Skip to content

Commit 06e85f9

Browse files
Merge pull request #66 from scanoss/5.4.1
Add encoder lib version log
2 parents 8f90eb2 + 6baa857 commit 06e85f9

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

inc/decrypt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
extern char * (*decrypt_data) (uint8_t *data, uint32_t size, struct ldb_table table, uint8_t *key, uint8_t *subkey);
77
extern void (*decrypt_mz) (uint8_t *data, uint32_t len);
8+
extern void (*encoder_version) (char * version);
89

910
char * standalone_decrypt_data(uint8_t *data, uint32_t size,struct ldb_table table, uint8_t *key, uint8_t *subkey);
1011

src/decrypt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
char * (*decrypt_data) (uint8_t *data, uint32_t size, struct ldb_table table, uint8_t *key, uint8_t *subkey);
3939
void (*decrypt_mz) (uint8_t *data, uint32_t len);
40+
void (*encoder_version) (char * version);
4041
/**
4142
* @brief Decrypt data function pointer. Will be executed for the ldb_fetch_recordset function in each iteration. See LDB documentation for more details.
4243
* @param data //TODO

src/main.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,10 @@ bool lib_encoder_load()
229229
scanlog("Lib scanoss-enocder present\n");
230230
decrypt_data = dlsym(lib_encoder_handle, "scanoss_decode_table");
231231
decrypt_mz = dlsym(lib_encoder_handle, "scanoss_decode_mz");
232+
encoder_version = dlsym(lib_encoder_handle, "scanoss_encoder_version");
232233
if ((err = dlerror()))
233234
{
234-
printf("%s\n", err);
235+
printf("%s - You may need to update libscanoss_encoder.so\n", err);
235236
exit(EXIT_FAILURE);
236237
}
237238
return true;
@@ -377,7 +378,11 @@ int main(int argc, char **argv)
377378
quiet = true;
378379
scanlog("Quiet mode enabled. Displaying only debugging info via STDERR.\n");
379380
if (lib_encoder_present)
380-
scanlog("Lib encoder present.\n");
381+
{
382+
char version[32] = "\0";
383+
encoder_version(version);
384+
scanlog("Lib encoder present - version %s\n", version);
385+
}
381386
break;
382387

383388
case 'd':

0 commit comments

Comments
 (0)