YAZ
5.34.0
|
XML Include (not to be confused with W3C XInclude) More...
#include <yaz/yconfig.h>
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <yaz/wrbuf.h>
#include <yaz/tpath.h>
#include <yaz/log.h>
#include <yaz/xml_include.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xinclude.h>
Go to the source code of this file.
Data Structures | |
struct | yaz_xml_include_s |
Typedefs | |
typedef struct yaz_xml_include_s * | yaz_xml_include_t |
Functions | |
static int | process_config_includes (yaz_xml_include_t config, xmlNode *n) |
static void | conf_dir_path (yaz_xml_include_t config, WRBUF w, const char *src) |
static int | config_include_one (yaz_xml_include_t config, xmlNode **sib, const char *path) |
static int | config_include_src (yaz_xml_include_t config, xmlNode **np, const char *src) |
int | yaz_xml_include_glob (xmlNode *n, const char *base_path, unsigned glob_flags) |
substitute include nodes in a tree More... | |
int | yaz_xml_include_simple (xmlNode *n, const char *base_path) |
substitute include nodes in a tree More... | |
XML Include (not to be confused with W3C XInclude)
Definition in file xml_include.c.
typedef struct yaz_xml_include_s* yaz_xml_include_t |
Definition at line 45 of file xml_include.c.
|
static |
Definition at line 49 of file xml_include.c.
References yaz_xml_include_s::confdir, wrbuf_printf(), wrbuf_puts(), and yaz_is_abspath().
Referenced by config_include_src().
|
static |
Definition at line 60 of file xml_include.c.
References process_config_includes(), yaz_log(), YLOG_ERRNO, and YLOG_FATAL.
Referenced by config_include_src().
|
static |
Definition at line 103 of file xml_include.c.
References conf_dir_path(), config_include_one(), yaz_xml_include_s::glob_flags, wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), wrbuf_printf(), wrbuf_rewind(), yaz_file_glob2(), yaz_file_glob_get_file(), and yaz_file_globfree().
Referenced by process_config_includes().
|
static |
Definition at line 145 of file xml_include.c.
References config_include_src().
Referenced by config_include_one(), and yaz_xml_include_glob().
int yaz_xml_include_glob | ( | xmlNode * | n, |
const char * | base_path, | ||
unsigned | flags | ||
) |
substitute include nodes in a tree
n | node where include is performed |
base_path | base_path - for relative file specs |
flags | for yaz_file_glob2 (YAZ_FILE_GLOB_...) |
0 | OK |
-1 | FAILURE |
Nodes of the form are substituted with contents of files matching glob-pattern. Do not use this function on XML from untrusted sources – from the net for example – local trusted XML configuration ONLY.
Definition at line 175 of file xml_include.c.
References yaz_xml_include_s::confdir, yaz_xml_include_s::glob_flags, and process_config_includes().
Referenced by yaz_xml_include_simple().
int yaz_xml_include_simple | ( | xmlNode * | n, |
const char * | base_path | ||
) |
substitute include nodes in a tree
n | node where include is performed |
base_path | base_path - for relative file specs |
0 | OK |
-1 | FAILURE |
Nodes of the form are substituted with contents of files matching glob-pattern. Do not use this function on XML from untrusted sources – from the net for example – local trusted XML configuration ONLY.
Definition at line 185 of file xml_include.c.
References yaz_xml_include_glob().