示例#1
0
static PyObject*
python_api_settings_string_list_clear(PyObject *self, PyObject *args)
{
    PyObject *group = NULL;
    PyObject *key = NULL;

    if (!PyArg_ParseTuple(args, "OO", &group, &key)) {
        return Py_BuildValue("O", Py_False);
    }

    char *group_str = python_str_or_unicode_to_string(group);
    char *key_str = python_str_or_unicode_to_string(key);

    allow_python_threads();
    int res = api_settings_string_list_clear(group_str, key_str);
    free(group_str);
    free(key_str);
    disable_python_threads();

    if (res) {
        return Py_BuildValue("O", Py_True);
    } else {
        return Py_BuildValue("O", Py_False);
    }
}
示例#2
0
文件: c_api.c 项目: anossov/profanity
static int
c_api_settings_string_list_clear(char *group, char *key)
{
    return api_settings_string_list_clear(group, key);
}