Tests about a simple python3 fastcgi runner using libfcgi and the Python-C API.
python
c
wsgi
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pyutils.h 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (C) 2019 Weber Yann
  3. *
  4. * This file is part of PyFCGI.
  5. *
  6. * PyFCGI is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * any later version.
  10. *
  11. * PyFCGI is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with PyFCGI. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef _PYUTILS__H__
  20. #define _PYUTILS__H__
  21. #include "config.h"
  22. #include <fcgiapp.h>
  23. #include <fcgi_stdio.h> /* fcgi library; put it first*/
  24. #define PY_SSIZE_T_CLEAN
  25. #include <Python.h>
  26. #include "logger.h"
  27. /**@brief Call Py_Initialize & update_python_path
  28. */
  29. void pyinit();
  30. /**@brief Add . to the embed pythonpath
  31. */
  32. void update_python_path();
  33. /**@brief Import & return the python entrypoint callable
  34. * from PyFCGI_conf.py_entrymod & PyFCGI_conf.py_entryfun
  35. */
  36. PyObject* import_entrypoint();
  37. void log_expt(int priority);
  38. #endif