Back to index

lightning-sunbird  0.9+nobinonly
install.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is the Netscape security libraries.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Netscape Communications Corporation.
00018  * Portions created by the Initial Developer are Copyright (C) 1994-2000
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPL"), or
00025  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026  * in which case the provisions of the GPL or the LGPL are applicable instead
00027  * of those above. If you wish to allow use of your version of this file only
00028  * under the terms of either the GPL or the LGPL, and not to allow others to
00029  * use your version of this file under the terms of the MPL, indicate your
00030  * decision by deleting the provisions above and replace them with the notice
00031  * and other provisions required by the GPL or the LGPL. If you do not delete
00032  * the provisions above, a recipient may use your version of this file under
00033  * the terms of any one of the MPL, the GPL or the LGPL.
00034  *
00035  * ***** END LICENSE BLOCK ***** */
00036 
00037 #ifndef PK11INSTALL_H
00038 #define PK11INSTALL_H
00039 
00040 #include <prio.h>
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 typedef void (*Pk11Install_ErrorHandler)(char *);
00047 
00048 typedef enum {
00049        PK11_INSTALL_NO_ERROR=0,
00050        PK11_INSTALL_DIR_DOESNT_EXIST,
00051        PK11_INSTALL_FILE_DOESNT_EXIST,
00052        PK11_INSTALL_FILE_NOT_READABLE,
00053        PK11_INSTALL_ERROR_STRING,
00054        PK11_INSTALL_JAR_ERROR,
00055        PK11_INSTALL_NO_INSTALLER_SCRIPT,
00056        PK11_INSTALL_DELETE_TEMP_FILE,
00057        PK11_INSTALL_OPEN_SCRIPT_FILE,
00058        PK11_INSTALL_SCRIPT_PARSE,
00059        PK11_INSTALL_SEMANTIC,
00060        PK11_INSTALL_SYSINFO,
00061        PK11_INSTALL_NO_PLATFORM,
00062        PK11_INSTALL_BOGUS_REL_DIR,
00063        PK11_INSTALL_NO_MOD_FILE,
00064        PK11_INSTALL_ADD_MODULE,
00065        PK11_INSTALL_JAR_EXTRACT,
00066        PK11_INSTALL_DIR_NOT_WRITEABLE,
00067        PK11_INSTALL_CREATE_DIR,
00068        PK11_INSTALL_REMOVE_DIR,
00069        PK11_INSTALL_EXEC_FILE,
00070        PK11_INSTALL_WAIT_PROCESS,
00071        PK11_INSTALL_PROC_ERROR,
00072        PK11_INSTALL_USER_ABORT,
00073        PK11_INSTALL_UNSPECIFIED
00074 } Pk11Install_Error;
00075 #define PK11_INSTALL_SUCCESS PK11_INSTALL_NO_ERROR
00076 
00077 /**************************************************************************
00078  *
00079  * P k 1 1 I n s t a l l _ I n i t
00080  *
00081  * Does initialization that otherwise would be done on the fly.  Only
00082  * needs to be called by multithreaded apps, before they make any calls
00083  * to this library.
00084  */
00085 void 
00086 Pk11Install_Init();
00087 
00088 /**************************************************************************
00089  *
00090  * 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
00091  *
00092  * Sets the error handler to be used by the library.  Returns the current
00093  * error handler function.
00094  */
00095 Pk11Install_ErrorHandler
00096 Pk11Install_SetErrorHandler(Pk11Install_ErrorHandler handler);
00097 
00098 
00099 /**************************************************************************
00100  *
00101  * P k 1 1 I n s t a l l _ R e l e a s e
00102  *
00103  * Releases static data structures used by the library.  Don't use the
00104  * library after calling this, unless you call Pk11Install_Init()
00105  * first.  This function doesn't have to be called at all unless you're
00106  * really anal about freeing memory before your program exits.
00107  */
00108 void 
00109 Pk11Install_Release();
00110 
00111 /*************************************************************************
00112  *
00113  * P k 1 1 I n s t a l l _ D o I n s t a l l
00114  *
00115  * jarFile is the path of a JAR in the PKCS #11 module JAR format.
00116  * installDir is the directory relative to which files will be
00117  *   installed.
00118  * feedback is a file descriptor to which to write informative (not error)
00119  * status messages: what files are being installed, what modules are being
00120  * installed.  If feedback==NULL, no messages will be displayed.
00121  * If force != 0, interactive prompts will be suppressed.
00122  * If noverify == PR_TRUE, signatures won't be checked on the JAR file.
00123  */
00124 Pk11Install_Error
00125 Pk11Install_DoInstall(char *jarFile, const char *installDir,
00126        const char *tempDir, PRFileDesc *feedback, short force,
00127        PRBool noverify);
00128 
00129 #ifdef __cplusplus
00130 }
00131 #endif
00132 
00133 #endif /*PK11INSTALL_H*/