Mercurial > hg > octave-nkf
comparison liboctave/oct-shlib.cc @ 10314:07ebe522dac2
untabify liboctave C++ sources
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 11 Feb 2010 12:23:32 -0500 |
parents | 4c0cdbe0acca |
children | 65d5776379c3 |
comparison
equal
deleted
inserted
replaced
10313:f3b65e1ae355 | 10314:07ebe522dac2 |
---|---|
215 dlclose (library); | 215 dlclose (library); |
216 } | 216 } |
217 | 217 |
218 void * | 218 void * |
219 octave_dlopen_shlib::search (const std::string& name, | 219 octave_dlopen_shlib::search (const std::string& name, |
220 octave_shlib::name_mangler mangler) | 220 octave_shlib::name_mangler mangler) |
221 { | 221 { |
222 void *function = 0; | 222 void *function = 0; |
223 | 223 |
224 if (is_open ()) | 224 if (is_open ()) |
225 { | 225 { |
226 std::string sym_name = name; | 226 std::string sym_name = name; |
227 | 227 |
228 if (mangler) | 228 if (mangler) |
229 sym_name = mangler (name); | 229 sym_name = mangler (name); |
230 | 230 |
231 function = dlsym (library, sym_name.c_str ()); | 231 function = dlsym (library, sym_name.c_str ()); |
232 } | 232 } |
233 else | 233 else |
234 (*current_liboctave_error_handler) | 234 (*current_liboctave_error_handler) |
283 shl_unload (library); | 283 shl_unload (library); |
284 } | 284 } |
285 | 285 |
286 void * | 286 void * |
287 octave_shl_load_shlib::search (const std::string& name, | 287 octave_shl_load_shlib::search (const std::string& name, |
288 octave_shlib::name_mangler mangler) | 288 octave_shlib::name_mangler mangler) |
289 { | 289 { |
290 void *function = 0; | 290 void *function = 0; |
291 | 291 |
292 if (is_open ()) | 292 if (is_open ()) |
293 { | 293 { |
294 std::string sym_name = name; | 294 std::string sym_name = name; |
295 | 295 |
296 if (mangler) | 296 if (mangler) |
297 sym_name = mangler (name); | 297 sym_name = mangler (name); |
298 | 298 |
299 int status = shl_findsym (&library, sym_name.c_str (), | 299 int status = shl_findsym (&library, sym_name.c_str (), |
300 TYPE_UNDEFINED, &function); | 300 TYPE_UNDEFINED, &function); |
301 } | 301 } |
302 else | 302 else |
303 (*current_liboctave_error_handler) | 303 (*current_liboctave_error_handler) |
304 ("shared library %s is not open", file.c_str ()); | 304 ("shared library %s is not open", file.c_str ()); |
305 | 305 |
376 void * octave_w32_search (HINSTANCE handle, const char * name); | 376 void * octave_w32_search (HINSTANCE handle, const char * name); |
377 } | 377 } |
378 | 378 |
379 void * | 379 void * |
380 octave_w32_shlib::search (const std::string& name, | 380 octave_w32_shlib::search (const std::string& name, |
381 octave_shlib::name_mangler mangler) | 381 octave_shlib::name_mangler mangler) |
382 { | 382 { |
383 void *function = 0; | 383 void *function = 0; |
384 | 384 |
385 if (is_open ()) | 385 if (is_open ()) |
386 { | 386 { |
387 std::string sym_name = name; | 387 std::string sym_name = name; |
388 | 388 |
389 if (mangler) | 389 if (mangler) |
390 sym_name = mangler (name); | 390 sym_name = mangler (name); |
391 | 391 |
392 function = octave_w32_library_search (handle, sym_name.c_str ()); | 392 function = octave_w32_library_search (handle, sym_name.c_str ()); |
393 } | 393 } |
394 else | 394 else |
395 (*current_liboctave_error_handler) | 395 (*current_liboctave_error_handler) |
450 | 450 |
451 if (! errstr) | 451 if (! errstr) |
452 errstr = "unspecified error"; | 452 errstr = "unspecified error"; |
453 | 453 |
454 (*current_liboctave_error_handler) | 454 (*current_liboctave_error_handler) |
455 ("%s: %s", file.c_str (), errstr); | 455 ("%s: %s", file.c_str (), errstr); |
456 } | 456 } |
457 } | 457 } |
458 else | 458 else |
459 { | 459 { |
460 (*current_liboctave_error_handler) | 460 (*current_liboctave_error_handler) |
473 NSDestroyObjectFileImage (img); | 473 NSDestroyObjectFileImage (img); |
474 } | 474 } |
475 | 475 |
476 void * | 476 void * |
477 octave_dyld_shlib::search (const std::string& name, | 477 octave_dyld_shlib::search (const std::string& name, |
478 octave_shlib::name_mangler mangler) | 478 octave_shlib::name_mangler mangler) |
479 { | 479 { |
480 void *function = 0; | 480 void *function = 0; |
481 | 481 |
482 if (is_open ()) | 482 if (is_open ()) |
483 { | 483 { |
484 std::string sym_name = name; | 484 std::string sym_name = name; |
485 | 485 |
486 if (mangler) | 486 if (mangler) |
487 sym_name = mangler (name); | 487 sym_name = mangler (name); |
488 | 488 |
489 NSSymbol symbol = NSLookupSymbolInModule (handle, sym_name.c_str ()); | 489 NSSymbol symbol = NSLookupSymbolInModule (handle, sym_name.c_str ()); |
490 | 490 |
491 if (symbol) | 491 if (symbol) |
492 { | 492 { |
493 function = NSAddressOfSymbol (symbol); | 493 function = NSAddressOfSymbol (symbol); |
494 } | 494 } |
495 } | 495 } |
496 else | 496 else |
497 (*current_liboctave_error_handler) | 497 (*current_liboctave_error_handler) |
498 ("bundle %s is not open", file.c_str ()); | 498 ("bundle %s is not open", file.c_str ()); |
499 | 499 |