home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / game / think / chaos / src / chaos_cat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-27  |  19.8 KB  |  496 lines

  1. /****************************************************************
  2.    This file was created automatically by `FlexCat V1.0'
  3.    Do NOT edit by hand!
  4. ****************************************************************/
  5.  
  6. #ifndef Chaos_CAT_H
  7. #include "Chaos_CAT.h"
  8. #endif    /*  !Chaos_CAT_H         */
  9.  
  10. #include <string.h>
  11.  
  12. #ifndef EXEC_MEMORY_H
  13. #include <exec/memory.h>
  14. #endif    /*  !EXEC_MEMORY_H        */
  15. #ifndef LIBRARIES_IFFPARSE_H
  16. #include <libraries/iffparse.h>
  17. #endif    /*  !LIBRARIES_IFFPARSE_H   */
  18.  
  19. #ifndef CLIB_IFFPARSE_PROTOS_H
  20. #include <clib/iffparse_protos.h>
  21. #endif    /*  !CLIB_IFFPARSE_PROTOS_H */
  22. #ifndef CLIB_LOCALE_PROTOS_H
  23. #include <clib/locale_protos.h>
  24. #endif    /*  !CLIB_LOCALE_PROTOS_H   */
  25. #ifndef CLIB_DOS_PROTOS_H
  26. #include <clib/dos_protos.h>
  27. #endif    /*  !DOS_PROTOS_H        */
  28. #ifndef CLIB_EXEC_PROTOS_H
  29. #include <clib/exec_protos.h>
  30. #endif    /*  !EXEC_PROTOS_H        */
  31. #ifndef CLIB_UTILITY_PROTOS_H
  32. #include <clib/utility_protos.h>
  33. #endif    /*  !CLIB_UTILITY_PROTOS_H  */
  34.  
  35. #ifdef AZTEC_C
  36. #ifndef __PRAGMAS_LOCALE_LIB_H
  37. #include <pragmas/locale_lib.h>
  38. #endif    /*  !PRAGMAS_LOCALE_LIB_H   */
  39. #ifndef __PRAGMAS_IFFPARSE_LIB_H
  40. #include <pragmas/iffparse_lib.h>
  41. #endif    /*  !PRAGMAS_IFFPARSE_LIB_H */
  42. #ifndef __PRAGMAS_DOS_LIB_H
  43. #include <pragmas/dos_lib.h>
  44. #endif    /*  !PRAGMAS_DOS_LIB_H        */
  45. #ifndef __PRAGMAS_EXEC_LIB_H
  46. #include <pragmas/exec_lib.h>
  47. #endif    /*  !PRAGMAS_EXEC_LIB_H     */
  48. #ifndef __PRAGMAS_UTILITY_LIB_H
  49. #include <pragmas/utility_lib.h>
  50. #endif    /*  !PRAGMAS_UTILITY_LIB_H  */
  51. #endif    /*  AZTEC_C            */
  52.  
  53. static LONG Chaos_Version = 8;
  54. static const STRPTR Chaos_BuiltInLanguage = (STRPTR) "english";
  55.  
  56. struct FC_Type
  57. {   LONG    ID;
  58.     STRPTR  Str;
  59. };
  60.  
  61. static const struct FC_Type Chaos_Array [] =
  62. {
  63.     MSG_CDAT_SELECTION, (STRPTR) "Tournamentfile-selection",
  64.     MSG_NO_WRITE_FILE, (STRPTR) "Cannot open %s as write-file!\nDOS-Error %ld",
  65.     MSG_WRITE_ERROR, (STRPTR) "DOS-Error %ld while writing %s!",
  66.     MSG_NO_READ_FILE, (STRPTR) "Cannot open %s as read-file!\nDOS-Error %ld",
  67.     MSG_NO_CHAOS_FILE, (STRPTR) "%s is no Chaos-V5-file!",
  68.     MSG_READ_ERROR, (STRPTR) "DOS-Error %ld while reading %s!",
  69.     MSG_ATTENTION, (STRPTR) "Attention!",
  70.     MSG_CHANGES_MADE, (STRPTR) "Changes have been made!\nDo you want to save the tournament first?",
  71.     MSG_YES_NO, (STRPTR) "Yes|No",
  72.     MSG_NO_TOURNAMENT_INPUT_WINDOW, (STRPTR) "Cannot open Tournament-input-window!",
  73.     MSG_NO_PAIRING, (STRPTR) "No pairings possible!\nToo much rounds?",
  74.     MSG_NO_PRINTER, (STRPTR) "Cannot connect to printer!",
  75.     MSG_PAGENR, (STRPTR) "Page",
  76.     MSG_NAME_OUTPUT, (STRPTR) "Name",
  77.     MSG_DWZ_OUTPUT, (STRPTR) "Rating",
  78.     MSG_CHESSCLUB_OUTPUT, (STRPTR) "Chess-club",
  79.     MSG_STREET_OUTPUT, (STRPTR) "Home",
  80.     MSG_VILLAGE_OUTPUT, (STRPTR) "Address",
  81.     MSG_BIRTHDAY_OUTPUT, (STRPTR) "Birthday",
  82.     MSG_PHONE_OUTPUT, (STRPTR) "Phone",
  83.     MSG_PLAYER_LIST_TITLE, (STRPTR) "List of players",
  84.     MSG_RESULT_OUTPUT, (STRPTR) "Result",
  85.     MSG_WHITE_OUTPUT, (STRPTR) "White",
  86.     MSG_BLACK_OUTPUT, (STRPTR) "Black",
  87.     MSG_ROUND_TITLE, (STRPTR) "Games of round %ld",
  88.     MSG_PLACE_OUTPUT, (STRPTR) "Place",
  89.     MSG_POINTS_OUTPUT, (STRPTR) "Points",
  90.     MSG_BUCHHOLZ_OUTPUT, (STRPTR) "Buchholz",
  91.     MSG_EXT_BUCHHOLZ_OUTPUT, (STRPTR) "Ext.Bchh.",
  92.     MSG_SONNEBORN_BERGER_OUTPUT, (STRPTR) "SnnBrgr.",
  93.     MSG_TABLE_TITLE, (STRPTR) "Table of round %ld %s",
  94.     MSG_TABLE_TITLE2, (STRPTR) "Table %s",
  95.     MSG_RANKINGS_TITLE, (STRPTR) "Ratings",
  96.     MSG_NUMBER, (STRPTR) "Nr.",
  97.     MSG_RANKINGS_TITLE2, (STRPTR) "List of rankings (round %ld)",
  98.     MSG_PROGRESS_TABLE_TITLE, (STRPTR) "Table of progress until round %ld",
  99.     MSG_GAME_OUTPUT, (STRPTR) "Opponent (Nr., Result, Color)",
  100.     MSG_FREE_GAME_OUTPUT, (STRPTR) "    free",
  101.     MSG_GONE_OUTPUT, (STRPTR) " dropped",
  102.     MSG_FREE_POINT_OUTPUT, (STRPTR) "1 p. bye",
  103.     MSG_FREE_GAME_OUTPUT2, (STRPTR) "free",
  104.     MSG_NO_FIGHT_OUTPUT, (STRPTR) "(np)",
  105.     MSG_ROUND_INPUT_TITLE, (STRPTR) "Input of games (round %ld)",
  106.     MSG_NEW_PLAYER_REQUEST, (STRPTR) "Games have already been paired!\nDo you really want to add new players?",
  107.     MSG_MODIFY_PLAYER_REQUEST, (STRPTR) "Games have already been paired!\nDo you really want to modify players?",
  108.     MSG_DELETE_PLAYER_REQUEST, (STRPTR) "Games have already been paired!\nDo you really want to delete players?\n"\
  109.     "(Mark them as withdrawn.)",
  110.     MSG_DELETE_THIS_PLAYER_REQUEST, (STRPTR) "Do you really want to delete\nthe player %s?",
  111.     MSG_THIS_PLAYER_GONE_REQUEST, (STRPTR) "Do you really want to mark\n%s as withdrawn?",
  112.     MSG_DONT_CARE_REQUEST_TITLE, (STRPTR) "Don't care!",
  113.     MSG_DONT_CARE_REQUEST, (STRPTR) "Player %s\nhas already been marked as withdrawn!",
  114.     MSG_OK, (STRPTR) "Ok",
  115.     MSG_OK_SC, (STRPTR) "o",
  116.     MSG_ERROR_REQUEST, (STRPTR) "Error!",
  117.     MSG_MEMORY_ERROR, (STRPTR) "Out of memory!",
  118.     MSG_SWISS_PAIRING, (STRPTR) "Swiss pairing",
  119.     MSG_RUNDENTURNIER, (STRPTR) "Round Robin (FIDE-system)",
  120.     MSG_RUTSCHSYSTEM, (STRPTR) "Round Robin (shift-system)",
  121.     MSG_TOURNAMENT_INPUT_TITLE, (STRPTR) "Input of tournament-data",
  122.     WND_PLAYER_ADD_TITLE, (STRPTR) "Input of new players",
  123.     MSG_WHITE_WINS_INPUT, (STRPTR) "\033uW\033nhite wins",
  124.     MSG_DRAW_INPUT, (STRPTR) "\033uD\033nraw",
  125.     MSG_BLACK_WINS_INPUT, (STRPTR) "\033uB\033nlack wins",
  126.     MSG_RESULT_MISSING_INPUT, (STRPTR) "Result \033u\033nmissing",
  127.     MSG_AUSGETRAGEN_INPUT, (STRPTR) "\033uP\033nlayed",
  128.     MSG_KAMPFLOS_INPUT, (STRPTR) "\033uN\033not played",
  129.     MSG_TOURNAMENT_MENU, (STRPTR) "Project",
  130.     MSG_TOURNAMENT_NEW_ITEM, (STRPTR) "New",
  131.     MSG_TOURNAMENT_LOAD_ITEM, (STRPTR) "Load",
  132.     MSG_TOURNAMENT_SAVE_ITEM, (STRPTR) "Save",
  133.     MSG_TOURNAMENT_SAVEAS_ITEM, (STRPTR) "Save as",
  134.     MSG_TOURNAMENT_ABOUT_ITEM, (STRPTR) "About",
  135.     MSG_TOURNAMENT_QUIT_ITEM, (STRPTR) "Quit",
  136.     MSG_PLAYER_MENU, (STRPTR) "Players",
  137.     MSG_PLAYER_ADD_ITEM, (STRPTR) "Add",
  138.     MSG_PLAYER_IMPORT_ITEM, (STRPTR) "Import",
  139.     MSG_PLAYER_MODIFY_ITEM, (STRPTR) "Modify",
  140.     MSG_PLAYER_DELETE_ITEM, (STRPTR) "Delete",
  141.     MSG_ROUND_MENU, (STRPTR) "Round",
  142.     MSG_ROUND_PAIRINGS_ITEM, (STRPTR) "Make pairings",
  143.     MSG_ROUND_PAIRINGS_SWISS_SUB, (STRPTR) "Swiss pairing",
  144.     MSG_ROUND_PAIRINGS_RROBIN_SUB, (STRPTR) "Round Robin (FIDE-system)",
  145.     MSG_ROUND_PAIRINGS_SLIDE_SUB, (STRPTR) "Round Robin (shift-system)",
  146.     MSG_ROUND_RESULTS_ITEM, (STRPTR) "Enter results",
  147.     MSG_OUTPUT_MENU, (STRPTR) "Output",
  148.     MSG_OUTPUT_PLAYERS_ITEM, (STRPTR) "Player-list",
  149.     MSG_OUTPUT_PLAYERS_SHORT_SUB, (STRPTR) "short",
  150.     MSG_OUTPUT_PLAYERS_LONG_SUB, (STRPTR) "long",
  151.     MSG_OUTPUT_RANKINGS_ITEM, (STRPTR) "Rankings",
  152.     MSG_OUTPUT_ROUND_ITEM, (STRPTR) "Round",
  153.     MSG_OUTPUT_TABLE_ITEM, (STRPTR) "Table",
  154.     MSG_OUTPUT_TABLE_ALL_SUB, (STRPTR) "All",
  155.     MSG_OUTPUT_TABLE_SENIORS_SUB, (STRPTR) "Seniors",
  156.     MSG_OUTPUT_TABLE_JUNIORS_SUB, (STRPTR) "Juniors",
  157.     MSG_OUTPUT_TABLE_WOMEN_SUB, (STRPTR) "Women",
  158.     MSG_OUTPUT_TABLE_JUNIORSA_SUB, (STRPTR) "Juniors (A)",
  159.     MSG_OUTPUT_TABLE_JUNIORSB_SUB, (STRPTR) "Juniors (B)",
  160.     MSG_OUTPUT_TABLE_JUNIORSC_SUB, (STRPTR) "Juniors (C)",
  161.     MSG_OUTPUT_TABLE_JUNIORSD_SUB, (STRPTR) "Juniors (D)",
  162.     MSG_OUTPUT_TABLE_JUNIORSE_SUB, (STRPTR) "Juniors (E)",
  163.     MSG_OUTPUT_PROGRESSTABLE_ITEM, (STRPTR) "Table of progress",
  164.     MSG_OUTPUT_DWZ_ITEM, (STRPTR) "DWZ-report",
  165.     MSG_OUTPUT_CROSSTABLE_ITEM, (STRPTR) "Cross-table",
  166.     MSG_OUTPUT_CROSSTABLE_ASC_SUB, (STRPTR) "Ascii",
  167.     MSG_OUTPUT_CROSSTABLE_TEX_SUB, (STRPTR) "TeX",
  168.     MSG_OUTPUT_PLAYERCARDS_ITEM, (STRPTR) "Player-cards",
  169.     MSG_OUTPUT_PLAYERCARDS_ASC_SUB, (STRPTR) "Ascii",
  170.     MSG_OUTPUT_PLAYERCARDS_TEX_SUB, (STRPTR) "TeX",
  171.     MSG_PREFS_MENU, (STRPTR) "Preferences",
  172.     MSG_PREFS_TMODE_ITEM, (STRPTR) "scoring",
  173.     MSG_PREFS_TMODE_SIMPLE_SUB, (STRPTR) "Simple",
  174.     MSG_PREFS_TMODE_BUCHHOLZ_SUB, (STRPTR) "Buchholz",
  175.     MSG_PREFS_TMODE_EXTBCHHLZ_SUB, (STRPTR) "Buchholz (extended)",
  176.     MSG_PREFS_TMODE_SONNEBORN_SUB, (STRPTR) "Sonneborn-Berger",
  177.     MSG_PREFS_OUT_ITEM, (STRPTR) "Output-Device",
  178.     MSG_PREFS_OUT_SCREEN_SUB, (STRPTR) "Screen",
  179.     MSG_PREFS_OUT_PRTDRAFT_SUB, (STRPTR) "Printer (Draft)",
  180.     MSG_PREFS_OUT_PRTLQ_SUB, (STRPTR) "Printer (LQ)",
  181.     MSG_PREFS_OUT_FILE_SUB, (STRPTR) "File",
  182.     MSG_PREFS_SETGAMES, (STRPTR) "Set Games",
  183.     MSG_PREFS_MAKEICONS_ITEM, (STRPTR) "Make icons",
  184.     MSG_PREFS_SAVEWINDOWSETTINGS, (STRPTR) "Save window settings",
  185.     MSG_SPECIAL_MENU, (STRPTR) "Special",
  186.     MSG_NUM_PLAYERS_OUTPUT, (STRPTR) "Players:",
  187.     MSG_NUM_ROUNDS_OUTPUT, (STRPTR) "Rounds:",
  188.     MSG_TOURNAMENT_NAME_OUTPUT, (STRPTR) "Tournamentname:",
  189.     MSG_TOURNAMENT_FILE_OUTPUT, (STRPTR) "Tournamentfile:",
  190.     MSG_TOURNAMENT_MODE_OUTPUT, (STRPTR) "Tournamentmode:",
  191.     MSG_CANCEL_INPUT, (STRPTR) "Cancel",
  192.     MSG_CANCEL_SC, (STRPTR) "c",
  193.     MSG_OK_INPUT, (STRPTR) "Ok",
  194.     MSG_TOURNAMENT_NAME_INPUT, (STRPTR) "Tournamentname",
  195.     MSG_NAME_INPUT, (STRPTR) "Name",
  196.     MSG_STREET_INPUT, (STRPTR) "Home",
  197.     MSG_VILLAGE_INPUT, (STRPTR) "Address",
  198.     MSG_CHESS_CLUB_INPUT, (STRPTR) "Chess-club",
  199.     MSG_PHONE_INPUT, (STRPTR) "Phone",
  200.     MSG_BIRTHDAY_INPUT, (STRPTR) "Birthday",
  201.     MSG_DWZ_INPUT, (STRPTR) "Rating",
  202.     MSG_ELO_INPUT, (STRPTR) "ELO",
  203.     MSG_SENIORS_INPUT, (STRPTR) "Senior",
  204.     MSG_JUNIORS_INPUT, (STRPTR) "Junior",
  205.     MSG_WOMEN_INPUT, (STRPTR) "Woman",
  206.     MSG_JUNIORSA_INPUT, (STRPTR) "Junior (A)",
  207.     MSG_JUNIORSB_INPUT, (STRPTR) "Junior (B)",
  208.     MSG_JUNIORSC_INPUT, (STRPTR) "Junior (C)",
  209.     MSG_JUNIORSD_INPUT, (STRPTR) "Junior (D)",
  210.     MSG_JUNIORSE_INPUT, (STRPTR) "Junior (E)",
  211.     MSG_MISSING_PLAYER_NAME, (STRPTR) "Players name is missing!",
  212.     MSG_BIRTHDAY_ERROR, (STRPTR) "Error in birthday of player %s!",
  213.     MSG_ABOUT_PERMISSION, (STRPTR) "This program is governed by the terms and conditions of the GNU General "\
  214.     "Public License. A copy should have come with this distribution. (See the "\
  215.     "file COPYING.) In that license it is made clear that you are welcome to "\
  216.     "redistribute either verbatim or modified copies of the program and the "\
  217.     "documentation under certain conditions. Further you are told that this "\
  218.     "program comes with ABSOLUTELY NO WARRANTY!\n\n\n",
  219.     MSG_ABOUT_THANKS1, (STRPTR) "My thanks go to\n"\
  220.     "\n"\
  221.     "    Stefan Stuntz for MUI. Finally the user interface should be satisfying "\
  222.     "for everyone.\n"\
  223.     "\n"\
  224.     "    Reinhard Spisser and Sebastiano Vigna for the Amiga-version of texinfo. "\
  225.     "The documentation is written using this.\n"\
  226.     "\n"\
  227.     "    The Free Software Foundation for creating texinfo and many other "\
  228.     "excellent programs.\n\n",
  229.     MSG_ABOUT_THANKS2, (STRPTR) "    The Betatesters: Kai Bolay, Frank Geider, Franz Hemmer, Jürgen Lang "\
  230.     "(Quarvon), Christian Soltenborn and Volker Zink (The_Zinker)\n"\
  231.     "\n"\
  232.     "    My friend Mathias Moersch for his help in the manual's english "\
  233.     "translation: Spending nearly 6 years in the USA finally does some good!\n"\
  234.     "\n"\
  235.     "    The people of #AmigaGer for answering many stupid questions and lots of "\
  236.     "fun, for example PowerStat (Kai Hoffmann), ZZA (Bernhard Möllemann), "\
  237.     "Stargazer (Petra Zeidler), stefanb (Stefan Becker), Tron (Mathias "\
  238.     "Scheler) and ill (Markus Illenseer)\n"\
  239.     "\n"\
  240.     "    Commodore for the Amiga and Kickstart V2.x. Keep on developing and I'll "\
  241.     "be an Amiga-user the next 8 years too. :-)\n"\
  242.     "\n"\
  243.     "    Douglas Adams and Tom Sharpe for creating Arthur Dent and Tom Sharpe. "\
  244.     "My favourite (anti)-heroes!\n"\
  245.     "\n"\
  246.     "    and to my parents for their bath-tub: There's no better place to think "\
  247.     "about something ;-)",
  248.     MSG_NO_BIRTHDAY, (STRPTR) "Player %s doesn't have a birthdate!\n"\
  249.     "Please select an age-group or make another decision:",
  250.     MSG_NO_BIRTHDAY_GADGETS, (STRPTR) "20 or younger|21-25|26 or older|Modify|Skip|Cancel",
  251.     MSG_DWZ_TITLE, (STRPTR) "DWZ-Ratings",
  252.     MSG_ABOUT_TITLE, (STRPTR) "Informations",
  253.     MSG_ELO_OUTPUT, (STRPTR) "ELO",
  254.     MSG_SENIOR_SHORT, (STRPTR) "S",
  255.     MSG_JUNIOR_SHORT, (STRPTR) "J",
  256.     MSG_WOMAN_SHORT, (STRPTR) "W",
  257.     MSG_JUNIORA_SHORT, (STRPTR) "A",
  258.     MSG_JUNIORB_SHORT, (STRPTR) "B",
  259.     MSG_JUNIORC_SHORT, (STRPTR) "C",
  260.     MSG_JUNIORD_SHORT, (STRPTR) "D",
  261.     MSG_JUNIORE_SHORT, (STRPTR) "E",
  262.     MSG_DATE_FORMAT, (STRPTR) "(dd.mm.yyyy)",
  263.     KEY_PROJECT_LOAD, (STRPTR) "L",
  264.     KEY_PROJECT_SAVE, (STRPTR) "S",
  265.     KEY_PROJECT_SAVE_AS, (STRPTR) "A",
  266.     KEY_PROJECT_ABOUT, (STRPTR) "I",
  267.     KEY_PLAYERS_NEW, (STRPTR) "N",
  268.     KEY_PLAYERS_MODIFY, (STRPTR) "M",
  269.     WND_PLAYER_MODSEL_TITLE, (STRPTR) "Select a player to modify",
  270.     MSG_TEXFILE_SELECTION, (STRPTR) "TeX-file-selection",
  271.     MSG_NO_NEW_PLAYERS_ROUND_ROBIN, (STRPTR) "Games have already been paired.\nNo new players possible!",
  272.     MSG_NO_NEW_PLAYERS_SWISS_PAIR, (STRPTR) "It isn't possible to enter new players,\nwhen round 1 is finished!",
  273.     WND_PLAYER_MODIFY_TITLE, (STRPTR) "Player modification",
  274.     WND_PLAYER_DELSEL_TITLE, (STRPTR) "Select a player to delete",
  275.     MSG_NO_PLAYER_DELETE, (STRPTR) "No players may be deleted\n in a round robin tournament!",
  276.     MSG_YES_NO_CANCEL, (STRPTR) "Yes|No|Cancel",
  277.     WND_GAMESET_TITLE, (STRPTR) "Setting of games",
  278.     BUTTON_DELETE_TITLE, (STRPTR) "Delete",
  279.     BUTTON_DELETE_SC, (STRPTR) "d",
  280.     MSG_ONEPOINTBYE_VERYSHORT, (STRPTR) "F",
  281.     WND_ASCIIFILE_TITLE, (STRPTR) "Output file selection",
  282.     WND_RNDSEL_TITLE, (STRPTR) "Round selection",
  283.     WND_RNDSEL_TEXT, (STRPTR) "Please select a round number",
  284.     ERRMSG_CANNOT_OPEN_WINDOW, (STRPTR) "Canot open window: %s",
  285.     MUIERR_OK, (STRPTR) "Ok",
  286.     MUIERR_OutOfMemory, (STRPTR) "Out of memory",
  287.     MUIERR_OutOfGfxMemory, (STRPTR) "Out of chip memory",
  288.     MUIERR_InvalidWindowObject, (STRPTR) "Invalid window object",
  289.     MUIERR_MissingLibrary, (STRPTR) "Missing library",
  290.     MUIERR_NoARexx, (STRPTR) "Cannot create ARexx port",
  291.     MUIERR_SingleTask, (STRPTR) "Application is already running",
  292.     MUIERR_Unknown, (STRPTR) "Unknown error",
  293.     MSG_INVALID_ONEPOINTBYE, (STRPTR) "Number of active players is even:\n"\
  294.     "No one point bye allowed.",
  295.     MSG_INVALID_GAME, (STRPTR) "Players %s\n"\
  296.     "and %s\n"\
  297.     "have already been paired in round %ld.",
  298.     MSG_INVALID_COLORS, (STRPTR) "Players %s\n"\
  299.     "and %s\n"\
  300.     "had %s pieces in the last two rounds.\n\n"\
  301.     "Do you really want to pair them?",
  302.     MSG_PLAYER_WITHDRAWN, (STRPTR) "Player %s has withdrawn\n"\
  303.     "and cannot be set.",
  304.     MSG_INVALID_PLAYER, (STRPTR) "Player %s is already set as\n"\
  305.     "opponent of player %s.",
  306.     MSG_HAD_ONEPOINTBYE, (STRPTR) "Player %s already\n"\
  307.     "had an one point bye.",
  308.     BUTTON_MODIFY_TITLE, (STRPTR) "Modify",
  309.     BUTTON_MODIFY_SC, (STRPTR) "m",
  310.     RADIO_RESULT_TITLE, (STRPTR) "Result",
  311.     RADIO_MODE_TITLE, (STRPTR) "Mode",
  312.     BUTTON_FINISH, (STRPTR) "Finish",
  313.     BUTTON_FINISH_SC, (STRPTR) "f",
  314.     CYCLE_CHAOSCOLORS, (STRPTR) "Chaos selects colors",
  315.     CYCLE_USERCOLORS, (STRPTR) "User determines colors",
  316.     MSG_COLORS_SET, (STRPTR) "(cd)",
  317.     MSG_INVALID_COLOR, (STRPTR) "Player %s already had\n"\
  318.     "the %s pieces in the last two rounds.\n"\
  319.     "Do you really want this?",
  320.     KEY_RESULT_WHITE, (STRPTR) "w",
  321.     KEY_RESULT_DRAW, (STRPTR) "d",
  322.     KEY_RESULT_BLACK, (STRPTR) "b",
  323.     KEY_RESULT_MISSING, (STRPTR) "m",
  324.     KEY_RESULT_PLAYED, (STRPTR) "p",
  325.     KEY_RESULT_NPLAYED, (STRPTR) "n",
  326.     MSG_PlayerExists, (STRPTR) "A player %s already exists.",
  327.     BUTTONS_DELETE_THIS_PLAYER_REQUEST, (STRPTR) "Delete him|Skip him|Cancel",
  328.     BUTTONS_THIS_PLAYER_GONE_REQUEST, (STRPTR) "Withdraw him|Skip him|Cancel",
  329.     MSG_ImportPlayersWinTitle, (STRPTR) "Please select players to import",
  330.     MSG_ImportPlayersOkButton, (STRPTR) "Import",
  331.     MSG_ImportPlayersOkButtonSC, (STRPTR) "i",
  332.     Button_Reverse, (STRPTR) "Reverse",
  333.     Button_Reverse_SC, (STRPTR) "r",
  334.     MSG_PrinterError, (STRPTR) "Cancelling output:\nPrinter trouble.",
  335. };
  336.  
  337. static struct Catalog *Chaos_Catalog = NULL;
  338. static struct FC_Type *Chaos_OwnCatalog = NULL;
  339. static LONG Chaos_OwnStrings;
  340. static LONG Chaos_OwnBytes;
  341.  
  342. void OpenChaosCatalog(struct Locale *loc, STRPTR language)
  343. { LONG tag, tagarg;
  344.   extern struct Library *LocaleBase;
  345.   extern struct Library *IFFParseBase;
  346.  
  347.   CloseChaosCatalog();  /*  Not needed if the programmer pairs Open-()
  348.              and CloseCatalog() right, but does no harm. */
  349.   if (language == NULL)
  350.   { tag = TAG_IGNORE;
  351.   }
  352.   else
  353.   { tag = OC_Language;
  354.     tagarg = (LONG) language;
  355.   }
  356.   if (LocaleBase != NULL  &&  Chaos_Catalog == NULL)
  357.   { Chaos_Catalog = OpenCatalog(loc, (STRPTR) "Chaos.catalog",
  358.                  OC_BuiltInLanguage, Chaos_BuiltInLanguage,
  359.                  tag, tagarg,
  360.                  OC_Version, Chaos_Version,
  361.                  TAG_DONE);
  362.   }
  363.   if (LocaleBase == NULL  &&  IFFParseBase != NULL  &&  language != NULL  &&
  364.       Stricmp(language, Chaos_BuiltInLanguage) != 0)
  365.   { struct IFFHandle *iffhandle;
  366.     char path[128]; /*    Enough to hold 4 path items (dos.library 3.0)  */
  367.  
  368.     if ((iffhandle = AllocIFF())  !=  NULL)
  369.     { /*  Trying to open the catalog  */
  370.       strcpy(path, "Catalogs");
  371.       AddPart((STRPTR) path, language, sizeof(path));
  372.       AddPart((STRPTR) path, (STRPTR) "Chaos.catalog", sizeof(path));
  373.       if ((iffhandle->iff_Stream = Open((STRPTR) path, MODE_OLDFILE))
  374.                  ==  NULL)
  375.       { strcpy(path, "Locale:Catalogs");
  376.     AddPart((STRPTR) path, language, sizeof(path));
  377.     AddPart((STRPTR) path, (STRPTR) "Chaos.catalog", sizeof(path));
  378.     iffhandle->iff_Stream = Open((STRPTR) path, MODE_OLDFILE);
  379.       }
  380.  
  381.       if (iffhandle->iff_Stream)
  382.       { InitIFFasDOS(iffhandle);
  383.     if (!OpenIFF(iffhandle, IFFF_READ))
  384.     { if (!PropChunk(iffhandle, MAKE_ID('C','T','L','G'),
  385.              MAKE_ID('S','T','R','S')))
  386.       { struct StoredProperty *sp;
  387.         int error;
  388.  
  389.         for (;;)
  390.         { if ((error = ParseIFF(iffhandle, IFFPARSE_STEP))
  391.              ==  IFFERR_EOC)
  392.           { continue;
  393.           }
  394.           if (error != 0)
  395.           { break;
  396.           }
  397.  
  398.           if (sp = FindProp(iffhandle, MAKE_ID('C','T','L','G'),
  399.                 MAKE_ID('S','T','R','S')))
  400.           { LONG *ptr;
  401.         LONG BytesToScan, StrLength;
  402.  
  403.         /*  First scan: Check the number of strings        */
  404.         /*  Note that this assumes that the strings are padded    */
  405.         /*  to a longword boundary!                */
  406.         Chaos_OwnBytes = 0;
  407.         Chaos_OwnStrings = 0;
  408.         BytesToScan = sp->sp_Size;
  409.         ptr = sp->sp_Data;
  410.         while (BytesToScan > 0)
  411.         { ++Chaos_OwnStrings;
  412.           ++ptr;              /*  Skip ID        */
  413.           StrLength = *ptr+1;          /*  NUL-Byte!        */
  414.           Chaos_OwnBytes += StrLength;
  415.           ptr += 1+(StrLength+3)/4;   /*  Skip Length and String*/
  416.           BytesToScan -= 8+((StrLength+3)/4)*4;
  417.         }
  418.  
  419.         /*  Marginal check: BytesToScan has to be 0!        */
  420.         if (BytesToScan == 0)
  421.         { char *cptr;
  422.           LONG i;
  423.  
  424.           if (Chaos_OwnCatalog = (struct FC_Type *)
  425.               AllocMem(Chaos_OwnStrings*sizeof(struct FC_Type)+Chaos_OwnBytes,
  426.                    MEMF_ANY))
  427.           { /*    Second scan: Copy the strings and their ID's    */
  428.             cptr = (char *) &Chaos_OwnCatalog[Chaos_OwnStrings];
  429.             BytesToScan = sp->sp_Size;
  430.             ptr = sp->sp_Data;
  431.             i = 0;
  432.             while (BytesToScan > 0)
  433.             { Chaos_OwnCatalog[i].ID = *(ptr++);
  434.               Chaos_OwnCatalog[i].Str = (STRPTR) cptr;
  435.               StrLength = *ptr+1;     /*  NUL-Byte!        */
  436.               ptr++;
  437.               strncpy(cptr, (char *) ptr, StrLength);
  438.                     /*  Not more, not less bytes!    */
  439.               cptr+=StrLength;
  440.               ptr += (StrLength+3)/4;
  441.               BytesToScan -= 8+((StrLength+3)/4)*4;
  442.               ++i;
  443.             }
  444.             break;
  445.           }
  446.         }
  447.           }
  448.         }
  449.       }
  450.       CloseIFF(iffhandle);
  451.     }
  452.     Close(iffhandle->iff_Stream);
  453.       }
  454.  
  455.       FreeIFF(iffhandle);
  456.     }
  457.   }
  458. }
  459.  
  460.  
  461. void CloseChaosCatalog(void)
  462. { if (LocaleBase != NULL)
  463.   { CloseCatalog(Chaos_Catalog);
  464.   }
  465.   Chaos_Catalog = NULL;
  466.   if (Chaos_OwnCatalog != NULL)
  467.   { FreeMem(Chaos_OwnCatalog,
  468.         Chaos_OwnStrings*sizeof(struct FC_Type)+Chaos_OwnBytes);
  469.     Chaos_OwnCatalog = NULL;
  470.   }
  471. }
  472.  
  473.  
  474. STRPTR GetChaosString(LONG strnum)
  475. { STRPTR defaultstr = NULL;
  476.   LONG i;
  477.  
  478.   for (i = 0;  i < sizeof(Chaos_Array)/sizeof(struct FC_Type);  i++)
  479.     { if (Chaos_Array[i].ID == strnum)
  480.       { defaultstr = Chaos_Array[i].Str;
  481.     break;
  482.       }
  483.     }
  484.   if (Chaos_Catalog == NULL)
  485.   { if (Chaos_OwnCatalog != NULL)
  486.     { for (i = 0;  i < Chaos_OwnStrings;  i++)
  487.        { if (Chaos_OwnCatalog[i].ID == strnum)
  488.      { return(Chaos_OwnCatalog[i].Str);
  489.      }
  490.        }
  491.     }
  492.     return(defaultstr);
  493.   }
  494.   return(GetCatalogStr(Chaos_Catalog, strnum, defaultstr));
  495. }
  496.