diff --git a/COPYING b/COPYING
index 94a9ed024d38..f288702d2fa1 100644
--- a/COPYING
+++ b/COPYING
@@ -1,674 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
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 .
+ along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
-.
+.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
-.
+.
diff --git a/LICENSE b/LICENSE
index 315d1d86815c..65bce4288972 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,27 +1,27 @@
Less License
------------
Less
-Copyright (C) 1984-2018 Mark Nudelman
+Copyright (C) 1984-2022 Mark Nudelman
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice in the documentation and/or other materials provided with
the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Makefile.aut b/Makefile.aut
index f0eb26d41e23..948532e2f193 100644
--- a/Makefile.aut
+++ b/Makefile.aut
@@ -1,157 +1,161 @@
# Makefile for authoring less.
EMAIL = bug-less@gnu.org
HOMEPAGE = https://greenwoodsoftware.com/less
SHELL = /bin/sh
GIT = git
NROFF = nroff -t -man
srcdir = .
REL := $(shell sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q ${srcdir}/version.c)
ifeq ($(USE_PYTHON),1)
MKHELP = mkhelp.py
MKFUNCS = mkfuncs.py
else
MKHELP = mkhelp.pl
MKFUNCS = mkfuncs.pl
endif
SRC = \
main.c screen.c brac.c ch.c charset.c cmdbuf.c \
command.c cvt.c decode.c edit.c filename.c forwback.c \
help.c ifile.c input.c jump.c line.c linenum.c \
lsystem.c mark.c optfunc.c option.c opttbl.c os.c \
output.c pattern.c position.c prompt.c search.c signal.c \
tags.c ttyin.c version.c xbuf.c
DISTFILES_W = \
defines.ds Makefile.dsb Makefile.dsg Makefile.dsu \
defines.o2 Makefile.o2e \
defines.o9 Makefile.o9c Makefile.o9u \
defines.wn Makefile.wnm Makefile.wnb Makefile.wng \
configure
UNICODE_FILES = \
compose.uni fmt.uni ubin.uni wide.uni
DISTFILES = \
${SRC} regexp.c regexp.h \
COPYING INSTALL LICENSE Makefile.in Makefile.aut NEWS README \
configure.ac lesskey.c lesskey_parse.c lessecho.c scrsize.c \
charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h \
pckeys.h pattern.h position.h xbuf.h \
install.sh defines.h.in mkinstalldirs \
less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man \
less.hlp \
mkfuncs.pl mkhelp.pl \
mkfuncs.py mkhelp.py \
mkutable $(UNICODE_FILES) \
${DISTFILES_W}
all: help.c funcs.h $(UNICODE_FILES) ${srcdir}/configure
release: .FORCE
@if grep -s 'Major changes between .*${REL}' NEWS ; then :; else echo '*** NEWS is not updated for ${REL}'; exit 1; fi
${MAKE} -f Makefile.aut tagall
${MAKE} -f Makefile.aut all
${MAKE} -f Makefile.aut clean
${MAKE} -f Makefile.aut dist
.FORCE:
help.c: less.hlp
-mv -f ${srcdir}/help.c ${srcdir}/help.c.old
rm -rf help.c
${srcdir}/${MKHELP} < less.hlp > help.c
if cmp -s help.c help.c.old; then mv -f help.c.old help.c; fi
${srcdir}/configure ${srcdir}/defines.h.in: ${srcdir}/configure.ac ${srcdir}/Makefile.in
cd ${srcdir}; autoheader; autoconf
funcs.h: ${SRC:%=${srcdir}/%}
-mv -f ${srcdir}/funcs.h ${srcdir}/funcs.h.old
${srcdir}/${MKFUNCS} ${SRC:%=${srcdir}/%} >${srcdir}/funcs.h
- if cmp -s funcs.h funcs.h.old; then mv -f funcs.h.old funcs.h; fi
lint:
lint -I. ${CPPFLAGS} ${SRC}
clean:
rm -f Makefile config.status config.log config.cache defines.h stamp-h \
configure defines.h.in funcs.h help.c \
less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man
distclean: clean
realclean: clean
REPLACE_VERSION = \
DT=`date '+%d %h %Y'`; \
echo "Stuffing version number ${REL} into $@"; \
rm -f $@; \
sed \
-e "s;@@VERSION@@;${REL};" \
-e "s;@@DATE@@;$$DT;" >$@
${srcdir}/less.nro: ${srcdir}/less.nro.VER ${srcdir}/version.c
${REPLACE_VERSION} ${srcdir}/less.nro.VER
${srcdir}/lesskey.nro: ${srcdir}/lesskey.nro.VER ${srcdir}/version.c
${REPLACE_VERSION} ${srcdir}/lesskey.nro.VER
${srcdir}/lessecho.nro: ${srcdir}/lessecho.nro.VER ${srcdir}/version.c
${REPLACE_VERSION} ${srcdir}/lessecho.nro.VER
${srcdir}/less.man: ${srcdir}/less.nro
${NROFF} ${srcdir}/less.nro >${srcdir}/less.man
${srcdir}/lesskey.man: ${srcdir}/lesskey.nro
${NROFF} ${srcdir}/lesskey.nro >${srcdir}/lesskey.man
${srcdir}/lessecho.man: ${srcdir}/lessecho.nro
${NROFF} ${srcdir}/lessecho.nro >${srcdir}/lessecho.man
compose.uni: unicode/UnicodeData.txt
./mkutable -f2 Mn Me -- unicode/UnicodeData.txt > $@
fmt.uni: unicode/UnicodeData.txt
./mkutable -f2 Cf -- unicode/UnicodeData.txt > $@
ubin.uni: unicode/UnicodeData.txt
./mkutable -f2 Cc Cs Co Zl Zp -- unicode/UnicodeData.txt > $@
wide.uni: unicode/EastAsianWidth.txt
./mkutable -f1 W F -- unicode/EastAsianWidth.txt > $@
unicode/UnicodeData.txt:
mkdir -p unicode
- curl -s -u 'anonymous:${EMAIL}' -o $@ ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt
+ lftp -c 'open -u "anonymous:${EMAIL}" ftp.unicode.org ; get Public/UNIDATA/UnicodeData.txt -o $@'
+ touch $@
unicode/EastAsianWidth.txt:
mkdir -p unicode
- curl -s -u 'anonymous:${EMAIL}' -o $@ ftp://ftp.unicode.org/Public/UNIDATA/EastAsianWidth.txt
+ lftp -c 'open -u "anonymous:${EMAIL}" ftp.unicode.org ; get Public/UNIDATA/EastAsianWidth.txt -o $@'
+ touch $@
distfiles: ${DISTFILES}
echo_distfiles:
- echo ${DISTFILES}
+ @echo $(subst .nro,.nro.VER,${DISTFILES})
dist: ${DISTFILES}
if [ ! -d ${srcdir}/release ]; then mkdir ${srcdir}/release; fi
@LESSREL=less-${REL} && RELDIR=release/$$LESSREL && \
+ TARF=$$LESSREL-beta.tar.gz && ZIPF=$$LESSREL-beta.zip && \
cd ${srcdir} && \
rm -rf $$RELDIR && mkdir $$RELDIR && \
echo "Preparing $$LESSREL" && \
rm -rf $$LESSREL && mkdir $$LESSREL && \
cp ${DISTFILES} $$LESSREL && \
cd $$LESSREL && chmod -w * && chmod +w ${DISTFILES_W} && chmod +x configure && cd .. && \
- echo "Creating $$RELDIR/${REL}.tar.gz" && \
- tar -cf - $$LESSREL | gzip -c >$$RELDIR/$$LESSREL.tar.gz && \
- echo "Signing $$RELDIR/$$LESSREL.tar.gz" && \
- gpg --detach-sign $$RELDIR/$$LESSREL.tar.gz && \
- mv $$RELDIR/$$LESSREL.tar.gz.sig $$RELDIR/$$LESSREL.sig && \
- echo "Creating $$RELDIR/$$LESSREL.zip" && \
- zip -rq $$RELDIR/$$LESSREL.zip $$LESSREL && \
+ echo "Creating $$RELDIR/$$TARF" && \
+ tar -cf - $$LESSREL | gzip -c >$$RELDIR/$$TARF && \
+ echo "Signing $$RELDIR/$$TARF" && \
+ gpg --detach-sign $$RELDIR/$$TARF && \
+ mv $$RELDIR/$$TARF.sig $$RELDIR/$$LESSREL.sig && \
+ echo "Creating $$RELDIR/$$ZIPF" && \
+ zip -rq $$RELDIR/$$ZIPF $$LESSREL && \
rm -rf $$LESSREL
tagall:
echo "tagging v${REL}"; \
$(GIT) tag -a -f -m "v${REL}" "v${REL}"
gnu_upload:
@if [ -z "${REL}" ]; then echo "Please set REL=nnn"; exit 1; fi; \
- if [ ! -s release/less-${REL}/less-${REL}.tar.gz ]; then echo "release/less-${REL}/less-${REL}.tar.gz does not exist"; exit 1; fi; \
- cd release/less-${REL} && \
- gpg -b less-${REL}.tar.gz && \
- ( echo "version: 1.2"; echo "directory: less"; echo "filename: less-${REL}.tar.gz" ) > less-${REL}.tar.gz.directive && \
- gpg --clearsign less-${REL}.tar.gz.directive
- @echo "upload ready: cd release/less-${REL}; ftp ftp-upload.gnu.org; cd /incoming/ftp; put less-${REL}.tar.gz less-${REL}.tar.gz.sig less-${REL}.tar.gz.directive.asc"
+ LESSREL=less-${REL} && RELDIR=release/$$LESSREL && \
+ TARF=$$LESSREL-release.tar.gz && \
+ if [ ! -s $$RELDIR/$$TARF ]; then echo "$$RELDIR/$$TARF does not exist"; exit 1; fi; \
+ cd $$RELDIR && \
+ gpg -b $$TARF && \
+ ( echo "version: 1.2"; echo "directory: less"; echo "filename: $$TARF" ) > $$TARF.directive && \
+ gpg --clearsign $$TARF.directive
+ @echo "upload ready: cd $$RELDIR; ftp ftp-upload.gnu.org; cd /incoming/ftp; put $$TARF $$TARF.sig $$TARF.directive.asc"
diff --git a/NEWS b/NEWS
index a403c5d8a875..bcfe4c6c9e38 100644
--- a/NEWS
+++ b/NEWS
@@ -1,1105 +1,1172 @@
NEWS about less
======================================================================
For the latest news about less, see https://greenwoodsoftware.com/less
You can also download the latest version of less from there.
Report bugs, suggestions or comments at
https://github.com/gwsw/less/issues.
+======================================================================
+
+ Major changes between "less" versions 590 and 608
+
+* Add the --header option (github #43).
+
+* Add the --no-number-headers option (github #178).
+
+* Add the --status-line option.
+
+* Add the --redraw-on-quit option (github #36).
+
+* Add the --search-options option (github #213).
+
+* Add the --exit-follow-on-close option (github #244).
+
+* Add 'H' color type to set color of header lines.
+
+* Add #version conditional to lesskey.
+
+* Add += syntax to variable section in lesskey files.
+
+* Allow option name in -- command to end with '=' in addition to '\n'.
+
+* Add $HOME/.config to possible locations of lesskey file (github #153).
+
+* Add $XDG_STATE_HOME and $HOME/.local/state to possible locations
+ of history file (github #223).
+
+* Don't read or write history file in secure mode (github #201).
+
+* Fix display of multibyte and double-width chars in prompt.
+
+* Fix ESC-BACKSPACE command when BACKSPACE key does not send 0x08
+ (github #188).
+
+* Add more \k codes to lesskey format.
+
+* Fix bug when empty file is modified while viewing it.
+
+* Fix bug when parsing a malformed lesskey file (githb #234).
+
+* Fix bug scrolling history when --incsearch is set (github #214).
+
+* Fix buffer overflow when invoking lessecho with more than 63 -m/-n
+ options (github #198).
+
+* Fix buffer overflow in bin_file (github #271).
+
+* Fix bug restoring color at end of highlighted text.
+
+* Fix bug in parsing lesskey file.
+
+* Defer moving cursor to lower left in some more cases.
+
+* Suppress TAB filename expansion in some cases where it doesn't make sense.
+
+* Fix termlib detection when compiler doesn't accept
+ calls to undeclared functions.
+
+* Fix bug in input of non-ASCII characters on Windows (github #247)
+
+* Escape filenames when invoking LESSCLOSE.
+
+* Fix bug using multibyte UTF-8 char in search string
+ with --incsearch (github #273).
+
======================================================================
Major changes between "less" versions 581 and 590
* Make less able to read lesskey source files (deprecating lesskey).
* If XDG_CONFIG_HOME is set, find lesskey source file
in $XDG_CONFIG_HOME/lesskey rather than $HOME/.lesskey.
* If XDG_DATA_HOME is set, find and store history file
in $XDG_DATA_HOME/lesshst rather than $HOME/.lesshst.
* Add the --lesskey-src option.
* Add the --file-size option.
* With -F, if screen is resized to make file fit on one screen, don't exit.
* Fix bug which could leave terminal in mouse-reporting mode
after exiting less.
* Fix bug which caused failure to respond to window resize.
* Fix backslash bug searching in tag file.
======================================================================
Major changes between "less" versions 563 and 581
* Change ESC-u command to toggle, not disable, highlighting per man page.
* Add ESC-U command.
* Add ctrl-W search modifier for wrapping search.
* F command can be interrupted by ^X.
* Support OSC 8 hyperlinks when -R is in effect.
* g command with no number will ignore -j and put first line at top of screen.
* Multiple + or -p command line options are handled better.
* Add the --incsearch option.
* Add the --line-num-width option.
* Add the --status-col-width option.
* Add the --use-color and --color options.
* Display -w highlight even if highlighted line is empty.
* If search result is in a long line, scroll to ensure it is visible.
* Editing the same file under different names now creates only
one entry in the file list.
* Make visual bell more visible on some terminals.
* Ring end-of-file bell no more than once per second.
* Build can use either Python or Perl for Makefile.aut operations.
* Fix crash when using the @ search modifier.
* Fix crash in the 's' command due to duplicate free.
* Fix realpath crash on Darwin.
======================================================================
Major changes between "less" versions 551 and 563
* Update Unicode tables.
* Treat Hangul Jamo medial vowels and final consonants as zero width.
* Display error message immediately when -o is toggled and
input is not a pipe.
* Fix regression: make screen repaint when "squished" and
a no-movement command is given.
* Fix erroneous EOF calculation when F command is interrupted.
* Make WIN32C version include this fix from 551:
Don't count lines in initial screen if using -X with -F.
* Fix display bug in WIN32C version.
* Fix memory corruption when built with libtermcap.
* Support libtinfow.
======================================================================
Major changes between "less" versions 530 and 551
* Add --mouse option.
* Add --wheel-lines option.
* Add --no-histdups option.
* Add --save-marks option.
* Support PCRE2 regular expression library.
* Redraw screen on SIGWINCH even if screen size doesn't change.
* Shell-escape filenames in history so they can be used again.
* Ring bell if user enters invalid long option name.
* Use PCRE_UTF8 flag for pcre regular expressions when in UTF-8 mode.
* Windows: use wide-char string to set console title.
* Don't count lines in initial screen if using -X with -F.
* Support mingw build system.
* Fix bug in v command on empty file.
* Fix bug in v command when filename contains shell metacharacters.
======================================================================
Major changes between "less" versions 487 and 530
* Don't output terminal init sequence if using -F and file fits on one screen.
* When using -S, mark truncated lines with a special character.
The character can be changed or disabled via the new --rscroll option.
* New command M marks the last line displayed on the screen.
* New command ESC-m removes a line mark.
* Status column (enabled via -J) now shows mark letters.
* Status column shows search matches even if highlighting is disabled via -G.
* A second ESC-u command will clear search match markers in the status column.
* Do same ANSI escape code filtering for tag matching that we do for
searching, to help when viewing syntax-highlighted code.
* Catch SIGTERM and clean up before exiting.
* Fix bug initializing default charset on Windows.
* Handle keypad ENTER key correctly if it sends something other than newline.
* Fix buffering bug when using stdin with a LESSOPEN pipe.
* On Windows, allow 'u' in -D option to enable underlining.
* On Windows, use underline in sgr mode.
* On Windows, convert UTF-8 to multibyte if console is not UTF-8.
* Update Unicode tables to 2017-03-08.
* Pass-thru Unicode formating chars (Cf type) instead of treating them
as binary chars. But treat them as binary if -U is set.
* Fix erroneous binary file warning when UTF-8 file contains ANSI SGR sequences.
* Fix bugs when using LESSOPEN and switching between stdin and other files.
* Fix some bugs handling filenames containing shell metacharacters.
* Fix some memory leaks.
* Allow some debugging environment variables to be set in lesskey file.
* Code improvements:
. Use ANSI prototypes in funcs.h declarations.
. Fix some const mismatches.
. Remove archaic "register" in variable declarations.
======================================================================
Major changes between "less" versions 481 and 487
* New commands ESC-{ and ESC-} to shift to start/end of displayed lines.
* Make search highlights work correctly when changing caselessness with -i.
* New option -Da in Windows version to enable SGR mode.
* Fix "nothing to search" error when top or bottom line on screen is empty.
* Fix bug when terminal has no "cm" termcap entry.
* Fix incorrect display when entering double-width chars in search string.
* Fix bug in Unicode handling that missed some double width characters.
* Update Unicode database to 9.0.0.
======================================================================
Major changes between "less" versions 458 and 481
* Don't overwrite history file; just append to it.
* New command ESC-G goes to end of currently buffered data in a pipe.
* Disable history feature when compiled with LESSHISTFILE set to "-".
* In more-compatible mode, make the -p option apply to every file opened,
not just the first one.
* In more-compatible mode, change the -e option to work like -E, not -EF.
* Treat multiple CRs before LF are like one CR (all the CRs are hidden).
* Allow "extra" string in lesskey file to append to a multi-char command
(like a search pattern), without executing the command.
* Ignore -u/-U setting while viewing help file, so that
underline and bold chars are displayed correctly.
* Improve detection of "binary" files in UTF-8 mode.
* Fix bug with ++ commands.
* Fix bug where prompt was sometimes not displayed with +G.
* Fix possible memory corruption
* Fix bugs and improve performance in ampersand filtering.
* Automate construction of Unicode tables from Unicode database.
* Allow %% escape sequence in LESSOPEN variable.
======================================================================
Major changes between "less" versions 451 and 458
* Allow backslash escaping of metacharacters in LESS environment variable
after the --use-backslash option.
* Don't quit if syntax errors are found in command line options.
* Increase sizes of some internal buffers.
* Fix configure bug with --with-regex=none.
* Fix crash with "stty rows 0".
* Fix Win32 attribute display bug.
* Fix display bug when using up/down arrow on the command line.
======================================================================
Major changes between "less" versions 444 and 451
* Add ESC-F command to keep reading data until a pattern is found.
* Use exit code of LESSOPEN script if LESSOPEN starts with "||".
* When up/down arrow is used on the command line immediately after
typing text, the next command starting with that text is found.
* Add support for GNU regex.
* Add configure option --with-regex=none and fix compile errors
when compiling with no regex library.
* Fix bugs handling SGR sequences in Win32.
* Fix possible crashes caused by malformed LESSOPEN or
LESSCLOSE variables.
* Fix bug highlighting text which is discontiguous in the file
due to backspace processing.
* Fix bug in displaying status column when scrolling backwards
with -J and -S in effect.
======================================================================
Major changes between "less" versions 443 and 444
* Fix bug in unget handling that can cause strange effects on the
command line.
* Remove vestiges of obsolete -l option that can cause a crash.
======================================================================
Major changes between "less" versions 436 and 443
* Change search behavior such that when a search is given an explicit
pattern, the entire displayed screen is included in the search and
not just the portion after the target line.
* Add -A option to change search behavior to the old way: only
the portion of the screen after the target line is searched.
* Add %F formatting to prompt strings, replaced by the last component
of the input file.
* Control-G while editing a command exits the command.
* Less now exits with status 2 if control-C is pressed and -K is in effect.
* Fix "ungetc overflow" when passing long commands via the -p option.
* Fix bug in using line filtering via the & command
in combination with -i and -I.
* Fix bug in handling negative arguments to the -j option.
* Fix bug in handling %t in prompt strings.
* Improve handling of long option names.
* Improve percentage calculation for very large files.
======================================================================
Major changes between "less" versions 429 and 436
* Don't pass "-" to non-pipe LESSOPEN unless it starts with "-".
* Allow a fraction as the argument to the -# (--shift) option.
* Fix highlight bug when underlined/overstruck text matches at end of line.
* Fix non-regex searches with ctrl-R.
======================================================================
Major changes between "less" versions 424 and 429
* LESSOPEN pipe will now be used on standard input, if the LESSOPEN
environment variable begins with "|-".
* The -D option with one number now means use the normal background color.
* Don't change permissions on history file if it is not a regular file.
* Fix non-ANSI-compliant code that caused problems with some compilers.
* Fix binary file detection in UTF-8 mode.
* Fix display problems with long lines on "ignaw" terminals.
* Fix problem interrupting the line number calculation for initial prompt.
* Fix SGR emulation when dealing with multiple attributes (eg. bold+underline).
* Fix highlight bug when searching for underlined/overstruck text.
======================================================================
Major changes between "less" versions 418 and 424
* New "&" command allows filtering of lines based on a pattern.
* Status column now displays a search match, even if the matched
string is scrolled off screen because -S is in effect.
* Improve behavior of -F option.
* Allow CSI character (0x9B) to work in UTF-8 mode.
* Output carriage return at startup in case terminal doesn't default
to column 1.
* Fix bug in '' (quote, quote) command after G command.
======================================================================
Major changes between "less" versions 416 and 418
* Color escape sequences are now supported in WIN32 build.
* Makefile now uses EXEEXT feature of autoconf.
* Fix search bug when using -R and text contains ANSI color escape sequences.
* Fix crash when using -r with UTF-8 text containing 0x9B bytes.
* Fix display bug when using ' command to move less than one page forward.
* Update GPL to version 3.
======================================================================
Major changes between "less" versions 409 and 416
* New --follow-name option makes F command follow the name of a file
rather than the file descriptor if an open file is renamed.
* Make searching with -i/-I work correctly with non-ASCII text.
* Fix DJGPP build.
======================================================================
Major changes between "less" versions 406 and 409
* Support CSI escape sequences, like SGR escape sequences.
* Fix bug which caused screen to fail to repaint when window is resized.
* Fix bug in using -i and -I flags with non-ASCII text.
* Fix configure bug on systems which don't support langinfo.h.
* Fix crash when searching text containing certain invalid UTF-8 sequences.
======================================================================
Major changes between "less" versions 394 and 406
* Allow decimal point in number for % (percent) command.
* Allow decimal point in number for -j option (fraction of screen height).
* Make n command fetch previous pattern from history file on first search.
* Don't rewrite history file if it has not changed.
* Don't move to bottom of screen on first page.
* Don't output extraneous newlines, so copy & pasting lines from the
output works better.
* The -c option has been made identical with the -C option.
* Allow "/dev/null" as synomym for "-" in LESSHISTFILE to indicate
that no history file should be used.
* Search can now find text which follows a null byte, if the PCRE
library is used, or if no-regex searching (ctrl-R) is used.
* Better compatibility with POSIX more specification.
* Make -f work for directories.
* Make "t" cmd traverse tags in the correct order.
* Allow a few binary characters in the input file before warning
that the file is binary.
* Don't warn that file is binary if it merely contains ANSI color sequences
and -R is in effect.
* Update Unicode character tables.
* Support DESTDIR in Makefile.
* Fix bug when filename contains certain shell metacharacters such as "$".
* Fix bug when resizing the window while waiting for input from a pipe.
* Fix configure bugs.
======================================================================
Major changes between "less" versions 382 and 394
* Add history file to save search and shell command history between
invocations of less.
* Improve behavior of history list for search and shell commands.
* Add -K (or --quit-on-intr) option to make less exit immediately on ctrl-C.
* Improve handling of UTF-8 files and commands, including better
line wrapping and handling double-width chars.
* Added LESSUTFBINFMT environment variable to control display of
non-printable characters in a UTF-8 file.
* Add --with-secure option to configure, to make it easier to
build a secure version of less.
* Show search matches in the status column even if search highlights
are disabled via the -G option or the ESC-u command.
* Improve performance when the file contains very long lines.
* Add "windows" charset.
* Add man page for lessecho.
* Add support for erase2 character, treated same as erase.
* Use ASCII lowercase/uppercase logic when operating on the command line.
* Update makefile for Borland C++ 5.5.1.
* Fix bug in calculating number of pages for %D prompt.
* Fix bug in handling tag file error.
* Fix obscure bug if input file is deleted while viewing help.
* Fix bug handling filenames which include square brackets.
* Fix possible buffer overflow in "global" tag search.
* Fix possible buffer overflow in usage of LESSOPEN and LESSCLOSE.
* Fix buffer overflow in reverse search.
======================================================================
Major changes between "less" versions 381 and 382
* Removed some old copyrighted code.
This probably breaks OS/9 support.
======================================================================
Major changes between "less" versions 378 and 381
* New -L option to disable LESSOPEN processing.
* Further support for large (64 bit) file addressing.
Large file support is now set up by the configure script.
* Use autoconf 2.54.
Replace configure.in, acconfig.h, defines.h.top with configure.ac.
* Overstriking underscore with underscore is now bold or underlined
depending on context.
* Use only 7 spaces for line numbers in -N mode, if possible.
* Fix some bugs in handling overstriking in UTF-8 files.
* Fix some nroff issues in the man page.
======================================================================
Major changes between "less" versions 376 and 378
* Bug fixes:
Default buffer space is now 64K as documented.
Search highlighting works properly when used with -R.
Windows version works properly when input file contains carriage returns.
Clean up some compiler warnings.
======================================================================
Major changes between "less" versions 358 and 376
* -x option can now specify multiple variable-width tab stops.
* -X option no longer disables keypad initialization.
New option --no-keypad disables keypad initialization.
* New commands t and T step through multiple tag matches.
Added support for "global(1)" tags
(see http://www.gnu.org/software/global/global.html).
* New prompt style set by option -Pw defines the message printed
while waiting for data in the F command.
* System-wide lesskey file now defaults to sysless in etc directory
instead of .sysless in bin directory.
Use "configure --sysconfdir=..." to change it.
(For backwards compatibility, .sysless in bin is still recognized.)
* Pressing RightArrow or LeftArrow while entering a number now shifts
the display N columns rather than editing the number itself.
* Status column (enabled with -J) now shows search results.
* Windows version sets window title.
* Default LESSCHARSET for MS-DOS versions is now "dos".
* Searching works better with ANSI (SGR) escape sequences.
ANSI color escape sequences are now supported in the MS-DOS (DJGPP) version.
* Improved performance in reading very large pipes.
* Eliminated some dependencies on file offets being 32 bits.
* Fixed problems when viewing files with very long lines.
* Fixed overstriking in UTF-8 mode, and overstriking tabs.
* Improved horizontal shifting of text using -R option with ANSI color.
* Improved handling of filenames containing shell metacharacters.
* Some fixes for EBCDIC systems.
* Some fixes for OS/2 systems.
======================================================================
Major changes between "less" versions 354 and 358
* Add -J (--status-column) option to display a status column.
* Add -# (--shift) option to set default horizontal shift distance.
Default horizontal shift distance is now one-half screen width.
* Horizontal shifting does not shift line numbers if -N is in effect.
* Horizontal shifting acts as though -S were set, to avoid confusion.
======================================================================
Major changes between "less" versions 352 and 354
* Allow space after numeric-valued command line options.
* Fix problem with configuring terminal libraries on some systems.
* Add support for PCRE regular expression library.
* Add --with-regex option to configure to allow manually selecting
a regular expression library.
* Fix bug compiling with SECURE = 1.
======================================================================
Major changes between "less" versions 346 and 352
* Enable UTF-8 if "UTF-8" appears in locale-related environment variables.
* Add --with-editor option to configure script.
* The -M prompt and = message now show the top and bottom line number.
* Fix bug in running the editor on a file whose name contains quotes, etc.
* Fix bug in horizontal scrolling of long lines.
* Fix bug in doing :d on a file which contains marks.
* Fix bug causing cleared lines to sometimes be filled with standout,
bold, underline, etc. on certain terminals.
* Fixes for MS-DOS (DJGPP) version.
======================================================================
Major changes between "less" versions 340 and 346
* The UTF-8 character set is now supported.
* The default character set is now latin1 rather than ascii.
* New option -R (--RAW-CONTROL-CHARS) is like -r but handles
long (wrapped) lines correctly, as long as the input contains only
normal text and ANSI color escape sequences.
* New option -F (--quit-if-one-screen) quits if the text fits on
the first screen.
* The -w option now highlights the target line of a g or p command.
* A system-wide lesskey file is supported (LESSKEY_SYSTEM).
* New escape for prompt strings: %c is replaced by column number.
* New escape for prompt strings: %P is replaced by percentage into
file, based on line number rather than byte offset.
* HOME and END keys now jump to beginning of file or end of file.
======================================================================
Major changes between "less" versions 337 and 340
* Command line options for less may now be given in either the old
single-letter form, or a new long name form (--option-name).
See the less man page or "less --help" for the list of long option names.
* Command line options for lesskey may now be given in a new long name
form. See the lesskey man page for the list of long option names.
* New command -- toggles an option using the long option name.
* New command __ queries an option using the long option name.
* The old -- command is renamed as -!.
* If a ^P is entered between the dash and the option letter of the -
command, the message describing the new setting is suppressed.
* Lesskey files may now contain \k escape sequences to represent the
"special" keys (arrows, PAGE-UP/PAGE-DOWN, HOME, END, INSERT, DELETE).
* New command :d removes the current file from the list of files.
* New option -~ (like -w before version 335)
suppresses tildes after end-of-file.
* Less is now released under the GNU General Public License.
======================================================================
Major changes between "less" versions 335 and 337
* Fixed bugs in "make install".
======================================================================
Major changes between "less" versions 332 and 335
* The old -w flag (suppress tildes after end-of-file) has been removed.
* New -w flag highlights the first new line after a forward-screen.
* New -W flag highlights the first new line after any forward movement.
* Window resize works even if LINES and/or COLUMNS environment
variables are incorrect.
* New percent escapes for prompt strings:
%d is replaced by the page number, and
%D is replaced by the number of pages in the file.
* Added charsets "iso8859" and "ebcdic".
* In Windows version, uses HOMEDRIVE and HOMEPATH if HOME is not defined.
* Fixed some bugs causing incorrect display on DOS/Windows.
======================================================================
Major changes between "less" versions 330 and 332
* Filenames from the command line are entered into the command history,
so UPARROW/DOWNARROW can be used to retrieve them from the :e command.
* Now works correctly on Windows when using a scrolling terminal
window (buffer larger than display window).
* On Windows, now restores the console screen on exit.
Use -X to get the old behavior.
* Fixed bug on Windows when CAPS-LOCK or NUM-LOCK is pressed.
* Fixed bug on Windows when piping output of an interactive program.
* Fixed bug in tags file processing when tags file has DOS-style
line terminators (CR/LF).
* Fixed compilation problem on OS/2.
======================================================================
Major changes between "less" versions 321 and 330
* Now supports filenames containing spaces (in double quotes).
New option -" can be used to change the quoting characters.
* In filename completion, a slash is appended to a directory name.
If the environment variable LESSSEPARATOR is set, the value of
that variable, rather than a slash, is appended.
* LeftArrow and RightArrow are same as ESC-[ and ESC-].
* Added commands ESC-( and ESC-), same as ESC-[ and ESC-].
* A "quit" command defined in a lesskey file may now have an "extra"
string, which is used to return an exit code from less when it quits.
* New environment variables LESSMETACHARS and LESSMETAESCAPE provide
more control over how less interfaces to the shell.
* Ported to Microsoft Visual C compiler for Windows.
* Ported to DJGPP compiler for MS-DOS.
* Bug fixes.
======================================================================
Major changes between "less" versions 291 and 321
* Command line at bottom of screen now scrolls, so it can be longer
than the screen width.
* New commands ESC-] and ESC-[ scroll the display horizontally.
* New command ESC-SPACE scrolls forward a full screen, even if it
hits end-of-file.
* Alternate modifiers for search commands: ^N is same as !,
^F is same as @, and ^E is same as *.
* New modifier for search commands: ^K means highlight the matches
currently on-screen, but don't move to the first match.
* New modifier for search commands: ^R means don't use regular
expressions in the search.
* Environment variable LESSKEY gives name of default lesskey file.
* Environment variable LESSSECURE will force less to run in
"secure" mode.
* Command line argument "--" signals that the rest of the arguments
are files (not option flags).
* Help file (less.hlp) is no longer installed. Help text is now
embedded in the less executable itself.
* Added -Ph to change the prompt for the help text.
Added -Ps to change the default short prompt (same as plain -P).
* Ported to the Borland C compiler for MS-DOS.
* Ported to Windows 95 & Windows NT.
* Ported to OS-9.
* Ported to GNU Hurd.
======================================================================
Major changes between "less" versions 290 and 291
* Less environment variables can be specified in lesskey files.
* Fixed MS-DOS build.
======================================================================
Major changes between "less" versions 278 and 290
* Accepts GNU-style options "--help" and "--version".
* OS/2 version looks for less.ini in $HOME before $INIT and $PATH.
* Bug fixes
======================================================================
Major changes between "less" versions 252 and 278
* A LESSOPEN preprocessor may now pipe the converted file data to less,
rather than writing it to a temporary file.
* Search pattern highlighting has been fixed. It now highlights
reliably, even if a string is split across two screen lines,
contains TABs, etc.
* The -F flag (which suppress search highlighting) has been changed
to -G. A new flag, -g, changes search highlighting to highlight
only the string found by the last search command, instead of all
strings which match the last search command.
* New flag -I acts like -i, but ignores case even if the search
pattern contains uppercase letters.
* Less now checks for the environment variable VISUAL before EDITOR.
* Ported to OS/2.
======================================================================
Major changes between "less" versions 237 and 252
* Changes in line-editing keys:
The literal key is now ^V or ^A rather than \ (backslash).
Filename completion commands (TAB and ^L) are disabled
when typing a search pattern.
* Line-editing command keys can be redefined using lesskey.
* Lesskey with no input file defaults to $HOME/.lesskey
rather than standard input.
* New option -V displays version number of less.
* New option -V displays version number of lesskey.
* Help file less.hlp is now installed by default in /usr/local/share
rather than /usr/local/lib.
======================================================================
Major changes between "less" versions 170 and 237
* By popular demand, text which matches the current search pattern
is highlighted. New -F flag disables this feature.
* Henry Spencer's regexp.c is now included, for systems which do not
have a regular expression library.
regexp.c is Copyright (c) 1986 by University of Toronto.
* New line-editing keys, including command history (arrow keys) and
filename completion (TAB).
* Input preprocessor allows modification of input files (e.g. uncompress)
via LESSOPEN/LESSCLOSE environment variables.
* New -X flag disables sending termcap "ti" and "te" (initialize and
deinitialize) strings to the terminal.
* Changing -i from within less now correctly affects a subsequent
repeated search.
* Searching for underlined or overstruck text now works when the -u
flag is in effect, rather than the -i flag.
* Use setlocale (LANG and LC_CTYPE environment variables) to determine
the character set if LESSCHARSET/LESSCHARDEF are not set.
* The default format for displaying binary characters is now standout
(reverse video) rather than blinking. This can still be changed by
setting the LESSBINFMT environment variable.
* Use autoconf installation technology.
* Ported to MS-DOS.
********************************
Things that may surprise you
********************************
* When you enter text at the bottom of the screen (search string,
filename, etc.), some keys act different than previously.
Specifically, \ (backslash), ESC, TAB, BACKTAB, and control-L
now have line editing functions.
* Some previous unofficial versions of less were able to display
compressed files. The new LESSOPEN/LESSCLOSE feature now provides
this functionality in a different way.
* Some previous unofficial versions of less provided a -Z flag to
set the number of lines of text to retain between full screen scrolls.
The -z-n flag (that is, -z with a negative number) provides this
functionality.
======================================================================
Major changes between "less" versions 123 and 170
* New option -j allows target lines to be positioned anywhere on screen.
* New option -S truncates displayed line at the screen width,
rather than wrapping onto the next line.
* New option -y limits amount of forward scroll.
* New option -T specifies a "tags" file.
* Non-printable, non-control characters are displayed in octal.
Such characters, as well as control characters, are displayed
in blinking mode.
* New command -+ sets an option to its default.
* New command -- sets an option to the opposite of its default.
* Lesskey file may have a string appended to a key's action,
which acts as though typed in after the command.
* New commands ESC-^F and ESC-^B match arbitrary types of brackets.
* New command F monitors a growing file (like "tail -f").
* New command | pipes a section of the input file into a shell command.
* New command :x directly jumps to a file in the command line list.
* Search commands have been enhanced and reorganized:
n Repeat search, same direction.
N Repeat search, opposite direction.
ESC-/ Search forward thru file boundaries
ESC-? Search backward thru file boundaries
ESC-n Repeat search thru file boundaries, same direction.
ESC-N Repeat search thru file boundaries, opposite direction.
Special character * causes search to search thru file boundaries.
Special character @ causes search to begin at start/end of file list.
* Examining a new file adds it to the command line list.
A list of files, or an expression which matches more than one file,
may be examined; all of them are added to the command line list.
* Environment variables LESSCHARSET and LESSCHARDEF can define
a non-ASCII character set.
* Partial support for MSDOS, including options -R for repainting screen
on quit, -v/-V to select video mode, and -W to change window size.
======================================================================
Major changes between "less" versions 97 and 123
* New option (-N) causes line numbers to be displayed in the
text of the file (like vi "set nu").
* New option (-?) prints help message immediately.
* New option (-r) displays "raw" control characters, without
mapping them to ^X notation.
* New option (-f) forces less to open non-regular files
(directories, etc).
* New option (-k) can be used to specify lesskey files by name.
* New option (-y) can be used to set a forward scroll limit
(like -h sets a backward scroll limit).
* File marks (set by the m command) are now preserved when a new
file is edited. The ' command can thus be used to switch files.
* New command ESC-/ searches all files (on the command line)
for a pattern.
* New command ESC-n repeats previous search, spanning files.
* The N command has been changed to repeat the previous search
in the reverse direction. The old N command is still available
via :n.
* New command ESC-N repeats previous search in the reverse
direction and spanning files.
* 8 bit characters are now supported. A new option (-g) can be
used to strip off the eighth bit (the previous behavior).
* Options which take a following string (like -t) may now
optionally have a space between the option letter and the string.
* Six new commands { } ( ) [ and ] can be used to match
brackets of specific types, similar to vi % command.
* New commands z and w move forward/backward one window and
simultaneously set the window size.
* Prompt string expansion now has %L for line number of the last
line in the file, and %E for the name of the editor.
Also, % escapes which refer to a line (b=bottom, t=top, etc.)
can use j for the jump target line.
* New environment variable LESSEDIT can be used to tailor the
command string passed to the editor by the v command.
* Examining a file which was previously examined will return
to the same position in the file.
* A "%" is expanded to the current filename and a "#" to the
previous filename, in both shell commands and the E command.
(Previously % worked only in shell commands and # worked
only in the E command.)
* New command ":ta" is equivalent to "-t".
* New command "s" is equivalent to "-l".
* The - command may be followed by "+X" to revert to the default
for option X, or "-X" to get the opposite of the default.
* Lesskey files may now include characters after the action as
extra input to be parsed after the action; for example:
"toggle-option X" to toggle a specific option X.
diff --git a/README b/README
index 955bf82822ea..a4443b69f273 100644
--- a/README
+++ b/README
@@ -1,246 +1,246 @@
This is the source code distribution of "less".
- This program is part of the GNU project (http://www.gnu.org).
+ This program is part of the GNU project (https://www.gnu.org).
This program is free software. You may redistribute it and/or
modify it under the terms of either:
1. The GNU General Public License, as published by the Free
Software Foundation; either version 3, or (at your option) any
later version. A copy of this license is in the file COPYING.
or
2. The Less License, in the file LICENSE.
Please report any problems at https://github.com/gwsw/less/issues.
See https://greenwoodsoftware.com/less for the latest info.
Source repository is at https://github.com/gwsw/less.git.
=========================================================================
You should build from a clone of a git repository
ONLY IF you are doing development on the less source itself.
If you are merely using less as a tool, you should download a release
-from http://greenwoodsoftware.com and NOT from github.
+from https://greenwoodsoftware.com and NOT from github.
The formatted manual page is in less.man.
The manual page nroff source is in less.nro.
Major changes made since the last posted version are in NEWS.
=======================================================================
INSTALLATION (Unix & Linux systems only):
1. Move the distributed source to its own directory and unpack it,
if you have not already done so.
2. If you are building from a clone of a git repository,
- type "make -f Makefile.aut".
+ type "make -f Makefile.aut distfiles".
If you are building from a numbered release package (a tar or
zip file with a name like less-999.tar.gz or less-999.zip downloaded
from greenwoodsoftware.com, not from github), you should skip this step.
3. Type "sh configure".
This will generate a Makefile and a defines.h.
Warning: if you have a GNU sed, make sure it is version 2.05 or later.
The file INSTALL describes the usage of the configure program in
general. In addition, these options to configure are supported:
--with-editor=program
Specifies the default editor program used by the "v" command.
The default is "vi".
--with-regex=lib
Specifies the regular expression library used by less for pattern
matching. The default is "auto", which means the configure program
finds a regular expression library automatically. Other values are:
gnu Use the GNU regex library.
pcre Use the PCRE library.
pcre2 Use the PCRE2 library.
posix Use the POSIX-compatible regcomp.
regcmp Use the regcmp library.
re_comp Use the re_comp library.
regcomp Use the V8-compatible regcomp.
regcomp-local Use Henry Spencer's V8-compatible regcomp
(source is supplied with less).
none No regular expressions, only simple string matching.
--with-secure
Builds a "secure" version of less, with some features disabled
to prevent users from viewing other files, accessing shell
commands, etc.
4. It is a good idea to look over the generated Makefile and defines.h
and make sure they look ok. If you know of any peculiarities of
your system that configure might not have detected, you may fix the
Makefile now. Take particular notice of the list of "terminal"
libraries in the LIBS definition in the Makefile; these may need
to be edited. The terminal libraries will be some subset of
-lncurses -lcurses -ltermcap -ltermlib
If you wish, you may edit defines.h to remove some optional features.
If you choose not to include some features in your version, you may
wish to edit the manual page "less.nro" and the help page "less.hlp"
to remove the descriptions of the features which you are removing.
If you edit less.hlp, you should run "make -f Makefile.aut help.c".
5. Type "make" and watch the fun.
6. If the make succeeds, it will generate the programs "less",
"lesskey" and "lessecho" in your current directory. Test the
generated programs.
7. When satisfied that it works, if you wish to install it
in a public place, type "make install".
The default install destinations are:
Executables (less, lesskey, lessecho) in /usr/local/bin
Documentation (less.nro, lesskey.nro) in /usr/local/man/man1
If you want to install any of these files elsewhere, define
bindir and/or mandir to the appropriate directories.
Note to hackers: comments noting possible improvements are enclosed
in double curly brackets {{ like this }}.
(Note that the above note was originally written at a time when
"hackers" most commonly meant "enthusiastic and dedicated computer
programmers", not "persons who attempt to circumvent computer security".)
=======================================================================
INSTALLATION (MS-DOS systems only,
with Microsoft C, Borland C, or DJGPP)
1. Move the distributed source to its own directory.
Depending on your compiler, you may need to convert the source
to have CR-LF rather than LF as line terminators.
2. If you are using Microsoft C, rename MAKEFILE.DSU to MAKEFILE.
If you are using Borland C, rename MAKEFILE.DSB to MAKEFILE.
If you are using DJGPP, rename MAKEFILE.DSG to MAKEFILE.
3. Look at MAKEFILE to make sure that the definitions for CC and LIBDIR
are correct. CC should be the name of your C compiler and
LIBDIR should be the directory where the C libraries reside (for
Microsoft C only). If these definitions need to be changed, you can
either modify the definitions directly in MAKEFILE, or set your
environment variables CC and/or LIBDIR to override the definitions
in MAKEFILE.
4. If you wish, you may edit DEFINES.DS to remove some optional features.
If you choose not to include some features in your version, you may
wish to edit the manual page LESS.MAN and the help page HELP.C
to remove the descriptions of the features which you are removing.
5. Run your "make" program and watch the fun.
If your "make" requires a flag to import environment variables,
you should use that flag.
If your compiler runs out of memory, try running "make -n >cmds.bat"
and then run cmds.bat.
6. If the make succeeds, it will generate the programs "LESS.EXE" and
"LESSKEY.EXE" in your current directory. Test the generated programs.
7. When satisfied that it works, you may wish to install LESS.EXE and
LESSKEY.EXE in a directory which is included in your PATH.
=======================================================================
INSTALLATION (Windows-95, Windows-98 and Windows-NT systems only,
with Borland C or Microsoft Visual C++)
1. Move the distributed source to its own directory.
2. If you are using Borland C, rename Makefile.wnb to Makefile.
If you are using Microsoft Visual C++, rename Makefile.wnm to Makefile.
3. Check the Makefile to make sure the definitions look ok.
4. If you wish, you may edit defines.wn to remove some optional features.
If you choose not to include some features in your version, you may
wish to edit the manual page less.man and the help page help.c
to remove the descriptions of the features which you are removing.
5. Type "make" and watch the fun.
6. If the make succeeds, it will generate the programs "less.exe" and
"lesskey.exe" in your current directory. Test the generated programs.
7. When satisfied that it works, if you wish to install it
in a public place, type "make install".
See step 6 of the Unix installation instructions for details
on how to change the default installation directories.
=======================================================================
INSTALLATION (OS/2 systems only,
with EMX C)
1. Move the distributed source to its own directory.
2. Rename Makefile.o2e to Makefile.
3. Check the Makefile to make sure the definitions look ok.
4. If you wish, you may edit defines.o2 to remove some optional features.
If you choose not to include some features in your version, you may
wish to edit the manual page less.man and the help page help.c
to remove the descriptions of the features which you are removing.
5. Type "make" and watch the fun.
6. If the make succeeds, it will generate the programs "less.exe" and
"lesskey.exe" in your current directory. Test the generated programs.
7. Make sure you have the emx runtime installed. You need the emx DLLs
emx.dll and emxlibcs.dll and also the termcap database, termcap.dat.
Make sure you have termcap.dat either in the default location or
somewhere in a directory listed in the PATH or INIT environment
variables.
8. When satisfied that it works, you may wish to install less.exe,
lesskey.exe and scrsize.exe in a directory which is included in
your PATH. scrsize.exe is required only if you use a terminal
emulator such as xterm or rxvt.
=======================================================================
INSTALLATION (OS-9 systems only,
with Microware C or Ultra C)
1. Move the distributed source to its own directory.
2. If you are using Microware C, rename Makefile.o9c to Makefile.
If you are using Ultra C, rename Makefile.o9u to Makefile.
3. Check the Makefile to make sure the definitions look ok.
4. If you wish, you may edit defines.o9 to remove some optional features.
If you choose not to include some features in your version, you may
wish to edit the manual page less.man and the help page help.c
to remove the descriptions of the features which you are removing.
5. Type "dmake" and watch the fun.
The standard OS-9 "make" will probably not work. If you don't
have dmake, you can get a copy from os9archive.rtsi.com.
6. If the make succeeds, it will generate the programs "less" and
"lesskey" in your current directory. Test the generated programs.
7. When satisfied that it works, if you wish to install it
in a public place, type "dmake install".
See step 6 of the Unix installation instructions for details
on how to change the default installation directories.
=======================================================================
ACKNOWLEDGMENTS:
Some versions of the less distribution are packaged using
Info-ZIP's compression utility.
Info-ZIP's software is free and can be obtained as source
code or executables from various anonymous-ftp sites,
including ftp.uu.net:/pub/archiving/zip.
diff --git a/brac.c b/brac.c
index 53ada50aab56..58ecf172ae4e 100644
--- a/brac.c
+++ b/brac.c
@@ -1,100 +1,104 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
/*
* Routines to perform bracket matching functions.
*/
#include "less.h"
#include "position.h"
/*
* Try to match the n-th open bracket
* which appears in the top displayed line (forwdir),
* or the n-th close bracket
* which appears in the bottom displayed line (!forwdir).
* The characters which serve as "open bracket" and
* "close bracket" are given.
*/
public void
match_brac(obrac, cbrac, forwdir, n)
int obrac;
int cbrac;
int forwdir;
int n;
{
int c;
int nest;
POSITION pos;
int (*chget)();
extern int ch_forw_get(), ch_back_get();
/*
* Seek to the line containing the open bracket.
* This is either the top or bottom line on the screen,
* depending on the type of bracket.
*/
pos = position((forwdir) ? TOP : BOTTOM);
if (pos == NULL_POSITION || ch_seek(pos))
{
if (forwdir)
error("Nothing in top line", NULL_PARG);
else
error("Nothing in bottom line", NULL_PARG);
return;
}
/*
* Look thru the line to find the open bracket to match.
*/
do
{
if ((c = ch_forw_get()) == '\n' || c == EOI)
{
if (forwdir)
error("No bracket in top line", NULL_PARG);
else
error("No bracket in bottom line", NULL_PARG);
return;
}
} while (c != obrac || --n > 0);
/*
* Position the file just "after" the open bracket
* (in the direction in which we will be searching).
* If searching forward, we are already after the bracket.
* If searching backward, skip back over the open bracket.
*/
if (!forwdir)
(void) ch_back_get();
/*
* Search the file for the matching bracket.
*/
chget = (forwdir) ? ch_forw_get : ch_back_get;
nest = 0;
while ((c = (*chget)()) != EOI)
{
if (c == obrac)
+ {
+ if (nest == INT_MAX)
+ break;
nest++;
+ }
else if (c == cbrac && --nest < 0)
{
/*
* Found the matching bracket.
* If searching backward, put it on the top line.
* If searching forward, put it on the bottom line.
*/
jump_line_loc(ch_tell(), forwdir ? -1 : 1);
return;
}
}
error("No matching bracket", NULL_PARG);
}
diff --git a/ch.c b/ch.c
index 379dd84c41b8..bfad09c719f6 100644
--- a/ch.c
+++ b/ch.c
@@ -1,969 +1,980 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
/*
* Low level character input from the input file.
* We use these special purpose routines which optimize moving
* both forward and backward from the current read pointer.
*/
#include "less.h"
#if MSDOS_COMPILER==WIN32C
#include
#include
#endif
#if HAVE_STAT_INO
#include
extern dev_t curr_dev;
extern ino_t curr_ino;
#endif
+#if HAVE_PROCFS
+#include
+#endif
+
typedef POSITION BLOCKNUM;
public int ignore_eoi;
/*
* Pool of buffers holding the most recently used blocks of the input file.
* The buffer pool is kept as a doubly-linked circular list,
* in order from most- to least-recently used.
* The circular list is anchored by the file state "thisfile".
*/
struct bufnode {
struct bufnode *next, *prev;
struct bufnode *hnext, *hprev;
};
#define LBUFSIZE 8192
struct buf {
struct bufnode node;
BLOCKNUM block;
unsigned int datasize;
unsigned char data[LBUFSIZE];
};
#define bufnode_buf(bn) ((struct buf *) bn)
/*
* The file state is maintained in a filestate structure.
* A pointer to the filestate is kept in the ifile structure.
*/
#define BUFHASH_SIZE 1024
struct filestate {
struct bufnode buflist;
struct bufnode hashtbl[BUFHASH_SIZE];
int file;
int flags;
POSITION fpos;
int nbufs;
BLOCKNUM block;
unsigned int offset;
POSITION fsize;
};
#define ch_bufhead thisfile->buflist.next
#define ch_buftail thisfile->buflist.prev
#define ch_nbufs thisfile->nbufs
#define ch_block thisfile->block
#define ch_offset thisfile->offset
#define ch_fpos thisfile->fpos
#define ch_fsize thisfile->fsize
#define ch_flags thisfile->flags
#define ch_file thisfile->file
#define END_OF_CHAIN (&thisfile->buflist)
#define END_OF_HCHAIN(h) (&thisfile->hashtbl[h])
#define BUFHASH(blk) ((blk) & (BUFHASH_SIZE-1))
/*
* Macros to manipulate the list of buffers in thisfile->buflist.
*/
#define FOR_BUFS(bn) \
for (bn = ch_bufhead; bn != END_OF_CHAIN; bn = bn->next)
#define BUF_RM(bn) \
(bn)->next->prev = (bn)->prev; \
(bn)->prev->next = (bn)->next;
#define BUF_INS_HEAD(bn) \
(bn)->next = ch_bufhead; \
(bn)->prev = END_OF_CHAIN; \
ch_bufhead->prev = (bn); \
ch_bufhead = (bn);
#define BUF_INS_TAIL(bn) \
(bn)->next = END_OF_CHAIN; \
(bn)->prev = ch_buftail; \
ch_buftail->next = (bn); \
ch_buftail = (bn);
/*
* Macros to manipulate the list of buffers in thisfile->hashtbl[n].
*/
#define FOR_BUFS_IN_CHAIN(h,bn) \
for (bn = thisfile->hashtbl[h].hnext; \
bn != END_OF_HCHAIN(h); bn = bn->hnext)
#define BUF_HASH_RM(bn) \
(bn)->hnext->hprev = (bn)->hprev; \
(bn)->hprev->hnext = (bn)->hnext;
#define BUF_HASH_INS(bn,h) \
(bn)->hnext = thisfile->hashtbl[h].hnext; \
(bn)->hprev = END_OF_HCHAIN(h); \
thisfile->hashtbl[h].hnext->hprev = (bn); \
thisfile->hashtbl[h].hnext = (bn);
static struct filestate *thisfile;
static int ch_ungotchar = -1;
static int maxbufs = -1;
extern int autobuf;
extern int sigs;
extern int secure;
extern int screen_trashed;
extern int follow_mode;
extern constant char helpdata[];
extern constant int size_helpdata;
extern IFILE curr_ifile;
#if LOGFILE
extern int logfile;
extern char *namelogfile;
#endif
static int ch_addbuf();
/*
* Get the character pointed to by the read pointer.
*/
int
ch_get(VOID_PARAM)
{
struct buf *bp;
struct bufnode *bn;
int n;
int slept;
int h;
POSITION pos;
POSITION len;
if (thisfile == NULL)
return (EOI);
/*
* Quick check for the common case where
* the desired char is in the head buffer.
*/
if (ch_bufhead != END_OF_CHAIN)
{
bp = bufnode_buf(ch_bufhead);
if (ch_block == bp->block && ch_offset < bp->datasize)
return bp->data[ch_offset];
}
slept = FALSE;
/*
* Look for a buffer holding the desired block.
*/
h = BUFHASH(ch_block);
FOR_BUFS_IN_CHAIN(h, bn)
{
bp = bufnode_buf(bn);
if (bp->block == ch_block)
{
if (ch_offset >= bp->datasize)
/*
* Need more data in this buffer.
*/
break;
goto found;
}
}
if (bn == END_OF_HCHAIN(h))
{
/*
* Block is not in a buffer.
* Take the least recently used buffer
* and read the desired block into it.
* If the LRU buffer has data in it,
* then maybe allocate a new buffer.
*/
if (ch_buftail == END_OF_CHAIN ||
bufnode_buf(ch_buftail)->block != -1)
{
/*
* There is no empty buffer to use.
* Allocate a new buffer if:
* 1. We can't seek on this file and -b is not in effect; or
* 2. We haven't allocated the max buffers for this file yet.
*/
if ((autobuf && !(ch_flags & CH_CANSEEK)) ||
(maxbufs < 0 || ch_nbufs < maxbufs))
if (ch_addbuf())
/*
* Allocation failed: turn off autobuf.
*/
autobuf = OPT_OFF;
}
bn = ch_buftail;
bp = bufnode_buf(bn);
BUF_HASH_RM(bn); /* Remove from old hash chain. */
bp->block = ch_block;
bp->datasize = 0;
BUF_HASH_INS(bn, h); /* Insert into new hash chain. */
}
read_more:
pos = (ch_block * LBUFSIZE) + bp->datasize;
if ((len = ch_length()) != NULL_POSITION && pos >= len)
/*
* At end of file.
*/
return (EOI);
if (pos != ch_fpos)
{
/*
* Not at the correct position: must seek.
* If input is a pipe, we're in trouble (can't seek on a pipe).
* Some data has been lost: just return "?".
*/
if (!(ch_flags & CH_CANSEEK))
return ('?');
if (lseek(ch_file, (off_t)pos, SEEK_SET) == BAD_LSEEK)
{
error("seek error", NULL_PARG);
clear_eol();
return (EOI);
}
ch_fpos = pos;
}
/*
* Read the block.
* If we read less than a full block, that's ok.
* We use partial block and pick up the rest next time.
*/
if (ch_ungotchar != -1)
{
bp->data[bp->datasize] = ch_ungotchar;
n = 1;
ch_ungotchar = -1;
} else if (ch_flags & CH_HELPFILE)
{
bp->data[bp->datasize] = helpdata[ch_fpos];
n = 1;
} else
{
n = iread(ch_file, &bp->data[bp->datasize],
(unsigned int)(LBUFSIZE - bp->datasize));
}
if (n == READ_INTR)
return (EOI);
if (n < 0)
{
#if MSDOS_COMPILER==WIN32C
if (errno != EPIPE)
#endif
{
error("read error", NULL_PARG);
clear_eol();
}
n = 0;
}
#if LOGFILE
/*
* If we have a log file, write the new data to it.
*/
if (!secure && logfile >= 0 && n > 0)
write(logfile, (char *) &bp->data[bp->datasize], n);
#endif
ch_fpos += n;
bp->datasize += n;
/*
* If we have read to end of file, set ch_fsize to indicate
* the position of the end of file.
*/
if (n == 0)
{
ch_fsize = pos;
if (ignore_eoi)
{
/*
* We are ignoring EOF.
* Wait a while, then try again.
*/
if (!slept)
{
PARG parg;
parg.p_string = wait_message();
ierror("%s", &parg);
}
sleep_ms(2); /* Reduce system load */
slept = TRUE;
#if HAVE_STAT_INO
if (follow_mode == FOLLOW_NAME)
{
/* See whether the file's i-number has changed,
* or the file has shrunk.
* If so, force the file to be closed and
* reopened. */
struct stat st;
POSITION curr_pos = ch_tell();
int r = stat(get_filename(curr_ifile), &st);
if (r == 0 && (st.st_ino != curr_ino ||
st.st_dev != curr_dev ||
(curr_pos != NULL_POSITION && st.st_size < curr_pos)))
{
/* screen_trashed=2 causes
* make_display to reopen the file. */
screen_trashed = 2;
return (EOI);
}
}
#endif
}
if (sigs)
return (EOI);
}
found:
if (ch_bufhead != bn)
{
/*
* Move the buffer to the head of the buffer chain.
* This orders the buffer chain, most- to least-recently used.
*/
BUF_RM(bn);
BUF_INS_HEAD(bn);
/*
* Move to head of hash chain too.
*/
BUF_HASH_RM(bn);
BUF_HASH_INS(bn, h);
}
if (ch_offset >= bp->datasize)
/*
* After all that, we still don't have enough data.
* Go back and try again.
*/
goto read_more;
return (bp->data[ch_offset]);
}
/*
* ch_ungetchar is a rather kludgy and limited way to push
* a single char onto an input file descriptor.
*/
public void
ch_ungetchar(c)
int c;
{
if (c != -1 && ch_ungotchar != -1)
error("ch_ungetchar overrun", NULL_PARG);
ch_ungotchar = c;
}
#if LOGFILE
/*
* Close the logfile.
* If we haven't read all of standard input into it, do that now.
*/
public void
end_logfile(VOID_PARAM)
{
static int tried = FALSE;
if (logfile < 0)
return;
if (!tried && ch_fsize == NULL_POSITION)
{
tried = TRUE;
ierror("Finishing logfile", NULL_PARG);
while (ch_forw_get() != EOI)
if (ABORT_SIGS())
break;
}
close(logfile);
logfile = -1;
free(namelogfile);
namelogfile = NULL;
}
/*
* Start a log file AFTER less has already been running.
* Invoked from the - command; see toggle_option().
* Write all the existing buffered data to the log file.
*/
public void
sync_logfile(VOID_PARAM)
{
struct buf *bp;
struct bufnode *bn;
int warned = FALSE;
BLOCKNUM block;
BLOCKNUM nblocks;
nblocks = (ch_fpos + LBUFSIZE - 1) / LBUFSIZE;
for (block = 0; block < nblocks; block++)
{
int wrote = FALSE;
FOR_BUFS(bn)
{
bp = bufnode_buf(bn);
if (bp->block == block)
{
write(logfile, (char *) bp->data, bp->datasize);
wrote = TRUE;
break;
}
}
if (!wrote && !warned)
{
error("Warning: log file is incomplete",
NULL_PARG);
warned = TRUE;
}
}
}
#endif
/*
* Determine if a specific block is currently in one of the buffers.
*/
static int
buffered(block)
BLOCKNUM block;
{
struct buf *bp;
struct bufnode *bn;
int h;
h = BUFHASH(block);
FOR_BUFS_IN_CHAIN(h, bn)
{
bp = bufnode_buf(bn);
if (bp->block == block)
return (TRUE);
}
return (FALSE);
}
/*
* Seek to a specified position in the file.
* Return 0 if successful, non-zero if can't seek there.
*/
public int
ch_seek(pos)
POSITION pos;
{
BLOCKNUM new_block;
POSITION len;
if (thisfile == NULL)
return (0);
len = ch_length();
if (pos < ch_zero() || (len != NULL_POSITION && pos > len))
return (1);
new_block = pos / LBUFSIZE;
if (!(ch_flags & CH_CANSEEK) && pos != ch_fpos && !buffered(new_block))
{
if (ch_fpos > pos)
return (1);
while (ch_fpos < pos)
{
if (ch_forw_get() == EOI)
return (1);
if (ABORT_SIGS())
return (1);
}
return (0);
}
/*
* Set read pointer.
*/
ch_block = new_block;
ch_offset = pos % LBUFSIZE;
return (0);
}
/*
* Seek to the end of the file.
*/
public int
ch_end_seek(VOID_PARAM)
{
POSITION len;
if (thisfile == NULL)
return (0);
if (ch_flags & CH_CANSEEK)
ch_fsize = filesize(ch_file);
len = ch_length();
if (len != NULL_POSITION)
return (ch_seek(len));
/*
* Do it the slow way: read till end of data.
*/
while (ch_forw_get() != EOI)
if (ABORT_SIGS())
return (1);
return (0);
}
/*
* Seek to the last position in the file that is currently buffered.
*/
public int
ch_end_buffer_seek(VOID_PARAM)
{
struct buf *bp;
struct bufnode *bn;
POSITION buf_pos;
POSITION end_pos;
if (thisfile == NULL || (ch_flags & CH_CANSEEK))
return (ch_end_seek());
end_pos = 0;
FOR_BUFS(bn)
{
bp = bufnode_buf(bn);
buf_pos = (bp->block * LBUFSIZE) + bp->datasize;
if (buf_pos > end_pos)
end_pos = buf_pos;
}
return (ch_seek(end_pos));
}
/*
* Seek to the beginning of the file, or as close to it as we can get.
* We may not be able to seek there if input is a pipe and the
* beginning of the pipe is no longer buffered.
*/
public int
ch_beg_seek(VOID_PARAM)
{
struct bufnode *bn;
struct bufnode *firstbn;
/*
* Try a plain ch_seek first.
*/
if (ch_seek(ch_zero()) == 0)
return (0);
/*
* Can't get to position 0.
* Look thru the buffers for the one closest to position 0.
*/
firstbn = ch_bufhead;
if (firstbn == END_OF_CHAIN)
return (1);
FOR_BUFS(bn)
{
if (bufnode_buf(bn)->block < bufnode_buf(firstbn)->block)
firstbn = bn;
}
ch_block = bufnode_buf(firstbn)->block;
ch_offset = 0;
return (0);
}
/*
* Return the length of the file, if known.
*/
public POSITION
ch_length(VOID_PARAM)
{
if (thisfile == NULL)
return (NULL_POSITION);
if (ignore_eoi)
return (NULL_POSITION);
if (ch_flags & CH_HELPFILE)
return (size_helpdata);
if (ch_flags & CH_NODATA)
return (0);
return (ch_fsize);
}
/*
* Return the current position in the file.
*/
public POSITION
ch_tell(VOID_PARAM)
{
if (thisfile == NULL)
return (NULL_POSITION);
return (ch_block * LBUFSIZE) + ch_offset;
}
/*
* Get the current char and post-increment the read pointer.
*/
public int
ch_forw_get(VOID_PARAM)
{
int c;
if (thisfile == NULL)
return (EOI);
c = ch_get();
if (c == EOI)
return (EOI);
if (ch_offset < LBUFSIZE-1)
ch_offset++;
else
{
ch_block ++;
ch_offset = 0;
}
return (c);
}
/*
* Pre-decrement the read pointer and get the new current char.
*/
public int
ch_back_get(VOID_PARAM)
{
if (thisfile == NULL)
return (EOI);
if (ch_offset > 0)
ch_offset --;
else
{
if (ch_block <= 0)
return (EOI);
if (!(ch_flags & CH_CANSEEK) && !buffered(ch_block-1))
return (EOI);
ch_block--;
ch_offset = LBUFSIZE-1;
}
return (ch_get());
}
/*
* Set max amount of buffer space.
* bufspace is in units of 1024 bytes. -1 mean no limit.
*/
public void
ch_setbufspace(bufspace)
int bufspace;
{
if (bufspace < 0)
maxbufs = -1;
else
{
maxbufs = ((bufspace * 1024) + LBUFSIZE-1) / LBUFSIZE;
if (maxbufs < 1)
maxbufs = 1;
}
}
/*
* Flush (discard) any saved file state, including buffer contents.
*/
public void
ch_flush(VOID_PARAM)
{
struct bufnode *bn;
if (thisfile == NULL)
return;
if (!(ch_flags & CH_CANSEEK))
{
/*
* If input is a pipe, we don't flush buffer contents,
* since the contents can't be recovered.
*/
ch_fsize = NULL_POSITION;
return;
}
/*
* Initialize all the buffers.
*/
FOR_BUFS(bn)
{
bufnode_buf(bn)->block = -1;
}
/*
* Figure out the size of the file, if we can.
*/
ch_fsize = filesize(ch_file);
/*
* Seek to a known position: the beginning of the file.
*/
ch_fpos = 0;
ch_block = 0; /* ch_fpos / LBUFSIZE; */
ch_offset = 0; /* ch_fpos % LBUFSIZE; */
-#if 1
+#if HAVE_PROCFS
/*
* This is a kludge to workaround a Linux kernel bug: files in
* /proc have a size of 0 according to fstat() but have readable
* data. They are sometimes, but not always, seekable.
* Force them to be non-seekable here.
*/
if (ch_fsize == 0)
{
- ch_fsize = NULL_POSITION;
- ch_flags &= ~CH_CANSEEK;
+ struct statfs st;
+ if (fstatfs(ch_file, &st) == 0)
+ {
+ if (st.f_type == PROC_SUPER_MAGIC)
+ {
+ ch_fsize = NULL_POSITION;
+ ch_flags &= ~CH_CANSEEK;
+ }
+ }
}
#endif
if (lseek(ch_file, (off_t)0, SEEK_SET) == BAD_LSEEK)
{
/*
* Warning only; even if the seek fails for some reason,
* there's a good chance we're at the beginning anyway.
* {{ I think this is bogus reasoning. }}
*/
error("seek error to 0", NULL_PARG);
}
}
/*
* Allocate a new buffer.
* The buffer is added to the tail of the buffer chain.
*/
static int
ch_addbuf(VOID_PARAM)
{
struct buf *bp;
struct bufnode *bn;
/*
* Allocate and initialize a new buffer and link it
* onto the tail of the buffer list.
*/
bp = (struct buf *) calloc(1, sizeof(struct buf));
if (bp == NULL)
return (1);
ch_nbufs++;
bp->block = -1;
bn = &bp->node;
BUF_INS_TAIL(bn);
BUF_HASH_INS(bn, 0);
return (0);
}
/*
*
*/
static void
init_hashtbl(VOID_PARAM)
{
int h;
for (h = 0; h < BUFHASH_SIZE; h++)
{
thisfile->hashtbl[h].hnext = END_OF_HCHAIN(h);
thisfile->hashtbl[h].hprev = END_OF_HCHAIN(h);
}
}
/*
* Delete all buffers for this file.
*/
static void
ch_delbufs(VOID_PARAM)
{
struct bufnode *bn;
while (ch_bufhead != END_OF_CHAIN)
{
bn = ch_bufhead;
BUF_RM(bn);
free(bufnode_buf(bn));
}
ch_nbufs = 0;
init_hashtbl();
}
/*
* Is it possible to seek on a file descriptor?
*/
public int
seekable(f)
int f;
{
#if MSDOS_COMPILER
extern int fd0;
if (f == fd0 && !isatty(fd0))
{
/*
* In MS-DOS, pipes are seekable. Check for
* standard input, and pretend it is not seekable.
*/
return (0);
}
#endif
return (lseek(f, (off_t)1, SEEK_SET) != BAD_LSEEK);
}
/*
* Force EOF to be at the current read position.
* This is used after an ignore_eof read, during which the EOF may change.
*/
public void
ch_set_eof(VOID_PARAM)
{
if (ch_fsize != NULL_POSITION && ch_fsize < ch_fpos)
ch_fsize = ch_fpos;
}
/*
* Initialize file state for a new file.
*/
public void
ch_init(f, flags)
int f;
int flags;
{
/*
* See if we already have a filestate for this file.
*/
thisfile = (struct filestate *) get_filestate(curr_ifile);
if (thisfile == NULL)
{
/*
* Allocate and initialize a new filestate.
*/
thisfile = (struct filestate *)
ecalloc(1, sizeof(struct filestate));
thisfile->buflist.next = thisfile->buflist.prev = END_OF_CHAIN;
thisfile->nbufs = 0;
thisfile->flags = flags;
thisfile->fpos = 0;
thisfile->block = 0;
thisfile->offset = 0;
thisfile->file = -1;
thisfile->fsize = NULL_POSITION;
init_hashtbl();
/*
* Try to seek; set CH_CANSEEK if it works.
*/
if ((flags & CH_CANSEEK) && !seekable(f))
ch_flags &= ~CH_CANSEEK;
set_filestate(curr_ifile, (void *) thisfile);
}
if (thisfile->file == -1)
thisfile->file = f;
ch_flush();
}
/*
* Close a filestate.
*/
public void
ch_close(VOID_PARAM)
{
int keepstate = FALSE;
if (thisfile == NULL)
return;
if ((ch_flags & (CH_CANSEEK|CH_POPENED|CH_HELPFILE)) && !(ch_flags & CH_KEEPOPEN))
{
/*
* We can seek or re-open, so we don't need to keep buffers.
*/
ch_delbufs();
} else
keepstate = TRUE;
if (!(ch_flags & CH_KEEPOPEN))
{
/*
* We don't need to keep the file descriptor open
* (because we can re-open it.)
* But don't really close it if it was opened via popen(),
* because pclose() wants to close it.
*/
if (!(ch_flags & (CH_POPENED|CH_HELPFILE)))
close(ch_file);
ch_file = -1;
} else
keepstate = TRUE;
if (!keepstate)
{
/*
* We don't even need to keep the filestate structure.
*/
free(thisfile);
thisfile = NULL;
set_filestate(curr_ifile, (void *) NULL);
}
}
/*
* Return ch_flags for the current file.
*/
public int
ch_getflags(VOID_PARAM)
{
if (thisfile == NULL)
return (0);
return (ch_flags);
}
#if 0
public void
ch_dump(struct filestate *fs)
{
struct buf *bp;
struct bufnode *bn;
unsigned char *s;
if (fs == NULL)
{
printf(" --no filestate\n");
return;
}
printf(" file %d, flags %x, fpos %x, fsize %x, blk/off %x/%x\n",
fs->file, fs->flags, fs->fpos,
fs->fsize, fs->block, fs->offset);
printf(" %d bufs:\n", fs->nbufs);
for (bn = fs->next; bn != &fs->buflist; bn = bn->next)
{
bp = bufnode_buf(bn);
printf("%x: blk %x, size %x \"",
bp, bp->block, bp->datasize);
for (s = bp->data; s < bp->data + 30; s++)
if (*s >= ' ' && *s < 0x7F)
printf("%c", *s);
else
printf(".");
printf("\"\n");
}
}
#endif
diff --git a/charset.c b/charset.c
index b37c8a29cbd9..5e9a2d6427b8 100644
--- a/charset.c
+++ b/charset.c
@@ -1,853 +1,841 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
/*
* Functions to define the character set
* and do things specific to the character set.
*/
#include "less.h"
#if HAVE_LOCALE
#include
#include
#include
#endif
#include "charset.h"
#if MSDOS_COMPILER==WIN32C
#define WIN32_LEAN_AND_MEAN
#include
#endif
extern int bs_mode;
public int utf_mode = 0;
/*
* Predefined character sets,
* selected by the LESSCHARSET environment variable.
*/
struct charset {
char *name;
int *p_flag;
char *desc;
} charsets[] = {
{ "ascii", NULL, "8bcccbcc18b95.b" },
{ "utf-8", &utf_mode, "8bcccbcc18b95.b126.bb" },
{ "iso8859", NULL, "8bcccbcc18b95.33b." },
{ "latin3", NULL, "8bcccbcc18b95.33b5.b8.b15.b4.b12.b18.b12.b." },
{ "arabic", NULL, "8bcccbcc18b95.33b.3b.7b2.13b.3b.b26.5b19.b" },
{ "greek", NULL, "8bcccbcc18b95.33b4.2b4.b3.b35.b44.b" },
{ "greek2005", NULL, "8bcccbcc18b95.33b14.b35.b44.b" },
{ "hebrew", NULL, "8bcccbcc18b95.33b.b29.32b28.2b2.b" },
{ "koi8-r", NULL, "8bcccbcc18b95.b." },
{ "KOI8-T", NULL, "8bcccbcc18b95.b8.b6.b8.b.b.5b7.3b4.b4.b3.b.b.3b." },
{ "georgianps", NULL, "8bcccbcc18b95.3b11.4b12.2b." },
{ "tcvn", NULL, "b..b...bcccbccbbb7.8b95.b48.5b." },
{ "TIS-620", NULL, "8bcccbcc18b95.b.4b.11b7.8b." },
{ "next", NULL, "8bcccbcc18b95.bb125.bb" },
{ "dos", NULL, "8bcccbcc12bc5b95.b." },
{ "windows-1251", NULL, "8bcccbcc12bc5b95.b24.b." },
{ "windows-1252", NULL, "8bcccbcc12bc5b95.b.b11.b.2b12.b." },
{ "windows-1255", NULL, "8bcccbcc12bc5b95.b.b8.b.5b9.b.4b." },
{ "ebcdic", NULL, "5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b." },
{ "IBM-1047", NULL, "4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc191.b" },
{ NULL, NULL, NULL }
};
/*
* Support "locale charmap"/nl_langinfo(CODESET) values, as well as others.
*/
struct cs_alias {
char *name;
char *oname;
} cs_aliases[] = {
{ "UTF-8", "utf-8" },
{ "utf8", "utf-8" },
{ "UTF8", "utf-8" },
{ "ANSI_X3.4-1968", "ascii" },
{ "US-ASCII", "ascii" },
{ "latin1", "iso8859" },
{ "ISO-8859-1", "iso8859" },
{ "latin9", "iso8859" },
{ "ISO-8859-15", "iso8859" },
{ "latin2", "iso8859" },
{ "ISO-8859-2", "iso8859" },
{ "ISO-8859-3", "latin3" },
{ "latin4", "iso8859" },
{ "ISO-8859-4", "iso8859" },
{ "cyrillic", "iso8859" },
{ "ISO-8859-5", "iso8859" },
{ "ISO-8859-6", "arabic" },
{ "ISO-8859-7", "greek" },
{ "IBM9005", "greek2005" },
{ "ISO-8859-8", "hebrew" },
{ "latin5", "iso8859" },
{ "ISO-8859-9", "iso8859" },
{ "latin6", "iso8859" },
{ "ISO-8859-10", "iso8859" },
{ "latin7", "iso8859" },
{ "ISO-8859-13", "iso8859" },
{ "latin8", "iso8859" },
{ "ISO-8859-14", "iso8859" },
{ "latin10", "iso8859" },
{ "ISO-8859-16", "iso8859" },
{ "IBM437", "dos" },
{ "EBCDIC-US", "ebcdic" },
{ "IBM1047", "IBM-1047" },
{ "KOI8-R", "koi8-r" },
{ "KOI8-U", "koi8-r" },
{ "GEORGIAN-PS", "georgianps" },
{ "TCVN5712-1", "tcvn" },
{ "NEXTSTEP", "next" },
{ "windows", "windows-1252" }, /* backward compatibility */
{ "CP1251", "windows-1251" },
{ "CP1252", "windows-1252" },
{ "CP1255", "windows-1255" },
{ NULL, NULL }
};
#define IS_BINARY_CHAR 01
#define IS_CONTROL_CHAR 02
static char chardef[256];
static char *binfmt = NULL;
static char *utfbinfmt = NULL;
public int binattr = AT_STANDOUT|AT_COLOR_BIN;
/*
* Define a charset, given a description string.
* The string consists of 256 letters,
* one for each character in the charset.
* If the string is shorter than 256 letters, missing letters
* are taken to be identical to the last one.
* A decimal number followed by a letter is taken to be a
* repetition of the letter.
*
* Each letter is one of:
* . normal character
* b binary character
* c control character
*/
static void
ichardef(s)
char *s;
{
char *cp;
int n;
char v;
n = 0;
v = 0;
cp = chardef;
while (*s != '\0')
{
switch (*s++)
{
case '.':
v = 0;
break;
case 'c':
v = IS_CONTROL_CHAR;
break;
case 'b':
v = IS_BINARY_CHAR|IS_CONTROL_CHAR;
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
n = (10 * n) + (s[-1] - '0');
continue;
default:
error("invalid chardef", NULL_PARG);
quit(QUIT_ERROR);
/*NOTREACHED*/
}
do
{
if (cp >= chardef + sizeof(chardef))
{
error("chardef longer than 256", NULL_PARG);
quit(QUIT_ERROR);
/*NOTREACHED*/
}
*cp++ = v;
} while (--n > 0);
n = 0;
}
while (cp < chardef + sizeof(chardef))
*cp++ = v;
}
/*
* Define a charset, given a charset name.
* The valid charset names are listed in the "charsets" array.
*/
static int
icharset(name, no_error)
char *name;
int no_error;
{
struct charset *p;
struct cs_alias *a;
if (name == NULL || *name == '\0')
return (0);
/* First see if the name is an alias. */
for (a = cs_aliases; a->name != NULL; a++)
{
if (strcmp(name, a->name) == 0)
{
name = a->oname;
break;
}
}
for (p = charsets; p->name != NULL; p++)
{
if (strcmp(name, p->name) == 0)
{
ichardef(p->desc);
if (p->p_flag != NULL)
{
#if MSDOS_COMPILER==WIN32C
*(p->p_flag) = 1 + (GetConsoleOutputCP() != CP_UTF8);
#else
*(p->p_flag) = 1;
#endif
}
return (1);
}
}
if (!no_error) {
error("invalid charset name", NULL_PARG);
quit(QUIT_ERROR);
}
return (0);
}
#if HAVE_LOCALE
/*
* Define a charset, given a locale name.
*/
static void
ilocale(VOID_PARAM)
{
int c;
for (c = 0; c < (int) sizeof(chardef); c++)
{
if (isprint(c))
chardef[c] = 0;
else if (iscntrl(c))
chardef[c] = IS_CONTROL_CHAR;
else
chardef[c] = IS_BINARY_CHAR|IS_CONTROL_CHAR;
}
}
#endif
/*
* Define the printing format for control (or binary utf) chars.
*/
public void
setfmt(s, fmtvarptr, attrptr, default_fmt)
char *s;
char **fmtvarptr;
int *attrptr;
char *default_fmt;
{
if (s && utf_mode)
{
/* It would be too hard to account for width otherwise. */
char constant *t = s;
while (*t)
{
if (*t < ' ' || *t > '~')
{
s = default_fmt;
goto attr;
}
t++;
}
}
/* %n is evil */
if (s == NULL || *s == '\0' ||
(*s == '*' && (s[1] == '\0' || s[2] == '\0' || strchr(s + 2, 'n'))) ||
(*s != '*' && strchr(s, 'n')))
s = default_fmt;
/*
* Select the attributes if it starts with "*".
*/
attr:
if (*s == '*' && s[1] != '\0')
{
switch (s[1])
{
case 'd': *attrptr = AT_BOLD; break;
case 'k': *attrptr = AT_BLINK; break;
case 's': *attrptr = AT_STANDOUT; break;
case 'u': *attrptr = AT_UNDERLINE; break;
default: *attrptr = AT_NORMAL; break;
}
s += 2;
}
*fmtvarptr = s;
}
/*
*
*/
static void
set_charset(VOID_PARAM)
{
char *s;
#if MSDOS_COMPILER==WIN32C
/*
* If the Windows console is using UTF-8, we'll use it too.
*/
if (GetConsoleOutputCP() == CP_UTF8)
if (icharset("utf-8", 1))
return;
#endif
/*
* See if environment variable LESSCHARSET is defined.
*/
s = lgetenv("LESSCHARSET");
if (icharset(s, 0))
return;
/*
* LESSCHARSET is not defined: try LESSCHARDEF.
*/
s = lgetenv("LESSCHARDEF");
if (!isnullenv(s))
{
ichardef(s);
return;
}
#if HAVE_LOCALE
#ifdef CODESET
/*
* Try using the codeset name as the charset name.
*/
s = nl_langinfo(CODESET);
if (icharset(s, 1))
return;
#endif
#endif
#if HAVE_STRSTR
/*
* Check whether LC_ALL, LC_CTYPE or LANG look like UTF-8 is used.
*/
if ((s = lgetenv("LC_ALL")) != NULL ||
(s = lgetenv("LC_CTYPE")) != NULL ||
(s = lgetenv("LANG")) != NULL)
{
if ( strstr(s, "UTF-8") != NULL || strstr(s, "utf-8") != NULL
|| strstr(s, "UTF8") != NULL || strstr(s, "utf8") != NULL)
if (icharset("utf-8", 1))
return;
}
#endif
#if HAVE_LOCALE
/*
* Get character definitions from locale functions,
* rather than from predefined charset entry.
*/
ilocale();
#else
#if MSDOS_COMPILER
/*
* Default to "dos".
*/
(void) icharset("dos", 1);
#else
/*
* Default to "latin1".
*/
(void) icharset("latin1", 1);
#endif
#endif
}
/*
* Initialize charset data structures.
*/
public void
init_charset(VOID_PARAM)
{
char *s;
#if HAVE_LOCALE
setlocale(LC_ALL, "");
#endif
set_charset();
s = lgetenv("LESSBINFMT");
setfmt(s, &binfmt, &binattr, "*s<%02X>");
s = lgetenv("LESSUTFBINFMT");
setfmt(s, &utfbinfmt, &binattr, "");
}
/*
* Is a given character a "binary" character?
*/
public int
binary_char(c)
LWCHAR c;
{
if (utf_mode)
return (is_ubin_char(c));
c &= 0377;
return (chardef[c] & IS_BINARY_CHAR);
}
/*
* Is a given character a "control" character?
*/
public int
control_char(c)
LWCHAR c;
{
c &= 0377;
return (chardef[c] & IS_CONTROL_CHAR);
}
/*
* Return the printable form of a character.
* For example, in the "ascii" charset '\3' is printed as "^C".
*/
public char *
prchar(c)
LWCHAR c;
{
/* {{ This buffer can be overrun if LESSBINFMT is a long string. }} */
- static char buf[32];
+ static char buf[MAX_PRCHAR_LEN+1];
c &= 0377;
if ((c < 128 || !utf_mode) && !control_char(c))
SNPRINTF1(buf, sizeof(buf), "%c", (int) c);
else if (c == ESC)
strcpy(buf, "ESC");
#if IS_EBCDIC_HOST
else if (!binary_char(c) && c < 64)
SNPRINTF1(buf, sizeof(buf), "^%c",
/*
* This array roughly inverts CONTROL() #defined in less.h,
* and should be kept in sync with CONTROL() and IBM-1047.
*/
"@ABC.I.?...KLMNO"
"PQRS.JH.XY.."
"\\]^_"
"......W[.....EFG"
"..V....D....TU.Z"[c]);
#else
else if (c < 128 && !control_char(c ^ 0100))
SNPRINTF1(buf, sizeof(buf), "^%c", (int) (c ^ 0100));
#endif
else
SNPRINTF1(buf, sizeof(buf), binfmt, c);
return (buf);
}
/*
* Return the printable form of a UTF-8 character.
*/
public char *
prutfchar(ch)
LWCHAR ch;
{
- static char buf[32];
+ static char buf[MAX_PRCHAR_LEN+1];
if (ch == ESC)
strcpy(buf, "ESC");
else if (ch < 128 && control_char(ch))
{
if (!control_char(ch ^ 0100))
SNPRINTF1(buf, sizeof(buf), "^%c", ((char) ch) ^ 0100);
else
SNPRINTF1(buf, sizeof(buf), binfmt, (char) ch);
} else if (is_ubin_char(ch))
{
SNPRINTF1(buf, sizeof(buf), utfbinfmt, ch);
} else
{
char *p = buf;
if (ch >= 0x80000000)
ch = 0xFFFD; /* REPLACEMENT CHARACTER */
put_wchar(&p, ch);
*p = '\0';
}
return (buf);
}
/*
* Get the length of a UTF-8 character in bytes.
*/
public int
utf_len(ch)
int ch;
{
if ((ch & 0x80) == 0)
return 1;
if ((ch & 0xE0) == 0xC0)
return 2;
if ((ch & 0xF0) == 0xE0)
return 3;
if ((ch & 0xF8) == 0xF0)
return 4;
if ((ch & 0xFC) == 0xF8)
return 5;
if ((ch & 0xFE) == 0xFC)
return 6;
/* Invalid UTF-8 encoding. */
return 1;
}
/*
* Does the parameter point to the lead byte of a well-formed UTF-8 character?
*/
public int
is_utf8_well_formed(ss, slen)
char *ss;
int slen;
{
int i;
int len;
unsigned char *s = (unsigned char *) ss;
if (IS_UTF8_INVALID(s[0]))
return (0);
len = utf_len(s[0]);
if (len > slen)
return (0);
if (len == 1)
return (1);
if (len == 2)
{
if (s[0] < 0xC2)
return (0);
} else
{
unsigned char mask;
mask = (~((1 << (8-len)) - 1)) & 0xFF;
if (s[0] == mask && (s[1] & mask) == 0x80)
return (0);
}
for (i = 1; i < len; i++)
if (!IS_UTF8_TRAIL(s[i]))
return (0);
return (1);
}
/*
* Skip bytes until a UTF-8 lead byte (11xxxxxx) or ASCII byte (0xxxxxxx) is found.
*/
public void
utf_skip_to_lead(pp, limit)
char **pp;
char *limit;
{
do {
++(*pp);
} while (*pp < limit && !IS_UTF8_LEAD((*pp)[0] & 0377) && !IS_ASCII_OCTET((*pp)[0]));
}
/*
* Get the value of a UTF-8 character.
*/
public LWCHAR
get_wchar(p)
constant char *p;
{
switch (utf_len(p[0]))
{
case 1:
default:
/* 0xxxxxxx */
return (LWCHAR)
(p[0] & 0xFF);
case 2:
/* 110xxxxx 10xxxxxx */
return (LWCHAR) (
((p[0] & 0x1F) << 6) |
(p[1] & 0x3F));
case 3:
/* 1110xxxx 10xxxxxx 10xxxxxx */
return (LWCHAR) (
((p[0] & 0x0F) << 12) |
((p[1] & 0x3F) << 6) |
(p[2] & 0x3F));
case 4:
/* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
return (LWCHAR) (
((p[0] & 0x07) << 18) |
((p[1] & 0x3F) << 12) |
((p[2] & 0x3F) << 6) |
(p[3] & 0x3F));
case 5:
/* 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */
return (LWCHAR) (
((p[0] & 0x03) << 24) |
((p[1] & 0x3F) << 18) |
((p[2] & 0x3F) << 12) |
((p[3] & 0x3F) << 6) |
(p[4] & 0x3F));
case 6:
/* 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */
return (LWCHAR) (
((p[0] & 0x01) << 30) |
((p[1] & 0x3F) << 24) |
((p[2] & 0x3F) << 18) |
((p[3] & 0x3F) << 12) |
((p[4] & 0x3F) << 6) |
(p[5] & 0x3F));
}
}
/*
* Store a character into a UTF-8 string.
*/
public void
put_wchar(pp, ch)
char **pp;
LWCHAR ch;
{
if (!utf_mode || ch < 0x80)
{
/* 0xxxxxxx */
*(*pp)++ = (char) ch;
} else if (ch < 0x800)
{
/* 110xxxxx 10xxxxxx */
*(*pp)++ = (char) (0xC0 | ((ch >> 6) & 0x1F));
*(*pp)++ = (char) (0x80 | (ch & 0x3F));
} else if (ch < 0x10000)
{
/* 1110xxxx 10xxxxxx 10xxxxxx */
*(*pp)++ = (char) (0xE0 | ((ch >> 12) & 0x0F));
*(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F));
*(*pp)++ = (char) (0x80 | (ch & 0x3F));
} else if (ch < 0x200000)
{
/* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
*(*pp)++ = (char) (0xF0 | ((ch >> 18) & 0x07));
*(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F));
*(*pp)++ = (char) (0x80 | (ch & 0x3F));
} else if (ch < 0x4000000)
{
/* 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */
*(*pp)++ = (char) (0xF0 | ((ch >> 24) & 0x03));
*(*pp)++ = (char) (0x80 | ((ch >> 18) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F));
*(*pp)++ = (char) (0x80 | (ch & 0x3F));
} else
{
/* 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */
*(*pp)++ = (char) (0xF0 | ((ch >> 30) & 0x01));
*(*pp)++ = (char) (0x80 | ((ch >> 24) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 18) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F));
*(*pp)++ = (char) (0x80 | (ch & 0x3F));
}
}
/*
* Step forward or backward one character in a string.
*/
public LWCHAR
step_char(pp, dir, limit)
char **pp;
signed int dir;
constant char *limit;
{
LWCHAR ch;
int len;
char *p = *pp;
if (!utf_mode)
{
/* It's easy if chars are one byte. */
if (dir > 0)
ch = (LWCHAR) (unsigned char) ((p < limit) ? *p++ : 0);
else
ch = (LWCHAR) (unsigned char) ((p > limit) ? *--p : 0);
} else if (dir > 0)
{
len = utf_len(*p);
if (p + len > limit)
{
ch = 0;
p = (char *) limit;
} else
{
ch = get_wchar(p);
p += len;
}
} else
{
while (p > limit && IS_UTF8_TRAIL(p[-1]))
p--;
if (p > limit)
ch = get_wchar(--p);
else
ch = 0;
}
*pp = p;
return ch;
}
/*
* Unicode characters data
* Actual data is in the generated *.uni files.
*/
#define DECLARE_RANGE_TABLE_START(name) \
static struct wchar_range name##_array[] = {
#define DECLARE_RANGE_TABLE_END(name) \
}; struct wchar_range_table name##_table = { name##_array, sizeof(name##_array)/sizeof(*name##_array) };
DECLARE_RANGE_TABLE_START(compose)
#include "compose.uni"
DECLARE_RANGE_TABLE_END(compose)
DECLARE_RANGE_TABLE_START(ubin)
#include "ubin.uni"
DECLARE_RANGE_TABLE_END(ubin)
DECLARE_RANGE_TABLE_START(wide)
#include "wide.uni"
DECLARE_RANGE_TABLE_END(wide)
DECLARE_RANGE_TABLE_START(fmt)
#include "fmt.uni"
DECLARE_RANGE_TABLE_END(fmt)
/* comb_table is special pairs, not ranges. */
static struct wchar_range comb_table[] = {
{0x0644,0x0622}, {0x0644,0x0623}, {0x0644,0x0625}, {0x0644,0x0627},
};
static int
is_in_table(ch, table)
LWCHAR ch;
struct wchar_range_table *table;
{
int hi;
int lo;
/* Binary search in the table. */
if (ch < table->table[0].first)
return 0;
lo = 0;
hi = table->count - 1;
while (lo <= hi)
{
int mid = (lo + hi) / 2;
if (ch > table->table[mid].last)
lo = mid + 1;
else if (ch < table->table[mid].first)
hi = mid - 1;
else
return 1;
}
return 0;
}
/*
* Is a character a UTF-8 composing character?
* If a composing character follows any char, the two combine into one glyph.
*/
public int
is_composing_char(ch)
LWCHAR ch;
{
return is_in_table(ch, &compose_table) ||
(bs_mode != BS_CONTROL && is_in_table(ch, &fmt_table));
}
/*
* Should this UTF-8 character be treated as binary?
*/
public int
is_ubin_char(ch)
LWCHAR ch;
{
int ubin = is_in_table(ch, &ubin_table) ||
(bs_mode == BS_CONTROL && is_in_table(ch, &fmt_table));
-#if MSDOS_COMPILER==WIN32C
- if (!ubin && utf_mode == 2 && ch < 0x10000)
- {
- /*
- * Consider it binary if it can't be converted.
- */
- BOOL used_default = TRUE;
- WideCharToMultiByte(GetConsoleOutputCP(), WC_NO_BEST_FIT_CHARS, (LPCWSTR) &ch, 1, NULL, 0, NULL, &used_default);
- if (used_default)
- ubin = 1;
- }
-#endif
return ubin;
}
/*
* Is this a double width UTF-8 character?
*/
public int
is_wide_char(ch)
LWCHAR ch;
{
return is_in_table(ch, &wide_table);
}
/*
* Is a character a UTF-8 combining character?
* A combining char acts like an ordinary char, but if it follows
* a specific char (not any char), the two combine into one glyph.
*/
public int
is_combining_char(ch1, ch2)
LWCHAR ch1;
LWCHAR ch2;
{
/* The table is small; use linear search. */
int i;
for (i = 0; i < sizeof(comb_table)/sizeof(*comb_table); i++)
{
if (ch1 == comb_table[i].first &&
ch2 == comb_table[i].last)
return 1;
}
return 0;
}
diff --git a/charset.h b/charset.h
index 3e7ecf73db94..aa6273dfda6c 100644
--- a/charset.h
+++ b/charset.h
@@ -1,18 +1,18 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
#define IS_ASCII_OCTET(c) (((c) & 0x80) == 0)
#define IS_UTF8_TRAIL(c) (((c) & 0xC0) == 0x80)
#define IS_UTF8_LEAD2(c) (((c) & 0xE0) == 0xC0)
#define IS_UTF8_LEAD3(c) (((c) & 0xF0) == 0xE0)
#define IS_UTF8_LEAD4(c) (((c) & 0xF8) == 0xF0)
#define IS_UTF8_LEAD5(c) (((c) & 0xFC) == 0xF8)
#define IS_UTF8_LEAD6(c) (((c) & 0xFE) == 0xFC)
#define IS_UTF8_INVALID(c) (((c) & 0xFE) == 0xFE)
#define IS_UTF8_LEAD(c) (((c) & 0xC0) == 0xC0 && !IS_UTF8_INVALID(c))
diff --git a/cmd.h b/cmd.h
index c51f0bc5c4f3..b0f3fdb14b1e 100644
--- a/cmd.h
+++ b/cmd.h
@@ -1,145 +1,146 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
#define MAX_USERCMD 1000
#define MAX_CMDLEN 16
#define A_B_LINE 2
#define A_B_SCREEN 3
#define A_B_SCROLL 4
#define A_B_SEARCH 5
#define A_DIGIT 6
#define A_DISP_OPTION 7
#define A_DEBUG 8
#define A_EXAMINE 9
#define A_FIRSTCMD 10
#define A_FREPAINT 11
#define A_F_LINE 12
#define A_F_SCREEN 13
#define A_F_SCROLL 14
#define A_F_SEARCH 15
#define A_GOEND 16
#define A_GOLINE 17
#define A_GOMARK 18
#define A_HELP 19
#define A_NEXT_FILE 20
#define A_PERCENT 21
#define A_PREV_FILE 23
#define A_QUIT 24
#define A_REPAINT 25
#define A_SETMARK 26
#define A_SHELL 27
#define A_STAT 28
#define A_FF_LINE 29
#define A_BF_LINE 30
#define A_VERSION 31
#define A_VISUAL 32
#define A_F_WINDOW 33
#define A_B_WINDOW 34
#define A_F_BRACKET 35
#define A_B_BRACKET 36
#define A_PIPE 37
#define A_INDEX_FILE 38
#define A_UNDO_SEARCH 39
#define A_FF_SCREEN 40
#define A_LSHIFT 41
#define A_RSHIFT 42
#define A_AGAIN_SEARCH 43
#define A_T_AGAIN_SEARCH 44
#define A_REVERSE_SEARCH 45
#define A_T_REVERSE_SEARCH 46
#define A_OPT_TOGGLE 47
#define A_OPT_SET 48
#define A_OPT_UNSET 49
#define A_F_FOREVER 50
#define A_GOPOS 51
#define A_REMOVE_FILE 52
#define A_NEXT_TAG 53
#define A_PREV_TAG 54
#define A_FILTER 55
#define A_F_UNTIL_HILITE 56
#define A_GOEND_BUF 57
#define A_LLSHIFT 58
#define A_RRSHIFT 59
#define A_CLRMARK 62
#define A_SETMARKBOT 63
#define A_X11MOUSE_IN 64
#define A_F_MOUSE 66
#define A_B_MOUSE 67
/* Note "X116" refers to extended (1006) X11 mouse reporting. */
#define A_X116MOUSE_IN 68
#define A_CLR_SEARCH 70
/* These values must not conflict with any A_* or EC_* value. */
#define A_INVALID 100
#define A_NOACTION 101
#define A_UINVALID 102
#define A_END_LIST 103
#define A_SPECIAL_KEY 104
#define A_PREFIX 105
#define A_SKIP 127
#define A_EXTRA 0200
/* Line editing characters */
#define EC_BACKSPACE 1
#define EC_LINEKILL 2
#define EC_RIGHT 3
#define EC_LEFT 4
#define EC_W_LEFT 5
#define EC_W_RIGHT 6
#define EC_INSERT 7
#define EC_DELETE 8
#define EC_HOME 9
#define EC_END 10
#define EC_W_BACKSPACE 11
#define EC_W_DELETE 12
#define EC_UP 13
#define EC_DOWN 14
#define EC_EXPAND 15
#define EC_F_COMPLETE 17
#define EC_B_COMPLETE 18
#define EC_LITERAL 19
#define EC_ABORT 20
#define EC_X11MOUSE 21
#define EC_X116MOUSE 22
#define EC_UINVALID 102
/* Flags for editchar() */
#define ECF_PEEK 01
#define ECF_NOHISTORY 02
#define ECF_NOCOMPLETE 04
#define ECF_NORIGHTLEFT 010
/* Environment variable stuff */
#define EV_OK 01
/* Special keys (keys which output different strings on different terminals) */
#define SK_SPECIAL_KEY CONTROL('K')
#define SK_RIGHT_ARROW 1
#define SK_LEFT_ARROW 2
#define SK_UP_ARROW 3
#define SK_DOWN_ARROW 4
#define SK_PAGE_UP 5
#define SK_PAGE_DOWN 6
#define SK_HOME 7
#define SK_END 8
#define SK_DELETE 9
#define SK_INSERT 10
#define SK_CTL_LEFT_ARROW 11
#define SK_CTL_RIGHT_ARROW 12
#define SK_CTL_DELETE 13
#define SK_F1 14
#define SK_BACKTAB 15
#define SK_CTL_BACKSPACE 16
+#define SK_BACKSPACE 17
#define SK_CONTROL_K 40
diff --git a/cmdbuf.c b/cmdbuf.c
index dd135382aa11..5b5704602d8d 100644
--- a/cmdbuf.c
+++ b/cmdbuf.c
@@ -1,1745 +1,1782 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
/*
* Functions which manipulate the command buffer.
* Used only by command() and related functions.
*/
#include "less.h"
#include "cmd.h"
#include "charset.h"
#if HAVE_STAT
#include
#endif
extern int sc_width;
extern int utf_mode;
extern int no_hist_dups;
extern int marks_modified;
+extern int secure;
static char cmdbuf[CMDBUF_SIZE]; /* Buffer for holding a multi-char command */
static int cmd_col; /* Current column of the cursor */
static int prompt_col; /* Column of cursor just after prompt */
static char *cp; /* Pointer into cmdbuf */
static int cmd_offset; /* Index into cmdbuf of first displayed char */
static int literal; /* Next input char should not be interpreted */
-static int updown_match = -1; /* Prefix length in up/down movement */
+public int updown_match = -1; /* Prefix length in up/down movement */
#if TAB_COMPLETE_FILENAME
static int cmd_complete LESSPARAMS((int action));
/*
* These variables are statics used by cmd_complete.
*/
static int in_completion = 0;
static char *tk_text;
static char *tk_original;
static char *tk_ipoint;
static char *tk_trial = NULL;
static struct textlist tk_tlist;
#endif
static int cmd_left();
static int cmd_right();
#if SPACES_IN_FILENAMES
public char openquote = '"';
public char closequote = '"';
#endif
#if CMD_HISTORY
/* History file */
#define HISTFILE_FIRST_LINE ".less-history-file:"
#define HISTFILE_SEARCH_SECTION ".search"
#define HISTFILE_SHELL_SECTION ".shell"
#define HISTFILE_MARK_SECTION ".mark"
/*
* A mlist structure represents a command history.
*/
struct mlist
{
struct mlist *next;
struct mlist *prev;
struct mlist *curr_mp;
char *string;
int modified;
};
/*
* These are the various command histories that exist.
*/
struct mlist mlist_search =
{ &mlist_search, &mlist_search, &mlist_search, NULL, 0 };
public void *ml_search = (void *) &mlist_search;
struct mlist mlist_examine =
{ &mlist_examine, &mlist_examine, &mlist_examine, NULL, 0 };
public void *ml_examine = (void *) &mlist_examine;
#if SHELL_ESCAPE || PIPEC
struct mlist mlist_shell =
{ &mlist_shell, &mlist_shell, &mlist_shell, NULL, 0 };
public void *ml_shell = (void *) &mlist_shell;
#endif
#else /* CMD_HISTORY */
/* If CMD_HISTORY is off, these are just flags. */
public void *ml_search = (void *)1;
public void *ml_examine = (void *)2;
#if SHELL_ESCAPE || PIPEC
public void *ml_shell = (void *)3;
#endif
#endif /* CMD_HISTORY */
/*
* History for the current command.
*/
static struct mlist *curr_mlist = NULL;
static int curr_cmdflags;
static char cmd_mbc_buf[MAX_UTF_CHAR_LEN];
static int cmd_mbc_buf_len;
static int cmd_mbc_buf_index;
/*
* Reset command buffer (to empty).
*/
public void
cmd_reset(VOID_PARAM)
{
cp = cmdbuf;
*cp = '\0';
cmd_col = 0;
cmd_offset = 0;
literal = 0;
cmd_mbc_buf_len = 0;
updown_match = -1;
}
/*
* Clear command line.
*/
public void
clear_cmd(VOID_PARAM)
{
cmd_col = prompt_col = 0;
cmd_mbc_buf_len = 0;
updown_match = -1;
}
/*
* Display a string, usually as a prompt for input into the command buffer.
*/
public void
cmd_putstr(s)
constant char *s;
{
LWCHAR prev_ch = 0;
LWCHAR ch;
constant char *endline = s + strlen(s);
while (*s != '\0')
{
char *ns = (char *) s;
int width;
ch = step_char(&ns, +1, endline);
while (s < ns)
putchr(*s++);
if (!utf_mode)
width = 1;
else if (is_composing_char(ch) || is_combining_char(prev_ch, ch))
width = 0;
else
width = is_wide_char(ch) ? 2 : 1;
cmd_col += width;
prompt_col += width;
prev_ch = ch;
}
}
/*
* How many characters are in the command buffer?
*/
public int
len_cmdbuf(VOID_PARAM)
{
char *s = cmdbuf;
char *endline = s + strlen(s);
int len = 0;
while (*s != '\0')
{
step_char(&s, +1, endline);
len++;
}
return (len);
}
/*
* Common part of cmd_step_right() and cmd_step_left().
* {{ Returning pwidth and bswidth separately is a historical artifact
* since they're always the same. Maybe clean this up someday. }}
*/
static char *
cmd_step_common(p, ch, len, pwidth, bswidth)
char *p;
LWCHAR ch;
int len;
int *pwidth;
int *bswidth;
{
char *pr;
int width;
if (len == 1)
{
pr = prchar((int) ch);
width = (int) strlen(pr);
} else
{
pr = prutfchar(ch);
if (is_composing_char(ch))
width = 0;
else if (is_ubin_char(ch))
width = (int) strlen(pr);
else
{
LWCHAR prev_ch = step_char(&p, -1, cmdbuf);
if (is_combining_char(prev_ch, ch))
width = 0;
else
width = is_wide_char(ch) ? 2 : 1;
}
}
if (pwidth != NULL)
*pwidth = width;
if (bswidth != NULL)
*bswidth = width;
return (pr);
}
/*
* Step a pointer one character right in the command buffer.
*/
static char *
cmd_step_right(pp, pwidth, bswidth)
char **pp;
int *pwidth;
int *bswidth;
{
char *p = *pp;
LWCHAR ch = step_char(pp, +1, p + strlen(p));
return cmd_step_common(p, ch, *pp - p, pwidth, bswidth);
}
/*
* Step a pointer one character left in the command buffer.
*/
static char *
cmd_step_left(pp, pwidth, bswidth)
char **pp;
int *pwidth;
int *bswidth;
{
char *p = *pp;
LWCHAR ch = step_char(pp, -1, cmdbuf);
return cmd_step_common(*pp, ch, p - *pp, pwidth, bswidth);
}
/*
* Put the cursor at "home" (just after the prompt),
* and set cp to the corresponding char in cmdbuf.
*/
static void
cmd_home(VOID_PARAM)
{
while (cmd_col > prompt_col)
{
int width, bswidth;
cmd_step_left(&cp, &width, &bswidth);
while (bswidth-- > 0)
putbs();
cmd_col -= width;
}
cp = &cmdbuf[cmd_offset];
}
/*
* Repaint the line from cp onwards.
* Then position the cursor just after the char old_cp (a pointer into cmdbuf).
*/
public void
cmd_repaint(old_cp)
constant char *old_cp;
{
/*
* Repaint the line from the current position.
*/
if (old_cp == NULL)
{
old_cp = cp;
cmd_home();
}
clear_eol();
while (*cp != '\0')
{
char *np = cp;
int width;
char *pr = cmd_step_right(&np, &width, NULL);
if (cmd_col + width >= sc_width)
break;
cp = np;
putstr(pr);
cmd_col += width;
}
while (*cp != '\0')
{
char *np = cp;
int width;
char *pr = cmd_step_right(&np, &width, NULL);
if (width > 0)
break;
cp = np;
putstr(pr);
}
/*
* Back up the cursor to the correct position.
*/
while (cp > old_cp)
cmd_left();
}
/*
* Shift the cmdbuf display left a half-screen.
*/
static void
cmd_lshift(VOID_PARAM)
{
char *s;
char *save_cp;
int cols;
/*
* Start at the first displayed char, count how far to the
* right we'd have to move to reach the center of the screen.
*/
s = cmdbuf + cmd_offset;
cols = 0;
while (cols < (sc_width - prompt_col) / 2 && *s != '\0')
{
int width;
cmd_step_right(&s, &width, NULL);
cols += width;
}
while (*s != '\0')
{
int width;
char *ns = s;
cmd_step_right(&ns, &width, NULL);
if (width > 0)
break;
s = ns;
}
cmd_offset = (int) (s - cmdbuf);
save_cp = cp;
cmd_home();
cmd_repaint(save_cp);
}
/*
* Shift the cmdbuf display right a half-screen.
*/
static void
cmd_rshift(VOID_PARAM)
{
char *s;
char *save_cp;
int cols;
/*
* Start at the first displayed char, count how far to the
* left we'd have to move to traverse a half-screen width
* of displayed characters.
*/
s = cmdbuf + cmd_offset;
cols = 0;
while (cols < (sc_width - prompt_col) / 2 && s > cmdbuf)
{
int width;
cmd_step_left(&s, &width, NULL);
cols += width;
}
cmd_offset = (int) (s - cmdbuf);
save_cp = cp;
cmd_home();
cmd_repaint(save_cp);
}
/*
* Move cursor right one character.
*/
static int
cmd_right(VOID_PARAM)
{
char *pr;
char *ncp;
int width;
if (*cp == '\0')
{
/* Already at the end of the line. */
return (CC_OK);
}
ncp = cp;
pr = cmd_step_right(&ncp, &width, NULL);
if (cmd_col + width >= sc_width)
cmd_lshift();
else if (cmd_col + width == sc_width - 1 && cp[1] != '\0')
cmd_lshift();
cp = ncp;
cmd_col += width;
putstr(pr);
while (*cp != '\0')
{
pr = cmd_step_right(&ncp, &width, NULL);
if (width > 0)
break;
putstr(pr);
cp = ncp;
}
return (CC_OK);
}
/*
* Move cursor left one character.
*/
static int
cmd_left(VOID_PARAM)
{
char *ncp;
int width = 0;
int bswidth = 0;
if (cp <= cmdbuf)
{
/* Already at the beginning of the line */
return (CC_OK);
}
ncp = cp;
while (ncp > cmdbuf)
{
cmd_step_left(&ncp, &width, &bswidth);
if (width > 0)
break;
}
if (cmd_col < prompt_col + width)
cmd_rshift();
cp = ncp;
cmd_col -= width;
while (bswidth-- > 0)
putbs();
return (CC_OK);
}
/*
* Insert a char into the command buffer, at the current position.
*/
static int
cmd_ichar(cs, clen)
char *cs;
int clen;
{
char *s;
if (strlen(cmdbuf) + clen >= sizeof(cmdbuf)-1)
{
/* No room in the command buffer for another char. */
bell();
return (CC_ERROR);
}
/*
* Make room for the new character (shift the tail of the buffer right).
*/
for (s = &cmdbuf[strlen(cmdbuf)]; s >= cp; s--)
s[clen] = s[0];
/*
* Insert the character into the buffer.
*/
for (s = cp; s < cp + clen; s++)
*s = *cs++;
/*
* Reprint the tail of the line from the inserted char.
*/
updown_match = -1;
cmd_repaint(cp);
cmd_right();
return (CC_OK);
}
/*
* Backspace in the command buffer.
* Delete the char to the left of the cursor.
*/
static int
cmd_erase(VOID_PARAM)
{
char *s;
int clen;
if (cp == cmdbuf)
{
/*
* Backspace past beginning of the buffer:
* this usually means abort the command.
*/
return (CC_QUIT);
}
/*
* Move cursor left (to the char being erased).
*/
s = cp;
cmd_left();
clen = (int) (s - cp);
/*
* Remove the char from the buffer (shift the buffer left).
*/
for (s = cp; ; s++)
{
s[0] = s[clen];
if (s[0] == '\0')
break;
}
/*
* Repaint the buffer after the erased char.
*/
updown_match = -1;
cmd_repaint(cp);
/*
* We say that erasing the entire command string causes us
* to abort the current command, if CF_QUIT_ON_ERASE is set.
*/
if ((curr_cmdflags & CF_QUIT_ON_ERASE) && cp == cmdbuf && *cp == '\0')
return (CC_QUIT);
return (CC_OK);
}
/*
* Delete the char under the cursor.
*/
static int
cmd_delete(VOID_PARAM)
{
if (*cp == '\0')
{
/* At end of string; there is no char under the cursor. */
return (CC_OK);
}
/*
* Move right, then use cmd_erase.
*/
cmd_right();
cmd_erase();
return (CC_OK);
}
/*
* Delete the "word" to the left of the cursor.
*/
static int
cmd_werase(VOID_PARAM)
{
if (cp > cmdbuf && cp[-1] == ' ')
{
/*
* If the char left of cursor is a space,
* erase all the spaces left of cursor (to the first non-space).
*/
while (cp > cmdbuf && cp[-1] == ' ')
(void) cmd_erase();
} else
{
/*
* If the char left of cursor is not a space,
* erase all the nonspaces left of cursor (the whole "word").
*/
while (cp > cmdbuf && cp[-1] != ' ')
(void) cmd_erase();
}
return (CC_OK);
}
/*
* Delete the "word" under the cursor.
*/
static int
cmd_wdelete(VOID_PARAM)
{
if (*cp == ' ')
{
/*
* If the char under the cursor is a space,
* delete it and all the spaces right of cursor.
*/
while (*cp == ' ')
(void) cmd_delete();
} else
{
/*
* If the char under the cursor is not a space,
* delete it and all nonspaces right of cursor (the whole word).
*/
while (*cp != ' ' && *cp != '\0')
(void) cmd_delete();
}
return (CC_OK);
}
/*
* Delete all chars in the command buffer.
*/
static int
cmd_kill(VOID_PARAM)
{
if (cmdbuf[0] == '\0')
{
/* Buffer is already empty; abort the current command. */
return (CC_QUIT);
}
cmd_offset = 0;
cmd_home();
*cp = '\0';
updown_match = -1;
cmd_repaint(cp);
/*
* We say that erasing the entire command string causes us
* to abort the current command, if CF_QUIT_ON_ERASE is set.
*/
if (curr_cmdflags & CF_QUIT_ON_ERASE)
return (CC_QUIT);
return (CC_OK);
}
/*
* Select an mlist structure to be the current command history.
*/
public void
set_mlist(mlist, cmdflags)
void *mlist;
int cmdflags;
{
#if CMD_HISTORY
curr_mlist = (struct mlist *) mlist;
curr_cmdflags = cmdflags;
/* Make sure the next up-arrow moves to the last string in the mlist. */
if (curr_mlist != NULL)
curr_mlist->curr_mp = curr_mlist;
#endif
}
#if CMD_HISTORY
/*
* Move up or down in the currently selected command history list.
* Only consider entries whose first updown_match chars are equal to
* cmdbuf's corresponding chars.
*/
static int
cmd_updown(action)
int action;
{
constant char *s;
struct mlist *ml;
if (curr_mlist == NULL)
{
/*
* The current command has no history list.
*/
bell();
return (CC_OK);
}
if (updown_match < 0)
{
updown_match = (int) (cp - cmdbuf);
}
/*
* Find the next history entry which matches.
*/
for (ml = curr_mlist->curr_mp;;)
{
ml = (action == EC_UP) ? ml->prev : ml->next;
if (ml == curr_mlist)
{
/*
* We reached the end (or beginning) of the list.
*/
break;
}
if (strncmp(cmdbuf, ml->string, updown_match) == 0)
{
/*
* This entry matches; stop here.
* Copy the entry into cmdbuf and echo it on the screen.
*/
curr_mlist->curr_mp = ml;
s = ml->string;
if (s == NULL)
s = "";
cmd_offset = 0;
cmd_home();
clear_eol();
strcpy(cmdbuf, s);
for (cp = cmdbuf; *cp != '\0'; )
cmd_right();
return (CC_OK);
}
}
/*
* We didn't find a history entry that matches.
*/
bell();
return (CC_OK);
}
#endif
/*
*
*/
static void
ml_link(mlist, ml)
struct mlist *mlist;
struct mlist *ml;
{
ml->next = mlist;
ml->prev = mlist->prev;
mlist->prev->next = ml;
mlist->prev = ml;
}
/*
*
*/
static void
ml_unlink(ml)
struct mlist *ml;
{
ml->prev->next = ml->next;
ml->next->prev = ml->prev;
}
/*
* Add a string to an mlist.
*/
public void
cmd_addhist(mlist, cmd, modified)
struct mlist *mlist;
constant char *cmd;
int modified;
{
#if CMD_HISTORY
struct mlist *ml;
/*
* Don't save a trivial command.
*/
if (strlen(cmd) == 0)
return;
if (no_hist_dups)
{
struct mlist *next = NULL;
for (ml = mlist->next; ml->string != NULL; ml = next)
{
next = ml->next;
if (strcmp(ml->string, cmd) == 0)
{
ml_unlink(ml);
free(ml->string);
free(ml);
}
}
}
/*
* Save the command unless it's a duplicate of the
* last command in the history.
*/
ml = mlist->prev;
if (ml == mlist || strcmp(ml->string, cmd) != 0)
{
/*
* Did not find command in history.
* Save the command and put it at the end of the history list.
*/
ml = (struct mlist *) ecalloc(1, sizeof(struct mlist));
ml->string = save(cmd);
ml->modified = modified;
ml_link(mlist, ml);
}
/*
* Point to the cmd just after the just-accepted command.
* Thus, an UPARROW will always retrieve the previous command.
*/
mlist->curr_mp = ml->next;
#endif
}
/*
* Accept the command in the command buffer.
* Add it to the currently selected history list.
*/
public void
cmd_accept(VOID_PARAM)
{
#if CMD_HISTORY
/*
* Nothing to do if there is no currently selected history list.
*/
if (curr_mlist == NULL || curr_mlist == ml_examine)
return;
cmd_addhist(curr_mlist, cmdbuf, 1);
curr_mlist->modified = 1;
#endif
}
/*
* Try to perform a line-edit function on the command buffer,
* using a specified char as a line-editing command.
* Returns:
* CC_PASS The char does not invoke a line edit function.
* CC_OK Line edit function done.
* CC_QUIT The char requests the current command to be aborted.
*/
static int
cmd_edit(c)
int c;
{
int action;
int flags;
#if TAB_COMPLETE_FILENAME
#define not_in_completion() in_completion = 0
#else
#define not_in_completion(VOID_PARAM)
#endif
/*
* See if the char is indeed a line-editing command.
*/
flags = 0;
#if CMD_HISTORY
if (curr_mlist == NULL)
/*
* No current history; don't accept history manipulation cmds.
*/
flags |= ECF_NOHISTORY;
#endif
#if TAB_COMPLETE_FILENAME
- if (curr_mlist == ml_search)
+ if (curr_mlist == ml_search || curr_mlist == NULL)
/*
- * In a search command; don't accept file-completion cmds.
+ * Don't accept file-completion cmds in contexts
+ * such as search pattern, digits, long option name, etc.
*/
flags |= ECF_NOCOMPLETE;
#endif
action = editchar(c, flags);
switch (action)
{
case A_NOACTION:
return (CC_OK);
case EC_RIGHT:
not_in_completion();
return (cmd_right());
case EC_LEFT:
not_in_completion();
return (cmd_left());
case EC_W_RIGHT:
not_in_completion();
while (*cp != '\0' && *cp != ' ')
cmd_right();
while (*cp == ' ')
cmd_right();
return (CC_OK);
case EC_W_LEFT:
not_in_completion();
while (cp > cmdbuf && cp[-1] == ' ')
cmd_left();
while (cp > cmdbuf && cp[-1] != ' ')
cmd_left();
return (CC_OK);
case EC_HOME:
not_in_completion();
cmd_offset = 0;
cmd_home();
cmd_repaint(cp);
return (CC_OK);
case EC_END:
not_in_completion();
while (*cp != '\0')
cmd_right();
return (CC_OK);
case EC_INSERT:
not_in_completion();
return (CC_OK);
case EC_BACKSPACE:
not_in_completion();
return (cmd_erase());
case EC_LINEKILL:
not_in_completion();
return (cmd_kill());
case EC_ABORT:
not_in_completion();
(void) cmd_kill();
return (CC_QUIT);
case EC_W_BACKSPACE:
not_in_completion();
return (cmd_werase());
case EC_DELETE:
not_in_completion();
return (cmd_delete());
case EC_W_DELETE:
not_in_completion();
return (cmd_wdelete());
case EC_LITERAL:
literal = 1;
return (CC_OK);
#if CMD_HISTORY
case EC_UP:
case EC_DOWN:
not_in_completion();
return (cmd_updown(action));
#endif
#if TAB_COMPLETE_FILENAME
case EC_F_COMPLETE:
case EC_B_COMPLETE:
case EC_EXPAND:
return (cmd_complete(action));
#endif
default:
not_in_completion();
return (CC_PASS);
}
}
#if TAB_COMPLETE_FILENAME
/*
* Insert a string into the command buffer, at the current position.
*/
static int
cmd_istr(str)
char *str;
{
char *s;
int action;
char *endline = str + strlen(str);
for (s = str; *s != '\0'; )
{
char *os = s;
step_char(&s, +1, endline);
action = cmd_ichar(os, s - os);
if (action != CC_OK)
return (action);
}
return (CC_OK);
}
/*
* Find the beginning and end of the "current" word.
* This is the word which the cursor (cp) is inside or at the end of.
* Return pointer to the beginning of the word and put the
* cursor at the end of the word.
*/
static char *
delimit_word(VOID_PARAM)
{
char *word;
#if SPACES_IN_FILENAMES
char *p;
int delim_quoted = 0;
int meta_quoted = 0;
constant char *esc = get_meta_escape();
int esclen = (int) strlen(esc);
#endif
/*
* Move cursor to end of word.
*/
if (*cp != ' ' && *cp != '\0')
{
/*
* Cursor is on a nonspace.
* Move cursor right to the next space.
*/
while (*cp != ' ' && *cp != '\0')
cmd_right();
} else if (cp > cmdbuf && cp[-1] != ' ')
{
/*
* Cursor is on a space, and char to the left is a nonspace.
* We're already at the end of the word.
*/
;
#if 0
} else
{
/*
* Cursor is on a space and char to the left is a space.
* Huh? There's no word here.
*/
return (NULL);
#endif
}
/*
* Find the beginning of the word which the cursor is in.
*/
if (cp == cmdbuf)
return (NULL);
#if SPACES_IN_FILENAMES
/*
* If we have an unbalanced quote (that is, an open quote
* without a corresponding close quote), we return everything
* from the open quote, including spaces.
*/
for (word = cmdbuf; word < cp; word++)
if (*word != ' ')
break;
if (word >= cp)
return (cp);
for (p = cmdbuf; p < cp; p++)
{
if (meta_quoted)
{
meta_quoted = 0;
} else if (esclen > 0 && p + esclen < cp &&
strncmp(p, esc, esclen) == 0)
{
meta_quoted = 1;
p += esclen - 1;
} else if (delim_quoted)
{
if (*p == closequote)
delim_quoted = 0;
} else /* (!delim_quoted) */
{
if (*p == openquote)
delim_quoted = 1;
else if (*p == ' ')
word = p+1;
}
}
#endif
return (word);
}
/*
* Set things up to enter completion mode.
* Expand the word under the cursor into a list of filenames
* which start with that word, and set tk_text to that list.
*/
static void
init_compl(VOID_PARAM)
{
char *word;
char c;
/*
* Get rid of any previous tk_text.
*/
if (tk_text != NULL)
{
free(tk_text);
tk_text = NULL;
}
/*
* Find the original (uncompleted) word in the command buffer.
*/
word = delimit_word();
if (word == NULL)
return;
/*
* Set the insertion point to the point in the command buffer
* where the original (uncompleted) word now sits.
*/
tk_ipoint = word;
/*
* Save the original (uncompleted) word
*/
if (tk_original != NULL)
free(tk_original);
tk_original = (char *) ecalloc(cp-word+1, sizeof(char));
strncpy(tk_original, word, cp-word);
/*
* Get the expanded filename.
* This may result in a single filename, or
* a blank-separated list of filenames.
*/
c = *cp;
*cp = '\0';
if (*word != openquote)
{
tk_text = fcomplete(word);
} else
{
#if MSDOS_COMPILER
char *qword = NULL;
#else
char *qword = shell_quote(word+1);
#endif
if (qword == NULL)
tk_text = fcomplete(word+1);
else
{
tk_text = fcomplete(qword);
free(qword);
}
}
*cp = c;
}
/*
* Return the next word in the current completion list.
*/
static char *
next_compl(action, prev)
int action;
char *prev;
{
switch (action)
{
case EC_F_COMPLETE:
return (forw_textlist(&tk_tlist, prev));
case EC_B_COMPLETE:
return (back_textlist(&tk_tlist, prev));
}
/* Cannot happen */
return ("?");
}
/*
* Complete the filename before (or under) the cursor.
* cmd_complete may be called multiple times. The global in_completion
* remembers whether this call is the first time (create the list),
* or a subsequent time (step thru the list).
*/
static int
cmd_complete(action)
int action;
{
char *s;
if (!in_completion || action == EC_EXPAND)
{
/*
* Expand the word under the cursor and
* use the first word in the expansion
* (or the entire expansion if we're doing EC_EXPAND).
*/
init_compl();
if (tk_text == NULL)
{
bell();
return (CC_OK);
}
if (action == EC_EXPAND)
{
/*
* Use the whole list.
*/
tk_trial = tk_text;
} else
{
/*
* Use the first filename in the list.
*/
in_completion = 1;
init_textlist(&tk_tlist, tk_text);
tk_trial = next_compl(action, (char*)NULL);
}
} else
{
/*
* We already have a completion list.
* Use the next/previous filename from the list.
*/
tk_trial = next_compl(action, tk_trial);
}
/*
* Remove the original word, or the previous trial completion.
*/
while (cp > tk_ipoint)
(void) cmd_erase();
if (tk_trial == NULL)
{
/*
* There are no more trial completions.
* Insert the original (uncompleted) filename.
*/
in_completion = 0;
if (cmd_istr(tk_original) != CC_OK)
goto fail;
} else
{
/*
* Insert trial completion.
*/
if (cmd_istr(tk_trial) != CC_OK)
goto fail;
/*
* If it is a directory, append a slash.
*/
if (is_dir(tk_trial))
{
if (cp > cmdbuf && cp[-1] == closequote)
(void) cmd_erase();
s = lgetenv("LESSSEPARATOR");
if (s == NULL)
s = PATHNAME_SEP;
if (cmd_istr(s) != CC_OK)
goto fail;
}
}
return (CC_OK);
fail:
in_completion = 0;
bell();
return (CC_OK);
}
#endif /* TAB_COMPLETE_FILENAME */
/*
* Process a single character of a multi-character command, such as
* a number, or the pattern of a search command.
* Returns:
* CC_OK The char was accepted.
* CC_QUIT The char requests the command to be aborted.
* CC_ERROR The char could not be accepted due to an error.
*/
public int
cmd_char(c)
int c;
{
int action;
int len;
if (!utf_mode)
{
cmd_mbc_buf[0] = c;
len = 1;
} else
{
/* Perform strict validation in all possible cases. */
if (cmd_mbc_buf_len == 0)
{
retry:
cmd_mbc_buf_index = 1;
*cmd_mbc_buf = c;
if (IS_ASCII_OCTET(c))
cmd_mbc_buf_len = 1;
#if MSDOS_COMPILER || OS2
else if (c == (unsigned char) '\340' && IS_ASCII_OCTET(peekcc()))
{
/* Assume a special key. */
cmd_mbc_buf_len = 1;
}
#endif
else if (IS_UTF8_LEAD(c))
{
cmd_mbc_buf_len = utf_len(c);
return (CC_OK);
} else
{
/* UTF8_INVALID or stray UTF8_TRAIL */
bell();
return (CC_ERROR);
}
} else if (IS_UTF8_TRAIL(c))
{
cmd_mbc_buf[cmd_mbc_buf_index++] = c;
if (cmd_mbc_buf_index < cmd_mbc_buf_len)
return (CC_OK);
if (!is_utf8_well_formed(cmd_mbc_buf, cmd_mbc_buf_index))
{
/* complete, but not well formed (non-shortest form), sequence */
cmd_mbc_buf_len = 0;
bell();
return (CC_ERROR);
}
} else
{
/* Flush incomplete (truncated) sequence. */
cmd_mbc_buf_len = 0;
bell();
/* Handle new char. */
goto retry;
}
len = cmd_mbc_buf_len;
cmd_mbc_buf_len = 0;
}
if (literal)
{
/*
* Insert the char, even if it is a line-editing char.
*/
literal = 0;
return (cmd_ichar(cmd_mbc_buf, len));
}
/*
* See if it is a line-editing character.
*/
if (in_mca() && len == 1)
{
action = cmd_edit(c);
switch (action)
{
case CC_OK:
case CC_QUIT:
return (action);
case CC_PASS:
break;
}
}
/*
* Insert the char into the command buffer.
*/
return (cmd_ichar(cmd_mbc_buf, len));
}
/*
* Return the number currently in the command buffer.
*/
public LINENUM
cmd_int(frac)
long *frac;
{
char *p;
LINENUM n = 0;
int err;
for (p = cmdbuf; *p >= '0' && *p <= '9'; p++)
- n = (n * 10) + (*p - '0');
+ {
+ LINENUM nn = (n * 10) + (*p - '0');
+ if (nn < n)
+ {
+ error("Integer is too big", NULL_PARG);
+ return (0);
+ }
+ n = nn;
+ }
*frac = 0;
if (*p++ == '.')
{
*frac = getfraction(&p, NULL, &err);
/* {{ do something if err is set? }} */
}
return (n);
}
/*
* Return a pointer to the command buffer.
*/
public char *
get_cmdbuf(VOID_PARAM)
{
+ if (cmd_mbc_buf_index < cmd_mbc_buf_len)
+ /* Don't return buffer containing an incomplete multibyte char. */
+ return (NULL);
return (cmdbuf);
}
#if CMD_HISTORY
/*
* Return the last (most recent) string in the current command history.
*/
public char *
cmd_lastpattern(VOID_PARAM)
{
if (curr_mlist == NULL)
return (NULL);
return (curr_mlist->curr_mp->prev->string);
}
#endif
#if CMD_HISTORY
/*
*/
static int
mlist_size(ml)
struct mlist *ml;
{
int size = 0;
for (ml = ml->next; ml->string != NULL; ml = ml->next)
++size;
return size;
}
/*
* Get the name of the history file.
*/
+ static char *
+histfile_find(must_exist)
+ int must_exist;
+{
+ char *home = lgetenv("HOME");
+ char *name = NULL;
+
+ /* Try in $XDG_STATE_HOME, then in $HOME/.local/state, then in $XDG_DATA_HOME, then in $HOME. */
+#if OS2
+ if (isnullenv(home))
+ home = lgetenv("INIT");
+#endif
+ name = dirfile(lgetenv("XDG_STATE_HOME"), &LESSHISTFILE[1], must_exist);
+ if (name == NULL)
+ {
+ char *dir = dirfile(home, ".local/state", 1);
+ if (dir != NULL)
+ {
+ name = dirfile(dir, &LESSHISTFILE[1], must_exist);
+ free(dir);
+ }
+ }
+ if (name == NULL)
+ name = dirfile(lgetenv("XDG_DATA_HOME"), &LESSHISTFILE[1], must_exist);
+ if (name == NULL)
+ name = dirfile(home, LESSHISTFILE, must_exist);
+ return (name);
+}
+
static char *
histfile_name(must_exist)
int must_exist;
{
- char *home;
- char *xdg;
char *name;
-
+
/* See if filename is explicitly specified by $LESSHISTFILE. */
name = lgetenv("LESSHISTFILE");
if (!isnullenv(name))
{
if (strcmp(name, "-") == 0 || strcmp(name, "/dev/null") == 0)
/* $LESSHISTFILE == "-" means don't use a history file. */
return (NULL);
return (save(name));
}
/* See if history file is disabled in the build. */
if (strcmp(LESSHISTFILE, "") == 0 || strcmp(LESSHISTFILE, "-") == 0)
return (NULL);
- /* Try in $XDG_DATA_HOME first, then in $HOME. */
- xdg = lgetenv("XDG_DATA_HOME");
- home = lgetenv("HOME");
-#if OS2
- if (isnullenv(home))
- home = lgetenv("INIT");
-#endif
name = NULL;
if (!must_exist)
{
/* If we're writing the file and the file already exists, use it. */
- name = dirfile(xdg, &LESSHISTFILE[1], 1);
- if (name == NULL)
- name = dirfile(home, LESSHISTFILE, 1);
+ name = histfile_find(1);
}
if (name == NULL)
- name = dirfile(xdg, &LESSHISTFILE[1], must_exist);
- if (name == NULL)
- name = dirfile(home, LESSHISTFILE, must_exist);
+ name = histfile_find(must_exist);
return (name);
}
/*
* Read a .lesshst file and call a callback for each line in the file.
*/
static void
read_cmdhist2(action, uparam, skip_search, skip_shell)
void (*action)(void*,struct mlist*,char*);
void *uparam;
int skip_search;
int skip_shell;
{
struct mlist *ml = NULL;
char line[CMDBUF_SIZE];
char *filename;
FILE *f;
char *p;
int *skip = NULL;
filename = histfile_name(1);
if (filename == NULL)
return;
f = fopen(filename, "r");
free(filename);
if (f == NULL)
return;
if (fgets(line, sizeof(line), f) == NULL ||
strncmp(line, HISTFILE_FIRST_LINE, strlen(HISTFILE_FIRST_LINE)) != 0)
{
fclose(f);
return;
}
while (fgets(line, sizeof(line), f) != NULL)
{
for (p = line; *p != '\0'; p++)
{
if (*p == '\n' || *p == '\r')
{
*p = '\0';
break;
}
}
if (strcmp(line, HISTFILE_SEARCH_SECTION) == 0)
{
ml = &mlist_search;
skip = &skip_search;
} else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0)
{
#if SHELL_ESCAPE || PIPEC
ml = &mlist_shell;
skip = &skip_shell;
#else
ml = NULL;
skip = NULL;
#endif
} else if (strcmp(line, HISTFILE_MARK_SECTION) == 0)
{
ml = NULL;
} else if (*line == '"')
{
if (ml != NULL)
{
if (skip != NULL && *skip > 0)
--(*skip);
else
(*action)(uparam, ml, line+1);
}
} else if (*line == 'm')
{
(*action)(uparam, NULL, line);
}
}
fclose(f);
}
static void
read_cmdhist(action, uparam, skip_search, skip_shell)
void (*action)(void*,struct mlist*,char*);
void *uparam;
int skip_search;
int skip_shell;
{
+ if (secure)
+ return;
read_cmdhist2(action, uparam, skip_search, skip_shell);
(*action)(uparam, NULL, NULL); /* signal end of file */
}
static void
-addhist_init(void *uparam, struct mlist *ml, char *string)
+addhist_init(uparam, ml, string)
+ void *uparam;
+ struct mlist *ml;
+ char constant *string;
{
if (ml != NULL)
cmd_addhist(ml, string, 0);
else if (string != NULL)
- restore_mark(string);
+ restore_mark((char*)string); /* stupid const cast */
}
#endif /* CMD_HISTORY */
/*
* Initialize history from a .lesshist file.
*/
public void
init_cmdhist(VOID_PARAM)
{
#if CMD_HISTORY
read_cmdhist(&addhist_init, NULL, 0, 0);
#endif /* CMD_HISTORY */
}
/*
* Write the header for a section of the history file.
*/
#if CMD_HISTORY
static void
write_mlist_header(ml, f)
struct mlist *ml;
FILE *f;
{
if (ml == &mlist_search)
fprintf(f, "%s\n", HISTFILE_SEARCH_SECTION);
#if SHELL_ESCAPE || PIPEC
else if (ml == &mlist_shell)
fprintf(f, "%s\n", HISTFILE_SHELL_SECTION);
#endif
}
/*
* Write all modified entries in an mlist to the history file.
*/
static void
write_mlist(ml, f)
struct mlist *ml;
FILE *f;
{
for (ml = ml->next; ml->string != NULL; ml = ml->next)
{
if (!ml->modified)
continue;
fprintf(f, "\"%s\n", ml->string);
ml->modified = 0;
}
ml->modified = 0; /* entire mlist is now unmodified */
}
/*
* Make a temp name in the same directory as filename.
*/
static char *
make_tempname(filename)
char *filename;
{
char lastch;
char *tempname = ecalloc(1, strlen(filename)+1);
strcpy(tempname, filename);
lastch = tempname[strlen(tempname)-1];
tempname[strlen(tempname)-1] = (lastch == 'Q') ? 'Z' : 'Q';
return tempname;
}
struct save_ctx
{
struct mlist *mlist;
FILE *fout;
};
/*
* Copy entries from the saved history file to a new file.
* At the end of each mlist, append any new entries
* created during this session.
*/
static void
-copy_hist(void *uparam, struct mlist *ml, char *string)
+copy_hist(uparam, ml, string)
+ void *uparam;
+ struct mlist *ml;
+ char constant *string;
{
struct save_ctx *ctx = (struct save_ctx *) uparam;
if (ml != NULL && ml != ctx->mlist) {
/* We're changing mlists. */
if (ctx->mlist)
/* Append any new entries to the end of the current mlist. */
write_mlist(ctx->mlist, ctx->fout);
/* Write the header for the new mlist. */
ctx->mlist = ml;
write_mlist_header(ctx->mlist, ctx->fout);
}
if (string == NULL) /* End of file */
{
/* Write any sections that were not in the original file. */
if (mlist_search.modified)
{
write_mlist_header(&mlist_search, ctx->fout);
write_mlist(&mlist_search, ctx->fout);
}
#if SHELL_ESCAPE || PIPEC
if (mlist_shell.modified)
{
write_mlist_header(&mlist_shell, ctx->fout);
write_mlist(&mlist_shell, ctx->fout);
}
#endif
} else if (ml != NULL)
{
/* Copy mlist entry. */
fprintf(ctx->fout, "\"%s\n", string);
}
/* Skip marks */
}
#endif /* CMD_HISTORY */
/*
* Make a file readable only by its owner.
*/
static void
make_file_private(f)
FILE *f;
{
#if HAVE_FCHMOD
int do_chmod = 1;
#if HAVE_STAT
struct stat statbuf;
int r = fstat(fileno(f), &statbuf);
if (r < 0 || !S_ISREG(statbuf.st_mode))
/* Don't chmod if not a regular file. */
do_chmod = 0;
#endif
if (do_chmod)
fchmod(fileno(f), 0600);
#endif
}
/*
* Does the history file need to be updated?
*/
+#if CMD_HISTORY
static int
histfile_modified(VOID_PARAM)
{
if (mlist_search.modified)
return 1;
#if SHELL_ESCAPE || PIPEC
if (mlist_shell.modified)
return 1;
#endif
-#if CMD_HISTORY
if (marks_modified)
return 1;
-#endif
return 0;
}
+#endif
/*
* Update the .lesshst file.
*/
public void
save_cmdhist(VOID_PARAM)
{
#if CMD_HISTORY
char *histname;
char *tempname;
int skip_search;
int skip_shell;
struct save_ctx ctx;
char *s;
FILE *fout = NULL;
int histsize = 0;
- if (!histfile_modified())
+ if (secure || !histfile_modified())
return;
histname = histfile_name(0);
if (histname == NULL)
return;
tempname = make_tempname(histname);
fout = fopen(tempname, "w");
if (fout != NULL)
{
make_file_private(fout);
s = lgetenv("LESSHISTSIZE");
if (s != NULL)
histsize = atoi(s);
if (histsize <= 0)
histsize = 100;
skip_search = mlist_size(&mlist_search) - histsize;
#if SHELL_ESCAPE || PIPEC
skip_shell = mlist_size(&mlist_shell) - histsize;
#endif
fprintf(fout, "%s\n", HISTFILE_FIRST_LINE);
ctx.fout = fout;
ctx.mlist = NULL;
read_cmdhist(©_hist, &ctx, skip_search, skip_shell);
save_marks(fout, HISTFILE_MARK_SECTION);
fclose(fout);
#if MSDOS_COMPILER==WIN32C
/*
* Windows rename doesn't remove an existing file,
* making it useless for atomic operations. Sigh.
*/
remove(histname);
#endif
rename(tempname, histname);
}
free(tempname);
free(histname);
#endif /* CMD_HISTORY */
}
diff --git a/command.c b/command.c
index 88a2f8b34a7d..524b93892991 100644
--- a/command.c
+++ b/command.c
@@ -1,2055 +1,2093 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
/*
* User-level command processor.
*/
#include "less.h"
#if MSDOS_COMPILER==WIN32C
#include
#endif
#include "position.h"
#include "option.h"
#include "cmd.h"
extern int erase_char, erase2_char, kill_char;
extern int sigs;
extern int quit_if_one_screen;
extern int squished;
extern int sc_width;
extern int sc_height;
extern char *kent;
extern int swindow;
extern int jump_sline;
extern int quitting;
extern int wscroll;
extern int top_scroll;
extern int ignore_eoi;
extern int secure;
extern int hshift;
extern int bs_mode;
extern int show_attn;
extern int status_col;
extern POSITION highest_hilite;
extern POSITION start_attnpos;
extern POSITION end_attnpos;
extern char *every_first_cmd;
extern char version[];
extern struct scrpos initial_scrpos;
extern IFILE curr_ifile;
extern void *ml_search;
extern void *ml_examine;
extern int wheel_lines;
+extern int header_lines;
+extern int def_search_type;
+extern int updown_match;
#if SHELL_ESCAPE || PIPEC
extern void *ml_shell;
#endif
#if EDITOR
extern char *editor;
extern char *editproto;
#endif
extern int screen_trashed; /* The screen has been overwritten */
extern int shift_count;
extern int oldbot;
extern int forw_prompt;
extern int incr_search;
#if MSDOS_COMPILER==WIN32C
extern int utf_mode;
#endif
#if SHELL_ESCAPE
static char *shellcmd = NULL; /* For holding last shell command for "!!" */
#endif
static int mca; /* The multicharacter command (action) */
static int search_type; /* The previous type of search */
static LINENUM number; /* The number typed by the user */
static long fraction; /* The fractional part of the number */
static struct loption *curropt;
static int opt_lower;
static int optflag;
static int optgetname;
static POSITION bottompos;
static int save_hshift;
static int save_bs_mode;
#if PIPEC
static char pipec;
#endif
/* Stack of ungotten chars (via ungetcc) */
struct ungot {
struct ungot *ug_next;
LWCHAR ug_char;
};
static struct ungot* ungot = NULL;
static void multi_search LESSPARAMS((char *pattern, int n, int silent));
/*
* Move the cursor to start of prompt line before executing a command.
* This looks nicer if the command takes a long time before
* updating the screen.
*/
static void
cmd_exec(VOID_PARAM)
{
clear_attn();
clear_bot();
flush();
}
/*
* Indicate we are reading a multi-character command.
*/
static void
set_mca(action)
int action;
{
mca = action;
clear_bot();
clear_cmd();
}
/*
* Indicate we are not reading a multi-character command.
*/
static void
clear_mca(VOID_PARAM)
{
if (mca == 0)
return;
mca = 0;
}
/*
* Set up the display to start a new multi-character command.
*/
static void
start_mca(action, prompt, mlist, cmdflags)
int action;
constant char *prompt;
void *mlist;
int cmdflags;
{
set_mca(action);
cmd_putstr(prompt);
set_mlist(mlist, cmdflags);
}
public int
in_mca(VOID_PARAM)
{
return (mca != 0 && mca != A_PREFIX);
}
/*
* Set up the display to start a new search command.
*/
static void
-mca_search(VOID_PARAM)
+mca_search1(VOID_PARAM)
{
#if HILITE_SEARCH
if (search_type & SRCH_FILTER)
set_mca(A_FILTER);
else
#endif
if (search_type & SRCH_FORW)
set_mca(A_F_SEARCH);
else
set_mca(A_B_SEARCH);
if (search_type & SRCH_NO_MATCH)
cmd_putstr("Non-match ");
if (search_type & SRCH_FIRST_FILE)
cmd_putstr("First-file ");
if (search_type & SRCH_PAST_EOF)
cmd_putstr("EOF-ignore ");
if (search_type & SRCH_NO_MOVE)
cmd_putstr("Keep-pos ");
if (search_type & SRCH_NO_REGEX)
cmd_putstr("Regex-off ");
if (search_type & SRCH_WRAP)
cmd_putstr("Wrap ");
#if HILITE_SEARCH
if (search_type & SRCH_FILTER)
cmd_putstr("&/");
else
#endif
if (search_type & SRCH_FORW)
cmd_putstr("/");
else
cmd_putstr("?");
forw_prompt = 0;
+}
+
+ static void
+mca_search(VOID_PARAM)
+{
+ mca_search1();
set_mlist(ml_search, 0);
}
/*
* Set up the display to start a new toggle-option command.
*/
static void
mca_opt_toggle(VOID_PARAM)
{
int no_prompt;
int flag;
char *dash;
no_prompt = (optflag & OPT_NO_PROMPT);
flag = (optflag & ~OPT_NO_PROMPT);
dash = (flag == OPT_NO_TOGGLE) ? "_" : "-";
set_mca(A_OPT_TOGGLE);
cmd_putstr(dash);
if (optgetname)
cmd_putstr(dash);
if (no_prompt)
cmd_putstr("(P)");
switch (flag)
{
case OPT_UNSET:
cmd_putstr("+");
break;
case OPT_SET:
cmd_putstr("!");
break;
}
forw_prompt = 0;
set_mlist(NULL, 0);
}
/*
* Execute a multicharacter command.
*/
static void
exec_mca(VOID_PARAM)
{
char *cbuf;
cmd_exec();
cbuf = get_cmdbuf();
+ if (cbuf == NULL)
+ return;
switch (mca)
{
case A_F_SEARCH:
case A_B_SEARCH:
multi_search(cbuf, (int) number, 0);
break;
#if HILITE_SEARCH
case A_FILTER:
search_type ^= SRCH_NO_MATCH;
set_filter_pattern(cbuf, search_type);
break;
#endif
case A_FIRSTCMD:
/*
* Skip leading spaces or + signs in the string.
*/
while (*cbuf == '+' || *cbuf == ' ')
cbuf++;
if (every_first_cmd != NULL)
free(every_first_cmd);
if (*cbuf == '\0')
every_first_cmd = NULL;
else
every_first_cmd = save(cbuf);
break;
case A_OPT_TOGGLE:
toggle_option(curropt, opt_lower, cbuf, optflag);
curropt = NULL;
break;
case A_F_BRACKET:
match_brac(cbuf[0], cbuf[1], 1, (int) number);
break;
case A_B_BRACKET:
match_brac(cbuf[1], cbuf[0], 0, (int) number);
break;
#if EXAMINE
case A_EXAMINE:
if (secure)
break;
edit_list(cbuf);
#if TAGS
/* If tag structure is loaded then clean it up. */
cleantags();
#endif
break;
#endif
#if SHELL_ESCAPE
case A_SHELL:
/*
* !! just uses whatever is in shellcmd.
* Otherwise, copy cmdbuf to shellcmd,
* expanding any special characters ("%" or "#").
*/
if (*cbuf != '!')
{
if (shellcmd != NULL)
free(shellcmd);
shellcmd = fexpand(cbuf);
}
if (secure)
break;
if (shellcmd == NULL)
lsystem("", "!done");
else
lsystem(shellcmd, "!done");
break;
#endif
#if PIPEC
case A_PIPE:
if (secure)
break;
(void) pipe_mark(pipec, cbuf);
error("|done", NULL_PARG);
break;
#endif
}
}
/*
* Is a character an erase or kill char?
*/
static int
is_erase_char(c)
int c;
{
return (c == erase_char || c == erase2_char || c == kill_char);
}
/*
* Is a character a carriage return or newline?
*/
static int
is_newline_char(c)
int c;
{
return (c == '\n' || c == '\r');
}
/*
* Handle the first char of an option (after the initial dash).
*/
static int
mca_opt_first_char(c)
int c;
{
+ int no_prompt = (optflag & OPT_NO_PROMPT);
int flag = (optflag & ~OPT_NO_PROMPT);
if (flag == OPT_NO_TOGGLE)
{
switch (c)
{
case '_':
/* "__" = long option name. */
optgetname = TRUE;
mca_opt_toggle();
return (MCA_MORE);
}
} else
{
switch (c)
{
case '+':
/* "-+" = UNSET. */
- optflag = (flag == OPT_UNSET) ?
- OPT_TOGGLE : OPT_UNSET;
+ optflag = no_prompt | ((flag == OPT_UNSET) ?
+ OPT_TOGGLE : OPT_UNSET);
mca_opt_toggle();
return (MCA_MORE);
case '!':
/* "-!" = SET */
- optflag = (flag == OPT_SET) ?
- OPT_TOGGLE : OPT_SET;
+ optflag = no_prompt | ((flag == OPT_SET) ?
+ OPT_TOGGLE : OPT_SET);
mca_opt_toggle();
return (MCA_MORE);
case CONTROL('P'):
optflag ^= OPT_NO_PROMPT;
mca_opt_toggle();
return (MCA_MORE);
case '-':
/* "--" = long option name. */
optgetname = TRUE;
mca_opt_toggle();
return (MCA_MORE);
}
}
/* Char was not handled here. */
return (NO_MCA);
}
/*
* Add a char to a long option name.
* See if we've got a match for an option name yet.
* If so, display the complete name and stop
* accepting chars until user hits RETURN.
*/
static int
mca_opt_nonfirst_char(c)
int c;
{
char *p;
char *oname;
int err;
if (curropt != NULL)
{
/*
* Already have a match for the name.
* Don't accept anything but erase/kill.
*/
if (is_erase_char(c))
return (MCA_DONE);
return (MCA_MORE);
}
/*
* Add char to cmd buffer and try to match
* the option name.
*/
if (cmd_char(c) == CC_QUIT)
return (MCA_DONE);
p = get_cmdbuf();
+ if (p == NULL)
+ return (MCA_MORE);
opt_lower = ASCII_IS_LOWER(p[0]);
err = 0;
curropt = findopt_name(&p, &oname, &err);
if (curropt != NULL)
{
/*
* Got a match.
* Remember the option and
* display the full option name.
*/
cmd_reset();
mca_opt_toggle();
for (p = oname; *p != '\0'; p++)
{
c = *p;
if (!opt_lower && ASCII_IS_LOWER(c))
c = ASCII_TO_UPPER(c);
if (cmd_char(c) != CC_OK)
return (MCA_DONE);
}
} else if (err != OPT_AMBIG)
{
bell();
}
return (MCA_MORE);
}
/*
* Handle a char of an option toggle command.
*/
static int
mca_opt_char(c)
int c;
{
PARG parg;
/*
* This may be a short option (single char),
* or one char of a long option name,
* or one char of the option parameter.
*/
if (curropt == NULL && len_cmdbuf() == 0)
{
int ret = mca_opt_first_char(c);
if (ret != NO_MCA)
return (ret);
}
if (optgetname)
{
/* We're getting a long option name. */
- if (!is_newline_char(c))
+ if (!is_newline_char(c) && c != '=')
return (mca_opt_nonfirst_char(c));
if (curropt == NULL)
{
parg.p_string = get_cmdbuf();
+ if (parg.p_string == NULL)
+ return (MCA_MORE);
error("There is no --%s option", &parg);
return (MCA_DONE);
}
optgetname = FALSE;
cmd_reset();
} else
{
if (is_erase_char(c))
return (NO_MCA);
if (curropt != NULL)
/* We're getting the option parameter. */
return (NO_MCA);
curropt = findopt(c);
if (curropt == NULL)
{
parg.p_string = propt(c);
error("There is no %s option", &parg);
return (MCA_DONE);
}
opt_lower = ASCII_IS_LOWER(c);
}
/*
* If the option which was entered does not take a
* parameter, toggle the option immediately,
* so user doesn't have to hit RETURN.
*/
if ((optflag & ~OPT_NO_PROMPT) != OPT_TOGGLE ||
!opt_has_param(curropt))
{
toggle_option(curropt, opt_lower, "", optflag);
return (MCA_DONE);
}
/*
* Display a prompt appropriate for the option parameter.
*/
start_mca(A_OPT_TOGGLE, opt_prompt(curropt), (void*)NULL, 0);
return (MCA_MORE);
}
+/*
+ * Normalize search type.
+ */
+ public int
+norm_search_type(st)
+ int st;
+{
+ /* WRAP and PAST_EOF are mutually exclusive. */
+ if ((st & (SRCH_PAST_EOF|SRCH_WRAP)) == (SRCH_PAST_EOF|SRCH_WRAP))
+ st ^= SRCH_PAST_EOF;
+ return st;
+}
+
/*
* Handle a char of a search command.
*/
static int
mca_search_char(c)
int c;
{
int flag = 0;
/*
* Certain characters as the first char of
* the pattern have special meaning:
* ! Toggle the NO_MATCH flag
* * Toggle the PAST_EOF flag
* @ Toggle the FIRST_FILE flag
*/
if (len_cmdbuf() > 0)
return (NO_MCA);
switch (c)
{
case CONTROL('E'): /* ignore END of file */
case '*':
if (mca != A_FILTER)
flag = SRCH_PAST_EOF;
break;
case CONTROL('F'): /* FIRST file */
case '@':
if (mca != A_FILTER)
flag = SRCH_FIRST_FILE;
break;
case CONTROL('K'): /* KEEP position */
if (mca != A_FILTER)
flag = SRCH_NO_MOVE;
break;
case CONTROL('W'): /* WRAP around */
if (mca != A_FILTER)
flag = SRCH_WRAP;
break;
case CONTROL('R'): /* Don't use REGULAR EXPRESSIONS */
flag = SRCH_NO_REGEX;
break;
case CONTROL('N'): /* NOT match */
case '!':
flag = SRCH_NO_MATCH;
break;
}
if (flag != 0)
{
- /* Toggle flag, but keep PAST_EOF and WRAP mutually exclusive. */
- search_type ^= flag | (search_type & (SRCH_PAST_EOF|SRCH_WRAP));
+ search_type = norm_search_type(search_type ^ flag);
mca_search();
return (MCA_MORE);
}
return (NO_MCA);
}
/*
* Handle a character of a multi-character command.
*/
static int
mca_char(c)
int c;
{
int ret;
switch (mca)
{
case 0:
/*
* We're not in a multicharacter command.
*/
return (NO_MCA);
case A_PREFIX:
/*
* In the prefix of a command.
* This not considered a multichar command
* (even tho it uses cmdbuf, etc.).
* It is handled in the commands() switch.
*/
return (NO_MCA);
case A_DIGIT:
/*
* Entering digits of a number.
* Terminated by a non-digit.
*/
if ((c >= '0' && c <= '9') || c == '.')
break;
switch (editchar(c, ECF_PEEK|ECF_NOHISTORY|ECF_NOCOMPLETE|ECF_NORIGHTLEFT))
{
case A_NOACTION:
/*
* Ignore this char and get another one.
*/
return (MCA_MORE);
case A_INVALID:
/*
* Not part of the number.
* End the number and treat this char
* as a normal command character.
*/
number = cmd_int(&fraction);
clear_mca();
cmd_accept();
return (NO_MCA);
}
break;
case A_OPT_TOGGLE:
ret = mca_opt_char(c);
if (ret != NO_MCA)
return (ret);
break;
case A_F_SEARCH:
case A_B_SEARCH:
case A_FILTER:
ret = mca_search_char(c);
if (ret != NO_MCA)
return (ret);
break;
default:
/* Other multicharacter command. */
break;
}
/*
* The multichar command is terminated by a newline.
*/
if (is_newline_char(c))
{
/*
* Execute the command.
*/
exec_mca();
return (MCA_DONE);
}
/*
* Append the char to the command buffer.
*/
if (cmd_char(c) == CC_QUIT)
/*
* Abort the multi-char command.
*/
return (MCA_DONE);
switch (mca)
{
case A_F_BRACKET:
case A_B_BRACKET:
if (len_cmdbuf() >= 2)
{
/*
* Special case for the bracket-matching commands.
* Execute the command after getting exactly two
* characters from the user.
*/
exec_mca();
return (MCA_DONE);
}
break;
case A_F_SEARCH:
case A_B_SEARCH:
if (incr_search)
{
/* Incremental search: do a search after every input char. */
int st = (search_type & (SRCH_FORW|SRCH_BACK|SRCH_NO_MATCH|SRCH_NO_REGEX|SRCH_NO_MOVE|SRCH_WRAP));
char *pattern = get_cmdbuf();
+ if (pattern == NULL)
+ return (MCA_MORE);
+ /*
+ * Must save updown_match because mca_search
+ * reinits it. That breaks history scrolling.
+ * {{ This is ugly. mca_search probably shouldn't call set_mlist. }}
+ */
+ int save_updown_match = updown_match;
cmd_exec();
if (*pattern == '\0')
{
/* User has backspaced to an empty pattern. */
undo_search(1);
} else
{
if (search(st | SRCH_INCR, pattern, 1) != 0)
/* No match, invalid pattern, etc. */
undo_search(1);
}
/* Redraw the search prompt and search string. */
- mca_search();
+ mca_search1();
+ updown_match = save_updown_match;
cmd_repaint(NULL);
}
break;
}
/*
* Need another character.
*/
return (MCA_MORE);
}
/*
* Discard any buffered file data.
*/
static void
clear_buffers(VOID_PARAM)
{
if (!(ch_getflags() & CH_CANSEEK))
return;
ch_flush();
clr_linenum();
#if HILITE_SEARCH
clr_hilite();
#endif
}
/*
* Make sure the screen is displayed.
*/
static void
make_display(VOID_PARAM)
{
/*
* If nothing is displayed yet, display starting from initial_scrpos.
*/
if (empty_screen())
{
if (initial_scrpos.pos == NULL_POSITION)
jump_loc(ch_zero(), 1);
else
jump_loc(initial_scrpos.pos, initial_scrpos.ln);
} else if (screen_trashed)
{
int save_top_scroll = top_scroll;
int save_ignore_eoi = ignore_eoi;
top_scroll = 1;
ignore_eoi = 0;
if (screen_trashed == 2)
{
/* Special case used by ignore_eoi: re-open the input file
* and jump to the end of the file. */
reopen_curr_ifile();
jump_forw();
}
repaint();
top_scroll = save_top_scroll;
ignore_eoi = save_ignore_eoi;
}
}
/*
* Display the appropriate prompt.
*/
static void
prompt(VOID_PARAM)
{
constant char *p;
if (ungot != NULL && ungot->ug_char != CHAR_END_COMMAND)
{
/*
* No prompt necessary if commands are from
* ungotten chars rather than from the user.
*/
return;
}
/*
* Make sure the screen is displayed.
*/
make_display();
bottompos = position(BOTTOM_PLUS_ONE);
/*
* If we've hit EOF on the last file and the -E flag is set, quit.
*/
if (get_quit_at_eof() == OPT_ONPLUS &&
eof_displayed() && !(ch_getflags() & CH_HELPFILE) &&
next_ifile(curr_ifile) == NULL_IFILE)
quit(QUIT_OK);
/*
* If the entire file is displayed and the -F flag is set, quit.
*/
if (quit_if_one_screen &&
entire_file_displayed() && !(ch_getflags() & CH_HELPFILE) &&
next_ifile(curr_ifile) == NULL_IFILE)
quit(QUIT_OK);
quit_if_one_screen = FALSE; /* only get one chance at this */
#if MSDOS_COMPILER==WIN32C
/*
* In Win32, display the file name in the window title.
*/
if (!(ch_getflags() & CH_HELPFILE))
{
WCHAR w[MAX_PATH+16];
- p = pr_expand("Less?f - %f.", 0);
+ p = pr_expand("Less?f - %f.");
MultiByteToWideChar(CP_ACP, 0, p, -1, w, sizeof(w)/sizeof(*w));
SetConsoleTitleW(w);
}
#endif
/*
* Select the proper prompt and display it.
*/
/*
* If the previous action was a forward movement,
* don't clear the bottom line of the display;
* just print the prompt since the forward movement guarantees
* that we're in the right position to display the prompt.
* Clearing the line could cause a problem: for example, if the last
* line displayed ended at the right screen edge without a newline,
* then clearing would clear the last displayed line rather than
* the prompt line.
*/
if (!forw_prompt)
clear_bot();
clear_cmd();
forw_prompt = 0;
p = pr_string();
#if HILITE_SEARCH
if (is_filtering())
putstr("& ");
#endif
if (p == NULL || *p == '\0')
{
at_enter(AT_NORMAL|AT_COLOR_PROMPT);
putchr(':');
at_exit();
} else
{
#if MSDOS_COMPILER==WIN32C
WCHAR w[MAX_PATH*2];
char a[MAX_PATH*2];
MultiByteToWideChar(CP_ACP, 0, p, -1, w, sizeof(w)/sizeof(*w));
WideCharToMultiByte(utf_mode ? CP_UTF8 : GetConsoleOutputCP(),
0, w, -1, a, sizeof(a), NULL, NULL);
p = a;
#endif
- at_enter(AT_STANDOUT|AT_COLOR_PROMPT);
- putstr(p);
- at_exit();
+ load_line(p);
+ put_line();
}
clear_eol();
}
/*
* Display the less version message.
*/
public void
dispversion(VOID_PARAM)
{
PARG parg;
parg.p_string = version;
error("less %s", &parg);
}
/*
* Return a character to complete a partial command, if possible.
*/
static LWCHAR
getcc_end_command(VOID_PARAM)
{
switch (mca)
{
case A_DIGIT:
/* We have a number but no command. Treat as #g. */
return ('g');
case A_F_SEARCH:
case A_B_SEARCH:
/* We have "/string" but no newline. Add the \n. */
return ('\n');
default:
/* Some other incomplete command. Let user complete it. */
return ((ungot == NULL) ? getchr() : 0);
}
}
/*
* Get command character.
* The character normally comes from the keyboard,
* but may come from ungotten characters
* (characters previously given to ungetcc or ungetsc).
*/
static LWCHAR
getccu(VOID_PARAM)
{
LWCHAR c = 0;
while (c == 0)
{
if (ungot == NULL)
{
/* Normal case: no ungotten chars.
* Get char from the user. */
c = getchr();
} else
{
/* Ungotten chars available:
* Take the top of stack (most recent). */
struct ungot *ug = ungot;
c = ug->ug_char;
ungot = ug->ug_next;
free(ug);
if (c == CHAR_END_COMMAND)
c = getcc_end_command();
}
}
return (c);
}
/*
* Get a command character, but if we receive the orig sequence,
* convert it to the repl sequence.
*/
static LWCHAR
getcc_repl(orig, repl, gr_getc, gr_ungetc)
- char const* orig;
- char const* repl;
+ char constant* orig;
+ char constant* repl;
LWCHAR (*gr_getc)(VOID_PARAM);
void (*gr_ungetc)(LWCHAR);
{
LWCHAR c;
LWCHAR keys[16];
int ki = 0;
c = (*gr_getc)();
if (orig == NULL || orig[0] == '\0')
return c;
for (;;)
{
keys[ki] = c;
if (c != orig[ki] || ki >= sizeof(keys)-1)
{
/* This is not orig we have been receiving.
* If we have stashed chars in keys[],
* unget them and return the first one. */
while (ki > 0)
(*gr_ungetc)(keys[ki--]);
return keys[0];
}
if (orig[++ki] == '\0')
{
/* We've received the full orig sequence.
* Return the repl sequence. */
ki = strlen(repl)-1;
while (ki > 0)
(*gr_ungetc)(repl[ki--]);
return repl[0];
}
/* We've received a partial orig sequence (ki chars of it).
* Get next char and see if it continues to match orig. */
c = (*gr_getc)();
}
}
/*
* Get command character.
*/
public int
getcc(VOID_PARAM)
{
/* Replace kent (keypad Enter) with a newline. */
return getcc_repl(kent, "\n", getccu, ungetcc);
}
/*
* "Unget" a command character.
* The next getcc() will return this character.
*/
public void
ungetcc(c)
LWCHAR c;
{
struct ungot *ug = (struct ungot *) ecalloc(1, sizeof(struct ungot));
ug->ug_char = c;
ug->ug_next = ungot;
ungot = ug;
}
/*
* "Unget" a command character.
* If any other chars are already ungotten, put this one after those.
*/
public void
ungetcc_back(c)
LWCHAR c;
{
struct ungot *ug = (struct ungot *) ecalloc(1, sizeof(struct ungot));
ug->ug_char = c;
ug->ug_next = NULL;
if (ungot == NULL)
ungot = ug;
else
{
struct ungot *pu;
for (pu = ungot; pu->ug_next != NULL; pu = pu->ug_next)
continue;
pu->ug_next = ug;
}
}
/*
* Unget a whole string of command characters.
* The next sequence of getcc()'s will return this string.
*/
public void
ungetsc(s)
char *s;
{
while (*s != '\0')
ungetcc_back(*s++);
}
/*
* Peek the next command character, without consuming it.
*/
public LWCHAR
peekcc(VOID_PARAM)
{
LWCHAR c = getcc();
ungetcc(c);
return c;
}
/*
* Search for a pattern, possibly in multiple files.
* If SRCH_FIRST_FILE is set, begin searching at the first file.
* If SRCH_PAST_EOF is set, continue the search thru multiple files.
*/
static void
multi_search(pattern, n, silent)
char *pattern;
int n;
int silent;
{
int nomore;
IFILE save_ifile;
int changed_file;
changed_file = 0;
save_ifile = save_curr_ifile();
if (search_type & SRCH_FIRST_FILE)
{
/*
* Start at the first (or last) file
* in the command line list.
*/
if (search_type & SRCH_FORW)
nomore = edit_first();
else
nomore = edit_last();
if (nomore)
{
unsave_ifile(save_ifile);
return;
}
changed_file = 1;
search_type &= ~SRCH_FIRST_FILE;
}
for (;;)
{
n = search(search_type, pattern, n);
/*
* The SRCH_NO_MOVE flag doesn't "stick": it gets cleared
* after being used once. This allows "n" to work after
* using a /@@ search.
*/
search_type &= ~SRCH_NO_MOVE;
if (n == 0)
{
/*
* Found it.
*/
unsave_ifile(save_ifile);
return;
}
if (n < 0)
/*
* Some kind of error in the search.
* Error message has been printed by search().
*/
break;
if ((search_type & SRCH_PAST_EOF) == 0)
/*
* We didn't find a match, but we're
* supposed to search only one file.
*/
break;
/*
* Move on to the next file.
*/
if (search_type & SRCH_FORW)
nomore = edit_next(1);
else
nomore = edit_prev(1);
if (nomore)
break;
changed_file = 1;
}
/*
* Didn't find it.
* Print an error message if we haven't already.
*/
if (n > 0 && !silent)
error("Pattern not found", NULL_PARG);
if (changed_file)
{
/*
* Restore the file we were originally viewing.
*/
reedit_ifile(save_ifile);
} else
{
unsave_ifile(save_ifile);
}
}
/*
* Forward forever, or until a highlighted line appears.
*/
static int
forw_loop(until_hilite)
int until_hilite;
{
POSITION curr_len;
if (ch_getflags() & CH_HELPFILE)
return (A_NOACTION);
cmd_exec();
jump_forw_buffered();
curr_len = ch_length();
highest_hilite = until_hilite ? curr_len : NULL_POSITION;
ignore_eoi = 1;
while (!sigs)
{
if (until_hilite && highest_hilite > curr_len)
{
bell();
break;
}
make_display();
forward(1, 0, 0);
}
ignore_eoi = 0;
ch_set_eof();
/*
* This gets us back in "F mode" after processing
* a non-abort signal (e.g. window-change).
*/
if (sigs && !ABORT_SIGS())
return (until_hilite ? A_F_UNTIL_HILITE : A_F_FOREVER);
return (A_NOACTION);
}
/*
* Main command processor.
* Accept and execute commands until a quit command.
*/
public void
commands(VOID_PARAM)
{
int c;
int action;
char *cbuf;
int newaction;
int save_jump_sline;
int save_search_type;
char *extra;
char tbuf[2];
PARG parg;
IFILE old_ifile;
IFILE new_ifile;
char *tagfile;
search_type = SRCH_FORW;
wscroll = (sc_height + 1) / 2;
newaction = A_NOACTION;
for (;;)
{
clear_mca();
cmd_accept();
number = 0;
curropt = NULL;
/*
* See if any signals need processing.
*/
if (sigs)
{
psignals();
if (quitting)
quit(QUIT_SAVED_STATUS);
}
/*
* See if window size changed, for systems that don't
* generate SIGWINCH.
*/
check_winch();
/*
* Display prompt and accept a character.
*/
cmd_reset();
prompt();
if (sigs)
continue;
if (newaction == A_NOACTION)
c = getcc();
again:
if (sigs)
continue;
if (newaction != A_NOACTION)
{
action = newaction;
newaction = A_NOACTION;
} else
{
/*
* If we are in a multicharacter command, call mca_char.
* Otherwise we call fcmd_decode to determine the
* action to be performed.
*/
if (mca)
switch (mca_char(c))
{
case MCA_MORE:
/*
* Need another character.
*/
c = getcc();
goto again;
case MCA_DONE:
/*
* Command has been handled by mca_char.
* Start clean with a prompt.
*/
continue;
case NO_MCA:
/*
* Not a multi-char command
* (at least, not anymore).
*/
break;
}
/*
* Decode the command character and decide what to do.
*/
if (mca)
{
/*
* We're in a multichar command.
* Add the character to the command buffer
* and display it on the screen.
* If the user backspaces past the start
* of the line, abort the command.
*/
if (cmd_char(c) == CC_QUIT || len_cmdbuf() == 0)
continue;
cbuf = get_cmdbuf();
+ if (cbuf == NULL)
+ continue;
} else
{
/*
* Don't use cmd_char if we're starting fresh
* at the beginning of a command, because we
* don't want to echo the command until we know
* it is a multichar command. We also don't
* want erase_char/kill_char to be treated
* as line editing characters.
*/
tbuf[0] = c;
tbuf[1] = '\0';
cbuf = tbuf;
}
extra = NULL;
action = fcmd_decode(cbuf, &extra);
/*
* If an "extra" string was returned,
* process it as a string of command characters.
*/
if (extra != NULL)
ungetsc(extra);
}
/*
* Clear the cmdbuf string.
* (But not if we're in the prefix of a command,
* because the partial command string is kept there.)
*/
if (action != A_PREFIX)
cmd_reset();
switch (action)
{
case A_DIGIT:
/*
* First digit of a number.
*/
start_mca(A_DIGIT, ":", (void*)NULL, CF_QUIT_ON_ERASE);
goto again;
case A_F_WINDOW:
/*
* Forward one window (and set the window size).
*/
if (number > 0)
swindow = (int) number;
/* FALLTHRU */
case A_F_SCREEN:
/*
* Forward one screen.
*/
if (number <= 0)
number = get_swindow();
cmd_exec();
if (show_attn)
set_attnpos(bottompos);
forward((int) number, 0, 1);
break;
case A_B_WINDOW:
/*
* Backward one window (and set the window size).
*/
if (number > 0)
swindow = (int) number;
/* FALLTHRU */
case A_B_SCREEN:
/*
* Backward one screen.
*/
if (number <= 0)
number = get_swindow();
cmd_exec();
backward((int) number, 0, 1);
break;
case A_F_LINE:
/*
* Forward N (default 1) line.
*/
if (number <= 0)
number = 1;
cmd_exec();
if (show_attn == OPT_ONPLUS && number > 1)
set_attnpos(bottompos);
forward((int) number, 0, 0);
break;
case A_B_LINE:
/*
* Backward N (default 1) line.
*/
if (number <= 0)
number = 1;
cmd_exec();
backward((int) number, 0, 0);
break;
case A_F_MOUSE:
/*
* Forward wheel_lines lines.
*/
cmd_exec();
forward(wheel_lines, 0, 0);
break;
case A_B_MOUSE:
/*
* Backward wheel_lines lines.
*/
cmd_exec();
backward(wheel_lines, 0, 0);
break;
case A_FF_LINE:
/*
* Force forward N (default 1) line.
*/
if (number <= 0)
number = 1;
cmd_exec();
if (show_attn == OPT_ONPLUS && number > 1)
set_attnpos(bottompos);
forward((int) number, 1, 0);
break;
case A_BF_LINE:
/*
* Force backward N (default 1) line.
*/
if (number <= 0)
number = 1;
cmd_exec();
backward((int) number, 1, 0);
break;
case A_FF_SCREEN:
/*
* Force forward one screen.
*/
if (number <= 0)
number = get_swindow();
cmd_exec();
if (show_attn == OPT_ONPLUS)
set_attnpos(bottompos);
forward((int) number, 1, 0);
break;
case A_F_FOREVER:
/*
* Forward forever, ignoring EOF.
*/
if (show_attn)
set_attnpos(bottompos);
newaction = forw_loop(0);
break;
case A_F_UNTIL_HILITE:
newaction = forw_loop(1);
break;
case A_F_SCROLL:
/*
* Forward N lines
* (default same as last 'd' or 'u' command).
*/
if (number > 0)
wscroll = (int) number;
cmd_exec();
if (show_attn == OPT_ONPLUS)
set_attnpos(bottompos);
forward(wscroll, 0, 0);
break;
case A_B_SCROLL:
/*
* Forward N lines
* (default same as last 'd' or 'u' command).
*/
if (number > 0)
wscroll = (int) number;
cmd_exec();
backward(wscroll, 0, 0);
break;
case A_FREPAINT:
/*
* Flush buffers, then repaint screen.
* Don't flush the buffers on a pipe!
*/
clear_buffers();
/* FALLTHRU */
case A_REPAINT:
/*
* Repaint screen.
*/
cmd_exec();
repaint();
break;
case A_GOLINE:
/*
* Go to line N, default beginning of file.
* If N <= 0, ignore jump_sline in order to avoid
* empty lines before the beginning of the file.
*/
save_jump_sline = jump_sline;
if (number <= 0)
{
number = 1;
jump_sline = 0;
}
cmd_exec();
jump_back(number);
jump_sline = save_jump_sline;
break;
case A_PERCENT:
/*
* Go to a specified percentage into the file.
*/
if (number < 0)
{
number = 0;
fraction = 0;
}
if (number > 100 || (number == 100 && fraction != 0))
{
number = 100;
fraction = 0;
}
cmd_exec();
jump_percent((int) number, fraction);
break;
case A_GOEND:
/*
* Go to line N, default end of file.
*/
cmd_exec();
if (number <= 0)
jump_forw();
else
jump_back(number);
break;
case A_GOEND_BUF:
/*
* Go to line N, default last buffered byte.
*/
cmd_exec();
if (number <= 0)
jump_forw_buffered();
else
jump_back(number);
break;
case A_GOPOS:
/*
* Go to a specified byte position in the file.
*/
cmd_exec();
if (number < 0)
number = 0;
jump_line_loc((POSITION) number, jump_sline);
break;
case A_STAT:
/*
* Print file name, etc.
*/
if (ch_getflags() & CH_HELPFILE)
break;
cmd_exec();
parg.p_string = eq_message();
error("%s", &parg);
break;
case A_VERSION:
/*
* Print version number.
*/
cmd_exec();
dispversion();
break;
case A_QUIT:
/*
* Exit.
*/
if (curr_ifile != NULL_IFILE &&
ch_getflags() & CH_HELPFILE)
{
/*
* Quit while viewing the help file
* just means return to viewing the
* previous file.
*/
hshift = save_hshift;
bs_mode = save_bs_mode;
if (edit_prev(1) == 0)
break;
}
if (extra != NULL)
quit(*extra);
quit(QUIT_OK);
break;
/*
* Define abbreviation for a commonly used sequence below.
*/
#define DO_SEARCH() \
if (number <= 0) number = 1; \
mca_search(); \
cmd_exec(); \
multi_search((char *)NULL, (int) number, 0);
case A_F_SEARCH:
/*
* Search forward for a pattern.
* Get the first char of the pattern.
*/
- search_type = SRCH_FORW;
+ search_type = SRCH_FORW | def_search_type;
if (number <= 0)
number = 1;
mca_search();
c = getcc();
goto again;
case A_B_SEARCH:
/*
* Search backward for a pattern.
* Get the first char of the pattern.
*/
- search_type = SRCH_BACK;
+ search_type = SRCH_BACK | def_search_type;
if (number <= 0)
number = 1;
mca_search();
c = getcc();
goto again;
case A_FILTER:
#if HILITE_SEARCH
search_type = SRCH_FORW | SRCH_FILTER;
mca_search();
c = getcc();
goto again;
#else
error("Command not available", NULL_PARG);
break;
#endif
case A_AGAIN_SEARCH:
/*
* Repeat previous search.
*/
DO_SEARCH();
break;
case A_T_AGAIN_SEARCH:
/*
* Repeat previous search, multiple files.
*/
search_type |= SRCH_PAST_EOF;
DO_SEARCH();
break;
case A_REVERSE_SEARCH:
/*
* Repeat previous search, in reverse direction.
*/
save_search_type = search_type;
search_type = SRCH_REVERSE(search_type);
DO_SEARCH();
search_type = save_search_type;
break;
case A_T_REVERSE_SEARCH:
/*
* Repeat previous search,
* multiple files in reverse direction.
*/
save_search_type = search_type;
search_type = SRCH_REVERSE(search_type);
search_type |= SRCH_PAST_EOF;
DO_SEARCH();
search_type = save_search_type;
break;
case A_UNDO_SEARCH:
case A_CLR_SEARCH:
/*
* Clear search string highlighting.
*/
undo_search(action == A_CLR_SEARCH);
break;
case A_HELP:
/*
* Help.
*/
if (ch_getflags() & CH_HELPFILE)
break;
cmd_exec();
save_hshift = hshift;
hshift = 0;
save_bs_mode = bs_mode;
bs_mode = BS_SPECIAL;
(void) edit(FAKE_HELPFILE);
break;
case A_EXAMINE:
/*
* Edit a new file. Get the filename.
*/
#if EXAMINE
if (!secure)
{
start_mca(A_EXAMINE, "Examine: ", ml_examine, 0);
c = getcc();
goto again;
}
#endif
error("Command not available", NULL_PARG);
break;
case A_VISUAL:
/*
* Invoke an editor on the input file.
*/
#if EDITOR
if (!secure)
{
if (ch_getflags() & CH_HELPFILE)
break;
if (strcmp(get_filename(curr_ifile), "-") == 0)
{
error("Cannot edit standard input", NULL_PARG);
break;
}
if (get_altfilename(curr_ifile) != NULL)
{
error("WARNING: This file was viewed via LESSOPEN",
NULL_PARG);
}
start_mca(A_SHELL, "!", ml_shell, 0);
/*
* Expand the editor prototype string
* and pass it to the system to execute.
* (Make sure the screen is displayed so the
* expansion of "+%lm" works.)
*/
make_display();
cmd_exec();
- lsystem(pr_expand(editproto, 0), (char*)NULL);
+ lsystem(pr_expand(editproto), (char*)NULL);
break;
}
#endif
error("Command not available", NULL_PARG);
break;
case A_NEXT_FILE:
/*
* Examine next file.
*/
#if TAGS
if (ntags())
{
error("No next file", NULL_PARG);
break;
}
#endif
if (number <= 0)
number = 1;
if (edit_next((int) number))
{
if (get_quit_at_eof() && eof_displayed() &&
!(ch_getflags() & CH_HELPFILE))
quit(QUIT_OK);
parg.p_string = (number > 1) ? "(N-th) " : "";
error("No %snext file", &parg);
}
break;
case A_PREV_FILE:
/*
* Examine previous file.
*/
#if TAGS
if (ntags())
{
error("No previous file", NULL_PARG);
break;
}
#endif
if (number <= 0)
number = 1;
if (edit_prev((int) number))
{
parg.p_string = (number > 1) ? "(N-th) " : "";
error("No %sprevious file", &parg);
}
break;
case A_NEXT_TAG:
/*
* Jump to the next tag in the current tag list.
*/
#if TAGS
if (number <= 0)
number = 1;
tagfile = nexttag((int) number);
if (tagfile == NULL)
{
error("No next tag", NULL_PARG);
break;
}
cmd_exec();
if (edit(tagfile) == 0)
{
POSITION pos = tagsearch();
if (pos != NULL_POSITION)
jump_loc(pos, jump_sline);
}
#else
error("Command not available", NULL_PARG);
#endif
break;
case A_PREV_TAG:
/*
* Jump to the previous tag in the current tag list.
*/
#if TAGS
if (number <= 0)
number = 1;
tagfile = prevtag((int) number);
if (tagfile == NULL)
{
error("No previous tag", NULL_PARG);
break;
}
cmd_exec();
if (edit(tagfile) == 0)
{
POSITION pos = tagsearch();
if (pos != NULL_POSITION)
jump_loc(pos, jump_sline);
}
#else
error("Command not available", NULL_PARG);
#endif
break;
case A_INDEX_FILE:
/*
* Examine a particular file.
*/
if (number <= 0)
number = 1;
if (edit_index((int) number))
error("No such file", NULL_PARG);
break;
case A_REMOVE_FILE:
/*
* Remove a file from the input file list.
*/
if (ch_getflags() & CH_HELPFILE)
break;
old_ifile = curr_ifile;
new_ifile = getoff_ifile(curr_ifile);
if (new_ifile == NULL_IFILE)
{
bell();
break;
}
if (edit_ifile(new_ifile) != 0)
{
reedit_ifile(old_ifile);
break;
}
del_ifile(old_ifile);
break;
case A_OPT_TOGGLE:
/*
* Change the setting of an option.
*/
optflag = OPT_TOGGLE;
optgetname = FALSE;
mca_opt_toggle();
c = getcc();
cbuf = opt_toggle_disallowed(c);
if (cbuf != NULL)
{
error(cbuf, NULL_PARG);
break;
}
goto again;
case A_DISP_OPTION:
/*
* Report the setting of an option.
*/
optflag = OPT_NO_TOGGLE;
optgetname = FALSE;
mca_opt_toggle();
c = getcc();
goto again;
case A_FIRSTCMD:
/*
* Set an initial command for new files.
*/
start_mca(A_FIRSTCMD, "+", (void*)NULL, 0);
c = getcc();
goto again;
case A_SHELL:
/*
* Shell escape.
*/
#if SHELL_ESCAPE
if (!secure)
{
start_mca(A_SHELL, "!", ml_shell, 0);
c = getcc();
goto again;
}
#endif
error("Command not available", NULL_PARG);
break;
case A_SETMARK:
case A_SETMARKBOT:
/*
* Set a mark.
*/
if (ch_getflags() & CH_HELPFILE)
break;
start_mca(A_SETMARK, "set mark: ", (void*)NULL, 0);
c = getcc();
if (is_erase_char(c) || is_newline_char(c))
break;
setmark(c, action == A_SETMARKBOT ? BOTTOM : TOP);
repaint();
break;
case A_CLRMARK:
/*
* Clear a mark.
*/
start_mca(A_CLRMARK, "clear mark: ", (void*)NULL, 0);
c = getcc();
if (is_erase_char(c) || is_newline_char(c))
break;
clrmark(c);
repaint();
break;
case A_GOMARK:
/*
* Jump to a marked position.
*/
start_mca(A_GOMARK, "goto mark: ", (void*)NULL, 0);
c = getcc();
if (is_erase_char(c) || is_newline_char(c))
break;
cmd_exec();
gomark(c);
break;
case A_PIPE:
/*
* Write part of the input to a pipe to a shell command.
*/
#if PIPEC
if (!secure)
{
start_mca(A_PIPE, "|mark: ", (void*)NULL, 0);
c = getcc();
if (is_erase_char(c))
break;
if (is_newline_char(c))
c = '.';
if (badmark(c))
break;
pipec = c;
start_mca(A_PIPE, "!", ml_shell, 0);
c = getcc();
goto again;
}
#endif
error("Command not available", NULL_PARG);
break;
case A_B_BRACKET:
case A_F_BRACKET:
start_mca(action, "Brackets: ", (void*)NULL, 0);
c = getcc();
goto again;
case A_LSHIFT:
/*
* Shift view left.
*/
if (number > 0)
shift_count = number;
else
number = (shift_count > 0) ?
shift_count : sc_width / 2;
if (number > hshift)
number = hshift;
hshift -= number;
screen_trashed = 1;
break;
case A_RSHIFT:
/*
* Shift view right.
*/
if (number > 0)
shift_count = number;
else
number = (shift_count > 0) ?
shift_count : sc_width / 2;
hshift += number;
screen_trashed = 1;
break;
case A_LLSHIFT:
/*
* Shift view left to margin.
*/
hshift = 0;
screen_trashed = 1;
break;
case A_RRSHIFT:
/*
* Shift view right to view rightmost char on screen.
*/
hshift = rrshift();
screen_trashed = 1;
break;
case A_PREFIX:
/*
* The command is incomplete (more chars are needed).
* Display the current char, so the user knows
* what's going on, and get another character.
*/
if (mca != A_PREFIX)
{
cmd_reset();
start_mca(A_PREFIX, " ", (void*)NULL,
CF_QUIT_ON_ERASE);
(void) cmd_char(c);
}
c = getcc();
goto again;
case A_NOACTION:
break;
default:
bell();
break;
}
}
}
diff --git a/compose.uni b/compose.uni
index bbf4b20387fc..cc7ddcf02bb9 100644
--- a/compose.uni
+++ b/compose.uni
@@ -1,337 +1,345 @@
-/* Generated by "./mkutable -f2 Mn Me -- unicode/UnicodeData.txt" on Tue May 19 14:47:34 PDT 2020 */
+/* Generated by "./mkutable -f2 Mn Me -- unicode/UnicodeData.txt" on Tue Jul 19 12:45:16 PDT 2022 */
{ 0x0300, 0x036f }, /* Mn */
{ 0x0483, 0x0487 }, /* Mn */
{ 0x0488, 0x0489 }, /* Me */
{ 0x0591, 0x05bd }, /* Mn */
{ 0x05bf, 0x05bf }, /* Mn */
{ 0x05c1, 0x05c2 }, /* Mn */
{ 0x05c4, 0x05c5 }, /* Mn */
{ 0x05c7, 0x05c7 }, /* Mn */
{ 0x0610, 0x061a }, /* Mn */
{ 0x064b, 0x065f }, /* Mn */
{ 0x0670, 0x0670 }, /* Mn */
{ 0x06d6, 0x06dc }, /* Mn */
{ 0x06df, 0x06e4 }, /* Mn */
{ 0x06e7, 0x06e8 }, /* Mn */
{ 0x06ea, 0x06ed }, /* Mn */
{ 0x0711, 0x0711 }, /* Mn */
{ 0x0730, 0x074a }, /* Mn */
{ 0x07a6, 0x07b0 }, /* Mn */
{ 0x07eb, 0x07f3 }, /* Mn */
{ 0x07fd, 0x07fd }, /* Mn */
{ 0x0816, 0x0819 }, /* Mn */
{ 0x081b, 0x0823 }, /* Mn */
{ 0x0825, 0x0827 }, /* Mn */
{ 0x0829, 0x082d }, /* Mn */
{ 0x0859, 0x085b }, /* Mn */
- { 0x08d3, 0x08e1 }, /* Mn */
+ { 0x0898, 0x089f }, /* Mn */
+ { 0x08ca, 0x08e1 }, /* Mn */
{ 0x08e3, 0x0902 }, /* Mn */
{ 0x093a, 0x093a }, /* Mn */
{ 0x093c, 0x093c }, /* Mn */
{ 0x0941, 0x0948 }, /* Mn */
{ 0x094d, 0x094d }, /* Mn */
{ 0x0951, 0x0957 }, /* Mn */
{ 0x0962, 0x0963 }, /* Mn */
{ 0x0981, 0x0981 }, /* Mn */
{ 0x09bc, 0x09bc }, /* Mn */
{ 0x09c1, 0x09c4 }, /* Mn */
{ 0x09cd, 0x09cd }, /* Mn */
{ 0x09e2, 0x09e3 }, /* Mn */
{ 0x09fe, 0x09fe }, /* Mn */
{ 0x0a01, 0x0a02 }, /* Mn */
{ 0x0a3c, 0x0a3c }, /* Mn */
{ 0x0a41, 0x0a42 }, /* Mn */
{ 0x0a47, 0x0a48 }, /* Mn */
{ 0x0a4b, 0x0a4d }, /* Mn */
{ 0x0a51, 0x0a51 }, /* Mn */
{ 0x0a70, 0x0a71 }, /* Mn */
{ 0x0a75, 0x0a75 }, /* Mn */
{ 0x0a81, 0x0a82 }, /* Mn */
{ 0x0abc, 0x0abc }, /* Mn */
{ 0x0ac1, 0x0ac5 }, /* Mn */
{ 0x0ac7, 0x0ac8 }, /* Mn */
{ 0x0acd, 0x0acd }, /* Mn */
{ 0x0ae2, 0x0ae3 }, /* Mn */
{ 0x0afa, 0x0aff }, /* Mn */
{ 0x0b01, 0x0b01 }, /* Mn */
{ 0x0b3c, 0x0b3c }, /* Mn */
{ 0x0b3f, 0x0b3f }, /* Mn */
{ 0x0b41, 0x0b44 }, /* Mn */
{ 0x0b4d, 0x0b4d }, /* Mn */
{ 0x0b55, 0x0b56 }, /* Mn */
{ 0x0b62, 0x0b63 }, /* Mn */
{ 0x0b82, 0x0b82 }, /* Mn */
{ 0x0bc0, 0x0bc0 }, /* Mn */
{ 0x0bcd, 0x0bcd }, /* Mn */
{ 0x0c00, 0x0c00 }, /* Mn */
{ 0x0c04, 0x0c04 }, /* Mn */
+ { 0x0c3c, 0x0c3c }, /* Mn */
{ 0x0c3e, 0x0c40 }, /* Mn */
{ 0x0c46, 0x0c48 }, /* Mn */
{ 0x0c4a, 0x0c4d }, /* Mn */
{ 0x0c55, 0x0c56 }, /* Mn */
{ 0x0c62, 0x0c63 }, /* Mn */
{ 0x0c81, 0x0c81 }, /* Mn */
{ 0x0cbc, 0x0cbc }, /* Mn */
{ 0x0cbf, 0x0cbf }, /* Mn */
{ 0x0cc6, 0x0cc6 }, /* Mn */
{ 0x0ccc, 0x0ccd }, /* Mn */
{ 0x0ce2, 0x0ce3 }, /* Mn */
{ 0x0d00, 0x0d01 }, /* Mn */
{ 0x0d3b, 0x0d3c }, /* Mn */
{ 0x0d41, 0x0d44 }, /* Mn */
{ 0x0d4d, 0x0d4d }, /* Mn */
{ 0x0d62, 0x0d63 }, /* Mn */
{ 0x0d81, 0x0d81 }, /* Mn */
{ 0x0dca, 0x0dca }, /* Mn */
{ 0x0dd2, 0x0dd4 }, /* Mn */
{ 0x0dd6, 0x0dd6 }, /* Mn */
{ 0x0e31, 0x0e31 }, /* Mn */
{ 0x0e34, 0x0e3a }, /* Mn */
{ 0x0e47, 0x0e4e }, /* Mn */
{ 0x0eb1, 0x0eb1 }, /* Mn */
{ 0x0eb4, 0x0ebc }, /* Mn */
{ 0x0ec8, 0x0ecd }, /* Mn */
{ 0x0f18, 0x0f19 }, /* Mn */
{ 0x0f35, 0x0f35 }, /* Mn */
{ 0x0f37, 0x0f37 }, /* Mn */
{ 0x0f39, 0x0f39 }, /* Mn */
{ 0x0f71, 0x0f7e }, /* Mn */
{ 0x0f80, 0x0f84 }, /* Mn */
{ 0x0f86, 0x0f87 }, /* Mn */
{ 0x0f8d, 0x0f97 }, /* Mn */
{ 0x0f99, 0x0fbc }, /* Mn */
{ 0x0fc6, 0x0fc6 }, /* Mn */
{ 0x102d, 0x1030 }, /* Mn */
{ 0x1032, 0x1037 }, /* Mn */
{ 0x1039, 0x103a }, /* Mn */
{ 0x103d, 0x103e }, /* Mn */
{ 0x1058, 0x1059 }, /* Mn */
{ 0x105e, 0x1060 }, /* Mn */
{ 0x1071, 0x1074 }, /* Mn */
{ 0x1082, 0x1082 }, /* Mn */
{ 0x1085, 0x1086 }, /* Mn */
{ 0x108d, 0x108d }, /* Mn */
{ 0x109d, 0x109d }, /* Mn */
{ 0x1160, 0x11ff }, /* Mn */
{ 0x135d, 0x135f }, /* Mn */
{ 0x1712, 0x1714 }, /* Mn */
- { 0x1732, 0x1734 }, /* Mn */
+ { 0x1732, 0x1733 }, /* Mn */
{ 0x1752, 0x1753 }, /* Mn */
{ 0x1772, 0x1773 }, /* Mn */
{ 0x17b4, 0x17b5 }, /* Mn */
{ 0x17b7, 0x17bd }, /* Mn */
{ 0x17c6, 0x17c6 }, /* Mn */
{ 0x17c9, 0x17d3 }, /* Mn */
{ 0x17dd, 0x17dd }, /* Mn */
{ 0x180b, 0x180d }, /* Mn */
+ { 0x180f, 0x180f }, /* Mn */
{ 0x1885, 0x1886 }, /* Mn */
{ 0x18a9, 0x18a9 }, /* Mn */
{ 0x1920, 0x1922 }, /* Mn */
{ 0x1927, 0x1928 }, /* Mn */
{ 0x1932, 0x1932 }, /* Mn */
{ 0x1939, 0x193b }, /* Mn */
{ 0x1a17, 0x1a18 }, /* Mn */
{ 0x1a1b, 0x1a1b }, /* Mn */
{ 0x1a56, 0x1a56 }, /* Mn */
{ 0x1a58, 0x1a5e }, /* Mn */
{ 0x1a60, 0x1a60 }, /* Mn */
{ 0x1a62, 0x1a62 }, /* Mn */
{ 0x1a65, 0x1a6c }, /* Mn */
{ 0x1a73, 0x1a7c }, /* Mn */
{ 0x1a7f, 0x1a7f }, /* Mn */
{ 0x1ab0, 0x1abd }, /* Mn */
{ 0x1abe, 0x1abe }, /* Me */
- { 0x1abf, 0x1ac0 }, /* Mn */
+ { 0x1abf, 0x1ace }, /* Mn */
{ 0x1b00, 0x1b03 }, /* Mn */
{ 0x1b34, 0x1b34 }, /* Mn */
{ 0x1b36, 0x1b3a }, /* Mn */
{ 0x1b3c, 0x1b3c }, /* Mn */
{ 0x1b42, 0x1b42 }, /* Mn */
{ 0x1b6b, 0x1b73 }, /* Mn */
{ 0x1b80, 0x1b81 }, /* Mn */
{ 0x1ba2, 0x1ba5 }, /* Mn */
{ 0x1ba8, 0x1ba9 }, /* Mn */
{ 0x1bab, 0x1bad }, /* Mn */
{ 0x1be6, 0x1be6 }, /* Mn */
{ 0x1be8, 0x1be9 }, /* Mn */
{ 0x1bed, 0x1bed }, /* Mn */
{ 0x1bef, 0x1bf1 }, /* Mn */
{ 0x1c2c, 0x1c33 }, /* Mn */
{ 0x1c36, 0x1c37 }, /* Mn */
{ 0x1cd0, 0x1cd2 }, /* Mn */
{ 0x1cd4, 0x1ce0 }, /* Mn */
{ 0x1ce2, 0x1ce8 }, /* Mn */
{ 0x1ced, 0x1ced }, /* Mn */
{ 0x1cf4, 0x1cf4 }, /* Mn */
{ 0x1cf8, 0x1cf9 }, /* Mn */
- { 0x1dc0, 0x1df9 }, /* Mn */
- { 0x1dfb, 0x1dff }, /* Mn */
+ { 0x1dc0, 0x1dff }, /* Mn */
{ 0x20d0, 0x20dc }, /* Mn */
{ 0x20dd, 0x20e0 }, /* Me */
{ 0x20e1, 0x20e1 }, /* Mn */
{ 0x20e2, 0x20e4 }, /* Me */
{ 0x20e5, 0x20f0 }, /* Mn */
{ 0x2cef, 0x2cf1 }, /* Mn */
{ 0x2d7f, 0x2d7f }, /* Mn */
{ 0x2de0, 0x2dff }, /* Mn */
{ 0x302a, 0x302d }, /* Mn */
{ 0x3099, 0x309a }, /* Mn */
{ 0xa66f, 0xa66f }, /* Mn */
{ 0xa670, 0xa672 }, /* Me */
{ 0xa674, 0xa67d }, /* Mn */
{ 0xa69e, 0xa69f }, /* Mn */
{ 0xa6f0, 0xa6f1 }, /* Mn */
{ 0xa802, 0xa802 }, /* Mn */
{ 0xa806, 0xa806 }, /* Mn */
{ 0xa80b, 0xa80b }, /* Mn */
{ 0xa825, 0xa826 }, /* Mn */
{ 0xa82c, 0xa82c }, /* Mn */
{ 0xa8c4, 0xa8c5 }, /* Mn */
{ 0xa8e0, 0xa8f1 }, /* Mn */
{ 0xa8ff, 0xa8ff }, /* Mn */
{ 0xa926, 0xa92d }, /* Mn */
{ 0xa947, 0xa951 }, /* Mn */
{ 0xa980, 0xa982 }, /* Mn */
{ 0xa9b3, 0xa9b3 }, /* Mn */
{ 0xa9b6, 0xa9b9 }, /* Mn */
{ 0xa9bc, 0xa9bd }, /* Mn */
{ 0xa9e5, 0xa9e5 }, /* Mn */
{ 0xaa29, 0xaa2e }, /* Mn */
{ 0xaa31, 0xaa32 }, /* Mn */
{ 0xaa35, 0xaa36 }, /* Mn */
{ 0xaa43, 0xaa43 }, /* Mn */
{ 0xaa4c, 0xaa4c }, /* Mn */
{ 0xaa7c, 0xaa7c }, /* Mn */
{ 0xaab0, 0xaab0 }, /* Mn */
{ 0xaab2, 0xaab4 }, /* Mn */
{ 0xaab7, 0xaab8 }, /* Mn */
{ 0xaabe, 0xaabf }, /* Mn */
{ 0xaac1, 0xaac1 }, /* Mn */
{ 0xaaec, 0xaaed }, /* Mn */
{ 0xaaf6, 0xaaf6 }, /* Mn */
{ 0xabe5, 0xabe5 }, /* Mn */
{ 0xabe8, 0xabe8 }, /* Mn */
{ 0xabed, 0xabed }, /* Mn */
{ 0xd7b0, 0xd7c6 }, /* Mn */
{ 0xd7cb, 0xd7fb }, /* Mn */
{ 0xfb1e, 0xfb1e }, /* Mn */
{ 0xfe00, 0xfe0f }, /* Mn */
{ 0xfe20, 0xfe2f }, /* Mn */
{ 0x101fd, 0x101fd }, /* Mn */
{ 0x102e0, 0x102e0 }, /* Mn */
{ 0x10376, 0x1037a }, /* Mn */
{ 0x10a01, 0x10a03 }, /* Mn */
{ 0x10a05, 0x10a06 }, /* Mn */
{ 0x10a0c, 0x10a0f }, /* Mn */
{ 0x10a38, 0x10a3a }, /* Mn */
{ 0x10a3f, 0x10a3f }, /* Mn */
{ 0x10ae5, 0x10ae6 }, /* Mn */
{ 0x10d24, 0x10d27 }, /* Mn */
{ 0x10eab, 0x10eac }, /* Mn */
{ 0x10f46, 0x10f50 }, /* Mn */
+ { 0x10f82, 0x10f85 }, /* Mn */
{ 0x11001, 0x11001 }, /* Mn */
{ 0x11038, 0x11046 }, /* Mn */
+ { 0x11070, 0x11070 }, /* Mn */
+ { 0x11073, 0x11074 }, /* Mn */
{ 0x1107f, 0x11081 }, /* Mn */
{ 0x110b3, 0x110b6 }, /* Mn */
{ 0x110b9, 0x110ba }, /* Mn */
+ { 0x110c2, 0x110c2 }, /* Mn */
{ 0x11100, 0x11102 }, /* Mn */
{ 0x11127, 0x1112b }, /* Mn */
{ 0x1112d, 0x11134 }, /* Mn */
{ 0x11173, 0x11173 }, /* Mn */
{ 0x11180, 0x11181 }, /* Mn */
{ 0x111b6, 0x111be }, /* Mn */
{ 0x111c9, 0x111cc }, /* Mn */
{ 0x111cf, 0x111cf }, /* Mn */
{ 0x1122f, 0x11231 }, /* Mn */
{ 0x11234, 0x11234 }, /* Mn */
{ 0x11236, 0x11237 }, /* Mn */
{ 0x1123e, 0x1123e }, /* Mn */
{ 0x112df, 0x112df }, /* Mn */
{ 0x112e3, 0x112ea }, /* Mn */
{ 0x11300, 0x11301 }, /* Mn */
{ 0x1133b, 0x1133c }, /* Mn */
{ 0x11340, 0x11340 }, /* Mn */
{ 0x11366, 0x1136c }, /* Mn */
{ 0x11370, 0x11374 }, /* Mn */
{ 0x11438, 0x1143f }, /* Mn */
{ 0x11442, 0x11444 }, /* Mn */
{ 0x11446, 0x11446 }, /* Mn */
{ 0x1145e, 0x1145e }, /* Mn */
{ 0x114b3, 0x114b8 }, /* Mn */
{ 0x114ba, 0x114ba }, /* Mn */
{ 0x114bf, 0x114c0 }, /* Mn */
{ 0x114c2, 0x114c3 }, /* Mn */
{ 0x115b2, 0x115b5 }, /* Mn */
{ 0x115bc, 0x115bd }, /* Mn */
{ 0x115bf, 0x115c0 }, /* Mn */
{ 0x115dc, 0x115dd }, /* Mn */
{ 0x11633, 0x1163a }, /* Mn */
{ 0x1163d, 0x1163d }, /* Mn */
{ 0x1163f, 0x11640 }, /* Mn */
{ 0x116ab, 0x116ab }, /* Mn */
{ 0x116ad, 0x116ad }, /* Mn */
{ 0x116b0, 0x116b5 }, /* Mn */
{ 0x116b7, 0x116b7 }, /* Mn */
{ 0x1171d, 0x1171f }, /* Mn */
{ 0x11722, 0x11725 }, /* Mn */
{ 0x11727, 0x1172b }, /* Mn */
{ 0x1182f, 0x11837 }, /* Mn */
{ 0x11839, 0x1183a }, /* Mn */
{ 0x1193b, 0x1193c }, /* Mn */
{ 0x1193e, 0x1193e }, /* Mn */
{ 0x11943, 0x11943 }, /* Mn */
{ 0x119d4, 0x119d7 }, /* Mn */
{ 0x119da, 0x119db }, /* Mn */
{ 0x119e0, 0x119e0 }, /* Mn */
{ 0x11a01, 0x11a0a }, /* Mn */
{ 0x11a33, 0x11a38 }, /* Mn */
{ 0x11a3b, 0x11a3e }, /* Mn */
{ 0x11a47, 0x11a47 }, /* Mn */
{ 0x11a51, 0x11a56 }, /* Mn */
{ 0x11a59, 0x11a5b }, /* Mn */
{ 0x11a8a, 0x11a96 }, /* Mn */
{ 0x11a98, 0x11a99 }, /* Mn */
{ 0x11c30, 0x11c36 }, /* Mn */
{ 0x11c38, 0x11c3d }, /* Mn */
{ 0x11c3f, 0x11c3f }, /* Mn */
{ 0x11c92, 0x11ca7 }, /* Mn */
{ 0x11caa, 0x11cb0 }, /* Mn */
{ 0x11cb2, 0x11cb3 }, /* Mn */
{ 0x11cb5, 0x11cb6 }, /* Mn */
{ 0x11d31, 0x11d36 }, /* Mn */
{ 0x11d3a, 0x11d3a }, /* Mn */
{ 0x11d3c, 0x11d3d }, /* Mn */
{ 0x11d3f, 0x11d45 }, /* Mn */
{ 0x11d47, 0x11d47 }, /* Mn */
{ 0x11d90, 0x11d91 }, /* Mn */
{ 0x11d95, 0x11d95 }, /* Mn */
{ 0x11d97, 0x11d97 }, /* Mn */
{ 0x11ef3, 0x11ef4 }, /* Mn */
{ 0x16af0, 0x16af4 }, /* Mn */
{ 0x16b30, 0x16b36 }, /* Mn */
{ 0x16f4f, 0x16f4f }, /* Mn */
{ 0x16f8f, 0x16f92 }, /* Mn */
{ 0x16fe4, 0x16fe4 }, /* Mn */
{ 0x1bc9d, 0x1bc9e }, /* Mn */
+ { 0x1cf00, 0x1cf2d }, /* Mn */
+ { 0x1cf30, 0x1cf46 }, /* Mn */
{ 0x1d167, 0x1d169 }, /* Mn */
{ 0x1d17b, 0x1d182 }, /* Mn */
{ 0x1d185, 0x1d18b }, /* Mn */
{ 0x1d1aa, 0x1d1ad }, /* Mn */
{ 0x1d242, 0x1d244 }, /* Mn */
{ 0x1da00, 0x1da36 }, /* Mn */
{ 0x1da3b, 0x1da6c }, /* Mn */
{ 0x1da75, 0x1da75 }, /* Mn */
{ 0x1da84, 0x1da84 }, /* Mn */
{ 0x1da9b, 0x1da9f }, /* Mn */
{ 0x1daa1, 0x1daaf }, /* Mn */
{ 0x1e000, 0x1e006 }, /* Mn */
{ 0x1e008, 0x1e018 }, /* Mn */
{ 0x1e01b, 0x1e021 }, /* Mn */
{ 0x1e023, 0x1e024 }, /* Mn */
{ 0x1e026, 0x1e02a }, /* Mn */
{ 0x1e130, 0x1e136 }, /* Mn */
{ 0x1e2ae, 0x1e2ae }, /* Mn */
{ 0x1e2ec, 0x1e2ef }, /* Mn */
{ 0x1e8d0, 0x1e8d6 }, /* Mn */
{ 0x1e944, 0x1e94a }, /* Mn */
{ 0xe0100, 0xe01ef }, /* Mn */
diff --git a/configure b/configure
index 5589f8e761f0..eb346f8a3463 100755
--- a/configure
+++ b/configure
@@ -1,6914 +1,6939 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for less 1.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
_as_can_reexec=no; export _as_can_reexec;
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
as_fn_exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
"
as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }
exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
if (eval "$as_required") 2>/dev/null; then :
as_have_required=yes
else
as_have_required=no
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
as_shell=$as_dir/$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
CONFIG_SHELL=$as_shell as_have_required=yes
if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
break 2
fi
fi
done;;
esac
as_found=false
done
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
CONFIG_SHELL=$SHELL as_have_required=yes
fi; }
IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
if test x$as_have_required = xno; then :
$as_echo "$0: This script requires a shell more modern than all"
$as_echo "$0: the shells that I found on your system."
if test x${ZSH_VERSION+set} = xset ; then
$as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi
exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS
## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
as_lineno_1=$LINENO as_lineno_1a=$LINENO
as_lineno_2=$LINENO as_lineno_2a=$LINENO
eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
# Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
test -n "$DJDIR" || exec 7<&0 &1
# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='less'
PACKAGE_TARNAME='less'
PACKAGE_VERSION='1'
PACKAGE_STRING='less 1'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
ac_unique_file="forwback.c"
# Factoring default headers for most tests.
ac_includes_default="\
#include
#ifdef HAVE_SYS_TYPES_H
# include
#endif
#ifdef HAVE_SYS_STAT_H
# include
#endif
#ifdef STDC_HEADERS
# include
# include
#else
# ifdef HAVE_STDLIB_H
# include
# endif
#endif
#ifdef HAVE_STRING_H
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
# include
# endif
# include
#endif
#ifdef HAVE_STRINGS_H
# include
#endif
#ifdef HAVE_INTTYPES_H
# include
#endif
#ifdef HAVE_STDINT_H
# include
#endif
#ifdef HAVE_UNISTD_H
# include
#endif"
ac_subst_vars='LTLIBOBJS
LIBOBJS
REGEX_O
SECURE_COMPILE
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
EGREP
GREP
CPP
OBJEXT
EXEEXT
ac_ct_CC
CPPFLAGS
LDFLAGS
CFLAGS
CC
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
datadir
datarootdir
libexecdir
sbindir
bindir
program_transform_name
prefix
exec_prefix
PACKAGE_URL
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_largefile
with_secure
with_no_float
with_regex
with_editor
'
ac_precious_vars='build_alias
host_alias
target_alias
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CPP'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE
# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'
ac_prev=
ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval $ac_prev=\$ac_option
ac_prev=
continue
fi
case $ac_option in
*=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
*=) ac_optarg= ;;
*) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file=$ac_optarg ;;
--config-cache | -C)
cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
| --dataroo | --dataro | --datar)
ac_prev=datarootdir ;;
-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
-docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
docdir=$ac_optarg ;;
-dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
ac_prev=dvidir ;;
-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he | -h)
ac_init_help=long ;;
-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
ac_init_help=recursive ;;
-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
ac_init_help=short ;;
-host | --host | --hos | --ho)
ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
-htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
ac_prev=htmldir ;;
-htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
| --ht=*)
htmldir=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
-localedir | --localedir | --localedi | --localed | --locale)
ac_prev=localedir ;;
-localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
localedir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
-pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
ac_prev=pdfdir ;;
-pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
pdfdir=$ac_optarg ;;
-psdir | --psdir | --psdi | --psd | --ps)
ac_prev=psdir ;;
-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
psdir=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers | -V)
ac_init_version=: ;;
-with-* | --with-*)
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
-*) as_fn_error $? "unrecognized option: \`$ac_option'
Try \`$0 --help' for more information"
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
$as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
$as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
as_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
case $ac_val in
*/ )
ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
eval $ac_var=\$ac_val;;
esac
# Be sure to have absolute directory names.
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias
# FIXME: To remove some day.
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
fi
ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
ac_confdir=`$as_dirname -- "$as_myself" ||
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
eval ac_env_${ac_var}_set=\${${ac_var}+set}
eval ac_env_${ac_var}_value=\$${ac_var}
eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
eval ac_cv_env_${ac_var}_value=\$${ac_var}
done
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures less 1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print \`checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/less]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of less 1:";;
esac
cat <<\_ACEOF
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-largefile omit support for large files
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-secure Compile in secure mode
--with-no-float Do not use floating point
--with-regex=LIB select regular expression library (LIB is one of auto,none,gnu,pcre,pcre2,posix,regcmp,re_comp,regcomp,regcomp-local) [auto]
--with-editor=PROGRAM use PROGRAM as the default editor [vi]
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L if you have libraries in a
nonstandard directory
LIBS libraries to pass to the linker, e.g. -l
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if
you have headers in a nonstandard directory
CPP C preprocessor
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to the package provider.
_ACEOF
ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
test -d "$ac_dir" ||
{ cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
# Check for guested configure.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
elif test -f "$ac_srcdir/configure"; then
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
less configure 1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##
# ac_fn_c_try_compile LINENO
# --------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext conftest$ac_exeext
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_link
# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_cpp ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if { { ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } > conftest.i && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
# ac_fn_c_try_run LINENO
# ----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
# that executables *can* be run.
ac_fn_c_try_run ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then :
ac_retval=0
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=$ac_status
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_run
# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
# the include files in INCLUDES and setting the cache variable VAR
# accordingly.
ac_fn_c_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if eval \${$3+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
$as_echo_n "checking $2 usability... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_header_compiler=yes
else
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
$as_echo_n "checking $2 presence... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <$2>
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
ac_header_preproc=yes
else
ac_header_preproc=no
fi
rm -f conftest.err conftest.i conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
yes:no: )
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
;;
no:yes:* )
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_mongrel
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
# INCLUDES, setting the cache variable VAR accordingly.
ac_fn_c_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
# variable VAR accordingly.
ac_fn_c_check_type ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
if (sizeof ($2))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
if (sizeof (($2)))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
eval "$3=yes"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_type
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case declares $2.
For example, HP-UX 11i declares gettimeofday. */
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $2 (); below.
Prefer to if __STDC__ is defined, since
exists even on freestanding compilers. */
#ifdef __STDC__
# include
#else
# include
#endif
#undef $2
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char $2 ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_$2 || defined __stub___$2
choke me
#endif
int
main ()
{
return $2 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by less $as_me 1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
_ASUNAME
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
$as_echo "PATH: $as_dir"
done
IFS=$as_save_IFS
} >&5
cat >&5 <<_ACEOF
## ----------- ##
## Core tests. ##
## ----------- ##
_ACEOF
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
for ac_arg
do
case $ac_arg in
-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
as_fn_append ac_configure_args1 " '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
case $ac_arg in
*=* | --config-cache | -C | -disable-* | --disable-* \
| -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
| -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
| -with-* | --with-* | -without-* | --without-* | --x)
case "$ac_configure_args0 " in
"$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
esac
;;
-* ) ac_must_keep_next=true ;;
esac
fi
as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset ac_configure_args1;}
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
echo
$as_echo "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
# The following way of writing the cache mishandles newlines in values,
(
for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
sed -n \
"s/'\''/'\''\\\\'\'''\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
;; #(
*)
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
)
echo
$as_echo "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
$as_echo "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
$as_echo "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
$as_echo "$as_me: caught signal $ac_signal"
$as_echo "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
$as_echo "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_URL "$PACKAGE_URL"
_ACEOF
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
# We do not want a PATH search for config.site.
case $CONFIG_SITE in #((
-*) ac_site_file1=./$CONFIG_SITE;;
*/*) ac_site_file1=$CONFIG_SITE;;
*) ac_site_file1=./$CONFIG_SITE;;
esac
elif test "x$prefix" != xNONE; then
ac_site_file1=$prefix/share/config.site
ac_site_file2=$prefix/etc/config.site
else
ac_site_file1=$ac_default_prefix/share/config.site
ac_site_file2=$ac_default_prefix/etc/config.site
fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
test "x$ac_site_file" = xNONE && continue
if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
|| { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
done
if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
$as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val=\$ac_cv_env_${ac_var}_value
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
# differences in whitespace do not lead to failure.
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
*) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
## -------------------- ##
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers defines.h"
# Checks for programs.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
if test $# != 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
for ac_prog in cl.exe
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
for ac_prog in cl.exe
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ac_ct_CC" && break
done
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
fi
fi
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
$as_echo_n "checking whether the C compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
* ) ac_rmfiles="$ac_rmfiles $ac_file";;
esac
done
rm -f $ac_rmfiles
if { { ac_try="$ac_link_default"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
# so that the user can short-circuit this test for compilers unknown to
# Autoconf.
for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
# We set ac_cv_exeext here because the later test for it is not
# safe: cross compilers may not add the suffix if given an `-o'
# argument, so we may need to know it at that point already.
# Even if this section looks crufty: it has the advantage of
# actually working.
break;;
* )
break;;
esac
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
else
ac_file=''
fi
if test -z "$ac_file"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
$as_echo_n "checking for C compiler default output file name... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
$as_echo_n "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
# `rm'.
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
esac
done
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
;
return 0;
}
_ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
$as_echo_n "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
if ${ac_cv_objext+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
if ${ac_cv_c_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if ${ac_cv_prog_cc_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
else
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-g"
fi
else
if test "$GCC" = yes; then
CFLAGS="-O2"
else
CFLAGS=
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not '\xHH' hex character constants.
These don't provoke an error unfortunately, instead are silently treated
as 'x'. The following induces an error, until -std is added to get
proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
array size at least. It's necessary to write '\x00'==0 to get something
that's true only with -std. */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
inside strings and character constants. */
#define FOO(x) 'x'
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
;
return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_c89=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
x)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
xno)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
$as_echo_n "checking for library containing strerror... " >&6; }
if ${ac_cv_search_strerror+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char strerror ();
int
main ()
{
return strerror ();
;
return 0;
}
_ACEOF
for ac_lib in '' cposix; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_strerror=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_strerror+:} false; then :
break
fi
done
if ${ac_cv_search_strerror+:} false; then :
else
ac_cv_search_strerror=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
$as_echo "$ac_cv_search_strerror" >&6; }
ac_res=$ac_cv_search_strerror
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if ${ac_cv_prog_CPP+:} false; then :
$as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
do
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer to if __STDC__ is defined, since
# exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
break
fi
done
ac_cv_prog_CPP=$CPP
fi
CPP=$ac_cv_prog_CPP
else
ac_cv_prog_CPP=$CPP
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
$as_echo "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer to if __STDC__ is defined, since
# exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$GREP"; then
ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo 'GREP' >> "conftest.nl"
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_GREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP="$ac_path_GREP"
ac_path_GREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_GREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_GREP"; then
as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
$as_echo "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
if ${ac_cv_path_EGREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
if test -z "$EGREP"; then
ac_path_EGREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in egrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo 'EGREP' >> "conftest.nl"
"$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_EGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_EGREP="$ac_path_EGREP"
ac_path_EGREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_EGREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_EGREP"; then
as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_EGREP=$EGREP
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
$as_echo "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
if test $ac_cv_c_compiler_gnu = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
$as_echo_n "checking whether $CC needs -traditional... " >&6; }
if ${ac_cv_prog_gcc_traditional+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_pattern="Autoconf.*'x'"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
Autoconf TIOCGETP
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "$ac_pattern" >/dev/null 2>&1; then :
ac_cv_prog_gcc_traditional=yes
else
ac_cv_prog_gcc_traditional=no
fi
rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
Autoconf TCGETA
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "$ac_pattern" >/dev/null 2>&1; then :
ac_cv_prog_gcc_traditional=yes
fi
rm -f conftest*
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
if test $ac_cv_prog_gcc_traditional = yes; then
CC="$CC -traditional"
fi
fi
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f "$ac_dir/install.sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
elif test -f "$ac_dir/shtool"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
# and are intended to be withdrawn in a future Autoconf release.
# They can cause serious problems if a builder's source tree is in a directory
# whose full name contains unusual characters.
ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if ${ac_cv_path_install+:} false; then :
$as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
# Account for people who put trailing slashes in PATH elements.
case $as_dir/ in #((
./ | .// | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# Don't use installbsd from OSF since it installs stuff as root
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
rm -rf conftest.one conftest.two conftest.dir
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
break 3
fi
fi
fi
done
done
;;
esac
done
IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
# value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
$as_echo "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Checks for compilation model.
# Check whether --enable-largefile was given.
if test "${enable_largefile+set}" = set; then :
enableval=$enable_largefile;
fi
if test "$enable_largefile" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
if ${ac_cv_sys_largefile_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_sys_largefile_CC=no
if test "$GCC" != yes; then
ac_save_CC=$CC
while :; do
# IRIX 6.2 and later do not support large files by default,
# so use the C compiler's -n32 option if that helps.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
break
fi
rm -f core conftest.err conftest.$ac_objext
CC="$CC -n32"
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sys_largefile_CC=' -n32'; break
fi
rm -f core conftest.err conftest.$ac_objext
break
done
CC=$ac_save_CC
rm -f conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
$as_echo "$ac_cv_sys_largefile_CC" >&6; }
if test "$ac_cv_sys_largefile_CC" != no; then
CC=$CC$ac_cv_sys_largefile_CC
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
if ${ac_cv_sys_file_offset_bits+:} false; then :
$as_echo_n "(cached) " >&6
else
while :; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sys_file_offset_bits=no; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#define _FILE_OFFSET_BITS 64
#include
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sys_file_offset_bits=64; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_sys_file_offset_bits=unknown
break
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
case $ac_cv_sys_file_offset_bits in #(
no | unknown) ;;
*)
cat >>confdefs.h <<_ACEOF
#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
_ACEOF
;;
esac
rm -rf conftest*
if test $ac_cv_sys_file_offset_bits = unknown; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
if ${ac_cv_sys_large_files+:} false; then :
$as_echo_n "(cached) " >&6
else
while :; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sys_large_files=no; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#define _LARGE_FILES 1
#include
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sys_large_files=1; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_sys_large_files=unknown
break
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
$as_echo "$ac_cv_sys_large_files" >&6; }
case $ac_cv_sys_large_files in #(
no | unknown) ;;
*)
cat >>confdefs.h <<_ACEOF
#define _LARGE_FILES $ac_cv_sys_large_files
_ACEOF
;;
esac
rm -rf conftest*
fi
fi
# Checks for general libraries.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgoto in -ltinfo" >&5
$as_echo_n "checking for tgoto in -ltinfo... " >&6; }
if ${ac_cv_lib_tinfo_tgoto+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ltinfo $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char tgoto ();
int
main ()
{
return tgoto ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_tinfo_tgoto=yes
else
ac_cv_lib_tinfo_tgoto=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgoto" >&5
$as_echo "$ac_cv_lib_tinfo_tgoto" >&6; }
if test "x$ac_cv_lib_tinfo_tgoto" = xyes; then :
have_tinfo=yes
else
have_tinfo=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgoto in -ltinfow" >&5
$as_echo_n "checking for tgoto in -ltinfow... " >&6; }
if ${ac_cv_lib_tinfow_tgoto+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ltinfow $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char tgoto ();
int
main ()
{
return tgoto ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_tinfow_tgoto=yes
else
ac_cv_lib_tinfow_tgoto=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfow_tgoto" >&5
$as_echo "$ac_cv_lib_tinfow_tgoto" >&6; }
if test "x$ac_cv_lib_tinfow_tgoto" = xyes; then :
have_tinfow=yes
else
have_tinfow=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lxcurses" >&5
$as_echo_n "checking for initscr in -lxcurses... " >&6; }
if ${ac_cv_lib_xcurses_initscr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lxcurses $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char initscr ();
int
main ()
{
return initscr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_xcurses_initscr=yes
else
ac_cv_lib_xcurses_initscr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xcurses_initscr" >&5
$as_echo "$ac_cv_lib_xcurses_initscr" >&6; }
if test "x$ac_cv_lib_xcurses_initscr" = xyes; then :
have_xcurses=yes
else
have_xcurses=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncursesw" >&5
$as_echo_n "checking for initscr in -lncursesw... " >&6; }
if ${ac_cv_lib_ncursesw_initscr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncursesw $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char initscr ();
int
main ()
{
return initscr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_ncursesw_initscr=yes
else
ac_cv_lib_ncursesw_initscr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_initscr" >&5
$as_echo "$ac_cv_lib_ncursesw_initscr" >&6; }
if test "x$ac_cv_lib_ncursesw_initscr" = xyes; then :
have_ncursesw=yes
else
have_ncursesw=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5
$as_echo_n "checking for initscr in -lncurses... " >&6; }
if ${ac_cv_lib_ncurses_initscr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncurses $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char initscr ();
int
main ()
{
return initscr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_ncurses_initscr=yes
else
ac_cv_lib_ncurses_initscr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5
$as_echo "$ac_cv_lib_ncurses_initscr" >&6; }
if test "x$ac_cv_lib_ncurses_initscr" = xyes; then :
have_ncurses=yes
else
have_ncurses=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lcurses" >&5
$as_echo_n "checking for initscr in -lcurses... " >&6; }
if ${ac_cv_lib_curses_initscr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcurses $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char initscr ();
int
main ()
{
return initscr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_curses_initscr=yes
else
ac_cv_lib_curses_initscr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_initscr" >&5
$as_echo "$ac_cv_lib_curses_initscr" >&6; }
if test "x$ac_cv_lib_curses_initscr" = xyes; then :
have_curses=yes
else
have_curses=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5
$as_echo_n "checking for tgetent in -ltermcap... " >&6; }
if ${ac_cv_lib_termcap_tgetent+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ltermcap $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char tgetent ();
int
main ()
{
return tgetent ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_termcap_tgetent=yes
else
ac_cv_lib_termcap_tgetent=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tgetent" >&5
$as_echo "$ac_cv_lib_termcap_tgetent" >&6; }
if test "x$ac_cv_lib_termcap_tgetent" = xyes; then :
have_termcap=yes
else
have_termcap=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermlib" >&5
$as_echo_n "checking for tgetent in -ltermlib... " >&6; }
if ${ac_cv_lib_termlib_tgetent+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ltermlib $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char tgetent ();
int
main ()
{
return tgetent ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_termlib_tgetent=yes
else
ac_cv_lib_termlib_tgetent=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termlib_tgetent" >&5
$as_echo "$ac_cv_lib_termlib_tgetent" >&6; }
if test "x$ac_cv_lib_termlib_tgetent" = xyes; then :
have_termlib=yes
else
have_termlib=no
fi
# Regular expressions (regcmp) are in -lgen on Solaris 2, (but in libc
# at least on Solaris 10 (2.10)) and in -lintl on SCO Unix.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing regcmp" >&5
$as_echo_n "checking for library containing regcmp... " >&6; }
if ${ac_cv_search_regcmp+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char regcmp ();
int
main ()
{
return regcmp ();
;
return 0;
}
_ACEOF
for ac_lib in '' gen intl PW; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_regcmp=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_regcmp+:} false; then :
break
fi
done
if ${ac_cv_search_regcmp+:} false; then :
else
ac_cv_search_regcmp=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_regcmp" >&5
$as_echo "$ac_cv_search_regcmp" >&6; }
ac_res=$ac_cv_search_regcmp
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
-# Checks for terminal libraries
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working terminal libraries" >&5
-$as_echo_n "checking for working terminal libraries... " >&6; }
-TERMLIBS=
-
-# Check for systems where curses is broken.
-curses_broken=0
-if test x`uname -s` = "xHP-UX" >/dev/null 2>&1; then
-if test x`uname -r` = "xB.11.00" >/dev/null 2>&1; then
- curses_broken=1
-fi
-if test x`uname -r` = "xB.11.11" >/dev/null 2>&1; then
- curses_broken=1
-fi
-fi
-
-if test $curses_broken = 0; then
-
-# -- Try tinfo.
-if test "x$TERMLIBS" = x; then
- if test $have_tinfo = yes; then
- TERMLIBS="-ltinfo"
- SAVE_LIBS=$LIBS
- LIBS="$LIBS $TERMLIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+# Checks for header files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include
+#include
+#include
+#include
int
main ()
{
-tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- termok=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
else
- termok=no
+ ac_cv_header_stdc=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS=$SAVE_LIBS
- if test $termok = no; then TERMLIBS=""; fi
- fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
fi
+rm -f conftest*
-# -- Try tinfow.
-if test "x$TERMLIBS" = x; then
- if test $have_tinfow = yes; then
- TERMLIBS="-ltinfow"
- SAVE_LIBS=$LIBS
- LIBS="$LIBS $TERMLIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include
-int
-main ()
-{
-tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
- ;
- return 0;
-}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- termok=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
else
- termok=no
+ ac_cv_header_stdc=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS=$SAVE_LIBS
- if test $termok = no; then TERMLIBS=""; fi
- fi
+rm -f conftest*
+
fi
-# -- Try xcurses.
-if test "x$TERMLIBS" = x; then
- if test $have_xcurses = yes; then
- TERMLIBS="-lxcurses"
- SAVE_LIBS=$LIBS
- LIBS="$LIBS $TERMLIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include
+#include
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
-tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
- ;
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- termok=yes
+if ac_fn_c_try_run "$LINENO"; then :
+
else
- termok=no
+ ac_cv_header_stdc=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS=$SAVE_LIBS
- if test $termok = no; then TERMLIBS=""; fi
- fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-# -- Try ncursesw.
-if test "x$TERMLIBS" = x; then
- if test $have_ncursesw = yes; then
- TERMLIBS="-lncursesw"
- SAVE_LIBS=$LIBS
- LIBS="$LIBS $TERMLIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in ctype.h errno.h fcntl.h limits.h stdio.h stdlib.h string.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h wctype.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
+$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
+if ${ac_cv_header_stat_broken+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+#include
+
+#if defined S_ISBLK && defined S_IFDIR
+extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
+#endif
+
+#if defined S_ISBLK && defined S_IFCHR
+extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
+#endif
+
+#if defined S_ISLNK && defined S_IFREG
+extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
+#endif
+
+#if defined S_ISSOCK && defined S_IFREG
+extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stat_broken=no
+else
+ ac_cv_header_stat_broken=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
+$as_echo "$ac_cv_header_stat_broken" >&6; }
+if test $ac_cv_header_stat_broken = yes; then
+
+$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
-tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
+
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this sort of thing. */
+ typedef int charset[2];
+ const charset cs = { 0, 0 };
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this sort of thing. */
+ char tx;
+ char *t = &tx;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; } bx;
+ struct s *b = &bx; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- termok=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
else
- termok=no
+ ac_cv_c_const=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS=$SAVE_LIBS
- if test $termok = no; then TERMLIBS=""; fi
- fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
-# -- Try ncurses.
-if test "x$TERMLIBS" = x; then
- if test $have_ncurses = yes; then
- TERMLIBS="-lncurses"
- SAVE_LIBS=$LIBS
- LIBS="$LIBS $TERMLIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
+#include
+#include
+#include
+
int
main ()
{
-tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
+if ((struct tm *) 0)
+return 0;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- termok=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
else
- termok=no
+ ac_cv_header_time=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS=$SAVE_LIBS
- if test $termok = no; then TERMLIBS=""; fi
- fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
-# -- Try curses.
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+
+# Checks for terminal libraries
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working terminal libraries" >&5
+$as_echo_n "checking for working terminal libraries... " >&6; }
+TERMLIBS=
+include_termcap_h=
+if test "x$ac_cv_header_termcap_h" = xyes; then include_termcap_h="#include "; fi
+
+# Check for systems where curses is broken.
+curses_broken=0
+if test x`uname -s` = "xHP-UX" >/dev/null 2>&1; then
+if test x`uname -r` = "xB.11.00" >/dev/null 2>&1; then
+ curses_broken=1
+fi
+if test x`uname -r` = "xB.11.11" >/dev/null 2>&1; then
+ curses_broken=1
+fi
+fi
+
+if test $curses_broken = 0; then
+
+# -- Try tinfo.
if test "x$TERMLIBS" = x; then
- if test $have_curses = yes; then
- TERMLIBS="-lcurses"
+ if test $have_tinfo = yes; then
+ TERMLIBS="-ltinfo"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
+$include_termcap_h
int
main ()
{
tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
termok=yes
else
termok=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
fi
-# -- Try curses & termcap.
+# -- Try tinfow.
if test "x$TERMLIBS" = x; then
- if test $have_curses = yes; then
- if test $have_termcap = yes; then
- TERMLIBS="-lcurses -ltermcap"
+ if test $have_tinfow = yes; then
+ TERMLIBS="-ltinfow"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
+$include_termcap_h
int
main ()
{
tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
termok=yes
else
termok=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
- fi
-fi
fi
-# -- Try termcap.
+# -- Try xcurses.
if test "x$TERMLIBS" = x; then
- if test $have_termcap = yes; then
- TERMLIBS="-ltermcap"
+ if test $have_xcurses = yes; then
+ TERMLIBS="-lxcurses"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
+$include_termcap_h
int
main ()
{
tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
termok=yes
else
termok=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
fi
-# -- Try termlib.
+# -- Try ncursesw.
if test "x$TERMLIBS" = x; then
- if test $have_termlib = yes; then
- TERMLIBS="-lcurses -ltermlib"
+ if test $have_ncursesw = yes; then
+ TERMLIBS="-lncursesw"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
+$include_termcap_h
int
main ()
{
tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
termok=yes
else
termok=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS=$SAVE_LIBS
- if test $termok = no; then TERMLIBS=""; fi
- fi
-fi
-
-if test "x$TERMLIBS" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Cannot find terminal libraries - configure failed" >&5
-$as_echo "Cannot find terminal libraries - configure failed" >&6; }
- exit 1
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using $TERMLIBS" >&5
-$as_echo "using $TERMLIBS" >&6; }
-LIBS="$LIBS $TERMLIBS"
-
-# Checks for header files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-#include
-#include
-#include
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-#include
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in ctype.h errno.h fcntl.h limits.h stdio.h stdlib.h string.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h wctype.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-# Checks for typedefs, structures, and compiler characteristics.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
-$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
-if ${ac_cv_header_stat_broken+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-#include
-
-#if defined S_ISBLK && defined S_IFDIR
-extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
-#endif
-
-#if defined S_ISBLK && defined S_IFCHR
-extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
-#endif
-
-#if defined S_ISLNK && defined S_IFREG
-extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
-#endif
-
-#if defined S_ISSOCK && defined S_IFREG
-extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
-#endif
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$SAVE_LIBS
+ if test $termok = no; then TERMLIBS=""; fi
+ fi
+fi
+# -- Try ncurses.
+if test "x$TERMLIBS" = x; then
+ if test $have_ncurses = yes; then
+ TERMLIBS="-lncurses"
+ SAVE_LIBS=$LIBS
+ LIBS="$LIBS $TERMLIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$include_termcap_h
+int
+main ()
+{
+tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
+ ;
+ return 0;
+}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stat_broken=no
+if ac_fn_c_try_link "$LINENO"; then :
+ termok=yes
else
- ac_cv_header_stat_broken=yes
+ termok=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$SAVE_LIBS
+ if test $termok = no; then TERMLIBS=""; fi
+ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
-$as_echo "$ac_cv_header_stat_broken" >&6; }
-if test $ac_cv_header_stat_broken = yes; then
-
-$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
+# -- Try curses.
+if test "x$TERMLIBS" = x; then
+ if test $have_curses = yes; then
+ TERMLIBS="-lcurses"
+ SAVE_LIBS=$LIBS
+ LIBS="$LIBS $TERMLIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$include_termcap_h
+int
+main ()
+{
+tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ termok=yes
+else
+ termok=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$SAVE_LIBS
+ if test $termok = no; then TERMLIBS=""; fi
+ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+# -- Try curses & termcap.
+if test "x$TERMLIBS" = x; then
+ if test $have_curses = yes; then
+ if test $have_termcap = yes; then
+ TERMLIBS="-lcurses -ltermcap"
+ SAVE_LIBS=$LIBS
+ LIBS="$LIBS $TERMLIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
+$include_termcap_h
int
main ()
{
-
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this sort of thing. */
- typedef int charset[2];
- const charset cs = { 0, 0 };
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *pcpcc;
- char **ppc;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- pcpcc = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++pcpcc;
- ppc = (char**) pcpcc;
- pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this sort of thing. */
- char tx;
- char *t = &tx;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- if (s) return 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; } bx;
- struct s *b = &bx; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- if (!foo) return 0;
- }
- return !cs[0] && !zero.x;
-#endif
-
+tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_const=yes
+if ac_fn_c_try_link "$LINENO"; then :
+ termok=yes
else
- ac_cv_c_const=no
+ termok=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$SAVE_LIBS
+ if test $termok = no; then TERMLIBS=""; fi
+ fi
+ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
-
fi
-ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define off_t long int
+# -- Try termcap.
+if test "x$TERMLIBS" = x; then
+ if test $have_termcap = yes; then
+ TERMLIBS="-ltermcap"
+ SAVE_LIBS=$LIBS
+ LIBS="$LIBS $TERMLIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$include_termcap_h
+int
+main ()
+{
+tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
+ ;
+ return 0;
+}
_ACEOF
-
-fi
-
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
-
+if ac_fn_c_try_link "$LINENO"; then :
+ termok=yes
else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
+ termok=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$SAVE_LIBS
+ if test $termok = no; then TERMLIBS=""; fi
+ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
-$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if ${ac_cv_header_time+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+# -- Try termlib.
+if test "x$TERMLIBS" = x; then
+ if test $have_termlib = yes; then
+ TERMLIBS="-lcurses -ltermlib"
+ SAVE_LIBS=$LIBS
+ LIBS="$LIBS $TERMLIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include
-#include
-#include
-
+$include_termcap_h
int
main ()
{
-if ((struct tm *) 0)
-return 0;
+tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_time=yes
+if ac_fn_c_try_link "$LINENO"; then :
+ termok=yes
else
- ac_cv_header_time=no
+ termok=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$SAVE_LIBS
+ if test $termok = no; then TERMLIBS=""; fi
+ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
-$as_echo "$ac_cv_header_time" >&6; }
-if test $ac_cv_header_time = yes; then
-
-$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+if test "x$TERMLIBS" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Cannot find terminal libraries - configure failed" >&5
+$as_echo "Cannot find terminal libraries - configure failed" >&6; }
+ exit 1
fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using $TERMLIBS" >&5
+$as_echo "using $TERMLIBS" >&6; }
+LIBS="$LIBS $TERMLIBS"
# Autoheader templates for symbols defined later by AC_DEFINE.
+
# Checks for identifiers.
ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
if test "x$ac_cv_type_off_t" = xyes; then :
else
cat >>confdefs.h <<_ACEOF
#define off_t long int
_ACEOF
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for void" >&5
$as_echo_n "checking for void... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
void *foo = 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_VOID 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for const" >&5
$as_echo_n "checking for const... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
const int foo = 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_CONST 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for time_t" >&5
$as_echo_n "checking for time_t... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
time_t t = 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_TIME_T 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_ino in struct stat" >&5
$as_echo_n "checking for st_ino in struct stat... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main ()
{
struct stat s; dev_t dev = s.st_dev; ino_t ino = s.st_ino;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_STAT_INO 1" >>confdefs.h
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for procfs" >&5
+$as_echo_n "checking for procfs... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+int
+main ()
+{
+struct statfs s; s.f_type = PROC_SUPER_MAGIC; (void) fstatfs(0,&s);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }; $as_echo "#define HAVE_PROCFS 1" >>confdefs.h
+
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Checks for ANSI function prototypes.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI function prototypes" >&5
$as_echo_n "checking for ANSI function prototypes... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
int f(int a) { return a; }
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_ANSI_PROTOS 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Checks for library functions.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
$as_echo_n "checking return type of signal handlers... " >&6; }
if ${ac_cv_type_signal+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main ()
{
return *(signal (0, 0)) (0) == 1;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_type_signal=int
else
ac_cv_type_signal=void
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
$as_echo "$ac_cv_type_signal" >&6; }
cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
_ACEOF
for ac_func in fchmod fsync nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat system ttyname usleep
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
# AC_CHECK_FUNCS may not work for inline functions, so test these separately.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for memcpy" >&5
$as_echo_n "checking for memcpy... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if HAVE_STRING_H
#include
#endif
int
main ()
{
memcpy(0,0,0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_MEMCPY 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strchr" >&5
$as_echo_n "checking for strchr... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if HAVE_STRING_H
#include
#endif
int
main ()
{
strchr("x",'x');
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_STRCHR 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strstr" >&5
$as_echo_n "checking for strstr... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if HAVE_STRING_H
#include
#endif
int
main ()
{
strstr("x","x");
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_STRSTR 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
# Some systems have termios.h but not the corresponding functions.
ac_fn_c_check_func "$LINENO" "tcgetattr" "ac_cv_func_tcgetattr"
if test "x$ac_cv_func_tcgetattr" = xyes; then :
$as_echo "#define HAVE_TERMIOS_FUNCS 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fileno" >&5
$as_echo_n "checking for fileno... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if HAVE_STDIO_H
#include
#endif
int
main ()
{
static int x; x = fileno(stdin);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_FILENO 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror" >&5
$as_echo_n "checking for strerror... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if HAVE_STDIO_H
#include
#endif
#if HAVE_STRING_H
#include
#endif
#if HAVE_ERRNO_H
#include
#endif
int
main ()
{
static char *x; x = strerror(0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_STRERROR 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys_errlist" >&5
$as_echo_n "checking for sys_errlist... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
extern char *sys_errlist[]; static char **x; x = sys_errlist;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_SYS_ERRLIST 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "#include
"
if test "x$ac_cv_type_sigset_t" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SIGSET_T 1
_ACEOF
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigemptyset" >&5
$as_echo_n "checking for sigemptyset... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
sigset_t s; sigemptyset(&s);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_SIGEMPTYSET 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
have_errno=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno" >&5
$as_echo_n "checking for errno... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if HAVE_ERRNO_H
#include
#endif
int
main ()
{
static int x; x = errno;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - in errno.h" >&5
$as_echo "yes - in errno.h" >&6; }; $as_echo "#define HAVE_ERRNO 1" >>confdefs.h
have_errno=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test $have_errno = no; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if HAVE_ERRNO_H
#include
#endif
int
main ()
{
extern int errno; static int x; x = errno;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - must define" >&5
$as_echo "yes - must define" >&6; }; $as_echo "#define HAVE_ERRNO 1" >>confdefs.h
$as_echo "#define MUST_DEFINE_ERRNO 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale" >&5
$as_echo_n "checking for locale... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#include
int
main ()
{
setlocale(LC_CTYPE,""); isprint(0); iscntrl(0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_LOCALE 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctype functions" >&5
$as_echo_n "checking for ctype functions... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if HAVE_CTYPE_H
#include
#endif
int
main ()
{
static int x; x = isupper(x); x = tolower(x); x = toupper(x);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_UPPER_LOWER 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype functions" >&5
$as_echo_n "checking for wctype functions... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
iswlower(0); iswupper(0); towlower(0); towupper(0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_WCTYPE 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
# Checks for external variable ospeed in the termcap library.
have_ospeed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking termcap for ospeed" >&5
$as_echo_n "checking termcap for ospeed... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#if HAVE_TERMIOS_H
#include
#endif
#if HAVE_TERMCAP_H
#include
#endif
int
main ()
{
ospeed = 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - in termcap.h" >&5
$as_echo "yes - in termcap.h" >&6; }; $as_echo "#define HAVE_OSPEED 1" >>confdefs.h
have_ospeed=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test $have_ospeed = no; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
extern short ospeed; ospeed = 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - must define" >&5
$as_echo "yes - must define" >&6; }; $as_echo "#define HAVE_OSPEED 1" >>confdefs.h
$as_echo "#define MUST_DEFINE_OSPEED 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
# Compile in secure mode?
# Check whether --with-secure was given.
if test "${with_secure+set}" = set; then :
withval=$with_secure; $as_echo "#define SECURE_COMPILE 1" >>confdefs.h
SECURE_COMPILE=1
else
$as_echo "#define SECURE_COMPILE 0" >>confdefs.h
SECURE_COMPILE=0
fi
# Should we use floating point?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floating point" >&5
$as_echo_n "checking for floating point... " >&6; }
# Check whether --with-no-float was given.
if test "${with_no_float+set}" = set; then :
withval=$with_no_float; WANT_NO_FLOAT=1
else
WANT_NO_FLOAT=0
fi
if test $WANT_NO_FLOAT = 0; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
double f1 = 12.5; double f2 = f1*f1/2.5;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_FLOAT 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled by user" >&5
$as_echo "disabled by user" >&6; }
fi
# Checks for regular expression functions.
have_regex=no
have_posix_regex=unknown
supported_regex=""
# Select a regular expression library.
WANT_REGEX=auto
# Check whether --with-regex was given.
if test "${with_regex+set}" = set; then :
withval=$with_regex; WANT_REGEX="$withval"
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then
# Some versions of Solaris have a regcomp() function, but it doesn't work!
# So we run a test program. If we're cross-compiling, do it the old way.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX regcomp" >&5
$as_echo_n "checking for POSIX regcomp... " >&6; }
if test "$cross_compiling" = yes; then :
have_posix_regex=unknown
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
-main() { regex_t r; regmatch_t rm; char *text = "xabcy";
-if (regcomp(&r, "abc", 0)) exit(1);
-if (regexec(&r, text, 1, &rm, 0)) exit(1);
+int main() { regex_t r; regmatch_t rm; char *text = "xabcy";
+if (regcomp(&r, "abc", 0)) return (1);
+if (regexec(&r, text, 1, &rm, 0)) return (1);
#ifndef __WATCOMC__
-if (rm.rm_so != 1) exit(1); /* check for correct offset */
+if (rm.rm_so != 1) return (1); /* check for correct offset */
#else
-if (rm.rm_sp != text + 1) exit(1); /* check for correct offset */
+if (rm.rm_sp != text + 1) return (1); /* check for correct offset */
#endif
-exit(0); }
+return (0); }
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
have_posix_regex=yes
else
have_posix_regex=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
if test $have_posix_regex = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h
supported_regex="$supported_regex posix"
have_regex=yes
elif test $have_posix_regex = unknown; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main ()
{
regex_t *r; regfree(r);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h
have_regex=yes; supported_regex="$supported_regex posix"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = pcre2; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre2_compile_8 in -lpcre2-8" >&5
$as_echo_n "checking for pcre2_compile_8 in -lpcre2-8... " >&6; }
if ${ac_cv_lib_pcre2_8_pcre2_compile_8+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpcre2-8 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char pcre2_compile_8 ();
int
main ()
{
return pcre2_compile_8 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_pcre2_8_pcre2_compile_8=yes
else
ac_cv_lib_pcre2_8_pcre2_compile_8=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre2_8_pcre2_compile_8" >&5
$as_echo "$ac_cv_lib_pcre2_8_pcre2_compile_8" >&6; }
if test "x$ac_cv_lib_pcre2_8_pcre2_compile_8" = xyes; then :
$as_echo "#define HAVE_PCRE2 1" >>confdefs.h
LIBS="$LIBS -lpcre2-8" have_regex=yes; supported_regex="$supported_regex pcre2"
fi
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5
$as_echo_n "checking for pcre_compile in -lpcre... " >&6; }
if ${ac_cv_lib_pcre_pcre_compile+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpcre $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char pcre_compile ();
int
main ()
{
return pcre_compile ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_pcre_pcre_compile=yes
else
ac_cv_lib_pcre_pcre_compile=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5
$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; }
if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then :
$as_echo "#define HAVE_PCRE 1" >>confdefs.h
LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre"
fi
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5
$as_echo_n "checking for re_compile_pattern in -lc... " >&6; }
if ${ac_cv_lib_c_re_compile_pattern+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lc $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char re_compile_pattern ();
int
main ()
{
return re_compile_pattern ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_c_re_compile_pattern=yes
else
ac_cv_lib_c_re_compile_pattern=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5
$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; }
if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then :
$as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h
have_regex=yes; supported_regex="$supported_regex gnu"
fi
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then
ac_fn_c_check_func "$LINENO" "regcmp" "ac_cv_func_regcmp"
if test "x$ac_cv_func_regcmp" = xyes; then :
$as_echo "#define HAVE_REGCMP 1" >>confdefs.h
have_regex=yes; supported_regex="$supported_regex regcmp"
fi
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V8 regcomp" >&5
$as_echo_n "checking for V8 regcomp... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "regexp.h"
int
main ()
{
regcomp("");
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h
have_regex=yes; supported_regex="$supported_regex regcomp"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
fi
if test $have_regex = no && test -f ${srcdir}/regexp.c; then
if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp -- local source" >&5
$as_echo "using V8 regcomp -- local source" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h
supported_regex="$supported_regex regcomp-local"
$as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h
REGEX_O='regexp.$(O)' have_regex=yes
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_comp" >&5
$as_echo_n "checking for re_comp... " >&6; }
ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp"
if test "x$ac_cv_func_re_comp" = xyes; then :
$as_echo "#define HAVE_RE_COMP 1" >>confdefs.h
have_regex=yes; supported_regex="$supported_regex re_comp"
fi
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = none; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using no regex" >&5
$as_echo "using no regex" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find regular expression library" >&5
$as_echo "$as_me: WARNING: cannot find regular expression library" >&2;}
fi
$as_echo "#define NO_REGEX 1" >>confdefs.h
supported_regex="$supported_regex none"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: regular expression library: $supported_regex" >&5
$as_echo "regular expression library: $supported_regex" >&6; }
# Check whether --with-editor was given.
if test "${with_editor+set}" = set; then :
withval=$with_editor; cat >>confdefs.h <<_ACEOF
#define EDIT_PGM "$withval"
_ACEOF
else
$as_echo "#define EDIT_PGM \"vi\"" >>confdefs.h
fi
ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems. If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.
_ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes: double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
) |
sed '
/^ac_cv_env_/b end
t clear
:clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
case $cache_file in #(
*/* | ?:*)
mv -f confcache "$cache_file"$$ &&
mv -f "$cache_file"$$ "$cache_file" ;; #(
*)
mv -f confcache "$cache_file" ;;
esac
fi
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
DEFS=-DHAVE_CONFIG_H
ac_libobjs=
ac_ltlibobjs=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 6>&1
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
_ASEOF
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by less $as_me 1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
on `(hostname || uname -n) 2>/dev/null | sed 1q`
"
_ACEOF
case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac
case $ac_config_headers in *"
"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
esac
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration. Unless the files
and actions are specified as TAGs, all are instantiated by default.
Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
--config print configuration, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
instantiate the configuration file FILE
--header=FILE[:TEMPLATE]
instantiate the configuration header FILE
Configuration files:
$config_files
Configuration headers:
$config_headers
Report bugs to the package provider."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
less config.status 1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
test -n "\$AWK" || AWK=awk
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
--*=)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=
ac_shift=:
;;
*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
esac
case $ac_option in
# Handling of the options.
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
$as_echo "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
$as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--header | --heade | --head | --hea )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
as_fn_append CONFIG_HEADERS " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
as_fn_error $? "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
--help | --hel | -h )
$as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
-*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
esac
shift
done
ac_configure_extra_args=
if $ac_cs_silent; then
exec 6>/dev/null
ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
fi
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
$as_echo "$ac_log"
} >&5
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"defines.h") CONFIG_HEADERS="$CONFIG_HEADERS defines.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
fi
# Have a temporary directory for convenience. Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
tmp= ac_tmp=
trap 'exit_status=$?
: "${ac_tmp:=$tmp}"
{ test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
{
echo "cat >conf$$subs.awk <<_ACEOF" &&
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
s/^/S["/; s/!.*/"]=/
p
g
s/^[^!]*!//
:repl
t repl
s/'"$ac_delim"'$//
t delim
:nl
h
s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
n
b repl
:more1
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t nl
:delim
h
s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
b
:more2
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t delim
' >$CONFIG_STATUS || ac_write_fail=1
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
}
{
line = $ 0
nfields = split(line, field, "@")
substed = 0
len = length(field[1])
for (i = 2; i < nfields; i++) {
key = field[i]
keylen = length(key)
if (S_is_set[key]) {
value = S[key]
line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
len += length(value) + length(field[++i])
substed = 1
} else
len += 1 + keylen
}
print line
}
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
h
s///
s/^/:/
s/[ ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[ ]*\).*/\1/
G
s/\n//
s/^[^=]*=[ ]*$//
}'
fi
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
# Set up the scripts for CONFIG_HEADERS section.
# No need to generate them if there are no CONFIG_HEADERS.
# This happens for instance with `./config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF
# Transform confdefs.h into an awk script `defines.awk', embedded as
# here-document in config.status, that substitutes the proper values into
# config.h.in to produce config.h.
# Create a delimiter string that does not exist in confdefs.h, to ease
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
if test -z "$ac_tt"; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
# For the awk script, D is an array of macro values keyed by name,
# likewise P contains macro parameters if any. Preserve backslash
# newline sequences.
ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
sed -n '
s/.\{148\}/&'"$ac_delim"'/g
t rset
:rset
s/^[ ]*#[ ]*define[ ][ ]*/ /
t def
d
:def
s/\\$//
t bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3"/p
s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
d
:bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3\\\\\\n"\\/p
t cont
s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
t cont
d
:cont
n
s/.\{148\}/&'"$ac_delim"'/g
t clear
:clear
s/\\$//
t bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/"/p
d
:bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
b cont
' >$CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
for (key in D) D_is_set[key] = 1
FS = ""
}
/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
line = \$ 0
split(line, arg, " ")
if (arg[1] == "#") {
defundef = arg[2]
mac1 = arg[3]
} else {
defundef = substr(arg[1], 2)
mac1 = arg[2]
}
split(mac1, mac2, "(") #)
macro = mac2[1]
prefix = substr(line, 1, index(line, defundef) - 1)
if (D_is_set[macro]) {
# Preserve the white space surrounding the "#".
print prefix "define", macro P[macro] D[macro]
next
} else {
# Replace #undef with comments. This is necessary, for example,
# in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
if (defundef == "undef") {
print "/*", prefix defundef, macro, "*/"
next
}
}
}
{ print }
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
fi # test -n "$CONFIG_HEADERS"
eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS "
shift
for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
ac_save_IFS=$IFS
IFS=:
set x $ac_tag
IFS=$ac_save_IFS
shift
ac_file=$1
shift
case $ac_mode in
:L) ac_source=$1;;
:[FH])
ac_file_inputs=
for ac_f
do
case $ac_f in
-) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
$as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
$as_echo "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
ac_sed_conf_input=`$as_echo "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
case $ac_tag in
*:-:* | *:-) cat >"$ac_tmp/stdin" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
case $ac_mode in
:F)
#
# CONFIG_FILE
#
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
ac_sed_dataroot='
/datarootdir/ {
p
q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
s&@infodir@&$infodir&g
s&@localedir@&$localedir&g
s&@mandir@&$mandir&g
s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
>$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
case $ac_file in
-) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
*) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
:H)
#
# CONFIG_HEADER
#
if test x"$ac_file" != x-; then
{
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
} >"$ac_tmp/config.h" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
mv "$ac_tmp/config.h" "$ac_file" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
;;
esac
done # for ac_tag
as_fn_exit 0
_ACEOF
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded. So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status. When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
ac_cs_success=:
ac_config_status_args=
test "$silent" = yes &&
ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
$SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
diff --git a/configure.ac b/configure.ac
index 21f550a1a609..f7c648142d43 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,737 +1,745 @@
# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1984-2011 Mark Nudelman
+# Copyright (C) 1984-2022 Mark Nudelman
#
# You may distribute under the terms of either the GNU General Public
# License or the Less License, as specified in the README file.
#
# For more information about less, or for information on how to
# contact the author, see the README file.
# Autoconf initialization.
AC_INIT(less, 1)
AC_CONFIG_SRCDIR([forwback.c])
AC_CONFIG_HEADER([defines.h])
# Checks for programs.
AC_PROG_CC
AC_ISC_POSIX
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
# Checks for compilation model.
AC_SYS_LARGEFILE
# Checks for general libraries.
AC_CHECK_LIB(tinfo, tgoto, [have_tinfo=yes], [have_tinfo=no])
AC_CHECK_LIB(tinfow, tgoto, [have_tinfow=yes], [have_tinfow=no])
AC_CHECK_LIB(xcurses, initscr, [have_xcurses=yes], [have_xcurses=no])
AC_CHECK_LIB(ncursesw, initscr, [have_ncursesw=yes], [have_ncursesw=no])
AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
AC_CHECK_LIB(curses, initscr, [have_curses=yes], [have_curses=no])
AC_CHECK_LIB(termcap, tgetent, [have_termcap=yes], [have_termcap=no])
AC_CHECK_LIB(termlib, tgetent, [have_termlib=yes], [have_termlib=no])
# Regular expressions (regcmp) are in -lgen on Solaris 2, (but in libc
# at least on Solaris 10 (2.10)) and in -lintl on SCO Unix.
AC_SEARCH_LIBS([regcmp], [gen intl PW])
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([ctype.h errno.h fcntl.h limits.h stdio.h stdlib.h string.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h wctype.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STAT
+AC_C_CONST
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+
# Checks for terminal libraries
AC_MSG_CHECKING([for working terminal libraries])
TERMLIBS=
+include_termcap_h=
+if test "x$ac_cv_header_termcap_h" = xyes; then include_termcap_h="#include "; fi
# Check for systems where curses is broken.
curses_broken=0
if test x`uname -s` = "xHP-UX" >/dev/null 2>&1; then
if test x`uname -r` = "xB.11.00" >/dev/null 2>&1; then
curses_broken=1
fi
if test x`uname -r` = "xB.11.11" >/dev/null 2>&1; then
curses_broken=1
fi
fi
if test $curses_broken = 0; then
# -- Try tinfo.
if test "x$TERMLIBS" = x; then
if test $have_tinfo = yes; then
TERMLIBS="-ltinfo"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
- AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
+ AC_TRY_LINK([$include_termcap_h], [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
[termok=yes], [termok=no])
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
fi
# -- Try tinfow.
if test "x$TERMLIBS" = x; then
if test $have_tinfow = yes; then
TERMLIBS="-ltinfow"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
- AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
+ AC_TRY_LINK([$include_termcap_h], [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
[termok=yes], [termok=no])
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
fi
# -- Try xcurses.
if test "x$TERMLIBS" = x; then
if test $have_xcurses = yes; then
TERMLIBS="-lxcurses"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
- AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
+ AC_TRY_LINK([$include_termcap_h], [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
[termok=yes], [termok=no])
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
fi
# -- Try ncursesw.
if test "x$TERMLIBS" = x; then
if test $have_ncursesw = yes; then
TERMLIBS="-lncursesw"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
- AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
+ AC_TRY_LINK([$include_termcap_h], [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
[termok=yes], [termok=no])
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
fi
# -- Try ncurses.
if test "x$TERMLIBS" = x; then
if test $have_ncurses = yes; then
TERMLIBS="-lncurses"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
- AC_TRY_LINK([#include ], [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
+ AC_TRY_LINK([$include_termcap_h], [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
[termok=yes], [termok=no])
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
fi
# -- Try curses.
if test "x$TERMLIBS" = x; then
if test $have_curses = yes; then
TERMLIBS="-lcurses"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
- AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
+ AC_TRY_LINK([$include_termcap_h], [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
[termok=yes], [termok=no])
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
fi
# -- Try curses & termcap.
if test "x$TERMLIBS" = x; then
if test $have_curses = yes; then
if test $have_termcap = yes; then
TERMLIBS="-lcurses -ltermcap"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
- AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
+ AC_TRY_LINK([$include_termcap_h], [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
[termok=yes], [termok=no])
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
fi
fi
fi
# -- Try termcap.
if test "x$TERMLIBS" = x; then
if test $have_termcap = yes; then
TERMLIBS="-ltermcap"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
- AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
+ AC_TRY_LINK([$include_termcap_h], [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
[termok=yes], [termok=no])
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
fi
# -- Try termlib.
if test "x$TERMLIBS" = x; then
if test $have_termlib = yes; then
TERMLIBS="-lcurses -ltermlib"
SAVE_LIBS=$LIBS
LIBS="$LIBS $TERMLIBS"
- AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
+ AC_TRY_LINK([$include_termcap_h], [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
[termok=yes], [termok=no])
LIBS=$SAVE_LIBS
if test $termok = no; then TERMLIBS=""; fi
fi
fi
if test "x$TERMLIBS" = x; then
AC_MSG_RESULT(Cannot find terminal libraries - configure failed)
exit 1
fi
AC_MSG_RESULT(using $TERMLIBS)
LIBS="$LIBS $TERMLIBS"
-# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([ctype.h errno.h fcntl.h limits.h stdio.h stdlib.h string.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h wctype.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_HEADER_STAT
-AC_C_CONST
-AC_TYPE_OFF_T
-AC_TYPE_SIZE_T
-AC_HEADER_TIME
-
# Autoheader templates for symbols defined later by AC_DEFINE.
AH_TEMPLATE([HAVE_GNU_REGEX],
[GNU regex library])
AH_TEMPLATE([HAVE_POSIX_REGCOMP],
[POSIX regcomp() and regex.h])
AH_TEMPLATE([HAVE_PCRE],
[PCRE (Perl-compatible regular expression) library])
AH_TEMPLATE([HAVE_PCRE2],
[PCRE2 (Perl-compatible regular expression) library])
AH_TEMPLATE([HAVE_RE_COMP],
[BSD re_comp()])
AH_TEMPLATE([HAVE_REGCMP],
[System V regcmp()])
AH_TEMPLATE([HAVE_V8_REGCOMP],
[Henry Spencer V8 regcomp() and regexp.h])
AH_TEMPLATE([NO_REGEX],
[pattern matching is supported, but without metacharacters.])
AH_TEMPLATE([HAVE_REGEXEC2],
[])
AH_TEMPLATE([HAVE_VOID],
[Define HAVE_VOID if your compiler supports the "void" type.])
AH_TEMPLATE([HAVE_FLOAT],
[Define HAVE_FLOAT if your compiler supports the "double" type.])
AH_TEMPLATE([HAVE_CONST],
[Define HAVE_CONST if your compiler supports the "const" modifier.])
AH_TEMPLATE([HAVE_STAT_INO],
[Define HAVE_STAT_INO if your struct stat has st_ino and st_dev.])
+AH_TEMPLATE([HAVE_PROCFS],
+ [Define HAVE_PROCFS if have have fstatfs with f_type and PROC_SUPER_MAGIC.])
AH_TEMPLATE([HAVE_TIME_T],
[Define HAVE_TIME_T if your system supports the "time_t" type.])
AH_TEMPLATE([HAVE_STRERROR],
[Define HAVE_STRERROR if you have the strerror() function.])
AH_TEMPLATE([HAVE_FILENO],
[Define HAVE_FILENO if you have the fileno() macro.])
AH_TEMPLATE([HAVE_ERRNO],
[Define HAVE_ERRNO if you have the errno variable.])
AH_TEMPLATE([MUST_DEFINE_ERRNO],
[Define MUST_DEFINE_ERRNO if you have errno but it is not define in errno.h.])
AH_TEMPLATE([HAVE_SYS_ERRLIST],
[Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable.])
AH_TEMPLATE([HAVE_OSPEED],
[Define HAVE_OSPEED if your termcap library has the ospeed variable.])
AH_TEMPLATE([MUST_DEFINE_OSPEED],
[Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined in termcap.h.])
AH_TEMPLATE([HAVE_LOCALE],
[Define HAVE_LOCALE if you have locale.h and setlocale.])
AH_TEMPLATE([HAVE_TERMIOS_FUNCS],
[Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr.])
AH_TEMPLATE([HAVE_UPPER_LOWER],
[Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower.])
AH_TEMPLATE([HAVE_WCTYPE],
[Define HAVE_WCTYPE if you have iswupper, iswlower, towupper, towlower.])
AH_TEMPLATE([HAVE_SIGSET_T],
[Define HAVE_SIGSET_T you have the sigset_t type.])
AH_TEMPLATE([HAVE_SIGEMPTYSET],
[Define HAVE_SIGEMPTYSET if you have the sigemptyset macro.])
AH_TEMPLATE([EDIT_PGM],
[Define EDIT_PGM to your editor.])
AH_TEMPLATE([SECURE_COMPILE],
[Define SECURE_COMPILE=1 to build a secure version of less.])
# Checks for identifiers.
AC_TYPE_OFF_T
AC_MSG_CHECKING(for void)
AC_TRY_COMPILE(, [void *foo = 0;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_VOID)], [AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for const)
AC_TRY_COMPILE(, [const int foo = 0;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_CONST)], [AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for time_t)
AC_TRY_COMPILE([#include ], [time_t t = 0;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIME_T)], [AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for st_ino in struct stat)
AC_TRY_COMPILE([#include
#include ],
[struct stat s; dev_t dev = s.st_dev; ino_t ino = s.st_ino;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STAT_INO)], [AC_MSG_RESULT(no)])
+AC_MSG_CHECKING(for procfs)
+AC_TRY_COMPILE([#include ],
+ [struct statfs s; s.f_type = PROC_SUPER_MAGIC; (void) fstatfs(0,&s); ],
+ [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PROCFS)], [AC_MSG_RESULT(no)])
# Checks for ANSI function prototypes.
AC_MSG_CHECKING(for ANSI function prototypes)
AC_TRY_COMPILE([], [int f(int a) { return a; }],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ANSI_PROTOS)], [AC_MSG_RESULT(no)])
# Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([fchmod fsync nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat system ttyname usleep])
# AC_CHECK_FUNCS may not work for inline functions, so test these separately.
AC_MSG_CHECKING(for memcpy)
AC_TRY_LINK([
#if HAVE_STRING_H
#include
#endif], [memcpy(0,0,0);],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MEMCPY)], [AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for strchr)
AC_TRY_LINK([
#if HAVE_STRING_H
#include
#endif], [strchr("x",'x');],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRCHR)], [AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for strstr)
AC_TRY_LINK([
#if HAVE_STRING_H
#include
#endif], [strstr("x","x");],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRSTR)], [AC_MSG_RESULT(no)])
# Some systems have termios.h but not the corresponding functions.
AC_CHECK_FUNC(tcgetattr, AC_DEFINE(HAVE_TERMIOS_FUNCS))
AC_MSG_CHECKING(for fileno)
AC_TRY_LINK([
#if HAVE_STDIO_H
#include
#endif], [static int x; x = fileno(stdin);],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FILENO)], [AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for strerror)
AC_TRY_LINK([
#if HAVE_STDIO_H
#include
#endif
#if HAVE_STRING_H
#include
#endif
#if HAVE_ERRNO_H
#include
#endif], [static char *x; x = strerror(0);],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)], [AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for sys_errlist)
AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)])
AC_CHECK_TYPES([sigset_t],,,[#include ])
AC_MSG_CHECKING(for sigemptyset)
AC_TRY_LINK([
#include
], [sigset_t s; sigemptyset(&s);],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SIGEMPTYSET)], [AC_MSG_RESULT(no)])
have_errno=no
AC_MSG_CHECKING(for errno)
AC_TRY_LINK([
#if HAVE_ERRNO_H
#include
#endif], [static int x; x = errno;],
[AC_MSG_RESULT(yes - in errno.h); AC_DEFINE(HAVE_ERRNO) have_errno=yes])
if test $have_errno = no; then
AC_TRY_LINK([
#if HAVE_ERRNO_H
#include
#endif], [extern int errno; static int x; x = errno;],
[AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_ERRNO) AC_DEFINE(MUST_DEFINE_ERRNO)],
[AC_MSG_RESULT(no)])
fi
AC_MSG_CHECKING(for locale)
AC_TRY_LINK([#include
#include
#include ], [setlocale(LC_CTYPE,""); isprint(0); iscntrl(0);],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_LOCALE)], [AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for ctype functions)
AC_TRY_LINK([
#if HAVE_CTYPE_H
#include
#endif], [static int x; x = isupper(x); x = tolower(x); x = toupper(x);],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UPPER_LOWER)], [AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for wctype functions)
AC_TRY_LINK([#include ], [iswlower(0); iswupper(0); towlower(0); towupper(0);],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_WCTYPE)], [AC_MSG_RESULT(no)])
# Checks for external variable ospeed in the termcap library.
have_ospeed=no
AC_MSG_CHECKING(termcap for ospeed)
AC_TRY_LINK([
#include
#if HAVE_TERMIOS_H
#include
#endif
#if HAVE_TERMCAP_H
#include
#endif], [ospeed = 0;],
[AC_MSG_RESULT(yes - in termcap.h); AC_DEFINE(HAVE_OSPEED) have_ospeed=yes])
if test $have_ospeed = no; then
AC_TRY_LINK(, [extern short ospeed; ospeed = 0;],
[AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_OSPEED) AC_DEFINE(MUST_DEFINE_OSPEED)],
[AC_MSG_RESULT(no)])
fi
# Compile in secure mode?
AC_ARG_WITH(secure,
[ --with-secure Compile in secure mode],
AC_DEFINE(SECURE_COMPILE, 1)
AC_SUBST(SECURE_COMPILE,1), AC_DEFINE(SECURE_COMPILE, 0)
AC_SUBST(SECURE_COMPILE,0))
# Should we use floating point?
AC_MSG_CHECKING(for floating point)
AC_ARG_WITH(no-float,
[ --with-no-float Do not use floating point],
WANT_NO_FLOAT=1, WANT_NO_FLOAT=0)
if test $WANT_NO_FLOAT = 0; then
AC_TRY_LINK(, [double f1 = 12.5; double f2 = f1*f1/2.5;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT)], [AC_MSG_RESULT(no)])
else
AC_MSG_RESULT(disabled by user)
fi
# Checks for regular expression functions.
have_regex=no
have_posix_regex=unknown
supported_regex=""
# Select a regular expression library.
WANT_REGEX=auto
AC_ARG_WITH(regex,
[ --with-regex=LIB select regular expression library (LIB is one of auto,none,gnu,pcre,pcre2,posix,regcmp,re_comp,regcomp,regcomp-local) [[auto]]],
WANT_REGEX="$withval")
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then
# Some versions of Solaris have a regcomp() function, but it doesn't work!
# So we run a test program. If we're cross-compiling, do it the old way.
AC_MSG_CHECKING(for POSIX regcomp)
AC_TRY_RUN([
#include
#include
-main() { regex_t r; regmatch_t rm; char *text = "xabcy";
-if (regcomp(&r, "abc", 0)) exit(1);
-if (regexec(&r, text, 1, &rm, 0)) exit(1);
+int main() { regex_t r; regmatch_t rm; char *text = "xabcy";
+if (regcomp(&r, "abc", 0)) return (1);
+if (regexec(&r, text, 1, &rm, 0)) return (1);
#ifndef __WATCOMC__
-if (rm.rm_so != 1) exit(1); /* check for correct offset */
+if (rm.rm_so != 1) return (1); /* check for correct offset */
#else
-if (rm.rm_sp != text + 1) exit(1); /* check for correct offset */
+if (rm.rm_sp != text + 1) return (1); /* check for correct offset */
#endif
-exit(0); }],
+return (0); }],
have_posix_regex=yes, have_posix_regex=no, have_posix_regex=unknown)
if test $have_posix_regex = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_POSIX_REGCOMP) supported_regex="$supported_regex posix"
have_regex=yes
elif test $have_posix_regex = unknown; then
AC_TRY_LINK([
#include
#include ],
[regex_t *r; regfree(r);],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes; supported_regex="$supported_regex posix")
else
AC_MSG_RESULT(no)
fi
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = pcre2; then
AC_CHECK_LIB(pcre2-8, pcre2_compile_8,
[AC_DEFINE(HAVE_PCRE2) LIBS="$LIBS -lpcre2-8" have_regex=yes; supported_regex="$supported_regex pcre2"], [])
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then
AC_CHECK_LIB(pcre, pcre_compile,
[AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre"], [])
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then
AC_CHECK_LIB(c, re_compile_pattern,
[AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes; supported_regex="$supported_regex gnu"], [])
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then
AC_CHECK_FUNC(regcmp,
[AC_DEFINE(HAVE_REGCMP) have_regex=yes; supported_regex="$supported_regex regcmp"],[])
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then
AC_MSG_CHECKING(for V8 regcomp)
AC_TRY_LINK([
#include "regexp.h"], [regcomp("");],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes; supported_regex="$supported_regex regcomp"],[AC_MSG_RESULT(no)])
fi
fi
if test $have_regex = no && test -f ${srcdir}/regexp.c; then
if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then
AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP)
supported_regex="$supported_regex regcomp-local"
AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then
AC_MSG_CHECKING(for re_comp)
AC_CHECK_FUNC(re_comp,
[AC_DEFINE(HAVE_RE_COMP) have_regex=yes; supported_regex="$supported_regex re_comp"],[])
fi
fi
if test $have_regex = no; then
if test $WANT_REGEX = auto -o $WANT_REGEX = none; then
AC_MSG_RESULT(using no regex)
else
AC_MSG_WARN(cannot find regular expression library)
fi
AC_DEFINE(NO_REGEX) supported_regex="$supported_regex none"
fi
AC_MSG_RESULT(regular expression library: $supported_regex)
AC_ARG_WITH(editor,
[ --with-editor=PROGRAM use PROGRAM as the default editor [[vi]]],
AC_DEFINE_UNQUOTED(EDIT_PGM, "$withval"), AC_DEFINE(EDIT_PGM, "vi"))
AH_TOP([
/* Unix definition file for less. -*- C -*-
*
* This file has 3 sections:
* User preferences.
* Settings always true on Unix.
* Settings automatically determined by configure.
*
* * * * * * WARNING * * * * * *
* If you edit defines.h by hand, do "touch stamp-h" before you run make
* so config.status doesn't overwrite your changes.
*/
/* User preferences. */
/*
* SECURE is 1 if you wish to disable a bunch of features in order to
* be safe to run by unprivileged users.
* SECURE_COMPILE is set by the --with-secure configure option.
*/
#define SECURE SECURE_COMPILE
/*
* SHELL_ESCAPE is 1 if you wish to allow shell escapes.
* (This is possible only if your system supplies the system() function.)
*/
#define SHELL_ESCAPE (!SECURE)
/*
* EXAMINE is 1 if you wish to allow examining files by name from within less.
*/
#define EXAMINE (!SECURE)
/*
* TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key
* to complete filenames at prompts.
*/
#define TAB_COMPLETE_FILENAME (!SECURE)
/*
* CMD_HISTORY is 1 if you wish to allow keys to cycle through
* previous commands at prompts.
*/
#define CMD_HISTORY 1
/*
* HILITE_SEARCH is 1 if you wish to have search targets to be
* displayed in standout mode.
*/
#define HILITE_SEARCH 1
/*
* EDITOR is 1 if you wish to allow editor invocation (the "v" command).
* (This is possible only if your system supplies the system() function.)
* EDIT_PGM is the name of the (default) editor to be invoked.
*/
#define EDITOR (!SECURE)
/*
* TAGS is 1 if you wish to support tag files.
*/
#define TAGS (!SECURE)
/*
* USERFILE is 1 if you wish to allow a .less file to specify
* user-defined key bindings.
*/
#define USERFILE (!SECURE)
/*
* GLOB is 1 if you wish to have shell metacharacters expanded in filenames.
* This will generally work if your system provides the "popen" function
* and the "echo" shell command.
*/
#define GLOB (!SECURE)
/*
* PIPEC is 1 if you wish to have the "|" command
* which allows the user to pipe data into a shell command.
*/
#define PIPEC (!SECURE && HAVE_POPEN)
/*
* LOGFILE is 1 if you wish to allow the -o option (to create log files).
*/
#define LOGFILE (!SECURE)
/*
* GNU_OPTIONS is 1 if you wish to support the GNU-style command
* line options --help and --version.
*/
#define GNU_OPTIONS 1
/*
* ONLY_RETURN is 1 if you want RETURN to be the only input which
* will continue past an error message.
* Otherwise, any key will continue past an error message.
*/
#define ONLY_RETURN 0
/*
* LESSKEYFILE is the filename of the default lesskey output file
* (in the HOME directory).
* LESSKEYFILE_SYS is the filename of the system-wide lesskey output file.
* DEF_LESSKEYINFILE is the filename of the default lesskey input
* (in the HOME directory).
* LESSHISTFILE is the filename of the history file
* (in the HOME directory).
*/
#define LESSKEYFILE ".less"
#define LESSKEYFILE_SYS SYSDIR "/sysless"
#define DEF_LESSKEYINFILE ".lesskey"
#define LESSKEYINFILE_SYS SYSDIR "/syslesskey"
#define LESSHISTFILE ".lesshst"
/* Settings always true on Unix. */
/*
* Define MSDOS_COMPILER if compiling under Microsoft C.
*/
#define MSDOS_COMPILER 0
/*
* Pathname separator character.
*/
#define PATHNAME_SEP "/"
/*
* The value returned from tgetent on success.
* Some HP-UX systems return 0 on success.
*/
#define TGETENT_OK 1
/*
* HAVE_ANSI_PROTOS is 1 if your compiler supports ANSI function prototypes.
*/
#define HAVE_ANSI_PROTOS 1
/*
* HAVE_SYS_TYPES_H is 1 if your system has .
*/
#define HAVE_SYS_TYPES_H 1
/*
* Define if you have the header file.
*/
#undef HAVE_SGSTAT_H
/*
* HAVE_PERROR is 1 if your system has the perror() call.
* (Actually, if it has sys_errlist, sys_nerr and errno.)
*/
#define HAVE_PERROR 1
/*
* HAVE_TIME is 1 if your system has the time() call.
*/
#define HAVE_TIME 1
/*
* HAVE_SHELL is 1 if your system supports a SHELL command interpreter.
*/
#define HAVE_SHELL 1
/*
* Default shell metacharacters and meta-escape character.
*/
#define DEF_METACHARS "; *?\t\n'\"()<>[]|&^`#\\$%=~{},"
#define DEF_METAESCAPE "\\"
/*
* HAVE_DUP is 1 if your system has the dup() call.
*/
#define HAVE_DUP 1
/* Define to 1 if you have the memcpy() function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the strchr() function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the strstr() function. */
#define HAVE_STRSTR 1
/* Define to 1 to support reading lesskey source files (not just binary). */
#define HAVE_LESSKEYSRC 1
/*
* Sizes of various buffers.
*/
#if 0 /* old sizes for small memory machines */
#define CMDBUF_SIZE 512 /* Buffer for multichar commands */
#define UNGOT_SIZE 100 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 200 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 512 /* Max size of line in tags file */
#define TABSTOP_MAX 32 /* Max number of custom tab stops */
#else /* more reasonable sizes for modern machines */
#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */
#define UNGOT_SIZE 200 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 2048 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 1024 /* Max size of line in tags file */
#define TABSTOP_MAX 128 /* Max number of custom tab stops */
#endif
/* Settings automatically determined by configure. */
])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff --git a/cvt.c b/cvt.c
index 9cf44b894e7d..bb4649264f12 100644
--- a/cvt.c
+++ b/cvt.c
@@ -1,118 +1,118 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
/*
* Routines to convert text in various ways. Used by search.
*/
#include "less.h"
#include "charset.h"
extern int utf_mode;
/*
* Get the length of a buffer needed to convert a string.
*/
public int
cvt_length(len, ops)
int len;
int ops;
{
if (utf_mode)
/*
* Just copying a string in UTF-8 mode can cause it to grow
* in length.
* Four output bytes for one input byte is the worst case.
*/
len *= 4;
return (len + 1);
}
/*
* Allocate a chpos array for use by cvt_text.
*/
public int *
cvt_alloc_chpos(len)
int len;
{
int i;
int *chpos = (int *) ecalloc(sizeof(int), len);
/* Initialize all entries to an invalid position. */
for (i = 0; i < len; i++)
chpos[i] = -1;
return (chpos);
}
/*
* Convert text. Perform the transformations specified by ops.
* Returns converted text in odst. The original offset of each
* odst character (when it was in osrc) is returned in the chpos array.
*/
public void
cvt_text(odst, osrc, chpos, lenp, ops)
char *odst;
char *osrc;
int *chpos;
int *lenp;
int ops;
{
char *dst;
char *edst = odst;
char *src;
char *src_end;
LWCHAR ch;
if (lenp != NULL)
src_end = osrc + *lenp;
else
src_end = osrc + strlen(osrc);
for (src = osrc, dst = odst; src < src_end; )
{
int src_pos = (int) (src - osrc);
int dst_pos = (int) (dst - odst);
struct ansi_state *pansi;
ch = step_char(&src, +1, src_end);
if ((ops & CVT_BS) && ch == '\b' && dst > odst)
{
/* Delete backspace and preceding char. */
do {
dst--;
} while (dst > odst && utf_mode &&
!IS_ASCII_OCTET(*dst) && !IS_UTF8_LEAD(*dst));
} else if ((ops & CVT_ANSI) && (pansi = ansi_start(ch)) != NULL)
{
/* Skip to end of ANSI escape sequence. */
while (src < src_end)
{
if (ansi_step(pansi, ch) != ANSI_MID)
break;
ch = *src++;
}
ansi_done(pansi);
} else
{
/* Just copy the char to the destination buffer. */
if ((ops & CVT_TO_LC) && IS_UPPER(ch))
ch = TO_LOWER(ch);
put_wchar(&dst, ch);
/* Record the original position of the char. */
if (chpos != NULL)
chpos[dst_pos] = src_pos;
}
if (dst > edst)
edst = dst;
}
if ((ops & CVT_CRLF) && edst > odst && edst[-1] == '\r')
edst--;
*edst = '\0';
if (lenp != NULL)
*lenp = (int) (edst - odst);
/* FIXME: why was this here? if (chpos != NULL) chpos[dst - odst] = src - osrc; */
}
diff --git a/decode.c b/decode.c
index 7e9b167bc786..0444cab399c9 100644
--- a/decode.c
+++ b/decode.c
@@ -1,1071 +1,1091 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
/*
* Routines to decode user commands.
*
* This is all table driven.
* A command table is a sequence of command descriptors.
* Each command descriptor is a sequence of bytes with the following format:
* ...<0>
* The characters c1,c2,...,cN are the command string; that is,
* the characters which the user must type.
* It is terminated by a null <0> byte.
* The byte after the null byte is the action code associated
* with the command string.
* If an action byte is OR-ed with A_EXTRA, this indicates
* that the option byte is followed by an extra string.
*
* There may be many command tables.
* The first (default) table is built-in.
* Other tables are read in from "lesskey" files.
* All the tables are linked together and are searched in order.
*/
#include "less.h"
#include "cmd.h"
#include "lesskey.h"
extern int erase_char, erase2_char, kill_char;
extern int secure;
extern int mousecap;
extern int screen_trashed;
extern int sc_height;
#define SK(k) \
SK_SPECIAL_KEY, (k), 6, 1, 1, 1
/*
* Command table is ordered roughly according to expected
* frequency of use, so the common commands are near the beginning.
*/
static unsigned char cmdtable[] =
{
'\r',0, A_F_LINE,
'\n',0, A_F_LINE,
'e',0, A_F_LINE,
'j',0, A_F_LINE,
SK(SK_DOWN_ARROW),0, A_F_LINE,
CONTROL('E'),0, A_F_LINE,
CONTROL('N'),0, A_F_LINE,
'k',0, A_B_LINE,
'y',0, A_B_LINE,
CONTROL('Y'),0, A_B_LINE,
SK(SK_CONTROL_K),0, A_B_LINE,
CONTROL('P'),0, A_B_LINE,
SK(SK_UP_ARROW),0, A_B_LINE,
'J',0, A_FF_LINE,
'K',0, A_BF_LINE,
'Y',0, A_BF_LINE,
'd',0, A_F_SCROLL,
CONTROL('D'),0, A_F_SCROLL,
'u',0, A_B_SCROLL,
CONTROL('U'),0, A_B_SCROLL,
ESC,'[','M',0, A_X11MOUSE_IN,
ESC,'[','<',0, A_X116MOUSE_IN,
' ',0, A_F_SCREEN,
'f',0, A_F_SCREEN,
CONTROL('F'),0, A_F_SCREEN,
CONTROL('V'),0, A_F_SCREEN,
SK(SK_PAGE_DOWN),0, A_F_SCREEN,
'b',0, A_B_SCREEN,
CONTROL('B'),0, A_B_SCREEN,
ESC,'v',0, A_B_SCREEN,
SK(SK_PAGE_UP),0, A_B_SCREEN,
'z',0, A_F_WINDOW,
'w',0, A_B_WINDOW,
ESC,' ',0, A_FF_SCREEN,
'F',0, A_F_FOREVER,
ESC,'F',0, A_F_UNTIL_HILITE,
'R',0, A_FREPAINT,
'r',0, A_REPAINT,
CONTROL('R'),0, A_REPAINT,
CONTROL('L'),0, A_REPAINT,
ESC,'u',0, A_UNDO_SEARCH,
ESC,'U',0, A_CLR_SEARCH,
'g',0, A_GOLINE,
SK(SK_HOME),0, A_GOLINE,
'<',0, A_GOLINE,
ESC,'<',0, A_GOLINE,
'p',0, A_PERCENT,
'%',0, A_PERCENT,
ESC,'[',0, A_LSHIFT,
ESC,']',0, A_RSHIFT,
ESC,'(',0, A_LSHIFT,
ESC,')',0, A_RSHIFT,
ESC,'{',0, A_LLSHIFT,
ESC,'}',0, A_RRSHIFT,
SK(SK_RIGHT_ARROW),0, A_RSHIFT,
SK(SK_LEFT_ARROW),0, A_LSHIFT,
SK(SK_CTL_RIGHT_ARROW),0, A_RRSHIFT,
SK(SK_CTL_LEFT_ARROW),0, A_LLSHIFT,
'{',0, A_F_BRACKET|A_EXTRA, '{','}',0,
'}',0, A_B_BRACKET|A_EXTRA, '{','}',0,
'(',0, A_F_BRACKET|A_EXTRA, '(',')',0,
')',0, A_B_BRACKET|A_EXTRA, '(',')',0,
'[',0, A_F_BRACKET|A_EXTRA, '[',']',0,
']',0, A_B_BRACKET|A_EXTRA, '[',']',0,
ESC,CONTROL('F'),0, A_F_BRACKET,
ESC,CONTROL('B'),0, A_B_BRACKET,
'G',0, A_GOEND,
ESC,'G',0, A_GOEND_BUF,
ESC,'>',0, A_GOEND,
'>',0, A_GOEND,
SK(SK_END),0, A_GOEND,
'P',0, A_GOPOS,
'0',0, A_DIGIT,
'1',0, A_DIGIT,
'2',0, A_DIGIT,
'3',0, A_DIGIT,
'4',0, A_DIGIT,
'5',0, A_DIGIT,
'6',0, A_DIGIT,
'7',0, A_DIGIT,
'8',0, A_DIGIT,
'9',0, A_DIGIT,
'.',0, A_DIGIT,
'=',0, A_STAT,
CONTROL('G'),0, A_STAT,
':','f',0, A_STAT,
'/',0, A_F_SEARCH,
'?',0, A_B_SEARCH,
ESC,'/',0, A_F_SEARCH|A_EXTRA, '*',0,
ESC,'?',0, A_B_SEARCH|A_EXTRA, '*',0,
'n',0, A_AGAIN_SEARCH,
ESC,'n',0, A_T_AGAIN_SEARCH,
'N',0, A_REVERSE_SEARCH,
ESC,'N',0, A_T_REVERSE_SEARCH,
'&',0, A_FILTER,
'm',0, A_SETMARK,
'M',0, A_SETMARKBOT,
ESC,'m',0, A_CLRMARK,
'\'',0, A_GOMARK,
CONTROL('X'),CONTROL('X'),0, A_GOMARK,
'E',0, A_EXAMINE,
':','e',0, A_EXAMINE,
CONTROL('X'),CONTROL('V'),0, A_EXAMINE,
':','n',0, A_NEXT_FILE,
':','p',0, A_PREV_FILE,
't',0, A_NEXT_TAG,
'T',0, A_PREV_TAG,
':','x',0, A_INDEX_FILE,
':','d',0, A_REMOVE_FILE,
'-',0, A_OPT_TOGGLE,
':','t',0, A_OPT_TOGGLE|A_EXTRA, 't',0,
's',0, A_OPT_TOGGLE|A_EXTRA, 'o',0,
'_',0, A_DISP_OPTION,
'|',0, A_PIPE,
'v',0, A_VISUAL,
'!',0, A_SHELL,
'+',0, A_FIRSTCMD,
'H',0, A_HELP,
'h',0, A_HELP,
SK(SK_F1),0, A_HELP,
'V',0, A_VERSION,
'q',0, A_QUIT,
'Q',0, A_QUIT,
':','q',0, A_QUIT,
':','Q',0, A_QUIT,
'Z','Z',0, A_QUIT
};
static unsigned char edittable[] =
{
'\t',0, EC_F_COMPLETE, /* TAB */
'\17',0, EC_B_COMPLETE, /* BACKTAB */
SK(SK_BACKTAB),0, EC_B_COMPLETE, /* BACKTAB */
ESC,'\t',0, EC_B_COMPLETE, /* ESC TAB */
CONTROL('L'),0, EC_EXPAND, /* CTRL-L */
CONTROL('V'),0, EC_LITERAL, /* BACKSLASH */
CONTROL('A'),0, EC_LITERAL, /* BACKSLASH */
ESC,'l',0, EC_RIGHT, /* ESC l */
SK(SK_RIGHT_ARROW),0, EC_RIGHT, /* RIGHTARROW */
ESC,'h',0, EC_LEFT, /* ESC h */
SK(SK_LEFT_ARROW),0, EC_LEFT, /* LEFTARROW */
ESC,'b',0, EC_W_LEFT, /* ESC b */
ESC,SK(SK_LEFT_ARROW),0, EC_W_LEFT, /* ESC LEFTARROW */
SK(SK_CTL_LEFT_ARROW),0, EC_W_LEFT, /* CTRL-LEFTARROW */
ESC,'w',0, EC_W_RIGHT, /* ESC w */
ESC,SK(SK_RIGHT_ARROW),0, EC_W_RIGHT, /* ESC RIGHTARROW */
SK(SK_CTL_RIGHT_ARROW),0, EC_W_RIGHT, /* CTRL-RIGHTARROW */
ESC,'i',0, EC_INSERT, /* ESC i */
SK(SK_INSERT),0, EC_INSERT, /* INSERT */
ESC,'x',0, EC_DELETE, /* ESC x */
SK(SK_DELETE),0, EC_DELETE, /* DELETE */
ESC,'X',0, EC_W_DELETE, /* ESC X */
ESC,SK(SK_DELETE),0, EC_W_DELETE, /* ESC DELETE */
SK(SK_CTL_DELETE),0, EC_W_DELETE, /* CTRL-DELETE */
SK(SK_CTL_BACKSPACE),0, EC_W_BACKSPACE, /* CTRL-BACKSPACE */
- ESC,'\b',0, EC_W_BACKSPACE, /* ESC BACKSPACE */
+ ESC,SK(SK_BACKSPACE),0, EC_W_BACKSPACE, /* ESC BACKSPACE */
ESC,'0',0, EC_HOME, /* ESC 0 */
SK(SK_HOME),0, EC_HOME, /* HOME */
ESC,'$',0, EC_END, /* ESC $ */
SK(SK_END),0, EC_END, /* END */
ESC,'k',0, EC_UP, /* ESC k */
SK(SK_UP_ARROW),0, EC_UP, /* UPARROW */
ESC,'j',0, EC_DOWN, /* ESC j */
SK(SK_DOWN_ARROW),0, EC_DOWN, /* DOWNARROW */
CONTROL('G'),0, EC_ABORT, /* CTRL-G */
ESC,'[','M',0, EC_X11MOUSE, /* X11 mouse report */
ESC,'[','<',0, EC_X116MOUSE, /* X11 1006 mouse report */
};
/*
* Structure to support a list of command tables.
*/
struct tablelist
{
struct tablelist *t_next;
char *t_start;
char *t_end;
};
/*
* List of command tables and list of line-edit tables.
*/
static struct tablelist *list_fcmd_tables = NULL;
static struct tablelist *list_ecmd_tables = NULL;
static struct tablelist *list_var_tables = NULL;
static struct tablelist *list_sysvar_tables = NULL;
/*
* Expand special key abbreviations in a command table.
*/
static void
expand_special_keys(table, len)
char *table;
int len;
{
char *fm;
char *to;
int a;
char *repl;
int klen;
for (fm = table; fm < table + len; )
{
/*
* Rewrite each command in the table with any
* special key abbreviations expanded.
*/
for (to = fm; *fm != '\0'; )
{
if (*fm != SK_SPECIAL_KEY)
{
*to++ = *fm++;
continue;
}
/*
* After SK_SPECIAL_KEY, next byte is the type
- * of special key (one of the SK_* contants),
+ * of special key (one of the SK_* constants),
* and the byte after that is the number of bytes,
* N, reserved by the abbreviation (including the
* SK_SPECIAL_KEY and key type bytes).
* Replace all N bytes with the actual bytes
* output by the special key on this terminal.
*/
repl = special_key_str(fm[1]);
klen = fm[2] & 0377;
fm += klen;
if (repl == NULL || (int) strlen(repl) > klen)
repl = "\377";
while (*repl != '\0')
*to++ = *repl++;
}
*to++ = '\0';
/*
* Fill any unused bytes between end of command and
* the action byte with A_SKIP.
*/
while (to <= fm)
*to++ = A_SKIP;
fm++;
a = *fm++ & 0377;
if (a & A_EXTRA)
{
while (*fm++ != '\0')
continue;
}
}
}
/*
* Expand special key abbreviations in a list of command tables.
*/
static void
expand_cmd_table(tlist)
struct tablelist *tlist;
{
struct tablelist *t;
for (t = tlist; t != NULL; t = t->t_next)
{
expand_special_keys(t->t_start, t->t_end - t->t_start);
}
}
/*
* Expand special key abbreviations in all command tables.
*/
public void
expand_cmd_tables(VOID_PARAM)
{
expand_cmd_table(list_fcmd_tables);
expand_cmd_table(list_ecmd_tables);
expand_cmd_table(list_var_tables);
expand_cmd_table(list_sysvar_tables);
}
/*
* Initialize the command lists.
*/
public void
init_cmds(VOID_PARAM)
{
/*
* Add the default command tables.
*/
add_fcmd_table((char*)cmdtable, sizeof(cmdtable));
add_ecmd_table((char*)edittable, sizeof(edittable));
#if USERFILE
#ifdef BINDIR /* For backwards compatibility */
/* Try to add tables in the OLD system lesskey file. */
add_hometable(lesskey, NULL, BINDIR "/.sysless", 1);
#endif
/*
* Try to load lesskey source file or binary file.
* If the source file succeeds, don't load binary file.
* The binary file is likely to have been generated from
* a (possibly out of date) copy of the src file,
* so loading it is at best redundant.
*/
/*
* Try to add tables in system lesskey src file.
*/
#if HAVE_LESSKEYSRC
if (add_hometable(lesskey_src, "LESSKEYIN_SYSTEM", LESSKEYINFILE_SYS, 1) != 0)
#endif
{
/*
* Try to add the tables in the system lesskey binary file.
*/
add_hometable(lesskey, "LESSKEY_SYSTEM", LESSKEYFILE_SYS, 1);
}
/*
* Try to add tables in the lesskey src file "$HOME/.lesskey".
*/
#if HAVE_LESSKEYSRC
if (add_hometable(lesskey_src, "LESSKEYIN", DEF_LESSKEYINFILE, 0) != 0)
#endif
{
/*
* Try to add the tables in the standard lesskey binary file "$HOME/.less".
*/
add_hometable(lesskey, "LESSKEY", LESSKEYFILE, 0);
}
#endif
}
/*
* Add a command table.
*/
static int
add_cmd_table(tlist, buf, len)
struct tablelist **tlist;
char *buf;
int len;
{
struct tablelist *t;
if (len == 0)
return (0);
/*
* Allocate a tablelist structure, initialize it,
* and link it into the list of tables.
*/
if ((t = (struct tablelist *)
calloc(1, sizeof(struct tablelist))) == NULL)
{
return (-1);
}
t->t_start = buf;
t->t_end = buf + len;
t->t_next = *tlist;
*tlist = t;
return (0);
}
/*
* Add a command table.
*/
public void
add_fcmd_table(buf, len)
char *buf;
int len;
{
if (add_cmd_table(&list_fcmd_tables, buf, len) < 0)
error("Warning: some commands disabled", NULL_PARG);
}
/*
* Add an editing command table.
*/
public void
add_ecmd_table(buf, len)
char *buf;
int len;
{
if (add_cmd_table(&list_ecmd_tables, buf, len) < 0)
error("Warning: some edit commands disabled", NULL_PARG);
}
/*
* Add an environment variable table.
*/
static void
add_var_table(tlist, buf, len)
struct tablelist **tlist;
char *buf;
int len;
{
if (add_cmd_table(tlist, buf, len) < 0)
error("Warning: environment variables from lesskey file unavailable", NULL_PARG);
}
/*
* Return action for a mouse wheel down event.
*/
static int
mouse_wheel_down(VOID_PARAM)
{
return ((mousecap == OPT_ONPLUS) ? A_B_MOUSE : A_F_MOUSE);
}
/*
* Return action for a mouse wheel up event.
*/
static int
mouse_wheel_up(VOID_PARAM)
{
return ((mousecap == OPT_ONPLUS) ? A_F_MOUSE : A_B_MOUSE);
}
/*
* Return action for a mouse button release event.
*/
static int
mouse_button_rel(x, y)
int x;
int y;
{
/*
* {{ It would be better to return an action and then do this
* in commands() but it's nontrivial to pass y to it. }}
*/
if (y < sc_height-1)
{
setmark('#', y);
screen_trashed = 1;
}
return (A_NOACTION);
}
/*
* Read a decimal integer. Return the integer and set *pterm to the terminating char.
*/
static int
getcc_int(pterm)
char* pterm;
{
int num = 0;
int digits = 0;
for (;;)
{
char ch = getcc();
if (ch < '0' || ch > '9')
{
if (pterm != NULL) *pterm = ch;
if (digits == 0)
return (-1);
return (num);
}
num = (10 * num) + (ch - '0');
++digits;
}
}
/*
* Read suffix of mouse input and return the action to take.
* The prefix ("\e[M") has already been read.
*/
static int
x11mouse_action(skip)
int skip;
{
int b = getcc() - X11MOUSE_OFFSET;
int x = getcc() - X11MOUSE_OFFSET-1;
int y = getcc() - X11MOUSE_OFFSET-1;
if (skip)
return (A_NOACTION);
switch (b) {
default:
return (A_NOACTION);
case X11MOUSE_WHEEL_DOWN:
return mouse_wheel_down();
case X11MOUSE_WHEEL_UP:
return mouse_wheel_up();
case X11MOUSE_BUTTON_REL:
return mouse_button_rel(x, y);
}
}
/*
* Read suffix of mouse input and return the action to take.
* The prefix ("\e[<") has already been read.
*/
static int
x116mouse_action(skip)
int skip;
{
char ch;
int x, y;
int b = getcc_int(&ch);
if (b < 0 || ch != ';') return (A_NOACTION);
x = getcc_int(&ch) - 1;
if (x < 0 || ch != ';') return (A_NOACTION);
y = getcc_int(&ch) - 1;
if (y < 0) return (A_NOACTION);
if (skip)
return (A_NOACTION);
switch (b) {
case X11MOUSE_WHEEL_DOWN:
return mouse_wheel_down();
case X11MOUSE_WHEEL_UP:
return mouse_wheel_up();
default:
if (ch != 'm') return (A_NOACTION);
return mouse_button_rel(x, y);
}
}
/*
* Search a single command table for the command string in cmd.
*/
static int
cmd_search(cmd, table, endtable, sp)
char *cmd;
char *table;
char *endtable;
char **sp;
{
char *p;
char *q;
int a;
*sp = NULL;
for (p = table, q = cmd; p < endtable; p++, q++)
{
if (*p == *q)
{
/*
* Current characters match.
* If we're at the end of the string, we've found it.
* Return the action code, which is the character
* after the null at the end of the string
* in the command table.
*/
if (*p == '\0')
{
a = *++p & 0377;
while (a == A_SKIP)
a = *++p & 0377;
if (a == A_END_LIST)
{
/*
* We get here only if the original
* cmd string passed in was empty ("").
* I don't think that can happen,
* but just in case ...
*/
return (A_UINVALID);
}
/*
* Check for an "extra" string.
*/
if (a & A_EXTRA)
{
*sp = ++p;
a &= ~A_EXTRA;
}
if (a == A_X11MOUSE_IN)
a = x11mouse_action(0);
else if (a == A_X116MOUSE_IN)
a = x116mouse_action(0);
return (a);
}
} else if (*q == '\0')
{
/*
* Hit the end of the user's command,
* but not the end of the string in the command table.
* The user's command is incomplete.
*/
return (A_PREFIX);
} else
{
/*
* Not a match.
* Skip ahead to the next command in the
* command table, and reset the pointer
* to the beginning of the user's command.
*/
if (*p == '\0' && p[1] == A_END_LIST)
{
/*
* A_END_LIST is a special marker that tells
* us to abort the cmd search.
*/
return (A_UINVALID);
}
while (*p++ != '\0')
continue;
while (*p == A_SKIP)
p++;
if (*p & A_EXTRA)
while (*++p != '\0')
continue;
q = cmd-1;
}
}
/*
* No match found in the entire command table.
*/
return (A_INVALID);
}
/*
* Decode a command character and return the associated action.
* The "extra" string, if any, is returned in sp.
*/
static int
cmd_decode(tlist, cmd, sp)
struct tablelist *tlist;
char *cmd;
char **sp;
{
struct tablelist *t;
int action = A_INVALID;
/*
* Search thru all the command tables.
* Stop when we find an action which is not A_INVALID.
*/
for (t = tlist; t != NULL; t = t->t_next)
{
action = cmd_search(cmd, t->t_start, t->t_end, sp);
if (action != A_INVALID)
break;
}
if (action == A_UINVALID)
action = A_INVALID;
return (action);
}
/*
* Decode a command from the cmdtables list.
*/
public int
fcmd_decode(cmd, sp)
char *cmd;
char **sp;
{
return (cmd_decode(list_fcmd_tables, cmd, sp));
}
/*
* Decode a command from the edittables list.
*/
public int
ecmd_decode(cmd, sp)
char *cmd;
char **sp;
{
return (cmd_decode(list_ecmd_tables, cmd, sp));
}
/*
* Get the value of an environment variable.
* Looks first in the lesskey file, then in the real environment.
*/
public char *
lgetenv(var)
char *var;
{
int a;
char *s;
a = cmd_decode(list_var_tables, var, &s);
if (a == EV_OK)
return (s);
s = getenv(var);
if (s != NULL && *s != '\0')
return (s);
a = cmd_decode(list_sysvar_tables, var, &s);
if (a == EV_OK)
return (s);
return (NULL);
}
/*
* Is a string null or empty?
*/
public int
isnullenv(s)
char* s;
{
return (s == NULL || *s == '\0');
}
#if USERFILE
/*
* Get an "integer" from a lesskey file.
* Integers are stored in a funny format:
* two bytes, low order first, in radix KRADIX.
*/
static int
gint(sp)
char **sp;
{
int n;
n = *(*sp)++;
n += *(*sp)++ * KRADIX;
return (n);
}
/*
* Process an old (pre-v241) lesskey file.
*/
static int
old_lesskey(buf, len)
char *buf;
int len;
{
/*
* Old-style lesskey file.
* The file must end with either
* ...,cmd,0,action
* or ...,cmd,0,action|A_EXTRA,string,0
* So the last byte or the second to last byte must be zero.
*/
if (buf[len-1] != '\0' && buf[len-2] != '\0')
return (-1);
add_fcmd_table(buf, len);
return (0);
}
/*
* Process a new (post-v241) lesskey file.
*/
static int
new_lesskey(buf, len, sysvar)
char *buf;
int len;
int sysvar;
{
char *p;
+ char *end;
int c;
int n;
/*
* New-style lesskey file.
* Extract the pieces.
*/
if (buf[len-3] != C0_END_LESSKEY_MAGIC ||
buf[len-2] != C1_END_LESSKEY_MAGIC ||
buf[len-1] != C2_END_LESSKEY_MAGIC)
return (-1);
p = buf + 4;
+ end = buf + len;
for (;;)
{
c = *p++;
switch (c)
{
case CMD_SECTION:
n = gint(&p);
+ if (n < 0 || p+n >= end)
+ return (-1);
add_fcmd_table(p, n);
p += n;
break;
case EDIT_SECTION:
n = gint(&p);
+ if (n < 0 || p+n >= end)
+ return (-1);
add_ecmd_table(p, n);
p += n;
break;
case VAR_SECTION:
n = gint(&p);
+ if (n < 0 || p+n >= end)
+ return (-1);
add_var_table((sysvar) ?
&list_sysvar_tables : &list_var_tables, p, n);
p += n;
break;
case END_SECTION:
return (0);
default:
/*
* Unrecognized section type.
*/
return (-1);
}
}
}
/*
* Set up a user command table, based on a "lesskey" file.
*/
public int
lesskey(filename, sysvar)
char *filename;
int sysvar;
{
char *buf;
POSITION len;
long n;
int f;
if (secure)
return (1);
/*
* Try to open the lesskey file.
*/
f = open(filename, OPEN_READ);
if (f < 0)
return (1);
/*
* Read the file into a buffer.
* We first figure out the size of the file and allocate space for it.
* {{ Minimal error checking is done here.
* A garbage .less file will produce strange results.
* To avoid a large amount of error checking code here, we
* rely on the lesskey program to generate a good .less file. }}
*/
len = filesize(f);
if (len == NULL_POSITION || len < 3)
{
/*
* Bad file (valid file must have at least 3 chars).
*/
close(f);
return (-1);
}
if ((buf = (char *) calloc((int)len, sizeof(char))) == NULL)
{
close(f);
return (-1);
}
if (lseek(f, (off_t)0, SEEK_SET) == BAD_LSEEK)
{
free(buf);
close(f);
return (-1);
}
n = read(f, buf, (unsigned int) len);
close(f);
if (n != len)
{
free(buf);
return (-1);
}
/*
* Figure out if this is an old-style (before version 241)
* or new-style lesskey file format.
*/
- if (buf[0] != C0_LESSKEY_MAGIC || buf[1] != C1_LESSKEY_MAGIC ||
+ if (len < 4 ||
+ buf[0] != C0_LESSKEY_MAGIC || buf[1] != C1_LESSKEY_MAGIC ||
buf[2] != C2_LESSKEY_MAGIC || buf[3] != C3_LESSKEY_MAGIC)
return (old_lesskey(buf, (int)len));
return (new_lesskey(buf, (int)len, sysvar));
}
#if HAVE_LESSKEYSRC
public int
lesskey_src(filename, sysvar)
char *filename;
int sysvar;
{
static struct lesskey_tables tables;
int r = parse_lesskey(filename, &tables);
if (r != 0)
return (r);
add_fcmd_table(tables.cmdtable.buf.data, tables.cmdtable.buf.end);
add_ecmd_table(tables.edittable.buf.data, tables.edittable.buf.end);
add_var_table(sysvar ? &list_sysvar_tables : &list_var_tables,
tables.vartable.buf.data, tables.vartable.buf.end);
return (0);
}
void
lesskey_parse_error(s)
char *s;
{
PARG parg;
parg.p_string = s;
error("%s", &parg);
}
#endif /* HAVE_LESSKEYSRC */
/*
* Add a lesskey file.
*/
public int
add_hometable(call_lesskey, envname, def_filename, sysvar)
int (*call_lesskey)(char *, int);
char *envname;
char *def_filename;
int sysvar;
{
char *filename;
int r;
if (envname != NULL && (filename = lgetenv(envname)) != NULL)
filename = save(filename);
else if (sysvar) /* def_filename is full path */
filename = save(def_filename);
else /* def_filename is just basename */
{
+ /* Remove first char (normally a dot) unless stored in $HOME. */
char *xdg = lgetenv("XDG_CONFIG_HOME");
if (!isnullenv(xdg))
- filename = dirfile(xdg, def_filename+1, 1);
+ filename = dirfile(xdg, &def_filename[1], 1);
+ if (filename == NULL)
+ {
+ char *home = lgetenv("HOME");
+ if (!isnullenv(home))
+ {
+ char *cfg_dir = dirfile(home, ".config", 0);
+ filename = dirfile(cfg_dir, &def_filename[1], 1);
+ free(cfg_dir);
+ }
+ }
if (filename == NULL)
filename = homefile(def_filename);
}
if (filename == NULL)
return -1;
r = (*call_lesskey)(filename, sysvar);
free(filename);
return (r);
}
#endif
/*
* See if a char is a special line-editing command.
*/
public int
editchar(c, flags)
int c;
int flags;
{
int action;
int nch;
char *s;
char usercmd[MAX_CMDLEN+1];
/*
* An editing character could actually be a sequence of characters;
* for example, an escape sequence sent by pressing the uparrow key.
* To match the editing string, we use the command decoder
* but give it the edit-commands command table
* This table is constructed to match the user's keyboard.
*/
if (c == erase_char || c == erase2_char)
return (EC_BACKSPACE);
if (c == kill_char)
{
#if MSDOS_COMPILER==WIN32C
if (!win32_kbhit())
#endif
return (EC_LINEKILL);
}
/*
* Collect characters in a buffer.
* Start with the one we have, and get more if we need them.
*/
nch = 0;
do {
if (nch > 0)
c = getcc();
usercmd[nch] = c;
usercmd[nch+1] = '\0';
nch++;
action = ecmd_decode(usercmd, &s);
} while (action == A_PREFIX && nch < MAX_CMDLEN);
if (action == EC_X11MOUSE)
return (x11mouse_action(1));
if (action == EC_X116MOUSE)
return (x116mouse_action(1));
if (flags & ECF_NORIGHTLEFT)
{
switch (action)
{
case EC_RIGHT:
case EC_LEFT:
action = A_INVALID;
break;
}
}
#if CMD_HISTORY
if (flags & ECF_NOHISTORY)
{
/*
* The caller says there is no history list.
* Reject any history-manipulation action.
*/
switch (action)
{
case EC_UP:
case EC_DOWN:
action = A_INVALID;
break;
}
}
#endif
#if TAB_COMPLETE_FILENAME
if (flags & ECF_NOCOMPLETE)
{
/*
* The caller says we don't want any filename completion cmds.
* Reject them.
*/
switch (action)
{
case EC_F_COMPLETE:
case EC_B_COMPLETE:
case EC_EXPAND:
action = A_INVALID;
break;
}
}
#endif
if ((flags & ECF_PEEK) || action == A_INVALID)
{
/*
* We're just peeking, or we didn't understand the command.
* Unget all the characters we read in the loop above.
* This does NOT include the original character that was
* passed in as a parameter.
*/
while (nch > 1)
{
ungetcc(usercmd[--nch]);
}
} else
{
if (s != NULL)
ungetsc(s);
}
return action;
}
diff --git a/defines.ds b/defines.ds
index 1bd50261561b..d358fec5e524 100644
--- a/defines.ds
+++ b/defines.ds
@@ -1,423 +1,423 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
/* DOS definition file for less. */
/*
* This file has 2 sections:
* User preferences.
* Settings always true for MS-DOS systems.
*/
/* User preferences. */
/*
* SECURE is 1 if you wish to disable a bunch of features in order to
* be safe to run by unprivileged users.
*/
#define SECURE 0
/*
* SHELL_ESCAPE is 1 if you wish to allow shell escapes.
* (This is possible only if your system supplies the system() function.)
*/
#define SHELL_ESCAPE (!SECURE)
/*
* EXAMINE is 1 if you wish to allow examining files by name from within less.
*/
#define EXAMINE (!SECURE)
/*
* TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key
* to complete filenames at prompts.
*/
#define TAB_COMPLETE_FILENAME (!SECURE)
/*
* CMD_HISTORY is 1 if you wish to allow keys to cycle through
* previous commands at prompts.
*/
#define CMD_HISTORY 1
/*
* HILITE_SEARCH is 1 if you wish to have search targets to be
* displayed in standout mode.
*/
#define HILITE_SEARCH 1
/*
* EDITOR is 1 if you wish to allow editor invocation (the "v" command).
* (This is possible only if your system supplies the system() function.)
* EDIT_PGM is the name of the (default) editor to be invoked.
*/
#define EDITOR (!SECURE)
#define EDIT_PGM "vi"
/*
* TAGS is 1 if you wish to support tag files.
*/
#define TAGS (!SECURE)
/*
* USERFILE is 1 if you wish to allow a .less file to specify
* user-defined key bindings.
*/
#define USERFILE (!SECURE)
/*
* GLOB is 1 if you wish to have shell metacharacters expanded in filenames.
* This will generally work if your system provides the "popen" function
* and the "echo" shell command.
*/
#ifdef __DJGPP__
#define GLOB (!SECURE)
#else
#define GLOB 0
#endif
/*
* PIPEC is 1 if you wish to have the "|" command
* which allows the user to pipe data into a shell command.
*/
#ifdef __DJGPP__
#define PIPEC (!SECURE)
#else
#define PIPEC 0
#endif
/*
* LOGFILE is 1 if you wish to allow the -o option (to create log files).
*/
#define LOGFILE (!SECURE)
/*
* GNU_OPTIONS is 1 if you wish to support the GNU-style command
* line options --help and --version.
*/
#define GNU_OPTIONS 1
/*
* ONLY_RETURN is 1 if you want RETURN to be the only input which
* will continue past an error message.
* Otherwise, any key will continue past an error message.
*/
#define ONLY_RETURN 0
/*
* LESSKEYFILE is the filename of the default lesskey output file
* (in the HOME directory).
* LESSKEYFILE_SYS is the filename of the system-wide lesskey output file.
* DEF_LESSKEYINFILE is the filename of the default lesskey input
* (in the HOME directory).
* LESSHISTFILE is the filename of the history file
* (in the HOME directory).
*/
#define LESSKEYFILE "_less"
#define LESSKEYFILE_SYS "c:\\_sysless"
#define DEF_LESSKEYINFILE "_lesskey"
#define LESSKEYINFILE_SYS "c:\\_syslesskey"
#define LESSHISTFILE "_lesshst"
/* Settings always true for MS-DOS systems. */
/*
* Define MSDOS_COMPILER if compiling for MS-DOS.
*/
#ifdef __DJGPP__
#define MSDOS_COMPILER DJGPPC
#else
#ifdef __BORLANDC__
#define MSDOS_COMPILER BORLANDC
#else
#define MSDOS_COMPILER MSOFTC
#endif
#endif
/*
* Pathname separator character.
*/
#define PATHNAME_SEP "\\"
/*
* HAVE_ANSI_PROTOS is 1 if your compiler supports ANSI function prototypes.
*/
#define HAVE_ANSI_PROTOS 1
/*
* HAVE_SYS_TYPES_H is 1 if your system has .
*/
#define HAVE_SYS_TYPES_H 1
/*
* Define if you have the header file.
*/
#define HAVE_SGSTAT_H 0
/*
* HAVE_PERROR is 1 if your system has the perror() call.
* (Actually, if it has sys_errlist, sys_nerr and errno.)
*/
#define HAVE_PERROR 1
/*
* HAVE_TIME is 1 if your system has the time() call.
*/
#define HAVE_TIME 1
/*
* HAVE_SHELL is 1 if your system supports a SHELL command interpreter.
*/
#define HAVE_SHELL 0
/*
* Default shell metacharacters and meta-escape character.
*/
#define DEF_METACHARS "; *?\t\n'\"()<>|&"
#define DEF_METAESCAPE ""
/*
* HAVE_DUP is 1 if your system has the dup() call.
*/
#define HAVE_DUP 1
/* Define to 1 to support reading lesskey source files (not just binary). */
#define HAVE_LESSKEYSRC 1
/*
* Sizes of various buffers.
*/
#if 0 /* old sizes for small memory machines
#define CMDBUF_SIZE 512 /* Buffer for multichar commands */
#define UNGOT_SIZE 100 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 200 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 512 /* Max size of line in tags file */
#define TABSTOP_MAX 32 /* Max number of custom tab stops */
#else /* more reasonable sizes for modern machines */
#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */
#define UNGOT_SIZE 200 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 2048 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 1024 /* Max size of line in tags file */
#define TABSTOP_MAX 128 /* Max number of custom tab stops */
#endif
/* Define to `long' if doesn't define. */
#if MSDOS_COMPILER==BORLANDC
#define off_t long
#endif
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/*
* Regular expression library.
* Define exactly one of the following to be 1:
* HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h
* HAVE_RE_COMP: BSD re_comp()
* HAVE_REGCMP: System V regcmp()
* HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h
* NO_REGEX: pattern matching is supported, but without metacharacters.
*/
/* #undef HAVE_POSIX_REGCOMP */
/* #undef HAVE_RE_COMP */
/* #undef HAVE_REGCMP */
/* #undef HAVE_V8_REGCOMP */
#if MSDOS_COMPILER==DJGPPC
#define HAVE_POSIX_REGCOMP 1
#else
#define NO_REGEX 1
#endif
/* Define HAVE_VOID if your compiler supports the "void" type. */
#define HAVE_VOID 1
/* Define HAVE_CONST if your compiler supports the "const" modifier. */
#define HAVE_CONST 1
/* Define HAVE_TIME_T if your system supports the "time_t" type. */
#define HAVE_TIME_T 1
/* Define HAVE_STRERROR if you have the strerror() function. */
#define HAVE_STRERROR 1
/* Define HAVE_FILENO if you have the fileno() macro. */
#define HAVE_FILENO 1
/* Define HAVE_ERRNO if you have the errno variable */
/* Define MUST_DEFINE_ERRNO if you have errno but it is not defined
* in errno.h */
#if MSDOS_COMPILER==MSOFTC || MSDOS_COMPILER==DJGPPC
#define HAVE_ERRNO 1
#define MUST_DEFINE_ERRNO 0
#else
#define HAVE_ERRNO 1
#define MUST_DEFINE_ERRNO 1
#endif
/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
#define HAVE_SYS_ERRLIST 1
/* Define HAVE_OSPEED if your termcap library has the ospeed variable */
/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined
* in termcap.h. */
#define HAVE_OSPEED 0
#define MUST_DEFINE_OSPEED 0
/* Define HAVE_LOCALE if you have locale.h and setlocale. */
#define HAVE_LOCALE 0
/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */
#define HAVE_TERMIOS_FUNCS 0
/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */
#define HAVE_UPPER_LOWER 1
/* Define if you have the _setjmp function. */
#if MSDOS_COMPILER==MSOFTC || MSDOS_COMPILER==DJGPPC
#define HAVE__SETJMP 0
#else
#define HAVE__SETJMP 1
#endif
/* Define if you have the memcpy function. */
#define HAVE_MEMCPY 1
/* Define if you have the popen function. */
#if MSDOS_COMPILER==DJGPPC
#define HAVE_POPEN 1
#else
#define HAVE_POPEN 0
#endif
/* Define if you have the sigsetmask function. */
#define HAVE_SIGSETMASK 0
/* Define if you have the sigprocmask function. */
#define HAVE_SIGPROCMASK 0
/* Define if you have the sigset_t type and sigemptyset macro */
#define HAVE_SIGSET_T 0
#define HAVE_SIGEMPTYSET 0
/* Define if you have the stat function. */
#define HAVE_STAT 1
/* Define if you have the strchr function. */
#define HAVE_STRCHR 1
/* Define if you have the system function. */
#define HAVE_SYSTEM 1
/* Define if you have the snprintf function. */
#define HAVE_SNPRINTF 0
/* Define if you have the header file. */
#define HAVE_CTYPE_H 1
/* Define if you have the header file. */
#define HAVE_WCTYPE_H 0
/* Define if you have the header file. */
#define HAVE_ERRNO_H 1
/* Define if you have the header file. */
#define HAVE_FCNTL_H 1
/* Define HAVE_FLOAT if your compiler supports the "double" type. */
#define HAVE_FLOAT 1
/* Define if you have the header file. */
#define HAVE_LIMITS_H 1
/* Define if you have the header file. */
#define HAVE_STDIO_H 1
/* Define if you have the header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the header file. */
#define HAVE_STRING_H 1
/* Define if you have the header file. */
#define HAVE_SYS_IOCTL_H 0
/* Define if you have the header file. */
#define HAVE_SYS_PTEM_H 0
/* Define if you have the header file. */
#define HAVE_SYS_STREAM_H 0
/* Define if you have the header file. */
#define HAVE_TERMCAP_H 0
/* Define if you have the header file. */
#define HAVE_TERMIO_H 0
/* Define if you have the header file. */
#define HAVE_TERMIOS_H 0
/* Define if you have the header file. */
#define HAVE_TIME_H 1
/* Define if you have the header file. */
#if MSDOS_COMPILER==DJGPPC
#define HAVE_UNISTD_H 1
#else
#define HAVE_UNISTD_H 0
#endif
/* Define if you have the header file. */
#if MSDOS_COMPILER==MSOFTC
#define HAVE_VALUES_H 0
#else
#define HAVE_VALUES_H 1
#endif
#if MSDOS_COMPILER == MSOFTC && _MSC_VER >= 700
/*
* The names of these things changed in Microsoft C version 7.0.
*/
#define videoconfig _videoconfig
#define rccoord _rccoord
#define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY
#define O_APPEND _O_APPEND
#define O_BINARY _O_BINARY
#define O_TEXT _O_TEXT
#define find_t _find_t
#define stat _stat
#define S_IFMT _S_IFMT
#define S_IFDIR _S_IFDIR
#define S_IFREG _S_IFREG
#define dup _dup
#define open _open
#define lseek _lseek
#define write _write
#define creat _creat
#define fstat _fstat
#define isatty _isatty
#define close _close
#define read _read
#define ungetch _ungetch
#define kbhit _kbhit
#define getch _getch
#endif
diff --git a/defines.h.in b/defines.h.in
index 9a36f1b857f2..e5559d1153f9 100644
--- a/defines.h.in
+++ b/defines.h.in
@@ -1,464 +1,468 @@
/* defines.h.in. Generated from configure.ac by autoheader. */
/* Unix definition file for less. -*- C -*-
*
* This file has 3 sections:
* User preferences.
* Settings always true on Unix.
* Settings automatically determined by configure.
*
* * * * * * WARNING * * * * * *
* If you edit defines.h by hand, do "touch stamp-h" before you run make
* so config.status doesn't overwrite your changes.
*/
/* User preferences. */
/*
* SECURE is 1 if you wish to disable a bunch of features in order to
* be safe to run by unprivileged users.
* SECURE_COMPILE is set by the --with-secure configure option.
*/
#define SECURE SECURE_COMPILE
/*
* SHELL_ESCAPE is 1 if you wish to allow shell escapes.
* (This is possible only if your system supplies the system() function.)
*/
#define SHELL_ESCAPE (!SECURE)
/*
* EXAMINE is 1 if you wish to allow examining files by name from within less.
*/
#define EXAMINE (!SECURE)
/*
* TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key
* to complete filenames at prompts.
*/
#define TAB_COMPLETE_FILENAME (!SECURE)
/*
* CMD_HISTORY is 1 if you wish to allow keys to cycle through
* previous commands at prompts.
*/
#define CMD_HISTORY 1
/*
* HILITE_SEARCH is 1 if you wish to have search targets to be
* displayed in standout mode.
*/
#define HILITE_SEARCH 1
/*
* EDITOR is 1 if you wish to allow editor invocation (the "v" command).
* (This is possible only if your system supplies the system() function.)
* EDIT_PGM is the name of the (default) editor to be invoked.
*/
#define EDITOR (!SECURE)
/*
* TAGS is 1 if you wish to support tag files.
*/
#define TAGS (!SECURE)
/*
* USERFILE is 1 if you wish to allow a .less file to specify
* user-defined key bindings.
*/
#define USERFILE (!SECURE)
/*
* GLOB is 1 if you wish to have shell metacharacters expanded in filenames.
* This will generally work if your system provides the "popen" function
* and the "echo" shell command.
*/
#define GLOB (!SECURE)
/*
* PIPEC is 1 if you wish to have the "|" command
* which allows the user to pipe data into a shell command.
*/
#define PIPEC (!SECURE && HAVE_POPEN)
/*
* LOGFILE is 1 if you wish to allow the -o option (to create log files).
*/
#define LOGFILE (!SECURE)
/*
* GNU_OPTIONS is 1 if you wish to support the GNU-style command
* line options --help and --version.
*/
#define GNU_OPTIONS 1
/*
* ONLY_RETURN is 1 if you want RETURN to be the only input which
* will continue past an error message.
* Otherwise, any key will continue past an error message.
*/
#define ONLY_RETURN 0
/*
* LESSKEYFILE is the filename of the default lesskey output file
* (in the HOME directory).
* LESSKEYFILE_SYS is the filename of the system-wide lesskey output file.
* DEF_LESSKEYINFILE is the filename of the default lesskey input
* (in the HOME directory).
* LESSHISTFILE is the filename of the history file
* (in the HOME directory).
*/
#define LESSKEYFILE ".less"
#define LESSKEYFILE_SYS SYSDIR "/sysless"
#define DEF_LESSKEYINFILE ".lesskey"
#define LESSKEYINFILE_SYS SYSDIR "/syslesskey"
#define LESSHISTFILE ".lesshst"
/* Settings always true on Unix. */
/*
* Define MSDOS_COMPILER if compiling under Microsoft C.
*/
#define MSDOS_COMPILER 0
/*
* Pathname separator character.
*/
#define PATHNAME_SEP "/"
/*
* The value returned from tgetent on success.
* Some HP-UX systems return 0 on success.
*/
#define TGETENT_OK 1
/*
* HAVE_ANSI_PROTOS is 1 if your compiler supports ANSI function prototypes.
*/
#define HAVE_ANSI_PROTOS 1
/*
* HAVE_SYS_TYPES_H is 1 if your system has .
*/
#define HAVE_SYS_TYPES_H 1
/*
* Define if you have the header file.
*/
#undef HAVE_SGSTAT_H
/*
* HAVE_PERROR is 1 if your system has the perror() call.
* (Actually, if it has sys_errlist, sys_nerr and errno.)
*/
#define HAVE_PERROR 1
/*
* HAVE_TIME is 1 if your system has the time() call.
*/
#define HAVE_TIME 1
/*
* HAVE_SHELL is 1 if your system supports a SHELL command interpreter.
*/
#define HAVE_SHELL 1
/*
* Default shell metacharacters and meta-escape character.
*/
#define DEF_METACHARS "; *?\t\n'\"()<>[]|&^`#\\$%=~{},"
#define DEF_METAESCAPE "\\"
/*
* HAVE_DUP is 1 if your system has the dup() call.
*/
#define HAVE_DUP 1
/* Define to 1 if you have the memcpy() function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the strchr() function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the strstr() function. */
#define HAVE_STRSTR 1
/* Define to 1 to support reading lesskey source files (not just binary). */
#define HAVE_LESSKEYSRC 1
/*
* Sizes of various buffers.
*/
#if 0 /* old sizes for small memory machines */
#define CMDBUF_SIZE 512 /* Buffer for multichar commands */
#define UNGOT_SIZE 100 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 200 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 512 /* Max size of line in tags file */
#define TABSTOP_MAX 32 /* Max number of custom tab stops */
#else /* more reasonable sizes for modern machines */
#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */
#define UNGOT_SIZE 200 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 2048 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 1024 /* Max size of line in tags file */
#define TABSTOP_MAX 128 /* Max number of custom tab stops */
#endif
/* Settings automatically determined by configure. */
/* Define EDIT_PGM to your editor. */
#undef EDIT_PGM
/* Define HAVE_CONST if your compiler supports the "const" modifier. */
#undef HAVE_CONST
/* Define to 1 if you have the header file. */
#undef HAVE_CTYPE_H
/* Define HAVE_ERRNO if you have the errno variable. */
#undef HAVE_ERRNO
/* Define to 1 if you have the header file. */
#undef HAVE_ERRNO_H
/* Define to 1 if you have the `fchmod' function. */
#undef HAVE_FCHMOD
/* Define to 1 if you have the header file. */
#undef HAVE_FCNTL_H
/* Define HAVE_FILENO if you have the fileno() macro. */
#undef HAVE_FILENO
/* Define HAVE_FLOAT if your compiler supports the "double" type. */
#undef HAVE_FLOAT
/* Define to 1 if you have the `fsync' function. */
#undef HAVE_FSYNC
/* GNU regex library */
#undef HAVE_GNU_REGEX
/* Define to 1 if you have the header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the header file. */
#undef HAVE_LIMITS_H
/* Define HAVE_LOCALE if you have locale.h and setlocale. */
#undef HAVE_LOCALE
/* Define to 1 if you have the header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `nanosleep' function. */
#undef HAVE_NANOSLEEP
/* Define HAVE_OSPEED if your termcap library has the ospeed variable. */
#undef HAVE_OSPEED
/* PCRE (Perl-compatible regular expression) library */
#undef HAVE_PCRE
/* PCRE2 (Perl-compatible regular expression) library */
#undef HAVE_PCRE2
/* Define to 1 if you have the `poll' function. */
#undef HAVE_POLL
/* Define to 1 if you have the `popen' function. */
#undef HAVE_POPEN
/* POSIX regcomp() and regex.h */
#undef HAVE_POSIX_REGCOMP
+/* Define HAVE_PROCFS if have have fstatfs with f_type and PROC_SUPER_MAGIC.
+ */
+#undef HAVE_PROCFS
+
/* Define to 1 if you have the `realpath' function. */
#undef HAVE_REALPATH
/* System V regcmp() */
#undef HAVE_REGCMP
/* */
#undef HAVE_REGEXEC2
/* BSD re_comp() */
#undef HAVE_RE_COMP
/* Define HAVE_SIGEMPTYSET if you have the sigemptyset macro. */
#undef HAVE_SIGEMPTYSET
/* Define to 1 if you have the `sigprocmask' function. */
#undef HAVE_SIGPROCMASK
/* Define to 1 if you have the `sigsetmask' function. */
#undef HAVE_SIGSETMASK
/* Define to 1 if the system has the type `sigset_t'. */
#undef HAVE_SIGSET_T
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the `stat' function. */
#undef HAVE_STAT
/* Define HAVE_STAT_INO if your struct stat has st_ino and st_dev. */
#undef HAVE_STAT_INO
/* Define to 1 if you have the header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDLIB_H
/* Define HAVE_STRERROR if you have the strerror() function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `system' function. */
#undef HAVE_SYSTEM
/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable. */
#undef HAVE_SYS_ERRLIST
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_STREAM_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the header file. */
#undef HAVE_TERMCAP_H
/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr. */
#undef HAVE_TERMIOS_FUNCS
/* Define to 1 if you have the header file. */
#undef HAVE_TERMIOS_H
/* Define to 1 if you have the header file. */
#undef HAVE_TERMIO_H
/* Define to 1 if you have the header file. */
#undef HAVE_TIME_H
/* Define HAVE_TIME_T if your system supports the "time_t" type. */
#undef HAVE_TIME_T
/* Define to 1 if you have the `ttyname' function. */
#undef HAVE_TTYNAME
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower. */
#undef HAVE_UPPER_LOWER
/* Define to 1 if you have the `usleep' function. */
#undef HAVE_USLEEP
/* Henry Spencer V8 regcomp() and regexp.h */
#undef HAVE_V8_REGCOMP
/* Define to 1 if you have the header file. */
#undef HAVE_VALUES_H
/* Define HAVE_VOID if your compiler supports the "void" type. */
#undef HAVE_VOID
/* Define HAVE_WCTYPE if you have iswupper, iswlower, towupper, towlower. */
#undef HAVE_WCTYPE
/* Define to 1 if you have the header file. */
#undef HAVE_WCTYPE_H
/* Define to 1 if you have the `_setjmp' function. */
#undef HAVE__SETJMP
/* Define MUST_DEFINE_ERRNO if you have errno but it is not define in errno.h.
*/
#undef MUST_DEFINE_ERRNO
/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined in
termcap.h. */
#undef MUST_DEFINE_OSPEED
/* pattern matching is supported, but without metacharacters. */
#undef NO_REGEX
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Define SECURE_COMPILE=1 to build a secure version of less. */
#undef SECURE_COMPILE
/* Define to 1 if the `S_IS*' macros in do not work properly. */
#undef STAT_MACROS_BROKEN
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both and . */
#undef TIME_WITH_SYS_TIME
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `long int' if does not define. */
#undef off_t
/* Define to `unsigned int' if does not define. */
#undef size_t
diff --git a/defines.o2 b/defines.o2
index 5499bb401c89..9438bb2634c4 100644
--- a/defines.o2
+++ b/defines.o2
@@ -1,348 +1,348 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
/* OS/2 definition file for less. */
/*
* This file has 2 sections:
* User preferences.
* Settings always true for the emx compiler for OS/2 systems.
*/
/* User preferences. */
/*
* SECURE is 1 if you wish to disable a bunch of features in order to
* be safe to run by unprivileged users.
*/
#define SECURE 0
/*
* SHELL_ESCAPE is 1 if you wish to allow shell escapes.
* (This is possible only if your system supplies the system() function.)
*/
#define SHELL_ESCAPE (!SECURE)
/*
* EXAMINE is 1 if you wish to allow examining files by name from within less.
*/
#define EXAMINE (!SECURE)
/*
* TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key
* to complete filenames at prompts.
*/
#define TAB_COMPLETE_FILENAME (!SECURE)
/*
* CMD_HISTORY is 1 if you wish to allow keys to cycle through
* previous commands at prompts.
*/
#define CMD_HISTORY 1
/*
* HILITE_SEARCH is 1 if you wish to have search targets to be
* displayed in standout mode.
*/
#define HILITE_SEARCH 1
/*
* EDITOR is 1 if you wish to allow editor invocation (the "v" command).
* (This is possible only if your system supplies the system() function.)
* EDIT_PGM is the name of the (default) editor to be invoked.
*/
#define EDITOR (!SECURE)
#define EDIT_PGM "vi"
/*
* TAGS is 1 if you wish to support tag files.
*/
#define TAGS (!SECURE)
/*
* USERFILE is 1 if you wish to allow a .less file to specify
* user-defined key bindings.
*/
#define USERFILE (!SECURE)
/*
* GLOB is 1 if you wish to have shell metacharacters expanded in filenames.
* This will generally work if your system provides the "popen" function
* and the "echo" shell command.
*/
#define GLOB (!SECURE)
/*
* PIPEC is 1 if you wish to have the "|" command
* which allows the user to pipe data into a shell command.
*/
#define PIPEC (!SECURE)
/*
* LOGFILE is 1 if you wish to allow the -o option (to create log files).
*/
#define LOGFILE (!SECURE)
/*
* GNU_OPTIONS is 1 if you wish to support the GNU-style command
* line options --help and --version.
*/
#define GNU_OPTIONS 1
/*
* ONLY_RETURN is 1 if you want RETURN to be the only input which
* will continue past an error message.
* Otherwise, any key will continue past an error message.
*/
#define ONLY_RETURN 0
/*
* LESSKEYFILE is the filename of the default lesskey output file
* (in the HOME directory).
* LESSKEYFILE_SYS is the filename of the system-wide lesskey output file.
* DEF_LESSKEYINFILE is the filename of the default lesskey input
* (in the HOME directory).
* LESSHISTFILE is the filename of the history file
* (in the HOME directory).
*/
#define LESSKEYFILE "less.ini"
#define LESSKEYFILE_SYS "C:\\sysless.ini"
#define DEF_LESSKEYINFILE "lesskey.ini"
#define LESSKEYINFILE_SYS "C:\\syslesskey.ini"
#define LESSHISTFILE "lesshst.ini"
/* Settings always true for the emx compiler for OS/2 systems. */
#define OS2 1
/*
* Pathname separator character.
*/
#define PATHNAME_SEP "\\"
/*
* HAVE_ANSI_PROTOS is 1 if your compiler supports ANSI function prototypes.
*/
#define HAVE_ANSI_PROTOS 1
/*
* HAVE_SYS_TYPES_H is 1 if your system has .
*/
#define HAVE_SYS_TYPES_H 1
/*
* Define if you have the header file.
*/
#define HAVE_SGSTAT_H 0
/*
* HAVE_PERROR is 1 if your system has the perror() call.
* (Actually, if it has sys_errlist, sys_nerr and errno.)
*/
#define HAVE_PERROR 1
/*
* HAVE_TIME is 1 if your system has the time() call.
*/
#define HAVE_TIME 1
/*
* HAVE_SHELL is 1 if your system supports a SHELL command interpreter.
*/
#define HAVE_SHELL 0
/*
* Default shell metacharacters and meta-escape character.
*/
#define DEF_METACHARS "; *?\t\n'\"()<>|&"
#define DEF_METAESCAPE ""
/*
* HAVE_DUP is 1 if your system has the dup() call.
*/
#define HAVE_DUP 1
/* Define to 1 to support reading lesskey source files (not just binary). */
#define HAVE_LESSKEYSRC 1
/*
* Sizes of various buffers.
*/
#if 0 /* old sizes for small memory machines
#define CMDBUF_SIZE 512 /* Buffer for multichar commands */
#define UNGOT_SIZE 100 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 200 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 512 /* Max size of line in tags file */
#define TABSTOP_MAX 32 /* Max number of custom tab stops */
#else /* more reasonable sizes for modern machines */
#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */
#define UNGOT_SIZE 200 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 2048 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 1024 /* Max size of line in tags file */
#define TABSTOP_MAX 128 /* Max number of custom tab stops */
#endif
/* Define to `long' if doesn't define. */
/* #define off_t long */
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/*
* Regular expression library.
* Define exactly one of the following to be 1:
* HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h
* HAVE_RE_COMP: BSD re_comp()
* HAVE_REGCMP: System V regcmp()
* HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h
* NO_REGEX: pattern matching is supported, but without metacharacters.
*/
/* #undef HAVE_POSIX_REGCOMP */
/* #undef HAVE_RE_COMP */
/* #undef HAVE_REGCMP */
#define HAVE_V8_REGCOMP 1
/* #undef NO_REGEX */
#define HAVE_REGEXEC2 1
/* Define HAVE_VOID if your compiler supports the "void" type. */
#define HAVE_VOID 1
/* Define HAVE_CONST if your compiler supports the "const" modifier. */
#define HAVE_CONST 1
/* Define HAVE_TIME_T if your system supports the "time_t" type. */
#define HAVE_TIME_T 1
/* Define HAVE_STRERROR if you have the strerror() function. */
#define HAVE_STRERROR 1
/* Define HAVE_FILENO if you have the fileno() macro. */
#define HAVE_FILENO 1
/* Define HAVE_ERRNO if you have the errno variable */
/* Define MUST_DEFINE_ERRNO if you have errno but it is not define
* in errno.h */
#define HAVE_ERRNO 1
/* #undef MUST_DEFINE_ERRNO */
/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
#define HAVE_SYS_ERRLIST 1
/* Define HAVE_OSPEED if your termcap library has the ospeed variable */
#define HAVE_OSPEED 1
/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined
* in termcap.h. */
#define MUST_DEFINE_OSPEED 0
/* Define HAVE_LOCALE if you have locale.h and setlocale. */
#define HAVE_LOCALE 1
/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */
#define HAVE_TERMIOS_FUNCS 1
/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */
#define HAVE_UPPER_LOWER 1
/* Define if you have the _setjmp function. */
#define HAVE__SETJMP 0
/* Define if you have the memcpy function. */
#define HAVE_MEMCPY 1
/* Define if you have the popen function. */
#define HAVE_POPEN 1
/* Define if you have the sigsetmask function. */
#define HAVE_SIGSETMASK 0
/* Define if you have the sigprocmask function. */
#define HAVE_SIGPROCMASK 1
/* Define if you have the sigset_t type and sigemptyset macro */
#define HAVE_SIGSET_T 1
#define HAVE_SIGEMPTYSET 1
/* Define if you have the stat function. */
#define HAVE_STAT 1
/* Define if you have the strchr function. */
#define HAVE_STRCHR 1
/* Define if you have the strstr function. */
#define HAVE_STRSTR 1
/* Define if you have the system function. */
#define HAVE_SYSTEM 1
/* Define if you have the snprintf function. */
#define HAVE_SNPRINTF 0
/* Define if you have the header file. */
#define HAVE_CTYPE_H 1
/* Define if you have the header file. */
#define HAVE_WCTYPE_H 0
/* Define if you have the header file. */
#define HAVE_ERRNO_H 1
/* Define if you have the header file. */
#define HAVE_FCNTL_H 1
/* Define if you have the header file. */
#define HAVE_LIMITS_H 1
/* Define if you have the header file. */
#define HAVE_STDIO_H 1
/* Define if you have the header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the header file. */
#define HAVE_STRING_H 1
/* Define if you have the header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define if you have the header file. */
#define HAVE_SYS_PTEM_H 0
/* Define if you have the header file. */
#define HAVE_SYS_STREAM_H 0
/* Define if you have the header file. */
#define HAVE_TERMCAP_H 1
/* Define if you have the header file. */
#define HAVE_TERMIO_H 1
/* Define if you have the header file. */
#define HAVE_TERMIOS_H 1
/* Define if you have the header file. */
#define HAVE_TIME_H 1
/* Define if you have the header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the header file. */
#define HAVE_VALUES_H 0
diff --git a/defines.o9 b/defines.o9
index cb5de661ec99..28a93d66954c 100644
--- a/defines.o9
+++ b/defines.o9
@@ -1,360 +1,360 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
/* OS/9 definition file for less. */
/*
* This file has 2 sections:
* User preferences.
* Settings always true for OS-9 systems.
*/
/* User preferences. */
/*
* SECURE is 1 if you wish to disable a bunch of features in order to
* be safe to run by unprivileged users.
*/
#define SECURE 0
/*
* SHELL_ESCAPE is 1 if you wish to allow shell escapes.
* (This is possible only if your system supplies the system() function.)
*/
#define SHELL_ESCAPE (!SECURE)
/*
* EXAMINE is 1 if you wish to allow examining files by name from within less.
*/
#define EXAMINE (!SECURE)
/*
* TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key
* to complete filenames at prompts.
*/
#define TAB_COMPLETE_FILENAME 1
/*
* CMD_HISTORY is 1 if you wish to allow keys to cycle through
* previous commands at prompts.
*/
#define CMD_HISTORY 1
/*
* HILITE_SEARCH is 1 if you wish to have search targets to be
* displayed in standout mode.
*/
#define HILITE_SEARCH 1
/*
* EDITOR is 1 if you wish to allow editor invocation (the "v" command).
* (This is possible only if your system supplies the system() function.)
* EDIT_PGM is the name of the (default) editor to be invoked.
*/
#define EDITOR (!SECURE)
#define EDIT_PGM "umacs"
/*
* TAGS is 1 if you wish to support tag files.
*/
#define TAGS (!SECURE)
/*
* USERFILE is 1 if you wish to allow a .less file to specify
* user-defined key bindings.
*/
#define USERFILE (!SECURE)
/*
* GLOB is 1 if you wish to have shell metacharacters expanded in filenames.
* This will generally work if your system provides the "popen" function
* and the "echo" shell command.
*/
#define GLOB (!SECURE)
/*
* PIPEC is 1 if you wish to have the "|" command
* which allows the user to pipe data into a shell command.
*/
#define PIPEC (!SECURE)
/*
* LOGFILE is 1 if you wish to allow the -o option (to create log files).
*/
#define LOGFILE (!SECURE)
/*
* GNU_OPTIONS is 1 if you wish to support the GNU-style command
* line options --help and --version.
*/
#define GNU_OPTIONS 1
/*
* ONLY_RETURN is 1 if you want RETURN to be the only input which
* will continue past an error message.
* Otherwise, any key will continue past an error message.
*/
#define ONLY_RETURN 0
/*
* LESSKEYFILE is the filename of the default lesskey output file
* (in the HOME directory).
* LESSKEYFILE_SYS is the filename of the system-wide lesskey output file.
* DEF_LESSKEYINFILE is the filename of the default lesskey input
* (in the HOME directory).
* LESSHISTFILE is the filename of the history file
* (in the HOME directory).
*/
#define LESSKEYFILE ".less"
#define LESSKEYFILE_SYS "/.sysless"
#define DEF_LESSKEYINFILE ".lesskey"
#define LESSKEYINFILE_SYS "/.syslesskey"
#define LESSHISTFILE ".lesshst"
/* Settings always true for OS-9. */
/* This is not needed; it is defined by the compiler. */
/* #define _OSK 1 */
#define OS2 0
#define MSDOS_COMPILER 0
/*
* Pathname separator character.
*/
#define PATHNAME_SEP "/"
/*
* HAVE_ANSI_PROTOS is 1 if your compiler supports ANSI function prototypes.
*/
#define HAVE_ANSI_PROTOS 1
/*
* HAVE_SYS_TYPES_H is 1 if your system has .
*/
#define HAVE_SYS_TYPES_H 0
/*
* Define if you have the header file.
*/
#define HAVE_SGSTAT_H 1
/*
* HAVE_PERROR is 1 if your system has the perror() call.
* (Actually, if it has sys_errlist, sys_nerr and errno.)
*/
#if _OSK_MWC32
#define HAVE_PERROR 0
#else
#define HAVE_PERROR 1
#endif
/*
* HAVE_TIME is 1 if your system has the time() call.
*/
#define HAVE_TIME 1
/*
* HAVE_SHELL is 1 if your system supports a SHELL command interpreter.
*/
#define HAVE_SHELL 0
/*
* Default shell metacharacters and meta-escape character.
*/
#define DEF_METACHARS "; \t\n'\"()<>|&^`#\\"
#define DEF_METAESCAPE "\\"
/*
* HAVE_DUP is 1 if your system has the dup() call.
*/
#define HAVE_DUP 0
/* Define to 1 to support reading lesskey source files (not just binary). */
#define HAVE_LESSKEYSRC 1
/*
* Sizes of various buffers.
*/
#if 0 /* old sizes for small memory machines
#define CMDBUF_SIZE 512 /* Buffer for multichar commands */
#define UNGOT_SIZE 100 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 200 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 512 /* Max size of line in tags file */
#define TABSTOP_MAX 32 /* Max number of custom tab stops */
#else /* more reasonable sizes for modern machines */
#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */
#define UNGOT_SIZE 200 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 2048 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 1024 /* Max size of line in tags file */
#define TABSTOP_MAX 128 /* Max number of custom tab stops */
#endif
/* Define to `long' if doesn't define. */
#define off_t long
/* Define if you need to in order for stat and other things to work. */
#define _POSIX_SOURCE 0
/* Define as the return type of signal handlers (int or void). */
#if _OSK_MWC32
#define RETSIGTYPE int
#else
#define RETSIGTYPE void
#endif
/*
* Regular expression library.
* Define exactly one of the following to be 1:
* HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h
* HAVE_RE_COMP: BSD re_comp()
* HAVE_REGCMP: System V regcmp()
* HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h
* NO_REGEX: pattern matching is supported, but without metacharacters.
*/
#define HAVE_POSIX_REGCOMP 0
#define HAVE_RE_COMP 0
#define HAVE_REGCMP 0
#define HAVE_V8_REGCOMP 1
#define NO_REGEX 0
#define HAVE_REGEXEC2 1
/* Define HAVE_VOID if your compiler supports the "void" type. */
#define HAVE_VOID 1
/* Define HAVE_CONST if your compiler supports the "const" modifier. */
#define HAVE_CONST 0
/* Define HAVE_TIME_T if your system supports the "time_t" type. */
#define HAVE_TIME_T 1
/* Define HAVE_STRERROR if you have the strerror() function. */
#define HAVE_STRERROR 0
/* Define HAVE_FILENO if you have the fileno() macro. */
#define HAVE_FILENO 1
/* Define HAVE_ERRNO if you have the errno variable */
/* Define MUST_DEFINE_ERRNO if you have errno but it is not define
* in errno.h */
#define HAVE_ERRNO 1
#define MUST_DEFINE_ERRNO 0
/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
#define HAVE_SYS_ERRLIST 0
/* Define HAVE_OSPEED if your termcap library has the ospeed variable */
/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined
* in termcap.h. */
#define HAVE_OSPEED 0
#define MUST_DEFINE_OSPEED 0
/* Define HAVE_LOCALE if you have locale.h and setlocale. */
#define HAVE_LOCALE 0
/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */
#define HAVE_TERMIOS_FUNCS 0
/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */
#define HAVE_UPPER_LOWER 1
/* Define if you have the _setjmp function. */
#define HAVE__SETJMP 1
/* Define if you have the memcpy function. */
#define HAVE_MEMCPY 1
/* Define if you have the popen function. */
#define HAVE_POPEN 1
/* Define if you have the sigsetmask function. */
#define HAVE_SIGSETMASK 0
/* Define if you have the sigprocmask function. */
#define HAVE_SIGPROCMASK 0
/* Define if you have the sigset_t type and sigemptyset macro */
#define HAVE_SIGSET_T 0
#define HAVE_SIGEMPTYSET 0
/* Define if you have the stat function. */
#define HAVE_STAT 0
/* Define if you have the strchr function. */
#define HAVE_STRCHR 0
/* Define if you have the system function. */
#define HAVE_SYSTEM 1
/* Define if you have the snprintf function. */
#define HAVE_SNPRINTF 0
/* Define if you have the header file. */
#define HAVE_CTYPE_H 1
/* Define if you have the header file. */
#define HAVE_WCTYPE_H 0
/* Define if you have the header file. */
#define HAVE_ERRNO_H 1
/* Define if you have the header file. */
#define HAVE_FCNTL_H 0
/* Define if you have the header file. */
#define HAVE_LIMITS_H 0
/* Define if you have the header file. */
#define HAVE_STDIO_H 1
/* Define if you have the header file. */
#define HAVE_STRING_H 1
/* Define if you have the header file. */
#if _OSK_MWC32
#define HAVE_STDLIB_H 0
#else
#define HAVE_STDLIB_H 1
#endif
/* Define if you have the header file. */
#define HAVE_SYS_IOCTL_H 0
/* Define if you have the header file. */
#define HAVE_SYS_PTEM_H 0
/* Define if you have the header file. */
#define HAVE_SYS_STREAM_H 0
/* Define if you have the header file. */
#define HAVE_TERMCAP_H 1
/* Define if you have the header file. */
#define HAVE_TERMIO_H 0
/* Define if you have the header file. */
#define HAVE_TERMIOS_H 0
/* Define if you have the header file. */
#define HAVE_TIME_H 1
/* Define if you have the header file. */
#define HAVE_UNISTD_H 0
/* Define if you have the header file. */
#define HAVE_VALUES_H 0
diff --git a/defines.wn b/defines.wn
index 390eb17e834e..30592cad3785 100644
--- a/defines.wn
+++ b/defines.wn
@@ -1,391 +1,391 @@
/*
- * Copyright (C) 1984-2021 Mark Nudelman
+ * Copyright (C) 1984-2022 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
/* Windows definition file for less. */
/*
* This file has 2 sections:
* User preferences.
* Settings always true for Windows systems.
*/
/* User preferences. */
/*
* SECURE is 1 if you wish to disable a bunch of features in order to
* be safe to run by unprivileged users.
*/
#define SECURE 0
/*
* SHELL_ESCAPE is 1 if you wish to allow shell escapes.
* (This is possible only if your system supplies the system() function.)
*/
#define SHELL_ESCAPE (!SECURE)
/*
* EXAMINE is 1 if you wish to allow examining files by name from within less.
*/
#define EXAMINE (!SECURE)
/*
* TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key
* to complete filenames at prompts.
*/
#define TAB_COMPLETE_FILENAME (!SECURE)
/*
* CMD_HISTORY is 1 if you wish to allow keys to cycle through
* previous commands at prompts.
*/
#define CMD_HISTORY 1
/*
* HILITE_SEARCH is 1 if you wish to have search targets to be
* displayed in standout mode.
*/
#define HILITE_SEARCH 1
/*
* EDITOR is 1 if you wish to allow editor invocation (the "v" command).
* (This is possible only if your system supplies the system() function.)
* EDIT_PGM is the name of the (default) editor to be invoked.
*/
#define EDITOR (!SECURE)
#define EDIT_PGM "edit"
/*
* TAGS is 1 if you wish to support tag files.
*/
#define TAGS (!SECURE)
/*
* USERFILE is 1 if you wish to allow a .less file to specify
* user-defined key bindings.
*/
#define USERFILE (!SECURE)
/*
* GLOB is 1 if you wish to have shell metacharacters expanded in filenames.
* This will generally work if your system provides the "popen" function
* and the "echo" shell command.
*/
#define GLOB 0
/*
* PIPEC is 1 if you wish to have the "|" command
* which allows the user to pipe data into a shell command.
*/
#define PIPEC 1
/*
* LOGFILE is 1 if you wish to allow the -o option (to create log files).
*/
#define LOGFILE (!SECURE)
/*
* GNU_OPTIONS is 1 if you wish to support the GNU-style command
* line options --help and --version.
*/
#define GNU_OPTIONS 1
/*
* ONLY_RETURN is 1 if you want RETURN to be the only input which
* will continue past an error message.
* Otherwise, any key will continue past an error message.
*/
#define ONLY_RETURN 0
/*
* LESSKEYFILE is the filename of the default lesskey output file
* (in the HOME directory).
* LESSKEYFILE_SYS is the filename of the system-wide lesskey output file.
* DEF_LESSKEYINFILE is the filename of the default lesskey input
* (in the HOME directory).
* LESSHISTFILE is the filename of the history file
* (in the HOME directory).
*/
#define LESSKEYFILE "_less"
#define LESSKEYFILE_SYS "c:\\_sysless"
#define DEF_LESSKEYINFILE "_lesskey"
#define LESSKEYINFILE_SYS "c:\\_syslesskey"
#define LESSHISTFILE "_lesshst"
/* Settings always true for Windows systems. */
#define MSDOS_COMPILER WIN32C
/*
* Pathname separator character.
*/
#define PATHNAME_SEP "\\"
/*
* HAVE_ANSI_PROTOS is 1 if your compiler supports ANSI function prototypes.
*/
#define HAVE_ANSI_PROTOS 1
/*
* HAVE_SYS_TYPES_H is 1 if your system has .
*/
#define HAVE_SYS_TYPES_H 1
/*
* Define if you have the header file.
*/
#define HAVE_SGSTAT_H 0
/*
* HAVE_PERROR is 1 if your system has the perror() call.
* (Actually, if it has sys_errlist, sys_nerr and errno.)
*/
#define HAVE_PERROR 1
/*
* HAVE_TIME is 1 if your system has the time() call.
*/
#define HAVE_TIME 1
/*
* HAVE_SHELL is 1 if your system supports a SHELL command interpreter.
*/
#define HAVE_SHELL 0
/*
* Default shell metacharacters and meta-escape character.
*/
#define DEF_METACHARS "; *?\t\n'\"()<>|&"
#define DEF_METAESCAPE ""
/*
* HAVE_DUP is 1 if your system has the dup() call.
*/
#define HAVE_DUP 1
/* Define to 1 to support reading lesskey source files (not just binary). */
#define HAVE_LESSKEYSRC 1
/*
* Sizes of various buffers.
*/
#if 0 /* old sizes for small memory machines */
#define CMDBUF_SIZE 512 /* Buffer for multichar commands */
#define UNGOT_SIZE 100 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 200 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 512 /* Max size of line in tags file */
#define TABSTOP_MAX 32 /* Max number of custom tab stops */
#else /* more reasonable sizes for modern machines */
#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */
#define UNGOT_SIZE 200 /* Max chars to unget() */
#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */
#define OUTBUF_SIZE 1024 /* Output buffer */
#define PROMPT_SIZE 2048 /* Max size of prompt string */
#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
#define TAGLINE_SIZE 1024 /* Max size of line in tags file */
#define TABSTOP_MAX 128 /* Max number of custom tab stops */
#endif
/* Define to `long' if doesn't define. */
/* #define off_t long */
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/*
* Regular expression library.
* Define exactly one of the following to be 1:
* HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h
* HAVE_RE_COMP: BSD re_comp()
* HAVE_REGCMP: System V regcmp()
* HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h
* NO_REGEX: pattern matching is supported, but without metacharacters.
*/
/* #undef HAVE_POSIX_REGCOMP */
/* #undef HAVE_RE_COMP */
/* #undef HAVE_REGCMP */
#ifdef MINGW
#ifdef USE_POSIX_REGCOMP
#define HAVE_POSIX_REGCOMP 1
#else
#ifdef USE_GNU_REGEX
#define HAVE_GNU_REGEX 1
#else
#ifdef USE_REGEXP_C
#define HAVE_V8_REGCOMP 1
#define HAVE_REGEXEC2 1
#else
#define NO_REGEX 1
#endif
#endif
#endif
#else
#define HAVE_V8_REGCOMP 1
/* #undef NO_REGEX */
#define HAVE_REGEXEC2 1
#endif
/* Define HAVE_VOID if your compiler supports the "void" type. */
#define HAVE_VOID 1
/* Define HAVE_CONST if your compiler supports the "const" modifier. */
#define HAVE_CONST 1
/* Define HAVE_TIME_T if your system supports the "time_t" type. */
#define HAVE_TIME_T 1
/* Define HAVE_STRERROR if you have the strerror() function. */
#define HAVE_STRERROR 1
/* Define HAVE_FILENO if you have the fileno() macro. */
#define HAVE_FILENO 1
/* Define HAVE_ERRNO if you have the errno variable */
/* Define MUST_DEFINE_ERRNO if you have errno but it is not define
* in errno.h */
#define HAVE_ERRNO 1
#ifdef MINGW
#define MUST_DEFINE_ERRNO 0
#else
#define MUST_DEFINE_ERRNO 1
#endif
/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
#define HAVE_SYS_ERRLIST 1
/* Define HAVE_OSPEED if your termcap library has the ospeed variable */
#define HAVE_OSPEED 0
/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined
* in termcap.h. */
#define MUST_DEFINE_OSPEED 0
/* Define HAVE_LOCALE if you have locale.h and setlocale. */
#define HAVE_LOCALE 0
/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */
#define HAVE_TERMIOS_FUNCS 0
/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */
#define HAVE_UPPER_LOWER 1
/* Define if you have the _setjmp function. */
#define HAVE__SETJMP 1
/* Define if you have the memcpy function. */
#define HAVE_MEMCPY 1
/* Define if you have the popen function. */
#define HAVE_POPEN 1
/* Define if you have the sigsetmask function. */
#define HAVE_SIGSETMASK 0
/* Define if you have the sigprocmask function. */
#define HAVE_SIGPROCMASK 0
/* Define if you have the sigset_t type and sigemptyset macro */
#define HAVE_SIGSET_T 0
#define HAVE_SIGEMPTYSET 0
/* Define if you have the stat function. */
#define HAVE_STAT 1
/* Define if you have the strchr function. */
#define HAVE_STRCHR 1
/* Define if you have the system function. */
#define HAVE_SYSTEM 1
/* Define if you have the snprintf function. */
#define HAVE_SNPRINTF 1
/* Define if you have the header file. */
#define HAVE_CTYPE_H 1
/* Define if you have the header file. */
#define HAVE_WCTYPE_H 1
/* Define if you have the header file. */
#define HAVE_ERRNO_H 1
/* Define if you have the