123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #ifndef dmap_parser_h
- #define dmap_parser_h
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <stdint.h>
- #include <stdlib.h>
- #include <sys/types.h>
- #define DMAP_VERSION_MAJOR 1
- #define DMAP_VERSION_MINOR 2
- #define DMAP_VERSION_PATCH 1
- #define DMAP_VERSION (DMAP_VERSION_MAJOR * 1000000 + \
- DMAP_VERSION_MINOR * 1000 + \
- DMAP_VERSION_PATCH)
- typedef void (*dmap_dict_cb) (void *ctx, const char *code, const char *name);
- typedef void (*dmap_int32_cb) (void *ctx, const char *code, const char *name, int32_t value);
- typedef void (*dmap_int64_cb) (void *ctx, const char *code, const char *name, int64_t value);
- typedef void (*dmap_uint32_cb) (void *ctx, const char *code, const char *name, uint32_t value);
- typedef void (*dmap_uint64_cb) (void *ctx, const char *code, const char *name, uint64_t value);
- typedef void (*dmap_data_cb) (void *ctx, const char *code, const char *name, const char *buf, size_t len);
- typedef struct {
-
- dmap_dict_cb on_dict_start;
- dmap_dict_cb on_dict_end;
-
- dmap_int32_cb on_int32;
- dmap_int64_cb on_int64;
- dmap_uint32_cb on_uint32;
- dmap_uint64_cb on_uint64;
- dmap_uint32_cb on_date;
- dmap_data_cb on_string;
- dmap_data_cb on_data;
-
- void *ctx;
- } dmap_settings;
- int dmap_version(void);
- const char *dmap_version_string(void);
- const char *dmap_name_from_code(const char *code);
- int dmap_parse(const dmap_settings *settings, const char *buf, size_t len);
- #ifdef __cplusplus
- }
- #endif
- #endif
|