
SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 1
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (1)



    1        	/*
    2        	 * @(#)sysdep.vms 1.4 87/09/29	Copyright 1987 Free Software Foundation, Inc.
    3        	 *
    4        	 * Copying and use of this program are controlled by the terms of the
    5        	 * GNU Emacs General Public License.
    6        	 */
    7        	
    8        	#ifndef lint
    9        	char sysdep_version[] = "@(#)sysdep.vms gnuucp Version hoptoad-1.4";
   10        	#endif
   11        	
   12        	/*
   13        	 * Split out of uuslave.c by John Gilmore, 8 August 1987.
   14        	 * re-worked for VMS by Lol Grant 15th. Aug. 1987, Sept. 87
   15        	 */
   16        	
   17        	/*
   18        	 * had to move includes.h to the beginning instead of the end so that
   19        	 * NAMESIZE would be defined within uucp.h .  How did this work before? JEH
   20        	 */
   21        	
   22        	#include "includes.h"
 2951        	#include "uucp.h"
 3037        	#include "sysdep.h"
 3141        	
 3142        	/*
 3143        	 * Exported variables
 3144        	 */
 3145        	char sysdep_control[] = CONTROL;
 3146        	
 3147        	
 3148        	/* Our variables */
 3149        	struct tt_mode {
 3150        	    char class, type;
 3151        	    short width;
 3152        	    int basic:24;
 3153        	    char length;
 3154        	    long extended;
 3155        	};
 3156        	
 3157        	struct iosb_struct {
 3158        	    short status, size, terminator, termsize;
 3159        	};
 3160        	
 3161        	static struct tt_mode ttold, ttraw;
 3162        	static struct iosb_struct ttiosb;
 3163        	
 3164        	int fdtty;			/* File descriptor for tty line */
 3165        	
 3166        	void sigint();			/* Forward declaration */
 3167        	
 3168        	/*
 3169        	 * Translation between integer baud rates and VMS baud rates (grumble)
 3170        	 */
 3171        	static struct baudtab {

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 2
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (1)

 3172        	    int baudrate, damn_B_code;
 3173        	} baudtab[] = {
 3174        	
 3175        	     110, TT$C_BAUD_110,
 3176        	     150, TT$C_BAUD_150,
 3177        	     300, TT$C_BAUD_300,
 3178        	     600, TT$C_BAUD_600,
 3179        	     1200, TT$C_BAUD_1200,
 3180        	     1800, TT$C_BAUD_1800,
 3181        	     2400, TT$C_BAUD_2400,
 3182        	     4800, TT$C_BAUD_4800,
 3183        	     9600, TT$C_BAUD_9600,
 3184        	     19200, TT$C_BAUD_19200
 3185        	};
 3186        	
 3187        	static int
 3188        	damn_B(baud)
 3189        	{
 3190    1   	    register struct baudtab *b;
 3191    1   	
 3192    1   	    for (b = baudtab; b->baudrate < baud; b++)
 3193    1   		continue;
 3194    1   	    if (b->baudrate == baud)
 3195    1   		return b->damn_B_code;
 3196    1   	    return 0;
 3197    1   	}
 3198        	
 3199        	
 3200        	/*
 3201        	 * Open the serial line for an incoming call.
 3202        	 * Argument of NULL or empty string means stdin.
 3203        	 */
 3204        	int
 3205        	openline(ttynam, baud)
 3206        		char	*ttynam;
 3207        		int	baud;
 3208        	{
 3209    1   	    int ontheline;
 3210    1   	    int ret, speed;
 3211    1   	    struct dsc$descriptor_s tmp;
 3212    1   	
 3213    1   	    ontheline = !(ttynam && ttynam[0]);	/* FIXME, this is garbage */
 3214    1   	
 3215    1   	    speed = 0;
 3216    1   	
 3217    1   	    if (ontheline)
 3218    1   		ttynam = "SYS$OUTPUT";
 3219    1   	
 3220    1   	    tmp.dsc$w_length = strlen(ttynam);
 3221    1   	    tmp.dsc$a_pointer = ttynam;
 3222    1   	    tmp.dsc$b_class = DSC$K_CLASS_S;
 3223    1   	    tmp.dsc$b_dtype = DSC$K_DTYPE_T;
 3224    1   	
 3225    1   	    if (((ret = sys$assign(&tmp, &fdtty, 0, 0)) & 1) != 1) {
 3226    2   		DEBUG(0, "Openline: assign %d", ret);
 3227    2   		exit(0);
 3228    2   	    }

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 3
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (1)

 3229    1   	    ret = sys$qiow(0, fdtty, IO$_SENSEMODE, 0, 0, 0, &ttold,
 3230    1   			   sizeof(ttold), 0, 0, 0, 0);
 3231    1   	
 3232    1   	    bcopy(&ttold,&ttraw,sizeof(struct tt_mode));
 3233    1   	    ttraw.basic |= TT$M_PASSALL;
 3234    1   	    ttraw.basic |= TT$M_NOECHO | TT$M_EIGHTBIT;
 3235    1   	    ttraw.basic &= ~TT$M_WRAP & ~TT$M_HOSTSYNC & ~TT$M_TTSYNC & 
 3236    1   			~TT$M_NOBRDCST ;
 3237    1   	    ttraw.extended &= ~TT2$M_DISCONNECT;
 3238    1   	
 3239    1   	    if (!ontheline)
 3240    1   		speed = damn_B(baud);
 3241    1   	
 3242    1   	    ret = sys$qiow(0, fdtty, IO$_SETMODE, 0, 0, 0, &ttraw, sizeof(ttraw),
 3243    1   			   speed, 0, 0, 0);
 3244    1   	
 3245    1   	    return SUCCESS;
 3246    1   	/*	signal(SIGINT,sigint); */
 3247    1   	}
 3248        	
 3249        	
 3250        	/*
 3251        	 * Open the serial line for an outgoing call.
 3252        	 */
 3253        	int
 3254        	openout(ttynam, baud)
 3255        	char *ttynam;
 3256        	int baud;
 3257        	{
 3258    1   	    int ret, speed;
 3259    1   	    struct dsc$descriptor_s tmp;
 3260    1   	
 3261    1   	    tmp.dsc$w_length = strlen(ttynam);
 3262    1   	    tmp.dsc$a_pointer = ttynam;
 3263    1   	    tmp.dsc$b_class = DSC$K_CLASS_S;
 3264    1   	    tmp.dsc$b_dtype = DSC$K_DTYPE_T;
 3265    1   	
 3266    1   	    if (((ret = sys$assign(&tmp, &fdtty, 0, 0)) & 1) != 1) {
 3267    2   		DEBUG(0, "openout: assign %d", ret);
 3268    2   		return -1;
 3269    2   	    }
 3270    1   	    ret = sys$qiow(0, fdtty, IO$_SENSEMODE, 0, 0, 0, &ttold,
 3271    1   			   sizeof(ttold), 0, 0, 0, 0);
 3272    1   	
 3273    1   	    bcopy(&ttold,&ttraw,sizeof(struct tt_mode));
 3274    1   	
 3275    1   	    ttraw.basic |= TT$M_PASSALL;
 3276    1   	    ttraw.basic |= TT$M_NOECHO | TT$M_EIGHTBIT;
 3277    1   	    ttraw.basic &= ~TT$M_WRAP & ~TT$M_HOSTSYNC & ~TT$M_TTSYNC & 
 3278    1   			~TT$M_NOBRDCST ;
 3279    1   	
 3280    1   	    speed = damn_B(baud);
 3281    1   	
 3282    1   	    ret = sys$qiow(0, fdtty, IO$_SETMODE, 0, 0, 0, &ttraw, sizeof(ttraw),
 3283    1   			   speed, 0, 0, 0);
 3284    1   	
 3285    1   	    signal(SIGINT, sigint);

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 4
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (1)

 3286    1   	    return SUCCESS;
 3287    1   	}
 3288        	
 3289        	
 3290        	/*
 3291        	 * Basement level I/O routines
 3292        	 *
 3293        	 * xwrite() writes a character string to the serial port
 3294        	 * xgetc() returns a character from the serial port, or an EOF for timeout.
 3295        	 * sigint() restores the state of the serial port on exit.
 3296        	 * hangup() hangs up the serial port (e.g. drop DTR).
 3297        	 */
 3298        	
 3299        	void
 3300        	sigint()
 3301        	{
 3302    1   	    /* Restore terminal settings on dialout line */
 3303    1   	    sys$qiow(0, fdtty, IO$_SETMODE, 0, 0, 0, &ttold, sizeof(ttold),
 3304    1   		     0, 0, 0, 0);
 3305    1   	    exit(0);
 3306    1   	}
 3307        	
 3308        	
 3309        	
 3310        	/* Nothing is quite as simple in VMS */
 3311        	xwrite(buf, ctr)
 3312        	char *buf;
 3313        	int ctr;
 3314        	
 3315        	{
 3316    1   	    int ret;
 3317    1   	
 3318    1   	    ret = sys$qiow(0, fdtty, IO$_WRITEVBLK, 0, 0, 0, buf, ctr, 0, 0, 0, 0);
 3319    1   	    if ((ret & SS$_NORMAL) != 1)
 3320    1   		return (0);
 3321    1   	    return (ctr);
 3322    1   	}
 3323        	
 3324        	
 3325        	/*
 3326        	 * Serial port reading routines 
 3327        	 */
 3328        	int
 3329        	xgetc()
 3330        	{
 3331    1   	    char c;
 3332    1   	    long trmmsk[2];
 3333    1   	    int ret;
 3334    1   	
 3335    1   	    trmmsk[0] = 0;
 3336    1   	    trmmsk[1] = 0;
 3337    1   	
 3338    1   	    ret = sys$qiow(0, fdtty, IO$_READVBLK | IO$M_TIMED, &ttiosb, 0, 0,
 3339    1   			   &c, 1, BYTE_TIMEOUT, trmmsk, 0, 0);
 3340    1   	
 3341    1   	    if (ttiosb.status == SS$_TIMEOUT | ttiosb.status == SS$_HANGUP)
 3342    1   		return (EOF);

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 5
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (1)

 3343    1   	
 3344    1   	    if (ret & SS$_NORMAL)
 3345    1   		return (c & 0xff);
 3346    1   	
 3347    1   	    return (EOF);
 3348    1   	}
 3349        	
 3350        	/*
 3351        	 * hangup(): hang up the 'fone, deassign channel.  
 3352        	 */
 3353        	void
 3354        	hangup()
 3355        	{
 3356    1   	    tthang();
 3357    1   	    sys$dassgn(fdtty);
 3358    1   	}
 3359        	
 3360        	/*
 3361        	 * tthang():  Drop DTR on the terminal.  
 3362        	 */
 3363        	void
 3364        	tthang()
 3365        	{
 3366    1   	    long iosb[2], p1_buff[2];
 3367    1   	
 3368    1   	    sys$cancel(fdtty);
 3369    1   	    sys$qiow(0, fdtty, (IO$_SETMODE | IO$M_HANGUP), iosb,
 3370    1   	        0, 0, p1_buff, 0, 0, 0, 0, 0);
 3371    1   	    sleep(6);
 3372    1   	}
 3373        	

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 6
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (2)

             	
 3374        	/* 
 3375        	/* wrtmbx(str1,str2): send a message to the mailbox.
 3376        	*/
 3377        	extern short int mbchan;
 3378        	void
 3379        	wrtmbx(str1,str2)
 3380        	char *str1, *str2;
 3381        	{
 3382    1   		char mbmsg[255];
 3383    1   		long iosb[2];
 3384    1   	
 3385    1   		sprintf(mbmsg, "%s %s", str1, str2);
 3386    1   		sys$qiow(0, mbchan, IO$_WRITEVBLK, iosb, 0, 0, 
 3387    1   			mbmsg, strlen(mbmsg), 0, 0, 0, 0);
 3388    1   	}
 3389        	
 3390        	

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 7
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (3)

             	
 3391        	/*
 3392        	 * Create a temporary file name for receiving a file into.
 3393        	 * "name" is the name we will actually eventually want to use for the file.
 3394        	 * We currently ignore it, but some OS's that can't move files around
 3395        	 * easily might want to e.g. put the temp file into the same directory
 3396        	 * that this file is going into.
 3397        	 *
 3398        	 * FIXME:
 3399        	 * This interface should be able to return a "possible" filename, and
 3400        	 * be re-called if the name is already in use, to get another.
 3401        	 * This avoids checking here whether the name is good -- saving system calls.
 3402        	 */
 3403        	char *
 3404        	temp_filename(name)
 3405        	register char *name;
 3406        	{
 3407    1   	    static char tname[NAMESIZE];
 3408    1   	
 3409    1   	    if (ourpid == 0)
 3410    1   		ourpid = getpid();
 3411    1   	    (void) sprintf(tname, "TM.u%d", ourpid);
 3412    1   	    DEBUG(7, "Using temp file %s\n", tname);
 3413    1   	    return tname;
 3414    1   	}
 3415        	
 3416        	
 3417        	char *
 3418        	substrloc(small, big)
 3419        	char *small, *big;
 3420        	{
 3421    1   		int i;
 3422    1   		for (i=0; i<=(strlen(big)-strlen(small)); i++) {
 3423    2   			if ( strncmp(small, &(big[i]), strlen(small))==0 )
 3424    2   				return(&(big[i]));
 3425    2   		}
 3426    1   		return(NULL);
 3427    1   	}
 3428        	
 3429        	void
 3430        	fix_x_filename(fn)
 3431        	char *fn;
 3432        	{
 3433    1   		char *xloc, *tail;
 3434    1   		int head_len;
 3435    1   		char tmp[NAMESIZE];
 3436    1   	
 3437    1   		sprintf(tmp, "X.%s", host_name);
 3438    1   		if ((xloc = substrloc(tmp, fn)) == NULL) {
 3439    2   			sprintf(tmp, "x.%s", host_name);
 3440    2   			xloc = substrloc(tmp, fn);
 3441    2   		}
 3442    1   		if (xloc == NULL)
 3443    1   			return;
 3444    1   		tail = &(xloc[strlen(tmp)]);
 3445    1   		head_len = fn - tail;
 3446    1   		strncpy(tmp, fn, head_len);

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 8
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (3)

 3447    1   		strcat(tmp, "_");
 3448    1   		strcat(tmp, tail);
 3449    1   		strcpy(fn, tmp);
 3450    1   		return;
 3451    1   	}
 3452        	
 3453        	/*
 3454        	 * Transform a filename from a uucp packet (in Unix format) into a local
 3455        	 * filename that will work in the local file system.
 3456        	 */
 3457        	char *
 3458        	munge_filename(name)
 3459        	register char *name;
 3460        	{
 3461    1   	    int i, l, j;
 3462    1   	    char buff[NAMESIZE+SLOP];
 3463    1   	
 3464    1   	    DEBUG(7, "Munge_filename  input: %s\n", name);
 3465    1   	    l = strlen(name);
 3466    1   	
 3467    1   	    /*	ignore anything preceding any of the delimiters that separate 
 3468    1   	    	VMS file names from node, device, or directory specs, so we 
 3469    1   	    	are constrained to the spool directory -- JEH
 3470    1   	    */
 3471    1   	
 3472    1   	    for (i = l; i >= 0; i--)
 3473    1   	        if ((name[i] == '/') | (name[i] == ']') |
 3474    1   	    	    (name[i] == '>') | (name[i] == ':') ) {
 3475    2   	            break;
 3476    2   	    }
 3477    1   	    j = 0;
 3478    1   	    for (i++; i < l; i++)
 3479    1   	        buff[j++] = name[i];
 3480    1   	    buff[j++] = '\0';
 3481    1   	
 3482    1   	 	/*
 3483    1   		 * concatenate what's left to the logical for the spool directory.
 3484    1   		 * The worst that can happen here is that someone will create a 
 3485    1   		 * strangely-named file in the spool directory.  
 3486    1   		 */
 3487    1   	
 3488    1   	    sprintf(name, "%s%s", Pubdir, buff);
 3489    1   	 
 3490    1   	    DEBUG(7, "Munge_filename output: %s\n", name);
 3491    1   	    return name;
 3492    1   	}
 3493        	
 3494        	
 3495        	/*
 3496        	 * Uucp work queue scan.
 3497        	 *
 3498        	 * gotsome = work_scan(hostname, type);
 3499        	 * return 1 if files matching type.hostname* exist.
 3500        	 * if hostname is NULL, match type.*. Sets up template for work_next.
 3501        	 *
 3502        	 * workfile = work_next();
 3503        	 * Return the name of the next file to match or NULL.

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 9
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (3)

 3504        	 *
 3505        	 * void work_done();
 3506        	 * No more matches required.
 3507        	 */
 3508        	
 3509        	int context = NULL;		/* Context for lib$find_file */
 3510        	char template[255];		/* Template for lib$find_file to match */
 3511        	
 3512        	void
 3513        	work_done()
 3514        	{
 3515    1   	    if (context)
 3516    1   		lib$find_file_end(&context);
 3517    1   	    context = NULL;
 3518    1   	}
 3519        	
 3520        	
 3521        	/* return 1 if type.host* exists else 0 */
 3522        	
 3523        	int
 3524        	work_scan(host, type)
 3525        	char *host;
 3526        	char *type;
 3527        	{
 3528    1   	    int length, ret;
 3529    1   	    char *strchr();
 3530    1   	    char file_found[255];
 3531    1   	    struct dsc$descriptor_s result_dsc, file_dsc;
 3532    1   	
 3533    1   	    result_dsc.dsc$w_length = 0;
 3534    1   	    result_dsc.dsc$a_pointer = file_found;
 3535    1   	    result_dsc.dsc$b_class = DSC$K_CLASS_S;
 3536    1   	    result_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
 3537    1   	
 3538    1   	    file_dsc.dsc$w_length = strlen(template);
 3539    1   	    file_dsc.dsc$a_pointer = template;
 3540    1   	    file_dsc.dsc$b_class = DSC$K_CLASS_S;
 3541    1   	    file_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
 3542    1   	
 3543    1   	    if (!host)
 3544    1   		host = "";
 3545    1   	
 3546    1   	    sprintf(template, "%s.%s_*", type, host);
 3547    1   	
 3548    1   	    if (context)
 3549    1   		work_done();		/* Clean up prev call, if any */
 3550    1   	
 3551    1   	    file_dsc.dsc$w_length = strlen(template);
 3552    1   	    result_dsc.dsc$w_length = sizeof(file_found);
 3553    1   	
 3554    1   	    ret = lib$find_file(&file_dsc, &result_dsc, &context);
 3555    1   	
 3556    1   	    work_done();
 3557    1   	
 3558    1   	    switch (ret) {
 3559    2   	    case RMS$_NORMAL:
 3560    2   		return 1;

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 10
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (3)

 3561    2   	
 3562    2   	    case RMS$_NMF:		/* no more files */
 3563    2   	    default:
 3564    2   		return NULL;
 3565    2   	    }
 3566    1   	}
 3567        	
 3568        	
 3569        	char *
 3570        	work_next()
 3571        	{
 3572    1   	    int length, ret;
 3573    1   	    char *strchr();
 3574    1   	
 3575    1   	    static char file_found[255];
 3576    1   	
 3577    1   	    struct dsc$descriptor_s result_dsc, file_dsc;
 3578    1   	
 3579    1   	    result_dsc.dsc$w_length = sizeof(file_found);
 3580    1   	    result_dsc.dsc$a_pointer = file_found;
 3581    1   	    result_dsc.dsc$b_class = DSC$K_CLASS_S;
 3582    1   	    result_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
 3583    1   	
 3584    1   	    file_dsc.dsc$w_length = strlen(template);
 3585    1   	    file_dsc.dsc$a_pointer = template;
 3586    1   	    file_dsc.dsc$b_class = DSC$K_CLASS_S;
 3587    1   	    file_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
 3588    1   	
 3589    1   	    ret = lib$find_file(&file_dsc, &result_dsc, &context);
 3590    1   	
 3591    1   	    length = strchr(file_found, ' ') - file_found;
 3592    1   	    file_found[length] = '\0';
 3593    1   	
 3594    1   	    switch (ret) {
 3595    2   	    case RMS$_NORMAL:
 3596    2   		return file_found;
 3597    2   	
 3598    2   	    case RMS$_NMF:		/* no more files */
 3599    2   	    default:
 3600    2   		return NULL;
 3601    2   	    }
 3602    1   	}
 3603        	
 3604        	bcopy(from, to, cnt)
 3605        	register char *from;
 3606        	register char *to;
 3607        	register int cnt;
 3608        	{
 3609    1   	    register int i;
 3610    1   	
 3611    1   	    for (i = 0; i < cnt; i++)
 3612    1   	        *to++ = *from++;
 3613    1   	}
 3614        	
 3615        	bzero(s, cnt)
 3616        	register char *s;
 3617        	register int cnt;

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 11
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (3)

 3618        	{
 3619    1   	    register int i;
 3620    1   	
 3621    1   	    for (i = 0; i < cnt; i++)
 3622    1   	        *s++ = '\0';
 3623    1   	}
 3624        	
 3625        	#ifdef bogus
 3626   X    	/* ifdef'd out -- already in VAX-11 C RTL (V2.3)  JEH */
 3627   X    	rename(from, to)
 3628   X    	char *to, *from;
 3629   X    	{
 3630   X    	    int ifd, ofd, n;
 3631   X    	
 3632   X    	    char buff[512];
 3633   X    	
 3634   X    	    if ((ifd = open(from, 0)) < 0)
 3635   X    	        return (0);
 3636   X    	
 3637   X    	    if ((ofd = creat(to, 0)) < 0)
 3638   X    	        return (1);
 3639   X    	
 3640   X    	    while ((n = read(ifd, buff, sizeof(buff))) > 0)
 3641   X    	        write(ofd, buff, n);
 3642   X    	    if (close(ifd) < 0)
 3643   X    	        return (1);
 3644   X    	    if (close(ofd) < 0)
 3645   X    	        return (1);
 3646   X    	    delete(from);
 3647   X    	    return (0);
 3648   X    	}
 3649        	#endif
 3650        	
 3651        	#ifdef bogus
 3652   X    	/* ifdef'd out -- already in VAX-11 C RTL (V2.3)  JEH */
 3653   X    	char *
 3654   X    	strtok(string, separators)
 3655   X    	char *string, *separators;
 3656   X    	{
 3657   X    	    char *p;
 3658   X    	    static char *start, *last;
 3659   X    	
 3660   X    	    if (string != NULL) {
 3661   X    		start = string;
 3662   X    		/* skip leading separators */
 3663   X    	        while(*start && isin(*start,separators))
 3664   X    		    start++;
 3665   X    		last = start;
 3666   X    	    }
 3667   X    	
 3668   X    	    p = start;
 3669   X    	
 3670   X    	    if (*last == NULL)
 3671   X    		return NULL;
 3672   X    	
 3673   X    	    /* find first separator and NULL it */
 3674   X    	    while (*last && !isin(*last, separators))

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 12
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (3)

 3675   X    		last++;
 3676   X    	    *last++ = NULL;
 3677   X    	
 3678   X    	    /* find next non-separator */
 3679   X    	    while (*last && isin(*last, separators))
 3680   X    		last++;
 3681   X    	    start = last;
 3682   X    	    return p;
 3683   X    	}
 3684        	#endif
 3685        	
 3686        	isin(ch, setofchars)
 3687        	char ch, *setofchars;
 3688        	{
 3689    1   	    char *cp;
 3690    1   	
 3691    1   	    for (cp = setofchars; *cp; cp++)
 3692    1   		if (*cp == ch)
 3693    1   		    return 1;
 3694    1   	    return 0;
 3695    1   	}
 3696        	
 3697        	spawn(command, input, output)
 3698        	char *command, *input, *output;
 3699        	{
 3700    1   	    int ret;
 3701    1   	    int status;
 3702    1   	
 3703    1   	    $DESCRIPTOR(tmp1, command);
 3704    1   	    $DESCRIPTOR(tmp2, input);
 3705    1   	    $DESCRIPTOR(tmp3, output);
 3706    1   	
 3707    1   	    tmp1.dsc$w_length = strlen(command);
 3708    1   	    tmp2.dsc$w_length = strlen(input);
 3709    1   	    tmp3.dsc$w_length = strlen(output);
 3710    1   	
 3711    1   	    ret = lib$spawn(&tmp1, &tmp2, &tmp3, 0, 0, 0, &status, 0, 0, 0);
 3712    1   	    DEBUG(1, "spawn: completed %d\n", ret);
 3713    1   	    if (!(ret & 1 && status & 1))
 3714    1   		return (0);
 3715    1   	    return (status);
 3716    1   	}
 3717        	
 3718        	/*
 3719        	** void pqsort(vec, nel, esize, compptr)
 3720        	**
 3721        	**  Quick Sort routine.
 3722        	**  Based on Knuth's ART OF COMPUTER PROGRAMMING, VOL III, pp 114-117.
 3723        	**  For some unknown reason, this works faster than the library's qsort.
 3724        	**
 3725        	** Parameters:
 3726        	**  vec = points to beginning of structure to sort.
 3727        	**  nel = number of elements.
 3728        	**  esize = size of an element.
 3729        	**  compptr = points to the routine for comparing two elements.
 3730        	**
 3731        	** Returns:

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 13
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (3)

 3732        	**  Nothing.
 3733        	*/
 3734        	
 3735        	static int elsize;		/* Element size */
 3736        	static int (*comp) ();		/* Address of comparison routing */
 3737        	
 3738        	static void memexch(), mysort();
 3739        	
 3740        	void 
 3741        	pqsort(vec, nel, esize, compptr)
 3742        	unsigned char *vec;
 3743        	int nel;
 3744        	int esize;
 3745        	int (*compptr) ();
 3746        	
 3747        	{
 3748    1   	    /* If less than 2 items, done */
 3749    1   	    if (nel < 2)
 3750    1   		return;
 3751    1   	
 3752    1   	    elsize = esize;
 3753    1   	    comp = compptr;
 3754    1   	
 3755    1   	    /* Call the real worker */
 3756    1   	    mysort(vec, nel);
 3757    1   	}
 3758        	
 3759        	/*
 3760        	** void mysort(vec, nel)
 3761        	**
 3762        	**  The real quick sort routine.
 3763        	**
 3764        	** Parameters:
 3765        	**  vec = points to beginning of structure to sort.
 3766        	**  nel = number of elements.
 3767        	**
 3768        	**  esize = size of an element.
 3769        	**  compptr = points to the routine for comparing two elements.
 3770        	**
 3771        	** Returns:
 3772        	**  Nothing.
 3773        	*/
 3774        	
 3775        	static void 
 3776        	mysort(vec, nel)
 3777        	unsigned char *vec;
 3778        	int nel;
 3779        	
 3780        	{
 3781    1   	    register short i, j;
 3782    1   	    register unsigned char *iptr, *jptr, *kptr;
 3783    1   	
 3784    1   	    /* * If 2 items, check them by hand. */
 3785    1   	
 3786    1   	begin:
 3787    1   	    if (nel == 2) {
 3788    2   		if ((*comp) (vec, vec + elsize) > 0)

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 14
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (3)

 3789    2   		    memexch(vec, vec + elsize, elsize);
 3790    2   		return;
 3791    2   	    }
 3792    1   	    /* * Initialize for this round. */
 3793    1   	
 3794    1   	    j = nel;
 3795    1   	    i = 0;
 3796    1   	    kptr = vec;
 3797    1   	    iptr = vec;
 3798    1   	    jptr = vec + elsize * nel;
 3799    1   	
 3800    1   	    while (--j > i) {
 3801    2   	
 3802    2   		/* * From the righthand side, find the first value that should be *
 3803    2   		 * to the left of k. */
 3804    2   	
 3805    2   		jptr -= elsize;
 3806    2   		if ((*comp) (jptr, kptr) > 0)
 3807    2   		    continue;
 3808    2   	
 3809    2   		/* * Now from the lefthand side, find the first value that should be *
 3810    2   		 * to the right of k. */
 3811    2   	
 3812    2   		iptr += elsize;
 3813    2   		while (++i < j && (*comp) (iptr, kptr) <= 0)
 3814    2   		    iptr += elsize;
 3815    2   	
 3816    2   		if (i >= j)
 3817    2   		    break;
 3818    2   	
 3819    2   		/* * Exchange the two items. * k will eventually end up between them. */
 3820    2   	
 3821    2   		memexch(jptr, iptr, elsize);
 3822    2   	    }
 3823    1   	
 3824    1   	    /* * Move item 0 into position. */
 3825    1   	
 3826    1   	    memexch(vec, iptr, elsize);
 3827    1   	
 3828    1   	    /* * Now sort the two partitions. */
 3829    1   	
 3830    1   	    if ((nel -= (i + 1)) > 1)
 3831    1   		mysort(iptr + elsize, nel);
 3832    1   	
 3833    1   	    /* * To save a little time, just start the routine over by hand. */
 3834    1   	
 3835    1   	    if (i > 1) {
 3836    2   		nel = i;
 3837    2   		goto begin;
 3838    2   	    }
 3839    1   	}
 3840        	
 3841        	/*
 3842        	** memexch(s1, s2, n)
 3843        	**
 3844        	**  Exchange the contents of two vectors.
 3845        	**

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 15
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (3)

 3846        	** Parameters:
 3847        	**  s1 = points to one vector.
 3848        	**  s2 = points to another vector.
 3849        	**  n = size of the vectors in bytes.
 3850        	**
 3851        	** Returns:
 3852        	**  Nothing.
 3853        	*/
 3854        	
 3855        	static void 
 3856        	memexch(s1, s2, n)
 3857        	register unsigned char *s1;
 3858        	register unsigned char *s2;
 3859        	register int n;
 3860        	
 3861        	{
 3862    1   	    register unsigned char c;
 3863    1   	
 3864    1   	    while (n--) {
 3865    2   		c = *s1;
 3866    2   		*s1++ = *s2;
 3867    2   		*s2++ = c;
 3868    2   	    }
 3869    1   	}
 3870        	
 3871        	getwd(buff)
 3872        	char *buff;
 3873        	{
 3874    1   	    char *p = getenv("PATH");
 3875    1   	
 3876    1   	    strcpy(buff, p);
 3877    1   	}
 3878        	
 3879        	#ifdef bogus
 3880   X    	/* ifdef'd out -- already in VAX-11 C RTL (V2.3)  JEH */
 3881   X    	system(buff)
 3882   X    	char *buff;
 3883   X    	{
 3884   X    	    return (spawn(buff, "NL:", "NL:") & 1 == 0);
 3885   X    	}
 3886        	#endif
 3887        	
 3888        	

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 16
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (4)

             	
 3889        	/*
 3890        	 * Routine to return a string that gives the current date and time, and
 3891        	 * identifies the current process, if on a multiprocess system.
 3892        	 */
 3893        	char *
 3894        	time_and_pid()
 3895        	{
 3896    1   		long clock;
 3897    1   		struct tm *tm;
 3898    1   		static int ourpid = 0;
 3899    1   		static char format[] = "%d/%d-%d:%02d:%02d-%d";
 3900    1   		static char outbuf[sizeof(format)];
 3901    1   	
 3902    1   		(void) time(&clock);
 3903    1   		tm = localtime(&clock);
 3904    1   		if (ourpid == 0)
 3905    1   			ourpid = getpid();
 3906    1   		sprintf(outbuf, format,
 3907    1   			tm->tm_mon+1, tm->tm_mday,
 3908    1   			tm->tm_hour, tm->tm_min, tm->tm_sec,
 3909    1   			ourpid);
 3910    1   		return outbuf;
 3911    1   	}
 3912        	
 3913        	

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 17
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (5)

             	
 3914        	
 3915        	/*  T T C D -- return carrier status (returns 1 if CD true) */
 3916        	 
 3917        	int
 3918        	ttcd()
 3919        	{
 3920    1   		long iosb[2];
 3921    1   		long p1_buff[2];
 3922    1   	
 3923    1   		sys$qiow(0, fdtty, IO$_SENSEMODE|IO$M_RD_MODEM, iosb, 0, 0, 
 3924    1   			p1_buff, 8, 0, 0, 0, 0);
 3925    1   		return( (p1_buff[0] & (TT$M_DS_CARRIER << 16) ) != 0);
 3926    1   	}
 3927        	
 3928        	

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 18
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)

             	
 3929        	
 3930        	
 3931        	/*  T T F L U I  --  Flush tty input buffer */
 3932        	
 3933        	void
 3934        	ttflui()
 3935        	{
 3936    1   	
 3937    1   	    long junk2;
 3938    1   	    sys$qiow(0, fdtty, IO$_READVBLK|IO$M_TIMED|IO$M_PURGE,
 3939    1   			 0, 0, 0, &junk2, 0, 0, 0, 0, 0);
 3940    1   	    return;
 3941    1   	}
 3942        	


SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 19
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)

                                       +-------------+
                                       | Storage Map |
                                       +-------------+
 
 

External Declarations
---------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

baudtab                          3171    8 bytes                      Structure tag
 baudrate                        3172    1 longword                    Member (offset = 0), long int
 damn_B_code                     3172    1 longword                    Member (offset = 4 bytes), long int
baudtab                          3173    80 bytes        Static       Initialized array [10] of struct baudtab
bcopy                            3604                    Extern def.  Function returning long int
CABS_T                           1500    16 bytes                     Structure tag
 x                               1500    1 quadword                    Member (offset = 0), double
 y                               1500    1 quadword                    Member (offset = 8 bytes), double
clock_t                          2532    1 longword                   Typedef:  long int
comp                             3736    1 longword      Static       Pointer to function returning long int
context                          3509    1 longword      Extern def.  Initialized long int
damn_B                           3188                    Static       Function returning long int
debug                            2992    1 longword      Extern       Long int
dev_t                            2272    1 longword                   Typedef:  pointer to char
dsc$descriptor_s                 458     8 bytes                      Structure tag
 dsc$w_length                    460     1 word                        Member (offset = 0), unsigned short int
 dsc$b_dtype                     463     1 byte                        Member (offset = 2 bytes), unsigned char
 dsc$b_class                     464     1 byte                        Member (offset = 3 bytes), unsigned char
 dsc$a_pointer                   465     1 longword                    Member (offset = 4 bytes), pointer to char
