common.h

changeset 42
5cd91fd1526c
parent 41
47e686c96d8f
child 47
d84d82213137
equal deleted inserted replaced
41:47e686c96d8f 42:5cd91fd1526c
41 #ifndef __COMMON_H__ 41 #ifndef __COMMON_H__
42 #define __COMMON_H__ 42 #define __COMMON_H__
43 43
44 #include <stdio.h> 44 #include <stdio.h>
45 #include <stdarg.h> 45 #include <stdarg.h>
46 #include <typeinfo> 46 #include <typeinfo>
47 #include <stdint.h>
47 #include "bots.h" 48 #include "bots.h"
48 #include "str.h" 49 #include "str.h"
49 50
50 // Application name and version 51 // Application name and version
51 #define APPNAME "botc" 52 #define APPNAME "botc"
115 inline bool IsCharWhitespace (char c) { 116 inline bool IsCharWhitespace (char c) {
116 return (c <= 32 || c == 127 || c == 255); 117 return (c <= 32 || c == 127 || c == 255);
117 } 118 }
118 119
119 // Byte datatype 120 // Byte datatype
120 typedef unsigned long int word; 121 // typedef unsigned long int word;
121 typedef unsigned char byte; 122 typedef int32_t word;
123 typedef uint8_t byte;
122 124
123 // Keywords 125 // Keywords
124 #define NUM_KEYWORDS 20
125 #ifndef __MAIN_CXX__ 126 #ifndef __MAIN_CXX__
126 extern const char** g_Keywords; 127 extern const char** g_Keywords;
127 #endif 128 #endif
129
128 bool IsKeyword (str s); 130 bool IsKeyword (str s);
131 unsigned int NumKeywords ();
129 132
130 // Script mark and reference 133 // Script mark and reference
131 struct ScriptMark { 134 struct ScriptMark {
132 int type; 135 int type;
133 str name; 136 str name;

mercurial