Language.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: Language.h ///////////////////////////////////////////////////////////
  24. //-----------------------------------------------------------------------------
  25. //
  26. // Westwood Studios Pacific.
  27. //
  28. // Confidential Information
  29. // Copyright (C) 2001 - All Rights Reserved
  30. //
  31. //-----------------------------------------------------------------------------
  32. //
  33. // Project: RTS3
  34. //
  35. // File name: Language.h
  36. //
  37. // Created: Colin Day, June 2001
  38. //
  39. // Desc: Header for dealing with multiple languages
  40. //
  41. //-----------------------------------------------------------------------------
  42. ///////////////////////////////////////////////////////////////////////////////
  43. #pragma once
  44. #ifndef __LANGUAGE_H_
  45. #define __LANGUAGE_H_
  46. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  47. // USER INCLUDES //////////////////////////////////////////////////////////////
  48. // FORWARD REFERENCES /////////////////////////////////////////////////////////
  49. ///////////////////////////////////////////////////////////////////////////////
  50. // TYPE DEFINES ///////////////////////////////////////////////////////////////
  51. ///////////////////////////////////////////////////////////////////////////////
  52. // IMPORTANT: Make sure this enum is identical to the one in Noxstring tool
  53. typedef enum
  54. {
  55. LANGUAGE_ID_US = 0,
  56. LANGUAGE_ID_UK,
  57. LANGUAGE_ID_GERMAN,
  58. LANGUAGE_ID_FRENCH,
  59. LANGUAGE_ID_SPANISH,
  60. LANGUAGE_ID_ITALIAN,
  61. LANGUAGE_ID_JAPANESE,
  62. LANGUAGE_ID_JABBER,
  63. LANGUAGE_ID_KOREAN,
  64. LANGUAGE_ID_UNKNOWN
  65. } LanguageID;
  66. #define GameStrcpy wcscpy
  67. #define GameStrncpy wcsncpy
  68. #define GameStrlen wcslen
  69. #define GameStrcat wcscat
  70. #define GameStrcmp wcscmp
  71. #define GameStrncmp wcsncmp
  72. #define GameStricmp wcsicmp
  73. #define GameStrnicmp wcsnicmp
  74. #define GameStrtok wcstok
  75. #define GameSprintf swprintf
  76. #define GameVsprintf vswprintf
  77. /// @todo -- add a non-malloc-based string dup func #define GameStrdup wcsdup
  78. #define GameAtoi(S) wcstol( (S), NULL, 10)
  79. #define GameAtod(S) wcstod( (S), NULL )
  80. #define GameItoa _itow
  81. #define GameSscanf swscanf
  82. #define GameStrstr wcsstr
  83. #define GameStrchr wcschr
  84. #define GameIsDigit iswdigit
  85. #define GameIsAscii iswascii
  86. #define GameIsAlNum iswalnum
  87. #define GameIsAlpha iswalpha
  88. #define GameArrayEnd(array) (array)[(sizeof(array)/sizeof((array)[0]))-1] = 0
  89. // INLINING ///////////////////////////////////////////////////////////////////
  90. // EXTERNALS //////////////////////////////////////////////////////////////////
  91. extern LanguageID OurLanguage; ///< our current language definition
  92. #endif // __LANGUAGE_H_