renamed .h and libs clicon->clixon

This commit is contained in:
Olof Hagsand 2016-02-28 15:27:36 +01:00
parent baa5611616
commit 79b77943f9
132 changed files with 1240 additions and 1268 deletions

View file

@ -28,7 +28,7 @@ LIBS = @LIBS@
SHELL = /bin/sh
SUBDIRS = src clicon
SUBDIRS = src clixon
.PHONY: all clean depend $(SUBDIRS) install
@ -48,7 +48,7 @@ install:
install-include:
for i in $(SUBDIRS); \
do (cd $$i; $(MAKE) $(MFLAGS) $@); done; \
(cd clicon; $(MAKE) $(MFLAGS) $@)
(cd clixon; $(MAKE) $(MFLAGS) $@)
uninstall:
for i in $(SUBDIRS); \
@ -65,7 +65,7 @@ distclean: clean
rm -f Makefile *~ .depend
for i in $(SUBDIRS); \
do (cd $$i; $(MAKE) $(MFLAGS) distclean); done; \
(cd clicon; $(MAKE) $(MFLAGS) $@)
(cd clixon; $(MAKE) $(MFLAGS) $@)
tags:
find $(srcdir) -name '*.[chyl]' -print | etags -

View file

@ -1,79 +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/>.
* 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>
/*
* CLICON version macros
*/
#undef CLICON_VERSION_STRING
#undef CLICON_VERSION_MAJOR
#undef CLICON_VERSION_MINOR
#undef CLICON_VERSION_PATCH
/*
* 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 LIBCLICON_API 1
#include <clicon/clicon_sig.h>
#include <clicon/clicon_log.h>
#include <clicon/clicon_err.h>
#include <clicon/clicon_queue.h>
#include <clicon/clicon_hash.h>
#include <clicon/clicon_handle.h>
#include <clicon/clicon_qdb.h>
#include <clicon/clicon_yang.h>
#include <clicon/clicon_yang_type.h>
#include <clicon/clicon_chunk.h>
#include <clicon/clicon_event.h>
#include <clicon/clicon_string.h>
#include <clicon/clicon_file.h>
#include <clicon/clicon_xml.h>
#include <clicon/clicon_proto.h>
#include <clicon/clicon_proto_encode.h>
#include <clicon/clicon_proto_client.h>
#include <clicon/clicon_proc.h>
#include <clicon/clicon_options.h>
#include <clicon/clicon_xml_map.h>
#include <clicon/clicon_xml_db.h>
#include <clicon/clicon_xsl.h>
#include <clicon/clicon_plugin.h>
#include <clicon/clicon_plugin.h>
/*
* Global variables generated by Makefile
*/
extern const char CLICON_BUILDSTR[];
extern const char CLICON_VERSION[];

View file

@ -31,14 +31,14 @@ depend:
install:
install-include:
install -m 755 -d $(DESTDIR)$(includedir)/clicon
install -m 644 *.h $(DESTDIR)$(includedir)/clicon
install -m 755 -d $(DESTDIR)$(includedir)/clixon
install -m 644 *.h $(DESTDIR)$(includedir)/clixon
uninstall:
rm -f $(includedir)/clicon
rm -f $(includedir)/clixon
clean:
distclean:
rm -f Makefile clicon.h
rm -f Makefile clixon.h

79
lib/clixon/clixon.h.in Normal file
View file

@ -0,0 +1,79 @@
/*
*
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/>.
* 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
*/
#undef CLIXON_VERSION_STRING
#undef CLIXON_VERSION_MAJOR
#undef CLIXON_VERSION_MINOR
#undef CLIXON_VERSION_PATCH
/*
* 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_qdb.h>
#include <clixon/clixon_yang.h>
#include <clixon/clixon_yang_type.h>
#include <clixon/clixon_chunk.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_plugin.h>
#include <clixon/clixon_plugin.h>
/*
* Global variables generated by Makefile
*/
extern const char CLIXON_BUILDSTR[];
extern const char CLIXON_VERSION[];

View file

@ -2,28 +2,28 @@
*
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/>.
*
* Copyright (C) 2002 Benny Holmgren, All rights reserved
*/
#ifndef _CLICON_CHUNK_H_
#define _CLICON_CHUNK_H_
#ifndef _CLIXON_CHUNK_H_
#define _CLIXON_CHUNK_H_
/*
@ -163,4 +163,4 @@ void chunk_check (FILE *, const char *);
size_t chunksize (void *);
#endif /* _CLICON_CHUNK_H_ */
#endif /* _CLIXON_CHUNK_H_ */

View file

