Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
dataio_json.h File Reference
#include <jansson.h>
#include "bitvector.h"
#include "support.h"
#include "connection.h"

Go to the source code of this file.

Data Structures

struct  json_data_out
 

Macros

#define DIO_BV_GET(pdin, location, bv)
 
#define DIO_GET(f, d, l, ...)    dio_get_##f##_json(pc, d, l, ## __VA_ARGS__)
 
#define DIO_BV_PUT(pdout, location, bv)    dio_put_memory_json((pdout), location, (bv).vec, sizeof((bv).vec))
 
#define DIO_PUT(f, d, l, ...)    dio_put_##f##_json(d, l, ## __VA_ARGS__)
 

Functions

bool dio_get_type_json (struct data_in *din, enum data_type type, int *dest) fc__attribute((nonnull(3)))
 
bool dio_get_uint8_json (struct connection *pc, struct data_in *din, const struct plocation *location, int *dest)
 
bool dio_get_uint16_json (struct connection *pc, struct data_in *din, const struct plocation *location, int *dest)
 
bool dio_get_uint32_json (struct connection *pc, struct data_in *din, const struct plocation *location, int *dest)
 
bool dio_get_sint8_json (struct connection *pc, struct data_in *din, const struct plocation *location, int *dest)
 
bool dio_get_sint16_json (struct connection *pc, struct data_in *din, const struct plocation *location, int *dest)
 
bool dio_get_sint32_json (struct connection *pc, struct data_in *din, const struct plocation *location, int *dest)
 
bool dio_get_bool8_json (struct connection *pc, struct data_in *din, const struct plocation *location, bool *dest)
 
bool dio_get_bool32_json (struct connection *pc, struct data_in *din, const struct plocation *location, bool *dest)
 
bool dio_get_ufloat_json (struct connection *pc, struct data_in *din, const struct plocation *location, float *dest, int float_factor)
 
bool dio_get_sfloat_json (struct connection *pc, struct data_in *din, const struct plocation *location, float *dest, int float_factor)
 
bool dio_get_memory_json (struct connection *pc, struct data_in *din, struct plocation *location, void *dest, size_t dest_size)
 
bool dio_get_string_json (struct connection *pc, struct data_in *din, const struct plocation *location, char *dest, size_t max_dest_size)
 
bool dio_get_estring_json (struct connection *pc, struct data_in *din, const struct plocation *location, char *dest, size_t max_dest_size)
 
bool dio_get_cm_parameter_json (struct connection *pc, struct data_in *din, struct plocation *location, struct cm_parameter *param)
 
bool dio_get_worklist_json (struct connection *pc, struct data_in *din, struct plocation *location, struct worklist *pwl)
 
bool dio_get_unit_order_json (struct connection *pc, struct data_in *din, struct plocation *location, struct unit_order *order)
 
bool dio_get_requirement_json (struct connection *pc, struct data_in *din, const struct plocation *location, struct requirement *preq)
 
bool dio_get_action_probability_json (struct connection *pc, struct data_in *din, const struct plocation *location, struct act_prob *prob)
 
bool dio_get_uint8_vec8_json (struct connection *pc, struct data_in *din, const struct plocation *location, int **values, int stop_value)
 
bool dio_get_uint16_vec8_json (struct connection *pc, struct data_in *din, const struct plocation *location, int **values, int stop_value)
 
int dio_put_farray_json (struct json_data_out *dout, const struct plocation *location, int size)
 
int dio_put_type_json (struct json_data_out *dout, enum data_type type, const struct plocation *location, int value)
 
int dio_put_uint8_json (struct json_data_out *dout, const struct plocation *location, int value)
 
int dio_put_sint8_json (struct json_data_out *dout, const struct plocation *location, int value)
 
int dio_put_uint16_json (struct json_data_out *dout, const struct plocation *location, int value)
 
int dio_put_sint16_json (struct json_data_out *dout, const struct plocation *location, int value)
 
int dio_put_uint32_json (struct json_data_out *dout, const struct plocation *location, int value)
 
int dio_put_sint32_json (struct json_data_out *dout, const struct plocation *location, int value)
 
int dio_put_bool8_json (struct json_data_out *dout, const struct plocation *location, bool value)
 
int dio_put_bool32_json (struct json_data_out *dout, const struct plocation *location, bool value)
 
int dio_put_ufloat_json (struct json_data_out *dout, const struct plocation *location, float value, int float_factor)
 
int dio_put_sfloat_json (struct json_data_out *dout, const struct plocation *location, float value, int float_factor)
 
