forked from jasonweiyi/XAPI2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApiHeader.h
More file actions
23 lines (18 loc) · 856 Bytes
/
ApiHeader.h
File metadata and controls
23 lines (18 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef _API_HEADER_H_
#define _API_HEADER_H_
#include "CrossPlatform.h"
#ifdef __cplusplus
extern "C" {
#endif
//用于分隔输入的合列表,与前置机地址列表,所以不能出现“:”一类的
#define _QUANTBOX_SEPS_ ";"
DLL_PUBLIC void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3);
#ifdef __cplusplus
}
#endif
// 长度不够时,后面会填0,但长度超出会写出界
#define SAFE_STRNCPY(x,y) if(y) strncpy_s(x, y, sizeof(x));x[sizeof(x)-1]=0;
#define SAFE_STRNCAT(x,y) if(y) strncat_s(x, y, sizeof(x));x[sizeof(x)-1]=0;
// 有循环问题,不能乱用,比如abc%s,结果将变成abcabc
#define SAFE_SNPRINTF(x, ...) _snprintf_s(x,sizeof(x),##__VA_ARGS__);x[sizeof(x)-1]=0;
#endif//end of _API_HEADER_H_