home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************
- This file was created automatically by `FlexCat V1.0'
- Do NOT edit by hand!
- ****************************************************************/
-
- #ifndef Chaos_CAT_H
- #include "Chaos_CAT.h"
- #endif /* !Chaos_CAT_H */
-
- #include <string.h>
-
- #ifndef EXEC_MEMORY_H
- #include <exec/memory.h>
- #endif /* !EXEC_MEMORY_H */
- #ifndef LIBRARIES_IFFPARSE_H
- #include <libraries/iffparse.h>
- #endif /* !LIBRARIES_IFFPARSE_H */
-
- #ifndef CLIB_IFFPARSE_PROTOS_H
- #include <clib/iffparse_protos.h>
- #endif /* !CLIB_IFFPARSE_PROTOS_H */
- #ifndef CLIB_LOCALE_PROTOS_H
- #include <clib/locale_protos.h>
- #endif /* !CLIB_LOCALE_PROTOS_H */
- #ifndef CLIB_DOS_PROTOS_H
- #include <clib/dos_protos.h>
- #endif /* !DOS_PROTOS_H */
- #ifndef CLIB_EXEC_PROTOS_H
- #include <clib/exec_protos.h>
- #endif /* !EXEC_PROTOS_H */
- #ifndef CLIB_UTILITY_PROTOS_H
- #include <clib/utility_protos.h>
- #endif /* !CLIB_UTILITY_PROTOS_H */
-
- #ifdef AZTEC_C
- #ifndef __PRAGMAS_LOCALE_LIB_H
- #include <pragmas/locale_lib.h>
- #endif /* !PRAGMAS_LOCALE_LIB_H */
- #ifndef __PRAGMAS_IFFPARSE_LIB_H
- #include <pragmas/iffparse_lib.h>
- #endif /* !PRAGMAS_IFFPARSE_LIB_H */
- #ifndef __PRAGMAS_DOS_LIB_H
- #include <pragmas/dos_lib.h>
- #endif /* !PRAGMAS_DOS_LIB_H */
- #ifndef __PRAGMAS_EXEC_LIB_H
- #include <pragmas/exec_lib.h>
- #endif /* !PRAGMAS_EXEC_LIB_H */
- #ifndef __PRAGMAS_UTILITY_LIB_H
- #include <pragmas/utility_lib.h>
- #endif /* !PRAGMAS_UTILITY_LIB_H */
- #endif /* AZTEC_C */
-
- static LONG Chaos_Version = 8;
- static const STRPTR Chaos_BuiltInLanguage = (STRPTR) "english";
-
- struct FC_Type
- { LONG ID;
- STRPTR Str;
- };
-
- static const struct FC_Type Chaos_Array [] =
- {
- MSG_CDAT_SELECTION, (STRPTR) "Tournamentfile-selection",
- MSG_NO_WRITE_FILE, (STRPTR) "Cannot open %s as write-file!\nDOS-Error %ld",
- MSG_WRITE_ERROR, (STRPTR) "DOS-Error %ld while writing %s!",
- MSG_NO_READ_FILE, (STRPTR) "Cannot open %s as read-file!\nDOS-Error %ld",
- MSG_NO_CHAOS_FILE, (STRPTR) "%s is no Chaos-V5-file!",
- MSG_READ_ERROR, (STRPTR) "DOS-Error %ld while reading %s!",
- MSG_ATTENTION, (STRPTR) "Attention!",
- MSG_CHANGES_MADE, (STRPTR) "Changes have been made!\nDo you want to save the tournament first?",
- MSG_YES_NO, (STRPTR) "Yes|No",
- MSG_NO_TOURNAMENT_INPUT_WINDOW, (STRPTR) "Cannot open Tournament-input-window!",
- MSG_NO_PAIRING, (STRPTR) "No pairings possible!\nToo much rounds?",
- MSG_NO_PRINTER, (STRPTR) "Cannot connect to printer!",
- MSG_PAGENR, (STRPTR) "Page",
- MSG_NAME_OUTPUT, (STRPTR) "Name",
- MSG_DWZ_OUTPUT, (STRPTR) "Rating",
- MSG_CHESSCLUB_OUTPUT, (STRPTR) "Chess-club",
- MSG_STREET_OUTPUT, (STRPTR) "Home",
- MSG_VILLAGE_OUTPUT, (STRPTR) "Address",
- MSG_BIRTHDAY_OUTPUT, (STRPTR) "Birthday",
- MSG_PHONE_OUTPUT, (STRPTR) "Phone",
- MSG_PLAYER_LIST_TITLE, (STRPTR) "List of players",
- MSG_RESULT_OUTPUT, (STRPTR) "Result",
- MSG_WHITE_OUTPUT, (STRPTR) "White",
- MSG_BLACK_OUTPUT, (STRPTR) "Black",
- MSG_ROUND_TITLE, (STRPTR) "Games of round %ld",
- MSG_PLACE_OUTPUT, (STRPTR) "Place",
- MSG_POINTS_OUTPUT, (STRPTR) "Points",
- MSG_BUCHHOLZ_OUTPUT, (STRPTR) "Buchholz",
- MSG_EXT_BUCHHOLZ_OUTPUT, (STRPTR) "Ext.Bchh.",
- MSG_SONNEBORN_BERGER_OUTPUT, (STRPTR) "SnnBrgr.",
- MSG_TABLE_TITLE, (STRPTR) "Table of round %ld %s",
- MSG_TABLE_TITLE2, (STRPTR) "Table %s",
- MSG_RANKINGS_TITLE, (STRPTR) "Ratings",
- MSG_NUMBER, (STRPTR) "Nr.",
- MSG_RANKINGS_TITLE2, (STRPTR) "List of rankings (round %ld)",
- MSG_PROGRESS_TABLE_TITLE, (STRPTR) "Table of progress until round %ld",
- MSG_GAME_OUTPUT, (STRPTR) "Opponent (Nr., Result, Color)",
- MSG_FREE_GAME_OUTPUT, (STRPTR) " free",
- MSG_GONE_OUTPUT, (STRPTR) " dropped",
- MSG_FREE_POINT_OUTPUT, (STRPTR) "1 p. bye",
- MSG_FREE_GAME_OUTPUT2, (STRPTR) "free",
- MSG_NO_FIGHT_OUTPUT, (STRPTR) "(np)",
- MSG_ROUND_INPUT_TITLE, (STRPTR) "Input of games (round %ld)",
- MSG_NEW_PLAYER_REQUEST, (STRPTR) "Games have already been paired!\nDo you really want to add new players?",
- MSG_MODIFY_PLAYER_REQUEST, (STRPTR) "Games have already been paired!\nDo you really want to modify players?",
- MSG_DELETE_PLAYER_REQUEST, (STRPTR) "Games have already been paired!\nDo you really want to delete players?\n"\
- "(Mark them as withdrawn.)",
- MSG_DELETE_THIS_PLAYER_REQUEST, (STRPTR) "Do you really want to delete\nthe player %s?",
- MSG_THIS_PLAYER_GONE_REQUEST, (STRPTR) "Do you really want to mark\n%s as withdrawn?",
- MSG_DONT_CARE_REQUEST_TITLE, (STRPTR) "Don't care!",
- MSG_DONT_CARE_REQUEST, (STRPTR) "Player %s\nhas already been marked as withdrawn!",
- MSG_OK, (STRPTR) "Ok",
- MSG_OK_SC, (STRPTR) "o",
- MSG_ERROR_REQUEST, (STRPTR) "Error!",
- MSG_MEMORY_ERROR, (STRPTR) "Out of memory!",
- MSG_SWISS_PAIRING, (STRPTR) "Swiss pairing",
- MSG_RUNDENTURNIER, (STRPTR) "Round Robin (FIDE-system)",
- MSG_RUTSCHSYSTEM, (STRPTR) "Round Robin (shift-system)",
- MSG_TOURNAMENT_INPUT_TITLE, (STRPTR) "Input of tournament-data",
- WND_PLAYER_ADD_TITLE, (STRPTR) "Input of new players",
- MSG_WHITE_WINS_INPUT, (STRPTR) "\033uW\033nhite wins",
- MSG_DRAW_INPUT, (STRPTR) "\033uD\033nraw",
- MSG_BLACK_WINS_INPUT, (STRPTR) "\033uB\033nlack wins",
- MSG_RESULT_MISSING_INPUT, (STRPTR) "Result \033u\033nmissing",
- MSG_AUSGETRAGEN_INPUT, (STRPTR) "\033uP\033nlayed",
- MSG_KAMPFLOS_INPUT, (STRPTR) "\033uN\033not played",
- MSG_TOURNAMENT_MENU, (STRPTR) "Project",
- MSG_TOURNAMENT_NEW_ITEM, (STRPTR) "New",
- MSG_TOURNAMENT_LOAD_ITEM, (STRPTR) "Load",
- MSG_TOURNAMENT_SAVE_ITEM, (STRPTR) "Save",
- MSG_TOURNAMENT_SAVEAS_ITEM, (STRPTR) "Save as",
- MSG_TOURNAMENT_ABOUT_ITEM, (STRPTR) "About",
- MSG_TOURNAMENT_QUIT_ITEM, (STRPTR) "Quit",
- MSG_PLAYER_MENU, (STRPTR) "Players",
- MSG_PLAYER_ADD_ITEM, (STRPTR) "Add",
- MSG_PLAYER_IMPORT_ITEM, (STRPTR) "Import",
- MSG_PLAYER_MODIFY_ITEM, (STRPTR) "Modify",
- MSG_PLAYER_DELETE_ITEM, (STRPTR) "Delete",
- MSG_ROUND_MENU, (STRPTR) "Round",
- MSG_ROUND_PAIRINGS_ITEM, (STRPTR) "Make pairings",
- MSG_ROUND_PAIRINGS_SWISS_SUB, (STRPTR) "Swiss pairing",
- MSG_ROUND_PAIRINGS_RROBIN_SUB, (STRPTR) "Round Robin (FIDE-system)",
- MSG_ROUND_PAIRINGS_SLIDE_SUB, (STRPTR) "Round Robin (shift-system)",
- MSG_ROUND_RESULTS_ITEM, (STRPTR) "Enter results",
- MSG_OUTPUT_MENU, (STRPTR) "Output",
- MSG_OUTPUT_PLAYERS_ITEM, (STRPTR) "Player-list",
- MSG_OUTPUT_PLAYERS_SHORT_SUB, (STRPTR) "short",
- MSG_OUTPUT_PLAYERS_LONG_SUB, (STRPTR) "long",
- MSG_OUTPUT_RANKINGS_ITEM, (STRPTR) "Rankings",
- MSG_OUTPUT_ROUND_ITEM, (STRPTR) "Round",
- MSG_OUTPUT_TABLE_ITEM, (STRPTR) "Table",
- MSG_OUTPUT_TABLE_ALL_SUB, (STRPTR) "All",
- MSG_OUTPUT_TABLE_SENIORS_SUB, (STRPTR) "Seniors",
- MSG_OUTPUT_TABLE_JUNIORS_SUB, (STRPTR) "Juniors",
- MSG_OUTPUT_TABLE_WOMEN_SUB, (STRPTR) "Women",
- MSG_OUTPUT_TABLE_JUNIORSA_SUB, (STRPTR) "Juniors (A)",
- MSG_OUTPUT_TABLE_JUNIORSB_SUB, (STRPTR) "Juniors (B)",
- MSG_OUTPUT_TABLE_JUNIORSC_SUB, (STRPTR) "Juniors (C)",
- MSG_OUTPUT_TABLE_JUNIORSD_SUB, (STRPTR) "Juniors (D)",
- MSG_OUTPUT_TABLE_JUNIORSE_SUB, (STRPTR) "Juniors (E)",
- MSG_OUTPUT_PROGRESSTABLE_ITEM, (STRPTR) "Table of progress",
- MSG_OUTPUT_DWZ_ITEM, (STRPTR) "DWZ-report",
- MSG_OUTPUT_CROSSTABLE_ITEM, (STRPTR) "Cross-table",
- MSG_OUTPUT_CROSSTABLE_ASC_SUB, (STRPTR) "Ascii",
- MSG_OUTPUT_CROSSTABLE_TEX_SUB, (STRPTR) "TeX",
- MSG_OUTPUT_PLAYERCARDS_ITEM, (STRPTR) "Player-cards",
- MSG_OUTPUT_PLAYERCARDS_ASC_SUB, (STRPTR) "Ascii",
- MSG_OUTPUT_PLAYERCARDS_TEX_SUB, (STRPTR) "TeX",
- MSG_PREFS_MENU, (STRPTR) "Preferences",
- MSG_PREFS_TMODE_ITEM, (STRPTR) "scoring",
- MSG_PREFS_TMODE_SIMPLE_SUB, (STRPTR) "Simple",
- MSG_PREFS_TMODE_BUCHHOLZ_SUB, (STRPTR) "Buchholz",
- MSG_PREFS_TMODE_EXTBCHHLZ_SUB, (STRPTR) "Buchholz (extended)",
- MSG_PREFS_TMODE_SONNEBORN_SUB, (STRPTR) "Sonneborn-Berger",
- MSG_PREFS_OUT_ITEM, (STRPTR) "Output-Device",
- MSG_PREFS_OUT_SCREEN_SUB, (STRPTR) "Screen",
- MSG_PREFS_OUT_PRTDRAFT_SUB, (STRPTR) "Printer (Draft)",
- MSG_PREFS_OUT_PRTLQ_SUB, (STRPTR) "Printer (LQ)",
- MSG_PREFS_OUT_FILE_SUB, (STRPTR) "File",
- MSG_PREFS_SETGAMES, (STRPTR) "Set Games",
- MSG_PREFS_MAKEICONS_ITEM, (STRPTR) "Make icons",
- MSG_PREFS_SAVEWINDOWSETTINGS, (STRPTR) "Save window settings",
- MSG_SPECIAL_MENU, (STRPTR) "Special",
- MSG_NUM_PLAYERS_OUTPUT, (STRPTR) "Players:",
- MSG_NUM_ROUNDS_OUTPUT, (STRPTR) "Rounds:",
- MSG_TOURNAMENT_NAME_OUTPUT, (STRPTR) "Tournamentname:",
- MSG_TOURNAMENT_FILE_OUTPUT, (STRPTR) "Tournamentfile:",
- MSG_TOURNAMENT_MODE_OUTPUT, (STRPTR) "Tournamentmode:",
- MSG_CANCEL_INPUT, (STRPTR) "Cancel",
- MSG_CANCEL_SC, (STRPTR) "c",
- MSG_OK_INPUT, (STRPTR) "Ok",
- MSG_TOURNAMENT_NAME_INPUT, (STRPTR) "Tournamentname",
- MSG_NAME_INPUT, (STRPTR) "Name",
- MSG_STREET_INPUT, (STRPTR) "Home",
- MSG_VILLAGE_INPUT, (STRPTR) "Address",
- MSG_CHESS_CLUB_INPUT, (STRPTR) "Chess-club",
- MSG_PHONE_INPUT, (STRPTR) "Phone",
- MSG_BIRTHDAY_INPUT, (STRPTR) "Birthday",
- MSG_DWZ_INPUT, (STRPTR) "Rating",
- MSG_ELO_INPUT, (STRPTR) "ELO",
- MSG_SENIORS_INPUT, (STRPTR) "Senior",
- MSG_JUNIORS_INPUT, (STRPTR) "Junior",
- MSG_WOMEN_INPUT, (STRPTR) "Woman",
- MSG_JUNIORSA_INPUT, (STRPTR) "Junior (A)",
- MSG_JUNIORSB_INPUT, (STRPTR) "Junior (B)",
- MSG_JUNIORSC_INPUT, (STRPTR) "Junior (C)",
- MSG_JUNIORSD_INPUT, (STRPTR) "Junior (D)",
- MSG_JUNIORSE_INPUT, (STRPTR) "Junior (E)",
- MSG_MISSING_PLAYER_NAME, (STRPTR) "Players name is missing!",
- MSG_BIRTHDAY_ERROR, (STRPTR) "Error in birthday of player %s!",
- MSG_ABOUT_PERMISSION, (STRPTR) "This program is governed by the terms and conditions of the GNU General "\
- "Public License. A copy should have come with this distribution. (See the "\
- "file COPYING.) In that license it is made clear that you are welcome to "\
- "redistribute either verbatim or modified copies of the program and the "\
- "documentation under certain conditions. Further you are told that this "\
- "program comes with ABSOLUTELY NO WARRANTY!\n\n\n",
- MSG_ABOUT_THANKS1, (STRPTR) "My thanks go to\n"\
- "\n"\
- " Stefan Stuntz for MUI. Finally the user interface should be satisfying "\
- "for everyone.\n"\
- "\n"\
- " Reinhard Spisser and Sebastiano Vigna for the Amiga-version of texinfo. "\
- "The documentation is written using this.\n"\
- "\n"\
- " The Free Software Foundation for creating texinfo and many other "\
- "excellent programs.\n\n",
- MSG_ABOUT_THANKS2, (STRPTR) " The Betatesters: Kai Bolay, Frank Geider, Franz Hemmer, Jürgen Lang "\
- "(Quarvon), Christian Soltenborn and Volker Zink (The_Zinker)\n"\
- "\n"\
- " My friend Mathias Moersch for his help in the manual's english "\
- "translation: Spending nearly 6 years in the USA finally does some good!\n"\
- "\n"\
- " The people of #AmigaGer for answering many stupid questions and lots of "\
- "fun, for example PowerStat (Kai Hoffmann), ZZA (Bernhard Möllemann), "\
- "Stargazer (Petra Zeidler), stefanb (Stefan Becker), Tron (Mathias "\
- "Scheler) and ill (Markus Illenseer)\n"\
- "\n"\
- " Commodore for the Amiga and Kickstart V2.x. Keep on developing and I'll "\
- "be an Amiga-user the next 8 years too. :-)\n"\
- "\n"\
- " Douglas Adams and Tom Sharpe for creating Arthur Dent and Tom Sharpe. "\
- "My favourite (anti)-heroes!\n"\
- "\n"\
- " and to my parents for their bath-tub: There's no better place to think "\
- "about something ;-)",
- MSG_NO_BIRTHDAY, (STRPTR) "Player %s doesn't have a birthdate!\n"\
- "Please select an age-group or make another decision:",
- MSG_NO_BIRTHDAY_GADGETS, (STRPTR) "20 or younger|21-25|26 or older|Modify|Skip|Cancel",
- MSG_DWZ_TITLE, (STRPTR) "DWZ-Ratings",
- MSG_ABOUT_TITLE, (STRPTR) "Informations",
- MSG_ELO_OUTPUT, (STRPTR) "ELO",
- MSG_SENIOR_SHORT, (STRPTR) "S",
- MSG_JUNIOR_SHORT, (STRPTR) "J",
- MSG_WOMAN_SHORT, (STRPTR) "W",
- MSG_JUNIORA_SHORT, (STRPTR) "A",
- MSG_JUNIORB_SHORT, (STRPTR) "B",
- MSG_JUNIORC_SHORT, (STRPTR) "C",
- MSG_JUNIORD_SHORT, (STRPTR) "D",
- MSG_JUNIORE_SHORT, (STRPTR) "E",
- MSG_DATE_FORMAT, (STRPTR) "(dd.mm.yyyy)",
- KEY_PROJECT_LOAD, (STRPTR) "L",
- KEY_PROJECT_SAVE, (STRPTR) "S",
- KEY_PROJECT_SAVE_AS, (STRPTR) "A",
- KEY_PROJECT_ABOUT, (STRPTR) "I",
- KEY_PLAYERS_NEW, (STRPTR) "N",
- KEY_PLAYERS_MODIFY, (STRPTR) "M",
- WND_PLAYER_MODSEL_TITLE, (STRPTR) "Select a player to modify",
- MSG_TEXFILE_SELECTION, (STRPTR) "TeX-file-selection",
- MSG_NO_NEW_PLAYERS_ROUND_ROBIN, (STRPTR) "Games have already been paired.\nNo new players possible!",
- MSG_NO_NEW_PLAYERS_SWISS_PAIR, (STRPTR) "It isn't possible to enter new players,\nwhen round 1 is finished!",
- WND_PLAYER_MODIFY_TITLE, (STRPTR) "Player modification",
- WND_PLAYER_DELSEL_TITLE, (STRPTR) "Select a player to delete",
- MSG_NO_PLAYER_DELETE, (STRPTR) "No players may be deleted\n in a round robin tournament!",
- MSG_YES_NO_CANCEL, (STRPTR) "Yes|No|Cancel",
- WND_GAMESET_TITLE, (STRPTR) "Setting of games",
- BUTTON_DELETE_TITLE, (STRPTR) "Delete",
- BUTTON_DELETE_SC, (STRPTR) "d",
- MSG_ONEPOINTBYE_VERYSHORT, (STRPTR) "F",
- WND_ASCIIFILE_TITLE, (STRPTR) "Output file selection",
- WND_RNDSEL_TITLE, (STRPTR) "Round selection",
- WND_RNDSEL_TEXT, (STRPTR) "Please select a round number",
- ERRMSG_CANNOT_OPEN_WINDOW, (STRPTR) "Canot open window: %s",
- MUIERR_OK, (STRPTR) "Ok",
- MUIERR_OutOfMemory, (STRPTR) "Out of memory",
- MUIERR_OutOfGfxMemory, (STRPTR) "Out of chip memory",
- MUIERR_InvalidWindowObject, (STRPTR) "Invalid window object",
- MUIERR_MissingLibrary, (STRPTR) "Missing library",
- MUIERR_NoARexx, (STRPTR) "Cannot create ARexx port",
- MUIERR_SingleTask, (STRPTR) "Application is already running",
- MUIERR_Unknown, (STRPTR) "Unknown error",
- MSG_INVALID_ONEPOINTBYE, (STRPTR) "Number of active players is even:\n"\
- "No one point bye allowed.",
- MSG_INVALID_GAME, (STRPTR) "Players %s\n"\
- "and %s\n"\
- "have already been paired in round %ld.",
- MSG_INVALID_COLORS, (STRPTR) "Players %s\n"\
- "and %s\n"\
- "had %s pieces in the last two rounds.\n\n"\
- "Do you really want to pair them?",
- MSG_PLAYER_WITHDRAWN, (STRPTR) "Player %s has withdrawn\n"\
- "and cannot be set.",
- MSG_INVALID_PLAYER, (STRPTR) "Player %s is already set as\n"\
- "opponent of player %s.",
- MSG_HAD_ONEPOINTBYE, (STRPTR) "Player %s already\n"\
- "had an one point bye.",
- BUTTON_MODIFY_TITLE, (STRPTR) "Modify",
- BUTTON_MODIFY_SC, (STRPTR) "m",
- RADIO_RESULT_TITLE, (STRPTR) "Result",
- RADIO_MODE_TITLE, (STRPTR) "Mode",
- BUTTON_FINISH, (STRPTR) "Finish",
- BUTTON_FINISH_SC, (STRPTR) "f",
- CYCLE_CHAOSCOLORS, (STRPTR) "Chaos selects colors",
- CYCLE_USERCOLORS, (STRPTR) "User determines colors",
- MSG_COLORS_SET, (STRPTR) "(cd)",
- MSG_INVALID_COLOR, (STRPTR) "Player %s already had\n"\
- "the %s pieces in the last two rounds.\n"\
- "Do you really want this?",
- KEY_RESULT_WHITE, (STRPTR) "w",
- KEY_RESULT_DRAW, (STRPTR) "d",
- KEY_RESULT_BLACK, (STRPTR) "b",
- KEY_RESULT_MISSING, (STRPTR) "m",
- KEY_RESULT_PLAYED, (STRPTR) "p",
- KEY_RESULT_NPLAYED, (STRPTR) "n",
- MSG_PlayerExists, (STRPTR) "A player %s already exists.",
- BUTTONS_DELETE_THIS_PLAYER_REQUEST, (STRPTR) "Delete him|Skip him|Cancel",
- BUTTONS_THIS_PLAYER_GONE_REQUEST, (STRPTR) "Withdraw him|Skip him|Cancel",
- MSG_ImportPlayersWinTitle, (STRPTR) "Please select players to import",
- MSG_ImportPlayersOkButton, (STRPTR) "Import",
- MSG_ImportPlayersOkButtonSC, (STRPTR) "i",
- Button_Reverse, (STRPTR) "Reverse",
- Button_Reverse_SC, (STRPTR) "r",
- MSG_PrinterError, (STRPTR) "Cancelling output:\nPrinter trouble.",
- };
-
- static struct Catalog *Chaos_Catalog = NULL;
- static struct FC_Type *Chaos_OwnCatalog = NULL;
- static LONG Chaos_OwnStrings;
- static LONG Chaos_OwnBytes;
-
- void OpenChaosCatalog(struct Locale *loc, STRPTR language)
- { LONG tag, tagarg;
- extern struct Library *LocaleBase;
- extern struct Library *IFFParseBase;
-
- CloseChaosCatalog(); /* Not needed if the programmer pairs Open-()
- and CloseCatalog() right, but does no harm. */
- if (language == NULL)
- { tag = TAG_IGNORE;
- }
- else
- { tag = OC_Language;
- tagarg = (LONG) language;
- }
- if (LocaleBase != NULL && Chaos_Catalog == NULL)
- { Chaos_Catalog = OpenCatalog(loc, (STRPTR) "Chaos.catalog",
- OC_BuiltInLanguage, Chaos_BuiltInLanguage,
- tag, tagarg,
- OC_Version, Chaos_Version,
- TAG_DONE);
- }
- if (LocaleBase == NULL && IFFParseBase != NULL && language != NULL &&
- Stricmp(language, Chaos_BuiltInLanguage) != 0)
- { struct IFFHandle *iffhandle;
- char path[128]; /* Enough to hold 4 path items (dos.library 3.0) */
-
- if ((iffhandle = AllocIFF()) != NULL)
- { /* Trying to open the catalog */
- strcpy(path, "Catalogs");
- AddPart((STRPTR) path, language, sizeof(path));
- AddPart((STRPTR) path, (STRPTR) "Chaos.catalog", sizeof(path));
- if ((iffhandle->iff_Stream = Open((STRPTR) path, MODE_OLDFILE))
- == NULL)
- { strcpy(path, "Locale:Catalogs");
- AddPart((STRPTR) path, language, sizeof(path));
- AddPart((STRPTR) path, (STRPTR) "Chaos.catalog", sizeof(path));
- iffhandle->iff_Stream = Open((STRPTR) path, MODE_OLDFILE);
- }
-
- if (iffhandle->iff_Stream)
- { InitIFFasDOS(iffhandle);
- if (!OpenIFF(iffhandle, IFFF_READ))
- { if (!PropChunk(iffhandle, MAKE_ID('C','T','L','G'),
- MAKE_ID('S','T','R','S')))
- { struct StoredProperty *sp;
- int error;
-
- for (;;)
- { if ((error = ParseIFF(iffhandle, IFFPARSE_STEP))
- == IFFERR_EOC)
- { continue;
- }
- if (error != 0)
- { break;
- }
-
- if (sp = FindProp(iffhandle, MAKE_ID('C','T','L','G'),
- MAKE_ID('S','T','R','S')))
- { LONG *ptr;
- LONG BytesToScan, StrLength;
-
- /* First scan: Check the number of strings */
- /* Note that this assumes that the strings are padded */
- /* to a longword boundary! */
- Chaos_OwnBytes = 0;
- Chaos_OwnStrings = 0;
- BytesToScan = sp->sp_Size;
- ptr = sp->sp_Data;
- while (BytesToScan > 0)
- { ++Chaos_OwnStrings;
- ++ptr; /* Skip ID */
- StrLength = *ptr+1; /* NUL-Byte! */
- Chaos_OwnBytes += StrLength;
- ptr += 1+(StrLength+3)/4; /* Skip Length and String*/
- BytesToScan -= 8+((StrLength+3)/4)*4;
- }
-
- /* Marginal check: BytesToScan has to be 0! */
- if (BytesToScan == 0)
- { char *cptr;
- LONG i;
-
- if (Chaos_OwnCatalog = (struct FC_Type *)
- AllocMem(Chaos_OwnStrings*sizeof(struct FC_Type)+Chaos_OwnBytes,
- MEMF_ANY))
- { /* Second scan: Copy the strings and their ID's */
- cptr = (char *) &Chaos_OwnCatalog[Chaos_OwnStrings];
- BytesToScan = sp->sp_Size;
- ptr = sp->sp_Data;
- i = 0;
- while (BytesToScan > 0)
- { Chaos_OwnCatalog[i].ID = *(ptr++);
- Chaos_OwnCatalog[i].Str = (STRPTR) cptr;
- StrLength = *ptr+1; /* NUL-Byte! */
- ptr++;
- strncpy(cptr, (char *) ptr, StrLength);
- /* Not more, not less bytes! */
- cptr+=StrLength;
- ptr += (StrLength+3)/4;
- BytesToScan -= 8+((StrLength+3)/4)*4;
- ++i;
- }
- break;
- }
- }
- }
- }
- }
- CloseIFF(iffhandle);
- }
- Close(iffhandle->iff_Stream);
- }
-
- FreeIFF(iffhandle);
- }
- }
- }
-
-
- void CloseChaosCatalog(void)
- { if (LocaleBase != NULL)
- { CloseCatalog(Chaos_Catalog);
- }
- Chaos_Catalog = NULL;
- if (Chaos_OwnCatalog != NULL)
- { FreeMem(Chaos_OwnCatalog,
- Chaos_OwnStrings*sizeof(struct FC_Type)+Chaos_OwnBytes);
- Chaos_OwnCatalog = NULL;
- }
- }
-
-
- STRPTR GetChaosString(LONG strnum)
- { STRPTR defaultstr = NULL;
- LONG i;
-
- for (i = 0; i < sizeof(Chaos_Array)/sizeof(struct FC_Type); i++)
- { if (Chaos_Array[i].ID == strnum)
- { defaultstr = Chaos_Array[i].Str;
- break;
- }
- }
- if (Chaos_Catalog == NULL)
- { if (Chaos_OwnCatalog != NULL)
- { for (i = 0; i < Chaos_OwnStrings; i++)
- { if (Chaos_OwnCatalog[i].ID == strnum)
- { return(Chaos_OwnCatalog[i].Str);
- }
- }
- }
- return(defaultstr);
- }
- return(GetCatalogStr(Chaos_Catalog, strnum, defaultstr));
- }
-