1 /* Based on node-formidable by Felix Geisendörfer 2 * Igor Afonov - afonov@gmail.com - 2012 3 * MIT License - http://www.opensource.org/licenses/mit-license.php 4 */ 5 #ifndef _multipart_parser_h 6 #define _multipart_parser_h 7 8 #ifdef __cplusplus 9 extern "C" 10 { 11 #endif 12 13 #include <stdlib.h> 14 #include <ctype.h> 15 16 typedef struct multipart_parser multipart_parser; 17 typedef struct multipart_parser_settings multipart_parser_settings; 18 typedef struct multipart_parser_state multipart_parser_state; 19 20 typedef int (*multipart_data_cb) (multipart_parser*, const char *at, size_t length); 21 typedef int (*multipart_notify_cb) (multipart_parser*); 22 23 struct multipart_parser_settings { 24 multipart_data_cb on_header_field; 25 multipart_data_cb on_header_value; 26 multipart_data_cb on_part_data; 27 28 multipart_notify_cb on_part_data_begin; 29 multipart_notify_cb on_headers_complete; 30 multipart_notify_cb on_part_data_end; 31 multipart_notify_cb on_body_end; 32 }; 33 34 multipart_parser* multipart_parser_init 35 (const char *boundary, const multipart_parser_settings* settings); 36 37 void multipart_parser_free(multipart_parser* p); 38 39 size_t multipart_parser_execute(multipart_parser* p, const char *buf, size_t len); 40 41 void multipart_parser_set_data(multipart_parser* p, void* data); 42 void * multipart_parser_get_data(multipart_parser* p); 43 44 #ifdef __cplusplus 45 } /* extern "C" */ 46 #endif 47 48 #endif 49
This page was automatically generated by LXR 0.3.1. • OpenWrt