Commit 82f5df08 authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Changed the product number to a new format


Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
Change-Id: I4fd6172e2bbb790356ff90fc960fdd95927c0429
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 854410e4
...@@ -41,85 +41,89 @@ ...@@ -41,85 +41,89 @@
#endif #endif
/* Product number */ /* Product number */
#define PRODNR_EXECUTOR "CRL 113 200" #define PRODNR_EXECUTOR "CAX 105 7730"
#define LEGACY_PRODNR_EXECUTOR "CRL 113 200"
/* Ericsson revision: /m Rnx /* Ericsson (legacy) revision: /m Rnx
* m = TTCN3_MAJOR * m = TTCN3_MAJOR
* n = TTCN3_MINOR * n = TTCN3_MINOR
* x = 'A' + TTCN3_PATCHLEVEL * x = 'A' + TTCN3_PATCHLEVEL
* Example: 1.4.pl3 = R4D */ * Example: 1.4.pl3 = R4D */
#define GEN_ERICSSON_SUFFIX2(num) #num #define GEN_SUFFIX2(num) #num
#define GEN_ERICSSON_SUFFIX(num) GEN_ERICSSON_SUFFIX2(num) #define GEN_SUFFIX(num) GEN_SUFFIX2(num)
#define ERICSSON_SUFFIX GEN_ERICSSON_SUFFIX(TTCN3_MAJOR) #define MAJOR_SUFFIX GEN_SUFFIX(TTCN3_MAJOR)
#define GEN_ERICSSON_NUMBER2(num) #num #define GEN_NUMBER2(num) #num
#define GEN_ERICSSON_NUMBER(num) GEN_ERICSSON_NUMBER2(num) #define GEN_NUMBER(num) GEN_NUMBER2(num)
#define ERICSSON_NUMBER GEN_ERICSSON_NUMBER(TTCN3_MINOR) #define MINOR_NUMBER GEN_NUMBER(TTCN3_MINOR)
#if TTCN3_PATCHLEVEL == 0 #if TTCN3_PATCHLEVEL == 0
#define ERICSSON_LETTER "A" #define PATCH_LETTER "A"
#elif TTCN3_PATCHLEVEL == 1 #elif TTCN3_PATCHLEVEL == 1
#define ERICSSON_LETTER "B" #define PATCH_LETTER "B"
#elif TTCN3_PATCHLEVEL == 2 #elif TTCN3_PATCHLEVEL == 2
#define ERICSSON_LETTER "C" #define PATCH_LETTER "C"
#elif TTCN3_PATCHLEVEL == 3 #elif TTCN3_PATCHLEVEL == 3
#define ERICSSON_LETTER "D" #define PATCH_LETTER "D"
#elif TTCN3_PATCHLEVEL == 4 #elif TTCN3_PATCHLEVEL == 4
#define ERICSSON_LETTER "E" #define PATCH_LETTER "E"
#elif TTCN3_PATCHLEVEL == 5 #elif TTCN3_PATCHLEVEL == 5
#define ERICSSON_LETTER "F" #define PATCH_LETTER "F"
#elif TTCN3_PATCHLEVEL == 6 #elif TTCN3_PATCHLEVEL == 6
#define ERICSSON_LETTER "G" #define PATCH_LETTER "G"
#elif TTCN3_PATCHLEVEL == 7 #elif TTCN3_PATCHLEVEL == 7
#define ERICSSON_LETTER "H" #define PATCH_LETTER "H"
#elif TTCN3_PATCHLEVEL == 8 #elif TTCN3_PATCHLEVEL == 8
/* I: forbidden */ /* I: forbidden */
#define ERICSSON_LETTER "J" #define PATCH_LETTER "J"
#elif TTCN3_PATCHLEVEL == 9 #elif TTCN3_PATCHLEVEL == 9
#define ERICSSON_LETTER "K" #define PATCH_LETTER "K"
#elif TTCN3_PATCHLEVEL == 10 #elif TTCN3_PATCHLEVEL == 10
#define ERICSSON_LETTER "L" #define PATCH_LETTER "L"
#elif TTCN3_PATCHLEVEL == 11 #elif TTCN3_PATCHLEVEL == 11
#define ERICSSON_LETTER "M" #define PATCH_LETTER "M"
#elif TTCN3_PATCHLEVEL == 12 #elif TTCN3_PATCHLEVEL == 12
#define ERICSSON_LETTER "N" #define PATCH_LETTER "N"
/* O, P, Q, R: forbidden */ /* O, P, Q, R: forbidden */
#elif TTCN3_PATCHLEVEL == 13 #elif TTCN3_PATCHLEVEL == 13
#define ERICSSON_LETTER "S" #define PATCH_LETTER "S"
#elif TTCN3_PATCHLEVEL == 14 #elif TTCN3_PATCHLEVEL == 14
#define ERICSSON_LETTER "T" #define PATCH_LETTER "T"
#elif TTCN3_PATCHLEVEL == 15 #elif TTCN3_PATCHLEVEL == 15
#define ERICSSON_LETTER "U" #define PATCH_LETTER "U"
#elif TTCN3_PATCHLEVEL == 16 #elif TTCN3_PATCHLEVEL == 16
#define ERICSSON_LETTER "V" #define PATCH_LETTER "V"
#elif TTCN3_PATCHLEVEL == 17 #elif TTCN3_PATCHLEVEL == 17
/* W: forbidden */ /* W: forbidden */
#define ERICSSON_LETTER "X" #define PATCH_LETTER "X"
#elif TTCN3_PATCHLEVEL == 18 #elif TTCN3_PATCHLEVEL == 18
#define ERICSSON_LETTER "Y" #define PATCH_LETTER "Y"
#elif TTCN3_PATCHLEVEL == 19 #elif TTCN3_PATCHLEVEL == 19
#define ERICSSON_LETTER "Z" #define PATCH_LETTER "Z"
#else #else
#error "Ericsson revision letter is not defined." #error "Patch-level revision letter is not defined."
#endif #endif
#ifdef TTCN3_BUILDNUMBER #ifdef TTCN3_BUILDNUMBER
/* The Ericsson version is suffixed with the build number (at least 2 digits) /* The Ericsson version is suffixed with the build number (at least 2 digits)
* in preliminary releases (like this: "R6E01") */ * in preliminary releases (like this: "R6E01") */
# if TTCN3_BUILDNUMBER < 10 # if TTCN3_BUILDNUMBER < 10
# define ERICSSON_BUILDNUMBER "0" GEN_ERICSSON_NUMBER(TTCN3_BUILDNUMBER) # define DOUBLEDIGIT_BUILDNUMBER "0" GEN_NUMBER(TTCN3_BUILDNUMBER)
# else # else
# define ERICSSON_BUILDNUMBER GEN_ERICSSON_NUMBER(TTCN3_BUILDNUMBER) # define DOUBLEDIGIT_BUILDNUMBER GEN_NUMBER(TTCN3_BUILDNUMBER)
# endif # endif
#else #else
# define ERICSSON_BUILDNUMBER # define DOUBLEDIGIT_BUILDNUMBER
#endif #endif
#define ERICSSON_VERSION "/" ERICSSON_SUFFIX " R" ERICSSON_NUMBER ERICSSON_LETTER \ #define LEGACY_VERSION "/" MAJOR_SUFFIX " R" MINOR_NUMBER PATCH_LETTER \
ERICSSON_BUILDNUMBER DOUBLEDIGIT_BUILDNUMBER
#define PRODUCT_NUMBER PRODNR_EXECUTOR ERICSSON_VERSION #define LEGACY_PRODUCT_NUMBER LEGACY_PRODNR_EXECUTOR LEGACY_VERSION
#define PRODUCT_NUMBER MAJOR_SUFFIX "/" PRODNR_EXECUTOR " R" MINOR_NUMBER PATCH_LETTER \
DOUBLEDIGIT_BUILDNUMBER
/* Version of the C/C++ compiler */ /* Version of the C/C++ compiler */
......
...@@ -1319,7 +1319,7 @@ namespace Common { ...@@ -1319,7 +1319,7 @@ namespace Common {
control_ns_prefix(p_mt == MOD_ASN ? mcopystr("asn1") : NULL), control_ns_prefix(p_mt == MOD_ASN ? mcopystr("asn1") : NULL),
// only ASN.1 modules have default control namespace (X.693 amd1, 16.9) // only ASN.1 modules have default control namespace (X.693 amd1, 16.9)
used_namespaces(), type_conv_v(), product_number(NULL), used_namespaces(), type_conv_v(), product_number(NULL),
suffix(0), release(UINT_MAX), patch(UINT_MAX), build(UINT_MAX), extra(NULL) suffix(0), release(UINT_MAX), patch(UINT_MAX), build(UINT_MAX), extra(NULL), legacy_version(TUNKNOWN)
{ {
if(!p_modid) if(!p_modid)
FATAL_ERROR("NULL parameter: Common::Module::Module()"); FATAL_ERROR("NULL parameter: Common::Module::Module()");
...@@ -1481,7 +1481,7 @@ namespace Common { ...@@ -1481,7 +1481,7 @@ namespace Common {
if (release <= 999999 && patch < 30 && build < 100) { if (release <= 999999 && patch < 30 && build < 100) {
char *product_identifier = char *product_identifier =
get_product_identifier(product_number, suffix, release, patch, build, extra); get_product_identifier(product_number, suffix, release, patch, build, extra, legacy_version);
fprintf(stderr, " %s", product_identifier); fprintf(stderr, " %s", product_identifier);
Free(product_identifier); Free(product_identifier);
} }
...@@ -1491,7 +1491,7 @@ namespace Common { ...@@ -1491,7 +1491,7 @@ namespace Common {
char* Module::get_product_identifier(const char* product_number, char* Module::get_product_identifier(const char* product_number,
const unsigned int suffix, unsigned int release, unsigned int patch, const unsigned int suffix, unsigned int release, unsigned int patch,
unsigned int build, const char* extra) unsigned int build, const char* extra, tribool legacy)
{ {
expstring_t ret_val = memptystr(); expstring_t ret_val = memptystr();
if ( product_number == NULL if ( product_number == NULL
...@@ -1503,8 +1503,11 @@ namespace Common { ...@@ -1503,8 +1503,11 @@ namespace Common {
return ret_val; return ret_val;
} }
if (product_number != NULL) { if (product_number != NULL) {
if (legacy != TTRUE && suffix != 0) {
ret_val = mputprintf(ret_val, "%d/", suffix);
}
ret_val = mputstr(ret_val, product_number); ret_val = mputstr(ret_val, product_number);
if (suffix != 0) { if (legacy == TTRUE && suffix != 0) {
ret_val = mputprintf(ret_val, "/%d", suffix); ret_val = mputprintf(ret_val, "/%d", suffix);
} }
ret_val = mputc(ret_val, ' '); ret_val = mputc(ret_val, ' ');
......
...@@ -253,6 +253,7 @@ namespace Common { ...@@ -253,6 +253,7 @@ namespace Common {
unsigned int patch; unsigned int patch;
unsigned int build; unsigned int build;
char* extra; char* extra;
tribool legacy_version;
/** @} */ /** @} */
friend class Ttcn::Module; friend class Ttcn::Module;
...@@ -368,7 +369,7 @@ namespace Common { ...@@ -368,7 +369,7 @@ namespace Common {
void write_checksum(); void write_checksum();
static char* get_product_identifier(const char* product_number, static char* get_product_identifier(const char* product_number,
const unsigned int suffix, unsigned int release, unsigned int patch, const unsigned int suffix, unsigned int release, unsigned int patch,
unsigned int build, const char* extra=NULL); unsigned int build, const char* extra=NULL, tribool legacy = TUNKNOWN);
ModuleVersion getVersion() const; ModuleVersion getVersion() const;
protected: // *::Module need access protected: // *::Module need access
/** Collects the set of visible modules into \a visible_mods. */ /** Collects the set of visible modules into \a visible_mods. */
......
...@@ -2910,7 +2910,8 @@ namespace Ttcn { ...@@ -2910,7 +2910,8 @@ namespace Ttcn {
char* act_product_number; char* act_product_number;
unsigned int act_suffix, act_rel, act_patch, act_build; unsigned int act_suffix, act_rel, act_patch, act_build;
char* extra_junk; char* extra_junk;
(void)ex.get_id(act_product_number, act_suffix, act_rel, act_patch, act_build, extra_junk); tribool legacy;
(void)ex.get_id(act_product_number, act_suffix, act_rel, act_patch, act_build, extra_junk, legacy);
if (release != UINT_MAX) { if (release != UINT_MAX) {
ex.error("Duplicate 'version' attribute"); ex.error("Duplicate 'version' attribute");
...@@ -2922,6 +2923,7 @@ namespace Ttcn { ...@@ -2922,6 +2923,7 @@ namespace Ttcn {
patch = act_patch; patch = act_patch;
build = act_build; build = act_build;
extra = mcopystr(extra_junk); extra = mcopystr(extra_junk);
legacy_version = legacy;
} }
// Avoid propagating the attribute needlessly // Avoid propagating the attribute needlessly
multi->delete_element(i--); multi->delete_element(i--);
...@@ -2933,8 +2935,9 @@ namespace Ttcn { ...@@ -2933,8 +2935,9 @@ namespace Ttcn {
char* exp_product_number; char* exp_product_number;
unsigned int exp_suffix, exp_rel, exp_patch, exp_build; unsigned int exp_suffix, exp_rel, exp_patch, exp_build;
char* exp_extra; char* exp_extra;
tribool legacy;
Common::Identifier *req_id = ex.get_id(exp_product_number, Common::Identifier *req_id = ex.get_id(exp_product_number,
exp_suffix, exp_rel, exp_patch, exp_build, exp_extra); exp_suffix, exp_rel, exp_patch, exp_build, exp_extra, legacy);
// We own req_id // We own req_id
if (imp->has_impmod_withId(*req_id)) { if (imp->has_impmod_withId(*req_id)) {
Common::Module* m = modules->get_mod_byId(*req_id); Common::Module* m = modules->get_mod_byId(*req_id);
...@@ -2952,33 +2955,46 @@ namespace Ttcn { ...@@ -2952,33 +2955,46 @@ namespace Ttcn {
", while it specifies '%s'", ", while it specifies '%s'",
this->modid->get_dispname().c_str(), this->modid->get_dispname().c_str(),
req_id->get_dispname().c_str(), m->product_number); req_id->get_dispname().c_str(), m->product_number);
} else if (m->product_number != NULL && exp_product_number != NULL } else if (m->product_number != NULL && exp_product_number != NULL) {
&& 0 != strcmp(m->product_number, exp_product_number)) { bool prod_match = false;
char *req_product_identifier = if (legacy == m->legacy_version || (legacy != TFALSE && m->legacy_version != TFALSE)) {
get_product_identifier(exp_product_number, prod_match = (0 == strcmp(m->product_number, exp_product_number));
exp_suffix, exp_rel, exp_patch, exp_build); }
char *mod_product_identifier = else if (legacy == TTRUE && m->legacy_version == TFALSE) {
get_product_identifier(m->product_number, prod_match = (0 == strcmp(exp_product_number, LEGACY_PRODNR_EXECUTOR) &&
m->suffix, m->release, m->patch, m->build); 0 == strcmp(m->product_number, PRODNR_EXECUTOR));
}
ex.error("Module '%s' requires version %s of module" else if (legacy == TFALSE && m->legacy_version == TTRUE) {
" '%s', but only %s is available", prod_match = (0 == strcmp(exp_product_number, PRODNR_EXECUTOR) &&
this->modid->get_dispname().c_str(), req_product_identifier, 0 == strcmp(m->product_number, LEGACY_PRODNR_EXECUTOR));
req_id->get_dispname().c_str(), mod_product_identifier); }
Free(req_product_identifier); if (!prod_match) {
Free(mod_product_identifier); char *req_product_identifier =
multi->delete_element(i--); get_product_identifier(exp_product_number,
single = 0; exp_suffix, exp_rel, exp_patch, exp_build, NULL, legacy);
break; char *mod_product_identifier =
get_product_identifier(m->product_number,
m->suffix, m->release, m->patch, m->build, NULL, m->legacy_version);
ex.error("Module '%s' requires version %s of module"
" '%s', but only %s is available",
this->modid->get_dispname().c_str(), req_product_identifier,
req_id->get_dispname().c_str(), mod_product_identifier);
Free(req_product_identifier);
Free(mod_product_identifier);
multi->delete_element(i--);
single = 0;
break;
}
} }
// different suffixes are always incompatible // different suffixes are always incompatible
// unless the special version number is used // unless the special version number is used
if (m->suffix != exp_suffix && (m->suffix != UINT_MAX)) { if (m->suffix != exp_suffix && (m->suffix != UINT_MAX)) {
char *req_product_identifier = char *req_product_identifier =
get_product_identifier(exp_product_number,exp_suffix, exp_rel, exp_patch, exp_build); get_product_identifier(exp_product_number,exp_suffix, exp_rel, exp_patch, exp_build, NULL, legacy);
char *mod_product_identifier = char *mod_product_identifier =
get_product_identifier(m->product_number, get_product_identifier(m->product_number,
m->suffix, m->release, m->patch, m->build); m->suffix, m->release, m->patch, m->build, NULL, m->legacy_version);
ex.error("Module '%s' requires version %s of module" ex.error("Module '%s' requires version %s of module"
" '%s', but only %s is available", " '%s', but only %s is available",
...@@ -3018,8 +3034,10 @@ namespace Ttcn { ...@@ -3018,8 +3034,10 @@ namespace Ttcn {
char* exp_product_number; char* exp_product_number;
unsigned int exp_suffix, exp_minor, exp_patch, exp_build; unsigned int exp_suffix, exp_minor, exp_patch, exp_build;
char* exp_extra; char* exp_extra;
(void)ex.get_id(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build, exp_extra); tribool legacy;
if (exp_product_number != NULL && strcmp(exp_product_number,"CRL 113 200") != 0) { (void)ex.get_id(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build, exp_extra, legacy);
if (exp_product_number != NULL && ((legacy != TTRUE && strcmp(exp_product_number, PRODNR_EXECUTOR) != 0) ||
(legacy == TTRUE && strcmp(exp_product_number, LEGACY_PRODNR_EXECUTOR) != 0))) {
ex.error("This module needs to be compiled with TITAN, but " ex.error("This module needs to be compiled with TITAN, but "
" product number %s is not TITAN" " product number %s is not TITAN"
, exp_product_number); , exp_product_number);
...@@ -3032,10 +3050,10 @@ namespace Ttcn { ...@@ -3032,10 +3050,10 @@ namespace Ttcn {
+ exp_minor * 10000 + exp_patch * 100 + exp_build; + exp_minor * 10000 + exp_patch * 100 + exp_build;
if (expected_version > TTCN3_VERSION_MONOTONE) { if (expected_version > TTCN3_VERSION_MONOTONE) {
char *exp_product_identifier = char *exp_product_identifier =
get_product_identifier(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build); get_product_identifier(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build, NULL, legacy);
ex.error("This module needs to be compiled with TITAN version" ex.error("This module needs to be compiled with TITAN version"
" %s or higher; version %s detected" " %s or higher; version %s detected"
, exp_product_identifier, PRODUCT_NUMBER); , exp_product_identifier, legacy == TTRUE ? LEGACY_PRODUCT_NUMBER : PRODUCT_NUMBER);
Free(exp_product_identifier); Free(exp_product_identifier);
} }
multi->delete_element(i--); multi->delete_element(i--);
......
...@@ -2720,11 +2720,12 @@ namespace Ttcn { ...@@ -2720,11 +2720,12 @@ namespace Ttcn {
} }
ExtensionAttribute::ExtensionAttribute(const char* ABCClass, int type_number, ExtensionAttribute::ExtensionAttribute(const char* ABCClass, int type_number,
int sequence, int suffix, Identifier *ver) int sequence, int suffix, Identifier *ver, tribool legacy)
: Location(), type_(VERSION), value_() : Location(), type_(VERSION), value_()
{ {
if (ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()"); if (ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
value_.version_.module_ = NULL; value_.version_.module_ = NULL;
value_.version_.legacy_ = legacy;
check_product_number(ABCClass, type_number, sequence); check_product_number(ABCClass, type_number, sequence);
parse_version(ver); parse_version(ver);
...@@ -2737,13 +2738,14 @@ namespace Ttcn { ...@@ -2737,13 +2738,14 @@ namespace Ttcn {
} }
ExtensionAttribute::ExtensionAttribute(Identifier *mod, const char* ABCClass, ExtensionAttribute::ExtensionAttribute(Identifier *mod, const char* ABCClass,
int type_number, int sequence, int suffix, Identifier *ver) int type_number, int sequence, int suffix, Identifier *ver, tribool legacy)
: Location(), type_(REQUIRES), value_() : Location(), type_(REQUIRES), value_()
{ {
if (mod == NULL || ver == NULL) if (mod == NULL || ver == NULL)
FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()"); FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
// store the module identifier // store the module identifier
value_.version_.module_ = mod; value_.version_.module_ = mod;
value_.version_.legacy_ = legacy;
check_product_number(ABCClass, type_number, sequence); check_product_number(ABCClass, type_number, sequence);
parse_version(ver); parse_version(ver);
...@@ -2759,10 +2761,11 @@ namespace Ttcn { ...@@ -2759,10 +2761,11 @@ namespace Ttcn {
} }
ExtensionAttribute::ExtensionAttribute(const char* ABCClass, int type_number, ExtensionAttribute::ExtensionAttribute(const char* ABCClass, int type_number,
int sequence, int suffix, Identifier* ver, extension_t et) int sequence, int suffix, Identifier* ver, extension_t et, tribool legacy)
: Location(), type_(et), value_() : Location(), type_(et), value_()
{ {
if (ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()"); if (ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
value_.version_.legacy_ = legacy;
switch (et) { switch (et) {
case REQ_TITAN: case REQ_TITAN:
...@@ -2936,7 +2939,7 @@ namespace Ttcn { ...@@ -2936,7 +2939,7 @@ namespace Ttcn {
//FIXME ot is update -elni kell. //FIXME ot is update -elni kell.
Common::Identifier *ExtensionAttribute::get_id( Common::Identifier *ExtensionAttribute::get_id(
char*& product_number, unsigned int& suffix, char*& product_number, unsigned int& suffix,
unsigned int& rel, unsigned int& patch, unsigned int& bld, char*& extra) unsigned int& rel, unsigned int& patch, unsigned int& bld, char*& extra, tribool& legacy)
{ {
if ( type_ != REQUIRES && type_ != REQ_TITAN if ( type_ != REQUIRES && type_ != REQ_TITAN
&& type_ != VERSION && type_ != VERSION_TEMPLATE) { && type_ != VERSION && type_ != VERSION_TEMPLATE) {
...@@ -2948,6 +2951,7 @@ namespace Ttcn { ...@@ -2948,6 +2951,7 @@ namespace Ttcn {
patch = value_.version_.patch_; patch = value_.version_.patch_;
bld = value_.version_.build_; bld = value_.version_.build_;
extra = value_.version_.extra_; extra = value_.version_.extra_;
legacy = value_.version_.legacy_;
return value_.version_.module_; return value_.version_.module_;
} }
......
...@@ -595,7 +595,7 @@ public: ...@@ -595,7 +595,7 @@ public:
* becomes responsible for \p ver, otherwise the caller has to free it. * becomes responsible for \p ver, otherwise the caller has to free it.
*/ */
ExtensionAttribute(const char* ABCClass, int type_number, int sequence, ExtensionAttribute(const char* ABCClass, int type_number, int sequence,
int suffix, Identifier *ver); int suffix, Identifier *ver, tribool legacy);
/** Constructor for the REQUIRES type /** Constructor for the REQUIRES type
* *
...@@ -608,7 +608,7 @@ public: ...@@ -608,7 +608,7 @@ public:
* If unsuccessful, freeing the identifiers remains the caller's duty. * If unsuccessful, freeing the identifiers remains the caller's duty.
*/ */
ExtensionAttribute(Identifier *mod, const char* ABCClass, int type_number, ExtensionAttribute(Identifier *mod, const char* ABCClass, int type_number,
int sequence, int suffix, Identifier *ver); int sequence, int suffix, Identifier *ver, tribool legacy);
/** Constructor for the REQ_TITAN type or the VERSION_TEMPLATE type /** Constructor for the REQ_TITAN type or the VERSION_TEMPLATE type
* *
...@@ -621,7 +621,7 @@ public: ...@@ -621,7 +621,7 @@ public:
* becomes responsible for \p ver, otherwise the caller has to free it. * becomes responsible for \p ver, otherwise the caller has to free it.
*/ */
ExtensionAttribute(const char* ABCClass, int type_number, int sequence, ExtensionAttribute(const char* ABCClass, int type_number, int sequence,
int suffix, Identifier* ver, extension_t et); int suffix, Identifier* ver, extension_t et, tribool legacy);
~ExtensionAttribute(); ~ExtensionAttribute();
...@@ -687,7 +687,7 @@ public: ...@@ -687,7 +687,7 @@ public:
* @return pointer to the identifier of the module; the caller must not free * @return pointer to the identifier of the module; the caller must not free
*/ */
Common::Identifier *get_id(char*& product_number, unsigned int& suffix, Common::Identifier *get_id(char*& product_number, unsigned int& suffix,
unsigned int& rel, unsigned int& patch, unsigned int& bld, char*& extra); unsigned int& rel, unsigned int& patch, unsigned int& bld, char*& extra, tribool& legacy);
/// @} /// @}
private: private:
/// Attribute type. /// Attribute type.
...@@ -715,12 +715,13 @@ private: ...@@ -715,12 +715,13 @@ private:
Types *anytypes_; Types *anytypes_;
struct { struct {
Common::Identifier *module_; Common::Identifier *module_;
char* productNumber_; ///< "CRL 113 200" char* productNumber_; ///< "CRL 113 200" for legacy versions, "CAX 105 7730" for current versions
unsigned int suffix_; ///< The "/3" unsigned int suffix_; ///< The "/3"
unsigned int release_;///< release unsigned int release_;///< release
unsigned int patch_; ///< patch unsigned int patch_; ///< patch
unsigned int build_; ///< build number unsigned int build_; ///< build number
char* extra_; ///< extra junk at the end, for titansim char* extra_; ///< extra junk at the end, for titansim
tribool legacy_; ///< 'true' for legacy versions, 'false' for current versions, or 'unknown'
} version_; } version_;
PrintingType *pt_; PrintingType *pt_;
} value_; } value_;
......
...@@ -305,7 +305,7 @@ ExtensionAttribute: ...@@ -305,7 +305,7 @@ ExtensionAttribute:
VersionAttribute: VersionAttribute:
VersionKeyword IDentifier VersionKeyword IDentifier
{ // version R2D2 { // version R2D2
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $2); // VERSION $$ = new ExtensionAttribute(NULL, 0, 0, 0, $2, TUNKNOWN); // VERSION
$$->set_location(coding_attrib_infile, @$); $$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) { if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s'", $2->get_name().c_str()); $$->error("Incorrect version data '%s'", $2->get_name().c_str());
...@@ -316,7 +316,7 @@ VersionKeyword IDentifier ...@@ -316,7 +316,7 @@ VersionKeyword IDentifier
} }
| VersionKeyword '<' IDentifier '>' | VersionKeyword '<' IDentifier '>'
{ // version <RnXnn> { // version <RnXnn>
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $3, ExtensionAttribute::VERSION_TEMPLATE); $$ = new ExtensionAttribute(NULL, 0, 0, 0, $3, ExtensionAttribute::VERSION_TEMPLATE, TTRUE);
$$->set_location(coding_attrib_infile, @$); $$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) { if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version template '<%s>'", $3->get_name().c_str()); $$->error("Incorrect version template '<%s>'", $3->get_name().c_str());
...@@ -327,7 +327,7 @@ VersionKeyword IDentifier ...@@ -327,7 +327,7 @@ VersionKeyword IDentifier
} }
| VersionKeyword IDentifier Number Number IDentifier | VersionKeyword IDentifier Number Number IDentifier
{ // version CNL 113 200 R2D2 { // version CNL 113 200 R2D2
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5); // VERSION $$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5, TUNKNOWN); // VERSION
$$->set_location(coding_attrib_infile, @$); $$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {