|
QGIS API Documentation
master-3f58142
|
00001 /* 00002 * Copyright Tim (xtimor@gmail.com) 00003 * 00004 * NMEA library is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Lesser General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/> 00016 */ 00017 /* 00018 * 00019 * NMEA library 00020 * URL: http://nmea.sourceforge.net 00021 * Author: Tim (xtimor@gmail.com) 00022 * Licence: http://www.gnu.org/licenses/lgpl.html 00023 * $Id: parser.h 4 2007-08-27 13:11:03Z xtimor $ 00024 * 00025 */ 00026 00027 #ifndef __NMEA_PARSER_H__ 00028 #define __NMEA_PARSER_H__ 00029 00030 #include "info.h" 00031 00032 #ifdef __cplusplus 00033 extern "C" 00034 { 00035 #endif 00036 00037 /* 00038 * high level 00039 */ 00040 00041 typedef struct _nmeaPARSER 00042 { 00043 void *top_node; 00044 void *end_node; 00045 unsigned char *buffer; 00046 int buff_size; 00047 int buff_use; 00048 00049 } nmeaPARSER; 00050 00051 int nmea_parser_init( nmeaPARSER *parser ); 00052 void nmea_parser_destroy( nmeaPARSER *parser ); 00053 00054 int nmea_parse( 00055 nmeaPARSER *parser, 00056 const char *buff, int buff_sz, 00057 nmeaINFO *info 00058 ); 00059 00060 /* 00061 * low level 00062 */ 00063 00064 int nmea_parser_push( nmeaPARSER *parser, const char *buff, int buff_sz ); 00065 int nmea_parser_top( nmeaPARSER *parser ); 00066 int nmea_parser_pop( nmeaPARSER *parser, void **pack_ptr ); 00067 int nmea_parser_peek( nmeaPARSER *parser, void **pack_ptr ); 00068 int nmea_parser_drop( nmeaPARSER *parser ); 00069 int nmea_parser_buff_clear( nmeaPARSER *parser ); 00070 int nmea_parser_queue_clear( nmeaPARSER *parser ); 00071 00072 #ifdef __cplusplus 00073 } 00074 #endif 00075 00076 #endif /* __NMEA_PARSER_H__ */