rfc1867.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef RFC1867_H
  19. #define RFC1867_H
  20. #include "SAPI.h"
  21. #define MULTIPART_CONTENT_TYPE "multipart/form-data"
  22. #define MULTIPART_EVENT_START 0
  23. #define MULTIPART_EVENT_FORMDATA 1
  24. #define MULTIPART_EVENT_FILE_START 2
  25. #define MULTIPART_EVENT_FILE_DATA 3
  26. #define MULTIPART_EVENT_FILE_END 4
  27. #define MULTIPART_EVENT_END 5
  28. typedef struct _multipart_event_start {
  29. size_t content_length;
  30. } multipart_event_start;
  31. typedef struct _multipart_event_formdata {
  32. size_t post_bytes_processed;
  33. char *name;
  34. char **value;
  35. size_t length;
  36. size_t *newlength;
  37. } multipart_event_formdata;
  38. typedef struct _multipart_event_file_start {
  39. size_t post_bytes_processed;
  40. char *name;
  41. char **filename;
  42. } multipart_event_file_start;
  43. typedef struct _multipart_event_file_data {
  44. size_t post_bytes_processed;
  45. zend_off_t offset;
  46. char *data;
  47. size_t length;
  48. size_t *newlength;
  49. } multipart_event_file_data;
  50. typedef struct _multipart_event_file_end {
  51. size_t post_bytes_processed;
  52. char *temp_filename;
  53. int cancel_upload;
  54. } multipart_event_file_end;
  55. typedef struct _multipart_event_end {
  56. size_t post_bytes_processed;
  57. } multipart_event_end;
  58. typedef int (*php_rfc1867_encoding_translation_t)(void);
  59. typedef void (*php_rfc1867_get_detect_order_t)(const zend_encoding ***list, size_t *list_size);
  60. typedef void (*php_rfc1867_set_input_encoding_t)(const zend_encoding *encoding);
  61. typedef char* (*php_rfc1867_getword_t)(const zend_encoding *encoding, char **line, char stop);
  62. typedef char* (*php_rfc1867_getword_conf_t)(const zend_encoding *encoding, char *str);
  63. typedef char* (*php_rfc1867_basename_t)(const zend_encoding *encoding, char *str);
  64. SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler);
  65. PHPAPI void destroy_uploaded_files_hash(void);
  66. void php_rfc1867_register_constants(void);
  67. extern PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra);
  68. SAPI_API void php_rfc1867_set_multibyte_callbacks(
  69. php_rfc1867_encoding_translation_t encoding_translation,
  70. php_rfc1867_get_detect_order_t get_detect_order,
  71. php_rfc1867_set_input_encoding_t set_input_encoding,
  72. php_rfc1867_getword_t getword,
  73. php_rfc1867_getword_conf_t getword_conf,
  74. php_rfc1867_basename_t basename);
  75. #endif /* RFC1867_H */
  76. /*
  77. * Local variables:
  78. * tab-width: 4
  79. * c-basic-offset: 4
  80. * End:
  81. * vim600: sw=4 ts=4 fdm=marker
  82. * vim<600: sw=4 ts=4
  83. */