Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ames!ptsfa!ihnp4!inuxc!iuvax!isrnix!mr From: mr@isrnix.UUCP (a.k.a regoli@silver.bacs.indiana.edu) Newsgroups: comp.sys.ibm.pc Subject: Repost: EMACS 3.8L Source (Part 4 of 9) Message-ID: <872@isrnix.UUCP> Date: Fri, 31-Jul-87 15:25:58 EDT Article-I.D.: isrnix.872 Posted: Fri Jul 31 15:25:58 1987 Date-Received: Sun, 2-Aug-87 09:42:19 EDT Sender: mr@isrnix.UUCP Organization: indiana university, bloomington Lines: 2544 #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # exec.c # file.c # fileio.c # hp110.c # hp150.c # This archive created: Fri Jul 31 13:54:26 1987 # By: michael regoli (indiana university, bloomington) export PATH; PATH=/bin:/usr/bin:$PATH echo shar: "extracting 'exec.c'" '(0 character)' if test -f 'exec.c' then echo shar: "will not over-write existing file 'exec.c'" else cat << \SHAR_EOF > 'exec.c' /* This file is for functions dealing with execution of commands, command lines, buffers, files and startup files written 1986 by Daniel Lawrence */ #include #include "estruct.h" #include "edef.h" #if MEGAMAX & ST520 overlay "exec" #endif #if DEBUGM char outline[NSTRING]; /* global string to hold debug line text */ #endif /* namedcmd: execute a named command even if it is not bound */ namedcmd(f, n) int f, n; /* command arguments [passed through to command executed] */ { register (*kfunc)(); /* ptr to the requexted function to bind to */ int (*getname())(); /* prompt the user to type a named command */ mlwrite(": "); /* and now get the function name to execute */ kfunc = getname(); if (kfunc == NULL) { mlwrite("[No such function]"); return(FALSE); } /* and then execute the command */ return((*kfunc)(f, n)); } /* execcmd: Execute a command line command to be typed in by the user */ execcmd(f, n) int f, n; /* default Flag and Numeric argument */ { register int status; /* status return */ char cmdstr[NSTRING]; /* string holding command to execute */ /* get the line wanted */ if ((status = mlreply(": ", cmdstr, NSTRING)) != TRUE) return(status); execlevel = 0; return(docmd(cmdstr)); } /* docmd: take a passed string as a command line and translate it to be executed as a command. This function will be used by execute-command-line and by all source and startup files. Lastflag/thisflag is also updated. format of the command line is: {# arg} {} Directives start with a "!" and include: !endm End a macro !if (cond) conditional execution !else !endif !return Return (terminating current macro) !goto