configure version major/minor derived from git
Remove compile-time COMPAT_6_5 and IDENTITYREF_KLUDGE
This commit is contained in:
parent
7aac03ba5e
commit
3e07a1d279
12 changed files with 23 additions and 119 deletions
|
|
@ -119,15 +119,4 @@ int clixon_err_exit(void);
|
|||
/* doesnt work if arg != NULL */
|
||||
#define clixon_netconf_error(h, x, f, a) clixon_err_fn((h), __FUNCTION__, __LINE__, OE_XML, 0,(x), (f))
|
||||
|
||||
#if 1 /* COMPAT_6_5 */
|
||||
#define clicon_err(c,s,_fmt, args...) clixon_err_fn(NULL, __FUNCTION__, __LINE__, (c), (s), NULL, _fmt , ##args)
|
||||
#define clicon_err_reset() clixon_err_reset()
|
||||
|
||||
#define clicon_errno clixon_err_category()
|
||||
#define clicon_suberrno clixon_err_subnr()
|
||||
#define clicon_err_reason clixon_err_reason()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _CLIXON_ERR_H_ */
|
||||
|
|
|
|||
|
|
@ -92,11 +92,4 @@ struct event_stream;
|
|||
int clicon_stream_set(clixon_handle h, struct event_stream *es);
|
||||
int clicon_stream_append(clixon_handle h, struct event_stream *es);
|
||||
|
||||
/* COMPAT_6_5 */
|
||||
#if 1
|
||||
typedef void *clicon_handle;
|
||||
#define clicon_handle_init() clixon_handle_init()
|
||||
#define clicon_handle_exit(h) clixon_handle_exit(h)
|
||||
#endif
|
||||
|
||||
#endif /* _CLIXON_HANDLE_H_ */
|
||||
|
|
|
|||
|
|
@ -83,19 +83,4 @@ int clixon_get_logflags(void);
|
|||
int clixon_log_str(int level, char *msg);
|
||||
int clixon_log_fn(clixon_handle h, int user, int level, cxobj *x, const char *format, ...) __attribute__ ((format (printf, 5, 6)));
|
||||
|
||||
#if 1 /* COMPAT_6_5 */
|
||||
#define CLICON_LOG_SYSLOG CLIXON_LOG_SYSLOG
|
||||
#define CLICON_LOG_STDERR CLIXON_LOG_STDERR
|
||||
#define CLICON_LOG_STDOUT CLIXON_LOG_STDOUT
|
||||
#define CLICON_LOG_FILE CLIXON_LOG_FILE
|
||||
|
||||
#define clicon_log(l, f, args...) clixon_log(NULL, (l), (f), ##args)
|
||||
#define clicon_log_exit() clixon_log_exit()
|
||||
#define clicon_log_opt(c) clixon_log_opt((c))
|
||||
#define clicon_log_file(f) clixon_log_file((f))
|
||||
|
||||
int clicon_log_init(char *ident, int upto, int flags);
|
||||
|
||||
#endif /* COMPAT_6_5 */
|
||||
|
||||
#endif /* _CLIXON_LOG_H_ */
|
||||
|
|
|
|||
|
|
@ -238,20 +238,6 @@ check_body_namespace(cxobj *x0,
|
|||
}
|
||||
#endif
|
||||
else{ /* Namespace does not exist in x0: error */
|
||||
#ifdef IDENTITYREF_KLUDGE
|
||||
int ret;
|
||||
if (ns1 == NULL){
|
||||
if ((ret = yang_find_namespace_by_prefix(y, prefix, &ns0)) < 0)
|
||||
goto done;
|
||||
if (ret == 0){ /* no such namespace in yang */
|
||||
;
|
||||
}
|
||||
else{ /* Add it according to the kludge,... */
|
||||
if (xml_add_attr(x0, prefix, ns0, "xmlns", NULL) == NULL)
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if ((cberr = cbuf_new()) == NULL){
|
||||
clixon_err(OE_UNIX, errno, "cbuf_new");
|
||||
goto done;
|
||||
|
|
@ -260,7 +246,6 @@ check_body_namespace(cxobj *x0,
|
|||
if (netconf_invalid_value(cbret, "application", cbuf_get(cberr)) < 0)
|
||||
goto done;
|
||||
goto fail;
|
||||
#endif
|
||||
}
|
||||
ok:
|
||||
retval = 1;
|
||||
|
|
|
|||
|
|
@ -481,31 +481,15 @@ xml2json_encode_identityref(cxobj *xb,
|
|||
if (xml2ns(xb, prefix, &namespace) < 0)
|
||||
goto done;
|
||||
/* We got the namespace, now get the module */
|
||||
// clixon_debug(CLIXON_DBG_DEFAULT, "body:%s prefix:%s namespace:%s", body, prefix, namespace);
|
||||
#ifdef IDENTITYREF_KLUDGE
|
||||
if (namespace == NULL){
|
||||
/* If we dont find namespace here, we assume it is because of a missing
|
||||
* xmlns that should be there, as a kludge we search for its (own)
|
||||
* prefix in mymodule.
|
||||
*/
|
||||
if ((ymod = yang_find_module_by_prefix_yspec(yspec, prefix)) != NULL)
|
||||
cprintf(cb, "%s:%s", yang_argument_get(ymod), id);
|
||||
else
|
||||
if ((ymod = yang_find_module_by_namespace(yspec, namespace)) != NULL){
|
||||
if (ymod == my_ymod)
|
||||
cprintf(cb, "%s", id);
|
||||
else{
|
||||
cprintf(cb, "%s:%s", yang_argument_get(ymod), id);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if ((ymod = yang_find_module_by_namespace(yspec, namespace)) != NULL){
|
||||
if (ymod == my_ymod)
|
||||
cprintf(cb, "%s", id);
|
||||
else{
|
||||
cprintf(cb, "%s:%s", yang_argument_get(ymod), id);
|
||||
}
|
||||
}
|
||||
else
|
||||
cprintf(cb, "%s", id);
|
||||
}
|
||||
cprintf(cb, "%s", id);
|
||||
retval = 0;
|
||||
done:
|
||||
if (prefix)
|
||||
|
|
|
|||
|
|
@ -161,19 +161,6 @@ clixon_log_init(clixon_handle h,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef COMPAT_6_5
|
||||
/* Required for clixon-example autoconf
|
||||
*/
|
||||
int
|
||||
clicon_log_init(char *ident,
|
||||
int upto,
|
||||
int flags)
|
||||
{
|
||||
return clixon_log_init(NULL, ident, upto, flags);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int
|
||||
clixon_log_exit(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -579,9 +579,6 @@ yang_find_module_by_prefix(yang_stmt *ys,
|
|||
|
||||
/*! Get module from its own prefix
|
||||
*
|
||||
* This is really not a valid usecase, a kludge for the identityref derived
|
||||
* list workaround (IDENTITYREF_KLUDGE)
|
||||
* Actually, for canonical prefixes it is!
|
||||
*/
|
||||
yang_stmt *
|
||||
yang_find_module_by_prefix_yspec(yang_stmt *yspec,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue