/*************************************************************************
* This program is copyright (C) 1985, 1986 by Jonathan Payne. It is *
* provided to you without charge for use only on a licensed Unix *
* system. You may copy JOVE provided that this notice is included with *
* the copy. You may not sell copies of this program or versions *
* modified for use on microcomputer systems, unless the copies are *
* included with a Unix system distribution and the source is provided. *
*************************************************************************/
format(buf
, len
, fmt
, ap
)
sp
->f_ptr
= sp
->f_base
= buf
;
sp
->f_fd
= -1; /* Not legit for files */
sprintf(cp
, "C-%c", c
+ '@');
putld(leftadj
, width
, d
, base
)
while (tmpd
= (tmpd
/ base
))
pad(padc
, width
- length
);
pad(padc
, width
- length
);
putc((int) ('0' + (int) (d
% base
)), curiop
);
puts(leftadj
, width
, str
)
pad(' ', width
- length
);
pad(' ', width
- length
);
while (c
>= '0' && c
<= '9') {
width
= width
* 10 + (c
- '0');
/* At this point, fmt points at one past the format letter. */
putld(leftadj
, width
, (long) va_arg(ap
, int), 8);
putld(leftadj
, width
, (long) va_arg(ap
, int), 10);
putld(leftadj
, width
, va_arg(ap
, long), 10);
PPchar(va_arg(ap
, int), cbuf
);
puts(leftadj
, width
, cbuf
);
if (va_arg(ap
, int) != 1)
puts(leftadj
, width
, "s");
puts(leftadj
, width
, va_arg(ap
, char *));
putc(va_arg(ap
, int), curiop
);
case 'f': /* current command name gets inserted here! */
puts(leftadj
, width
, LastCmd
->Name
);
format(line
, sizeof line
, fmt
, ap
);
doformat(stdout
, fmt
, ap
);
fprintf(fp
, fmt
, va_alist
)
sprintf(str
, fmt
, va_alist
)
format(str
, 130, fmt
, ap
);
format(mesgbuf
, sizeof mesgbuf
, fmt
, ap
);
format(mesgbuf
, sizeof mesgbuf
, fmt
, ap
);
UpdMesg
++; /* Still needs updating (for convenience) */
int mesg_len
= strlen(mesgbuf
);
format(&mesgbuf
[mesg_len
], (sizeof mesgbuf
) - mesg_len
, fmt
, ap
);