/*************************************************************************** * Copyright (C) 2007 by Rui Maciel * * rui.maciel@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ /** @file json.h A small library that helps deal with JSON-encoded information \ingroup JSON \note error handling is only in a very rudimentary form. \author Rui Maciel rui_maciel@users.sourceforge.net \author Sven Herzberg \version v1.7 */ #include #include #ifndef JSON_H #define JSON_H #ifdef __cplusplus extern "C" { #endif #define JSON_MAX_STRING_LENGTH SIZE_MAX-1 /** The descriptions of the json_value node type **/ enum json_value_type { JSON_STRING = 0, JSON_NUMBER, JSON_OBJECT, JSON_ARRAY, JSON_TRUE, JSON_FALSE, JSON_NULL }; /** String implementation **/ struct rui_cstring { char *text; /*