@ -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,8 +25,8 @@
* clicon_errno, clicon_suberrno, clicon_err_reason.
*/
#ifndef _CLICON_ERR_H_
#define _CLICON_ERR_H_
#ifndef _CLIXON_ERR_H_
#define _CLIXON_ERR_H_
/*
* Constants
@ -77,4 +77,4 @@ char *clicon_strerror(int err);
void *clicon_err_save(void);
int clicon_err_restore(void *handle);
#endif /* _CLICON_ERR_H_ */
#endif /* _CLIXON_ERR_H_ */

View file

@ -2,28 +2,28 @@
*
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/>.
*
* Event handling and loop
*/
#ifndef _CLICON_EVENT_H_
#define _CLICON_EVENT_H_
#ifndef _CLIXON_EVENT_H_
#define _CLIXON_EVENT_H_
/*
* Prototypes
@ -43,4 +43,4 @@ int event_unreg_timeout(int (*fn)(int, void*), void *arg);
int event_loop(void);
#endif /* _CLICON_EVENT_H_ */
#endif /* _CLIXON_EVENT_H_ */

View file

@ -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/>.
*/
#ifndef _CLICON_FILE_H_
#define _CLICON_FILE_H_
#ifndef _CLIXON_FILE_H_
#define _CLIXON_FILE_H_
char **clicon_realpath(const char *cwd, char *path, const char *label);
@ -33,4 +33,4 @@ char *clicon_tmpfile(const char *label);
int file_cp(char *src, char *target);
#endif /* _CLICON_FILE_H_ */
#endif /* _CLIXON_FILE_H_ */

View file

@ -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/>.
*/
#ifndef _CLICON_HANDLE_H_
#define _CLICON_HANDLE_H_
#ifndef _CLIXON_HANDLE_H_
#define _CLIXON_HANDLE_H_
/*
* Types
@ -58,4 +58,4 @@ clicon_hash_t *clicon_options(clicon_handle h);
/* Return internal clicon data (hash-array) given a handle.*/
clicon_hash_t *clicon_data(clicon_handle h);
#endif /* _CLICON_HANDLE_H_ */
#endif /* _CLIXON_HANDLE_H_ */

View file

