Created xmldb plugin api
This commit is contained in:
parent
4169bd8d30
commit
f6b3e95100
39 changed files with 492 additions and 504 deletions
91
lib/clixon/clixon.h
Normal file
91
lib/clixon/clixon.h
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
/* lib/clixon/clixon.h. Generated from clixon.h.in by configure. */
|
||||
/*
|
||||
*
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (C) 2009-2017 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLIXON.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
the GNU General Public License Version 3 or later (the "GPL"),
|
||||
in which case the provisions of the GPL are applicable instead
|
||||
of those above. If you wish to allow use of your version of this file only
|
||||
under the terms of the GPL, and not to allow others to
|
||||
use your version of this file under the terms of Apache License version 2,
|
||||
indicate your decision by deleting the provisions above and replace them with
|
||||
the notice and other provisions required by the GPL. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the Apache License version 2 or the GPL.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
|
||||
* Meta-include file that includes all sub-files in control-lib
|
||||
* Note: this include files is for external purposes. Do not include this
|
||||
* file in clicon lib-routines.
|
||||
*/
|
||||
|
||||
/* This include file requires the following include file dependencies */
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
/*
|
||||
* CLIXON version macros
|
||||
*/
|
||||
|
||||
#define CLIXON_VERSION_STRING "3.2.0"
|
||||
#define CLIXON_VERSION_MAJOR 3
|
||||
#define CLIXON_VERSION_MINOR 2
|
||||
#define CLIXON_VERSION_PATCH 0
|
||||
|
||||
/*
|
||||
* Use this constant to disable some prototypes that should not be visible outside the lib.
|
||||
* This is an alternative to use separate internal include files.
|
||||
*/
|
||||
#define LIBCLIXON_API 1
|
||||
|
||||
#include <clixon/clixon_sig.h>
|
||||
#include <clixon/clixon_log.h>
|
||||
#include <clixon/clixon_err.h>
|
||||
#include <clixon/clixon_queue.h>
|
||||
#include <clixon/clixon_hash.h>
|
||||
#include <clixon/clixon_handle.h>
|
||||
#include <clixon/clixon_yang.h>
|
||||
#include <clixon/clixon_yang_type.h>
|
||||
#include <clixon/clixon_event.h>
|
||||
#include <clixon/clixon_string.h>
|
||||
#include <clixon/clixon_file.h>
|
||||
#include <clixon/clixon_xml.h>
|
||||
#include <clixon/clixon_proto.h>
|
||||
#include <clixon/clixon_proto_encode.h>
|
||||
#include <clixon/clixon_proto_client.h>
|
||||
#include <clixon/clixon_proc.h>
|
||||
#include <clixon/clixon_options.h>
|
||||
#include <clixon/clixon_xml_map.h>
|
||||
#include <clixon/clixon_xml_db.h>
|
||||
#include <clixon/clixon_xsl.h>
|
||||
#include <clixon/clixon_json.h>
|
||||
#include <clixon/clixon_plugin.h>
|
||||
#include <clixon/clixon_plugin.h>
|
||||
|
||||
/*
|
||||
* Global variables generated by Makefile
|
||||
*/
|
||||
extern const char CLIXON_BUILDSTR[];
|
||||
extern const char CLIXON_VERSION[];
|
||||
|
|
@ -1,177 +0,0 @@
|
|||
/*
|
||||
*
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (C) 2009-2017 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLIXON.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
the GNU General Public License Version 3 or later (the "GPL"),
|
||||
in which case the provisions of the GPL are applicable instead
|
||||
of those above. If you wish to allow use of your version of this file only
|
||||
under the terms of the GPL, and not to allow others to
|
||||
use your version of this file under the terms of Apache License version 2,
|
||||
indicate your decision by deleting the provisions above and replace them with
|
||||
the notice and other provisions required by the GPL. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the Apache License version 2 or the GPL.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _CLIXON_CHUNK_H_
|
||||
#define _CLIXON_CHUNK_H_
|
||||
|
||||
|
||||
/*
|
||||
* Compile with chunk diagnostics. XXX Should be in Makefile.in ??
|
||||
*/
|
||||
#undef CHUNK_DIAG
|
||||
|
||||
/*
|
||||
* Base number of bits to shift getting the size of a chunk_head.
|
||||
*/
|
||||
#define CHUNK_BASE 6
|
||||
|
||||
/*
|
||||
* Number of predefined chunk sizes. I.e. the number of chunk heads in the
|
||||
* chunk_heads vector.
|
||||
*/
|
||||
#define CHUNK_HEADS (32 - CHUNK_BASE)
|
||||
|
||||
|
||||
#ifdef CHUNK_DIAG
|
||||
/*
|
||||
* Chunk diagnostics
|
||||
*/
|
||||
typedef struct _chunk_diag_t {
|
||||
const char *cd_file; /* File which requested chunk */
|
||||
|
||||
int cd_line; /* Line in requesting file */
|
||||
|
||||
} chunk_diag_t;
|
||||
#endif /* CHUNK_DIAG */
|
||||
|
||||
/*
|
||||
* The block header.
|
||||
*/
|
||||
struct _chunk_head_t;
|
||||
typedef struct _chunk_head_t chunk_head_t;
|
||||
|
||||
typedef struct _chunk_block_t {
|
||||
qelem_t cb_qelem; /* Circular queue of blocks */
|
||||
|
||||
chunk_head_t *cb_head; /* The chunk head I belong to */
|
||||
|
||||
void *cb_blk; /* Allocated memory block */
|
||||
|
||||
uint16_t cb_ref; /* Number of used chunks of block */
|
||||
|
||||
} chunk_block_t;
|
||||
|
||||
|
||||
/*
|
||||
* The chunk header.
|
||||
*/
|
||||
struct _chunk_grpent_t;
|
||||
typedef struct _chunk_grpent_t chunk_grpent_t;
|
||||
typedef struct _chunk_t {
|
||||
qelem_t c_qelem; /* Circular queue of chunks */
|
||||
|
||||
chunk_block_t *c_blk; /* The block I belong to */
|
||||
|
||||
#ifdef CHUNK_DIAG
|
||||
chunk_diag_t c_diag; /* The diagnostics structure */
|
||||
#endif /* CHUNK_DIAG */
|
||||
|
||||
chunk_grpent_t *c_grpent;
|
||||
} chunk_t;
|
||||
|
||||
/*
|
||||
* The head of a chunk size. Each predefined size has it's own head keeping
|
||||
* track of all blocks and chunks for the size.
|
||||
*/
|
||||
struct _chunk_head_t {
|
||||
size_t ch_size; /* Chunk size */
|
||||
int ch_nchkperblk; /* Number pf chunks per block */
|
||||
|
||||
size_t ch_blksz; /* Size of a block */
|
||||
int ch_nblks; /* Number of allocated blocks */
|
||||
|
||||
chunk_block_t *ch_blks; /* Circular list of blocks */
|
||||
|
||||
chunk_t *ch_cnks; /* Circular list of chunks in use */
|
||||
|
||||
size_t ch_nfree; /* Number of free chunks */
|
||||
chunk_t *ch_free; /* Circular list of free chunks */
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* The chunk group structure.
|
||||
*/
|
||||
typedef struct _chunk_group_t {
|
||||
qelem_t cg_qelem; /* List of chunk groups */
|
||||
|
||||
char *cg_name; /* Name of group */
|
||||
|
||||
chunk_grpent_t *cg_ent; /* List of chunks in the group */
|
||||
|
||||
} chunk_group_t;
|
||||
|
||||
|
||||
/*
|
||||
* The chunk group entry structure.
|
||||
*/
|
||||
struct _chunk_grpent_t {
|
||||
qelem_t ce_qelem; /* Circular list of entries */
|
||||
|
||||
chunk_group_t *ce_grp; /* The group I belong to */
|
||||
|
||||
chunk_t *ce_cnk; /* Pointer to the chunk */
|
||||
};
|
||||
|
||||
/*
|
||||
* Public function declarations
|
||||
*/
|
||||
#ifdef CHUNK_DIAG
|
||||
void *_chunk (size_t, const char *, const char *, int);
|
||||
#define chunk(siz,label) _chunk((siz),(label),__FILE__,__LINE__)
|
||||
void *_rechunk (void *, size_t, const char *, const char *, int);
|
||||
#define rechunk(ptr,siz,label) _rechunk((ptr),(siz),(label),__FILE__,__LINE__)
|
||||
void *_chunkdup (const void *, size_t, const char *, const char *, int);
|
||||
#define chunkdup(ptr,siz,label) _chunkdup((ptr),(siz),(label),__FILE__,__LINE__)
|
||||
char *_chunk_strncat (const char *, const char *, size_t, const char *, const char *, int);
|
||||
#define chunk_strncat(str,new,n,label) _chunk_strncat((str),(new),(n),(label),__FILE__,__LINE__)
|
||||
char *_chunk_sprintf (const char *, const char *, int, const char *, ...);
|
||||
#define chunk_sprintf(label,fmt,...) _chunk_sprintf((label),__FILE__,__LINE__,(fmt),__VA_ARGS__)
|
||||
#else /* CHUNK_DIAG */
|
||||
void *chunk (size_t, const char *);
|
||||
void *rechunk (void *, size_t, const char *);
|
||||
void *chunkdup (const void *, size_t, const char *);
|
||||
char *chunk_strncat (const char *, const char *, size_t, const char *);
|
||||
char *chunk_sprintf (const char *, char *, ...);
|
||||
#endif /* CHUNK_DIAG */
|
||||
void unchunk (void *);
|
||||
void unchunk_group (const char *);
|
||||
void chunk_check (FILE *, const char *);
|
||||
size_t chunksize (void *);
|
||||
|
||||
|
||||
#endif /* _CLIXON_CHUNK_H_ */
|
||||
|
|
@ -38,9 +38,7 @@
|
|||
|
||||
|
||||
int clicon_file_dirent(const char *dir, struct dirent **ent,
|
||||
const char *regexp, mode_t type, const char *label);
|
||||
|
||||
char *clicon_tmpfile(const char *label);
|
||||
const char *regexp, mode_t type);
|
||||
|
||||
int clicon_file_copy(char *src, char *target);
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@ char *clicon_cli_dir(clicon_handle h);
|
|||
char *clicon_clispec_dir(clicon_handle h);
|
||||
char *clicon_netconf_dir(clicon_handle h);
|
||||
char *clicon_restconf_dir(clicon_handle h);
|
||||
char *clicon_archive_dir(clicon_handle h);
|
||||
char *clicon_xmldb_plugin(clicon_handle h);
|
||||
int clicon_sock_family(clicon_handle h);
|
||||
char *clicon_sock(clicon_handle h);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue