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