45 typedef void* HAUTOPOOL;
47 enum ncsBindingDataTYPE{
56 #define SBPE_READERROR 1 //psrc cannot read 57 #define SBPE_WRITEERROR 2 //pdest cannot write 58 #define SBPE_MISSMATCH 3 //type miss match 60 typedef void (*NCS_SET_VALUE)(
void*
self, DWORD dst_v);
61 MGNCS_EXPORT
int ncsTransType(DWORD value,
int src_type,
int dest_type, NCS_SET_VALUE set_value,
void *
self);
67 MGNCS_EXPORT
int ncsTypeToInt(DWORD value,
int src_type);
69 #define ncsStrToInt(str) ncsTypeToInt((DWORD)(str), NCS_BT_STR) 70 #define ncsCharToInt(ch) (int)((char)(ch)) 72 MGNCS_EXPORT
int ncsTypeToChar(DWORD value,
int scr_type);
74 static inline int ncsStrToChar(DWORD str) {
77 return *((
const char*)(str));
80 #define ncsIntToChar(i) ((char)(i)) 92 MGNCS_EXPORT
void ncsResetAutoPool(HAUTOPOOL hPool);
93 MGNCS_EXPORT
void ncsFreeAutoPool(HAUTOPOOL hPool);
95 MGNCS_EXPORT
char* ncsTypeToAutoString(DWORD value,
int src_type, HAUTOPOOL hAutoPool);
97 #define _BEGIN_AUTO_STR_EX(size) { HAUTOPOOL __local_auto_pool__ = ncsCreateAutoPool(size); 98 #define _BEGIN_AUTO_STR _BEGIN_AUTO_STR_EX(-1) 100 #define _END_AUTO_STR ncsFreeAutoPool(__local_auto_pool__); } 102 #define _RESET_AUTO_STR ncsResetAutoPool(__local_auto_pool__); 104 #define _AUTO_STR(data,src_type) ((char*)ncsTypeToAutoString((data), (src_type), __local_auto_pool__)) 106 #define _RET_AUTO_STR do{ ncsFreeAutoPool(__local_auto_pool__); return; }while(0) 107 #define _RETV_AUTO_STR(ret) do { ncsFreeAutoPool(__local_auto_pool__); return (ret); }while(0) MGNCS_EXPORT char * ncsTypeToString(DWORD value, int src_type)
MGNCS_EXPORT int ncsTypeToInt(DWORD value, int src_type)
MGNCS_EXPORT HAUTOPOOL ncsCreateAutoPool(int size)