xref: /illumos-gate/usr/src/cmd/lp/include/form.h (revision 4763305e3243687c189d755d737d52205b2614ed)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1997 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 #if	!defined(_LP_FORM_H)
31 #define	_LP_FORM_H
32 
33 /**
34  ** The disk copy of the form files:
35  **/
36 
37 /*
38  * There are 10 fields in the form configuration file.
39  */
40 # define FO_MAX		10
41 # define FO_PLEN	0
42 # define FO_PWID	1
43 # define FO_NP		2
44 # define FO_LPI		3
45 # define FO_CPI		4
46 # define FO_CHSET	5
47 # define FO_RCOLOR	6
48 # define FO_CMT	 	7
49 # define FO_ALIGN	8
50 # define FO_PAPER	9
51 
52 /**
53  ** The internal copy of a form as seen by the rest of the world:
54  **/
55 
56 typedef struct FORM {
57 	SCALED			plen;
58 	SCALED			pwid;
59 	SCALED			lpi;
60 	SCALED			cpi;
61 	int			np;
62 	char *			chset;
63 	short			mandatory;
64 	char *			rcolor;
65 	char *			comment;
66 	char *			conttype;
67 	char *			name;
68 	char *			paper;
69 	short			isDefault;
70 }			FORM;
71 
72 /*
73  * Default configuration values:
74  */
75 #define DPLEN		66
76 #define DPWIDTH		80
77 #define DNP		1
78 #define	DLPITCH		6
79 #define DCPITCH		10
80 #define DCHSET		NAME_ANY
81 #define	DRCOLOR		NAME_ANY
82 #define DCONTYP		NAME_SIMPLE
83 #define ENDENV		"#ENDOF_ENV\n"
84 #define MANSTR		"mandatory"
85 #define DFTSTR		"default"
86 
87 /*
88  * These are the filenames that may be used for storing a form
89  */
90 #define DESCRIBE	"describe"
91 #define COMMENT		"comment"
92 #define ALIGN_PTRN	"align_ptrn"
93 #define ALERTSH		"alert.sh"
94 #define ALERTVARS	"alert.vars"
95 
96 #define err_hndlr	int (*)( int , int , int )
97 
98 int		delform ( char * );
99 int		getform ( char * , FORM * , FALERT * , FILE ** );
100 int		putform ( char * , FORM * , FALERT * , FILE ** );
101 int		rdform ( char * , FORM * , int , err_hndlr , int * );
102 int		wrform ( char * , FORM * , int , err_hndlr , int * );
103 
104 void		freeform ( FORM * );
105 
106 #undef	err_hndlr
107 
108 #endif
109