Skip to content

Commit e3db432

Browse files
committed
python CHANGE minor bindings fixes
1 parent b6dd3fc commit e3db432

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

python/netconf.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ clb_print(NC_VERB_LEVEL level, const char* msg)
5353
}
5454
break;
5555
case NC_VERB_DEBUG:
56+
case NC_VERB_DEBUG_LOWLVL:
5657
if (syslogEnabled) {
5758
syslog(LOG_DEBUG, "%s", msg);
5859
}
@@ -127,9 +128,15 @@ setSearchpath(PyObject *self, PyObject *args, PyObject *keywds)
127128
Py_RETURN_NONE;
128129
}
129130

130-
char *
131+
static void
132+
schemaCallbackModelFree(void *model_data, void *user_data)
133+
{
134+
free(model_data);
135+
}
136+
137+
const char *
131138
schemaCallbackWrapper(const char *mod_name, const char *mod_rev, const char *submod_name, const char *sub_rev,
132-
void *user_data, LYS_INFORMAT *format, void (**free_module_data)(void *model_data))
139+
void *user_data, LYS_INFORMAT *format, void (**free_module_data)(void *model_data, void *user_data))
133140
{
134141
PyObject *arglist, *result, *data = NULL;
135142
char *str = NULL;
@@ -148,7 +155,7 @@ schemaCallbackWrapper(const char *mod_name, const char *mod_rev, const char *sub
148155
return NULL;
149156
}
150157
Py_DECREF(result);
151-
*free_module_data = free;
158+
*free_module_data = schemaCallbackModelFree;
152159
str = strdup(PyUnicode_AsUTF8(data));
153160
Py_DECREF(data);
154161
}

python/rpc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ ncRPCEditConfig(ncSessionObject *self, PyObject *args, PyObject *keywords)
201201
{
202202
static char *kwlist[] = {"datastore", "data", "defop", "testopt", "erropt", NULL};
203203
struct lyd_node *data = NULL, *node, *content_tree = NULL;
204-
char *content_str = NULL;
204+
const char *content_str = NULL;
205205
const struct lys_module *ietfnc;
206206
NC_DATASTORE datastore;
207207
NC_RPC_EDIT_DFLTOP defop = 0;
@@ -264,7 +264,7 @@ ncRPCEditConfig(ncSessionObject *self, PyObject *args, PyObject *keywords)
264264

265265
if (content_str) {
266266
if (!content_str[0] || (content_str[0] == '<')) {
267-
node = lyd_new_anydata(data, ietfnc, "config", content_str, LYD_ANYDATA_SXML);
267+
node = lyd_new_anydata(data, ietfnc, "config", (void *)content_str, LYD_ANYDATA_SXML);
268268
} else {
269269
node = lyd_new_leaf(data, ietfnc, "url", content_str);
270270
}

python/tls.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ncTLSStr(ncTLSObject *self)
6666
static int
6767
ncTLSSetCert(ncTLSObject *self, PyObject *value, void *closure)
6868
{
69-
char *path;
69+
const char *path;
7070
struct stat st;
7171

7272
if (!value) {
@@ -109,7 +109,7 @@ ncTLSGetCert(ncTLSObject *self, void *closure)
109109
static int
110110
ncTLSSetKey(ncTLSObject *self, PyObject *value, void *closure)
111111
{
112-
char *path;
112+
const char *path;
113113
struct stat st;
114114

115115
if (!value) {

0 commit comments

Comments
 (0)