Changeset 15819 in project


Ignore:
Timestamp:
09/10/09 19:40:43 (10 years ago)
Author:
Kon Lovett
Message:

files, path-tests Fix for "empty" but absolute pathnames
library, runtime, chicken Better names for experimental "module" introspection
files Deprecated 'make-pathname' separator argument

Location:
chicken/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/chicken.h

    r15816 r15819  
    14501450C_fctexport C_word C_dbg_hook(C_word x);
    14511451
    1452 C_fctexport void C_loaded_modules( C_word c, C_word closure, C_word k ) C_noret;
    1453 C_fctexport void C_module_procedures( C_word c, C_word closure, C_word k, C_char *modnam ) C_noret;
    1454 
    14551452C_fctimport void C_ccall C_toplevel(C_word c, C_word self, C_word k) C_noret;
    14561453C_fctexport void C_ccall C_stop_timer(C_word c, C_word closure, C_word k) C_noret;
     
    15171514C_fctexport void C_ccall C_call_with_cthulhu(C_word c, C_word self, C_word k, C_word proc) C_noret;
    15181515C_fctexport void C_ccall C_copy_closure(C_word c, C_word closure, C_word k, C_word proc) C_noret;
     1516C_fctexport void C_loaded_libraries( C_word c, C_word closure, C_word k ) C_noret;
     1517C_fctexport void C_library_procedures( C_word c, C_word closure, C_word k, C_word modnam ) C_noret;
    15191518
    15201519#if !defined(__GNUC__) && !defined(__INTEL_COMPILER)
  • chicken/trunk/files.scm

    r15816 r15819  
    248248
    249249  (set! make-pathname
    250     (lambda (dirs file #!optional ext pds)
     250    (lambda (dirs file #!optional ext pds) ; The 'pds' argument is DEPRECATED
    251251      (_make-pathname 'make-pathname (canonicalize-dirs dirs pds) file ext pds)))
    252252
    253253  (set! make-absolute-pathname
    254     (lambda (dirs file #!optional ext pds)
     254    (lambda (dirs file #!optional ext pds) ; The 'pds' argument is DEPRECATED
    255255      (_make-pathname
    256256       'make-absolute-pathname
     
    371371      (let ((sep (if (eq? platform 'windows) #\\ #\/)))
    372372        (##sys#check-string path 'normalize-pathname)
    373 
    374         ;(absolute-pathname-root path)
    375 
    376373        (let ((len (##sys#size path))
    377374              (abspath #f)
     
    382379                     (set! parts (addpart (##sys#substring path prev i) parts)))
    383380                   (if (null? parts)
    384                        (##sys#string-append "." (string sep))
     381                       (if abspath
     382                           (##sys#string-append (string sep) ".")
     383                           (##sys#string-append "." (string sep)) )
    385384                       (let ((out (open-output-string))
    386385                             (parts (reverse parts)))
  • chicken/trunk/library.scm

    r15816 r15819  
    215215(define-foreign-variable strerror c-string "strerror(errno)")
    216216
    217 (define ##sys#loaded-modules (##core#primitive "C_loaded_modules"))
    218 (define ##sys#module-procedures (##core#primitive "C_module_procedures"))
    219 
    220217(define (set-gc-report! flag) (##core#inline "C_set_gc_report" flag))
    221218(define ##sys#gc (##core#primitive "C_gc"))
     
    255252(define ##sys#copy-closure (##core#primitive "C_copy_closure"))
    256253(define ##sys#apply-argument-limit (##sys#fudge 34))
     254(define ##sys#loaded-libraries (##core#primitive "C_loaded_libraries"))
     255(define ##sys#library-procedures (##core#primitive "C_library_procedures"))
    257256
    258257(define (##sys#block-set! x i y)
  • chicken/trunk/manual/Unit files

    r15813 r15819  
    2828==== make-absolute-pathname
    2929
    30 <procedure>(make-pathname DIRECTORY FILENAME [EXTENSION [SEPARATOR]])</procedure>
    31 <procedure>(make-absolute-pathname DIRECTORY FILENAME [EXTENSION [SEPARATOR]])</procedure>
     30<procedure>(make-pathname DIRECTORY FILENAME [EXTENSION])</procedure>
     31<procedure>(make-absolute-pathname DIRECTORY FILENAME [EXTENSION])</procedure>
    3232
    3333Returns a string that names the file with the
     
    4040and {{EXTENSION}} should be strings or {{#f}}.
    4141{{make-absolute-pathname}} returns always an absolute pathname.
     42
     43The {{[SEPARATOR]}} argument is deprecated.
    4244
    4345==== pathname-directory
  • chicken/trunk/runtime.c

    r15816 r15819  
    19001900
    19011901
     1902void C_unregister_lf(void *handle)
     1903{
     1904  LF_LIST *node = (LF_LIST *) handle;
     1905
     1906  if (node->next) node->next->prev = node->prev;
     1907
     1908  if (node->prev) node->prev->next = node->next;
     1909
     1910  if (lf_list == node) lf_list = node->next;
     1911
     1912  C_free(node->module_name);
     1913  C_free(node);
     1914}
     1915
     1916
    19021917LF_LIST *find_module_handle(char *name)
    19031918{
     
    19141929
    19151930void C_ccall
    1916 C_loaded_modules( C_word c, C_word closure, C_word k )
     1931C_loaded_libraries( C_word c, C_word closure, C_word k )
    19171932{
    19181933  LF_LIST *np;
    19191934  C_word mods = C_SCHEME_END_OF_LIST;
     1935
    19201936  for( np = lf_list; np; np = np->next ) {
    19211937    if( np->module_name ) {
     
    19241940    }
    19251941  }
     1942
    19261943  C_kontinue( k, mods );
    19271944}
     
    19291946
    19301947void C_ccall
    1931 C_module_procedures( C_word c, C_word closure, C_word k, C_char *modnam )
    1932 {
    1933   LF_LIST *mod;
     1948C_library_procedures( C_word c, C_word closure, C_word k, C_word modnam )
     1949{
     1950  LF_LIST *np;
    19341951  C_word prcs = C_SCHEME_END_OF_LIST;
    1935 #if 0
    1936   for( mod = find_module_handle( XXX( modnam ) ) ; mod; mod = mod->next ) {
    1937     C_PTABLE_ENTRY *pt = mod->ptable;
     1952
     1953  if( c != 3 ) C_bad_argc( c, 3 );
     1954
     1955  if( C_immediatep( modnam ) || C_STRING_TYPE != C_header_bits( modnam )  )
     1956    barf( C_BAD_ARGUMENT_TYPE_ERROR, "library-procedures", modnam );
     1957
     1958  for( np = find_module_handle( C_c_string( modnam ) ) ; np; np = np->next ) {
     1959    C_PTABLE_ENTRY *pt = np->ptable;
    19381960    if( pt ) {
    19391961      for( ; pt->id; ++pt ) {
     
    19431965    }
    19441966  }
    1945 #endif
     1967
    19461968  C_kontinue( k, prcs );
    1947 }
    1948 
    1949 
    1950 void C_unregister_lf(void *handle)
    1951 {
    1952   LF_LIST *node = (LF_LIST *) handle;
    1953 
    1954   if (node->next) node->next->prev = node->prev;
    1955 
    1956   if (node->prev) node->prev->next = node->next;
    1957 
    1958   if (lf_list == node) lf_list = node->next;
    1959 
    1960   C_free(node->module_name);
    1961   C_free(node);
    19621969}
    19631970
  • chicken/trunk/tests/path-tests.scm

    r15813 r15819  
    2929(test "./" (normalize-pathname "" 'unix))
    3030(test ".\\" (normalize-pathname "" 'windows))
    31 ;this is weird
    32 (test "./" (normalize-pathname "/" 'unix))
    33 (test "./" (normalize-pathname "/./" 'unix))
    34 (test "./" (normalize-pathname "/." 'unix))
     31(test "/../" (normalize-pathname "/../"))
     32(test "/." (normalize-pathname "/abc/../."))
     33(test "/." (normalize-pathname "/" 'unix))
     34(test "/." (normalize-pathname "/./" 'unix))
     35(test "/." (normalize-pathname "/." 'unix))
    3536(test "./" (normalize-pathname "./" 'unix))
    3637(test "a" (normalize-pathname "a"))
     
    6566
    6667(test '(#f "/" (".")) (receive (decompose-directory "/.//")))
    67 ; 'normalize-pathname' can be weird
    68 (test '(#f #f (".")) (receive (decompose-directory (normalize-pathname "/.//"))))
     68(test '(#f "/" (".")) (receive (decompose-directory (normalize-pathname "/.//"))))
    6969(test '(#f "/" #f) (receive (decompose-directory "///\\///")))
    7070(test '(#f "/" ("foo")) (receive (decompose-directory "//foo//")))
Note: See TracChangeset for help on using the changeset viewer.