elsize                           3735    1 longword      Static       Long int
exit                             2363                    Extern       Void function
fdtty                            3164    1 longword      Extern def.  Long int
FILE                             2429    1 longword                   Typedef:  pointer to struct _iobuf
getenv                           2365                    Extern       Function returning pointer to char
host_name                        3029    20 bytes        Extern       Array [20] of char
ino_t                            2271    1 word                       Typedef:  unsigned short int
iosb_struct                      3157    8 bytes                      Structure tag
 status                          3158    1 word                        Member (offset = 0), short int
 size                            3158    1 word                        Member (offset = 2 bytes), short int
 terminator                      3158    1 word                        Member (offset = 4 bytes), short int
 termsize                        3158    1 word                        Member (offset = 6 bytes), short int
jmp_buf                          1750    15 longwords                 Typedef:  array [15] of long int
localtime                        2600                    Extern       Function returning pointer to struct tm
mbchan                           3377    1 word          Extern       Short int
memexch                          3738                    Static       Void function
memexch                          3856                    Static       Void function
mysort                           3738                    Static       Void function
mysort                           3776                    Static       Void function
off_t                            2270    1 longword                   Typedef:  unsigned long int
ourpid                           3030    1 longword      Extern       Long int
port                             3016    68 bytes                     Structure tag
 portname                        3017    20 bytes                      Member (offset = 0), array [20] of char
 modemname                       3018    20 bytes                      Member (offset = 20 bytes), array [20] of char
 devname                         3019    20 bytes                      Member (offset = 40 bytes), array [20] of char
 baud                            3020    1 longword                    Member (offset = 60 bytes), long int

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 20
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

 chain                           3021    1 longword                    Member (offset = 64 bytes), pointer to struct port
