syslog-ng source
python-helpers.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Balabit
3  * Copyright (c) 2015 Balazs Scheidler <balazs.scheidler@balabit.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * As an additional exemption you are allowed to compile & link against the
20  * OpenSSL libraries as published by the OpenSSL project. See the file
21  * COPYING for details.
22  *
23  */
24 #ifndef PYTHON_HELPERS_H_INCLUDED
25 #define PYTHON_HELPERS_H_INCLUDED 1
26 
27 #include "python-module.h"
28 #include "python-options.h"
29 #include "cfg-args.h"
30 
31 const gchar *_py_get_callable_name(PyObject *callable, gchar *buf, gsize buf_len);
32 const gchar *_py_format_exception_text(gchar *buf, gsize buf_len);
34 PyObject *_py_get_attr_or_null(PyObject *o, const gchar *attr);
35 PyObject *_py_do_import(const gchar *modname);
36 PyObject *_py_resolve_qualified_name(const gchar *name);
37 PyObject *_py_create_arg_dict(GHashTable *args);
38 PyObject *_py_construct_cfg_args(CfgArgs *args);
39 PyObject *_py_invoke_function(PyObject *func, PyObject *arg, const gchar *class, const gchar *caller_context);
40 PyObject *_py_invoke_function_with_args(PyObject *func, PyObject *args, const gchar *class,
41  const gchar *caller_context);
42 void _py_invoke_void_function(PyObject *func, PyObject *arg, const gchar *class, const gchar *caller_context);
43 gboolean _py_invoke_bool_function(PyObject *func, PyObject *arg, const gchar *class, const gchar *caller_context);
44 PyObject *_py_get_method(PyObject *instance, const gchar *method_name, const gchar *module);
45 PyObject *_py_invoke_method_by_name(PyObject *instance, const gchar *method_name, PyObject *arg, const gchar *class,
46  const gchar *module);
47 void _py_invoke_void_method_by_name(PyObject *instance, const gchar *method_name, const gchar *class,
48  const gchar *module);
49 gboolean _py_invoke_bool_method_by_name_with_options(PyObject *instance, const gchar *method_name,
50  const PythonOptions *options, const gchar *class,
51  const gchar *module);
52 gboolean _py_invoke_bool_method_by_name(PyObject *instance, const gchar *method_name, const gchar *class,
53  const gchar *module);
54 gboolean _py_perform_imports(GList *imports);
55 const gchar *_py_object_repr(PyObject *s, gchar *buf, gsize buflen);
56 PyObject *_py_construct_enum(const gchar *name, PyObject *sequence);
57 
58 void py_slng_generic_dealloc(PyObject *self);
59 
60 #endif
const gchar * name
Definition: debugger.c:265
PyObject * _py_resolve_qualified_name(const gchar *name)
Definition: python-helpers.c:235
gboolean _py_perform_imports(GList *imports)
Definition: python-helpers.c:415
gboolean _py_invoke_bool_method_by_name(PyObject *instance, const gchar *method_name, const gchar *class, const gchar *module)
Definition: python-helpers.c:399
const gchar * _py_get_callable_name(PyObject *callable, gchar *buf, gsize buf_len)
Definition: python-helpers.c:32
const gchar * _py_format_exception_text(gchar *buf, gsize buf_len)
Definition: python-helpers.c:94
gboolean _py_invoke_bool_method_by_name_with_options(PyObject *instance, const gchar *method_name, const PythonOptions *options, const gchar *class, const gchar *module)
Definition: python-helpers.c:381
PyObject * _py_invoke_function_with_args(PyObject *func, PyObject *args, const gchar *class, const gchar *caller_context)
Definition: python-helpers.c:299
PyObject * _py_invoke_function(PyObject *func, PyObject *arg, const gchar *class, const gchar *caller_context)
Definition: python-helpers.c:278
PyObject * _py_get_attr_or_null(PyObject *o, const gchar *attr)
Definition: python-helpers.c:157
PyObject * _py_create_arg_dict(GHashTable *args)
void _py_invoke_void_function(PyObject *func, PyObject *arg, const gchar *class, const gchar *caller_context)
Definition: python-helpers.c:320
PyObject * _py_invoke_method_by_name(PyObject *instance, const gchar *method_name, PyObject *arg, const gchar *class, const gchar *module)
Definition: python-helpers.c:355
PyObject * _py_construct_cfg_args(CfgArgs *args)
Definition: python-helpers.c:270
void _py_invoke_void_method_by_name(PyObject *instance, const gchar *method_name, const gchar *class, const gchar *module)
Definition: python-helpers.c:370
PyObject * _py_do_import(const gchar *modname)
Definition: python-helpers.c:174
void _py_finish_exception_handling(void)
Definition: python-helpers.c:125
gboolean _py_invoke_bool_function(PyObject *func, PyObject *arg, const gchar *class, const gchar *caller_context)
Definition: python-helpers.c:327
const gchar * _py_object_repr(PyObject *s, gchar *buf, gsize buflen)
Definition: python-helpers.c:422
void py_slng_generic_dealloc(PyObject *self)
Definition: python-helpers.c:461
PyObject * _py_construct_enum(const gchar *name, PyObject *sequence)
Definition: python-helpers.c:440
PyObject * _py_get_method(PyObject *instance, const gchar *method_name, const gchar *module)