mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
Add map for sproto
This commit is contained in:
@@ -16,6 +16,9 @@ struct sproto_type;
|
||||
#define SPROTO_TDOUBLE 3
|
||||
#define SPROTO_TSTRUCT 4
|
||||
|
||||
// container type
|
||||
#define SPROTO_TARRAY 0x80
|
||||
|
||||
// sub type of string (sproto_arg.extra)
|
||||
#define SPROTO_TSTRING_STRING 0
|
||||
#define SPROTO_TSTRING_BINARY 1
|
||||
@@ -46,9 +49,13 @@ struct sproto_arg {
|
||||
struct sproto_type *subtype;
|
||||
void *value;
|
||||
int length;
|
||||
int index; // array base 1
|
||||
int index; // array base 1, negative value indicates that it is a empty array
|
||||
int mainindex; // for map
|
||||
int extra; // SPROTO_TINTEGER: decimal ; SPROTO_TSTRING 0:utf8 string 1:binary
|
||||
|
||||
// When interpretd two fields struct as map, the following fields must not be NULL.
|
||||
const char *ktagname;
|
||||
const char *vtagname;
|
||||
};
|
||||
|
||||
typedef int (*sproto_callback)(const struct sproto_arg *args);
|
||||
|
||||
Reference in New Issue
Block a user