michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef PK11INSTALL_H michael@0: #define PK11INSTALL_H michael@0: michael@0: #include michael@0: michael@0: #ifdef __cplusplus michael@0: extern "C" { michael@0: #endif michael@0: michael@0: typedef void (*Pk11Install_ErrorHandler)(char *); michael@0: michael@0: typedef enum { michael@0: PK11_INSTALL_NO_ERROR=0, michael@0: PK11_INSTALL_DIR_DOESNT_EXIST, michael@0: PK11_INSTALL_FILE_DOESNT_EXIST, michael@0: PK11_INSTALL_FILE_NOT_READABLE, michael@0: PK11_INSTALL_ERROR_STRING, michael@0: PK11_INSTALL_JAR_ERROR, michael@0: PK11_INSTALL_NO_INSTALLER_SCRIPT, michael@0: PK11_INSTALL_DELETE_TEMP_FILE, michael@0: PK11_INSTALL_OPEN_SCRIPT_FILE, michael@0: PK11_INSTALL_SCRIPT_PARSE, michael@0: PK11_INSTALL_SEMANTIC, michael@0: PK11_INSTALL_SYSINFO, michael@0: PK11_INSTALL_NO_PLATFORM, michael@0: PK11_INSTALL_BOGUS_REL_DIR, michael@0: PK11_INSTALL_NO_MOD_FILE, michael@0: PK11_INSTALL_ADD_MODULE, michael@0: PK11_INSTALL_JAR_EXTRACT, michael@0: PK11_INSTALL_DIR_NOT_WRITEABLE, michael@0: PK11_INSTALL_CREATE_DIR, michael@0: PK11_INSTALL_REMOVE_DIR, michael@0: PK11_INSTALL_EXEC_FILE, michael@0: PK11_INSTALL_WAIT_PROCESS, michael@0: PK11_INSTALL_PROC_ERROR, michael@0: PK11_INSTALL_USER_ABORT, michael@0: PK11_INSTALL_UNSPECIFIED michael@0: } Pk11Install_Error; michael@0: #define PK11_INSTALL_SUCCESS PK11_INSTALL_NO_ERROR michael@0: michael@0: /************************************************************************** michael@0: * michael@0: * P k 1 1 I n s t a l l _ I n i t michael@0: * michael@0: * Does initialization that otherwise would be done on the fly. Only michael@0: * needs to be called by multithreaded apps, before they make any calls michael@0: * to this library. michael@0: */ michael@0: void michael@0: Pk11Install_Init(); michael@0: michael@0: /************************************************************************** michael@0: * michael@0: * P k 1 1 I n s t a l l _ S e t E r r o r H a n d l e r michael@0: * michael@0: * Sets the error handler to be used by the library. Returns the current michael@0: * error handler function. michael@0: */ michael@0: Pk11Install_ErrorHandler michael@0: Pk11Install_SetErrorHandler(Pk11Install_ErrorHandler handler); michael@0: michael@0: michael@0: /************************************************************************** michael@0: * michael@0: * P k 1 1 I n s t a l l _ R e l e a s e michael@0: * michael@0: * Releases static data structures used by the library. Don't use the michael@0: * library after calling this, unless you call Pk11Install_Init() michael@0: * first. This function doesn't have to be called at all unless you're michael@0: * really anal about freeing memory before your program exits. michael@0: */ michael@0: void michael@0: Pk11Install_Release(); michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * P k 1 1 I n s t a l l _ D o I n s t a l l michael@0: * michael@0: * jarFile is the path of a JAR in the PKCS #11 module JAR format. michael@0: * installDir is the directory relative to which files will be michael@0: * installed. michael@0: * feedback is a file descriptor to which to write informative (not error) michael@0: * status messages: what files are being installed, what modules are being michael@0: * installed. If feedback==NULL, no messages will be displayed. michael@0: * If force != 0, interactive prompts will be suppressed. michael@0: * If noverify == PR_TRUE, signatures won't be checked on the JAR file. michael@0: */ michael@0: Pk11Install_Error michael@0: Pk11Install_DoInstall(char *jarFile, const char *installDir, michael@0: const char *tempDir, PRFileDesc *feedback, short force, michael@0: PRBool noverify); michael@0: michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif michael@0: michael@0: #endif /*PK11INSTALL_H*/