From 59b0ca6831aee0843ef80bc46c84a82104a09217 Mon Sep 17 00:00:00 2001 From: lotodore Date: Sat, 18 Jul 2009 21:54:02 +0000 Subject: [PATCH] Solving more name collision problems. --- src/third_party/asn1/AvatarHeader.c | 2 +- src/third_party/asn1/AvatarHeader.h | 4 +- src/third_party/asn1/AvatarType.h | 44 ---------- src/third_party/asn1/Makefile | 20 ++--- .../asn1/{AvatarType.c => NetAvatarType.c} | 88 +++++++++---------- src/third_party/asn1/NetAvatarType.h | 44 ++++++++++ src/third_party/asn1/PlayerInfoData.c | 2 +- src/third_party/asn1/PlayerInfoData.h | 4 +- 8 files changed, 104 insertions(+), 104 deletions(-) delete mode 100644 src/third_party/asn1/AvatarType.h rename src/third_party/asn1/{AvatarType.c => NetAvatarType.c} (56%) create mode 100644 src/third_party/asn1/NetAvatarType.h diff --git a/src/third_party/asn1/AvatarHeader.c b/src/third_party/asn1/AvatarHeader.c index 6c43230f..2b967c70 100644 --- a/src/third_party/asn1/AvatarHeader.c +++ b/src/third_party/asn1/AvatarHeader.c @@ -37,7 +37,7 @@ static asn_TYPE_member_t asn_MBR_AvatarHeader_1[] = { { ATF_NOFLAGS, 0, offsetof(struct AvatarHeader, avatarType), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, - &asn_DEF_AvatarType, + &asn_DEF_NetAvatarType, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, diff --git a/src/third_party/asn1/AvatarHeader.h b/src/third_party/asn1/AvatarHeader.h index 1d364e14..3653a4e9 100644 --- a/src/third_party/asn1/AvatarHeader.h +++ b/src/third_party/asn1/AvatarHeader.h @@ -11,7 +11,7 @@ #include /* Including external dependencies */ -#include "AvatarType.h" +#include "NetAvatarType.h" #include #include @@ -21,7 +21,7 @@ extern "C" { /* AvatarHeader */ typedef struct AvatarHeader { - AvatarType_t avatarType; + NetAvatarType_t avatarType; long avatarSize; /* * This type is extensible, diff --git a/src/third_party/asn1/AvatarType.h b/src/third_party/asn1/AvatarType.h deleted file mode 100644 index 6f9a1cf0..00000000 --- a/src/third_party/asn1/AvatarType.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Generated by asn1c-0.9.22 (http://lionet.info/asn1c) - * From ASN.1 module "POKERTH-PROTOCOL" - * found in "../../../docs/pokerth.asn1" - */ - -#ifndef _AvatarType_H_ -#define _AvatarType_H_ - - -#include - -/* Including external dependencies */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Dependencies */ -typedef enum AvatarType { - AvatarType_imagePng = 1, - AvatarType_imageJpg = 2, - AvatarType_imageGif = 3 -} e_AvatarType; - -/* AvatarType */ -typedef long AvatarType_t; - -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AvatarType; -asn_struct_free_f AvatarType_free; -asn_struct_print_f AvatarType_print; -asn_constr_check_f AvatarType_constraint; -ber_type_decoder_f AvatarType_decode_ber; -der_type_encoder_f AvatarType_encode_der; -xer_type_decoder_f AvatarType_decode_xer; -xer_type_encoder_f AvatarType_encode_xer; - -#ifdef __cplusplus -} -#endif - -#endif /* _AvatarType_H_ */ diff --git a/src/third_party/asn1/Makefile b/src/third_party/asn1/Makefile index 34000a18..bbc36ff3 100644 --- a/src/third_party/asn1/Makefile +++ b/src/third_party/asn1/Makefile @@ -13,14 +13,14 @@ ASN_MODULE_SOURCES= \ AvatarEnd.c \ UnknownAvatar.c \ AvatarHash.c \ - AvatarType.c \ + NetAvatarType.c \ GameListMessage.c \ GameListNew.c \ GameListUpdate.c \ GameListPlayerJoined.c \ GameListPlayerLeft.c \ GameListAdminChanged.c \ - GameMode.c \ + NetGameMode.c \ PlayerInfoRequestMessage.c \ PlayerInfoReplyMessage.c \ PlayerInfoData.c \ @@ -32,7 +32,7 @@ ASN_MODULE_SOURCES= \ JoinGameReplyMessage.c \ JoinGameAck.c \ JoinGameFailed.c \ - GameInfo.c \ + NetGameInfo.c \ GamePlayerMessage.c \ GamePlayerJoined.c \ GamePlayerLeft.c \ @@ -64,8 +64,8 @@ ASN_MODULE_SOURCES= \ ChatMessage.c \ DialogMessage.c \ ErrorMessage.c \ - GameState.c \ - PlayerAction.c \ + NetGameState.c \ + NetPlayerAction.c \ NonZeroId.c \ Id.c \ Guid.c \ @@ -86,14 +86,14 @@ ASN_MODULE_HEADERS= \ AvatarEnd.h \ UnknownAvatar.h \ AvatarHash.h \ - AvatarType.h \ + NetAvatarType.h \ GameListMessage.h \ GameListNew.h \ GameListUpdate.h \ GameListPlayerJoined.h \ GameListPlayerLeft.h \ GameListAdminChanged.h \ - GameMode.h \ + NetGameMode.h \ PlayerInfoRequestMessage.h \ PlayerInfoReplyMessage.h \ PlayerInfoData.h \ @@ -105,7 +105,7 @@ ASN_MODULE_HEADERS= \ JoinGameReplyMessage.h \ JoinGameAck.h \ JoinGameFailed.h \ - GameInfo.h \ + NetGameInfo.h \ GamePlayerMessage.h \ GamePlayerJoined.h \ GamePlayerLeft.h \ @@ -137,8 +137,8 @@ ASN_MODULE_HEADERS= \ ChatMessage.h \ DialogMessage.h \ ErrorMessage.h \ - GameState.h \ - PlayerAction.h \ + NetGameState.h \ + NetPlayerAction.h \ NonZeroId.h \ Id.h \ Guid.h \ diff --git a/src/third_party/asn1/AvatarType.c b/src/third_party/asn1/NetAvatarType.c similarity index 56% rename from src/third_party/asn1/AvatarType.c rename to src/third_party/asn1/NetAvatarType.c index 4dc72c62..b14b8eac 100644 --- a/src/third_party/asn1/AvatarType.c +++ b/src/third_party/asn1/NetAvatarType.c @@ -6,10 +6,10 @@ #include -#include "AvatarType.h" +#include "NetAvatarType.h" int -AvatarType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, +NetAvatarType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; @@ -21,7 +21,7 @@ AvatarType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, * so here we adjust the DEF accordingly. */ static void -AvatarType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { +NetAvatarType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeEnumerated.free_struct; td->print_struct = asn_DEF_NativeEnumerated.print_struct; td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; @@ -38,91 +38,91 @@ AvatarType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { } void -AvatarType_free(asn_TYPE_descriptor_t *td, +NetAvatarType_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { - AvatarType_1_inherit_TYPE_descriptor(td); + NetAvatarType_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int -AvatarType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, +NetAvatarType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { - AvatarType_1_inherit_TYPE_descriptor(td); + NetAvatarType_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t -AvatarType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, +NetAvatarType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { - AvatarType_1_inherit_TYPE_descriptor(td); + NetAvatarType_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t -AvatarType_encode_der(asn_TYPE_descriptor_t *td, +NetAvatarType_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { - AvatarType_1_inherit_TYPE_descriptor(td); + NetAvatarType_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t -AvatarType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, +NetAvatarType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { - AvatarType_1_inherit_TYPE_descriptor(td); + NetAvatarType_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t -AvatarType_encode_xer(asn_TYPE_descriptor_t *td, void *structure, +NetAvatarType_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { - AvatarType_1_inherit_TYPE_descriptor(td); + NetAvatarType_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } -static asn_INTEGER_enum_map_t asn_MAP_AvatarType_value2enum_1[] = { - { 1, 8, "imagePng" }, - { 2, 8, "imageJpg" }, - { 3, 8, "imageGif" } +static asn_INTEGER_enum_map_t asn_MAP_NetAvatarType_value2enum_1[] = { + { 1, 14, "avatarImagePng" }, + { 2, 14, "avatarImageJpg" }, + { 3, 14, "avatarImageGif" } }; -static unsigned int asn_MAP_AvatarType_enum2value_1[] = { - 2, /* imageGif(3) */ - 1, /* imageJpg(2) */ - 0 /* imagePng(1) */ +static unsigned int asn_MAP_NetAvatarType_enum2value_1[] = { + 2, /* avatarImageGif(3) */ + 1, /* avatarImageJpg(2) */ + 0 /* avatarImagePng(1) */ }; -static asn_INTEGER_specifics_t asn_SPC_AvatarType_specs_1 = { - asn_MAP_AvatarType_value2enum_1, /* "tag" => N; sorted by tag */ - asn_MAP_AvatarType_enum2value_1, /* N => "tag"; sorted by N */ +static asn_INTEGER_specifics_t asn_SPC_NetAvatarType_specs_1 = { + asn_MAP_NetAvatarType_value2enum_1, /* "tag" => N; sorted by tag */ + asn_MAP_NetAvatarType_enum2value_1, /* N => "tag"; sorted by N */ 3, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; -static ber_tlv_tag_t asn_DEF_AvatarType_tags_1[] = { +static ber_tlv_tag_t asn_DEF_NetAvatarType_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; -asn_TYPE_descriptor_t asn_DEF_AvatarType = { - "AvatarType", - "AvatarType", - AvatarType_free, - AvatarType_print, - AvatarType_constraint, - AvatarType_decode_ber, - AvatarType_encode_der, - AvatarType_decode_xer, - AvatarType_encode_xer, +asn_TYPE_descriptor_t asn_DEF_NetAvatarType = { + "NetAvatarType", + "NetAvatarType", + NetAvatarType_free, + NetAvatarType_print, + NetAvatarType_constraint, + NetAvatarType_decode_ber, + NetAvatarType_encode_der, + NetAvatarType_decode_xer, + NetAvatarType_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ 0, /* Use generic outmost tag fetcher */ - asn_DEF_AvatarType_tags_1, - sizeof(asn_DEF_AvatarType_tags_1) - /sizeof(asn_DEF_AvatarType_tags_1[0]), /* 1 */ - asn_DEF_AvatarType_tags_1, /* Same as above */ - sizeof(asn_DEF_AvatarType_tags_1) - /sizeof(asn_DEF_AvatarType_tags_1[0]), /* 1 */ + asn_DEF_NetAvatarType_tags_1, + sizeof(asn_DEF_NetAvatarType_tags_1) + /sizeof(asn_DEF_NetAvatarType_tags_1[0]), /* 1 */ + asn_DEF_NetAvatarType_tags_1, /* Same as above */ + sizeof(asn_DEF_NetAvatarType_tags_1) + /sizeof(asn_DEF_NetAvatarType_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ - &asn_SPC_AvatarType_specs_1 /* Additional specs */ + &asn_SPC_NetAvatarType_specs_1 /* Additional specs */ }; diff --git a/src/third_party/asn1/NetAvatarType.h b/src/third_party/asn1/NetAvatarType.h new file mode 100644 index 00000000..1c424983 --- /dev/null +++ b/src/third_party/asn1/NetAvatarType.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.22 (http://lionet.info/asn1c) + * From ASN.1 module "POKERTH-PROTOCOL" + * found in "../../../docs/pokerth.asn1" + */ + +#ifndef _NetAvatarType_H_ +#define _NetAvatarType_H_ + + +#include + +/* Including external dependencies */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Dependencies */ +typedef enum NetAvatarType { + NetAvatarType_avatarImagePng = 1, + NetAvatarType_avatarImageJpg = 2, + NetAvatarType_avatarImageGif = 3 +} e_NetAvatarType; + +/* NetAvatarType */ +typedef long NetAvatarType_t; + +/* Implementation */ +extern asn_TYPE_descriptor_t asn_DEF_NetAvatarType; +asn_struct_free_f NetAvatarType_free; +asn_struct_print_f NetAvatarType_print; +asn_constr_check_f NetAvatarType_constraint; +ber_type_decoder_f NetAvatarType_decode_ber; +der_type_encoder_f NetAvatarType_encode_der; +xer_type_decoder_f NetAvatarType_decode_xer; +xer_type_encoder_f NetAvatarType_encode_xer; + +#ifdef __cplusplus +} +#endif + +#endif /* _NetAvatarType_H_ */ diff --git a/src/third_party/asn1/PlayerInfoData.c b/src/third_party/asn1/PlayerInfoData.c index e18bab96..aa285c10 100644 --- a/src/third_party/asn1/PlayerInfoData.c +++ b/src/third_party/asn1/PlayerInfoData.c @@ -12,7 +12,7 @@ static asn_TYPE_member_t asn_MBR_avatarData_4[] = { { ATF_NOFLAGS, 0, offsetof(struct avatarData, avatarType), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, - &asn_DEF_AvatarType, + &asn_DEF_NetAvatarType, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, diff --git a/src/third_party/asn1/PlayerInfoData.h b/src/third_party/asn1/PlayerInfoData.h index a7de8f43..a1c88a82 100644 --- a/src/third_party/asn1/PlayerInfoData.h +++ b/src/third_party/asn1/PlayerInfoData.h @@ -13,7 +13,7 @@ /* Including external dependencies */ #include #include -#include "AvatarType.h" +#include "NetAvatarType.h" #include "AvatarHash.h" #include @@ -26,7 +26,7 @@ typedef struct PlayerInfoData { UTF8String_t playerName; BOOLEAN_t isHuman; struct avatarData { - AvatarType_t avatarType; + NetAvatarType_t avatarType; AvatarHash_t avatar; /* * This type is extensible,