Pajdeg  0.2.2
Pajdeg
PDOperator.h
Go to the documentation of this file.
1 //
2 // PDOperator.h
3 //
4 // Copyright (c) 2012 - 2015 Karl-Johan Alm (http://github.com/kallewoof)
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in
14 // all copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 // THE SOFTWARE.
23 //
24 
43 #ifndef INCLUDED_PDOperator_h
44 #define INCLUDED_PDOperator_h
45 
46 #include "PDDefines.h"
47 
48 #define PDOperatorSymbolGlobRegular 0
49 #define PDOperatorSymbolGlobWhitespace 1
50 #define PDOperatorSymbolGlobDelimiter 4
51 #define PDOperatorSymbolExtNumeric 8
52 #define PDOperatorSymbolExtFake 16
53 #define PDOperatorSymbolExtEOB 32
54 
55 
58 extern char *PDOperatorSymbolGlob;
59 
63 extern char *PDOperatorSymbolGlobHex;
64 
68 extern char *PDOperatorSymbolGlobDehex;
69 
73 extern char *PDOperatorSymbolGlobEscaping;
74 
78 extern void PDOperatorSymbolGlobSetup();
79 
83 extern char PDOperatorSymbolGlobDefine(char *str);
84 
90 extern PDOperatorRef PDOperatorCreateFromDefinition(const void **defs);
91 
100 
109 #define PDSymbolUpdateNumeric(numeric, real, c, first_character) \
110  numeric &= ((c >= '0' && c <= '9') \
111  || \
112  (first_character && (c == '-' || c == '+')) \
113  || \
114  (! real && (real |= c == '.')))
115 
125 #define PDSymbolDetermineNumeric(numeric, real, c, sym, len) \
126  do { \
127  PDInteger i; \
128  for (i = len-1; numeric && i >= 0; i--) { \
129  c = sym[i]; \
130  PDSymbolUpdateNumeric(numeric, real, c, i==0); \
131  } \
132  } while (0)
133 
134 #endif
135 
PDOperatorRef PDOperatorCreateFromDefinition(const void **defs)
Definition: PDOperator.c:155
char * PDOperatorSymbolGlobDehex
Definition: PDOperator.c:40
void PDOperatorCompileStates(PDOperatorRef op)
Definition: PDOperator.c:197
char * PDOperatorSymbolGlobEscaping
Definition: PDOperator.c:39
char * PDOperatorSymbolGlob
Definition: PDOperator.c:37
char PDOperatorSymbolGlobDefine(char *str)
Definition: PDOperator.c:90
void PDOperatorSymbolGlobSetup()
Definition: PDOperator.c:42
Definition: pd_internal.h:374
Definitions for the Pajdeg interface.
char * PDOperatorSymbolGlobHex
Definition: PDOperator.c:38