xref: /illumos-gate/usr/src/cmd/lp/include/form.h (revision 581cede61ac9c14d8d4ea452562a567189eead78)
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 
31 #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.5	*/
32 
33 #if	!defined(_LP_FORM_H)
34 #define	_LP_FORM_H
35 
36 /**
37  ** The disk copy of the form files:
38  **/
39 
40 /*
41  * There are 10 fields in the form configuration file.
42  */
43 # define FO_MAX		10
44 # define FO_PLEN	0
45 # define FO_PWID	1
46 # define FO_NP		2
47 # define FO_LPI		3
48 # define FO_CPI		4
49 # define FO_CHSET	5
50 # define FO_RCOLOR	6
51 # define FO_CMT	 	7
52 # define FO_ALIGN	8
53 # define FO_PAPER	9
54 
55 /**
56  ** The internal copy of a form as seen by the rest of the world:
57  **/
58 
59 typedef struct FORM {
60 	SCALED			plen;
61 	SCALED			pwid;
62 	SCALED			lpi;
63 	SCALED			cpi;
64 	int			np;
65 	char *			chset;
66 	short			mandatory;
67 	char *			rcolor;
68 	char *			comment;
69 	char *			conttype;
70 	char *			name;
71 	char *			paper;
72 	short			isDefault;
73 }			FORM;
74 
75 /*
76  * Default configuration values:
77  */
78 #define DPLEN		66
79 #define DPWIDTH		80
80 #define DNP		1
81 #define	DLPITCH		6
82 #define DCPITCH		10
83 #define DCHSET		NAME_ANY
84 #define	DRCOLOR		NAME_ANY
85 #define DCONTYP		NAME_SIMPLE
86 #define ENDENV		"#ENDOF_ENV\n"
87 #define MANSTR		"mandatory"
88 #define DFTSTR		"default"
89 
90 /*
91  * These are the filenames that may be used for storing a form
92  */
93 #define DESCRIBE	"describe"
94 #define COMMENT		"comment"
95 #define ALIGN_PTRN	"align_ptrn"
96 #define ALERTSH		"alert.sh"
97 #define ALERTVARS	"alert.vars"
98 
99 #define err_hndlr	int (*)( int , int , int )
100 
101 int		delform ( char * );
102 int		getform ( char * , FORM * , FALERT * , FILE ** );
103 int		putform ( char * , FORM * , FALERT * , FILE ** );
104 int		rdform ( char * , FORM * , int , err_hndlr , int * );
105 int		wrform ( char * , FORM * , int , err_hndlr , int * );
106 
107 void		freeform ( FORM * );
108 
109 #undef	err_hndlr
110 
111 #endif
112