Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:19:16

0001 /*
0002  * Copyright (c) 2020 Eric Hawicz
0003  *
0004  * This library is free software; you can redistribute it and/or modify
0005  * it under the terms of the MIT license. See COPYING for details.
0006  */
0007 
0008 #ifndef _json_types_h_
0009 #define _json_types_h_
0010 
0011 /**
0012  * @file
0013  * @brief Basic types used in a few places in json-c, but you should include "json_object.h" instead.
0014  */
0015 
0016 #ifdef __cplusplus
0017 extern "C" {
0018 #endif
0019 
0020 #ifndef JSON_EXPORT
0021 #if defined(_MSC_VER) && defined(JSON_C_DLL)
0022 #define JSON_EXPORT __declspec(dllexport)
0023 #else
0024 #define JSON_EXPORT extern
0025 #endif
0026 #endif
0027 
0028 struct printbuf;
0029 
0030 /**
0031  * A structure to use with json_object_object_foreachC() loops.
0032  * Contains key, val and entry members.
0033  */
0034 struct json_object_iter
0035 {
0036     char *key;
0037     struct json_object *val;
0038     struct lh_entry *entry;
0039 };
0040 typedef struct json_object_iter json_object_iter;
0041 
0042 typedef int json_bool;
0043 
0044 /**
0045  * @brief The core type for all type of JSON objects handled by json-c
0046  */
0047 typedef struct json_object json_object;
0048 
0049 /**
0050  * Type of custom user delete functions.  See json_object_set_serializer.
0051  */
0052 typedef void(json_object_delete_fn)(struct json_object *jso, void *userdata);
0053 
0054 /**
0055  * Type of a custom serialization function.  See json_object_set_serializer.
0056  */
0057 typedef int(json_object_to_json_string_fn)(struct json_object *jso, struct printbuf *pb, int level,
0058                                            int flags);
0059 
0060 /* supported object types */
0061 
0062 typedef enum json_type
0063 {
0064     /* If you change this, be sure to update json_type_to_name() too */
0065     json_type_null,
0066     json_type_boolean,
0067     json_type_double,
0068     json_type_int,
0069     json_type_object,
0070     json_type_array,
0071     json_type_string
0072 } json_type;
0073 
0074 #ifdef __cplusplus
0075 }
0076 #endif
0077 
0078 #endif