SayoriOS  0.3.3
eBatRuntime.h
1 #ifndef EBAT_RUNTIME_H
2 #define EBAT_RUNTIME_H
3 
6 #define EBAT_CONFIG_HELLO_LINE ">"
7 #define EBAT_CONFIG_CRITICAL_STOP 1
8 #define EBAT_CONFIG_FILEIO_EXIST 1
9 #define EBAT_CONFIG_SYSTEM_SET 1
10 
11 
13 
14 
15 #define EBAT_INVALIDARGC(Line, Cur, Req) \
16  if (Cur != Req){ \
17  bat_fatalerror(Line, "Check the number of arguments! Current %d, required %d.", Cur, Req);\
18  return 1; \
19  }\
20 
21 #define EBAT_INVALIDMINARGC(Line, Cur, Req) \
22  if (Cur < Req){ \
23  bat_fatalerror(Line, "Not enough arguments! Current %d, required %d.", Cur, Req);\
24  return 2; \
25  } \
26 
27 #define eBatCheckModule(Line, Module, ModuleName) \
28  if (Module != 1){ \
29  bat_fatalerror(Line, "The module \"%s\" is not built for eBat.", ModuleName);\
30  return 3; \
31  }\
32 
33 #define eBatCheckMixingData(Line, Cur, Req) \
34  if (Cur != Req){ \
35  bat_fatalerror(Line, "Data type mismatch. \"%s\" Received, \"%s\" Required", bat_debug_type(Cur), bat_debug_type(Req)); \
36  return 4; \
37  }
38 
39 #define eBatCheckInputValue(Line) \
40  bat_fatalerror(Line, "You cannot compare different types of data. Only NUMBERS and VARIABLES are allowed to be compared."); \
41  return 5; \
42 
43 #define eBatCheckVariable(Line, Key, Var) \
44  char* Var = bat_runtime_system_get(Key); \
45  if (Var == NULL){ \
46  bat_fatalerror(Line, "The variable \"%s\" was not found.", Key); \
47  return 6; \
48  }
49 
50 #define eBatCheckGoTo(Line, Key) \
51  if (Key == NULL){ \
52  bat_fatalerror(Line, "The goto to line was not found."); \
53  return 7; \
54  }
55 int bar_runtime_system_exec(int argc, char** argv);
56 void bat_runtime_system_echo(char* text, int newline, int endline);
57 void bat_runtime_system_set(char* key, char* val);
58 char* bat_runtime_system_get(char* key);
59 void bat_runtime_system_pause();
60 
61 int bat_runtime_fileio_exist(char* path);
62 
63 int bat_strtol(char *string);
64 void bat_trim(char* string);
65 void bat_str_debug(char* string);
66 char* bat_toLower(char* str);
67 
68 int bat_runtime_exec(BAT_T* bat);
69 
70 #endif //EBAT_RUNTIME_H
Definition: eBat.h:91