OSDN Git Service

fix copyright year.
[bbk/bchan.git] / src / tadimf.h
1 /*
2  * tadimf.h
3  *
4  * Copyright (c) 2010 project bchan
5  *
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.
9  *
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:
13  *
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.
18  *
19  * 2. Altered source versions must be plainly marked as such, and must not be
20  *    misrepresented as being the original software.
21  *
22  * 3. This notice may not be removed or altered from any source
23  *    distribution.
24  *
25  */
26
27 #include        <basic.h>
28
29 #include    "tadlib.h"
30
31 #ifndef __TADIMF_H__
32 #define __TADIMF_H__
33
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
41 };
42 typedef enum TIMFPARSER_STATE_T_ TIMFPARSER_STATE_T;
43
44 typedef struct timfparser_t_ timfparser_t;
45 struct timfparser_t_ {
46         taditerator_t iterator;
47         tctokenchecker_t headerchecker;
48         TIMFPARSER_STATE_T state;
49         Bool ishankaku;
50         W headertype;
51         TC chratio[5];
52         TC buf[6];
53 };
54
55 enum TIMFPARSER_RESULT_T_ {
56         TIMFPARSER_RESULT_HEADERVALUE,
57         TIMFPARSER_RESULT_BODY,
58         TIMFPARSER_RESULT_END
59 };
60 typedef enum TIMFPARSER_RESULT_T_ TIMFPARSER_RESULT_T;
61
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);
66
67 #endif