base64.h
#ifndef _BASE64_H
#define _BASE64_H#include <stdint.h>
int bin_to_b64_nopad(const uint8_t * in, int size, char * out, int max_len);
int b64_to_bin_nopad(const char * in, int size, uint8_t * out, int max_len);
int bin_to_b64(const uint8_t * in, int size, char * out, int max_len);
int b64_to_bin(const char * in, int size, uint8_t * out, int max_len);#endif
cJSON.h
#ifndef cJSON__h
#define cJSON__h#ifdef __cplusplus
extern "C"
{
#endif/* cJSON Types: */
#define cJSON_False 0
#define cJSON_True 1
#define cJSON_NULL 2
#define cJSON_Number 3
#define cJSON_String 4
#define cJSON_Array 5
#define cJSON_Object 6
#define cJSON_IsReference 256
#define cJSON_StringIsConst 512/* The cJSON structure: */
typedef struct cJSON {
struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */int type; /* The type of the item, as above. */
char *valuestring; /* The item's string, if type==cJSON_String */
int valueint; /* The item's number, if type==cJSON_Number */
double valuedouble; /* The item's number, if type==cJSON_Number */char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
} cJSON;typedef struct cJSON_Hooks {
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
} cJSON_Hooks;/* Supply malloc, realloc and free functions to cJSON */
extern void cJSON_InitHooks(cJSON_Hooks* hooks);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
/*提供一个JSON块,然后返回一个可以查询的cJSON对象。完成后调用cJSON_Delete。*/
extern cJSON *cJSON_Parse(const char *value);/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */
/*将cJSON实体呈现为用于传输/存储的文本。完成后释放char*。*/
extern char *cJSON_Print(cJSON *item);
/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */
extern char *cJSON_PrintUnformatted(cJSON *item);
/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */
extern char *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt);
/* Delete a cJSON entity and all subentities. */
/*删除一个cJSON实体和所有子实体。*/
extern void cJSON_Delete(cJSON *c);/* Returns the number of items in an array (or object). */
extern int cJSON_GetArraySize(cJSON *array);
/* Retrieve item number "item" from array "array"