diff --git a/src/include/codeb.c b/src/include/codeb.c index 43841a488..5d7279f26 100755 --- a/src/include/codeb.c +++ b/src/include/codeb.c @@ -17,8 +17,11 @@ #define XVT_INCL_NATIVE #include #define S4OFF_REPORT -//#define S4DLL -//#define S4WIN32 + +#if XVT_OS == XVT_OS_WIN32 + #define S4DLL + #define S4WIN32 +#endif #include #include @@ -1196,3 +1199,21 @@ long DB_version(char* str, int maxstr) sprintf(str, "Codebase %d.%03d", S4VERSION/1000, S4VERSION%1000); return S4VERSION; } + +long double DB_pos_perc(int handle) +{ + TAG4* t = NULL; + long double perc; + HANDLE2DATA(handle, data); + + t = d4tagDefault(data); + if (t != NULL) + { + if (tfile4position2(t->tagFile, &perc) < 0) + { + perc = 0.0; + return DB_get_error(); + } + } + return perc; +} \ No newline at end of file diff --git a/src/include/codeb.h b/src/include/codeb.h index fbf7803d8..f2d19c838 100755 --- a/src/include/codeb.h +++ b/src/include/codeb.h @@ -67,6 +67,7 @@ extern "C" { long DB_getconf(); long DB_changed(int handle); /* returns true if the index of the key is changed */ long DB_version(char* str, int maxstr); + long double DB_pos_perc(int handle); #ifdef __cplusplus }; #endif