Esempio n. 1
0
static PyObject*
python_api_settings_int_set(PyObject *self, PyObject *args)
{
    PyObject *group = NULL;
    PyObject *key = NULL;
    int val = 0;

    if (!PyArg_ParseTuple(args, "OOi", &group, &key, &val)) {
        Py_RETURN_NONE;
    }

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

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

    Py_RETURN_NONE;
}
Esempio n. 2
0
static void
c_api_settings_int_set(char *group, char *key, int value)
{
    api_settings_int_set(group, key, value);
}