1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
15 /* helper functions for constructs not supported by C */
16 void *REDIM_1D(int a, int b, int c)
18 return checked_calloc(a * (c - b + 1));
21 void *REDIM_2D(int a, int b, int c, int d, int e)
26 boolean IS_NOTHING(void *a, int b)
31 void SET_TO_NOTHING(void *a, int b)
36 void MESSAGE_BOX(char *a)
42 char *CAT(const char *a, ...)
47 char *GET_PATH(char *a, ...)
52 char *INT_TO_STR(int a)
58 boolean STRING_IS_LIKE(char *a, char *b)
60 if (*b == '*') // something like "*.sp"
62 return (strSuffix(a, &b[1]));
66 // more sophisticated patterns currently not supported
73 void FILE_GET(FILE *file, int offset, void *buffer, int num_bytes)
75 fseek(file, offset - 1, SEEK_SET);
78 *(byte *)buffer++ = fgetc(file);
81 int FILE_PUT(FILE *a, int b, void *c, int d)
87 /* this is just a workaround -- handle array definitions later */
88 void *Array(int a, ...)
94 /* VB functions that do not return "int" (and would cause compiler errors) */
100 char *Left(char *a, int b)
105 char *left(char *a, int b)
110 char *Right(char *a, int b)
115 char *right(char *a, int b)
120 char *StrReverse(char *a)
125 int InStr(int a, char *b, char *c)
135 char *Dir_Without_Args()
150 char *String(int a, char *b)
170 if (stat(a, &buffer) == 0)
172 return buffer.st_size;
182 return random_linux_libc(RANDOM_SIMPLE);
195 void SaveSetting(const char * a, const char *b, char *c, int d)
200 long GetTempPath(long a, char *b)