#include #include #include #include #include #include #include #include #include #include #include #include #include #include // Path to the GAP root (for the library) #ifndef SYS_DEFAULT_PATHS #define SYS_DEFAULT_PATHS "/usr/share/gap" #endif void handler(char* msg) { printf("Caught an error: %s", msg); } int main() { char* argv[8]; argv[0] = "gap"; argv[1] = "-l"; argv[2] = SYS_DEFAULT_PATHS; argv[3] = "-m"; argv[4] = "24M"; argv[5] = "-T"; argv[6] = "-A"; argv[7] = NULL; int argc=7; libgap_set_error_handler(handler); libgap_initialize(argc, argv); libgap_mark_stack_bottom(); libgap_start_interaction("1/0"); libgap_enter(); libGAP_ReadEvalCommand(libGAP_BottomLVars, 0); libGAP_ViewObjHandler(libGAP_ReadEvalResult); libgap_exit() libgap_finish_interaction(); return 0; }