Annotation of capa/capa51/GUITools/quizzer.init.c, revision 1.1.1.1

1.1       albertel    1: /*
                      2:  * quizzer.c
                      3:  * Copyright Guy Albertelli II 1996
                      4:  */
                      5: #include <stdio.h>
                      6: #include <sys/file.h>
                      7: #include <tk.h>
                      8: #include <stdlib.h>
                      9: #include <Capa/capaCommon.h>
                     10: #include <signal.h>
                     11: #include <quizzer.h>
                     12: #include <common.h>
                     13: 
                     14: Tcl_Interp * gInterp;
                     15: 
                     16: int Quizzer_Init(Tcl_Interp *interp)
                     17: {
                     18:   char buf[BUFFER_SIZE],*argv;
                     19: 
                     20:   signal(SIGSEGV,signalHandler);
                     21:   signal(SIGILL,signalHandler);
                     22:   signal(SIGFPE,signalHandler);
                     23:   signal(SIGBUS,signalHandler);
                     24: 
                     25:   gInterp=interp;
                     26:   Tcl_CreateCommand( interp, "enscriptParse", capaTclParse, (ClientData)NULL, 
                     27: 		     (Tcl_CmdDeleteProc *)NULL); 
                     28:   Tcl_CreateCommand( interp, "texParse", capaTclParse, (ClientData)NULL, 
                     29: 		     (Tcl_CmdDeleteProc *)NULL); 
                     30:   Tcl_CreateCommand( interp, "webParse", capaTclParse, (ClientData)NULL, 
                     31: 		     (Tcl_CmdDeleteProc *)NULL); 
                     32:   Tcl_CreateCommand( interp, "capaGetStudent", capaGetStudent, (ClientData)NULL, 
                     33: 		     (Tcl_CmdDeleteProc *)NULL); 
                     34:   Tcl_CreateCommand( interp, "dateUpdate", capaDateUpdate, (ClientData)NULL, 
                     35: 		     (Tcl_CmdDeleteProc *)NULL); 
                     36:   Tcl_CreateCommand( interp, "runLatex", capaRunLatex, (ClientData)NULL, 
                     37: 		     (Tcl_CmdDeleteProc *)NULL); 
                     38:   Tcl_CreateCommand( interp, "getParseErrors", capaGetParseErrors, (ClientData)NULL, 
                     39: 		     (Tcl_CmdDeleteProc *)NULL); 
                     40:   Tcl_CreateCommand( interp, "getHeaderInfo", capaGetHeaderInfo, (ClientData)NULL, 
                     41: 		     (Tcl_CmdDeleteProc *)NULL); 
                     42:   Tcl_CreateCommand( interp, "updateHeader", capaUpdateHeader, (ClientData)NULL, 
                     43: 		     (Tcl_CmdDeleteProc *)NULL); 
                     44:   Tcl_CreateCommand( interp, "checkHeader", capaCheckHeader, (ClientData)NULL, 
                     45: 		     (Tcl_CmdDeleteProc *)NULL); 
                     46:   Tcl_CreateCommand( interp, "getExistingSections", capaGetExistingSections,
                     47: 		     (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); 
                     48:   Tcl_CreateCommand( interp, "getStudentNumbers", capaGetStudentNumbers,
                     49: 		     (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); 
                     50:   Tcl_CreateCommand( interp, "stopParser", capaStopParser,
                     51: 		     (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); 
                     52: 
                     53:   Tcl_LinkVar(interp,"gFasterParsing",(char *)&gFasterParsing,TCL_LINK_INT);
                     54: 
                     55:   sprintf(buf,"%s.%s",MAJORVER,QUIZZERMINORVER);
                     56:   Tcl_SetVar(interp,"gVer",buf,TCL_GLOBAL_ONLY);
                     57:   sprintf(buf,"Compiled on %s",COMPILE_DATE);
                     58:   Tcl_SetVar(interp,"gCompileDate",buf,TCL_GLOBAL_ONLY);
                     59: 
                     60:   argv=Tcl_GetVar(interp,"argv", TCL_GLOBAL_ONLY);
                     61:   if (argv!=NULL && strlen(argv) > 9 && 
                     62:       argv[0]=='-' && 
                     63:       argv[1]=='c' && 
                     64:       argv[2]=='o' && 
                     65:       argv[3]=='p' && 
                     66:       argv[4]=='y' && 
                     67:       argv[5]=='r' && 
                     68:       argv[6]=='i' && 
                     69:       argv[7]=='g' && 
                     70:       argv[8]=='h' && 
                     71:       argv[9]=='t' ) message();
                     72: 
                     73:   return TCL_OK;
                     74: }
                     75: 
                     76: int Quizzer_InitStandAlone(Tcl_Interp *interp)
                     77: {
                     78:   return Quizzer_Init(interp);
                     79: }
                     80: 
                     81: int Quizzer_SafeInit(Tcl_Interp *interp)
                     82: {
                     83:   return Quizzer_Init(interp);
                     84: }
                     85: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>