Blame apache2/msc_json.h

Packit 284210
/*
Packit 284210
* ModSecurity for Apache 2.x, http://www.modsecurity.org/
Packit 284210
* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://www.trustwave.com/)
Packit 284210
*
Packit 284210
* You may not use this file except in compliance with
Packit 284210
* the License.  You may obtain a copy of the License at
Packit 284210
*
Packit 284210
*     http://www.apache.org/licenses/LICENSE-2.0
Packit 284210
*
Packit 284210
* If any of the files related to licensing are missing or if you have any
Packit 284210
* other questions related to licensing please contact Trustwave Holdings, Inc.
Packit 284210
* directly using the email address security@modsecurity.org.
Packit 284210
*/
Packit 284210
Packit 284210
#ifndef _MSC_JSON_H_
Packit 284210
#define _MSC_JSON_H_
Packit 284210
#ifdef WITH_YAJL
Packit 284210
Packit 284210
typedef struct json_data json_data;
Packit 284210
Packit 284210
Packit 284210
#include "modsecurity.h"
Packit 284210
Packit 284210
#include <yajl/yajl_parse.h>
Packit 284210
//#ifdef WITH_YAJL
Packit 284210
//#else
Packit 284210
Packit 284210
Packit 284210
#include "modsecurity.h"
Packit 284210
Packit 284210
/* Structures */
Packit 284210
struct json_data {
Packit 284210
    /* yajl configuration and parser state */
Packit 284210
    yajl_handle handle;
Packit 284210
    yajl_status status;
Packit 284210
Packit 284210
    /* error reporting and JSON array flag */
Packit 284210
    unsigned char *yajl_error;
Packit 284210
Packit 284210
    /* prefix is used to create data hierarchy (i.e., 'parent.child.value') */
Packit 284210
    unsigned char *prefix;
Packit 284210
    unsigned char *current_key;
Packit 284210
};
Packit 284210
Packit 284210
/* Functions */
Packit 284210
Packit 284210
int DSOLOCAL json_init(modsec_rec *msr, char **error_msg);
Packit 284210
Packit 284210
int DSOLOCAL json_process(modsec_rec *msr, const char *buf,
Packit 284210
    unsigned int size, char **error_msg);
Packit 284210
Packit 284210
int DSOLOCAL json_complete(modsec_rec *msr, char **error_msg);
Packit 284210
Packit 284210
apr_status_t DSOLOCAL json_cleanup(modsec_rec *msr);
Packit 284210
Packit 284210
int DSOLOCAL json_process_chunk(modsec_rec *msr, const char *buf,
Packit 284210
		unsigned int size, char **error_msg);
Packit 284210
Packit 284210
#endif
Packit 284210
#endif