printf                           2500                    Extern       Function returning long int
Pubdir                           3033    1 longword      Extern       Pointer to char
sigint                           3166                    Extern       Void function
sigint                           3300                    Extern def.  Void function
signal                           1829                    Extern       Function returning pointer to function returning long int
sigstack                         1816    8 bytes                      Structure tag
 ss_sp                           1818    1 longword                    Member (offset = 0), pointer to char
 ss_onstack                      1819    1 longword                    Member (offset = 4 bytes), long int
sigvec                           1800    12 bytes                     Structure tag
 sv_handler                      1802    1 longword                    Member (offset = 0), pointer to function returning long int
 sv_mask                         1803    1 longword                    Member (offset = 4 bytes), long int
 sv_onstack                      1804    1 longword                    Member (offset = 8 bytes), long int
sleep                            1843                    Extern       Function returning long int
sprintf                          2501                    Extern       Function returning long int
strcat                           2832                    Extern       Function returning pointer to char
strcpy                           2828                    Extern       Function returning pointer to char
strlen                           2856                    Extern       Function returning long int
strncmp                          2838                    Extern       Function returning long int
strncpy                          2830                    Extern       Function returning pointer to char
substrloc                        3418                    Extern def.  Function returning pointer to char
tbuffer                          2543    16 bytes                     Structure tag
 proc_user_time                  2545    1 longword                    Member (offset = 0), long int
 proc_system_time                2545    1 longword                    Member (offset = 4 bytes), long int
 child_user_time                 2546    1 longword                    Member (offset = 8 bytes), long int
 child_system_time               2546    1 longword                    Member (offset = 12 bytes), long int
