xref: /illumos-gate/usr/src/cmd/lp/lib/lp/getpaths.c (revision 7c478bd9)
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 1993 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.15	*/
32 /* LINTLIBRARY */
33 
34 #include "stdlib.h"
35 
36 #include "lp.h"
37 
38 char	Lp_Spooldir[]		= SPOOLDIR;
39 char	Lp_Admins[]		= SPOOLDIR "/admins";
40 char	Lp_FIFO[]		= SPOOLDIR "/fifos/FIFO";
41 char	Lp_Private_FIFOs[]	= SPOOLDIR "/fifos/private";
42 char	Lp_Public_FIFOs[]	= SPOOLDIR "/fifos/public";
43 char	Lp_Requests[]		= SPOOLDIR "/requests";
44 char	Lp_Schedlock[]		= SPOOLDIR "/SCHEDLOCK";
45 char	Lp_System[]		= SPOOLDIR "/system";
46 char	Lp_Temp[]		= SPOOLDIR "/temp";
47 char	Lp_Tmp[]		= SPOOLDIR "/tmp";
48 char	Lp_NetTmp[]		= SPOOLDIR "/tmp/.net";
49 
50 char	Lp_Bin[]		= LPDIR "/bin";
51 char	Lp_Model[]		= LPDIR "/model";
52 char	Lp_Slow_Filter[]	= LPDIR "/bin/slow.filter";
53 
54 char	Lp_A_Logs[]		= LOGDIR;
55 char	Lp_Logs[]		= LOGDIR;
56 char	Lp_ReqLog[]		= LOGDIR "/requests";
57 
58 char	Lp_A[]			= ETCDIR;
59 char	Lp_NetData[]		= ETCDIR "/Systems";
60 char	Lp_Users[]		= ETCDIR "/users";
61 char	Lp_A_Classes[]		= ETCDIR "/classes";
62 char	Lp_A_Forms[]		= ETCDIR "/forms";
63 char	Lp_A_Interfaces[]	= ETCDIR "/interfaces";
64 char	Lp_A_Printers[]		= ETCDIR "/printers";
65 char	Lp_A_PrintWheels[]	= ETCDIR "/pwheels";
66 char	Lp_A_Systems[]		= ETCDIR "/systems";
67 char	Lp_A_Filters[]		= ETCDIR "/filter.table";
68 char	Lp_Default[]		= ETCDIR "/default";
69 char	Lp_A_Faults[]		= ETCDIR "/alerts";
70 
71 int	Lp_NTBase		= sizeof(Lp_NetTmp);
72 
73 /*
74 **	Sorry about these nonfunctional functions.  The data is
75 **	static now.  These exist for historical reasons.
76 */
77 
78 #undef	getpaths
79 #undef	getadminpaths
80 
81 void		getpaths ( void ) { return; }
82 void		getadminpaths ( char * admin) { return; }
83 
84 /**
85  ** getprinterfile() - BUILD NAME OF PRINTER FILE
86  **/
87 
88 char *
89 getprinterfile(char *name, char *component)
90 {
91     char	*path;
92 
93     if (!name)
94 	return (0);
95 
96     path = makepath(Lp_A_Printers, name, component, NULL);
97 
98     return (path);
99 }
100 
101 /**
102  ** getsystemfile() - BUILD NAME OF SYSTEM FILE
103  **/
104 
105 char *
106 getsystemfile(char *name, char *component)
107 {
108     char	*path;
109 
110     if (!name)
111 	return (0);
112 
113     path = makepath(Lp_A_Systems, name, component, NULL);
114 
115     return (path);
116 }
117 
118 /**
119  ** getclassfile() - BUILD NAME OF CLASS FILE
120  **/
121 
122 char *
123 getclassfile(char *name)
124 {
125     char	*path;
126 
127     if (!name)
128 	return (0);
129 
130     path = makepath(Lp_A_Classes, name, NULL);
131 
132     return (path);
133 }
134 
135 /**
136  ** getfilterfile() - BUILD NAME OF FILTER TABLE FILE
137  **/
138 
139 char *
140 getfilterfile(char *table)
141 {
142     char	*path;
143 
144     if (!table)
145 	table = FILTERTABLE;
146 
147     path = makepath(ETCDIR, table, NULL);
148 
149     return (path);
150 }
151 
152 /**
153  ** getformfile() - BUILD NAME OF PRINTER FILE
154  **/
155 
156 char *
157 getformfile(char *name, char *component)
158 {
159     char	*path;
160 
161     if (!name)
162 	return (0);
163 
164     path = makepath(Lp_A_Forms, name, component, NULL);
165 
166     return (path);
167 }
168