mod_cgi.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. * @file mod_cgi.h
  18. * @brief CGI Script Execution Extension Module for Apache
  19. *
  20. * @defgroup MOD_CGI mod_cgi
  21. * @ingroup APACHE_MODS
  22. * @{
  23. */
  24. #ifndef _MOD_CGI_H
  25. #define _MOD_CGI_H 1
  26. #include "mod_include.h"
  27. typedef enum {RUN_AS_SSI, RUN_AS_CGI} prog_types;
  28. typedef struct {
  29. apr_int32_t in_pipe;
  30. apr_int32_t out_pipe;
  31. apr_int32_t err_pipe;
  32. int process_cgi;
  33. apr_cmdtype_e cmd_type;
  34. apr_int32_t detached;
  35. prog_types prog_type;
  36. apr_bucket_brigade **bb;
  37. include_ctx_t *ctx;
  38. ap_filter_t *next;
  39. apr_int32_t addrspace;
  40. } cgi_exec_info_t;
  41. /**
  42. * Registerable optional function to override CGI behavior;
  43. * Reprocess the command and arguments to execute the given CGI script.
  44. * @param cmd Pointer to the command to execute (may be overridden)
  45. * @param argv Pointer to the arguments to pass (may be overridden)
  46. * @param r The current request
  47. * @param p The pool to allocate correct cmd/argv elements within.
  48. * @param e_info pass e_info.cmd_type (Set to APR_SHELLCMD or APR_PROGRAM on entry)
  49. and e_info.detached (Should the child start in detached state?)
  50. * @remark This callback may be registered by the os-specific module
  51. * to correct the command and arguments for apr_proc_create invocation
  52. * on a given os. mod_cgi will call the function if registered.
  53. */
  54. APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_cgi_build_command,
  55. (const char **cmd, const char ***argv,
  56. request_rec *r, apr_pool_t *p,
  57. cgi_exec_info_t *e_info));
  58. #endif /* _MOD_CGI_H */
  59. /** @} */