xmldb api cleanup
This commit is contained in:
parent
caccfe8f2d
commit
cf3cf351c8
16 changed files with 177 additions and 361 deletions
|
|
@ -53,7 +53,6 @@
|
|||
#include <clixon/clixon_queue.h>
|
||||
#include <clixon/clixon_hash.h>
|
||||
#include <clixon/clixon_handle.h>
|
||||
#include <clixon/clixon_qdb.h>
|
||||
#include <clixon/clixon_yang.h>
|
||||
#include <clixon/clixon_yang_type.h>
|
||||
#include <clixon/clixon_chunk.h>
|
||||
|
|
|
|||
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLIXON is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
CLIXON is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _CLIXON_QDB_H_
|
||||
#define _CLIXON_QDB_H_
|
||||
|
||||
|
||||
/*
|
||||
* Low level API
|
||||
*/
|
||||
|
||||
struct db_pair {
|
||||
char *dp_key; /* database key */
|
||||
char *dp_matched; /* Matched component of key */
|
||||
char *dp_val; /* pointer to vector of lvalues */
|
||||
int dp_vlen; /* length of vector of lvalues */
|
||||
};
|
||||
|
||||
/*
|
||||
* Prototypes
|
||||
*/
|
||||
int db_init(char *file);
|
||||
|
||||
int db_set(char *file, char *key, void *data, size_t datalen);
|
||||
|
||||
int db_get(char *file, char *key, void *data, size_t *datalen);
|
||||
|
||||
int db_get_alloc(char *file, char *key, void **data, size_t *datalen);
|
||||
|
||||
int db_del(char *file, char *key);
|
||||
|
||||
int db_exists(char *file, char *key);
|
||||
|
||||
int db_regexp(char *file, char *regexp, const char *label,
|
||||
struct db_pair **pairs, int noval);
|
||||
|
||||
char *db_sanitize(char *rx, const char *label);
|
||||
|
||||
#endif /* _CLIXON_QDB_H_ */
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
int yang2xmlkeyfmt(yang_stmt *ys, char **xkfmt);
|
||||
int xmlkeyfmt2key(char *xkfmt, cvec *cvv, char **xk);
|
||||
int xmlkeyfmt2key2(char *xkfmt, cvec *cvv, char **xk);
|
||||
int xmlkeyfmt2xpath(char *xkfmt, cvec *cvv, char **xk);
|
||||
int xmlkey2xml(char *xkey, yang_spec *yspec, char **xml);
|
||||
int xmldb_get(char *dbname, char *xpath,
|
||||
yang_spec *yspec, cxobj **xtop);
|
||||
|
|
@ -38,5 +38,7 @@ int xmldb_put( char *dbname, cxobj *xt,
|
|||
yang_spec *yspec, enum operation_type op);
|
||||
int xmldb_put_xkey(char *dbname, char *xkey, char *val, yang_spec *yspec,
|
||||
enum operation_type op);
|
||||
int xmldb_dump(FILE *f, char *dbname, char *rxkey);
|
||||
int xmldb_init(char *file);
|
||||
|
||||
#endif /* _CLIXON_XML_DB_H */
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@
|
|||
*/
|
||||
cxobj *xpath_first(cxobj *xn_top, char *xpath);
|
||||
cxobj *xpath_each(cxobj *xn_top, char *xpath, cxobj *prev);
|
||||
cxobj **xpath_vec(cxobj *xn_top, char *xpath, size_t *xv_len);
|
||||
cxobj **xpath_vec_flag(cxobj *cxtop, char *xpath, uint16_t flags, size_t *veclen);
|
||||
int xpath_vec(cxobj *xn_top, char *xpath, cxobj ***vec, size_t *xv_len);
|
||||
int xpath_vec_flag(cxobj *cxtop, char *xpath, uint16_t flags,
|
||||
cxobj ***vec, size_t *veclen);
|
||||
|
||||
#endif /* _CLIXON_XSL_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue