Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!uunet!mcvax!hp4nl!ruuinf!piet From: piet@cs.ruu.nl (Piet van Oostrum) Newsgroups: comp.sys.atari.st Subject: Re: German MODULA2 compiler Keywords: modula-2, german Message-ID: <1323@ruuinf.cs.ruu.nl> Date: 17 May 89 10:25:11 GMT References: <8905091507.AA08429@ucbvax.Berkeley.EDU> <2971@ncsuvx.ncsu.edu> Sender: piet@ruuinf.cs.ruu.nl Reply-To: piet@cs.ruu.nl (Piet van Oostrum) Organization: Dept of Computer Science, University of Utrecht, Holland Lines: 230 In-reply-to: mark@ncsuvx.ncsu.edu (Mark Boyd) In article <2971@ncsuvx.ncsu.edu>, mark@ncsuvx (Mark Boyd) writes: ` `I have been unable to invoke the editor from within the modula shell. `I tried renaming gnome to editor.prg, but it didn't work. Any suggestions `on an available ( pd ) editor to use with this environment? ` I tried to use xmg (``micro-gnu-emacs''), but had a few problems: 1. There was no cursor 2. The environment was empty, so xmg didn't know where to get its init file Modula doesn't seem to pass the environment. 3. I don't like to have two copies of the same program (xmg.ttp/editor.prg) So I decided to write a ``glue'' program that: - enables the cursor - finds an environment in an ancestor with the EDITOR variable set - starts the program that is in that variable with that environment. I wrote it in C because of the environment handling routines, and compiled it with sozobon. The binary is about 6KB, because of all the stdio stuff. If somebody is willing to take that out by using (s)he has my blessing. I am posting it here, I don't think it is worth the effort sending it to the sources/binaries group. ---------------------------editor.c--------------------------- /* Modula-2 editor glue program */ /* By Piet van Oostrum, */ #include #include #include #define DEF_EDIT "c:\bin\xmg.ttp" extern char *getenv(); extern char *_envp; main(argc, argv) int argc; char **argv; { char *program, buf[80], command[128]; int status; BASEPAGE *bp = _base; printf ("\033e"); /* cursor on */ /* search for environment */ /* modula-2 does not pass the environment, */ /* so we also look in parents' environment */ while (bp) { _envp = bp->p_env; bp = bp->p_parent; program = getenv("EDITOR"); if (program && *program) break; } if (!program || !*program) program = DEF_EDIT; if (argc == 1) command[0] = 0; else { strcpy (&command[1], argv[1]); command[0] = (char) strlen(argv[1]); } status = (int) Pexec (0, program, command, _envp); if (status) { fprintf (stderr, "Can't execute %s - error %d\n", program, status); } printf ("\033f"); /* cursor off */ return status; } --------------------------editor.prg-------------------------- table !"#$%&'()*+,-./0123456789:;<=>? @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ begin 644 editor.prg M8!H !P @! 82( _ "\(3KD -.7(\F.0 &F F0T2#UJP !):\ "x M "1\ :3"0*9PXD$FH0U(.TO ! !L!B0\ $ +2#;1@O/ %RX_/ )w M3D%X3KD CZWOP #B\\ 77$ZYo M ).C N_RI.7DYU(&X "D'H 0O$$AN_RU.N0 $2Y03R!N I!Z $+Q!.n MN0 $0Y83QU _RQ@ /]\3E8 $CG&!!"0R9\ 7E+9\ 5L(#\K Q.N0 m M!AI43TI 9P8 :P ( I20]?\ $F#:+SD !ID+SD !=8/SD !=63KD l M %"WOP "D)G80I43TS?"!A.7DYU3E8 $CG& !"0[9\ !1L.C \ !+!PTC k MT+P !>4($ X* *, 3 ? #9QHP/ 2P<-(P-"\ 7E"! 2%!.N0 !G18j M3U)#8, _+@ (3KD #(5$],WP 83EY.=4Y6 !(YQ 0-BX "# #4D# ?/_^i M-@ _ TZY 5>%1/)D"W_ !G"B +3-\("$Y>3G4O/ &1H_/ )3KD h M #07$\_//_93KD #(5$]@V$Y6 !(YQP<+SP !C\3KD 6V6$\H0+G\g M &@!*%&F!@H Jf M 5*,8-8F1;G\ &0 e M&E @*P .L*@ )&< 1HV+@ ,/P,O+@ (, -20#\ 80#_&%1/+P!.N0 $4+>d M_ **$!(PT'T. !"$#\\ 1A /[X5$\J0"/- 76"J\ 9&3@\ $O/ c M&18O#$ZY 0F%!/*$"Y_ !G*C\\ 1A /["5$\J0%)$*HPO/ &1-"b MITZY 0F%!/*$"Y_ !FUC\\ 1A /Z85$\J0$*5,\0 !=6('D !=8a M2I!G#"!Y 76"!02A!F'B!Y :4"AH "2Y_ !F%"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68.@/P " \@ "( 3G4D0["!8A)G""( 0H F"DYU< %"@28*3G6RO a M %F!D*!)@I.=;"\ #__V(0@,%(0$*!,@!"0$A )@I.=;*\ #__V(B) !"z M0DA"A,%"@S8"2$,T (3!(@)"04A!0H P M"#)@I.=70!0H.R@&0&U(+2@6KVy MLH!B!(:"D('BB>**9O(B " #)@I.=4YO="!E;F]U9V@@;65M;W)Y#0H 4W1Ax M8VL@;W9E&UG+G1T< !%1$E43U( &V4 !v M 0 $ @ ! $ O__ u M $ @ " $ P # t M s M r M q M p M o M 'A!!B@(#BH@!@H((@@@!@H,$@8<$@H(e M#A8.&!@@&B J!@84"@HH" P(.%(L&@H6"A8&!A8&!DI*d M.@8$"@H&!)H<9#1BX 0$! 0$! 0$! 0$! 0$! 0$! 0$! 0$! 0$! 0$! 0$c H*C8T'("N"! 2>! \$"00)A(L%H*L?BX^"A8:,A 0K,HZ%A N( H& 0$b a end -- Piet van Oostrum, Dept of Computer Science, University of Utrecht Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands Telephone: +31-30-531806. piet@cs.ruu.nl (mcvax!hp4nl!ruuinf!piet)