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