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.

conf.h 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 __CONF_H___
  20. #define __CONF_H___
  21. #include "config.h"
  22. /**@defgroup conf_internal PYFCGI configuration handling
  23. */
  24. /**@defgroup conf_glob PYFCGI global (for all process) configurations
  25. * @see struct_pyfcgi_conf_s
  26. * @ingroup conf_internal */
  27. /**@defgroup ret_status Function & process return status
  28. */
  29. #define PYFCGI_ERR 16
  30. /**@ingroup ret_status */
  31. #define PYFCGI_WORKER_FAIL 32
  32. /**@ingroup ret_status */
  33. #define PYFCGI_MASTER_FAIL 64
  34. /**@ingroup ret_status */
  35. #define PYFCGI_FATAL 128
  36. /**@brief Friendly name for @ref struct pyfcgi_conf_s
  37. * @see struct pyfcgi_conf_s */
  38. typedef struct pyfcgi_conf_s pyfcgi_conf_t;
  39. typedef struct pyfcgi_conf_logger_s pyfcgi_conf_logger_t;
  40. typedef struct pyfcgi_context_s pyfcgi_context_t;
  41. struct pyfcgi_context_s {
  42. int foo;
  43. };
  44. /**@brief Structure containing configuration
  45. * @ingroup conf_internal
  46. * The structure is used for the global @ref pyfcgi_conf variable.
  47. * @see pyfcgi_conf_t
  48. */
  49. struct pyfcgi_conf_s
  50. {
  51. /**@brief Entrypoint module name
  52. * @ingroup conf_glob */
  53. char *py_entrymod;
  54. /**@brief Entrypoint function name
  55. * @ingroup conf_glob */
  56. char *py_entryfun;
  57. /**@brief Minimum count worker in pool
  58. * @ingroup conf_glob */
  59. int min_wrk;
  60. /**@brief Maximum count workers in pool
  61. * @ingroup conf_glob */
  62. int max_wrk;
  63. /**@brief Maximum request before a worker restarts (0 for no restart)
  64. * @ingroup conf_glob */
  65. int max_reqs;
  66. /**@brief Logger configuration
  67. * @ingroupe conf_glob */
  68. pyfcgi_conf_logger_t logs;
  69. pyfcgi_context_t context;
  70. };
  71. /**@brief Configuration globals, inherited from parent to childs */
  72. pyfcgi_conf_t PyFCGI_conf;
  73. #endif