int dio_put_memory_json (struct json_data_out *dout, struct plocation *location, const void *value, size_t size)
 
int dio_put_string_json (struct json_data_out *dout, const struct plocation *location, const char *value)
 
int dio_put_estring_json (struct json_data_out *dout, const struct plocation *location, const char *value)
 
int dio_put_cm_parameter_json (struct json_data_out *dout, struct plocation *location, const struct cm_parameter *order)
 
int dio_put_unit_order_json (struct json_data_out *dout, struct plocation *location, const struct unit_order *order)
 
int dio_put_worklist_json (struct json_data_out *dout, struct plocation *location, const struct worklist *pwl)
 
int dio_put_requirement_json (struct json_data_out *dout, const struct plocation *location, const struct requirement *preq)
 
int dio_put_action_probability_json (struct json_data_out *dout, const struct plocation *location, const struct act_prob *prob)
 
int dio_put_uint8_vec8_json (struct json_data_out *dout, const struct plocation *location, int *values, int stop_value)
 
int dio_put_uint16_vec8_json (struct json_data_out *dout, const struct plocation *location, int *values, int stop_value)
 

Macro Definition Documentation

◆ DIO_BV_GET

#define DIO_BV_GET (   pdin,
  location,
  bv 
)
Value:
dio_get_memory_json(pc, pdin, location, \
(bv).vec, sizeof((bv).vec))
char * incite_cost
Definition comments.c:75
bool dio_get_memory_json(struct connection *pc, struct data_in *din, struct plocation *location, void *dest, size_t dest_size)

Definition at line 100 of file dataio_json.h.

◆ DIO_BV_PUT

#define DIO_BV_PUT (   pdout,
  location,
  bv 
)     dio_put_memory_json((pdout), location, (bv).vec, sizeof((bv).vec))

Definition at line 171 of file dataio_json.h.

◆ DIO_GET

#define DIO_GET (   f,
  d,
  l,
  ... 
)     dio_get_##f##_json(pc, d, l, ## __VA_ARGS__)

Definition at line 104 of file dataio_json.h.

◆ DIO_PUT

#define DIO_PUT (   f,
  d,
  l,
  ... 
)     dio_put_##f##_json(d, l, ## __VA_ARGS__)

Definition at line 174 of file dataio_json.h.

Function Documentation

◆ dio_get_action_probability_json()

bool dio_get_action_probability_json ( struct connection pc,
struct data_in din,
const struct plocation location,
struct act_prob prob 
)

◆ dio_get_bool32_json()

bool dio_get_bool32_json ( struct connection pc,
struct data_in din,
const struct plocation location,
bool dest 
)

◆ dio_get_bool8_json()

bool dio_get_bool8_json ( struct connection pc,
struct data_in din,
const struct plocation location,
bool dest 
)

◆ dio_get_cm_parameter_json()

bool dio_get_cm_parameter_json ( struct connection pc,
struct data_in din,
struct plocation location,
struct cm_parameter param 
)

◆ dio_get_estring_json()

bool dio_get_estring_json ( struct connection pc,
struct data_in din,
const struct plocation location,
char dest,
size_t  max_dest_size 
)

◆ dio_get_memory_json()

bool dio_get_memory_json ( struct connection pc,
struct data_in din,
struct plocation location,
void dest,
size_t  dest_size 
)

◆ dio_get_requirement_json()

bool dio_get_requirement_json ( struct connection pc,
struct data_in din,
const struct plocation location,
struct requirement preq 
)

◆ dio_get_sfloat_json()

bool dio_get_sfloat_json ( struct connection pc,
struct data_in din,
const struct plocation location,
float dest,
int  float_factor 
)

◆ dio_get_sint16_json()

bool dio_get_sint16_json ( struct connection pc,
struct data_in din,
const struct plocation location,
int dest 
)

◆ dio_get_sint32_json()

bool dio_get_sint32_json ( struct connection pc,
struct data_in din,
const struct plocation location,
int dest 
)

◆ dio_get_sint8_json()

bool dio_get_sint8_json ( struct connection pc,
struct data_in din,
const struct plocation location,
int dest 
)

◆ dio_get_string_json()

bool dio_get_string_json ( struct connection pc,
struct data_in din,
const struct plocation location,
char dest,
size_t  max_dest_size 
)

◆ dio_get_type_json()

bool dio_get_type_json ( struct data_in din,
enum data_type  type,
int dest 
)

◆ dio_get_ufloat_json()

