read and scan a file for definitions */
| 108 | |
| 109 | /* read and scan a file for definitions */ |
| 110 | void PicocPlatformScanFile(Picoc* pc, const char* FileName) |
| 111 | { |
| 112 | char* SourceStr = PlatformReadFile(pc, FileName); |
| 113 | |
| 114 | /* ignore "#!/path/to/picoc" .. by replacing the "#!" with "//" */ |
| 115 | if (SourceStr != NULL && SourceStr[0] == '#' && SourceStr[1] == '!') { |
| 116 | SourceStr[0] = '/'; |
| 117 | SourceStr[1] = '/'; |
| 118 | } |
| 119 | |
| 120 | PicocParse(pc, FileName, SourceStr, strlen(SourceStr), true, false, true, gEnableDebugger); |
| 121 | } |
| 122 | |
| 123 | /* exit the program */ |
| 124 | void PlatformExit(Picoc* pc, int RetVal) |