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