Ticket #455: add_library_path.diff

File add_library_path.diff, 3.1 KB (added by jkeenan, 6 years ago)

Current state of work being done in the add_library_path_remove branch

  • DEPRECATED.pod

     
    205205 
    206206L<https://trac.parrot.org/parrot/ticket/443> 
    207207 
    208 =item Parrot_add_library_path [eligible in 1.1] 
    209  
    210 Will be renamed to C<Parrot_lib_add_path_from_cstring>. 
    211  
    212 L<https://trac.parrot.org/parrot/ticket/455> 
    213  
    214208=item parrot_new_pmc_hash [eligible in 1.5] 
    215209 
    216210This function will be removed.  parrot_new_hash should be used in its place. 
  • src/library.c

     
    594594 
    595595/* 
    596596 
    597 =item C<void Parrot_add_library_path(PARROT_INTERP, STRING *path, enum_lib_paths 
    598 which)> 
    599  
    600 Add a path to the library searchpath of the given type. 
    601  
    602 =cut 
    603  
    604 */ 
    605  
    606 PARROT_EXPORT 
    607 void 
    608 Parrot_add_library_path(PARROT_INTERP, 
    609         ARGIN(STRING *path), 
    610         enum_lib_paths which) 
    611 { 
    612     ASSERT_ARGS(Parrot_add_library_path) 
    613     PMC * const iglobals = interp->iglobals; 
    614     PMC * const lib_paths = VTABLE_get_pmc_keyed_int(interp, iglobals, 
    615         IGLOBALS_LIB_PATHS); 
    616     PMC * const paths = VTABLE_get_pmc_keyed_int(interp, lib_paths, which); 
    617     VTABLE_push_string(interp, paths, path); 
    618 } 
    619  
    620 /* 
    621  
    622597=item C<void Parrot_add_library_path_from_cstring(PARROT_INTERP, const char 
    623598*path, enum_lib_paths which)> 
    624599 
    625600Add a path to the library searchpath of the given type (passing in a C string). 
    626601 
    627 This function is just an interface to C<Parrot_add_library_path> for low-level 
    628 code. 
    629  
    630602=cut 
    631603 
    632604*/ 
     
    639611{ 
    640612    ASSERT_ARGS(Parrot_add_library_path_from_cstring) 
    641613    STRING * const path_str = Parrot_str_new(interp, path, 0); 
    642     Parrot_add_library_path(interp, path_str, which); 
     614    PMC * const iglobals = interp->iglobals; 
     615    PMC * const lib_paths = VTABLE_get_pmc_keyed_int(interp, iglobals, 
     616        IGLOBALS_LIB_PATHS); 
     617    PMC * const paths = VTABLE_get_pmc_keyed_int(interp, lib_paths, which); 
     618    VTABLE_push_string(interp, paths, path_str); 
    643619} 
    644620 
    645621/* 
  • src/packfile.c

     
    47724772    parrot_split_path_ext(interp, path, &found_path, &found_ext); 
    47734773    name_length = Parrot_str_length(interp, lang_name); 
    47744774    found_path = Parrot_str_substr(interp, found_path, -name_length, name_length, NULL, 0); 
    4775     Parrot_add_library_path(interp, Parrot_str_append(interp, found_path, CONST_STRING(interp, "include/")), 
     4775    Parrot_add_library_path_from_cstring(interp, Parrot_str_append(interp, found_path, "include/"), 
    47764776            PARROT_LIB_PATH_INCLUDE); 
    4777     Parrot_add_library_path(interp, Parrot_str_append(interp, found_path, CONST_STRING(interp, "dynext/")), 
     4777    Parrot_add_library_path_from_cstring(interp, Parrot_str_append(interp, found_path, "dynext/"), 
    47784778            PARROT_LIB_PATH_DYNEXT); 
    47794779 
    47804780