| 10 | #include <unistd.h> |
| 11 | |
| 12 | void OnFileOpened(const char* path, Lemon::GUI::FileView* fv){ |
| 13 | char* pathCopy = strdup(path); |
| 14 | |
| 15 | if(strncmp(path + strlen(path) - 4, ".lef", 4) == 0){ |
| 16 | lemon_spawn(path, 1, &pathCopy); |
| 17 | } else if(strncmp(path + strlen(path) - 4, ".txt", 4) == 0 || strncmp(path + strlen(path) - 4, ".cfg", 4) == 0 || strncmp(path + strlen(path) - 4, ".asm", 4) == 0 || strncmp(path + strlen(path) - 3, ".py", 3) == 0 || strncmp(path + strlen(path) - 5, ".json", 5) == 0){ |
| 18 | char* const argv[] = {const_cast<char*>("/system/bin/textedit.lef"), pathCopy}; |
| 19 | lemon_spawn("/system/bin/textedit.lef", 2, argv); |
| 20 | } else if(strncmp(path + strlen(path) - 4, ".png", 4) == 0 || strncmp(path + strlen(path) - 4, ".bmp", 4) == 0){ |
| 21 | char* const argv[] = {const_cast<char*>("/system/bin/imgview.lef"), pathCopy}; |
| 22 | lemon_spawn("/system/bin/imgview.lef", 2, argv); |
| 23 | } |
| 24 | |
| 25 | free(pathCopy); |
| 26 | } |
| 27 | |
| 28 | extern "C" |
| 29 | int main(int argc, char** argv){ |
no test coverage detected