Fix issue #374 - Patch from Milan Crha
[jelmer/openchange-proposed.git/.git] / libmapi / fxparser.h
1 /*
2    OpenChange MAPI implementation.
3
4    Copyright (C) Brad Hards <bradh@openchange.org> 2010
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #ifndef __LIBMAPI_FXPARSER_H__
21 #define __LIBMAPI_FXPARSER_H__
22
23 /* This header is private to the parser. If you use this directly, you may suffer API or ABI breakage.
24    
25    We mean it.
26 */
27
28 enum fx_parser_state { ParserState_Entry, ParserState_HaveTag, ParserState_HavePropTag };
29
30 struct fx_parser_context {
31         TALLOC_CTX              *mem_ctx;
32         DATA_BLOB               data;   /* the data we have (so far) to parse */
33         uint32_t                idx;    /* where we are up to in the data blob */
34         enum fx_parser_state    state;
35         struct SPropValue       lpProp;         /* the current property tag and value we are parsing */
36         struct MAPINAMEID       namedprop;      /* the current named property we are parsing */
37         bool                    enough_data;
38         uint32_t                tag;
39         void                    *priv;
40         
41         /* callbacks for parser actions */
42         enum MAPISTATUS (*op_marker)(uint32_t, void *);
43         enum MAPISTATUS (*op_delprop)(uint32_t, void *);
44         enum MAPISTATUS (*op_namedprop)(uint32_t, struct MAPINAMEID, void *);
45         enum MAPISTATUS (*op_property)(struct SPropValue, void *);
46 };
47
48 #endif