|
Gateway C ABI
|
Plugin testing library. This library provides the the implementation of the GCJsonCallbacks to test configuration parsing of a plugin. Without this functionality, the plugin would have to mock every related json function, which would be cumbersome. More...
#include "json.h"Go to the source code of this file.
Functions | |
| GCJsonCallbacks | gcGetJsonCallbacks (const char *json_data) |
| Get the JSON callbacks from a JSON string. | |
| void | gcFreeJsonCallbacks (GCJsonCallbacks) |
| Free the JSON callbacks. | |
Plugin testing library. This library provides the the implementation of the GCJsonCallbacks to test configuration parsing of a plugin. Without this functionality, the plugin would have to mock every related json function, which would be cumbersome.
Each plugin is responsible for building and linking the testing library (which is implemented in Rust).
Linking the include files is highly recommended in order to keep it updated to the latest version. The include files are located in the include directory.
The library provides the following functions:
The return value of gcGetJsonCallbacks can be used to create the GCPluginInterface.
| void gcFreeJsonCallbacks | ( | GCJsonCallbacks | ) |
Free the JSON callbacks.
This function will free the JSON callbacks and the data field.
| callbacks | The JSON callbacks |
| GCJsonCallbacks gcGetJsonCallbacks | ( | const char * | json_data | ) |
Get the JSON callbacks from a JSON string.
This function will copy the JSON string and set it as the data field of the GCJsonCallbacks. The data can then be used by the various JSON callbacks.
Once the data is no longer needed, it should be freed using gcFreeJsonCallbacks.
| json_data | The JSON string |