@ -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/>.
*/
#ifndef _CLICON_HASH_H_
#define _CLICON_HASH_H_
#ifndef _CLIXON_HASH_H_
#define _CLIXON_HASH_H_
struct clicon_hash {
qelem_t h_qelem;
@ -67,4 +67,4 @@ char **hash_keys(clicon_hash_t *hash, size_t *nkeys);
#define hash_each_end(__hash__) if (__k__) free(__k__); } }
#endif /* _CLICON_HASH_H_ */
#endif /* _CLIXON_HASH_H_ */

View file

@ -2,28 +2,28 @@
*
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/>.
*
* Regular logging and debugging. Syslog using levels.
*/
#ifndef _CLICON_LOG_H_
#define _CLICON_LOG_H_
#ifndef _CLIXON_LOG_H_
#define _CLIXON_LOG_H_
/*
* Constants
@ -54,4 +54,4 @@ int clicon_debug_init(int dbglevel, FILE *f);
int clicon_debug(int dbglevel, char *format, ...);
char *mon2name(int md);
#endif /* _CLICON_LOG_H_ */
#endif /* _CLIXON_LOG_H_ */

View file

@ -2,28 +2,28 @@
*
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/>.
*
* Configuration file and Options.
*/
#ifndef _CLICON_OPTIONS_H_
#define _CLICON_OPTIONS_H_
#ifndef _CLIXON_OPTIONS_H_
#define _CLIXON_OPTIONS_H_
/*
* Constants
@ -103,12 +103,10 @@ enum genmodel_type clicon_cli_genmodel_type(clicon_handle h);
int clicon_autocommit(clicon_handle h);
int clicon_autocommit_set(clicon_handle h, int val);
int clicon_commit_order(clicon_handle h);
yang_spec * clicon_dbspec_yang(clicon_handle h);
int clicon_dbspec_yang_set(clicon_handle h, struct yang_spec *ys);
char *clicon_dbspec_name(clicon_handle h);
int clicon_dbspec_name_set(clicon_handle h, char *name);
#endif /* _CLICON_OPTIONS_H_ */
#endif /* _CLIXON_OPTIONS_H_ */

View file

@ -2,28 +2,28 @@
*
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/>.
*/
/*
* Internal prototypes, not accessed by plugin client code
*/
#ifndef _CLICON_PLUGIN_H_
#define _CLICON_PLUGIN_H_
#ifndef _CLIXON_PLUGIN_H_
#define _CLIXON_PLUGIN_H_
/*
* Types
@ -64,4 +64,4 @@ typedef int (plgexit_t)(clicon_handle); /* Plugin exit */
/* Find a function in global namespace or a plugin. XXX clicon internal */
void *clicon_find_func(clicon_handle h, char *plugin, char *func);
#endif /* _CLICON_PLUGIN_H_ */
#endif /* _CLIXON_PLUGIN_H_ */

View file

@ -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/>.
*/
#ifndef _CLICON_PROC_H_
#define _CLICON_PROC_H_
#ifndef _CLIXON_PROC_H_
#define _CLIXON_PROC_H_
/*
* Prototypes
@ -30,4 +30,4 @@ int clicon_proc_run (char *, void (outcb)(char *), int doerr);
int clicon_proc_daemon (char *);
int group_name2gid(char *name, gid_t *gid);
#endif /* _CLICON_PROC_H_ */
#endif /* _CLIXON_PROC_H_ */

View file

@ -2,28 +2,28 @@
*
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/>.
*
* Protocol to communicate with CLICON config daemon
*/
#ifndef _CLICON_PROTO_H_
#define _CLICON_PROTO_H_
#ifndef _CLIXON_PROTO_H_
#define _CLIXON_PROTO_H_
/*
* Types
@ -180,4 +180,4 @@ int send_msg_err(int s, int err, int suberr, char *format, ...);
#endif /* _CLICON_PROTO_H_ */
#endif /* _CLIXON_PROTO_H_ */

View file

@ -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,8 +24,8 @@
* it should (is?) be general enough to be used by other applications.
*/
#ifndef _CLICON_PROTO_CLIENT_H_
#define _CLICON_PROTO_CLIENT_H_
#ifndef _CLIXON_PROTO_CLIENT_H_
#define _CLIXON_PROTO_CLIENT_H_
int clicon_rpc_commit(clicon_handle h, char *running_db, char *db,
int snapshot, int startup);
@ -54,4 +54,4 @@ int clicon_rpc_subscription(clicon_handle h, int status, char *stream,
enum format_enum format, char *filter, int *s);
#endif /* _CLICON_PROTO_CLIENT_H_ */
#endif /* _CLIXON_PROTO_CLIENT_H_ */

View file

@ -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,8 +23,8 @@
* and server (clicon_backend)
*/
#ifndef _CLICON_PROTO_ENCODE_H_
#define _CLICON_PROTO_ENCODE_H_
#ifndef _CLIXON_PROTO_ENCODE_H_
#define _CLIXON_PROTO_ENCODE_H_
/*
* Prototypes
@ -186,4 +186,4 @@ struct clicon_msg *clicon_msg_err_encode(uint32_t err, uint32_t suberr,
int clicon_msg_err_decode(struct clicon_msg *msg, uint32_t *err, uint32_t *suberr,
char **reason, const char *label);
#endif /* _CLICON_PROTO_ENCODE_H_ */
#endif /* _CLIXON_PROTO_ENCODE_H_ */

View file

@ -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/>.
*/
#ifndef _CLICON_QDB_H_
#define _CLICON_QDB_H_
#ifndef _CLIXON_QDB_H_
#define _CLIXON_QDB_H_
/*
@ -55,4 +55,4 @@ int db_regexp(char *file, char *regexp, const char *label,
char *db_sanitize(char *rx, const char *label);
#endif /* _CLICON_QDB_H_ */
#endif /* _CLIXON_QDB_H_ */

View file

@ -2,28 +2,28 @@
*
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/>.
*
* Copyright (C) 2002 Benny Holmgren, All rights reserved
*/
#ifndef _CLICON_QUEUE_H_
#define _CLICON_QUEUE_H_
#ifndef _CLIXON_QUEUE_H_
#define _CLIXON_QUEUE_H_
/*
* Circular queue structure for use as first entry in a parent structure.
@ -86,4 +86,4 @@ typedef struct _qelem_t {
#define NEXTQ(type, elem) ((type)((elem)?((qelem_t *)(elem))->q_next:NULL))
#endif /* _CLICON_QUEUE_H_ */
#endif /* _CLIXON_QUEUE_H_ */

View file

@ -2,29 +2,29 @@
*
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/>.
*/
#ifndef _CLICON_SHA1_H_
#define _CLICON_SHA1_H_
#ifndef _CLIXON_SHA1_H_
#define _CLIXON_SHA1_H_
/*
* Function Prototypes
*/
char *clicon_sha1hex(const char *str);
#endif /* _CLICON_SHA1_H_ */
#endif /* _CLIXON_SHA1_H_ */

View file

@ -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/>.
*/
#ifndef _CLICON_SIG_H_
#define _CLICON_SIG_H_
#ifndef _CLIXON_SIG_H_
#define _CLIXON_SIG_H_
/*
* Types
@ -39,4 +39,4 @@ int pidfile_get(char *pidfile, pid_t *pid0);
int pidfile_write(char *pidfile);
int pidfile_zapold(pid_t pid);
#endif /* _CLICON_SIG_H_ */
#endif /* _CLIXON_SIG_H_ */

View file

@ -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/>.
*/
#ifndef _CLICON_STRING_H_
#define _CLICON_STRING_H_
#ifndef _CLIXON_STRING_H_
#define _CLIXON_STRING_H_
/*! A malloc version that aligns on 4 bytes. To avoid warning from valgrind */
#define align4(s) (((s)/4)*4 + 4)
@ -53,4 +53,4 @@ int clicon_strmatch(const char *str, const char *regexp, char **match);
char *clicon_strsub(char *str, char *from, char *to);
#endif /* _CLICON_STRING_H_ */
#endif /* _CLIXON_STRING_H_ */

View file

@ -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/>.
* XML support functions.
*/
#ifndef _CLICON_XML_H
#define _CLICON_XML_H
#ifndef _CLIXON_XML_H
#define _CLIXON_XML_H
/*
* Types
@ -108,4 +108,4 @@ int cxvec_append(cxobj *x, cxobj ***vec, size_t *len);
int xml_apply(cxobj *xn, enum cxobj_type type, xml_applyfn_t fn, void *arg);
int xml_apply_ancestor(cxobj *xn, xml_applyfn_t fn, void *arg);
#endif /* _CLICON_XML_H */
#endif /* _CLIXON_XML_H */

View file

@ -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/>.
* XML support functions.
*/
#ifndef _CLICON_XML_DB_H
#define _CLICON_XML_DB_H
#ifndef _CLIXON_XML_DB_H
#define _CLIXON_XML_DB_H
/*
* Prototypes
@ -39,4 +39,4 @@ int xmldb_put( char *dbname, cxobj *xt,
int xmldb_put_xkey(char *dbname, char *xkey, char *val, yang_spec *yspec,
enum operation_type op);
#endif /* _CLICON_XML_DB_H */
#endif /* _CLIXON_XML_DB_H */

View file

@ -2,28 +2,28 @@
*
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 code
*/
#ifndef _CLICON_XML_MAP_H_
#define _CLICON_XML_MAP_H_
#ifndef _CLIXON_XML_MAP_H_
#define _CLIXON_XML_MAP_H_
/*
* lvmap_xml op codes
@ -50,4 +50,4 @@ int xml_diff(yang_spec *yspec, cxobj *xt1, cxobj *xt2,
cxobj ***second, size_t *secondlen,
cxobj ***changed1, cxobj ***changed2, size_t *changedlen);
#endif /* _CLICON_XML_MAP_H_ */
#endif /* _CLIXON_XML_MAP_H_ */

View file

@ -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/>.
* XML XPATH and XSLT functions.
*/
#ifndef _CLICON_XSL_H
#define _CLICON_XSL_H
#ifndef _CLIXON_XSL_H
#define _CLIXON_XSL_H
/*
* Prototypes
@ -31,4 +31,4 @@ 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);
#endif /* _CLICON_XSL_H */
#endif /* _CLIXON_XSL_H */

View file

@ -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/>.
*/
#ifndef _CLICON_YANG_H_
#define _CLICON_YANG_H_
#ifndef _CLIXON_YANG_H_
#define _CLIXON_YANG_H_
/*
@ -203,4 +203,4 @@ int yang_spec_main(clicon_handle h, FILE *f, int printspec);
cvec *yang_arg2cvec(yang_stmt *ys, char *delimi);
int yang_key_match(yang_node *yn, char *name);
#endif /* _CLICON_YANG_H_ */
#endif /* _CLIXON_YANG_H_ */

View file

@ -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/>.
*/
#ifndef _CLICON_YANG_TYPE_H_
#define _CLICON_YANG_TYPE_H_
#ifndef _CLIXON_YANG_TYPE_H_
#define _CLIXON_YANG_TYPE_H_
/*
* Constants
@ -65,4 +65,4 @@ int yang_type_resolve(yang_stmt *ys, yang_stmt *ytype,
char **pattern, uint8_t *fraction);
#endif /* _CLICON_YANG_TYPE_H_ */
#endif /* _CLIXON_YANG_TYPE_H_ */

View file

@ -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)

View file

@ -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_ */

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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 '../'.

View file

@ -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

View file

@ -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 */

View file

@ -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;

View file

@ -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

View file

@ -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 *

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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)
*/

View file

@ -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

View 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"
/*

View file

@ -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.

View file

@ -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
*

View file

@ -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;

View file

@ -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.

View file

@ -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

View 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_ */

View file

@ -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

View file

@ -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;
}

View file

@ -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

View file

@ -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,

View file

@ -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_ */

View file

@ -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

View file

@ -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 */

View file

@ -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