search for: check_list

Displaying 3 results from an estimated 3 matches for "check_list".

Did you mean: check_lint
2018 Apr 11
0
[nbdkit PATCH v2 1/5] python: Let zero's may_trim parameter be optional
...hon/python.c b/plugins/python/python.c index 7eb91d7..07559a5 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -108,6 +108,73 @@ callback_defined (const char *name, PyObject **obj_rtn) return 1; } +/* Checks whether a list of strings contains the given name */ +static int +check_list (PyObject *list, const char *name) +{ + ssize_t i = 0; + PyObject *elt; + + if (!list) + return 0; + while ((elt = PyList_GetItem (list, i++))) { + char *str = PyString_AsString (elt); + if (str && !strcmp (str, name)) + return 1; + } + return 0; +} + +/* Does a callback...
2018 Apr 06
1
[nbdkit PATCH] python: Let zero's may_trim parameter be optional
...e; static int last_error; +static int zero_may_trim = -1; + static PyObject * set_error (PyObject *self, PyObject *args) { @@ -108,6 +110,68 @@ callback_defined (const char *name, PyObject **obj_rtn) return 1; } +/* Checks whether a list of strings contains the given name */ +static int +check_list (PyObject *list, const char *name) +{ + ssize_t i = 0; + PyObject *elt; + + if (!list) + return 0; + while ((elt = PyList_GetItem(list, i++))) { + char *str = PyString_AsString(elt); + if (str && !strcmp(str, name)) + return 1; + } + return 0; +} + +/* Does a callback su...
2018 Apr 11
10
[nbdkit PATCH v2 0/5] FUA support in Python scripts
First out of our four language bindings to add FUA support (for reference, I added 'zero' support for python, perl, and ruby back in 1.1.13, then Rich had to add it for ocaml in 1.1.20). I tested this heavily under python 2, but for now only compile tested under python 3; I plan to do further testing there and make any tweaks if necessary. I wrote patch 5 early on, but then realized I