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.
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.
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]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 #ifndef __PKG_LIBADM_H__
29 #define __PKG_LIBADM_H__
31 #include <sys/types.h>
41 #define __P(protos) protos
43 #define __P(protos) ()
50 extern int ckdate_err
__P((char *fmt
, char *error
));
51 extern int ckdate_hlp
__P((char *fmt
, char *help
));
52 extern int ckdate_val
__P((char *fmt
, char *input
));
53 extern int ckdate
__P((char *date
, char *fmt
, char *defstr
, char *error
,
54 char *help
, char *prompt
));
59 extern int ckgid_dsp
__P((void));
60 extern int ckgid_val
__P((char *grpnm
));
61 extern int ckgrpfile
__P((void));
62 extern void ckgid_err
__P((int disp
, char *error
));
63 extern void ckgid_hlp
__P((int disp
, char *help
));
64 extern int ckgid
__P((char *gid
, short disp
, char *defstr
, char *error
,
65 char *help
, char *prompt
));
70 extern int ckint_val
__P((char *value
, short base
));
71 extern void ckint_err
__P((short base
, char *error
));
72 extern void ckint_hlp
__P((short base
, char *help
));
73 extern int ckint
__P((long *intval
, short base
, char *defstr
, char *error
,
74 char *help
, char *prompt
));
79 extern CKMENU
*allocmenu
__P((char *label
, int attr
));
80 extern void ckitem_err
__P((CKMENU
*menup
, char *error
));
81 extern void ckitem_hlp
__P((CKMENU
*menup
, char *help
));
82 extern int ckitem
__P((CKMENU
*menup
, char *item
[], short max
,
83 char *defstr
, char *error
, char *help
,
85 extern int setitem
__P((CKMENU
*menup
, char *choice
));
86 extern int setinvis
__P((CKMENU
*menup
, char *choice
));
87 extern void printmenu
__P((CKMENU
*menup
));
92 extern int ckkeywd
__P((char *strval
, char *keyword
[], char *defstr
,
93 char *error
, char *help
, char *prompt
));
98 extern int ckpath_stx
__P((int pflags
));
99 extern int ckpath_val
__P((char *path
, int pflags
));
100 extern void ckpath_err
__P((int pflags
, char *error
, char *input
));
101 extern void ckpath_hlp
__P((int pflags
, char *help
));
102 extern int ckpath
__P((char *pathval
, int pflags
, char *defstr
,
103 char *error
, char *help
, char *prompt
));
108 extern void ckrange_err
__P((long lower
, long upper
, int base
,
110 extern void ckrange_hlp
__P((long lower
, long upper
, int base
, char *help
));
111 extern int ckrange_val
__P((long lower
, long upper
, int base
,
113 extern int ckrange
__P((long *rngval
, long lower
, long upper
, short base
,
114 char *defstr
, char *error
, char *help
,
120 extern int ckstr_val
__P((char *regexp
[], int length
, char *input
));
121 extern void ckstr_err
__P((char *regexp
[], int length
, char *error
,
123 extern void ckstr_hlp
__P((char *regexp
[], int length
, char *help
));
124 extern int ckstr
__P((char *strval
, char *regexp
[], int length
,
125 char *defstr
, char *error
, char *help
,
131 extern int cktime_val
__P((char *fmt
, char *input
));
132 extern int cktime_err
__P((char *fmt
, char *error
));
133 extern int cktime_hlp
__P((char *fmt
, char *help
));
134 extern int fmtcheck
__P((char *fmt
));
135 extern int cktime
__P((char *tod
, char *fmt
, char *defstr
, char *error
,
136 char *help
, char *prompt
));
141 extern int ckuid_dsp
__P((void));
142 extern int ckuid_val
__P((char *usrnm
));
143 extern int ckpwdfile
__P((void));
144 extern void ckuid_err
__P((short disp
, char *error
));
145 extern void ckuid_hlp
__P((int disp
, char *help
));
146 extern int ckuid
__P((char *uid
, short disp
, char *defstr
, char *error
,
147 char *help
, char *prompt
));
152 extern int ckyorn_val
__P((char *str
));
153 extern void ckyorn_err
__P((char *error
));
154 extern void ckyorn_hlp
__P((char *help
));
155 extern int ckyorn
__P((char *yorn
, char *defstr
, char *error
, char *help
,
161 extern char *devattr
__P((char *device
, char *attribute
));
166 extern char *_rsvtabpath
__P((void));
167 extern int _openlkfile
__P((void));
168 extern int _closelkfile
__P((void));
169 extern int unreserv
__P((long key
, char *device
));
170 extern char **devreserv
__P((long key
, char **rsvlst
[]));
171 extern int devfree
__P((long key
, char *device
));
172 extern struct reservdev
**reservdev
__P((void));
177 extern void _setdevtab
__P((void));
178 extern void _enddevtab
__P((void));
179 extern char *_devtabpath
__P((void));
180 extern int _opendevtab
__P((char *mode
));
181 extern int _validalias
__P((char *alias
));
182 extern struct devtabent
*_getdevtabent
__P((void));
183 extern void _freedevtabent
__P((struct devtabent
*ent
));
184 extern struct devtabent
*_getdevrec
__P((char *device
));
189 extern void _setdgrptab
__P((void));
190 extern void _enddgrptab
__P((void));
191 extern char *_dgrptabpath
__P((void));
192 extern int _opendgrptab
__P((char *mode
));
193 extern struct dgrptabent
*_getdgrptabent
__P((void));
194 extern void _freedgrptabent
__P((struct dgrptabent
*ent
));
195 extern struct dgrptabent
*_getdgrprec
__P((char *dgroup
));
200 extern char *getfullblkname
__P((char *cp
));
201 extern char *getfullrawname
__P((char *cp
));
206 extern char **getdev
__P((char **devices
, char **criteria
, int options
));
211 extern char **getdgrp
__P((char **dgroups
, char **criteria
, int options
));
216 extern int getinput
__P((char *s
));
221 extern int getvol
__P((char *device
, char *label
, int options
,
223 extern int _getvol
__P((char *device
, char *label
, int options
,
224 char *prompt
, char *norewind
));
225 extern void doremovecmd
__P((char *device
, int echo
));
230 extern char **listdev
__P((char *device
));
235 extern char **listdgrp
__P((char *dgroup
));
240 extern long sysmem
__P((void));
241 extern long asysmem
__P((void));
246 extern int pkginfo
__P((struct pkginfo
*info
, char *pkginst
, ...));
247 extern int fpkginfo
__P((struct pkginfo
*info
, char *pkginst
));
248 extern char *fpkginst
__P((char *pkg
, ...));
253 extern int pkgnmchk
__P((register char *pkg
, register char *spec
,
255 extern void set_ABI_namelngth
__P((void));
256 extern int get_ABI_namelngth
__P((void));
261 extern char *fpkgparam
__P((FILE *fp
, char *param
));
262 extern char *pkgparam
__P((char *pkg
, char *param
));
263 extern void set_PKGpaths
__P((char *path
));
264 extern char *get_PKGLOC
__P((void));
265 extern char *get_PKGADM
__P((void));
266 extern void set_PKGADM(char *newpath
);
267 extern void set_PKGLOC(char *newpath
);
272 extern int _putdevtabrec
__P((FILE *stream
, struct devtabent
*rec
));
273 extern int _adddevtabrec
__P((char *alias
, char **attrval
));
274 extern int _moddevtabrec
__P((char *device
, char **attrval
));
275 extern int _rmdevtabrec
__P((char *device
));
276 extern int _rmdevtabattrs
__P((char *device
, char **attributes
,
282 extern int _putdgrptabrec
__P((FILE *stream
, struct dgrptabent
*rec
));
283 extern int _adddgrptabrec
__P((char *dgrp
, char **members
));
284 extern int _rmdgrptabrec
__P((char *dgrp
));
285 extern int _rmdgrpmems
__P((char *dgrp
, char **mems
, char ***notfounds
));
290 extern void puterror
__P((FILE *fp
, char *defmesg
, char *error
));
295 extern void puthelp
__P((FILE *fp
, char *defmesg
, char *help
));
300 extern void putprmpt
__P((FILE *fp
, char *prompt
, char *choices
[],
306 extern int puttext
__P((FILE *fp
, char *str
, int lmarg
, int rmarg
));
311 extern int read_vtoc
__P((int fd
, struct vtoc
*vtoc
));
312 extern int write_vtoc
__P((int fd
, struct vtoc
*vtoc
));
314 #if defined(lint) && !defined(gettext)
316 #endif /* defined(lint) && !defined(gettext) */
318 #endif /* __PKG_LIBADM_H__ */