2 * htmlform_urlencoder.h
4 * Copyright (c) 2015 project bchan
6 * This software is provided 'as-is', without any express or implied
7 * warranty. In no event will the authors be held liable for any damages
8 * arising from the use of this software.
10 * Permission is granted to anyone to use this software for any purpose,
11 * including commercial applications, and to alter it and redistribute it
12 * freely, subject to the following restrictions:
14 * 1. The origin of this software must not be misrepresented; you must not
15 * claim that you wrote the original software. If you use this software
16 * in a product, an acknowledgment in the product documentation would be
17 * appreciated but is not required.
19 * 2. Altered source versions must be plainly marked as such, and must not be
20 * misrepresented as being the original software.
22 * 3. This notice may not be removed or altered from any source
27 /* http://tools.ietf.org/html/rfc1866#section-8.2.1 */
30 /* Functionality name: htmlform */
31 /* Detail name: urnencoder */
35 #ifndef __HTMLFORM_URLENCODER_H__
36 #define __HTMLFORM_URLENCODER_H__
38 /* Functionality name: htmlform */
40 /* Data structure identifier: field */
41 struct htmlform_field_ {
47 typedef struct htmlform_field_ htmlform_field;
49 /* Functionality name: htmlform */
50 /* Detail name: urlencoder */
51 struct htmlform_urlencoder_t_ {
52 htmlform_field *fields;
55 HTMLFORM_URLENCODER_STATE_NAME,
56 HTMLFORM_URLENCODER_STATE_EQUAL,
57 HTMLFORM_URLENCODER_STATE_VALUE,
58 HTMLFORM_URLENCODER_STATE_AMP
64 typedef struct htmlform_urlencoder_t_ htmlform_urlencoder_t;
66 IMPORT VOID htmlform_urlencoder_initialize(htmlform_urlencoder_t *encoder, htmlform_field *fields, W fields_len);
67 IMPORT VOID htmlform_urlencoder_finalize(htmlform_urlencoder_t *encoder);
68 IMPORT Bool htmlform_urlencoder_next(htmlform_urlencoder_t *encoder, UB **str, W *len);