/[svn]/liblscp/trunk/examples/parser.h
ViewVC logotype

Annotation of /liblscp/trunk/examples/parser.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 963 - (hide annotations) (download) (as text)
Sun Dec 3 18:30:04 2006 UTC (17 years, 4 months ago) by capela
File MIME type: text/x-c++hdr
File size: 2197 byte(s)
* MIDI instrument mapping fixed, previously missing
  the regular ON_DEMAND load mode.

* Server error reporting is now effective; all server
  numerical error and warning codes are added to 100,
  thus giving a proper non-zero lscp_client_get_errno()
  return value.

1 capela 92 // parser.h
2     //
3     /****************************************************************************
4     liblscp - LinuxSampler Control Protocol API
5 capela 869 Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved.
6 capela 92
7     This library is free software; you can redistribute it and/or
8     modify it under the terms of the GNU Lesser General Public
9     License as published by the Free Software Foundation; either
10     version 2.1 of the License, or (at your option) any later version.
11    
12     This library is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15     Lesser General Public License for more details.
16    
17 capela 921 You should have received a copy of the GNU General Public License along
18     with this program; if not, write to the Free Software Foundation, Inc.,
19     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 capela 92
21     *****************************************************************************/
22    
23     #ifndef __LSCP_PARSER_H
24     #define __LSCP_PARSER_H
25    
26     #include <stdio.h>
27     #include <stdlib.h>
28     #include <string.h>
29    
30     #if (defined(_WIN32) || defined(__WIN32__))
31     #if (!defined(WIN32))
32     #define WIN32
33     #endif
34     #endif
35    
36     #if defined(__cplusplus)
37     extern "C" {
38     #endif
39    
40     //-------------------------------------------------------------------------
41     // Simple token parser.
42    
43     typedef struct _lscp_parser_t
44     {
45 capela 963 char *pchBuffer;
46     int cchBuffer;
47     const char *pszToken;
48     char *pch;
49 capela 92
50     } lscp_parser_t;
51    
52     const char *lscp_parser_strtok (char *pchBuffer, const char *pszDelim, char **ppch);
53    
54     void lscp_parser_init (lscp_parser_t *pParser, const char *pchBuffer, int cchBuffer);
55     const char *lscp_parser_next (lscp_parser_t *pParser);
56     int lscp_parser_nextint (lscp_parser_t *pParser);
57     float lscp_parser_nextnum (lscp_parser_t *pParser);
58     int lscp_parser_test (lscp_parser_t *pParser, const char *pszToken);
59     int lscp_parser_test2 (lscp_parser_t *pParser, const char *pszToken, const char *pszToken2);
60     void lscp_parser_free (lscp_parser_t *pParser);
61    
62     #if defined(__cplusplus)
63     }
64     #endif
65    
66     #endif // __LSCP_PARSER_H
67    
68     // end of parser.h

  ViewVC Help
Powered by ViewVC