3.8.0.PRE preparations and

* Obsoleted COMPAT_CLIV and COMPAT_XSL that were optional in 3.7
This commit is contained in:
Olof hagsand 2018-07-22 21:29:21 +02:00
parent f2d2b0a8c0
commit 56e51f1a8d
22 changed files with 29 additions and 1333 deletions

View file

@ -81,7 +81,6 @@
#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_xpath_ctx.h>
#include <clixon/clixon_xpath.h>
#include <clixon/clixon_json.h>

View file

@ -1,50 +0,0 @@
/*
*
***** BEGIN LICENSE BLOCK *****
Copyright (C) 2009-2018 Olof Hagsand and Benny Holmgren
This file is part of CLIXON.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 3 or later (the "GPL"),
in which case the provisions of the GPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of the GPL, and not to allow others to
use your version of this file under the terms of Apache License version 2,
indicate your decision by deleting the provisions above and replace them with
the notice and other provisions required by the GPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the Apache License version 2 or the GPL.
***** END LICENSE BLOCK *****
* XML XPATH and XSLT functions.
*/
#ifndef _CLIXON_XSL_H
#define _CLIXON_XSL_H
/*
* Prototypes
*/
int xpath_vec_xsl(cxobj *cxtop, char *xpath, cxobj ***vec, size_t *veclen);
int xpath_vec_flag_xsl(cxobj *cxtop, char *xpath, uint16_t flags,
cxobj ***vec, size_t *veclen);
cxobj *xpath_first_xsl(cxobj *cxtop, char *xpath);
#ifdef COMPAT_XSL
cxobj *xpath_each(cxobj *xn_top, char *xpath, cxobj *prev);
#endif
#endif /* _CLIXON_XSL_H */

View file

@ -72,7 +72,7 @@ SRC = clixon_sig.c clixon_log.c clixon_err.c clixon_event.c \
clixon_json.c clixon_yang.c clixon_yang_type.c \
clixon_hash.c clixon_options.c clixon_plugin.c \
clixon_proto.c clixon_proto_client.c \
clixon_xsl.c clixon_xpath.c clixon_xpath_ctx.c clixon_sha1.c \
clixon_xpath.c clixon_xpath_ctx.c clixon_sha1.c \
clixon_xml_db.c clixon_netconf_lib.c
YACCOBJS := lex.clixon_xml_parse.o clixon_xml_parse.tab.o \

View file

@ -67,7 +67,6 @@
#include "clixon_options.h"
#include "clixon_xml.h"
#include "clixon_plugin.h"
#include "clixon_xsl.h"
#include "clixon_xpath_ctx.h"
#include "clixon_xpath.h"
#include "clixon_xml_map.h"

View file

@ -71,7 +71,6 @@
#include "clixon_yang.h"
#include "clixon_sig.h"
#include "clixon_xml.h"
#include "clixon_xsl.h"
#include "clixon_proto.h"
static int _atomicio_sig = 0;

View file

@ -64,7 +64,6 @@
#include "clixon_options.h"
#include "clixon_xml.h"
#include "clixon_plugin.h"
#include "clixon_xsl.h"
#include "clixon_string.h"
#include "clixon_xpath_ctx.h"
#include "clixon_xpath.h"

View file

@ -85,7 +85,6 @@
#include "clixon_plugin.h"
#include "clixon_xpath_ctx.h"
#include "clixon_xpath.h"
#include "clixon_xsl.h"
#include "clixon_log.h"
#include "clixon_err.h"
#include "clixon_xml_sort.h"
@ -1088,13 +1087,7 @@ api_path_fmt2xpath(char *api_path_fmt,
clicon_err(OE_UNIX, errno, "cv2str_dup");
goto done;
}
cprintf(cb,
#ifdef COMPAT_XSL
"[%s=%s]",
#else
"[%s='%s']",
#endif
cv_name_get(cv), str);
cprintf(cb, "[%s='%s']", cv_name_get(cv), str);
free(str);
}
}
@ -1511,13 +1504,7 @@ api_path2xpath_cvv(yang_spec *yspec,
cprintf(xpath, "/%s", name);
v = val;
while ((cvi = cvec_each(cvk, cvi)) != NULL){
cprintf(xpath,
#ifdef COMPAT_XSL
"[%s=%s]",
#else
"[%s='%s']",
#endif
cv_string_get(cvi), v);
cprintf(xpath, "[%s='%s']", cv_string_get(cvi), v);
v += strlen(v)+1;
}
if (val)

View file

@ -62,7 +62,6 @@
#include "clixon_handle.h"
#include "clixon_yang.h"
#include "clixon_xml.h"
#include "clixon_xsl.h"
#include "clixon_xpath_parse.h"
#include "clixon_xpath_ctx.h"
#include "clixon_xpath.h"
@ -1142,16 +1141,11 @@ xpath_first(cxobj *xcur,
goto done;
}
va_end(ap);
#ifdef COMPAT_XSL
if ((cx = xpath_first_xsl(xcur, xpath)) == NULL)
goto done;
#else
if (xpath_vec_ctx(xcur, xpath, &xr) < 0)
goto done;
if (xr && xr->xc_type == XT_NODESET && xr->xc_size)
cx = xr->xc_nodeset[0];
#endif
done:
if (xr)
ctx_free(xr);
@ -1211,10 +1205,6 @@ xpath_vec(cxobj *xcur,
va_end(ap);
*vec=NULL;
*veclen = 0;
#ifdef COMPAT_XSL
if (xpath_vec_xsl(xcur, xpath, vec, veclen) < 0)
goto done;
#else
if (xpath_vec_ctx(xcur, xpath, &xr) < 0)
goto done;
if (xr && xr->xc_type == XT_NODESET){
@ -1222,7 +1212,6 @@ xpath_vec(cxobj *xcur,
xr->xc_nodeset = NULL;
*veclen = xr->xc_size;
}
#endif
retval = 0;
done:
if (xr)
@ -1268,10 +1257,8 @@ xpath_vec_flag(cxobj *xcur,
size_t len;
char *xpath = NULL;
xp_ctx *xr = NULL;
#ifndef COMPAT_XSL
int i;
cxobj *x;
#endif
va_start(ap, veclen);
len = vsnprintf(NULL, 0, format, ap);
@ -1291,10 +1278,6 @@ xpath_vec_flag(cxobj *xcur,
va_end(ap);
*vec=NULL;
*veclen = 0;
#ifdef COMPAT_XSL
if (xpath_vec_flag_xsl(xcur, xpath, flags, vec, veclen) < 0)
goto done;
#else
if (xpath_vec_ctx(xcur, xpath, &xr) < 0)
goto done;
if (xr && xr->xc_type == XT_NODESET){
@ -1305,8 +1288,6 @@ xpath_vec_flag(cxobj *xcur,
goto done;
}
}
#endif
retval = 0;
done:
if (xr)

File diff suppressed because it is too large Load diff