SOUND4 IMPACT.CL Library [1.3.6]
Loading...
Searching...
No Matches
Classes | Functions
Client's JSon config interfacing

Communicate with the instance. More...

Classes

struct  impact_CClientInstance
 

Functions

struct impact_CClientInstanceimpact_NewClient (struct impact_CInstance *instance)
 
void impact_DeleteClient (struct impact_CClientInstance *client)
 
const char * impact_ProcessJson (struct impact_CClientInstance *client, const char *json_str, int *need_save)
 
void impact_FreeJsonAnswer (const char *json_str)
 
int impact_SaveState (struct impact_CInstance *instance)
 

Detailed Description

Allow low-level JSON configuration. see also JSON syntax

Function Documentation

◆ impact_DeleteClient()

void impact_DeleteClient ( struct impact_CClientInstance client)

Deletes a client

Parameters
clientthe client instance

◆ impact_FreeJsonAnswer()

void impact_FreeJsonAnswer ( const char *  json_str)

Free a JSON answer returned by impact_ProcessJson

Parameters
json_strthe JSON request

◆ impact_NewClient()

struct impact_CClientInstance * impact_NewClient ( struct impact_CInstance instance)

Creates a new client

Remarks
not needed if using a port for JSON socket in Update Management
Parameters
instancethe processing instance
Returns
A new client instance

◆ impact_ProcessJson()

const char * impact_ProcessJson ( struct impact_CClientInstance client,
const char *  json_str,
int *  need_save 
)

Process a JSON request

For syntax, see JSON syntax

Note
In all library, all char* are UTF-8 encoded
Attention
the return value needs to be freed with impact_FreeJsonAnswer
Parameters
clientthe client instance
json_strthe JSON request
need_saveon return will be 1 is saving is required (maybe delayed)
Returns
a JSON answer (to be freed with impact_FreeJsonAnswer)

◆ impact_SaveState()

int impact_SaveState ( struct impact_CInstance instance)

Save the current state

Needed when impact_ProcessJson returned with need_save to 1. However it can be postponed as much as wanted.

Remarks
Works only when update thread is running
Parameters
instancethe processing instance
Returns
0 if success, <0 on error