tbuffer_t                        2549    16 bytes                     Typedef:  struct tbuffer
template                         3510    255 bytes       Extern def.  Array [255] of char
time                             2590                    Extern       Function returning long int
timeb                            2565    10 bytes                     Structure tag
 time                            2567    1 longword                    Member (offset = 0), long int
 millitm                         2568    1 word                        Member (offset = 4 bytes), unsigned short int
 timezone                        2569    1 word                        Member (offset = 6 bytes), short int
 dstflag                         2570    1 word                        Member (offset = 8 bytes), short int
timeb_t                          2573    10 bytes                     Typedef:  struct timeb
time_t                           2538    1 longword                   Typedef:  long int
tm                               2577    36 bytes                     Structure tag
 tm_sec                          2579    1 longword                    Member (offset = 0), long int
 tm_min                          2579    1 longword                    Member (offset = 4 bytes), long int
 tm_hour                         2579    1 longword                    Member (offset = 8 bytes), long int
 tm_mday                         2580    1 longword                    Member (offset = 12 bytes), long int
 tm_mon                          2580    1 longword                    Member (offset = 16 bytes), long int
 tm_year                         2580    1 longword                    Member (offset = 20 bytes), long int
 tm_wday                         2581    1 longword                    Member (offset = 24 bytes), long int
 tm_yday                         2581    1 longword                    Member (offset = 28 bytes), long int
 tm_isdst                        2581    1 longword                    Member (offset = 32 bytes), long int
