Gateway C ABI
Loading...
Searching...
No Matches
json.h
Go to the documentation of this file.
1#ifndef GC_JSON_H
2#define GC_JSON_H
3#include <stdbool.h>
4#include <stdint.h>
5
20
30
37{
40
42 const void* ptr;
43};
45typedef const char* GCString;
46
47typedef bool (*tJsonObjectGetBool)(const GCJsonObject obj, GCResultCallback* result);
48typedef int64_t (*tJsonObjectGetInt)(const GCJsonObject obj, GCResultCallback* result);
49typedef double (*tJsonObjectGetDouble)(const GCJsonObject obj, GCResultCallback* result);
50typedef char* (*tJsonObjectGetString)(const GCJsonObject obj, GCResultCallback* result);
51typedef char* (*tJsonObjectSerialize)(const GCJsonObject obj, GCResultCallback* result);
52typedef const GCJsonObject (*tJsonObjectGetArrayIdx)(const GCJsonObject obj, int64_t idx, GCResultCallback* result);
53typedef const int64_t (*tJsonObjectGetArrayLength)(const GCJsonObject obj, GCResultCallback* result);
54typedef const GCJsonObject (*tJsonObjectGetObjectField)(const GCJsonObject obj, const char* fieldName,
55 GCResultCallback* result);
56typedef void (*tFreeSring)(GCString);
57
157typedef const struct sGCJsonCallbacks* GCJsonCallbacks;
158#endif // GC_JSON_H
bool(* tJsonObjectGetBool)(const GCJsonObject obj, GCResultCallback *result)
Definition json.h:47
enum eGCJsonType GCJsonType
Definition json.h:19
eGCJsonType
The JSON types available.
Definition json.h:10
@ GC_JSON_TYPE_STRING
Definition json.h:15
@ GC_JSON_TYPE_DOUBLE
Definition json.h:14
@ GC_JSON_TYPE_NULL
Definition json.h:11
@ GC_JSON_TYPE_BOOL
Definition json.h:12
@ GC_JSON_TYPE_OBJECT
Definition json.h:17
@ GC_JSON_TYPE_INT
Definition json.h:13
@ GC_JSON_TYPE_ARRAY
Definition json.h:16
const struct sGCJsonCallbacks * GCJsonCallbacks
Definition json.h:157
const int64_t(* tJsonObjectGetArrayLength)(const GCJsonObject obj, GCResultCallback *result)
Definition json.h:53
const GCJsonObject(* tJsonObjectGetObjectField)(const GCJsonObject obj, const char *fieldName, GCResultCallback *result)
Definition json.h:54
int64_t(* tJsonObjectGetInt)(const GCJsonObject obj, GCResultCallback *result)
Definition json.h:48
const char * GCString
Definition json.h:45
double(* tJsonObjectGetDouble)(const GCJsonObject obj, GCResultCallback *result)
Definition json.h:49
struct sGCJsonObject GCJsonObject
Definition json.h:44
enum eResultCallback GCResultCallback
Definition json.h:29
eResultCallback
The result of a json callback.
Definition json.h:25
@ GC_JSON_ERROR
Definition json.h:27
@ GC_JSON_OK
Definition json.h:26
void(* tFreeSring)(GCString)
Definition json.h:56
const GCJsonObject(* tJsonObjectGetArrayIdx)(const GCJsonObject obj, int64_t idx, GCResultCallback *result)
Definition json.h:52
The JSON configuration data and parsing callbacks.
Definition json.h:65
tJsonObjectGetInt getInt
Parse an integer from a JSON object.
Definition json.h:80
tJsonObjectGetObjectField getObjectField
Get a field from a JSON object.
Definition json.h:128
tJsonObjectGetDouble getDouble
Parse a double from a JSON object.
Definition json.h:88
tJsonObjectGetBool getBool
Parse a boolean from a JSON object.
Definition json.h:72
tJsonObjectGetArrayIdx getArrayIdx
Get an element from a JSON array.
Definition json.h:109
tFreeSring freeString
Free a string.
Definition json.h:148
tJsonObjectSerialize getObjectSerialized
Serialize a JSON object to a string.
Definition json.h:139
const GCJsonObject data
The plugin specific configuration.
Definition json.h:155
tJsonObjectGetArrayLength getArrayLength
Get the length of a JSON array.
Definition json.h:118
tJsonObjectGetString getString
Parse a string from a JSON object.
Definition json.h:99
The JSON object.
Definition json.h:37
GCJsonType type
The type of the JSON object.
Definition json.h:39
const void * ptr
The pointer to the underlying JSON object.
Definition json.h:42
bool(* tJsonObjectGetBool)(const GCJsonObject obj, GCResultCallback *result)
Definition json.h:47
char *(* tJsonObjectSerialize)(const GCJsonObject obj, GCResultCallback *result)
Definition json.h:51
const int64_t(* tJsonObjectGetArrayLength)(const GCJsonObject obj, GCResultCallback *result)
Definition json.h:53
char *(* tJsonObjectGetString)(const GCJsonObject obj, GCResultCallback *result)
Definition json.h:50
const GCJsonObject(* tJsonObjectGetObjectField)(const GCJsonObject obj, const char *fieldName, GCResultCallback *result)
Definition json.h:54
int64_t(* tJsonObjectGetInt)(const GCJsonObject obj, GCResultCallback *result)
Definition json.h:48
double(* tJsonObjectGetDouble)(const GCJsonObject obj, GCResultCallback *result)
Definition json.h:49
void(* tFreeSring)(GCString)
Definition json.h:56
const GCJsonObject(* tJsonObjectGetArrayIdx)(const GCJsonObject obj, int64_t idx, GCResultCallback *result)
Definition json.h:52