renamed .h and libs clicon->clixon
This commit is contained in:
parent
baa5611616
commit
79b77943f9
132 changed files with 1240 additions and 1268 deletions
|
|
@ -31,9 +31,9 @@ localstatedir = @localstatedir@
|
|||
sysconfdir = @sysconfdir@
|
||||
|
||||
SH_SUFFIX = @SH_SUFFIX@
|
||||
CLICON_VERSION = @CLICON_VERSION@
|
||||
CLICON_MAJOR = @CLICON_VERSION_MAJOR@
|
||||
CLICON_MINOR = @CLICON_VERSION_MINOR@
|
||||
CLIXON_VERSION = @CLIXON_VERSION@
|
||||
CLIXON_MAJOR = @CLIXON_VERSION_MAJOR@
|
||||
CLIXON_MINOR = @CLIXON_VERSION_MINOR@
|
||||
|
||||
VPATH = @srcdir@
|
||||
CC = @CC@
|
||||
|
|
@ -46,19 +46,19 @@ LEX = @LEX@
|
|||
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
|
||||
INCLUDES = -I. @INCLUDES@ -I$(top_srcdir)/lib/clicon -I$(top_srcdir)/include -I$(top_srcdir)
|
||||
INCLUDES = -I. @INCLUDES@ -I$(top_srcdir)/lib/clixon -I$(top_srcdir)/include -I$(top_srcdir)
|
||||
|
||||
SRC = clicon_sig.c clicon_qdb.c clicon_log.c clicon_err.c clicon_event.c \
|
||||
clicon_chunk.c clicon_proc.c \
|
||||
clicon_string.c clicon_handle.c \
|
||||
clicon_xml.c clicon_xml_map.c clicon_file.c \
|
||||
clicon_yang.c clicon_yang_type.c \
|
||||
clicon_hash.c clicon_options.c clicon_plugin.c \
|
||||
clicon_proto.c clicon_proto_encode.c clicon_proto_client.c \
|
||||
clicon_xsl.c clicon_sha1.c clicon_xml_db.c
|
||||
SRC = clixon_sig.c clixon_qdb.c clixon_log.c clixon_err.c clixon_event.c \
|
||||
clixon_chunk.c clixon_proc.c \
|
||||
clixon_string.c clixon_handle.c \
|
||||
clixon_xml.c clixon_xml_map.c clixon_file.c \
|
||||
clixon_yang.c clixon_yang_type.c \
|
||||
clixon_hash.c clixon_options.c clixon_plugin.c \
|
||||
clixon_proto.c clixon_proto_encode.c clixon_proto_client.c \
|
||||
clixon_xsl.c clixon_sha1.c clixon_xml_db.c
|
||||
|
||||
YACCOBJS := lex.clicon_xml_parse.o clicon_xml_parse.tab.o \
|
||||
lex.clicon_yang_parse.o clicon_yang_parse.tab.o
|
||||
YACCOBJS := lex.clixon_xml_parse.o clixon_xml_parse.tab.o \
|
||||
lex.clixon_yang_parse.o clixon_yang_parse.tab.o
|
||||
# Logically, the below 4 should be in YACCOBJS?
|
||||
|
||||
|
||||
|
|
@ -68,24 +68,24 @@ GENSRC = build.c
|
|||
OBJS = $(YACCOBJS) $(SRC:.c=.o)
|
||||
GENOBJS = $(GENSRC:.c=.o)
|
||||
|
||||
# Linker-name: libclicon.so
|
||||
# so-name: libclicon.so.2
|
||||
# real-name: libclicon.so.2.0
|
||||
MYLIB = libclicon$(SH_SUFFIX).$(CLICON_MAJOR).$(CLICON_MINOR)
|
||||
MYLIBSO = libclicon$(SH_SUFFIX).$(CLICON_MAJOR)
|
||||
MYLIBLINK = libclicon$(SH_SUFFIX)
|
||||
# Linker-name: libclixon.so
|
||||
# so-name: libclixon.so.2
|
||||
# real-name: libclixon.so.2.0
|
||||
MYLIB = libclixon$(SH_SUFFIX).$(CLIXON_MAJOR).$(CLIXON_MINOR)
|
||||
MYLIBSO = libclixon$(SH_SUFFIX).$(CLIXON_MAJOR)
|
||||
MYLIBLINK = libclixon$(SH_SUFFIX)
|
||||
|
||||
all: $(MYLIB) $(MYLIBLINK)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(MYLIB) $(MYLIBLINK) $(GENOBJS) $(GENSRC) *.core
|
||||
rm -f clicon_xml_parse.tab.[ch] clicon_xml_parse.yy.[co]
|
||||
rm -f clicon_yang_parse.tab.[ch] clicon_yang_parse.[co]
|
||||
rm -f lex.clicon_yang_parse.c
|
||||
rm -f lex.clicon_xml_parse.c
|
||||
# disabled when USE_DBSPEC_PT is disabled in clicon_config.h.in
|
||||
# rm -f clicon_dbspec.tab.[ch] clicon_dbspec.[co]
|
||||
# rm -f lex.clicon_dbspec.c
|
||||
rm -f clixon_xml_parse.tab.[ch] clixon_xml_parse.yy.[co]
|
||||
rm -f clixon_yang_parse.tab.[ch] clixon_yang_parse.[co]
|
||||
rm -f lex.clixon_yang_parse.c
|
||||
rm -f lex.clixon_xml_parse.c
|
||||
# disabled when USE_DBSPEC_PT is disabled in clixon_config.h.in
|
||||
# rm -f clixon_dbspec.tab.[ch] clixon_dbspec.[co]
|
||||
# rm -f lex.clixon_dbspec.c
|
||||
|
||||
#############################################################################
|
||||
# Implicit rules for lex and yacc.
|
||||
|
|
@ -100,27 +100,27 @@ clean:
|
|||
%.c : %.l # cancel implicit lex rule
|
||||
|
||||
# xml parser
|
||||
lex.clicon_xml_parse.c : clicon_xml_parse.l clicon_xml_parse.tab.h
|
||||
$(LEX) -Pclicon_xml_parse clicon_xml_parse.l # -d is debug
|
||||
lex.clixon_xml_parse.c : clixon_xml_parse.l clixon_xml_parse.tab.h
|
||||
$(LEX) -Pclixon_xml_parse clixon_xml_parse.l # -d is debug
|
||||
|
||||
clicon_xml_parse.tab.c clicon_xml_parse.tab.h: clicon_xml_parse.y
|
||||
$(YACC) -l -d -p clicon_xml_parse clicon_xml_parse.y # -t is debug
|
||||
mv y.tab.c clicon_xml_parse.tab.c
|
||||
mv y.tab.h clicon_xml_parse.tab.h
|
||||
clixon_xml_parse.tab.c clixon_xml_parse.tab.h: clixon_xml_parse.y
|
||||
$(YACC) -l -d -p clixon_xml_parse clixon_xml_parse.y # -t is debug
|
||||
mv y.tab.c clixon_xml_parse.tab.c
|
||||
mv y.tab.h clixon_xml_parse.tab.h
|
||||
|
||||
lex.clicon_xml_parse.o : lex.clicon_xml_parse.c clicon_xml_parse.tab.h # special rule to for make clean to work
|
||||
lex.clixon_xml_parse.o : lex.clixon_xml_parse.c clixon_xml_parse.tab.h # special rule to for make clean to work
|
||||
$(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -Wno-error -c $<
|
||||
|
||||
# clicon_yang parser
|
||||
lex.clicon_yang_parse.c : clicon_yang_parse.l clicon_yang_parse.tab.h
|
||||
$(LEX) -Pclicon_yang_parse clicon_yang_parse.l # -d is debug
|
||||
# clixon_yang parser
|
||||
lex.clixon_yang_parse.c : clixon_yang_parse.l clixon_yang_parse.tab.h
|
||||
$(LEX) -Pclixon_yang_parse clixon_yang_parse.l # -d is debug
|
||||
|
||||
clicon_yang_parse.tab.c clicon_yang_parse.tab.h: clicon_yang_parse.y
|
||||
$(YACC) -l -d -p clicon_yang_parse clicon_yang_parse.y # -t is debug
|
||||
mv y.tab.c clicon_yang_parse.tab.c
|
||||
mv y.tab.h clicon_yang_parse.tab.h
|
||||
clixon_yang_parse.tab.c clixon_yang_parse.tab.h: clixon_yang_parse.y
|
||||
$(YACC) -l -d -p clixon_yang_parse clixon_yang_parse.y # -t is debug
|
||||
mv y.tab.c clixon_yang_parse.tab.c
|
||||
mv y.tab.h clixon_yang_parse.tab.h
|
||||
|
||||
lex.clicon_yang_parse.o : lex.clicon_yang_parse.c clicon_yang_parse.tab.h
|
||||
lex.clixon_yang_parse.o : lex.clixon_yang_parse.c clixon_yang_parse.tab.h
|
||||
$(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -Wno-error -c $<
|
||||
|
||||
distclean: clean
|
||||
|
|
@ -134,13 +134,13 @@ distclean: clean
|
|||
|
||||
.PHONY: build.c
|
||||
build.c:
|
||||
date +"const char CLICON_BUILDSTR[64]=\"%Y.%m.%d %H:%M by `whoami` on `hostname`"\"\; > build.c;
|
||||
echo "const char CLICON_VERSION[64]=\"$(CLICON_VERSION)\""\; >> build.c;
|
||||
date +"const char CLIXON_BUILDSTR[64]=\"%Y.%m.%d %H:%M by `whoami` on `hostname`"\"\; > build.c;
|
||||
echo "const char CLIXON_VERSION[64]=\"$(CLIXON_VERSION)\""\; >> build.c;
|
||||
|
||||
|
||||
$(MYLIB) : $(GENOBJS) $(OBJS)
|
||||
$(CC) -shared -Wl,-soname,$(MYLIBSO) -o $@ $(GENOBJS) $(OBJS) $(LIBS) -Wl,-soname=$(MYLIBSO)
|
||||
# link-name is needed for application linking, eg for clicon_cli and clicon_config
|
||||
# link-name is needed for application linking, eg for clixon_cli and clixon_config
|
||||
$(MYLIBLINK) : $(MYLIB)
|
||||
# ln -sf $(MYLIB) $@
|
||||
|
||||
|
|
@ -154,8 +154,8 @@ install-include:
|
|||
install-lib: $(MYLIB)
|
||||
install -m 755 -d $(DESTDIR)$(libdir)
|
||||
install -m 755 $(MYLIB) $(DESTDIR)$(libdir)
|
||||
ln -sf $(MYLIB) $(DESTDIR)$(libdir)/$(MYLIBSO) # -l:libclicon.so.2
|
||||
ln -sf $(MYLIBSO) $(DESTDIR)$(libdir)/$(MYLIBLINK) # -l:libclicon.so
|
||||
ln -sf $(MYLIB) $(DESTDIR)$(libdir)/$(MYLIBSO) # -l:libclixon.so.3
|
||||
ln -sf $(MYLIBSO) $(DESTDIR)$(libdir)/$(MYLIBLINK) # -l:libclixon.so
|
||||
|
||||
uninstall:
|
||||
rm -f $(libdir)/$(MYLIB)
|
||||
|
|
|
|||
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
|
||||
CLICON 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.
|
||||
|
||||
CLICON 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 CLICON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
* XML parser
|
||||
*/
|
||||
#ifndef _CLICON_XML_PARSE_H_
|
||||
#define _CLICON_XML_PARSE_H_
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
struct xml_parse_yacc_arg{
|
||||
char *ya_parse_string; /* original (copy of) parse string */
|
||||
int ya_linenum; /* Number of \n in parsed buffer */
|
||||
void *ya_lexbuf; /* internal parse buffer from lex */
|
||||
|
||||
cxobj *ya_xelement; /* xml active element */
|
||||
cxobj *ya_xparent; /* xml parent element*/
|
||||
};
|
||||
|
||||
extern char *clicon_xml_parsetext;
|
||||
|
||||
/*
|
||||
* Prototypes
|
||||
*/
|
||||
int clicon_xml_parsel_init(struct xml_parse_yacc_arg *ya);
|
||||
int clicon_xml_parsel_exit(struct xml_parse_yacc_arg *ya);
|
||||
|
||||
int clicon_xml_parsel_linenr(void);
|
||||
int clicon_xml_parselex(void *);
|
||||
int clicon_xml_parseparse(void *);
|
||||
|
||||
#endif /* _CLICON_XML_PARSE_H_ */
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*
|
||||
|
|
@ -34,8 +34,8 @@
|
|||
#include <sys/types.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_chunk.h"
|
||||
|
||||
/*
|
||||
* The chunk head array for the predefined chunk sizes.
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -42,10 +42,10 @@
|
|||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_err.h"
|
||||
|
||||
/*
|
||||
* Types
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -37,10 +37,10 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_event.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_event.h"
|
||||
|
||||
/*
|
||||
* Constants
|
||||
|
|
@ -2,26 +2,26 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h"
|
||||
#include "clixon_config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -43,11 +43,11 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_string.h"
|
||||
#include "clicon_file.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_string.h"
|
||||
#include "clixon_file.h"
|
||||
|
||||
/*
|
||||
* Resolve the real path of a given 'path', following symbolic links and '../'.
|
||||
|
|
@ -2,26 +2,26 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h"
|
||||
#include "clixon_config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -34,12 +34,12 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_yang.h"
|
||||
#include "clicon_options.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_yang.h"
|
||||
#include "clixon_options.h"
|
||||
|
||||
#define CLICON_MAGIC 0x99aafabe
|
||||
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -76,9 +76,9 @@
|
|||
#include <inttypes.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_hash.h"
|
||||
|
||||
#define HASH_SIZE 1031 /* Number of hash buckets. Should be a prime */
|
||||
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -40,8 +40,8 @@
|
|||
#include <sys/types.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_log.h"
|
||||
|
||||
/* The global debug level. 0 means no debug */
|
||||
int debug = 0;
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* options
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -44,14 +44,14 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_yang.h"
|
||||
#include "clicon_options.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_yang.h"
|
||||
#include "clixon_options.h"
|
||||
|
||||
/*
|
||||
* clicon_option_dump
|
||||
|
|
@ -174,10 +174,6 @@ clicon_option_default(clicon_hash_t *copt)
|
|||
if (hash_add(copt, "CLICON_AUTOCOMMIT", "0", strlen("0")+1) < 0)
|
||||
goto catch;
|
||||
}
|
||||
if (!hash_lookup(copt, "CLICON_COMMIT_ORDER")){
|
||||
if (hash_add(copt, "CLICON_COMMIT_ORDER", "0", strlen("0")+1) < 0)
|
||||
goto catch;
|
||||
}
|
||||
/* Legacy is 1 but default should really be 0. New apps should use 0 */
|
||||
if (!hash_lookup(copt, "CLICON_CLI_VARONLY")){
|
||||
if (hash_add(copt, "CLICON_CLI_VARONLY", "1", strlen("1")+1) < 0)
|
||||
|
|
@ -582,23 +578,6 @@ clicon_autocommit_set(clicon_handle h, int val)
|
|||
return clicon_option_int_set(h, "CLICON_AUTOCOMMIT", val);
|
||||
}
|
||||
|
||||
/*! Get backend callback order.
|
||||
* 0: all callbacks in (rising) priority order
|
||||
* 1: first delete operations in declining prio order; then add/change in prio order
|
||||
* 2: like (1) but CHANGE is replaced by (DEL;ADD)
|
||||
*/
|
||||
int
|
||||
clicon_commit_order(clicon_handle h)
|
||||
{
|
||||
char const *opt = "CLICON_COMMIT_ORDER";
|
||||
|
||||
if (clicon_option_exists(h, opt))
|
||||
return clicon_option_int(h, opt);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*! Dont include keys in cvec in cli vars callbacks
|
||||
*/
|
||||
int
|
||||
|
|
@ -2,25 +2,25 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -29,11 +29,11 @@
|
|||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_plugin.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_plugin.h"
|
||||
|
||||
|
||||
static find_plugin_t *
|
||||
|
|
@ -2,26 +2,26 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h"
|
||||
#include "clixon_config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -42,13 +42,13 @@
|
|||
#include <sys/resource.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_sig.h"
|
||||
#include "clicon_string.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_proc.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_sig.h"
|
||||
#include "clixon_string.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_proc.h"
|
||||
|
||||
/*
|
||||
* Macros
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -50,13 +50,13 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_sig.h"
|
||||
#include "clicon_proto.h"
|
||||
#include "clicon_proto_encode.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_sig.h"
|
||||
#include "clixon_proto.h"
|
||||
#include "clixon_proto_encode.h"
|
||||
|
||||
static int _atomicio_sig = 0;
|
||||
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
@ -41,17 +41,17 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_yang.h"
|
||||
#include "clicon_options.h"
|
||||
#include "clicon_proto.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_xml.h"
|
||||
#include "clicon_proto_encode.h"
|
||||
#include "clicon_proto_client.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_yang.h"
|
||||
#include "clixon_options.h"
|
||||
#include "clixon_proto.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_xml.h"
|
||||
#include "clixon_proto_encode.h"
|
||||
#include "clixon_proto_client.h"
|
||||
|
||||
/*! Internal rpc function
|
||||
* @param[in] h CLICON handle
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -48,15 +48,15 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_sig.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_proto.h"
|
||||
#include "clicon_proto_encode.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_sig.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_proto.h"
|
||||
#include "clixon_proto_encode.h"
|
||||
|
||||
/* Generic encode/decode functions for exactly one C-string (str)
|
||||
*/
|
||||
|
|
@ -2,26 +2,26 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h"
|
||||
#include "clixon_config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -46,11 +46,11 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_qdb.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_qdb.h"
|
||||
|
||||
/*! Initialize database
|
||||
* @param[in] file database file
|
||||
|
|
@ -58,8 +58,8 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_err.h"
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -2,26 +2,26 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -34,9 +34,9 @@
|
|||
#include <errno.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_sig.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_sig.h"
|
||||
|
||||
/*
|
||||
* Set a signal handler.
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
ensure errno is set and return -1/NULL */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h"
|
||||
#include "clixon_config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -35,10 +35,10 @@
|
|||
#include <ctype.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_string.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_string.h"
|
||||
#include "clixon_err.h"
|
||||
|
||||
/*! Split string into a vector based on character delimiters
|
||||
*
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
* XML support functions.
|
||||
|
|
@ -35,12 +35,12 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_xml.h"
|
||||
#include "clicon_xml_parse.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_xml.h"
|
||||
#include "clixon_xml_parse.h"
|
||||
|
||||
/*
|
||||
* Constants
|
||||
|
|
@ -750,14 +750,14 @@ xml_parse(char **str, cxobj *x_up)
|
|||
return -1;
|
||||
}
|
||||
ya.ya_xparent = x_up;
|
||||
if (clicon_xml_parsel_init(&ya) < 0)
|
||||
if (clixon_xml_parsel_init(&ya) < 0)
|
||||
goto done;
|
||||
if (clicon_xml_parseparse(&ya) != 0) /* yacc returns 1 on error */
|
||||
if (clixon_xml_parseparse(&ya) != 0) /* yacc returns 1 on error */
|
||||
goto done;
|
||||
|
||||
retval = 0;
|
||||
done:
|
||||
clicon_xml_parsel_exit(&ya);
|
||||
clixon_xml_parsel_exit(&ya);
|
||||
if(ya.ya_parse_string != NULL)
|
||||
free(ya.ya_parse_string);
|
||||
return retval;
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
* XML database
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
* TODO: xmldb_get: xpath: only load partial tree
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -41,20 +41,20 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_string.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_qdb.h"
|
||||
#include "clicon_yang.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_xml.h"
|
||||
#include "clicon_xsl.h"
|
||||
#include "clicon_xml_parse.h"
|
||||
#include "clicon_xml_db.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_string.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_qdb.h"
|
||||
#include "clixon_yang.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_xml.h"
|
||||
#include "clixon_xsl.h"
|
||||
#include "clixon_xml_parse.h"
|
||||
#include "clixon_xml_db.h"
|
||||
|
||||
/*
|
||||
* An xml database consists of key-value pairs for xml-trees.
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
* +---------+
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -59,20 +59,20 @@
|
|||
|
||||
/* clicon */
|
||||
|
||||
#include "clicon_string.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_yang.h"
|
||||
#include "clicon_yang_type.h"
|
||||
#include "clicon_options.h"
|
||||
#include "clicon_qdb.h"
|
||||
#include "clicon_xml.h"
|
||||
#include "clicon_xsl.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_xml_map.h"
|
||||
#include "clixon_string.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_yang.h"
|
||||
#include "clixon_yang_type.h"
|
||||
#include "clixon_options.h"
|
||||
#include "clixon_qdb.h"
|
||||
#include "clixon_xml.h"
|
||||
#include "clixon_xsl.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_xml_map.h"
|
||||
|
||||
/* Something to do with reverse engineering of junos syntax? */
|
||||
#undef SPECIAL_TREATMENT_OF_NAME
|
||||
50
lib/src/clixon_xml_parse.h
Normal file
50
lib/src/clixon_xml_parse.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
*
|
||||
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/>.
|
||||
|
||||
* XML parser
|
||||
*/
|
||||
#ifndef _CLIXON_XML_PARSE_H_
|
||||
#define _CLIXON_XML_PARSE_H_
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
struct xml_parse_yacc_arg{
|
||||
char *ya_parse_string; /* original (copy of) parse string */
|
||||
int ya_linenum; /* Number of \n in parsed buffer */
|
||||
void *ya_lexbuf; /* internal parse buffer from lex */
|
||||
|
||||
cxobj *ya_xelement; /* xml active element */
|
||||
cxobj *ya_xparent; /* xml parent element*/
|
||||
};
|
||||
|
||||
extern char *clixon_xml_parsetext;
|
||||
|
||||
/*
|
||||
* Prototypes
|
||||
*/
|
||||
int clixon_xml_parsel_init(struct xml_parse_yacc_arg *ya);
|
||||
int clixon_xml_parsel_exit(struct xml_parse_yacc_arg *ya);
|
||||
|
||||
int clixon_xml_parsel_linenr(void);
|
||||
int clixon_xml_parselex(void *);
|
||||
int clixon_xml_parseparse(void *);
|
||||
|
||||
#endif /* _CLIXON_XML_PARSE_H_ */
|
||||
|
|
@ -23,23 +23,23 @@
|
|||
|
||||
%{
|
||||
|
||||
#include "clicon_config.h"
|
||||
#include "clixon_config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "clicon_xml_parse.tab.h" /* generated file */
|
||||
#include "clixon_xml_parse.tab.h" /* generated file */
|
||||
|
||||
/* cligen */
|
||||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_xml.h"
|
||||
#include "clicon_xml_parse.h"
|
||||
#include "clixon_xml.h"
|
||||
#include "clixon_xml_parse.h"
|
||||
|
||||
/* Redefine main lex function so that you can send arguments to it: _ya is added to arg list */
|
||||
#define YY_DECL int clicon_xml_parselex(void *_ya)
|
||||
#define YY_DECL int clixon_xml_parselex(void *_ya)
|
||||
|
||||
/* Dont use input function (use user-buffer) */
|
||||
#define YY_NO_INPUT
|
||||
|
|
@ -47,8 +47,8 @@
|
|||
/* typecast macro */
|
||||
#define _YA ((struct xml_parse_yacc_arg *)_ya)
|
||||
|
||||
#undef clicon_xml_parsewrap
|
||||
int clicon_xml_parsewrap(void)
|
||||
#undef clixon_xml_parsewrap
|
||||
int clixon_xml_parsewrap(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -64,57 +64,57 @@ int clicon_xml_parsewrap(void)
|
|||
%s STRSQ
|
||||
|
||||
%%
|
||||
<START>[0-9A-Za-z_\-]+ { clicon_xml_parselval.string = strdup(yytext);
|
||||
<START>[0-9A-Za-z_\-]+ { clixon_xml_parselval.string = strdup(yytext);
|
||||
return NAME; /* rather be catch-all */
|
||||
}
|
||||
<START>[ \t]+ ;
|
||||
<START>\: return *clicon_xml_parsetext;
|
||||
<START>\: return *clixon_xml_parsetext;
|
||||
<START>\n { _YA->ya_linenum++;}
|
||||
<START>"<?xml" { BEGIN(TEXTDECL); return BTEXT;}
|
||||
<START>"/>" { BEGIN(STATEA); return ESLASH; }
|
||||
<START>"<!--" { BEGIN(CMNT); return BCOMMENT; }
|
||||
<START>"</" return BSLASH;
|
||||
<START>[/=] return *clicon_xml_parsetext;
|
||||
<START>\< return *clicon_xml_parsetext;
|
||||
<START>\> { BEGIN(STATEA); return *clicon_xml_parsetext; }
|
||||
<START>[/=] return *clixon_xml_parsetext;
|
||||
<START>\< return *clixon_xml_parsetext;
|
||||
<START>\> { BEGIN(STATEA); return *clixon_xml_parsetext; }
|
||||
|
||||
<START>\" { BEGIN(STR); return *clicon_xml_parsetext; }
|
||||
<START>. { clicon_xml_parselval.string = yytext; return CHAR; /*XXX:optimize*/ }
|
||||
<START>\" { BEGIN(STR); return *clixon_xml_parsetext; }
|
||||
<START>. { clixon_xml_parselval.string = yytext; return CHAR; /*XXX:optimize*/ }
|
||||
|
||||
|
||||
<STATEA>"</" { BEGIN(START); return BSLASH; }
|
||||
<STATEA>"<!--" { BEGIN(CMNT); return BCOMMENT; }
|
||||
<STATEA>\< { BEGIN(START); return *clicon_xml_parsetext; }
|
||||
<STATEA>\n { clicon_xml_parselval.string = yytext;_YA->ya_linenum++; return (CHAR);}
|
||||
<STATEA>. { clicon_xml_parselval.string = yytext; return CHAR; /*XXX:optimize*/}
|
||||
<STATEA>\< { BEGIN(START); return *clixon_xml_parsetext; }
|
||||
<STATEA>\n { clixon_xml_parselval.string = yytext;_YA->ya_linenum++; return (CHAR);}
|
||||
<STATEA>. { clixon_xml_parselval.string = yytext; return CHAR; /*XXX:optimize*/}
|
||||
|
||||
<CMNT>"-->" { BEGIN(START); return ECOMMENT; }
|
||||
<CMNT>\n _YA->ya_linenum++;
|
||||
<CMNT>.
|
||||
<TEXTDECL>encoding return ENC;
|
||||
<TEXTDECL>version return VER;
|
||||
<TEXTDECL>"=" return *clicon_xml_parsetext;
|
||||
<TEXTDECL>"=" return *clixon_xml_parsetext;
|
||||
<TEXTDECL>"?>" { BEGIN(START);return ETEXT;}
|
||||
<TEXTDECL>\" { BEGIN(STRDQ); return *clicon_xml_parsetext; }
|
||||
<TEXTDECL>\' { BEGIN(STRSQ); return *clicon_xml_parsetext; }
|
||||
<TEXTDECL>\" { BEGIN(STRDQ); return *clixon_xml_parsetext; }
|
||||
<TEXTDECL>\' { BEGIN(STRSQ); return *clixon_xml_parsetext; }
|
||||
|
||||
<STR>[^\"]+ { clicon_xml_parselval.string = strdup(yytext); return CHAR; }
|
||||
<STR>\" { BEGIN(START); return *clicon_xml_parsetext; }
|
||||
<STR>[^\"]+ { clixon_xml_parselval.string = strdup(yytext); return CHAR; }
|
||||
<STR>\" { BEGIN(START); return *clixon_xml_parsetext; }
|
||||
|
||||
<STRDQ>1\.[0-9]+ { clicon_xml_parselval.string = strdup(yytext); return CHAR; }
|
||||
<STRDQ>[^\"]+ { clicon_xml_parselval.string = strdup(yytext); return CHAR; }
|
||||
<STRDQ>\" { BEGIN(TEXTDECL); return *clicon_xml_parsetext; }
|
||||
<STRDQ>1\.[0-9]+ { clixon_xml_parselval.string = strdup(yytext); return CHAR; }
|
||||
<STRDQ>[^\"]+ { clixon_xml_parselval.string = strdup(yytext); return CHAR; }
|
||||
<STRDQ>\" { BEGIN(TEXTDECL); return *clixon_xml_parsetext; }
|
||||
|
||||
<STRSQ>1\.[0-9]+ { clicon_xml_parselval.string = strdup(yytext); return CHAR; }
|
||||
<STRSQ>[^\']+ { clicon_xml_parselval.string = strdup(yytext); return CHAR; }
|
||||
<STRSQ>\' { BEGIN(TEXTDECL); return *clicon_xml_parsetext; }
|
||||
<STRSQ>1\.[0-9]+ { clixon_xml_parselval.string = strdup(yytext); return CHAR; }
|
||||
<STRSQ>[^\']+ { clixon_xml_parselval.string = strdup(yytext); return CHAR; }
|
||||
<STRSQ>\' { BEGIN(TEXTDECL); return *clixon_xml_parsetext; }
|
||||
|
||||
%%
|
||||
|
||||
/*! Initialize XML scanner.
|
||||
*/
|
||||
int
|
||||
clicon_xml_parsel_init(struct xml_parse_yacc_arg *ya)
|
||||
clixon_xml_parsel_init(struct xml_parse_yacc_arg *ya)
|
||||
{
|
||||
BEGIN(START);
|
||||
ya->ya_lexbuf = yy_scan_string (ya->ya_parse_string);
|
||||
|
|
@ -125,11 +125,11 @@ clicon_xml_parsel_init(struct xml_parse_yacc_arg *ya)
|
|||
|
||||
/*! Exit xml scanner */
|
||||
int
|
||||
clicon_xml_parsel_exit(struct xml_parse_yacc_arg *ya)
|
||||
clixon_xml_parsel_exit(struct xml_parse_yacc_arg *ya)
|
||||
{
|
||||
yy_delete_buffer(ya->ya_lexbuf);
|
||||
#if defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION >= 9
|
||||
clicon_xml_parselex_destroy(); /* modern */
|
||||
clixon_xml_parselex_destroy(); /* modern */
|
||||
#else
|
||||
yy_init = 1; /* This does not quite free all buffers */
|
||||
#endif
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
* XML parser
|
||||
|
|
@ -53,16 +53,16 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_xml.h"
|
||||
#include "clicon_xml_parse.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_xml.h"
|
||||
#include "clixon_xml_parse.h"
|
||||
|
||||
void
|
||||
clicon_xml_parseerror(void *_ya, char *s)
|
||||
clixon_xml_parseerror(void *_ya, char *s)
|
||||
{
|
||||
clicon_err(OE_XML, 0, "xml_parse: line %d: %s: at or before: %s",
|
||||
_YA->ya_linenum, s, clicon_xml_parsetext);
|
||||
_YA->ya_linenum, s, clixon_xml_parsetext);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
* Limited XML XPATH and XSLT functions.
|
||||
|
|
@ -73,10 +73,10 @@ to the xml standards:
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_xml.h"
|
||||
#include "clicon_xsl.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_xml.h"
|
||||
#include "clixon_xsl.h"
|
||||
|
||||
/* Constants */
|
||||
#define XPATH_VEC_START 128
|
||||
|
|
@ -2,27 +2,27 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
* Yang functions
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -44,19 +44,19 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_string.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_file.h"
|
||||
#include "clicon_yang.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_options.h"
|
||||
#include "clicon_yang_type.h"
|
||||
#include "clicon_yang_parse.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_string.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_file.h"
|
||||
#include "clixon_yang.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_options.h"
|
||||
#include "clixon_yang_type.h"
|
||||
#include "clixon_yang_parse.h"
|
||||
|
||||
/* Instead of using dynamic type lookup, use a cache that is evaluated early
|
||||
for static scope type binding */
|
||||
|
|
@ -1201,7 +1201,7 @@ yang_expand(yang_node *yn)
|
|||
* yang_parse2 # Find file from yang (sub)module
|
||||
* yang_parse_file # Read yang file into a string
|
||||
* yang_parse_str # Set up yacc parser and call it given a string
|
||||
* clicon_yang_parseparse # Actual yang parsing using yacc
|
||||
* clixon_yang_parseparse # Actual yang parsing using yacc
|
||||
*/
|
||||
static yang_stmt *
|
||||
yang_parse_str(clicon_handle h,
|
||||
|
|
@ -1226,7 +1226,7 @@ yang_parse_str(clicon_handle h,
|
|||
goto done;
|
||||
if (yang_parse_init(&yy, yspec) < 0)
|
||||
goto done;
|
||||
if (clicon_yang_parseparse(&yy) != 0) { /* yacc returns 1 on error */
|
||||
if (clixon_yang_parseparse(&yy) != 0) { /* yacc returns 1 on error */
|
||||
clicon_log(LOG_NOTICE, "Yang error: %s on line %d", name, yy.yy_linenum);
|
||||
if (clicon_errno == 0)
|
||||
clicon_err(OE_YANG, 0, "yang parser error with no error code (should not happen)");
|
||||
|
|
@ -1263,7 +1263,7 @@ yang_parse_str(clicon_handle h,
|
|||
* yang_parse2 # Find file from yang (sub)module
|
||||
* yang_parse_file # Read yang file into a string
|
||||
* yang_parse_str # Set up yacc parser and call it given a string
|
||||
* clicon_yang_parseparse # Actual yang parsing using yacc
|
||||
* clixon_yang_parseparse # Actual yang parsing using yacc
|
||||
*/
|
||||
static yang_stmt *
|
||||
yang_parse_file(clicon_handle h,
|
||||
|
|
@ -1371,7 +1371,7 @@ yang_parse_find_match(clicon_handle h,
|
|||
* yang_parse2 # Find file from yang (sub)module
|
||||
* yang_parse_file # Read yang file into a string
|
||||
* yang_parse_str # Set up yacc parser and call it given a string
|
||||
* clicon_yang_parseparse # Actual yang parsing using yacc
|
||||
* clixon_yang_parseparse # Actual yang parsing using yacc
|
||||
*/
|
||||
static yang_stmt *
|
||||
yang_parse2(clicon_handle h,
|
||||
|
|
@ -1437,7 +1437,7 @@ yang_parse2(clicon_handle h,
|
|||
* yang_parse2 # Find file from yang (sub)module
|
||||
* yang_parse_file # Read yang file into a string
|
||||
* yang_parse_str # Set up yacc parser and call it given a string
|
||||
* clicon_yang_parseparse # Actual yang parsing using yacc
|
||||
* clixon_yang_parseparse # Actual yang parsing using yacc
|
||||
*/
|
||||
static yang_stmt *
|
||||
yang_parse1(clicon_handle h,
|
||||
|
|
@ -1490,7 +1490,7 @@ yang_parse1(clicon_handle h,
|
|||
* yang_parse2 # Find file from yang (sub)module
|
||||
* yang_parse_file # Read yang file into a string
|
||||
* yang_parse_str # Set up yacc parser and call it given a string
|
||||
* clicon_yang_parseparse # Actual yang parsing using yacc
|
||||
* clixon_yang_parseparse # Actual yang parsing using yacc
|
||||
*/
|
||||
int
|
||||
yang_parse(clicon_handle h,
|
||||
|
|
@ -2,27 +2,27 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
* Database specification parser cli syntax
|
||||
* (Cloned from cligen parser)
|
||||
*/
|
||||
#ifndef _CLICON_YANG_PARSE_H_
|
||||
#define _CLICON_YANG_PARSE_H_
|
||||
#ifndef _CLIXON_YANG_PARSE_H_
|
||||
#define _CLIXON_YANG_PARSE_H_
|
||||
|
||||
/*
|
||||
* Types
|
||||
|
|
@ -64,7 +64,7 @@ struct yang_userdata{
|
|||
/*
|
||||
* Variables
|
||||
*/
|
||||
extern char *clicon_yang_parsetext;
|
||||
extern char *clixon_yang_parsetext;
|
||||
|
||||
/*
|
||||
* Prototypes
|
||||
|
|
@ -75,11 +75,11 @@ int yang_scan_exit(struct clicon_yang_yacc_arg *ya);
|
|||
int yang_parse_init(struct clicon_yang_yacc_arg *ya, yang_spec *ysp);
|
||||
int yang_parse_exit(struct clicon_yang_yacc_arg *ya);
|
||||
|
||||
int clicon_yang_parselex(void *_ya);
|
||||
int clicon_yang_parseparse(void *);
|
||||
void clicon_yang_parseerror(void *_ya, char*);
|
||||
int clixon_yang_parselex(void *_ya);
|
||||
int clixon_yang_parseparse(void *);
|
||||
void clixon_yang_parseerror(void *_ya, char*);
|
||||
|
||||
int ystack_pop(struct clicon_yang_yacc_arg *ya);
|
||||
struct ys_stack *ystack_push(struct clicon_yang_yacc_arg *ya, yang_node *yn);
|
||||
|
||||
#endif /* _CLICON_YANG_PARSE_H_ */
|
||||
#endif /* _CLIXON_YANG_PARSE_H_ */
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
* Database specification parser cli syntax
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
%{
|
||||
|
||||
#include "clicon_config.h"
|
||||
#include "clixon_config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
|
@ -32,18 +32,18 @@
|
|||
#include <errno.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include "clicon_yang_parse.tab.h" /* generated */
|
||||
#include "clixon_yang_parse.tab.h" /* generated */
|
||||
|
||||
#include <cligen/cligen.h>
|
||||
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_yang.h"
|
||||
#include "clicon_yang_parse.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_yang.h"
|
||||
#include "clixon_yang_parse.h"
|
||||
|
||||
/* Redefine main lex function so that you can send arguments to it: _yy is added to arg list */
|
||||
#define YY_DECL int clicon_yang_parselex(void *_yy)
|
||||
#define YY_DECL int clixon_yang_parselex(void *_yy)
|
||||
|
||||
/* Dont use input function (use user-buffer) */
|
||||
#define YY_NO_INPUT
|
||||
|
|
@ -56,9 +56,9 @@
|
|||
#define MAX(x,y) ((x)>(y)?(x):(y))
|
||||
#define MIN(x,y) ((x)<(y)?(x):(y))
|
||||
|
||||
#undef clicon_yang_parsewrap
|
||||
#undef clixon_yang_parsewrap
|
||||
int
|
||||
clicon_yang_parsewrap(void)
|
||||
clixon_yang_parsewrap(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ stripdup(char *s0)
|
|||
<ARGUMENT>\' { _YY->yy_lex_string_state =ARGUMENT; BEGIN(STRING2); return DQ; }
|
||||
<ARGUMENT>\+ { return *yytext; /* many arg rules dont like this */ }
|
||||
<ARGUMENT>: { return *yytext; /* many arg rules dont like this */ }
|
||||
<ARGUMENT>. { clicon_yang_parselval.string = strdup(yytext);
|
||||
<ARGUMENT>. { clixon_yang_parselval.string = strdup(yytext);
|
||||
return CHAR;}
|
||||
|
||||
<STRING0>\{ { BEGIN(KEYWORD); return *yytext; }
|
||||
|
|
@ -197,24 +197,24 @@ stripdup(char *s0)
|
|||
<STRING0>\" { _YY->yy_lex_string_state =STRING0; BEGIN(STRING1); return DQ; }
|
||||
<STRING0>\' { _YY->yy_lex_string_state =STRING0; BEGIN(STRING2); return DQ; }
|
||||
<STRING0>\+ { return *yytext; }
|
||||
<STRING0>. { clicon_yang_parselval.string = strdup(yytext);
|
||||
<STRING0>. { clixon_yang_parselval.string = strdup(yytext);
|
||||
return CHAR;}
|
||||
|
||||
|
||||
<STRING1>\\ { _YY->yy_lex_state = STRING1; BEGIN(ESCAPE); }
|
||||
<STRING1>\" { BEGIN(_YY->yy_lex_string_state); return DQ; }
|
||||
<STRING1>\n { _YY->yy_linenum++; clicon_yang_parselval.string = strdup(yytext); return CHAR;}
|
||||
<STRING1>. { clicon_yang_parselval.string = strdup(yytext);
|
||||
<STRING1>\n { _YY->yy_linenum++; clixon_yang_parselval.string = strdup(yytext); return CHAR;}
|
||||
<STRING1>. { clixon_yang_parselval.string = strdup(yytext);
|
||||
return CHAR;}
|
||||
|
||||
<STRING2>\\ { _YY->yy_lex_state = STRING2; BEGIN(ESCAPE); }
|
||||
<STRING2>\' { BEGIN(_YY->yy_lex_string_state); return DQ; }
|
||||
<STRING2>\n { _YY->yy_linenum++; clicon_yang_parselval.string = strdup(yytext); return CHAR;}
|
||||
<STRING2>. { clicon_yang_parselval.string = strdup(yytext);
|
||||
<STRING2>\n { _YY->yy_linenum++; clixon_yang_parselval.string = strdup(yytext); return CHAR;}
|
||||
<STRING2>. { clixon_yang_parselval.string = strdup(yytext);
|
||||
return CHAR;}
|
||||
|
||||
<ESCAPE>. { BEGIN(_YY->yy_lex_state);
|
||||
clicon_yang_parselval.string = strdup(yytext);
|
||||
clixon_yang_parselval.string = strdup(yytext);
|
||||
return CHAR; }
|
||||
<COMMENT1>[^*\n]* /* eat anything that's not a '*' */
|
||||
<COMMENT1>"*"+[^*/\n]* /* eat up '*'s not followed by '/'s */
|
||||
|
|
@ -251,7 +251,7 @@ yang_scan_exit(struct clicon_yang_yacc_arg *yy)
|
|||
{
|
||||
yy_delete_buffer(yy->yy_lexbuf);
|
||||
#if defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION >= 9
|
||||
clicon_yang_parselex_destroy(); /* modern */
|
||||
clixon_yang_parselex_destroy(); /* modern */
|
||||
#else
|
||||
yy_init = 1; /* This does not quite free all buffers */
|
||||
#endif
|
||||
|
|
@ -2,20 +2,20 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
|
@ -125,12 +125,12 @@
|
|||
/* typecast macro */
|
||||
#define _YY ((struct clicon_yang_yacc_arg *)_yy)
|
||||
|
||||
#define _YYERROR(msg) {clicon_debug(2, "YYERROR %s '%s' %d", (msg), clicon_yang_parsetext, _YY->yy_linenum); YYERROR;}
|
||||
#define _YYERROR(msg) {clicon_debug(2, "YYERROR %s '%s' %d", (msg), clixon_yang_parsetext, _YY->yy_linenum); YYERROR;}
|
||||
|
||||
/* add _yy to error paramaters */
|
||||
#define YY_(msgid) msgid
|
||||
|
||||
#include "clicon_config.h"
|
||||
#include "clixon_config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
|
@ -146,15 +146,15 @@
|
|||
|
||||
#include <cligen/cligen.h>
|
||||
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_yang.h"
|
||||
#include "clicon_yang_parse.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_yang.h"
|
||||
#include "clixon_yang_parse.h"
|
||||
|
||||
extern int clicon_yang_parseget_lineno (void);
|
||||
extern int clixon_yang_parseget_lineno (void);
|
||||
|
||||
int
|
||||
clicon_yang_debug(int d)
|
||||
|
|
@ -164,17 +164,17 @@ clicon_yang_debug(int d)
|
|||
}
|
||||
|
||||
/*
|
||||
clicon_yang_parseerror
|
||||
clixon_yang_parseerror
|
||||
also called from yacc generated code *
|
||||
*/
|
||||
void
|
||||
clicon_yang_parseerror(void *_yy, char *s)
|
||||
clixon_yang_parseerror(void *_yy, char *s)
|
||||
{
|
||||
clicon_err(OE_YANG, 0, "%s on line %d: %s at or before: '%s'",
|
||||
_YY->yy_name,
|
||||
_YY->yy_linenum ,
|
||||
s,
|
||||
clicon_yang_parsetext);
|
||||
clixon_yang_parsetext);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -306,7 +306,7 @@ file : module_stmt MY_EOF
|
|||
{ clicon_debug(2,"file->submodule-stmt"); YYACCEPT; }
|
||||
;
|
||||
|
||||
unknown_stmt : K_UNKNOWN { clicon_yang_parseerror(_yy, "unknown statement");clicon_debug(2,"unknown-stmt"); _YYERROR("0"); }
|
||||
unknown_stmt : K_UNKNOWN { clixon_yang_parseerror(_yy, "unknown statement");clicon_debug(2,"unknown-stmt"); _YYERROR("0"); }
|
||||
;
|
||||
|
||||
/* module */
|
||||
|
|
@ -2,27 +2,27 @@
|
|||
*
|
||||
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
|
||||
|
||||
This file is part of CLICON.
|
||||
This file is part of CLIXON.
|
||||
|
||||
CLICON is free software; you can redistribute it and/or modify
|
||||
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.
|
||||
|
||||
CLICON is distributed in the hope that it will be useful,
|
||||
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 CLICON; see the file LICENSE. If not, see
|
||||
along with CLIXON; see the file LICENSE. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
* Yang type related functions
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clicon_config.h" /* generated by config & autoconf */
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -42,18 +42,18 @@
|
|||
#include <cligen/cligen.h>
|
||||
|
||||
/* clicon */
|
||||
#include "clicon_log.h"
|
||||
#include "clicon_err.h"
|
||||
#include "clicon_string.h"
|
||||
#include "clicon_queue.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_handle.h"
|
||||
#include "clicon_yang.h"
|
||||
#include "clicon_hash.h"
|
||||
#include "clicon_chunk.h"
|
||||
#include "clicon_options.h"
|
||||
#include "clicon_yang.h"
|
||||
#include "clicon_yang_type.h"
|
||||
#include "clixon_log.h"
|
||||
#include "clixon_err.h"
|
||||
#include "clixon_string.h"
|
||||
#include "clixon_queue.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_handle.h"
|
||||
#include "clixon_yang.h"
|
||||
#include "clixon_hash.h"
|
||||
#include "clixon_chunk.h"
|
||||
#include "clixon_options.h"
|
||||
#include "clixon_yang.h"
|
||||
#include "clixon_yang_type.h"
|
||||
|
||||
/*
|
||||
* Local types and variables
|
||||
Loading…
Add table
Add a link
Reference in a new issue