59 lines
1.3 KiB
C
59 lines
1.3 KiB
C
|
|
#ifndef USER_CERT_PRESENT
|
|||
|
|
#define USER_CERT_PRESENT
|
|||
|
|
|
|||
|
|
#include "type.h"
|
|||
|
|
|
|||
|
|
extern const char *ca_cert;
|
|||
|
|
extern const char *client_cert;
|
|||
|
|
extern const char *client_key;
|
|||
|
|
extern const char *http_header_fmt;
|
|||
|
|
extern const char *json_data;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ΪJSON<4F><4E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
char *JSON_data();
|
|||
|
|
void json_initialize();
|
|||
|
|
void json_finish();
|
|||
|
|
void json_new_object();
|
|||
|
|
void json_end_object();
|
|||
|
|
void json_new_array(char *key);
|
|||
|
|
void json_end_array();
|
|||
|
|
void json_new_intValue(char *key, int val);
|
|||
|
|
void json_new_doubleValue(char *key, double val);
|
|||
|
|
void json_new_stringValue(char *key, char *val);
|
|||
|
|
void json_new_boolValue(char *key, uint32_t val);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>ΪJSON<4F><4E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<F2B5A5B5>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƕ<EFBFBD>ף<EFBFBD><D7A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ֧<D6BB><D6A7><EFBFBD>ַ<EFBFBD><D6B7>͡<EFBFBD><CDA1><EFBFBD><EFBFBD>ͺ<CDBA><CDB8><EFBFBD><EFBFBD>ͣ<EFBFBD>
|
|||
|
|
#define JSON_FIELD_COUNT (25)
|
|||
|
|
#define JSON_NAME_LENGTH (19)
|
|||
|
|
#define JSON_VAL_LENGTH (29)
|
|||
|
|
|
|||
|
|
#define JSON_TYPE_NULL (0)
|
|||
|
|
#define JSON_TYPE_INTEGER (1)
|
|||
|
|
#define JSON_TYPE_FLOAT (2)
|
|||
|
|
#define JSON_TYPE_STRING (3)
|
|||
|
|
|
|||
|
|
#pragma pack(push, 1)
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
char name[JSON_NAME_LENGTH + 1]; // \0
|
|||
|
|
int type;
|
|||
|
|
union
|
|||
|
|
{
|
|||
|
|
char val[JSON_VAL_LENGTH + 2 + 1]; // \"\"\0
|
|||
|
|
char s[JSON_VAL_LENGTH + 1]; // \0
|
|||
|
|
struct
|
|||
|
|
{
|
|||
|
|
long i;
|
|||
|
|
float f;
|
|||
|
|
};
|
|||
|
|
};
|
|||
|
|
} JSON_field;
|
|||
|
|
|
|||
|
|
#pragma pack(pop)
|
|||
|
|
|
|||
|
|
extern JSON_field JSON_Record[JSON_FIELD_COUNT];
|
|||
|
|
int JSON_Parse_Record(char **src);
|
|||
|
|
|
|||
|
|
#endif
|