Ticket #560: parrot_libloading_3.patch
File parrot_libloading_3.patch, 2.9 KB (added by wayland, 13 years ago) |
---|
-
src/library.c
768 768 769 769 /* 770 770 771 =item C<STRING* Parrot_path_str> 772 773 Returns a STRING that contains the specified path, separated by colons (:). 774 775 The C<enum_runtime_ft type> is one or more of the types defined in 776 F<include/parrot/library.h>. 777 778 =cut 779 780 */ 781 782 PARROT_EXPORT 783 PARROT_WARN_UNUSED_RESULT 784 PARROT_CAN_RETURN_NULL 785 STRING* 786 Parrot_path_str(PARROT_INTERP, enum_runtime_ft type) 787 { 788 ASSERT_ARGS(Parrot_path_str) 789 STRING *prefix; 790 STRING *full_path; 791 PMC *paths; 792 INTVAL i, n; 793 794 /* TODO: Get the real separator, not this hacked-together stuff */ 795 #ifdef WIN32 796 STRING * const envpathsep = CONST_STRING(interp, ";"); 797 #else 798 STRING * const envpathsep = CONST_STRING(interp, ":"); 799 #endif 800 801 if (type & PARROT_RUNTIME_FT_DYNEXT) 802 paths = get_search_paths(interp, PARROT_LIB_PATH_DYNEXT); 803 else if (type & (PARROT_RUNTIME_FT_PBC | PARROT_RUNTIME_FT_SOURCE)) 804 paths = get_search_paths(interp, PARROT_LIB_PATH_LIBRARY); 805 else 806 paths = get_search_paths(interp, PARROT_LIB_PATH_INCLUDE); 807 808 full_path = Parrot_str_join(interp, envpathsep, paths); 809 810 return full_path; 811 } 812 813 /* 814 771 815 =item C<char* Parrot_get_runtime_prefix(PARROT_INTERP)> 772 816 773 817 Return a malloced C-string for the runtime prefix. The calling function -
src/dynext.c
620 620 /* 621 621 * XXX Parrot_ex_throw_from_c_args? return PMCNULL? 622 622 * PMC Undef seems convenient, because it can be queried with get_bool() 623 * -- 624 * Changed to Parrot_ex_throw_from_c_args because silently continuing and 625 * giving weird errors later is not a cool look - wayland/Tim Nelson 623 626 */ 624 return pmc_new(interp, enum_class_Undef); 627 /* return pmc_new(interp, enum_class_Undef); */ 628 629 path = Parrot_path_str(interp, PARROT_RUNTIME_FT_DYNEXT); 630 631 Parrot_ex_throw_from_c_args(interp, NULL, 632 EXCEPTION_LIBRARY_ERROR, 633 "Parrot VM: Can't load library '%Ss'; searched path %Ss\n", 634 wo_ext, path); 625 635 } 626 636 627 637 return run_init_lib(interp, handle, lib_name, wo_ext); -
include/parrot/library.h
83 83 __attribute__nonnull__(2) 84 84 FUNC_MODIFIES(*file); 85 85 86 PARROT_EXPORT 87 PARROT_WARN_UNUSED_RESULT 88 PARROT_CAN_RETURN_NULL 89 STRING* Parrot_path_str(PARROT_INTERP, 90 enum_runtime_ft type) 91 __attribute__nonnull__(1); 92 86 93 void parrot_init_library_paths(PARROT_INTERP) 87 94 __attribute__nonnull__(1); 88 95