recutils-1.5/ 0000755 0000000 0000000 00000000000 11704007350 010155 5 0000000 0000000 recutils-1.5/man/ 0000755 0000000 0000000 00000000000 11704007356 010736 5 0000000 0000000 recutils-1.5/man/recset.1 0000644 0000000 0000000 00000005051 11704007354 012224 0000000 0000000 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH RECSET "1" "January 2012" "recset 1.4.93" "User Commands"
.SH NAME
recset \- manipulate fields in a recfile
.SH SYNOPSIS
.B recset
[\fIOPTION\fR]... [\fIFILE\fR]...
.SH DESCRIPTION
Alter or delete fields in records.
.TP
\fB\-\-no\-external\fR
don't use external descriptors.
.TP
\fB\-\-force\fR
alter the records even if violating record
restrictions.
.TP
\fB\-\-help\fR
print a help message and exit.
.TP
\fB\-\-version\fR
show version and exit.
.SS "Record selection options:"
.TP
\fB\-i\fR, \fB\-\-case\-insensitive\fR
make strings case\-insensitive in selection
expressions.
.TP
\fB\-t\fR, \fB\-\-type\fR=\fITYPE\fR
operate on records of the specified type only.
.TP
\fB\-e\fR, \fB\-\-expression\fR=\fIEXPR\fR
selection expression.
.TP
\fB\-q\fR, \fB\-\-quick\fR=\fISTR\fR
select records with fields containing a string.
.TP
\fB\-n\fR, \fB\-\-number\fR=\fINUM\fR,...
select specific records by position, with ranges.
.TP
\fB\-R\fR, \fB\-\-random\fR=\fINUM\fR
select a given number of random records.
.SS "Field selection options:"
.TP
\fB\-f\fR, \fB\-\-fields\fR=\fIFIELDS\fR
comma\-separated list of field names with optional
subscripts.
.SS "Actions:"
.TP
\fB\-s\fR, \fB\-\-set\fR=\fIVALUE\fR
change the value of the selected fields.
.TP
\fB\-a\fR, \fB\-\-add\fR=\fIVALUE\fR
add the selected fields with the given value.
.TP
\fB\-S\fR, \fB\-\-set\-add\fR=\fIVALUE\fR
change the value of the selected fields. If they don't
exist then add a new field with that value.
.TP
\fB\-r\fR, \fB\-\-rename\fR=\fINAME\fR
rename the selected fields to a given name. If an entire
record set is selected then the field is renamed in the
record descriptor as well.
.TP
\fB\-d\fR, \fB\-\-delete\fR
delete the selected fields.
.TP
\fB\-c\fR, \fB\-\-comment\fR
comment out the selected fields.
.SH AUTHOR
Written by Jose E. Marchesi.
.SH "REPORTING BUGS"
Report bugs to: bug\-recutils@gnu.org
.br
GNU recutils home page:
.br
General help using GNU software:
.SH COPYRIGHT
Copyright \(co 2010, 2011, 2012 Jose E. Marchesi.
License GPLv3+: GNU GPL version 3 or later .
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The full documentation for
.B recset
is maintained as a Texinfo manual. If the
.B info
and
.B recset
programs are properly installed at your site, the command
.IP
.B info recset
.PP
should give you access to the complete manual.
recutils-1.5/man/recfmt.1 0000644 0000000 0000000 00000002317 11704007354 012221 0000000 0000000 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH RECFMT "1" "January 2012" "recfmt 1.4.93" "User Commands"
.SH NAME
recfmt \- apply a template to records
.SH SYNOPSIS
.B recfmt
[\fIOPTION\fR]... [\fITEMPLATE\fR]
.SH DESCRIPTION
Apply a template to records read from standard input.
.TP
\fB\-f\fR, \fB\-\-file\fR=\fIFILENAME\fR
read the template to apply from a file.
.TP
\fB\-\-help\fR
print a help message and exit.
.TP
\fB\-\-version\fR
show version and exit.
.SH AUTHOR
Written by Jose E. Marchesi.
.SH "REPORTING BUGS"
Report bugs to: bug\-recutils@gnu.org
.br
GNU recutils home page:
.br
General help using GNU software:
.SH COPYRIGHT
Copyright \(co 2010, 2011, 2012 Jose E. Marchesi.
License GPLv3+: GNU GPL version 3 or later .
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The full documentation for
.B recfmt
is maintained as a Texinfo manual. If the
.B info
and
.B recfmt
programs are properly installed at your site, the command
.IP
.B info recfmt
.PP
should give you access to the complete manual.
recutils-1.5/man/recdel.1 0000644 0000000 0000000 00000004312 11704007353 012173 0000000 0000000 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH RECDEL "1" "January 2012" "recdel 1.4.93" "User Commands"
.SH NAME
recdel \- remove records from a recfile
.SH SYNOPSIS
.B recdel
[\fIOPTIONS\fR]... [\fI-t TYPE\fR] [\fI-n NUM | -e EXPR | -q STR | -m NUM\fR] [\fIFILE\fR]
.SH DESCRIPTION
Remove (or comment out) records from a rec file.
.TP
\fB\-c\fR, \fB\-\-comment\fR
comment out the matching records instead of
deleting them.
.TP
\fB\-\-force\fR
delete even in potentially dangerous situations,
and if the deletion is violating record restrictions.
.TP
\fB\-\-no\-external\fR
don't use external descriptors.
.TP
\fB\-\-verbose\fR
give a detailed report if the integrity check
fails.
.TP
\fB\-\-help\fR
print a help message and exit.
.TP
\fB\-\-version\fR
show version and exit.
.SS "Record selection options:"
.TP
\fB\-i\fR, \fB\-\-case\-insensitive\fR
make strings case\-insensitive in selection
expressions.
.TP
\fB\-t\fR, \fB\-\-type\fR=\fITYPE\fR
operate on records of the specified type only.
.TP
\fB\-e\fR, \fB\-\-expression\fR=\fIEXPR\fR
selection expression.
.TP
\fB\-q\fR, \fB\-\-quick\fR=\fISTR\fR
select records with fields containing a string.
.TP
\fB\-n\fR, \fB\-\-number\fR=\fINUM\fR,...
select specific records by position, with ranges.
.TP
\fB\-R\fR, \fB\-\-random\fR=\fINUM\fR
select a given number of random records.
.PP
If no FILE is specified then the command acts like a filter, getting
the data from standard input and writing the result to standard output.
.SH AUTHOR
Written by Jose E. Marchesi.
.SH "REPORTING BUGS"
Report bugs to: bug\-recutils@gnu.org
.br
GNU recutils home page:
.br
General help using GNU software:
.SH COPYRIGHT
Copyright \(co 2010, 2011, 2012 Jose E. Marchesi.
License GPLv3+: GNU GPL version 3 or later .
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The full documentation for
.B recdel
is maintained as a Texinfo manual. If the
.B info
and
.B recdel
programs are properly installed at your site, the command
.IP
.B info recdel
.PP
should give you access to the complete manual.
recutils-1.5/man/recinf.1 0000644 0000000 0000000 00000003017 11704007353 012204 0000000 0000000 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH RECINF "1" "January 2012" "recinf 1.4.93" "User Commands"
.SH NAME
recinf \- print information about a recfile
.SH SYNOPSIS
.B recinf
[\fIOPTION\fR]... [\fIFILE\fR]...
.SH DESCRIPTION
Print information about the types of records stored in the input.
.TP
\fB\-t\fR, \fB\-\-type\fR=\fIRECORD_TYPE\fR
print information on the records having the
specified type.
.TP
\fB\-d\fR, \fB\-\-descriptor\fR
include the full record descriptors.
.TP
\fB\-n\fR, \fB\-\-names\-only\fR
output just the names of the record files
found in the input.
.TP
\fB\-\-help\fR
print a help message and exit.
.TP
\fB\-\-version\fR
show version and exit.
.SS "Special options:"
.TP
\fB\-S\fR, \fB\-\-print\-sexps\fR
print the data in sexps instead of rec format.
.SH AUTHOR
Written by Jose E. Marchesi.
.SH "REPORTING BUGS"
Report bugs to: bug\-recutils@gnu.org
.br
GNU recutils home page:
.br
General help using GNU software:
.SH COPYRIGHT
Copyright \(co 2010, 2011, 2012 Jose E. Marchesi.
License GPLv3+: GNU GPL version 3 or later .
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The full documentation for
.B recinf
is maintained as a Texinfo manual. If the
.B info
and
.B recinf
programs are properly installed at your site, the command
.IP
.B info recinf
.PP
should give you access to the complete manual.
recutils-1.5/man/recins.1 0000644 0000000 0000000 00000005015 11704007353 012221 0000000 0000000 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH RECINS "1" "January 2012" "recins 1.4.93" "User Commands"
.SH NAME
recins \- insert records in a recfile
.SH SYNOPSIS
.B recins
[\fIOPTION\fR]... [\fIt TYPE\fR] [\fI-n NUM | -e EXPR | -q STR | -m NUM\fR] [\fI(-f STR -v STR\fR]\fI|\fR[\fI-R RECDATA)\fR]... [\fIFILE\fR]
.SH DESCRIPTION
Insert new records in a rec database.
.TP
\fB\-f\fR, \fB\-\-field\fR=\fISTR\fR
field name; should be followed by a \fB\-v\fR.
.TP
\fB\-v\fR, \fB\-\-value\fR=\fISTR\fR
field value; should be preceded by an \fB\-f\fR.
.TP
\fB\-r\fR, \fB\-\-record\fR=\fISTR\fR
record that will be inserted in the file.
.TP
\fB\-\-force\fR
insert the record even if it is violating
record restrictions.
.TP
\fB\-\-no\-external\fR
don't use external descriptors.
.TP
\fB\-\-no\-auto\fR
don't insert auto generated fields.
.TP
\fB\-\-verbose\fR
give a detailed report if the integrity check
fails.
.TP
\fB\-s\fR, \fB\-\-password\fR=\fISTR\fR
encrypt confidential fields with the given password.
.TP
\fB\-\-help\fR
print a help message and exit.
.TP
\fB\-\-version\fR
show version and exit.
.SS "Record selection options:"
.TP
\fB\-i\fR, \fB\-\-case\-insensitive\fR
make strings case\-insensitive in selection
expressions.
.TP
\fB\-t\fR, \fB\-\-type\fR=\fITYPE\fR
operate on records of the specified type only.
.TP
\fB\-e\fR, \fB\-\-expression\fR=\fIEXPR\fR
selection expression.
.TP
\fB\-q\fR, \fB\-\-quick\fR=\fISTR\fR
select records with fields containing a string.
.TP
\fB\-n\fR, \fB\-\-number\fR=\fINUM\fR,...
select specific records by position, with ranges.
.TP
\fB\-R\fR, \fB\-\-random\fR=\fINUM\fR
select a given number of random records.
.PP
If no FILE is specified then the command acts like a filter, getting
the data from standard input and writing the result to standard output.
.SH AUTHOR
Written by Jose E. Marchesi.
.SH "REPORTING BUGS"
Report bugs to: bug\-recutils@gnu.org
.br
GNU recutils home page:
.br
General help using GNU software:
.SH COPYRIGHT
Copyright \(co 2010, 2011, 2012 Jose E. Marchesi.
License GPLv3+: GNU GPL version 3 or later .
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The full documentation for
.B recins
is maintained as a Texinfo manual. If the
.B info
and
.B recins
programs are properly installed at your site, the command
.IP
.B info recins
.PP
should give you access to the complete manual.
recutils-1.5/man/mdb2rec.1 0000644 0000000 0000000 00000002556 11704007355 012265 0000000 0000000 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH MDB2REC "1" "January 2012" "mdb2rec 1.4.93" "User Commands"
.SH NAME
mdb2rec \- mdb to rec converter
.SH SYNOPSIS
.B mdb2rec
[\fIOPTIONS\fR]... \fIMDB_FILE \fR[\fITABLE\fR]
.SH DESCRIPTION
Convert an mdb file into a rec file.
.TP
\fB\-s\fR, \fB\-\-system\-tables\fR
include system tables.
.TP
\fB\-e\fR, \fB\-\-keep\-empty\-fields\fR
don't prune empty fields in the rec
output.
.TP
\fB\-l\fR, \fB\-\-list\-tables\fR
dump a list of the table names contained
in the mdb file.
.TP
\fB\-\-help\fR
print a help message and exit.
.TP
\fB\-\-version\fR
show version and exit.
.SH AUTHOR
Written by Jose E. Marchesi.
.SH "REPORTING BUGS"
Report bugs to: bug\-recutils@gnu.org
.br
GNU recutils home page:
.br
General help using GNU software:
.SH COPYRIGHT
Copyright \(co 2010, 2011, 2012 Jose E. Marchesi.
License GPLv3+: GNU GPL version 3 or later .
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The full documentation for
.B mdb2rec
is maintained as a Texinfo manual. If the
.B info
and
.B mdb2rec
programs are properly installed at your site, the command
.IP
.B info mdb2rec
.PP
should give you access to the complete manual.
recutils-1.5/man/recsel.1 0000644 0000000 0000000 00000005353 11704007354 012221 0000000 0000000 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH RECSEL "1" "January 2012" "recsel 1.4.93" "User Commands"
.SH NAME
recsel \- print records from a recfile
.SH SYNOPSIS
.B recsel
[\fIOPTION\fR]... [\fI-t TYPE\fR] [\fI-n INDEXES | -e RECORD_EXPR | -q EXPR | -m NUM\fR] [\fI-c | (-p|-P) FIELD_EXPR\fR] [\fIFILE\fR]...
.SH DESCRIPTION
Select and print rec data.
.TP
\fB\-d\fR, \fB\-\-include\-descriptors\fR
print record descriptors along with the matched
records.
.TP
\fB\-C\fR, \fB\-\-collapse\fR
do not section the result in records with newlines.
.TP
\fB\-S\fR, \fB\-\-sort\fR=\fIFIELD\fR
sort the output by the specified field.
.TP
\fB\-U\fR, \fB\-\-uniq\fR
remove duplicated fields in the output records.
.TP
\fB\-s\fR, \fB\-\-password\fR=\fISTR\fR
decrypt confidential fields with the given password.
.TP
\fB\-\-help\fR
print a help message and exit.
.TP
\fB\-\-version\fR
show version and exit.
.SS "Record selection options:"
.TP
\fB\-i\fR, \fB\-\-case\-insensitive\fR
make strings case\-insensitive in selection
expressions.
.TP
\fB\-t\fR, \fB\-\-type\fR=\fITYPE\fR
operate on records of the specified type only.
.TP
\fB\-e\fR, \fB\-\-expression\fR=\fIEXPR\fR
selection expression.
.TP
\fB\-q\fR, \fB\-\-quick\fR=\fISTR\fR
select records with fields containing a string.
.TP
\fB\-n\fR, \fB\-\-number\fR=\fINUM\fR,...
select specific records by position, with ranges.
.TP
\fB\-R\fR, \fB\-\-random\fR=\fINUM\fR
select a given number of random records.
.SS "Output options:"
.TP
\fB\-p\fR, \fB\-\-print\fR=\fIFIELDS\fR
comma\-separated list of fields to print for each
matching record.
.TP
\fB\-P\fR, \fB\-\-print\-values\fR=\fIFIELDS\fR
as \fB\-p\fR, but print only the values of the selected
fields.
.TP
\fB\-R\fR, \fB\-\-print\-row\fR=\fIFIELDS\fR
as \fB\-P\fR, but separate the values with spaces instead
of newlines.
.TP
\fB\-c\fR, \fB\-\-count\fR
print a count of the matching records instead of
the records themselves.
.SS "Special options:"
.TP
\fB\-\-print\-sexps\fR
print the data in sexps instead of rec format.
.SH AUTHOR
Written by Jose E. Marchesi.
.SH "REPORTING BUGS"
Report bugs to: bug\-recutils@gnu.org
.br
GNU recutils home page:
.br
General help using GNU software:
.SH COPYRIGHT
Copyright \(co 2010, 2011, 2012 Jose E. Marchesi.
License GPLv3+: GNU GPL version 3 or later .
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The full documentation for
.B recsel
is maintained as a Texinfo manual. If the
.B info
and
.B recsel
programs are properly installed at your site, the command
.IP
.B info recsel
.PP
should give you access to the complete manual.
recutils-1.5/man/Makefile.am 0000644 0000000 0000000 00000005375 11655011572 012724 0000000 0000000 # Makefile.am for recutils/man
# Copyright (C) 2010 Jose E. Marchesi
# 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
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
man_MANS = recdel.1 \
recfix.1 \
recinf.1 \
recins.1 \
recsel.1 \
recset.1 \
recfmt.1 \
csv2rec.1 \
rec2csv.1
if COMPILE_MDB2REC
man_MANS += mdb2rec.1
endif
EXTRA_DIST = $(man_MANS)
MAINTAINERCLEANFILES = $(man_MANS)
# The man pages depend on the --help strings and the version number.
common_mandeps = $(top_srcdir)/configure.ac \
$(top_srcdir)/utils/recutl.c
# Depend on the source, not the binary; we don't need to regenerate
# the binary when any source file changes, only the main one.
# Use -o so that the `missing' program can infer the output file.
rec2csv.1: $(top_srcdir)/utils/rec2csv.c $(common_mandeps)
$(HELP2MAN) --name="rec to csv converter" $(builddir)/../utils/rec2csv -o $@
csv2rec.1: $(top_srcdir)/utils/csv2rec.c $(common_mandeps)
$(HELP2MAN) --name="csv to rec converter" $(builddir)/../utils/csv2rec -o $@
mdb2rec.1: $(top_srcdir)/utils/mdb2rec.c $(common_mandeps)
$(HELP2MAN) --name="mdb to rec converter" $(builddir)/../utils/mdb2rec -o $@
recdel.1: $(top_srcdir)/utils/recdel.c $(common_mandeps)
$(HELP2MAN) --name="remove records from a recfile" $(builddir)/../utils/recdel -o $@
recfix.1: $(top_srcdir)/utils/recfix.c $(common_mandeps)
$(HELP2MAN) --name="check a recfile for errors" $(builddir)/../utils/recfix -o $@
recinf.1: $(top_srcdir)/utils/recinf.c $(common_mandeps)
$(HELP2MAN) --name="print information about a recfile" $(builddir)/../utils/recinf -o $@
recins.1: $(top_srcdir)/utils/recins.c $(common_mandeps)
$(HELP2MAN) --name="insert records in a recfile" $(builddir)/../utils/recins -o $@
recsel.1: $(top_srcdir)/utils/recsel.c $(common_mandeps)
$(HELP2MAN) --name="print records from a recfile" $(builddir)/../utils/recsel -o $@
recset.1: $(top_srcdir)/utils/recset.c $(common_mandeps)
$(HELP2MAN) --name="manipulate fields in a recfile" $(builddir)/../utils/recset -o $@
recfmt.1: $(top_srcdir)/utils/recfmt.c $(common_mandeps)
$(HELP2MAN) --name="apply a template to records" $(builddir)/../utils/recfmt -o $@
# End of Makefile.am
recutils-1.5/man/recfix.1 0000644 0000000 0000000 00000003657 11704007353 012230 0000000 0000000 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH RECFIX "1" "January 2012" "recfix 1.4.93" "User Commands"
.SH NAME
recfix \- check a recfile for errors
.SH SYNOPSIS
.B recfix
[\fIOPTION\fR]... [\fIOPERATION\fR] [\fIOP_OPTION\fR]... [\fIFILE\fR]
.SH DESCRIPTION
Check and fix rec files.
.TP
\fB\-t\fR, \fB\-\-type\fR=\fITYPE\fR
process only records of the given type.
.TP
\fB\-\-no\-external\fR
don't use external descriptors.
.TP
\fB\-\-force\fR
force the requested operation.
.TP
\fB\-\-help\fR
print a help message and exit.
.TP
\fB\-\-version\fR
show version and exit.
.SS "Operations:"
.TP
\fB\-\-check\fR
check integrity of the specified file. Default.
.TP
\fB\-\-sort\fR
sort the records in the specified file.
.TP
\fB\-\-auto\fR
insert auto\-generated fields in records missing them.
.TP
\fB\-\-encrypt\fR
encrypt confidential fields in the specified file.
.TP
\fB\-\-decrypt\fR
decrypt confidential fields in the specified file.
.SS "De/Encryption options:"
.TP
\fB\-s\fR, \fB\-\-password\fR=\fIPASSWORD\fR
encrypt/decrypt with this password.
.PP
If no FILE is specified then the command acts like a filter, getting
the data from standard input and writing the result to standard output.
.SH AUTHOR
Written by Jose E. Marchesi.
.SH "REPORTING BUGS"
Report bugs to: bug\-recutils@gnu.org
.br
GNU recutils home page:
.br
General help using GNU software:
.SH COPYRIGHT
Copyright \(co 2010, 2011, 2012 Jose E. Marchesi.
License GPLv3+: GNU GPL version 3 or later .
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The full documentation for
.B recfix
is maintained as a Texinfo manual. If the
.B info
and
.B recfix
programs are properly installed at your site, the command
.IP
.B info recfix
.PP
should give you access to the complete manual.
recutils-1.5/man/rec2csv.1 0000644 0000000 0000000 00000002477 11704007355 012320 0000000 0000000 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH REC2CSV "1" "January 2012" "rec2csv 1.4.93" "User Commands"
.SH NAME
rec2csv \- rec to csv converter
.SH SYNOPSIS
.B rec2csv
[\fIOPTIONS\fR]... [\fIREC_FILE\fR]
.SH DESCRIPTION
Convert rec data into csv data.
.TP
\fB\-t\fR, \fB\-\-type\fR=\fITYPE\fR
record set to convert to csv; if this parameter
is omitted then the default record set is used
.TP
\fB\-S\fR, \fB\-\-sort\fR=\fIFIELD\fR
sort the output by the specified field.
.TP
\fB\-\-help\fR
print a help message and exit.
.TP
\fB\-\-version\fR
show version and exit.
.SH AUTHOR
Written by Jose E. Marchesi.
.SH "REPORTING BUGS"
Report bugs to: bug\-recutils@gnu.org
.br
GNU recutils home page:
.br
General help using GNU software:
.SH COPYRIGHT
Copyright \(co 2010, 2011, 2012 Jose E. Marchesi.
License GPLv3+: GNU GPL version 3 or later .
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The full documentation for
.B rec2csv
is maintained as a Texinfo manual. If the
.B info
and
.B rec2csv
programs are properly installed at your site, the command
.IP
.B info rec2csv
.PP
should give you access to the complete manual.
recutils-1.5/man/csv2rec.1 0000644 0000000 0000000 00000002536 11704007355 012314 0000000 0000000 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH CSV2REC "1" "January 2012" "csv2rec 1.4.93" "User Commands"
.SH NAME
csv2rec \- csv to rec converter
.SH SYNOPSIS
.B csv2rec
[\fIOPTIONS\fR]... [\fICSV_FILE\fR]
.SH DESCRIPTION
Convert csv data into rec data.
.TP
\fB\-t\fR, \fB\-\-type\fR=\fITYPE\fR
type name for the converted records; if this
parameter is ommited then no type is used.
.TP
\fB\-s\fR, \fB\-\-strict\fR
be strict parsing the csv file.
.TP
\fB\-e\fR, \fB\-\-omit\-empty\fR
omit empty fields.
.TP
\fB\-\-help\fR
print a help message and exit.
.TP
\fB\-\-version\fR
show version and exit.
.SH AUTHOR
Written by Jose E. Marchesi.
.SH "REPORTING BUGS"
Report bugs to: bug\-recutils@gnu.org
.br
GNU recutils home page:
.br
General help using GNU software:
.SH COPYRIGHT
Copyright \(co 2010, 2011, 2012 Jose E. Marchesi.
License GPLv3+: GNU GPL version 3 or later .
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The full documentation for
.B csv2rec
is maintained as a Texinfo manual. If the
.B info
and
.B csv2rec
programs are properly installed at your site, the command
.IP
.B info csv2rec
.PP
should give you access to the complete manual.
recutils-1.5/man/Makefile.in 0000644 0000000 0000000 00000147612 11704006654 012736 0000000 0000000 # Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Makefile.am for recutils/man
# Copyright (C) 2010 Jose E. Marchesi
# 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
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@COMPILE_MDB2REC_TRUE@am__append_1 = mdb2rec.1
subdir = man
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \
$(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/base64.m4 \
$(top_srcdir)/m4/bison.m4 $(top_srcdir)/m4/btowc.m4 \
$(top_srcdir)/m4/clock_time.m4 \
$(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closeout.m4 \
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/configmake.m4 \
$(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
$(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \
$(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/execute.m4 \
$(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \
$(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \
$(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl-o.m4 \
$(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
$(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fpending.m4 \
$(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \
$(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
$(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
$(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/getdelim.m4 \
$(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getline.m4 \
$(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/getpass.m4 \
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettime.m4 \
$(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/gl_list.m4 \
$(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \
$(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \
$(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \
$(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isnand.m4 \
$(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \
$(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \
$(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/localcharset.m4 \
$(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \
$(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/longlong.m4 \
$(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \
$(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbrtowc.m4 \
$(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \
$(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
$(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/mktime.m4 \
$(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
$(top_srcdir)/m4/msvc-inval.m4 \
$(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
$(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/onceonly.m4 \
$(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/parse-datetime.m4 \
$(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \
$(top_srcdir)/m4/printf-frexp.m4 \
$(top_srcdir)/m4/printf-frexpl.m4 \
$(top_srcdir)/m4/printf-posix-rpl.m4 \
$(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/raise.m4 \
$(top_srcdir)/m4/random_r.m4 $(top_srcdir)/m4/rawmemchr.m4 \
$(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/realloc.m4 \
$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sched_h.m4 \
$(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \
$(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
$(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \
$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/spawn_h.m4 \
$(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \
$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
$(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
$(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
$(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strcasestr.m4 \
$(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strerror.m4 \
$(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \
$(top_srcdir)/m4/strsep.m4 $(top_srcdir)/m4/sys_socket_h.m4 \
$(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
$(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \
$(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/time_h.m4 \
$(top_srcdir)/m4/time_r.m4 $(top_srcdir)/m4/timespec.m4 \
$(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/unistd_h.m4 \
$(top_srcdir)/m4/vasnprintf-posix.m4 \
$(top_srcdir)/m4/vasnprintf.m4 \
$(top_srcdir)/m4/vasprintf-posix.m4 \
$(top_srcdir)/m4/vasprintf.m4 \
$(top_srcdir)/m4/vfprintf-posix.m4 \
$(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \
$(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/wchar_h.m4 \
$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wcrtomb.m4 \
$(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
$(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)"
NROFF = nroff
MANS = $(man_MANS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkglibexecdir = @pkglibexecdir@
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
AR = @AR@
ARFLAGS = @ARFLAGS@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
CA68 = @CA68@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHECKLIBS = @CHECKLIBS@
CONFIG_INCLUDE = @CONFIG_INCLUDE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURLLIBS = @CURLLIBS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
ENOLINK_VALUE = @ENOLINK_VALUE@
EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
ERRNO_H = @ERRNO_H@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FLOAT_H = @FLOAT_H@
GETOPT_H = @GETOPT_H@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GLIBC21 = @GLIBC21@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GNULIB_ACOSF = @GNULIB_ACOSF@
GNULIB_ACOSL = @GNULIB_ACOSL@
GNULIB_ASINF = @GNULIB_ASINF@
GNULIB_ASINL = @GNULIB_ASINL@
GNULIB_ATAN2F = @GNULIB_ATAN2F@
GNULIB_ATANF = @GNULIB_ATANF@
GNULIB_ATANL = @GNULIB_ATANL@
GNULIB_ATOLL = @GNULIB_ATOLL@
GNULIB_BTOWC = @GNULIB_BTOWC@
GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
GNULIB_CEIL = @GNULIB_CEIL@
GNULIB_CEILF = @GNULIB_CEILF@
GNULIB_CEILL = @GNULIB_CEILL@
GNULIB_CHDIR = @GNULIB_CHDIR@
GNULIB_CHOWN = @GNULIB_CHOWN@
GNULIB_CLOSE = @GNULIB_CLOSE@
GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
GNULIB_COSF = @GNULIB_COSF@
GNULIB_COSHF = @GNULIB_COSHF@
GNULIB_COSL = @GNULIB_COSL@
GNULIB_DPRINTF = @GNULIB_DPRINTF@
GNULIB_DUP = @GNULIB_DUP@
GNULIB_DUP2 = @GNULIB_DUP2@
GNULIB_DUP3 = @GNULIB_DUP3@
GNULIB_ENVIRON = @GNULIB_ENVIRON@
GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
GNULIB_EXPF = @GNULIB_EXPF@
GNULIB_EXPL = @GNULIB_EXPL@
GNULIB_FABSF = @GNULIB_FABSF@
GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
GNULIB_FCHDIR = @GNULIB_FCHDIR@
GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
GNULIB_FCLOSE = @GNULIB_FCLOSE@
GNULIB_FCNTL = @GNULIB_FCNTL@
GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
GNULIB_FDOPEN = @GNULIB_FDOPEN@
GNULIB_FFLUSH = @GNULIB_FFLUSH@
GNULIB_FFS = @GNULIB_FFS@
GNULIB_FFSL = @GNULIB_FFSL@
GNULIB_FFSLL = @GNULIB_FFSLL@
GNULIB_FGETC = @GNULIB_FGETC@
GNULIB_FGETS = @GNULIB_FGETS@
GNULIB_FLOOR = @GNULIB_FLOOR@
GNULIB_FLOORF = @GNULIB_FLOORF@
GNULIB_FLOORL = @GNULIB_FLOORL@
GNULIB_FMA = @GNULIB_FMA@
GNULIB_FMAF = @GNULIB_FMAF@
GNULIB_FMAL = @GNULIB_FMAL@
GNULIB_FMODF = @GNULIB_FMODF@
GNULIB_FOPEN = @GNULIB_FOPEN@
GNULIB_FPRINTF = @GNULIB_FPRINTF@
GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
GNULIB_FPURGE = @GNULIB_FPURGE@
GNULIB_FPUTC = @GNULIB_FPUTC@
GNULIB_FPUTS = @GNULIB_FPUTS@
GNULIB_FREAD = @GNULIB_FREAD@
GNULIB_FREOPEN = @GNULIB_FREOPEN@
GNULIB_FREXP = @GNULIB_FREXP@
GNULIB_FREXPF = @GNULIB_FREXPF@
GNULIB_FREXPL = @GNULIB_FREXPL@
GNULIB_FSCANF = @GNULIB_FSCANF@
GNULIB_FSEEK = @GNULIB_FSEEK@
GNULIB_FSEEKO = @GNULIB_FSEEKO@
GNULIB_FSTAT = @GNULIB_FSTAT@
GNULIB_FSTATAT = @GNULIB_FSTATAT@
GNULIB_FSYNC = @GNULIB_FSYNC@
GNULIB_FTELL = @GNULIB_FTELL@
GNULIB_FTELLO = @GNULIB_FTELLO@
GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
GNULIB_FWRITE = @GNULIB_FWRITE@
GNULIB_GETC = @GNULIB_GETC@
GNULIB_GETCHAR = @GNULIB_GETCHAR@
GNULIB_GETCWD = @GNULIB_GETCWD@
GNULIB_GETDELIM = @GNULIB_GETDELIM@
GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
GNULIB_GETLINE = @GNULIB_GETLINE@
GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
GNULIB_GETS = @GNULIB_GETS@
GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
GNULIB_GRANTPT = @GNULIB_GRANTPT@
GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
GNULIB_ISATTY = @GNULIB_ISATTY@
GNULIB_ISFINITE = @GNULIB_ISFINITE@
GNULIB_ISINF = @GNULIB_ISINF@
GNULIB_ISNAN = @GNULIB_ISNAN@
GNULIB_ISNAND = @GNULIB_ISNAND@
GNULIB_ISNANF = @GNULIB_ISNANF@
GNULIB_ISNANL = @GNULIB_ISNANL@
GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
GNULIB_LCHMOD = @GNULIB_LCHMOD@
GNULIB_LCHOWN = @GNULIB_LCHOWN@
GNULIB_LDEXPF = @GNULIB_LDEXPF@
GNULIB_LDEXPL = @GNULIB_LDEXPL@
GNULIB_LINK = @GNULIB_LINK@
GNULIB_LINKAT = @GNULIB_LINKAT@
GNULIB_LOG10F = @GNULIB_LOG10F@
GNULIB_LOGB = @GNULIB_LOGB@
GNULIB_LOGF = @GNULIB_LOGF@
GNULIB_LOGL = @GNULIB_LOGL@
GNULIB_LSEEK = @GNULIB_LSEEK@
GNULIB_LSTAT = @GNULIB_LSTAT@
GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
GNULIB_MBRLEN = @GNULIB_MBRLEN@
GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
GNULIB_MBSCHR = @GNULIB_MBSCHR@
GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
GNULIB_MBSINIT = @GNULIB_MBSINIT@
GNULIB_MBSLEN = @GNULIB_MBSLEN@
GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
GNULIB_MBSSEP = @GNULIB_MBSSEP@
GNULIB_MBSSPN = @GNULIB_MBSSPN@
GNULIB_MBSSTR = @GNULIB_MBSSTR@
GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
GNULIB_MBTOWC = @GNULIB_MBTOWC@
GNULIB_MEMCHR = @GNULIB_MEMCHR@
GNULIB_MEMMEM = @GNULIB_MEMMEM@
GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
GNULIB_MKFIFO = @GNULIB_MKFIFO@
GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
GNULIB_MKNOD = @GNULIB_MKNOD@
GNULIB_MKNODAT = @GNULIB_MKNODAT@
GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
GNULIB_MKTIME = @GNULIB_MKTIME@
GNULIB_MODFF = @GNULIB_MODFF@
GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
GNULIB_OPEN = @GNULIB_OPEN@
GNULIB_OPENAT = @GNULIB_OPENAT@
GNULIB_PCLOSE = @GNULIB_PCLOSE@
GNULIB_PERROR = @GNULIB_PERROR@
GNULIB_PIPE = @GNULIB_PIPE@
GNULIB_PIPE2 = @GNULIB_PIPE2@
GNULIB_POPEN = @GNULIB_POPEN@
GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@
GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@
GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@
GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
GNULIB_POWF = @GNULIB_POWF@
GNULIB_PREAD = @GNULIB_PREAD@
GNULIB_PRINTF = @GNULIB_PRINTF@
GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
GNULIB_PTSNAME = @GNULIB_PTSNAME@
GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RAISE = @GNULIB_RAISE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READ = @GNULIB_READ@
GNULIB_READLINK = @GNULIB_READLINK@
GNULIB_READLINKAT = @GNULIB_READLINKAT@
GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
GNULIB_REALPATH = @GNULIB_REALPATH@
GNULIB_REMOVE = @GNULIB_REMOVE@
GNULIB_RENAME = @GNULIB_RENAME@
GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
GNULIB_RINT = @GNULIB_RINT@
GNULIB_RINTF = @GNULIB_RINTF@
GNULIB_RINTL = @GNULIB_RINTL@
GNULIB_RMDIR = @GNULIB_RMDIR@
GNULIB_ROUND = @GNULIB_ROUND@
GNULIB_ROUNDF = @GNULIB_ROUNDF@
GNULIB_ROUNDL = @GNULIB_ROUNDL@
GNULIB_RPMATCH = @GNULIB_RPMATCH@
GNULIB_SCANF = @GNULIB_SCANF@
GNULIB_SETENV = @GNULIB_SETENV@
GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
GNULIB_SIGACTION = @GNULIB_SIGACTION@
GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
GNULIB_SINF = @GNULIB_SINF@
GNULIB_SINHF = @GNULIB_SINHF@
GNULIB_SINL = @GNULIB_SINL@
GNULIB_SLEEP = @GNULIB_SLEEP@
GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
GNULIB_SQRTF = @GNULIB_SQRTF@
GNULIB_SQRTL = @GNULIB_SQRTL@
GNULIB_STAT = @GNULIB_STAT@
GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
GNULIB_STPCPY = @GNULIB_STPCPY@
GNULIB_STPNCPY = @GNULIB_STPNCPY@
GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
GNULIB_STRDUP = @GNULIB_STRDUP@
GNULIB_STRERROR = @GNULIB_STRERROR@
GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
GNULIB_STRNCAT = @GNULIB_STRNCAT@
GNULIB_STRNDUP = @GNULIB_STRNDUP@
GNULIB_STRNLEN = @GNULIB_STRNLEN@
GNULIB_STRPBRK = @GNULIB_STRPBRK@
GNULIB_STRPTIME = @GNULIB_STRPTIME@
GNULIB_STRSEP = @GNULIB_STRSEP@
GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
GNULIB_STRSTR = @GNULIB_STRSTR@
GNULIB_STRTOD = @GNULIB_STRTOD@
GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
GNULIB_STRTOLL = @GNULIB_STRTOLL@
GNULIB_STRTOULL = @GNULIB_STRTOULL@
GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
GNULIB_SYMLINK = @GNULIB_SYMLINK@
GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
GNULIB_TANF = @GNULIB_TANF@
GNULIB_TANHF = @GNULIB_TANHF@
GNULIB_TANL = @GNULIB_TANL@
GNULIB_TIMEGM = @GNULIB_TIMEGM@
GNULIB_TIME_R = @GNULIB_TIME_R@
GNULIB_TMPFILE = @GNULIB_TMPFILE@
GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
GNULIB_TRUNC = @GNULIB_TRUNC@
GNULIB_TRUNCF = @GNULIB_TRUNCF@
GNULIB_TRUNCL = @GNULIB_TRUNCL@
GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
GNULIB_UNLINK = @GNULIB_UNLINK@
GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
GNULIB_UNSETENV = @GNULIB_UNSETENV@
GNULIB_USLEEP = @GNULIB_USLEEP@
GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
GNULIB_VFSCANF = @GNULIB_VFSCANF@
GNULIB_VPRINTF = @GNULIB_VPRINTF@
GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
GNULIB_VSCANF = @GNULIB_VSCANF@
GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
GNULIB_WAITPID = @GNULIB_WAITPID@
GNULIB_WCPCPY = @GNULIB_WCPCPY@
GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
GNULIB_WCSCAT = @GNULIB_WCSCAT@
GNULIB_WCSCHR = @GNULIB_WCSCHR@
GNULIB_WCSCMP = @GNULIB_WCSCMP@
GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
GNULIB_WCSCPY = @GNULIB_WCSCPY@
GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
GNULIB_WCSDUP = @GNULIB_WCSDUP@
GNULIB_WCSLEN = @GNULIB_WCSLEN@
GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
GNULIB_WCSSPN = @GNULIB_WCSSPN@
GNULIB_WCSSTR = @GNULIB_WCSSTR@
GNULIB_WCSTOK = @GNULIB_WCSTOK@
GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
GNULIB_WCTOB = @GNULIB_WCTOB@
GNULIB_WCTOMB = @GNULIB_WCTOMB@
GNULIB_WCTRANS = @GNULIB_WCTRANS@
GNULIB_WCTYPE = @GNULIB_WCTYPE@
GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
GNULIB_WMEMSET = @GNULIB_WMEMSET@
GNULIB_WRITE = @GNULIB_WRITE@
GNULIB__EXIT = @GNULIB__EXIT@
GREP = @GREP@
HAVE_ACOSF = @HAVE_ACOSF@
HAVE_ACOSL = @HAVE_ACOSL@
HAVE_ASINF = @HAVE_ASINF@
HAVE_ASINL = @HAVE_ASINL@
HAVE_ATAN2F = @HAVE_ATAN2F@
HAVE_ATANF = @HAVE_ATANF@
HAVE_ATANL = @HAVE_ATANL@
HAVE_ATOLL = @HAVE_ATOLL@
HAVE_BTOWC = @HAVE_BTOWC@
HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
HAVE_CHOWN = @HAVE_CHOWN@
HAVE_COPYSIGN = @HAVE_COPYSIGN@
HAVE_COPYSIGNF = @HAVE_COPYSIGNF@
HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
HAVE_COSF = @HAVE_COSF@
HAVE_COSHF = @HAVE_COSHF@
HAVE_COSL = @HAVE_COSL@
HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
HAVE_DECL_COSL = @HAVE_DECL_COSL@
HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
HAVE_DECL_SINL = @HAVE_DECL_SINL@
HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
HAVE_DECL_TANL = @HAVE_DECL_TANL@
HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
HAVE_DPRINTF = @HAVE_DPRINTF@
HAVE_DUP2 = @HAVE_DUP2@
HAVE_DUP3 = @HAVE_DUP3@
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
HAVE_EXPF = @HAVE_EXPF@
HAVE_EXPL = @HAVE_EXPL@
HAVE_FABSF = @HAVE_FABSF@
HAVE_FACCESSAT = @HAVE_FACCESSAT@
HAVE_FCHDIR = @HAVE_FCHDIR@
HAVE_FCHMODAT = @HAVE_FCHMODAT@
HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
HAVE_FCNTL = @HAVE_FCNTL@
HAVE_FDATASYNC = @HAVE_FDATASYNC@
HAVE_FEATURES_H = @HAVE_FEATURES_H@
HAVE_FFS = @HAVE_FFS@
HAVE_FFSL = @HAVE_FFSL@
HAVE_FFSLL = @HAVE_FFSLL@
HAVE_FMA = @HAVE_FMA@
HAVE_FMAF = @HAVE_FMAF@
HAVE_FMAL = @HAVE_FMAL@
HAVE_FMODF = @HAVE_FMODF@
HAVE_FREXPF = @HAVE_FREXPF@
HAVE_FSEEKO = @HAVE_FSEEKO@
HAVE_FSTATAT = @HAVE_FSTATAT@
HAVE_FSYNC = @HAVE_FSYNC@
HAVE_FTELLO = @HAVE_FTELLO@
HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
HAVE_FUTIMENS = @HAVE_FUTIMENS@
HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
HAVE_GETGROUPS = @HAVE_GETGROUPS@
HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
HAVE_GETLOGIN = @HAVE_GETLOGIN@
HAVE_GETOPT_H = @HAVE_GETOPT_H@
HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
HAVE_GRANTPT = @HAVE_GRANTPT@
HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
HAVE_ISNAND = @HAVE_ISNAND@
HAVE_ISNANF = @HAVE_ISNANF@
HAVE_ISNANL = @HAVE_ISNANL@
HAVE_ISWBLANK = @HAVE_ISWBLANK@
HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
HAVE_LCHMOD = @HAVE_LCHMOD@
HAVE_LCHOWN = @HAVE_LCHOWN@
HAVE_LDEXPF = @HAVE_LDEXPF@
HAVE_LIBGCRYPT = @HAVE_LIBGCRYPT@
HAVE_LINK = @HAVE_LINK@
HAVE_LINKAT = @HAVE_LINKAT@
HAVE_LOG10F = @HAVE_LOG10F@
HAVE_LOGF = @HAVE_LOGF@
HAVE_LOGL = @HAVE_LOGL@
HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
HAVE_LSTAT = @HAVE_LSTAT@
HAVE_MBRLEN = @HAVE_MBRLEN@
HAVE_MBRTOWC = @HAVE_MBRTOWC@
HAVE_MBSINIT = @HAVE_MBSINIT@
HAVE_MBSLEN = @HAVE_MBSLEN@
HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
HAVE_MEMCHR = @HAVE_MEMCHR@
HAVE_MEMPCPY = @HAVE_MEMPCPY@
HAVE_MKDIRAT = @HAVE_MKDIRAT@
HAVE_MKDTEMP = @HAVE_MKDTEMP@
HAVE_MKFIFO = @HAVE_MKFIFO@
HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
HAVE_MKNOD = @HAVE_MKNOD@
HAVE_MKNODAT = @HAVE_MKNODAT@
HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_MODFF = @HAVE_MODFF@
HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
HAVE_PCLOSE = @HAVE_PCLOSE@
HAVE_PIPE = @HAVE_PIPE@
HAVE_PIPE2 = @HAVE_PIPE2@
HAVE_POPEN = @HAVE_POPEN@
HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@
HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@
HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
HAVE_POWF = @HAVE_POWF@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
HAVE_PTSNAME = @HAVE_PTSNAME@
HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RAISE = @HAVE_RAISE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
HAVE_READLINK = @HAVE_READLINK@
HAVE_READLINKAT = @HAVE_READLINKAT@
HAVE_REALPATH = @HAVE_REALPATH@
HAVE_RENAMEAT = @HAVE_RENAMEAT@
HAVE_RINT = @HAVE_RINT@
HAVE_RINTF = @HAVE_RINTF@
HAVE_RINTL = @HAVE_RINTL@
HAVE_RPMATCH = @HAVE_RPMATCH@
HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
HAVE_SCHED_H = @HAVE_SCHED_H@
HAVE_SETENV = @HAVE_SETENV@
HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
HAVE_SIGACTION = @HAVE_SIGACTION@
HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
HAVE_SIGSET_T = @HAVE_SIGSET_T@
HAVE_SINF = @HAVE_SINF@
HAVE_SINHF = @HAVE_SINHF@
HAVE_SINL = @HAVE_SINL@
HAVE_SLEEP = @HAVE_SLEEP@
HAVE_SPAWN_H = @HAVE_SPAWN_H@
HAVE_SQRTF = @HAVE_SQRTF@
HAVE_SQRTL = @HAVE_SQRTL@
HAVE_STDINT_H = @HAVE_STDINT_H@
HAVE_STPCPY = @HAVE_STPCPY@
HAVE_STPNCPY = @HAVE_STPNCPY@
HAVE_STRCASECMP = @HAVE_STRCASECMP@
HAVE_STRCASESTR = @HAVE_STRCASESTR@
HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
HAVE_STRINGS_H = @HAVE_STRINGS_H@
HAVE_STRPBRK = @HAVE_STRPBRK@
HAVE_STRPTIME = @HAVE_STRPTIME@
HAVE_STRSEP = @HAVE_STRSEP@
HAVE_STRTOD = @HAVE_STRTOD@
HAVE_STRTOLL = @HAVE_STRTOLL@
HAVE_STRTOULL = @HAVE_STRTOULL@
HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@
HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
HAVE_SYMLINK = @HAVE_SYMLINK@
HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
HAVE_TANF = @HAVE_TANF@
HAVE_TANHF = @HAVE_TANHF@
HAVE_TANL = @HAVE_TANL@
HAVE_TIMEGM = @HAVE_TIMEGM@
HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
HAVE_UNISTD_H = @HAVE_UNISTD_H@
HAVE_UNLINKAT = @HAVE_UNLINKAT@
HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
HAVE_USLEEP = @HAVE_USLEEP@
HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
HAVE_VASPRINTF = @HAVE_VASPRINTF@
HAVE_VDPRINTF = @HAVE_VDPRINTF@
HAVE_WCHAR_H = @HAVE_WCHAR_H@
HAVE_WCHAR_T = @HAVE_WCHAR_T@
HAVE_WCPCPY = @HAVE_WCPCPY@
HAVE_WCPNCPY = @HAVE_WCPNCPY@
HAVE_WCRTOMB = @HAVE_WCRTOMB@
HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
HAVE_WCSCAT = @HAVE_WCSCAT@
HAVE_WCSCHR = @HAVE_WCSCHR@
HAVE_WCSCMP = @HAVE_WCSCMP@
HAVE_WCSCOLL = @HAVE_WCSCOLL@
HAVE_WCSCPY = @HAVE_WCSCPY@
HAVE_WCSCSPN = @HAVE_WCSCSPN@
HAVE_WCSDUP = @HAVE_WCSDUP@
HAVE_WCSLEN = @HAVE_WCSLEN@
HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
HAVE_WCSNCAT = @HAVE_WCSNCAT@
HAVE_WCSNCMP = @HAVE_WCSNCMP@
HAVE_WCSNCPY = @HAVE_WCSNCPY@
HAVE_WCSNLEN = @HAVE_WCSNLEN@
HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
HAVE_WCSPBRK = @HAVE_WCSPBRK@
HAVE_WCSRCHR = @HAVE_WCSRCHR@
HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
HAVE_WCSSPN = @HAVE_WCSSPN@
HAVE_WCSSTR = @HAVE_WCSSTR@
HAVE_WCSTOK = @HAVE_WCSTOK@
HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
HAVE_WCSXFRM = @HAVE_WCSXFRM@
HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
HAVE_WINT_T = @HAVE_WINT_T@
HAVE_WMEMCHR = @HAVE_WMEMCHR@
HAVE_WMEMCMP = @HAVE_WMEMCMP@
HAVE_WMEMCPY = @HAVE_WMEMCPY@
HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
HAVE_WMEMSET = @HAVE_WMEMSET@
HAVE__BOOL = @HAVE__BOOL@
HAVE__EXIT = @HAVE__EXIT@
HELP2MAN = @HELP2MAN@
INCLUDE_NEXT = @INCLUDE_NEXT@
INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBGCRYPT = @LIBGCRYPT@
LIBGCRYPT_PREFIX = @LIBGCRYPT_PREFIX@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBREADLINE = @LIBREADLINE@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIPO = @LIPO@
LN_S = @LN_S@
LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
LOCALE_FR = @LOCALE_FR@
LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
LOCALE_JA = @LOCALE_JA@
LOCALE_ZH_CN = @LOCALE_ZH_CN@
LTLIBGCRYPT = @LTLIBGCRYPT@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LTLIBREADLINE = @LTLIBREADLINE@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MDBLIBS = @MDBLIBS@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@
NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@
NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
NEXT_ERRNO_H = @NEXT_ERRNO_H@
NEXT_FCNTL_H = @NEXT_FCNTL_H@
NEXT_FLOAT_H = @NEXT_FLOAT_H@
NEXT_GETOPT_H = @NEXT_GETOPT_H@
NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
NEXT_MATH_H = @NEXT_MATH_H@
NEXT_SCHED_H = @NEXT_SCHED_H@
NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
NEXT_SPAWN_H = @NEXT_SPAWN_H@
NEXT_STDDEF_H = @NEXT_STDDEF_H@
NEXT_STDINT_H = @NEXT_STDINT_H@
NEXT_STDIO_H = @NEXT_STDIO_H@
NEXT_STDLIB_H = @NEXT_STDLIB_H@
NEXT_STRINGS_H = @NEXT_STRINGS_H@
NEXT_STRING_H = @NEXT_STRING_H@
NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
NEXT_TIME_H = @NEXT_TIME_H@
NEXT_UNISTD_H = @NEXT_UNISTD_H@
NEXT_WCHAR_H = @NEXT_WCHAR_H@
NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSUB = @POSUB@
PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
REPLACE_CALLOC = @REPLACE_CALLOC@
REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
REPLACE_CEIL = @REPLACE_CEIL@
REPLACE_CEILF = @REPLACE_CEILF@
REPLACE_CEILL = @REPLACE_CEILL@
REPLACE_CHOWN = @REPLACE_CHOWN@
REPLACE_CLOSE = @REPLACE_CLOSE@
REPLACE_DPRINTF = @REPLACE_DPRINTF@
REPLACE_DUP = @REPLACE_DUP@
REPLACE_DUP2 = @REPLACE_DUP2@
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
REPLACE_FCLOSE = @REPLACE_FCLOSE@
REPLACE_FCNTL = @REPLACE_FCNTL@
REPLACE_FDOPEN = @REPLACE_FDOPEN@
REPLACE_FFLUSH = @REPLACE_FFLUSH@
REPLACE_FLOOR = @REPLACE_FLOOR@
REPLACE_FLOORF = @REPLACE_FLOORF@
REPLACE_FLOORL = @REPLACE_FLOORL@
REPLACE_FMA = @REPLACE_FMA@
REPLACE_FMAF = @REPLACE_FMAF@
REPLACE_FMAL = @REPLACE_FMAL@
REPLACE_FOPEN = @REPLACE_FOPEN@
REPLACE_FPRINTF = @REPLACE_FPRINTF@
REPLACE_FPURGE = @REPLACE_FPURGE@
REPLACE_FREOPEN = @REPLACE_FREOPEN@
REPLACE_FREXP = @REPLACE_FREXP@
REPLACE_FREXPF = @REPLACE_FREXPF@
REPLACE_FREXPL = @REPLACE_FREXPL@
REPLACE_FSEEK = @REPLACE_FSEEK@
REPLACE_FSEEKO = @REPLACE_FSEEKO@
REPLACE_FSTAT = @REPLACE_FSTAT@
REPLACE_FSTATAT = @REPLACE_FSTATAT@
REPLACE_FTELL = @REPLACE_FTELL@
REPLACE_FTELLO = @REPLACE_FTELLO@
REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
REPLACE_GETCWD = @REPLACE_GETCWD@
REPLACE_GETDELIM = @REPLACE_GETDELIM@
REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
REPLACE_GETLINE = @REPLACE_GETLINE@
REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
REPLACE_ISATTY = @REPLACE_ISATTY@
REPLACE_ISFINITE = @REPLACE_ISFINITE@
REPLACE_ISINF = @REPLACE_ISINF@
REPLACE_ISNAN = @REPLACE_ISNAN@
REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
REPLACE_ITOLD = @REPLACE_ITOLD@
REPLACE_LCHOWN = @REPLACE_LCHOWN@
REPLACE_LDEXPL = @REPLACE_LDEXPL@
REPLACE_LINK = @REPLACE_LINK@
REPLACE_LINKAT = @REPLACE_LINKAT@
REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
REPLACE_LSEEK = @REPLACE_LSEEK@
REPLACE_LSTAT = @REPLACE_LSTAT@
REPLACE_MALLOC = @REPLACE_MALLOC@
REPLACE_MBRLEN = @REPLACE_MBRLEN@
REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
REPLACE_MBSINIT = @REPLACE_MBSINIT@
REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
REPLACE_MBTOWC = @REPLACE_MBTOWC@
REPLACE_MEMCHR = @REPLACE_MEMCHR@
REPLACE_MEMMEM = @REPLACE_MEMMEM@
REPLACE_MKDIR = @REPLACE_MKDIR@
REPLACE_MKFIFO = @REPLACE_MKFIFO@
REPLACE_MKNOD = @REPLACE_MKNOD@
REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
REPLACE_MKTIME = @REPLACE_MKTIME@
REPLACE_NAN = @REPLACE_NAN@
REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
REPLACE_NULL = @REPLACE_NULL@
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
REPLACE_OPEN = @REPLACE_OPEN@
REPLACE_OPENAT = @REPLACE_OPENAT@
REPLACE_PERROR = @REPLACE_PERROR@
REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
REPLACE_PUTENV = @REPLACE_PUTENV@
REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_RAISE = @REPLACE_RAISE@
REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
REPLACE_READ = @REPLACE_READ@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALLOC = @REPLACE_REALLOC@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
REPLACE_RENAME = @REPLACE_RENAME@
REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
REPLACE_RMDIR = @REPLACE_RMDIR@
REPLACE_ROUND = @REPLACE_ROUND@
REPLACE_ROUNDF = @REPLACE_ROUNDF@
REPLACE_ROUNDL = @REPLACE_ROUNDL@
REPLACE_SETENV = @REPLACE_SETENV@
REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
REPLACE_SLEEP = @REPLACE_SLEEP@
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
REPLACE_SPRINTF = @REPLACE_SPRINTF@
REPLACE_STAT = @REPLACE_STAT@
REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
REPLACE_STPNCPY = @REPLACE_STPNCPY@
REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
REPLACE_TRUNC = @REPLACE_TRUNC@
REPLACE_TRUNCF = @REPLACE_TRUNCF@
REPLACE_TRUNCL = @REPLACE_TRUNCL@
REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
REPLACE_USLEEP = @REPLACE_USLEEP@
REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
REPLACE_VPRINTF = @REPLACE_VPRINTF@
REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
REPLACE_WCTOB = @REPLACE_WCTOB@
REPLACE_WCTOMB = @REPLACE_WCTOMB@
REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
REPLACE_WRITE = @REPLACE_WRITE@
SCHED_H = @SCHED_H@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
STDBOOL_H = @STDBOOL_H@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
WINT_T_SUFFIX = @WINT_T_SUFFIX@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
crypt_support = @crypt_support@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gl_LIBOBJS = @gl_LIBOBJS@
gl_LTLIBOBJS = @gl_LTLIBOBJS@
gltests_LIBOBJS = @gltests_LIBOBJS@
gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
gltests_WITNESS = @gltests_WITNESS@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
lispdir = @lispdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
man_MANS = recdel.1 recfix.1 recinf.1 recins.1 recsel.1 recset.1 \
recfmt.1 csv2rec.1 rec2csv.1 $(am__append_1)
EXTRA_DIST = $(man_MANS)
MAINTAINERCLEANFILES = $(man_MANS)
# The man pages depend on the --help strings and the version number.
common_mandeps = $(top_srcdir)/configure.ac \
$(top_srcdir)/utils/recutl.c
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu man/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man1: $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list=''; test -n "$(man1dir)" || exit 0; \
{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
test -z "$$files" || { \
echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
if test -n "$$list" && \
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
echo " typically \`make maintainer-clean' will remove them" >&2; \
exit 1; \
else :; fi; \
else :; fi
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(MANS)
installdirs:
for dir in "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-man
uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-man1 \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
uninstall uninstall-am uninstall-man uninstall-man1
# Depend on the source, not the binary; we don't need to regenerate
# the binary when any source file changes, only the main one.
# Use -o so that the `missing' program can infer the output file.
rec2csv.1: $(top_srcdir)/utils/rec2csv.c $(common_mandeps)
$(HELP2MAN) --name="rec to csv converter" $(builddir)/../utils/rec2csv -o $@
csv2rec.1: $(top_srcdir)/utils/csv2rec.c $(common_mandeps)
$(HELP2MAN) --name="csv to rec converter" $(builddir)/../utils/csv2rec -o $@
mdb2rec.1: $(top_srcdir)/utils/mdb2rec.c $(common_mandeps)
$(HELP2MAN) --name="mdb to rec converter" $(builddir)/../utils/mdb2rec -o $@
recdel.1: $(top_srcdir)/utils/recdel.c $(common_mandeps)
$(HELP2MAN) --name="remove records from a recfile" $(builddir)/../utils/recdel -o $@
recfix.1: $(top_srcdir)/utils/recfix.c $(common_mandeps)
$(HELP2MAN) --name="check a recfile for errors" $(builddir)/../utils/recfix -o $@
recinf.1: $(top_srcdir)/utils/recinf.c $(common_mandeps)
$(HELP2MAN) --name="print information about a recfile" $(builddir)/../utils/recinf -o $@
recins.1: $(top_srcdir)/utils/recins.c $(common_mandeps)
$(HELP2MAN) --name="insert records in a recfile" $(builddir)/../utils/recins -o $@
recsel.1: $(top_srcdir)/utils/recsel.c $(common_mandeps)
$(HELP2MAN) --name="print records from a recfile" $(builddir)/../utils/recsel -o $@
recset.1: $(top_srcdir)/utils/recset.c $(common_mandeps)
$(HELP2MAN) --name="manipulate fields in a recfile" $(builddir)/../utils/recset -o $@
recfmt.1: $(top_srcdir)/utils/recfmt.c $(common_mandeps)
$(HELP2MAN) --name="apply a template to records" $(builddir)/../utils/recfmt -o $@
# End of Makefile.am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
recutils-1.5/ABOUT-NLS 0000644 0000000 0000000 00000267133 11655011546 011347 0000000 0000000 1 Notes on the Free Translation Project
***************************************
Free software is going international! The Free Translation Project is
a way to get maintainers of free software, translators, and users all
together, so that free software will gradually become able to speak many
languages. A few packages already provide translations for their
messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work on translations can contact the appropriate team.
1.1 INSTALL Matters
===================
Some packages are "localizable" when properly installed; the programs
they contain can be made to speak your own native language. Most such
packages use GNU `gettext'. Other packages have their own ways to
internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU `gettext' functions. Installers may use special
options at configuration time for changing the default behaviour. The
command:
./configure --disable-nls
will _totally_ disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl' library
and will decide to use it. If not, you may have to to use the
`--with-libintl-prefix' option to tell `configure' where to look for it.
Internationalized packages usually have many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
1.2 Using This Package
======================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
`LL_CC' combination. If you happen to have the `LC_ALL' or some other
`LC_xxx' environment variables set, you should unset them before
setting `LANG', otherwise the setting of `LANG' will not have the
desired effect. Here `LL' is an ISO 639 two-letter language code, and
`CC' is an ISO 3166 two-letter country code. For example, let's
suppose that you speak German and live in Germany. At the shell
prompt, merely execute `setenv LANG de_DE' (in `csh'),
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
This can be done from your `.login' or `.profile' file, once and for
all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of `LL_CC', with `LL' denoting the
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
locales supported by your system for your language by running the
command `locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
for the purpose of message handling, but you still need to have `LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather
read translations in German than English for when Swedish is not
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
Special advice for Norwegian users: The language code for Norwegian
bokma*l changed from `no' to `nb' recently (in 2003). During the
transition period, while some message catalogs for this language are
installed under `nb' and some older ones under `no', it's recommended
for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
older translations are used.
In the `LANGUAGE' environment variable, but not in the `LANG'
environment variable, `LL_CC' combinations can be abbreviated as `LL'
to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
1.3 Translating Teams
=====================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
`http://translationproject.org/', in the "Teams" area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
_actively_ in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `coordinator@translationproject.org' to
reach the coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skills are praised more than
programming skills, here.
1.4 Available Packages
======================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of June
2010. The matrix shows, in regard of each package, for which languages
PO files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca
+--------------------------------------------------+
a2ps | [] [] |
aegis | |
ant-phone | |
anubis | |
aspell | [] [] |
bash | |
bfd | |
bibshelf | [] |
binutils | |
bison | |
bison-runtime | [] |
bluez-pin | [] [] |
bombono-dvd | |
buzztard | |
cflow | |
clisp | |
coreutils | [] [] |
cpio | |
cppi | |
cpplib | [] |
cryptsetup | |
dfarc | |
dialog | [] [] |
dico | |
diffutils | [] |
dink | |
doodle | |
e2fsprogs | [] |
enscript | [] |
exif | |
fetchmail | [] |
findutils | [] |
flex | [] |
freedink | |
gas | |
gawk | [] [] |
gcal | [] |
gcc | |
gettext-examples | [] [] [] [] |
gettext-runtime | [] [] |
gettext-tools | [] [] |
gip | [] |
gjay | |
gliv | [] |
glunarclock | [] [] |
gnubiff | |
gnucash | [] |
gnuedu | |
gnulib | |
gnunet | |
gnunet-gtk | |
gnutls | |
gold | |
gpe-aerial | |
gpe-beam | |
gpe-bluetooth | |
gpe-calendar | |
gpe-clock | [] |
gpe-conf | |
gpe-contacts | |
gpe-edit | |
gpe-filemanager | |
gpe-go | |
gpe-login | |
gpe-ownerinfo | [] |
gpe-package | |
gpe-sketchbook | |
gpe-su | [] |
gpe-taskmanager | [] |
gpe-timesheet | [] |
gpe-today | [] |
gpe-todo | |
gphoto2 | |
gprof | [] |
gpsdrive | |
gramadoir | |
grep | |
grub | [] [] |
gsasl | |
gss | |
gst-plugins-bad | [] |
gst-plugins-base | [] |
gst-plugins-good | [] |
gst-plugins-ugly | [] |
gstreamer | [] [] [] |
gtick | |
gtkam | [] |
gtkorphan | [] |
gtkspell | [] [] [] |
gutenprint | |
hello | [] |
help2man | |
hylafax | |
idutils | |
indent | [] [] |
iso_15924 | |
iso_3166 | [] [] [] [] [] [] [] |
iso_3166_2 | |
iso_4217 | |
iso_639 | [] [] [] [] |
iso_639_3 | |
jwhois | |
kbd | |
keytouch | [] |
keytouch-editor | |
keytouch-keyboa... | [] |
klavaro | [] |
latrine | |
ld | [] |
leafpad | [] [] |
libc | [] [] |
libexif | () |
libextractor | |
libgnutls | |
libgpewidget | |
libgpg-error | |
libgphoto2 | |
libgphoto2_port | |
libgsasl | |
libiconv | [] |
libidn | |
lifelines | |
liferea | [] [] |
lilypond | |
linkdr | [] |
lordsawar | |
lprng | |
lynx | [] |
m4 | |
mailfromd | |
mailutils | |
make | |
man-db | |
man-db-manpages | |
minicom | |
mkisofs | |
myserver | |
nano | [] [] |
opcodes | |
parted | |
pies | |
popt | |
psmisc | |
pspp | [] |
pwdutils | |
radius | [] |
recode | [] [] |
rosegarden | |
rpm | |
rush | |
sarg | |
screem | |
scrollkeeper | [] [] [] |
sed | [] [] |
sharutils | [] [] |
shishi | |
skencil | |
solfege | |
solfege-manual | |
soundtracker | |
sp | |
sysstat | |
tar | [] |
texinfo | |
tin | |
unicode-han-tra... | |
unicode-transla... | |
util-linux-ng | [] |
vice | |
vmm | |
vorbis-tools | |
wastesedge | |
wdiff | |
wget | [] [] |
wyslij-po | |
xchat | [] [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] |
+--------------------------------------------------+
af am an ar as ast az be be@latin bg bn_IN bs ca
6 0 1 2 3 19 1 10 3 28 3 1 38
crh cs da de el en en_GB en_ZA eo es et eu fa
+-------------------------------------------------+
a2ps | [] [] [] [] [] [] [] |
aegis | [] [] [] |
ant-phone | [] () |
anubis | [] [] |
aspell | [] [] [] [] [] |
bash | [] [] [] |
bfd | [] |
bibshelf | [] [] [] |
binutils | [] |
bison | [] [] |
bison-runtime | [] [] [] [] |
bluez-pin | [] [] [] [] [] [] |
bombono-dvd | [] |
buzztard | [] [] [] |
cflow | [] [] |
clisp | [] [] [] [] |
coreutils | [] [] [] [] |
cpio | |
cppi | |
cpplib | [] [] [] |
cryptsetup | [] |
dfarc | [] [] [] |
dialog | [] [] [] [] [] |
dico | |
diffutils | [] [] [] [] [] [] |
dink | [] [] [] |
doodle | [] |
e2fsprogs | [] [] [] |
enscript | [] [] [] |
exif | () [] [] |
fetchmail | [] [] () [] [] [] |
findutils | [] [] [] |
flex | [] [] |
freedink | [] [] [] |
gas | [] |
gawk | [] [] [] |
gcal | [] |
gcc | [] [] |
gettext-examples | [] [] [] [] |
gettext-runtime | [] [] [] [] |
gettext-tools | [] [] [] |
gip | [] [] [] [] |
gjay | [] |
gliv | [] [] [] |
glunarclock | [] [] |
gnubiff | () |
gnucash | [] () () () () |
gnuedu | [] [] |
gnulib | [] [] |
gnunet | |
gnunet-gtk | [] |
gnutls | [] [] |
gold | [] |
gpe-aerial | [] [] [] [] |
gpe-beam | [] [] [] [] |
gpe-bluetooth | [] [] |
gpe-calendar | [] |
gpe-clock | [] [] [] [] |
gpe-conf | [] [] [] |
gpe-contacts | [] [] [] |
gpe-edit | [] [] |
gpe-filemanager | [] [] [] |
gpe-go | [] [] [] [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] [] [] |
gpe-package | [] [] [] |
gpe-sketchbook | [] [] [] [] |
gpe-su | [] [] [] [] |
gpe-taskmanager | [] [] [] [] |
gpe-timesheet | [] [] [] [] |
gpe-today | [] [] [] [] |
gpe-todo | [] [] [] |
gphoto2 | [] [] () [] [] [] |
gprof | [] [] [] |
gpsdrive | [] [] [] |
gramadoir | [] [] [] |
grep | [] |
grub | [] [] |
gsasl | [] |
gss | |
gst-plugins-bad | [] [] [] [] [] |
gst-plugins-base | [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] () [] |
gtkam | [] [] () [] [] |
gtkorphan | [] [] [] [] |
gtkspell | [] [] [] [] [] [] [] |
gutenprint | [] [] [] |
hello | [] [] [] [] |
help2man | [] |
hylafax | [] [] |
idutils | [] [] |
indent | [] [] [] [] [] [] [] |
iso_15924 | [] () [] [] |
iso_3166 | [] [] [] [] () [] [] [] () |
iso_3166_2 | () |
iso_4217 | [] [] [] () [] [] |
iso_639 | [] [] [] [] () [] [] |
iso_639_3 | [] |
jwhois | [] |
kbd | [] [] [] [] [] |
keytouch | [] [] |
keytouch-editor | [] [] |
keytouch-keyboa... | [] |
klavaro | [] [] [] [] |
latrine | [] () |
ld | [] [] |
leafpad | [] [] [] [] [] [] |
libc | [] [] [] [] |
libexif | [] [] () |
libextractor | |
libgnutls | [] |
libgpewidget | [] [] |
libgpg-error | [] [] |
libgphoto2 | [] () |
libgphoto2_port | [] () [] |
libgsasl | |
libiconv | [] [] [] [] [] |
libidn | [] [] [] |
lifelines | [] () |
liferea | [] [] [] [] [] |
lilypond | [] [] [] |
linkdr | [] [] [] |
lordsawar | [] |
lprng | |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailfromd | |
mailutils | [] |
make | [] [] [] |
man-db | |
man-db-manpages | |
minicom | [] [] [] [] |
mkisofs | |
myserver | |
nano | [] [] [] |
opcodes | [] [] |
parted | [] [] |
pies | |
popt | [] [] [] [] [] |
psmisc | [] [] [] |
pspp | [] |
pwdutils | [] |
radius | [] |
recode | [] [] [] [] [] [] |
rosegarden | () () () |
rpm | [] [] [] |
rush | |
sarg | |
screem | |
scrollkeeper | [] [] [] [] [] |
sed | [] [] [] [] [] [] |
sharutils | [] [] [] [] |
shishi | |
skencil | [] () [] |
solfege | [] [] [] |
solfege-manual | [] [] |
soundtracker | [] [] [] |
sp | [] |
sysstat | [] [] [] |
tar | [] [] [] [] |
texinfo | [] [] [] |
tin | [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux-ng | [] [] [] [] |
vice | () () |
vmm | [] |
vorbis-tools | [] [] |
wastesedge | [] |
wdiff | [] [] |
wget | [] [] [] |
wyslij-po | |
xchat | [] [] [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] [] [] |
+-------------------------------------------------+
crh cs da de el en en_GB en_ZA eo es et eu fa
5 64 105 117 18 1 8 0 28 89 18 19 0
fi fr ga gl gu he hi hr hu hy id is it ja ka kn
+----------------------------------------------------+
a2ps | [] [] [] [] |
aegis | [] [] |
ant-phone | [] [] |
anubis | [] [] [] [] |
aspell | [] [] [] [] |
bash | [] [] [] [] |
bfd | [] [] [] |
bibshelf | [] [] [] [] [] |
binutils | [] [] [] |
bison | [] [] [] [] |
bison-runtime | [] [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] [] [] |
bombono-dvd | [] |
buzztard | [] |
cflow | [] [] [] |
clisp | [] |
coreutils | [] [] [] [] [] |
cpio | [] [] [] [] |
cppi | [] [] |
cpplib | [] [] [] |
cryptsetup | [] [] [] |
dfarc | [] [] [] |
dialog | [] [] [] [] [] [] [] |
dico | |
diffutils | [] [] [] [] [] [] [] [] [] |
dink | [] |
doodle | [] [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
exif | [] [] [] [] [] [] |
fetchmail | [] [] [] [] |
findutils | [] [] [] [] [] [] |
flex | [] [] [] |
freedink | [] [] [] |
gas | [] [] |
gawk | [] [] [] [] () [] |
gcal | [] |
gcc | [] |
gettext-examples | [] [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] |
gettext-tools | [] [] [] [] |
gip | [] [] [] [] [] [] |
gjay | [] |
gliv | [] () |
glunarclock | [] [] [] [] |
gnubiff | () [] () |
gnucash | () () () () () [] |
gnuedu | [] [] |
gnulib | [] [] [] [] [] [] |
gnunet | |
gnunet-gtk | [] |
gnutls | [] [] |
gold | [] [] |
gpe-aerial | [] [] [] |
gpe-beam | [] [] [] [] |
gpe-bluetooth | [] [] [] [] |
gpe-calendar | [] [] |
gpe-clock | [] [] [] [] [] |
gpe-conf | [] [] [] [] |
gpe-contacts | [] [] [] [] |
gpe-edit | [] [] [] |
gpe-filemanager | [] [] [] [] |
gpe-go | [] [] [] [] [] |
gpe-login | [] [] [] |
gpe-ownerinfo | [] [] [] [] [] |
gpe-package | [] [] [] |
gpe-sketchbook | [] [] [] [] |
gpe-su | [] [] [] [] [] [] |
gpe-taskmanager | [] [] [] [] [] |
gpe-timesheet | [] [] [] [] [] |
gpe-today | [] [] [] [] [] [] [] |
gpe-todo | [] [] [] |
gphoto2 | [] [] [] [] [] [] |
gprof | [] [] [] [] |
gpsdrive | [] [] [] |
gramadoir | [] [] [] |
grep | [] [] |
grub | [] [] [] [] |
gsasl | [] [] [] [] [] |
gss | [] [] [] [] [] |
gst-plugins-bad | [] [] [] [] [] [] |
gst-plugins-base | [] [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] [] [] [] [] |
gtkam | [] [] [] [] [] |
gtkorphan | [] [] [] |
gtkspell | [] [] [] [] [] [] [] [] [] |
gutenprint | [] [] [] [] |
hello | [] [] [] |
help2man | [] [] |
hylafax | [] |
idutils | [] [] [] [] [] [] |
indent | [] [] [] [] [] [] [] [] |
iso_15924 | [] () [] [] |
iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] |
iso_3166_2 | () [] [] [] |
iso_4217 | [] () [] [] [] [] |
iso_639 | [] () [] [] [] [] [] [] [] |
iso_639_3 | () [] [] |
jwhois | [] [] [] [] [] |
kbd | [] [] |
keytouch | [] [] [] [] [] [] |
keytouch-editor | [] [] [] [] [] |
keytouch-keyboa... | [] [] [] [] [] |
klavaro | [] [] |
latrine | [] [] [] |
ld | [] [] [] [] |
leafpad | [] [] [] [] [] [] [] () |
libc | [] [] [] [] [] |
libexif | [] |
libextractor | |
libgnutls | [] [] |
libgpewidget | [] [] [] [] |
libgpg-error | [] [] |
libgphoto2 | [] [] [] |
libgphoto2_port | [] [] [] |
libgsasl | [] [] [] [] [] |
libiconv | [] [] [] [] [] [] |
libidn | [] [] [] [] |
lifelines | () |
liferea | [] [] [] [] |
lilypond | [] [] |
linkdr | [] [] [] [] [] |
lordsawar | |
lprng | [] |
lynx | [] [] [] [] [] |
m4 | [] [] [] [] [] [] |
mailfromd | |
mailutils | [] [] |
make | [] [] [] [] [] [] [] [] [] |
man-db | [] [] |
man-db-manpages | [] |
minicom | [] [] [] [] [] |
mkisofs | [] [] [] [] |
myserver | |
nano | [] [] [] [] [] [] |
opcodes | [] [] [] [] |
parted | [] [] [] [] |
pies | |
popt | [] [] [] [] [] [] [] [] [] |
psmisc | [] [] [] |
pspp | |
pwdutils | [] [] |
radius | [] [] |
recode | [] [] [] [] [] [] [] [] |
rosegarden | () () () () () |
rpm | [] [] |
rush | |
sarg | [] |
screem | [] [] |
scrollkeeper | [] [] [] [] |
sed | [] [] [] [] [] [] [] [] |
sharutils | [] [] [] [] [] [] [] |
shishi | [] |
skencil | [] |
solfege | [] [] [] [] |
solfege-manual | [] [] |
soundtracker | [] [] |
sp | [] () |
sysstat | [] [] [] [] [] |
tar | [] [] [] [] [] [] [] |
texinfo | [] [] [] [] |
tin | [] |
unicode-han-tra... | |
unicode-transla... | [] [] |
util-linux-ng | [] [] [] [] [] [] |
vice | () () () |
vmm | [] |
vorbis-tools | [] |
wastesedge | () () |
wdiff | [] |
wget | [] [] [] [] [] [] [] [] |
wyslij-po | [] [] [] |
xchat | [] [] [] [] [] [] [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] [] |
+----------------------------------------------------+
fi fr ga gl gu he hi hr hu hy id is it ja ka kn
105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4
ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+-----------------------------------------------+
a2ps | [] |
aegis | |
ant-phone | |
anubis | [] [] |
aspell | [] |
bash | |
bfd | |
bibshelf | [] [] |
binutils | |
bison | [] |
bison-runtime | [] [] [] [] [] |
bluez-pin | [] [] [] [] [] |
bombono-dvd | |
buzztard | |
cflow | |
clisp | |
coreutils | [] |
cpio | |
cppi | |
cpplib | |
cryptsetup | |
dfarc | [] |
dialog | [] [] [] [] [] |
dico | |
diffutils | [] [] |
dink | |
doodle | |
e2fsprogs | |
enscript | |
exif | [] |
fetchmail | |
findutils | |
flex | |
freedink | [] |
gas | |
gawk | |
gcal | |
gcc | |
gettext-examples | [] [] [] [] |
gettext-runtime | [] |
gettext-tools | [] |
gip | [] [] |
gjay | |
gliv | |
glunarclock | [] |
gnubiff | |
gnucash | () () () () |
gnuedu | |
gnulib | |
gnunet | |
gnunet-gtk | |
gnutls | [] |
gold | |
gpe-aerial | [] |
gpe-beam | [] |
gpe-bluetooth | [] [] |
gpe-calendar | [] |
gpe-clock | [] [] [] [] [] |
gpe-conf | [] [] |
gpe-contacts | [] [] |
gpe-edit | [] |
gpe-filemanager | [] [] |
gpe-go | [] [] [] |
gpe-login | [] |
gpe-ownerinfo | [] [] |
gpe-package | [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] [] [] [] [] |
gpe-taskmanager | [] [] [] [] [] [] |
gpe-timesheet | [] [] |
gpe-today | [] [] [] [] |
gpe-todo | [] [] |
gphoto2 | |
gprof | [] |
gpsdrive | |
gramadoir | |
grep | |
grub | |
gsasl | |
gss | |
gst-plugins-bad | [] [] [] [] |
gst-plugins-base | [] [] |
gst-plugins-good | [] [] |
gst-plugins-ugly | [] [] [] [] [] |
gstreamer | |
gtick | |
gtkam | [] |
gtkorphan | [] [] |
gtkspell | [] [] [] [] [] [] [] |
gutenprint | |
hello | [] [] [] |
help2man | |
hylafax | |
idutils | |
indent | |
iso_15924 | [] [] |
iso_3166 | [] [] () [] [] [] [] [] |
iso_3166_2 | |
iso_4217 | [] [] |
iso_639 | [] [] |
iso_639_3 | [] |
jwhois | [] |
kbd | |
keytouch | [] |
keytouch-editor | [] |
keytouch-keyboa... | [] |
klavaro | [] |
latrine | [] |
ld | |
leafpad | [] [] [] |
libc | [] |
libexif | |
libextractor | |
libgnutls | [] |
libgpewidget | [] [] |
libgpg-error | |
libgphoto2 | |
libgphoto2_port | |
libgsasl | |
libiconv | |
libidn | |
lifelines | |
liferea | |
lilypond | |
linkdr | |
lordsawar | |
lprng | |
lynx | |
m4 | |
mailfromd | |
mailutils | |
make | [] |
man-db | |
man-db-manpages | |
minicom | [] |
mkisofs | |
myserver | |
nano | [] [] |
opcodes | |
parted | |
pies | |
popt | [] [] [] |
psmisc | |
pspp | |
pwdutils | |
radius | |
recode | |
rosegarden | |
rpm | |
rush | |
sarg | |
screem | |
scrollkeeper | [] [] |
sed | |
sharutils | |
shishi | |
skencil | |
solfege | [] |
solfege-manual | |
soundtracker | |
sp | |
sysstat | [] |
tar | [] |
texinfo | [] |
tin | |
unicode-han-tra... | |
unicode-transla... | |
util-linux-ng | |
vice | |
vmm | |
vorbis-tools | |
wastesedge | |
wdiff | |
wget | [] |
wyslij-po | |
xchat | [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] |
+-----------------------------------------------+
ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
20 5 10 1 13 48 4 2 2 4 24 10 20 3 1
nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
+---------------------------------------------------+
a2ps | [] [] [] [] [] [] [] [] |
aegis | [] [] [] |
ant-phone | [] [] |
anubis | [] [] [] |
aspell | [] [] [] [] [] |
bash | [] [] |
bfd | [] |
bibshelf | [] [] |
binutils | [] [] |
bison | [] [] [] |
bison-runtime | [] [] [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] [] [] |
bombono-dvd | [] () |
buzztard | [] [] |
cflow | [] |
clisp | [] [] |
coreutils | [] [] [] [] [] [] |
cpio | [] [] [] |
cppi | [] |
cpplib | [] |
cryptsetup | [] |
dfarc | [] |
dialog | [] [] [] [] |
dico | [] |
diffutils | [] [] [] [] [] [] |
dink | () |
doodle | [] [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] [] |
exif | [] [] [] () [] |
fetchmail | [] [] [] [] |
findutils | [] [] [] [] [] |
flex | [] [] [] [] [] |
freedink | [] [] |
gas | |
gawk | [] [] [] [] |
gcal | |
gcc | [] |
gettext-examples | [] [] [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] [] [] [] |
gettext-tools | [] [] [] [] [] [] |
gip | [] [] [] [] [] |
gjay | |
gliv | [] [] [] [] [] [] |
glunarclock | [] [] [] [] [] |
gnubiff | [] () |
gnucash | [] () () () |
gnuedu | [] |
gnulib | [] [] [] [] |
gnunet | |
gnunet-gtk | |
gnutls | [] [] |
gold | |
gpe-aerial | [] [] [] [] [] [] [] |
gpe-beam | [] [] [] [] [] [] [] |
gpe-bluetooth | [] [] |
gpe-calendar | [] [] [] [] |
gpe-clock | [] [] [] [] [] [] [] [] |
gpe-conf | [] [] [] [] [] [] [] |
gpe-contacts | [] [] [] [] [] |
gpe-edit | [] [] [] |
gpe-filemanager | [] [] [] |
gpe-go | [] [] [] [] [] [] [] [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] [] [] [] [] [] [] |
gpe-package | [] [] |
gpe-sketchbook | [] [] [] [] [] [] [] |
gpe-su | [] [] [] [] [] [] [] [] |
gpe-taskmanager | [] [] [] [] [] [] [] [] |
gpe-timesheet | [] [] [] [] [] [] [] [] |
gpe-today | [] [] [] [] [] [] [] [] |
gpe-todo | [] [] [] [] [] |
gphoto2 | [] [] [] [] [] [] [] [] |
gprof | [] [] [] |
gpsdrive | [] [] |
gramadoir | [] [] |
grep | [] [] [] [] |
grub | [] [] [] |
gsasl | [] [] [] [] |
gss | [] [] [] |
gst-plugins-bad | [] [] [] [] [] [] |
gst-plugins-base | [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] [] [] |
gtkam | [] [] [] [] [] [] |
gtkorphan | [] |
gtkspell | [] [] [] [] [] [] [] [] [] [] |
gutenprint | [] [] |
hello | [] [] [] [] |
help2man | [] [] |
hylafax | [] |
idutils | [] [] [] [] [] |
indent | [] [] [] [] [] [] [] |
iso_15924 | [] [] [] [] |
iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] |
iso_3166_2 | [] [] [] |
iso_4217 | [] [] [] [] [] [] [] [] |
iso_639 | [] [] [] [] [] [] [] [] [] |
iso_639_3 | [] [] |
jwhois | [] [] [] [] |
kbd | [] [] [] |
keytouch | [] [] [] |
keytouch-editor | [] [] [] |
keytouch-keyboa... | [] [] [] |
klavaro | [] [] |
latrine | [] [] |
ld | |
leafpad | [] [] [] [] [] [] [] [] [] |
libc | [] [] [] [] |
libexif | [] [] () [] |
libextractor | |
libgnutls | [] [] |
libgpewidget | [] [] [] |
libgpg-error | [] [] |
libgphoto2 | [] [] |
libgphoto2_port | [] [] [] [] [] |
libgsasl | [] [] [] [] [] |
libiconv | [] [] [] [] [] |
libidn | [] [] |
lifelines | [] [] |
liferea | [] [] [] [] [] () () [] |
lilypond | [] |
linkdr | [] [] [] |
lordsawar | |
lprng | [] |
lynx | [] [] [] |
m4 | [] [] [] [] [] |
mailfromd | [] |
mailutils | [] |
make | [] [] [] [] |
man-db | [] [] [] |
man-db-manpages | [] [] [] |
minicom | [] [] [] [] |
mkisofs | [] [] [] |
myserver | |
nano | [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] |
pies | [] |
popt | [] [] [] [] |
psmisc | [] [] [] |
pspp | [] [] |
pwdutils | [] |
radius | [] [] [] |
recode | [] [] [] [] [] [] [] [] |
rosegarden | () () |
rpm | [] [] [] |
rush | [] [] |
sarg | |
screem | |
scrollkeeper | [] [] [] [] [] [] [] [] |
sed | [] [] [] [] [] [] [] [] [] |
sharutils | [] [] [] [] |
shishi | [] |
skencil | [] [] |
solfege | [] [] [] [] |
solfege-manual | [] [] [] |
soundtracker | [] |
sp | |
sysstat | [] [] [] [] |
tar | [] [] [] [] |
texinfo | [] [] [] [] |
tin | [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux-ng | [] [] [] [] [] |
vice | [] |
vmm | [] |
vorbis-tools | [] [] |
wastesedge | [] |
wdiff | [] [] |
wget | [] [] [] [] [] [] [] |
wyslij-po | [] [] [] |
xchat | [] [] [] [] [] [] [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] |
+---------------------------------------------------+
nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
135 10 4 7 105 1 29 62 47 91 3 54 46 9 37
sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
+---------------------------------------------------+
a2ps | [] [] [] [] [] | 27
aegis | [] | 9
ant-phone | [] [] [] [] | 9
anubis | [] [] [] [] | 15
aspell | [] [] [] | 20
bash | [] [] [] | 12
bfd | [] | 6
bibshelf | [] [] [] | 16
binutils | [] [] | 8
bison | [] [] | 12
bison-runtime | [] [] [] [] [] [] | 29
bluez-pin | [] [] [] [] [] [] [] [] | 37
bombono-dvd | [] | 4
buzztard | [] | 7
cflow | [] [] [] | 9
clisp | | 10
coreutils | [] [] [] [] | 22
cpio | [] [] [] [] [] [] | 13
cppi | [] [] | 5
cpplib | [] [] [] [] [] [] | 14
cryptsetup | [] [] | 7
dfarc | [] | 9
dialog | [] [] [] [] [] [] [] | 30
dico | [] | 2
diffutils | [] [] [] [] [] [] | 30
dink | | 4
doodle | [] [] | 7
e2fsprogs | [] [] [] | 11
enscript | [] [] [] [] | 17
exif | [] [] [] | 16
fetchmail | [] [] [] | 17
findutils | [] [] [] [] [] | 20
flex | [] [] [] [] | 15
freedink | [] | 10
gas | [] | 4
gawk | [] [] [] [] | 18
gcal | [] [] | 5
gcc | [] [] [] | 7
gettext-examples | [] [] [] [] [] [] [] | 34
gettext-runtime | [] [] [] [] [] [] [] | 29
gettext-tools | [] [] [] [] [] [] | 22
gip | [] [] [] [] | 22
gjay | [] | 3
gliv | [] [] [] | 14
glunarclock | [] [] [] [] [] | 19
gnubiff | [] [] | 4
gnucash | () [] () [] () | 10
gnuedu | [] [] | 7
gnulib | [] [] [] [] | 16
gnunet | [] | 1
gnunet-gtk | [] [] [] | 5
gnutls | [] [] [] | 10
gold | [] | 4
gpe-aerial | [] [] [] | 18
gpe-beam | [] [] [] | 19
gpe-bluetooth | [] [] [] | 13
gpe-calendar | [] [] [] [] | 12
gpe-clock | [] [] [] [] [] | 28
gpe-conf | [] [] [] [] | 20
gpe-contacts | [] [] [] | 17
gpe-edit | [] [] [] | 12
gpe-filemanager | [] [] [] [] | 16
gpe-go | [] [] [] [] [] | 25
gpe-login | [] [] [] | 11
gpe-ownerinfo | [] [] [] [] [] | 25
gpe-package | [] [] [] | 13
gpe-sketchbook | [] [] [] | 20
gpe-su | [] [] [] [] [] | 30
gpe-taskmanager | [] [] [] [] [] | 29
gpe-timesheet | [] [] [] [] [] | 25
gpe-today | [] [] [] [] [] [] | 30
gpe-todo | [] [] [] [] | 17
gphoto2 | [] [] [] [] [] | 24
gprof | [] [] [] | 15
gpsdrive | [] [] [] | 11
gramadoir | [] [] [] | 11
grep | [] [] [] | 10
grub | [] [] [] | 14
gsasl | [] [] [] [] | 14
gss | [] [] [] | 11
gst-plugins-bad | [] [] [] [] | 26
gst-plugins-base | [] [] [] [] [] | 24
gst-plugins-good | [] [] [] [] | 24
gst-plugins-ugly | [] [] [] [] [] | 29
gstreamer | [] [] [] [] | 22
gtick | [] [] [] | 13
gtkam | [] [] [] | 20
gtkorphan | [] [] [] | 14
gtkspell | [] [] [] [] [] [] [] [] [] | 45
gutenprint | [] | 10
hello | [] [] [] [] [] [] | 21
help2man | [] [] | 7
hylafax | [] | 5
idutils | [] [] [] [] | 17
indent | [] [] [] [] [] [] | 30
iso_15924 | () [] () [] [] | 16
iso_3166 | [] [] () [] [] () [] [] [] () | 53
iso_3166_2 | () [] () [] | 9
iso_4217 | [] () [] [] () [] [] | 26
iso_639 | [] [] [] () [] () [] [] [] [] | 38
iso_639_3 | [] () | 8
jwhois | [] [] [] [] [] | 16
kbd | [] [] [] [] [] | 15
keytouch | [] [] [] | 16
keytouch-editor | [] [] [] | 14
keytouch-keyboa... | [] [] [] | 14
klavaro | [] | 11
latrine | [] [] [] | 10
ld | [] [] [] [] | 11
leafpad | [] [] [] [] [] [] | 33
libc | [] [] [] [] [] | 21
libexif | [] () | 7
libextractor | [] | 1
libgnutls | [] [] [] | 9
libgpewidget | [] [] [] | 14
libgpg-error | [] [] [] | 9
libgphoto2 | [] [] | 8
libgphoto2_port | [] [] [] [] | 14
libgsasl | [] [] [] | 13
libiconv | [] [] [] [] | 21
libidn | () [] [] | 11
lifelines | [] | 4
liferea | [] [] [] | 21
lilypond | [] | 7
linkdr | [] [] [] [] [] | 17
lordsawar | | 1
lprng | [] | 3
lynx | [] [] [] [] | 17
m4 | [] [] [] [] | 19
mailfromd | [] [] | 3
mailutils | [] | 5
make | [] [] [] [] | 21
man-db | [] [] [] | 8
man-db-manpages | | 4
minicom | [] [] | 16
mkisofs | [] [] | 9
myserver | | 0
nano | [] [] [] [] | 21
opcodes | [] [] [] | 11
parted | [] [] [] [] [] | 15
pies | [] [] | 3
popt | [] [] [] [] [] [] | 27
psmisc | [] [] | 11
pspp | | 4
pwdutils | [] [] | 6
radius | [] [] | 9
recode | [] [] [] [] | 28
rosegarden | () | 0
rpm | [] [] [] | 11
rush | [] [] | 4
sarg | | 1
screem | [] | 3
scrollkeeper | [] [] [] [] [] | 27
sed | [] [] [] [] [] | 30
sharutils | [] [] [] [] [] | 22
shishi | [] | 3
skencil | [] [] | 7
solfege | [] [] [] [] | 16
solfege-manual | [] | 8
soundtracker | [] [] [] | 9
sp | [] | 3
sysstat | [] [] | 15
tar | [] [] [] [] [] [] | 23
texinfo | [] [] [] [] [] | 17
tin | | 4
unicode-han-tra... | | 0
unicode-transla... | | 2
util-linux-ng | [] [] [] [] | 20
vice | () () | 1
vmm | [] | 4
vorbis-tools | [] | 6
wastesedge | | 2
wdiff | [] [] | 7
wget | [] [] [] [] [] | 26
wyslij-po | [] [] | 8
xchat | [] [] [] [] [] [] | 36
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63
xkeyboard-config | [] [] [] | 22
+---------------------------------------------------+
85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
If June 2010 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
matrix with full percentage details can be found at
`http://translationproject.org/extra/matrix.html'.
1.5 Using `gettext' in new packages
===================================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
package. Of course you have to respect the GNU Library General Public
License which covers the use of the GNU `gettext' library. This means
in particular that even non-free programs can use `libintl' as a shared
library, whereas only free software can use `libintl' as a static
library or use modified versions of `libintl'.
Once the sources are changed appropriately and the setup can handle
the use of `gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`coordinator@translationproject.org' to make the `.pot' files available
to the translation teams.
recutils-1.5/TODO 0000644 0000000 0000000 00000040066 11674164757 010620 0000000 0000000 # -*- mode: rec -*-
#
# TODO file for GNU recutils.
#
# Please execute ./tasktool --help
#
# Contact bug-recutils@gnu.org for any question or request concerning
# this file.
%rec: Task
%key: Id
%mandatory: Summary Status Category
%type: Id int
%type: Summary line
%type: Type enum
+ task
%type: Status enum
+ TODO NEXT STARTED WAITING
+ DONE SOMEDAY DISCARDED
%type: Category enum
+ librec utils doc rec-mode torture tasktool
%type: Originator,AssignedTo email
%type: CreatedAt,ClosedAt date
Id: 1
Summary: Make rec_db_t smarter.
Category: librec
CreatedAt: Sat Nov 6 11:13:36 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: TODO
Description: The rec_db_t abstract data type could benefit of some obvious
+ optimizations that are not yet in place. Currently it loads all the
+ record sets found in the input file. It shall be possible to load
+ record sets on demand instead, so the typical recsel usage on a
+ concrete record type won't be loading all other record sets.
Id: 2
Summary: Optimize rec_sex_eval.
Category: librec
CreatedAt: Sat Nov 6 11:15:06 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: TODO
Description: There is an obvious optimization in the SEX evaluator that is not yet
+ in place: don't evaluate permuted records if the changed field is not
+ present in the expression.
+
+ See the comment in 'rec_sex_eval' in rec-sex.c
Id: 3
Summary: Write unit tests for rec_field.
Category: torture
CreatedAt: Sat Nov 6 11:19:55 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Id: 4
Summary: Write unit tests for rec_record.
Category: torture
CreatedAt: Sat Nov 6 11:22:07 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: TODO
Id: 5
Summary: Write unit tests for rec_rset.
Category: torture
CreatedAt: Sat Nov 6 11:22:40 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: TODO
Id: 6
Summary: Write unit tests for rec_db.
Category: torture
CreatedAt: Sat Nov 6 11:22:48 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: TODO
Id: 7
Summary: Write unit tests for rec_int.
Category: torture
CreatedAt: Sat Nov 6 11:22:57 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: TODO
Id: 8
Summary: Write unit tests for rec_parser.
Category: torture
CreatedAt: Sat Nov 6 11:23:03 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Id: 9
Summary: Write unit tests for rec_fex.
Category: torture
CreatedAt: Sat Nov 6 11:23:12 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Id: 10
Summary: Write unit tests for rec_writer.
Category: torture
CreatedAt: Sat Nov 6 11:23:21 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Id: 11
Summary: Write unit tests for rec_sex.
Category: torture
CreatedAt: Sat Nov 6 11:23:29 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Id: 12
Summary: Improve error reporting with invalid %type fields.
Category: librec
CreatedAt: Sat Nov 6 11:43:25 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Description: The error reporting on type definitions in %type fields is not very
+ good. An error reporting mechanism should be implemented in the
+ rec_type_new function. Maybe an I/O stream.
Id: 13
Summary: Check the return value of all system calls.
Category: librec
Category: utils
CreatedAt: Sat Nov 6 11:44:38 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: TODO
Description: There are some unchecked malloc() calls in both the library and the
+ utilities. Any system call shall have its return value checked.
Note: Sat Nov 6 11:44:49 CET 2010
+
+ The 'malloc' cases are done, but it would be better to use the gnulib
+ xmalloc module in the utilities.
Note: Sat Nov 6 11:45:14 CET 2010
+
+ The code of the utilities are now using xmalloc and xstrdup.
Id: 14
Summary: Fix rec-finish-editing in rec-mode.el.
Category: rec-mode
CreatedAt: Sun Nov 7 14:46:14 CET 2010
AssignedTo: jemarch@gnu.org
Status: TODO
Description: When opening a file foo.rec with the following contents:
+
+ -- begin of file
+ baz: val1
+
+ %rec: type1
+
+ foo: val1
+
+ foo: val2
+
+ foo: val3
+
+ %rec: type2
+
+ jo: ja
+
+ bar: val2
+
+ bar: val3
+
+ -- end of file
+
+ An error makes rec-mode to be in a "showing task" state. There we can
+ press B and then C-cC-c. We get an error:
+
+ Wrong type argument: number-or-marker-p, nil
Id: 15
Summary: Make rec-mode to honour the external descriptors.
Category: rec-mode
CreatedAt: Sun Nov 7 14:57:22 CET 2010
AssignedTo: jemarch@gnu.org
Status: TODO
Id: 16
Summary: Implement %fsort.
Category: librec
CreatedAt: Sun Nov 7 20:26:41 CET 2010
AssignedTo: jemarch@gnu.org
Status: DISCARDED
Description: The %fsort special field specifies the desired order of the fields
+ of records. For example:
+
+ %rec: Employee
+ %fsort: Id,Name,Surname,Department
+
+ Determines the desired order for the fields of Employees. Not any
+ field used in records of type Employee shall be specified in the
+ %fsort field. The desired position for non explicitly mentioned
+ fields is at the end of the record.
Note: Tue Dec 20 17:23:43 CET 2011
+ Task resolved to 'DISCARDED'.
+
+ Probably not needed.
ClosedAt: Tue Dec 20 17:23:43 CET 2011
Id: 17
Summary: Make tasktool to reuse ChangeLog entries with the same date.
Category: tasktool
CreatedAt: Sun Nov 7 20:29:03 CET 2010
AssignedTo: jemarch@gnu.org
Status: TODO
Id: 18
Summary: Allow the usage of field lists in type declarations.
Category: librec
CreatedAt: Sun Nov 7 20:53:59 CET 2010
ClosedAt: Thu Nov 25 17:25:26 CET 2010
AssignedTo: jemarch@gnu.org
Status: DONE
Description: It is possible to specify more than one field name in type
+ declarations. All the fields having that name will share the same
+ type. For example:
+
+ @example
+ %type: Width,Height real
+ @end example
Id: 19
Summary: Fix over sized synopsis lines in the PDF manual.
Category: doc
CreatedAt: Mon Nov 8 11:36:58 CET 2010
Originator: Ralf.Wildenhues@gmx.de
AssignedTo: jemarch@gnu.org
Status: DONE
Description: @node recsel Invocation contains an overlong synopsis line in the PDF
+ output.
+
+ The problem may be present in the postscript and dvi output as well.
Note: Tue Nov 30 16:30:10 CET 2010
+ Task resolved to 'DONE'.
+
+ Fixed in a previous patch by Ralf Wildenhues.
ClosedAt: Tue Nov 30 16:30:10 CET 2010
Id: 20
Summary: Implement %sort.
Category: librec
CreatedAt: Mon Nov 8 12:57:20 CET 2010
AssignedTo: jemarch@gnu.org
Status: DONE
Description: Sorting of records in the described record set. Usage:
+
+ %sort: FIELD_NAME
+
+ Just a single field name is supported.
Note: Tue Dec 20 17:18:22 CET 2011
+ Task resolved to 'DONE'.
+
ClosedAt: Tue Dec 20 17:18:22 CET 2011
Id: 21
Summary: Support maximum width in output in recsel.
Category: librec
Category: utils
CreatedAt: Fri Nov 19 19:13:29 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: TODO
Description: The w option shall be implemented in recsel:
+
+ -w,--width maximum length (in characters) of values in
+ the output.
+
+ Example:
+
+ $ echo "foo: 0123456789" | recsel -w 5
+ foo: 01234+ 56789
Id: 22
Summary: Support external non-remote descriptors.
Category: librec
CreatedAt: Sat Nov 20 22:54:09 CET 2010
ClosedAt: Sat Nov 27 10:38:50 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Description: It shall be possible to use external desciptors not requiring a
+ URL. External descriptions can then be non-remote. Example:
+
+ %rec: foo /path/to/file
+
+ Compilation options shall be provided to disable the usage of libcurl.
Id: 23
Summary: Support renaming of fields in recset.
Category: librec
CreatedAt: Tue Nov 23 22:45:08 CET 2010
ClosedAt: Thu Nov 25 17:23:28 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Description: The recset utility shall support the -r option:
+
+ $ recset -n 0 -f field -r newname
+
+ that will rename the field field into newname in matching records.
Id: 24
Summary: Configuration file for tasktool.
Category: tasktool
CreatedAt: Wed Dec 1 18:03:14 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: TODO
Description:
+ The tasktool script can use a configuration file to store some default
+ values and other information, such as teh name of the user and her
+ email. The originator of newly created tasks, for example, would
+ default to that email address.
+
+ The format used to store the configuration file can be a recfile
+ (surprise! :D):
+
+ User: Jose E. Marchesi
+ Email: jemarch@gnu.org
+ # ... more configuration.
+
+ A new subcommand 'hello' can then be used to get introduced to
+ tasktool:
+
+ $ ./tasktool hello
+ Hello! my name is tasktool.
+ What is your name?:
+ What is your email?:
+ ... and so on.
+
+ or non-interactively:
+
+ $ ./tasktool hello 'Jose E. Marchesi' jemarch@gnu.org
+
+ Whatever.
Note: Tue Dec 20 17:24:54 CET 2011
+
+ The configuration file must be ignored by the vcs.
Id: 25
Summary: Support for %size
Category: librec
CreatedAt: Wed Dec 1 18:51:23 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Description:
+ %size fields can be used to define the minimum and the maximum
+ number of records that should exist in a record set.
+
+ Example:
+
+ %rec: TasktoolControl
+ %size: 1
+
+ The previous example requires the existence of one (and only one)
+ TasktoolControl record.
Note: Tue May 10 16:44:52 CEST 2011
+ Task resolved to 'DONE'.
+
+ Already implemented.
ClosedAt: Tue May 10 16:44:52 CEST 2011
Id: 26
Summary: rec_init shall build a list of predefined field names.
Category: librec
CreatedAt: Wed Dec 1 22:32:43 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Description:
+ The librec codebase is full of places where some predefined field
+ name, such as '%rec' or '%type', is used. In that case the following
+ sequence is used:
+
+ rec_fname = rec_parse_field_name_str ("%rec");
+
+ /* ... use it. */
+
+ rec_field_name_destroy (rec_fname);
+
+ The idiom above is dangeous and undesirable because:
+
+ 1. It is prone to generate memory leaks.
+ 2. It is slow.
+ 3. If we wanted to change a predefined field we would need to change
+ all its appareances.
+
+ A solution could be to make 'rec_init' to create a list of predefined
+ field names and 'rec_fini' to destroy them.
ClosedAt: Tue Dec 20 17:19:58 CET 2011
Id: 27
Summary: tasktool list shall list assigned tasks by default.
Category: tasktool
CreatedAt: Wed Dec 1 22:36:50 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: TODO
Description:
+ This would require the availability of the configuration file to
+ determine the user's email address.
+
+ See task 24.
Id: 28
Summary: support categories in tasktool.
Category: tasktool
CreatedAt: Wed Dec 1 22:38:35 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Description:
+ Subcommands that need to be aware of categories:
+
+ - create: option to specify the category, otherwise ask.
+ - list: option to filter by category.
Note: Fri Dec 10 16:27:21 CET 2010
+ Task resolved to 'DONE'.
+
+ Command line option -c|--category added to the "list" subcommand.
ClosedAt: Fri Dec 10 16:27:21 CET 2010
Id: 29
Summary: Support set-or-add -S option in recset.
Category: utils
CreatedAt: Wed Dec 1 22:55:06 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Description:
+ This option:
+
+ $ recset -f foo -S bar
+
+ would set the value of the fields named 'foo' in records to 'bar'. If
+ no field named 'foo' is found in a record, one is created with the
+ given value.
ClosedAt: Fri Jan 14 20:45:58 CET 2011
Id: 30
Summary: Do not use open_memstream and fmemopen.
Category: librec
Category: torture
Category: utils
CreatedAt: Sat Dec 4 20:50:55 CET 2010
Originator: bruno@clisp.org
AssignedTo: jemarch@gnu.org
Status: DONE
Description:
+ open_memstream and fmemopen are not portable. Information sent by
+ Bruno Haible to the development mailing list:
+
+ libtool: link: gcc -Wall -fno-strict-aliasing -g -O2 -o .libs/recinf recutl.o recinf.o ../lib/.libs/libgnu.a -L/Users/bruno/data/local-macos/lib ../src/.libs/librec.dylib /Users/bruno/data/local-macos/lib/libintl.dylib /Users/bruno/data/local-macos/lib/libiconv.dylib -lc -lcurl
+ Undefined symbols:
+ "_open_memstream", referenced from:
+ _recutl_eval_field_expression in recutl.o
+ ld: symbol(s) not found
+ collect2: ld returned 1 exit status
+ make[1]: *** [recinf] Error 1
+ make: *** [all-recursive] Error 1
+
+ This is because the function open_memstream(), and also fmemopen()
+ which is used in rec-parser.c, exist only on glibc, Cygwin 1.7, and
+ AIX 7.1:
+
+ $ ./show-portability open_memstream
+ libc aix-7.1.0
+ libc cygwin-1.7
+ libc glibc-2.3.6
+ MISSING in aix-4.3.2 aix-5.1.0 aix-5.2.0 aix-5.3.0a aix-6.1.0 beos cygwin-1.5 freebsd-5.2.1 freebsd-6.0 freebsd-6.4 hpux-10.20 hpux-11.00 hpux-11.11 hpux-11.23 hpux-11.31 interix-3.5 irix-5.3 irix-6.5 macosx-10.3 macosx-10.4 macosx-10.5 mingw netbsd-3.0 netbsd-5.0.1 netbsd-5.0 nsk-G06 openbsd-3.8 osf1-4.0d osf1-5.1a pips solaris-2.10 solaris-2.11_2010_11 solaris-2.4 solaris-2.5.1 solaris-2.6 solaris-2.7 solaris-2.8 solaris-2.9
+
+ $ ./show-portability fmemopen
+ libc aix-7.1.0
+ libc cygwin-1.7
+ libc glibc-2.3.6
+ MISSING in aix-4.3.2 aix-5.1.0 aix-5.2.0 aix-5.3.0a aix-6.1.0 beos cygwin-1.5 freebsd-5.2.1 freebsd-6.0 freebsd-6.4 hpux-10.20 hpux-11.00 hpux-11.11 hpux-11.23 hpux-11.31 interix-3.5 irix-5.3 irix-6.5 macosx-10.3 macosx-10.4 macosx-10.5 mingw netbsd-3.0 netbsd-5.0.1 netbsd-5.0 nsk-G06 openbsd-3.8 osf1-4.0d osf1-5.1a pips solaris-2.10 solaris-2.11_2010_11 solaris-2.4 solaris-2.5.1 solaris-2.6 solaris-2.7 solaris-2.8 solaris-2.9
+
+ See also the gnulib documentation:
+ http://www.gnu.org/software/gnulib/manual/html_node/open_005fmemstream.html
+ http://www.gnu.org/software/gnulib/manual/html_node/fmemopen.html
+
+ And no, gnulib cannot create a replacement for these functions,
+ because the 'FILE' type is simply not extensible and the stream
+ functions are hardcoded in many systems.
+
+ For open_memstream(), how about using an explicit in-memory buffer,
+ that is grown through x2nrealloc when needed?
+
+ For fmemopen(), I would suggest to change the rec_parser_s type so
+ that it contains a FILE * for reading from a file and a 'const char
+ *buf; const char *bufend;' for reading from a buffer in memory.
Note: Tue Dec 14 22:13:25 CET 2010
+
+ The library (and associated tests) has been modified to not use
+ fmemopen. The parser now supports a buffer-backed operation mode.
+ The implementations of the rec_parse_xxx_str functions have been
+ modified to use the new kind of parsers instead of the non-portable
+ construction.
ClosedAt: Sat Dec 18 12:22:55 CET 2010
Id: 34
Summary: Embed a copy of libcsv in the sources tree.
Category: librec
CreatedAt: Thu Dec 16 19:39:19 CET 2010
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Description:
+ The libcsv library (available in http://libcsv.sf.net) is composed by
+ a single header file and a source file. It is licensed under the
+ LGPLv2.1+.
ClosedAt: Thu Dec 16 23:12:20 CET 2010
Id: 35
Summary: Support escaped characters in string literals.
Category: librec
CreatedAt: Tue May 10 16:49:10 CEST 2011
Originator: jemarch@gnu.org
AssignedTo: jemarch@gnu.org
Status: DONE
Description: The string literals supported in the selection expressions are not
+ supporting the escaping of characters, thus having to provide a real
+ newline character or tab character in order to have them included in
+ the value of the literal.
+
+ C-style scaped characters shall be supported in string literals. An
+ initial list of supported characters is:
+
+ - \n for newline.
+ - \t for tab.
+ - \NNN for any ASCII character whose code is encoded in octal in NNN.
ClosedAt: Tue Dec 20 17:20:15 CET 2011
%rec: TasktoolControl
%type: NextFreeId int
%mandatory: NextFreeId
%unique: NextFreeId
NextFreeId: 36
# End of TODO
recutils-1.5/lib/ 0000755 0000000 0000000 00000000000 11704007351 010724 5 0000000 0000000 recutils-1.5/lib/closeout.h 0000644 0000000 0000000 00000002042 11703116213 012645 0000000 0000000 /* Close standard output and standard error.
Copyright (C) 1998, 2000, 2003-2004, 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 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#ifndef CLOSEOUT_H
# define CLOSEOUT_H 1
# include
# ifdef __cplusplus
extern "C" {
# endif
void close_stdout_set_file_name (const char *file);
void close_stdout_set_ignore_EPIPE (bool ignore);
void close_stdout (void);
# ifdef __cplusplus
}
# endif
#endif
recutils-1.5/lib/spawni.c 0000644 0000000 0000000 00000025106 11703116215 012314 0000000 0000000 /* Guts of POSIX spawn interface. Generic POSIX.1 version.
Copyright (C) 2000-2006, 2008-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#include
/* Specification. */
#include
#include "spawn_int.h"
#include
#include
#include
#ifndef O_LARGEFILE
# define O_LARGEFILE 0
#endif
#if _LIBC || HAVE_PATHS_H
# include
#else
# define _PATH_BSHELL "/bin/sh"
#endif
#include
#include
#include
#include
#if _LIBC
# include
#else
# define close_not_cancel close
# define open_not_cancel open
#endif
#if _LIBC
# include
#else
# if !HAVE_SETEUID
# define seteuid(id) setresuid (-1, id, -1)
# endif
# if !HAVE_SETEGID
# define setegid(id) setresgid (-1, id, -1)
# endif
# define local_seteuid(id) seteuid (id)
# define local_setegid(id) setegid (id)
#endif
#if _LIBC
# define alloca __alloca
# define execve __execve
# define dup2 __dup2
# define fork __fork
# define getgid __getgid
# define getuid __getuid
# define sched_setparam __sched_setparam
# define sched_setscheduler __sched_setscheduler
# define setpgid __setpgid
# define sigaction __sigaction
# define sigismember __sigismember
# define sigprocmask __sigprocmask
# define strchrnul __strchrnul
# define vfork __vfork
#else
# undef internal_function
# define internal_function /* empty */
#endif
/* The Unix standard contains a long explanation of the way to signal
an error after the fork() was successful. Since no new wait status
was wanted there is no way to signal an error using one of the
available methods. The committee chose to signal an error by a
normal program exit with the exit code 127. */
#define SPAWN_ERROR 127
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Native Windows API. */
int
__spawni (pid_t *pid, const char *file,
const posix_spawn_file_actions_t *file_actions,
const posix_spawnattr_t *attrp, char *const argv[],
char *const envp[], int use_path)
{
/* Not yet implemented. */
return ENOSYS;
}
#else
/* The file is accessible but it is not an executable file. Invoke
the shell to interpret it as a script. */
static void
internal_function
script_execute (const char *file, char *const argv[], char *const envp[])
{
/* Count the arguments. */
int argc = 0;
while (argv[argc++])
;
/* Construct an argument list for the shell. */
{
char **new_argv = (char **) alloca ((argc + 1) * sizeof (char *));
new_argv[0] = (char *) _PATH_BSHELL;
new_argv[1] = (char *) file;
while (argc > 1)
{
new_argv[argc] = argv[argc - 1];
--argc;
}
/* Execute the shell. */
execve (new_argv[0], new_argv, envp);
}
}
/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
Before running the process perform the actions described in FILE-ACTIONS. */
int
__spawni (pid_t *pid, const char *file,
const posix_spawn_file_actions_t *file_actions,
const posix_spawnattr_t *attrp, char *const argv[],
char *const envp[], int use_path)
{
pid_t new_pid;
char *path, *p, *name;
size_t len;
size_t pathlen;
/* Do this once. */
short int flags = attrp == NULL ? 0 : attrp->_flags;
/* Avoid gcc warning
"variable 'flags' might be clobbered by 'longjmp' or 'vfork'" */
(void) &flags;
/* Generate the new process. */
#if HAVE_VFORK
if ((flags & POSIX_SPAWN_USEVFORK) != 0
/* If no major work is done, allow using vfork. Note that we
might perform the path searching. But this would be done by
a call to execvp(), too, and such a call must be OK according
to POSIX. */
|| ((flags & (POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF
| POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER
| POSIX_SPAWN_SETPGROUP | POSIX_SPAWN_RESETIDS)) == 0
&& file_actions == NULL))
new_pid = vfork ();
else
#endif
new_pid = fork ();
if (new_pid != 0)
{
if (new_pid < 0)
return errno;
/* The call was successful. Store the PID if necessary. */
if (pid != NULL)
*pid = new_pid;
return 0;
}
/* Set signal mask. */
if ((flags & POSIX_SPAWN_SETSIGMASK) != 0
&& sigprocmask (SIG_SETMASK, &attrp->_ss, NULL) != 0)
_exit (SPAWN_ERROR);
/* Set signal default action. */
if ((flags & POSIX_SPAWN_SETSIGDEF) != 0)
{
/* We have to iterate over all signals. This could possibly be
done better but it requires system specific solutions since
the sigset_t data type can be very different on different
architectures. */
int sig;
struct sigaction sa;
memset (&sa, '\0', sizeof (sa));
sa.sa_handler = SIG_DFL;
for (sig = 1; sig <= NSIG; ++sig)
if (sigismember (&attrp->_sd, sig) != 0
&& sigaction (sig, &sa, NULL) != 0)
_exit (SPAWN_ERROR);
}
#if (_LIBC ? defined _POSIX_PRIORITY_SCHEDULING : HAVE_SCHED_SETPARAM && HAVE_SCHED_SETSCHEDULER)
/* Set the scheduling algorithm and parameters. */
if ((flags & (POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER))
== POSIX_SPAWN_SETSCHEDPARAM)
{
if (sched_setparam (0, &attrp->_sp) == -1)
_exit (SPAWN_ERROR);
}
else if ((flags & POSIX_SPAWN_SETSCHEDULER) != 0)
{
if (sched_setscheduler (0, attrp->_policy,
(flags & POSIX_SPAWN_SETSCHEDPARAM) != 0
? &attrp->_sp : NULL) == -1)
_exit (SPAWN_ERROR);
}
#endif
/* Set the process group ID. */
if ((flags & POSIX_SPAWN_SETPGROUP) != 0
&& setpgid (0, attrp->_pgrp) != 0)
_exit (SPAWN_ERROR);
/* Set the effective user and group IDs. */
if ((flags & POSIX_SPAWN_RESETIDS) != 0
&& (local_seteuid (getuid ()) != 0
|| local_setegid (getgid ()) != 0))
_exit (SPAWN_ERROR);
/* Execute the file actions. */
if (file_actions != NULL)
{
int cnt;
for (cnt = 0; cnt < file_actions->_used; ++cnt)
{
struct __spawn_action *action = &file_actions->_actions[cnt];
switch (action->tag)
{
case spawn_do_close:
if (close_not_cancel (action->action.close_action.fd) != 0)
/* Signal the error. */
_exit (SPAWN_ERROR);
break;
case spawn_do_open:
{
int new_fd = open_not_cancel (action->action.open_action.path,
action->action.open_action.oflag
| O_LARGEFILE,
action->action.open_action.mode);
if (new_fd == -1)
/* The 'open' call failed. */
_exit (SPAWN_ERROR);
/* Make sure the desired file descriptor is used. */
if (new_fd != action->action.open_action.fd)
{
if (dup2 (new_fd, action->action.open_action.fd)
!= action->action.open_action.fd)
/* The 'dup2' call failed. */
_exit (SPAWN_ERROR);
if (close_not_cancel (new_fd) != 0)
/* The 'close' call failed. */
_exit (SPAWN_ERROR);
}
}
break;
case spawn_do_dup2:
if (dup2 (action->action.dup2_action.fd,
action->action.dup2_action.newfd)
!= action->action.dup2_action.newfd)
/* The 'dup2' call failed. */
_exit (SPAWN_ERROR);
break;
}
}
}
if (! use_path || strchr (file, '/') != NULL)
{
/* The FILE parameter is actually a path. */
execve (file, argv, envp);
if (errno == ENOEXEC)
script_execute (file, argv, envp);
/* Oh, oh. 'execve' returns. This is bad. */
_exit (SPAWN_ERROR);
}
/* We have to search for FILE on the path. */
path = getenv ("PATH");
if (path == NULL)
{
#if HAVE_CONFSTR
/* There is no 'PATH' in the environment.
The default search path is the current directory
followed by the path 'confstr' returns for '_CS_PATH'. */
len = confstr (_CS_PATH, (char *) NULL, 0);
path = (char *) alloca (1 + len);
path[0] = ':';
(void) confstr (_CS_PATH, path + 1, len);
#else
/* Pretend that the PATH contains only the current directory. */
path = "";
#endif
}
len = strlen (file) + 1;
pathlen = strlen (path);
name = alloca (pathlen + len + 1);
/* Copy the file name at the top. */
name = (char *) memcpy (name + pathlen + 1, file, len);
/* And add the slash. */
*--name = '/';
p = path;
do
{
char *startp;
path = p;
p = strchrnul (path, ':');
if (p == path)
/* Two adjacent colons, or a colon at the beginning or the end
of 'PATH' means to search the current directory. */
startp = name + 1;
else
startp = (char *) memcpy (name - (p - path), path, p - path);
/* Try to execute this name. If it works, execv will not return. */
execve (startp, argv, envp);
if (errno == ENOEXEC)
script_execute (startp, argv, envp);
switch (errno)
{
case EACCES:
case ENOENT:
case ESTALE:
case ENOTDIR:
/* Those errors indicate the file is missing or not executable
by us, in which case we want to just try the next path
directory. */
break;
default:
/* Some other error means we found an executable file, but
something went wrong executing it; return the error to our
caller. */
_exit (SPAWN_ERROR);
}
}
while (*p++ != '\0');
/* Return with an error. */
_exit (SPAWN_ERROR);
}
#endif
recutils-1.5/lib/regex.h 0000644 0000000 0000000 00000062113 11703116215 012131 0000000 0000000 /* Definitions for data structures and routines for the regular
expression library.
Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2006, 2009-2012
Free Software Foundation, Inc.
This file is part of the GNU C Library.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _REGEX_H
#define _REGEX_H 1
#include
/* Allow the use in C++ code. */
#ifdef __cplusplus
extern "C" {
#endif
/* Define __USE_GNU_REGEX to declare GNU extensions that violate the
POSIX name space rules. */
#undef __USE_GNU_REGEX
#if (defined _GNU_SOURCE \
|| (!defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE \
&& !defined _XOPEN_SOURCE))
# define __USE_GNU_REGEX 1
#endif
#ifdef _REGEX_LARGE_OFFSETS
/* Use types and values that are wide enough to represent signed and
unsigned byte offsets in memory. This currently works only when
the regex code is used outside of the GNU C library; it is not yet
supported within glibc itself, and glibc users should not define
_REGEX_LARGE_OFFSETS. */
/* The type of the offset of a byte within a string.
For historical reasons POSIX 1003.1-2004 requires that regoff_t be
at least as wide as off_t. However, many common POSIX platforms set
regoff_t to the more-sensible ssize_t and the Open Group has
signalled its intention to change the requirement to be that
regoff_t be at least as wide as ptrdiff_t and ssize_t; see XBD ERN
60 (2005-08-25). We don't know of any hosts where ssize_t or
ptrdiff_t is wider than ssize_t, so ssize_t is safe. */
typedef ssize_t regoff_t;
/* The type of nonnegative object indexes. Traditionally, GNU regex
uses 'int' for these. Code that uses __re_idx_t should work
regardless of whether the type is signed. */
typedef size_t __re_idx_t;
/* The type of object sizes. */
typedef size_t __re_size_t;
/* The type of object sizes, in places where the traditional code
uses unsigned long int. */
typedef size_t __re_long_size_t;
#else
/* Use types that are binary-compatible with the traditional GNU regex
implementation, which mishandles strings longer than INT_MAX. */
typedef int regoff_t;
typedef int __re_idx_t;
typedef unsigned int __re_size_t;
typedef unsigned long int __re_long_size_t;
#endif
/* The following two types have to be signed and unsigned integer type
wide enough to hold a value of a pointer. For most ANSI compilers
ptrdiff_t and size_t should be likely OK. Still size of these two
types is 2 for Microsoft C. Ugh... */
typedef long int s_reg_t;
typedef unsigned long int active_reg_t;
/* The following bits are used to determine the regexp syntax we
recognize. The set/not-set meanings are chosen so that Emacs syntax
remains the value 0. The bits are given in alphabetical order, and
the definitions shifted by one from the previous bit; thus, when we
add or remove a bit, only one other definition need change. */
typedef unsigned long int reg_syntax_t;
#ifdef __USE_GNU_REGEX
/* If this bit is not set, then \ inside a bracket expression is literal.
If set, then such a \ quotes the following character. */
# define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
/* If this bit is not set, then + and ? are operators, and \+ and \? are
literals.
If set, then \+ and \? are operators and + and ? are literals. */
# define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
/* If this bit is set, then character classes are supported. They are:
[:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
[:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
If not set, then character classes are not supported. */
# define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
/* If this bit is set, then ^ and $ are always anchors (outside bracket
expressions, of course).
If this bit is not set, then it depends:
^ is an anchor if it is at the beginning of a regular
expression or after an open-group or an alternation operator;
$ is an anchor if it is at the end of a regular expression, or
before a close-group or an alternation operator.
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
POSIX draft 11.2 says that * etc. in leading positions is undefined.
We already implemented a previous draft which made those constructs
invalid, though, so we haven't changed the code back. */
# define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
/* If this bit is set, then special characters are always special
regardless of where they are in the pattern.
If this bit is not set, then special characters are special only in
some contexts; otherwise they are ordinary. Specifically,
* + ? and intervals are only special when not after the beginning,
open-group, or alternation operator. */
# define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
/* If this bit is set, then *, +, ?, and { cannot be first in an re or
immediately after an alternation or begin-group operator. */
# define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
/* If this bit is set, then . matches newline.
If not set, then it doesn't. */
# define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
/* If this bit is set, then . doesn't match NUL.
If not set, then it does. */
# define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
/* If this bit is set, nonmatching lists [^...] do not match newline.
If not set, they do. */
# define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
/* If this bit is set, either \{...\} or {...} defines an
interval, depending on RE_NO_BK_BRACES.
If not set, \{, \}, {, and } are literals. */
# define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
/* If this bit is set, +, ? and | aren't recognized as operators.
If not set, they are. */
# define RE_LIMITED_OPS (RE_INTERVALS << 1)
/* If this bit is set, newline is an alternation operator.
If not set, newline is literal. */
# define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
/* If this bit is set, then '{...}' defines an interval, and \{ and \}
are literals.
If not set, then '\{...\}' defines an interval. */
# define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
/* If this bit is set, (...) defines a group, and \( and \) are literals.
If not set, \(...\) defines a group, and ( and ) are literals. */
# define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
/* If this bit is set, then \ matches .
If not set, then \ is a back-reference. */
# define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
/* If this bit is set, then | is an alternation operator, and \| is literal.
If not set, then \| is an alternation operator, and | is literal. */
# define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
/* If this bit is set, then an ending range point collating higher
than the starting range point, as in [z-a], is invalid.
If not set, then when ending range point collates higher than the
starting range point, the range is ignored. */
# define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
/* If this bit is set, then an unmatched ) is ordinary.
If not set, then an unmatched ) is invalid. */
# define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
/* If this bit is set, succeed as soon as we match the whole pattern,
without further backtracking. */
# define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
/* If this bit is set, do not process the GNU regex operators.
If not set, then the GNU regex operators are recognized. */
# define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
/* If this bit is set, turn on internal regex debugging.
If not set, and debugging was on, turn it off.
This only works if regex.c is compiled -DDEBUG.
We define this bit always, so that all that's needed to turn on
debugging is to recompile regex.c; the calling code can always have
this bit set, and it won't affect anything in the normal case. */
# define RE_DEBUG (RE_NO_GNU_OPS << 1)
/* If this bit is set, a syntactically invalid interval is treated as
a string of ordinary characters. For example, the ERE 'a{1' is
treated as 'a\{1'. */
# define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
/* If this bit is set, then ignore case when matching.
If not set, then case is significant. */
# define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
/* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but only
for ^, because it is difficult to scan the regex backwards to find
whether ^ should be special. */
# define RE_CARET_ANCHORS_HERE (RE_ICASE << 1)
/* If this bit is set, then \{ cannot be first in a regex or
immediately after an alternation, open-group or \} operator. */
# define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1)
/* If this bit is set, then no_sub will be set to 1 during
re_compile_pattern. */
# define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)
#endif /* defined __USE_GNU_REGEX */
/* This global variable defines the particular regexp syntax to use (for
some interfaces). When a regexp is compiled, the syntax used is
stored in the pattern buffer, so changing this does not affect
already-compiled regexps. */
extern reg_syntax_t re_syntax_options;
#ifdef __USE_GNU_REGEX
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
don't delete them!) */
/* [[[begin syntaxes]]] */
# define RE_SYNTAX_EMACS 0
# define RE_SYNTAX_AWK \
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
| RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
| RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
# define RE_SYNTAX_GNU_AWK \
((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
& ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS \
| RE_CONTEXT_INVALID_OPS ))
# define RE_SYNTAX_POSIX_AWK \
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
| RE_INTERVALS | RE_NO_GNU_OPS)
# define RE_SYNTAX_GREP \
(RE_BK_PLUS_QM | RE_CHAR_CLASSES \
| RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
| RE_NEWLINE_ALT)
# define RE_SYNTAX_EGREP \
(RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
| RE_NEWLINE_ALT | RE_NO_BK_PARENS \
| RE_NO_BK_VBAR)
# define RE_SYNTAX_POSIX_EGREP \
(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES \
| RE_INVALID_INTERVAL_ORD)
/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
# define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
# define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
/* Syntax bits common to both basic and extended POSIX regex syntax. */
# define _RE_SYNTAX_POSIX_COMMON \
(RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
| RE_INTERVALS | RE_NO_EMPTY_RANGES)
# define RE_SYNTAX_POSIX_BASIC \
(_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP)
/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
isn't minimal, since other operators, such as \`, aren't disabled. */
# define RE_SYNTAX_POSIX_MINIMAL_BASIC \
(_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
# define RE_SYNTAX_POSIX_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \
| RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
removed and RE_NO_BK_REFS is added. */
# define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
/* [[[end syntaxes]]] */
#endif /* defined __USE_GNU_REGEX */
#ifdef __USE_GNU_REGEX
/* Maximum number of duplicates an interval can allow. POSIX-conforming
systems might define this in , but we want our
value, so remove any previous define. */
# ifdef RE_DUP_MAX
# undef RE_DUP_MAX
# endif
/* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored
the counter as a 2-byte signed integer. This is no longer true, so
RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to
((SIZE_MAX - 2) / 10 - 1) if _REGEX_LARGE_OFFSETS is defined.
However, there would be a huge performance problem if someone
actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains
its historical value. */
# define RE_DUP_MAX (0x7fff)
#endif /* defined __USE_GNU_REGEX */
/* POSIX 'cflags' bits (i.e., information for 'regcomp'). */
/* If this bit is set, then use extended regular expression syntax.
If not set, then use basic regular expression syntax. */
#define REG_EXTENDED 1
/* If this bit is set, then ignore case when matching.
If not set, then case is significant. */
#define REG_ICASE (1 << 1)
/* If this bit is set, then anchors do not match at newline
characters in the string.
If not set, then anchors do match at newlines. */
#define REG_NEWLINE (1 << 2)
/* If this bit is set, then report only success or fail in regexec.
If not set, then returns differ between not matching and errors. */
#define REG_NOSUB (1 << 3)
/* POSIX 'eflags' bits (i.e., information for regexec). */
/* If this bit is set, then the beginning-of-line operator doesn't match
the beginning of the string (presumably because it's not the
beginning of a line).
If not set, then the beginning-of-line operator does match the
beginning of the string. */
#define REG_NOTBOL 1
/* Like REG_NOTBOL, except for the end-of-line. */
#define REG_NOTEOL (1 << 1)
/* Use PMATCH[0] to delimit the start and end of the search in the
buffer. */
#define REG_STARTEND (1 << 2)
/* If any error codes are removed, changed, or added, update the
'__re_error_msgid' table in regcomp.c. */
typedef enum
{
_REG_ENOSYS = -1, /* This will never happen for this implementation. */
_REG_NOERROR = 0, /* Success. */
_REG_NOMATCH, /* Didn't find a match (for regexec). */
/* POSIX regcomp return error codes. (In the order listed in the
standard.) */
_REG_BADPAT, /* Invalid pattern. */
_REG_ECOLLATE, /* Invalid collating element. */
_REG_ECTYPE, /* Invalid character class name. */
_REG_EESCAPE, /* Trailing backslash. */
_REG_ESUBREG, /* Invalid back reference. */
_REG_EBRACK, /* Unmatched left bracket. */
_REG_EPAREN, /* Parenthesis imbalance. */
_REG_EBRACE, /* Unmatched \{. */
_REG_BADBR, /* Invalid contents of \{\}. */
_REG_ERANGE, /* Invalid range end. */
_REG_ESPACE, /* Ran out of memory. */
_REG_BADRPT, /* No preceding re for repetition op. */
/* Error codes we've added. */
_REG_EEND, /* Premature end. */
_REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
_REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
} reg_errcode_t;
#ifdef _XOPEN_SOURCE
# define REG_ENOSYS _REG_ENOSYS
#endif
#define REG_NOERROR _REG_NOERROR
#define REG_NOMATCH _REG_NOMATCH
#define REG_BADPAT _REG_BADPAT
#define REG_ECOLLATE _REG_ECOLLATE
#define REG_ECTYPE _REG_ECTYPE
#define REG_EESCAPE _REG_EESCAPE
#define REG_ESUBREG _REG_ESUBREG
#define REG_EBRACK _REG_EBRACK
#define REG_EPAREN _REG_EPAREN
#define REG_EBRACE _REG_EBRACE
#define REG_BADBR _REG_BADBR
#define REG_ERANGE _REG_ERANGE
#define REG_ESPACE _REG_ESPACE
#define REG_BADRPT _REG_BADRPT
#define REG_EEND _REG_EEND
#define REG_ESIZE _REG_ESIZE
#define REG_ERPAREN _REG_ERPAREN
/* struct re_pattern_buffer normally uses member names like 'buffer'
that POSIX does not allow. In POSIX mode these members have names
with leading 're_' (e.g., 're_buffer'). */
#ifdef __USE_GNU_REGEX
# define _REG_RE_NAME(id) id
# define _REG_RM_NAME(id) id
#else
# define _REG_RE_NAME(id) re_##id
# define _REG_RM_NAME(id) rm_##id
#endif
/* The user can specify the type of the re_translate member by
defining the macro RE_TRANSLATE_TYPE, which defaults to unsigned
char *. This pollutes the POSIX name space, so in POSIX mode just
use unsigned char *. */
#ifdef __USE_GNU_REGEX
# ifndef RE_TRANSLATE_TYPE
# define RE_TRANSLATE_TYPE unsigned char *
# endif
# define REG_TRANSLATE_TYPE RE_TRANSLATE_TYPE
#else
# define REG_TRANSLATE_TYPE unsigned char *
#endif
/* This data structure represents a compiled pattern. Before calling
the pattern compiler, the fields 'buffer', 'allocated', 'fastmap',
'translate', and 'no_sub' can be set. After the pattern has been
compiled, the 're_nsub' field is available. All other fields are
private to the regex routines. */
struct re_pattern_buffer
{
/* Space that holds the compiled pattern. It is declared as
'unsigned char *' because its elements are sometimes used as
array indexes. */
unsigned char *_REG_RE_NAME (buffer);
/* Number of bytes to which 'buffer' points. */
__re_long_size_t _REG_RE_NAME (allocated);
/* Number of bytes actually used in 'buffer'. */
__re_long_size_t _REG_RE_NAME (used);
/* Syntax setting with which the pattern was compiled. */
reg_syntax_t _REG_RE_NAME (syntax);
/* Pointer to a fastmap, if any, otherwise zero. re_search uses the
fastmap, if there is one, to skip over impossible starting points
for matches. */
char *_REG_RE_NAME (fastmap);
/* Either a translate table to apply to all characters before
comparing them, or zero for no translation. The translation is
applied to a pattern when it is compiled and to a string when it
is matched. */
REG_TRANSLATE_TYPE _REG_RE_NAME (translate);
/* Number of subexpressions found by the compiler. */
size_t re_nsub;
/* Zero if this pattern cannot match the empty string, one else.
Well, in truth it's used only in 're_search_2', to see whether or
not we should use the fastmap, so we don't set this absolutely
perfectly; see 're_compile_fastmap' (the "duplicate" case). */
unsigned int _REG_RE_NAME (can_be_null) : 1;
/* If REGS_UNALLOCATED, allocate space in the 'regs' structure
for 'max (RE_NREGS, re_nsub + 1)' groups.
If REGS_REALLOCATE, reallocate space if necessary.
If REGS_FIXED, use what's there. */
#ifdef __USE_GNU_REGEX
# define REGS_UNALLOCATED 0
# define REGS_REALLOCATE 1
# define REGS_FIXED 2
#endif
unsigned int _REG_RE_NAME (regs_allocated) : 2;
/* Set to zero when 're_compile_pattern' compiles a pattern; set to
one by 're_compile_fastmap' if it updates the fastmap. */
unsigned int _REG_RE_NAME (fastmap_accurate) : 1;
/* If set, 're_match_2' does not return information about
subexpressions. */
unsigned int _REG_RE_NAME (no_sub) : 1;
/* If set, a beginning-of-line anchor doesn't match at the beginning
of the string. */
unsigned int _REG_RE_NAME (not_bol) : 1;
/* Similarly for an end-of-line anchor. */
unsigned int _REG_RE_NAME (not_eol) : 1;
/* If true, an anchor at a newline matches. */
unsigned int _REG_RE_NAME (newline_anchor) : 1;
/* [[[end pattern_buffer]]] */
};
typedef struct re_pattern_buffer regex_t;
/* This is the structure we store register match data in. See
regex.texinfo for a full description of what registers match. */
struct re_registers
{
__re_size_t _REG_RM_NAME (num_regs);
regoff_t *_REG_RM_NAME (start);
regoff_t *_REG_RM_NAME (end);
};
/* If 'regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
're_match_2' returns information about at least this many registers
the first time a 'regs' structure is passed. */
#if !defined RE_NREGS && defined __USE_GNU_REGEX
# define RE_NREGS 30
#endif
/* POSIX specification for registers. Aside from the different names than
're_registers', POSIX uses an array of structures, instead of a
structure of arrays. */
typedef struct
{
regoff_t rm_so; /* Byte offset from string's start to substring's start. */
regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
} regmatch_t;
/* Declarations for routines. */
/* Sets the current default syntax to SYNTAX, and return the old syntax.
You can also simply assign to the 're_syntax_options' variable. */
extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax);
/* Compile the regular expression PATTERN, with length LENGTH
and syntax given by the global 're_syntax_options', into the buffer
BUFFER. Return NULL if successful, and an error string if not. */
extern const char *re_compile_pattern (const char *__pattern, size_t __length,
struct re_pattern_buffer *__buffer);
/* Compile a fastmap for the compiled pattern in BUFFER; used to
accelerate searches. Return 0 if successful and -2 if was an
internal error. */
extern int re_compile_fastmap (struct re_pattern_buffer *__buffer);
/* Search in the string STRING (with length LENGTH) for the pattern
compiled into BUFFER. Start searching at position START, for RANGE
characters. Return the starting position of the match, -1 for no
match, or -2 for an internal error. Also return register
information in REGS (if REGS and BUFFER->no_sub are nonzero). */
extern regoff_t re_search (struct re_pattern_buffer *__buffer,
const char *__string, __re_idx_t __length,
__re_idx_t __start, regoff_t __range,
struct re_registers *__regs);
/* Like 're_search', but search in the concatenation of STRING1 and
STRING2. Also, stop searching at index START + STOP. */
extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer,
const char *__string1, __re_idx_t __length1,
const char *__string2, __re_idx_t __length2,
__re_idx_t __start, regoff_t __range,
struct re_registers *__regs,
__re_idx_t __stop);
/* Like 're_search', but return how many characters in STRING the regexp
in BUFFER matched, starting at position START. */
extern regoff_t re_match (struct re_pattern_buffer *__buffer,
const char *__string, __re_idx_t __length,
__re_idx_t __start, struct re_registers *__regs);
/* Relates to 're_match' as 're_search_2' relates to 're_search'. */
extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer,
const char *__string1, __re_idx_t __length1,
const char *__string2, __re_idx_t __length2,
__re_idx_t __start, struct re_registers *__regs,
__re_idx_t __stop);
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
ENDS. Subsequent matches using BUFFER and REGS will use this memory
for recording register information. STARTS and ENDS must be
allocated with malloc, and must each be at least 'NUM_REGS * sizeof
(regoff_t)' bytes long.
If NUM_REGS == 0, then subsequent matches should allocate their own
register data.
Unless this function is called, the first search or match using
BUFFER will allocate its own register data, without freeing the old
data. */
extern void re_set_registers (struct re_pattern_buffer *__buffer,
struct re_registers *__regs,
__re_size_t __num_regs,
regoff_t *__starts, regoff_t *__ends);
#if defined _REGEX_RE_COMP || defined _LIBC
# ifndef _CRAY
/* 4.2 bsd compatibility. */
extern char *re_comp (const char *);
extern int re_exec (const char *);
# endif
#endif
/* GCC 2.95 and later have "__restrict"; C99 compilers have
"restrict", and "configure" may have defined "restrict".
Other compilers use __restrict, __restrict__, and _Restrict, and
'configure' might #define 'restrict' to those words, so pick a
different name. */
#ifndef _Restrict_
# if 199901L <= __STDC_VERSION__
# define _Restrict_ restrict
# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
# define _Restrict_ __restrict
# else
# define _Restrict_
# endif
#endif
/* gcc 3.1 and up support the [restrict] syntax. Don't trust
sys/cdefs.h's definition of __restrict_arr, though, as it
mishandles gcc -ansi -pedantic. */
#ifndef _Restrict_arr_
# if ((199901L <= __STDC_VERSION__ \
|| ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \
&& !defined __STRICT_ANSI__)) \
&& !defined __GNUG__)
# define _Restrict_arr_ _Restrict_
# else
# define _Restrict_arr_
# endif
#endif
/* POSIX compatibility. */
extern int regcomp (regex_t *_Restrict_ __preg,
const char *_Restrict_ __pattern,
int __cflags);
extern int regexec (const regex_t *_Restrict_ __preg,
const char *_Restrict_ __string, size_t __nmatch,
regmatch_t __pmatch[_Restrict_arr_],
int __eflags);
extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg,
char *_Restrict_ __errbuf, size_t __errbuf_size);
extern void regfree (regex_t *__preg);
#ifdef __cplusplus
}
#endif /* C++ */
#endif /* regex.h */
recutils-1.5/lib/c-ctype.h 0000644 0000000 0000000 00000022134 11703116213 012360 0000000 0000000 /* Character handling in C locale.
These functions work like the corresponding functions in ,
except that they have the C (POSIX) locale hardwired, whereas the
functions' behaviour depends on the current locale set via
setlocale.
Copyright (C) 2000-2003, 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 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef C_CTYPE_H
#define C_CTYPE_H
#include
#ifdef __cplusplus
extern "C" {
#endif
/* The functions defined in this file assume the "C" locale and a character
set without diacritics (ASCII-US or EBCDIC-US or something like that).
Even if the "C" locale on a particular system is an extension of the ASCII
character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it
is ISO-8859-1), the functions in this file recognize only the ASCII
characters. */
/* Check whether the ASCII optimizations apply. */
/* ANSI C89 (and ISO C99 5.2.1.3 too) already guarantees that
'0', '1', ..., '9' have consecutive integer values. */
#define C_CTYPE_CONSECUTIVE_DIGITS 1
#if ('A' <= 'Z') \
&& ('A' + 1 == 'B') && ('B' + 1 == 'C') && ('C' + 1 == 'D') \
&& ('D' + 1 == 'E') && ('E' + 1 == 'F') && ('F' + 1 == 'G') \
&& ('G' + 1 == 'H') && ('H' + 1 == 'I') && ('I' + 1 == 'J') \
&& ('J' + 1 == 'K') && ('K' + 1 == 'L') && ('L' + 1 == 'M') \
&& ('M' + 1 == 'N') && ('N' + 1 == 'O') && ('O' + 1 == 'P') \
&& ('P' + 1 == 'Q') && ('Q' + 1 == 'R') && ('R' + 1 == 'S') \
&& ('S' + 1 == 'T') && ('T' + 1 == 'U') && ('U' + 1 == 'V') \
&& ('V' + 1 == 'W') && ('W' + 1 == 'X') && ('X' + 1 == 'Y') \
&& ('Y' + 1 == 'Z')
#define C_CTYPE_CONSECUTIVE_UPPERCASE 1
#endif
#if ('a' <= 'z') \
&& ('a' + 1 == 'b') && ('b' + 1 == 'c') && ('c' + 1 == 'd') \
&& ('d' + 1 == 'e') && ('e' + 1 == 'f') && ('f' + 1 == 'g') \
&& ('g' + 1 == 'h') && ('h' + 1 == 'i') && ('i' + 1 == 'j') \
&& ('j' + 1 == 'k') && ('k' + 1 == 'l') && ('l' + 1 == 'm') \
&& ('m' + 1 == 'n') && ('n' + 1 == 'o') && ('o' + 1 == 'p') \
&& ('p' + 1 == 'q') && ('q' + 1 == 'r') && ('r' + 1 == 's') \
&& ('s' + 1 == 't') && ('t' + 1 == 'u') && ('u' + 1 == 'v') \
&& ('v' + 1 == 'w') && ('w' + 1 == 'x') && ('x' + 1 == 'y') \
&& ('y' + 1 == 'z')
#define C_CTYPE_CONSECUTIVE_LOWERCASE 1
#endif
#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
/* The character set is ASCII or one of its variants or extensions, not EBCDIC.
Testing the value of '\n' and '\r' is not relevant. */
#define C_CTYPE_ASCII 1
#endif
/* Function declarations. */
/* Unlike the functions in , which require an argument in the range
of the 'unsigned char' type, the functions here operate on values that are
in the 'unsigned char' range or in the 'char' range. In other words,
when you have a 'char' value, you need to cast it before using it as
argument to a function:
const char *s = ...;
if (isalpha ((unsigned char) *s)) ...
but you don't need to cast it for the functions defined in this file:
const char *s = ...;
if (c_isalpha (*s)) ...
*/
extern bool c_isascii (int c) _GL_ATTRIBUTE_CONST; /* not locale dependent */
extern bool c_isalnum (int c) _GL_ATTRIBUTE_CONST;
extern bool c_isalpha (int c) _GL_ATTRIBUTE_CONST;
extern bool c_isblank (int c) _GL_ATTRIBUTE_CONST;
extern bool c_iscntrl (int c) _GL_ATTRIBUTE_CONST;
extern bool c_isdigit (int c) _GL_ATTRIBUTE_CONST;
extern bool c_islower (int c) _GL_ATTRIBUTE_CONST;
extern bool c_isgraph (int c) _GL_ATTRIBUTE_CONST;
extern bool c_isprint (int c) _GL_ATTRIBUTE_CONST;
extern bool c_ispunct (int c) _GL_ATTRIBUTE_CONST;
extern bool c_isspace (int c) _GL_ATTRIBUTE_CONST;
extern bool c_isupper (int c) _GL_ATTRIBUTE_CONST;
extern bool c_isxdigit (int c) _GL_ATTRIBUTE_CONST;
extern int c_tolower (int c) _GL_ATTRIBUTE_CONST;
extern int c_toupper (int c) _GL_ATTRIBUTE_CONST;
#if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS
/* ASCII optimizations. */
#undef c_isascii
#define c_isascii(c) \
({ int __c = (c); \
(__c >= 0x00 && __c <= 0x7f); \
})
#if C_CTYPE_CONSECUTIVE_DIGITS \
&& C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
#if C_CTYPE_ASCII
#undef c_isalnum
#define c_isalnum(c) \
({ int __c = (c); \
((__c >= '0' && __c <= '9') \
|| ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z')); \
})
#else
#undef c_isalnum
#define c_isalnum(c) \
({ int __c = (c); \
((__c >= '0' && __c <= '9') \
|| (__c >= 'A' && __c <= 'Z') \
|| (__c >= 'a' && __c <= 'z')); \
})
#endif
#endif
#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
#if C_CTYPE_ASCII
#undef c_isalpha
#define c_isalpha(c) \
({ int __c = (c); \
((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z'); \
})
#else
#undef c_isalpha
#define c_isalpha(c) \
({ int __c = (c); \
((__c >= 'A' && __c <= 'Z') || (__c >= 'a' && __c <= 'z')); \
})
#endif
#endif
#undef c_isblank
#define c_isblank(c) \
({ int __c = (c); \
(__c == ' ' || __c == '\t'); \
})
#if C_CTYPE_ASCII
#undef c_iscntrl
#define c_iscntrl(c) \
({ int __c = (c); \
((__c & ~0x1f) == 0 || __c == 0x7f); \
})
#endif
#if C_CTYPE_CONSECUTIVE_DIGITS
#undef c_isdigit
#define c_isdigit(c) \
({ int __c = (c); \
(__c >= '0' && __c <= '9'); \
})
#endif
#if C_CTYPE_CONSECUTIVE_LOWERCASE
#undef c_islower
#define c_islower(c) \
({ int __c = (c); \
(__c >= 'a' && __c <= 'z'); \
})
#endif
#if C_CTYPE_ASCII
#undef c_isgraph
#define c_isgraph(c) \
({ int __c = (c); \
(__c >= '!' && __c <= '~'); \
})
#endif
#if C_CTYPE_ASCII
#undef c_isprint
#define c_isprint(c) \
({ int __c = (c); \
(__c >= ' ' && __c <= '~'); \
})
#endif
#if C_CTYPE_ASCII
#undef c_ispunct
#define c_ispunct(c) \
({ int _c = (c); \
(c_isgraph (_c) && ! c_isalnum (_c)); \
})
#endif
#undef c_isspace
#define c_isspace(c) \
({ int __c = (c); \
(__c == ' ' || __c == '\t' \
|| __c == '\n' || __c == '\v' || __c == '\f' || __c == '\r'); \
})
#if C_CTYPE_CONSECUTIVE_UPPERCASE
#undef c_isupper
#define c_isupper(c) \
({ int __c = (c); \
(__c >= 'A' && __c <= 'Z'); \
})
#endif
#if C_CTYPE_CONSECUTIVE_DIGITS \
&& C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
#if C_CTYPE_ASCII
#undef c_isxdigit
#define c_isxdigit(c) \
({ int __c = (c); \
((__c >= '0' && __c <= '9') \
|| ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'F')); \
})
#else
#undef c_isxdigit
#define c_isxdigit(c) \
({ int __c = (c); \
((__c >= '0' && __c <= '9') \
|| (__c >= 'A' && __c <= 'F') \
|| (__c >= 'a' && __c <= 'f')); \
})
#endif
#endif
#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
#undef c_tolower
#define c_tolower(c) \
({ int __c = (c); \
(__c >= 'A' && __c <= 'Z' ? __c - 'A' + 'a' : __c); \
})
#undef c_toupper
#define c_toupper(c) \
({ int __c = (c); \
(__c >= 'a' && __c <= 'z' ? __c - 'a' + 'A' : __c); \
})
#endif
#endif /* optimizing for speed */
#ifdef __cplusplus
}
#endif
#endif /* C_CTYPE_H */
recutils-1.5/lib/progname.h 0000644 0000000 0000000 00000003737 11703116215 012636 0000000 0000000 /* Program name management.
Copyright (C) 2001-2004, 2006, 2009-2012 Free Software Foundation, Inc.
Written by Bruno Haible , 2001.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#ifndef _PROGNAME_H
#define _PROGNAME_H
/* Programs using this file should do the following in main():
set_program_name (argv[0]);
*/
#ifdef __cplusplus
extern "C" {
#endif
/* String containing name the program is called with. */
extern const char *program_name;
/* Set program_name, based on argv[0].
argv0 must be a string allocated with indefinite extent, and must not be
modified after this call. */
extern void set_program_name (const char *argv0);
#if ENABLE_RELOCATABLE
/* Set program_name, based on argv[0], and original installation prefix and
directory, for relocatability. */
extern void set_program_name_and_installdir (const char *argv0,
const char *orig_installprefix,
const char *orig_installdir);
#undef set_program_name
#define set_program_name(ARG0) \
set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR)
/* Return the full pathname of the current executable, based on the earlier
call to set_program_name_and_installdir. Return NULL if unknown. */
extern char *get_full_program_name (void);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _PROGNAME_H */
recutils-1.5/lib/rawmemchr.c 0000644 0000000 0000000 00000012201 11703116215 012770 0000000 0000000 /* Searching in a string.
Copyright (C) 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 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#include
/* Specification. */
#include
/* Find the first occurrence of C in S. */
void *
rawmemchr (const void *s, int c_in)
{
/* On 32-bit hardware, choosing longword to be a 32-bit unsigned
long instead of a 64-bit uintmax_t tends to give better
performance. On 64-bit hardware, unsigned long is generally 64
bits already. Change this typedef to experiment with
performance. */
typedef unsigned long int longword;
const unsigned char *char_ptr;
const longword *longword_ptr;
longword repeated_one;
longword repeated_c;
unsigned char c;
c = (unsigned char) c_in;
/* Handle the first few bytes by reading one byte at a time.
Do this until CHAR_PTR is aligned on a longword boundary. */
for (char_ptr = (const unsigned char *) s;
(size_t) char_ptr % sizeof (longword) != 0;
++char_ptr)
if (*char_ptr == c)
return (void *) char_ptr;
longword_ptr = (const longword *) char_ptr;
/* All these elucidatory comments refer to 4-byte longwords,
but the theory applies equally well to any size longwords. */
/* Compute auxiliary longword values:
repeated_one is a value which has a 1 in every byte.
repeated_c has c in every byte. */
repeated_one = 0x01010101;
repeated_c = c | (c << 8);
repeated_c |= repeated_c << 16;
if (0xffffffffU < (longword) -1)
{
repeated_one |= repeated_one << 31 << 1;
repeated_c |= repeated_c << 31 << 1;
if (8 < sizeof (longword))
{
size_t i;
for (i = 64; i < sizeof (longword) * 8; i *= 2)
{
repeated_one |= repeated_one << i;
repeated_c |= repeated_c << i;
}
}
}
/* Instead of the traditional loop which tests each byte, we will
test a longword at a time. The tricky part is testing if *any of
the four* bytes in the longword in question are equal to NUL or
c. We first use an xor with repeated_c. This reduces the task
to testing whether *any of the four* bytes in longword1 is zero.
We compute tmp =
((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
That is, we perform the following operations:
1. Subtract repeated_one.
2. & ~longword1.
3. & a mask consisting of 0x80 in every byte.
Consider what happens in each byte:
- If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
and step 3 transforms it into 0x80. A carry can also be propagated
to more significant bytes.
- If a byte of longword1 is nonzero, let its lowest 1 bit be at
position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
the byte ends in a single bit of value 0 and k bits of value 1.
After step 2, the result is just k bits of value 1: 2^k - 1. After
step 3, the result is 0. And no carry is produced.
So, if longword1 has only non-zero bytes, tmp is zero.
Whereas if longword1 has a zero byte, call j the position of the least
significant zero byte. Then the result has a zero at positions 0, ...,
j-1 and a 0x80 at position j. We cannot predict the result at the more
significant bytes (positions j+1..3), but it does not matter since we
already have a non-zero bit at position 8*j+7.
The test whether any byte in longword1 is zero is equivalent
to testing whether tmp is nonzero.
This test can read beyond the end of a string, depending on where
C_IN is encountered. However, this is considered safe since the
initialization phase ensured that the read will be aligned,
therefore, the read will not cross page boundaries and will not
cause a fault. */
while (1)
{
longword longword1 = *longword_ptr ^ repeated_c;
if ((((longword1 - repeated_one) & ~longword1)
& (repeated_one << 7)) != 0)
break;
longword_ptr++;
}
char_ptr = (const unsigned char *) longword_ptr;
/* At this point, we know that one of the sizeof (longword) bytes
starting at char_ptr is == c. On little-endian machines, we
could determine the first such byte without any further memory
accesses, just by looking at the tmp result from the last loop
iteration. But this does not work on big-endian machines.
Choose code that works in both cases. */
char_ptr = (unsigned char *) longword_ptr;
while (*char_ptr != c)
char_ptr++;
return (void *) char_ptr;
}
recutils-1.5/lib/spawn_faction_addopen.c 0000644 0000000 0000000 00000004320 11703116215 015333 0000000 0000000 /* Copyright (C) 2000, 2009-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#include
/* Specification. */
#include
#include
#include
#if !_LIBC
# define __sysconf(open_max) getdtablesize ()
#endif
#if !HAVE_WORKING_POSIX_SPAWN
# include "spawn_int.h"
#endif
/* Add an action to FILE-ACTIONS which tells the implementation to call
'open' for the given file during the 'spawn' call. */
int
posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *file_actions,
int fd, const char *path, int oflag,
mode_t mode)
#undef posix_spawn_file_actions_addopen
{
int maxfd = __sysconf (_SC_OPEN_MAX);
/* Test for the validity of the file descriptor. */
if (fd < 0 || fd >= maxfd)
return EBADF;
#if HAVE_WORKING_POSIX_SPAWN
return posix_spawn_file_actions_addopen (file_actions, fd, path, oflag, mode);
#else
/* Allocate more memory if needed. */
if (file_actions->_used == file_actions->_allocated
&& __posix_spawn_file_actions_realloc (file_actions) != 0)
/* This can only mean we ran out of memory. */
return ENOMEM;
{
struct __spawn_action *rec;
/* Add the new value. */
rec = &file_actions->_actions[file_actions->_used];
rec->tag = spawn_do_open;
rec->action.open_action.fd = fd;
rec->action.open_action.path = path;
rec->action.open_action.oflag = oflag;
rec->action.open_action.mode = mode;
/* Account for the new entry. */
++file_actions->_used;
return 0;
}
#endif
}
recutils-1.5/lib/regex_internal.h 0000644 0000000 0000000 00000056542 11703116215 014036 0000000 0000000 /* Extended regular expression matching and search library.
Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa .
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _REGEX_INTERNAL_H
#define _REGEX_INTERNAL_H 1
#include
#include
#include
#include
#include
#include
#include
#ifndef _LIBC
# include "localcharset.h"
#endif
#include
#include
#include
#include
#if defined _LIBC
# include
#else
# define __libc_lock_init(NAME) do { } while (0)
# define __libc_lock_lock(NAME) do { } while (0)
# define __libc_lock_unlock(NAME) do { } while (0)
#endif
/* In case that the system doesn't have isblank(). */
#if !defined _LIBC && ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK))
# define isblank(ch) ((ch) == ' ' || (ch) == '\t')
#endif
#ifdef _LIBC
# ifndef _RE_DEFINE_LOCALE_FUNCTIONS
# define _RE_DEFINE_LOCALE_FUNCTIONS 1
# include
# include
# include
# endif
#endif
/* This is for other GNU distributions with internationalized messages. */
#if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
# include
# ifdef _LIBC
# undef gettext
# define gettext(msgid) \
INTUSE(__dcgettext) (_libc_intl_domainname, msgid, LC_MESSAGES)
# endif
#else
# define gettext(msgid) (msgid)
#endif
#ifndef gettext_noop
/* This define is so xgettext can find the internationalizable
strings. */
# define gettext_noop(String) String
#endif
/* For loser systems without the definition. */
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
#endif
#if (defined MB_CUR_MAX && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCSCOLL) || _LIBC
# define RE_ENABLE_I18N
#endif
#if __GNUC__ >= 3
# define BE(expr, val) __builtin_expect (expr, val)
#else
# define BE(expr, val) (expr)
# ifdef _LIBC
# define inline
# endif
#endif
/* Number of ASCII characters. */
#define ASCII_CHARS 0x80
/* Number of single byte characters. */
#define SBC_MAX (UCHAR_MAX + 1)
#define COLL_ELEM_LEN_MAX 8
/* The character which represents newline. */
#define NEWLINE_CHAR '\n'
#define WIDE_NEWLINE_CHAR L'\n'
/* Rename to standard API for using out of glibc. */
#ifndef _LIBC
# define __wctype wctype
# define __iswctype iswctype
# define __btowc btowc
# define __wcrtomb wcrtomb
# define __mbrtowc mbrtowc
# define __regfree regfree
# define attribute_hidden
#endif /* not _LIBC */
#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
# define __attribute(arg) __attribute__ (arg)
#else
# define __attribute(arg)
#endif
typedef __re_idx_t Idx;
/* Special return value for failure to match. */
#define REG_MISSING ((Idx) -1)
/* Special return value for internal error. */
#define REG_ERROR ((Idx) -2)
/* Test whether N is a valid index, and is not one of the above. */
#ifdef _REGEX_LARGE_OFFSETS
# define REG_VALID_INDEX(n) ((Idx) (n) < REG_ERROR)
#else
# define REG_VALID_INDEX(n) (0 <= (n))
#endif
/* Test whether N is a valid nonzero index. */
#ifdef _REGEX_LARGE_OFFSETS
# define REG_VALID_NONZERO_INDEX(n) ((Idx) ((n) - 1) < (Idx) (REG_ERROR - 1))
#else
# define REG_VALID_NONZERO_INDEX(n) (0 < (n))
#endif
/* A hash value, suitable for computing hash tables. */
typedef __re_size_t re_hashval_t;
/* An integer used to represent a set of bits. It must be unsigned,
and must be at least as wide as unsigned int. */
typedef unsigned long int bitset_word_t;
/* All bits set in a bitset_word_t. */
#define BITSET_WORD_MAX ULONG_MAX
/* Number of bits in a bitset_word_t. For portability to hosts with
padding bits, do not use '(sizeof (bitset_word_t) * CHAR_BIT)';
instead, deduce it directly from BITSET_WORD_MAX. Avoid
greater-than-32-bit integers and unconditional shifts by more than
31 bits, as they're not portable. */
#if BITSET_WORD_MAX == 0xffffffffUL
# define BITSET_WORD_BITS 32
#elif BITSET_WORD_MAX >> 31 >> 4 == 1
# define BITSET_WORD_BITS 36
#elif BITSET_WORD_MAX >> 31 >> 16 == 1
# define BITSET_WORD_BITS 48
#elif BITSET_WORD_MAX >> 31 >> 28 == 1
# define BITSET_WORD_BITS 60
#elif BITSET_WORD_MAX >> 31 >> 31 >> 1 == 1
# define BITSET_WORD_BITS 64
#elif BITSET_WORD_MAX >> 31 >> 31 >> 9 == 1
# define BITSET_WORD_BITS 72
#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 3 == 1
# define BITSET_WORD_BITS 128
#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 7 == 1
# define BITSET_WORD_BITS 256
#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 7 > 1
# define BITSET_WORD_BITS 257 /* any value > SBC_MAX will do here */
# if BITSET_WORD_BITS <= SBC_MAX
# error "Invalid SBC_MAX"
# endif
#else
# error "Add case for new bitset_word_t size"
#endif
/* Number of bitset_word_t values in a bitset_t. */
#define BITSET_WORDS ((SBC_MAX + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)
typedef bitset_word_t bitset_t[BITSET_WORDS];
typedef bitset_word_t *re_bitset_ptr_t;
typedef const bitset_word_t *re_const_bitset_ptr_t;
#define PREV_WORD_CONSTRAINT 0x0001
#define PREV_NOTWORD_CONSTRAINT 0x0002
#define NEXT_WORD_CONSTRAINT 0x0004
#define NEXT_NOTWORD_CONSTRAINT 0x0008
#define PREV_NEWLINE_CONSTRAINT 0x0010
#define NEXT_NEWLINE_CONSTRAINT 0x0020
#define PREV_BEGBUF_CONSTRAINT 0x0040
#define NEXT_ENDBUF_CONSTRAINT 0x0080
#define WORD_DELIM_CONSTRAINT 0x0100
#define NOT_WORD_DELIM_CONSTRAINT 0x0200
typedef enum
{
INSIDE_WORD = PREV_WORD_CONSTRAINT | NEXT_WORD_CONSTRAINT,
WORD_FIRST = PREV_NOTWORD_CONSTRAINT | NEXT_WORD_CONSTRAINT,
WORD_LAST = PREV_WORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT,
INSIDE_NOTWORD = PREV_NOTWORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT,
LINE_FIRST = PREV_NEWLINE_CONSTRAINT,
LINE_LAST = NEXT_NEWLINE_CONSTRAINT,
BUF_FIRST = PREV_BEGBUF_CONSTRAINT,
BUF_LAST = NEXT_ENDBUF_CONSTRAINT,
WORD_DELIM = WORD_DELIM_CONSTRAINT,
NOT_WORD_DELIM = NOT_WORD_DELIM_CONSTRAINT
} re_context_type;
typedef struct
{
Idx alloc;
Idx nelem;
Idx *elems;
} re_node_set;
typedef enum
{
NON_TYPE = 0,
/* Node type, These are used by token, node, tree. */
CHARACTER = 1,
END_OF_RE = 2,
SIMPLE_BRACKET = 3,
OP_BACK_REF = 4,
OP_PERIOD = 5,
#ifdef RE_ENABLE_I18N
COMPLEX_BRACKET = 6,
OP_UTF8_PERIOD = 7,
#endif /* RE_ENABLE_I18N */
/* We define EPSILON_BIT as a macro so that OP_OPEN_SUBEXP is used
when the debugger shows values of this enum type. */
#define EPSILON_BIT 8
OP_OPEN_SUBEXP = EPSILON_BIT | 0,
OP_CLOSE_SUBEXP = EPSILON_BIT | 1,
OP_ALT = EPSILON_BIT | 2,
OP_DUP_ASTERISK = EPSILON_BIT | 3,
ANCHOR = EPSILON_BIT | 4,
/* Tree type, these are used only by tree. */
CONCAT = 16,
SUBEXP = 17,
/* Token type, these are used only by token. */
OP_DUP_PLUS = 18,
OP_DUP_QUESTION,
OP_OPEN_BRACKET,
OP_CLOSE_BRACKET,
OP_CHARSET_RANGE,
OP_OPEN_DUP_NUM,
OP_CLOSE_DUP_NUM,
OP_NON_MATCH_LIST,
OP_OPEN_COLL_ELEM,
OP_CLOSE_COLL_ELEM,
OP_OPEN_EQUIV_CLASS,
OP_CLOSE_EQUIV_CLASS,
OP_OPEN_CHAR_CLASS,
OP_CLOSE_CHAR_CLASS,
OP_WORD,
OP_NOTWORD,
OP_SPACE,
OP_NOTSPACE,
BACK_SLASH
} re_token_type_t;
#ifdef RE_ENABLE_I18N
typedef struct
{
/* Multibyte characters. */
wchar_t *mbchars;
/* Collating symbols. */
# ifdef _LIBC
int32_t *coll_syms;
# endif
/* Equivalence classes. */
# ifdef _LIBC
int32_t *equiv_classes;
# endif
/* Range expressions. */
# ifdef _LIBC
uint32_t *range_starts;
uint32_t *range_ends;
# else /* not _LIBC */
wchar_t *range_starts;
wchar_t *range_ends;
# endif /* not _LIBC */
/* Character classes. */
wctype_t *char_classes;
/* If this character set is the non-matching list. */
unsigned int non_match : 1;
/* # of multibyte characters. */
Idx nmbchars;
/* # of collating symbols. */
Idx ncoll_syms;
/* # of equivalence classes. */
Idx nequiv_classes;
/* # of range expressions. */
Idx nranges;
/* # of character classes. */
Idx nchar_classes;
} re_charset_t;
#endif /* RE_ENABLE_I18N */
typedef struct
{
union
{
unsigned char c; /* for CHARACTER */
re_bitset_ptr_t sbcset; /* for SIMPLE_BRACKET */
#ifdef RE_ENABLE_I18N
re_charset_t *mbcset; /* for COMPLEX_BRACKET */
#endif /* RE_ENABLE_I18N */
Idx idx; /* for BACK_REF */
re_context_type ctx_type; /* for ANCHOR */
} opr;
#if __GNUC__ >= 2 && !defined __STRICT_ANSI__
re_token_type_t type : 8;
#else
re_token_type_t type;
#endif
unsigned int constraint : 10; /* context constraint */
unsigned int duplicated : 1;
unsigned int opt_subexp : 1;
#ifdef RE_ENABLE_I18N
unsigned int accept_mb : 1;
/* These 2 bits can be moved into the union if needed (e.g. if running out
of bits; move opr.c to opr.c.c and move the flags to opr.c.flags). */
unsigned int mb_partial : 1;
#endif
unsigned int word_char : 1;
} re_token_t;
#define IS_EPSILON_NODE(type) ((type) & EPSILON_BIT)
struct re_string_t
{
/* Indicate the raw buffer which is the original string passed as an
argument of regexec(), re_search(), etc.. */
const unsigned char *raw_mbs;
/* Store the multibyte string. In case of "case insensitive mode" like
REG_ICASE, upper cases of the string are stored, otherwise MBS points
the same address that RAW_MBS points. */
unsigned char *mbs;
#ifdef RE_ENABLE_I18N
/* Store the wide character string which is corresponding to MBS. */
wint_t *wcs;
Idx *offsets;
mbstate_t cur_state;
#endif
/* Index in RAW_MBS. Each character mbs[i] corresponds to
raw_mbs[raw_mbs_idx + i]. */
Idx raw_mbs_idx;
/* The length of the valid characters in the buffers. */
Idx valid_len;
/* The corresponding number of bytes in raw_mbs array. */
Idx valid_raw_len;
/* The length of the buffers MBS and WCS. */
Idx bufs_len;
/* The index in MBS, which is updated by re_string_fetch_byte. */
Idx cur_idx;
/* length of RAW_MBS array. */
Idx raw_len;
/* This is RAW_LEN - RAW_MBS_IDX + VALID_LEN - VALID_RAW_LEN. */
Idx len;
/* End of the buffer may be shorter than its length in the cases such
as re_match_2, re_search_2. Then, we use STOP for end of the buffer
instead of LEN. */
Idx raw_stop;
/* This is RAW_STOP - RAW_MBS_IDX adjusted through OFFSETS. */
Idx stop;
/* The context of mbs[0]. We store the context independently, since
the context of mbs[0] may be different from raw_mbs[0], which is
the beginning of the input string. */
unsigned int tip_context;
/* The translation passed as a part of an argument of re_compile_pattern. */
RE_TRANSLATE_TYPE trans;
/* Copy of re_dfa_t's word_char. */
re_const_bitset_ptr_t word_char;
/* true if REG_ICASE. */
unsigned char icase;
unsigned char is_utf8;
unsigned char map_notascii;
unsigned char mbs_allocated;
unsigned char offsets_needed;
unsigned char newline_anchor;
unsigned char word_ops_used;
int mb_cur_max;
};
typedef struct re_string_t re_string_t;
struct re_dfa_t;
typedef struct re_dfa_t re_dfa_t;
#ifndef _LIBC
# define internal_function
#endif
static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr,
Idx new_buf_len)
internal_function;
#ifdef RE_ENABLE_I18N
static void build_wcs_buffer (re_string_t *pstr) internal_function;
static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr)
internal_function;
#endif /* RE_ENABLE_I18N */
static void build_upper_buffer (re_string_t *pstr) internal_function;
static void re_string_translate_buffer (re_string_t *pstr) internal_function;
static unsigned int re_string_context_at (const re_string_t *input, Idx idx,
int eflags)
internal_function __attribute ((pure));
#define re_string_peek_byte(pstr, offset) \
((pstr)->mbs[(pstr)->cur_idx + offset])
#define re_string_fetch_byte(pstr) \
((pstr)->mbs[(pstr)->cur_idx++])
#define re_string_first_byte(pstr, idx) \
((idx) == (pstr)->valid_len || (pstr)->wcs[idx] != WEOF)
#define re_string_is_single_byte_char(pstr, idx) \
((pstr)->wcs[idx] != WEOF && ((pstr)->valid_len == (idx) + 1 \
|| (pstr)->wcs[(idx) + 1] != WEOF))
#define re_string_eoi(pstr) ((pstr)->stop <= (pstr)->cur_idx)
#define re_string_cur_idx(pstr) ((pstr)->cur_idx)
#define re_string_get_buffer(pstr) ((pstr)->mbs)
#define re_string_length(pstr) ((pstr)->len)
#define re_string_byte_at(pstr,idx) ((pstr)->mbs[idx])
#define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
#define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
#include
#ifndef _LIBC
# if HAVE_ALLOCA
/* The OS usually guarantees only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
allocate anything larger than 4096 bytes. Also care for the possibility
of a few compiler-allocated temporary stack slots. */
# define __libc_use_alloca(n) ((n) < 4032)
# else
/* alloca is implemented with malloc, so just use malloc. */
# define __libc_use_alloca(n) 0
# undef alloca
# define alloca(n) malloc (n)
# endif
#endif
#ifndef MAX
# define MAX(a,b) ((a) < (b) ? (b) : (a))
#endif
#define re_malloc(t,n) ((t *) malloc ((n) * sizeof (t)))
#define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t)))
#define re_free(p) free (p)
struct bin_tree_t
{
struct bin_tree_t *parent;
struct bin_tree_t *left;
struct bin_tree_t *right;
struct bin_tree_t *first;
struct bin_tree_t *next;
re_token_t token;
/* 'node_idx' is the index in dfa->nodes, if 'type' == 0.
Otherwise 'type' indicate the type of this node. */
Idx node_idx;
};
typedef struct bin_tree_t bin_tree_t;
#define BIN_TREE_STORAGE_SIZE \
((1024 - sizeof (void *)) / sizeof (bin_tree_t))
struct bin_tree_storage_t
{
struct bin_tree_storage_t *next;
bin_tree_t data[BIN_TREE_STORAGE_SIZE];
};
typedef struct bin_tree_storage_t bin_tree_storage_t;
#define CONTEXT_WORD 1
#define CONTEXT_NEWLINE (CONTEXT_WORD << 1)
#define CONTEXT_BEGBUF (CONTEXT_NEWLINE << 1)
#define CONTEXT_ENDBUF (CONTEXT_BEGBUF << 1)
#define IS_WORD_CONTEXT(c) ((c) & CONTEXT_WORD)
#define IS_NEWLINE_CONTEXT(c) ((c) & CONTEXT_NEWLINE)
#define IS_BEGBUF_CONTEXT(c) ((c) & CONTEXT_BEGBUF)
#define IS_ENDBUF_CONTEXT(c) ((c) & CONTEXT_ENDBUF)
#define IS_ORDINARY_CONTEXT(c) ((c) == 0)
#define IS_WORD_CHAR(ch) (isalnum (ch) || (ch) == '_')
#define IS_NEWLINE(ch) ((ch) == NEWLINE_CHAR)
#define IS_WIDE_WORD_CHAR(ch) (iswalnum (ch) || (ch) == L'_')
#define IS_WIDE_NEWLINE(ch) ((ch) == WIDE_NEWLINE_CHAR)
#define NOT_SATISFY_PREV_CONSTRAINT(constraint,context) \
((((constraint) & PREV_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
|| ((constraint & PREV_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
|| ((constraint & PREV_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context))\
|| ((constraint & PREV_BEGBUF_CONSTRAINT) && !IS_BEGBUF_CONTEXT (context)))
#define NOT_SATISFY_NEXT_CONSTRAINT(constraint,context) \
((((constraint) & NEXT_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
|| (((constraint) & NEXT_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
|| (((constraint) & NEXT_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context)) \
|| (((constraint) & NEXT_ENDBUF_CONSTRAINT) && !IS_ENDBUF_CONTEXT (context)))
struct re_dfastate_t
{
re_hashval_t hash;
re_node_set nodes;
re_node_set non_eps_nodes;
re_node_set inveclosure;
re_node_set *entrance_nodes;
struct re_dfastate_t **trtable, **word_trtable;
unsigned int context : 4;
unsigned int halt : 1;
/* If this state can accept "multi byte".
Note that we refer to multibyte characters, and multi character
collating elements as "multi byte". */
unsigned int accept_mb : 1;
/* If this state has backreference node(s). */
unsigned int has_backref : 1;
unsigned int has_constraint : 1;
};
typedef struct re_dfastate_t re_dfastate_t;
struct re_state_table_entry
{
Idx num;
Idx alloc;
re_dfastate_t **array;
};
/* Array type used in re_sub_match_last_t and re_sub_match_top_t. */
typedef struct
{
Idx next_idx;
Idx alloc;
re_dfastate_t **array;
} state_array_t;
/* Store information about the node NODE whose type is OP_CLOSE_SUBEXP. */
typedef struct
{
Idx node;
Idx str_idx; /* The position NODE match at. */
state_array_t path;
} re_sub_match_last_t;
/* Store information about the node NODE whose type is OP_OPEN_SUBEXP.
And information about the node, whose type is OP_CLOSE_SUBEXP,
corresponding to NODE is stored in LASTS. */
typedef struct
{
Idx str_idx;
Idx node;
state_array_t *path;
Idx alasts; /* Allocation size of LASTS. */
Idx nlasts; /* The number of LASTS. */
re_sub_match_last_t **lasts;
} re_sub_match_top_t;
struct re_backref_cache_entry
{
Idx node;
Idx str_idx;
Idx subexp_from;
Idx subexp_to;
char more;
char unused;
unsigned short int eps_reachable_subexps_map;
};
typedef struct
{
/* The string object corresponding to the input string. */
re_string_t input;
#if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
const re_dfa_t *const dfa;
#else
const re_dfa_t *dfa;
#endif
/* EFLAGS of the argument of regexec. */
int eflags;
/* Where the matching ends. */
Idx match_last;
Idx last_node;
/* The state log used by the matcher. */
re_dfastate_t **state_log;
Idx state_log_top;
/* Back reference cache. */
Idx nbkref_ents;
Idx abkref_ents;
struct re_backref_cache_entry *bkref_ents;
int max_mb_elem_len;
Idx nsub_tops;
Idx asub_tops;
re_sub_match_top_t **sub_tops;
} re_match_context_t;
typedef struct
{
re_dfastate_t **sifted_states;
re_dfastate_t **limited_states;
Idx last_node;
Idx last_str_idx;
re_node_set limits;
} re_sift_context_t;
struct re_fail_stack_ent_t
{
Idx idx;
Idx node;
regmatch_t *regs;
re_node_set eps_via_nodes;
};
struct re_fail_stack_t
{
Idx num;
Idx alloc;
struct re_fail_stack_ent_t *stack;
};
struct re_dfa_t
{
re_token_t *nodes;
size_t nodes_alloc;
size_t nodes_len;
Idx *nexts;
Idx *org_indices;
re_node_set *edests;
re_node_set *eclosures;
re_node_set *inveclosures;
struct re_state_table_entry *state_table;
re_dfastate_t *init_state;
re_dfastate_t *init_state_word;
re_dfastate_t *init_state_nl;
re_dfastate_t *init_state_begbuf;
bin_tree_t *str_tree;
bin_tree_storage_t *str_tree_storage;
re_bitset_ptr_t sb_char;
int str_tree_storage_idx;
/* number of subexpressions 're_nsub' is in regex_t. */
re_hashval_t state_hash_mask;
Idx init_node;
Idx nbackref; /* The number of backreference in this dfa. */
/* Bitmap expressing which backreference is used. */
bitset_word_t used_bkref_map;
bitset_word_t completed_bkref_map;
unsigned int has_plural_match : 1;
/* If this dfa has "multibyte node", which is a backreference or
a node which can accept multibyte character or multi character
collating element. */
unsigned int has_mb_node : 1;
unsigned int is_utf8 : 1;
unsigned int map_notascii : 1;
unsigned int word_ops_used : 1;
int mb_cur_max;
bitset_t word_char;
reg_syntax_t syntax;
Idx *subexp_map;
#ifdef DEBUG
char* re_str;
#endif
#ifdef _LIBC
__libc_lock_define (, lock)
#endif
};
#define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))
#define re_node_set_remove(set,id) \
(re_node_set_remove_at (set, re_node_set_contains (set, id) - 1))
#define re_node_set_empty(p) ((p)->nelem = 0)
#define re_node_set_free(set) re_free ((set)->elems)
typedef enum
{
SB_CHAR,
MB_CHAR,
EQUIV_CLASS,
COLL_SYM,
CHAR_CLASS
} bracket_elem_type;
typedef struct
{
bracket_elem_type type;
union
{
unsigned char ch;
unsigned char *name;
wchar_t wch;
} opr;
} bracket_elem_t;
/* Inline functions for bitset_t operation. */
static inline void
bitset_set (bitset_t set, Idx i)
{
set[i / BITSET_WORD_BITS] |= (bitset_word_t) 1 << i % BITSET_WORD_BITS;
}
static inline void
bitset_clear (bitset_t set, Idx i)
{
set[i / BITSET_WORD_BITS] &= ~ ((bitset_word_t) 1 << i % BITSET_WORD_BITS);
}
static inline bool
bitset_contain (const bitset_t set, Idx i)
{
return (set[i / BITSET_WORD_BITS] >> i % BITSET_WORD_BITS) & 1;
}
static inline void
bitset_empty (bitset_t set)
{
memset (set, '\0', sizeof (bitset_t));
}
static inline void
bitset_set_all (bitset_t set)
{
memset (set, -1, sizeof (bitset_word_t) * (SBC_MAX / BITSET_WORD_BITS));
if (SBC_MAX % BITSET_WORD_BITS != 0)
set[BITSET_WORDS - 1] =
((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1;
}
static inline void
bitset_copy (bitset_t dest, const bitset_t src)
{
memcpy (dest, src, sizeof (bitset_t));
}
static inline void
bitset_not (bitset_t set)
{
int bitset_i;
for (bitset_i = 0; bitset_i < SBC_MAX / BITSET_WORD_BITS; ++bitset_i)
set[bitset_i] = ~set[bitset_i];
if (SBC_MAX % BITSET_WORD_BITS != 0)
set[BITSET_WORDS - 1] =
((((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1)
& ~set[BITSET_WORDS - 1]);
}
static inline void
bitset_merge (bitset_t dest, const bitset_t src)
{
int bitset_i;
for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
dest[bitset_i] |= src[bitset_i];
}
static inline void
bitset_mask (bitset_t dest, const bitset_t src)
{
int bitset_i;
for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
dest[bitset_i] &= src[bitset_i];
}
#ifdef RE_ENABLE_I18N
/* Inline functions for re_string. */
static inline int
internal_function __attribute ((pure))
re_string_char_size_at (const re_string_t *pstr, Idx idx)
{
int byte_idx;
if (pstr->mb_cur_max == 1)
return 1;
for (byte_idx = 1; idx + byte_idx < pstr->valid_len; ++byte_idx)
if (pstr->wcs[idx + byte_idx] != WEOF)
break;
return byte_idx;
}
static inline wint_t
internal_function __attribute ((pure))
re_string_wchar_at (const re_string_t *pstr, Idx idx)
{
if (pstr->mb_cur_max == 1)
return (wint_t) pstr->mbs[idx];
return (wint_t) pstr->wcs[idx];
}
static int
internal_function __attribute ((pure))
re_string_elem_size_at (const re_string_t *pstr, Idx idx)
{
# ifdef _LIBC
const unsigned char *p, *extra;
const int32_t *table, *indirect;
int32_t tmp;
# include
uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
if (nrules != 0)
{
table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
extra = (const unsigned char *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
_NL_COLLATE_INDIRECTMB);
p = pstr->mbs + idx;
tmp = findidx (&p);
return p - pstr->mbs - idx;
}
else
# endif /* _LIBC */
return 1;
}
#endif /* RE_ENABLE_I18N */
#ifndef __GNUC_PREREQ
# if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
# else
# define __GNUC_PREREQ(maj, min) 0
# endif
#endif
#if __GNUC_PREREQ (3,4)
# undef __attribute_warn_unused_result__
# define __attribute_warn_unused_result__ \
__attribute__ ((__warn_unused_result__))
#else
# define __attribute_warn_unused_result__ /* empty */
#endif
#endif /* _REGEX_INTERNAL_H */
recutils-1.5/lib/localcharset.h 0000644 0000000 0000000 00000002543 11703116214 013463 0000000 0000000 /* Determine a canonical name for the current locale's character encoding.
Copyright (C) 2000-2003, 2009-2012 Free Software Foundation, Inc.
This file is part of the GNU CHARSET Library.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _LOCALCHARSET_H
#define _LOCALCHARSET_H
#ifdef __cplusplus
extern "C" {
#endif
/* Determine the current locale's character encoding, and canonicalize it
into one of the canonical names listed in config.charset.
The result must not be freed; it is statically allocated.
If the canonical name cannot be determined, the result is a non-canonical
name. */
extern const char * locale_charset (void);
#ifdef __cplusplus
}
#endif
#endif /* _LOCALCHARSET_H */
recutils-1.5/lib/fcntl.c 0000644 0000000 0000000 00000022775 11703116214 012131 0000000 0000000 /* Provide file descriptor control.
Copyright (C) 2009-2012 Free Software Foundation, Inc.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* Written by Eric Blake . */
#include
/* Specification. */
#include
#include
#include
#include
#include
#if !HAVE_FCNTL
# define rpl_fcntl fcntl
#endif
#undef fcntl
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include
/* Get _get_osfhandle. */
# include "msvc-nothrow.h"
/* Upper bound on getdtablesize(). See lib/getdtablesize.c. */
# define OPEN_MAX_MAX 0x10000
/* Duplicate OLDFD into the first available slot of at least NEWFD,
which must be positive, with FLAGS determining whether the duplicate
will be inheritable. */
static int
dupfd (int oldfd, int newfd, int flags)
{
/* Mingw has no way to create an arbitrary fd. Iterate until all
file descriptors less than newfd are filled up. */
HANDLE curr_process = GetCurrentProcess ();
HANDLE old_handle = (HANDLE) _get_osfhandle (oldfd);
unsigned char fds_to_close[OPEN_MAX_MAX / CHAR_BIT];
unsigned int fds_to_close_bound = 0;
int result;
BOOL inherit = flags & O_CLOEXEC ? FALSE : TRUE;
int mode;
if (newfd < 0 || getdtablesize () <= newfd)
{
errno = EINVAL;
return -1;
}
if (old_handle == INVALID_HANDLE_VALUE
|| (mode = setmode (oldfd, O_BINARY)) == -1)
{
/* oldfd is not open, or is an unassigned standard file
descriptor. */
errno = EBADF;
return -1;
}
setmode (oldfd, mode);
flags |= mode;
for (;;)
{
HANDLE new_handle;
int duplicated_fd;
unsigned int index;
if (!DuplicateHandle (curr_process, /* SourceProcessHandle */
old_handle, /* SourceHandle */
curr_process, /* TargetProcessHandle */
(PHANDLE) &new_handle, /* TargetHandle */
(DWORD) 0, /* DesiredAccess */
inherit, /* InheritHandle */
DUPLICATE_SAME_ACCESS)) /* Options */
{
/* TODO: Translate GetLastError () into errno. */
errno = EMFILE;
result = -1;
break;
}
duplicated_fd = _open_osfhandle ((long) new_handle, flags);
if (duplicated_fd < 0)
{
CloseHandle (new_handle);
errno = EMFILE;
result = -1;
break;
}
if (newfd <= duplicated_fd)
{
result = duplicated_fd;
break;
}
/* Set the bit duplicated_fd in fds_to_close[]. */
index = (unsigned int) duplicated_fd / CHAR_BIT;
if (fds_to_close_bound <= index)
{
if (sizeof fds_to_close <= index)
/* Need to increase OPEN_MAX_MAX. */
abort ();
memset (fds_to_close + fds_to_close_bound, '\0',
index + 1 - fds_to_close_bound);
fds_to_close_bound = index + 1;
}
fds_to_close[index] |= 1 << ((unsigned int) duplicated_fd % CHAR_BIT);
}
/* Close the previous fds that turned out to be too small. */
{
int saved_errno = errno;
unsigned int duplicated_fd;
for (duplicated_fd = 0;
duplicated_fd < fds_to_close_bound * CHAR_BIT;
duplicated_fd++)
if ((fds_to_close[duplicated_fd / CHAR_BIT]
>> (duplicated_fd % CHAR_BIT))
& 1)
close (duplicated_fd);
errno = saved_errno;
}
# if REPLACE_FCHDIR
if (0 <= result)
result = _gl_register_dup (oldfd, result);
# endif
return result;
}
#endif /* W32 */
/* Perform the specified ACTION on the file descriptor FD, possibly
using the argument ARG further described below. This replacement
handles the following actions, and forwards all others on to the
native fcntl. An unrecognized ACTION returns -1 with errno set to
EINVAL.
F_DUPFD - duplicate FD, with int ARG being the minimum target fd.
If successful, return the duplicate, which will be inheritable;
otherwise return -1 and set errno.
F_DUPFD_CLOEXEC - duplicate FD, with int ARG being the minimum
target fd. If successful, return the duplicate, which will not be
inheritable; otherwise return -1 and set errno.
F_GETFD - ARG need not be present. If successful, return a
non-negative value containing the descriptor flags of FD (only
FD_CLOEXEC is portable, but other flags may be present); otherwise
return -1 and set errno. */
int
rpl_fcntl (int fd, int action, /* arg */...)
{
va_list arg;
int result = -1;
va_start (arg, action);
switch (action)
{
#if !HAVE_FCNTL
case F_DUPFD:
{
int target = va_arg (arg, int);
result = dupfd (fd, target, 0);
break;
}
#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
case F_DUPFD:
{
int target = va_arg (arg, int);
/* Detect invalid target; needed for cygwin 1.5.x. */
if (target < 0 || getdtablesize () <= target)
errno = EINVAL;
else
{
/* Haiku alpha 2 loses fd flags on original. */
int flags = fcntl (fd, F_GETFD);
if (flags < 0)
{
result = -1;
break;
}
result = fcntl (fd, action, target);
if (0 <= result && fcntl (fd, F_SETFD, flags) == -1)
{
int saved_errno = errno;
close (result);
result = -1;
errno = saved_errno;
}
# if REPLACE_FCHDIR
if (0 <= result)
result = _gl_register_dup (fd, result);
# endif
}
break;
} /* F_DUPFD */
#endif /* FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR */
case F_DUPFD_CLOEXEC:
{
int target = va_arg (arg, int);
#if !HAVE_FCNTL
result = dupfd (fd, target, O_CLOEXEC);
break;
#else /* HAVE_FCNTL */
/* Try the system call first, if the headers claim it exists
(that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we
may be running with a glibc that has the macro but with an
older kernel that does not support it. Cache the
information on whether the system call really works, but
avoid caching failure if the corresponding F_DUPFD fails
for any reason. 0 = unknown, 1 = yes, -1 = no. */
static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0;
if (0 <= have_dupfd_cloexec)
{
result = fcntl (fd, action, target);
if (0 <= result || errno != EINVAL)
{
have_dupfd_cloexec = 1;
# if REPLACE_FCHDIR
if (0 <= result)
result = _gl_register_dup (fd, result);
# endif
}
else
{
result = rpl_fcntl (fd, F_DUPFD, target);
if (result < 0)
break;
have_dupfd_cloexec = -1;
}
}
else
result = rpl_fcntl (fd, F_DUPFD, target);
if (0 <= result && have_dupfd_cloexec == -1)
{
int flags = fcntl (result, F_GETFD);
if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1)
{
int saved_errno = errno;
close (result);
errno = saved_errno;
result = -1;
}
}
break;
#endif /* HAVE_FCNTL */
} /* F_DUPFD_CLOEXEC */
#if !HAVE_FCNTL
case F_GETFD:
{
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
HANDLE handle = (HANDLE) _get_osfhandle (fd);
DWORD flags;
if (handle == INVALID_HANDLE_VALUE
|| GetHandleInformation (handle, &flags) == 0)
errno = EBADF;
else
result = (flags & HANDLE_FLAG_INHERIT) ? 0 : FD_CLOEXEC;
# else /* !W32 */
/* Use dup2 to reject invalid file descriptors. No way to
access this information, so punt. */
if (0 <= dup2 (fd, fd))
result = 0;
# endif /* !W32 */
break;
} /* F_GETFD */
#endif /* !HAVE_FCNTL */
/* Implementing F_SETFD on mingw is not trivial - there is no
API for changing the O_NOINHERIT bit on an fd, and merely
changing the HANDLE_FLAG_INHERIT bit on the underlying handle
can lead to odd state. It may be possible by duplicating the
handle, using _open_osfhandle with the right flags, then
using dup2 to move the duplicate onto the original, but that
is not supported for now. */
default:
{
#if HAVE_FCNTL
void *p = va_arg (arg, void *);
result = fcntl (fd, action, p);
#else
errno = EINVAL;
#endif
break;
}
}
va_end (arg);
return result;
}
recutils-1.5/lib/gl_list.c 0000644 0000000 0000000 00000020605 11703116214 012446 0000000 0000000 /* Abstract sequential list data type.
Copyright (C) 2006-2012 Free Software Foundation, Inc.
Written by Bruno Haible , 2006.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#include
/* Specification. */
#include "gl_list.h"
#if !HAVE_INLINE
/* Define all functions of this file as inline accesses to the
struct gl_list_implementation.
Use #define to avoid a warning because of extern vs. static. */
gl_list_t
gl_list_nx_create_empty (gl_list_implementation_t implementation,
gl_listelement_equals_fn equals_fn,
gl_listelement_hashcode_fn hashcode_fn,
gl_listelement_dispose_fn dispose_fn,
bool allow_duplicates)
{
return implementation->nx_create_empty (implementation, equals_fn,
hashcode_fn, dispose_fn,
allow_duplicates);
}
gl_list_t
gl_list_nx_create (gl_list_implementation_t implementation,
gl_listelement_equals_fn equals_fn,
gl_listelement_hashcode_fn hashcode_fn,
gl_listelement_dispose_fn dispose_fn,
bool allow_duplicates,
size_t count, const void **contents)
{
return implementation->nx_create (implementation, equals_fn, hashcode_fn,
dispose_fn, allow_duplicates, count,
contents);
}
size_t
gl_list_size (gl_list_t list)
{
return ((const struct gl_list_impl_base *) list)->vtable
->size (list);
}
const void *
gl_list_node_value (gl_list_t list, gl_list_node_t node)
{
return ((const struct gl_list_impl_base *) list)->vtable
->node_value (list, node);
}
int
gl_list_node_nx_set_value (gl_list_t list, gl_list_node_t node,
const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->node_nx_set_value (list, node, elt);
}
gl_list_node_t
gl_list_next_node (gl_list_t list, gl_list_node_t node)
{
return ((const struct gl_list_impl_base *) list)->vtable
->next_node (list, node);
}
gl_list_node_t
gl_list_previous_node (gl_list_t list, gl_list_node_t node)
{
return ((const struct gl_list_impl_base *) list)->vtable
->previous_node (list, node);
}
const void *
gl_list_get_at (gl_list_t list, size_t position)
{
return ((const struct gl_list_impl_base *) list)->vtable
->get_at (list, position);
}
gl_list_node_t
gl_list_nx_set_at (gl_list_t list, size_t position, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->nx_set_at (list, position, elt);
}
gl_list_node_t
gl_list_search (gl_list_t list, const void *elt)
{
size_t size = ((const struct gl_list_impl_base *) list)->vtable->size (list);
return ((const struct gl_list_impl_base *) list)->vtable
->search_from_to (list, 0, size, elt);
}
gl_list_node_t
gl_list_search_from (gl_list_t list, size_t start_index, const void *elt)
{
size_t size = ((const struct gl_list_impl_base *) list)->vtable->size (list);
return ((const struct gl_list_impl_base *) list)->vtable
->search_from_to (list, start_index, size, elt);
}
gl_list_node_t
gl_list_search_from_to (gl_list_t list, size_t start_index, size_t end_index, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->search_from_to (list, start_index, end_index, elt);
}
size_t
gl_list_indexof (gl_list_t list, const void *elt)
{
size_t size = ((const struct gl_list_impl_base *) list)->vtable->size (list);
return ((const struct gl_list_impl_base *) list)->vtable
->indexof_from_to (list, 0, size, elt);
}
size_t
gl_list_indexof_from (gl_list_t list, size_t start_index, const void *elt)
{
size_t size = ((const struct gl_list_impl_base *) list)->vtable->size (list);
return ((const struct gl_list_impl_base *) list)->vtable
->indexof_from_to (list, start_index, size, elt);
}
size_t
gl_list_indexof_from_to (gl_list_t list, size_t start_index, size_t end_index, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->indexof_from_to (list, start_index, end_index, elt);
}
gl_list_node_t
gl_list_nx_add_first (gl_list_t list, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->nx_add_first (list, elt);
}
gl_list_node_t
gl_list_nx_add_last (gl_list_t list, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->nx_add_last (list, elt);
}
gl_list_node_t
gl_list_nx_add_before (gl_list_t list, gl_list_node_t node, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->nx_add_before (list, node, elt);
}
gl_list_node_t
gl_list_nx_add_after (gl_list_t list, gl_list_node_t node, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->nx_add_after (list, node, elt);
}
gl_list_node_t
gl_list_nx_add_at (gl_list_t list, size_t position, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->nx_add_at (list, position, elt);
}
bool
gl_list_remove_node (gl_list_t list, gl_list_node_t node)
{
return ((const struct gl_list_impl_base *) list)->vtable
->remove_node (list, node);
}
bool
gl_list_remove_at (gl_list_t list, size_t position)
{
return ((const struct gl_list_impl_base *) list)->vtable
->remove_at (list, position);
}
bool
gl_list_remove (gl_list_t list, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->remove_elt (list, elt);
}
void
gl_list_free (gl_list_t list)
{
((const struct gl_list_impl_base *) list)->vtable->list_free (list);
}
gl_list_iterator_t
gl_list_iterator (gl_list_t list)
{
return ((const struct gl_list_impl_base *) list)->vtable
->iterator (list);
}
gl_list_iterator_t
gl_list_iterator_from_to (gl_list_t list, size_t start_index, size_t end_index)
{
return ((const struct gl_list_impl_base *) list)->vtable
->iterator_from_to (list, start_index, end_index);
}
bool
gl_list_iterator_next (gl_list_iterator_t *iterator,
const void **eltp, gl_list_node_t *nodep)
{
return iterator->vtable->iterator_next (iterator, eltp, nodep);
}
void
gl_list_iterator_free (gl_list_iterator_t *iterator)
{
iterator->vtable->iterator_free (iterator);
}
gl_list_node_t
gl_sortedlist_search (gl_list_t list, gl_listelement_compar_fn compar, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->sortedlist_search (list, compar, elt);
}
gl_list_node_t
gl_sortedlist_search_from_to (gl_list_t list, gl_listelement_compar_fn compar, size_t start_index, size_t end_index, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->sortedlist_search_from_to (list, compar, start_index, end_index,
elt);
}
size_t
gl_sortedlist_indexof (gl_list_t list, gl_listelement_compar_fn compar, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->sortedlist_indexof (list, compar, elt);
}
size_t
gl_sortedlist_indexof_from_to (gl_list_t list, gl_listelement_compar_fn compar, size_t start_index, size_t end_index, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->sortedlist_indexof_from_to (list, compar, start_index, end_index,
elt);
}
gl_list_node_t
gl_sortedlist_nx_add (gl_list_t list, gl_listelement_compar_fn compar, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->sortedlist_nx_add (list, compar, elt);
}
bool
gl_sortedlist_remove (gl_list_t list, gl_listelement_compar_fn compar, const void *elt)
{
return ((const struct gl_list_impl_base *) list)->vtable
->sortedlist_remove (list, compar, elt);
}
#endif
recutils-1.5/lib/sys_types.in.h 0000644 0000000 0000000 00000002602 11703116215 013463 0000000 0000000 /* Provide a more complete sys/types.h.
Copyright (C) 2011-2012 Free Software Foundation, Inc.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
#define _@GUARD_PREFIX@_SYS_TYPES_H
/* MSVC 9 defines size_t in , not in . */
/* But avoid namespace pollution on glibc systems. */
#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
&& ! defined __GLIBC__
# include
#endif
#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
recutils-1.5/lib/fseeko.c 0000644 0000000 0000000 00000012217 11703116214 012265 0000000 0000000 /* An fseeko() function that, together with fflush(), is POSIX compliant.
Copyright (C) 2007-2012 Free Software Foundation, Inc.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#include
/* Specification. */
#include
/* Get off_t and lseek. */
#include
#include "stdio-impl.h"
int
fseeko (FILE *fp, off_t offset, int whence)
#undef fseeko
#if !HAVE_FSEEKO
# undef fseek
# define fseeko fseek
#endif
{
#if LSEEK_PIPE_BROKEN
/* mingw gives bogus answers rather than failure on non-seekable files. */
if (lseek (fileno (fp), 0, SEEK_CUR) == -1)
return EOF;
#endif
/* These tests are based on fpurge.c. */
#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
if (fp->_IO_read_end == fp->_IO_read_ptr
&& fp->_IO_write_ptr == fp->_IO_write_base
&& fp->_IO_save_base == NULL)
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
# if defined __SL64 && defined __SCLE /* Cygwin */
if ((fp->_flags & __SL64) == 0)
{
/* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit
mode; but has an fseeko that requires 64-bit mode. */
FILE *tmp = fopen ("/dev/null", "r");
if (!tmp)
return -1;
fp->_flags |= __SL64;
fp->_seek64 = tmp->_seek64;
fclose (tmp);
}
# endif
if (fp_->_p == fp_->_bf._base
&& fp_->_r == 0
&& fp_->_w == ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
? fp_->_bf._size
: 0)
&& fp_ub._base == NULL)
#elif defined __EMX__ /* emx+gcc */
if (fp->_ptr == fp->_buffer
&& fp->_rcount == 0
&& fp->_wcount == 0
&& fp->_ungetc_count == 0)
#elif defined __minix /* Minix */
if (fp_->_ptr == fp_->_buf
&& (fp_->_ptr == NULL || fp_->_count == 0))
#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
if (fp_->_ptr == fp_->_base
&& (fp_->_ptr == NULL || fp_->_cnt == 0))
#elif defined __UCLIBC__ /* uClibc */
if (((fp->__modeflags & __FLAG_WRITING) == 0
|| fp->__bufpos == fp->__bufstart)
&& ((fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) == 0
|| fp->__bufpos == fp->__bufread))
#elif defined __QNX__ /* QNX */
if ((fp->_Mode & 0x2000 /* _MWRITE */ ? fp->_Next == fp->_Buf : fp->_Next == fp->_Rend)
&& fp->_Rback == fp->_Back + sizeof (fp->_Back)
&& fp->_Rsave == NULL)
#elif defined __MINT__ /* Atari FreeMiNT */
if (fp->__bufp == fp->__buffer
&& fp->__get_limit == fp->__bufp
&& fp->__put_limit == fp->__bufp
&& !fp->__pushed_back)
#else
#error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib."
#endif
{
/* We get here when an fflush() call immediately preceded this one (or
if ftell() has created buffers but no I/O has occurred on a
newly-opened stream). We know there are no buffers. */
off_t pos = lseek (fileno (fp), offset, whence);
if (pos == -1)
{
#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
fp_->_flags &= ~__SOFF;
#endif
return -1;
}
#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags &= ~_IO_EOF_SEEN;
fp->_offset = pos;
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
# if defined __CYGWIN__
/* fp_->_offset is typed as an integer. */
fp_->_offset = pos;
# else
/* fp_->_offset is an fpos_t. */
{
/* Use a union, since on NetBSD, the compilation flags
determine whether fpos_t is typedef'd to off_t or a struct
containing a single off_t member. */
union
{
fpos_t f;
off_t o;
} u;
u.o = pos;
fp_->_offset = u.f;
}
# endif
fp_->_flags |= __SOFF;
fp_->_flags &= ~__SEOF;
#elif defined __EMX__ /* emx+gcc */
fp->_flags &= ~_IOEOF;
#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
fp->_flag &= ~_IOEOF;
#elif defined __MINT__ /* Atari FreeMiNT */
fp->__offset = pos;
fp->__eof = 0;
#endif
return 0;
}
return fseeko (fp, offset, whence);
}
recutils-1.5/lib/strchrnul.c 0000644 0000000 0000000 00000013015 11703116215 013033 0000000 0000000 /* Searching in a string.
Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#include
/* Specification. */
#include
/* Find the first occurrence of C in S or the final NUL byte. */
char *
strchrnul (const char *s, int c_in)
{
/* On 32-bit hardware, choosing longword to be a 32-bit unsigned
long instead of a 64-bit uintmax_t tends to give better
performance. On 64-bit hardware, unsigned long is generally 64
bits already. Change this typedef to experiment with
performance. */
typedef unsigned long int longword;
const unsigned char *char_ptr;
const longword *longword_ptr;
longword repeated_one;
longword repeated_c;
unsigned char c;
c = (unsigned char) c_in;
if (!c)
return rawmemchr (s, 0);
/* Handle the first few bytes by reading one byte at a time.
Do this until CHAR_PTR is aligned on a longword boundary. */
for (char_ptr = (const unsigned char *) s;
(size_t) char_ptr % sizeof (longword) != 0;
++char_ptr)
if (!*char_ptr || *char_ptr == c)
return (char *) char_ptr;
longword_ptr = (const longword *) char_ptr;
/* All these elucidatory comments refer to 4-byte longwords,
but the theory applies equally well to any size longwords. */
/* Compute auxiliary longword values:
repeated_one is a value which has a 1 in every byte.
repeated_c has c in every byte. */
repeated_one = 0x01010101;
repeated_c = c | (c << 8);
repeated_c |= repeated_c << 16;
if (0xffffffffU < (longword) -1)
{
repeated_one |= repeated_one << 31 << 1;
repeated_c |= repeated_c << 31 << 1;
if (8 < sizeof (longword))
{
size_t i;
for (i = 64; i < sizeof (longword) * 8; i *= 2)
{
repeated_one |= repeated_one << i;
repeated_c |= repeated_c << i;
}
}
}
/* Instead of the traditional loop which tests each byte, we will
test a longword at a time. The tricky part is testing if *any of
the four* bytes in the longword in question are equal to NUL or
c. We first use an xor with repeated_c. This reduces the task
to testing whether *any of the four* bytes in longword1 or
longword2 is zero.
Let's consider longword1. We compute tmp =
((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
That is, we perform the following operations:
1. Subtract repeated_one.
2. & ~longword1.
3. & a mask consisting of 0x80 in every byte.
Consider what happens in each byte:
- If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
and step 3 transforms it into 0x80. A carry can also be propagated
to more significant bytes.
- If a byte of longword1 is nonzero, let its lowest 1 bit be at
position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
the byte ends in a single bit of value 0 and k bits of value 1.
After step 2, the result is just k bits of value 1: 2^k - 1. After
step 3, the result is 0. And no carry is produced.
So, if longword1 has only non-zero bytes, tmp is zero.
Whereas if longword1 has a zero byte, call j the position of the least
significant zero byte. Then the result has a zero at positions 0, ...,
j-1 and a 0x80 at position j. We cannot predict the result at the more
significant bytes (positions j+1..3), but it does not matter since we
already have a non-zero bit at position 8*j+7.
The test whether any byte in longword1 or longword2 is zero is equivalent
to testing whether tmp1 is nonzero or tmp2 is nonzero. We can combine
this into a single test, whether (tmp1 | tmp2) is nonzero.
This test can read more than one byte beyond the end of a string,
depending on where the terminating NUL is encountered. However,
this is considered safe since the initialization phase ensured
that the read will be aligned, therefore, the read will not cross
page boundaries and will not cause a fault. */
while (1)
{
longword longword1 = *longword_ptr ^ repeated_c;
longword longword2 = *longword_ptr;
if (((((longword1 - repeated_one) & ~longword1)
| ((longword2 - repeated_one) & ~longword2))
& (repeated_one << 7)) != 0)
break;
longword_ptr++;
}
char_ptr = (const unsigned char *) longword_ptr;
/* At this point, we know that one of the sizeof (longword) bytes
starting at char_ptr is == 0 or == c. On little-endian machines,
we could determine the first such byte without any further memory
accesses, just by looking at the tmp result from the last loop
iteration. But this does not work on big-endian machines.
Choose code that works in both cases. */
char_ptr = (unsigned char *) longword_ptr;
while (*char_ptr && (*char_ptr != c))
char_ptr++;
return (char *) char_ptr;
}
recutils-1.5/lib/base64.c 0000644 0000000 0000000 00000045636 11703116213 012107 0000000 0000000 /* base64.c -- Encode binary data using printable characters.
Copyright (C) 1999-2001, 2004-2006, 2009-2012 Free Software Foundation, Inc.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Simon Josefsson. Partially adapted from GNU MailUtils
* (mailbox/filter_trans.c, as of 2004-11-28). Improved by review
* from Paul Eggert, Bruno Haible, and Stepan Kasal.
*
* See also RFC 4648 .
*
* Be careful with error checking. Here is how you would typically
* use these functions:
*
* bool ok = base64_decode_alloc (in, inlen, &out, &outlen);
* if (!ok)
* FAIL: input was not valid base64
* if (out == NULL)
* FAIL: memory allocation error
* OK: data in OUT/OUTLEN
*
* size_t outlen = base64_encode_alloc (in, inlen, &out);
* if (out == NULL && outlen == 0 && inlen != 0)
* FAIL: input too long
* if (out == NULL)
* FAIL: memory allocation error
* OK: data in OUT/OUTLEN.
*
*/
#include
/* Get prototype. */
#include "base64.h"
/* Get malloc. */
#include
/* Get UCHAR_MAX. */
#include
#include
/* C89 compliant way to cast 'char' to 'unsigned char'. */
static inline unsigned char
to_uchar (char ch)
{
return ch;
}
/* Base64 encode IN array of size INLEN into OUT array of size OUTLEN.
If OUTLEN is less than BASE64_LENGTH(INLEN), write as many bytes as
possible. If OUTLEN is larger than BASE64_LENGTH(INLEN), also zero
terminate the output buffer. */
void
base64_encode (const char *restrict in, size_t inlen,
char *restrict out, size_t outlen)
{
static const char b64str[64] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
while (inlen && outlen)
{
*out++ = b64str[(to_uchar (in[0]) >> 2) & 0x3f];
if (!--outlen)
break;
*out++ = b64str[((to_uchar (in[0]) << 4)
+ (--inlen ? to_uchar (in[1]) >> 4 : 0))
& 0x3f];
if (!--outlen)
break;
*out++ =
(inlen
? b64str[((to_uchar (in[1]) << 2)
+ (--inlen ? to_uchar (in[2]) >> 6 : 0))
& 0x3f]
: '=');
if (!--outlen)
break;
*out++ = inlen ? b64str[to_uchar (in[2]) & 0x3f] : '=';
if (!--outlen)
break;
if (inlen)
inlen--;
if (inlen)
in += 3;
}
if (outlen)
*out = '\0';
}
/* Allocate a buffer and store zero terminated base64 encoded data
from array IN of size INLEN, returning BASE64_LENGTH(INLEN), i.e.,
the length of the encoded data, excluding the terminating zero. On
return, the OUT variable will hold a pointer to newly allocated
memory that must be deallocated by the caller. If output string
length would overflow, 0 is returned and OUT is set to NULL. If
memory allocation failed, OUT is set to NULL, and the return value
indicates length of the requested memory block, i.e.,
BASE64_LENGTH(inlen) + 1. */
size_t
base64_encode_alloc (const char *in, size_t inlen, char **out)
{
size_t outlen = 1 + BASE64_LENGTH (inlen);
/* Check for overflow in outlen computation.
*
* If there is no overflow, outlen >= inlen.
*
* If the operation (inlen + 2) overflows then it yields at most +1, so
* outlen is 0.
*
* If the multiplication overflows, we lose at least half of the
* correct value, so the result is < ((inlen + 2) / 3) * 2, which is
* less than (inlen + 2) * 0.66667, which is less than inlen as soon as
* (inlen > 4).
*/
if (inlen > outlen)
{
*out = NULL;
return 0;
}
*out = malloc (outlen);
if (!*out)
return outlen;
base64_encode (in, inlen, *out, outlen);
return outlen - 1;
}
/* With this approach this file works independent of the charset used
(think EBCDIC). However, it does assume that the characters in the
Base64 alphabet (A-Za-z0-9+/) are encoded in 0..255. POSIX
1003.1-2001 require that char and unsigned char are 8-bit
quantities, though, taking care of that problem. But this may be a
potential problem on non-POSIX C99 platforms.
IBM C V6 for AIX mishandles "#define B64(x) ...'x'...", so use "_"
as the formal parameter rather than "x". */
#define B64(_) \
((_) == 'A' ? 0 \
: (_) == 'B' ? 1 \
: (_) == 'C' ? 2 \
: (_) == 'D' ? 3 \
: (_) == 'E' ? 4 \
: (_) == 'F' ? 5 \
: (_) == 'G' ? 6 \
: (_) == 'H' ? 7 \
: (_) == 'I' ? 8 \
: (_) == 'J' ? 9 \
: (_) == 'K' ? 10 \
: (_) == 'L' ? 11 \
: (_) == 'M' ? 12 \
: (_) == 'N' ? 13 \
: (_) == 'O' ? 14 \
: (_) == 'P' ? 15 \
: (_) == 'Q' ? 16 \
: (_) == 'R' ? 17 \
: (_) == 'S' ? 18 \
: (_) == 'T' ? 19 \
: (_) == 'U' ? 20 \
: (_) == 'V' ? 21 \
: (_) == 'W' ? 22 \
: (_) == 'X' ? 23 \
: (_) == 'Y' ? 24 \
: (_) == 'Z' ? 25 \
: (_) == 'a' ? 26 \
: (_) == 'b' ? 27 \
: (_) == 'c' ? 28 \
: (_) == 'd' ? 29 \
: (_) == 'e' ? 30 \
: (_) == 'f' ? 31 \
: (_) == 'g' ? 32 \
: (_) == 'h' ? 33 \
: (_) == 'i' ? 34 \
: (_) == 'j' ? 35 \
: (_) == 'k' ? 36 \
: (_) == 'l' ? 37 \
: (_) == 'm' ? 38 \
: (_) == 'n' ? 39 \
: (_) == 'o' ? 40 \
: (_) == 'p' ? 41 \
: (_) == 'q' ? 42 \
: (_) == 'r' ? 43 \
: (_) == 's' ? 44 \
: (_) == 't' ? 45 \
: (_) == 'u' ? 46 \
: (_) == 'v' ? 47 \
: (_) == 'w' ? 48 \
: (_) == 'x' ? 49 \
: (_) == 'y' ? 50 \
: (_) == 'z' ? 51 \
: (_) == '0' ? 52 \
: (_) == '1' ? 53 \
: (_) == '2' ? 54 \
: (_) == '3' ? 55 \
: (_) == '4' ? 56 \
: (_) == '5' ? 57 \
: (_) == '6' ? 58 \
: (_) == '7' ? 59 \
: (_) == '8' ? 60 \
: (_) == '9' ? 61 \
: (_) == '+' ? 62 \
: (_) == '/' ? 63 \
: -1)
static const signed char b64[0x100] = {
B64 (0), B64 (1), B64 (2), B64 (3),
B64 (4), B64 (5), B64 (6), B64 (7),
B64 (8), B64 (9), B64 (10), B64 (11),
B64 (12), B64 (13), B64 (14), B64 (15),
B64 (16), B64 (17), B64 (18), B64 (19),
B64 (20), B64 (21), B64 (22), B64 (23),
B64 (24), B64 (25), B64 (26), B64 (27),
B64 (28), B64 (29), B64 (30), B64 (31),
B64 (32), B64 (33), B64 (34), B64 (35),
B64 (36), B64 (37), B64 (38), B64 (39),
B64 (40), B64 (41), B64 (42), B64 (43),
B64 (44), B64 (45), B64 (46), B64 (47),
B64 (48), B64 (49), B64 (50), B64 (51),
B64 (52), B64 (53), B64 (54), B64 (55),
B64 (56), B64 (57), B64 (58), B64 (59),
B64 (60), B64 (61), B64 (62), B64 (63),
B64 (64), B64 (65), B64 (66), B64 (67),
B64 (68), B64 (69), B64 (70), B64 (71),
B64 (72), B64 (73), B64 (74), B64 (75),
B64 (76), B64 (77), B64 (78), B64 (79),
B64 (80), B64 (81), B64 (82), B64 (83),
B64 (84), B64 (85), B64 (86), B64 (87),
B64 (88), B64 (89), B64 (90), B64 (91),
B64 (92), B64 (93), B64 (94), B64 (95),
B64 (96), B64 (97), B64 (98), B64 (99),
B64 (100), B64 (101), B64 (102), B64 (103),
B64 (104), B64 (105), B64 (106), B64 (107),
B64 (108), B64 (109), B64 (110), B64 (111),
B64 (112), B64 (113), B64 (114), B64 (115),
B64 (116), B64 (117), B64 (118), B64 (119),
B64 (120), B64 (121), B64 (122), B64 (123),
B64 (124), B64 (125), B64 (126), B64 (127),
B64 (128), B64 (129), B64 (130), B64 (131),
B64 (132), B64 (133), B64 (134), B64 (135),
B64 (136), B64 (137), B64 (138), B64 (139),
B64 (140), B64 (141), B64 (142), B64 (143),
B64 (144), B64 (145), B64 (146), B64 (147),
B64 (148), B64 (149), B64 (150), B64 (151),
B64 (152), B64 (153), B64 (154), B64 (155),
B64 (156), B64 (157), B64 (158), B64 (159),
B64 (160), B64 (161), B64 (162), B64 (163),
B64 (164), B64 (165), B64 (166), B64 (167),
B64 (168), B64 (169), B64 (170), B64 (171),
B64 (172), B64 (173), B64 (174), B64 (175),
B64 (176), B64 (177), B64 (178), B64 (179),
B64 (180), B64 (181), B64 (182), B64 (183),
B64 (184), B64 (185), B64 (186), B64 (187),
B64 (188), B64 (189), B64 (190), B64 (191),
B64 (192), B64 (193), B64 (194), B64 (195),
B64 (196), B64 (197), B64 (198), B64 (199),
B64 (200), B64 (201), B64 (202), B64 (203),
B64 (204), B64 (205), B64 (206), B64 (207),
B64 (208), B64 (209), B64 (210), B64 (211),
B64 (212), B64 (213), B64 (214), B64 (215),
B64 (216), B64 (217), B64 (218), B64 (219),
B64 (220), B64 (221), B64 (222), B64 (223),
B64 (224), B64 (225), B64 (226), B64 (227),
B64 (228), B64 (229), B64 (230), B64 (231),
B64 (232), B64 (233), B64 (234), B64 (235),
B64 (236), B64 (237), B64 (238), B64 (239),
B64 (240), B64 (241), B64 (242), B64 (243),
B64 (244), B64 (245), B64 (246), B64 (247),
B64 (248), B64 (249), B64 (250), B64 (251),
B64 (252), B64 (253), B64 (254), B64 (255)
};
#if UCHAR_MAX == 255
# define uchar_in_range(c) true
#else
# define uchar_in_range(c) ((c) <= 255)
#endif
/* Return true if CH is a character from the Base64 alphabet, and
false otherwise. Note that '=' is padding and not considered to be
part of the alphabet. */
bool
isbase64 (char ch)
{
return uchar_in_range (to_uchar (ch)) && 0 <= b64[to_uchar (ch)];
}
/* Initialize decode-context buffer, CTX. */
void
base64_decode_ctx_init (struct base64_decode_context *ctx)
{
ctx->i = 0;
}
/* If CTX->i is 0 or 4, there are four or more bytes in [*IN..IN_END), and
none of those four is a newline, then return *IN. Otherwise, copy up to
4 - CTX->i non-newline bytes from that range into CTX->buf, starting at
index CTX->i and setting CTX->i to reflect the number of bytes copied,
and return CTX->buf. In either case, advance *IN to point to the byte
after the last one processed, and set *N_NON_NEWLINE to the number of
verified non-newline bytes accessible through the returned pointer. */
static inline char *
get_4 (struct base64_decode_context *ctx,
char const *restrict *in, char const *restrict in_end,
size_t *n_non_newline)
{
if (ctx->i == 4)
ctx->i = 0;
if (ctx->i == 0)
{
char const *t = *in;
if (4 <= in_end - *in && memchr (t, '\n', 4) == NULL)
{
/* This is the common case: no newline. */
*in += 4;
*n_non_newline = 4;
return (char *) t;
}
}
{
/* Copy non-newline bytes into BUF. */
char const *p = *in;
while (p < in_end)
{
char c = *p++;
if (c != '\n')
{
ctx->buf[ctx->i++] = c;
if (ctx->i == 4)
break;
}
}
*in = p;
*n_non_newline = ctx->i;
return ctx->buf;
}
}
#define return_false \
do \
{ \
*outp = out; \
return false; \
} \
while (false)
/* Decode up to four bytes of base64-encoded data, IN, of length INLEN
into the output buffer, *OUT, of size *OUTLEN bytes. Return true if
decoding is successful, false otherwise. If *OUTLEN is too small,
as many bytes as possible are written to *OUT. On return, advance
*OUT to point to the byte after the last one written, and decrement
*OUTLEN to reflect the number of bytes remaining in *OUT. */
static inline bool
decode_4 (char const *restrict in, size_t inlen,
char *restrict *outp, size_t *outleft)
{
char *out = *outp;
if (inlen < 2)
return false;
if (!isbase64 (in[0]) || !isbase64 (in[1]))
return false;
if (*outleft)
{
*out++ = ((b64[to_uchar (in[0])] << 2)
| (b64[to_uchar (in[1])] >> 4));
--*outleft;
}
if (inlen == 2)
return_false;
if (in[2] == '=')
{
if (inlen != 4)
return_false;
if (in[3] != '=')
return_false;
}
else
{
if (!isbase64 (in[2]))
return_false;
if (*outleft)
{
*out++ = (((b64[to_uchar (in[1])] << 4) & 0xf0)
| (b64[to_uchar (in[2])] >> 2));
--*outleft;
}
if (inlen == 3)
return_false;
if (in[3] == '=')
{
if (inlen != 4)
return_false;
}
else
{
if (!isbase64 (in[3]))
return_false;
if (*outleft)
{
*out++ = (((b64[to_uchar (in[2])] << 6) & 0xc0)
| b64[to_uchar (in[3])]);
--*outleft;
}
}
}
*outp = out;
return true;
}
/* Decode base64-encoded input array IN of length INLEN to output array
OUT that can hold *OUTLEN bytes. The input data may be interspersed
with newlines. Return true if decoding was successful, i.e. if the
input was valid base64 data, false otherwise. If *OUTLEN is too
small, as many bytes as possible will be written to OUT. On return,
*OUTLEN holds the length of decoded bytes in OUT. Note that as soon
as any non-alphabet, non-newline character is encountered, decoding
is stopped and false is returned. If INLEN is zero, then process
only whatever data is stored in CTX.
Initially, CTX must have been initialized via base64_decode_ctx_init.
Subsequent calls to this function must reuse whatever state is recorded
in that buffer. It is necessary for when a quadruple of base64 input
bytes spans two input buffers.
If CTX is NULL then newlines are treated as garbage and the input
buffer is processed as a unit. */
bool
base64_decode_ctx (struct base64_decode_context *ctx,
const char *restrict in, size_t inlen,
char *restrict out, size_t *outlen)
{
size_t outleft = *outlen;
bool ignore_newlines = ctx != NULL;
bool flush_ctx = false;
unsigned int ctx_i = 0;
if (ignore_newlines)
{
ctx_i = ctx->i;
flush_ctx = inlen == 0;
}
while (true)
{
size_t outleft_save = outleft;
if (ctx_i == 0 && !flush_ctx)
{
while (true)
{
/* Save a copy of outleft, in case we need to re-parse this
block of four bytes. */
outleft_save = outleft;
if (!decode_4 (in, inlen, &out, &outleft))
break;
in += 4;
inlen -= 4;
}
}
if (inlen == 0 && !flush_ctx)
break;
/* Handle the common case of 72-byte wrapped lines.
This also handles any other multiple-of-4-byte wrapping. */
if (inlen && *in == '\n' && ignore_newlines)
{
++in;
--inlen;
continue;
}
/* Restore OUT and OUTLEFT. */
out -= outleft_save - outleft;
outleft = outleft_save;
{
char const *in_end = in + inlen;
char const *non_nl;
if (ignore_newlines)
non_nl = get_4 (ctx, &in, in_end, &inlen);
else
non_nl = in; /* Might have nl in this case. */
/* If the input is empty or consists solely of newlines (0 non-newlines),
then we're done. Likewise if there are fewer than 4 bytes when not
flushing context and not treating newlines as garbage. */
if (inlen == 0 || (inlen < 4 && !flush_ctx && ignore_newlines))
{
inlen = 0;
break;
}
if (!decode_4 (non_nl, inlen, &out, &outleft))
break;
inlen = in_end - in;
}
}
*outlen -= outleft;
return inlen == 0;
}
/* Allocate an output buffer in *OUT, and decode the base64 encoded
data stored in IN of size INLEN to the *OUT buffer. On return, the
size of the decoded data is stored in *OUTLEN. OUTLEN may be NULL,
if the caller is not interested in the decoded length. *OUT may be
NULL to indicate an out of memory error, in which case *OUTLEN
contains the size of the memory block needed. The function returns
true on successful decoding and memory allocation errors. (Use the
*OUT and *OUTLEN parameters to differentiate between successful
decoding and memory error.) The function returns false if the
input was invalid, in which case *OUT is NULL and *OUTLEN is
undefined. */
bool
base64_decode_alloc_ctx (struct base64_decode_context *ctx,
const char *in, size_t inlen, char **out,
size_t *outlen)
{
/* This may allocate a few bytes too many, depending on input,
but it's not worth the extra CPU time to compute the exact size.
The exact size is 3 * (inlen + (ctx ? ctx->i : 0)) / 4, minus 1 if the
input ends with "=" and minus another 1 if the input ends with "==".
Dividing before multiplying avoids the possibility of overflow. */
size_t needlen = 3 * (inlen / 4) + 3;
*out = malloc (needlen);
if (!*out)
return true;
if (!base64_decode_ctx (ctx, in, inlen, *out, &needlen))
{
free (*out);
*out = NULL;
return false;
}
if (outlen)
*outlen = needlen;
return true;
}
recutils-1.5/lib/malloc.c 0000644 0000000 0000000 00000003043 11703116214 012255 0000000 0000000 /* malloc() function that is glibc compatible.
Copyright (C) 1997-1998, 2006-2007, 2009-2012 Free Software Foundation, Inc.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* written by Jim Meyering and Bruno Haible */
#define _GL_USE_STDLIB_ALLOC 1
#include
/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */
#ifdef malloc
# define NEED_MALLOC_GNU 1
# undef malloc
/* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU. */
#elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU
# define NEED_MALLOC_GNU 1
#endif
#include
#include
/* Allocate an N-byte block of memory from the heap.
If N is zero, allocate a 1-byte block. */
void *
rpl_malloc (size_t n)
{
void *result;
#if NEED_MALLOC_GNU
if (n == 0)
n = 1;
#endif
result = malloc (n);
#if !HAVE_MALLOC_POSIX
if (result == NULL)
errno = ENOMEM;
#endif
return result;
}
recutils-1.5/lib/getdtablesize.c 0000644 0000000 0000000 00000004772 11703116214 013646 0000000 0000000 /* getdtablesize() function for platforms that don't have it.
Copyright (C) 2008-2012 Free Software Foundation, Inc.
Written by Bruno Haible , 2008.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#include
/* Specification. */
#include
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
#include
#include "msvc-inval.h"
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
static inline int
_setmaxstdio_nothrow (int newmax)
{
int result;
TRY_MSVC_INVAL
{
result = _setmaxstdio (newmax);
}
CATCH_MSVC_INVAL
{
result = -1;
}
DONE_MSVC_INVAL;
return result;
}
# define _setmaxstdio _setmaxstdio_nothrow
#endif
/* Cache for the previous getdtablesize () result. */
static int dtablesize;
int
getdtablesize (void)
{
if (dtablesize == 0)
{
/* We are looking for the number N such that the valid file descriptors
are 0..N-1. It can be obtained through a loop as follows:
{
int fd;
for (fd = 3; fd < 65536; fd++)
if (dup2 (0, fd) == -1)
break;
return fd;
}
On Windows XP, the result is 2048.
The drawback of this loop is that it allocates memory for a libc
internal array that is never freed.
The number N can also be obtained as the upper bound for
_getmaxstdio (). _getmaxstdio () returns the maximum number of open
FILE objects. The sanity check in _setmaxstdio reveals the maximum
number of file descriptors. This too allocates memory, but it is
freed when we call _setmaxstdio with the original value. */
int orig_max_stdio = _getmaxstdio ();
unsigned int bound;
for (bound = 0x10000; _setmaxstdio (bound) < 0; bound = bound / 2)
;
_setmaxstdio (orig_max_stdio);
dtablesize = bound;
}
return dtablesize;
}
#endif
recutils-1.5/lib/timespec.h 0000644 0000000 0000000 00000005702 11703116215 012631 0000000 0000000 /* timespec -- System time interface
Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2012 Free Software
Foundation, Inc.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#if ! defined TIMESPEC_H
# define TIMESPEC_H
# include
/* Return negative, zero, positive if A < B, A == B, A > B, respectively.
For each time stamp T, this code assumes that either:
* T.tv_nsec is in the range 0..999999999; or
* T.tv_sec corresponds to a valid leap second on a host that supports
leap seconds, and T.tv_nsec is in the range 1000000000..1999999999; or
* T.tv_sec is the minimum time_t value and T.tv_nsec is -1; or
T.tv_sec is the maximum time_t value and T.tv_nsec is 2000000000.
This allows for special struct timespec values that are less or
greater than all possible valid time stamps.
In all these cases, it is safe to subtract two tv_nsec values and
convert the result to integer without worrying about overflow on
any platform of interest to the GNU project, since all such
platforms have 32-bit int or wider.
Replacing "(int) (a.tv_nsec - b.tv_nsec)" with something like
"a.tv_nsec < b.tv_nsec ? -1 : a.tv_nsec > b.tv_nsec" would cause
this function to work in some cases where the above assumption is
violated, but not in all cases (e.g., a.tv_sec==1, a.tv_nsec==-2,
b.tv_sec==0, b.tv_nsec==999999999) and is arguably not worth the
extra instructions. Using a subtraction has the advantage of
detecting some invalid cases on platforms that detect integer
overflow.
The (int) cast avoids a gcc -Wconversion warning. */
static inline int
timespec_cmp (struct timespec a, struct timespec b)
{
return (a.tv_sec < b.tv_sec ? -1
: a.tv_sec > b.tv_sec ? 1
: (int) (a.tv_nsec - b.tv_nsec));
}
/* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be
nonnegative. */
static inline int
timespec_sign (struct timespec a)
{
return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec;
}
struct timespec timespec_add (struct timespec, struct timespec);
struct timespec timespec_sub (struct timespec, struct timespec);
struct timespec dtotimespec (double);
/* Return an approximation to A, of type 'double'. */
static inline double
timespectod (struct timespec a)
{
return a.tv_sec + a.tv_nsec / 1e9;
}
void gettime (struct timespec *);
int settime (struct timespec const *);
#endif
recutils-1.5/lib/msvc-nothrow.h 0000644 0000000 0000000 00000003121 11703116214 013456 0000000 0000000 /* Wrappers that don't throw invalid parameter notifications
with MSVC runtime libraries.
Copyright (C) 2011-2012 Free Software Foundation, Inc.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _MSVC_NOTHROW_H
#define _MSVC_NOTHROW_H
/* With MSVC runtime libraries with the "invalid parameter handler" concept,
functions like fprintf(), dup2(), or close() crash when the caller passes
an invalid argument. But POSIX wants error codes (such as EINVAL or EBADF)
instead.
This file defines wrappers that turn such an invalid parameter notification
into an error code. */
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Get original declaration of _get_osfhandle. */
# include
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
/* Override _get_osfhandle. */
extern intptr_t _gl_nothrow_get_osfhandle (int fd);
# define _get_osfhandle _gl_nothrow_get_osfhandle
# endif
#endif
#endif /* _MSVC_NOTHROW_H */
recutils-1.5/lib/realloc.c 0000644 0000000 0000000 00000004070 11703116215 012431 0000000 0000000 /* realloc() function that is glibc compatible.
Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2012 Free Software
Foundation, Inc.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* written by Jim Meyering and Bruno Haible */
#define _GL_USE_STDLIB_ALLOC 1
#include
/* Only the AC_FUNC_REALLOC macro defines 'realloc' already in config.h. */
#ifdef realloc
# define NEED_REALLOC_GNU 1
/* Whereas the gnulib module 'realloc-gnu' defines HAVE_REALLOC_GNU. */
#elif GNULIB_REALLOC_GNU && !HAVE_REALLOC_GNU
# define NEED_REALLOC_GNU 1
#endif
/* Infer the properties of the system's malloc function.
The gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU. */
#if GNULIB_MALLOC_GNU && HAVE_MALLOC_GNU
# define SYSTEM_MALLOC_GLIBC_COMPATIBLE 1
#endif
#include
#include
/* Change the size of an allocated block of memory P to N bytes,
with error checking. If N is zero, change it to 1. If P is NULL,
use malloc. */
void *
rpl_realloc (void *p, size_t n)
{
void *result;
#if NEED_REALLOC_GNU
if (n == 0)
{
n = 1;
/* In theory realloc might fail, so don't rely on it to free. */
free (p);
p = NULL;
}
#endif
if (p == NULL)
{
#if GNULIB_REALLOC_GNU && !NEED_REALLOC_GNU && !SYSTEM_MALLOC_GLIBC_COMPATIBLE
if (n == 0)
n = 1;
#endif
result = malloc (n);
}
else
result = realloc (p, n);
#if !HAVE_REALLOC_POSIX
if (result == NULL)
errno = ENOMEM;
#endif
return result;
}
recutils-1.5/lib/progname.c 0000644 0000000 0000000 00000006150 11703116215 012621 0000000 0000000 /* Program name management.
Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc.
Written by Bruno Haible , 2001.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#include
/* Specification. */
#undef ENABLE_RELOCATABLE /* avoid defining set_program_name as a macro */
#include "progname.h"
#include /* get program_invocation_name declaration */
#include
#include
#include
/* String containing name the program is called with.
To be initialized by main(). */
const char *program_name = NULL;
/* Set program_name, based on argv[0].
argv0 must be a string allocated with indefinite extent, and must not be
modified after this call. */
void
set_program_name (const char *argv0)
{
/* libtool creates a temporary executable whose name is sometimes prefixed
with "lt-" (depends on the platform). It also makes argv[0] absolute.
But the name of the temporary executable is a detail that should not be
visible to the end user and to the test suite.
Remove this "/.libs/" or "/.libs/lt-" prefix here. */
const char *slash;
const char *base;
/* Sanity check. POSIX requires the invoking process to pass a non-NULL
argv[0]. */
if (argv0 == NULL)
{
/* It's a bug in the invoking program. Help diagnosing it. */
fputs ("A NULL argv[0] was passed through an exec system call.\n",
stderr);
abort ();
}
slash = strrchr (argv0, '/');
base = (slash != NULL ? slash + 1 : argv0);
if (base - argv0 >= 7 && strncmp (base - 7, "/.libs/", 7) == 0)
{
argv0 = base;
if (strncmp (base, "lt-", 3) == 0)
{
argv0 = base + 3;
/* On glibc systems, remove the "lt-" prefix from the variable
program_invocation_short_name. */
#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
program_invocation_short_name = (char *) argv0;
#endif
}
}
/* But don't strip off a leading / in general, because when the user
runs
/some/hidden/place/bin/cp foo foo
he should get the error message
/some/hidden/place/bin/cp: `foo' and `foo' are the same file
not
cp: `foo' and `foo' are the same file
*/
program_name = argv0;
/* On glibc systems, the error() function comes from libc and uses the
variable program_invocation_name, not program_name. So set this variable
as well. */
#if HAVE_DECL_PROGRAM_INVOCATION_NAME
program_invocation_name = (char *) argv0;
#endif
}
recutils-1.5/lib/wait-process.h 0000644 0000000 0000000 00000005706 11703116216 013445 0000000 0000000 /* Waiting for a subprocess to finish.
Copyright (C) 2001-2003, 2006, 2008-2012 Free Software Foundation, Inc.
Written by Bruno Haible , 2001.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#ifndef _WAIT_PROCESS_H
#define _WAIT_PROCESS_H
/* Get pid_t. */
#include
#include
#include
#include
#ifdef __cplusplus
extern "C" {
#endif
/* Wait for a subprocess to finish. Return its exit code.
If it didn't terminate correctly, exit if exit_on_error is true, otherwise
return 127.
Arguments:
- child is the pid of the subprocess.
- progname is the name of the program executed by the subprocess, used for
error messages.
- If ignore_sigpipe is true, consider a subprocess termination due to
SIGPIPE as equivalent to a success. This is suitable for processes whose
only purpose is to write to standard output. This flag can be safely set
to false when the process' standard output is known to go to DEV_NULL.
- If null_stderr is true, the usual error message to stderr will be omitted.
This is suitable when the subprocess does not fulfill an important task.
- slave_process should be set to true if the process has been launched as a
slave process.
- If exit_on_error is true, any error will cause the main process to exit
with an error status.
- If termsigp is not NULL: *termsig will be set to the signal that
terminated the subprocess (if supported by the platform: not on native
Windows platforms), otherwise 0, and the error message about the signal
that terminated the subprocess will be omitted.
Prerequisites: The signal handler for SIGCHLD should not be set to SIG_IGN,
otherwise this function will not work. */
extern int wait_subprocess (pid_t child, const char *progname,
bool ignore_sigpipe, bool null_stderr,
bool slave_process, bool exit_on_error,
int *termsigp);
/* Register a subprocess as being a slave process. This means that the
subprocess will be terminated when its creator receives a catchable fatal
signal or exits normally. Registration ends when wait_subprocess()
notices that the subprocess has exited. */
extern void register_slave_subprocess (pid_t child);
#ifdef __cplusplus
}
#endif
#endif /* _WAIT_PROCESS_H */
recutils-1.5/lib/lseek.c 0000644 0000000 0000000 00000003421 11703116214 012111 0000000 0000000 /* An lseek() function that detects pipes.
Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#include
/* Specification. */
#include
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Windows platforms. */
/* Get GetFileType. */
# include
/* Get _get_osfhandle. */
# include "msvc-nothrow.h"
#else
# include
#endif
#include
#undef lseek
off_t
rpl_lseek (int fd, off_t offset, int whence)
{
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* mingw lseek mistakenly succeeds on pipes, sockets, and terminals. */
HANDLE h = (HANDLE) _get_osfhandle (fd);
if (h == INVALID_HANDLE_VALUE)
{
errno = EBADF;
return -1;
}
if (GetFileType (h) != FILE_TYPE_DISK)
{
errno = ESPIPE;
return -1;
}
#else
/* BeOS lseek mistakenly succeeds on pipes... */
struct stat statbuf;
if (fstat (fd, &statbuf) < 0)
return -1;
if (!S_ISREG (statbuf.st_mode))
{
errno = ESPIPE;
return -1;
}
#endif
return lseek (fd, offset, whence);
}
recutils-1.5/lib/mbtowc.c 0000644 0000000 0000000 00000001646 11703116214 012310 0000000 0000000 /* Convert multibyte character to wide character.
Copyright (C) 2011-2012 Free Software Foundation, Inc.
Written by Bruno Haible , 2011.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#include
#include
#include
#include
#include
#include "mbtowc-impl.h"
recutils-1.5/lib/isnanl.c 0000644 0000000 0000000 00000001525 11703116214 012275 0000000 0000000 /* Test for NaN that does not need libm.
Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* Written by Bruno Haible , 2007. */
#define USE_LONG_DOUBLE
#include "isnan.c"
recutils-1.5/lib/str-two-way.h 0000644 0000000 0000000 00000042276 11703116213 013242 0000000 0000000 /* Byte-wise substring search, using the Two-Way algorithm.
Copyright (C) 2008-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Eric Blake , 2008.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Before including this file, you need to include and
, and define:
RESULT_TYPE A macro that expands to the return type.
AVAILABLE(h, h_l, j, n_l)
A macro that returns nonzero if there are
at least N_L bytes left starting at H[J].
H is 'unsigned char *', H_L, J, and N_L
are 'size_t'; H_L is an lvalue. For
NUL-terminated searches, H_L can be
modified each iteration to avoid having
to compute the end of H up front.
For case-insensitivity, you may optionally define:
CMP_FUNC(p1, p2, l) A macro that returns 0 iff the first L
characters of P1 and P2 are equal.
CANON_ELEMENT(c) A macro that canonicalizes an element right after
it has been fetched from one of the two strings.
The argument is an 'unsigned char'; the result
must be an 'unsigned char' as well.
This file undefines the macros documented above, and defines
LONG_NEEDLE_THRESHOLD.
*/
#include
#include
/* We use the Two-Way string matching algorithm (also known as
Chrochemore-Perrin), which guarantees linear complexity with
constant space. Additionally, for long needles, we also use a bad
character shift table similar to the Boyer-Moore algorithm to
achieve improved (potentially sub-linear) performance.
See http://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260,
http://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm,
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.34.6641&rep=rep1&type=pdf
*/
/* Point at which computing a bad-byte shift table is likely to be
worthwhile. Small needles should not compute a table, since it
adds (1 << CHAR_BIT) + NEEDLE_LEN computations of preparation for a
speedup no greater than a factor of NEEDLE_LEN. The larger the
needle, the better the potential performance gain. On the other
hand, on non-POSIX systems with CHAR_BIT larger than eight, the
memory required for the table is prohibitive. */
#if CHAR_BIT < 10
# define LONG_NEEDLE_THRESHOLD 32U
#else
# define LONG_NEEDLE_THRESHOLD SIZE_MAX
#endif
#ifndef MAX
# define MAX(a, b) ((a < b) ? (b) : (a))
#endif
#ifndef CANON_ELEMENT
# define CANON_ELEMENT(c) c
#endif
#ifndef CMP_FUNC
# define CMP_FUNC memcmp
#endif
/* Perform a critical factorization of NEEDLE, of length NEEDLE_LEN.
Return the index of the first byte in the right half, and set
*PERIOD to the global period of the right half.
The global period of a string is the smallest index (possibly its
length) at which all remaining bytes in the string are repetitions
of the prefix (the last repetition may be a subset of the prefix).
When NEEDLE is factored into two halves, a local period is the
length of the smallest word that shares a suffix with the left half
and shares a prefix with the right half. All factorizations of a
non-empty NEEDLE have a local period of at least 1 and no greater
than NEEDLE_LEN.
A critical factorization has the property that the local period
equals the global period. All strings have at least one critical
factorization with the left half smaller than the global period.
And while some strings have more than one critical factorization,
it is provable that with an ordered alphabet, at least one of the
critical factorizations corresponds to a maximal suffix.
Given an ordered alphabet, a critical factorization can be computed
in linear time, with 2 * NEEDLE_LEN comparisons, by computing the
shorter of two ordered maximal suffixes. The ordered maximal
suffixes are determined by lexicographic comparison while tracking
periodicity. */
static size_t
critical_factorization (const unsigned char *needle, size_t needle_len,
size_t *period)
{
/* Index of last byte of left half, or SIZE_MAX. */
size_t max_suffix, max_suffix_rev;
size_t j; /* Index into NEEDLE for current candidate suffix. */
size_t k; /* Offset into current period. */
size_t p; /* Intermediate period. */
unsigned char a, b; /* Current comparison bytes. */
/* Special case NEEDLE_LEN of 1 or 2 (all callers already filtered
out 0-length needles. */
if (needle_len < 3)
{
*period = 1;
return needle_len - 1;
}
/* Invariants:
0 <= j < NEEDLE_LEN - 1
-1 <= max_suffix{,_rev} < j (treating SIZE_MAX as if it were signed)
min(max_suffix, max_suffix_rev) < global period of NEEDLE
1 <= p <= global period of NEEDLE
p == global period of the substring NEEDLE[max_suffix{,_rev}+1...j]
1 <= k <= p
*/
/* Perform lexicographic search. */
max_suffix = SIZE_MAX;
j = 0;
k = p = 1;
while (j + k < needle_len)
{
a = CANON_ELEMENT (needle[j + k]);
b = CANON_ELEMENT (needle[max_suffix + k]);
if (a < b)
{
/* Suffix is smaller, period is entire prefix so far. */
j += k;
k = 1;
p = j - max_suffix;
}
else if (a == b)
{
/* Advance through repetition of the current period. */
if (k != p)
++k;
else
{
j += p;
k = 1;
}
}
else /* b < a */
{
/* Suffix is larger, start over from current location. */
max_suffix = j++;
k = p = 1;
}
}
*period = p;
/* Perform reverse lexicographic search. */
max_suffix_rev = SIZE_MAX;
j = 0;
k = p = 1;
while (j + k < needle_len)
{
a = CANON_ELEMENT (needle[j + k]);
b = CANON_ELEMENT (needle[max_suffix_rev + k]);
if (b < a)
{
/* Suffix is smaller, period is entire prefix so far. */
j += k;
k = 1;
p = j - max_suffix_rev;
}
else if (a == b)
{
/* Advance through repetition of the current period. */
if (k != p)
++k;
else
{
j += p;
k = 1;
}
}
else /* a < b */
{
/* Suffix is larger, start over from current location. */
max_suffix_rev = j++;
k = p = 1;
}
}
/* Choose the shorter suffix. Return the index of the first byte of
the right half, rather than the last byte of the left half.
For some examples, 'banana' has two critical factorizations, both
exposed by the two lexicographic extreme suffixes of 'anana' and
'nana', where both suffixes have a period of 2. On the other
hand, with 'aab' and 'bba', both strings have a single critical
factorization of the last byte, with the suffix having a period
of 1. While the maximal lexicographic suffix of 'aab' is 'b',
the maximal lexicographic suffix of 'bba' is 'ba', which is not a
critical factorization. Conversely, the maximal reverse
lexicographic suffix of 'a' works for 'bba', but not 'ab' for
'aab'. The shorter suffix of the two will always be a critical
factorization. */
if (max_suffix_rev + 1 < max_suffix + 1)
return max_suffix + 1;
*period = p;
return max_suffix_rev + 1;
}
/* Return the first location of non-empty NEEDLE within HAYSTACK, or
NULL. HAYSTACK_LEN is the minimum known length of HAYSTACK. This
method is optimized for NEEDLE_LEN < LONG_NEEDLE_THRESHOLD.
Performance is guaranteed to be linear, with an initialization cost
of 2 * NEEDLE_LEN comparisons.
If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at
most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching.
If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. */
static RETURN_TYPE
two_way_short_needle (const unsigned char *haystack, size_t haystack_len,
const unsigned char *needle, size_t needle_len)
{
size_t i; /* Index into current byte of NEEDLE. */
size_t j; /* Index into current window of HAYSTACK. */
size_t period; /* The period of the right half of needle. */
size_t suffix; /* The index of the right half of needle. */
/* Factor the needle into two halves, such that the left half is
smaller than the global period, and the right half is
periodic (with a period as large as NEEDLE_LEN - suffix). */
suffix = critical_factorization (needle, needle_len, &period);
/* Perform the search. Each iteration compares the right half
first. */
if (CMP_FUNC (needle, needle + period, suffix) == 0)
{
/* Entire needle is periodic; a mismatch in the left half can
only advance by the period, so use memory to avoid rescanning
known occurrences of the period in the right half. */
size_t memory = 0;
j = 0;
while (AVAILABLE (haystack, haystack_len, j, needle_len))
{
/* Scan for matches in right half. */
i = MAX (suffix, memory);
while (i < needle_len && (CANON_ELEMENT (needle[i])
== CANON_ELEMENT (haystack[i + j])))
++i;
if (needle_len <= i)
{
/* Scan for matches in left half. */
i = suffix - 1;
while (memory < i + 1 && (CANON_ELEMENT (needle[i])
== CANON_ELEMENT (haystack[i + j])))
--i;
if (i + 1 < memory + 1)
return (RETURN_TYPE) (haystack + j);
/* No match, so remember how many repetitions of period
on the right half were scanned. */
j += period;
memory = needle_len - period;
}
else
{
j += i - suffix + 1;
memory = 0;
}
}
}
else
{
/* The two halves of needle are distinct; no extra memory is
required, and any mismatch results in a maximal shift. */
period = MAX (suffix, needle_len - suffix) + 1;
j = 0;
while (AVAILABLE (haystack, haystack_len, j, needle_len))
{
/* Scan for matches in right half. */
i = suffix;
while (i < needle_len && (CANON_ELEMENT (needle[i])
== CANON_ELEMENT (haystack[i + j])))
++i;
if (needle_len <= i)
{
/* Scan for matches in left half. */
i = suffix - 1;
while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
== CANON_ELEMENT (haystack[i + j])))
--i;
if (i == SIZE_MAX)
return (RETURN_TYPE) (haystack + j);
j += period;
}
else
j += i - suffix + 1;
}
}
return NULL;
}
/* Return the first location of non-empty NEEDLE within HAYSTACK, or
NULL. HAYSTACK_LEN is the minimum known length of HAYSTACK. This
method is optimized for LONG_NEEDLE_THRESHOLD <= NEEDLE_LEN.
Performance is guaranteed to be linear, with an initialization cost
of 3 * NEEDLE_LEN + (1 << CHAR_BIT) operations.
If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at
most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching,
and sublinear performance O(HAYSTACK_LEN / NEEDLE_LEN) is possible.
If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, and
sublinear performance is not possible. */
static RETURN_TYPE
two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
const unsigned char *needle, size_t needle_len)
{
size_t i; /* Index into current byte of NEEDLE. */
size_t j; /* Index into current window of HAYSTACK. */
size_t period; /* The period of the right half of needle. */
size_t suffix; /* The index of the right half of needle. */
size_t shift_table[1U << CHAR_BIT]; /* See below. */
/* Factor the needle into two halves, such that the left half is
smaller than the global period, and the right half is
periodic (with a period as large as NEEDLE_LEN - suffix). */
suffix = critical_factorization (needle, needle_len, &period);
/* Populate shift_table. For each possible byte value c,
shift_table[c] is the distance from the last occurrence of c to
the end of NEEDLE, or NEEDLE_LEN if c is absent from the NEEDLE.
shift_table[NEEDLE[NEEDLE_LEN - 1]] contains the only 0. */
for (i = 0; i < 1U << CHAR_BIT; i++)
shift_table[i] = needle_len;
for (i = 0; i < needle_len; i++)
shift_table[CANON_ELEMENT (needle[i])] = needle_len - i - 1;
/* Perform the search. Each iteration compares the right half
first. */
if (CMP_FUNC (needle, needle + period, suffix) == 0)
{
/* Entire needle is periodic; a mismatch in the left half can
only advance by the period, so use memory to avoid rescanning
known occurrences of the period in the right half. */
size_t memory = 0;
size_t shift;
j = 0;
while (AVAILABLE (haystack, haystack_len, j, needle_len))
{
/* Check the last byte first; if it does not match, then
shift to the next possible match location. */
shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
if (0 < shift)
{
if (memory && shift < period)
{
/* Since needle is periodic, but the last period has
a byte out of place, there can be no match until
after the mismatch. */
shift = needle_len - period;
}
memory = 0;
j += shift;
continue;
}
/* Scan for matches in right half. The last byte has
already been matched, by virtue of the shift table. */
i = MAX (suffix, memory);
while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
== CANON_ELEMENT (haystack[i + j])))
++i;
if (needle_len - 1 <= i)
{
/* Scan for matches in left half. */
i = suffix - 1;
while (memory < i + 1 && (CANON_ELEMENT (needle[i])
== CANON_ELEMENT (haystack[i + j])))
--i;
if (i + 1 < memory + 1)
return (RETURN_TYPE) (haystack + j);
/* No match, so remember how many repetitions of period
on the right half were scanned. */
j += period;
memory = needle_len - period;
}
else
{
j += i - suffix + 1;
memory = 0;
}
}
}
else
{
/* The two halves of needle are distinct; no extra memory is
required, and any mismatch results in a maximal shift. */
size_t shift;
period = MAX (suffix, needle_len - suffix) + 1;
j = 0;
while (AVAILABLE (haystack, haystack_len, j, needle_len))
{
/* Check the last byte first; if it does not match, then
shift to the next possible match location. */
shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
if (0 < shift)
{
j += shift;
continue;
}
/* Scan for matches in right half. The last byte has
already been matched, by virtue of the shift table. */
i = suffix;
while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
== CANON_ELEMENT (haystack[i + j])))
++i;
if (needle_len - 1 <= i)
{
/* Scan for matches in left half. */
i = suffix - 1;
while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
== CANON_ELEMENT (haystack[i + j])))
--i;
if (i == SIZE_MAX)
return (RETURN_TYPE) (haystack + j);
j += period;
}
else
j += i - suffix + 1;
}
}
return NULL;
}
#undef AVAILABLE
#undef CANON_ELEMENT
#undef CMP_FUNC
#undef MAX
#undef RETURN_TYPE
recutils-1.5/lib/fpending.c 0000644 0000000 0000000 00000002045 11703116214 012601 0000000 0000000 /* fpending.c -- return the number of pending output bytes on a stream
Copyright (C) 2000, 2004, 2006-2007, 2009-2012 Free Software Foundation,
Inc.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* Written by Jim Meyering. */
#include
#include "fpending.h"
/* Return the number of pending (aka buffered, unflushed)
bytes on the stream, FP, that is open for writing. */
size_t
__fpending (FILE *fp)
{
return PENDING_OUTPUT_N_BYTES;
}
recutils-1.5/lib/verify.h 0000644 0000000 0000000 00000022650 11703116215 012325 0000000 0000000 /* Compile-time assert-like macros.
Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
#ifndef _GL_VERIFY_H
# define _GL_VERIFY_H
/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11.
This is supported by GCC 4.6.0 and later, in C mode, and its use
here generates easier-to-read diagnostics when verify (R) fails.
Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11.
This will likely be supported by future GCC versions, in C++ mode.
Use this only with GCC. If we were willing to slow 'configure'
down we could also use it with other compilers, but since this
affects only the quality of diagnostics, why bother? */
# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined __cplusplus
# define _GL_HAVE__STATIC_ASSERT 1
# endif
/* The condition (99 < __GNUC__) is temporary, until we know about the
first G++ release that supports static_assert. */
# if (99 < __GNUC__) && defined __cplusplus
# define _GL_HAVE_STATIC_ASSERT 1
# endif
/* Each of these macros verifies that its argument R is nonzero. To
be portable, R should be an integer constant expression. Unlike
assert (R), there is no run-time overhead.
If _Static_assert works, verify (R) uses it directly. Similarly,
_GL_VERIFY_TRUE works by packaging a _Static_assert inside a struct
that is an operand of sizeof.
The code below uses several ideas for C++ compilers, and for C
compilers that do not support _Static_assert:
* The first step is ((R) ? 1 : -1). Given an expression R, of
integral or boolean or floating-point type, this yields an
expression of integral type, whose value is later verified to be
constant and nonnegative.
* Next this expression W is wrapped in a type
struct _gl_verify_type {
unsigned int _gl_verify_error_if_negative: W;
}.
If W is negative, this yields a compile-time error. No compiler can
deal with a bit-field of negative size.
One might think that an array size check would have the same
effect, that is, that the type struct { unsigned int dummy[W]; }
would work as well. However, inside a function, some compilers
(such as C++ compilers and GNU C) allow local parameters and
variables inside array size expressions. With these compilers,
an array size check would not properly diagnose this misuse of
the verify macro:
void function (int n) { verify (n < 0); }
* For the verify macro, the struct _gl_verify_type will need to
somehow be embedded into a declaration. To be portable, this
declaration must declare an object, a constant, a function, or a
typedef name. If the declared entity uses the type directly,
such as in
struct dummy {...};
typedef struct {...} dummy;
extern struct {...} *dummy;
extern void dummy (struct {...} *);
extern struct {...} *dummy (void);
two uses of the verify macro would yield colliding declarations
if the entity names are not disambiguated. A workaround is to
attach the current line number to the entity name:
#define _GL_CONCAT0(x, y) x##y
#define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
extern struct {...} * _GL_CONCAT (dummy, __LINE__);
But this has the problem that two invocations of verify from
within the same macro would collide, since the __LINE__ value
would be the same for both invocations. (The GCC __COUNTER__
macro solves this problem, but is not portable.)
A solution is to use the sizeof operator. It yields a number,
getting rid of the identity of the type. Declarations like
extern int dummy [sizeof (struct {...})];
extern void dummy (int [sizeof (struct {...})]);
extern int (*dummy (void)) [sizeof (struct {...})];
can be repeated.
* Should the implementation use a named struct or an unnamed struct?
Which of the following alternatives can be used?
extern int dummy [sizeof (struct {...})];
extern int dummy [sizeof (struct _gl_verify_type {...})];
extern void dummy (int [sizeof (struct {...})]);
extern void dummy (int [sizeof (struct _gl_verify_type {...})]);
extern int (*dummy (void)) [sizeof (struct {...})];
extern int (*dummy (void)) [sizeof (struct _gl_verify_type {...})];
In the second and sixth case, the struct type is exported to the
outer scope; two such declarations therefore collide. GCC warns
about the first, third, and fourth cases. So the only remaining
possibility is the fifth case:
extern int (*dummy (void)) [sizeof (struct {...})];
* GCC warns about duplicate declarations of the dummy function if
-Wredundant_decls is used. GCC 4.3 and later have a builtin
__COUNTER__ macro that can let us generate unique identifiers for
each dummy function, to suppress this warning.
* This implementation exploits the fact that older versions of GCC,
which do not support _Static_assert, also do not warn about the
last declaration mentioned above.
* In C++, any struct definition inside sizeof is invalid.
Use a template type to work around the problem. */
/* Concatenate two preprocessor tokens. */
# define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
# define _GL_CONCAT0(x, y) x##y
/* _GL_COUNTER is an integer, preferably one that changes each time we
use it. Use __COUNTER__ if it works, falling back on __LINE__
otherwise. __LINE__ isn't perfect, but it's better than a
constant. */
# if defined __COUNTER__ && __COUNTER__ != __COUNTER__
# define _GL_COUNTER __COUNTER__
# else
# define _GL_COUNTER __LINE__
# endif
/* Generate a symbol with the given prefix, making it unique if
possible. */
# define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
/* Verify requirement R at compile-time, as an integer constant expression
that returns 1. If R is false, fail at compile-time, preferably
with a diagnostic that includes the string-literal DIAGNOSTIC. */
# define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \
(!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
# ifdef __cplusplus
# if !GNULIB_defined_struct__gl_verify_type
template
struct _gl_verify_type {
unsigned int _gl_verify_error_if_negative: w;
};
# define GNULIB_defined_struct__gl_verify_type 1
# endif
# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
_gl_verify_type<(R) ? 1 : -1>
# elif defined _GL_HAVE__STATIC_ASSERT
# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
struct { \
_Static_assert (R, DIAGNOSTIC); \
int _gl_dummy; \
}
# else
# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; }
# endif
/* Verify requirement R at compile-time, as a declaration without a
trailing ';'. If R is false, fail at compile-time, preferably
with a diagnostic that includes the string-literal DIAGNOSTIC.
Unfortunately, unlike C11, this implementation must appear as an
ordinary declaration, and cannot appear inside struct { ... }. */
# ifdef _GL_HAVE__STATIC_ASSERT
# define _GL_VERIFY _Static_assert
# else
# define _GL_VERIFY(R, DIAGNOSTIC) \
extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
[_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
# endif
/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
# ifdef _GL_STATIC_ASSERT_H
# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert
# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
# endif
# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
# define static_assert _Static_assert /* C11 requires this #define. */
# endif
# endif
/* @assert.h omit start@ */
/* Each of these macros verifies that its argument R is nonzero. To
be portable, R should be an integer constant expression. Unlike
assert (R), there is no run-time overhead.
There are two macros, since no single macro can be used in all
contexts in C. verify_true (R) is for scalar contexts, including
integer constant expression contexts. verify (R) is for declaration
contexts, e.g., the top level. */
/* Verify requirement R at compile-time, as an integer constant expression.
Return 1. This is equivalent to verify_expr (R, 1).
verify_true is obsolescent; please use verify_expr instead. */
# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
/* Verify requirement R at compile-time. Return the value of the
expression E. */
# define verify_expr(R, E) \
(_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
/* Verify requirement R at compile-time, as a declaration without a
trailing ';'. */
# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
/* @assert.h omit end@ */
#endif
recutils-1.5/lib/stdint.in.h 0000644 0000000 0000000 00000042711 11703116215 012733 0000000 0000000 /* Copyright (C) 2001-2002, 2004-2012 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/*
* ISO C 99 for platforms that lack it.
*
*/
#ifndef _@GUARD_PREFIX@_STDINT_H
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
/* When including a system file that in turn includes ,
use the system , not our substitute. This avoids
problems with (for example) VMS, whose includes
. */
#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
/* Get those types that are already defined in other system include
files, so that we can "#define int8_t signed char" below without
worrying about a later system include file containing a "typedef
signed char int8_t;" that will get messed up by our macro. Our
macros should all be consistent with the system versions, except
for the "fast" types and macros, which we recommend against using
in public interfaces due to compiler differences. */
#if @HAVE_STDINT_H@
# if defined __sgi && ! defined __c99
/* Bypass IRIX's if in C89 mode, since it merely annoys users
with "This header file is to be used only for c99 mode compilations"
diagnostics. */
# define __STDINT_H__
# endif
/* Some pre-C++11 implementations need this. */
# ifdef __cplusplus
# ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS 1
# endif
# ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS 1
# endif
# endif
/* Other systems may have an incomplete or buggy .
Include it before , since any "#include "
in would reinclude us, skipping our contents because
_@GUARD_PREFIX@_STDINT_H is defined.
The include_next requires a split double-inclusion guard. */
# @INCLUDE_NEXT@ @NEXT_STDINT_H@
#endif
#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
#define _@GUARD_PREFIX@_STDINT_H
/* defines some of the stdint.h types as well, on glibc,
IRIX 6.5, and OpenBSD 3.8 (via ).
AIX 5.2 isn't needed and causes troubles.
MacOS X 10.4.6 includes (which is us), but
relies on the system definitions, so include
after @NEXT_STDINT_H@. */
#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
# include
#endif
/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */
#include
#if @HAVE_INTTYPES_H@
/* In OpenBSD 3.8, includes , which defines
int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
also defines intptr_t and uintptr_t. */
# include
#elif @HAVE_SYS_INTTYPES_H@
/* Solaris 7 has the types except the *_fast*_t types, and
the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */
# include
#endif
#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
/* Linux libc4 >= 4.6.7 and libc5 have a that defines
int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is
included by . */
# include
#endif
#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
/* Minimum and maximum values for an integer type under the usual assumption.
Return an unspecified value if BITS == 0, adding a check to pacify
picky compilers. */
#define _STDINT_MIN(signed, bits, zero) \
((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
#define _STDINT_MAX(signed, bits, zero) \
((signed) \
? ~ _STDINT_MIN (signed, bits, zero) \
: /* The expression for the unsigned case. The subtraction of (signed) \
is a nop in the unsigned case and avoids "signed integer overflow" \
warnings in the signed case. */ \
((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
#if !GNULIB_defined_stdint_types
/* 7.18.1.1. Exact-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. */
#undef int8_t
#undef uint8_t
typedef signed char gl_int8_t;
typedef unsigned char gl_uint8_t;
#define int8_t gl_int8_t
#define uint8_t gl_uint8_t
#undef int16_t
#undef uint16_t
typedef short int gl_int16_t;
typedef unsigned short int gl_uint16_t;
#define int16_t gl_int16_t
#define uint16_t gl_uint16_t
#undef int32_t
#undef uint32_t
typedef int gl_int32_t;
typedef unsigned int gl_uint32_t;
#define int32_t gl_int32_t
#define uint32_t gl_uint32_t
/* If the system defines INT64_MAX, assume int64_t works. That way,
if the underlying platform defines int64_t to be a 64-bit long long
int, the code below won't mistakenly define it to be a 64-bit long
int, which would mess up C++ name mangling. We must use #ifdef
rather than #if, to avoid an error with HP-UX 10.20 cc. */
#ifdef INT64_MAX
# define GL_INT64_T
#else
/* Do not undefine int64_t if gnulib is not being used with 64-bit
types, since otherwise it breaks platforms like Tandem/NSK. */
# if LONG_MAX >> 31 >> 31 == 1
# undef int64_t
typedef long int gl_int64_t;
# define int64_t gl_int64_t
# define GL_INT64_T
# elif defined _MSC_VER
# undef int64_t
typedef __int64 gl_int64_t;
# define int64_t gl_int64_t
# define GL_INT64_T
# elif @HAVE_LONG_LONG_INT@
# undef int64_t
typedef long long int gl_int64_t;
# define int64_t gl_int64_t
# define GL_INT64_T
# endif
#endif
#ifdef UINT64_MAX
# define GL_UINT64_T
#else
# if ULONG_MAX >> 31 >> 31 >> 1 == 1
# undef uint64_t
typedef unsigned long int gl_uint64_t;
# define uint64_t gl_uint64_t
# define GL_UINT64_T
# elif defined _MSC_VER
# undef uint64_t
typedef unsigned __int64 gl_uint64_t;
# define uint64_t gl_uint64_t
# define GL_UINT64_T
# elif @HAVE_UNSIGNED_LONG_LONG_INT@
# undef uint64_t
typedef unsigned long long int gl_uint64_t;
# define uint64_t gl_uint64_t
# define GL_UINT64_T
# endif
#endif
/* Avoid collision with Solaris 2.5.1 etc. */
#define _UINT8_T
#define _UINT32_T
#define _UINT64_T
/* 7.18.1.2. Minimum-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
are the same as the corresponding N_t types. */
#undef int_least8_t
#undef uint_least8_t
#undef int_least16_t
#undef uint_least16_t
#undef int_least32_t
#undef uint_least32_t
#undef int_least64_t
#undef uint_least64_t
#define int_least8_t int8_t
#define uint_least8_t uint8_t
#define int_least16_t int16_t
#define uint_least16_t uint16_t
#define int_least32_t int32_t
#define uint_least32_t uint32_t
#ifdef GL_INT64_T
# define int_least64_t int64_t
#endif
#ifdef GL_UINT64_T
# define uint_least64_t uint64_t
#endif
/* 7.18.1.3. Fastest minimum-width integer types */
/* Note: Other substitutes may define these types differently.
It is not recommended to use these types in public header files. */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
are taken from the same list of types. Assume that 'long int'
is fast enough for all narrower integers. */
#undef int_fast8_t
#undef uint_fast8_t
#undef int_fast16_t
#undef uint_fast16_t
#undef int_fast32_t
#undef uint_fast32_t
#undef int_fast64_t
#undef uint_fast64_t
typedef long int gl_int_fast8_t;
typedef unsigned long int gl_uint_fast8_t;
typedef long int gl_int_fast16_t;
typedef unsigned long int gl_uint_fast16_t;
typedef long int gl_int_fast32_t;
typedef unsigned long int gl_uint_fast32_t;
#define int_fast8_t gl_int_fast8_t
#define uint_fast8_t gl_uint_fast8_t
#define int_fast16_t gl_int_fast16_t
#define uint_fast16_t gl_uint_fast16_t
#define int_fast32_t gl_int_fast32_t
#define uint_fast32_t gl_uint_fast32_t
#ifdef GL_INT64_T
# define int_fast64_t int64_t
#endif
#ifdef GL_UINT64_T
# define uint_fast64_t uint64_t
#endif
/* 7.18.1.4. Integer types capable of holding object pointers */
#undef intptr_t
#undef uintptr_t
typedef long int gl_intptr_t;
typedef unsigned long int gl_uintptr_t;
#define intptr_t gl_intptr_t
#define uintptr_t gl_uintptr_t
/* 7.18.1.5. Greatest-width integer types */
/* Note: These types are compiler dependent. It may be unwise to use them in
public header files. */
/* If the system defines INTMAX_MAX, assume that intmax_t works, and
similarly for UINTMAX_MAX and uintmax_t. This avoids problems with
assuming one type where another is used by the system. */
#ifndef INTMAX_MAX
# undef INTMAX_C
# undef intmax_t
# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
typedef long long int gl_intmax_t;
# define intmax_t gl_intmax_t
# elif defined GL_INT64_T
# define intmax_t int64_t
# else
typedef long int gl_intmax_t;
# define intmax_t gl_intmax_t
# endif
#endif
#ifndef UINTMAX_MAX
# undef UINTMAX_C
# undef uintmax_t
# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
typedef unsigned long long int gl_uintmax_t;
# define uintmax_t gl_uintmax_t
# elif defined GL_UINT64_T
# define uintmax_t uint64_t
# else
typedef unsigned long int gl_uintmax_t;
# define uintmax_t gl_uintmax_t
# endif
#endif
/* Verify that intmax_t and uintmax_t have the same size. Too much code
breaks if this is not the case. If this check fails, the reason is likely
to be found in the autoconf macros. */
typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
? 1 : -1];
#define GNULIB_defined_stdint_types 1
#endif /* !GNULIB_defined_stdint_types */
/* 7.18.2. Limits of specified-width integer types */
/* 7.18.2.1. Limits of exact-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. */
#undef INT8_MIN
#undef INT8_MAX
#undef UINT8_MAX
#define INT8_MIN (~ INT8_MAX)
#define INT8_MAX 127
#define UINT8_MAX 255
#undef INT16_MIN
#undef INT16_MAX
#undef UINT16_MAX
#define INT16_MIN (~ INT16_MAX)
#define INT16_MAX 32767
#define UINT16_MAX 65535
#undef INT32_MIN
#undef INT32_MAX
#undef UINT32_MAX
#define INT32_MIN (~ INT32_MAX)
#define INT32_MAX 2147483647
#define UINT32_MAX 4294967295U
#if defined GL_INT64_T && ! defined INT64_MAX
/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
evaluates the latter incorrectly in preprocessor expressions. */
# define INT64_MIN (- INTMAX_C (1) << 63)
# define INT64_MAX INTMAX_C (9223372036854775807)
#endif
#if defined GL_UINT64_T && ! defined UINT64_MAX
# define UINT64_MAX UINTMAX_C (18446744073709551615)
#endif
/* 7.18.2.2. Limits of minimum-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
are the same as the corresponding N_t types. */
#undef INT_LEAST8_MIN
#undef INT_LEAST8_MAX
#undef UINT_LEAST8_MAX
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST8_MAX INT8_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#undef INT_LEAST16_MIN
#undef INT_LEAST16_MAX
#undef UINT_LEAST16_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST16_MAX INT16_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#undef INT_LEAST32_MIN
#undef INT_LEAST32_MAX
#undef UINT_LEAST32_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST32_MAX INT32_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#undef INT_LEAST64_MIN
#undef INT_LEAST64_MAX
#ifdef GL_INT64_T
# define INT_LEAST64_MIN INT64_MIN
# define INT_LEAST64_MAX INT64_MAX
#endif
#undef UINT_LEAST64_MAX
#ifdef GL_UINT64_T
# define UINT_LEAST64_MAX UINT64_MAX
#endif
/* 7.18.2.3. Limits of fastest minimum-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
are taken from the same list of types. */
#undef INT_FAST8_MIN
#undef INT_FAST8_MAX
#undef UINT_FAST8_MAX
#define INT_FAST8_MIN LONG_MIN
#define INT_FAST8_MAX LONG_MAX
#define UINT_FAST8_MAX ULONG_MAX
#undef INT_FAST16_MIN
#undef INT_FAST16_MAX
#undef UINT_FAST16_MAX
#define INT_FAST16_MIN LONG_MIN
#define INT_FAST16_MAX LONG_MAX
#define UINT_FAST16_MAX ULONG_MAX
#undef INT_FAST32_MIN
#undef INT_FAST32_MAX
#undef UINT_FAST32_MAX
#define INT_FAST32_MIN LONG_MIN
#define INT_FAST32_MAX LONG_MAX
#define UINT_FAST32_MAX ULONG_MAX
#undef INT_FAST64_MIN
#undef INT_FAST64_MAX
#ifdef GL_INT64_T
# define INT_FAST64_MIN INT64_MIN
# define INT_FAST64_MAX INT64_MAX
#endif
#undef UINT_FAST64_MAX
#ifdef GL_UINT64_T
# define UINT_FAST64_MAX UINT64_MAX
#endif
/* 7.18.2.4. Limits of integer types capable of holding object pointers */
#undef INTPTR_MIN
#undef INTPTR_MAX
#undef UINTPTR_MAX
#define INTPTR_MIN LONG_MIN
#define INTPTR_MAX LONG_MAX
#define UINTPTR_MAX ULONG_MAX
/* 7.18.2.5. Limits of greatest-width integer types */
#ifndef INTMAX_MAX
# undef INTMAX_MIN
# ifdef INT64_MAX
# define INTMAX_MIN INT64_MIN
# define INTMAX_MAX INT64_MAX
# else
# define INTMAX_MIN INT32_MIN
# define INTMAX_MAX INT32_MAX
# endif
#endif
#ifndef UINTMAX_MAX
# ifdef UINT64_MAX
# define UINTMAX_MAX UINT64_MAX
# else
# define UINTMAX_MAX UINT32_MAX
# endif
#endif
/* 7.18.3. Limits of other integer types */
/* ptrdiff_t limits */
#undef PTRDIFF_MIN
#undef PTRDIFF_MAX
#if @APPLE_UNIVERSAL_BUILD@
# ifdef _LP64
# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l)
# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
# else
# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0)
# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
# endif
#else
# define PTRDIFF_MIN \
_STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
# define PTRDIFF_MAX \
_STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
#endif
/* sig_atomic_t limits */
#undef SIG_ATOMIC_MIN
#undef SIG_ATOMIC_MAX
#define SIG_ATOMIC_MIN \
_STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
0@SIG_ATOMIC_T_SUFFIX@)
#define SIG_ATOMIC_MAX \
_STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
0@SIG_ATOMIC_T_SUFFIX@)
/* size_t limit */
#undef SIZE_MAX
#if @APPLE_UNIVERSAL_BUILD@
# ifdef _LP64
# define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
# else
# define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
# endif
#else
# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
#endif
/* wchar_t limits */
/* Get WCHAR_MIN, WCHAR_MAX.
This include is not on the top, above, because on OSF/1 4.0 we have a
sequence of nested includes
-> -> -> , and the latter includes
and assumes its types are already defined. */
#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
/* BSD/OS 4.0.1 has a bug: , and must be
included before . */
# include
# include
# include
# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
# include
# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
#endif
#undef WCHAR_MIN
#undef WCHAR_MAX
#define WCHAR_MIN \
_STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
#define WCHAR_MAX \
_STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
/* wint_t limits */
#undef WINT_MIN
#undef WINT_MAX
#define WINT_MIN \
_STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
#define WINT_MAX \
_STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
/* 7.18.4. Macros for integer constants */
/* 7.18.4.1. Macros for minimum-width integer constants */
/* According to ISO C 99 Technical Corrigendum 1 */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */
#undef INT8_C
#undef UINT8_C
#define INT8_C(x) x
#define UINT8_C(x) x
#undef INT16_C
#undef UINT16_C
#define INT16_C(x) x
#define UINT16_C(x) x
#undef INT32_C
#undef UINT32_C
#define INT32_C(x) x
#define UINT32_C(x) x ## U
#undef INT64_C
#undef UINT64_C
#if LONG_MAX >> 31 >> 31 == 1
# define INT64_C(x) x##L
#elif defined _MSC_VER
# define INT64_C(x) x##i64
#elif @HAVE_LONG_LONG_INT@
# define INT64_C(x) x##LL
#endif
#if ULONG_MAX >> 31 >> 31 >> 1 == 1
# define UINT64_C(x) x##UL
#elif defined _MSC_VER
# define UINT64_C(x) x##ui64
#elif @HAVE_UNSIGNED_LONG_LONG_INT@
# define UINT64_C(x) x##ULL
#endif
/* 7.18.4.2. Macros for greatest-width integer constants */
#ifndef INTMAX_C
# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
# define INTMAX_C(x) x##LL
# elif defined GL_INT64_T
# define INTMAX_C(x) INT64_C(x)
# else
# define INTMAX_C(x) x##L
# endif
#endif
#ifndef UINTMAX_C
# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
# define UINTMAX_C(x) x##ULL
# elif defined GL_UINT64_T
# define UINTMAX_C(x) UINT64_C(x)
# else
# define UINTMAX_C(x) x##UL
# endif
#endif
#endif /* _@GUARD_PREFIX@_STDINT_H */
#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
recutils-1.5/lib/execute.h 0000644 0000000 0000000 00000004002 11703116214 012451 0000000 0000000 /* Creation of autonomous subprocesses.
Copyright (C) 2001-2003, 2008-2012 Free Software Foundation, Inc.
Written by Bruno Haible , 2001.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#ifndef _EXECUTE_H
#define _EXECUTE_H
#include
/* Execute a command, optionally redirecting any of the three standard file
descriptors to /dev/null. Return its exit code.
If it didn't terminate correctly, exit if exit_on_error is true, otherwise
return 127.
If ignore_sigpipe is true, consider a subprocess termination due to SIGPIPE
as equivalent to a success. This is suitable for processes whose only
purpose is to write to standard output.
If slave_process is true, the child process will be terminated when its
creator receives a catchable fatal signal.
If termsigp is not NULL, *termsig will be set to the signal that terminated
the subprocess (if supported by the platform: not on native Windows
platforms), otherwise 0.
It is recommended that no signal is blocked or ignored while execute()
is called. See pipe.h for the reason. */
extern int execute (const char *progname,
const char *prog_path, char **prog_argv,
bool ignore_sigpipe,
bool null_stdin, bool null_stdout, bool null_stderr,
bool slave_process, bool exit_on_error,
int *termsigp);
#endif /* _EXECUTE_H */
recutils-1.5/lib/wctype.in.h 0000644 0000000 0000000 00000031244 11703116216 012741 0000000 0000000 /* A substitute for ISO C99 , for platforms that lack it.
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 General Public License as published by
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Bruno Haible and Paul Eggert. */
/*
* ISO C 99 for platforms that lack it.
*
*
* iswctype, towctrans, towlower, towupper, wctrans, wctype,
* wctrans_t, and wctype_t are not yet implemented.
*/
#ifndef _@GUARD_PREFIX@_WCTYPE_H
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
#if @HAVE_WINT_T@
/* Solaris 2.5 has a bug: must be included before .
Tru64 with Desktop Toolkit C has a bug: must be included before
.
BSD/OS 4.0.1 has a bug: , and must be
included before . */
# include
# include
# include
# include
#endif
/* Include the original if it exists.
BeOS 5 has the functions but no . */
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_WCTYPE_H@
# @INCLUDE_NEXT@ @NEXT_WCTYPE_H@
#endif
#ifndef _@GUARD_PREFIX@_WCTYPE_H
#define _@GUARD_PREFIX@_WCTYPE_H
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
/* Solaris 2.6 includes which includes which
#defines a number of identifiers in the application namespace. Revert
these #defines. */
#ifdef __sun
# undef multibyte
# undef eucw1
# undef eucw2
# undef eucw3
# undef scrw1
# undef scrw2
# undef scrw3
#endif
/* Define wint_t and WEOF. (Also done in wchar.in.h.) */
#if !@HAVE_WINT_T@ && !defined wint_t
# define wint_t int
# ifndef WEOF
# define WEOF -1
# endif
#else
/* MSVC defines wint_t as 'unsigned short' in .
This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
"unchanged by default argument promotions". Override it. */
# if defined _MSC_VER
# if !GNULIB_defined_wint_t
# include
typedef unsigned int rpl_wint_t;
# undef wint_t
# define wint_t rpl_wint_t
# define GNULIB_defined_wint_t 1
# endif
# endif
# ifndef WEOF
# define WEOF ((wint_t) -1)
# endif
#endif
#if !GNULIB_defined_wctype_functions
/* FreeBSD 4.4 to 4.11 has but lacks the functions.
Linux libc5 has and the functions but they are broken.
Assume all 11 functions (all isw* except iswblank) are implemented the
same way, or not at all. */
# if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
/* IRIX 5.3 has macros but no functions, its isw* macros refer to an
undefined variable _ctmp_ and to macros like _P, and they
refer to system functions like _iswctype that are not in the
standard C library. Rather than try to get ancient buggy
implementations like this to work, just disable them. */
# undef iswalnum
# undef iswalpha
# undef iswblank
# undef iswcntrl
# undef iswdigit
# undef iswgraph
# undef iswlower
# undef iswprint
# undef iswpunct
# undef iswspace
# undef iswupper
# undef iswxdigit
# undef towlower
# undef towupper
/* Linux libc5 has and the functions but they are broken. */
# if @REPLACE_ISWCNTRL@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define iswalnum rpl_iswalnum
# define iswalpha rpl_iswalpha
# define iswblank rpl_iswblank
# define iswcntrl rpl_iswcntrl
# define iswdigit rpl_iswdigit
# define iswgraph rpl_iswgraph
# define iswlower rpl_iswlower
# define iswprint rpl_iswprint
# define iswpunct rpl_iswpunct
# define iswspace rpl_iswspace
# define iswupper rpl_iswupper
# define iswxdigit rpl_iswxdigit
# endif
# endif
# if @REPLACE_TOWLOWER@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define towlower rpl_towlower
# define towupper rpl_towupper
# endif
# endif
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswalnum
# else
iswalnum
# endif
(wint_t wc)
{
return ((wc >= '0' && wc <= '9')
|| ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
}
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswalpha
# else
iswalpha
# endif
(wint_t wc)
{
return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
}
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswblank
# else
iswblank
# endif
(wint_t wc)
{
return wc == ' ' || wc == '\t';
}
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswcntrl
# else
iswcntrl
# endif
(wint_t wc)
{
return (wc & ~0x1f) == 0 || wc == 0x7f;
}
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswdigit
# else
iswdigit
# endif
(wint_t wc)
{
return wc >= '0' && wc <= '9';
}
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswgraph
# else
iswgraph
# endif
(wint_t wc)
{
return wc >= '!' && wc <= '~';
}
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswlower
# else
iswlower
# endif
(wint_t wc)
{
return wc >= 'a' && wc <= 'z';
}
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswprint
# else
iswprint
# endif
(wint_t wc)
{
return wc >= ' ' && wc <= '~';
}
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswpunct
# else
iswpunct
# endif
(wint_t wc)
{
return (wc >= '!' && wc <= '~'
&& !((wc >= '0' && wc <= '9')
|| ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
}
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswspace
# else
iswspace
# endif
(wint_t wc)
{
return (wc == ' ' || wc == '\t'
|| wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
}
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswupper
# else
iswupper
# endif
(wint_t wc)
{
return wc >= 'A' && wc <= 'Z';
}
static inline int
# if @REPLACE_ISWCNTRL@
rpl_iswxdigit
# else
iswxdigit
# endif
(wint_t wc)
{
return ((wc >= '0' && wc <= '9')
|| ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
}
static inline wint_t
# if @REPLACE_TOWLOWER@
rpl_towlower
# else
towlower
# endif
(wint_t wc)
{
return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
}
static inline wint_t
# if @REPLACE_TOWLOWER@
rpl_towupper
# else
towupper
# endif
(wint_t wc)
{
return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
}
# elif @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@)
/* Only the iswblank function is missing. */
# if @REPLACE_ISWBLANK@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define iswblank rpl_iswblank
# endif
_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
# else
_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
# endif
# endif
# if defined __MINGW32__
/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
The functions towlower and towupper are implemented in the MSVCRT library
to take a wchar_t argument and return a wchar_t result. mingw declares
these functions to take a wint_t argument and return a wint_t result.
This means that:
1. When the user passes an argument outside the range 0x0000..0xFFFF, the
function will look only at the lower 16 bits. This is allowed according
to POSIX.
2. The return value is returned in the lower 16 bits of the result register.
The upper 16 bits are random: whatever happened to be in that part of the
result register. We need to fix this by adding a zero-extend from
wchar_t to wint_t after the call. */
static inline wint_t
rpl_towlower (wint_t wc)
{
return (wint_t) (wchar_t) towlower (wc);
}
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define towlower rpl_towlower
# endif
static inline wint_t
rpl_towupper (wint_t wc)
{
return (wint_t) (wchar_t) towupper (wc);
}
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define towupper rpl_towupper
# endif
# endif /* __MINGW32__ */
# define GNULIB_defined_wctype_functions 1
#endif
#if @REPLACE_ISWCNTRL@
_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
#else
_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswlower, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswprint, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswspace, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
#endif
_GL_CXXALIASWARN (iswalnum);
_GL_CXXALIASWARN (iswalpha);
_GL_CXXALIASWARN (iswcntrl);
_GL_CXXALIASWARN (iswdigit);
_GL_CXXALIASWARN (iswgraph);
_GL_CXXALIASWARN (iswlower);
_GL_CXXALIASWARN (iswprint);
_GL_CXXALIASWARN (iswpunct);
_GL_CXXALIASWARN (iswspace);
_GL_CXXALIASWARN (iswupper);
_GL_CXXALIASWARN (iswxdigit);
#if @GNULIB_ISWBLANK@
# if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@
_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
# else
_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
# endif
_GL_CXXALIASWARN (iswblank);
#endif
#if !@HAVE_WCTYPE_T@
# if !GNULIB_defined_wctype_t
typedef void * wctype_t;
# define GNULIB_defined_wctype_t 1
# endif
#endif
/* Get a descriptor for a wide character property. */
#if @GNULIB_WCTYPE@
# if !@HAVE_WCTYPE_T@
_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name));
# endif
_GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
_GL_CXXALIASWARN (wctype);
#elif defined GNULIB_POSIXCHECK
# undef wctype
# if HAVE_RAW_DECL_WCTYPE
_GL_WARN_ON_USE (wctype, "wctype is unportable - "
"use gnulib module wctype for portability");
# endif
#endif
/* Test whether a wide character has a given property.
The argument WC must be either a wchar_t value or WEOF.
The argument DESC must have been returned by the wctype() function. */
#if @GNULIB_ISWCTYPE@
# if !@HAVE_WCTYPE_T@
_GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc));
# endif
_GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc));
_GL_CXXALIASWARN (iswctype);
#elif defined GNULIB_POSIXCHECK
# undef iswctype
# if HAVE_RAW_DECL_ISWCTYPE
_GL_WARN_ON_USE (iswctype, "iswctype is unportable - "
"use gnulib module iswctype for portability");
# endif
#endif
#if @REPLACE_TOWLOWER@ || defined __MINGW32__
_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
#else
_GL_CXXALIAS_SYS (towlower, wint_t, (wint_t wc));
_GL_CXXALIAS_SYS (towupper, wint_t, (wint_t wc));
#endif
_GL_CXXALIASWARN (towlower);
_GL_CXXALIASWARN (towupper);
#if !@HAVE_WCTRANS_T@
# if !GNULIB_defined_wctrans_t
typedef void * wctrans_t;
# define GNULIB_defined_wctrans_t 1
# endif
#endif
/* Get a descriptor for a wide character case conversion. */
#if @GNULIB_WCTRANS@
# if !@HAVE_WCTRANS_T@
_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name));
# endif
_GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
_GL_CXXALIASWARN (wctrans);
#elif defined GNULIB_POSIXCHECK
# undef wctrans
# if HAVE_RAW_DECL_WCTRANS
_GL_WARN_ON_USE (wctrans, "wctrans is unportable - "
"use gnulib module wctrans for portability");
# endif
#endif
/* Perform a given case conversion on a wide character.
The argument WC must be either a wchar_t value or WEOF.
The argument DESC must have been returned by the wctrans() function. */
#if @GNULIB_TOWCTRANS@
# if !@HAVE_WCTRANS_T@
_GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
# endif
_GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
_GL_CXXALIASWARN (towctrans);
#elif defined GNULIB_POSIXCHECK
# undef towctrans
# if HAVE_RAW_DECL_TOWCTRANS
_GL_WARN_ON_USE (towctrans, "towctrans is unportable - "
"use gnulib module towctrans for portability");
# endif
#endif
#endif /* _@GUARD_PREFIX@_WCTYPE_H */
#endif /* _@GUARD_PREFIX@_WCTYPE_H */
recutils-1.5/lib/spawnattr_setsigmask.c 0000644 0000000 0000000 00000002154 11703116215 015266 0000000 0000000 /* Copyright (C) 2000, 2009-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#include
/* Specification. */
#include
#include
/* Set signal mask for the new process in ATTR to SIGMASK. */
int
posix_spawnattr_setsigmask (posix_spawnattr_t *attr,
const sigset_t *sigmask)
{
/* Copy the sigset_t data to the user buffer. */
memcpy (&attr->_ss, sigmask, sizeof (sigset_t));
return 0;
}
recutils-1.5/lib/spawnattr_setflags.c 0000644 0000000 0000000 00000003200 11703116215 014715 0000000 0000000 /* Copyright (C) 2000, 2004, 2009-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#include
/* Specification. */
#include
#include
#include
#define ALL_FLAGS (POSIX_SPAWN_RESETIDS \
| POSIX_SPAWN_SETPGROUP \
| POSIX_SPAWN_SETSIGDEF \
| POSIX_SPAWN_SETSIGMASK \
| POSIX_SPAWN_SETSCHEDPARAM \
| POSIX_SPAWN_SETSCHEDULER \
| POSIX_SPAWN_USEVFORK)
/* Store flags in the attribute structure. */
int
posix_spawnattr_setflags (posix_spawnattr_t *attr, short int flags)
{
/* Check no invalid bits are set. */
if (flags & ~ALL_FLAGS)
return EINVAL;
/* Store the flag word. */
attr->_flags = flags;
return 0;
}
recutils-1.5/lib/w32spawn.h 0000644 0000000 0000000 00000015406 11703116216 012507 0000000 0000000 /* Auxiliary functions for the creation of subprocesses. Native Windows API.
Copyright (C) 2001, 2003-2012 Free Software Foundation, Inc.
Written by Bruno Haible , 2003.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* Get declarations of the native Windows API functions. */
#define WIN32_LEAN_AND_MEAN
#include
/* Get _open_osfhandle(). */
#include
#include
#include
#include
#include
/* Get _get_osfhandle(). */
#include "msvc-nothrow.h"
#include "cloexec.h"
#include "xalloc.h"
/* Duplicates a file handle, making the copy uninheritable.
Returns -1 for a file handle that is equivalent to closed. */
static int
dup_noinherit (int fd)
{
fd = dup_cloexec (fd);
if (fd < 0 && errno == EMFILE)
error (EXIT_FAILURE, errno, _("_open_osfhandle failed"));
return fd;
}
/* Returns a file descriptor equivalent to FD, except that the resulting file
descriptor is none of STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO.
FD must be open and non-inheritable. The result will be non-inheritable as
well.
If FD < 0, FD itself is returned. */
static int
fd_safer_noinherit (int fd)
{
if (STDIN_FILENO <= fd && fd <= STDERR_FILENO)
{
/* The recursion depth is at most 3. */
int nfd = fd_safer_noinherit (dup_noinherit (fd));
int saved_errno = errno;
close (fd);
errno = saved_errno;
return nfd;
}
return fd;
}
/* Duplicates a file handle, making the copy uninheritable and ensuring the
result is none of STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO.
Returns -1 for a file handle that is equivalent to closed. */
static int
dup_safer_noinherit (int fd)
{
return fd_safer_noinherit (dup_noinherit (fd));
}
/* Undoes the effect of TEMPFD = dup_safer_noinherit (ORIGFD); */
static void
undup_safer_noinherit (int tempfd, int origfd)
{
if (tempfd >= 0)
{
if (dup2 (tempfd, origfd) < 0)
error (EXIT_FAILURE, errno, _("cannot restore fd %d: dup2 failed"),
origfd);
close (tempfd);
}
else
{
/* origfd was closed or open to no handle at all. Set it to a closed
state. This is (nearly) equivalent to the original state. */
close (origfd);
}
}
/* Prepares an argument vector before calling spawn().
Note that spawn() does not by itself call the command interpreter
(getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&v);
v.dwPlatformId == VER_PLATFORM_WIN32_NT;
}) ? "cmd.exe" : "command.com").
Instead it simply concatenates the arguments, separated by ' ', and calls
CreateProcess(). We must quote the arguments since Windows CreateProcess()
interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
special way:
- Space and tab are interpreted as delimiters. They are not treated as
delimiters if they are surrounded by double quotes: "...".
- Unescaped double quotes are removed from the input. Their only effect is
that within double quotes, space and tab are treated like normal
characters.
- Backslashes not followed by double quotes are not special.
- But 2*n+1 backslashes followed by a double quote become
n backslashes followed by a double quote (n >= 0):
\" -> "
\\\" -> \"
\\\\\" -> \\"
*/
#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
static char **
prepare_spawn (char **argv)
{
size_t argc;
char **new_argv;
size_t i;
/* Count number of arguments. */
for (argc = 0; argv[argc] != NULL; argc++)
;
/* Allocate new argument vector. */
new_argv = XNMALLOC (1 + argc + 1, char *);
/* Add an element upfront that can be used when argv[0] turns out to be a
script, not a program.
On Unix, this would be "/bin/sh". On native Windows, "sh" is actually
"sh.exe". We have to omit the directory part and rely on the search in
PATH, because the mingw "mount points" are not visible inside Windows
CreateProcess(). */
*new_argv++ = "sh.exe";
/* Put quoted arguments into the new argument vector. */
for (i = 0; i < argc; i++)
{
const char *string = argv[i];
if (string[0] == '\0')
new_argv[i] = xstrdup ("\"\"");
else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
{
bool quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
size_t length;
unsigned int backslashes;
const char *s;
char *quoted_string;
char *p;
length = 0;
backslashes = 0;
if (quote_around)
length++;
for (s = string; *s != '\0'; s++)
{
char c = *s;
if (c == '"')
length += backslashes + 1;
length++;
if (c == '\\')
backslashes++;
else
backslashes = 0;
}
if (quote_around)
length += backslashes + 1;
quoted_string = (char *) xmalloc (length + 1);
p = quoted_string;
backslashes = 0;
if (quote_around)
*p++ = '"';
for (s = string; *s != '\0'; s++)
{
char c = *s;
if (c == '"')
{
unsigned int j;
for (j = backslashes + 1; j > 0; j--)
*p++ = '\\';
}
*p++ = c;
if (c == '\\')
backslashes++;
else
backslashes = 0;
}
if (quote_around)
{
unsigned int j;
for (j = backslashes; j > 0; j--)
*p++ = '\\';
*p++ = '"';
}
*p = '\0';
new_argv[i] = quoted_string;
}
else
new_argv[i] = (char *) string;
}
new_argv[argc] = NULL;
return new_argv;
}
recutils-1.5/lib/fatal-signal.c 0000644 0000000 0000000 00000017216 11703116214 013357 0000000 0000000 /* Emergency actions in case of a fatal signal.
Copyright (C) 2003-2004, 2006-2012 Free Software Foundation, Inc.
Written by Bruno Haible , 2003.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#include
/* Specification. */
#include "fatal-signal.h"
#include
#include
#include
#include
#include "sig-handler.h"
#include "xalloc.h"
#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
/* ========================================================================= */
/* The list of fatal signals.
These are those signals whose default action is to terminate the process
without a core dump, except
SIGKILL - because it cannot be caught,
SIGALRM SIGUSR1 SIGUSR2 SIGPOLL SIGIO SIGLOST - because applications
often use them for their own purpose,
SIGPROF SIGVTALRM - because they are used for profiling,
SIGSTKFLT - because it is more similar to SIGFPE, SIGSEGV, SIGBUS,
SIGSYS - because it is more similar to SIGABRT, SIGSEGV,
SIGPWR - because it of too special use,
SIGRTMIN...SIGRTMAX - because they are reserved for application use.
plus
SIGXCPU, SIGXFSZ - because they are quite similar to SIGTERM. */
static int fatal_signals[] =
{
/* ISO C 99 signals. */
#ifdef SIGINT
SIGINT,
#endif
#ifdef SIGTERM
SIGTERM,
#endif
/* POSIX:2001 signals. */
#ifdef SIGHUP
SIGHUP,
#endif
#ifdef SIGPIPE
SIGPIPE,
#endif
/* BSD signals. */
#ifdef SIGXCPU
SIGXCPU,
#endif
#ifdef SIGXFSZ
SIGXFSZ,
#endif
/* Native Windows signals. */
#ifdef SIGBREAK
SIGBREAK,
#endif
0
};
#define num_fatal_signals (SIZEOF (fatal_signals) - 1)
/* Eliminate signals whose signal handler is SIG_IGN. */
static void
init_fatal_signals (void)
{
static bool fatal_signals_initialized = false;
if (!fatal_signals_initialized)
{
size_t i;
for (i = 0; i < num_fatal_signals; i++)
{
struct sigaction action;
if (sigaction (fatal_signals[i], NULL, &action) >= 0
&& get_handler (&action) == SIG_IGN)
fatal_signals[i] = -1;
}
fatal_signals_initialized = true;
}
}
/* ========================================================================= */
typedef void (*action_t) (void);
/* Type of an entry in the actions array.
The 'action' field is accessed from within the fatal_signal_handler(),
therefore we mark it as 'volatile'. */
typedef struct
{
volatile action_t action;
}
actions_entry_t;
/* The registered cleanup actions. */
static actions_entry_t static_actions[32];
static actions_entry_t * volatile actions = static_actions;
static sig_atomic_t volatile actions_count = 0;
static size_t actions_allocated = SIZEOF (static_actions);
/* The saved signal handlers.
Size 32 would not be sufficient: On HP-UX, SIGXCPU = 33, SIGXFSZ = 34. */
static struct sigaction saved_sigactions[64];
/* Uninstall the handlers. */
static inline void
uninstall_handlers ()
{
size_t i;
for (i = 0; i < num_fatal_signals; i++)
if (fatal_signals[i] >= 0)
{
int sig = fatal_signals[i];
if (saved_sigactions[sig].sa_handler == SIG_IGN)
saved_sigactions[sig].sa_handler = SIG_DFL;
sigaction (sig, &saved_sigactions[sig], NULL);
}
}
/* The signal handler. It gets called asynchronously. */
static void
fatal_signal_handler (int sig)
{
for (;;)
{
/* Get the last registered cleanup action, in a reentrant way. */
action_t action;
size_t n = actions_count;
if (n == 0)
break;
n--;
actions_count = n;
action = actions[n].action;
/* Execute the action. */
action ();
}
/* Now execute the signal's default action.
If the signal being delivered was blocked, the re-raised signal would be
delivered when this handler returns. But the way we install this handler,
no signal is blocked, and the re-raised signal is delivered already
during raise(). */
uninstall_handlers ();
raise (sig);
}
/* Install the handlers. */
static inline void
install_handlers ()
{
size_t i;
struct sigaction action;
action.sa_handler = &fatal_signal_handler;
/* If we get a fatal signal while executing fatal_signal_handler, enter
fatal_signal_handler recursively, since it is reentrant. Hence no
SA_RESETHAND. */
action.sa_flags = SA_NODEFER;
sigemptyset (&action.sa_mask);
for (i = 0; i < num_fatal_signals; i++)
if (fatal_signals[i] >= 0)
{
int sig = fatal_signals[i];
if (!(sig < sizeof (saved_sigactions) / sizeof (saved_sigactions[0])))
abort ();
sigaction (sig, &action, &saved_sigactions[sig]);
}
}
/* Register a cleanup function to be executed when a catchable fatal signal
occurs. */
void
at_fatal_signal (action_t action)
{
static bool cleanup_initialized = false;
if (!cleanup_initialized)
{
init_fatal_signals ();
install_handlers ();
cleanup_initialized = true;
}
if (actions_count == actions_allocated)
{
/* Extend the actions array. Note that we cannot use xrealloc(),
because then the cleanup() function could access an already
deallocated array. */
actions_entry_t *old_actions = actions;
size_t old_actions_allocated = actions_allocated;
size_t new_actions_allocated = 2 * actions_allocated;
actions_entry_t *new_actions =
XNMALLOC (new_actions_allocated, actions_entry_t);
size_t k;
/* Don't use memcpy() here, because memcpy takes non-volatile arguments
and is therefore not guaranteed to complete all memory stores before
the next statement. */
for (k = 0; k < old_actions_allocated; k++)
new_actions[k] = old_actions[k];
actions = new_actions;
actions_allocated = new_actions_allocated;
/* Now we can free the old actions array. */
if (old_actions != static_actions)
free (old_actions);
}
/* The two uses of 'volatile' in the types above (and ISO C 99 section
5.1.2.3.(5)) ensure that we increment the actions_count only after
the new action has been written to the memory location
actions[actions_count]. */
actions[actions_count].action = action;
actions_count++;
}
/* ========================================================================= */
static sigset_t fatal_signal_set;
static void
init_fatal_signal_set ()
{
static bool fatal_signal_set_initialized = false;
if (!fatal_signal_set_initialized)
{
size_t i;
init_fatal_signals ();
sigemptyset (&fatal_signal_set);
for (i = 0; i < num_fatal_signals; i++)
if (fatal_signals[i] >= 0)
sigaddset (&fatal_signal_set, fatal_signals[i]);
fatal_signal_set_initialized = true;
}
}
/* Temporarily delay the catchable fatal signals. */
void
block_fatal_signals ()
{
init_fatal_signal_set ();
sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL);
}
/* Stop delaying the catchable fatal signals. */
void
unblock_fatal_signals ()
{
init_fatal_signal_set ();
sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL);
}
recutils-1.5/lib/printf-frexp.c 0000644 0000000 0000000 00000012316 11703116215 013436 0000000 0000000 /* Split a double into fraction and mantissa, for hexadecimal printf.
Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
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
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#if ! defined USE_LONG_DOUBLE
# include
#endif
/* Specification. */
#ifdef USE_LONG_DOUBLE
# include "printf-frexpl.h"
#else
# include "printf-frexp.h"
#endif
#include
#include
#ifdef USE_LONG_DOUBLE
# include "fpucw.h"
#endif
/* This file assumes FLT_RADIX = 2. If FLT_RADIX is a power of 2 greater
than 2, or not even a power of 2, some rounding errors can occur, so that
then the returned mantissa is only guaranteed to be <= 2.0, not < 2.0. */
#ifdef USE_LONG_DOUBLE
# define FUNC printf_frexpl
# define DOUBLE long double
# define MIN_EXP LDBL_MIN_EXP
# if HAVE_FREXPL_IN_LIBC && HAVE_LDEXPL_IN_LIBC
# define USE_FREXP_LDEXP
# define FREXP frexpl
# define LDEXP ldexpl
# endif
# define DECL_ROUNDING DECL_LONG_DOUBLE_ROUNDING
# define BEGIN_ROUNDING() BEGIN_LONG_DOUBLE_ROUNDING ()
# define END_ROUNDING() END_LONG_DOUBLE_ROUNDING ()
# define L_(literal) literal##L
#else
# define FUNC printf_frexp
# define DOUBLE double
# define MIN_EXP DBL_MIN_EXP
# if HAVE_FREXP_IN_LIBC && HAVE_LDEXP_IN_LIBC
# define USE_FREXP_LDEXP
# define FREXP frexp
# define LDEXP ldexp
# endif
# define DECL_ROUNDING
# define BEGIN_ROUNDING()
# define END_ROUNDING()
# define L_(literal) literal
#endif
DOUBLE
FUNC (DOUBLE x, int *expptr)
{
int exponent;
DECL_ROUNDING
BEGIN_ROUNDING ();
#ifdef USE_FREXP_LDEXP
/* frexp and ldexp are usually faster than the loop below. */
x = FREXP (x, &exponent);
x = x + x;
exponent -= 1;
if (exponent < MIN_EXP - 1)
{
x = LDEXP (x, exponent - (MIN_EXP - 1));
exponent = MIN_EXP - 1;
}
#else
{
/* Since the exponent is an 'int', it fits in 64 bits. Therefore the
loops are executed no more than 64 times. */
DOUBLE pow2[64]; /* pow2[i] = 2^2^i */
DOUBLE powh[64]; /* powh[i] = 2^-2^i */
int i;
exponent = 0;
if (x >= L_(1.0))
{
/* A nonnegative exponent. */
{
DOUBLE pow2_i; /* = pow2[i] */
DOUBLE powh_i; /* = powh[i] */
/* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
x * 2^exponent = argument, x >= 1.0. */
for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
;
i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
{
if (x >= pow2_i)
{
exponent += (1 << i);
x *= powh_i;
}
else
break;
pow2[i] = pow2_i;
powh[i] = powh_i;
}
}
/* Here 1.0 <= x < 2^2^i. */
}
else
{
/* A negative exponent. */
{
DOUBLE pow2_i; /* = pow2[i] */
DOUBLE powh_i; /* = powh[i] */
/* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
x * 2^exponent = argument, x < 1.0, exponent >= MIN_EXP - 1. */
for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
;
i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
{
if (exponent - (1 << i) < MIN_EXP - 1)
break;
exponent -= (1 << i);
x *= pow2_i;
if (x >= L_(1.0))
break;
pow2[i] = pow2_i;
powh[i] = powh_i;
}
}
/* Here either x < 1.0 and exponent - 2^i < MIN_EXP - 1 <= exponent,
or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
if (x < L_(1.0))
/* Invariants: x * 2^exponent = argument, x < 1.0 and
exponent - 2^i < MIN_EXP - 1 <= exponent. */
while (i > 0)
{
i--;
if (exponent - (1 << i) >= MIN_EXP - 1)
{
exponent -= (1 << i);
x *= pow2[i];
if (x >= L_(1.0))
break;
}
}
/* Here either x < 1.0 and exponent = MIN_EXP - 1,
or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
}
/* Invariants: x * 2^exponent = argument, and
either x < 1.0 and exponent = MIN_EXP - 1,
or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
while (i > 0)
{
i--;
if (x >= pow2[i])
{
exponent += (1 << i);
x *= powh[i];
}
}
/* Here either x < 1.0 and exponent = MIN_EXP - 1,
or 1.0 <= x < 2.0 and exponent >= MIN_EXP - 1. */
}
#endif
END_ROUNDING ();
*expptr = exponent;
return x;
}
recutils-1.5/lib/fprintf.c 0000644 0000000 0000000 00000003364 11703371706 012475 0000000 0000000 /* Formatted output to a stream.
Copyright (C) 2004, 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 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#ifdef HAVE_CONFIG_H
# include
#endif
/* Specification. */
#include
#include
#include
#include
#include
#include "fseterr.h"
#include "vasnprintf.h"
/* Print formatted output to the stream FP.
Return string length of formatted string. On error, return a negative
value. */
int
fprintf (FILE *fp, const char *format, ...)
{
char buf[2000];
char *output;
size_t len;
size_t lenbuf = sizeof (buf);
va_list args;
va_start (args, format);
output = vasnprintf (buf, &lenbuf, format, args);
len = lenbuf;
va_end (args);
if (!output)
{
fseterr (fp);
return -1;
}
if (fwrite (output, 1, len, fp) < len)
{
if (output != buf)
{
int saved_errno = errno;
free (output);
errno = saved_errno;
}
return -1;
}
if (output != buf)
free (output);
if (len > INT_MAX)
{
errno = EOVERFLOW;
fseterr (fp);
return -1;
}
return len;
}
recutils-1.5/lib/stdio.in.h 0000644 0000000 0000000 00000141057 11703116215 012553 0000000 0000000 /* A GNU-like .
Copyright (C) 2004, 2007-2012 Free Software Foundation, Inc.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
/* Special invocation convention:
- Inside glibc header files.
- On OSF/1 5.1 we have a sequence of nested includes
-> -> -> ->
-> -> -> .
In this situation, the functions are not yet declared, therefore we cannot
provide the C++ aliases. */
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
#else
/* Normal invocation convention. */
#ifndef _@GUARD_PREFIX@_STDIO_H
#define _GL_ALREADY_INCLUDING_STDIO_H
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
#undef _GL_ALREADY_INCLUDING_STDIO_H
#ifndef _@GUARD_PREFIX@_STDIO_H
#define _@GUARD_PREFIX@_STDIO_H
/* Get va_list. Needed on many systems, including glibc 2.8. */
#include
#include
/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
and eglibc 2.11.2. */
#include
/* The __attribute__ feature is available in gcc versions 2.5 and later.
The __-protected variants of the attributes 'format' and 'printf' are
accepted by gcc versions 2.6.4 (effectively 2.7) and later.
We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
gnulib and libintl do '#define printf __printf__' when they override
the 'printf' function. */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
#else
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
#endif
/* _GL_ATTRIBUTE_FORMAT_PRINTF
indicates to GCC that the function takes a format string and arguments,
where the format string directives are the ones standardized by ISO C99
and POSIX. */
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
_GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
#else
# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
_GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
#endif
/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
except that it indicates to GCC that the supported format string directives
are the ones of the system printf(), rather than the ones standardized by
ISO C99 and POSIX. */
#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
_GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
/* _GL_ATTRIBUTE_FORMAT_SCANF
indicates to GCC that the function takes a format string and arguments,
where the format string directives are the ones standardized by ISO C99
and POSIX. */
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
_GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
#else
# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
_GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
#endif
/* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
except that it indicates to GCC that the supported format string directives
are the ones of the system scanf(), rather than the ones standardized by
ISO C99 and POSIX. */
#define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
_GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
/* Solaris 10 declares renameat in , not in . */
/* But in any case avoid namespace pollution on glibc systems. */
#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \
&& ! defined __GLIBC__
# include
#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. */
/* Macros for stringification. */
#define _GL_STDIO_STRINGIZE(token) #token
#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
#if @GNULIB_DPRINTF@
# if @REPLACE_DPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define dprintf rpl_dprintf
# endif
_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
# else
# if !@HAVE_DPRINTF@
_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
# endif
_GL_CXXALIASWARN (dprintf);
#elif defined GNULIB_POSIXCHECK
# undef dprintf
# if HAVE_RAW_DECL_DPRINTF
_GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
"use gnulib module dprintf for portability");
# endif
#endif
#if @GNULIB_FCLOSE@
/* Close STREAM and its underlying file descriptor. */
# if @REPLACE_FCLOSE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fclose rpl_fclose
# endif
_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
# else
_GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
# endif
_GL_CXXALIASWARN (fclose);
#elif defined GNULIB_POSIXCHECK
# undef fclose
/* Assume fclose is always declared. */
_GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
"use gnulib module fclose for portable POSIX compliance");
#endif
#if @GNULIB_FDOPEN@
# if @REPLACE_FDOPEN@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fdopen
# define fdopen rpl_fdopen
# endif
_GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
# else
_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
# endif
_GL_CXXALIASWARN (fdopen);
#elif defined GNULIB_POSIXCHECK
# undef fdopen
/* Assume fdopen is always declared. */
_GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
"use gnulib module fdopen for portability");
#endif
#if @GNULIB_FFLUSH@
/* Flush all pending data on STREAM according to POSIX rules. Both
output and seekable input streams are supported.
Note! LOSS OF DATA can occur if fflush is applied on an input stream
that is _not_seekable_ or on an update stream that is _not_seekable_
and in which the most recent operation was input. Seekability can
be tested with lseek(fileno(fp),0,SEEK_CUR). */
# if @REPLACE_FFLUSH@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fflush rpl_fflush
# endif
_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
_GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
# else
_GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
# endif
_GL_CXXALIASWARN (fflush);
#elif defined GNULIB_POSIXCHECK
# undef fflush
/* Assume fflush is always declared. */
_GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
"use gnulib module fflush for portable POSIX compliance");
#endif
#if @GNULIB_FGETC@
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fgetc
# define fgetc rpl_fgetc
# endif
_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
# else
_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
# endif
_GL_CXXALIASWARN (fgetc);
#endif
#if @GNULIB_FGETS@
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fgets
# define fgets rpl_fgets
# endif
_GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream)
_GL_ARG_NONNULL ((1, 3)));
_GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
# else
_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
# endif
_GL_CXXALIASWARN (fgets);
#endif
#if @GNULIB_FOPEN@
# if @REPLACE_FOPEN@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fopen
# define fopen rpl_fopen
# endif
_GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
# else
_GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
# endif
_GL_CXXALIASWARN (fopen);
#elif defined GNULIB_POSIXCHECK
# undef fopen
/* Assume fopen is always declared. */
_GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
"use gnulib module fopen for portability");
#endif
#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
|| (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fprintf rpl_fprintf
# endif
# define GNULIB_overrides_fprintf 1
# if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# else
_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
# else
_GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
# endif
_GL_CXXALIASWARN (fprintf);
#endif
#if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
# if !GNULIB_overrides_fprintf
# undef fprintf
# endif
/* Assume fprintf is always declared. */
_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
"use gnulib module fprintf-posix for portable "
"POSIX compliance");
#endif
#if @GNULIB_FPURGE@
/* Discard all pending buffered I/O data on STREAM.
STREAM must not be wide-character oriented.
When discarding pending output, the file position is set back to where it
was before the write calls. When discarding pending input, the file
position is advanced to match the end of the previously read input.
Return 0 if successful. Upon error, return -1 and set errno. */
# if @REPLACE_FPURGE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fpurge rpl_fpurge
# endif
_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
# else
# if !@HAVE_DECL_FPURGE@
_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
# endif
_GL_CXXALIASWARN (fpurge);
#elif defined GNULIB_POSIXCHECK
# undef fpurge
# if HAVE_RAW_DECL_FPURGE
_GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
"use gnulib module fpurge for portability");
# endif
#endif
#if @GNULIB_FPUTC@
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fputc
# define fputc rpl_fputc
# endif
_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
# else
_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
# endif
_GL_CXXALIASWARN (fputc);
#endif
#if @GNULIB_FPUTS@
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fputs
# define fputs rpl_fputs
# endif
_GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
# else
_GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
# endif
_GL_CXXALIASWARN (fputs);
#endif
#if @GNULIB_FREAD@
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fread
# define fread rpl_fread
# endif
_GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)
_GL_ARG_NONNULL ((4)));
_GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
# else
_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
# endif
_GL_CXXALIASWARN (fread);
#endif
#if @GNULIB_FREOPEN@
# if @REPLACE_FREOPEN@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef freopen
# define freopen rpl_freopen
# endif
_GL_FUNCDECL_RPL (freopen, FILE *,
(const char *filename, const char *mode, FILE *stream)
_GL_ARG_NONNULL ((2, 3)));
_GL_CXXALIAS_RPL (freopen, FILE *,
(const char *filename, const char *mode, FILE *stream));
# else
_GL_CXXALIAS_SYS (freopen, FILE *,
(const char *filename, const char *mode, FILE *stream));
# endif
_GL_CXXALIASWARN (freopen);
#elif defined GNULIB_POSIXCHECK
# undef freopen
/* Assume freopen is always declared. */
_GL_WARN_ON_USE (freopen,
"freopen on native Windows platforms is not POSIX compliant - "
"use gnulib module freopen for portability");
#endif
#if @GNULIB_FSCANF@
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fscanf
# define fscanf rpl_fscanf
# endif
_GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
# else
_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
# endif
_GL_CXXALIASWARN (fscanf);
#endif
/* Set up the following warnings, based on which modules are in use.
GNU Coding Standards discourage the use of fseek, since it imposes
an arbitrary limitation on some 32-bit hosts. Remember that the
fseek module depends on the fseeko module, so we only have three
cases to consider:
1. The developer is not using either module. Issue a warning under
GNULIB_POSIXCHECK for both functions, to remind them that both
functions have bugs on some systems. _GL_NO_LARGE_FILES has no
impact on this warning.
2. The developer is using both modules. They may be unaware of the
arbitrary limitations of fseek, so issue a warning under
GNULIB_POSIXCHECK. On the other hand, they may be using both
modules intentionally, so the developer can define
_GL_NO_LARGE_FILES in the compilation units where the use of fseek
is safe, to silence the warning.
3. The developer is using the fseeko module, but not fseek. Gnulib
guarantees that fseek will still work around platform bugs in that
case, but we presume that the developer is aware of the pitfalls of
fseek and was trying to avoid it, so issue a warning even when
GNULIB_POSIXCHECK is undefined. Again, _GL_NO_LARGE_FILES can be
defined to silence the warning in particular compilation units.
In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
fseek gets defined as a macro, it is recommended that the developer
uses the fseek module, even if he is not calling the fseek function.
Most gnulib clients that perform stream operations should fall into
category 3. */
#if @GNULIB_FSEEK@
# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
# define _GL_FSEEK_WARN /* Category 2, above. */
# undef fseek
# endif
# if @REPLACE_FSEEK@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fseek
# define fseek rpl_fseek
# endif
_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
# else
_GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
# endif
_GL_CXXALIASWARN (fseek);
#endif
#if @GNULIB_FSEEKO@
# if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
# define _GL_FSEEK_WARN /* Category 3, above. */
# undef fseek
# endif
# if @REPLACE_FSEEKO@
/* Provide an fseeko function that is aware of a preceding fflush(), and which
detects pipes. */
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fseeko
# define fseeko rpl_fseeko
# endif
_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
# else
# if ! @HAVE_DECL_FSEEKO@
_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
# endif
_GL_CXXALIASWARN (fseeko);
#elif defined GNULIB_POSIXCHECK
# define _GL_FSEEK_WARN /* Category 1, above. */
# undef fseek
# undef fseeko
# if HAVE_RAW_DECL_FSEEKO
_GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
"use gnulib module fseeko for portability");
# endif
#endif
#ifdef _GL_FSEEK_WARN
# undef _GL_FSEEK_WARN
/* Here, either fseek is undefined (but C89 guarantees that it is
declared), or it is defined as rpl_fseek (declared above). */
_GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
"on 32-bit platforms - "
"use fseeko function for handling of large files");
#endif
/* ftell, ftello. See the comments on fseek/fseeko. */
#if @GNULIB_FTELL@
# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
# define _GL_FTELL_WARN /* Category 2, above. */
# undef ftell
# endif
# if @REPLACE_FTELL@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef ftell
# define ftell rpl_ftell
# endif
_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
# else
_GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
# endif
_GL_CXXALIASWARN (ftell);
#endif
#if @GNULIB_FTELLO@
# if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
# define _GL_FTELL_WARN /* Category 3, above. */
# undef ftell
# endif
# if @REPLACE_FTELLO@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef ftello
# define ftello rpl_ftello
# endif
_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
# else
# if ! @HAVE_DECL_FTELLO@
_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
# endif
_GL_CXXALIASWARN (ftello);
#elif defined GNULIB_POSIXCHECK
# define _GL_FTELL_WARN /* Category 1, above. */
# undef ftell
# undef ftello
# if HAVE_RAW_DECL_FTELLO
_GL_WARN_ON_USE (ftello, "ftello is unportable - "
"use gnulib module ftello for portability");
# endif
#endif
#ifdef _GL_FTELL_WARN
# undef _GL_FTELL_WARN
/* Here, either ftell is undefined (but C89 guarantees that it is
declared), or it is defined as rpl_ftell (declared above). */
_GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
"on 32-bit platforms - "
"use ftello function for handling of large files");
#endif
#if @GNULIB_FWRITE@
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fwrite
# define fwrite rpl_fwrite
# endif
_GL_FUNCDECL_RPL (fwrite, size_t,
(const void *ptr, size_t s, size_t n, FILE *stream)
_GL_ARG_NONNULL ((1, 4)));
_GL_CXXALIAS_RPL (fwrite, size_t,
(const void *ptr, size_t s, size_t n, FILE *stream));
# else
_GL_CXXALIAS_SYS (fwrite, size_t,
(const void *ptr, size_t s, size_t n, FILE *stream));
/* Work around glibc bug 11959
,
which sometimes causes an unwanted diagnostic for fwrite calls.
This affects only function declaration attributes, so it's not
needed for C++. */
# if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL
static inline size_t _GL_ARG_NONNULL ((1, 4))
rpl_fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
{
size_t r = fwrite (ptr, s, n, stream);
(void) r;
return r;
}
# undef fwrite
# define fwrite rpl_fwrite
# endif
# endif
_GL_CXXALIASWARN (fwrite);
#endif
#if @GNULIB_GETC@
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef getc
# define getc rpl_fgetc
# endif
_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
# else
_GL_CXXALIAS_SYS (getc, int, (FILE *stream));
# endif
_GL_CXXALIASWARN (getc);
#endif
#if @GNULIB_GETCHAR@
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef getchar
# define getchar rpl_getchar
# endif
_GL_FUNCDECL_RPL (getchar, int, (void));
_GL_CXXALIAS_RPL (getchar, int, (void));
# else
_GL_CXXALIAS_SYS (getchar, int, (void));
# endif
_GL_CXXALIASWARN (getchar);
#endif
#if @GNULIB_GETDELIM@
/* Read input, up to (and including) the next occurrence of DELIMITER, from
STREAM, store it in *LINEPTR (and NUL-terminate it).
*LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
bytes of space. It is realloc'd as necessary.
Return the number of bytes read and stored at *LINEPTR (not including the
NUL terminator), or -1 on error or EOF. */
# if @REPLACE_GETDELIM@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef getdelim
# define getdelim rpl_getdelim
# endif
_GL_FUNCDECL_RPL (getdelim, ssize_t,
(char **lineptr, size_t *linesize, int delimiter,
FILE *stream)
_GL_ARG_NONNULL ((1, 2, 4)));
_GL_CXXALIAS_RPL (getdelim, ssize_t,
(char **lineptr, size_t *linesize, int delimiter,
FILE *stream));
# else
# if !@HAVE_DECL_GETDELIM@
_GL_FUNCDECL_SYS (getdelim, ssize_t,
(char **lineptr, size_t *linesize, int delimiter,
FILE *stream)
_GL_ARG_NONNULL ((1, 2, 4)));
# endif
_GL_CXXALIAS_SYS (getdelim, ssize_t,
(char **lineptr, size_t *linesize, int delimiter,
FILE *stream));
# endif
_GL_CXXALIASWARN (getdelim);
#elif defined GNULIB_POSIXCHECK
# undef getdelim
# if HAVE_RAW_DECL_GETDELIM
_GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
"use gnulib module getdelim for portability");
# endif
#endif
#if @GNULIB_GETLINE@
/* Read a line, up to (and including) the next newline, from STREAM, store it
in *LINEPTR (and NUL-terminate it).
*LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
bytes of space. It is realloc'd as necessary.
Return the number of bytes read and stored at *LINEPTR (not including the
NUL terminator), or -1 on error or EOF. */
# if @REPLACE_GETLINE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef getline
# define getline rpl_getline
# endif
_GL_FUNCDECL_RPL (getline, ssize_t,
(char **lineptr, size_t *linesize, FILE *stream)
_GL_ARG_NONNULL ((1, 2, 3)));
_GL_CXXALIAS_RPL (getline, ssize_t,
(char **lineptr, size_t *linesize, FILE *stream));
# else
# if !@HAVE_DECL_GETLINE@
_GL_FUNCDECL_SYS (getline, ssize_t,
(char **lineptr, size_t *linesize, FILE *stream)
_GL_ARG_NONNULL ((1, 2, 3)));
# endif
_GL_CXXALIAS_SYS (getline, ssize_t,
(char **lineptr, size_t *linesize, FILE *stream));
# endif
# if @HAVE_DECL_GETLINE@
_GL_CXXALIASWARN (getline);
# endif
#elif defined GNULIB_POSIXCHECK
# undef getline
# if HAVE_RAW_DECL_GETLINE
_GL_WARN_ON_USE (getline, "getline is unportable - "
"use gnulib module getline for portability");
# endif
#endif
#if @GNULIB_GETS@
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef gets
# define gets rpl_gets
# endif
_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (gets, char *, (char *s));
# else
_GL_CXXALIAS_SYS (gets, char *, (char *s));
# undef gets
# endif
_GL_CXXALIASWARN (gets);
/* It is very rare that the developer ever has full control of stdin,
so any use of gets warrants an unconditional warning. Assume it is
always declared, since it is required by C89. */
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
#endif
#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
struct obstack;
/* Grow an obstack with formatted output. Return the number of
bytes added to OBS. No trailing nul byte is added, and the
object should be closed with obstack_finish before use. Upon
memory allocation error, call obstack_alloc_failed_handler. Upon
other error, return -1. */
# if @REPLACE_OBSTACK_PRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define obstack_printf rpl_obstack_printf
# endif
_GL_FUNCDECL_RPL (obstack_printf, int,
(struct obstack *obs, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_printf, int,
(struct obstack *obs, const char *format, ...));
# else
# if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_printf, int,
(struct obstack *obs, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (obstack_printf, int,
(struct obstack *obs, const char *format, ...));
# endif
_GL_CXXALIASWARN (obstack_printf);
# if @REPLACE_OBSTACK_PRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define obstack_vprintf rpl_obstack_vprintf
# endif
_GL_FUNCDECL_RPL (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args));
# else
# if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args));
# endif
_GL_CXXALIASWARN (obstack_vprintf);
#endif
#if @GNULIB_PCLOSE@
# if !@HAVE_PCLOSE@
_GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
_GL_CXXALIASWARN (pclose);
#elif defined GNULIB_POSIXCHECK
# undef pclose
# if HAVE_RAW_DECL_PCLOSE
_GL_WARN_ON_USE (pclose, "popen is unportable - "
"use gnulib module pclose for more portability");
# endif
#endif
#if @GNULIB_PERROR@
/* Print a message to standard error, describing the value of ERRNO,
(if STRING is not NULL and not empty) prefixed with STRING and ": ",
and terminated with a newline. */
# if @REPLACE_PERROR@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define perror rpl_perror
# endif
_GL_FUNCDECL_RPL (perror, void, (const char *string));
_GL_CXXALIAS_RPL (perror, void, (const char *string));
# else
_GL_CXXALIAS_SYS (perror, void, (const char *string));
# endif
_GL_CXXALIASWARN (perror);
#elif defined GNULIB_POSIXCHECK
# undef perror
/* Assume perror is always declared. */
_GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
"use gnulib module perror for portability");
#endif
#if @GNULIB_POPEN@
# if @REPLACE_POPEN@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef popen
# define popen rpl_popen
# endif
_GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
# else
# if !@HAVE_POPEN@
_GL_FUNCDECL_SYS (popen, FILE *, (const char *cmd, const char *mode)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
# endif
_GL_CXXALIASWARN (popen);
#elif defined GNULIB_POSIXCHECK
# undef popen
# if HAVE_RAW_DECL_POPEN
_GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
"use gnulib module popen or pipe for more portability");
# endif
#endif
#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
|| (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if defined __GNUC__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
/* Don't break __attribute__((format(printf,M,N))). */
# define printf __printf__
# endif
# if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
_GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
_GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
_GL_ARG_NONNULL ((1)));
# else
_GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
_GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
# else
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define printf rpl_printf
# endif
_GL_FUNCDECL_RPL (printf, int,
(const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
# endif
# define GNULIB_overrides_printf 1
# else
_GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
# endif
_GL_CXXALIASWARN (printf);
#endif
#if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
# if !GNULIB_overrides_printf
# undef printf
# endif
/* Assume printf is always declared. */
_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
"use gnulib module printf-posix for portable "
"POSIX compliance");
#endif
#if @GNULIB_PUTC@
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef putc
# define putc rpl_fputc
# endif
_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
# else
_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
# endif
_GL_CXXALIASWARN (putc);
#endif
#if @GNULIB_PUTCHAR@
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef putchar
# define putchar rpl_putchar
# endif
_GL_FUNCDECL_RPL (putchar, int, (int c));
_GL_CXXALIAS_RPL (putchar, int, (int c));
# else
_GL_CXXALIAS_SYS (putchar, int, (int c));
# endif
_GL_CXXALIASWARN (putchar);
#endif
#if @GNULIB_PUTS@
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef puts
# define puts rpl_puts
# endif
_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (puts, int, (const char *string));
# else
_GL_CXXALIAS_SYS (puts, int, (const char *string));
# endif
_GL_CXXALIASWARN (puts);
#endif
#if @GNULIB_REMOVE@
# if @REPLACE_REMOVE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef remove
# define remove rpl_remove
# endif
_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (remove, int, (const char *name));
# else
_GL_CXXALIAS_SYS (remove, int, (const char *name));
# endif
_GL_CXXALIASWARN (remove);
#elif defined GNULIB_POSIXCHECK
# undef remove
/* Assume remove is always declared. */
_GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
"use gnulib module remove for more portability");
#endif
#if @GNULIB_RENAME@
# if @REPLACE_RENAME@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef rename
# define rename rpl_rename
# endif
_GL_FUNCDECL_RPL (rename, int,
(const char *old_filename, const char *new_filename)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (rename, int,
(const char *old_filename, const char *new_filename));
# else
_GL_CXXALIAS_SYS (rename, int,
(const char *old_filename, const char *new_filename));
# endif
_GL_CXXALIASWARN (rename);
#elif defined GNULIB_POSIXCHECK
# undef rename
/* Assume rename is always declared. */
_GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
"use gnulib module rename for more portability");
#endif
#if @GNULIB_RENAMEAT@
# if @REPLACE_RENAMEAT@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef renameat
# define renameat rpl_renameat
# endif
_GL_FUNCDECL_RPL (renameat, int,
(int fd1, char const *file1, int fd2, char const *file2)
_GL_ARG_NONNULL ((2, 4)));
_GL_CXXALIAS_RPL (renameat, int,
(int fd1, char const *file1, int fd2, char const *file2));
# else
# if !@HAVE_RENAMEAT@
_GL_FUNCDECL_SYS (renameat, int,
(int fd1, char const *file1, int fd2, char const *file2)
_GL_ARG_NONNULL ((2, 4)));
# endif
_GL_CXXALIAS_SYS (renameat, int,
(int fd1, char const *file1, int fd2, char const *file2));
# endif
_GL_CXXALIASWARN (renameat);
#elif defined GNULIB_POSIXCHECK
# undef renameat
# if HAVE_RAW_DECL_RENAMEAT
_GL_WARN_ON_USE (renameat, "renameat is not portable - "
"use gnulib module renameat for portability");
# endif
#endif
#if @GNULIB_SCANF@
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
# if defined __GNUC__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef scanf
/* Don't break __attribute__((format(scanf,M,N))). */
# define scanf __scanf__
# endif
_GL_FUNCDECL_RPL_1 (__scanf__, int,
(const char *format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
_GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...));
# else
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef scanf
# define scanf rpl_scanf
# endif
_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
# endif
# else
_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
# endif
_GL_CXXALIASWARN (scanf);
#endif
#if @GNULIB_SNPRINTF@
# if @REPLACE_SNPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define snprintf rpl_snprintf
# endif
_GL_FUNCDECL_RPL (snprintf, int,
(char *str, size_t size, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (snprintf, int,
(char *str, size_t size, const char *format, ...));
# else
# if !@HAVE_DECL_SNPRINTF@
_GL_FUNCDECL_SYS (snprintf, int,
(char *str, size_t size, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
_GL_ARG_NONNULL ((3)));
# endif
_GL_CXXALIAS_SYS (snprintf, int,
(char *str, size_t size, const char *format, ...));
# endif
_GL_CXXALIASWARN (snprintf);
#elif defined GNULIB_POSIXCHECK
# undef snprintf
# if HAVE_RAW_DECL_SNPRINTF
_GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
"use gnulib module snprintf for portability");
# endif
#endif
/* Some people would argue that sprintf should be handled like gets
(for example, OpenBSD issues a link warning for both functions),
since both can cause security holes due to buffer overruns.
However, we believe that sprintf can be used safely, and is more
efficient than snprintf in those safe cases; and as proof of our
belief, we use sprintf in several gnulib modules. So this header
intentionally avoids adding a warning to sprintf except when
GNULIB_POSIXCHECK is defined. */
#if @GNULIB_SPRINTF_POSIX@
# if @REPLACE_SPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define sprintf rpl_sprintf
# endif
_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
# else
_GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
# endif
_GL_CXXALIASWARN (sprintf);
#elif defined GNULIB_POSIXCHECK
# undef sprintf
/* Assume sprintf is always declared. */
_GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
"use gnulib module sprintf-posix for portable "
"POSIX compliance");
#endif
#if @GNULIB_TMPFILE@
# if @REPLACE_TMPFILE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define tmpfile rpl_tmpfile
# endif
_GL_FUNCDECL_RPL (tmpfile, FILE *, (void));
_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
# else
_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
# endif
_GL_CXXALIASWARN (tmpfile);
#elif defined GNULIB_POSIXCHECK
# undef tmpfile
# if HAVE_RAW_DECL_TMPFILE
_GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
"use gnulib module tmpfile for portability");
# endif
#endif
#if @GNULIB_VASPRINTF@
/* Write formatted output to a string dynamically allocated with malloc().
If the memory allocation succeeds, store the address of the string in
*RESULT and return the number of resulting bytes, excluding the trailing
NUL. Upon memory allocation error, or some other error, return -1. */
# if @REPLACE_VASPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define asprintf rpl_asprintf
# endif
_GL_FUNCDECL_RPL (asprintf, int,
(char **result, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (asprintf, int,
(char **result, const char *format, ...));
# else
# if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (asprintf, int,
(char **result, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (asprintf, int,
(char **result, const char *format, ...));
# endif
_GL_CXXALIASWARN (asprintf);
# if @REPLACE_VASPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vasprintf rpl_vasprintf
# endif
_GL_FUNCDECL_RPL (vasprintf, int,
(char **result, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vasprintf, int,
(char **result, const char *format, va_list args));
# else
# if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (vasprintf, int,
(char **result, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (vasprintf, int,
(char **result, const char *format, va_list args));
# endif
_GL_CXXALIASWARN (vasprintf);
#endif
#if @GNULIB_VDPRINTF@
# if @REPLACE_VDPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vdprintf rpl_vdprintf
# endif
_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
# else
# if !@HAVE_VDPRINTF@
_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((2)));
# endif
/* Need to cast, because on Solaris, the third parameter will likely be
__va_list args. */
_GL_CXXALIAS_SYS_CAST (vdprintf, int,
(int fd, const char *format, va_list args));
# endif
_GL_CXXALIASWARN (vdprintf);
#elif defined GNULIB_POSIXCHECK
# undef vdprintf
# if HAVE_RAW_DECL_VDPRINTF
_GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
"use gnulib module vdprintf for portability");
# endif
#endif
#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
|| (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vfprintf rpl_vfprintf
# endif
# define GNULIB_overrides_vfprintf 1
# if @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# else
_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
# else
/* Need to cast, because on Solaris, the third parameter is
__va_list args
and GCC's fixincludes did not change this to __gnuc_va_list. */
_GL_CXXALIAS_SYS_CAST (vfprintf, int,
(FILE *fp, const char *format, va_list args));
# endif
_GL_CXXALIASWARN (vfprintf);
#endif
#if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
# if !GNULIB_overrides_vfprintf
# undef vfprintf
# endif
/* Assume vfprintf is always declared. */
_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
"use gnulib module vfprintf-posix for portable "
"POSIX compliance");
#endif
#if @GNULIB_VFSCANF@
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef vfscanf
# define vfscanf rpl_vfscanf
# endif
_GL_FUNCDECL_RPL (vfscanf, int,
(FILE *stream, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vfscanf, int,
(FILE *stream, const char *format, va_list args));
# else
_GL_CXXALIAS_SYS (vfscanf, int,
(FILE *stream, const char *format, va_list args));
# endif
_GL_CXXALIASWARN (vfscanf);
#endif
#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
|| (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vprintf rpl_vprintf
# endif
# define GNULIB_overrides_vprintf 1
# if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
_GL_ARG_NONNULL ((1)));
# else
_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
# else
/* Need to cast, because on Solaris, the second parameter is
__va_list args
and GCC's fixincludes did not change this to __gnuc_va_list. */
_GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
# endif
_GL_CXXALIASWARN (vprintf);
#endif
#if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
# if !GNULIB_overrides_vprintf
# undef vprintf
# endif
/* Assume vprintf is always declared. */
_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
"use gnulib module vprintf-posix for portable "
"POSIX compliance");
#endif
#if @GNULIB_VSCANF@
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef vscanf
# define vscanf rpl_vscanf
# endif
_GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args));
# else
_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
# endif
_GL_CXXALIASWARN (vscanf);
#endif
#if @GNULIB_VSNPRINTF@
# if @REPLACE_VSNPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vsnprintf rpl_vsnprintf
# endif
_GL_FUNCDECL_RPL (vsnprintf, int,
(char *str, size_t size, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (vsnprintf, int,
(char *str, size_t size, const char *format, va_list args));
# else
# if !@HAVE_DECL_VSNPRINTF@
_GL_FUNCDECL_SYS (vsnprintf, int,
(char *str, size_t size, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
_GL_ARG_NONNULL ((3)));
# endif
_GL_CXXALIAS_SYS (vsnprintf, int,
(char *str, size_t size, const char *format, va_list args));
# endif
_GL_CXXALIASWARN (vsnprintf);
#elif defined GNULIB_POSIXCHECK
# undef vsnprintf
# if HAVE_RAW_DECL_VSNPRINTF
_GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
"use gnulib module vsnprintf for portability");
# endif
#endif
#if @GNULIB_VSPRINTF_POSIX@
# if @REPLACE_VSPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vsprintf rpl_vsprintf
# endif
_GL_FUNCDECL_RPL (vsprintf, int,
(char *str, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vsprintf, int,
(char *str, const char *format, va_list args));
# else
/* Need to cast, because on Solaris, the third parameter is
__va_list args
and GCC's fixincludes did not change this to __gnuc_va_list. */
_GL_CXXALIAS_SYS_CAST (vsprintf, int,
(char *str, const char *format, va_list args));
# endif
_GL_CXXALIASWARN (vsprintf);
#elif defined GNULIB_POSIXCHECK
# undef vsprintf
/* Assume vsprintf is always declared. */
_GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
"use gnulib module vsprintf-posix for portable "
"POSIX compliance");
#endif
#endif /* _@GUARD_PREFIX@_STDIO_H */
#endif /* _@GUARD_PREFIX@_STDIO_H */
#endif
recutils-1.5/lib/c-strcasecmp.c 0000644 0000000 0000000 00000003155 11703116213 013375 0000000 0000000 /* c-strcasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2012 Free Software Foundation, Inc.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#include
/* Specification. */
#include "c-strcase.h"
#include
#include "c-ctype.h"
int
c_strcasecmp (const char *s1, const char *s2)
{
register const unsigned char *p1 = (const unsigned char *) s1;
register const unsigned char *p2 = (const unsigned char *) s2;
unsigned char c1, c2;
if (p1 == p2)
return 0;
do
{
c1 = c_tolower (*p1);
c2 = c_tolower (*p2);
if (c1 == '\0')
break;
++p1;
++p2;
}
while (c1 == c2);
if (UCHAR_MAX <= INT_MAX)
return c1 - c2;
else
/* On machines where 'char' and 'int' are types of the same size, the
difference of two 'unsigned char' values - including the sign bit -
doesn't fit in an 'int'. */
return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
}
recutils-1.5/lib/printf-args.h 0000644 0000000 0000000 00000007644 11703116215 013263 0000000 0000000 /* Decomposed printf argument list.
Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2012 Free Software
Foundation, Inc.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _PRINTF_ARGS_H
#define _PRINTF_ARGS_H
/* This file can be parametrized with the following macros:
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
PRINTF_FETCHARGS Name of the function to be declared.
STATIC Set to 'static' to declare the function static. */
/* Default parameters. */
#ifndef PRINTF_FETCHARGS
# define PRINTF_FETCHARGS printf_fetchargs
#endif
/* Get size_t. */
#include
/* Get wchar_t. */
#if HAVE_WCHAR_T
# include
#endif
/* Get wint_t. */
#if HAVE_WINT_T
# include
#endif
/* Get va_list. */
#include
/* Argument types */
typedef enum
{
TYPE_NONE,
TYPE_SCHAR,
TYPE_UCHAR,
TYPE_SHORT,
TYPE_USHORT,
TYPE_INT,
TYPE_UINT,
TYPE_LONGINT,
TYPE_ULONGINT,
#if HAVE_LONG_LONG_INT
TYPE_LONGLONGINT,
TYPE_ULONGLONGINT,
#endif
TYPE_DOUBLE,
TYPE_LONGDOUBLE,
TYPE_CHAR,
#if HAVE_WINT_T
TYPE_WIDE_CHAR,
#endif
TYPE_STRING,
#if HAVE_WCHAR_T
TYPE_WIDE_STRING,
#endif
TYPE_POINTER,
TYPE_COUNT_SCHAR_POINTER,
TYPE_COUNT_SHORT_POINTER,
TYPE_COUNT_INT_POINTER,
TYPE_COUNT_LONGINT_POINTER
#if HAVE_LONG_LONG_INT
, TYPE_COUNT_LONGLONGINT_POINTER
#endif
#if ENABLE_UNISTDIO
/* The unistdio extensions. */
, TYPE_U8_STRING
, TYPE_U16_STRING
, TYPE_U32_STRING
#endif
} arg_type;
/* Polymorphic argument */
typedef struct
{
arg_type type;
union
{
signed char a_schar;
unsigned char a_uchar;
short a_short;
unsigned short a_ushort;
int a_int;
unsigned int a_uint;
long int a_longint;
unsigned long int a_ulongint;
#if HAVE_LONG_LONG_INT
long long int a_longlongint;
unsigned long long int a_ulonglongint;
#endif
float a_float;
double a_double;
long double a_longdouble;
int a_char;
#if HAVE_WINT_T
wint_t a_wide_char;
#endif
const char* a_string;
#if HAVE_WCHAR_T
const wchar_t* a_wide_string;
#endif
void* a_pointer;
signed char * a_count_schar_pointer;
short * a_count_short_pointer;
int * a_count_int_pointer;
long int * a_count_longint_pointer;
#if HAVE_LONG_LONG_INT
long long int * a_count_longlongint_pointer;
#endif
#if ENABLE_UNISTDIO
/* The unistdio extensions. */
const uint8_t * a_u8_string;
const uint16_t * a_u16_string;
const uint32_t * a_u32_string;
#endif
}
a;
}
argument;
/* Number of directly allocated arguments (no malloc() needed). */
#define N_DIRECT_ALLOC_ARGUMENTS 7
typedef struct
{
size_t count;
argument *arg;
argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS];
}
arguments;
/* Fetch the arguments, putting them into a. */
#ifdef STATIC
STATIC
#else
extern
#endif
int PRINTF_FETCHARGS (va_list args, arguments *a);
#endif /* _PRINTF_ARGS_H */
recutils-1.5/lib/strings.in.h 0000644 0000000 0000000 00000007767 11703116215 013133 0000000 0000000 /* A substitute .
Copyright (C) 2007-2012 Free Software Foundation, Inc.
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
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _@GUARD_PREFIX@_STRINGS_H
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
/* Minix 3.1.8 has a bug: must be included before .
But avoid namespace pollution on glibc systems. */
#if defined __minix && !defined __GLIBC__
# include