📄 icta_cfg.c
字号:
pstCurrentServer->stFeatures.bBlock2 = icTrue; else cfg_set_config_err(); }/************************************************************************//* cfgFeaturesBlock3 *//* found 'Block3' keyword *//************************************************************************/static ST_VOID cfgFeaturesBlock3 (ST_VOID) { if (pstCurrentServer) pstCurrentServer->stFeatures.bBlock3 = icTrue; else cfg_set_config_err(); }/************************************************************************//* cfgFeaturesBlock4 *//* found 'Block4' keyword *//************************************************************************/static ST_VOID cfgFeaturesBlock4 (ST_VOID) { if (pstCurrentServer) pstCurrentServer->stFeatures.bBlock4 = icTrue; else cfg_set_config_err(); }/************************************************************************//* cfgFeaturesBlock5 *//* found 'Block5' keyword *//************************************************************************/static ST_VOID cfgFeaturesBlock5 (ST_VOID) { if (pstCurrentServer) pstCurrentServer->stFeatures.bBlock5 = icTrue; else cfg_set_config_err(); }/************************************************************************//* cfgFeaturesBlock6 *//* found 'Block6' keyword *//************************************************************************/static ST_VOID cfgFeaturesBlock6 (ST_VOID) { if (pstCurrentServer) pstCurrentServer->stFeatures.bBlock6 = icTrue; else cfg_set_config_err(); }/************************************************************************//* cfgFeaturesBlock7 *//* found 'Block7' keyword *//************************************************************************/static ST_VOID cfgFeaturesBlock7 (ST_VOID) { if (pstCurrentServer) pstCurrentServer->stFeatures.bBlock7 = icTrue; else cfg_set_config_err(); }/************************************************************************//* cfgFeaturesBlock8 *//* found 'Block8' keyword *//************************************************************************/static ST_VOID cfgFeaturesBlock8 (ST_VOID) { if (pstCurrentServer) pstCurrentServer->stFeatures.bBlock8 = icTrue; else cfg_set_config_err(); }/************************************************************************//* cfgFeaturesBlock9 *//* found 'Block9' keyword *//************************************************************************/static ST_VOID cfgFeaturesBlock9 (ST_VOID) { if (pstCurrentServer) pstCurrentServer->stFeatures.bBlock9 = icTrue; else cfg_set_config_err(); }/************************************************************************//* cfgServerFeaturesEnd *//************************************************************************/static ST_VOID cfgServerFeaturesEnd (ST_VOID) { if (cfg_tbl_pop (1) != SD_SUCCESS) cfg_set_config_err (); }/************************************************************************//* cfgServerVarsBegin *//************************************************************************/static ST_VOID cfgServerVarsBegin (ST_VOID) { if (cfg_tbl_push (kwtblServerVars) != SD_SUCCESS) cfg_set_config_err (); }/************************************************************************//* cfgServerVarName *//* found 'Name' keyword, get the value *//************************************************************************/static ST_VOID cfgServerVarName (ST_VOID) {ST_CHAR *name = NULL; /* when you get a name, assume a new variable and allocate mem */ if ( (pstServerVar) && strlen(pstServerVar->varName) ) list_add_last ((ST_VOID **)&pstCurrentServer->variableList, pstServerVar); else if (pstServerVar) { chk_free(pstServerVar); pstServerVar = NULL; } pstServerVar = chk_calloc(1, sizeof(ICTA_VAR_INFO)); memset(pstServerVar, 0, sizeof(ICTA_VAR_INFO)); if ((name = cfg_get_string_ptr ()) != NULL) { strcpy(pstServerVar->varName, name); } else cfg_set_config_err (); }/************************************************************************//* cfgServerVarScope *//* found 'Scope' keyword, get the value *//************************************************************************/static ST_VOID cfgServerVarScope (ST_VOID) {ST_CHAR *name = NULL; if (((name = cfg_get_string_ptr ()) != NULL) && pstServerVar) { if (strcmp(name, "VMD") == 0) pstServerVar->varScope = IC_SCOPE_VMD; else if (strcmp(name, "DOM") == 0) pstServerVar->varScope = IC_SCOPE_DOMAIN; else cfg_set_config_err (); } else cfg_set_config_err (); }/************************************************************************//* cfgServerVarType *//* found 'Type' keyword, get the value *//************************************************************************/static ST_VOID cfgServerVarType (ST_VOID) {ST_CHAR *name = NULL;int typeConstant;ICTA_TYPE *pstAType; if (((name = cfg_get_string_ptr ()) != NULL) && pstServerVar) { typeConstant = findStdType(name); if (typeConstant != -1) { pstServerVar->iccpType = typeConstant; pstServerVar->bUserType = icFalse; } else { pstAType = findUserType(name); if (pstAType) { pstServerVar->bUserType = icTrue; pstServerVar->pstType = pstAType; pstServerVar->iccpType = IC_TYPE_USER_DEFINED; } else cfg_set_config_err (); } } else cfg_set_config_err (); }/************************************************************************//* cfgServerVarWriteable *//* found 'Writeable' keyword *//************************************************************************/static ST_VOID cfgServerVarWriteable (ST_VOID) { if (pstServerVar) pstServerVar->bWriteable = icTrue; else cfg_set_config_err(); }/************************************************************************//* cfgServerVarsEnd *//************************************************************************/static ST_VOID cfgServerVarsEnd (ST_VOID) { if ( (pstServerVar) && strlen(pstServerVar->varName) ) { list_add_last ((ST_VOID **)&pstCurrentServer->variableList, pstServerVar); pstServerVar = NULL; } else if (pstServerVar) { chk_free(pstServerVar); pstServerVar = NULL; } if (cfg_tbl_pop (1) != SD_SUCCESS) cfg_set_config_err (); }/************************************************************************//* cfgServerMsgBegin *//************************************************************************/static ST_VOID cfgServerMsgBegin (ST_VOID) { if (cfg_tbl_push (kwtblServerMsg) != SD_SUCCESS) cfg_set_config_err (); }/************************************************************************//* cfgServerMsgRef *//* found 'MsgRef' keyword, get the value *//************************************************************************/static ST_VOID cfgServerMsgRef (ST_VOID) {ST_INT16 sVal; /* when you get a msgRef, assume a new message and allocate mem */ if ( (pstServerMsg) && (pstServerMsg->nRef > 0) ) list_add_last ((ST_VOID **)&pstCurrentServer->infoMsgsList, pstServerMsg); else if (pstServerMsg) { chk_free(pstServerMsg); pstServerMsg = NULL; } pstServerMsg = chk_calloc(1, sizeof(ICTA_MSG_INFO)); memset(pstServerMsg, 0, sizeof(ICTA_MSG_INFO)); if (cfg_get_short ((ST_INT16 *) &sVal) == SD_SUCCESS) pstServerMsg->nRef = (icInt) sVal; else cfg_set_config_err(); }/************************************************************************//* cfgServerMsgScope *//* found 'Scope' keyword, get the value *//************************************************************************/static ST_VOID cfgServerMsgScope (ST_VOID) {ST_CHAR *name = NULL; if (((name = cfg_get_string_ptr ()) != NULL) && pstServerMsg) { if (strcmp(name, "VMD") == 0) pstServerMsg->scope = IC_SCOPE_VMD; else if (strcmp(name, "DOM") == 0) pstServerMsg->scope = IC_SCOPE_DOMAIN; else cfg_set_config_err (); } else cfg_set_config_err (); }/************************************************************************//* cfgServerMsgSize *//* found 'MaxSize' keyword, get the value *//************************************************************************/static ST_VOID cfgServerMsgSize (ST_VOID) {ST_INT16 sVal; if ( (cfg_get_short ((ST_INT16 *) &sVal) == SD_SUCCESS) && pstServerMsg) pstServerMsg->maxMsgSize = (icInt) sVal; else cfg_set_config_err(); }/************************************************************************//* cfgServerMsgEnd *//************************************************************************/static ST_VOID cfgServerMsgEnd (ST_VOID) { if ( (pstServerMsg) && (pstServerMsg->nRef > 0) ) { list_add_last ((ST_VOID **)&pstCurrentServer->infoMsgsList, pstServerMsg); pstServerMsg = NULL; } else if (pstServerMsg) { chk_free(pstServerMsg); pstServerMsg = NULL; } if (cfg_tbl_pop (1) != SD_SUCCESS) cfg_set_config_err (); }/************************************************************************//* cfgServerDeviceBegin *//************************************************************************/static ST_VOID cfgServerDeviceBegin (ST_VOID) { if (cfg_tbl_push (kwtblServerDevice) != SD_SUCCESS) cfg_set_config_err (); }/************************************************************************//* cfgServerDeviceName *//* found 'Name' keyword, get the value *//************************************************************************/static ST_VOID cfgServerDeviceName (ST_VOID) {ST_CHAR *name = NULL; /* when you get a name, assume a new device and allocate mem */ if ( (pstServerDevice) && strlen(pstServerDevice->name) ) list_add_last ((ST_VOID **)&pstCurrentServer->devicesList, pstServerDevice); else if (pstServerDevice) { chk_free(pstServerDevice); pstServerDevice = NULL; } pstServerDevice = chk_calloc(1, sizeof(ICTA_DEVICE)); memset(pstServerDevice, 0, sizeof(ICTA_DEVICE)); if ((name = cfg_get_string_ptr ()) != NULL) { strcpy(pstServerDevice->name, name); } else cfg_set_config_err (); }/************************************************************************//* cfgServerDeviceScope *//* found 'Scope' keyword, get the value *//************************************************************************/static ST_VOID cfgServerDeviceScope (ST_VOID) {ST_CHAR *name = NULL; if (((name = cfg_get_string_ptr ()) != NULL) && pstServerDevice) { if (strcmp(name, "VMD") == 0) pstServerDevice->scope = IC_SCOPE_VMD; else if (strcmp(name, "DOM") == 0) pstServerDevice->scope = IC_SCOPE_DOMAIN; else cfg_set_config_err (); } else cfg_set_config_err (); }/************************************************************************//* cfgServerDeviceType *//* found 'Type' keyword, get the value *//************************************************************************/static ST_VOID cfgServerDeviceType (ST_VOID) {ST_CHAR *name = NULL; if (((name = cfg_get_string_ptr ()) != NULL) && pstServerDevice) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -