Commit cfb8ff06 authored by Adam Knapp's avatar Adam Knapp
Browse files

Implementing dot separated version format, e.g. 7.2.1



Change-Id: I2a9c4c5d90b7fbe32be74349988a15272c099bce
Signed-off-by: default avatarAdam Knapp <adam.knapp@sigmatechnology.se>
parent 083dc876
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
* Baranyi, Botond * Baranyi, Botond
* Beres, Szabolcs * Beres, Szabolcs
* Delic, Adam * Delic, Adam
* Knapp, Adam
* Kovacs, Ferenc * Kovacs, Ferenc
* Pandi, Krisztian * Pandi, Krisztian
* Raduly, Csaba * Raduly, Csaba
...@@ -163,4 +164,7 @@ public: ...@@ -163,4 +164,7 @@ public:
#undef FIELD_NAME #undef FIELD_NAME
#undef FN #undef FN
/* Enum to identify version types */
enum version_t { UNKNOWN, LEGACY_CRL, LEGACY_CAX, DOT_SEPARATED /*current*/ };
#endif #endif
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
* *
* Contributors: * Contributors:
* Balasko, Jeno * Balasko, Jeno
* Baranyi, Botond
* Godar, Marton * Godar, Marton
* Knapp, Adam
* Kovacs, Ferenc * Kovacs, Ferenc
* Lovassy, Arpad * Lovassy, Arpad
* Raduly, Csaba * Raduly, Csaba
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <sstream> #include <sstream>
#include "../common/dbgnew.hh" #include "../common/dbgnew.hh"
#include "../common/version.h"
#include "AST.hh" #include "AST.hh"
#include "asn1/AST_asn1.hh" #include "asn1/AST_asn1.hh"
#include "Identifier.hh" #include "Identifier.hh"
...@@ -1319,7 +1320,7 @@ namespace Common { ...@@ -1319,7 +1320,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), legacy_version(TUNKNOWN) suffix(0), release(UINT_MAX), patch(UINT_MAX), build(UINT_MAX), extra(NULL), version_type(UNKNOWN)
{ {
if(!p_modid) if(!p_modid)
FATAL_ERROR("NULL parameter: Common::Module::Module()"); FATAL_ERROR("NULL parameter: Common::Module::Module()");
...@@ -1481,7 +1482,7 @@ namespace Common { ...@@ -1481,7 +1482,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, legacy_version); get_product_identifier(product_number, suffix, release, patch, build, extra, version_type);
fprintf(stderr, " %s", product_identifier); fprintf(stderr, " %s", product_identifier);
Free(product_identifier); Free(product_identifier);
} }
...@@ -1491,7 +1492,7 @@ namespace Common { ...@@ -1491,7 +1492,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, tribool legacy) unsigned int build, const char* extra, enum version_t version_type)
{ {
expstring_t ret_val = memptystr(); expstring_t ret_val = memptystr();
if ( product_number == NULL if ( product_number == NULL
...@@ -1503,11 +1504,15 @@ namespace Common { ...@@ -1503,11 +1504,15 @@ namespace Common {
return ret_val; return ret_val;
} }
if (product_number != NULL) { if (product_number != NULL) {
if (legacy != TTRUE && suffix != 0) { if (version_type == DOT_SEPARATED) {
ret_val = mputprintf(ret_val, "%d.%d.%d", suffix, release, patch);
return ret_val;
}
if (version_type == LEGACY_CAX && suffix != 0) {
ret_val = mputprintf(ret_val, "%d/", suffix); ret_val = mputprintf(ret_val, "%d/", suffix);
} }
ret_val = mputstr(ret_val, product_number); ret_val = mputstr(ret_val, product_number);
if (legacy == TTRUE && suffix != 0) { if (version_type == LEGACY_CRL && 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, ' ');
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* Cserveni, Akos * Cserveni, Akos
* Czerman, Oliver * Czerman, Oliver
* Delic, Adam * Delic, Adam
* Knapp, Adam
* Forstner, Matyas * Forstner, Matyas
* Gecse, Roland * Gecse, Roland
* Kovacs, Ferenc * Kovacs, Ferenc
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
#include <set> #include <set>
#include <string> #include <string>
#include "../common/dbgnew.hh" #include "../common/dbgnew.hh"
#include "../common/version.h"
#include "../common/ModuleVersion.hh" #include "../common/ModuleVersion.hh"
#include "CompilerError.hh" #include "CompilerError.hh"
...@@ -253,7 +255,7 @@ namespace Common { ...@@ -253,7 +255,7 @@ namespace Common {
unsigned int patch; unsigned int patch;
unsigned int build; unsigned int build;
char* extra; char* extra;
tribool legacy_version; enum version_t version_type;
/** @} */ /** @} */
friend class Ttcn::Module; friend class Ttcn::Module;
...@@ -369,7 +371,7 @@ namespace Common { ...@@ -369,7 +371,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, tribool legacy = TUNKNOWN); unsigned int build, const char* extra=NULL, enum version_t version_type = UNKNOWN);
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. */
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
* Baranyi, Botond * Baranyi, Botond
* Beres, Szabolcs * Beres, Szabolcs
* Delic, Adam * Delic, Adam
* Knapp, Adam
* Kovacs, Ferenc * Kovacs, Ferenc
* Raduly, Csaba * Raduly, Csaba
* Szabados, Kristof * Szabados, Kristof
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
* *
******************************************************************************/ ******************************************************************************/
#include "../../common/dbgnew.hh" #include "../../common/dbgnew.hh"
#include "../../common/version.h"
#include "AST_ttcn3.hh" #include "AST_ttcn3.hh"
#include "../Identifier.hh" #include "../Identifier.hh"
#include "../CompilerError.hh" #include "../CompilerError.hh"
...@@ -2989,8 +2991,8 @@ namespace Ttcn { ...@@ -2989,8 +2991,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;
tribool legacy; enum version_t version_type;
(void)ex.get_id(act_product_number, act_suffix, act_rel, act_patch, act_build, extra_junk, legacy); (void)ex.get_id(act_product_number, act_suffix, act_rel, act_patch, act_build, extra_junk, version_type);
if (release != UINT_MAX) { if (release != UINT_MAX) {
ex.error("Duplicate 'version' attribute"); ex.error("Duplicate 'version' attribute");
...@@ -3002,7 +3004,7 @@ namespace Ttcn { ...@@ -3002,7 +3004,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; this->version_type = version_type;
} }
// Avoid propagating the attribute needlessly // Avoid propagating the attribute needlessly
multi->delete_element(i--); multi->delete_element(i--);
...@@ -3014,9 +3016,9 @@ namespace Ttcn { ...@@ -3014,9 +3016,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; enum version_t version_type;
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, legacy); exp_suffix, exp_rel, exp_patch, exp_build, exp_extra, version_type);
// 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);
...@@ -3029,31 +3031,47 @@ namespace Ttcn { ...@@ -3029,31 +3031,47 @@ namespace Ttcn {
single = 0; single = 0;
break; break;
} else if (exp_product_number == NULL && } else if (exp_product_number == NULL &&
m->product_number != NULL && strcmp(m->product_number, "") > 0){ m->product_number != NULL && strlen(m->product_number) > 0){
ex.warning("Module '%s' requires module '%s' of any product" ex.warning("Module '%s' requires module '%s' of any product"
", 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) {
bool prod_match = false; bool prod_match = false;
if (legacy == m->legacy_version || (legacy != TFALSE && m->legacy_version != TFALSE)) { if (version_type == m->version_type) {
prod_match = (0 == strcmp(m->product_number, exp_product_number)); prod_match = (0 == strcmp(m->product_number, exp_product_number));
} }
else if (legacy == TTRUE && m->legacy_version == TFALSE) { else if (version_type == LEGACY_CRL && m->version_type == LEGACY_CAX) {
prod_match = (0 == strcmp(exp_product_number, LEGACY_CRL_PRODNR_EXECUTOR) && prod_match = (0 == strcmp(exp_product_number, LEGACY_CRL_PRODNR_EXECUTOR) &&
0 == strcmp(m->product_number, LEGACY_CAX_PRODNR_EXECUTOR)); 0 == strcmp(m->product_number, LEGACY_CAX_PRODNR_EXECUTOR));
} }
else if (legacy == TFALSE && m->legacy_version == TTRUE) { else if (version_type == LEGACY_CAX && m->version_type == LEGACY_CRL) {
prod_match = (0 == strcmp(exp_product_number, LEGACY_CAX_PRODNR_EXECUTOR) && prod_match = (0 == strcmp(exp_product_number, LEGACY_CAX_PRODNR_EXECUTOR) &&
0 == strcmp(m->product_number, LEGACY_CRL_PRODNR_EXECUTOR)); 0 == strcmp(m->product_number, LEGACY_CRL_PRODNR_EXECUTOR));
} }
else if (version_type == LEGACY_CRL && m->version_type == DOT_SEPARATED) {
prod_match = (0 == strcmp(exp_product_number, LEGACY_CRL_PRODNR_EXECUTOR) &&
0 == strlen(m->product_number));
}
else if (version_type == DOT_SEPARATED && m->version_type == LEGACY_CRL) {
prod_match = (0 == strlen(exp_product_number) &&
0 == strcmp(m->product_number, LEGACY_CRL_PRODNR_EXECUTOR));
}
else if (version_type == LEGACY_CAX && m->version_type == DOT_SEPARATED) {
prod_match = (0 == strcmp(exp_product_number, LEGACY_CAX_PRODNR_EXECUTOR) &&
0 == strlen(m->product_number));
}
else if (version_type == DOT_SEPARATED && m->version_type == LEGACY_CAX) {
prod_match = (0 == strlen(exp_product_number) &&
0 == strcmp(m->product_number, LEGACY_CAX_PRODNR_EXECUTOR));
}
if (!prod_match) { if (!prod_match) {
char *req_product_identifier = char *req_product_identifier =
get_product_identifier(exp_product_number, get_product_identifier(exp_product_number,
exp_suffix, exp_rel, exp_patch, exp_build, NULL, legacy); exp_suffix, exp_rel, exp_patch, exp_build, NULL, version_type);
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, NULL, m->legacy_version); m->suffix, m->release, m->patch, m->build, NULL, m->version_type);
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",
...@@ -3070,10 +3088,10 @@ namespace Ttcn { ...@@ -3070,10 +3088,10 @@ namespace Ttcn {
// 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, NULL, legacy); get_product_identifier(exp_product_number,exp_suffix, exp_rel, exp_patch, exp_build, NULL, version_type);
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, NULL, m->legacy_version); m->suffix, m->release, m->patch, m->build, NULL, m->version_type);
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",
...@@ -3113,10 +3131,11 @@ namespace Ttcn { ...@@ -3113,10 +3131,11 @@ 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;
tribool legacy; enum version_t version_type;
(void)ex.get_id(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build, exp_extra, legacy); (void)ex.get_id(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build, exp_extra, version_type);
if (exp_product_number != NULL && ((legacy != TTRUE && strcmp(exp_product_number, LEGACY_CAX_PRODNR_EXECUTOR) != 0) || if (exp_product_number != NULL && ((version_type == LEGACY_CAX && strcmp(exp_product_number, LEGACY_CAX_PRODNR_EXECUTOR) != 0) ||
(legacy == TTRUE && strcmp(exp_product_number, LEGACY_CRL_PRODNR_EXECUTOR) != 0))) { (version_type == LEGACY_CRL && strcmp(exp_product_number, LEGACY_CRL_PRODNR_EXECUTOR) != 0) ||
(version_type == DOT_SEPARATED && strlen(exp_product_number) != 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);
...@@ -3129,10 +3148,25 @@ namespace Ttcn { ...@@ -3129,10 +3148,25 @@ 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, NULL, legacy); get_product_identifier(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build, NULL, version_type);
char *tmp = "UNKNOWN";
switch(version_type) {
case LEGACY_CRL:
tmp = LEGACY_CRL_PRODUCT_NUMBER;
break;
case LEGACY_CAX:
tmp = LEGACY_CAX_PRODUCT_NUMBER;
break;
case DOT_SEPARATED:
tmp = PRODUCT_NUMBER;
break;
default:
// Do nothing
break;
}
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, legacy == TTRUE ? LEGACY_CRL_PRODUCT_NUMBER : LEGACY_CAX_PRODUCT_NUMBER); , exp_product_identifier, tmp);
Free(exp_product_identifier); Free(exp_product_identifier);
} }
multi->delete_element(i--); multi->delete_element(i--);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
* Balasko, Jeno * Balasko, Jeno
* Baranyi, Botond * Baranyi, Botond
* Delic, Adam * Delic, Adam
* Knapp, Adam
* Kovacs, Ferenc * Kovacs, Ferenc
* Raduly, Csaba * Raduly, Csaba
* Szabados, Kristof * Szabados, Kristof
...@@ -2725,13 +2726,32 @@ namespace Ttcn { ...@@ -2725,13 +2726,32 @@ namespace Ttcn {
} }
ExtensionAttribute::ExtensionAttribute(const char* ABCClass, int type_number, ExtensionAttribute::ExtensionAttribute(const char* ABCClass, int type_number,
int sequence, int suffix, Identifier *ver, tribool legacy) int sequence, int suffix, Identifier *ver, enum version_t version_type)
: Location(), type_(VERSION), value_() : Location(), type_(VERSION), value_()
{ {
if (ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()"); if (version_type != DOT_SEPARATED && ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
value_.version_.module_ = NULL; value_.version_.module_ = NULL;
value_.version_.legacy_ = legacy; value_.version_.version_type_ = version_type;
switch (version_type) {
case DOT_SEPARATED:
// In this case, 'type_number' and 'sequence' are used to pass the minor and patch part of the version
// major minor/release patch
if (suffix < 0 || type_number < 0 || sequence < 0) {
type_ = NONE;
return;
}
value_.version_.productNumber_ = mputc(value_.version_.productNumber_, '\0');
value_.version_.suffix_ = suffix;
value_.version_.release_ = type_number;
value_.version_.patch_ = sequence;
value_.version_.build_ = 99;
value_.version_.extra_ = NULL;
break;
case UNKNOWN:
case LEGACY_CRL:
case LEGACY_CAX:
check_product_number(ABCClass, type_number, sequence); check_product_number(ABCClass, type_number, sequence);
parse_version(ver); parse_version(ver);
if (type_ != NONE) { if (type_ != NONE) {
...@@ -2740,18 +2760,43 @@ namespace Ttcn { ...@@ -2740,18 +2760,43 @@ namespace Ttcn {
value_.version_.suffix_ = suffix; value_.version_.suffix_ = suffix;
delete ver; // "took care of it" delete ver; // "took care of it"
} }
break;
default:
FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
break;
}
} }
ExtensionAttribute::ExtensionAttribute(Identifier *mod, const char* ABCClass, ExtensionAttribute::ExtensionAttribute(Identifier *mod, const char* ABCClass,
int type_number, int sequence, int suffix, Identifier *ver, tribool legacy) int type_number, int sequence, int suffix, Identifier *ver, enum version_t version_type)
: Location(), type_(REQUIRES), value_() : Location(), type_(REQUIRES), value_()
{ {
if (mod == NULL || ver == NULL) if (version_type != DOT_SEPARATED && (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; value_.version_.version_type_ = version_type;
switch (version_type) {
case DOT_SEPARATED:
// In this case, 'type_number' and 'sequence' are used to pass the minor and patch part of the version
// major minor/release patch
if (suffix < 0 || type_number < 0 || sequence < 0) {
type_ = NONE;
return;
}
value_.version_.productNumber_ = mputc(value_.version_.productNumber_, '\0');
value_.version_.suffix_ = suffix;
value_.version_.release_ = type_number;
value_.version_.patch_ = sequence;
value_.version_.build_ = 99;
value_.version_.extra_ = NULL;
break;
case UNKNOWN:
case LEGACY_CRL:
case LEGACY_CAX:
check_product_number(ABCClass, type_number, sequence); check_product_number(ABCClass, type_number, sequence);
parse_version(ver); parse_version(ver);
if (type_ == NONE) { // parse_version reported an error if (type_ == NONE) { // parse_version reported an error
...@@ -2763,17 +2808,42 @@ namespace Ttcn { ...@@ -2763,17 +2808,42 @@ namespace Ttcn {
value_.version_.suffix_ = suffix; value_.version_.suffix_ = suffix;
delete ver; delete ver;
} }
break;
default:
FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
break;
}
} }
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, tribool legacy) int sequence, int suffix, Identifier* ver, extension_t et, enum version_t version_type)
: Location(), type_(et), value_() : Location(), type_(et), value_()
{ {
if (ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()"); if (version_type != DOT_SEPARATED && ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
value_.version_.legacy_ = legacy; value_.version_.version_type_ = version_type;
switch (et) { switch (et) {
case REQ_TITAN: case REQ_TITAN:
switch (version_type) {
case DOT_SEPARATED:
// In this case, 'type_number' and 'sequence' are used to pass the minor and patch part of the version
// major minor/release patch
if (suffix < 0 || type_number < 0 || sequence < 0) {
type_ = NONE;
return;
}
value_.version_.productNumber_ = mputc(value_.version_.productNumber_, '\0');
value_.version_.suffix_ = suffix;
value_.version_.release_ = type_number;
value_.version_.patch_ = sequence;
value_.version_.build_ = 99;
value_.version_.extra_ = NULL;
break;
case UNKNOWN:
case LEGACY_CRL:
case LEGACY_CAX:
check_product_number(ABCClass, type_number, sequence); check_product_number(ABCClass, type_number, sequence);
parse_version(ver); parse_version(ver);
if (type_ != NONE) { if (type_ != NONE) {
...@@ -2786,6 +2856,12 @@ namespace Ttcn { ...@@ -2786,6 +2856,12 @@ namespace Ttcn {
} }
break; break;
default:
FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
break;
}
break;
case VERSION_TEMPLATE: // RnXnn without the <>, must match exactly case VERSION_TEMPLATE: // RnXnn without the <>, must match exactly
if (ver->get_name() == version_template) { if (ver->get_name() == version_template) {
value_.version_.productNumber_ = NULL; value_.version_.productNumber_ = NULL;
...@@ -2944,7 +3020,7 @@ namespace Ttcn { ...@@ -2944,7 +3020,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, tribool& legacy) unsigned int& rel, unsigned int& patch, unsigned int& bld, char*& extra, enum version_t& version_type)
{ {
if ( type_ != REQUIRES && type_ != REQ_TITAN if ( type_ != REQUIRES && type_ != REQ_TITAN
&& type_ != VERSION && type_ != VERSION_TEMPLATE) { && type_ != VERSION && type_ != VERSION_TEMPLATE) {
...@@ -2956,7 +3032,7 @@ namespace Ttcn { ...@@ -2956,7 +3032,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_; version_type = value_.version_.version_type_;
return value_.version_.module_; return value_.version_.module_;