Restructured error,debug anf log API

Renamed functions clicon->clixon, replaced global variables w access functions
Unified clicon_netconf_error with clixon_err()
This commit is contained in:
Olof hagsand 2023-11-13 10:12:52 +01:00
parent 261469be16
commit 24a4991ec8
199 changed files with 4668 additions and 4158 deletions

View file

@ -62,7 +62,7 @@
/* cligen */
#include <cligen/cligen.h>
/* clicon */
/* clixon */
#include <clixon/clixon.h>
#include "clixon_backend_transaction.h"
@ -78,7 +78,7 @@
* @retval -1 Error
*/
static int
db_merge(clicon_handle h,
db_merge(clixon_handle h,
const char *db1,
const char *db2,
cbuf *cbret)
@ -130,7 +130,7 @@ startup --+-------------------------------------> BROKEN XML
* @note: if commit fails, copy factory to running
*/
int
startup_mode_startup(clicon_handle h,
startup_mode_startup(clixon_handle h,
char *db,
cbuf *cbret)
{
@ -140,7 +140,7 @@ startup_mode_startup(clicon_handle h,
yang_stmt *yspec = clicon_dbspec_yang(h);
if (strcmp(db, "running")==0){
clicon_err(OE_FATAL, 0, "Invalid startup db: %s", db);
clixon_err(OE_FATAL, 0, "Invalid startup db: %s", db);
goto done;
}
/* If startup does not exist, create it empty */
@ -158,7 +158,7 @@ startup_mode_startup(clicon_handle h,
*/
if (if_feature(yspec, "ietf-netconf", "confirmed-commit")) {
if ((rollback_exists = xmldb_exists(h, "rollback")) < 0) {
clicon_err(OE_DAEMON, 0, "Error checking for the existence of the rollback database");
clixon_err(OE_DAEMON, 0, "Error checking for the existence of the rollback database");
goto done;
}
if (rollback_exists == 1) {
@ -211,7 +211,7 @@ startup_mode_startup(clicon_handle h,
* @retval -1 Error
*/
static int
load_extraxml(clicon_handle h,
load_extraxml(clixon_handle h,
char *filename,
const char *db,
cbuf *cbret)
@ -226,7 +226,7 @@ load_extraxml(clicon_handle h,
if (filename == NULL)
return 1;
if ((fp = fopen(filename, "r")) == NULL){
clicon_err(OE_UNIX, errno, "open(%s)", filename);
clixon_err(OE_UNIX, errno, "open(%s)", filename);
goto done;
}
yspec = clicon_dbspec_yang(h);
@ -248,7 +248,6 @@ load_extraxml(clicon_handle h,
retval = 0;
goto done;
}
/* Merge user reset state */
retval = xmldb_put(h, (char*)db, OP_MERGE, xt, clicon_username_get(h), cbret);
done:
@ -280,7 +279,7 @@ tmp |-------+-----+-----+
reset extrafile
*/
int
startup_extraxml(clicon_handle h,
startup_extraxml(clixon_handle h,
char *file,
cbuf *cbret)
{
@ -352,7 +351,7 @@ startup_extraxml(clicon_handle h,
* @retval -1 Error
*/
int
startup_module_state(clicon_handle h,
startup_module_state(clixon_handle h,
yang_stmt *yspec)
{
int retval = -1;