tm_t                             2584    36 bytes                     Typedef:  struct tm
tthang                           3134                    Extern       Void function
tthang                           3364                    Extern def.  Void function
ttiosb                           3162    8 bytes         Static       Struct iosb_struct
ttold                            3161    12 bytes        Static       Struct tt_mode
ttraw                            3161    12 bytes        Static       Struct tt_mode
tt_mode                          3149    12 bytes                     Structure tag
 class                           3150    1 byte                        Member (offset = 0), char

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 21
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

 type                            3150    1 byte                        Member (offset = 1 byte), char
 width                           3151    1 word                        Member (offset = 2 bytes), short int
 basic                           3152    24 bits                       Member (offset = 4 bytes), signed field
 length                          3153    1 byte                        Member (offset = 7 bytes), char
 extended                        3154    1 longword                    Member (offset = 8 bytes), long int
work_done                        3513                    Extern def.  Void function
_iobuf                           2409    14 bytes                     Structure tag
 _cnt                            2411    1 longword                    Member (offset = 0), long int
 _ptr                            2412    1 longword                    Member (offset = 4 bytes), pointer to char
 _base                           2413    1 longword                    Member (offset = 8 bytes), pointer to char
 _flag                           2414    1 byte                        Member (offset = 12 bytes), char
 _file                           2425    1 byte                        Member (offset = 13 bytes), char
 
 

