302 |
lt_dladderror (diagnostic) |
lt_dladderror (diagnostic) |
303 |
const char *diagnostic; |
const char *diagnostic; |
304 |
{ |
{ |
305 |
int index = 0; |
int errindex = 0; |
306 |
int result = -1; |
int result = -1; |
307 |
const char **temp = (const char **) 0; |
const char **temp = (const char **) 0; |
308 |
|
|
309 |
LT_DLMUTEX_LOCK (); |
LT_DLMUTEX_LOCK (); |
310 |
|
|
311 |
index = errorcount - LT_ERROR_MAX; |
errindex = errorcount - LT_ERROR_MAX; |
312 |
temp = LT_DLREALLOC (const char *, user_error_strings, 1 + index); |
temp = LT_DLREALLOC (const char *, user_error_strings, 1 + errindex); |
313 |
if (temp == 0) |
if (temp == 0) |
314 |
{ |
{ |
315 |
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); |
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); |
316 |
} |
} |
317 |
else |
else |
318 |
{ |
{ |
319 |
user_error_strings = temp; |
user_error_strings = temp; |
320 |
user_error_strings[index] = diagnostic; |
user_error_strings[errindex] = diagnostic; |
321 |
result = errorcount++; |
result = errorcount++; |
322 |
} |
} |
323 |
|
|
324 |
LT_DLMUTEX_UNLOCK (); |
LT_DLMUTEX_UNLOCK (); |
327 |
} |
} |
328 |
|
|
329 |
int |
int |
330 |
lt_dlseterror (index) |
lt_dlseterror (errindex) |
331 |
int index; |
int errindex; |
332 |
{ |
{ |
333 |
int errors = 0; |
int errors = 0; |
334 |
|
|
335 |
LT_DLMUTEX_LOCK (); |
LT_DLMUTEX_LOCK (); |
336 |
|
|
337 |
if (index >= errorcount || index < 0) |
if (errindex >= errorcount || errindex < 0) |
338 |
{ |
{ |
339 |
/* Ack! Error setting the error message! */ |
/* Ack! Error setting the error message! */ |
340 |
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE)); |
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE)); |
341 |
++errors; |
++errors; |
342 |
} |
} |
343 |
else if (index < LT_ERROR_MAX) |
else if (errindex < LT_ERROR_MAX) |
344 |
{ |
{ |
345 |
/* No error setting the error message! */ |
/* No error setting the error message! */ |
346 |
LT_DLMUTEX_SETERROR (lt_dlerror_strings[errorcount]); |
LT_DLMUTEX_SETERROR (lt_dlerror_strings[errorcount]); |
1392 |
} |
} |
1393 |
else |
else |
1394 |
{ |
{ |
|
const char *errormsg = 0; |
|
|
|
|
1395 |
presym_free_symlists(); |
presym_free_symlists(); |
1396 |
|
|
1397 |
LT_DLMUTEX_LOCK (); |
LT_DLMUTEX_LOCK (); |
1420 |
{ |
{ |
1421 |
/* shut down libltdl */ |
/* shut down libltdl */ |
1422 |
lt_dlloader *loader; |
lt_dlloader *loader; |
|
const char *errormsg; |
|
1423 |
int errors = 0; |
int errors = 0; |
1424 |
|
|
1425 |
LT_DLMUTEX_LOCK (); |
LT_DLMUTEX_LOCK (); |
1717 |
int result = 0; |
int result = 0; |
1718 |
int filenamesize = 0; |
int filenamesize = 0; |
1719 |
int lenbase = LT_DLSTRLEN (base_name); |
int lenbase = LT_DLSTRLEN (base_name); |
1720 |
char *filename, *canonical, *next; |
char *filename = 0; |
1721 |
|
char *canonical, *next; |
1722 |
|
|
1723 |
LT_DLMUTEX_LOCK (); |
LT_DLMUTEX_LOCK (); |
1724 |
|
|
1863 |
const char *base_name; |
const char *base_name; |
1864 |
lt_dlhandle *handle; |
lt_dlhandle *handle; |
1865 |
{ |
{ |
1866 |
foreach_dirinpath (search_path, base_name, find_handle_callback, handle, 0); |
if (!foreach_dirinpath (search_path, base_name, find_handle_callback, |
1867 |
|
handle, 0)) |
1868 |
|
return 0; |
1869 |
|
|
1870 |
return handle; |
return handle; |
1871 |
} |
} |
1872 |
|
|
2553 |
lt_ptr data1; |
lt_ptr data1; |
2554 |
lt_ptr data2; |
lt_ptr data2; |
2555 |
{ |
{ |
2556 |
int (*func) LT_PARAMS((const char *filename, lt_ptr data2)) |
int (*func) LT_PARAMS((const char *filename, lt_ptr data)) |
2557 |
= (int (*) LT_PARAMS((const char *filename, lt_ptr data2))) data1; |
= (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1; |
2558 |
|
|
2559 |
char *filename = 0; |
char *filename = 0; |
2560 |
int filenamesize = 0; |
int filenamesize = 0; |