1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
Conflicts:
	libguile/foreign.c
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
This commit is contained in:
Andy Wingo 2012-01-30 18:25:07 +01:00
commit 855db1905d
331 changed files with 1929 additions and 817 deletions

1
.gitignore vendored
View file

@ -147,3 +147,4 @@ INSTALL
/lib/stdalign.h /lib/stdalign.h
/lib/signal.h /lib/signal.h
/lib/sys/types.h /lib/sys/types.h
/lib/dirent.h

View file

@ -1,11 +1,11 @@
# Having a separate GNUmakefile lets me `include' the dynamically # Having a separate GNUmakefile lets me 'include' the dynamically
# generated rules created via cfg.mk (package-local configuration) # generated rules created via cfg.mk (package-local configuration)
# as well as maint.mk (generic maintainer rules). # as well as maint.mk (generic maintainer rules).
# This makefile is used only if you run GNU Make. # This makefile is used only if you run GNU Make.
# It is necessary if you want to build targets usually of interest # It is necessary if you want to build targets usually of interest
# only to the maintainer. # only to the maintainer.
# Copyright (C) 2001, 2003, 2006-2011 Free Software Foundation, Inc. # Copyright (C) 2001, 2003, 2006-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -114,7 +114,7 @@ endif
abort-due-to-no-makefile: abort-due-to-no-makefile:
@echo There seems to be no Makefile in this directory. 1>&2 @echo There seems to be no Makefile in this directory. 1>&2
@echo "You must run ./configure before running \`make'." 1>&2 @echo "You must run ./configure before running 'make'." 1>&2
@exit 1 @exit 1
endif endif

138
NEWS
View file

