Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
jsmn.h File Reference
#include <stddef.h>

Go to the source code of this file.

Classes

struct  jsmntok_t
 
struct  jsmn_parser
 

Enumerations

enum  jsmntype_t {
  JSMN_UNDEFINED = 0 , JSMN_OBJECT = 1 , JSMN_ARRAY = 2 , JSMN_STRING = 3 ,
  JSMN_PRIMITIVE = 4
}
 
enum  jsmnerr { JSMN_ERROR_NOMEM = -1 , JSMN_ERROR_INVAL = -2 , JSMN_ERROR_PART = -3 }
 

Functions

void jsmn_init (jsmn_parser *parser)
 
int jsmn_parse (jsmn_parser *parser, const char *js, size_t len, jsmntok_t *tokens, unsigned int num_tokens)
 

Detailed Description

Copyright (c) 2010 Serge A. Zaitsev

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Enumeration Type Documentation

◆ jsmntype_t

enum jsmntype_t

JSON type identifier. Basic types are: o Object o Array o String o Other primitive: number, boolean (true/false) or null

Function Documentation

◆ jsmn_init()

void jsmn_init ( jsmn_parser parser)

Create JSON parser over an array of tokens

Creates a new parser based over a given buffer with an array of tokens available.

◆ jsmn_parse()

int jsmn_parse ( jsmn_parser parser,
const char *  js,
size_t  len,
jsmntok_t tokens,
unsigned int  num_tokens 
)

Run JSON parser. It parses a JSON data string into and array of tokens, each describing a single JSON object.

Parse JSON string and fill tokens.