xref: /illumos-gate/usr/src/cmd/lp/lib/lp/getpaths.c (revision 0a44ef6d)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2006 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"
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_Requests[]		= SPOOLDIR "/requests";
42 char	Lp_Schedlock[]		= SPOOLDIR "/SCHEDLOCK";
43 char	Lp_System[]		= SPOOLDIR "/system";
44 char	Lp_Temp[]		= SPOOLDIR "/temp";
45 char	Lp_Tmp[]		= SPOOLDIR "/tmp";
46 
47 char	Lp_Bin[]		= LPDIR "/bin";
48 char	Lp_Model[]		= LPDIR "/model";
49 char	Lp_Slow_Filter[]	= LPDIR "/bin/slow.filter";
50 
51 char	Lp_A_Logs[]		= LOGDIR;
52 char	Lp_Logs[]		= LOGDIR;
53 char	Lp_ReqLog[]		= LOGDIR "/requests";
54 
55 char	Lp_A[]			= ETCDIR;
56 char	Lp_Users[]		= ETCDIR "/users";
57 char	Lp_A_Classes[]		= ETCDIR "/classes";
58 char	Lp_A_Forms[]		= ETCDIR "/forms";
59 char	Lp_A_Interfaces[]	= ETCDIR "/interfaces";
60 char	Lp_A_Printers[]		= ETCDIR "/printers";
61 char	Lp_A_PrintWheels[]	= ETCDIR "/pwheels";
62 char	Lp_A_Systems[]		= ETCDIR "/systems";
63 char	Lp_A_Filters[]		= ETCDIR "/filter.table";
64 char	Lp_Default[]		= ETCDIR "/default";
65 char	Lp_A_Faults[]		= ETCDIR "/alerts";
66 
67 /*
68 **	Sorry about these nonfunctional functions.  The data is
69 **	static now.  These exist for historical reasons.
70 */
71 
72 #undef	getpaths
73 #undef	getadminpaths
74 
75 void		getpaths ( void ) { return; }
76 void		getadminpaths ( char * admin) { return; }
77 
78 /**
79  ** getprinterfile() - BUILD NAME OF PRINTER FILE
80  **/
81 
82 char *
83 getprinterfile(char *name, char *component)
84 {
85     char	*path;
86 
87     if (!name)
88 	return (0);
89 
90     path = makepath(Lp_A_Printers, name, component, NULL);
91 
92     return (path);
93 }
94 
95 /**
96  ** getsystemfile() - BUILD NAME OF SYSTEM FILE
97  **/
98 
99 char *
100 getsystemfile(char *name, char *component)
101 {
102     char	*path;
103 
104     if (!name)
105 	return (0);
106 
107     path = makepath(Lp_A_Systems, name, component, NULL);
108 
109     return (path);
110 }
111 
112 /**
113  ** getclassfile() - BUILD NAME OF CLASS FILE
114  **/
115 
116 char *
117 getclassfile(char *name)
118 {
119     char	*path;
120 
121     if (!name)
122 	return (0);
123 
124     path = makepath(Lp_A_Classes, name, NULL);
125 
126     return (path);
127 }
128 
129 /**
130  ** getfilterfile() - BUILD NAME OF FILTER TABLE FILE
131  **/
132 
133 char *
134 getfilterfile(char *table)
135 {
136     char	*path;
137 
138     if (!table)
139 	table = FILTERTABLE;
140 
141     path = makepath(ETCDIR, table, NULL);
142 
143     return (path);
144 }
145 
146 /**
147  ** getformfile() - BUILD NAME OF PRINTER FILE
148  **/
149 
150 char *
151 getformfile(char *name, char *component)
152 {
153     char	*path;
154 
155     if (!name)
156 	return (0);
157 
158     path = makepath(Lp_A_Forms, name, component, NULL);
159 
160     return (path);
161 }
162