You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.8 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*===================================================================================================
Copyright(c) 2011 Siemens PLM Software Corp. All rights reserved.
Unpublished - All rights reserved
====================================================================================================
File description:
Filename : epm_register_handler.c
This file registers functions which are called when Teamcenter is being initialized
====================================================================================================
Date Name Description of Change
2011-8-21 Ray wei creation
$HISTORY$
==================================================================================================*/
#pragma warning (disable: 4819)
/**
* @headerfile tcua ͷ<>ļ<EFBFBD>
*/
#include <server_exits/user_server_exits.h>
#include <tccore/custom.h>
#include <epm/epm.h>
/**
* @headerfile standard c & cpp header files
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
/**
* @headerfile user's header files
*/
#include "epm_register_handler.h"
#include "epm_handler_common.h"
#include "util.h"
// Method and Workflow Handler
extern DLLAPI int CUST_init_module(int *decision, va_list args) {
int ifail = ITK_ok, n = 0;
char date_buf[80], *expire_date;
time_t now;
struct tm *p;
*decision = ALL_CUSTOMIZATIONS;
printf("==》register start\n");
ifail = EPM_register_rule_handler("jd_check_jz", "jd_check_jz",
(EPM_rule_handler_t)jd_check_jz);
if (ifail) {
printf("注册 jd_check_jz 失败\n");
}
else {
printf("注册 jd_check_jz 成功\n");
}
return ifail;
}
extern DLLAPI int USERSERVICE_custom_register_methods() {
int ifail = ITK_ok;
int argCount = 0,
returnArgType = 0,
* argList = NULL;
USER_function_t functionPoint;
//===========1 Uservice============
argCount = 2;
//处理当前服务的函数方法USERSEVICE_getProperties来源cust-uservice.h中声明方法
functionPoint = USERSEVICE_getProperties;
//手动开辟一块地址
argList = (int*)MEM_alloc(argCount * sizeof(int));
argList[0] = USERARG_TAG_TYPE;
argList[1] = USERARG_ARRAY_TYPE + USERARG_STRING_TYPE;
returnArgType = USERARG_STRING_TYPE;
//参数1服务名称
//参数2-functionPoint,:函数指针;
//参数3-argCount服务入参个数
//参数4-argList服务入参的参数类型
//参数5-returnArgType返回值类型
ITKCALL(ifail = USERSERVICE_register_method("USERSEVICE_getProperties", functionPoint, argCount, argList, returnArgType));
if (ifail == ITK_ok)
{
printf("USERVICE [USERSEVICE_getProperties] 注册成功!\n");
}
else
{
printf("USERVICE [USERSEVICE_getProperties] 注册失败!\n");
}
MEM_free(argList);
//===================2 Uservice=================================
return ifail;
}