1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/cmd/modutil/install.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,101 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef PK11INSTALL_H 1.9 +#define PK11INSTALL_H 1.10 + 1.11 +#include <prio.h> 1.12 + 1.13 +#ifdef __cplusplus 1.14 +extern "C" { 1.15 +#endif 1.16 + 1.17 +typedef void (*Pk11Install_ErrorHandler)(char *); 1.18 + 1.19 +typedef enum { 1.20 + PK11_INSTALL_NO_ERROR=0, 1.21 + PK11_INSTALL_DIR_DOESNT_EXIST, 1.22 + PK11_INSTALL_FILE_DOESNT_EXIST, 1.23 + PK11_INSTALL_FILE_NOT_READABLE, 1.24 + PK11_INSTALL_ERROR_STRING, 1.25 + PK11_INSTALL_JAR_ERROR, 1.26 + PK11_INSTALL_NO_INSTALLER_SCRIPT, 1.27 + PK11_INSTALL_DELETE_TEMP_FILE, 1.28 + PK11_INSTALL_OPEN_SCRIPT_FILE, 1.29 + PK11_INSTALL_SCRIPT_PARSE, 1.30 + PK11_INSTALL_SEMANTIC, 1.31 + PK11_INSTALL_SYSINFO, 1.32 + PK11_INSTALL_NO_PLATFORM, 1.33 + PK11_INSTALL_BOGUS_REL_DIR, 1.34 + PK11_INSTALL_NO_MOD_FILE, 1.35 + PK11_INSTALL_ADD_MODULE, 1.36 + PK11_INSTALL_JAR_EXTRACT, 1.37 + PK11_INSTALL_DIR_NOT_WRITEABLE, 1.38 + PK11_INSTALL_CREATE_DIR, 1.39 + PK11_INSTALL_REMOVE_DIR, 1.40 + PK11_INSTALL_EXEC_FILE, 1.41 + PK11_INSTALL_WAIT_PROCESS, 1.42 + PK11_INSTALL_PROC_ERROR, 1.43 + PK11_INSTALL_USER_ABORT, 1.44 + PK11_INSTALL_UNSPECIFIED 1.45 +} Pk11Install_Error; 1.46 +#define PK11_INSTALL_SUCCESS PK11_INSTALL_NO_ERROR 1.47 + 1.48 +/************************************************************************** 1.49 + * 1.50 + * P k 1 1 I n s t a l l _ I n i t 1.51 + * 1.52 + * Does initialization that otherwise would be done on the fly. Only 1.53 + * needs to be called by multithreaded apps, before they make any calls 1.54 + * to this library. 1.55 + */ 1.56 +void 1.57 +Pk11Install_Init(); 1.58 + 1.59 +/************************************************************************** 1.60 + * 1.61 + * 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 1.62 + * 1.63 + * Sets the error handler to be used by the library. Returns the current 1.64 + * error handler function. 1.65 + */ 1.66 +Pk11Install_ErrorHandler 1.67 +Pk11Install_SetErrorHandler(Pk11Install_ErrorHandler handler); 1.68 + 1.69 + 1.70 +/************************************************************************** 1.71 + * 1.72 + * P k 1 1 I n s t a l l _ R e l e a s e 1.73 + * 1.74 + * Releases static data structures used by the library. Don't use the 1.75 + * library after calling this, unless you call Pk11Install_Init() 1.76 + * first. This function doesn't have to be called at all unless you're 1.77 + * really anal about freeing memory before your program exits. 1.78 + */ 1.79 +void 1.80 +Pk11Install_Release(); 1.81 + 1.82 +/************************************************************************* 1.83 + * 1.84 + * P k 1 1 I n s t a l l _ D o I n s t a l l 1.85 + * 1.86 + * jarFile is the path of a JAR in the PKCS #11 module JAR format. 1.87 + * installDir is the directory relative to which files will be 1.88 + * installed. 1.89 + * feedback is a file descriptor to which to write informative (not error) 1.90 + * status messages: what files are being installed, what modules are being 1.91 + * installed. If feedback==NULL, no messages will be displayed. 1.92 + * If force != 0, interactive prompts will be suppressed. 1.93 + * If noverify == PR_TRUE, signatures won't be checked on the JAR file. 1.94 + */ 1.95 +Pk11Install_Error 1.96 +Pk11Install_DoInstall(char *jarFile, const char *installDir, 1.97 + const char *tempDir, PRFileDesc *feedback, short force, 1.98 + PRBool noverify); 1.99 + 1.100 +#ifdef __cplusplus 1.101 +} 1.102 +#endif 1.103 + 1.104 +#endif /*PK11INSTALL_H*/