bool dio_get_ufloat_json ( struct connection pc,
struct data_in din,
const struct plocation location,
float dest,
int  float_factor 
)

◆ dio_get_uint16_json()

bool dio_get_uint16_json ( struct connection pc,
struct data_in din,
const struct plocation location,
int dest 
)

◆ dio_get_uint16_vec8_json()

bool dio_get_uint16_vec8_json ( struct connection pc,
struct data_in din,
const struct plocation location,
int **  values,
int  stop_value 
)

◆ dio_get_uint32_json()

bool dio_get_uint32_json ( struct connection pc,
struct data_in din,
const struct plocation location,
int dest 
)

◆ dio_get_uint8_json()

bool dio_get_uint8_json ( struct connection pc,
struct data_in din,
const struct plocation location,
int dest 
)

◆ dio_get_uint8_vec8_json()

bool dio_get_uint8_vec8_json ( struct connection pc,
struct data_in din,
const struct plocation location,
int **  values,
int  stop_value 
)

◆ dio_get_unit_order_json()

bool dio_get_unit_order_json ( struct connection pc,
struct data_in din,
struct plocation location,
struct unit_order order 
)

◆ dio_get_worklist_json()

bool dio_get_worklist_json ( struct connection pc,
struct data_in din,
struct plocation location,
struct worklist pwl 
)

◆ dio_put_action_probability_json()

int dio_put_action_probability_json ( struct json_data_out dout,
const struct plocation location,
const struct act_prob prob 
)

◆ dio_put_bool32_json()

int dio_put_bool32_json ( struct json_data_out dout,
const struct plocation location,
bool  value 
)

◆ dio_put_bool8_json()

int dio_put_bool8_json ( struct json_data_out dout,
const struct plocation location,
bool  value 
)

◆ dio_put_cm_parameter_json()

int dio_put_cm_parameter_json ( struct json_data_out dout,
struct plocation location,
const struct cm_parameter order 
)

◆ dio_put_estring_json()

int dio_put_estring_json ( struct json_data_out dout,
const struct plocation location,
const char value 
)

◆ dio_put_farray_json()

int dio_put_farray_json ( struct json_data_out dout,
const struct plocation location,
int  size 
)

◆ dio_put_memory_json()

int dio_put_memory_json ( struct json_data_out dout,
struct plocation location,
const void value,
size_t  size 
)

◆ dio_put_requirement_json()

int dio_put_requirement_json ( struct json_data_out dout,
const struct plocation location,
const struct requirement preq 
)

◆ dio_put_sfloat_json()

int dio_put_sfloat_json ( struct json_data_out dout,
const struct plocation location,
float  value,
int  float_factor 
)

◆ dio_put_sint16_json()

int dio_put_sint16_json ( struct json_data_out dout,
const struct plocation location,
int  value 
)

◆ dio_put_sint32_json()

int dio_put_sint32_json ( struct json_data_out dout,
const struct plocation location,
int  value 
)

◆ dio_put_sint8_json()

int dio_put_sint8_json ( struct json_data_out dout,
const struct plocation location,
int  value 
)

◆ dio_put_string_json()

int dio_put_string_json ( struct json_data_out dout,
const struct plocation location,
const char value 
)

◆ dio_put_type_json()

int dio_put_type_json ( struct json_data_out dout,
enum data_type  type,
const struct plocation location,
int  value 
)

◆ dio_put_ufloat_json()

int dio_put_ufloat_json ( struct json_data_out dout,
const struct plocation location,
float  value,
int  float_factor 
)

◆ dio_put_uint16_json()

int dio_put_uint16_json ( struct json_data_out dout,
const struct plocation location,
int  value 
)

◆ dio_put_uint16_vec8_json()

int dio_put_uint16_vec8_json ( struct json_data_out dout,
const struct plocation location,
int values,
int  stop_value 
)

◆ dio_put_uint32_json()

int dio_put_uint32_json ( struct json_data_out dout,
const struct plocation location,
int  value 
)

◆ dio_put_uint8_json()

int dio_put_uint8_json ( struct json_data_out dout,
const struct plocation location,
int  value 
)

◆ dio_put_uint8_vec8_json()

int dio_put_uint8_vec8_json ( struct json_data_out dout,
const struct plocation location,
int values,
int  stop_value 
)

◆ dio_put_unit_order_json()

int dio_put_unit_order_json ( struct json_data_out dout,
struct plocation location,
const struct unit_order order 
)

◆ dio_put_worklist_json()

int dio_put_worklist_json ( struct json_data_out dout,
struct plocation location,
const struct worklist pwl 
)