libinst.h revision 5c51f1241dbbdf2656d0e10011981411ed0c9673
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef __HDRS_LIBINST_H__
#define __HDRS_LIBINST_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <fcntl.h>
#include <pkgstrct.h>
#include <pkginfo.h>
#include "pkglib.h"
#include <cfext.h>
#include "install.h"
#define DEF_NONE_SCR "i.CompCpio"
/* signal handler function definition */
typedef void (sighdlrFunc_t)(int);
/* maximum parameter length */
/* flag for check_applicability */
typedef unsigned long CAF_T;
/* flags for check_applicability */
/* path to the request file in the package directory */
#define REQUEST_FILE "install/request"
/* path to the copyright file in the package directory */
#define COPYRIGHT_FILE "install/copyright"
/* path to the depend file in the package directory */
#define DEPEND_FILE "install/depend"
/*
* name of environment variable set to non-global zone name being installed:
* pkgadd/pkginstall expects this name and passes it on to any scripts that
* are run if it is set.
*/
#define PKG_ZONENAME_VARIABLE "SUNW_PKG_INSTALL_ZONENAME"
/*
* name of environment variable set to indicate this package should be installed
* in the current zone only - see PSARC/2004/789 - New Pkginfo(4) attributes
* for zones
*/
#define PKG_THISZONE_VARIABLE "SUNW_PKG_THISZONE"
/*
* name of environment variable set to indicate this package should be installed
* in all zones, and only from the global zone - see PSARC/2003/460
*/
#define PKG_ALLZONES_VARIABLE "SUNW_PKG_ALLZONES"
/*
* name of environment variable set to indicate this package should be installed
* hollow (db update only) when installed in nonglobal zone - see PSARC/2003/460
*/
#define PKG_HOLLOW_VARIABLE "SUNW_PKG_HOLLOW"
/*
* General purpose return codes used for functions which don't return a basic
* possible, then 1 means OK and 0 means FAIL.
*/
#define RESULT_OK 0x0
#define RESULT_WRN 0x1
#define RESULT_ERR 0x2
/* These are the file status indicators for the contents file */
/* control bits for pkgdbmerg() */
#define NO_COPY 0x0001
/* control bits for file verification by class */
/* control bit for path type to pass to CAS */
/* findscripts() argument */
struct cl_attr {
char *inst_script; /* install class action script */
char *rem_script; /* remove class action script */
};
#if defined(__STDC__)
#else /* __STDC__ */
#endif /* __STDC__ */
/* Common quit declaration used across many package commands */
extern void quit(int) __NORETURN;
/* listmgr.c */
char *desc));
char *desc));
/* doulimit.c */
extern int clr_ulimit __P((void));
/* dryrun.c */
extern void set_continue_not_ok __P((void));
extern int continue_is_ok __P((void));
extern int in_dryrun_mode __P((void));
extern int in_continue_mode __P((void));
/* instvol.c */
extern void regfiles_free __P((void));
/* lockinst.c */
extern void unlockinst __P((void));
extern char *get_info_basedir __P((void));
extern char *get_basedir __P((void));
extern char *get_client_basedir __P((void));
char *pkginst, int nointeract));
extern int get_orig_offset __P((void));
extern char *get_inst_root __P((void));
extern char *get_mount_point __P((short n));
extern char *get_remote_path __P((short n));
extern void set_env_cbdir __P((void));
extern void put_path_params __P((void));
extern int is_an_inst_root __P((void));
extern int is_a_basedir __P((void));
extern int is_a_cl_basedir __P((void));
extern int is_relocatable __P((void));
int includeZonename));
/* dockdeps.c */
extern void setPatchUpdate __P((void));
extern int isPatchUpdate __P((void));
/* mntinfo.c */
extern int mount_client __P((void));
extern int unmount_client __P((void));
extern char *get_server_host __P((short n));
extern int use_srvr_map_n __P((short n));
extern int is_fs_writeable_n __P((short n));
extern int is_remote_fs_n __P((short n));
extern int is_served_n __P((short n));
extern int is_mounted_n __P((short n));
extern char *get_source_name_n __P((short n));
extern char *get_fs_name_n __P((short n));
char *fstype, char *remote_name));
extern void fs_tab_free __P((void));
/* pkgdbmerg.c */
extern int files_installed __P((void));
/* ocfile.c */
extern void pkgobjinit __P((void));
char *local));
extern int init_pkgobjspace __P((void));
/* eptstat.c */
extern void pinfo_free __P((void));
/* echo.c */
/*PRINTFLIKE1*/
/*PRINTFLIKE1*/
/* psvr4ck.c */
extern void psvr4cnflct __P((void));
/* ptext.c */
/*PRINTFLIKE2*/
/* putparam.c */
extern void getuserlocale __P((void));
extern void putuserlocale __P((void));
extern void putConditionInfo __P((char *, char *));
/* setadmin.c */
char *a_paramValue));
extern char *set_keystore_admin __P((void));
extern int web_ck_retries __P((void));
extern int web_ck_timeout __P((void));
extern int web_ck_authentication __P((void));
/* setlist.c */
extern int cl_deliscript __P((int i));
/* passwd.c */
extern int pkg_passphrase_cb __P((char *, int, int, void *));
extern void set_passarg __P((char *));
extern void set_prompt __P((char *));
/* fixpath.c */
extern void __P(export_client_env(char *));
extern void __P(set_partial_inst(void));
extern int __P(is_partial_inst(void));
extern void __P(disable_spool_create(void));
extern int __P(is_spool_create(void));
int a_optind);
/* pkgops.c */
char *a_rootPath);
extern void pkgAddThisZonePackage(char *a_pkgInst);
char *a_pkgInst);
char *a_pkgInst);
int a_optind, char *a_categories,
char *r_pkgInst, int r_pkgInstLen,
char *a_rootPath, char *a_pkgInst);
extern char *pkgGetGzOnlyPath(void);
/* depchk.c */
struct depckErrorRecord {
int ier_numZones;
char *ier_packageName;
char **ier_zones;
char **ier_values;
};
typedef struct depckErrorRecord depckErrorRecord_t;
struct depckError {
int er_numEntries;
};
typedef struct depckError depckError_t;
/*
* ignore_values:
* == NULL - record one message for each instance of "name" found
* == "" - record multiple instances
* != "" - record multiple instances if value not in ignore_values
*/
struct depckl_struct {
char *name;
char *ignore_values;
char **err_msg;
};
typedef struct depckl_struct depckl_t;
char *a_pkginst, char *a_zoneName,
char *a_value);
/* log.c */
/* types of log messages we recognize */
typedef enum {
} LogMsgType;
/*PRINTFLIKE2*/
extern void log_msg(LogMsgType, const char *, ...);
extern void log_set_verbose(boolean_t);
extern boolean_t log_get_verbose(void);
/*
* typedef for the 'ckreturn' function
*/
typedef void (ckreturnFunc_t)(int a_retcode);
/* sml.c */
/* null reference to SML_TAG object */
/* null reference to SML_TAG * object */
/* is reference to SML_TAG object valid? */
/* is indirect reference to SML_TAG object valid? */
#define SML_TAG__R_ISVALID(r_tag) \
/* definitions for sml passed from pkginstall to pkgcond */
#define PKGCOND_GLOBAL_VARIABLE "SUNW_PKGCOND_GLOBAL_DATA"
#define TAG_COND_TOPLEVEL "environmentConditionInformation"
#define TAG_COND_PARENT_ZONE "parentZone"
#define TAG_COND_CURRENT_ZONE "currentZone"
#define TAG_COND_ZONE_NAME "zoneName"
#define TAG_COND_ZONE_TYPE "zoneType"
#define TAG_COND_INHERITED_FS "inheritedFileSystem"
#define TAG_COND_FS_NAME "fileSystemName"
#define TAG_VALUE_GLOBAL_ZONE "global"
#define TAG_VALUE_NONGLOBAL_ZONE "nonglobal"
typedef struct _sml_tag_struct SML_TAG;
typedef struct _sml_parameter_struct SML_PARAM;
struct _sml_tag_struct {
char *name; /* tag name */
int params_num; /* # params in *params */
int tags_num; /* # subtags in *tags */
};
struct _sml_parameter_struct {
char *name; /* tag name */
char *value; /* parameters */
};
/*PRINTFLIKE2*/
/*PRINTFLIKE2*/
int bufLen);
char *parmReturn);
boolean_t smlGetVerbose(void);
/*PRINTFLIKE4*/
char *format, ...);
/*PRINTFLIKE3*/
/*PRINTFLIKE3*/
/*PRINTFLIKE1*/
char *sml_strPrintf(char *a_format, ...);
char *sml_XmlEncodeString(char *a_plainTextString);
char *sml_XmlDecodeString(char *a_xmlEncodedString);
#define gettext(x) x
#endif /* defined(lint) && !defined(gettext) */
#ifdef __cplusplus
}
#endif
#endif /* __HDRS_LIBINST_H__ */