Changeset 11646 in project


Ignore:
Timestamp:
08/14/08 11:50:52 (11 years ago)
Author:
felix winkelmann
Message:

merged with trunk rev. 11635; compiler bugfix; added files import lib

Location:
chicken/branches/hygienic
Files:
1 added
37 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/hygienic/Makefile

    r10952 r11646  
    2525# POSSIBILITY OF SUCH DAMAGE.
    2626
     27STANDARD_TARGETS \
     28        = all clean distclean spotless install uninstall confclean check \
     29          fullcheck dist libs install-libs bootstrap
     30SRCDIR = .
    2731
    28 .PHONY: all clean distclean spotless install uninstall confclean check dist \
    29         libs install-libs fullcheck bootstrap
     32.PHONY: $(STANDARD_TARGETS)
    3033
    3134ifndef PLATFORM
    32 all clean spotless distclean install uninstall:
     35$(STANDARD_TARGETS):
    3336        @echo "no PLATFORM given."
    3437        @echo ""
     
    4952else
    5053all:
    51         $(MAKE) -f Makefile.$(PLATFORM) all
     54        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) all
    5255clean:
    53         $(MAKE) -f Makefile.$(PLATFORM) clean
     56        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) clean
    5457distclean:
    55         $(MAKE) -f Makefile.$(PLATFORM) distclean
     58        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) distclean
    5659spotless:
    57         $(MAKE) -f Makefile.$(PLATFORM) spotless
     60        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) spotless
    5861install:
    59         $(MAKE) -f Makefile.$(PLATFORM) install
     62        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) install
    6063uninstall:
    61         $(MAKE) -f Makefile.$(PLATFORM) uninstall
     64        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) uninstall
    6265confclean:
    63         $(MAKE) -f Makefile.$(PLATFORM) confclean
     66        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) confclean
    6467check:
    65         $(MAKE) -f Makefile.$(PLATFORM) check
     68        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) check
    6669fullcheck:
    67         $(MAKE) -f Makefile.$(PLATFORM) fullcheck
     70        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) fullcheck
    6871dist:
    69         $(MAKE) -f Makefile.$(PLATFORM) distfiles
     72        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) distfiles
    7073        csi -s scripts/makedist.scm
    7174libs:
    72         $(MAKE) -f Makefile.$(PLATFORM) libs
     75        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) libs
    7376install-libs:
    74         $(MAKE) -f Makefile.$(PLATFORM) install-libs
     77        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) install-libs
    7578bootstrap:
    76         $(MAKE) -f Makefile.$(PLATFORM) bootstrap
     79        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) bootstrap
    7780endif
  • chicken/branches/hygienic/Makefile.bsd

    r11219 r11646  
    2626
    2727
     28SRCDIR = .
     29VPATH  = $(SRCDIR)
     30
    2831# platform configuration
    2932
    30 ARCH = $(shell sh config-arch.sh)
     33ARCH = $(shell sh $(SRCDIR)/config-arch.sh)
    3134
    3235# options
     
    5053# select default and internal settings
    5154
    52 include defaults.make
     55include $(SRCDIR)/defaults.make
    5356
    5457chicken-config.h: chicken-defaults.h
     
    9295        cat chicken-defaults.h >>$@
    9396
    94 include rules.make
     97include $(SRCDIR)/rules.make
  • chicken/branches/hygienic/Makefile.cross-linux-mingw

    r11573 r11646  
    2525# POSSIBILITY OF SUCH DAMAGE.
    2626
     27
     28SRCDIR = .
     29VPATH  = $(SRCDIR)
    2730
    2831# platform configuration
     
    7376# select default and internal settings
    7477
    75 include defaults.make
     78include $(SRCDIR)/defaults.make
    7679
    7780# main target
     
    131134        cat chicken-defaults.h >>$@
    132135
    133 include rules.make
     136include $(SRCDIR)/rules.make
  • chicken/branches/hygienic/Makefile.cygwin

    r11573 r11646  
    2626
    2727
     28SRCDIR = .
     29VPATH  = $(SRCDIR)
     30
    2831# platform configuration
    2932
    3033ARCH = x86
    3134HACKED_APPLY=1
     35DLLSINPATH = 1
    3236
    3337# options
     
    6670
    6771LIBRARIES = -lm
    68 LIBCHICKEN_SO_LIBRARIES = -lm
    69 LIBUCHICKEN_SO_LIBRARIES = -lm
    7072LIBCHICKEN_IMPORT_LIBRARY = libchicken.dll.a
    7173LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a
     
    8082
    8183CUSTOM_CHICKEN_DEFAULTS=1
    82 include defaults.make
     84include $(SRCDIR)/defaults.make
     85
     86LIBCHICKEN_SO_LIBRARIES = $(LIBRARIES)
     87LIBUCHICKEN_SO_LIBRARIES = $(LIBRARIES)
    8388
    8489chicken-config.h: chicken-defaults.h buildsvnrevision
     
    218223        echo "#endif" >>$@
    219224
    220 include rules.make
     225include $(SRCDIR)/rules.make
  • chicken/branches/hygienic/Makefile.linux

    r11219 r11646  
    2626
    2727
     28SRCDIR = .
     29VPATH  = $(SRCDIR)
     30
    2831# platform configuration
    2932
    30 ARCH = $(shell sh config-arch.sh)
     33ARCH = $(shell sh $(SRCDIR)/config-arch.sh)
    3134
    3235# options
     
    5356# select default and internal settings
    5457
    55 include defaults.make
     58include $(SRCDIR)/defaults.make
    5659
    5760chicken-config.h: chicken-defaults.h
     
    100103        cat chicken-defaults.h >>$@
    101104
    102 include rules.make
     105include $(SRCDIR)/rules.make
  • chicken/branches/hygienic/Makefile.macosx

    r11031 r11646  
    2626
    2727
     28SRCDIR = .
     29VPATH  = $(SRCDIR)
     30
    2831# platform configuration
    2932
    30 ARCH = $(shell sh config-arch.sh)
     33ARCH = $(shell sh $(SRCDIR)/config-arch.sh)
    3134
    3235# commands
     
    5861# select default and internal settings
    5962
    60 include defaults.make
     63include $(SRCDIR)/defaults.make
    6164
    6265chicken-config.h: chicken-defaults.h
     
    126129endif
    127130
    128 include rules.make
     131include $(SRCDIR)/rules.make
  • chicken/branches/hygienic/Makefile.mingw

    r8361 r11646  
    2525# POSSIBILITY OF SUCH DAMAGE.
    2626
     27
     28SRCDIR = .
     29VPATH  = $(SRCDIR)
    2730
    2831# platform configuration
     
    7275CUSTOM_CHICKEN_DEFAULTS=1
    7376
    74 include defaults.make
     77include $(SRCDIR)/defaults.make
    7578
    7679# main target
     
    207210        echo #endif >>$@
    208211
    209 include rules.make
     212include $(SRCDIR)/rules.make
  • chicken/branches/hygienic/Makefile.mingw-msys

    r8361 r11646  
    2525# POSSIBILITY OF SUCH DAMAGE.
    2626
     27
     28SRCDIR = .
     29VPATH  = $(SRCDIR)
    2730
    2831# platform configuration
     
    6871# select default and internal settings
    6972
    70 include defaults.make
     73include $(SRCDIR)/defaults.make
    7174
    7275# main target
     
    118121        cat chicken-defaults.h >>$@
    119122
    120 include rules.make
     123include $(SRCDIR)/rules.make
  • chicken/branches/hygienic/Makefile.solaris

    r10209 r11646  
    2626
    2727
     28SRCDIR = .
     29VPATH  = $(SRCDIR)
     30
    2831# platform configuration
    2932
    30 ARCH = $(shell sh config-arch.sh)
     33ARCH = $(shell sh $SRCDIR/config-arch.sh)
    3134
    3235# options
     
    4851# select default and internal settings
    4952
    50 include defaults.make
     53include $(SRCDIR)/defaults.make
    5154
    5255chicken-config.h: chicken-defaults.h
     
    9093        cat chicken-defaults.h >>$@
    9194
    92 include rules.make
     95include $(SRCDIR)/rules.make
  • chicken/branches/hygienic/NEWS

    r11528 r11646  
    3535    define-extension
    3636
    37 3.2.7
    38 
    39 - a different approach to creating a versioned shared library
    40 
    41 3.2.6
    42 
     373.3.8
     38
     39- Bug fix in thread-terminate! [thanks to Joerg Wittenberger]
     40
     413.3.6
     42
     43- Cygwin build patched to put the runtime libraries in the right place.
     44  [thanks to Nathan Thern]
     45
     463.3.5
     47
     48- added support for out-of-tree compilation (via the SRCDIR variable)
     49  [thanks to Ivan Shmakov]
     50- bug fix for (string->number "/")
     51
     52
     533.3.2
     54
     55- support for selective procedure profiling in the compiler
     56- unit utils: moved file- and pathname-related procedures to unit files
     57- new unit files
     58
     593.3.0
     60
     61- bug fix for bitwise-or use [Joerg Wittenberger]
    4362- bug fixes for tickets  393, 430, 436
    4463- bug fix pointer->address
    45 
    46 3.2.5
    47 
    48 - bug fix in versioned symlink for shared library in rules.make
    49 
    50 3.2.4
    51 
    5264- the build system now sets the SONAME field of libchicken.so under Linux
    5365- fixed an allocation bug in decode_literal
    54 
    55 3.2.3
    56 
    5766- some fixes to the build system when USE_HOST_PCRE is set
    58 
    59 3.2.2
    60 
    6167- added use of unit ports to unit extras and chicken-setup
    62 
    63 3.2.1
    64 
    6568- unit utils and extras: moved port extensions to unit ports
    6669- new unit ports
  • chicken/branches/hygienic/README

    r10629 r11646  
    169169          know what you are doing.
    170170
     171        SRCDIR=
     172          Specifies that CHICKEN should be built outside of its source
     173          tree. The SRCDIR variable indicates the location of the
     174          CHICKEN source tree. The executables and object files will
     175          be generated in the current directory.
     176
     177
    171178        To remove CHICKEN from your file-system, enter (probably as
    172179        root):
  • chicken/branches/hygienic/TODO

    r11640 r11646  
    44
    55* trunk merge
    6   11148 was last
     6  11635 was last
    77
    88* macros
  • chicken/branches/hygienic/batch-driver.scm

    r11160 r11646  
    3838  standard-bindings-that-never-return-false side-effect-free-standard-bindings-that-never-return-false
    3939  compiler-cleanup-hook disabled-warnings
    40   file-io-only undefine-shadowed-macros
     40  file-io-only undefine-shadowed-macros profiled-procedures
    4141  unit-name insert-timer-checks used-units inline-max-size
    4242  debugging perform-lambda-lifting! disable-stack-overflow-checking
     
    359359      (let ([acc (eq? 'accumulate-profile (car profile))])
    360360        (set! emit-profile #t)
     361        (set! profiled-procedures #f)
    361362        (set! initforms
    362363          (append
     
    367368               '() ) ) )
    368369        (when verbose
    369           (printf "Generating ~aprofile~%~!" (if acc "accumulated " "") emit-profile) ) ) )
     370          (printf "Generating ~aprofile~%~!" (if acc "accumulated " "")) ) ) )
    370371
    371372    (cond ((memq 'version options)
  • chicken/branches/hygienic/chicken-setup.scm

    r11149 r11646  
    2828(declare
    2929  (run-time-macros)                     ;*** later: compile-syntax
    30   (uses srfi-1 regex utils posix tcp srfi-18 srfi-13 ports)
     30  (uses srfi-1 regex utils files posix tcp srfi-18 srfi-13 ports)
    3131  (export move-file run:execute make/proc uninstall-extension
    3232          install-extension install-program install-script setup-verbose-flag
     
    199199(define *gzip-program* 'gzip)
    200200(define *tar-program* 'tar)
     201
    201202(define *fetch-only* #f)
    202203(define *builddir-created* #f)
     
    10891090  (and (or *dont-ask*
    10901091           (yes-or-no?
    1091             (sprintf "The extension ~A does not exist.~%Do you want to download it ?" ext)
     1092            (sprintf "File ~A.egg or ~A.setup not found in the download directory. ~%Do you want to download .egg archive ?" ext ext)
    10921093            "yes") )
    10931094       (cond ((pathname-directory ext)
  • chicken/branches/hygienic/chicken.scm

    r10657 r11646  
    2727
    2828(declare
    29   (uses srfi-1 srfi-4 utils support compiler optimizer driver platform backend srfi-69)
     29  (uses srfi-1 srfi-4 utils files support compiler optimizer driver
     30        platform backend srfi-69)
    3031  (run-time-macros) )                   ;*** later: compile-syntax
    3132
  • chicken/branches/hygienic/compiler.scm

    r11577 r11646  
    6868; (import <symbol-or-string> ...)
    6969; (unused <symbol> ...)
     70; (profile <symbol> ...)
    7071;
    7172;   <type> = fixnum | generic
     
    258259  foreign-declarations emit-trace-info block-compilation line-number-database-size
    259260  always-bound-to-procedure block-globals make-block-variable-literal block-variable-literal? block-variable-literal-name
    260   target-heap-size target-stack-size valid-c-identifier? standalone-executable
     261  target-heap-size target-stack-size valid-c-identifier? profiled-procedures standalone-executable
    261262  target-initial-heap-size internal-bindings source-filename dump-nodes source-info->string
    262263  default-default-target-heap-size default-default-target-stack-size verbose-mode original-program-size
     
    365366(define undefine-shadowed-macros #t)
    366367(define constant-declarations '())
     368(define profiled-procedures #f)
    367369(define import-libraries '())
    368370(define standalone-executable #t)
     
    644646                                           (not (assq dest se))) ; global?
    645647                                       l)
    646                                       ((and emit-profile (eq? 'lambda name))
     648                                      ((and (eq? 'lambda name)
     649                                            emit-profile
     650                                            (or (not profiled-procedures)
     651                                                (memq dest profiled-procedures)))
    647652                                       (expand-profile-lambda dest llist2 body) )
    648653                                      (else
     
    703708                        (let* ((var (if (pair? (cadr x)) (caadr x) (cadr x)))
    704709                               (body (if (pair? (cadr x))
    705                                          `(,(rename 'lambda se) ,(cdadr x) ,@(cddr x))
     710                                         `(,(macro-alias 'lambda se) ,(cdadr x) ,@(cddr x))
    706711                                         (caddr x)))
    707712                               (name (lookup var se)))
     
    729734                        (let* ((var (if (pair? (cadr x)) (caadr x) (cadr x)))
    730735                               (body (if (pair? (cadr x))
    731                                          `(,(rename 'lambda se) ,(cdadr x) ,@(cddr x))
     736                                         `(,(macro-alias 'lambda se) ,(cdadr x) ,@(cddr x))
    732737                                         (caddr x)))
    733738                               (name (lookup var se)))
     
    13711376                          "invalid import-library specification: ~s" il))))
    13721377                (cdr spec)))))
     1378       ((profile)
     1379        (set! profiled-procedures
     1380          (append (cdr spec)
     1381                  (or profiled-procedures '()))))
    13731382       (else (compiler-warning 'syntax "illegal declaration specifier `~s'" spec)) )
    13741383     '(##core#undefined) ) ) )
  • chicken/branches/hygienic/csc.scm

    r11034 r11646  
    2828(declare
    2929  (block)
    30   (uses data-structures ports srfi-1 srfi-13 utils extras ))
     30  (uses data-structures ports srfi-1 srfi-13 utils files extras ))
    3131
    3232#>
  • chicken/branches/hygienic/debian/control

    r11150 r11646  
    44Priority: optional
    55Maintainer: Davide Puricelli (evo) <evo@debian.org>
    6 Build-Depends: debhelper (>> 4.0.0), libpcre3-dev
     6Build-Depends: debhelper (>> 4.0.0), libpcre3-dev, texinfo
    77Standards-Version: 3.7.3
    88
  • chicken/branches/hygienic/defaults.make

    r11573 r11646  
    4040# directories
    4141
     42SRCDIR = .
     43VPATH  = $(SRCDIR)
     44
    4245DESTDIR =
    4346ifeq ($(PLATFORM),mingw-msys)
     
    157160PCRE_OBJECTS_1 =
    158161else
     162PCRE_DIR ?= $(VPATH)/pcre
    159163C_COMPILER_PCRE_OPTIONS = -DPCRE_STATIC
    160 PCRE_INCLUDES = $(INCLUDES) -Ipcre
     164PCRE_INCLUDES = $(INCLUDES) -I$(PCRE_DIR)
    161165endif
    162166ifndef NOPTABLES
    163167C_COMPILER_PTABLES_OPTIONS ?= -DC_ENABLE_PTABLES
    164168endif
    165 INCLUDES ?= -I.
     169INCLUDES ?= -I. -I$(SRCDIR)
    166170C_COMPILER_COMPILE_OPTION ?= -c
    167171C_COMPILER_OUTPUT_OPTION ?= -o
     
    297301# Scheme compiler flags
    298302
    299 CHICKEN_OPTIONS = -quiet -no-trace -optimize-level 2 -include-path .
     303CHICKEN_OPTIONS = \
     304        -quiet -no-trace -optimize-level 2 \
     305        -include-path . -include-path $(SRCDIR)
    300306CHICKEN_LIBRARY_OPTIONS = $(CHICKEN_OPTIONS) -explicit-use
    301307CHICKEN_PROGRAM_OPTIONS = $(CHICKEN_OPTIONS) -no-lambda-info
     
    308314CHICKEN_PCRE_LIBRARY_OPTIONS =
    309315else
    310 CHICKEN_PCRE_LIBRARY_OPTIONS = -include-path pcre
     316CHICKEN_PCRE_LIBRARY_OPTIONS = -include-path $(SRCDIR)/pcre
    311317endif
    312318
     
    325331endif
    326332CHICKEN_BUG_PROGRAM = $(PROGRAM_PREFIX)chicken-bug$(PROGRAM_SUFFIX)
    327 IMPORT_LIBRARIES = chicken lolevel srfi-1 srfi-4 data-structures ports posix srfi-13 srfi-69 extras \
     333IMPORT_LIBRARIES = chicken lolevel srfi-1 srfi-4 data-structures ports files posix srfi-13 srfi-69 extras \
    328334        regex srfi-14 tcp foreign scheme srfi-18 utils csi
    329335ifdef BUILD_SETUP_TOOLS
     
    375381
    376382buildsvnrevision:
    377         sh svnrevision.sh
     383        sh $(SRCDIR)/svnrevision.sh
     384ifeq ($(USE_HOST_PCRE),)
     385        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) pcre
     386endif
    378387
    379388# generic part of chicken-config.h
  • chicken/branches/hygienic/distribution/manifest

    r11573 r11646  
    7878udata-structures.c
    7979uports.c
     80ufiles.c
    8081ulibrary.c
    8182ulolevel.c
     
    120121data-structures.scm
    121122ports.scm
     123files.scm
    122124chicken-bug.1
    123125chicken-bug.scm
     
    152154html/unit-data-structures.html
    153155html/unit-ports.html
     156html/unit-files.html
    154157html/unit-eval.html
    155158html/unit-extras.html
  • chicken/branches/hygienic/files.scm

    r11643 r11646  
    6060    (no-bound-checks))] )
    6161
    62 (cond-expand
    63  [unsafe
    64   (eval-when (compile)
    65     (define-macro (##sys#check-structure . _) '(##core#undefined))
    66     (define-macro (##sys#check-range . _) '(##core#undefined))
    67     (define-macro (##sys#check-pair . _) '(##core#undefined))
    68     (define-macro (##sys#check-list . _) '(##core#undefined))
    69     (define-macro (##sys#check-symbol . _) '(##core#undefined))
    70     (define-macro (##sys#check-string . _) '(##core#undefined))
    71     (define-macro (##sys#check-char . _) '(##core#undefined))
    72     (define-macro (##sys#check-exact . _) '(##core#undefined))
    73     (define-macro (##sys#check-port . _) '(##core#undefined))
    74     (define-macro (##sys#check-number . _) '(##core#undefined)))]
    75  [else
    76   (declare (emit-exports "files.exports"))] )
     62(include "unsafe-declarations.scm")
    7763
    7864(register-feature! 'files)
  • chicken/branches/hygienic/manual/Acknowledgements

    r10932 r11646  
    33== Acknowledgements
    44
    5 Many thanks to Nico Amtsberg, William Annis, Marc Baily, Peter
    6 Barabas, Jonah Beckford, Arto Bendiken, Peter Bex, Jean-Francois
    7 Bignolles, Alaric Blagrave-Snellpym, Dave Bodenstab, Fabian Boehlke,
    8 T. Kurt Bond, Ashley Bone, Dominique Boucher, Terence Brannon, Roy
    9 Bryant, Adam Buchbinder, Hans Bulfone, Category 5, Taylor Campbell,
    10 Naruto Canada, Esteban U. Caamano Castro, Franklin Chen, Thomas Chust,
    11 Gian Paolo Ciceri, John Cowan, Grzegorz Chrupa&#322;a, James Crippen,
    12 Tollef Fog Heen, Alejandro Forero Cuervo, Linh Dang, Brian Denheyer,
    13 dgym, Don, Chris Double, Jarod Eells, Petter Egesund, Steve Elkins,
    14 Daniel B. Faken, Will Farr, Graham Fawcett, Marc Feeley, Fizzie,
    15 Kimura Fuyuki, Tony Garnock-Jones, Martin Gasbichler, Joey Gibson,
    16 Stephen C. Gilardi, Joshua Griffith, Johannes Groedem, Damian Gryski,
    17 Mario Domenech Goulart, Andreas Gustafsson, Sven Hartrumpf, Jun-ichiro
    18 itojun Hagino, Ahdi Hargo, Matthias Heiler, Karl M. Hegbloom, William
    19 P. Heinemann, Bill Hoffman, Bruce Hoult, Hans Huebner, Markus
    20 Huelsmann, Goetz Isenmann, Paulo Jabardo, David Janssens, Christian
    21 Jaeger, Dale Jordan, Valentin Kamyshenko, Daishi Kato, Peter Keller,
    22 Brad Kind, Ron Kneusel, Matthias Koeppe, Krysztof Kowa&#322;czyk,
    23 Andre Kuehne, Todd R. Kueny Sr, Goran Krampe, David Krentzlin, Ben
    24 Kurtz, Micky Latowicki, John Lenz, Kirill Lisovsky, Juergen
    25 Lorenz, Kon Lovett, Dennis Marti, Charles Martin, Bob McIsaac, Alain
    26 Mellan, Eric Merrit, Perry Metzger, Scott G. Miller, Mikael, Bruce
    27 Mitchener, Chris Moline, Eric E. Moore, Julian Morrison, Dan Muresan,
    28 Lars Nilsson, Ian Oversby, o.t., Gene Pavlovsky, Levi Pearson, Nicolas
    29 Pelletier, Carlos Pita, Robin Lee Powell, Pupeno, Davide Puricelli,
    30 Doug Quale, Eric Raible, Ivan Raikov, Joel Reymont, Eric Rochester,
    31 Andreas Rottman, David Rush, Lars Rustemeier, Daniel Sadilek, Oskar
    32 Schirmer, Burton Samograd, Reed Sheridan, Ronald Schroeder, Spencer
    33 Schumann, Alex Shinn, Ivan Shmakov, Shmul, Tony Sidaway, Jeffrey
    34 B. Siegal, Andrey Sidorenko, Michele Simionato, Volker Stolz, Jon
    35 Strait, Dorai Sitaram, Robert Skeels, Jason Songhurst, Clifford Stein,
    36 Sunnan, Zbigniew Szadkowski, Rick Taube, Mike Thomas, Minh Thu,
    37 Christian Tismer, Andre van Tonder, John Tobey, Henrik Tramberend,
    38 Vladimir Tsichevsky, Neil van Dyke, Sander Vesik, Jaques Vidrine,
    39 Panagiotis Vossos, Shawn Wagner, Peter Wang, Ed Watkeys, Brad Watson,
    40 Thomas Weidner, Goeran Weinholt, Matthew Welland, Joerg Wittenberger,
    41 Peter Wright, Mark Wutka, Richard Zidlicky and Houman Zolfaghari for
    42 bug-fixes, tips and suggestions.
     5Many thanks to Nico Amtsberg, Alonso Andres, William Annis, Marc
     6Baily, Peter Barabas, Jonah Beckford, Arto Bendiken, Peter Bex,
     7Jean-Francois Bignolles, Alaric Blagrave-Snellpym, Dave Bodenstab,
     8Fabian Boehlke, T. Kurt Bond, Ashley Bone, Dominique Boucher, Terence
     9Brannon, Roy Bryant, Adam Buchbinder, Hans Bulfone, Category 5, Taylor
     10Campbell, Naruto Canada, Esteban U. Caamano Castro, Franklin Chen,
     11Thomas Chust, Gian Paolo Ciceri, John Cowan, Grzegorz Chrupa&#322;a,
     12James Crippen, Tollef Fog Heen, Alejandro Forero Cuervo, Linh Dang,
     13Brian Denheyer, dgym, Don, Chris Double, Jarod Eells, Petter Egesund,
     14Steve Elkins, Daniel B. Faken, Will Farr, Graham Fawcett, Marc Feeley,
     15Fizzie, Kimura Fuyuki, Tony Garnock-Jones, Martin Gasbichler, Joey
     16Gibson, Stephen C. Gilardi, Joshua Griffith, Johannes Groedem, Damian
     17Gryski, Mario Domenech Goulart, Andreas Gustafsson, Sven Hartrumpf,
     18Jun-ichiro itojun Hagino, Ahdi Hargo, Matthias Heiler, Karl
     19M. Hegbloom, William P. Heinemann, Bill Hoffman, Bruce Hoult, Hans
     20Huebner, Markus Huelsmann, Goetz Isenmann, Paulo Jabardo, David
     21Janssens, Christian Jaeger, Dale Jordan, Valentin Kamyshenko, Daishi
     22Kato, Peter Keller, Brad Kind, Ron Kneusel, Matthias Koeppe, Krysztof
     23Kowa&#322;czyk, Andre Kuehne, Todd R. Kueny Sr, Goran Krampe, David
     24Krentzlin, Ben Kurtz, Micky Latowicki, John Lenz, Kirill Lisovsky,
     25Juergen Lorenz, Kon Lovett, Dennis Marti, Charles Martin, Bob McIsaac,
     26Alain Mellan, Eric Merrit, Perry Metzger, Scott G. Miller, Mikael,
     27Bruce Mitchener, Chris Moline, Eric E. Moore, Julian Morrison, Dan
     28Muresan, Lars Nilsson, Ian Oversby, o.t., Gene Pavlovsky, Levi
     29Pearson, Nicolas Pelletier, Carlos Pita, Robin Lee Powell, Pupeno,
     30Davide Puricelli, Doug Quale, Eric Raible, Ivan Raikov, Joel Reymont,
     31Eric Rochester, Andreas Rottman, David Rush, Lars Rustemeier, Daniel
     32Sadilek, Oskar Schirmer, Burton Samograd, Reed Sheridan, Ronald
     33Schroeder, Spencer Schumann, Alex Shinn, Ivan Shmakov, Shmul, Tony
     34Sidaway, Jeffrey B. Siegal, Andrey Sidorenko, Michele Simionato,
     35Volker Stolz, Jon Strait, Dorai Sitaram, Robert Skeels, Jason
     36Songhurst, Clifford Stein, Sunnan, Zbigniew Szadkowski, Rick Taube,
     37Nathan Thern, Mike Thomas, Minh Thu, Christian Tismer, Andre van
     38Tonder, John Tobey, Henrik Tramberend, Vladimir Tsichevsky, Neil van
     39Dyke, Sander Vesik, Jaques Vidrine, Panagiotis Vossos, Shawn Wagner,
     40Peter Wang, Ed Watkeys, Brad Watson, Thomas Weidner, Goeran Weinholt,
     41Matthew Welland, Joerg Wittenberger, Peter Wright, Mark Wutka, Richard
     42Zidlicky and Houman Zolfaghari for bug-fixes, tips and suggestions.
    4343
    4444CHICKEN uses the PCRE regular expression package ([[http://www.pcre.org]]),
  • chicken/branches/hygienic/manual/Declarations

    r11013 r11646  
    214214
    215215
     216=== profile
     217
     218 [declaration specifier] (profile IDENTIFIER ...)
     219
     220Enable profiling exclusively for given identifiers. Normally the compiler
     221enables profiling decorations for all globally defined procedures. With
     222this declaration, profiling can be enabled for selected procedures.
     223
     224
    216225=== number-type
    217226=== fixnum-arithmetic
  • chicken/branches/hygienic/manual/Locations

    r11149 r11646  
    7171</enscript>
    7272
    73 See [[http://chicken.wiki.br/location-and-c-string-star|location and
    74 c-string*]] for a tip on returning a {{c-string*}} type.
     73See [[http://chicken.wiki.br/location-and-c-string-star|location and c-string*]]
     74for a tip on returning a {{c-string*}} type.
    7575
    7676{{location}} returns a value of type {{c-pointer}}, when given
  • chicken/branches/hygienic/manual/Supported language

    r10952 r11646  
    1616* [[Unit data-structures]] data structures
    1717* [[Unit ports]] I/O ports
     18* [[Unit files]] File and pathname operations
    1819* [[Unit extras]] useful utility definitions
    1920* [[Unit srfi-1]] List Library
  • chicken/branches/hygienic/manual/Unit extras

    r10954 r11646  
    805805Returns the index of the found value or {{#f}} otherwise.
    806806
    807 Previous: [[Unit ports]]
     807Previous: [[Unit files]]
    808808
    809809Next: [[Unit srfi-1]]
  • chicken/branches/hygienic/manual/Unit library

    r10872 r11646  
    783783This procedure returns {{X}}.
    784784
     785Finalizers are invoked asynchronously, in the thread that happens
     786to be currently running.
     787
    785788
    786789==== set-gc-report!
  • chicken/branches/hygienic/manual/Unit ports

    r10952 r11646  
    143143Previous: [[Unit data-structures]]
    144144
    145 Next: [[Unit extras]]
     145Next: [[Unit files]]
  • chicken/branches/hygienic/manual/Unit utils

    r10952 r11646  
    55== Unit utils
    66
    7 This unit contains file/pathname oriented procedures, apropos, plus acts as a "grab bag" for procedures without a good home,
    8 and which don't have to be available by default (as compared to the [[Unit extras|extras]] unit).
     7This unit contains apropos and functions as a "grab bag" of procedures
     8without a good home, and which don't have to be available by default
     9(as compared to the [[Unit extras|extras]] unit).
    910
    1011This unit uses the {{extras}} and {{regex}} units.
  • chicken/branches/hygienic/posixunix.scm

    r10788 r11646  
    2828(declare
    2929  (unit posix)
    30   (uses scheduler regex extras utils)
     30  (uses scheduler regex extras utils files)
    3131  (disable-interrupts)
    3232  (usual-integrations)
  • chicken/branches/hygienic/posixwin.scm

    r11536 r11646  
    6666(declare
    6767  (unit posix)
    68   (uses scheduler regex extras utils)
     68  (uses scheduler regex extras utils files)
    6969  (disable-interrupts)
    7070  (usual-integrations)
  • chicken/branches/hygienic/rules.make

    r11573 r11646  
    2929
    3030LIBCHICKEN_OBJECTS_1 = \
    31        library eval data-structures ports extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
     31       library eval data-structures ports files extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
    3232       srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex scheduler \
    3333       profiler stub expand runtime
     
    3636
    3737LIBUCHICKEN_OBJECTS_1 = \
    38        ulibrary ueval udata-structures uports uextras ulolevel uutils utcp usrfi-1 usrfi-4 \
     38       ulibrary ueval udata-structures uports ufiles uextras ulolevel uutils utcp usrfi-1 usrfi-4 \
    3939       usrfi-13 usrfi-14 usrfi-18 usrfi-69 u$(POSIXFILE) uregex scheduler \
    4040       profiler stub expand uruntime
     
    4343
    4444LIBCHICKENGUI_OBJECTS_1 = \
    45        library eval data-structures ports extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
     45       library eval data-structures ports files extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
    4646       srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex scheduler \
    4747       profiler stub expand gui-runtime
     
    109109          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
    110110          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     111files$(O): files.c chicken.h $(CHICKEN_CONFIG_H)
     112        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     113          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     114          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    111115extras$(O): extras.c chicken.h $(CHICKEN_CONFIG_H)
    112116        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     
    133137          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
    134138          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    135 regex$(O): regex.c chicken.h $(CHICKEN_CONFIG_H) pcre/pcre.h
     139regex$(O): regex.c chicken.h $(CHICKEN_CONFIG_H)
    136140        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(PCRE_INCLUDES) \
    137141          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     
    194198          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
    195199          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     200ufiles$(O): ufiles.c chicken.h $(CHICKEN_CONFIG_H)
     201        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     202          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     203          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    196204uextras$(O): uextras.c chicken.h $(CHICKEN_CONFIG_H)
    197205        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     
    214222          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
    215223          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    216 uregex$(O): uregex.c chicken.h $(CHICKEN_CONFIG_H) pcre/pcre.h
     224uregex$(O): uregex.c chicken.h $(CHICKEN_CONFIG_H)
    217225        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(PCRE_INCLUDES) \
    218226          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     
    276284          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
    277285          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     286files-static$(O): files.c chicken.h $(CHICKEN_CONFIG_H)
     287        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     288          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     289          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    278290extras-static$(O): extras.c chicken.h $(CHICKEN_CONFIG_H)
    279291        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     
    300312          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
    301313          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    302 regex-static$(O): regex.c chicken.h $(CHICKEN_CONFIG_H) pcre/pcre.h
     314regex-static$(O): regex.c chicken.h $(CHICKEN_CONFIG_H)
    303315        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(PCRE_INCLUDES) \
    304316          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     
    361373          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
    362374          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     375ufiles-static$(O): ufiles.c chicken.h $(CHICKEN_CONFIG_H)
     376        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     377          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     378          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    363379uextras-static$(O): uextras.c chicken.h $(CHICKEN_CONFIG_H)
    364380        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     
    381397          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
    382398          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    383 uregex-static$(O): uregex.c chicken.h $(CHICKEN_CONFIG_H) pcre/pcre.h
     399uregex-static$(O): uregex.c chicken.h $(CHICKEN_CONFIG_H)
    384400        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    385401          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(PCRE_INCLUDES) \
     
    452468          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
    453469          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     470files.import$(O): files.import.c chicken.h $(CHICKEN_CONFIG_H)
     471        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     472          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     473          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
    454474posix.import$(O): posix.import.c chicken.h $(CHICKEN_CONFIG_H)
    455475        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     
    580600# pcre objects
    581601
    582 pcre/pcre_compile$(O): pcre/pcre_compile.c pcre/pcre_internal.h pcre/config.h $(CHICKEN_CONFIG_H) pcre/pcre.h pcre/ucp.h
    583         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    584           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    585           $(C_COMPILER_PCRE_OPTIONS)
    586 pcre/pcre_config$(O): pcre/pcre_config.c pcre/pcre_internal.h pcre/config.h $(CHICKEN_CONFIG_H) pcre/pcre.h pcre/ucp.h
    587         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    588           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    589           $(C_COMPILER_PCRE_OPTIONS)
    590 pcre/pcre_dfa_exec$(O): pcre/pcre_dfa_exec.c pcre/pcre_internal.h pcre/config.h $(CHICKEN_CONFIG_H) pcre/pcre.h pcre/ucp.h
    591         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    592           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    593           $(C_COMPILER_PCRE_OPTIONS)
    594 pcre/pcre_exec$(O): pcre/pcre_exec.c pcre/pcre_internal.h pcre/config.h $(CHICKEN_CONFIG_H) pcre/pcre.h pcre/ucp.h
    595         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    596           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    597           $(C_COMPILER_PCRE_OPTIONS)
    598 pcre/pcre_fullinfo$(O): pcre/pcre_fullinfo.c pcre/pcre_internal.h pcre/config.h $(CHICKEN_CONFIG_H) pcre/pcre.h pcre/ucp.h
    599         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    600           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    601           $(C_COMPILER_PCRE_OPTIONS)
    602 pcre/pcre_get$(O): pcre/pcre_get.c pcre/pcre_internal.h pcre/config.h $(CHICKEN_CONFIG_H) pcre/pcre.h pcre/ucp.h
    603         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    604           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    605           $(C_COMPILER_PCRE_OPTIONS)
    606 pcre/pcre_globals$(O): pcre/pcre_globals.c pcre/pcre_internal.h pcre/config.h $(CHICKEN_CONFIG_H) pcre/pcre.h pcre/ucp.h
    607         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    608           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    609           $(C_COMPILER_PCRE_OPTIONS)
    610 pcre/pcre_info$(O): pcre/pcre_info.c pcre/pcre_internal.h pcre/config.h $(CHICKEN_CONFIG_H) pcre/pcre.h pcre/ucp.h
    611         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    612           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    613           $(C_COMPILER_PCRE_OPTIONS)
    614 pcre/pcre_maketables$(O): pcre/pcre_maketables.c pcre/pcre_internal.h pcre/config.h $(CHICKEN_CONFIG_H) pcre/pcre.h pcre/ucp.h
    615         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    616           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    617           $(C_COMPILER_PCRE_OPTIONS)
    618 pcre/pcre_newline$(O): pcre/pcre_newline.c pcre/pcre_internal.h pcre/config.h $(CHICKEN_CONFIG_H) pcre/pcre.h pcre/ucp.h
     602$(PCRE_DIR)/pcre_compile$(O): $(PCRE_DIR)/pcre_compile.c $(PCRE_DIR)/pcre_internal.h $(PCRE_DIR)/config.h $(CHICKEN_CONFIG_H) $(PCRE_DIR)/pcre.h $(PCRE_DIR)/ucp.h
     603        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
     604          $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
     605          $(C_COMPILER_PCRE_OPTIONS)
     606$(PCRE_DIR)/pcre_config$(O): $(PCRE_DIR)/pcre_config.c $(PCRE_DIR)/pcre_internal.h $(PCRE_DIR)/config.h $(CHICKEN_CONFIG_H) $(PCRE_DIR)/pcre.h $(PCRE_DIR)/ucp.h
     607        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
     608          $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
     609          $(C_COMPILER_PCRE_OPTIONS)
     610$(PCRE_DIR)/pcre_dfa_exec$(O): $(PCRE_DIR)/pcre_dfa_exec.c $(PCRE_DIR)/pcre_internal.h $(PCRE_DIR)/config.h $(CHICKEN_CONFIG_H) $(PCRE_DIR)/pcre.h $(PCRE_DIR)/ucp.h
     611        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
     612          $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
     613          $(C_COMPILER_PCRE_OPTIONS)
     614$(PCRE_DIR)/pcre_exec$(O): $(PCRE_DIR)/pcre_exec.c $(PCRE_DIR)/pcre_internal.h $(PCRE_DIR)/config.h $(CHICKEN_CONFIG_H) $(PCRE_DIR)/pcre.h $(PCRE_DIR)/ucp.h
     615        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
     616          $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
     617          $(C_COMPILER_PCRE_OPTIONS)
     618$(PCRE_DIR)/pcre_fullinfo$(O): $(PCRE_DIR)/pcre_fullinfo.c $(PCRE_DIR)/pcre_internal.h $(PCRE_DIR)/config.h $(CHICKEN_CONFIG_H) $(PCRE_DIR)/pcre.h $(PCRE_DIR)/ucp.h
     619        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
     620          $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
     621          $(C_COMPILER_PCRE_OPTIONS)
     622$(PCRE_DIR)/pcre_get$(O): $(PCRE_DIR)/pcre_get.c $(PCRE_DIR)/pcre_internal.h $(PCRE_DIR)/config.h $(CHICKEN_CONFIG_H) $(PCRE_DIR)/pcre.h $(PCRE_DIR)/ucp.h
     623        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
     624          $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
     625          $(C_COMPILER_PCRE_OPTIONS)
     626$(PCRE_DIR)/pcre_globals$(O): $(PCRE_DIR)/pcre_globals.c $(PCRE_DIR)/pcre_internal.h $(PCRE_DIR)/config.h $(CHICKEN_CONFIG_H) $(PCRE_DIR)/pcre.h $(PCRE_DIR)/ucp.h
     627        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
     628          $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
     629          $(C_COMPILER_PCRE_OPTIONS)
     630$(PCRE_DIR)/pcre_info$(O): $(PCRE_DIR)/pcre_info.c $(PCRE_DIR)/pcre_internal.h $(PCRE_DIR)/config.h $(CHICKEN_CONFIG_H) $(PCRE_DIR)/pcre.h $(PCRE_DIR)/ucp.h
     631        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
     632          $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
     633          $(C_COMPILER_PCRE_OPTIONS)
     634$(PCRE_DIR)/pcre_maketables$(O): $(PCRE_DIR)/pcre_maketables.c $(PCRE_DIR)/pcre_internal.h $(PCRE_DIR)/config.h $(CHICKEN_CONFIG_H) $(PCRE_DIR)/pcre.h $(PCRE_DIR)/ucp.h
     635        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
     636          $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
     637          $(C_COMPILER_PCRE_OPTIONS)
     638$(PCRE_DIR)/pcre_newline$(O): $(PCRE_DIR)/pcre_newline.c $(PCRE_DIR)/pcre_internal.h $(PCRE_DIR)/config.h $(CHICKEN_CONFIG_H) $(PCRE_DIR)/pcre.h $(PCRE_DIR)/ucp.h
    619639        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    620640          $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
     
    931951          $(ILIBDIR)/libuchicken$(A)
    932952endif
    933         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.h $(DESTDIR)$(IINCDIR)
     953        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/chicken.h $(DESTDIR)$(IINCDIR)
    934954        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(CHICKEN_CONFIG_H) $(DESTDIR)$(IINCDIR)
    935955ifndef STATICBUILD
     
    9821002          $(CHICKEN_STATUS_PROGRAM)$(EXE)
    9831003endif
    984         $(MAKE) NEEDS_RELINKING=no RUNTIME_LINKER_PATH=$(LIBDIR) install
     1004        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) NEEDS_RELINKING=no RUNTIME_LINKER_PATH=$(LIBDIR) install
    9851005        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_PROGRAM)$(EXE) $(CSI_PROGRAM)$(EXE) \
    9861006          $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE)
     
    10331053        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/data-structures.import.so
    10341054        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/ports.import.so
     1055        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/files.import.so
    10351056        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/posix.import.so
    10361057        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-13.import.so
     
    10651086endif
    10661087endif
    1067         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.1 $(DESTDIR)$(IMANDIR)
    1068         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) csi.1 $(DESTDIR)$(IMANDIR)
    1069         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) csc.1 $(DESTDIR)$(IMANDIR)
    1070         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken-setup.1 $(DESTDIR)$(IMANDIR)
    1071         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken-profile.1 $(DESTDIR)$(IMANDIR)
    1072         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken-bug.1 $(DESTDIR)$(IMANDIR)
     1088        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/chicken.1 $(DESTDIR)$(IMANDIR)
     1089        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/csi.1 $(DESTDIR)$(IMANDIR)
     1090        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/csc.1 $(DESTDIR)$(IMANDIR)
     1091ifndef BUILD_SETUP_TOOLS
     1092        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/chicken-setup.1 $(DESTDIR)$(IMANDIR)
     1093else
     1094        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/chicken-install.1 $(DESTDIR)$(IMANDIR)
     1095        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/chicken-uninstall.1 $(DESTDIR)$(IMANDIR)
     1096        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/chicken-status.1 $(DESTDIR)$(IMANDIR)
     1097endif
     1098        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/chicken-profile.1 $(DESTDIR)$(IMANDIR)
     1099        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/chicken-bug.1 $(DESTDIR)$(IMANDIR)
    10731100        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IDOCDIR)/html
    1074         -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) html/* $(DESTDIR)$(IDOCDIR)/html
    1075         -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.pdf $(DESTDIR)$(IDOCDIR)
    1076         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) README $(DESTDIR)$(IDOCDIR)
    1077         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) LICENSE $(DESTDIR)$(IDOCDIR)
    1078         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken-more-macros.scm $(DESTDIR)$(IDATADIR)
     1101        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/html/* $(DESTDIR)$(IDOCDIR)/html
     1102        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/chicken.pdf $(DESTDIR)$(IDOCDIR)
     1103        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/README $(DESTDIR)$(IDOCDIR)
     1104        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/LICENSE $(DESTDIR)$(IDOCDIR)
     1105        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)/chicken-more-macros.scm $(DESTDIR)$(IDATADIR)
    10791106        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.info $(DESTDIR)$(IINFODIR)
    10801107        $(INSTALLINFO_PROGRAM) $(INSTALLINFO_PROGRAM_OPTIONS) --infodir=$(DESTDIR)$(IINFODIR) chicken.info
    10811108ifdef WINDOWS
    1082         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) csibatch.bat $(DESTDIR)$(IBINDIR)
     1109        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(SRCDIR)/csibatch.bat $(DESTDIR)$(IBINDIR)
    10831110endif
    10841111endif
     
    11611188        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
    11621189ports.c: ports.scm private-namespace.scm
     1190        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
     1191files.c: files.scm private-namespace.scm
    11631192        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
    11641193extras.c: extras.scm private-namespace.scm
     
    12031232uports.c: ports.scm private-namespace.scm unsafe-declarations.scm
    12041233        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
     1234ufiles.c: files.scm private-namespace.scm unsafe-declarations.scm
     1235        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    12051236uextras.c: extras.scm private-namespace.scm unsafe-declarations.scm
    12061237        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend private-namespace.scm
     
    12421273ports.import.c: ports.import.scm
    12431274        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1275files.import.c: files.import.scm
     1276        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
    12441277posix.import.c: posix.import.scm
    12451278        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     
    13231356.PHONY: distfiles dist
    13241357
    1325 distfiles: buildsvnrevision library.c eval.c expand.c data-structures.c ports.c extras.c lolevel.c utils.c \
     1358distfiles: buildsvnrevision library.c eval.c expand.c data-structures.c ports.c files.c extras.c lolevel.c utils.c \
    13261359        tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c \
    13271360        posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c \
    1328         ulibrary.c ueval.c udata-structures.c uports.c uextras.c ulolevel.c \
     1361        ulibrary.c ueval.c udata-structures.c uports.c ufiles.c uextras.c ulolevel.c \
    13291362        uutils.c utcp.c usrfi-1.c usrfi-4.c usrfi-13.c usrfi-14.c \
    13301363        usrfi-18.c usrfi-69.c uposixunix.c uposixwin.c uregex.c \
     
    13511384        -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) chicken$(EXE) csi$(EXE) csc$(EXE) \
    13521385          chicken-setup$(EXE) chicken-profile$(EXE) csi-static$(EXE) \
     1386          chicken-install$(EXE) chicken-uninstall$(EXE) chicken-status$(EXE) \
    13531387          csc-static$(EXE) chicken-static$(EXE) chicken-bug$(EXE) chicken.info *$(O) \
    13541388          $(LIBCHICKEN_SO_FILE) $(LIBUCHICKEN_SO_FILE) $(LIBCHICKENGUI_SO_FILE) \
    1355           libchicken$(A) libuchicken$(A) libchickengui$(A) $(PROGRAM_IMPORT_LIBRARIES) \
     1389          libchicken$(A) libuchicken$(A) libchickengui$(A) libchicken$(SO) $(PROGRAM_IMPORT_LIBRARIES) \
    13561390          $(LIBCHICKEN_IMPORT_LIBRARY) $(LIBUCHICKEN_IMPORT_LIBRARY) $(LIBCHICKENGUI_IMPORT_LIBRARY)  \
    13571391          $(MSVC_CHICKEN_EXPORT_FILES) chicken.info $(CLEAN_PCRE) $(CLEAN_MINGW_LIBS) \
     
    13611395
    13621396spotless: distclean
    1363         -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) library.c eval.c data-structures.c ports.c extras.c lolevel.c utils.c \
     1397        -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) library.c eval.c data-structures.c ports.c files.c extras.c lolevel.c utils.c \
    13641398          tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c expand.c \
    13651399          posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c \
    1366           ulibrary.c ueval.c udata-structures.c uports.c uextras.c ulolevel.c \
     1400          ulibrary.c ueval.c udata-structures.c uports.c ufiles.c uextras.c ulolevel.c \
    13671401          uutils.c utcp.c usrfi-1.c usrfi-4.c usrfi-13.c usrfi-14.c \
    13681402          usrfi-18.c usrfi-69.c uposixunix.c uposixwin.c uregex.c chicken-profile.c chicken-setup.c chicken-bug.c \
     
    13871421compiler-check:
    13881422        @echo "======================================== packing ..."
    1389         $(MAKE) dist
     1423        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) dist
    13901424        $(REMOVE_COMMAND $(REMOVE_COMMAND_RECURSIVE_OPTIONS) tests/chicken-*
    13911425        tar -C tests -xzf `ls -t chicken-*.tar.gz | head -1`
    13921426        @echo "======================================== building stage 1 ..."
    1393         $(MAKE) STATICBUILD=1 -C tests/chicken-* confclean all
     1427        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) STATICBUILD=1 -C tests/chicken-* confclean all
    13941428        touch tests/chicken-*/*.scm
    13951429        @echo "======================================== building stage 2 ..."
    1396         $(MAKE) STATICBUILD=1 -C tests/chicken-* confclean all
     1430        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) STATICBUILD=1 -C tests/chicken-* confclean all
    13971431        cat tests/chicken-*/*.c >tests/stage2.out
    13981432        @echo "======================================== building stage 3 ..."
    1399         $(MAKE) STATICBUILD=1 -C tests/chicken-* confclean all
     1433        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) STATICBUILD=1 -C tests/chicken-* confclean all
    14001434        cat tests/chicken-*/*.c >tests/stage3.out
    14011435        diff tests/stage2.out tests/stage3.out >tests/stages.diff
     
    14081442
    14091443bootstrap: bootstrap.tar.gz
    1410         gzip -d -c bootstrap.tar.gz | tar xvf -
     1444        gzip -d -c $(SRCDIR)/bootstrap.tar.gz | tar xvf -
    14111445        touch *.c
    1412         $(MAKE) -f Makefile.$(PLATFORM) STATICBUILD=1 chicken$(EXE)
     1446        $(MAKE) -f $(SRCDIR)/Makefile.$(PLATFORM) STATICBUILD=1 chicken$(EXE)
    14131447        cp chicken$(EXE) chicken-boot$(EXE)
    14141448        touch *.scm
    14151449
    14161450bootstrap.tar.gz: posixunix.c posixwin.c $(IMPORT_LIBRARIES:=.import.c)
    1417         tar cfz bootstrap.tar.gz library.c eval.c data-structures.c ports.c extras.c lolevel.c utils.c tcp.c \
     1451        tar cfz bootstrap.tar.gz library.c eval.c data-structures.c ports.c files.c extras.c lolevel.c utils.c tcp.c \
    14181452          srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c posixunix.c posixwin.c regex.c \
    14191453          scheduler.c profiler.c stub.c expand.c $(COMPILER_OBJECTS_1:=.c)
  • chicken/branches/hygienic/runtime.c

    r11149 r11646  
    75967596  /* check for rational representation: */
    75977597  if((eptr = C_strchr(sptr, '/')) != NULL) {
     7598    if (eptr == sptr) {
     7599        n = C_SCHEME_FALSE;
     7600        goto fini;
     7601    }
    75987602    *eptr = '\0';
    75997603    ratp = 1;
  • chicken/branches/hygienic/srfi-18.scm

    r10712 r11646  
    251251  (when (eq? thread ##sys#primordial-thread)
    252252    ((##sys#exit-handler)) )
    253   (##sys#setislot thread 2 (list (##core#undefined)))
     253  (##sys#setslot thread 2 (list (##core#undefined)))
    254254  (##sys#setslot thread 7 (##sys#make-structure 'condition '(terminated-thread-exception) '()))
    255255  (##sys#thread-kill! thread 'terminated)
  • chicken/branches/hygienic/svnrevision.sh

    r9498 r11646  
    2727
    2828
     29LANG="C"
     30
    2931if test -d ".svn" ;
    3032then
  • chicken/branches/hygienic/utils.import.scm

    r10788 r11646  
    2727(##sys#register-primitive-module
    2828 'utils
    29  '(absolute-pathname?
    30    apropos
     29 '(apropos
    3130   apropos-list
    32    create-temporary-file
    33    decompose-pathname
    34    delete-file*
    35    directory-null?
    3631   for-each-argv-line
    3732   for-each-line
    38    make-absolute-pathname
    39    make-broadcast-port
    40    make-concatenated-port
    41    make-pathname
    42    pathname-directory
    43    pathname-extension
    44    pathname-file
    45    pathname-replace-directory
    46    pathname-replace-extension
    47    pathname-replace-file
    48    pathname-strip-directory
    49    pathname-strip-extension
    50    port-fold
    51    port-for-each
    52    port-map
    5333   read-all
    5434   system*))
  • chicken/branches/hygienic/utils.scm

    r11524 r11646  
    2828(declare
    2929  (unit utils)
    30   (uses regex data-structures extras)
     30  (uses regex data-structures extras files)
    3131  (usual-integrations)
    3232  (fixnum)
     
    174174
    175175
    176 ;;; Like `delete-file', but does nothing if the file doesn't exist:
    177 
    178 (define delete-file*
    179   (let ([file-exists? file-exists?]
    180         [delete-file delete-file] )
    181     (lambda (file)
    182       (and (file-exists? file) (delete-file file) #t) ) ) )
    183 
    184 ;;; file-copy and file-move : they do what you'd think.
    185 (define (file-copy origfile newfile #!optional (clobber #f) (blocksize 1024))
    186     (##sys#check-string origfile 'file-copy)
    187     (##sys#check-string newfile 'file-copy)
    188     (##sys#check-number blocksize 'file-copy)
    189     (or (and (integer? blocksize) (> blocksize 0))
    190         (##sys#error (string-append
    191                          "invalid blocksize given: not a positive integer - "
    192                          (number->string blocksize))))
    193     (or (file-exists? origfile)
    194         (##sys#error (string-append "origfile does not exist - " origfile)))
    195     (and (file-exists? newfile)
    196          (or clobber
    197              (##sys#error (string-append
    198                               "newfile exists but clobber is false - "
    199                               newfile))))
    200     (let* ((i   (condition-case (open-input-file origfile)
    201                     (val ()
    202                         (##sys#error (string-append
    203                                          "could not open origfile for read - "
    204                                          origfile)))))
    205            (o   (condition-case (open-output-file newfile)
    206                     (val ()
    207                         (##sys#error (string-append
    208                                          "could not open newfile for write - "
    209                                          newfile)))))
    210            (s   (make-string blocksize)))
    211         (let loop ((d   (read-string! blocksize s i))
    212                    (l   0))
    213             (if (= 0 d)
    214                 (begin
    215                     (close-input-port i)
    216                     (close-output-port o)
    217                     l)
    218                 (begin
    219                     (condition-case (write-string s d o)
    220                         (val ()
    221                             (close-input-port i)
    222                             (close-output-port o)
    223                             (##sys#error (string-append
    224                                              "error writing file starting at "
    225                                              (number->string l)))))
    226                     (loop (read-string! blocksize s i) (+ d l)))))))
    227 
    228 (define (file-move origfile newfile #!optional (clobber #f) (blocksize 1024))
    229     (##sys#check-string origfile 'file-move)
    230     (##sys#check-string newfile 'file-move)
    231     (##sys#check-number blocksize 'file-move)
    232     (or (and (integer? blocksize) (> blocksize 0))
    233         (##sys#error (string-append
    234                          "invalid blocksize given: not a positive integer - "
    235                          (number->string blocksize))))
    236     (or (file-exists? origfile)
    237         (##sys#error (string-append "origfile does not exist - " origfile)))
    238     (and (file-exists? newfile)
    239          (or clobber
    240              (##sys#error (string-append
    241                               "newfile exists but clobber is false - "
    242                               newfile))))
    243     (let* ((i   (condition-case (open-input-file origfile)
    244                     (val ()
    245                         (##sys#error (string-append
    246                                          "could not open origfile for read - "
    247                                          origfile)))))
    248            (o   (condition-case (open-output-file newfile)
    249                     (val ()
    250                         (##sys#error (string-append
    251                                          "could not open newfile for write - "
    252                                          newfile)))))
    253            (s   (make-string blocksize)))
    254         (let loop ((d   (read-string! blocksize s i))
    255                    (l   0))
    256             (if (= 0 d)
    257                 (begin
    258                     (close-input-port i)
    259                     (close-output-port o)
    260                     (condition-case (delete-file origfile)
    261                         (val ()
    262                             (##sys#error (string-append
    263                                              "could not remove origfile - "
    264                                              origfile))))
    265                     l)
    266                 (begin
    267                     (condition-case (write-string s d o)
    268                         (val ()
    269                             (close-input-port i)
    270                             (close-output-port o)
    271                             (##sys#error (string-append
    272                                              "error writing file starting at "
    273                                              (number->string l)))))
    274                     (loop (read-string! blocksize s i) (+ d l)))))))
    275 
    276 ;;; Pathname operations:
    277 
    278 (define absolute-pathname?
    279   (let ([string-match string-match]
    280         [regexp regexp]
    281         [string-append string-append])
    282     (let* ([drv (if ##sys#windows-platform "([A-Za-z]:)?" "")]
    283            [patt (make-anchored-pattern (string-append drv "[\\/\\\\].*"))]
    284            [rx (regexp patt)] )
    285       (lambda (pn)
    286         (##sys#check-string pn 'absolute-pathname?)
    287         (pair? (string-match rx pn)) ) ) ) )
    288 
    289 (define (chop-pds str pds)
    290   (and str
    291        (let ((len (##sys#size str))
    292              (pdslen (if pds (##sys#size pds) 1)))
    293          (if (and (fx>= len 1)
    294                   (if pds
    295                       (##core#inline "C_substring_compare" str pds (fx- len pdslen) 0 pdslen)
    296                       (memq (##core#inline "C_subchar" str (fx- len pdslen))
    297                             '(#\/ #\\) ) ) )
    298              (##sys#substring str 0 (fx- len pdslen))
    299              str) ) ) )
    300 
    301 (define make-pathname)
    302 (define make-absolute-pathname)
    303 (let ([string-append string-append]
    304       [absolute-pathname? absolute-pathname?]
    305       [def-pds "/"] )
    306 
    307   (define (conc-dirs dirs pds)
    308     (##sys#check-list dirs 'make-pathname)
    309     (let loop ([strs dirs])
    310       (if (null? strs)
    311           ""
    312           (let ((s1 (car strs)))
    313             (if (zero? (string-length s1))
    314                 (loop (cdr strs))
    315                 (string-append
    316                  (chop-pds (car strs) pds)
    317                  (or pds def-pds)
    318                  (loop (cdr strs))) ) ) ) ) )
    319 
    320   (define (canonicalize-dirs dirs pds)
    321     (cond [(or (not dirs) (null? dirs)) ""]
    322           [(string? dirs) (conc-dirs (list dirs) pds)]
    323           [else           (conc-dirs dirs pds)] ) )
    324 
    325   (define (_make-pathname loc dir file ext pds)
    326     (let ([ext (or ext "")]
    327           [file (or file "")]
    328           [pdslen (if pds (##sys#size pds) 1)] )
    329       (##sys#check-string dir loc)
    330       (##sys#check-string file loc)
    331       (##sys#check-string ext loc)
    332       (when pds (##sys#check-string pds loc))
    333       (string-append
    334        dir
    335        (if (and (fx>= (##sys#size file) pdslen)
    336                 (if pds
    337                     (##core#inline "C_substring_compare" pds file 0 0 pdslen)
    338                     (memq (##core#inline "C_subchar" file 0) '(#\\ #\/))))
    339            (##sys#substring file pdslen (##sys#size file))
    340            file)
    341        (if (and (fx> (##sys#size ext) 0)
    342                 (not (char=? (##core#inline "C_subchar" ext 0) #\.)) )
    343            "."
    344            "")
    345        ext) ) )
    346 
    347   (set! make-pathname
    348     (lambda (dirs file #!optional ext pds)
    349       (_make-pathname 'make-pathname (canonicalize-dirs dirs pds) file ext pds)))
    350 
    351   (set! make-absolute-pathname
    352     (lambda (dirs file #!optional ext pds)
    353       (_make-pathname
    354        'make-absolute-pathname
    355        (let ([dir (canonicalize-dirs dirs pds)])
    356          (if (absolute-pathname? dir)
    357              dir
    358              (##sys#string-append (or pds def-pds) dir)) )
    359        file ext pds) ) ) )
    360 
    361 (define decompose-pathname
    362   (let ([string-match string-match]
    363         [regexp regexp]
    364         [string-append string-append])
    365     (let* ([patt1 "^(.*[\\/\\\\])?([^\\/\\\\]+)(\\.([^\\/\\\\.]+))$"]
    366            [patt2 "^(.*[\\/\\\\])?((\\.)?[^\\/\\\\]+)$"]
    367            [rx1 (regexp patt1)]
    368            [rx2 (regexp patt2)]
    369            [strip-pds
    370              (lambda (dir)
    371                 (and dir
    372                      (if (member dir '("/" "\\"))
    373                          dir
    374                          (chop-pds dir #f) ) ) )] )
    375       (lambda (pn)
    376         (##sys#check-string pn 'decompose-pathname)
    377         (if (fx= 0 (##sys#size pn))
    378             (values #f #f #f)
    379             (let ([ms (string-match rx1 pn)])
    380               (if ms
    381                   (values (strip-pds (cadr ms)) (caddr ms) (car (cddddr ms)))
    382                   (let ([ms (string-match rx2 pn)])
    383                     (if ms
    384                         (values (strip-pds (cadr ms)) (caddr ms) #f)
    385                         (values (strip-pds pn) #f #f) ) ) ) ) ) ) ) ) )
    386 
    387 (define pathname-directory)
    388 (define pathname-file)
    389 (define pathname-extension)
    390 (define pathname-strip-directory)
    391 (define pathname-strip-extension)
    392 (define pathname-replace-directory)
    393 (define pathname-replace-file)
    394 (define pathname-replace-extension)
    395 (let ([decompose-pathname decompose-pathname])
    396 
    397   (set! pathname-directory
    398     (lambda (pn)
    399       (let-values ([(dir file ext) (decompose-pathname pn)])
    400         dir) ) )
    401 
    402   (set! pathname-file
    403     (lambda (pn)
    404       (let-values ([(dir file ext) (decompose-pathname pn)])
    405         file) ) )
    406 
    407   (set! pathname-extension
    408     (lambda (pn)
    409       (let-values ([(dir file ext) (decompose-pathname pn)])
    410         ext) ) )
    411 
    412   (set! pathname-strip-directory
    413     (lambda (pn)
    414       (let-values ([(dir file ext) (decompose-pathname pn)])
    415         (make-pathname #f file ext) ) ) )
    416 
    417   (set! pathname-strip-extension
    418     (lambda (pn)
    419       (let-values ([(dir file ext) (decompose-pathname pn)])
    420         (make-pathname dir file) ) ) )
    421 
    422   (set! pathname-replace-directory
    423     (lambda (pn dir)
    424       (let-values ([(_ file ext) (decompose-pathname pn)])
    425         (make-pathname dir file ext) ) ) )
    426 
    427   (set! pathname-replace-file
    428     (lambda (pn file)
    429       (let-values ([(dir _ ext) (decompose-pathname pn)])
    430         (make-pathname dir file ext) ) ) )
    431 
    432   (set! pathname-replace-extension
    433     (lambda (pn ext)
    434       (let-values ([(dir file _) (decompose-pathname pn)])
    435         (make-pathname dir file ext) ) ) ) )
    436 
    437 (define create-temporary-file
    438   (let ([getenv getenv]
    439         [make-pathname make-pathname]
    440         [file-exists? file-exists?]
    441         [call-with-output-file call-with-output-file] )
    442     (lambda (#!optional (ext "tmp"))
    443       (let ([dir (or (getenv "TMPDIR") (getenv "TEMP") (getenv "TMP") "/tmp")])
    444         (##sys#check-string ext 'create-temporary-file)
    445         (let loop ()
    446           (let* ([n (##sys#fudge 16)]
    447                  [pn (make-pathname dir (##sys#string-append "t" (number->string n 16)) ext)] )
    448             (cond ((file-exists? pn) (loop))
    449                   (else (call-with-output-file pn (lambda (p) pn)) ) ) ) ) ) ) ) )
    450 
    451 ;; Directory string or list only contains path-separators
    452 ;; and/or current-directory names.
    453 
    454 (define (directory-null? dir)
    455   (let loop ([lst
    456               (if (list? dir)
    457                   dir ; Don't bother to check for strings here
    458                   (begin
    459                     (##sys#check-string dir 'directory-null?)
    460                     (string-split dir "/\\" #t)))])
    461     (or (null? lst)
    462         (and (member (car lst) '("" "."))
    463              (loop (cdr lst)) ) ) ) )
    464 
    465176;;; Handy I/O procedures:
    466177
Note: See TracChangeset for help on using the changeset viewer.