Back to index

lightning-sunbird  0.9+nobinonly
error.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 MODUTIL_ERROR_H
00038 #define MODUTIL_ERROR_H
00039 
00040 typedef enum {
00041        NO_ERR=0,
00042        INVALID_USAGE_ERR,
00043        UNEXPECTED_ARG_ERR,
00044        UNKNOWN_OPTION_ERR,
00045        MULTIPLE_COMMAND_ERR,
00046        OPTION_NEEDS_ARG_ERR,
00047        DUPLICATE_OPTION_ERR,
00048        MISSING_PARAM_ERR,
00049        INVALID_FIPS_ARG,
00050        NO_COMMAND_ERR,
00051        NO_DBDIR_ERR,
00052        FIPS_SWITCH_FAILED_ERR,
00053        FIPS_ALREADY_ON_ERR,
00054        FIPS_ALREADY_OFF_ERR,
00055        FILE_ALREADY_EXISTS_ERR,
00056        FILE_DOESNT_EXIST_ERR,
00057        FILE_NOT_READABLE_ERR,
00058        FILE_NOT_WRITEABLE_ERR,
00059        DIR_DOESNT_EXIST_ERR,
00060        DIR_NOT_READABLE_ERR,
00061        DIR_NOT_WRITEABLE_ERR,
00062        INVALID_CONSTANT_ERR,
00063        ADD_MODULE_FAILED_ERR,
00064        ADD_MODULE_FAILED_STATUS_ERR,
00065        OUT_OF_MEM_ERR,
00066        DELETE_INTERNAL_ERR,
00067        DELETE_FAILED_ERR,
00068        NO_LIST_LOCK_ERR,
00069        NO_MODULE_LIST_ERR,
00070        NO_SUCH_MODULE_ERR,
00071        MOD_INFO_ERR,
00072        SLOT_INFO_ERR,
00073        TOKEN_INFO_ERR,
00074        NO_SUCH_TOKEN_ERR,
00075        CHANGEPW_FAILED_ERR,
00076        BAD_PW_ERR,
00077        DB_ACCESS_ERR,
00078        AUTHENTICATION_FAILED_ERR,
00079        NO_SUCH_SLOT_ERR,
00080        ENABLE_FAILED_ERR,
00081        UPDATE_MOD_FAILED_ERR,
00082        DEFAULT_FAILED_ERR,
00083        UNDEFAULT_FAILED_ERR,
00084        STDIN_READ_ERR,
00085        UNSPECIFIED_ERR,
00086        NOCERTDB_MISUSE_ERR,
00087        NSS_INITIALIZE_FAILED_ERR,
00088 
00089        LAST_ERR /* must be last */
00090 } Error;
00091 #define SUCCESS NO_ERR
00092 
00093 /* !!! Should move this into its own .c and un-static it. */
00094 static char *errStrings[] = {
00095        "Operation completed successfully.\n",
00096        "ERROR: Invalid command line.\n",
00097        "ERROR: Not expecting argument \"%s\".\n",
00098        "ERROR: Unknown option: %s.\n",
00099        "ERROR: %s: multiple commands are not allowed on the command line.\n",
00100        "ERROR: %s: option needs an argument.\n",
00101        "ERROR: %s: option cannot be given more than once.\n",
00102        "ERROR: Command \"%s\" requires parameter \"%s\".\n",
00103        "ERROR: Argument to -fips must be \"true\" or \"false\".\n",
00104        "ERROR: No command was specified.\n",
00105        "ERROR: Cannot determine database directory: use the -dbdir option.\n",
00106        "ERROR: Unable to switch FIPS modes.\n",
00107        "FIPS mode already enabled.\n",
00108        "FIPS mode already disabled.\n",
00109        "ERROR: File \"%s\" already exists.\n",
00110        "ERROR: File \"%s\" does not exist.\n",
00111        "ERROR: File \"%s\" is not readable.\n",
00112        "ERROR: File \"%s\" is not writeable.\n",
00113        "ERROR: Directory \"%s\" does not exist.\n",
00114        "ERROR: Directory \"%s\" is not readable.\n",
00115        "ERROR: Directory \"%s\" is not writeable.\n",
00116        "\"%s\" is not a recognized value.\n",
00117        "ERROR: Failed to add module \"%s\".\n",
00118        "ERROR: Failed to add module \"%s\". Probable cause : \"%s\".\n",
00119        "ERROR: Out of memory.\n",
00120        "ERROR: Cannot delete internal module.\n",
00121        "ERROR: Failed to delete module \"%s\".\n",
00122        "ERROR: Unable to obtain lock on module list.\n",
00123        "ERROR: Unable to obtain module list.\n",
00124        "ERROR: Module \"%s\" not found in database.\n",
00125        "ERROR: Unable to get information about module \"%s\".\n",
00126        "ERROR: Unable to get information about slot \"%s\".\n",
00127        "ERROR: Unable to get information about token \"%s\".\n",
00128        "ERROR: Token \"%s\" not found.\n",
00129        "ERROR: Unable to change password on token \"%s\".\n",
00130        "ERROR: Incorrect password.\n",
00131        "ERROR: Unable to access database \"%s\".\n",
00132        "ERROR: Unable to authenticate to token \"%s\".\n",
00133        "ERROR: Slot \"%s\" not found.\n",
00134        "ERROR: Failed to %s slot \"%s\".\n",
00135        "ERROR: Failed to update module \"%s\".\n",
00136        "ERROR: Failed to change defaults.\n",
00137        "ERROR: Failed to change default.\n",
00138        "ERROR: Unable to read from standard input.\n",
00139        "ERROR: Unknown error occurred.\n",
00140        "ERROR: -nocertdb option can only be used with the -jar command.\n"
00141        "ERROR: NSS_Initialize() failed.\n"
00142 };
00143 
00144 typedef enum {
00145        FIPS_ENABLED_MSG=0,
00146        FIPS_DISABLED_MSG,
00147        USING_DBDIR_MSG,
00148        CREATING_DB_MSG,
00149        ADD_MODULE_SUCCESS_MSG,
00150        DELETE_SUCCESS_MSG,
00151        CHANGEPW_SUCCESS_MSG,
00152        BAD_PW_MSG,
00153        PW_MATCH_MSG,
00154        DONE_MSG,
00155        ENABLE_SUCCESS_MSG,
00156        DEFAULT_SUCCESS_MSG,
00157        UNDEFAULT_SUCCESS_MSG,
00158        BROWSER_RUNNING_MSG,
00159        ABORTING_MSG,
00160 
00161        LAST_MSG  /* must be last */
00162 } Message;
00163 
00164 static char *msgStrings[] = {
00165        "FIPS mode enabled.\n",
00166        "FIPS mode disabled.\n",
00167        "Using database directory %s...\n",
00168        "Creating \"%s\"...",
00169        "Module \"%s\" added to database.\n",
00170        "Module \"%s\" deleted from database.\n",
00171        "Token \"%s\" password changed successfully.\n",
00172        "Incorrect password, try again...\n",
00173        "Passwords do not match, try again...\n",
00174        "done.\n",
00175        "Slot \"%s\" %s.\n",
00176        "Successfully changed defaults.\n",
00177        "Successfully changed defaults.\n",
00178 "\nWARNING: Performing this operation while the browser is running could cause"
00179 "\ncorruption of your security databases. If the browser is currently running,"
00180 "\nyou should exit browser before continuing this operation. Type "
00181 "\n'q <enter>' to abort, or <enter> to continue: ",
00182        "\nAborting...\n"
00183 };
00184 
00185 #endif /* MODUTIL_ERROR_H */