Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef PK11INSTALL_H
6 #define PK11INSTALL_H
8 #include <prio.h>
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
14 typedef void (*Pk11Install_ErrorHandler)(char *);
16 typedef enum {
17 PK11_INSTALL_NO_ERROR=0,
18 PK11_INSTALL_DIR_DOESNT_EXIST,
19 PK11_INSTALL_FILE_DOESNT_EXIST,
20 PK11_INSTALL_FILE_NOT_READABLE,
21 PK11_INSTALL_ERROR_STRING,
22 PK11_INSTALL_JAR_ERROR,
23 PK11_INSTALL_NO_INSTALLER_SCRIPT,
24 PK11_INSTALL_DELETE_TEMP_FILE,
25 PK11_INSTALL_OPEN_SCRIPT_FILE,
26 PK11_INSTALL_SCRIPT_PARSE,
27 PK11_INSTALL_SEMANTIC,
28 PK11_INSTALL_SYSINFO,
29 PK11_INSTALL_NO_PLATFORM,
30 PK11_INSTALL_BOGUS_REL_DIR,
31 PK11_INSTALL_NO_MOD_FILE,
32 PK11_INSTALL_ADD_MODULE,
33 PK11_INSTALL_JAR_EXTRACT,
34 PK11_INSTALL_DIR_NOT_WRITEABLE,
35 PK11_INSTALL_CREATE_DIR,
36 PK11_INSTALL_REMOVE_DIR,
37 PK11_INSTALL_EXEC_FILE,
38 PK11_INSTALL_WAIT_PROCESS,
39 PK11_INSTALL_PROC_ERROR,
40 PK11_INSTALL_USER_ABORT,
41 PK11_INSTALL_UNSPECIFIED
42 } Pk11Install_Error;
43 #define PK11_INSTALL_SUCCESS PK11_INSTALL_NO_ERROR
45 /**************************************************************************
46 *
47 * P k 1 1 I n s t a l l _ I n i t
48 *
49 * Does initialization that otherwise would be done on the fly. Only
50 * needs to be called by multithreaded apps, before they make any calls
51 * to this library.
52 */
53 void
54 Pk11Install_Init();
56 /**************************************************************************
57 *
58 * 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
59 *
60 * Sets the error handler to be used by the library. Returns the current
61 * error handler function.
62 */
63 Pk11Install_ErrorHandler
64 Pk11Install_SetErrorHandler(Pk11Install_ErrorHandler handler);
67 /**************************************************************************
68 *
69 * P k 1 1 I n s t a l l _ R e l e a s e
70 *
71 * Releases static data structures used by the library. Don't use the
72 * library after calling this, unless you call Pk11Install_Init()
73 * first. This function doesn't have to be called at all unless you're
74 * really anal about freeing memory before your program exits.
75 */
76 void
77 Pk11Install_Release();
79 /*************************************************************************
80 *
81 * P k 1 1 I n s t a l l _ D o I n s t a l l
82 *
83 * jarFile is the path of a JAR in the PKCS #11 module JAR format.
84 * installDir is the directory relative to which files will be
85 * installed.
86 * feedback is a file descriptor to which to write informative (not error)
87 * status messages: what files are being installed, what modules are being
88 * installed. If feedback==NULL, no messages will be displayed.
89 * If force != 0, interactive prompts will be suppressed.
90 * If noverify == PR_TRUE, signatures won't be checked on the JAR file.
91 */
92 Pk11Install_Error
93 Pk11Install_DoInstall(char *jarFile, const char *installDir,
94 const char *tempDir, PRFileDesc *feedback, short force,
95 PRBool noverify);
97 #ifdef __cplusplus
98 }
99 #endif
101 #endif /*PK11INSTALL_H*/