rfc1867.h 3.1 KB

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