Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/bluemarvin/yajl
Browse files Browse the repository at this point in the history
Conflicts:
	src/api/yajl_gen.h
	src/api/yajl_parse.h
  • Loading branch information
lloyd committed Dec 18, 2009
2 parents c439d89 + 76994fa commit c84845b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
30 changes: 15 additions & 15 deletions src/api/yajl_gen.h
Expand Up @@ -94,7 +94,7 @@ extern "C" {
*
* \returns an allocated handle on success, NULL on failure (bad params)
*/
yajl_gen YAJL_API yajl_gen_alloc(const yajl_gen_config * config,
YAJL_API yajl_gen yajl_gen_alloc(const yajl_gen_config * config,
const yajl_alloc_funcs * allocFuncs);

/** allocate a generator handle that will print to the specified
Expand All @@ -114,43 +114,43 @@ extern "C" {
*
* \returns an allocated handle on success, NULL on failure (bad params)
*/
yajl_gen YAJL_API yajl_gen_alloc2(const yajl_print_t callback,
YAJL_API yajl_gen yajl_gen_alloc2(const yajl_print_t callback,
const yajl_gen_config * config,
const yajl_alloc_funcs * allocFuncs,
void * ctx);

/** free a generator handle */
void YAJL_API yajl_gen_free(yajl_gen handle);
YAJL_API void yajl_gen_free(yajl_gen handle);

yajl_gen_status YAJL_API yajl_gen_integer(yajl_gen hand, long int number);
YAJL_API yajl_gen_status yajl_gen_integer(yajl_gen hand, long int number);
/** generate a floating point number. number may not be infinity or
* NaN, as these have no representation in JSON. In these cases the
* generator will return 'yajl_gen_invalid_number' */
yajl_gen_status YAJL_API yajl_gen_double(yajl_gen hand, double number);
yajl_gen_status YAJL_API yajl_gen_number(yajl_gen hand,
YAJL_API yajl_gen_status yajl_gen_double(yajl_gen hand, double number);
YAJL_API yajl_gen_status yajl_gen_number(yajl_gen hand,
const char * num,
unsigned int len);
yajl_gen_status YAJL_API yajl_gen_string(yajl_gen hand,
YAJL_API yajl_gen_status yajl_gen_string(yajl_gen hand,
const unsigned char * str,
unsigned int len);
yajl_gen_status YAJL_API yajl_gen_null(yajl_gen hand);
yajl_gen_status YAJL_API yajl_gen_bool(yajl_gen hand, int boolean);
yajl_gen_status YAJL_API yajl_gen_map_open(yajl_gen hand);
yajl_gen_status YAJL_API yajl_gen_map_close(yajl_gen hand);
yajl_gen_status YAJL_API yajl_gen_array_open(yajl_gen hand);
yajl_gen_status YAJL_API yajl_gen_array_close(yajl_gen hand);
YAJL_API yajl_gen_status yajl_gen_null(yajl_gen hand);
YAJL_API yajl_gen_status yajl_gen_bool(yajl_gen hand, int boolean);
YAJL_API yajl_gen_status yajl_gen_map_open(yajl_gen hand);
YAJL_API yajl_gen_status yajl_gen_map_close(yajl_gen hand);
YAJL_API yajl_gen_status yajl_gen_array_open(yajl_gen hand);
YAJL_API yajl_gen_status yajl_gen_array_close(yajl_gen hand);

/** access the null terminated generator buffer. If incrementally
* outputing JSON, one should call yajl_gen_clear to clear the
* buffer. This allows stream generation. */
yajl_gen_status YAJL_API yajl_gen_get_buf(yajl_gen hand,
YAJL_API yajl_gen_status yajl_gen_get_buf(yajl_gen hand,
const unsigned char ** buf,
unsigned int * len);

/** clear yajl's output buffer, but maintain all internal generation
* state. This function will not "reset" the generator state, and is
* intended to enable incremental JSON outputing. */
void YAJL_API yajl_gen_clear(yajl_gen hand);
YAJL_API void yajl_gen_clear(yajl_gen hand);

#ifdef __cplusplus
}
Expand Down
16 changes: 8 additions & 8 deletions src/api/yajl_parse.h
Expand Up @@ -59,7 +59,7 @@ extern "C" {
} yajl_status;

/** attain a human readable, english, string for an error */
const char * YAJL_API yajl_status_to_string(yajl_status code);
YAJL_API const char * yajl_status_to_string(yajl_status code);

/** an opaque handle to a parser */
typedef struct yajl_handle_t * yajl_handle;
Expand Down Expand Up @@ -127,20 +127,20 @@ extern "C" {
* \param config configuration parameters for the parse.
* \param ctx a context pointer that will be passed to callbacks.
*/
yajl_handle YAJL_API yajl_alloc(const yajl_callbacks * callbacks,
YAJL_API yajl_handle yajl_alloc(const yajl_callbacks * callbacks,
const yajl_parser_config * config,
const yajl_alloc_funcs * allocFuncs,
void * ctx);

/** free a parser handle */
void YAJL_API yajl_free(yajl_handle handle);
YAJL_API void yajl_free(yajl_handle handle);

/** Parse some json!
* \param hand - a handle to the json parser allocated with yajl_alloc
* \param jsonText - a pointer to the UTF8 json text to be parsed
* \param jsonTextLength - the length, in bytes, of input text
*/
yajl_status YAJL_API yajl_parse(yajl_handle hand,
YAJL_API yajl_status yajl_parse(yajl_handle hand,
const unsigned char * jsonText,
unsigned int jsonTextLength);

Expand All @@ -153,7 +153,7 @@ extern "C" {
*
* \param hand - a handle to the json parser allocated with yajl_alloc
*/
yajl_status yajl_parse_complete(yajl_handle hand);
YAJL_API yajl_status yajl_parse_complete(yajl_handle hand);

/** get an error string describing the state of the
* parse.
Expand All @@ -165,7 +165,7 @@ extern "C" {
* \returns A dynamically allocated string will be returned which should
* be freed with yajl_free_error
*/
unsigned char * YAJL_API yajl_get_error(yajl_handle hand, int verbose,
YAJL_API unsigned char * yajl_get_error(yajl_handle hand, int verbose,
const unsigned char * jsonText,
unsigned int jsonTextLength);

Expand All @@ -181,10 +181,10 @@ extern "C" {
* chunk where the error occured. 0 will be returned if no error
* was encountered.
*/
unsigned int YAJL_API yajl_get_bytes_consumed(yajl_handle hand);
YAJL_API unsigned int yajl_get_bytes_consumed(yajl_handle hand);

/** free an error returned from yajl_get_error */
void YAJL_API yajl_free_error(yajl_handle hand, unsigned char * str);
YAJL_API void yajl_free_error(yajl_handle hand, unsigned char * str);

#ifdef __cplusplus
}
Expand Down

0 comments on commit c84845b

Please sign in to comment.