static void c_api_filepath_completer_add(const char *filename, const char *prefix) { char *plugin_name = _c_plugin_name(filename); log_debug("Filepath autocomplete added '%s' for %s", prefix, plugin_name); api_filepath_completer_add(plugin_name, prefix); free(plugin_name); }
static PyObject* python_api_filepath_completer_add(PyObject *self, PyObject *args) { PyObject *prefix = NULL; if (!PyArg_ParseTuple(args, "O", &prefix)) { Py_RETURN_NONE; } char *prefix_str = python_str_or_unicode_to_string(prefix); char *plugin_name = _python_plugin_name(); log_debug("Filepath autocomplete added '%s' for %s", prefix_str, plugin_name); allow_python_threads(); api_filepath_completer_add(plugin_name, prefix_str); free(prefix_str); disable_python_threads(); free(plugin_name); Py_RETURN_NONE; }