/*1* SPDX-License-Identifier: ISC2*3* Copyright (c) 2019-2020 Robert Manner <[email protected]>4*5* Permission to use, copy, modify, and distribute this software for any6* purpose with or without fee is hereby granted, provided that the above7* copyright notice and this permission notice appear in all copies.8*9* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES10* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF11* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR12* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES13* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN14* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF15* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.16*/1718#ifndef SUDO_PYTHON_MODULE_H19#define SUDO_PYTHON_MODULE_H2021#include "pyhelpers.h"2223extern PyObject *sudo_exc_SudoException; // Base exception for the sudo module problems2425// This is for the python plugins to report error messages for us26extern PyObject *sudo_exc_PluginException; // base exception of the following:27extern PyObject *sudo_exc_PluginReject; // a reject with message28extern PyObject *sudo_exc_PluginError; // an error with message2930extern PyTypeObject *sudo_type_Plugin;31extern PyTypeObject *sudo_type_ConvMessage;3233PyObject *sudo_module_create_class(const char *class_name, PyMethodDef *class_methods,34PyObject *base_class);3536CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION37int sudo_module_register_conv_message(PyObject *py_module);3839CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION40int sudo_module_ConvMessage_to_c(PyObject *py_conv_message, struct sudo_conv_message *conv_message);4142CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION43int sudo_module_ConvMessages_to_c(PyObject *py_tuple, Py_ssize_t *num_msgs, struct sudo_conv_message **msgs);4445CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION46int sudo_module_register_baseplugin(PyObject *py_module);4748CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION49int sudo_module_set_default_loghandler(void);5051PyObject *python_sudo_debug(PyObject *py_self, PyObject *py_args);5253PyMODINIT_FUNC sudo_module_init(void);5455#endif // SUDO_PYTHON_MODULE_H565758