nss: import at 3.0.1 beta 1
[mozilla-nss.git] / security / nss / cmd / modutil / install.h
blob00fae7aebc69d8fa0e6c5a7f939910ba1174f076
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is the Netscape security libraries.
16 * The Initial Developer of the Original Code is
17 * Netscape Communications Corporation.
18 * Portions created by the Initial Developer are Copyright (C) 1994-2000
19 * the Initial Developer. All Rights Reserved.
21 * Contributor(s):
23 * Alternatively, the contents of this file may be used under the terms of
24 * either the GNU General Public License Version 2 or later (the "GPL"), or
25 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26 * in which case the provisions of the GPL or the LGPL are applicable instead
27 * of those above. If you wish to allow use of your version of this file only
28 * under the terms of either the GPL or the LGPL, and not to allow others to
29 * use your version of this file under the terms of the MPL, indicate your
30 * decision by deleting the provisions above and replace them with the notice
31 * and other provisions required by the GPL or the LGPL. If you do not delete
32 * the provisions above, a recipient may use your version of this file under
33 * the terms of any one of the MPL, the GPL or the LGPL.
35 * ***** END LICENSE BLOCK ***** */
37 #ifndef PK11INSTALL_H
38 #define PK11INSTALL_H
40 #include <prio.h>
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
46 typedef void (*Pk11Install_ErrorHandler)(char *);
48 typedef enum {
49 PK11_INSTALL_NO_ERROR=0,
50 PK11_INSTALL_DIR_DOESNT_EXIST,
51 PK11_INSTALL_FILE_DOESNT_EXIST,
52 PK11_INSTALL_FILE_NOT_READABLE,
53 PK11_INSTALL_ERROR_STRING,
54 PK11_INSTALL_JAR_ERROR,
55 PK11_INSTALL_NO_INSTALLER_SCRIPT,
56 PK11_INSTALL_DELETE_TEMP_FILE,
57 PK11_INSTALL_OPEN_SCRIPT_FILE,
58 PK11_INSTALL_SCRIPT_PARSE,
59 PK11_INSTALL_SEMANTIC,
60 PK11_INSTALL_SYSINFO,
61 PK11_INSTALL_NO_PLATFORM,
62 PK11_INSTALL_BOGUS_REL_DIR,
63 PK11_INSTALL_NO_MOD_FILE,
64 PK11_INSTALL_ADD_MODULE,
65 PK11_INSTALL_JAR_EXTRACT,
66 PK11_INSTALL_DIR_NOT_WRITEABLE,
67 PK11_INSTALL_CREATE_DIR,
68 PK11_INSTALL_REMOVE_DIR,
69 PK11_INSTALL_EXEC_FILE,
70 PK11_INSTALL_WAIT_PROCESS,
71 PK11_INSTALL_PROC_ERROR,
72 PK11_INSTALL_USER_ABORT,
73 PK11_INSTALL_UNSPECIFIED
74 } Pk11Install_Error;
75 #define PK11_INSTALL_SUCCESS PK11_INSTALL_NO_ERROR
77 /**************************************************************************
79 * P k 1 1 I n s t a l l _ I n i t
81 * Does initialization that otherwise would be done on the fly. Only
82 * needs to be called by multithreaded apps, before they make any calls
83 * to this library.
85 void
86 Pk11Install_Init();
88 /**************************************************************************
90 * 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
92 * Sets the error handler to be used by the library. Returns the current
93 * error handler function.
95 Pk11Install_ErrorHandler
96 Pk11Install_SetErrorHandler(Pk11Install_ErrorHandler handler);
99 /**************************************************************************
101 * P k 1 1 I n s t a l l _ R e l e a s e
103 * Releases static data structures used by the library. Don't use the
104 * library after calling this, unless you call Pk11Install_Init()
105 * first. This function doesn't have to be called at all unless you're
106 * really anal about freeing memory before your program exits.
108 void
109 Pk11Install_Release();
111 /*************************************************************************
113 * P k 1 1 I n s t a l l _ D o I n s t a l l
115 * jarFile is the path of a JAR in the PKCS #11 module JAR format.
116 * installDir is the directory relative to which files will be
117 * installed.
118 * feedback is a file descriptor to which to write informative (not error)
119 * status messages: what files are being installed, what modules are being
120 * installed. If feedback==NULL, no messages will be displayed.
121 * If force != 0, interactive prompts will be suppressed.
122 * If noverify == PR_TRUE, signatures won't be checked on the JAR file.
124 Pk11Install_Error
125 Pk11Install_DoInstall(char *jarFile, const char *installDir,
126 const char *tempDir, PRFileDesc *feedback, short force,
127 PRBool noverify);
129 #ifdef __cplusplus
131 #endif
133 #endif /*PK11INSTALL_H*/