diff options
author | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-10-28 10:37:08 +0200 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-10-28 10:37:08 +0200 |
commit | 0d2cf007fbc852d2b9a745d792f7d4626dbe14f6 (patch) | |
tree | ff66380f1a57a267ee5b5f2bb2a2d37e02dc2e9c | |
parent | 62c994014e24b3eee0bf1da5b09d8c797bd5b4f3 (diff) | |
download | DLT-daemon-0d2cf007fbc852d2b9a745d792f7d4626dbe14f6.tar.gz |
Reverted changes in dlt_register_app() function.
Added new dlt_check_library_version() function.
-rwxr-xr-x | include/dlt/dlt_user.h | 10 | ||||
-rwxr-xr-x | include/dlt/dlt_user_macros.h | 3 | ||||
-rwxr-xr-x | src/examples/dlt-example-user-func.c | 2 | ||||
-rwxr-xr-x | src/lib/dlt_user.c | 9 |
4 files changed, 17 insertions, 7 deletions
diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h index 9fc5df4..db5b954 100755 --- a/include/dlt/dlt_user.h +++ b/include/dlt/dlt_user.h @@ -394,12 +394,20 @@ int dlt_init_file(const char *name); int dlt_free(); /** + * Check the library version of DLT library. + * @param user_major_version the major version to be compared + * @param user_minor_version the minor version to be compared + * @return negative value if there was an error + */ +int dlt_check_library_version(const char * user_major_version, const char * user_minor_version); + +/** * Register an application in the daemon. * @param appid four byte long character array with the application id * @param description long name of the application * @return negative value if there was an error */ -int dlt_register_app(const char *appid, const char * description, const char * user_major_version, const char * user_minor_version); +int dlt_register_app(const char *appid, const char * description); /** * Unregister an application in the daemon. diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h index 979026a..c9b19c9 100755 --- a/include/dlt/dlt_user_macros.h +++ b/include/dlt/dlt_user_macros.h @@ -115,7 +115,8 @@ extern DltContext CONTEXT; * @param DESCRIPTION ASCII string containing description */ #define DLT_REGISTER_APP(APPID,DESCRIPTION) \ - dlt_register_app( APPID, DESCRIPTION, PACKAGE_MAJOR_VERSION, PACKAGE_MINOR_VERSION ); + dlt_check_library_version(PACKAGE_MAJOR_VERSION, PACKAGE_MINOR_VERSION ); \ + dlt_register_app( APPID, DESCRIPTION); /** diff --git a/src/examples/dlt-example-user-func.c b/src/examples/dlt-example-user-func.c index 8939f1b..2180a6b 100755 --- a/src/examples/dlt-example-user-func.c +++ b/src/examples/dlt-example-user-func.c @@ -217,7 +217,7 @@ int main(int argc, char* argv[]) } } - dlt_register_app("LOG","Test Application for Logging", PACKAGE_MAJOR_VERSION,PACKAGE_MINOR_VERSION); + dlt_register_app("LOG","Test Application for Logging"); dlt_register_context(&mycontext,"TEST","Test Context for Logging"); diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c index 4093c84..58032f5 100755 --- a/src/lib/dlt_user.c +++ b/src/lib/dlt_user.c @@ -396,9 +396,12 @@ int dlt_free(void) return 0; } +int dlt_check_library_version(const char * user_major_version,const char * user_minor_version) +{ + return dlt_user_check_library_version(user_major_version, user_minor_version); +} - -int dlt_register_app(const char *appid, const char * description, const char * user_major_version,const char * user_minor_version) +int dlt_register_app(const char *appid, const char * description) { int ret; @@ -408,8 +411,6 @@ int dlt_register_app(const char *appid, const char * description, const char * u { return -1; } - - dlt_user_check_library_version(user_major_version, user_minor_version); } if ((appid==0) || (appid[0]=='\0')) |