home *** CD-ROM | disk | FTP | other *** search
- /*
- Auto: smake ForceIcon
- */
-
-
-
- /* $Revision Header built automatically *************** (do not edit) ************
- **
- ** © Copyright by GuntherSoft
- **
- ** File : SnakeSYS:CPrgs/Utils/ForceIcon/Error.c
- ** Created on : Saturday, 23.10.93 14:30:06
- ** Created by : Kai Iske
- ** Current revision : V1.0
- **
- **
- ** Purpose
- ** -------
- ** - Error-Handling for ForceIcon
- **
- ** Revision V1.0
- ** --------------
- ** created on Saturday, 23.10.93 14:30:06 by Kai Iske. LogMessage :
- ** --- Initial release ---
- **
- *********************************************************************************/
-
-
-
-
- /**********************************************************************/
- /* Internal errors */
- /**********************************************************************/
- static char *InternalErrs[] =
- {
- "%s verion %ld could not be opened.",
-
- "Sorry, out of memory",
-
- "Sorry, not all entries from DOS-List\ncould be collected.",
-
- #ifdef PREFSRUN
- "ForceIcon v%ld.%ld, (%s)\n"
- "by Kai Iske, GiftWare\n\n"
- "Reach me under\n"
- " Kai Iske, Brucknerstrasse 18, 63452 Hanau, Germany\n"
- " Tel.: +49-(0)6181-850181\n"
- "or electronically\n"
- " UseNet: kai@iske.adsp.sub.org\n"
- " Internet: iske@informatik.uni-frankfurt.de\n"
- " Fido: Kai Iske, 2:244/6302.11\n"
- " ZNet: KAI@SWEET.ZER\n\n"
- "ForceIcon (Prefs) is a MUI application; MUI © Stefan Stuntz",
-
- "Volume %s\nhas already been selected.",
-
- "No negative values please.",
-
- "",
-
- "",
- #else
- "",
-
- "",
-
- "",
-
- "Someone else has patched GetIcon() and Lock() vectors.\n"
- "Please remove the other program(s) first.\n"
- "Can not quit yet. Continuing program.",
-
- "Someone else has patched %s vector.\n"
- "Please remove the other program(s) first.\n"
- "Can not quit yet. Continuing program.",
- #endif
-
- #ifdef PREFSRUN
- "",
-
- "Application object for windows\n"
- "could not be created."
- #else
- "Removing ForceIcon.",
-
- ""
- #endif
- };
-
-
-
- /**********************************************************************/
- /* IFF-Errors */
- /**********************************************************************/
- static char *IFFErrs[] =
- {
- "IFF-Error\nEnd of file reached before completing parse.",
- "IFF-Error\nAn IFF-Chunk could not be read.",
- "IFF-Error\nChunk-Contents didn`t reside at expected position.",
- "IFF-Error\nInternal memory could not be allocated.",
- "IFF-Error\nError while reading from file.\nFile could probably not be opened.",
- "IFF-Error\nError while writing to file.\nFile could probably not be opened.",
- "IFF-Error\nError while seeking through file.\n%s",
- "IFF-Error\nData within file corrupt.\n%s",
- "IFF-Error\nSyntax error within file.\n%s",
- "IFF-Error\n%s\nis not an IFF file."
- };
-
-
-
-
-
- /**********************************************************************/
- /* Display an error */
- /**********************************************************************/
- static void __stdargs DisplayError(LONG ErrCode, ULONG Arg1, ...)
- {
- struct EasyStruct MyRequest =
- {
- sizeof(struct EasyStruct),
- 0,
- NULL,
- NULL,
- NULL
- };
-
- if(!IntuitionBase)
- return;
-
- // Set header for Requester
-
- MyRequest.es_Title = "ForceIcon";
- MyRequest.es_GadgetFormat = "Ok";
-
-
- // Set correct text
-
- if((ErrCode >= 0) && (ErrCode < 200))
- {
- MyRequest.es_TextFormat = InternalErrs[ErrCode];
- #ifdef PREFSRUN
- if(MainWindow && AppObject && MUIMasterBase)
- MUI_RequestA(AppObject, MainWindow, 0, NULL, "*Ok", MyRequest.es_TextFormat, &Arg1);
- else
- EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
- #else
- EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
- #endif
- }
-
- else if((ErrCode >= 200) && (ErrCode < 226))
- {
- char Buffer[128];
-
- Fault(ErrCode, NULL, Buffer, 128);
-
- MyRequest.es_TextFormat = "DOS-Error %ld\n%s";
-
- #ifdef PREFSRUN
- if(MainWindow && AppObject && MUIMasterBase)
- MUI_RequestA(AppObject, MainWindow, 0, NULL, "*Ok", MyRequest.es_TextFormat, &Arg1);
- else
- EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
- #else
- EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
- #endif
- }
-
- else if(ErrCode < 0)
- {
- MyRequest.es_TextFormat = IFFErrs[((-ErrCode) - 1)];
-
- #ifdef PREFSRUN
- if(MainWindow && AppObject && MUIMasterBase)
- MUI_RequestA(AppObject, MainWindow, 0, NULL, "*Ok", MyRequest.es_TextFormat, &Arg1);
- else
- EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
- #else
- EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
- #endif
- }
- }
-