expimp.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. // expimp.h
  20. //
  21. #ifndef __EXPIMP_H
  22. #define __EXPIMP_H
  23. #include "transDB.h"
  24. #include "noxstringdlg.h"
  25. typedef enum
  26. {
  27. TR_ALL,
  28. TR_CHANGES,
  29. TR_DIALOG,
  30. TR_NONDIALOG,
  31. TR_SAMPLE,
  32. TR_MISSING_DIALOG,
  33. TR_UNVERIFIED,
  34. TR_UNSENT
  35. } TrFilter;
  36. typedef struct
  37. {
  38. TrFilter filter;
  39. int include_comments;
  40. int include_translations;
  41. } TROPTIONS;
  42. typedef enum
  43. {
  44. GN_UNICODE,
  45. GN_NOXSTR,
  46. } GnFormat;
  47. typedef enum
  48. {
  49. GN_USEIDS,
  50. GN_USEORIGINAL,
  51. } GnUntranslated;
  52. typedef struct
  53. {
  54. GnFormat format; // what file format to generate
  55. GnUntranslated untranslated; // what to do with untranslated text
  56. } GNOPTIONS;
  57. typedef struct
  58. {
  59. int translations;
  60. int dialog;
  61. int limit;
  62. } RPOPTIONS;
  63. #define CSF_ID ( ('C'<<24) | ('S'<<16) | ('F'<<8) | (' ') )
  64. #define CSF_LABEL ( ('L'<<24) | ('B'<<16) | ('L'<<8) | (' ') )
  65. #define CSF_STRING ( ('S'<<24) | ('T'<<16) | ('R'<<8) | (' ') )
  66. #define CSF_STRINGWITHWAVE ( ('S'<<24) | ('T'<<16) | ('R'<<8) | ('W') )
  67. #define CSF_VERSION 3
  68. typedef struct
  69. {
  70. int id;
  71. int version;
  72. int num_labels;
  73. int num_strings;
  74. int skip;
  75. } CSF_HEADER_V1;
  76. typedef struct
  77. {
  78. int id;
  79. int version;
  80. int num_labels;
  81. int num_strings;
  82. int skip;
  83. int langid;
  84. } CSF_HEADER;
  85. int ExportTranslations ( TransDB *db, const char *filename, LangID langid, TROPTIONS *options, CNoxstringDlg *dlg = NULL );
  86. int ImportTranslations ( TransDB *db, const char *filename, CNoxstringDlg *dlg = NULL );
  87. int UpdateSentTranslations ( TransDB *db, const char *filename, CNoxstringDlg *dlg = NULL );
  88. int GenerateGameFiles ( TransDB *db, const char *filename, GNOPTIONS *option, LangID *languages, CNoxstringDlg *dlg = NULL );
  89. int GenerateReport ( TransDB *db, const char *filename, RPOPTIONS *options, LangID *languages, CNoxstringDlg *dlg = NULL );
  90. void ProcessWaves ( TransDB *db, const char *filename, CNoxstringDlg *dlg );
  91. #endif