1 /*
2  * Copyright (C) 1998  Mark Baysinger (mbaysing@ucsd.edu)
3  * Copyright (C) 1998,1999,2000  Ross Combs (rocombs@cs.nmsu.edu)
4  * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19  */
20 #ifndef INCLUDED_TAG_TYPES
21 #define INCLUDED_TAG_TYPES
22 
23 #ifdef JUST_NEED_TYPES
24 #include "compat/uint.h"
25 #else
26 #define JUST_NEED_TYPES
27 #include "compat/uint.h"
28 #undef JUST_NEED_TYPES
29 #endif
30 
31 typedef t_uint32	t_tag;
32 typedef t_tag		t_archtag;
33 typedef t_tag		t_clienttag;
34 typedef t_tag		t_gamelang;
35 
36 #endif
37 
38 /*****/
39 #ifndef JUST_NEED_TYPES
40 #ifndef INCLUDED_TAG_PROTOS
41 #define INCLUDED_TAG_PROTOS
42 
43 /* Software tags */
44 #define CLIENTTAG_BNCHATBOT 		"CHAT" /* CHAT bot */
45 #define CLIENTTAG_BNCHATBOT_UINT 	0x43484154
46 #define CLIENTTAG_STARCRAFT 		"STAR" /* Starcraft (original) */
47 #define CLIENTTAG_STARCRAFT_UINT 	0x53544152
48 #define CLIENTTAG_BROODWARS 		"SEXP" /* Starcraft EXpansion Pack */
49 #define CLIENTTAG_BROODWARS_UINT 	0x53455850
50 #define CLIENTTAG_SHAREWARE 		"SSHR" /* Starcraft Shareware */
51 #define CLIENTTAG_SHAREWARE_UINT	0x53534852
52 #define CLIENTTAG_DIABLORTL 		"DRTL" /* Diablo ReTaiL */
53 #define CLIENTTAG_DIABLORTL_UINT	0x4452544C
54 #define CLIENTTAG_DIABLOSHR 		"DSHR" /* Diablo SHaReware */
55 #define CLIENTTAG_DIABLOSHR_UINT	0x44534852
56 #define CLIENTTAG_WARCIIBNE 		"W2BN" /* WarCraft II Battle.net Edition */
57 #define CLIENTTAG_WARCIIBNE_UINT	0x5732424E
58 #define CLIENTTAG_DIABLO2DV 		"D2DV" /* Diablo II Diablo's Victory */
59 #define CLIENTTAG_DIABLO2DV_UINT	0x44324456
60 #define CLIENTTAG_STARJAPAN 		"JSTR" /* Starcraft (Japan) */
61 #define CLIENTTAG_STARJAPAN_UINT	0x4A535452
62 #define CLIENTTAG_DIABLO2ST 		"D2ST" /* Diablo II Stress Test */
63 #define CLIENTTAG_DIABLO2ST_UINT	0x44325354
64 #define CLIENTTAG_DIABLO2XP 		"D2XP" /* Diablo II Extension Pack */
65 #define CLIENTTAG_DIABLO2XP_UINT	0x44325850
66 /* FIXME: according to FSGS:
67     SJPN==Starcraft (Japanese)
68     SSJP==Starcraft (Japanese,Spawn)
69 */
70 #define CLIENTTAG_WARCRAFT3 		"WAR3" /* WarCraft III */
71 #define CLIENTTAG_WARCRAFT3_UINT	0x57415233
72 #define CLIENTTAG_WAR3XP    		"W3XP" /* WarCraft III Expansion */
73 #define CLIENTTAG_WAR3XP_UINT		0x57335850
74 
75 #define CLIENTTAG_IIRC              "IIRC"/* IRC */
76 #define CLIENTTAG_IIRC_UINT         0x49495243
77 #define CLIENTTAG_WWOL              "WWOL"/* Westwood Online */
78 #define CLIENTTAG_WWOL_UINT         0x57574F4C
79 
80 /* BNETD-specific software tags - we try to use lowercase to avoid collisions  */
81 #define CLIENTTAG_FREECRAFT "free" /* FreeCraft http://www.freecraft.com/ */
82 
83 #define CLIENTTAG_UNKNOWN		"UNKN"
84 #define CLIENTTAG_UNKNOWN_UINT		0x554E4B4E
85 
86 /* Architecture tags */
87 #define ARCHTAG_WINX86       "IX86" /* MS Windows on Intel x86 */
88 #define ARCHTAG_MACPPC       "PMAC" /* MacOS   on PowerPC   */
89 #define ARCHTAG_OSXPPC       "XMAC" /* MacOS X on PowerPC   */
90 
91 #define ARCHTAG_WINX86_UINT  0x49583836		/* IX86 */
92 #define ARCHTAG_MACPPC_UINT  0x504D4143		/* PMAC */
93 #define ARCHTAG_OSXPPC_UINT  0x584D4143		/* XMAC */
94 
95 /* game languages */
96 #define GAMELANG_ENGLISH_UINT	0x656E5553	/* enUS */
97 #define GAMELANG_GERMAN_UINT	0x64654445	/* deDE */
98 #define GAMELANG_CZECH_UINT	0x6373435A	/* csCZ */
99 #define GAMELANG_SPANISH_UINT	0x65734553	/* esES */
100 #define GAMELANG_FRENCH_UINT	0x66724652	/* frFR */
101 #define GAMELANG_ITALIAN_UINT	0x69744954	/* itIT */
102 #define GAMELANG_JAPANESE_UINT	0x6A614A41	/* jaJA */
103 #define GAMELANG_KOREAN_UINT	0x6B6F4B52	/* koKR */
104 #define GAMELANG_POLISH_UINT	0x706C504C	/* plPL */
105 #define GAMELANG_RUSSIAN_UINT	0x72755255	/* ruRU */
106 #define GAMELANG_CHINESE_S_UINT	0x7A68434E	/* zhCN */
107 #define GAMELANG_CHINESE_T_UINT	0x7A685457	/* zhTW */
108 
109 #define TAG_UNKNOWN_UINT	0x554E4B4E	/* UNKN */
110 #define TAG_UNKNOWN		"UNKN"
111 
112 /* Server tag */
113 #define BNETTAG "bnet" /* Battle.net */
114 
115 /* Filetype tags (note these are "backwards") */
116 #define EXTENSIONTAG_PCX "xcp."
117 #define EXTENSIONTAG_SMK "kms."
118 #define EXTENSIONTAG_MNG "gnm."
119 
120 extern t_clienttag clienttag_str_to_uint(char const * clienttag);
121 extern char const * clienttag_uint_to_str(t_clienttag clienttag);
122 extern char const * clienttag_get_title(t_clienttag clienttag);
123 
124 extern t_tag	tag_str_to_uint(char const * tag_str);
125 extern t_tag	tag_case_str_to_uint(char const * tag_str);
126 extern char *	tag_uint_to_str(char * tag_str, t_tag tag_uint);
127 extern char *	tag_uint_to_revstr(char * tag_str, t_tag tag_uint);
128 extern int	tag_check_arch(t_tag tag_uint);
129 extern int	tag_check_client(t_tag tag_uint);
130 extern int	tag_check_gamelang(t_tag tag_uint);
131 
132 #endif
133 #endif
134