@ -5,6 +5,144 @@ See the end for copying conditions.
Please send Guile bug reports to bug-guile@gnu.org. Please send Guile bug reports to bug-guile@gnu.org.
Changes in 2.0.4 (since 2.0.3):
* Notable changes
** Better debuggability for interpreted procedures.
Guile 2.0 came with a great debugging experience for compiled
procedures, but the story for interpreted procedures was terrible. Now,
at least, interpreted procedures have names, and the `arity' procedure
property is always correct (or, as correct as it can be, in the presence
of `case-lambda').
** Support for cross-compilation.
One can now use a native Guile to cross-compile `.go' files for a
different architecture. See the documentation for `--target' in the
"Compilation" section of the manual, for information on how to use the
cross-compiler. See the "Cross building Guile" section of the README,
for more on how to cross-compile Guile itself.
** Fluids can now have default values.
Fluids are used for dynamic and thread-local binding. They have always
inherited their values from the context or thread that created them.
However, there was a case in which a new thread would enter Guile, and
the default values of all the fluids would be `#f' for that thread.
This has now been fixed so that `make-fluid' has an optional default
value for fluids in unrelated dynamic roots, which defaults to `#f'.
** Garbage collector tuning.
The garbage collector has now been tuned to run more often under some
circumstances.
*** Unmanaged allocation
The new `scm_gc_register_allocation' function will notify the collector
of unmanaged allocation. This will cause the collector to run sooner.
Guile's `scm_malloc', `scm_calloc', and `scm_realloc' unmanaged
allocators eventually call this function. This leads to better
performance under steady-state unmanaged allocation.
*** Transient allocation
When the collector runs, it will try to record the total memory
footprint of a process, if the platform supports this information. If
the memory footprint is growing, the collector will run more frequently.
This reduces the increase of the resident size of a process in response
to a transient increase in allocation.
*** Management of threads, bignums
Creating a thread will allocate a fair amount of memory. Guile now does
some GC work (using `GC_collect_a_little') when allocating a thread.
This leads to a better memory footprint when creating many short-lived
threads.
Similarly, bignums can occupy a lot of memory. Guile now offers hooks
to enable custom GMP allocators that end up calling
`scm_gc_register_allocation'. These allocators are enabled by default
when running Guile from the command-line. To enable them in libraries,
set the `scm_install_gmp_memory_functions' variable to a nonzero value
before loading Guile.
** SRFI-39 parameters are available by default.
Guile now includes support for parameters, as defined by SRFI-39, in the
default environment. See "Parameters" in the manual, for more
information. `current-input-port', `current-output-port', and
`current-error-port' are now parameters.
** Add `current-warning-port'
Guile now outputs warnings on a separate port, `current-warning-port',
initialized to the value that `current-error-port' has on startup.
** Syntax parameters.
Following Racket's lead, Guile now supports syntax parameters. See
"Syntax parameters" in the manual, for more.
Also see Barzilay, Culpepper, and Flatt's 2011 SFP workshop paper,
"Keeping it Clean with syntax-parameterize".
** Parse command-line arguments from the locale encoding.
Guile now attempts to parse command-line arguments using the user's
locale. However for backwards compatibility with other 2.0.x releases,
it does so without actually calling `setlocale'. Please report any bugs
in this facility to bug-guile@gnu.org.
* New interfaces
** (ice-9 session): `apropos-hook'
** New print option: `escape-newlines', defaults to #t.
** (ice-9 ftw): `file-system-fold', `file-system-tree', `scandir'
* Bug fixes
** Fix R6RS `fold-left' so the accumulator is the first argument.
** fix <dynwind> serialization.
** Fix bugs in the new `peval' optimizer.
** Allow values bound in non-tail let expressions to be collected.
** Fix bit-set*! bug from 2005.
** Fix bug in `make-repl' when `lang' is actually a language.
** Hack the port-column of current-output-port after printing a prompt.
** FFI: Hold a weak reference to the CIF made by `procedure->pointer'.
** FFI: Hold a weak reference to the procedure passed to `procedure->pointer'.
** FFI: Properly unpack small integer return values in closure call.
** Allow overlapping regions to be passed to `bytevector-copy!'.
** Fix `validate-target' in (system base target).
** `,language' at REPL sets the current-language fluid.
** `primitive-load' returns the value(s) of the last expression.
** Add an exception printer for `getaddrinfo-error'.
** Add a deprecated alias for $expt.
** Document invalidity of (begin) as expression; add back-compat shim.
** Web: Allow URIs with empty authorities, like "file:///etc/hosts".
** HTTP: Fix validators for various list-style headers.
** HTTP: Extend handling of "Cache-Control" header.
** HTTP: Fix qstring writing of cache-extension values
** HTTP: `write-request-line' writes absolute paths, not absolute URIs.
** HTTP: Permit non-date values for Expires header.
** FreeBSD build fixes.
** Fix generalized-vector-{ref,set!} for slices.
** Fix erroneous check in `set-procedure-properties!'.
** Don't leak file descriptors when mmaping objcode.
** Fix bugs related to mutation, the null string, and shared substrings.
** Deprecate SCM_ASRTGO.
** Add deprecated shim for `scm_display_error' with stack as first argument.
** i18n: Fix gc_malloc/free mismatch on non-GNU systems.
** Make sure `regexp-quote' tests use Unicode-capable string ports.
** Have `cpu-word-size' error out on unknown CPUs; add support for MIPSEL.
** `scm_from_stringn' always returns unique strings.
** Empty substrings no longer reference the original stringbuf.
** `scm_i_substring_copy' tries to narrow the substring.
** Avoid calling `u32_conv_from_encoding' on the null string.
Changes in 2.0.3 (since 2.0.2): Changes in 2.0.3 (since 2.0.2):
* Speed improvements * Speed improvements

13
README
View file

@ -93,10 +93,15 @@ Guile requires the following external packages:
- pkg-config - pkg-config
Guile's ./configure script uses pkg-config to discover the correct Guile's ./configure script uses pkg-config to discover the correct
compile and link options for libgc and libffi. If you don't have compile and link options for libgc and libffi. For this to work,
pkg-config installed, or you have a version of libgc that doesn't the `PKG_CONFIG_PATH' environment variable must be set to point to
provide a .pc file, you can work around this by setting some the places where libgc's and libffi's `.pc' files can be found:
variables as part of the configure command-line:
PKG_CONFIG_PATH=/path/to/libgc/lib/pkgconfig:/path/to/libffi/lib/pkgconfig
Alternatively, when pkg-config is not installed, you can work around
this by setting some variables as part of the configure
command-line:
- PKG_CONFIG=true - PKG_CONFIG=true

View file

@ -3,13 +3,13 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
if 0; if 0;
# Generate a release announcement message. # Generate a release announcement message.
my $VERSION = '2011-11-09 21:30'; # UTC my $VERSION = '2012-01-06 07:46'; # UTC
# The definition above must lie within the first 8 lines in order # The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it. # for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook # If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually. # do its job. Otherwise, update this string manually.
# Copyright (C) 2002-2011 Free Software Foundation, Inc. # Copyright (C) 2002-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -44,7 +44,7 @@ sub usage ($)
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
if ($exit_code != 0) if ($exit_code != 0)
{ {
print $STREAM "Try `$ME --help' for more information.\n"; print $STREAM "Try '$ME --help' for more information.\n";
} }
else else
{ {
@ -106,7 +106,7 @@ sub sizes (@)
my $t = `$cmd`; my $t = `$cmd`;
# FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS # FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS
$@ $@
and (warn "$ME: command failed: `$cmd'\n"), $fail = 1; and (warn "$ME: command failed: '$cmd'\n"), $fail = 1;
chomp $t; chomp $t;
$t =~ s/^([\d.]+[MkK]).*/${1}B/; $t =~ s/^([\d.]+[MkK]).*/${1}B/;
$res{$f} = $t; $res{$f} = $t;
@ -210,7 +210,7 @@ sub print_news_deltas ($$$)
else else
{ {
# This regexp must not match version numbers in NEWS items. # This regexp must not match version numbers in NEWS items.
# For example, they might well say `introduced in 4.5.5', # For example, they might well say "introduced in 4.5.5",
# and we don't want that to match. # and we don't want that to match.
$line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$prev_version\E(?:[^\d.]|$)/o $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$prev_version\E(?:[^\d.]|$)/o
and last; and last;
@ -222,9 +222,9 @@ sub print_news_deltas ($$$)
close NEWS; close NEWS;
$in_items $in_items
or die "$ME: $news_file: no matching lines for `$curr_version'\n"; or die "$ME: $news_file: no matching lines for '$curr_version'\n";
$found_news $found_news
or die "$ME: $news_file: no news item found for `$curr_version'\n"; or die "$ME: $news_file: no news item found for '$curr_version'\n";
} }
sub print_changelog_deltas ($$) sub print_changelog_deltas ($$)
@ -269,7 +269,7 @@ sub print_changelog_deltas ($$)
# Append any remaining ChangeLog files. # Append any remaining ChangeLog files.
push @reordered, sort keys %changelog; push @reordered, sort keys %changelog;
# Remove leading `./'. # Remove leading './'.
@reordered = map { s!^\./!!; $_ } @reordered; @reordered = map { s!^\./!!; $_ } @reordered;
print "\nChangeLog entries:\n\n"; print "\nChangeLog entries:\n\n";
@ -280,11 +280,11 @@ sub print_changelog_deltas ($$)
my $cmd = "cvs -n diff -u -r$prev_cvs_tag -rHEAD @reordered"; my $cmd = "cvs -n diff -u -r$prev_cvs_tag -rHEAD @reordered";
open DIFF, '-|', $cmd open DIFF, '-|', $cmd
or die "$ME: cannot run `$cmd': $!\n"; or die "$ME: cannot run '$cmd': $!\n";
# Print two types of lines, making minor changes: # Print two types of lines, making minor changes:
# Lines starting with `+++ ', e.g., # Lines starting with '+++ ', e.g.,
# +++ ChangeLog 22 Feb 2003 16:52:51 -0000 1.247 # +++ ChangeLog 22 Feb 2003 16:52:51 -0000 1.247
# and those starting with `+'. # and those starting with '+'.
# Don't print the others. # Don't print the others.
my $prev_printed_line_empty = 1; my $prev_printed_line_empty = 1;
while (defined (my $line = <DIFF>)) while (defined (my $line = <DIFF>))
@ -310,7 +310,7 @@ sub print_changelog_deltas ($$)
# The exit code should be 1. # The exit code should be 1.
# Allow in case there are no modified ChangeLog entries. # Allow in case there are no modified ChangeLog entries.
$? == 256 || $? == 128 $? == 256 || $? == 128
or warn "$ME: warning: `cmd' had unexpected exit code or signal ($?)\n"; or warn "$ME: warning: '$cmd' had unexpected exit code or signal ($?)\n";
} }
sub get_tool_versions ($$) sub get_tool_versions ($$)
@ -329,7 +329,7 @@ sub get_tool_versions ($$)
next; next;
} }
# Assume that the last "word" on the first line of # Assume that the last "word" on the first line of
# `tool --version` output is the version string. # 'tool --version' output is the version string.
my ($first_line, undef) = split ("\n", `$t --version`); my ($first_line, undef) = split ("\n", `$t --version`);
if ($first_line =~ /.* (\d[\w.-]+)$/) if ($first_line =~ /.* (\d[\w.-]+)$/)
{ {
@ -410,7 +410,7 @@ sub get_tool_versions ($$)
. "in the gnulib source directory.\n"), $fail = 1; . "in the gnulib source directory.\n"), $fail = 1;
exists $valid_release_types{$release_type} exists $valid_release_types{$release_type}
or (warn "$ME: `$release_type': invalid release type\n"), $fail = 1; or (warn "$ME: '$release_type': invalid release type\n"), $fail = 1;
@ARGV @ARGV
and (warn "$ME: too many arguments:\n", join ("\n", @ARGV), "\n"), and (warn "$ME: too many arguments:\n", join ("\n", @ARGV), "\n"),
@ -505,7 +505,7 @@ then run this command to import it:
gpg --keyserver keys.gnupg.net --recv-keys $gpg_key_id gpg --keyserver keys.gnupg.net --recv-keys $gpg_key_id
and rerun the \`gpg --verify' command. and rerun the 'gpg --verify' command.
EOF EOF
my @tool_versions = get_tool_versions (\@tool_list, $gnulib_version); my @tool_versions = get_tool_versions (\@tool_list, $gnulib_version);

View file

@ -2,7 +2,7 @@
# Output a system dependent set of variables, describing how to set the # Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable. # run time search path of shared libraries in an executable.
# #
# Copyright 1996-2011 Free Software Foundation, Inc. # Copyright 1996-2012 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001 # Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# #

View file

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
# Print a version string. # Print a version string.
scriptversion=2011-11-13.13; # UTC scriptversion=2012-01-06.07; # UTC
# Copyright (C) 2007-2011 Free Software Foundation, Inc. # Copyright (C) 2007-2012 Free Software Foundation, Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -98,8 +98,8 @@ while test $# -gt 0; do
--version) echo "$version"; exit 0;; --version) echo "$version"; exit 0;;
--prefix) shift; prefix="$1";; --prefix) shift; prefix="$1";;
-*) -*)
echo "$0: Unknown option \`$1'." >&2 echo "$0: Unknown option '$1'." >&2
echo "$0: Try \`--help' for more information." >&2 echo "$0: Try '--help' for more information." >&2
exit 1;; exit 1;;
*) *)
if test -z "$tarball_version_file"; then if test -z "$tarball_version_file"; then
@ -107,7 +107,7 @@ while test $# -gt 0; do
elif test -z "$tag_sed_script"; then elif test -z "$tag_sed_script"; then
tag_sed_script="$1" tag_sed_script="$1"
else else
echo "$0: extra non-option argument \`$1'." >&2 echo "$0: extra non-option argument '$1'." >&2
exit 1 exit 1
fi;; fi;;
esac esac

View file

@ -3,13 +3,13 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
if 0; if 0;
# Convert git log output to ChangeLog format. # Convert git log output to ChangeLog format.
my $VERSION = '2011-11-02 07:53'; # UTC my $VERSION = '2012-01-06 07:14'; # UTC
# The definition above must lie within the first 8 lines in order # The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it. # for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook # If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually. # do its job. Otherwise, update this string manually.
# Copyright (C) 2008-2011 Free Software Foundation, Inc. # Copyright (C) 2008-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -47,7 +47,7 @@ sub usage ($)
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
if ($exit_code != 0) if ($exit_code != 0)
{ {
print $STREAM "Try `$ME --help' for more information.\n"; print $STREAM "Try '$ME --help' for more information.\n";
} }
else else
{ {
@ -78,6 +78,21 @@ EXAMPLE:
$ME --since=2008-01-01 > ChangeLog $ME --since=2008-01-01 > ChangeLog
$ME -- -n 5 foo > last-5-commits-to-branch-foo $ME -- -n 5 foo > last-5-commits-to-branch-foo
SPECIAL SYNTAX:
The following types of strings are interpreted specially when they appear
at the beginning of a log message line. They are not copied to the output.
Copyright-paperwork-exempt: Yes
Append the "(tiny change)" notation to the usual "date name email"
ChangeLog header to mark a change that does not require a copyright
assignment.
Co-authored-by: Joe User <user\@example.com>
List the specified name and email address on a second
ChangeLog header, denoting a co-author.
Signed-off-by: Joe User <user\@example.com>
These lines are simply elided.
In a FILE specified via --amend, comment lines (starting with "#") are ignored. In a FILE specified via --amend, comment lines (starting with "#") are ignored.
FILE must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 (alone on FILE must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 (alone on
a line) referring to a commit in the current project, and CODE refers to one a line) referring to a commit in the current project, and CODE refers to one
@ -93,7 +108,7 @@ s/all tile types/all file types/
1379ed974f1fa39b12e2ffab18b3f7a607082202 1379ed974f1fa39b12e2ffab18b3f7a607082202
# Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself. # Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself.
# Change the author to be Paul. Note the escaped "@": # Change the author to be Paul. Note the escaped "@":
s,Jim .*>,Paul Eggert <eggert\@cs.ucla.edu>, s,Jim .*>,Paul Eggert <eggert\\\@cs.ucla.edu>,
EOF EOF
} }
@ -196,9 +211,10 @@ sub parse_amend_file($)
my @cmd = (qw (git log --log-size), my @cmd = (qw (git log --log-size),
'--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV); '--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV);
open PIPE, '-|', @cmd open PIPE, '-|', @cmd
or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n" or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n"
. "(Is your Git too old? Version 1.5.1 or later is required.)\n"); . "(Is your Git too old? Version 1.5.1 or later is required.)\n");
my $prev_multi_paragraph;
my $prev_date_line = ''; my $prev_date_line = '';
my @prev_coauthors = (); my @prev_coauthors = ();
while (1) while (1)
@ -249,11 +265,33 @@ sub parse_amend_file($)
or die "$ME:$.: Invalid line " or die "$ME:$.: Invalid line "
. "(expected date/author/email):\n$author_line\n"; . "(expected date/author/email):\n$author_line\n";
my $date_line = sprintf "%s $2\n", strftime ("%F", localtime ($1)); # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
# `(tiny change)' annotation.
my $tiny = (grep (/^Copyright-paperwork-exempt:\s+[Yy]es$/, @line)
? ' (tiny change)' : '');
my $date_line = sprintf "%s %s$tiny\n",
strftime ("%F", localtime ($1)), $2;
my @coauthors = grep /^Co-authored-by:.*$/, @line;
# Omit meta-data lines we've already interpreted.
@line = grep !/^(?:Signed-off-by:[ ].*>$
|Co-authored-by:[ ]
|Copyright-paperwork-exempt:[ ]
)/x, @line;
# Remove leading and trailing blank lines.
if (@line)
{
while ($line[0] =~ /^\s*$/) { shift @line; }
while ($line[$#line] =~ /^\s*$/) { pop @line; }
}
# Record whether there are two or more paragraphs.
my $multi_paragraph = grep /^\s*$/, @line;
# Format 'Co-authored-by: A U Thor <email@example.com>' lines in # Format 'Co-authored-by: A U Thor <email@example.com>' lines in
# standard multi-author ChangeLog format. # standard multi-author ChangeLog format.
my @coauthors = grep /^Co-authored-by:.*$/, @line;
for (@coauthors) for (@coauthors)
{ {
s/^Co-authored-by:\s*/\t /; s/^Co-authored-by:\s*/\t /;
@ -264,9 +302,13 @@ sub parse_amend_file($)
. substr ($_, 5) . "\n"; . substr ($_, 5) . "\n";
} }
# If this header would be the same as the previous date/name/email/ # If this header would be different from the previous date/name/email/
# coauthors header, then arrange not to print it. # coauthors header, or if this or the previous entry consists of two
if ($date_line ne $prev_date_line or "@coauthors" ne "@prev_coauthors") # or more paragraphs, then print the header.
if ($date_line ne $prev_date_line
or "@coauthors" ne "@prev_coauthors"
or $multi_paragraph
or $prev_multi_paragraph)
{ {
$prev_date_line eq '' $prev_date_line eq ''
or print "\n"; or print "\n";
@ -276,17 +318,7 @@ sub parse_amend_file($)
} }
$prev_date_line = $date_line; $prev_date_line = $date_line;
@prev_coauthors = @coauthors; @prev_coauthors = @coauthors;
$prev_multi_paragraph = $multi_paragraph;
# Omit "Co-authored-by..." and "Signed-off-by..." lines.
@line = grep !/^Signed-off-by: .*>$/, @line;
@line = grep !/^Co-authored-by: /, @line;
# Remove leading and trailing blank lines.
if (@line)
{
while ($line[0] =~ /^\s*$/) { shift @line; }
while ($line[$#line] =~ /^\s*$/) { pop @line; }
}
# If there were any lines # If there were any lines
if (@line == 0) if (@line == 0)

View file

@ -9,7 +9,7 @@
VERSION=2009-07-21.16; # UTC VERSION=2009-07-21.16; # UTC
# Copyright (C) 2009-2011 Free Software Foundation, Inc. # Copyright (C) 2009-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View file

@ -1,10 +1,9 @@
#!/bin/sh #!/bin/sh
# Sign files and upload them. # Sign files and upload them.
scriptversion=2010-05-23.15; # UTC scriptversion=2012-01-15.15; # UTC
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Copyright (C) 2004-2010, 2012 Free Software Foundation, Inc.
# Foundation, Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -20,6 +19,8 @@ scriptversion=2010-05-23.15; # UTC
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Originally written by Alexandre Duret-Lutz <adl@gnu.org>. # Originally written by Alexandre Duret-Lutz <adl@gnu.org>.
# The master copy of this file is maintained in the gnulib Git repository.
# Please send bug reports and feature requests to bug-gnulib@gnu.org.
set -e set -e
@ -57,7 +58,7 @@ Options:
--version output version information and exit --version output version information and exit
If --symlink-regex is given without EXPR, then the link target name If --symlink-regex is given without EXPR, then the link target name
is created by replacing the version information with \`-latest', e.g.: is created by replacing the version information with '-latest', e.g.:
foo-1.3.4.tar.gz -> foo-latest.tar.gz foo-1.3.4.tar.gz -> foo-latest.tar.gz
@ -105,8 +106,7 @@ happen to have an ncftp package installed, the ncftpput-ftp script in
the build-aux/ directory of the gnulib package the build-aux/ directory of the gnulib package
(http://savannah.gnu.org/projects/gnulib) may serve as a replacement. (http://savannah.gnu.org/projects/gnulib) may serve as a replacement.
Report bugs to <bug-automake@gnu.org>. Send patches and bug reports to <bug-gnulib@gnu.org>."
Send patches to <automake-patches@gnu.org>."
# Read local configuration file # Read local configuration file
if test -r "$conffile"; then if test -r "$conffile"; then
@ -170,7 +170,7 @@ while test -n "$1"; do
break break
;; ;;
-*) -*)
echo "$0: Unknown option \`$1', try \`$0 --help'" 1>&2 echo "$0: Unknown option '$1', try '$0 --help'" 1>&2
exit 1 exit 1
;; ;;
esac esac
@ -219,7 +219,7 @@ else
for file for file
do do
if test ! -f $file; then if test ! -f $file; then
echo "$0: Cannot find \`$file'" 1>&2 echo "$0: Cannot find '$file'" 1>&2
exit 1 exit 1
elif test -n "$symlink_expr"; then elif test -n "$symlink_expr"; then
linkname=`echo $file | sed "$symlink_expr"` linkname=`echo $file | sed "$symlink_expr"`
@ -238,10 +238,10 @@ fi
unset passphrase unset passphrase
# Reset PATH to be sure that echo is a built-in. We will later use # Reset PATH to be sure that echo is a built-in. We will later use
# `echo $passphrase' to output the passphrase, so it is important that # 'echo $passphrase' to output the passphrase, so it is important that
# it is a built-in (third-party programs tend to appear in `ps' # it is a built-in (third-party programs tend to appear in 'ps'
# listings with their arguments...). # listings with their arguments...).
# Remember this script runs with `set -e', so if echo is not built-in # Remember this script runs with 'set -e', so if echo is not built-in
# it will exit now. # it will exit now.
PATH=/empty echo -n "Enter GPG passphrase: " PATH=/empty echo -n "Enter GPG passphrase: "
stty -echo stty -echo

View file

@ -1,5 +1,5 @@
/* A C macro for declaring that specific arguments must not be NULL. /* A C macro for declaring that specific arguments must not be NULL.
Copyright (C) 2009-2011 Free Software Foundation, Inc. Copyright (C) 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published under the terms of the GNU General Public License as published

View file

@ -1,5 +1,5 @@
/* C++ compatible function declaration macros. /* C++ compatible function declaration macros.
Copyright (C) 2010-2011 Free Software Foundation, Inc. Copyright (C) 2010-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published under the terms of the GNU General Public License as published

View file

@ -1,5 +1,5 @@
/* A C macro for declaring that specific function parameters are not used. /* A C macro for declaring that specific function parameters are not used.
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published under the terms of the GNU General Public License as published

View file

@ -1,5 +1,5 @@
/* A C macro for emitting warnings if a function is used. /* A C macro for emitting warnings if a function is used.
Copyright (C) 2010-2011 Free Software Foundation, Inc. Copyright (C) 2010-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published under the terms of the GNU General Public License as published

View file

@ -4,13 +4,13 @@ eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}'
# Detect instances of "if (p) free (p);". # Detect instances of "if (p) free (p);".
# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces. # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
my $VERSION = '2011-04-20 13:43'; # UTC my $VERSION = '2012-01-06 07:23'; # UTC
# The definition above must lie within the first 8 lines in order # The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it. # for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook # If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually. # do its job. Otherwise, update this string manually.
# Copyright (C) 2008-2011 Free Software Foundation, Inc. # Copyright (C) 2008-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -47,7 +47,7 @@ sub usage ($)
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
if ($exit_code != 0) if ($exit_code != 0)
{ {
print $STREAM "Try `$ME --help' for more information.\n"; print $STREAM "Try '$ME --help' for more information.\n";
} }
else else
{ {
@ -62,7 +62,7 @@ detect free-like functions named FOO and BAR.
OPTIONS: OPTIONS:
--list print only the name of each matching FILE (\\0-terminated) --list print only the name of each matching FILE (\\0-terminated)
--name=N add name N to the list of \`free\'-like functions to detect; --name=N add name N to the list of \'free\'-like functions to detect;
may be repeated may be repeated
--help display this help and exit --help display this help and exit
@ -125,7 +125,7 @@ sub is_NULL ($)
foreach my $file (@ARGV) foreach my $file (@ARGV)
{ {
open FH, '<', $file open FH, '<', $file
or (warn "$ME: can't open `$file' for reading: $!\n"), or (warn "$ME: can't open '$file' for reading: $!\n"),
$err = EXIT_ERROR, next; $err = EXIT_ERROR, next;
while (defined (my $line = <FH>)) while (defined (my $line = <FH>))
{ {

View file

@ -4,7 +4,7 @@
# Print a version string. # Print a version string.
scriptversion=2011-05-16.22; # UTC scriptversion=2011-05-16.22; # UTC
# Copyright (C) 2006-2011 Free Software Foundation, Inc. # Copyright (C) 2006-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View file

@ -77,7 +77,7 @@ the FSF.<br />
Please send broken links and other corrections or suggestions to Please send broken links and other corrections or suggestions to
<a href="mailto:%%EMAIL%%">&lt;%%EMAIL%%&gt;</a>.</p> <a href="mailto:%%EMAIL%%">&lt;%%EMAIL%%&gt;</a>.</p>
<p>Copyright &copy; 2011 Free Software Foundation, Inc.</p> <p>Copyright &copy; 2012 Free Software Foundation, Inc.</p>
<p>Verbatim copying and distribution of this entire article are <p>Verbatim copying and distribution of this entire article are
permitted worldwide, without royalty, in any medium, provided this permitted worldwide, without royalty, in any medium, provided this

View file

@ -785,6 +785,13 @@ the current implementation that object shares structure with
@var{args}, so @var{args} should not be modified subsequently. @var{args}, so @var{args} should not be modified subsequently.
@end deffn @end deffn
@deffn {C Function} scm_c_value_ref (values, idx)
Returns the value at the position specified by @var{idx} in
@var{values}. Note that @var{values} will ordinarily be a
multiple-values object, but it need not be. Any other object
represents a single value (itself), and is handled appropriately.
@end deffn
@rnindex call-with-values @rnindex call-with-values
@deffn {Scheme Procedure} call-with-values producer consumer @deffn {Scheme Procedure} call-with-values producer consumer
Calls its @var{producer} argument with no values and a Calls its @var{producer} argument with no values and a

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*- @c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual. @c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011 @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012
@c Free Software Foundation, Inc. @c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@ -417,6 +417,8 @@ quote-keywordish-symbols reader How to print symbols that have a colon
'#t' quotes them; 'reader' quotes them '#t' quotes them; 'reader' quotes them
when the reader option 'keywords' is when the reader option 'keywords' is
not '#f'. not '#f'.
escape-newlines yes Render newlines as \n when printing
using `write'.
@end smalllisp @end smalllisp
These options may be modified with the print-set! syntax. These options may be modified with the print-set! syntax.

View file

@ -38,9 +38,10 @@ languages}, or EDSLs.}.
* Defining Macros:: Binding macros, globally and locally. * Defining Macros:: Binding macros, globally and locally.
* Syntax Rules:: Pattern-driven macros. * Syntax Rules:: Pattern-driven macros.
* Syntax Case:: Procedural, hygienic macros. * Syntax Case:: Procedural, hygienic macros.
* Syntax Transformer Helpers:: Helpers for use in procedural macros.
* Defmacros:: Lisp-style macros. * Defmacros:: Lisp-style macros.
* Identifier Macros:: Identifier macros. * Identifier Macros:: Identifier macros.
* Syntax Parameters:: Syntax Parameters * Syntax Parameters:: Syntax Parameters.
* Eval When:: Affecting the expand-time environment. * Eval When:: Affecting the expand-time environment.
* Internal Macros:: Macros as first-class values. * Internal Macros:: Macros as first-class values.
@end menu @end menu
@ -671,28 +672,101 @@ source file, one may write:
(newline)))))) (newline))))))
@end example @end example
Finally, we should mention the following helper procedures defined by the core Readers interested in further information on @code{syntax-case} macros should
of @code{syntax-case}: see R. Kent Dybvig's excellent @cite{The Scheme Programming Language}, either
edition 3 or 4, in the chapter on syntax. Dybvig was the primary author of the
@code{syntax-case} system. The book itself is available online at
@uref{http://scheme.com/tspl4/}.
@node Syntax Transformer Helpers
@subsection Syntax Transformer Helpers
As noted in the previous section, Guile's syntax expander operates on
syntax objects. Procedural macros consume and produce syntax objects.
This section describes some of the auxiliary helpers that procedural
macros can use to compare, generate, and query objects of this data
type.
@deffn {Scheme Procedure} bound-identifier=? a b @deffn {Scheme Procedure} bound-identifier=? a b
Returns @code{#t} iff the syntax objects @var{a} and @var{b} refer to the same Return @code{#t} iff the syntax objects @var{a} and @var{b} refer to the
lexically-bound identifier. same lexically-bound identifier.
@end deffn @end deffn
@deffn {Scheme Procedure} free-identifier=? a b @deffn {Scheme Procedure} free-identifier=? a b
Returns @code{#t} iff the syntax objects @var{a} and @var{b} refer to the same Return @code{#t} iff the syntax objects @var{a} and @var{b} refer to the
free identifier. same free identifier.
@end deffn @end deffn
@deffn {Scheme Procedure} generate-temporaries ls @deffn {Scheme Procedure} generate-temporaries ls
Return a list of temporary identifiers as long as @var{ls} is long. Return a list of temporary identifiers as long as @var{ls} is long.
@end deffn @end deffn
Readers interested in further information on @code{syntax-case} macros should @deffn {Scheme Procedure} syntax-source x
see R. Kent Dybvig's excellent @cite{The Scheme Programming Language}, either Return the source properties that correspond to the syntax object
edition 3 or 4, in the chapter on syntax. Dybvig was the primary author of the @var{x}. @xref{Source Properties}, for more information.
@code{syntax-case} system. The book itself is available online at @end deffn
@uref{http://scheme.com/tspl4/}.
@deffn {Scheme Procedure} syntax-local-binding id
Resolve the identifer @var{id}, a syntax object, within the current
lexical environment, and return two values, the binding type and a
binding value. The binding type is a symbol, which may be one of the
following:
@table @code
@item lexical
A lexically-bound variable. The value is a unique token (in the sense
of @code{eq?}) identifying this binding.
@item macro
A syntax transformer, either local or global. The value is the
transformer procedure.
@item pattern-variable
A pattern variable, bound via syntax-case. The value is an opaque
object, internal to the expander.
@item displaced-lexical
A lexical variable that has gone out of scope. This can happen if a
badly-written procedural macro saves a syntax object, then attempts to
introduce it in a context in which it is unbound. The value is
@code{#f}.
@item global
A global binding. The value is a pair, whose head is the symbol, and
whose tail is the name of the module in which to resolve the symbol.
@item other
Some other binding, like @code{lambda} or other core bindings. The
value is @code{#f}.
@end table
This is a very low-level procedure, with limited uses. One case in
which it is useful is to build abstractions that associate auxiliary
information with macros:
@example
(define aux-property (make-object-property))
(define-syntax-rule (with-aux aux value)
(let ((trans value))
(set! (aux-property trans) aux)
trans)))
(define-syntax retrieve-aux
(lambda (x)
(syntax-case x ()
((x id)
(call-with-values (lambda () (syntax-local-binding #'id))
(lambda (type val)
(with-syntax ((aux (datum->syntax #'here
(and (eq? type 'macro)
(aux-property val)))))
#''aux)))))))
(define-syntax foo
(with-aux 'bar
(syntax-rules () ((_) 'foo))))
(foo)
@result{} foo
(retrieve-aux foo)
@result{} bar
@end example
@code{syntax-local-binding} must be called within the dynamic extent of
a syntax transformer; to call it otherwise will signal an error.
@end deffn
@node Defmacros @node Defmacros
@subsection Lisp-style Macro Definitions @subsection Lisp-style Macro Definitions

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*- @c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual. @c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010 @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2012
@c Free Software Foundation, Inc. @c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@ -163,6 +163,9 @@ between different modules.
The function @code{scm_calloc} is similar to @code{scm_malloc}, but The function @code{scm_calloc} is similar to @code{scm_malloc}, but
initializes the block of memory to zero as well. initializes the block of memory to zero as well.
These functions will (indirectly) call
@code{scm_gc_register_allocation}.
@end deftypefn @end deftypefn
@deftypefn {C Function} {void *} scm_realloc (void *@var{mem}, size_t @var{new_size}) @deftypefn {C Function} {void *} scm_realloc (void *@var{mem}, size_t @var{new_size})
@ -174,6 +177,8 @@ and allocates a new block of size @var{new_size}.
When not enough memory is available, signal an error. This function When not enough memory is available, signal an error. This function
runs the GC to free up some memory when it deems it appropriate. runs the GC to free up some memory when it deems it appropriate.
This function will call @code{scm_gc_register_allocation}.
@end deftypefn @end deftypefn
@ -209,39 +214,26 @@ the memory management overhead very low. However, in Guile 2.x,
@end deftypefn @end deftypefn
@deftypefn {C Function} void scm_gc_register_collectable_memory (void *@var{mem}, size_t @var{size}, const char *@var{what}) @deftypefn {C Function} void scm_gc_register_allocation (size_t @var{size})
Informs the GC that the memory at @var{mem} of size @var{size} can Informs the garbage collector that @var{size} bytes have been allocated,
potentially be freed during a GC. That is, announce that @var{mem} is which the collector would otherwise not have known about.
part of a GC controlled object and when the GC happens to free that
object, @var{size} bytes will be freed along with it. The GC will
@strong{not} free the memory itself, it will just know that so-and-so
much bytes of memory are associated with GC controlled objects and the
memory system figures this into its decisions when to run a GC.
The @var{what} argument is used for statistical purposes. It should In general, Scheme will decide to collect garbage only after some amount
describe the type of object that the memory will be used for so that of memory has been allocated. Calling this function will make the
users can identify just what strange objects are eating up their Scheme garbage collector know about more allocation, and thus run more
memory. often (as appropriate).
In Guile 2.x, this function has no effect. It is especially important to call this function when large unmanaged
@end deftypefn allocations, like images, may be freed by small Scheme allocations, like
SMOBs.
@deftypefn {C Function} void scm_gc_unregister_collectable_memory (void *@var{mem}, size_t @var{size})
Informs the GC that the memory at @var{mem} of size @var{size} is no
longer associated with a GC controlled object. You must take care to
match up every call to @code{scm_gc_register_collectable_memory} with
a call to @code{scm_gc_unregister_collectable_memory}. If you don't do
this, the GC might have a wrong impression of what is going on and run
much less efficiently than it could.
In Guile 2.x, this function has no effect.
@end deftypefn @end deftypefn
@deftypefn {C Function} void scm_frame_free (void *mem) @deftypefn {C Function} void scm_dynwind_free (void *mem)
Equivalent to @code{scm_frame_unwind_handler (free, @var{mem}, Equivalent to @code{scm_dynwind_unwind_handler (free, @var{mem},
SCM_F_WIND_EXPLICITLY)}. That is, the memory block at @var{mem} will SCM_F_WIND_EXPLICITLY)}. That is, the memory block at @var{mem} will be
be freed when the current frame is left. freed (using @code{free} from the C library) when the current dynwind is
left.
@end deftypefn @end deftypefn
@deffn {Scheme Procedure} malloc-stats @deffn {Scheme Procedure} malloc-stats
@ -272,7 +264,7 @@ The functions @code{scm_must_malloc} and @code{scm_must_realloc}
behaved like @code{scm_gc_malloc} and @code{scm_gc_realloc} do now, behaved like @code{scm_gc_malloc} and @code{scm_gc_realloc} do now,
respectively. They would inform the GC about the newly allocated respectively. They would inform the GC about the newly allocated
memory via the internal equivalent of memory via the internal equivalent of
@code{scm_gc_register_collectable_memory}. However, @code{scm_gc_register_allocation}. However,
@code{scm_must_free} did not unregister the memory it was about to @code{scm_must_free} did not unregister the memory it was about to
free. The usual way to unregister memory was to return its size from free. The usual way to unregister memory was to return its size from
a smob free function. a smob free function.

View file

@ -674,11 +674,6 @@ Return the source of the procedure @var{proc}. Returns @code{#f} if
the source code is not available. the source code is not available.
@end deffn @end deffn
@deffn {Scheme Procedure} procedure-environment proc
@deffnx {C Function} scm_procedure_environment (proc)
Return the environment of the procedure @var{proc}. Very deprecated.
@end deffn
@deffn {Scheme Procedure} procedure-properties proc @deffn {Scheme Procedure} procedure-properties proc
@deffnx {C Function} scm_procedure_properties (proc) @deffnx {C Function} scm_procedure_properties (proc)
Return the properties associated with @var{proc}, as an association Return the properties associated with @var{proc}, as an association

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*- @c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual. @c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 2009, 2010 @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 2009, 2010, 2012
@c Free Software Foundation, Inc. @c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@ -15,6 +15,7 @@
* Blocking:: How to block properly in guile mode. * Blocking:: How to block properly in guile mode.
* Critical Sections:: Avoiding concurrency and reentries. * Critical Sections:: Avoiding concurrency and reentries.
* Fluids and Dynamic States:: Thread-local variables, etc. * Fluids and Dynamic States:: Thread-local variables, etc.
* Parameters:: Dynamic scoping in Scheme.
* Futures:: Fine-grain parallelism. * Futures:: Fine-grain parallelism.
* Parallel Forms:: Parallel execution of forms. * Parallel Forms:: Parallel execution of forms.
@end menu @end menu
@ -680,9 +681,11 @@ used for testing whether an object is actually a fluid. The values
stored in a fluid can be accessed with @code{fluid-ref} and stored in a fluid can be accessed with @code{fluid-ref} and
@code{fluid-set!}. @code{fluid-set!}.
@deffn {Scheme Procedure} make-fluid @deffn {Scheme Procedure} make-fluid [dflt]
@deffnx {C Function} scm_make_fluid () @deffnx {C Function} scm_make_fluid ()
Return a newly created fluid. @deffnx {C Function} scm_make_fluid_with_default (dflt)
Return a newly created fluid, whose initial value is @var{dflt}, or
@code{#f} if @var{dflt} is not given.
Fluids are objects that can hold one Fluids are objects that can hold one
value per dynamic state. That is, modifications to this value are value per dynamic state. That is, modifications to this value are
only visible to code that executes with the same dynamic state as only visible to code that executes with the same dynamic state as
@ -694,7 +697,7 @@ with its own dynamic state, you can use fluids for thread local storage.
@deffn {Scheme Procedure} make-unbound-fluid @deffn {Scheme Procedure} make-unbound-fluid
@deffnx {C Function} scm_make_unbound_fluid () @deffnx {C Function} scm_make_unbound_fluid ()
Return a new fluid that is initially unbound (instead of being Return a new fluid that is initially unbound (instead of being
implicitly bound to @code{#f}. implicitly bound to some definite value).
@end deffn @end deffn
@deffn {Scheme Procedure} fluid? obj @deffn {Scheme Procedure} fluid? obj
@ -707,8 +710,8 @@ Return @code{#t} iff @var{obj} is a fluid; otherwise, return
@deffnx {C Function} scm_fluid_ref (fluid) @deffnx {C Function} scm_fluid_ref (fluid)
Return the value associated with @var{fluid} in the current Return the value associated with @var{fluid} in the current
dynamic root. If @var{fluid} has not been set, then return dynamic root. If @var{fluid} has not been set, then return
@code{#f}. Calling @code{fluid-ref} on an unbound fluid produces a its default value. Calling @code{fluid-ref} on an unbound fluid produces
runtime error. a runtime error.
@end deffn @end deffn
@deffn {Scheme Procedure} fluid-set! fluid value @deffn {Scheme Procedure} fluid-set! fluid value
@ -820,6 +823,119 @@ Like @code{scm_with_dynamic_state}, but call @var{func} with
@var{data}. @var{data}.
@end deftypefn @end deftypefn
@node Parameters
@subsection Parameters
@cindex SRFI-39
@cindex parameter object
@tindex Parameter
A parameter object is a procedure. Calling it with no arguments returns
its value. Calling it with one argument sets the value.
@example
(define my-param (make-parameter 123))
(my-param) @result{} 123
(my-param 456)
(my-param) @result{} 456
@end example
The @code{parameterize} special form establishes new locations for
parameters, those new locations having effect within the dynamic scope
of the @code{parameterize} body. Leaving restores the previous
locations. Re-entering (through a saved continuation) will again use
the new locations.
@example
(parameterize ((my-param 789))
(my-param)) @result{} 789
(my-param) @result{} 456
@end example
Parameters are like dynamically bound variables in other Lisp dialects.
They allow an application to establish parameter settings (as the name
suggests) just for the execution of a particular bit of code, restoring
when done. Examples of such parameters might be case-sensitivity for a
search, or a prompt for user input.
Global variables are not as good as parameter objects for this sort of
thing. Changes to them are visible to all threads, but in Guile
parameter object locations are per-thread, thereby truly limiting the
effect of @code{parameterize} to just its dynamic execution.
Passing arguments to functions is thread-safe, but that soon becomes
tedious when there's more than a few or when they need to pass down
through several layers of calls before reaching the point they should
affect. And introducing a new setting to existing code is often easier
with a parameter object than adding arguments.
@defun make-parameter init [converter]
Return a new parameter object, with initial value @var{init}.
If a @var{converter} is given, then a call @code{(@var{converter}
val)} is made for each value set, its return is the value stored.
Such a call is made for the @var{init} initial value too.
A @var{converter} allows values to be validated, or put into a
canonical form. For example,
@example
(define my-param (make-parameter 123
(lambda (val)
(if (not (number? val))
(error "must be a number"))
(inexact->exact val))))
(my-param 0.75)
(my-param) @result{} 3/4
@end example
@end defun
@deffn {Scheme Syntax} parameterize ((param value) @dots{}) body @dots{}
Establish a new dynamic scope with the given @var{param}s bound to new
locations and set to the given @var{value}s. @var{body} is evaluated
in that environment, the result is the return from the last form in
@var{body}.
Each @var{param} is an expression which is evaluated to get the
parameter object. Often this will just be the name of a variable
holding the object, but it can be anything that evaluates to a
parameter.
The @var{param} expressions and @var{value} expressions are all
evaluated before establishing the new dynamic bindings, and they're
evaluated in an unspecified order.
For example,
@example
(define prompt (make-parameter "Type something: "))
(define (get-input)
(display (prompt))
...)
(parameterize ((prompt "Type a number: "))
(get-input)
...)
@end example
@end deffn
Parameter objects are implemented using fluids (@pxref{Fluids and
Dynamic States}), so each dynamic state has its own parameter
locations. That includes the separate locations when outside any
@code{parameterize} form. When a parameter is created it gets a
separate initial location in each dynamic state, all initialized to the
given @var{init} value.
As alluded to above, because each thread usually has a separate dynamic
state, each thread has its own locations behind parameter objects, and
changes in one thread are not visible to any other. When a new dynamic
state or thread is created, the values of parameters in the originating
context are copied, into new locations.
@cindex SRFI-39
Guile's parameters conform to SRFI-39 (@pxref{SRFI-39}).
@node Futures @node Futures
@subsection Futures @subsection Futures
@cindex futures @cindex futures

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*- @c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual. @c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011, 2012
@c Free Software Foundation, Inc. @c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@ -3846,134 +3846,14 @@ from a closed port.
@node SRFI-39 @node SRFI-39
@subsection SRFI-39 - Parameters @subsection SRFI-39 - Parameters
@cindex SRFI-39 @cindex SRFI-39
@cindex parameter object
@tindex Parameter
This SRFI provides parameter objects, which implement dynamically This SRFI adds support for dynamically-scoped parameters. SRFI 39 is
bound locations for values. The functions below are available from implemented in the Guile core; there's no module needed to get SRFI-39
itself. Parameters are documented in @ref{Parameters}.
@example This module does export one extra function: @code{with-parameters*}.
(use-modules (srfi srfi-39)) This is a Guile-specific addition to the SRFI, similar to the core
@end example @code{with-fluids*} (@pxref{Fluids and Dynamic States}).
A parameter object is a procedure. Called with no arguments it
returns its value, called with one argument it sets the value.
@example
(define my-param (make-parameter 123))
(my-param) @result{} 123
(my-param 456)
(my-param) @result{} 456
@end example
The @code{parameterize} special form establishes new locations for
parameters, those new locations having effect within the dynamic scope
of the @code{parameterize} body. Leaving restores the previous
locations, or re-entering through a saved continuation will again use
the new locations.
@example
(parameterize ((my-param 789))
(my-param) @result{} 789
)
(my-param) @result{} 456
@end example
Parameters are like dynamically bound variables in other Lisp dialects.
They allow an application to establish parameter settings (as the name
suggests) just for the execution of a particular bit of code,
restoring when done. Examples of such parameters might be
case-sensitivity for a search, or a prompt for user input.
Global variables are not as good as parameter objects for this sort of
thing. Changes to them are visible to all threads, but in Guile
parameter object locations are per-thread, thereby truly limiting the
effect of @code{parameterize} to just its dynamic execution.
Passing arguments to functions is thread-safe, but that soon becomes
tedious when there's more than a few or when they need to pass down
through several layers of calls before reaching the point they should
affect. And introducing a new setting to existing code is often
easier with a parameter object than adding arguments.
@sp 1
@defun make-parameter init [converter]
Return a new parameter object, with initial value @var{init}.
A parameter object is a procedure. When called @code{(param)} it
returns its value, or a call @code{(param val)} sets its value. For
example,
@example
(define my-param (make-parameter 123))
(my-param) @result{} 123
(my-param 456)
(my-param) @result{} 456
@end example
If a @var{converter} is given, then a call @code{(@var{converter}
val)} is made for each value set, its return is the value stored.
Such a call is made for the @var{init} initial value too.
A @var{converter} allows values to be validated, or put into a
canonical form. For example,
@example
(define my-param (make-parameter 123
(lambda (val)
(if (not (number? val))
(error "must be a number"))
(inexact->exact val))))
(my-param 0.75)
(my-param) @result{} 3/4
@end example
@end defun
@deffn {library syntax} parameterize ((param value) @dots{}) body @dots{}
Establish a new dynamic scope with the given @var{param}s bound to new
locations and set to the given @var{value}s. @var{body} is evaluated
in that environment, the result is the return from the last form in
@var{body}.
Each @var{param} is an expression which is evaluated to get the
parameter object. Often this will just be the name of a variable
holding the object, but it can be anything that evaluates to a
parameter.
The @var{param} expressions and @var{value} expressions are all
evaluated before establishing the new dynamic bindings, and they're
evaluated in an unspecified order.
For example,
@example
(define prompt (make-parameter "Type something: "))
(define (get-input)
(display (prompt))
...)
(parameterize ((prompt "Type a number: "))
(get-input)
...)
@end example
@end deffn
@deffn {Parameter object} current-input-port [new-port]
@deffnx {Parameter object} current-output-port [new-port]
@deffnx {Parameter object} current-error-port [new-port]
This SRFI extends the core @code{current-input-port} and
@code{current-output-port}, making them parameter objects. The
Guile-specific @code{current-error-port} is extended too, for
consistency. (@pxref{Default Ports}.)
This is an upwardly compatible extension, a plain call like
@code{(current-input-port)} still returns the current input port, and
@code{set-current-input-port} can still be used. But the port can now
also be set with @code{(current-input-port my-port)} and bound
dynamically with @code{parameterize}.
@end deffn
@defun with-parameters* param-list value-list thunk @defun with-parameters* param-list value-list thunk
Establish a new dynamic scope, as per @code{parameterize} above, Establish a new dynamic scope, as per @code{parameterize} above,
@ -3981,30 +3861,8 @@ taking parameters from @var{param-list} and corresponding values from
@var{values-list}. A call @code{(@var{thunk})} is made in the new @var{values-list}. A call @code{(@var{thunk})} is made in the new
scope and the result from that @var{thunk} is the return from scope and the result from that @var{thunk} is the return from
@code{with-parameters*}. @code{with-parameters*}.
This function is a Guile-specific addition to the SRFI, it's similar
to the core @code{with-fluids*} (@pxref{Fluids and Dynamic States}).
@end defun @end defun
@sp 1
Parameter objects are implemented using fluids (@pxref{Fluids and
Dynamic States}), so each dynamic state has it's own parameter
locations. That includes the separate locations when outside any
@code{parameterize} form. When a parameter is created it gets a
separate initial location in each dynamic state, all initialized to
the given @var{init} value.
As alluded to above, because each thread usually has a separate
dynamic state, each thread has it's own locations behind parameter
objects, and changes in one thread are not visible to any other. When
a new dynamic state or thread is created, the values of parameters in
the originating context are copied, into new locations.
SRFI-39 doesn't specify the interaction between parameter objects and
threads, so the threading behaviour described here should be regarded
as Guile-specific.
@node SRFI-42 @node SRFI-42
@subsection SRFI-42 - Eager Comprehensions @subsection SRFI-42 - Eager Comprehensions
@cindex SRFI-42 @cindex SRFI-42

View file

@ -438,7 +438,7 @@ expressions.
@end deffn @end deffn
@deffn Instruction local-boxed-ref index @deffn Instruction local-boxed-ref index
@deffnx Instruction local-boxed-ref index @deffnx Instruction local-boxed-set index
Get or set the value of the variable located at @var{index} within the Get or set the value of the variable located at @var{index} within the
current stack frame. A shortcut for @code{local-ref} then current stack frame. A shortcut for @code{local-ref} then
@code{variable-ref} or @code{variable-set}, respectively. @code{variable-ref} or @code{variable-set}, respectively.

View file

@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY! ## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in. ## Process this file with automake to produce Makefile.in.
# Copyright (C) 2002-2011 Free Software Foundation, Inc. # Copyright (C) 2002-2012 Free Software Foundation, Inc.
# #
# This file is free software; you can redistribute it and/or modify # This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -21,7 +21,7 @@
# the same distribution terms as the rest of that program. # the same distribution terms as the rest of that program.
# #
# Generated by gnulib-tool. # Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl ceil close connect duplocale environ extensions flock floor fpieee frexp full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring listen localcharset locale log1p maintainer-makefile malloc-gnu malloca nproc open pipe2 putenv recv recvfrom rename send sendto setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat trunc verify vsnprintf warnings wchar # Reproduce by: gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl ceil close connect dirfd duplocale environ extensions flock floor fpieee frexp full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring listen localcharset locale log1p maintainer-makefile malloc-gnu malloca nproc open pipe2 putenv recv recvfrom rename send sendto setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat trunc verify vsnprintf warnings wchar
AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
@ -287,6 +287,63 @@ EXTRA_libgnu_la_SOURCES += connect.c
## end gnulib module connect ## end gnulib module connect
## begin gnulib module dirent
BUILT_SOURCES += dirent.h
# We need the following in order to create <dirent.h> when the system
# doesn't have one that works with the given compiler.
dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
-e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \
-e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \
-e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \
-e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \
-e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \
-e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \
-e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \
-e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \
-e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
-e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
-e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
-e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
-e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
-e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
-e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
-e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
-e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
-e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
-e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
-e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
-e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/dirent.in.h; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += dirent.h dirent.h-t
EXTRA_DIST += dirent.in.h
## end gnulib module dirent
## begin gnulib module dirfd
EXTRA_DIST += dirfd.c
EXTRA_libgnu_la_SOURCES += dirfd.c
## end gnulib module dirfd
## begin gnulib module dirname-lgpl ## begin gnulib module dirname-lgpl
libgnu_la_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c libgnu_la_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c
@ -1788,6 +1845,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
-e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
-e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \ -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
-e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
-e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \ -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
-e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
-e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \ -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
@ -1815,6 +1873,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
-e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
-e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
-e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
-e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
@ -1834,6 +1893,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
-e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
-e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
-e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
-e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
@ -2294,6 +2354,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
-e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
-e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
-e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
-e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \ -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
-e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \ -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
-e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \ -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
@ -2372,6 +2433,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
-e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
-e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
-e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
-e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \ -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \

View file

@ -1,6 +1,6 @@
/* accept.c --- wrappers for Windows accept function /* accept.c --- wrappers for Windows accept function
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Determine alignment of types. /* Determine alignment of types.
Copyright (C) 2003-2004, 2006, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2003-2004, 2006, 2009-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* Memory allocation on the stack. /* Memory allocation on the stack.
Copyright (C) 1995, 1999, 2001-2004, 2006-2011 Free Software Foundation, Copyright (C) 1995, 1999, 2001-2004, 2006-2012 Free Software Foundation,
Inc. Inc.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it

View file

@ -1,6 +1,6 @@
/* A GNU-like <arpa/inet.h>. /* A GNU-like <arpa/inet.h>.
Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc. Copyright (C) 2005-2006, 2008-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Formatted output to strings. /* Formatted output to strings.
Copyright (C) 1999, 2002, 2006, 2009-2011 Free Software Foundation, Inc. Copyright (C) 1999, 2002, 2006, 2009-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* basename.c -- return the last element in a file name /* basename.c -- return the last element in a file name
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2011 Free Software Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2012 Free Software
Foundation, Inc. Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View file

@ -1,5 +1,5 @@
/* Binary mode I/O. /* Binary mode I/O.
Copyright (C) 2001, 2003, 2005, 2008-2011 Free Software Foundation, Inc. Copyright (C) 2001, 2003, 2005, 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* bind.c --- wrappers for Windows bind function /* bind.c --- wrappers for Windows bind function
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* byteswap.h - Byte swapping /* byteswap.h - Byte swapping
Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc.
Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005. Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/* Character handling in C locale. /* Character handling in C locale.
Copyright 2000-2003, 2006, 2009-2011 Free Software Foundation, Inc. Copyright 2000-2003, 2006, 2009-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -5,7 +5,7 @@
<ctype.h> functions' behaviour depends on the current locale set via <ctype.h> functions' behaviour depends on the current locale set via
setlocale. setlocale.
Copyright (C) 2000-2003, 2006, 2008-2011 Free Software Foundation, Inc. Copyright (C) 2000-2003, 2006, 2008-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Case-insensitive string comparison functions in C locale. /* Case-insensitive string comparison functions in C locale.
Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2011 Free Software Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2012 Free Software
Foundation, Inc. Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify

View file

@ -1,5 +1,5 @@
/* c-strcasecmp.c -- case insensitive string comparator in C locale /* c-strcasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2011 Free Software Foundation, Inc. Copyright (C) 1998-1999, 2005-2006, 2009-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Optimized case-insensitive string comparison in C locale. /* Optimized case-insensitive string comparison in C locale.
Copyright (C) 2001-2002, 2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2001-2002, 2007, 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published under the terms of the GNU Lesser General Public License as published

View file

@ -1,5 +1,5 @@
/* c-strncasecmp.c -- case insensitive string comparator in C locale /* c-strncasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2011 Free Software Foundation, Inc. Copyright (C) 1998-1999, 2005-2006, 2009-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file. /* Return the canonical absolute name of a given file.
Copyright (C) 1996-2011 Free Software Foundation, Inc. Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@ -84,10 +84,10 @@
#if !FUNC_REALPATH_WORKS || defined _LIBC #if !FUNC_REALPATH_WORKS || defined _LIBC
/* Return the canonical absolute name of file NAME. A canonical name /* Return the canonical absolute name of file NAME. A canonical name
does not contain any `.', `..' components nor any repeated path does not contain any ".", ".." components nor any repeated path
separators ('/') or symlinks. All path components must exist. If separators ('/') or symlinks. All path components must exist. If
RESOLVED is null, the result is malloc'd; otherwise, if the RESOLVED is null, the result is malloc'd; otherwise, if the
canonical name is PATH_MAX chars or more, returns null with `errno' canonical name is PATH_MAX chars or more, returns null with 'errno'
set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars,
returns the name in RESOLVED. If the name cannot be resolved and returns the name in RESOLVED. If the name cannot be resolved and
RESOLVED is non-NULL, it contains the path of the first component RESOLVED is non-NULL, it contains the path of the first component

View file

@ -1,5 +1,5 @@
/* Round towards positive infinity. /* Round towards positive infinity.
Copyright (C) 2007, 2010-2011 Free Software Foundation, Inc. Copyright (C) 2007, 2010-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* close replacement. /* close replacement.
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,7 +1,7 @@
#! /bin/sh #! /bin/sh
# Output a system dependent table of character encoding aliases. # Output a system dependent table of character encoding aliases.
# #
# Copyright (C) 2000-2004, 2006-2011 Free Software Foundation, Inc. # Copyright (C) 2000-2004, 2006-2012 Free Software Foundation, Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by # it under the terms of the GNU Lesser General Public License as published by
@ -30,6 +30,8 @@
# The current list of GNU canonical charset names is as follows. # The current list of GNU canonical charset names is as follows.
# #
# name MIME? used by which systems # name MIME? used by which systems
# (darwin = MacOS X, woe32 = native Windows)
#
# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin # ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin
# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin # ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin # ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin

View file

@ -1,6 +1,6 @@
/* connect.c --- wrappers for Windows connect function /* connect.c --- wrappers for Windows connect function
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

249
lib/dirent.in.h Normal file
View file

@ -0,0 +1,249 @@
/* A GNU-like <dirent.h>.
Copyright (C) 2006-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_DIRENT_H
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_DIRENT_H@
# @INCLUDE_NEXT@ @NEXT_DIRENT_H@
#endif
#ifndef _@GUARD_PREFIX@_DIRENT_H
#define _@GUARD_PREFIX@_DIRENT_H
/* Get ino_t. Needed on some systems, including glibc 2.8. */
#include <sys/types.h>
#if !@HAVE_DIRENT_H@
/* Define types DIR and 'struct dirent'. */
# if !GNULIB_defined_struct_dirent
struct dirent
{
char d_type;
char d_name[1];
};
/* Possible values for 'd_type'. */
# define DT_UNKNOWN 0
# define DT_FIFO 1 /* FIFO */
# define DT_CHR 2 /* character device */
# define DT_DIR 4 /* directory */
# define DT_BLK 6 /* block device */
# define DT_REG 8 /* regular file */
# define DT_LNK 10 /* symbolic link */
# define DT_SOCK 12 /* socket */
# define DT_WHT 14 /* whiteout */
typedef struct gl_directory DIR;
# define GNULIB_defined_struct_dirent 1
# endif
#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
/* Declare overridden functions. */
#if @GNULIB_OPENDIR@
# if @REPLACE_OPENDIR@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef opendir
# define opendir rpl_opendir
# endif
_GL_FUNCDECL_RPL (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
# else
# if !@HAVE_OPENDIR@
_GL_FUNCDECL_SYS (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (opendir, DIR *, (const char *dir_name));
# endif
_GL_CXXALIASWARN (opendir);
#elif defined GNULIB_POSIXCHECK
# undef opendir
# if HAVE_RAW_DECL_OPENDIR
_GL_WARN_ON_USE (opendir, "opendir is not portable - "
"use gnulib module opendir for portability");
# endif
#endif
#if @GNULIB_READDIR@
# if !@HAVE_READDIR@
_GL_FUNCDECL_SYS (readdir, struct dirent *, (DIR *dirp) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (readdir, struct dirent *, (DIR *dirp));
_GL_CXXALIASWARN (readdir);
#elif defined GNULIB_POSIXCHECK
# undef readdir
# if HAVE_RAW_DECL_READDIR
_GL_WARN_ON_USE (readdir, "readdir is not portable - "
"use gnulib module readdir for portability");
# endif
#endif
#if @GNULIB_REWINDDIR@
# if !@HAVE_REWINDDIR@
_GL_FUNCDECL_SYS (rewinddir, void, (DIR *dirp) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (rewinddir, void, (DIR *dirp));
_GL_CXXALIASWARN (rewinddir);
#elif defined GNULIB_POSIXCHECK
# undef rewinddir
# if HAVE_RAW_DECL_REWINDDIR
_GL_WARN_ON_USE (rewinddir, "rewinddir is not portable - "
"use gnulib module rewinddir for portability");
# endif
#endif
#if @GNULIB_CLOSEDIR@
# if @REPLACE_CLOSEDIR@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef closedir
# define closedir rpl_closedir
# endif
_GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (closedir, int, (DIR *dirp));
# else
# if !@HAVE_CLOSEDIR@
_GL_FUNCDECL_SYS (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (closedir, int, (DIR *dirp));
# endif
_GL_CXXALIASWARN (closedir);
#elif defined GNULIB_POSIXCHECK
# undef closedir
# if HAVE_RAW_DECL_CLOSEDIR
_GL_WARN_ON_USE (closedir, "closedir is not portable - "
"use gnulib module closedir for portability");
# endif
#endif
#if @GNULIB_DIRFD@
/* Return the file descriptor associated with the given directory stream,
or -1 if none exists. */
# if @REPLACE_DIRFD@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef dirfd
# define dirfd rpl_dirfd
# endif
_GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (dirfd, int, (DIR *));
# else
# if defined __cplusplus && defined GNULIB_NAMESPACE && defined dirfd
/* dirfd is defined as a macro and not as a function.
Turn it into a function and get rid of the macro. */
static inline int (dirfd) (DIR *dp) { return dirfd (dp); }
# undef dirfd
# endif
# if !(@HAVE_DECL_DIRFD@ || defined dirfd)
_GL_FUNCDECL_SYS (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (dirfd, int, (DIR *));
# endif
_GL_CXXALIASWARN (dirfd);
#elif defined GNULIB_POSIXCHECK
# undef dirfd
# if HAVE_RAW_DECL_DIRFD
_GL_WARN_ON_USE (dirfd, "dirfd is unportable - "
"use gnulib module dirfd for portability");
# endif
#endif
#if @GNULIB_FDOPENDIR@
/* Open a directory stream visiting the given directory file
descriptor. Return NULL and set errno if fd is not visiting a
directory. On success, this function consumes fd (it will be
implicitly closed either by this function or by a subsequent
closedir). */
# if @REPLACE_FDOPENDIR@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fdopendir
# define fdopendir rpl_fdopendir
# endif
_GL_FUNCDECL_RPL (fdopendir, DIR *, (int fd));
_GL_CXXALIAS_RPL (fdopendir, DIR *, (int fd));
# else
# if !@HAVE_FDOPENDIR@ || !@HAVE_DECL_FDOPENDIR@
_GL_FUNCDECL_SYS (fdopendir, DIR *, (int fd));
# endif
_GL_CXXALIAS_SYS (fdopendir, DIR *, (int fd));
# endif
_GL_CXXALIASWARN (fdopendir);
#elif defined GNULIB_POSIXCHECK
# undef fdopendir
# if HAVE_RAW_DECL_FDOPENDIR
_GL_WARN_ON_USE (fdopendir, "fdopendir is unportable - "
"use gnulib module fdopendir for portability");
# endif
#endif
#if @GNULIB_SCANDIR@
/* Scan the directory DIR, calling FILTER on each directory entry.
Entries for which FILTER returns nonzero are individually malloc'd,
sorted using qsort with CMP, and collected in a malloc'd array in
*NAMELIST. Returns the number of entries selected, or -1 on error. */
# if !@HAVE_SCANDIR@
_GL_FUNCDECL_SYS (scandir, int,
(const char *dir, struct dirent ***namelist,
int (*filter) (const struct dirent *),
int (*cmp) (const struct dirent **, const struct dirent **))
_GL_ARG_NONNULL ((1, 2, 4)));
# endif
/* Need to cast, because on glibc systems, the fourth parameter is
int (*cmp) (const void *, const void *). */
_GL_CXXALIAS_SYS_CAST (scandir, int,
(const char *dir, struct dirent ***namelist,
int (*filter) (const struct dirent *),
int (*cmp) (const struct dirent **, const struct dirent **)));
_GL_CXXALIASWARN (scandir);
#elif defined GNULIB_POSIXCHECK
# undef scandir
# if HAVE_RAW_DECL_SCANDIR
_GL_WARN_ON_USE (scandir, "scandir is unportable - "
"use gnulib module scandir for portability");
# endif
#endif
#if @GNULIB_ALPHASORT@
/* Compare two 'struct dirent' entries alphabetically. */
# if !@HAVE_ALPHASORT@
_GL_FUNCDECL_SYS (alphasort, int,
(const struct dirent **, const struct dirent **)
_GL_ARG_NONNULL ((1, 2)));
# endif
/* Need to cast, because on glibc systems, the parameters are
(const void *, const void *). */
_GL_CXXALIAS_SYS_CAST (alphasort, int,
(const struct dirent **, const struct dirent **));
_GL_CXXALIASWARN (alphasort);
#elif defined GNULIB_POSIXCHECK
# undef alphasort
# if HAVE_RAW_DECL_ALPHASORT
_GL_WARN_ON_USE (alphasort, "alphasort is unportable - "
"use gnulib module alphasort for portability");
# endif
#endif
#endif /* _@GUARD_PREFIX@_DIRENT_H */
#endif /* _@GUARD_PREFIX@_DIRENT_H */

32
lib/dirfd.c Normal file
View file

@ -0,0 +1,32 @@
/* dirfd.c -- return the file descriptor associated with an open DIR*
Copyright (C) 2001, 2006, 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Jim Meyering. */
#include <config.h>
#include <dirent.h>
#include <errno.h>
int
dirfd (DIR *dir_p)
{
int fd = DIR_TO_FD (dir_p);
if (fd == -1)
errno = ENOTSUP;
return fd;
}

View file

@ -1,6 +1,6 @@
/* dirname.c -- return all but the last element in a file name /* dirname.c -- return all but the last element in a file name
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2011 Free Software Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2012 Free Software
Foundation, Inc. Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@ -25,7 +25,7 @@
/* Return the length of the prefix of FILE that will be used by /* Return the length of the prefix of FILE that will be used by
dir_name. If FILE is in the working directory, this returns zero dir_name. If FILE is in the working directory, this returns zero
even though `dir_name (FILE)' will return ".". Works properly even even though 'dir_name (FILE)' will return ".". Works properly even
if there are trailing slashes (by effectively ignoring them). */ if there are trailing slashes (by effectively ignoring them). */
size_t size_t
@ -53,9 +53,9 @@ dir_len (char const *file)
} }
/* In general, we can't use the builtin `dirname' function if available, /* In general, we can't use the builtin 'dirname' function if available,
since it has different meanings in different environments. since it has different meanings in different environments.
In some environments the builtin `dirname' modifies its argument. In some environments the builtin 'dirname' modifies its argument.
Return the leading directories part of FILE, allocated with malloc. Return the leading directories part of FILE, allocated with malloc.
Works properly even if there are trailing slashes (by effectively Works properly even if there are trailing slashes (by effectively

View file

@ -1,6 +1,6 @@
/* Take file names apart into directory and base names. /* Take file names apart into directory and base names.
Copyright (C) 1998, 2001, 2003-2006, 2009-2011 Free Software Foundation, Copyright (C) 1998, 2001, 2003-2006, 2009-2012 Free Software Foundation,
Inc. Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/* File names on MS-DOS/Windows systems. /* File names on MS-DOS/Windows systems.
Copyright (C) 2000-2001, 2004-2006, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2000-2001, 2004-2006, 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Duplicate a locale object. /* Duplicate a locale object.
Copyright (C) 2009-2011 Free Software Foundation, Inc. Copyright (C) 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* A POSIX-like <errno.h>. /* A POSIX-like <errno.h>.
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* Like <fcntl.h>, but with non-working flags defined to 0. /* Like <fcntl.h>, but with non-working flags defined to 0.
Copyright (C) 2006-2011 Free Software Foundation, Inc. Copyright (C) 2006-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
@ -62,6 +62,12 @@
# include <unistd.h> # include <unistd.h>
#endif #endif
/* Native Windows platforms declare open(), creat() in <io.h>. */
#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
&& ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
# include <io.h>
#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
@ -177,12 +183,12 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
/* Fix up the O_* macros. */ /* Fix up the O_* macros. */
#if !defined O_DIRECT && defined O_DIRECTIO #if !defined O_DIRECT && defined O_DIRECTIO
/* Tru64 spells it `O_DIRECTIO'. */ /* Tru64 spells it 'O_DIRECTIO'. */
# define O_DIRECT O_DIRECTIO # define O_DIRECT O_DIRECTIO
#endif #endif
#if !defined O_CLOEXEC && defined O_NOINHERIT #if !defined O_CLOEXEC && defined O_NOINHERIT
/* Mingw spells it `O_NOINHERIT'. */ /* Mingw spells it 'O_NOINHERIT'. */
# define O_CLOEXEC O_NOINHERIT # define O_CLOEXEC O_NOINHERIT
#endif #endif

View file

@ -1,5 +1,5 @@
/* Hook for making making file descriptor functions close(), ioctl() extensible. /* Hook for making making file descriptor functions close(), ioctl() extensible.
Copyright (C) 2009-2011 Free Software Foundation, Inc. Copyright (C) 2009-2012 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009. Written by Bruno Haible <bruno@clisp.org>, 2009.
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it

View file

@ -1,5 +1,5 @@
/* Hook for making making file descriptor functions close(), ioctl() extensible. /* Hook for making making file descriptor functions close(), ioctl() extensible.
Copyright (C) 2009-2011 Free Software Foundation, Inc. Copyright (C) 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published under the terms of the GNU Lesser General Public License as published

View file

@ -1,5 +1,5 @@
/* Supplemental information about the floating-point formats. /* Supplemental information about the floating-point formats.
Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007. Written by Bruno Haible <bruno@clisp.org>, 2007.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify

View file

@ -1,5 +1,5 @@
/* Auxiliary definitions for <float.h>. /* Auxiliary definitions for <float.h>.
Copyright (C) 2011 Free Software Foundation, Inc. Copyright (C) 2011-2012 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011. Written by Bruno Haible <bruno@clisp.org>, 2011.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/* A correct <float.h>. /* A correct <float.h>.
Copyright (C) 2007-2011 Free Software Foundation, Inc. Copyright (C) 2007-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -6,7 +6,7 @@
Written by Richard W.M. Jones <rjones.at.redhat.com> Written by Richard W.M. Jones <rjones.at.redhat.com>
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,5 +1,5 @@
/* Round towards negative infinity. /* Round towards negative infinity.
Copyright (C) 2007, 2010-2011 Free Software Foundation, Inc. Copyright (C) 2007, 2010-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Split a double into fraction and mantissa. /* Split a double into fraction and mantissa.
Copyright (C) 2007-2011 Free Software Foundation, Inc. Copyright (C) 2007-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* fstat() replacement. /* fstat() replacement.
Copyright (C) 2011 Free Software Foundation, Inc. Copyright (C) 2011-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* An interface to read that retries after partial reads and interrupts. /* An interface to read that retries after partial reads and interrupts.
Copyright (C) 2002-2003, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2002-2003, 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* An interface to read() that reads all it is asked to read. /* An interface to read() that reads all it is asked to read.
Copyright (C) 2002, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2002, 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* An interface to read and write that retries (if necessary) until complete. /* An interface to read and write that retries (if necessary) until complete.
Copyright (C) 1993-1994, 1997-2006, 2009-2011 Free Software Foundation, Inc. Copyright (C) 1993-1994, 1997-2006, 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* An interface to write() that writes all it is asked to write. /* An interface to write() that writes all it is asked to write.
Copyright (C) 2002-2003, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2002-2003, 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2011 Free Software /* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2012 Free Software
Foundation, Inc. Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997. Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.

View file

@ -1,5 +1,5 @@
/* Get address information (partial implementation). /* Get address information (partial implementation).
Copyright (C) 1997, 2001-2002, 2004-2011 Free Software Foundation, Inc. Copyright (C) 1997, 2001-2002, 2004-2012 Free Software Foundation, Inc.
Contributed by Simon Josefsson <simon@josefsson.org>. Contributed by Simon Josefsson <simon@josefsson.org>.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@ -56,13 +56,13 @@
#endif #endif
#if defined _WIN32 || defined __WIN32__ #if defined _WIN32 || defined __WIN32__
# define WIN32_NATIVE # define WINDOWS_NATIVE
#endif #endif
/* gl_sockets_startup */ /* gl_sockets_startup */
#include "sockets.h" #include "sockets.h"
#ifdef WIN32_NATIVE #ifdef WINDOWS_NATIVE
typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*, typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*,
const struct addrinfo*, const struct addrinfo*,
struct addrinfo**); struct addrinfo**);
@ -153,7 +153,7 @@ getaddrinfo (const char *restrict nodename,
}; };
#endif #endif
#ifdef WIN32_NATIVE #ifdef WINDOWS_NATIVE
if (use_win32_p ()) if (use_win32_p ())
return getaddrinfo_ptr (nodename, servname, hints, res); return getaddrinfo_ptr (nodename, servname, hints, res);
#endif #endif
@ -332,11 +332,11 @@ getaddrinfo (const char *restrict nodename,
return 0; return 0;
} }
/* Free `addrinfo' structure AI including associated storage. */ /* Free 'addrinfo' structure AI including associated storage. */
void void
freeaddrinfo (struct addrinfo *ai) freeaddrinfo (struct addrinfo *ai)
{ {
#ifdef WIN32_NATIVE #ifdef WINDOWS_NATIVE
if (use_win32_p ()) if (use_win32_p ())
{ {
freeaddrinfo_ptr (ai); freeaddrinfo_ptr (ai);
@ -362,7 +362,7 @@ getnameinfo (const struct sockaddr *restrict sa, socklen_t salen,
char *restrict service, socklen_t servicelen, char *restrict service, socklen_t servicelen,
int flags) int flags)
{ {
#ifdef WIN32_NATIVE #ifdef WINDOWS_NATIVE
if (use_win32_p ()) if (use_win32_p ())
return getnameinfo_ptr (sa, salen, node, nodelen, return getnameinfo_ptr (sa, salen, node, nodelen,
service, servicelen, flags); service, servicelen, flags);

View file

@ -1,6 +1,6 @@
/* getpeername.c --- wrappers for Windows getpeername function /* getpeername.c --- wrappers for Windows getpeername function
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* getsockname.c --- wrappers for Windows getsockname function /* getsockname.c --- wrappers for Windows getsockname function
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* getsockopt.c --- wrappers for Windows getsockopt function /* getsockopt.c --- wrappers for Windows getsockopt function
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>. /* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2011 Free Software Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2012 Free Software
Foundation, Inc. Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify

View file

@ -1,5 +1,5 @@
/* Character set conversion. /* Character set conversion.
Copyright (C) 1999-2001, 2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 1999-2001, 2007, 2009-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* A GNU-like <iconv.h>. /* A GNU-like <iconv.h>.
Copyright (C) 2007-2011 Free Software Foundation, Inc. Copyright (C) 2007-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Character set conversion. /* Character set conversion.
Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Character set conversion. /* Character set conversion.
Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Character set conversion handler type. /* Character set conversion handler type.
Copyright (C) 2001-2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2001-2007, 2009-2012 Free Software Foundation, Inc.
Written by Bruno Haible. Written by Bruno Haible.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc. Copyright (C) 2005-2006, 2008-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
@ -38,6 +38,16 @@
/* Specification. */ /* Specification. */
#include <arpa/inet.h> #include <arpa/inet.h>
/* Use this to suppress gcc's "...may be used before initialized" warnings.
Beware: The Code argument must not contain commas. */
#ifndef IF_LINT
# ifdef lint
# define IF_LINT(Code) Code
# else
# define IF_LINT(Code) /* empty */
# endif
#endif
#if HAVE_DECL_INET_NTOP #if HAVE_DECL_INET_NTOP
# undef inet_ntop # undef inet_ntop
@ -74,7 +84,7 @@ static const char *inet_ntop6 (const unsigned char *src, char *dst, socklen_t si
* inet_ntop(af, src, dst, size) * inet_ntop(af, src, dst, size)
* convert a network format address to presentation format. * convert a network format address to presentation format.
* return: * return:
* pointer to presentation format address (`dst'), or NULL (see errno). * pointer to presentation format address ('dst'), or NULL (see errno).
* author: * author:
* Paul Vixie, 1996. * Paul Vixie, 1996.
*/ */
@ -105,7 +115,7 @@ inet_ntop (int af, const void *restrict src,
* inet_ntop4(src, dst, size) * inet_ntop4(src, dst, size)
* format an IPv4 address * format an IPv4 address
* return: * return:
* `dst' (as a const) * 'dst' (as a const)
* notes: * notes:
* (1) uses no statics * (1) uses no statics
* (2) takes a u_char* not an in_addr as input * (2) takes a u_char* not an in_addr as input
@ -167,6 +177,8 @@ inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
words[i / 2] = (src[i] << 8) | src[i + 1]; words[i / 2] = (src[i] << 8) | src[i + 1];
best.base = -1; best.base = -1;
cur.base = -1; cur.base = -1;
IF_LINT(best.len = 0);
IF_LINT(cur.len = 0);
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
{ {
if (words[i] == 0) if (words[i] == 0)

View file

@ -1,6 +1,6 @@
/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form /* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc. Copyright (C) 2006, 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
@ -73,8 +73,8 @@ static int inet_pton6 (const char *src, unsigned char *dst);
* to network format (which is usually some kind of binary format). * to network format (which is usually some kind of binary format).
* return: * return:
* 1 if the address was valid for the specified address family * 1 if the address was valid for the specified address family
* 0 if the address wasn't valid (`dst' is untouched in this case) * 0 if the address wasn't valid ('dst' is untouched in this case)
* -1 if some other error occurred (`dst' is untouched in this case, too) * -1 if some other error occurred ('dst' is untouched in this case, too)
* author: * author:
* Paul Vixie, 1996. * Paul Vixie, 1996.
*/ */
@ -103,9 +103,9 @@ inet_pton (int af, const char *restrict src, void *restrict dst)
* like inet_aton() but without all the hexadecimal, octal (with the * like inet_aton() but without all the hexadecimal, octal (with the
* exception of 0) and shorthand. * exception of 0) and shorthand.
* return: * return:
* 1 if `src' is a valid dotted quad, else 0. * 1 if 'src' is a valid dotted quad, else 0.
* notice: * notice:
* does not touch `dst' unless it's returning 1. * does not touch 'dst' unless it's returning 1.
* author: * author:
* Paul Vixie, 1996. * Paul Vixie, 1996.
*/ */
@ -159,9 +159,9 @@ inet_pton4 (const char *restrict src, unsigned char *restrict dst)
* inet_pton6(src, dst) * inet_pton6(src, dst)
* convert presentation level address to network order binary form. * convert presentation level address to network order binary form.
* return: * return:
* 1 if `src' is a valid [RFC1884 2.2] address, else 0. * 1 if 'src' is a valid [RFC1884 2.2] address, else 0.
* notice: * notice:
* (1) does not touch `dst' unless it's returning 1. * (1) does not touch 'dst' unless it's returning 1.
* (2) :: in a full address is silently ignored. * (2) :: in a full address is silently ignored.
* credit: * credit:
* inspired by Mark Andrews. * inspired by Mark Andrews.

View file

@ -1,5 +1,5 @@
/* Test for positive or negative infinity. /* Test for positive or negative infinity.
Copyright (C) 2007-2011 Free Software Foundation, Inc. Copyright (C) 2007-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Test for NaN that does not need libm. /* Test for NaN that does not need libm.
Copyright (C) 2007-2011 Free Software Foundation, Inc. Copyright (C) 2007-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Test for NaN that does not need libm. /* Test for NaN that does not need libm.
Copyright (C) 2007-2011 Free Software Foundation, Inc. Copyright (C) 2007-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Test for NaN that does not need libm. /* Test for NaN that does not need libm.
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Test for NaN that does not need libm. /* Test for NaN that does not need libm.
Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Test for NaN that does not need libm. /* Test for NaN that does not need libm.
Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Replacement for 'int' to 'long double' conversion routine. /* Replacement for 'int' to 'long double' conversion routine.
Copyright (C) 2011 Free Software Foundation, Inc. Copyright (C) 2011-2012 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011. Written by Bruno Haible <bruno@clisp.org>, 2011.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/* listen.c --- wrappers for Windows listen function /* listen.c --- wrappers for Windows listen function
Copyright (C) 2008-2011 Free Software Foundation, Inc. Copyright (C) 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* Determine a canonical name for the current locale's character encoding. /* Determine a canonical name for the current locale's character encoding.
Copyright (C) 2000-2006, 2008-2011 Free Software Foundation, Inc. Copyright (C) 2000-2006, 2008-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
@ -34,7 +34,7 @@
#endif #endif
#if defined _WIN32 || defined __WIN32__ #if defined _WIN32 || defined __WIN32__
# define WIN32_NATIVE # define WINDOWS_NATIVE
#endif #endif
#if defined __EMX__ #if defined __EMX__
@ -44,7 +44,7 @@
# endif # endif
#endif #endif
#if !defined WIN32_NATIVE #if !defined WINDOWS_NATIVE
# include <unistd.h> # include <unistd.h>
# if HAVE_LANGINFO_CODESET # if HAVE_LANGINFO_CODESET
# include <langinfo.h> # include <langinfo.h>
@ -57,7 +57,7 @@
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
# endif # endif
#elif defined WIN32_NATIVE #elif defined WINDOWS_NATIVE
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
#endif #endif
@ -83,7 +83,7 @@
#endif #endif
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
/* Win32, Cygwin, OS/2, DOS */ /* Native Windows, Cygwin, OS/2, DOS */
# define ISSLASH(C) ((C) == '/' || (C) == '\\') # define ISSLASH(C) ((C) == '/' || (C) == '\\')
#endif #endif
@ -123,7 +123,7 @@ get_charset_aliases (void)
cp = charset_aliases; cp = charset_aliases;
if (cp == NULL) if (cp == NULL)
{ {
#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) #if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__)
const char *dir; const char *dir;
const char *base = "charset.alias"; const char *base = "charset.alias";
char *file_name; char *file_name;
@ -308,7 +308,7 @@ get_charset_aliases (void)
"DECKOREAN" "\0" "EUC-KR" "\0"; "DECKOREAN" "\0" "EUC-KR" "\0";
# endif # endif
# if defined WIN32_NATIVE || defined __CYGWIN__ # if defined WINDOWS_NATIVE || defined __CYGWIN__
/* To avoid the troubles of installing a separate file in the same /* To avoid the troubles of installing a separate file in the same
directory as the DLL and of retrieving the DLL's directory at directory as the DLL and of retrieving the DLL's directory at
runtime, simply inline the aliases here. */ runtime, simply inline the aliases here. */
@ -360,7 +360,7 @@ locale_charset (void)
const char *codeset; const char *codeset;
const char *aliases; const char *aliases;
#if !(defined WIN32_NATIVE || defined OS2) #if !(defined WINDOWS_NATIVE || defined OS2)
# if HAVE_LANGINFO_CODESET # if HAVE_LANGINFO_CODESET
@ -407,10 +407,10 @@ locale_charset (void)
} }
} }
/* Woe32 has a function returning the locale's codepage as a number: /* The Windows API has a function returning the locale's codepage as a
GetACP(). This encoding is used by Cygwin, unless the user has set number: GetACP(). This encoding is used by Cygwin, unless the user
the environment variable CYGWIN=codepage:oem (which very few people has set the environment variable CYGWIN=codepage:oem (which very few
do). people do).
Output directed to console windows needs to be converted (to Output directed to console windows needs to be converted (to
GetOEMCP() if the console is using a raster font, or to GetOEMCP() if the console is using a raster font, or to
GetConsoleOutputCP() if it is using a TrueType font). Cygwin does GetConsoleOutputCP() if it is using a TrueType font). Cygwin does
@ -453,12 +453,12 @@ locale_charset (void)
# endif # endif
#elif defined WIN32_NATIVE #elif defined WINDOWS_NATIVE
static char buf[2 + 10 + 1]; static char buf[2 + 10 + 1];
/* Woe32 has a function returning the locale's codepage as a number: /* The Windows API has a function returning the locale's codepage as a
GetACP(). number: GetACP().
When the output goes to a console window, it needs to be provided in When the output goes to a console window, it needs to be provided in
GetOEMCP() encoding if the console is using a raster font, or in GetOEMCP() encoding if the console is using a raster font, or in
GetConsoleOutputCP() encoding if it is using a TrueType font. GetConsoleOutputCP() encoding if it is using a TrueType font.

View file

@ -1,5 +1,5 @@
/* Determine a canonical name for the current locale's character encoding. /* Determine a canonical name for the current locale's character encoding.
Copyright (C) 2000-2003, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2000-2003, 2009-2012 Free Software Foundation, Inc.
This file is part of the GNU CHARSET Library. This file is part of the GNU CHARSET Library.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify

View file

@ -1,5 +1,5 @@
/* A POSIX <locale.h>. /* A POSIX <locale.h>.
Copyright (C) 2007-2011 Free Software Foundation, Inc. Copyright (C) 2007-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,6 +1,6 @@
/* Work around a bug of lstat on some systems /* Work around a bug of lstat on some systems
Copyright (C) 1997-2006, 2008-2011 Free Software Foundation, Inc. Copyright (C) 1997-2006, 2008-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
@ -51,11 +51,11 @@ orig_lstat (const char *filename, struct stat *buf)
# include <errno.h> # include <errno.h>
/* lstat works differently on Linux and Solaris systems. POSIX (see /* lstat works differently on Linux and Solaris systems. POSIX (see
`pathname resolution' in the glossary) requires that programs like "pathname resolution" in the glossary) requires that programs like
`ls' take into consideration the fact that FILE has a trailing slash 'ls' take into consideration the fact that FILE has a trailing slash
when FILE is a symbolic link. On Linux and Solaris 10 systems, the when FILE is a symbolic link. On Linux and Solaris 10 systems, the
lstat function already has the desired semantics (in treating lstat function already has the desired semantics (in treating
`lstat ("symlink/", sbuf)' just like `lstat ("symlink/.", sbuf)', 'lstat ("symlink/", sbuf)' just like 'lstat ("symlink/.", sbuf)',
but on Solaris 9 and earlier it does not. but on Solaris 9 and earlier it does not.
If FILE has a trailing slash and specifies a symbolic link, If FILE has a trailing slash and specifies a symbolic link,

View file

@ -1,6 +1,6 @@
/* malloc() function that is glibc compatible. /* malloc() function that is glibc compatible.
Copyright (C) 1997-1998, 2006-2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 1997-1998, 2006-2007, 2009-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,5 +1,5 @@
/* Safe automatic memory allocation. /* Safe automatic memory allocation.
Copyright (C) 2003, 2006-2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2003, 2006-2007, 2009-2012 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003. Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify

View file

@ -1,5 +1,5 @@
/* Safe automatic memory allocation. /* Safe automatic memory allocation.
Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc. Copyright (C) 2003-2007, 2009-2012 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003. Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/* A GNU-like <math.h>. /* A GNU-like <math.h>.
Copyright (C) 2002-2003, 2007-2011 Free Software Foundation, Inc. Copyright (C) 2002-2003, 2007-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2011 /* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2012
Free Software Foundation, Inc. Free Software Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se), Based on strlen implementation by Torbjorn Granlund (tege@sics.se),

View file

@ -1,5 +1,5 @@
/* Invalid parameter handler for MSVC runtime libraries. /* Invalid parameter handler for MSVC runtime libraries.
Copyright (C) 2011 Free Software Foundation, Inc. Copyright (C) 2011-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
@ -40,7 +40,7 @@ gl_msvc_invalid_parameter_handler (const wchar_t *expression,
# else # else
/* Get declarations of the Win32 API functions. */ /* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>

View file

@ -1,5 +1,5 @@
/* Invalid parameter handler for MSVC runtime libraries. /* Invalid parameter handler for MSVC runtime libraries.
Copyright (C) 2011 Free Software Foundation, Inc. Copyright (C) 2011-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
@ -207,7 +207,7 @@ extern struct gl_msvc_inval_per_thread *gl_msvc_inval_current (void);
or when SANE_LIBRARY_HANDLING is desired. */ or when SANE_LIBRARY_HANDLING is desired. */
/* The braces here avoid GCC warnings like /* The braces here avoid GCC warnings like
"warning: suggest explicit braces to avoid ambiguous `else'". */ "warning: suggest explicit braces to avoid ambiguous 'else'". */
# define TRY_MSVC_INVAL \ # define TRY_MSVC_INVAL \
do \ do \
{ \ { \

View file

@ -1,6 +1,6 @@
/* Wrappers that don't throw invalid parameter notifications /* Wrappers that don't throw invalid parameter notifications
with MSVC runtime libraries. with MSVC runtime libraries.
Copyright (C) 2011 Free Software Foundation, Inc. Copyright (C) 2011-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
@ -21,7 +21,7 @@
/* Specification. */ /* Specification. */
#include "msvc-nothrow.h" #include "msvc-nothrow.h"
/* Get declarations of the Win32 API functions. */ /* Get declarations of the native Windows API functions. */
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>

Some files were not shown because too many files have changed in this diff Show more