DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T s

⟦8ace71398⟧ TextFile

    Length: 948 (0x3b4)
    Types: TextFile
    Names: »showfile.c«

Derivation

└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
    └─⟦3658e588a⟧ »EurOpenD3/mail/mh/mh-6.7.tar.Z« 
        └─⟦c75e36ecb⟧ 
            └─⟦this⟧ »mh-6.7/sbr/showfile.c« 

TextFile

/* showfile.c - invoke lproc */

#include "../h/mh.h"
#include <stdio.h>


showfile (arg, file)
register char **arg,
               *file;
{
    int     isdraft,
            pid;
    register int    vecp;
    char   *vec[MAXARGS];

    m_update ();
    (void) fflush (stdout);

    if (strcmp (r1bindex (lproc, '/'), "mhl") == 0)
	lproc = mhlproc;

    switch (pid = vfork ()) {
	case NOTOK: 
	    advise ("fork", "unable to");
	    return 1;

	case OK: 
	    vecp = 0;
	    vec[vecp++] = r1bindex (lproc, '/');
	    isdraft = 1;
	    if (arg)
		while (*arg) {
		    if (**arg != '-')
			isdraft = 0;
		    vec[vecp++] = *arg++;
		}
	    if (isdraft) {
		if (strcmp (vec[0], "show") == 0)
		    vec[vecp++] = "-file";
		vec[vecp++] = file;
	    }
	    vec[vecp] = NULL;

	    execvp (lproc, vec);
	    fprintf (stderr, "unable to exec ");
	    perror (lproc);
	    _exit (-1);

	default: 
	    return (pidwait (pid, NOTOK) & 0377 ? 1 : 0);
    }
}