PyFCGI/include/pyutils.h

50 lines
1.3 KiB
C

/*
* Copyright (C) 2019 Weber Yann
*
* This file is part of PyFCGI.
*
* PyFCGI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* PyFCGI is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with PyFCGI. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PYUTILS__H__
#define _PYUTILS__H__
#include "config.h"
#include <fcgiapp.h>
#include <fcgi_stdio.h> /* fcgi library; put it first*/
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "logger.h"
/**@brief Call Py_Initialize & update_python_path
*/
void pyinit();
/**@brief Add . to the embed pythonpath
*/
void update_python_path();
/**@brief Import & return the python entrypoint callable
* from PyFCGI_conf.py_entrymod & PyFCGI_conf.py_entryfun
*/
PyObject* import_entrypoint();
void log_expt(int priority);
void pyfcgi_python_version(char[16]);
#endif