Function "damn_B" defined at line 3188
--------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

b                                3190    1 longword      Register     Pointer to struct baudtab
baud                             3189    1 longword                   Parameter # 1, long int
 
 

Function "openline" defined at line 3205
----------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

baud                             3207    1 longword                   Parameter # 2, long int
bcopy                            3232                    Extern       Function returning long int
ontheline                        3209    1 longword      Not Alloc.   Long int
ret                              3210    1 longword      Not Alloc.   Long int
speed                            3210    1 longword      Register     Long int
sys$assign                       3225                    Extern       Function returning long int
sys$qiow                         3229                    Extern       Function returning long int
tmp                              3211    8 bytes         Auto         Struct dsc$descriptor_s
ttynam                           3206    1 longword                   Parameter # 1, pointer to char
 
 

Function "openout" defined at line 3254
---------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

baud                             3256    1 longword                   Parameter # 2, long int
bcopy                            3273                    Extern       Function returning long int
ret                              3258    1 longword      Not Alloc.   Long int
speed                            3258    1 longword      Not Alloc.   Long int

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 22
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

sys$assign                       3266                    Extern       Function returning long int
sys$qiow                         3270                    Extern       Function returning long int
tmp                              3259    8 bytes         Auto         Struct dsc$descriptor_s
ttynam                           3255    1 longword                   Parameter # 1, pointer to char
 
 

Function "sigint" defined at line 3300
--------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

sys$qiow                         3303                    Extern       Function returning long int
 
 

Function "xwrite" defined at line 3311
--------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

buf                              3312    1 longword                   Parameter # 1, pointer to char
ctr                              3313    1 longword                   Parameter # 2, long int
ret                              3316    1 longword      Not Alloc.   Long int
sys$qiow                         3318                    Extern       Function returning long int
 
 

Function "xgetc" defined at line 3329
-------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

c                                3331    1 byte          Auto         Char
ret                              3333    1 longword      Not Alloc.   Long int
sys$qiow                         3338                    Extern       Function returning long int
trmmsk                           3332    2 longwords     Auto         Array [2] of long int
 
 

Function "hangup" defined at line 3354
--------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

sys$dassgn                       3357                    Extern       Function returning long int
 
 

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 23
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)


Function "tthang" defined at line 3364
--------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

iosb                             3366    2 longwords     Auto         Array [2] of long int
p1_buff                          3366    2 longwords     Auto         Array [2] of long int
sys$cancel                       3368                    Extern       Function returning long int
sys$qiow                         3369                    Extern       Function returning long int
 
 

Function "wrtmbx" defined at line 3379
--------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

iosb                             3383    2 longwords     Auto         Array [2] of long int
mbmsg                            3382    255 bytes       Auto         Array [255] of char
str1                             3380    1 longword                   Parameter # 1, pointer to char
str2                             3380    1 longword                   Parameter # 2, pointer to char
sys$qiow                         3386                    Extern       Function returning long int
 
 

Function "temp_filename" defined at line 3404
---------------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

getpid                           3410                    Extern       Function returning long int
tname                            3407    255 bytes       Static       Array [255] of char
 
 

Function "substrloc" defined at line 3418
-----------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

big                              3419    1 longword                   Parameter # 2, pointer to char
i                                3421    1 longword      Register     Long int
small                            3419    1 longword                   Parameter # 1, pointer to char
 
 

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 24
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)


Function "fix_x_filename" defined at line 3430
----------------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

fn                               3431    1 longword                   Parameter # 1, pointer to char
head_len                         3434    1 longword      Not Alloc.   Long int
tail                             3433    1 longword      Not Alloc.   Pointer to char
tmp                              3435    255 bytes       Auto         Array [255] of char
xloc                             3433    1 longword      Register     Pointer to char
 
 

Function "munge_filename" defined at line 3458
----------------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

buff                             3462    265 bytes       Auto         Array [265] of char
i                                3461    1 longword      Register     Long int
j                                3461    1 longword      Register     Long int
l                                3461    1 longword      Register     Long int
name                             3459    1 longword      Register     Parameter # 1, pointer to char
 
 

Function "work_done" defined at line 3513
-----------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

lib$find_file_end                3516                    Extern       Function returning long int
 
 

Function "work_scan" defined at line 3524
-----------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

file_dsc                         3531    8 bytes         Auto         Struct dsc$descriptor_s
file_found                       3530    255 bytes       Auto         Array [255] of char
host                             3525    1 longword                   Parameter # 1, pointer to char
lib$find_file                    3554                    Extern       Function returning long int
result_dsc                       3531    8 bytes         Auto         Struct dsc$descriptor_s
ret                              3528    1 longword      Not Alloc.   Long int
type                             3526    1 longword                   Parameter # 2, pointer to char
 
 

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 25
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)


Function "work_next" defined at line 3570
-----------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

file_dsc                         3577    8 bytes         Auto         Struct dsc$descriptor_s
file_found                       3575    255 bytes       Static       Array [255] of char
length                           3572    1 longword      Not Alloc.   Long int
lib$find_file                    3589                    Extern       Function returning long int
result_dsc                       3577    8 bytes         Auto         Struct dsc$descriptor_s
ret                              3572    1 longword      Not Alloc.   Long int
strchr                           3573                    Extern       Function returning pointer to char
 
 

Function "bcopy" defined at line 3604
-------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

cnt                              3607    1 longword      Register     Parameter # 3, long int
from                             3605    1 longword      Register     Parameter # 1, pointer to char
i                                3609    1 longword      Register     Long int
to                               3606    1 longword      Register     Parameter # 2, pointer to char
 
 

Function "bzero" defined at line 3615
-------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

