📄 mms_vvar.h
字号:
/* a pointer to an array of these structures are passed into the *//* 'mv_info_req' function */struct mv_info_req_info { ST_CHAR *data_ptr; /* Source data buffer */ NAMED_TYPE *type; /* pointer to associated type */ ST_BOOLEAN alt_acc_pres; /* set SD_TRUE if Alt Access is present */ ST_BOOLEAN alt_acc_data_packed;/* set SD_TRUE if local data is packed */ ALT_ACCESS alt_acc; /* Alternate Access specification */ };typedef struct mv_info_req_info MV_INFO_REQ_INFO;ST_RET mv_info (ST_INT chan, OBJECT_NAME *var, OBJECT_NAME *type, ST_CHAR *src);ST_RET mv_infovars (ST_INT chan, ST_INT num_vars, MV_VARDESC *vminfo);ST_RET mv_info_report (ST_INT chan, VAR_ACC_SPEC *req, ST_INT num_var, MV_INFO_REQ_INFO *vminfo);ST_RET mv_info_nvlist (ST_INT chan, OBJECT_NAME *obj);ST_RET ms_extract_info_data (MMSREQ_IND *ind, ST_INT index, NAMED_TYPE *type, ST_CHAR *dest, ST_BOOLEAN alt_acc_packed);ST_RET ms_extract_inf_data (MMSREQ_IND *indptr, ST_INT i, NAMED_TYPE *type, ST_CHAR *dest, ST_BOOLEAN alt_acc_packed, ALT_ACCESS *alt_acc_ptr);/************************************************************************/OBJECT_NAME *ms_extract_varname (ST_CHAR *reqinfo, ST_INT op, ST_INT indx);/************************************************************************//************************************************************************/#endif /* end of MMS_LITE not defined *//************************************************************************//************************************************************************/#define MMS_EASE_BUILDER 0#define UNKNOWN_BUILDER 1extern ST_INT ms_req_bld_id;extern ST_INT ms_resp_bld_id;ST_RET ms_init_va_size (ST_INT chan, ST_UCHAR spec_in_rslt, ST_INT16 var_acc_tag, OBJECT_NAME *vl_name, ST_LONG *req_size_out, ST_LONG *resp_size_out);#ifndef MMS_LITEST_RET ms_va_size (ST_INT op, ST_UCHAR spec_in_rslt, ST_INT16 var_acc_tag, VARIABLE_LIST *vl, NAMED_TYPE *type, ST_LONG *req_size_out, ST_LONG *resp_size_out);#elseST_RET ms_va_size (ST_INT op, ST_UCHAR spec_in_rslt, ST_INT16 var_acc_tag, VARIABLE_LIST *vl_ptr, ST_INT type_id, ST_LONG *req_size, ST_LONG *resp_size);#endif/************************************************************************//************************************************************************/extern ST_BOOLEAN m_calc_rt_size; /* flag to calculate num rt blocks */ /* in ms_asn1_to_runtime */extern ST_INT m_rt_type_limit; /* max num of runtime blks per def */#ifndef MMS_LITEST_INT ms_get_blocked_len (NAMED_TYPE *type);#endifST_INT ms_get_blocked_length (SD_CONST RUNTIME_TYPE *rt, ST_INT num_rt);ST_INT ms_asn1_to_runtime (ST_UCHAR *asn1, ST_UINT asn1len, RUNTIME_TYPE *dest, ST_INT num_rt_dest);ST_RET ms_runtime_to_asn1 (ASN1_ENC_CTXT *aCtx, SD_CONST RUNTIME_TYPE *rt, ST_INT num_rt);ST_UCHAR *ms_mk_asn1_type (ST_INT *asn1_len, ST_UCHAR *asn1_buf, ST_CHAR *tdl);ST_VOID ms_log_runtime (SD_CONST RUNTIME_TYPE *rt, ST_INT num_rt);ST_CHAR *ms_asn1_to_tdl (ST_UCHAR *asn1_ptr, ST_INT asn1_len, ST_INT max_tdl_len);ST_INT ms_runtime_to_tdl (SD_CONST RUNTIME_TYPE *rt, ST_INT rt_num, ST_CHAR *tdl_buf, ST_INT max_tdl_len);ST_RET ms_rt_to_typedef (ST_CHAR *typedefName, SD_CONST RUNTIME_TYPE *rt, ST_INT numRt, ST_CHAR *dest, ST_INT destSize);ST_INT ms_runtime_create (ST_UCHAR *asn1_data, ST_UINT asn1_len, RUNTIME_TYPE **pp_rt_table, ST_INT max_num_rt);ST_VOID ms_runtime_destroy (RUNTIME_TYPE *rt_table, ST_INT num_rt);/************************************************************************//* ms_comp_name_find *//* These macros find the component name in a runtime type structure. *//* There are different macros for different RUNTIME_TYPE structures. *//* Macro argument = ptr to RUNTIME_TYPE struct. *//* RETURN: pointer to component name string *//************************************************************************/#if defined(USE_RT_TYPE_2)/* rt->comp_name_ptr = pointer to string *//* NOTE: ptr may be NULL. If so return empty string (i.e. "") instead *//* of NULL. Caller might not handle NULL. */#define ms_comp_name_find(rt) ((rt)->comp_name_ptr ? (rt)->comp_name_ptr : "")#define ms_comp_name_pres(rt) ((rt)->comp_name_ptr ? SD_TRUE : SD_FALSE)#elif defined(USE_RT_TYPE_3)/* rt->name_index = index to global array of strings "mvlRtNames" */#define ms_comp_name_find(rt) (mvlRtNames[(rt)->name_index])#define ms_comp_name_pres(rt) ((rt)->name_index > 0 ? SD_TRUE : SD_FALSE)#else /* Default *//* rt->name = character array. */#define ms_comp_name_find(rt) ((rt)->name)#define ms_comp_name_pres(rt) ((rt)->name[0] != 0 ? SD_TRUE : SD_FALSE)#endif /* Default *//************************************************************************//* VIRTUAL MACHINE ASN.1 TO?FROM LOCAL REPRESENTATION FUNCTIONS *//* These functions are used to translate ASN.1 encoded data to/from *//* local format *//************************************************************************/#ifndef MMS_LITEST_RET ms_asn1_to_locl (NAMED_TYPE *type, ST_UCHAR *asn1, ST_INT asn1_len, ST_CHAR *dest);ST_RET ms_locl_to_asn1 (ASN1_ENC_CTXT *aCtx, NAMED_TYPE *type, ST_CHAR *src);#endif/* These 2 are Re-entrant functions. Based on ASN1R tools. */ST_RET ms_asn1_to_local (SD_CONST RUNTIME_TYPE *rt, ST_INT num_rt, ST_UCHAR *asn1, ST_INT asn1_len, ST_CHAR *dest);ST_RET ms_local_to_asn1 (ASN1_ENC_CTXT *aCtx, SD_CONST RUNTIME_TYPE *rt_head, ST_INT rt_num, ST_CHAR *dptr);ST_UCHAR *ms_local_to_asn1_easy (SD_CONST RUNTIME_TYPE *rt_head, ST_INT rt_num, ST_CHAR *dptr, ST_UCHAR *asn1Buf, ST_INT asn1BufLen, ST_INT *asn1LenOut);/* Index definitions into the alignment table */#define ARRSTRT_ALGN 0#define ARREND_ALGN 1#define STRSTRT_ALGN 2#define STREND_ALGN 3#define INT8_ALGN 4#define INT16_ALGN 5#define INT32_ALGN 6#define INT64_ALGN 7#define FLOAT_ALGN 8#define DOUBLE_ALGN 9#define OCT_ALGN 10#define BOOL_ALGN 11#define BCD1_ALGN 12#define BCD2_ALGN 13#define BCD4_ALGN 14#define BIT_ALGN 15#define VIS_ALGN 16#define NUM_ALGN_TYPES 17extern SD_CONST ST_INT *m_data_algn_tbl;extern SD_CONST ST_INT m_packed_data_algn_tbl[NUM_ALGN_TYPES];extern SD_CONST ST_INT m_def_data_algn_tbl[NUM_ALGN_TYPES];#define M_STRSTART_MODE_NONE 0#define M_STRSTART_MODE_FIRST 1#define M_STRSTART_MODE_LARGEST 2extern ST_INT m_struct_start_algn_mode;#define M_STREND_MODE_NONE 0#define M_STREND_MODE_LARGEST 1extern ST_INT m_struct_end_algn_mode;/* User defined runtime type post processing function */extern ST_VOID (*u_rt_type_process) (SD_CONST RUNTIME_TYPE *rt, ST_INT num_rt);/************************************************************************//************************************************************************//* For encoding and decoding 'alternateAccess', the outer constructor *//* usually has a value of 5. If a different value is required (for *//* scattered access, for instance), this value can be modified. *//* Used in both encoding and decode of alternateAccess */extern ST_INT16 m_alt_acc_outer_tag;/* When decoding an ASN.1 alternateAccess, this variable determines the *//* size of the table that is allocated for the decoded AA (and so *//* limits the complexity of the alternate access that can be handled *//* The default value is 50. */extern ST_INT m_max_dec_aa;/* This variable is the 'high water' mark of how many AA were actually *//* required. This can be used to tune memory usage if desired. */extern ST_INT m_hw_dec_aa;/* When performing ASN1 <-> local data format, the runtime type is *//* 'unrolled', and one element is required for each data element and *//* structure/array start/end. This variable determines the size of the *//* of the table that is allocated for this operation (and so limits the *//* size and complexity of the data types that can be handled. *//* The default value is 1000. */extern ST_INT m_max_rt_aa_ctrl;/* This variable is the 'high water' mark of how many elements were *//* actually required for m_max_rt_aa_ctrl. This can be used to tune *//* memory usage if desired. */extern ST_INT m_hw_rt_aa_ctrl;/* This variable is used to determine whether the local data format is *//* in 'packed type' or 'original type' form. Used in all conversions *//* to/from local data form when the AA_DATA library is used. *//* Temporarily set to SD_FALSE for the non-AA data conversion functions. */extern ST_BOOLEAN m_alt_acc_packed;/************************************************************************/extern ST_RET (*ms_asn1_data_to_runtime_fun) (RUNTIME_TYPE **tptr, ST_INT *t_len, ST_UCHAR *asn1ptr, ST_INT asn1_len);ST_RET ms_asn1_data_to_runtime (RUNTIME_TYPE **tptr, ST_INT *t_len, ST_UCHAR *asn1ptr, ST_INT asn1_len);ST_RET ms_asn1_data_to_locl (ST_UCHAR *asn1_data, ST_INT asn1_data_len, ST_VOID **data_dest, ST_INT *data_dest_len, RUNTIME_TYPE **rt, ST_INT *t_len); ST_VOID ms_rt_size_calc (RUNTIME_TYPE *rt_head, ST_INT rt_num);/************************************************************************//* ARBITRARY DATA HANDLING *//************************************************************************/typedef struct m_arb_data_ctrl { ST_RET (*arrStart) (RT_AA_CTRL *rtaa); ST_RET (*arrEnd) (RT_AA_CTRL *rtaa); ST_RET (*strStart) (RT_AA_CTRL *rtaa); ST_RET (*strEnd) (RT_AA_CTRL *rtaa); ST_RET (*int8) (ST_INT8 *data_dest, RT_AA_CTRL *rtaa); ST_RET (*int16) (ST_INT16 *data_dest, RT_AA_CTRL *rtaa); ST_RET (*int32) (ST_INT32 *data_dest, RT_AA_CTRL *rtaa);#ifdef INT64_SUPPORT ST_RET (*int64) (ST_INT64 *data_dest, RT_AA_CTRL *rtaa);#endif ST_RET (*uint8) (ST_UINT8 *data_dest, RT_AA_CTRL *rtaa); ST_RET (*uint16) (ST_UINT16 *data_dest, RT_AA_CTRL *rtaa); ST_RET (*uint32) (ST_UINT32 *data_dest, RT_AA_CTRL *rtaa);#ifdef INT64_SUPPORT ST_RET (*uint64) (ST_UINT64 *data_dest, RT_AA_CTRL *rtaa);#endif ST_RET (*flt) (ST_FLOAT *data_dest, RT_AA_CTRL *rtaa); ST_RET (*dbl) (ST_DOUBLE *data_dest, RT_AA_CTRL *rtaa); ST_RET (*oct) (ST_UCHAR *data_dest, RT_AA_CTRL *rtaa); ST_RET (*booln) (ST_BOOLEAN *data_dest, RT_AA_CTRL *rtaa); ST_RET (*bcd1) (ST_INT8 *data_dest, RT_AA_CTRL *rtaa); ST_RET (*bcd2) (ST_INT16 *data_dest, RT_AA_CTRL *rtaa); ST_RET (*bcd4) (ST_INT32 *data_dest, RT_AA_CTRL *rtaa); ST_RET (*bs) (ST_UCHAR *data_dest, RT_AA_CTRL *rtaa); ST_RET (*vis) (ST_CHAR *data_dest, RT_AA_CTRL *rtaa); ST_RET (*bt4) (ST_INT32 *data_dest, RT_AA_CTRL *rtaa); ST_RET (*bt6) (ST_INT32 *data_dest, RT_AA_CTRL *rtaa); ST_RET (*gt) (time_t *data_dest, RT_AA_CTRL *rtaa); ST_RET (*utc) (MMS_UTC_TIME *data_dest, RT_AA_CTRL *rtaa); } M_ARB_DATA_CTRL;ST_RET ms_process_arb_data (ST_CHAR *data_base, SD_CONST RUNTIME_TYPE *rt_head, ST_INT rt_num, ST_BOOLEAN alt_acc_pres, ST_BOOLEAN alt_acc_packed, ALT_ACCESS *alt_acc, M_ARB_DATA_CTRL *ac);#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -