QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
parser.h
Go to the documentation of this file.
1 /*
2 * Copyright Tim ([email protected])
3 *
4 * NMEA library is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>
16 */
17 /*
18  *
19  * NMEA library
20  * URL: http://nmea.sourceforge.net
21  * Author: Tim ([email protected])
22  * Licence: http://www.gnu.org/licenses/lgpl.html
23  * $Id: parser.h 4 2007-08-27 13:11:03Z xtimor $
24  *
25  */
26 
27 #ifndef __NMEA_PARSER_H__
28 #define __NMEA_PARSER_H__
29 
30 #include "info.h"
31 
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 
37  /*
38  * high level
39  */
40 
41  typedef struct _nmeaPARSER
42  {
43  void *top_node;
44  void *end_node;
45  unsigned char *buffer;
46  int buff_size;
47  int buff_use;
48 
49  } nmeaPARSER;
50 
51  int nmea_parser_init( nmeaPARSER *parser );
52  void nmea_parser_destroy( nmeaPARSER *parser );
53 
54  int nmea_parse(
55  nmeaPARSER *parser,
56  const char *buff, int buff_sz,
57  nmeaINFO *info
58  );
59 
60  /*
61  * low level
62  */
63 
64  int nmea_parser_push( nmeaPARSER *parser, const char *buff, int buff_sz );
65  int nmea_parser_top( nmeaPARSER *parser );
66  int nmea_parser_pop( nmeaPARSER *parser, void **pack_ptr );
67  int nmea_parser_peek( nmeaPARSER *parser, void **pack_ptr );
68  int nmea_parser_drop( nmeaPARSER *parser );
69  int nmea_parser_buff_clear( nmeaPARSER *parser );
70  int nmea_parser_queue_clear( nmeaPARSER *parser );
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* __NMEA_PARSER_H__ */