cnt                              3617    1 longword      Register     Parameter # 2, long int
i                                3619    1 longword      Register     Long int
s                                3616    1 longword      Register     Parameter # 1, pointer to char
 
 

Function "isin" defined at line 3686
------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

ch                               3687    1 byte                       Parameter # 1, char
cp                               3689    1 longword      Register     Pointer to char
setofchars                       3687    1 longword                   Parameter # 2, pointer to char
 
 

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 26
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)


Function "spawn" defined at line 3697
-------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

command                          3698    1 longword                   Parameter # 1, pointer to char
input                            3698    1 longword                   Parameter # 2, pointer to char
lib$spawn                        3711                    Extern       Function returning long int
output                           3698    1 longword                   Parameter # 3, pointer to char
ret                              3700    1 longword      Register     Long int
status                           3701    1 longword      Auto         Long int
tmp1                             3703    8 bytes         Auto         Initialized struct dsc$descriptor_s
tmp2                             3704    8 bytes         Auto         Initialized struct dsc$descriptor_s
tmp3                             3705    8 bytes         Auto         Initialized struct dsc$descriptor_s
 
 

Function "pqsort" defined at line 3741
--------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

compptr                          3745    1 longword                   Parameter # 4, pointer to function returning long int
esize                            3744    1 longword                   Parameter # 3, long int
nel                              3743    1 longword                   Parameter # 2, long int
vec                              3742    1 longword                   Parameter # 1, pointer to unsigned char
 
 

Function "mysort" defined at line 3776
--------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

begin                            3786                                 Label
i                                3781    1 word          Register     Short int
iptr                             3782    1 longword      Register     Pointer to unsigned char
j                                3781    1 word          Register     Short int
jptr                             3782    1 longword      Register     Pointer to unsigned char
kptr                             3782    1 longword      Register     Pointer to unsigned char
nel                              3778    1 longword                   Parameter # 2, long int
vec                              3777    1 longword                   Parameter # 1, pointer to unsigned char
 
 

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 27
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)


Function "memexch" defined at line 3856
---------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

c                                3862    1 byte          Register     Unsigned char
n                                3859    1 longword      Register     Parameter # 3, long int
s1                               3857    1 longword      Register     Parameter # 1, pointer to unsigned char
s2                               3858    1 longword      Register     Parameter # 2, pointer to unsigned char
 
 

Function "getwd" defined at line 3871
-------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

buff                             3872    1 longword                   Parameter # 1, pointer to char
p                                3874    1 longword      Not Alloc.   Initialized pointer to char
 
 

Function "time_and_pid" defined at line 3894
--------------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

clock                            3896    1 longword      Auto         Long int
format                           3899    22 bytes        Static       Initialized array [22] of char
getpid                           3905                    Extern       Function returning long int
ourpid                           3898    1 longword      Static       Initialized long int
outbuf                           3900    22 bytes        Static       Array [22] of char
tm                               3897    1 longword      Not Alloc.   Pointer to struct tm
 
 

Function "ttcd" defined at line 3918
------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

iosb                             3920    2 longwords     Auto         Array [2] of long int
p1_buff                          3921    2 longwords     Auto         Array [2] of long int
sys$qiow                         3923                    Extern       Function returning long int
 
 

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 28
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)


Function "ttflui" defined at line 3934
--------------------------------------

 Identifier Name                 Line    Size            Class        Type
 ---------------                 ----    ----            -----        ----

junk2                            3937    1 longword      Auto         Long int
sys$qiow                         3938                    Extern       Function returning long int
 
 

Psect Synopsis
--------------

 Psect Name                     Allocation  Attributes
 ----------                     ----------  ----------

$CODE                           2728 bytes  Position-independent, relocatable, shareable, executable, readable
$DATA                           680 bytes   Position-independent, relocatable, readable, writeable
SYSDEP_VERSION                  42 bytes    Position-independent, overlay, relocatable, global, shareable, readable, writeable
_CTYPE_                         0           Position-independent, overlay, relocatable, global, shareable, readable
ERRNO                           4 bytes     Position-independent, overlay, relocatable, global, readable, writeable
VAXC$ERRNO                      4 bytes     Position-independent, overlay, relocatable, global, readable, writeable
STDIN                           4 bytes     Position-independent, overlay, relocatable, global, readable, writeable
STDOUT                          4 bytes     Position-independent, overlay, relocatable, global, readable, writeable
STDERR                          4 bytes     Position-independent, overlay, relocatable, global, readable, writeable
DEBUG                           4 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
PROGNAME                        20 bytes    Position-independent, overlay, relocatable, global, shareable, readable, writeable
SPOOL                           4 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
CONTROL                         4 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
MYNAME                          20 bytes    Position-independent, overlay, relocatable, global, shareable, readable, writeable
HOST_NAME                       20 bytes    Position-independent, overlay, relocatable, global, shareable, readable, writeable
OURPID                          4 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
SYSFILE                         4 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
USERFILE                        4 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
PUBDIR                          4 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
PORTS                           4 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
WHO                             255 bytes   Position-independent, overlay, relocatable, global, shareable, readable, writeable
LOGFD                           4 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
SYSDEP_CONTROL                  22 bytes    Position-independent, overlay, relocatable, global, shareable, readable, writeable
FDTTY                           4 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
$CHAR_STRING_CONSTANTS          189 bytes   Position-independent, relocatable, readable, writeable
MBCHAN                          2 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
CONTEXT                         4 bytes     Position-independent, overlay, relocatable, global, shareable, readable, writeable
TEMPLATE                        255 bytes   Position-independent, overlay, relocatable, global, shareable, readable, writeable
 
 

SYSDEP                                                          12-NOV-1988 14:19:10    VAX C      V2.3-024                 Page 29
V1.0                                                            12-NOV-1988 14:14:57    [VMSNET.DEVEL.GNUUCP.SRC]SYSDEP.C;30 (6)


Function Definition Map
-----------------------

 Line   Name
 ----   ----

3188    damn_B
3205    openline
3254    openout
3300    sigint
3311    xwrite
3329    xgetc
3354    hangup
3364    tthang
3379    wrtmbx
3404    temp_filename
3418    substrloc
3430    fix_x_filename
3458    munge_filename
3513    work_done
3524    work_scan
3570    work_next
3604    bcopy
3615    bzero
3686    isin
3697    spawn
3741    pqsort
3776    mysort
3856    memexch
3871    getwd
3894    time_and_pid
3918    ttcd
3934    ttflui
 
 
Command Line
------------
 
CC/LIST=[-.BLD]/OBJE=[-.BLD]/SHOW=(BRIEF,SOURCE,SYMBOLS)/DEFINE=LOG SYSDEP

