41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
#ifndef __JSONCDACCORD_H
|
|
#define __JSONCDACCORD_H
|
|
|
|
#include <json-c/json.h>
|
|
|
|
enum jdac_errors {
|
|
JDAC_ERR_VALID = 0,
|
|
JDAC_ERR_GENERAL_ERROR,
|
|
JDAC_ERR_JSON_NOT_FOUND,
|
|
JDAC_ERR_SCHEMA_NOT_FOUND,
|
|
JDAC_ERR_WRONG_ARGS,
|
|
JDAC_ERR_SCHEMA_ERROR,
|
|
JDAC_ERR_INVALID,
|
|
JDAC_ERR_INVALID_TYPE,
|
|
JDAC_ERR_INVALID_REQUIRED,
|
|
JDAC_ERR_INVALID_SUBSCHEMALOGIC,
|
|
JDAC_ERR_INVALID_CONST,
|
|
JDAC_ERR_INVALID_ENUMS,
|
|
JDAC_ERR_INVALID_STRLEN,
|
|
JDAC_ERR_INVALID_UNIQUEITEMS,
|
|
JDAC_ERR_INVALID_PREFIXITEMS,
|
|
JDAC_ERR_INVALID_ITEMS,
|
|
JDAC_ERR_INVALID_CONTAINS,
|
|
JDAC_ERR_INVALID_ARRAYLEN,
|
|
JDAC_ERR_INVALID_NUMBER,
|
|
JDAC_ERR_INVALID_PATTERNMATCH,
|
|
JDAC_ERR_INVALID_REF,
|
|
JDAC_REGEX_MISMATCH,
|
|
JDAC_REGEX_MATCH,
|
|
JDAC_REGEX_COMPILE_FAILED,
|
|
JDAC_ERR_MAX
|
|
};
|
|
|
|
int jdac_validate_file(const char *jsonfile, const char *jsonschemafile);
|
|
int jdac_validate(json_object *jobj, json_object *jschema);
|
|
int jdac_ref_set_localpath(const char *_localpath);
|
|
|
|
const char *jdac_errorstr(unsigned int jdac_errors);
|
|
|
|
#endif //__JSONCDACCORD_H
|