packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmListFileLexer.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
8   This software is distributed WITHOUT ANY WARRANTY; without even the
9   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   See the License for more information.
11 ============================================================================*/
12 #ifndef cmListFileLexer_h
13 #define cmListFileLexer_h
14
15 typedef enum cmListFileLexer_Type_e
16 {
17   cmListFileLexer_Token_None,
18   cmListFileLexer_Token_Space,
19   cmListFileLexer_Token_Newline,
20   cmListFileLexer_Token_Identifier,
21   cmListFileLexer_Token_ParenLeft,
22   cmListFileLexer_Token_ParenRight,
23   cmListFileLexer_Token_ArgumentUnquoted,
24   cmListFileLexer_Token_ArgumentQuoted,
25   cmListFileLexer_Token_BadCharacter,
26   cmListFileLexer_Token_BadString
27 } cmListFileLexer_Type;
28
29 typedef struct cmListFileLexer_Token_s cmListFileLexer_Token;
30 struct cmListFileLexer_Token_s
31 {
32   cmListFileLexer_Type type;
33   char* text;
34   int length;
35   int line;
36   int column;
37 };
38
39 typedef struct cmListFileLexer_s cmListFileLexer;
40
41 #ifdef __cplusplus
42 extern "C"
43 {
44 #endif
45
46 cmListFileLexer* cmListFileLexer_New();
47 int cmListFileLexer_SetFileName(cmListFileLexer*, const char*);
48 int cmListFileLexer_SetString(cmListFileLexer*, const char*);
49 cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer*);
50 long cmListFileLexer_GetCurrentLine(cmListFileLexer*);
51 long cmListFileLexer_GetCurrentColumn(cmListFileLexer*);
52 const char* cmListFileLexer_GetTypeAsString(cmListFileLexer*,
53                                             cmListFileLexer_Type);
54 void cmListFileLexer_Delete(cmListFileLexer*);
55
56 #ifdef __cplusplus
57 } /* extern "C" */
58 #endif
59
60 #endif