xref: /titanic_52/usr/src/cmd/svr4pkg/hdrs/libinst.h (revision 9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bb)
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 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	__HDRS_LIBINST_H__
28 #define	__HDRS_LIBINST_H__
29 
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include <stdio.h>
36 #include <fcntl.h>
37 #include <sys/types.h>
38 #include <sys/stat.h>
39 #include <pkgstrct.h>
40 #include <pkginfo.h>
41 #include "pkglib.h"
42 #include <cfext.h>
43 #include "install.h"
44 
45 #define	DEF_NONE_SCR	"i.CompCpio"
46 
47 #define	BL_ALL		-1	/* refers to all allocated lists */
48 
49 /* signal handler function definition */
50 
51 typedef void (sighdlrFunc_t)(int);
52 
53 /* maximum parameter length */
54 
55 #define	MAX_PKG_PARAM_LENGTH	(64+1)	/* +1 for null termination */
56 
57 /* flag for check_applicability */
58 
59 typedef unsigned long CAF_T;
60 
61 /* flags for check_applicability */
62 
63 #define	CAF_IN_GLOBAL_ZONE	0x00000001	/* in global zone */
64 #define	CAF_SCOPE_GLOBAL	0x00000002	/* -G specified */
65 #define	CAF_SCOPE_NONGLOBAL	0x00000004	/* -Z specified */
66 
67 /* path to the request file in the package directory */
68 
69 #define	REQUEST_FILE	"install/request"
70 
71 /* path to the copyright file in the package directory */
72 
73 #define	COPYRIGHT_FILE	"install/copyright"
74 
75 /* path to the depend file in the package directory */
76 
77 #define	DEPEND_FILE	"install/depend"
78 
79 /*
80  * name of environment variable set to non-global zone name being installed:
81  * pkgadd/pkginstall expects this name and passes it on to any scripts that
82  * are run if it is set.
83  */
84 
85 #define	PKG_ZONENAME_VARIABLE	"SUNW_PKG_INSTALL_ZONENAME"
86 
87 /*
88  * name of environment variable set to indicate this package should be installed
89  * in the current zone only - see PSARC/2004/789 - New Pkginfo(4) attributes
90  * for zones
91  */
92 
93 #define	PKG_THISZONE_VARIABLE	"SUNW_PKG_THISZONE"
94 
95 /*
96  * name of environment variable set to indicate this package should be installed
97  * in all zones, and only from the global zone - see PSARC/2003/460
98  */
99 
100 #define	PKG_ALLZONES_VARIABLE	"SUNW_PKG_ALLZONES"
101 
102 /*
103  * name of environment variable set to indicate this package should be installed
104  * hollow (db update only) when installed in nonglobal zone - see PSARC/2003/460
105  */
106 
107 #define	PKG_HOLLOW_VARIABLE	"SUNW_PKG_HOLLOW"
108 
109 /*
110  * General purpose return codes used for functions which don't return a basic
111  * success or failure. For those functions wherein a yes/no result is
112  * possible, then 1 means OK and 0 means FAIL.
113  */
114 #define	RESULT_OK	0x0
115 #define	RESULT_WRN	0x1
116 #define	RESULT_ERR	0x2
117 
118 /* These are the file status indicators for the contents file */
119 #define	INST_RDY	'+'	/* entry is ready to installf -f */
120 #define	RM_RDY		'-'	/* entry is ready for removef -f */
121 #define	NOT_FND		'!'	/* entry (or part of entry) was not found */
122 #define	SERVED_FILE	'%'	/* using the file server's RO partition */
123 #define	STAT_NEXT	'@'	/* this is awaiting eptstat */
124 #define	DUP_ENTRY	'#'	/* there's a duplicate of this */
125 #define	CONFIRM_CONT	'*'	/* need to confirm contents */
126 #define	CONFIRM_ATTR	'~'	/* need to confirm attributes */
127 #define	ENTRY_OK	'\0'	/* entry is a confirmed file */
128 
129 /* control bits for pkgdbmerg() */
130 #define	NO_COPY		0x0001
131 #define	CLIENT_PATHS	0x0002	/* working with a client database */
132 
133 /* control bits for file verification by class */
134 #define	DEFAULT		0x0	/* standard full verification */
135 #define	NOVERIFY	0x1	/* do not verify */
136 #define	QKVERIFY	0x2	/* do a quick verification instead */
137 
138 /* control bit for path type to pass to CAS */
139 #define	DEFAULT		0x0	/* standard server-relative absolute path */
140 #define	REL_2_CAS	0x1	/* pass pkgmap-type relative path */
141 
142 /* findscripts() argument */
143 #define	I_ONLY		0x0	/* find install class action scripts */
144 #define	R_ONLY		0x1	/* find removal class action scripts */
145 
146 struct cl_attr {
147 	char	name[CLSSIZ+1];	/* name of class */
148 	char	*inst_script;	/* install class action script */
149 	char	*rem_script;	/* remove class action script */
150 	unsigned	src_verify:3;	/* source verification level */
151 	unsigned 	dst_verify:4;	/* destination verification level */
152 	unsigned	relpath_2_CAS:1;	/* CAS gets relative paths */
153 };
154 
155 #if defined(__STDC__)
156 #define	__P(protos) protos
157 #else	/* __STDC__ */
158 #define	__P(protos) ()
159 #endif	/* __STDC__ */
160 
161 /* Common quit declaration used across many package commands */
162 extern void	quit(int) __NORETURN;
163 
164 
165 /* listmgr.c */
166 extern int	bl_create __P((int count_per_block, int struct_size,
167 		    char *desc));
168 extern char	*bl_next_avail __P((int list_handle));
169 extern char	*bl_get_record __P((int list_handle, int recno));
170 extern void	bl_free __P((int list_handle));
171 extern int	ar_create __P((int count_per_block, int struct_size,
172 		    char *desc));
173 extern char	**ar_next_avail __P((int list_handle));
174 extern char	**ar_get_head __P((int list_handle));
175 extern int	ar_delete __P((int list_handle, int index));
176 extern void	ar_free __P((int list_handle));
177 
178 /* doulimit.c */
179 extern int	set_ulimit __P((char *script, char *err_msg));
180 extern int	clr_ulimit __P((void));
181 extern int	assign_ulimit __P((char *fslimit));
182 
183 /* dryrun.c */
184 extern void	set_continue_not_ok __P((void));
185 extern int	continue_is_ok __P((void));
186 extern int	in_dryrun_mode __P((void));
187 extern int	in_continue_mode __P((void));
188 extern void	init_dryrunfile __P((char *dr_dir));
189 extern void	init_contfile __P((char *cn_dir));
190 extern void	set_dr_exitmsg __P((char *value));
191 extern void	set_dr_info __P((int type, int value));
192 extern void	write_dryrun_file __P((struct cfextra **extlist));
193 
194 /* instvol.c */
195 extern void	regfiles_free __P((void));
196 
197 /* lockinst.c */
198 extern int	lockinst __P((char *util_name, char *pkg_name, char *place));
199 extern void	lockupd __P((char *place));
200 extern void	unlockinst __P((void));
201 
202 extern char	*pathdup __P((char *s));
203 extern char	*pathalloc __P((int n));
204 extern char	*fixpath __P((char *path));
205 extern char	*get_info_basedir __P((void));
206 extern char	*get_basedir __P((void));
207 extern char	*get_client_basedir __P((void));
208 extern int	set_basedirs __P((int reloc, char *adm_basedir,
209 		    char *pkginst, int nointeract));
210 extern int	eval_path __P((char **server_ptr, char **client_ptr,
211 		    char **map_ptr, char *path));
212 extern int	get_orig_offset __P((void));
213 extern char	*get_inst_root __P((void));
214 extern char	*get_mount_point __P((short n));
215 extern char	*get_remote_path __P((short n));
216 extern void	set_env_cbdir __P((void));
217 extern int	set_inst_root __P((char *path));
218 extern void	put_path_params __P((void));
219 extern int	mkpath __P((char *p));
220 extern void	mkbasedir __P((int flag, char *path));
221 extern int	is_an_inst_root __P((void));
222 extern int	is_a_basedir __P((void));
223 extern int	is_a_cl_basedir __P((void));
224 extern int	is_relocatable __P((void));
225 extern char	*orig_path __P((char *path));
226 extern char	*orig_path_ptr __P((char *path));
227 extern char	*qreason __P((int caller, int retcode, int started,
228 			int includeZonename));
229 extern char	*qstrdup __P((char *s));
230 extern char	*srcpath __P((char *d, char *p, int part, int nparts));
231 extern char	*trans_srcp_pi __P((char *local_path));
232 extern int	copyf __P((char *from, char *to, time_t mytime));
233 extern int	copyFile __P((int, int, char *, char *, struct stat *, long));
234 extern int	openLocal __P((char *a_path, int a_oflag, char *a_tmpdir));
235 extern int	dockdeps __P((char *depfile, int removeFlag,
236 			boolean_t a_preinstallCheck));
237 extern int	finalck __P((struct cfent *ept, int attrchg, int contchg,
238 			boolean_t a_warning));
239 
240 /* dockdeps.c */
241 extern void setUpdate __P((void));
242 extern int  isUpdate __P((void));
243 extern void setPatchUpdate __P((void));
244 extern int  isPatchUpdate __P((void));
245 
246 /* mntinfo.c */
247 extern int	get_mntinfo __P((int map_client, char *vfstab_file));
248 extern short	fsys __P((char *path));
249 extern struct fstable *get_fs_entry __P((short n));
250 extern int	mount_client __P((void));
251 extern int	unmount_client __P((void));
252 extern short	resolved_fsys __P((char *path));
253 extern char	*get_server_host __P((short n));
254 extern char	*server_map __P((char *path, short fsys_value));
255 extern int	use_srvr_map __P((char *path, short *fsys_value));
256 extern int	use_srvr_map_n __P((short n));
257 extern int	is_fs_writeable __P((char *path, short *fsys_value));
258 extern int	is_remote_fs __P((char *path, short *fsys_value));
259 extern int	is_served __P((char *path, short *fsys_value));
260 extern int	is_mounted __P((char *path, short *fsys_value));
261 extern int	is_fs_writeable_n __P((short n));
262 extern int	is_remote_fs_n __P((short n));
263 extern int	is_served_n __P((short n));
264 extern int	is_mounted_n __P((short n));
265 extern fsblkcnt_t	get_blk_size_n __P((short n));
266 extern fsblkcnt_t	get_frag_size_n __P((short n));
267 extern fsblkcnt_t	get_blk_used_n __P((short n));
268 extern fsblkcnt_t	get_blk_free_n __P((short n));
269 extern fsblkcnt_t	get_inode_used_n __P((short n));
270 extern fsblkcnt_t	get_inode_free_n __P((short n));
271 extern void	set_blk_used_n __P((short n, fsblkcnt_t value));
272 extern char	*get_source_name_n __P((short n));
273 extern char	*get_fs_name_n __P((short n));
274 extern int	load_fsentry __P((struct fstable *fs_entry, char *name,
275 		    char *fstype, char *remote_name));
276 extern int	isreloc __P((char *pkginstdir));
277 extern int	is_local_host __P((char *hostname));
278 extern void	fs_tab_free __P((void));
279 
280 /* pkgdbmerg.c */
281 extern int	pkgdbmerg __P((PKGserver server, VFP_T *tmpvfp,
282 		    struct cfextra **extlist));
283 extern int	files_installed __P((void));
284 
285 /* ocfile.c */
286 extern int	trunc_tcfile __P((int fd));
287 extern int	ocfile __P((PKGserver *serverp, VFP_T **tmpvfp,
288 			fsblkcnt_t map_blks));
289 extern int	swapcfile __P((PKGserver server, VFP_T **a_tmpvfp,
290 			char *pkginst, int dbchg));
291 extern int	set_cfdir __P((char *cfdir));
292 extern int	socfile __P((PKGserver *server, boolean_t quiet));
293 extern int	relslock __P((void));
294 extern int	pkgWlock __P((int verbose));
295 extern int	iscfile __P((void));
296 extern int	vcfile __P((void));
297 
298 extern fsblkcnt_t	nblk __P((fsblkcnt_t size, ulong_t bsize,
299 			ulong_t frsize));
300 extern struct	cfent **procmap __P((VFP_T *vfp, int mapflag, char *ir));
301 extern void	repl_cfent __P((struct cfent *new, struct cfent *old));
302 extern struct	cfextra **pkgobjmap __P((VFP_T *vfp, int mapflag, char *ir));
303 extern void	pkgobjinit __P((void));
304 extern int	seed_pkgobjmap __P((struct cfextra *ext_entry, char *path,
305 		    char *local));
306 extern int	init_pkgobjspace __P((void));
307 
308 /* eptstat.c */
309 extern void	pinfo_free __P((void));
310 extern struct	pinfo *eptstat __P((struct cfent *entry, char *pkg, char c));
311 
312 /* echo.c */
313 /*PRINTFLIKE1*/
314 extern void	echo __P((char *a_fmt, ...));
315 /*PRINTFLIKE1*/
316 extern void	echoDebug __P((char *a_fmt, ...));
317 extern boolean_t	echoGetFlag __P((void));
318 extern boolean_t	echoDebugGetFlag __P((void));
319 extern boolean_t	echoSetFlag __P((boolean_t a_debugFlag));
320 extern boolean_t	echoDebugSetFlag __P((boolean_t a_debugFlag));
321 
322 /* psvr4ck.c */
323 extern void	psvr4cnflct __P((void));
324 extern void	psvr4mail __P((char *list, char *msg, int retcode, char *pkg));
325 extern void	psvr4pkg __P((char **ppkg));
326 
327 /* ptext.c */
328 /*PRINTFLIKE2*/
329 extern void	ptext __P((FILE *fp, char *fmt, ...));
330 
331 /* putparam.c */
332 extern void	putparam __P((char *param, char *value));
333 extern void	getuserlocale __P((void));
334 extern void	putuserlocale __P((void));
335 extern void	putConditionInfo __P((char *, char *));
336 
337 /* setadmin.c */
338 extern void		setadminFile __P((char *file));
339 extern char		*setadminSetting __P((char *a_paramName,
340 				char *a_paramValue));
341 extern char		*set_keystore_admin __P((void));
342 extern boolean_t	get_proxy_port_admin __P((char **, ushort_t *));
343 extern boolean_t	check_keystore_admin __P((char **));
344 extern int		web_ck_retries __P((void));
345 extern int		web_ck_timeout __P((void));
346 extern int		web_ck_authentication __P((void));
347 
348 /* setlist.c */
349 extern char	*cl_iscript __P((int idx));
350 extern char	*cl_rscript __P((int idx));
351 extern void	find_CAS __P((int CAS_type, char *bin_ptr, char *inst_ptr));
352 extern int	setlist __P((struct cl_attr ***plist, char *slist));
353 extern void	addlist __P((struct cl_attr ***plist, char *item));
354 extern char	*cl_nam __P((int cl_idx));
355 extern char	*flex_device(char *device_name, int dev_ok);
356 extern int	cl_getn __P((void));
357 extern int	cl_idx __P((char *cl_nam));
358 extern void	cl_sets __P((char *slist));
359 extern void	cl_setl __P((struct cl_attr **cl_lst));
360 extern void	cl_putl __P((char *parm_name, struct cl_attr **list));
361 extern int	cl_deliscript __P((int i));
362 extern unsigned	cl_svfy __P((int i));
363 extern unsigned	cl_dvfy __P((int i));
364 extern unsigned	cl_pthrel __P((int i));
365 
366 /* passwd.c */
367 extern int	pkg_passphrase_cb __P((char *, int, int, void *));
368 extern void	set_passarg __P((char *));
369 extern void	set_prompt __P((char *));
370 
371 /* fixpath.c */
372 extern void __P(export_client_env(char *));
373 extern void __P(set_partial_inst(void));
374 extern int __P(is_partial_inst(void));
375 extern void __P(set_depend_pkginfo_DB(boolean_t a_setting));
376 extern boolean_t __P(is_depend_pkginfo_DB(void));
377 extern void __P(disable_spool_create(void));
378 extern int __P(is_spool_create(void));
379 
380 /* open_package_datastream.c */
381 extern boolean_t	open_package_datastream(int a_argc, char **a_argv,
382 				char *a_spoolto, char *a_device,
383 				int *r_repeat, char **r_idsName,
384 				char *a_tmpdir, struct pkgdev *a_pkgdev,
385 				int a_optind);
386 
387 /* setup_temporary_directory.c */
388 extern boolean_t	setup_temporary_directory(char **r_dirname,
389 				char *a_tmpdir, char *a_suffix);
390 
391 /* unpack_package_from_stream.c */
392 extern boolean_t	unpack_package_from_stream(char *a_idsName,
393 				char *a_pkginst, char *a_tempDir);
394 
395 /* pkgops.c */
396 
397 extern boolean_t	pkgAddPackageToGzonlyList(char *a_pkgInst,
398 				char *a_rootPath);
399 extern void		pkgAddThisZonePackage(char *a_pkgInst);
400 extern boolean_t	pkgRemovePackageFromGzonlyList(char *a_rootPath,
401 				char *a_pkgInst);
402 extern FILE		*pkgOpenInGzOnlyFile(char *a_rootPath);
403 extern void		pkginfoFree(struct pkginfo **r_info);
404 extern boolean_t	pkginfoIsPkgInstalled(struct pkginfo **r_pinfo,
405 				char *a_pkgInst);
406 extern boolean_t	pkgIsPkgInGzOnly(char *a_rootPath, char *a_pkgInst);
407 extern boolean_t	pkgIsPkgInGzOnlyFP(FILE *a_fp, char *a_pkgInst);
408 extern boolean_t	pkginfoParamTruth(FILE *a_fp, char *a_param,
409 				char *a_value, boolean_t a_default);
410 extern int		pkgGetPackageList(char ***r_pkgList, char **a_argv,
411 				int a_optind, char *a_categories,
412 				char **a_categoryList, struct pkgdev *a_pkgdev);
413 extern void		pkgLocateHighestInst(char *r_path, int r_pathLen,
414 				char *r_pkgInst, int r_pkgInstLen,
415 				char *a_rootPath, char *a_pkgInst);
416 extern boolean_t	pkgPackageIsThisZone(char *a_pkgInst);
417 extern boolean_t	pkgMatchInherited(char *a_src, char *a_dst,
418 				char *a_rootDir, char a_mode, time_t a_modtime,
419 				char a_ftype, unsigned long a_cksum);
420 extern char		*pkgGetGzOnlyPath(void);
421 extern boolean_t	pkgTestInstalled(char *a_packageName, char *a_rootPath);
422 
423 /* depchk.c */
424 
425 struct depckErrorRecord {
426 	int	ier_numZones;
427 	char	*ier_packageName;
428 	char	**ier_zones;
429 	char	**ier_values;
430 };
431 
432 typedef struct depckErrorRecord depckErrorRecord_t;
433 
434 struct depckError {
435 	int			er_numEntries;
436 	depckErrorRecord_t	*er_theEntries;
437 };
438 
439 typedef struct depckError depckError_t;
440 
441 typedef int (depcklFunc_t)(char *a_msg, char *a_pkg);
442 
443 /*
444  * ignore_values:
445  *	== NULL - record one message for each instance of "name" found
446  *	== "" - record multiple instances
447  *	!= "" - record multiple instances if value not in ignore_values
448  */
449 
450 struct depckl_struct {
451 	char		*name;
452 	char		*ignore_values;
453 	char		**err_msg;
454 	depcklFunc_t	*depcklFunc;
455 	depckError_t	*record;
456 };
457 
458 typedef struct depckl_struct depckl_t;
459 
460 extern int		depchkReportErrors(depckl_t *depckl);
461 extern void		depchkRecordError(depckError_t *a_erc,
462 				char *a_pkginst, char *a_zoneName,
463 				char *a_value);
464 
465 /* log.c */
466 
467 /* types of log messages we recognize */
468 typedef enum {
469 	LOG_MSG_ERR,
470 	LOG_MSG_WRN,
471 	LOG_MSG_INFO,
472 	LOG_MSG_DEBUG
473 } LogMsgType;
474 
475 /*PRINTFLIKE2*/
476 extern	void		log_msg(LogMsgType, const char *, ...);
477 extern	void		log_set_verbose(boolean_t);
478 extern	boolean_t	log_get_verbose(void);
479 
480 /*
481  * typedef for the 'ckreturn' function
482  */
483 typedef void (ckreturnFunc_t)(int a_retcode);
484 
485 /* sml.c */
486 
487 /* null reference to SML_TAG object */
488 
489 #define	SML_TAG__NULL		((SML_TAG*)NULL)
490 
491 /* null reference to SML_TAG * object */
492 
493 #define	SML_TAG__R_NULL		((SML_TAG**)NULL)
494 
495 /* is reference to SML_TAG object valid? */
496 
497 #define	SML_TAG__ISVALID(tag)	((tag) != (SML_TAG__NULL))
498 
499 /* is indirect reference to SML_TAG object valid? */
500 
501 #define	SML_TAG__R_ISVALID(r_tag)	\
502 	((r_tag) != ((SML_TAG**)(SML_TAG__NULL)))
503 
504 /* definitions for sml passed from pkginstall to pkgcond */
505 
506 #define	PKGCOND_GLOBAL_VARIABLE	"SUNW_PKGCOND_GLOBAL_DATA"
507 #define	TAG_COND_TOPLEVEL	"environmentConditionInformation"
508 #define	TAG_COND_PARENT_ZONE	"parentZone"
509 #define	TAG_COND_CURRENT_ZONE	"currentZone"
510 #define	TAG_COND_ZONE_NAME	"zoneName"
511 #define	TAG_COND_ZONE_TYPE	"zoneType"
512 #define	TAG_COND_INHERITED_FS	"inheritedFileSystem"
513 #define	TAG_COND_FS_NAME	"fileSystemName"
514 #define	TAG_VALUE_GLOBAL_ZONE	"global"
515 #define	TAG_VALUE_NONGLOBAL_ZONE	"nonglobal"
516 
517 typedef struct _sml_tag_struct SML_TAG;
518 typedef struct _sml_parameter_struct SML_PARAM;
519 
520 struct _sml_tag_struct {
521 	char		*name;		/* tag name */
522 	int		params_num;	/* # params in *params */
523 	SML_PARAM	*params;	/* tag parameters */
524 	int		tags_num;	/* # subtags in *tags */
525 	SML_TAG		*tags;		/* tag subtags */
526 };
527 
528 struct _sml_parameter_struct {
529 	char	*name;		/* tag name */
530 	char	*value;		/* parameters */
531 };
532 
533 SML_TAG		*smlAddTag(SML_TAG **r_tag, int a_index,
534 			SML_TAG *a_subTag);
535 boolean_t	smlFstatCompareEq(struct stat *statbuf,
536 				SML_TAG *tag, char *path);
537 char		*smlConvertTagToString(SML_TAG *tag);
538 /*PRINTFLIKE2*/
539 void		smlDbgPrintTag(SML_TAG *a_tag, char *a_format, ...);
540 void		smlDelTag(SML_TAG *tag, SML_TAG *sub_tag);
541 void		smlDelParam(SML_TAG *tag, char *name);
542 SML_TAG		*smlDup(SML_TAG *tag);
543 boolean_t	smlFindAndDelTag(SML_TAG *tag, char *findTag);
544 void		smlFreeTag(SML_TAG *tag);
545 char		*smlGetElementName(SML_TAG *a_tag);
546 int		smlGetNumParams(SML_TAG *a_tag);
547 char		*smlGetParam(SML_TAG *tag, char *name);
548 /*PRINTFLIKE2*/
549 char		*smlGetParamF(SML_TAG *tag, char *format, ...);
550 void		smlGetParam_r(SML_TAG *tag, char *name, char *buf,
551 			int bufLen);
552 char		*smlGetParamByTag(SML_TAG *tag, int index,
553 			char *tagName, char *parmName);
554 char		*smlGetParamByTagParam(SML_TAG *tag, int index,
555 			char *tagName, char *parmName, char *parmValue,
556 			char *parmReturn);
557 char		*smlGetParamName(SML_TAG *tag, int index);
558 SML_TAG		*smlGetTag(SML_TAG *tag, int index);
559 SML_TAG		*smlGetTagByName(SML_TAG *tag, int index, char *name);
560 SML_TAG		*smlGetTagByTagParam(SML_TAG *tag, int index,
561 			char *tagName, char *paramName, char *paramValue);
562 boolean_t	smlGetVerbose(void);
563 int		smlLoadTagFromFile(SML_TAG **r_tag, char *a_fileName);
564 SML_TAG		*smlNewTag(char *name);
565 boolean_t	smlParamEq(SML_TAG *tag, char *findTag,
566 			char *findParam, char *str);
567 /*PRINTFLIKE4*/
568 boolean_t	smlParamEqF(SML_TAG *tag, char *findTag, char *findParam,
569 			char *format, ...);
570 void		smlPrintTag(SML_TAG *tag);
571 int		smlReadOneTag(SML_TAG **r_tag, char *a_str);
572 int		smlConvertStringToTag(SML_TAG **r_tag, char *str);
573 void		smlSetFileStatInfo(SML_TAG **tag,
574 				struct stat *statbuf, char *path);
575 void		smlSetParam(SML_TAG *tag, char *name, char *value);
576 /*PRINTFLIKE3*/
577 void		smlSetParamF(SML_TAG *tag, char *name, char *format, ...);
578 void		smlSetVerbose(boolean_t a_setting);
579 int		smlWriteTagToFd(SML_TAG *tag, int fd);
580 int		smlWriteTagToFile(SML_TAG *tag, char *filename);
581 /*PRINTFLIKE3*/
582 void		sml_strPrintf_r(char *a_buf, int a_bufLen, char *a_format, ...);
583 /*PRINTFLIKE1*/
584 char 		*sml_strPrintf(char *a_format, ...);
585 char		*sml_XmlEncodeString(char *a_plainTextString);
586 char		*sml_XmlDecodeString(char *a_xmlEncodedString);
587 
588 #if defined(lint) && !defined(gettext)
589 #define	gettext(x)	x
590 #endif	/* defined(lint) && !defined(gettext) */
591 
592 #ifdef __cplusplus
593 }
594 #endif
595 
596 #endif	/* __HDRS_LIBINST_H__ */
597