Пример #1
0
static PyObject*
python_api_settings_boolean_set(PyObject *self, PyObject *args)
{
    PyObject *group = NULL;
    PyObject *key = NULL;
    PyObject *valobj = NULL;

    if (!PyArg_ParseTuple(args, "OOO!", &group, &key, &PyBool_Type, &valobj)) {
        Py_RETURN_NONE;
    }

    char *group_str = python_str_or_unicode_to_string(group);
    char *key_str = python_str_or_unicode_to_string(key);
    int val = PyObject_IsTrue(valobj);

    allow_python_threads();
    api_settings_boolean_set(group_str, key_str, val);
    free(group_str);
    free(key_str);
    disable_python_threads();

    Py_RETURN_NONE;
}
Пример #2
0
static void
c_api_settings_boolean_set(char *group, char *key, int value)
{
    api_settings_boolean_set(group, key, value);
}