rfc1867.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 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. /* $Id$ */
  19. #ifndef RFC1867_H
  20. #define RFC1867_H
  21. #include "SAPI.h"
  22. #define MULTIPART_CONTENT_TYPE "multipart/form-data"
  23. #define MULTIPART_EVENT_START 0
  24. #define MULTIPART_EVENT_FORMDATA 1
  25. #define MULTIPART_EVENT_FILE_START 2
  26. #define MULTIPART_EVENT_FILE_DATA 3
  27. #define MULTIPART_EVENT_FILE_END 4
  28. #define MULTIPART_EVENT_END 5
  29. typedef struct _multipart_event_start {
  30. size_t content_length;
  31. } multipart_event_start;
  32. typedef struct _multipart_event_formdata {
  33. size_t post_bytes_processed;
  34. char *name;
  35. char **value;
  36. size_t length;
  37. size_t *newlength;
  38. } multipart_event_formdata;
  39. typedef struct _multipart_event_file_start {
  40. size_t post_bytes_processed;
  41. char *name;
  42. char **filename;
  43. } multipart_event_file_start;
  44. typedef struct _multipart_event_file_data {
  45. size_t post_bytes_processed;
  46. off_t offset;
  47. char *data;
  48. size_t length;
  49. size_t *newlength;
  50. } multipart_event_file_data;
  51. typedef struct _multipart_event_file_end {
  52. size_t post_bytes_processed;
  53. char *temp_filename;
  54. int cancel_upload;
  55. } multipart_event_file_end;
  56. typedef struct _multipart_event_end {
  57. size_t post_bytes_processed;
  58. } multipart_event_end;
  59. typedef int (*php_rfc1867_encoding_translation_t)(TSRMLS_D);
  60. typedef void (*php_rfc1867_get_detect_order_t)(const zend_encoding ***list, size_t *list_size TSRMLS_DC);
  61. typedef void (*php_rfc1867_set_input_encoding_t)(const zend_encoding *encoding TSRMLS_DC);
  62. typedef char* (*php_rfc1867_getword_t)(const zend_encoding *encoding, char **line, char stop TSRMLS_DC);
  63. typedef char* (*php_rfc1867_getword_conf_t)(const zend_encoding *encoding, char *str TSRMLS_DC);
  64. typedef char* (*php_rfc1867_basename_t)(const zend_encoding *encoding, char *str TSRMLS_DC);
  65. SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler);
  66. void destroy_uploaded_files_hash(TSRMLS_D);
  67. void php_rfc1867_register_constants(TSRMLS_D);
  68. extern PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC);
  69. SAPI_API void php_rfc1867_set_multibyte_callbacks(
  70. php_rfc1867_encoding_translation_t encoding_translation,
  71. php_rfc1867_get_detect_order_t get_detect_order,
  72. php_rfc1867_set_input_encoding_t set_input_encoding,
  73. php_rfc1867_getword_t getword,
  74. php_rfc1867_getword_conf_t getword_conf,
  75. php_rfc1867_basename_t basename);
  76. #endif /* RFC1867_H */