formprint - print a form
#include "fml.h" extern int LINES; extern int COLS; formprint(frmname,fbfr,cmd) char *frmname; FBFR *fbfr; char *cmd; form1print(frmname,fbfr,file,formfeed, lines, pages) char *frmname; FBFR *fbfr; FILE *file; char *formfeed; int *lines; int *pages; form2print(frmname,fbfr,buffer,formfeed, lines, pages) char *frmname; FBFR *fbfr; char *buffer; char *formfeed; int *lines; int *pages;
The formprint routines accept the name of a form, frmname, and a fielded buffer, fbfr, and replace field areas on the form with the contents of the fielded buffer. The resulting form is output in a format suitable for printing. The default value for LINES is 66; for COLS it is 132. The routines differ, in that each directs its output to another medium. All three routines have frmname and fbfr as common parameters. frmname should be the name of a standard UFORM form, without the .M suffix. If frmname is null, the name of the form is assumed to be in the reserved FORMNAM field in the fielded buffer.
formprint() places its output in a temporary file, and then executes cmd on that file. %s should be substituted for the temporary file name wherever the temporary file name would appear in the cmd string. If cmd is null, lp %s is assumed to be the command string. If the USPOOLDIR environment variable is set, the temporary file is created in the $USPOOLDIR directory, otherwise the temporary file is created in /tmp.
form1print() places its output in file. The formfeed string is output at the end of each page. Upon successful return, page is set to the number of pages output, and lines is set to the number of lines on the last page. The number of pages output is the same as the number of pages on the form.
form2print() is identical to form1print(), except instead of placing its output in file, it places its output in buffer. buffer should be large enough to handle any anticipated (and unanticipated) output.
formprint(NULL,fbfr,"cat %s >/dev/tty") is an acceptable invocation of formprint. It sends the form named in the reserved FORMNAM field of the fielded buffer to /dev/tty.
These routines return 1 on success and -1 on failure.
It is not possible to link these routines and the curses(3) library (libcurses.a) into one program.
FRMPRT(5),
curses(3X) in a UNIX System reference manual