xine-lib 1.2.13-20230125hg15249
|
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <xine/stree.h>
Functions | |
size_t | xine_string_unpercent (char *s) |
size_t | xine_string_unbackslash (char *s) |
size_t | xine_string_unampersand (char *s) |
static int | _xine_stree_node_new (xine_stree_t **root, uint32_t *have, uint32_t *used, uint32_t parent) |
static uint8_t * | _xine_stree_get_string (uint8_t **p, uint8_t **q, const uint8_t *tab) |
static xine_stree_t * | _xine_stree_load_xml (char *buf) |
static xine_stree_t * | _xine_stree_load_json (char *buf) |
static xine_stree_t * | _xine_stree_load_url (char *buf) |
xine_stree_t * | xine_stree_load (char *buf, xine_stree_mode_t *mode) |
void | xine_stree_dump (const xine_stree_t *tree, const char *buf, uint32_t base) |
uint32_t | xine_stree_find (const xine_stree_t *tree, const char *buf, const char *path, uint32_t base, int case_sens) |
void | xine_stree_delete (xine_stree_t **tree) |
Variables | |
static const uint8_t | _tab_unhex [256] |
static const uint8_t | _tab_xml [256] |
static const uint8_t | _tab_json1 [256] |
static const uint8_t | _tab_json2 [256] |
static const uint8_t | _tab_url [256] |
static const uint8_t | _tab_key [256] |
|
static |
Referenced by _xine_stree_load_json(), and _xine_stree_load_xml().
|
static |
References _tab_json1, _tab_json2, _xine_stree_get_string(), _xine_stree_node_new(), xine_stree_t::first_child, xine_stree_t::index, xine_stree_t::key, xine_stree_t::last_child, xine_stree_t::level, xine_stree_t::next, NULL, xine_stree_t::num_children, xine_stree_t::parent, xine_stree_t::prev, v, xine_stree_t::value, xine_string_unbackslash(), and z.
Referenced by xine_stree_load().
|
static |
References _tab_url, _xine_stree_node_new(), xine_stree_t::first_child, xine_stree_t::index, xine_stree_t::key, key, xine_stree_t::last_child, xine_stree_t::level, xine_stree_t::next, NULL, xine_stree_t::num_children, xine_stree_t::parent, xine_stree_t::prev, xine_stree_t::value, xine_string_unpercent(), and z.
Referenced by xine_stree_load().
|
static |
References _tab_xml, _xine_stree_get_string(), _xine_stree_node_new(), xine_stree_t::first_child, xine_stree_t::index, xine_stree_t::key, key, xine_stree_t::last_child, xine_stree_t::level, xine_stree_t::next, NULL, xine_stree_t::num_children, xine_stree_t::parent, xine_stree_t::prev, v, xine_stree_t::value, xine_string_unampersand(), and z.
Referenced by xine_stree_load().
|
static |
References xine_stree_t::first_child, xine_stree_t::key, xine_stree_t::last_child, xine_stree_t::level, xine_stree_t::next, xine_stree_t::num_children, xine_stree_t::parent, xine_stree_t::prev, and xine_stree_t::value.
Referenced by _xine_stree_load_json(), _xine_stree_load_url(), and _xine_stree_load_xml().
void xine_stree_delete | ( | xine_stree_t ** | tree | ) |
References NULL.
Referenced by mpd_input_dispose(), and mpd_input_load_manifest().
void xine_stree_dump | ( | const xine_stree_t * | tree, |
const char * | buf, | ||
uint32_t | base ) |
base is an index into the tree, where to start.
References xine_stree_t::first_child, xine_stree_t::key, xine_stree_t::level, xine_stree_t::next, NULL, xine_stree_t::parent, xine_stree_t::prev, and xine_stree_t::value.
uint32_t xine_stree_find | ( | const xine_stree_t * | tree, |
const char * | buf, | ||
const char * | path, | ||
uint32_t | base, | ||
int | case_sens ) |
path is a dot separated list of parts. part is a key, a zero based index number in square brackets, or both. the special key "[]" refers to xml tag content text. "foo.[][0]" will also be available as "foo".
References _tab_key, _tab_xml, xine_stree_t::first_child, xine_stree_t::key, xine_stree_t::next, v, and z.
Referenced by mpd_input_load_manifest(), and mpd_stree_find().
xine_stree_t * xine_stree_load | ( | char * | buf, |
xine_stree_mode_t * | mode ) |
buf will be reused (modified) to hold the strings referenced by xine_stree_t. XINE_STREE_AUTO will update mode.
References _tab_xml, _xine_stree_load_json(), _xine_stree_load_url(), _xine_stree_load_xml(), mode(), NULL, XINE_STREE_AUTO, XINE_STREE_JSON, XINE_STREE_LAST, XINE_STREE_URL, and XINE_STREE_XML.
Referenced by mpd_input_load_manifest().
size_t xine_string_unampersand | ( | char * | s | ) |
"&" -> "&" "<" -> "<" ">" -> ">" """ -> "\"" "핵" -> "핵" return new strlen ().
References _tab_unhex, v, and z.
Referenced by _xine_stree_load_xml().
size_t xine_string_unbackslash | ( | char * | s | ) |
"\n" -> <newline> "\070" -> "8" "\x37" -> "7" "\ud575" -> "핵" "\cG" -> <bell> (^G) return new strlen ().
References _tab_unhex, v, and z.
Referenced by _xine_stree_load_json().
size_t xine_string_unpercent | ( | char * | s | ) |
"%3a" -> ":" etc. return new strlen ().
References _tab_unhex, v, and z.
Referenced by _xine_stree_load_url().
|
static |
Referenced by _xine_stree_load_json().
|
static |
Referenced by _xine_stree_load_json().
|
static |
Referenced by xine_stree_find().
|
static |
Referenced by xine_string_unampersand(), xine_string_unbackslash(), and xine_string_unpercent().
|
static |
Referenced by _xine_stree_load_url().
|
static |
Referenced by _xine_stree_load_xml(), xine_stree_find(), and xine_stree_load().