4 * Copyright (c) 2010 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
34 enum TIMFPARSER_STATE_T_ {
35 TIMFPARSER_STATE_SEARCH_HEADER,
36 TIMFPARSER_STATE_SKIP_HEADER,
37 TIMFPARSER_STATE_READ_HEADER_FIELDNAME,
38 TIMFPARSER_STATE_SEARCH_HEADER_FIELDVALUE,
39 TIMFPARSER_STATE_READ_HEADER_FIELDVALUE,
40 TIMFPARSER_STATE_READ_VALUE_MESSAGE
42 typedef enum TIMFPARSER_STATE_T_ TIMFPARSER_STATE_T;
44 typedef struct timfparser_t_ timfparser_t;
45 struct timfparser_t_ {
46 taditerator_t iterator;
47 tctokenchecker_t headerchecker;
48 TIMFPARSER_STATE_T state;
55 enum TIMFPARSER_RESULT_T_ {
56 TIMFPARSER_RESULT_HEADERVALUE,
57 TIMFPARSER_RESULT_BODY,
60 typedef enum TIMFPARSER_RESULT_T_ TIMFPARSER_RESULT_T;
62 IMPORT VOID timfparser_initialize(timfparser_t *timf, tctokenchecker_valuetuple_t *val, W val_len, TC *bin, W strlen);
63 IMPORT VOID timfparser_finalize(timfparser_t *timf);
64 IMPORT VOID timfparser_clear(timfparser_t *timf);
65 IMPORT W timfparser_next(timfparser_t *timf, W *headername, UB **bin, W *len);