Changeset 5347:1d76e45ebfd1 in roaraudio for roarclients


Ignore:
Timestamp:
12/10/11 01:34:28 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added some support and handling code for libdeps. currently it can be parsed and if there is libdep info in a file loading is canceled because we can not load additional stuff at the moment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarpluginrunner.c

    r5346 r5347  
    9494 struct roar_dl_libraryinst * (*func)(struct roar_dl_librarypara * para); 
    9595 struct roar_dl_libraryinst * lib; 
    96  int libok = 0, libnameok = 0; 
     96 int libok = 0, libnameok = 0, libdepok = 0; 
    9797 int tmp; 
    9898 int i; 
     99 size_t iter; 
     100 char c; 
    99101 
    100102 if ( lhandle == NULL ) 
     
    154156                                                      lib->libname->len == sizeof(*(lib->libname)) ? "" : "no "); 
    155157   if ( libnameok ) { 
    156 #define _ps(c,name) \ 
     158#define _ps(k,name) \ 
    157159    tmp = (lib->libname->name) != NULL; \ 
    158     printf("|   %c-> %-15s = %s%s%s\n", (c), #name, tmp ? "\"" : "", \ 
     160    printf("|   %c-> %-15s = %s%s%s\n", (k), #name, tmp ? "\"" : "", \ 
    159161                                    tmp ? (lib->libname->name) : "<not set>", tmp ? "\"" : ""); 
    160162 
     
    173175  printf("|-> global_data_init    = %s\n", _ptrrange2str(lib->global_data_init, lib->global_data_len)); 
    174176  printf("|-> global_data_pointer = %s\n", _ptr2str(lib->global_data_pointer)); 
    175   printf("|-> libdep              = %s\n", _ptr2str(lib->libdep)); 
    176   printf("|-> libdep_len          = %zu\n", lib->libdep_len); 
     177  if ( lib->libdep != NULL && lib->libdep_len ) { 
     178   printf("|-> libdep              = %s\n", _ptr2str(lib->libdep)); 
     179   for (iter = 0; iter < lib->libdep_len; iter++) { 
     180    printf("|   %c-> Table entry %zu   = %p\n", iter == (lib->libdep_len-1) ? '\\' : '|', iter, &(lib->libdep[iter])); 
     181    c = iter == (lib->libdep_len-1) ? ' ' : '|'; 
     182    if ( lib->libdep[iter].version == ROAR_DL_LIBDEP_VERSION && 
     183         lib->libdep[iter].len     == sizeof(struct roar_dl_librarydep) ) { 
     184     libdepok = 1; 
     185    } else { 
     186     libdepok = 0; 
     187    } 
     188    printf("|   %c   |-> version     = %i (%smatch)\n", c, lib->libdep[iter].version, 
     189                                                        lib->libdep[iter].version == ROAR_DL_LIBDEP_VERSION ? "" : "no "); 
     190    printf("|   %c   %c-> len         = %zu (%smatch)\n", c, libdepok ? '|' : '\\', 
     191                                                       lib->libdep[iter].len, 
     192                                                       lib->libdep[iter].len == sizeof(struct roar_dl_librarydep) ? 
     193                                                       "" : "no "); 
     194    if ( libdepok ) { 
     195     printf("|   %c   |-> flags       = 0x%.8lX\n", c, (unsigned long int)lib->libdep[iter].flags); 
     196#define _ps(k,name) \ 
     197    tmp = (lib->libdep[iter].name) != NULL; \ 
     198    printf("|   %c   %c-> %-11s = %s%s%s\n", c, (k), #name, tmp ? "\"" : "", \ 
     199                                    tmp ? (lib->libdep[iter].name) : "<not set>", tmp ? "\"" : ""); 
     200     _ps('|', name); 
     201     _ps('|', libname); 
     202     _ps('\\', abiversion); 
     203#undef _ps 
     204    } 
     205   } 
     206   printf("|-> libdep_len          = %zu\n", lib->libdep_len); 
     207  } else if ( (lib->libdep == NULL && lib->libdep_len) || (lib->libdep != NULL && !lib->libdep_len) ) { 
     208   printf("|-> libdep              = %s (invalid)\n", _ptr2str(lib->libdep)); 
     209   printf("|-> libdep_len          = %zu (invalid)\n", lib->libdep_len); 
     210  } 
    177211  printf("\\-> appsched            = %s\n", _ptr2str(lib->appsched)); 
    178212  if ( lib->appsched != NULL ) { 
Note: See TracChangeset for help on using the changeset viewer.