- update to wget 1.11.4

- update config.h with one generated with the BONE devkit under Zeta, should be enough.
- fixed config.h so it builds (we do have socklen_t, and stdbool.h)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26897 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2008-08-09 14:14:06 +00:00
parent 730798eb99
commit 88b1a3b340
227 changed files with 86114 additions and 46131 deletions

View File

@ -17,7 +17,8 @@ Junio Hamano. Added support for FTP Opie and HTTP digest
authentication.
Dan Harkless. Added --backup-converted, --follow-tags, --html-extension,
--ignore-tags, and --page-requisites; improved documentation; etc.
--ignore-tags, and --page-requisites; improved documentation; etc. Was
the principle maintainer of GNU Wget for some time.
Christian Fraenkel. Initially implemented SSL support.
@ -25,15 +26,19 @@ Thomas Lussnig. Initially implemented IPv6 support.
Ian Abbott. Contributed bugfixes, Windows-related fixes, provided a
prototype implementation of the new recursive code, and more.
Co-maintained Wget during the 1.8 release cycle.
Gisle Vanem. Contributed Windows improvements, including a port of
run_with_timeout to Windows, additions to Makefiles, and many bug
reports and fixes.
Gisle Vanem. Contributed Windows and MS-DOS improvements, including a
port of run_with_timeout to Windows, additions to Makefiles, and many
bug reports and fixes.
Mauro Tortonesi. Improved IPv6 support, adding support for dual
family systems. Refactored and enhanced FTP IPv6 code.
family systems. Refactored and enhanced FTP IPv6 code. Maintained GNU
Wget from 2004-2007.
Nicolas Schodet. Contributed to cookie code and documentation.
Daniel Stenberg. NTLM authentication in http-ntlm.c and http-ntlm.h
originally written for curl donated for use in GNU Wget.
Micah Cowan. Current Wget maintainer, from mid-2007.

View File

@ -1,285 +1,626 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
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
this service 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.
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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
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 give the recipients all the rights that
you have. 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.
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.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
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.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
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.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
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.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
TERMS AND CONDITIONS
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
0. Definitions.
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
"This License" refers to version 3 of the GNU General Public License.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
"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.
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
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.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
A "covered work" means either the unmodified Program or a work based
on the Program.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
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.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
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.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
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.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
1. Source Code.
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
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.
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
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.
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
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 source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
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.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
The Corresponding Source for a work in source code form is that
same work.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
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.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
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.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
13. Use with the GNU Affero General Public License.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
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.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
14. Revised Versions of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
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 a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
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.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
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.
NO WARRANTY
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.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
15. Disclaimer of Warranty.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE 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.
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.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
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
@ -287,15 +628,15 @@ 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
convey the exclusion of warranty; and each file should have at least
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
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,
@ -304,37 +645,30 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
<program> Copyright (C) <year> <name of author>
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, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
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 your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
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
<http://www.gnu.org/licenses/>.
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This 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 Library General
Public License instead of this License.
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
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -1,19 +1,294 @@
2008-06-29 Micah Cowan <micah@cowan.name>
* po/*.po: Sync with TP.
2008-05-12 Micah Cowan <micah@cowan.name>
* Makefile.in (dist): Create wget.pot first.
* NEWS: Translations and -N/-O.
2008-04-30 Micah Cowan <micah@cowan.name>
* NEWS: Added documentation for changes made in 1.11.2 so far.
* po/*.po: Sync with TP.
2008-03-24 Micah Cowan <micah@cowan.name>
* NEWS: Added documentation change re: --no-parents, and various
caveats on accept/reject lists behavior. Rearranged some items in
order of priority.
* po/*.po: Ensure synchronization with the TP, resync with
sources.
2008-02-14 Micah Cowan <micah@cowan.name>
* po/*.po: Updates from the Translation Project, resync with
sources.
2008-02-10 Micah Cowan <micah@cowan.name>
* NEWS: Added note re interrupted files resulting in renames,
and new --auth-no-challenge option.
2008-02-06 Micah Cowan <micah@cowan.name>
* configure.in (AC_CHECK_FUNCS): Added check for mbtowc.
* NEWS: Added notes regarding fixes for the localized progress
bar and --no-clobber wasted GET request.
2008-02-03 Micah Cowan <micah@cowan.name>
* configure.in: Add checks for wchar.h, wcwidth function (to
support column-counting in progress.c).
* NEWS: Added line for 1.11.1.
2008-01-26 Micah Cowan <micah@cowan.name>
* util/README, util/dist-wget, util/download-netscape.html,
util/download.html, util/update_po_files.sh, util/wget.spec:
Removed (obsolete and/or incomplete).
* DISTFILES: Removed the above entries from the dist.
2008-01-25 Micah Cowan <micah@cowan.name>
* Makefile.in, NEWS, README, autogen.sh, configure.bat,
configure.in, m4/wget.m4, po/POTFILES.in, util/Makefile.in,
util/dist-wget, util/rmold.pl: Update copyright year.
* DISTFILES: Added wget.pod, to avoid regeneration as a
dependency of wget.1, on systems that lack Perl.
2007-12-14 Micah Cowan <micah@cowan.name>
* po/cs.po, po/ja.po, po/nl.po, po/pt.po, po/sk.po: Updates from
the Translation Project.
2007-12-10 Micah Cowan <micah@cowan.name>
* NEWS: Removed developer-only notices (Autoconf, TODO, PATCHES,
GNUTLS).
2007-12-06 Micah Cowan <micah@cowan.name>
* Makefile.in, DISTFILES: Ensure that info and man pages are
included in the distribution.
2007-12-05 Micah Cowan <micah@cowan.name>
* NEWS: Reword warnings regarding --content-disposition.
2007-11-28 Micah Cowan <micah@cowan.name>
* Makefile.in, README, autogen.sh, configure.bat, configure.in,
m4/wget.m4, util/Makefile.in, util/dist-wget: Updated license
exception for OpenSSL, per the SFLC.
2007-11-19 Micah Cowan <micah@cowan.name>
* po/fi.po, po/hu.po, po/pt.po: Update from the Translation
Project.
2007-11-08 Micah Cowan <micah@cowan.name>
* po/be.po: Added new language support from the Translation
Project.
* DISTFILES: Added po/be.po.
2007-10-30 Micah Cowan <micah@cowan.name>
* po/it.po: Update from the Translation project.
2007-10-24 Micah Cowan <micah@schmendrick>
* po/vi.po, po/ga.po: Update from the Translation project.
2007-10-23 Micah Cowan <micah@schmendrick>
* po/de.po, po/ja.po: Update from the Translation Project.
2007-10-22 Micah Cowan <micah@cowan.name>
* po/*: Update from the Translation Project, and synced
against current source.
2007-10-13 Micah Cowan <micah@cowan.name>
* DISTFILES: Now hard-coded (just for 1.11; we use Automake for
1.12+.
* Makefile.in: Removed DISTFILES target, "make distclean" in
distdir (no Makefile is included in the distribution). Handle
".hg" dirs in addition to ".svn".
2007-10-12 Micah Cowan <micah@cowan.name>
* PATCHES: Removed.
* NEWS: Updated info about source repositories, removal of
PATCHES file.
2007-10-03 Micah Cowan <micah@cowan.name>
* NEWS: Note missing functionality from GnuTLS support. Call out
attention to content_disposition's experimental status.
2007-09-25 Micah Cowan <micah@cowan.name>
* configure.in: Remove unnecessary heuristic to generate exeext
variable, since AC_PROG_CC and others automatically set EXEEXT.
Pointed out by Steve Kenton <skenton@ou.edu>.
2007-09-12 Micah Cowan <micah@cowan.name>
* AUTHORS: Added... me...
* TODO: file removed, bugtracker is authoritative source for
planned changes.
2007-08-26 Micah Cowan <micah@cowan.name>
* po/POTFILES.in: Added spider.c.
2007-08-24 Micah Cowan <micah@cowan.name>
* po/no.po: removed; replaced by nb.po (per the translation
project coordinator, Benno Schulenberg).
2007-08-22 Micah Cowan <micah@cowan.name>
* Makefile.in: Exclude .svn directories and below from
distribution.
2007-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* m4/wget.m4 (WGET_PROCESS_PO, AM_PATH_PROG_WITH_TEST): Add
missing M4 quotation. Delete serial number.
2007-08-09 Micah Cowan <micah@cowan.name>
* NEWS: Timestamping from most recent response.
2007-08-08 Micah Cowan <micah@cowan.name>
* NEWS: Call attention to the fact that Content-Disposition is
not enabled by default.
2007-08-07 Micah Cowan <micah@cowan.name>
* configure.in: Fix --with-libssl-prefix failure by replacing
usage of sh "if" statement with "AS_IF" macros, to force
AC_REQUIRE'd macros to be expanded before the conditional
statement body.
* NEWS: Note that configure.in now requires autoconf >= 2.61,
to support AS_IF and its expansion of AC_REQUIREs.
2007-07-29 Micah Cowan <micah@cowan.name>
* NEWS: No more auth before challenge. No more auth info in
Referer. New --max-redirect option.
2007-07-09 Micah Cowan <micah@cowan.name>
* README, util/wget.spec: Removed references to wget.sunsite.dk.
2007-07-05 Micah Cowan <micah@cowan.name>
* AUTHORS:
Draw attention to previous maintainers.
* autogen.sh, config.guess, config.sub, configure.bat:
* configure.in, m4/wget.m4, Makefile.in, util/dist-wget:
* util/Makefile.in, util/rmold.pl:
Updated GPL reference to version 3 or later, removed FSF
address.
* README:
Updated reference to maintainer, and updated GPL reference to
version 3 or later.
* COPYING:
Replaced with verson 3.
2006-08-28 Noèl Köthe <noel@debian.org>
* Makefile.in: Fixed a DESTDIR-related bug.
2006-07-17 Daniel Richard G. <skunk@iSKUNK.ORG>
* Makefile.in: Added DESTDIR='$(DESTDIR)' to MAKEDEFS.
2006-07-14 Mauro Tortonesi <mauro@ferrara.linux.it>
* configure.in: Check for intptr_t.
2006-06-27 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: We're no longer using strtoimax.
2006-02-28 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Check for memrchr.
2005-11-19 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Check for uintptr_t.
2005-11-02 Mauro Tortonesi <mauro@ferrara.linux.it>
* Makefile.in: Improved support for unit testing.
* configure.in: Ditto.
2005-10-27 Mauro Tortonesi <mauro@ferrara.linux.it>
* Makefile.in: Added basic support for unit testing.
2005-08-26 Stepan Kasal <kasal@ucw.cz>
* configure.in: Abort if --with-ssl given and OpenSSL unavailable.
* configure.in: Abort configure if --with-ssl given but SSL
unavailable. Use HAVE_LIBSSL and HAVE_LIBGNUTLS symbols provided
by AC_LIB_HAVE_LINKFLAGS instead of inventing new ones.
2005-08-11 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Check for strtoll and strtoimax.
2005-07-08 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Remove -Wno-implicit from default GCC warning
flags.
2005-07-08 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Don't check for symlink, which is expected to
exist. Check for asprintf.
2005-07-07 Hrvoje Niksic <hniksic@xemacs.org>
* configure.bat: Copy the common config.h and config-compiler.h.
2005-07-06 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Don't check for setjmp.h.
2005-07-06 Hrvoje Niksic <hniksic@xemacs.org>
* Makefile.in: Also use @LIBGNUTLS@ to build LIBS.
2005-07-05 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Check for timegm.
* configure.in: Add check for GnuTLS if --with-ssl=gnutls is used.
2005-07-03 Hrvoje Niksic <hniksic@xemacs.org>
* po/POTFILES.in: Include src/ptimer.c.
2005-07-01 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Mention in message that the "GNU" md5
implementation is in fact built-in to Wget.
2005-06-29 Hrvoje Niksic <hniksic@xemacs.org>
* m4/wget.m4 (WGET_WITH_NLS): Don't check for locale.h.
2005-06-29 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Test for $LIBSSL instead of the old $ssl_success
@ -23,10 +298,77 @@
* configure.in: Require Autoconf 2.59.
2005-06-27 Hrvoje Niksic <hniksic@xemacs.org>
2005-06-29 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Replace libtool with AC_LIB_HAVE_LINKFLAGS.
Modify makefiles accordingly. (Imported from the trunk.)
* configure.in: Check for drand48.
2005-06-26 Hrvoje Niksic <hniksic@xemacs.org>
* m4/wget.m4: Use proper GPL header.
2005-06-25 Hrvoje Niksic <hniksic@xemacs.org>
* Makefile.in: No need to clean .libs.
2005-06-25 Hrvoje Niksic <hniksic@xemacs.org>
* Makefile.in (DISTFILES): Don't split the sed invocation across
several lines, Solaris make passes the backslashes to sed literally.
2005-06-25 Hrvoje Niksic <hniksic@xemacs.org>
* Makefile.in: Instead of creating configure.bat from
configure.bat.in, simply make sure the correct EOL style in
checked out of the repository.
2005-06-24 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Move the large file check further up. Only check
for endianness if GNU md5 is used (it being the only file that
needs endianness information).
2005-06-24 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Don't indent #include lines.
2005-06-24 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Enable the user to turn off SSL autodetection and
disable SSL using --without-ssl.
* Makefile.in ($(srcdir)/stamp-h.in): Remove the aclocal.m4
dependencies.
2005-06-24 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Include m4/*.m4.
* aclocal.m4: Renamed to m4/wget.m4.
2005-06-24 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Use AC_LIB_HAVE_LINKFLAGS instead of
AC_LIB_LINKFLAGS when checking for library functions.
* configure.in: Don't waste time checking for headers and
functions we know must be there. But manually AC_DEFINE the
functions that might be missing from non-Unix systems.
2005-06-23 Mauro Tortonesi <mauro@ferrara.linux.it>
* libtool.m4, ltmain.sh: Deleted.
* configure.in: Replaced ugly libtool-based check for OpenSSL libs
with a simpler config.rpath-based approach.
* Makefile.in, src/Makefile.in: Removed libtool support.
* m4/lib-link.m4, m4/lib-prefix.m4, m4/lib-ld.m4, config.rpath:
config.rpath macros taken from gettext 0.14.5.
2005-06-23 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Don't check for strpbrk and mktime.
2005-06-23 Hrvoje Niksic <hniksic@xemacs.org>
@ -44,6 +386,15 @@
* Makefile.svn: Deleted, replaced with the even simpler (and more
standard) `autogen.sh' script.
2005-06-22 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Don't check for signal.h. Remove the
AC_HEADER_TIME check. Remove the test for ANSI C prototypes.
2005-06-22 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Check for C99 conformant stdbool.h.
2005-06-22 Hrvoje Niksic <hniksic@xemacs.org>
* MAILING-LIST: Remove reference to the obsolete `wget-cvs'
@ -53,12 +404,31 @@
* config.sub, config.guess: Updated from canonical location.
2005-06-22 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Assume existence of gettimeofday and select.
gettimeofday exists on all platforms we care about (except for
Windows where Windows-specific functions are used instead), and
select exists virtually everywhere.
* configure.in: Assume existence of strerror, signal, strstr, and
memmove, which are all required by ANSI C.
2005-06-21 Hrvoje Niksic <hniksic@xemacs.org>
* Makefile.cvs: Renamed to Makefile.svn.
* README.cvs: Renamed to README.svn.
2005-06-20 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Don't check for the return type of signal
handlers; C89 requires it to be void.
2005-06-19 Hrvoje Niksic <hniksic@xemacs.org>
* aclocal.m4: Remove support for K&R compilers.
2005-05-10 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Test for OpenSSL includes we actually need.

View File

@ -10,5 +10,7 @@ Please note that Wget has more than one ChangeLog file:
windows/ChangeLog: documents only changes to files in the windows directory
msdos/ChangeLog: documents only changes to files in the msdos directory
When checking to see if a patch you sent in has been applied, please
look in the appropriate ChangeLog(s).

View File

@ -0,0 +1,213 @@
AUTHORS
autogen.sh
ChangeLog
ChangeLog.README
config.guess
config.rpath
config.sub
configure
configure.bat
configure.in
COPYING
DISTFILES
doc/ChangeLog
doc/fdl.texi
doc/Makefile.in
doc/sample.wgetrc
doc/texi2pod.pl
doc/texinfo.tex
doc/version.texi
doc/wget.texi
doc/wget.info
doc/wget.1
doc/wget.pod
INSTALL
install-sh
m4/lib-ld.m4
m4/lib-link.m4
m4/lib-prefix.m4
m4/wget.m4
MAILING-LIST
Makefile.in
mkinstalldirs
msdos/ChangeLog
msdos/config.h
msdos/Makefile.DJ
msdos/Makefile.WC
NEWS
po/be.po
po/bg.po
po/ca.po
po/cs.po
po/da.po
po/de.po
po/el.po
po/en_GB.po
po/eo.po
po/es.po
po/et.po
po/eu.po
po/fi.po
po/fr.po
po/ga.po
po/gl.po
po/he.po
po/hr.po
po/hu.po
po/id.po
po/it.po
po/ja.po
po/Makefile.in.in
po/nb.po
po/nl.po
po/pl.po
po/POTFILES.in
po/pt_BR.po
po/pt.po
po/ro.po
po/ru.po
po/sk.po
po/sl.po
po/sr.po
po/sv.po
po/tr.po
po/uk.po
po/vi.po
po/wget.pot
po/zh_CN.po
po/zh_TW.po
README
src/alloca.c
src/ChangeLog
src/cmpt.c
src/config.h.in
src/config-post.h
src/connect.c
src/connect.h
src/convert.c
src/convert.h
src/cookies.c
src/cookies.h
src/ftp-basic.c
src/ftp.c
src/ftp.h
src/ftp-ls.c
src/ftp-opie.c
src/gen-md5.c
src/gen-md5.h
src/getopt.c
src/getopt.h
src/gnu-md5.c
src/gnu-md5.h
src/gnutls.c
src/hash.c
src/hash.h
src/host.c
src/host.h
src/html-parse.c
src/html-parse.h
src/html-url.c
src/http.c
src/http.h
src/http-ntlm.c
src/http-ntlm.h
src/init.c
src/init.h
src/log.c
src/log.h
src/main.c
src/Makefile.in
src/mswindows.c
src/mswindows.h
src/netrc.c
src/netrc.h
src/openssl.c
src/options.h
src/progress.c
src/progress.h
src/ptimer.c
src/ptimer.h
src/recur.c
src/recur.h
src/res.c
src/res.h
src/retr.c
src/retr.h
src/safe-ctype.c
src/safe-ctype.h
src/snprintf.c
src/spider.c
src/spider.h
src/ssl.h
src/sysdep.h
src/test.c
src/test.h
src/url.c
src/url.h
src/utils.c
src/utils.h
src/version.c
src/wget.h
src/xmalloc.c
src/xmalloc.h
stamp-h.in
tests/ChangeLog
tests/FTPServer.pm
tests/FTPTest.pm
tests/HTTPServer.pm
tests/HTTPTest.pm
tests/Makefile.in
tests/README
tests/Test-auth-basic.px
tests/Test-c-full.px
tests/Test-c-partial.px
tests/Test-c.px
tests/Test-E-k-K.px
tests/Test-E-k.px
tests/Test-ftp.px
tests/Test-HTTP-Content-Disposition-1.px
tests/Test-HTTP-Content-Disposition-2.px
tests/Test-HTTP-Content-Disposition.px
tests/Test-N-current.px
tests/Test-N-HTTP-Content-Disposition.px
tests/Test-N--no-content-disposition.px
tests/Test-N--no-content-disposition-trivial.px
tests/Test--no-content-disposition.px
tests/Test--no-content-disposition-trivial.px
tests/Test-N-old.px
tests/Test-nonexisting-quiet.px
tests/Test-noop.px
tests/Test-np.px
tests/Test-N.px
tests/Test-O-HTTP-Content-Disposition.px
tests/Test-O--no-content-disposition.px
tests/Test-O--no-content-disposition-trivial.px
tests/Test-O-nonexisting.px
tests/Test-O.px
tests/Test-Restrict-Lowercase.px
tests/Test-Restrict-Uppercase.px
tests/Test--spider-fail.px
tests/Test--spider-HTTP-Content-Disposition.px
tests/Test--spider--no-content-disposition.px
tests/Test--spider--no-content-disposition-trivial.px
tests/Test--spider.px
tests/Test--spider-r-HTTP-Content-Disposition.px
tests/Test--spider-r--no-content-disposition.px
tests/Test--spider-r--no-content-disposition-trivial.px
tests/Test--spider-r.px
tests/WgetTest.pm.in
util/Makefile.in
util/README
util/rmold.pl
windows/ChangeLog
windows/config-compiler.h
windows/config.h
windows/Makefile.doc
windows/Makefile.in
windows/Makefile.src
windows/Makefile.src.bor
windows/Makefile.src.mingw
windows/Makefile.top
windows/Makefile.top.bor
windows/Makefile.top.mingw
windows/README

View File

@ -151,9 +151,9 @@ report it as a bug.
--------------
To compile GNU Wget after it has been configured, simply type make.
If your compiler is too old to handle function prototypes, Wget will
try to K&R-ize its sources on the fly. This should make GNU Wget
compilable on almost any Unix-like system you are likely to encounter.
Wget requires a compiler and standard library compliant with the 1990
ISO C standard, which includes the vast majority of compilation
environments present on systems in use today.
After the compilation a ready-to-use `wget' executable should reside
in the src directory. At this point there is no formal test suite for

View File

@ -35,6 +35,7 @@ BinCommand wget :
res.c
retr.c
safe-ctype.c
spider.c
url.c
utils.c
version.c

View File

@ -1,48 +1,33 @@
-*- text -*-
Mailing List
================
WGET-RELATED MAILING LISTS
There are several Wget-related mailing lists. The general discussion
list is at <wget@sunsite.dk>. It is the preferred place for support
requests and suggestions, as well as for discussion of development.
You are invited to subscribe.
There are several mailing lists related to GNU Wget, all of them
hosted by dotsrc.org, previously known as SunSITE.dk.
To subscribe, simply send mail to <wget-subscribe@sunsite.dk> and
follow the instructions. Unsubscribe by mailing to
<wget-unsubscribe@sunsite.dk>. The mailing list is archived at
`http://www.mail-archive.com/wget%40sunsite.dk/' and at
`http://news.gmane.org/gmane.comp.web.wget.general'.
wget@sunsite.dk:
Another mailing list is at <wget-patches@sunsite.dk>, and is used to
submit patches for review by Wget developers. A "patch" is a textual
representation of change to source code, readable by both humans and
programs. The file `PATCHES' that comes with Wget covers the creation
and submitting of patches in detail. Please don't send general
suggestions or bug reports to `wget-patches'; use it only for patch
submissions.
The mailing list for users and developers. This is the preferred
place to post bug reports and suggestions, as well as discuss
development-related matters.
Subscription is the same as above for <wget@sunsite.dk>, except that
you send to <wget-patches-subscribe@sunsite.dk>, instead. The mailing
list is archived at `http://news.gmane.org/gmane.comp.web.wget.patches'.
To post to the list, send mail to <wget@sunsite.dk>. To
subscribe, send mail to <wget-subscribe@sunsite.dk>.
NOTE: The list allows posts from non-subscribers. This is
intentional; I hate having to subscribe to a list only to ask a
single question. However, to protect the list members from spam,
non-subscribers must confirm messages they send to the list.
If you're not subscribed to the list and ask something, don't
forget to request that the responses be Cc'ed to you.
The list is archived at:
http://www.mail-archive.com/wget%40sunsite.dk/
http://news.gmane.org/gmane.comp.web.wget.general
wget-patches@sunsite.dk:
The mailing list for patch submission. Please see the PATCHES
file for a detailed description of how to send patches to this
list.
This is list is also open to non-subscribers, but it is *not* a
discussion list. It only ever distribute patches and immediate
responses to a patch. If you wish to take very active part in
development, you might wish to subscribe to it anyway, and receive
the new patches. To do that, send mail to
<wget-patches-subscribe@sunsite.dk>.
The list is archived at:
http://news.gmane.org/gmane.comp.web.wget.patches
As of this writing, the mail alias <bug-wget@gnu.org> is an alias for
<wget@sunsite.dk>.
Finally, there is the <wget-notify@addictivecode.org> mailing list.
This is a non-discussion list that receives commit notifications from
the source repository, and also bug report-change notifications. This
is the highest-traffic list for Wget, and is recommended only for
people who are seriously interested in ongoing Wget development.
Subscription is through the `mailman' interface at
`http://addictivecode.org/mailman/listinfo/wget-notify'.

View File

@ -1,9 +1,10 @@
# Makefile for `Wget' utility
# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
# Copyright (C) 1995, 1996, 1997, 2006, 2007,
# 2008 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# 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,
@ -12,18 +13,18 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# In addition, as a special exception, the Free Software Foundation
# gives permission to link the code of its release of Wget with the
# OpenSSL project's "OpenSSL" library (or with modified versions of it
# that use the same license as the "OpenSSL" library), and distribute
# the linked executables. You must obey the GNU General Public License
# in all respects for all of the code used other than "OpenSSL". If you
# modify this file, you may extend this exception to your version of the
# file, but you are not obligated to do so. If you do not wish to do
# so, delete this exception statement from your version.
# Additional permission under GNU GPL version 3 section 7
# If you modify this program, or any covered work, by linking or
# combining it with the OpenSSL project's OpenSSL library (or a
# modified version of that library), containing parts covered by the
# terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
# grants you additional permission to convey the resulting work.
# Corresponding Source for a non-source form of such a combination
# shall include the source code for the parts of OpenSSL used as well
# as that of the covered work.
#
# Version: @VERSION@
@ -57,7 +58,7 @@ CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
LIBS = @LIBS@ @LIBSSL@
LIBS = @LIBS@ @LIBSSL@ @LIBGNUTLS@
LDFLAGS = @LDFLAGS@
#
@ -77,15 +78,19 @@ TAR = tar
# flags passed to recursive makes in subdirectories
MAKEDEFS = CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' \
CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \
prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
infodir='$(infodir)' mandir='$(mandir)' manext='$(manext)'
DESTDIR='$(DESTDIR)' prefix='$(prefix)' exec_prefix='$(exec_prefix)' \
bindir='$(bindir)' infodir='$(infodir)' mandir='$(mandir)' \
manext='$(manext)'
# subdirectories in the distribution
SUBDIRS = src doc po util windows
SUBDIRS = src doc po tests util windows
# default target
all: src/config.h Makefile $(SUBDIRS)
test: src/config.h Makefile src
cd tests && $(MAKE) $(MAKEDEFS) $@
check: all
$(SUBDIRS): FORCE
@ -99,6 +104,10 @@ install: install.bin install.info install.wgetrc \
install.bin uninstall.bin:
cd src && $(MAKE) $(MAKEDEFS) $@
# Rules for info, man page (needed for make dist)
doc/wget.1 doc/wget.info:
cd doc && $(MAKE) $(MAKEDEFS)
# install/uninstall the info/man pages
install.info uninstall.info install.man uninstall.man install.wgetrc:
cd doc && $(MAKE) $(MAKEDEFS) $@
@ -107,19 +116,14 @@ install.info uninstall.info install.man uninstall.man install.wgetrc:
install.mo:
cd po && $(MAKE) $(MAKEDEFS) $@
# Create configure.bat from configure.bat.in by DOS-ifying the lines.
# This is invoked by `make dist' and deleted by `make realclean' (not
# `make distclean' because we want to preserve it for distribution).
configure.bat: $(srcdir)/configure.bat.in
awk '{ print $$0 ($$0 ~ /\r$$/ ? "" : "\r") }' $< > $@
# create tag files for Emacs
TAGS:
cd src && $(MAKE) $@
dist: $(srcdir)/configure $(srcdir)/configure.bat DISTFILES
dist: $(srcdir)/configure doc/wget.1 doc/wget.info DISTFILES
cd po && $(MAKE) wget.pot
mkdir $(DISTNAME)
for d in `$(FIND) . -type d ! -name CVS -a ! -name RCS -print`; do \
for d in `$(FIND) . -type d ! -regex '.*/\.\(svn\|hg\)\(/.*\)?' -print`; do \
if [ "$$d" != "." -a "$$d" != "./$(DISTNAME)" ]; then \
mkdir $(DISTNAME)/$$d; \
fi; \
@ -128,16 +132,8 @@ dist: $(srcdir)/configure $(srcdir)/configure.bat DISTFILES
ln $(srcdir)/$$f $(DISTNAME)/$$f || \
{ echo copying $$f; cp -p $(srcdir)/$$f $(DISTNAME)/$$f ; } \
done
(cd $(DISTNAME); $(MAKE) distclean)
$(TAR) chvf - $(DISTNAME) | $(GZIP) -c --best >$(DISTNAME).tar.gz
$(RM) -r $(DISTNAME)
$(RM) DISTFILES
DISTFILES: FORCE
rm -rf $(DISTNAME)
(cd $(srcdir); find . ! -type d -print) \
| sed '/\/\(CVS\|RCS\)\//d; /$@/d; /\.tar.*/d; s/^.\///; /^\.$$/d;' \
| sort | uniq > $@
#
# Cleanup dependencies
@ -155,7 +151,7 @@ distclean-top: clean-top
$(RM) -r autom4te.cache
realclean-top: distclean-top
$(RM) configure configure.bat
$(RM) configure
clean-recursive distclean-recursive realclean-recursive:
for subdir in $(SUBDIRS); do \

View File

@ -1,11 +1,120 @@
GNU Wget NEWS -- history of user-visible changes.
Copyright (C) 2005 Free Software Foundation, Inc.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008 Free Software Foundation, Inc.
See the end for copying conditions.
Please send GNU Wget bug reports to <bug-wget@gnu.org>.
* Wget 1.10.1 is a bugfix release with no user-visible changes.
* Changes in Wget 1.11.4
** Fixed an issue (apparently a regression) where -O would refuse to
download when -nc was given, even though the file didn't exist.
** Fixed a situation where Wget could abort with --continue if the
remote server gives a content-length of zero when the file exists
locally with content.
** Fixed a crash on some systems, due to Wget casting a pointer-to-long
to a pointer-to-time_t.
** Translation updates for Catalan.
* Changes in Wget 1.11.3
** Downgraded -N with -O to a warning, rather than an error.
** Translation updates
* Changes in Wget 1.11.2
** Fixed a problem in authenticating over HTTPS through a proxy.
(Regression in 1.11 over 1.10.2.)
** The combination of -r or -p with -O, which was disallowed in 1.11,
has been downgraded to a warning in 1.11.2. (-O and -N, which was never
meaningful, is still an error.)
** Further improvements to progress bar displays in non-English locales
(too many spaces could be inserted, causing the display to scroll).
** Successive invocations of Wget on FTP URLS, with --no-remove-listing
and --continue, was causing Wget to append, rather than replace,
information in the .listing file, and thereby download the same files
multiple times. This has been fixed in 1.11.2.
** Wget 1.11 no longer allowed ".." to persist at the beginning of URLs,
for improved conformance with RFC 3986. However, this behavior presents
problems for some FTP setups, and so they are now preserved again, for
FTP URLs only.
* Changes in Wget 1.11.1.
** Interrupted downloads no longer result in renaming the file
(regression in 1.11 over 1.10.2).
** Progress bar now displays correctly in non-English locales (and a
related assertion failure was fixed).
** Wget no longer issues a GET request over HTTP for files it should
know it's not going to download (regression in 1.11 over 1.10.2).
** Added option --auth-no-challenge, to support broken pre-1.11
authentication-before-server-challenge, which turns out to still be
useful for some limited cases.
** Documentation of accept/reject lists in the manual's "Types of
Files" section now explains various aspects of their behavior that may
be surprising, and notes that they may change in the future.
** Documentation of --no-parents now explains how a trailing slash, or
lack thereof, in the specified URL, will affect behavior.
* Changes in Wget 1.11.
** Timestamping now uses the value from the most recent HTTP response,
rather than the first one it got.
** Authentication information is no longer sent as part of the Referer
header in recursive fetches.
** No authentication credentials are sent until a challenge is issued,
for improved security. Authentication handling is still not
RFC-compliant, as once a Basic challenge has been received, it will
assume it can send credentials to any URL at that same host, and not
just the ones at or below the original authenticated location.
Credentials for Digest authentication are still never saved or issued
automatically, and continue to require a challenge for each resource.
** Added --max-redirect option, allowing the user to specify what should
be the maximum number of HTTP redirects to follow.
** Wget now supports saving HTTP downloads using file names specified by
the `Content-Disposition' header. This is a standard way of specifying
the file name used by many web dynamically generated pages. However, the
current implementation is inefficient, and known to have bugs. It is
EXPERIMENTAL only, and not enabled by default. Use --content-disposition
to enable it.
** The new option `--ignore-case' makes Wget ignore case when
matching files, directories, and wildcards. This affects the -X, -I,
-A, and -R options, as well as globbing in FTP URLs.
** ETA projection is now displayed in "dot" progress output as well as
in the default progress bar. (The dot progress is used by default when
logging Wget's output to file using the `-o' option.)
** The "lockable boolean" argument type is no longer supported. It
was only used by the passive_ftp .wgetrc setting. If you're running
broken scripts or Perl modules that unconditionally specify
`--passive-ftp' and your firewall disallows it, you can override them
by replacing wget with a script that execs wget "$@" --no-passive-ftp.
** The source code has been migrated to Mercurial. The repositories are
available at http://hg.addictivecode.org/. Prior to this, the source
code was hosted on Subversion (migrated from the original CVS); you can
still get access to older tags and branches for Wget in the Subversion
repository at http://addictivecode.org/svn/wget/.
* Changes in Wget 1.10.
@ -551,7 +660,7 @@ geturl -vo log http://fly.cc.fer.hr/
----------------------------------------------------------------------
Copyright information:
Copyright (C) 2005 Free Software Foundation, Inc.
Copyright (C) 1997-2005 Free Software Foundation, Inc.
Permission is granted to anyone to make or distribute verbatim
copies of this document as received, in any medium, provided that

View File

@ -1,160 +0,0 @@
* Guidelines for patch submissions.
===================================
** What is a patch?
-------------------
A patch file, also known as a "diff", is a textual representation of
changes to source code. Patches are readable enough to be reviewed by
humans and at the same time regular enough to be processed by
programs. The `patch' utility is used to change the source code in
the manner that the patch describes, this being called "applying" the
patch. Patches work even on files that have been modified
independently of the modifications in the patch, as long as those
other changes do not conflict with the patch.
Because of these properties, patches are the preferred means of
distributing the changes to a free software project. If you have made
a change to Wget and would like to contribute it, you will need to
create a patch and send it to the developers; please read on.
** Where to send the patches.
-----------------------------
Patches intended to be applied to Wget should be mailed to
<wget-patches@sunsite.dk>. Each patch will be reviewed by the
developers, and will be acked and added to the distribution, or
rejected with an explanation. Unfortunately, the developers are often
busy with their day jobs, so the review process can take a while.
If you want to discuss your patch with the community of Wget users and
developers, it is OK to send it to the main list at <wget@sunsite.dk>.
If the patch is really huge (more than 100K or so), you may want to
put it on the web and post the URL.
EVERY patch should be accompanied by an explanation of what the patch
changes, and why the change is desirable or necessary. The
explanation need not be long, but please don't just send a patch
without any accompanying text.
Normally, a patch can be just inserted into the message, after the
explanation and the ChangeLog entry. However, if your mail composer
or gateway is inclined to munge patches, e.g. by wrapping long lines,
please send them out as a MIME attachment. It is important that the
patch survives the travel unchanged so that we can feed it to the
`patch' utility after reviewing it.
** How to create patches.
-------------------------
First, please make sure that you are working with the latest version
of the source -- changing obsolete code is a waste of time. Working
on the latest release is acceptable in most cases, but it is better
yet to download the very latest sources from the public Subversionn
server and work on those. The web page at
<http://www.gnu.org/software/wget/> explains how to get the source
code from the repository.
Patches are created using the `diff' program. When making patches,
please use the `-u' option, or if your diff doesn't support it, `-c'.
Ordinary (context-free) diffs are notoriously prone to errors, since
line numbers tend to change when others make changes to the same
source file.
In the general case, `diff' is used like this:
diff -u ORIGFILE CHANGEDFILE > patch.txt
Also, it is helpful if you create the patch in the top level of
the Wget source directory. For example:
cp src/http.c src/http.c.orig
... modify src/http.c ....
diff -u src/http.c.orig src/http.c > patch.txt
If your patch changes more than one file, feel free to simply
concatenate the diffs of different files into a large diff:
(diff -u foo.orig foo; diff -u bar.orig bar) > patch.txt
The alternative is to leave the unchanged source lying around and use
the `-r' option to compare entire directories:
diff -ru wget-1.9.orig wget-1.9 > patch.txt
If you do that, please be careful not to include the differences to
automatically generated files, such as `.info*'.
If you are using Subversion, generating diffs is even simpler -- after
changing the files, all you need to do is run the following command
from Wget's top-level directory:
svn diff > patch.txt
If you run on Windows and don't have `diff' handy, please obtain it.
It's extremely hard to review changes to files unless they're in the
form of a patch. If you really cannot use a variant of `diff', then
mail us the whole new file and indicate which version of Wget you
changed; that way we will be able to generate the diff ourselves.
Finally, if your changes introduce new files, or if they change the
old files past all recognition (e.g. by completely reimplementing the
old stuff), sending a patch might not make sense. In that case, just
attach the files along with an explanation of what is being changed.
** Standards and coding style.
------------------------------
Wget abides by the GNU coding standards, available at:
http://www.gnu.org/prep/standards.html
I consider perhaps the most important single point in that entire
document to be the "no arbitrary limits" rule. Even where Wget's
coding is less than exemplary, it respects that rule. There should be
no exceptions.
Here is a short recap of the GNU formatting and naming conventions,
partly borrowed from XEmacs:
* Put a space after every comma.
* Put a space before the parenthesis that begins a function call,
macro call, function declaration or definition, or control
statement (if, while, switch, for). (DO NOT do this for macro
definitions; this is invalid preprocessor syntax.)
* The brace that begins a control statement (if, while, for, switch,
do) or a function definition should go on a line by itself.
* In function definitions, put the return type and all other
qualifiers on a line before the function name. Thus, the function
name is always at the beginning of a line.
* Indentation level is two spaces. (However, the first and
following statements of a while/for/if/etc. block are indented
four spaces from the while/for/if keyword. The opening and
closing braces are indented two spaces.)
* Variable and function names should be all lowercase, with
underscores separating words, except for a prefixing tag, which may
be in uppercase. Do not use the mixed-case convention (e.g.
SetVariableToValue ()) and *especially* do not use Microsoft
Hungarian notation (char **rgszRedundantTag).
* Preprocessor constants and enumerations should be all uppercase,
and should be prefixed with a tag that groups related constants
together.
** ChangeLog policy.
--------------------
Each patch should be accompanied by an update to the appropriate
ChangeLog file. Please don't mail diffs of ChangeLog files because
they have an extremely high rate of failure; just mail us the new
entries you added to the ChangeLog. Patches without a ChangeLog entry
will be accepted, but this creates additional work for the
maintainers, so please do take the time to write one.
Guidelines for writing ChangeLog entries are also governed by the GNU
coding standards, under the "Change Logs" section.

View File

@ -1,7 +1,7 @@
-*- text -*-
GNU Wget
========
Current Web home: http://wget.sunsite.dk/
Current Web home: http://www.gnu.org/software/wget/
GNU Wget is a free utility for non-interactive download of files from
the Web. It supports HTTP, HTTPS, and FTP protocols, as well as
@ -50,23 +50,21 @@ resides at <ftp://ftp.gnu.org/pub/gnu/wget/>.
Please report bugs in Wget to <bug-wget@gnu.org>.
See the file `MAILING-LIST' for information about Wget mailing lists.
Wget's home page is temporarily at <http://wget.sunsite.dk/>. It is
being migrated to <http://www.gnu.org/software/wget/>, where will be
its permanent home.
Wget's home page is at <http://www.gnu.org/software/wget/>.
MAINTAINER: Micah Cowan <micah@cowan.name>
Wget was originally written and mainained by Hrvoje Niksic. Please see
the file AUTHORS for a list of major contributors, and the ChangeLogs
for a detailed listing of all contributions.
MAINTAINER: Mauro Tortonesi <mauro@ferrara.linux.it>
Wget was originally written by Hrvoje Niksic. Please see the file
AUTHORS for a list of major contributors, and the ChangeLogs for a
detailed listing of all contributions.
Copyright (C) 2005 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
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,
@ -76,14 +74,16 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA.
In addition, as a special exception, the Free Software Foundation
gives permission to link the code of its release of Wget with the
OpenSSL project's "OpenSSL" library (or with modified versions of it
that use the same license as the "OpenSSL" library), and distribute
the linked executables. You must obey the GNU General Public License
in all respects for all of the code used other than "OpenSSL". If you
modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version.
Additional permission under GNU GPL version 3 section 7
If you modify this program, or any covered work, by linking or
combining it with the OpenSSL project's OpenSSL library (or a
modified version of that library), containing parts covered by the
terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
grants you additional permission to convey the resulting work.
Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work.

View File

@ -1,28 +0,0 @@
Important note:
To reduce bandwidth and needless updates, the Subversion tree does not
contain automatically-generated files, even when those files are
normally present in the distribution tarballs.
Therefore, if you're building from the sources obtained via
Subversion, you'll need to have at least GNU Autoconf (2.59 or newer)
installed on your system. To generate the Info documentation, you
will need the GNU Texinfo package. Those packages are available from
<ftp://ftp.gnu.org/pub/gnu/<package>/> and its mirrors, listed at
<http://www.gnu.org/order/ftp.html>.
In case you aren't used to running autoconf manually to generate the
necessary configure script, a script called autogen.sh has been
provided, and may be invoked using `./autogen.sh'. Once the script
has completed, the configure script will reside in the current
directory and you can proceed to build Wget as described in the
`INSTALL' file.
To summarize, once you've checked out wget from the Subversion
repository, the commands you'll execute will be as follows (barring
any extra options to `configure' or to `make'):
cd wget
./autogen.sh
./configure
make

View File

@ -1,92 +0,0 @@
Hey Emacs, this is -*- outline -*- mode
This is the to-do list for GNU Wget. There is no timetable of when we
plan to implement these features -- this is just a list of features
we'd like to see in Wget, as well as a list of problems that need
fixing. Patches to implement these items are likely to be accepted,
especially if they follow the coding convention outlined in PATCHES
and if they patch the documentation as well.
The items are not listed in any particular order (except that
recently-added items may tend towards the top). Not all of these
represent user-visible changes.
* Honor `Content-Disposition: XXX; filename="FILE"' when creating the
file name. If possible, try not to break `-nc' and friends when
doing that.
* Wget shouldn't delete rejected files that were not downloaded, but
just found on disk because of `-nc'. For example, `wget -r -nc
-A.gif URL' should allow the user to get all the GIFs without
removing any of the existing HTML files.
* Be careful not to lose username/password information given for the
URL on the command line.
* Add a --range parameter allowing you to explicitly specify a range
of bytes to get from a file over HTTP (FTP only supports ranges
ending at the end of the file, though forcibly disconnecting from
the server at the desired endpoint might be workable).
* If multiple FTP URLs are specified that are on the same host, Wget should
re-use the connection rather than opening a new one for each file.
* Try to devise a scheme so that, when password is unknown, Wget asks
the user for one.
* If -c used with -N, check to make sure a file hasn't changed on the server
before "continuing" to download it (preventing a bogus hybrid file).
* Generalize --html-extension to something like --mime-extensions and
have it look at mime.types/mimecap file for preferred extension.
Non-HTML files with filenames changed this way would be
re-downloaded each time despite -N unless .orig files were saved for
them. Since .orig would contain the same data as non-.orig, the
latter could be just a link to the former. Another possibility
would be to implement a per-directory database called something like
.wget_url_mapping containing URLs and their corresponding filenames.
* When spanning hosts, there's no way to say that you are only interested in
files in a certain directory on _one_ of the hosts (-I and -X apply to all).
Perhaps -I and -X should take an optional hostname before the directory?
* --retr-symlinks should cause wget to traverse links to directories too.
* Make wget return non-zero status in more situations, like incorrect HTTP auth.
* Make -K compare X.orig to X and move the former on top of the latter if
they're the same, rather than leaving identical .orig files laying around.
* Make `-k' check for files that were downloaded in the past and convert links
to them in newly-downloaded documents.
* Add option to clobber existing file names (no `.N' suffixes).
* Add option to only list wildcard matches without doing the download.
* Handle MIME types correctly. There should be an option to (not)
retrieve files based on MIME types, e.g. `--accept-types=image/*'.
* Allow time-stamping by arbitrary date.
* Allow size limit to files (perhaps with an option to download oversize files
up through the limit or not at all, to get more functionality than [u]limit.
* Download to .in* when mirroring.
* Add an option to delete or move no-longer-existent files when mirroring.
* Implement uploading (--upload URL?) in FTP and HTTP.
* Rewrite FTP code to allow for easy addition of new commands. It
should probably be coded as a simple DFA engine.
* Make HTTP timestamping use If-Modified-Since facility.
* Add more protocols (e.g. gopher and news), implementing them in a
modular fashion.
* Add a "rollback" option to have continued retrieval throw away a
configurable number of bytes at the end of a file before resuming
download. Apparently, some stupid proxies insert a "transfer
interrupted" string we need to get rid of.

View File

@ -2,11 +2,11 @@
# The (trivial) script for preparing the sources following the
# checkout from version control.
# Copyright (C) 2005 Free Software Foundation, Inc.
# Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# 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,
@ -15,23 +15,26 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# In addition, as a special exception, the Free Software Foundation
# gives permission to link the code of its release of Wget with the
# OpenSSL project's "OpenSSL" library (or with modified versions of it
# that use the same license as the "OpenSSL" library), and distribute
# the linked executables. You must obey the GNU General Public License
# in all respects for all of the code used other than "OpenSSL". If you
# modify this file, you may extend this exception to your version of the
# file, but you are not obligated to do so. If you do not wish to do
# so, delete this exception statement from your version.
# Additional permission under GNU GPL version 3 section 7
# If you modify this program, or any covered work, by linking or
# combining it with the OpenSSL project's OpenSSL library (or a
# modified version of that library), containing parts covered by the
# terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
# grants you additional permission to convey the resulting work.
# Corresponding Source for a non-source form of such a combination
# shall include the source code for the parts of OpenSSL used as well
# as that of the covered work.
# TODO: print an error message nicer than "sh: command not found" when
# Autoconf is not installed (or, more precisely, not found in the
# PATH).
autoheader
autoconf
# We intentionally don't invoke configure and make because we don't
# know where the user wants to run the configuration, nor with which
# arguments. That is entirely up to the user.
# At this point we intentionally don't invoke configure and make
# because we don't know where the user wants to run the configuration,
# nor with which arguments. That should be up to the user.

View File

@ -1,13 +1,14 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
timestamp='2005-05-27'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# 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
@ -16,9 +17,7 @@ timestamp='2005-05-27'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a

View File

@ -1,7 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
timestamp='2005-06-02'
@ -11,7 +12,7 @@ timestamp='2005-06-02'
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# 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,
@ -20,9 +21,7 @@ timestamp='2005-06-02'
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,10 @@
@echo off
rem Configure batch file for `Wget' utility
rem Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
rem Copyright (C) 1995, 1996, 1997, 2007, 2008 Free Software Foundation, Inc.
rem This program is free software; you can redistribute it and/or modify
rem it under the terms of the GNU General Public License as published by
rem the Free Software Foundation; either version 2 of the License, or
rem the Free Software Foundation; either version 3 of the License, or
rem (at your option) any later version.
rem This program is distributed in the hope that it will be useful,
@ -13,27 +13,25 @@ rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
rem GNU General Public License for more details.
rem You should have received a copy of the GNU General Public License
rem along with this program; if not, write to the Free Software
rem Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
rem along with this program. If not, see <http://www.gnu.org/licenses/>.
rem In addition, as a special exception, the Free Software Foundation
rem gives permission to link the code of its release of Wget with the
rem OpenSSL project's "OpenSSL" library (or with modified versions of it
rem that use the same license as the "OpenSSL" library), and distribute
rem the linked executables. You must obey the GNU General Public License
rem in all respects for all of the code used other than "OpenSSL". If you
rem modify this file, you may extend this exception to your version of the
rem file, but you are not obligated to do so. If you do not wish to do
rem so, delete this exception statement from your version.
rem Additional permission under GNU GPL version 3 section 7
rem If you modify this program, or any covered work, by linking or
rem combining it with the OpenSSL project's OpenSSL library (or a
rem modified version of that library), containing parts covered by the
rem terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
rem grants you additional permission to convey the resulting work.
rem Corresponding Source for a non-source form of such a combination
rem shall include the source code for the parts of OpenSSL used as well
rem as that of the covered work.
if .%1 == .--borland goto :borland
if .%1 == .--mingw goto :mingw
if .%1 == .--msvc goto :msvc
if .%1 == .--watcom goto :watcom
goto :usage
:msvc
copy windows\config.h.ms src\config.h > nul
copy windows\Makefile.top Makefile > nul
copy windows\Makefile.src src\Makefile > nul
copy windows\Makefile.doc doc\Makefile > nul
@ -44,7 +42,6 @@ echo and then NMAKE.
goto :end
:borland
copy windows\config.h.bor src\config.h > nul
copy windows\Makefile.top.bor Makefile > nul
copy windows\Makefile.src.bor src\Makefile > nul
copy windows\Makefile.doc doc\Makefile > nul
@ -53,7 +50,6 @@ echo Type MAKE to start compiling.
goto :end
:mingw
copy windows\config.h.mingw src\config.h > nul
copy windows\Makefile.top.mingw Makefile > nul
copy windows\Makefile.src.mingw src\Makefile > nul
copy windows\Makefile.doc doc\Makefile > nul
@ -61,20 +57,9 @@ copy windows\Makefile.doc doc\Makefile > nul
echo Type mingw32-make to start compiling.
goto :end
:watcom
copy windows\config.h.ms src\config.h > nul
copy windows\Makefile.watcom src\Makefile > nul
@echo Checking environment vars
@set INCLUDE | find /I "WATCOM"
@set LIB | find /I "WATCOM"
@echo If WATCOM directories were not displayed, you need to
@echo SET INCLUDE and SET LIB to the Watcom directories
@echo.
cd src
@echo Type WMAKE to build
goto :end
:usage
echo "Usage: configure [--borland | --mingw | --msvc | --watcom]"
echo "Usage: configure [--borland | --mingw | --msvc]"
:end
copy windows\config.h src\config.h > nul
copy windows\config-compiler.h src\config-compiler.h > nul

View File

@ -1,80 +0,0 @@
@echo off
rem Configure batch file for `Wget' utility
rem Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
rem This program is free software; you can redistribute it and/or modify
rem it under the terms of the GNU General Public License as published by
rem the Free Software Foundation; either version 2 of the License, or
rem (at your option) any later version.
rem This program is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
rem GNU General Public License for more details.
rem You should have received a copy of the GNU General Public License
rem along with this program; if not, write to the Free Software
rem Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
rem In addition, as a special exception, the Free Software Foundation
rem gives permission to link the code of its release of Wget with the
rem OpenSSL project's "OpenSSL" library (or with modified versions of it
rem that use the same license as the "OpenSSL" library), and distribute
rem the linked executables. You must obey the GNU General Public License
rem in all respects for all of the code used other than "OpenSSL". If you
rem modify this file, you may extend this exception to your version of the
rem file, but you are not obligated to do so. If you do not wish to do
rem so, delete this exception statement from your version.
if .%1 == .--borland goto :borland
if .%1 == .--mingw goto :mingw
if .%1 == .--msvc goto :msvc
if .%1 == .--watcom goto :watcom
goto :usage
:msvc
copy windows\config.h.ms src\config.h > nul
copy windows\Makefile.top Makefile > nul
copy windows\Makefile.src src\Makefile > nul
copy windows\Makefile.doc doc\Makefile > nul
echo Type NMAKE to start compiling.
echo If it doesn't work, try executing MSDEV\BIN\VCVARS32.BAT first,
echo and then NMAKE.
goto :end
:borland
copy windows\config.h.bor src\config.h > nul
copy windows\Makefile.top.bor Makefile > nul
copy windows\Makefile.src.bor src\Makefile > nul
copy windows\Makefile.doc doc\Makefile > nul
echo Type MAKE to start compiling.
goto :end
:mingw
copy windows\config.h.mingw src\config.h > nul
copy windows\Makefile.top.mingw Makefile > nul
copy windows\Makefile.src.mingw src\Makefile > nul
copy windows\Makefile.doc doc\Makefile > nul
echo Type mingw32-make to start compiling.
goto :end
:watcom
copy windows\config.h.ms src\config.h > nul
copy windows\Makefile.watcom src\Makefile > nul
@echo Checking environment vars
@set INCLUDE | find /I "WATCOM"
@set LIB | find /I "WATCOM"
@echo If WATCOM directories were not displayed, you need to
@echo SET INCLUDE and SET LIB to the Watcom directories
@echo.
cd src
@echo Type WMAKE to build
goto :end
:usage
echo "Usage: configure [--borland | --mingw | --msvc | --watcom]"
:end

View File

@ -1,9 +1,10 @@
dnl Template file for GNU Autoconf
dnl Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
dnl Copyright (C) 1995, 1996, 1997, 2001, 2007,
dnl 2008 Free Software Foundation, Inc.
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
dnl This program is distributed in the hope that it will be useful,
@ -12,25 +13,25 @@ dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
dnl In addition, as a special exception, the Free Software Foundation
dnl gives permission to link the code of its release of Wget with the
dnl OpenSSL project's "OpenSSL" library (or with modified versions of it
dnl that use the same license as the "OpenSSL" library), and distribute
dnl the linked executables. You must obey the GNU General Public License
dnl in all respects for all of the code used other than "OpenSSL". If you
dnl modify this file, you may extend this exception to your version of the
dnl file, but you are not obligated to do so. If you do not wish to do
dnl so, delete this exception statement from your version.
dnl Additional permission under GNU GPL version 3 section 7
dnl If you modify this program, or any covered work, by linking or
dnl combining it with the OpenSSL project's OpenSSL library (or a
dnl modified version of that library), containing parts covered by the
dnl terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
dnl grants you additional permission to convey the resulting work.
dnl Corresponding Source for a non-source form of such a combination
dnl shall include the source code for the parts of OpenSSL used as well
dnl as that of the covered work.
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT([src/version.c])
AC_PREREQ(2.59)
AC_PREREQ(2.61)
dnl Include the M4 macros we use.
builtin(include, [m4/wget.m4])dnl
@ -90,7 +91,7 @@ case "${ENABLE_OPIE}${ENABLE_DIGEST}" in
wget_need_md5=yes
esac
if test x"$ENABLE_OPIE" = xyes; then
OPIE_OBJ='ftp-opie$o'
OPIE_OBJ='ftp-opie.o'
fi
AC_SUBST(OPIE_OBJ)
@ -114,7 +115,6 @@ test -z "$CC" && cc_specified=yes
AC_PROG_CC
AC_AIX
AM_PROG_CC_STDC
dnl Turn on optimization by default. Specifically:
dnl
@ -125,7 +125,7 @@ dnl else
dnl use os-specific flags or -O
if test -n "$auto_cflags"; then
if test -n "$GCC"; then
CFLAGS="$CFLAGS -O2 -Wall -Wno-implicit"
CFLAGS="$CFLAGS -O2 -Wall"
else
case "$host_os" in
*hpux*) CFLAGS="$CFLAGS +O3" ;;
@ -135,80 +135,59 @@ if test -n "$auto_cflags"; then
fi
fi
dnl
dnl In case of {cyg,gnu}win32. Should be a _target_ test.
dnl Might also be erelevant for DJGPP.
dnl
case "$host_os" in
*win32) exeext='.exe';;
*) exeext='';;
esac
AC_SUBST(exeext)
dnl
dnl Checks for basic compiler characteristics.
dnl
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_C_BIGENDIAN
AC_C_PROTOTYPES
if test x"$am_cv_prog_cc_stdc" != xno; then :
AC_SUBST(U, [])
AC_SUBST(ANSI2KNR, [])
else
AC_SUBST(U, [_])
AC_SUBST(ANSI2KNR, [./ansi2knr])
fi
dnl
dnl Checks for header files that might be missing.
dnl
dnl Check for basic headers, even those we assume the presence of.
dnl This is because Autoconf default includes check for STDC_HEADERS,
dnl HAVE_SYS_TYPES_H, etc. before including them.
dnl Check for basic headers, even though we expect them to exist and
dnl #include them unconditionally in the code. Their detection is
dnl still needed because test programs used by Autoconf macros check
dnl for STDC_HEADERS, HAVE_SYS_TYPES_H, etc. before using them.
dnl Without the checks they will fail to be included in test programs,
dnl which will subsequently fail.
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/types.h sys/stat.h)
dnl Now check for the others.
AC_CHECK_HEADERS(string.h strings.h stdarg.h limits.h unistd.h sys/time.h)
AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/select.h utime.h sys/utime.h)
AC_CHECK_HEADERS(stdint.h inttypes.h signal.h setjmp.h pwd.h)
AC_HEADER_TIME
dnl Check for large file support. This check needs to come fairly
dnl early because it could (in principle) affect whether functions and
dnl headers are available, whether they work, etc.
AC_SYS_LARGEFILE
AC_CHECK_SIZEOF(off_t)
dnl
dnl Check integral type sizes.
dnl Checks for system header files that might be missing.
dnl
AC_HEADER_STDBOOL
AC_CHECK_HEADERS(unistd.h sys/time.h)
AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/select.h utime.h sys/utime.h)
AC_CHECK_HEADERS(stdint.h inttypes.h pwd.h wchar.h)
dnl
dnl Check sizes of integer types. These are used to find n-bit
dnl integral types on older systems that fail to provide intN_t and
dnl uintN_t typedefs.
dnl
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
dnl
dnl Check for large file support. This check needs to come fairly
dnl early because it could (in principle) affect whether functions and
dnl headers are available, whether they work, etc.
dnl
AC_SYS_LARGEFILE
AC_CHECK_SIZEOF(off_t)
AC_CHECK_SIZEOF(void *)
dnl
dnl Checks for non-universal or system-specific types.
dnl
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_CHECK_TYPES(uint32_t)
AC_TYPE_SIGNAL
AC_CHECK_TYPES([uint32_t, uintptr_t, intptr_t, int64_t])
AC_CHECK_TYPES(sig_atomic_t, [], [], [
#include <stdio.h>
#include <sys/types.h>
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_SIGNAL_H
# include <signal.h>
#endif
#include <signal.h>
])
dnl
@ -217,13 +196,21 @@ dnl
AC_FUNC_ALLOCA
AC_FUNC_MMAP
AC_FUNC_FSEEKO
AC_CHECK_FUNCS(strdup strstr strcasecmp strncasecmp strpbrk memmove)
AC_CHECK_FUNCS(gettimeofday mktime strptime timegm strerror snprintf vsnprintf)
AC_CHECK_FUNCS(usleep select ftello sigblock sigsetjmp signal)
AC_CHECK_FUNCS(symlink access isatty strtoll strtoimax)
AC_CHECK_FUNCS(strptime timegm snprintf vsnprintf vasprintf drand48)
AC_CHECK_FUNCS(strtoll usleep ftello sigblock sigsetjmp memrchr wcwidth mbtowc)
dnl We expect to have these functions on Unix-like systems configure
dnl runs on. The defines are provided to get them in config.h.in so
dnl Wget can still be ported to non-Unix systems (such as Windows)
dnl that lack some of these functions.
AC_DEFINE([HAVE_STRCASECMP], 1, [Define to 1 if you have the `strcasecmp' function.])
AC_DEFINE([HAVE_STRNCASECMP], 1, [Define to 1 if you have the `strncasecmp' function.])
AC_DEFINE([HAVE_STRDUP], 1, [Define to 1 if you have the `strdup' function.])
AC_DEFINE([HAVE_ISATTY], 1, [Define to 1 if you have the `isatty' function.])
AC_DEFINE([HAVE_SYMLINK], 1, [Define to 1 if you have the `symlink' function.])
dnl
dnl Call Wget's local macros defined in aclocal.
dnl Call Wget-specific macros defined in aclocal.
dnl
WGET_STRUCT_UTIMBUF
WGET_SOCKLEN_T
@ -236,7 +223,7 @@ dnl
dnl Check if we need to compile in getopt.c.
dnl
AC_CHECK_FUNC(getopt_long, [], [
GETOPT_OBJ='getopt$o'
GETOPT_OBJ='getopt.o'
])
AC_SUBST(GETOPT_OBJ)
@ -244,38 +231,50 @@ dnl
dnl Checks for libraries.
dnl
dnl Check for OpenSSL
if test x"$with_ssl" != x"no"
then
dnl As of this writing (OpenSSL 0.9.6), the libcrypto shared library
dnl doesn't record its dependency on libdl, so we need to make sure
dnl -ldl ends up in LIBS on systems that have it. Most OSes use
dnl dlopen(), but HP-UX uses shl_load().
AC_CHECK_LIB(dl, dlopen, [], [
AC_CHECK_LIB(dl, shl_load)
])
AS_IF([test x"$with_ssl" = xgnutls], [
dnl Now actually check for -lssl
AC_LIB_HAVE_LINKFLAGS([ssl], [crypto], [
#include <openssl/ssl.h>
#include <openssl/x509.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/des.h>
#include <openssl/md4.h>
#include <openssl/md5.h>
], [SSL_library_init ()])
if test x"$LIBSSL" != x
AC_LIB_HAVE_LINKFLAGS([gnutls], [], [
#include <gnutls/gnutls.h>
], [gnutls_global_init()])
if test x"$LIBGNUTLS" != x
then
AC_MSG_NOTICE([compiling in support for SSL])
AC_DEFINE([HAVE_SSL], 1,
[Define if SSL support is being compiled in.])
SSL_OBJ='openssl$o'
elif test x"$with_ssl" != x
then
AC_MSG_ERROR([--with-ssl was given, but OpenSSL is not available.])
AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
SSL_OBJ='gnutls.o'
else
AC_MSG_ERROR([--with-ssl=gnutls was given, but GNUTLS is not available.])
fi
fi
], [
# --with-ssl is not gnutls: check if it's no
AS_IF([test x"$with_ssl" != xno], [
dnl As of this writing (OpenSSL 0.9.6), the libcrypto shared library
dnl doesn't record its dependency on libdl, so we need to make sure
dnl -ldl ends up in LIBS on systems that have it. Most OSes use
dnl dlopen(), but HP-UX uses shl_load().
AC_CHECK_LIB(dl, dlopen, [], [
AC_CHECK_LIB(dl, shl_load)
])
dnl Now actually check for -lssl
AC_LIB_HAVE_LINKFLAGS([ssl], [crypto], [
#include <openssl/ssl.h>
#include <openssl/x509.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/des.h>
#include <openssl/md4.h>
#include <openssl/md5.h>
], [SSL_library_init ()])
if test x"$LIBSSL" != x
then
AC_MSG_NOTICE([compiling in support for SSL via OpenSSL])
SSL_OBJ='openssl.o'
elif test x"$with_ssl" != x
then
AC_MSG_ERROR([--with-ssl was given, but SSL is not available.])
fi
]) # endif: --with-ssl == no?
]) # endif: --with-ssl == gnutls?
AC_SUBST(SSL_OBJ)
dnl Enable NTLM if requested and if SSL is available.
@ -286,7 +285,7 @@ then
then
AC_DEFINE([ENABLE_NTLM], 1,
[Define if you want the NTLM authorization support compiled in.])
NTLM_OBJ='http-ntlm$o'
NTLM_OBJ='http-ntlm.o'
fi
else
dnl If SSL is unavailable and the user explicitly requested NTLM,
@ -308,7 +307,7 @@ then
dnl This should be moved to an AC_DEFUN, but I'm not sure how to
dnl manipulate MD5_OBJ from the defun.
MD5_OBJ='gen-md5$o'
MD5_OBJ='gen-md5.o'
found_md5=no
dnl Check for the system MD5 library on Solaris. We don't check for
@ -324,7 +323,7 @@ then
AC_COMPILE_IFELSE([#include <md5.h>
], [
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_SOLARIS_MD5], 1, [Define to use Solaris MD5.])
AC_DEFINE([HAVE_SOLARIS_MD5], 1, [Define when using Solaris MD5.])
LIBS="-lmd5 $LIBS"
found_md5=yes
AC_MSG_NOTICE([using the Solaris MD5 implementation])
@ -336,7 +335,7 @@ then
dnl implementation.
if test x"$found_md5" = xno; then
if test x"$LIBSSL" != x; then
AC_DEFINE([HAVE_OPENSSL_MD5], 1, [Define to use OpenSSL MD5.])
AC_DEFINE([HAVE_OPENSSL_MD5], 1, [Define when using OpenSSL MD5.])
found_md5=yes
AC_MSG_NOTICE([using the OpenSSL MD5 implementation])
fi
@ -344,10 +343,11 @@ then
dnl If none of the above worked, use the one we ship with Wget.
if test x"$found_md5" = xno; then
AC_DEFINE([HAVE_BUILTIN_MD5], 1, [Define to use built-in MD5.])
MD5_OBJ="$MD5_OBJ gnu-md5\$o"
AC_DEFINE([HAVE_BUILTIN_MD5], 1, [Define when using built-in MD5.])
MD5_OBJ="$MD5_OBJ gnu-md5.o"
found_md5=yes
AC_MSG_NOTICE([using the GNU MD5 implementation])
AC_MSG_NOTICE([using the built-in (GNU) MD5 implementation])
AC_C_BIGENDIAN
fi
fi
AC_DEFINE([HAVE_MD5], 1, [Define if we're compiling support for MD5.])
@ -470,7 +470,8 @@ dnl
dnl Create output
dnl
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile util/Makefile
po/Makefile.in windows/Makefile])
po/Makefile.in tests/Makefile tests/WgetTest.pm
windows/Makefile])
AC_CONFIG_HEADERS([src/config.h])
AH_BOTTOM([
#include "config-post.h"

View File

@ -1,3 +1,182 @@
2008-06-29 Micah Cowan <micah@cowan.name>
* wget.texi <Contributors>: Added Joao Ferreira.
* version.texi: Bumped version to 1.11.4.
2008-05-28 Micah Cowan <micah@cowan.name>
* version.texi: Bumped version to 1.11.3.
2008-05-12 Micah Cowan <micah@cowan.name>
* wget.texi (Download Options): -N with -O downgraded to a
warning.
2008-04-30 Micah Cowan <micah@cowan.name>
* version.texi: Bumped version to 1.11.2.
2008-04-27 Micah Cowan <micah@cowan.name>
* wget.texi (Download Options) <-O>: Elaborate on why certain
options make poor combinations with -O.
2008-04-11 Micah Cowan <micah@cowan.name>
* wget.texi <Contributors>: Added Julien Buty, Alexander
Dergachev, and Rabin Vincent.
2008-03-24 Micah Cowan <micah@cowan.name>
* wget.texi <Types of Fields>: Mentioned various caveats in the
behavior of accept/reject lists, deprecate current
always-download-HTML feature. Added @noindent to a couple of
appropriate spots.
2008-03-17 Micah Cowan <micah@cowan.name>
* wget.texi <Directory-Based Limits>: Mention importance of
trailing slashes to --no-parents.
2008-02-14 Micah Cowan <micah@cowan.name>
* Makefile.in: Install manpage from source dir, rather than
build dir.
2008-02-10 Micah Cowan <micah@cowan.name>
* wget.texi <HTTP Options>: Added documentation of
--auth-no-challenge.
2008-02-06 Micah Cowan <micah@cowan.name>
* wget.ṫexi <Overview>: Remove references to no-longer-supported
socks library.
2008-01-30 Micah Cowan <micah@cowan.name>
* version.texi: Bumped version to 1.11.1-devel.
* wget.texi: Ensure that license info appears in the info
version of the manual.
2008-01-25 Micah Cowan <micah@cowan.name>
* wget.texi: Update the "last updated" setting.
* Makefile.in, wget.texi: Updated copyright year.
* Makefile.in: Mark wget.pod as secondary, to avoid regeneration
because of wget.1's dependency upon it.
* version.texi: Bumped version to 1.11.
2007-12-10 Micah Cowan <micah@cowan.name>
* wget.texi: Document the --content-disposition option (and not
just the .wgetrc setting).
2007-12-06 Micah Cowan <micah@cowan.name>
* wget.texi: "the the" -> "the"
2007-12-05 Micah Cowan <micah@cowan.name>
* wget.texi <Wgetrc Commands>: Explicitly mention that
--content-disposition has known issues.
2007-10-13 Micah Cowan <micah@cowan.name>
* wget.texi <Mailing Lists>: Replaced mention of no-longer
included PATCHES file with link to relevant Wgiki page.
* wget.texi <Internet Relay Chat>: Added new section.
2007-10-10 Micah Cowan <micah@cowan.name>
* wget.texi <Wgetrc Commands>: Fixed "doewnloads" typo.
2007-10-03 Micah Cowan <micah@cowan.name>
* wget.texi <Wgetrc Commands>: Cleaned up alphabetization,
more consistent use of underscores. Added a description of the
content_disposition wgetrc command.
2007-10-01 Micah Cowan <micah@cowan.name>
* wget.texi: Updated information in Mailing Lists, Reporting
Bugs. Added Web Site section, and add information about Mac OS
X, MS-DOS, and VMS in Portability.
2007-09-27 Micah Cowan <micah@cowan.name>
* wget.texi: Removed "for more details" from parenthesese
enclosing @pxref{}s, so that texi2pod.pl knows to remove the
whole reference. Made some gramattical improvements, and
strengthened the recommendation to use the info manual instead.
* texi2pod.pl: Brought in some updates from the GCC version. Not
an entire update, since a couple "fixes" there breaks stuff
here.
2007-09-12 Micah Cowan <micah@cowan.name>
* wget.texi: Expanded the description of -O. Clarified the
detection of elements as "patterns" versus "suffixes" in -A,
-R. Describe -p in relation to -nc.
2007-07-28 Micah Cowan <micah@cowan.name>
* wget.texi <HTTP Options>: Added --max-redirect option.
2007-07-05 Micah Cowan <micah@cowan.name>
* fdl.texi:
Changed to match the version in gnulib.
* Makefile.in:
* texi2pod.pl:
* texinfo.tex:
Updated GPL reference to version 3 or later, removed FSF
address.
* wget.texi:
Slightly reworded the FDL license invocation. Replaced the
maintainer reference. Removed the GPL text from the manual.
* gpl.texi:
Removed due to discontinuation of reference in Wget manual.
2006-07-10 Mauro Tortonesi <mauro@ferrara.linux.it>
* wget.texi: Fixed rendering of --no-proxy description in the man
page. Added information about current maintainer.
2006-06-28 Mauro Tortonesi <mauro@ferrara.linux.it>
* wget.texi: Removed invariant status to the GPL and GFDL sections.
Changed UPDATED to Jun 2006. Updated copyright notice to include 2006.
2006-06-26 Hrvoje Niksic <hniksic@xemacs.org>
* wget.texi (Recursive Accept/Reject Options): Document
--ignore-case.
2006-06-20 Hrvoje Niksic <hniksic@xemacs.org>
* wget.texi (Download Options): Add missing word.
Reported by Adrian Knoth.
2006-02-05 Hrvoje Niksic <hniksic@xemacs.org>
(Download Options): Changed "a recent article" to "a 2001 article"
in the description of --random-wait, since the article in question
is not really recent.
2006-02-05 Hrvoje Niksic <hniksic@xemacs.org>
* wget.texi (Download Options): Document the modified meaning of
--random-wait.
2005-11-15 Hrvoje Niksic <hniksic@xemacs.org>
* wget.texi: Document https_proxy.
2005-09-02 Hrvoje Niksic <hniksic@xemacs.org>
* sample.wgetrc: Rewrite the "passive FTP" paragraph to better
@ -26,7 +205,8 @@
2005-06-23 Hrvoje Niksic <hniksic@xemacs.org>
* version.texi: Bump version to 1.10.1.
* wget.texi (Contributors): Updated list of principal
contributors.
2005-06-22 Hrvoje Niksic <hniksic@xemacs.org>
@ -45,6 +225,23 @@
* texinfo.tex: Update with a non-prehistoric version.
2005-06-22 Hrvoje Niksic <hniksic@xemacs.org>
* texi2pod.pl: Locate perl using the "env" program, so we don't
need to modify texi2pod.
* Makefile.in (wget.pod): Work with texi2pod.pl directly instead
of generating it from texi2pod.pl.in.
2005-06-22 Hrvoje Niksic <hniksic@xemacs.org>
* wget.texi (Wgetrc Commands): Remove the "lockable boolean"
feature.
2005-06-20 Hrvoje Niksic <hniksic@xemacs.org>
* ansi2knr.1: Removed.
2005-06-16 Hrvoje Niksic <hniksic@xemacs.org>
* wget.texi (Logging and Input File Options): It's --no-verbose,

View File

@ -1,9 +1,10 @@
# Makefile for `wget' utility
# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
# Copyright (C) 1995, 1996, 1997, 2007,
# 2008 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# 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,
@ -12,8 +13,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Version: @VERSION@
@ -48,7 +48,7 @@ INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
RM = rm -f
TEXI2POD = texi2pod.pl
TEXI2POD = $(srcdir)/texi2pod.pl
POD2MAN = @POD2MAN@
MAN = wget.$(manext)
WGETRC = $(sysconfdir)/wgetrc
@ -68,12 +68,9 @@ $(SAMPLERCTEXI): $(srcdir)/sample.wgetrc
wget.info: $(srcdir)/wget.texi $(SAMPLERCTEXI) $(srcdir)/version.texi
$(MAKEINFO) -I$(srcdir) $(srcdir)/wget.texi
$(TEXI2POD): $(srcdir)/$(TEXI2POD).in
sed 's,^#! /usr/bin/perl,#! @PERL@,' $? > $@
chmod u+x $@
wget.pod: $(srcdir)/wget.texi $(TEXI2POD) $(srcdir)/version.texi
./$(TEXI2POD) $(srcdir)/wget.texi $@
.SECONDARY: wget.pod
wget.pod: $(srcdir)/wget.texi $(srcdir)/version.texi
$(TEXI2POD) $(srcdir)/wget.texi $@
$(MAN): wget.pod
$(POD2MAN) --center="GNU Wget" --release="GNU Wget @VERSION@" $? > $@
@ -127,7 +124,7 @@ install.info: wget.info
# install man page, creating install directory if necessary
install.man: $(MAN)
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext)
$(INSTALL_DATA) $(MAN) $(DESTDIR)$(mandir)/man$(manext)/$(MAN)
$(INSTALL_DATA) $(srcdir)/$(MAN) $(DESTDIR)$(mandir)/man$(manext)/$(MAN)
# install sample.wgetrc
install.wgetrc: $(srcdir)/sample.wgetrc
@ -166,7 +163,7 @@ clean:
distclean: clean
$(RM) Makefile
$(RM) $(MAN) $(TEXI2POD)
$(RM) $(MAN)
realclean: distclean
$(RM) wget.info*

View File

@ -1,36 +0,0 @@
.TH ANSI2KNR 1 "19 Jan 1996"
.SH NAME
ansi2knr \- convert ANSI C to Kernighan & Ritchie C
.SH SYNOPSIS
.I ansi2knr
[--varargs] input_file [output_file]
.SH DESCRIPTION
If no output_file is supplied, output goes to stdout.
.br
There are no error messages.
.sp
.I ansi2knr
recognizes function definitions by seeing a non-keyword identifier at the left
margin, followed by a left parenthesis, with a right parenthesis as the last
character on the line, and with a left brace as the first token on the
following line (ignoring possible intervening comments). It will recognize a
multi-line header provided that no intervening line ends with a left or right
brace or a semicolon. These algorithms ignore whitespace and comments, except
that the function name must be the first thing on the line.
.sp
The following constructs will confuse it:
.br
- Any other construct that starts at the left margin and follows the
above syntax (such as a macro or function call).
.br
- Some macros that tinker with the syntax of the function header.
.sp
The --varargs switch is obsolete, and is recognized only for
backwards compatibility. The present version of
.I ansi2knr
will always attempt to convert a ... argument to va_alist and va_dcl.
.SH AUTHOR
L. Peter Deutsch <ghost@aladdin.com> wrote the original ansi2knr and
continues to maintain the current version; most of the code in the current
version is his work. ansi2knr also includes contributions by Francois
Pinard <pinard@iro.umontreal.ca> and Jim Avera <jima@netcom.com>.

View File

@ -1,12 +1,13 @@
@node GNU Free Documentation License
@section GNU Free Documentation License
@appendixsec GNU Free Documentation License
@cindex FDL, GNU Free Documentation License
@center Version 1.2, November 2002
@display
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -407,7 +408,7 @@ as a draft) by the Free Software Foundation.
@end enumerate
@page
@appendixsubsec ADDENDUM: How to use this License for your documents
@heading ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and

View File

@ -1,392 +0,0 @@
@node GNU General Public License
@section GNU General Public License
@center Version 2, June 1991
@c This file is intended to be included in another file.
@display
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@unnumberedsec Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software---to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) 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
this service 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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. 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.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
@iftex
@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@end iftex
@ifinfo
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@end ifinfo
@enumerate 0
@item
This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The ``Program'', below,
refers to any such program or work, and a ``work based on the Program''
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term ``modification''.) Each licensee is addressed as ``you''.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
@item
You may copy and distribute 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 and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
@item
You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
@enumerate a
@item
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
@item
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
@item
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
@end enumerate
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
@item
You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
@enumerate a
@item
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
@item
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
@item
Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
@end enumerate
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
@item
You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
@item
You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
@item
Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
@item
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
@item
If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
@item
The Free Software Foundation may publish revised and/or new versions
of the 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 a version number of this License which applies to it and ``any
later version'', you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
@item
If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
@iftex
@heading NO WARRANTY
@end iftex
@ifinfo
@center NO WARRANTY
@end ifinfo
@item
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
@item
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE 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.
@end enumerate
@iftex
@heading END OF TERMS AND CONDITIONS
@end iftex
@ifinfo
@center END OF TERMS AND CONDITIONS
@end ifinfo
@page
@unnumberedsec Appendix: 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
convey the exclusion of warranty; and each file should have at least
the ``copyright'' line and a pointer to where the full notice is found.
@smallexample
@var{one line to give the program's name and a brief idea of what it does.}
Copyright (C) @var{yyyy} @var{name of author}
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 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@end smallexample
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
@smallexample
Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
Gnomovision 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.
@end smallexample
The hypothetical commands @samp{show w} and @samp{show c} should show
the appropriate parts of the General Public License. Of course, the
commands you use may be called something other than @samp{show w} and
@samp{show c}; they could even be mouse-clicks or menu items---whatever
suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a ``copyright disclaimer'' for the program, if
necessary. Here is a sample; alter the names:
@example
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
@var{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
@end example
This 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.

View File

@ -1,112 +0,0 @@
###
### Sample Wget initialization file .wgetrc
###
## You can use this file to change the default behaviour of wget or to
## avoid having to type many many command-line options. This file does
## not contain a comprehensive list of commands -- look at the manual
## to find out what you can put into this file.
##
## Wget initialization file can reside in /usr/local/etc/wgetrc
## (global, for all users) or $HOME/.wgetrc (for a single user).
##
## To use the settings in this file, you will have to uncomment them,
## as well as change them, in most cases, as the values on the
## commented-out lines are the default values (e.g. "off").
##
## Global settings (useful for setting up in /usr/local/etc/wgetrc).
## Think well before you change them, since they may reduce wget's
## functionality, and make it behave contrary to the documentation:
##
# You can set retrieve quota for beginners by specifying a value
# optionally followed by 'K' (kilobytes) or 'M' (megabytes). The
# default quota is unlimited.
#quota = inf
# You can lower (or raise) the default number of retries when
# downloading a file (default is 20).
#tries = 20
# Lowering the maximum depth of the recursive retrieval is handy to
# prevent newbies from going too "deep" when they unwittingly start
# the recursive retrieval. The default is 5.
#reclevel = 5
# By default Wget uses "passive FTP" transfer where the client
# initiates the data connection to the server rather than the other
# way around. That is required on systems behind NAT where the client
# computer cannot be easily reached from the Internet. However, some
# firewalls software explicitly supports active FTP and in fact has
# problems supporting passive transfer. If you are in such
# environment, use "passive_ftp = off" to revert to active FTP.
#passive_ftp = off
# The "wait" command below makes Wget wait between every connection.
# If, instead, you want Wget to wait only between retries of failed
# downloads, set waitretry to maximum number of seconds to wait (Wget
# will use "linear backoff", waiting 1 second after the first failure
# on a file, 2 seconds after the second failure, etc. up to this max).
waitretry = 10
##
## Local settings (for a user to set in his $HOME/.wgetrc). It is
## *highly* undesirable to put these settings in the global file, since
## they are potentially dangerous to "normal" users.
##
## Even when setting up your own ~/.wgetrc, you should know what you
## are doing before doing so.
##
# Set this to on to use timestamping by default:
#timestamping = off
# It is a good idea to make Wget send your email address in a `From:'
# header with your request (so that server administrators can contact
# you in case of errors). Wget does *not* send `From:' by default.
#header = From: Your Name <username@@site.domain>
# You can set up other headers, like Accept-Language. Accept-Language
# is *not* sent by default.
#header = Accept-Language: en
# You can set the default proxies for Wget to use for http and ftp.
# They will override the value in the environment.
#http_proxy = http://proxy.yoyodyne.com:18023/
#ftp_proxy = http://proxy.yoyodyne.com:18023/
# If you do not want to use proxy at all, set this to off.
#use_proxy = on
# You can customize the retrieval outlook. Valid options are default,
# binary, mega and micro.
#dot_style = default
# Setting this to off makes Wget not download /robots.txt. Be sure to
# know *exactly* what /robots.txt is and how it is used before changing
# the default!
#robots = on
# It can be useful to make Wget wait between connections. Set this to
# the number of seconds you want Wget to wait.
#wait = 0
# You can force creating directory structure, even if a single is being
# retrieved, by setting this to on.
#dirstruct = off
# You can turn on recursive retrieving by default (don't do this if
# you are not sure you know what it means) by setting this to on.
#recursive = off
# To always back up file X as X.orig before converting its links (due
# to -k / --convert-links / convert_links = on having been specified),
# set this variable to on:
#backup_converted = off
# To have Wget follow FTP links from HTML files by default, set this
# to on:
#follow_ftp = off

View File

@ -1,12 +1,13 @@
#! /usr/bin/perl -w
#! /usr/bin/env perl
# Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
# Copyright (C) 1999, 2000, 2001, 2003, 2007 Free Software
# Foundation, Inc.
# This file is part of GCC.
# GCC 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 2, or (at your option)
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# GCC is distributed in the hope that it will be useful,
@ -15,14 +16,14 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston MA 02111-1307, USA.
# along with GCC. If not, see <http://www.gnu.org/licenses/>.
# This does trivial (and I mean _trivial_) conversion of Texinfo
# markup to Perl POD format. It's intended to be used to extract
# something suitable for a manpage from a Texinfo document.
use warnings;
$output = 0;
$skipping = 0;
%sects = ();
@ -227,11 +228,12 @@ while(<$inf>) {
/^\@include\s+(.+)$/ and do {
push @instack, $inf;
$inf = gensym();
$file = postprocess($1);
# Try cwd and $ibase.
open($inf, "<" . $1)
or open($inf, "<" . $ibase . "/" . $1)
or die "cannot open $1 or $ibase/$1: $!\n";
open($inf, "<" . $file)
or open($inf, "<" . $ibase . "/" . $file)
or die "cannot open $file or $ibase/$file: $!\n";
next;
};
@ -274,7 +276,6 @@ while(<$inf>) {
$ic =~ s/\@(?:code|kbd)/C/;
$ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
$ic =~ s/\@(?:file)/F/;
$ic =~ s/\@(?:asis)/S/; # punt
$_ = "\n=over 4\n";
};
@ -308,7 +309,7 @@ die "No filename or title\n" unless defined $fn && defined $tl;
$sects{NAME} = "$fn \- $tl\n";
$sects{FOOTNOTES} .= "=back\n" if exists $sects{FOOTNOTES};
for $sect (qw(NAME SYNOPSIS DESCRIPTION OPTIONS ENVIRONMENT EXAMPLES FILES
for $sect (qw(NAME SYNOPSIS DESCRIPTION OPTIONS ENVIRONMENT FILES
BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) {
if(exists $sects{$sect}) {
$head = $sect;
@ -350,6 +351,13 @@ sub postprocess
s/\@w\{([^\}]*)\}/S<$1>/g;
s/\@(?:dmn|math)\{([^\}]*)\}/$1/g;
# keep references of the form @ref{...}, print them bold
s/\@(?:ref)\{([^\}]*)\}/B<$1>/g;
# Change double single quotes to double quotes.
s/''/"/g;
s/``/"/g;
# Cross references are thrown away, as are @noindent and @refill.
# (@noindent is impossible in .pod, and @refill is unnecessary.)
# @* is also impossible in .pod; we discard it and any newline that

View File

@ -11,7 +11,7 @@
%
% This texinfo.tex file 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 2, or (at
% published by the Free Software Foundation; either version 3, or (at
% your option) any later version.
%
% This texinfo.tex file is distributed in the hope that it will be
@ -20,9 +20,8 @@
% General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this texinfo.tex file; see the file COPYING. If not, write
% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
% Boston, MA 02111-1307, USA.
% along with this texinfo.tex file. If not, see
% <http://www.gnu.org/licenses/>.
%
% As a special exception, when this file is read by TeX when processing
% a Texinfo source document, you may use the result without

View File

@ -1 +1 @@
@set VERSION 1.10.2
@set VERSION 1.11.4

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
# lib-ld.m4 serial 3 (gettext-0.13)
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
dnl Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
dnl 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

View File

@ -1,5 +1,6 @@
# lib-link.m4 serial 6 (gettext-0.14.3)
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
dnl Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
dnl Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

View File

@ -1,5 +1,6 @@
# lib-prefix.m4 serial 4 (gettext-0.14.2)
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
dnl Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
dnl Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

View File

@ -1,9 +1,10 @@
dnl Wget-specific Autoconf macros.
dnl Copyright (C) 1996-2005 Free Software Foundation, Inc.
dnl Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
dnl 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
dnl This program is distributed in the hope that it will be useful,
@ -12,18 +13,18 @@ dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
dnl In addition, as a special exception, the Free Software Foundation
dnl gives permission to link the code of its release of Wget with the
dnl OpenSSL project's "OpenSSL" library (or with modified versions of it
dnl that use the same license as the "OpenSSL" library), and distribute
dnl the linked executables. You must obey the GNU General Public License
dnl in all respects for all of the code used other than "OpenSSL". If you
dnl modify this file, you may extend this exception to your version of the
dnl file, but you are not obligated to do so. If you do not wish to do
dnl so, delete this exception statement from your version.
dnl Additional permission under GNU GPL version 3 section 7
dnl If you modify this program, or any covered work, by linking or
dnl combining it with the OpenSSL project's OpenSSL library (or a
dnl modified version of that library), containing parts covered by the
dnl terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
dnl grants you additional permission to convey the resulting work.
dnl Corresponding Source for a non-source form of such a combination
dnl shall include the source code for the parts of OpenSSL used as well
dnl as that of the covered work.
dnl
dnl Check for `struct utimbuf'.
@ -138,63 +139,6 @@ AC_DEFUN([WGET_NSL_SOCKET], [
])
# serial 1
# @defmac AC_PROG_CC_STDC
# @maindex PROG_CC_STDC
# @ovindex CC
# If the C compiler in not in ANSI C mode by default, try to add an option
# to output variable @code{CC} to make it so. This macro tries various
# options that select ANSI C on some system or another. It considers the
# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
# handles function prototypes correctly.
#
# If you use this macro, you should check after calling it whether the C
# compiler has been set to accept ANSI C; if not, the shell variable
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
AC_DEFUN(AM_PROG_CC_STDC,
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
AC_CACHE_VAL(am_cv_prog_cc_stdc,
[am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
# HP-UX -Aa -D_HPUX_SOURCE
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
[#if !defined(__STDC__)
choke me
#endif
/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/stat.h>
#endif
], [
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};],
[am_cv_prog_cc_stdc="$ac_arg"; break])
done
CC="$ac_save_CC"
])
AC_MSG_RESULT($am_cv_prog_cc_stdc)
case "x$am_cv_prog_cc_stdc" in
x|xno) ;;
*) CC="$CC $am_cv_prog_cc_stdc" ;;
esac
])
dnl ************************************************************
dnl START OF IPv6 AUTOCONFIGURATION SUPPORT MACROS
dnl ************************************************************
@ -336,7 +280,7 @@ AC_DEFUN([WGET_WITH_NLS],
fi
fi
AC_CHECK_HEADERS(locale.h libintl.h)
AC_CHECK_HEADERS(libintl.h)
dnl Prefer gettext found in -lintl to the one in libc.
dnl Otherwise it can happen that we include libintl.h from
@ -390,7 +334,7 @@ dnl
dnl This is not strictly an Autoconf macro, because it is run from
dnl within `config.status' rather than from within configure. This
dnl is why special rules must be applied for it.
AC_DEFUN(WGET_PROCESS_PO,
AC_DEFUN([WGET_PROCESS_PO],
[
dnl I wonder what the following several lines do...
if test "x$srcdir" != "x."; then
@ -422,11 +366,9 @@ AC_DEFUN(WGET_PROCESS_PO,
# functionality. Please note that the actual code is *not* freely
# available.
# serial 1
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
@ -461,3 +403,4 @@ else
fi
AC_SUBST($1)dnl
])

View File

@ -0,0 +1,23 @@
2008-01-25 Micah Cowan <micah@cowan.name>
* config.h: Updated copyright year.
2007-11-28 Micah Cowan <micah@cowan.name>
* config.h: Updated license exception for OpenSSL, per the SFLC.
2007-10-02 Gisle Vanem <gvanem@broadpark.no>
* config.h: Removed unused defines, added needed 'HAVE_*' defines.
* Makefile.DJ: rewritten to be used from './src' directory.
Added '-DOPENSSL_NO_KRB5' for OpenSSL build. Target is
now wget.exe.
* Makefile.WC: Added for building with OpenWatcom targeting
32-bit DOS (DOS32A extender).
2007-09-24 Gisle Vanem <giva@bgnett.no>
* Makefile.DJ, config.h: Added to support building on MS-DOS via
DJGPP.

View File

@ -0,0 +1,72 @@
#
# GNU Makefile for wget / djgpp / MSDOS.
# By Gisle Vanem <giva@bgnett.no> 2007.
#
# `cd' to `./src' and issue the command:
# make -f ../msdos/Makefile.dj
#
.SUFFIXES: .exe
USE_OPENSSL = 0
USE_IPV6 = 1
#
# Change to suite.
#
OPENSSL_ROOT = e:/net/OpenSSL.099
ZLIB_ROOT = e:/djgpp/contrib/zlib
OBJ_DIR = djgpp.obj
CC = gcc
CFLAGS = -O2 -g -Wall -Wcast-align -I. -I../msdos -I/dev/env/WATT_ROOT/inc \
-DHAVE_CONFIG_H -DENABLE_DEBUG
# LDFLAGS = -s
ifeq ($(USE_OPENSSL),1)
CFLAGS += -DHAVE_OPENSSL -DHAVE_SSL -DOPENSSL_NO_KRB5 -I$(OPENSSL_ROOT)
EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a \
$(ZLIB_ROOT)/libz.a
SOURCES += openssl.c http-ntlm.c
endif
ifeq ($(USE_IPV6),1)
CFLAGS += -DENABLE_IPV6
endif
EX_LIBS += /dev/env/WATT_ROOT/lib/libwatt.a
SOURCES += cmpt.c connect.c cookies.c ftp.c ftp-basic.c ftp-ls.c \
ftp-opie.c getopt.c hash.c host.c html-parse.c html-url.c \
http.c init.c log.c main.c gen-md5.c gnu-md5.c netrc.c \
progress.c recur.c res.c retr.c safe-ctype.c url.c utils.c \
version.c convert.c xmalloc.c ptimer.c spider.c
OBJECTS = $(addprefix $(OBJ_DIR)/, $(SOURCES:.c=.o))
all: $(OBJ_DIR) wget.exe
@echo 'Welcome to Wget'
$(OBJ_DIR):
mkdir $(OBJ_DIR)
wget.exe: $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $^ $(EX_LIBS)
clean:
rm -f $(OBJECTS) $(MAPFILE)
vclean realclean: clean
rm -f wget.exe depend.dj
- rmdir $(OBJ_DIR)
$(OBJ_DIR)/%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
@echo
depend:
$(CC) -MM $(CFLAGS) $(SOURCES) | \
sed -e 's/^\([a-zA-Z0-9_-]*\.o:\)/$$(OBJ_DIR)\/\1/' > depend.dj
-include depend.dj

View File

@ -0,0 +1,49 @@
#
# Makefile for Wget / DOS32A / OpenWatcom
# by G. Vanem <gvanem@broadpark.no> 2007
#
COMPILE = *wcc386 -mf -3r -w6 -d2 -zq -zm -of -I. -I$(%watt_root)\inc &
-I..\msdos -fr=nul -bt=dos -s -dHAVE_CONFIG_H -dENABLE_DEBUG &
-dSIZEOF_INT=4
LINK = *wlink option quiet, map, verbose, eliminate, caseexact, stack=100k &
debug all system dos32a
OBJ_DIR = Watcom.obj
OBJECTS = $(OBJ_DIR)\cmpt.obj $(OBJ_DIR)\connect.obj &
$(OBJ_DIR)\convert.obj $(OBJ_DIR)\cookies.obj &
$(OBJ_DIR)\ftp-basic.obj $(OBJ_DIR)\ftp-ls.obj &
$(OBJ_DIR)\ftp-opie.obj $(OBJ_DIR)\ftp.obj &
$(OBJ_DIR)\gen-md5.obj $(OBJ_DIR)\getopt.obj &
$(OBJ_DIR)\gnu-md5.obj $(OBJ_DIR)\hash.obj &
$(OBJ_DIR)\host.obj $(OBJ_DIR)\html-parse.obj &
$(OBJ_DIR)\html-url.obj $(OBJ_DIR)\http.obj &
$(OBJ_DIR)\init.obj $(OBJ_DIR)\log.obj &
$(OBJ_DIR)\main.obj $(OBJ_DIR)\netrc.obj &
$(OBJ_DIR)\progress.obj $(OBJ_DIR)\ptimer.obj &
$(OBJ_DIR)\recur.obj $(OBJ_DIR)\res.obj &
$(OBJ_DIR)\retr.obj $(OBJ_DIR)\safe-ctype.obj &
$(OBJ_DIR)\spider.obj $(OBJ_DIR)\url.obj &
$(OBJ_DIR)\utils.obj $(OBJ_DIR)\version.obj &
$(OBJ_DIR)\xmalloc.obj
all: $(OBJ_DIR) wget.exe .SYMBOLIC
@echo 'Welcome to Wget / Watcom'
$(OBJ_DIR):
- mkdir $^@
.ERASE
.c{$(OBJ_DIR)}.obj:
*$(COMPILE) $[@ -fo=$@
wget.exe: $(OBJECTS)
$(LINK) name $@ file { $(OBJECTS) } library $(%watt_root)\lib\wattcpwf.lib
clean: .SYMBOLIC
- rm $(OBJ_DIR)\*.obj wget.exe wget.map
- rmdir $(OBJ_DIR)

View File

@ -0,0 +1,121 @@
/* Configuration header file for MS-DOS/Watt-32
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
This file is part of GNU Wget.
GNU Wget 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.
GNU Wget 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 Wget. If not, see <http://www.gnu.org/licenses/>.
Additional permission under GNU GPL version 3 section 7
If you modify this program, or any covered work, by linking or
combining it with the OpenSSL project's OpenSSL library (or a
modified version of that library), containing parts covered by the
terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
grants you additional permission to convey the resulting work.
Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#ifndef CONFIG_DOS_H
#define CONFIG_DOS_H
#include <stdlib.h>
#include <limits.h>
#include <tcp.h>
#include <malloc.h>
#ifdef __DJGPP__
#include <sys/config.h>
#endif
#include <sys/errno.h>
#if defined(__WATCOMC__) && (__WATCOMC__ >= 1250) /* OW 1.5+ */
#define OPENWATCOM_15
#endif
#if defined(__HIGHC__)
#define HAVE_UNISTD_H 1
#define HAVE_UTIME_H 1
#endif
#if defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__HIGHC__)
#define inline
#endif
#define USE_OPIE 1
#define USE_DIGEST 1
#define DEBUG
#ifdef __DJGPP__
#define HAVE__BOOL 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_SIGSETJMP 1
#define HAVE_SIGBLOCK 1
#define HAVE_STRUCT_UTIMBUF 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_USLEEP 1
#define HAVE_UTIME_H 1
#define HAVE_INT64_T 1
#if (DJGPP_MINOR >= 4)
#include <stdbool.h>
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_UINT32_T 1
#endif
#endif
#ifdef __HIGHC__
#define HAVE_STRUCT_UTIMBUF 1
#define HAVE_UTIME_H 1
#endif
#ifdef OPENWATCOM_15
#define HAVE_INT64_T 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_UTIME_H 1
#endif
#define HAVE_PROCESS_H 1
#define HAVE_STRDUP 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_BUILTIN_MD5 1
#define HAVE_ISATTY 1
#define lookup_host wget_lookuphost
#define select select_s
#define socklen_t int
#define sock_read wget_sock_read
#define sock_write wget_sock_write
#define sock_close wget_sock_close
#if !defined(__DJGPP__)
#include <direct.h>
#define mkdir(p,a) (mkdir)(p)
#define strcasecmp stricmp
#endif
#if !defined(MSDOS)
#define MSDOS
#endif
#define OS_TYPE "DOS"
#endif /* CONFIG_DOS_H */

View File

@ -1,5 +1,6 @@
# List of files which containing translatable strings.
# Copyright (C) 1998 Free Software Foundation, Inc.
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
# 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# Package source files
src/cmpt.c
@ -29,6 +30,7 @@ src/ptimer.c
src/recur.c
src/res.c
src/retr.c
src/spider.c
src/url.c
src/utils.c
src/version.c

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,10 @@
# Makefile for `wget' utility
# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
# 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# 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,
@ -12,18 +13,18 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# along with Wget. If not, see <http://www.gnu.org/licenses/>.
# In addition, as a special exception, the Free Software Foundation
# gives permission to link the code of its release of Wget with the
# OpenSSL project's "OpenSSL" library (or with modified versions of it
# that use the same license as the "OpenSSL" library), and distribute
# the linked executables. You must obey the GNU General Public License
# in all respects for all of the code used other than "OpenSSL". If you
# modify this file, you may extend this exception to your version of the
# file, but you are not obligated to do so. If you do not wish to do
# so, delete this exception statement from your version.
# Additional permission under GNU GPL version 3 section 7
# If you modify this program, or any covered work, by linking or
# combining it with the OpenSSL project's OpenSSL library (or a
# modified version of that library), containing parts covered by the
# terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
# grants you additional permission to convey the resulting work.
# Corresponding Source for a non-source form of such a combination
# shall include the source code for the parts of OpenSSL used as well
# as that of the covered work.
#
# Version: @VERSION@
@ -36,14 +37,13 @@ top_builddir = ..
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
ANSI2KNR = @ANSI2KNR@
o = .@U@o
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sysconfdir = @sysconfdir@
localedir = $(prefix)/share/locale
datadir = @datadir@
localedir = $(datadir)/locale
DESTDIR =
@ -52,9 +52,9 @@ CPPFLAGS = @CPPFLAGS@
# The following line is losing on some versions of make!
DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ @LIBSSL@
exeext = @exeext@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ @LIBSSL@ @LIBGNUTLS@
exeext = @EXEEXT@
INCLUDES = -I. -I$(srcdir)
@ -73,53 +73,35 @@ NTLM_OBJ = @NTLM_OBJ@
SSL_OBJ = @SSL_OBJ@
GETOPT_OBJ = @GETOPT_OBJ@
OBJ = $(ALLOCA) cmpt$o connect$o convert$o cookies$o \
ftp$o ftp-basic$o ftp-ls$o $(OPIE_OBJ) $(GETOPT_OBJ) hash$o \
host$o html-parse$o html-url$o http$o $(NTLM_OBJ) init$o \
log$o main$o $(MD5_OBJ) netrc$o progress$o ptimer$o recur$o \
res$o retr$o safe-ctype$o snprintf$o $(SSL_OBJ) url$o \
utils$o version$o xmalloc$o
OBJ = $(ALLOCA) cmpt.o connect.o convert.o cookies.o \
ftp.o ftp-basic.o ftp-ls.o $(OPIE_OBJ) $(GETOPT_OBJ) hash.o \
host.o html-parse.o html-url.o http.o $(NTLM_OBJ) init.o \
log.o main.o $(MD5_OBJ) netrc.o progress.o ptimer.o recur.o \
res.o retr.o safe-ctype.o snprintf.o spider.o $(SSL_OBJ) \
url.o utils.o version.o xmalloc.o
.SUFFIXES:
.SUFFIXES: .c .o ._c ._o
.SUFFIXES: .c .o
.c.o:
$(COMPILE) -c $<
.c._c: $(ANSI2KNR)
$(ANSI2KNR) $< > $*.tmp && mv $*.tmp $@
._c._o:
@echo $(COMPILE) -c $<
@rm -f _$*.c
@ln $< _$*.c && $(COMPILE) -c _$*.c && mv _$*.o $@ && rm _$*.c
.c._o: $(ANSI2KNR)
$(ANSI2KNR) $< > $*.tmp && mv $*.tmp $*._c
@echo $(COMPILE) -c $*._c
@rm -f _$*.c
@ln $*._c _$*.c && $(COMPILE) -c _$*.c && mv _$*.o $@ && rm _$*.c
# Dependencies for building
wget$(exeext): $(OBJ)
$(LINK) $(OBJ) $(LIBS)
ansi2knr: ansi2knr.o
$(CC) -o ansi2knr ansi2knr.o $(LIBS)
# We make object files depend on every header. Rather than attempt to
# track dependencies, everything gets recompiled when a header
# changes. With a program of Wget's size this doesn't waste much
# time, and it's a lot safer than attempting to get all the
# dependencies right.
$(OBJ): $(ANSI2KNR) \
config-post.h connect.h convert.h cookies.h ftp.h gen-md5.h \
getopt.h gnu-md5.h hash.h host.h html-parse.h http-ntlm.h \
init.h log.h mswindows.h netrc.h options.h progress.h \
ptimer.h recur.h res.h retr.h safe-ctype.h ssl.h sysdep.h \
url.h utils.h wget.h xmalloc.h
$(OBJ): config-post.h config.h connect.h convert.h cookies.h ftp.h \
gen-md5.h getopt.h gnu-md5.h hash.h host.h html-parse.h \
http-ntlm.h init.h log.h mswindows.h netrc.h options.h \
progress.h ptimer.h recur.h res.h retr.h safe-ctype.h \
spider.h ssl.h sysdep.h url.h utils.h wget.h xmalloc.h
#
# Dependencies for installing
@ -141,7 +123,7 @@ uninstall.bin:
#
clean:
$(RM) *.o wget$(exeext) *~ *.bak core core.[0-9]* $(ANSI2KNR) *._o *._c
$(RM) *.o wget$(exeext) *~ *.bak core core.[0-9]*
distclean: clean
$(RM) Makefile config.h

View File

@ -74,7 +74,7 @@ typedef char *pointer;
#endif
#ifndef NULL
#define NULL 0
#define NULL 0
#endif
/* Different portions of Emacs need to call different versions of
@ -103,37 +103,37 @@ extern pointer malloc ();
STACK_DIRECTION = 0 => direction of growth unknown */
#ifndef STACK_DIRECTION
#define STACK_DIRECTION 0 /* Direction unknown. */
#define STACK_DIRECTION 0 /* Direction unknown. */
#endif
#if STACK_DIRECTION != 0
#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
#else /* STACK_DIRECTION == 0; need run-time code. */
static int stack_dir; /* 1 or -1 once known. */
#define STACK_DIR stack_dir
static int stack_dir; /* 1 or -1 once known. */
#define STACK_DIR stack_dir
static void
find_stack_direction ()
{
static char *addr = NULL; /* Address of first `dummy', once known. */
auto char dummy; /* To get stack address. */
static char *addr = NULL; /* Address of first `dummy', once known. */
auto char dummy; /* To get stack address. */
if (addr == NULL)
{ /* Initial entry. */
{ /* Initial entry. */
addr = ADDRESS_FUNCTION (dummy);
find_stack_direction (); /* Recurse once. */
find_stack_direction (); /* Recurse once. */
}
else
{
/* Second entry. */
if (ADDRESS_FUNCTION (dummy) > addr)
stack_dir = 1; /* Stack grew upward. */
stack_dir = 1; /* Stack grew upward. */
else
stack_dir = -1; /* Stack grew downward. */
stack_dir = -1; /* Stack grew downward. */
}
}
@ -146,21 +146,21 @@ find_stack_direction ()
It is very important that sizeof(header) agree with malloc
alignment chunk size. The following default should work okay. */
#ifndef ALIGN_SIZE
#define ALIGN_SIZE sizeof(double)
#ifndef ALIGN_SIZE
#define ALIGN_SIZE sizeof(double)
#endif
typedef union hdr
{
char align[ALIGN_SIZE]; /* To force sizeof(header). */
char align[ALIGN_SIZE]; /* To force sizeof(header). */
struct
{
union hdr *next; /* For chaining headers. */
char *deep; /* For stack depth measure. */
union hdr *next; /* For chaining headers. */
char *deep; /* For stack depth measure. */
} h;
} header;
static header *last_alloca_header = NULL; /* -> last alloca header. */
static header *last_alloca_header = NULL; /* -> last alloca header. */
/* Return a pointer to at least SIZE bytes of storage,
which will be automatically reclaimed upon exit from
@ -173,11 +173,11 @@ pointer
alloca (size)
unsigned size;
{
auto char probe; /* Probes stack depth: */
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
#if STACK_DIRECTION == 0
if (STACK_DIR == 0) /* Unknown growth direction. */
if (STACK_DIR == 0) /* Unknown growth direction. */
find_stack_direction ();
#endif
@ -185,7 +185,7 @@ alloca (size)
was allocated from deeper in the stack than currently. */
{
register header *hp; /* Traverses linked list. */
register header *hp; /* Traverses linked list. */
#ifdef emacs
BLOCK_INPUT;
@ -193,18 +193,18 @@ alloca (size)
for (hp = last_alloca_header; hp != NULL;)
if ((STACK_DIR > 0 && hp->h.deep > depth)
|| (STACK_DIR < 0 && hp->h.deep < depth))
{
register header *np = hp->h.next;
|| (STACK_DIR < 0 && hp->h.deep < depth))
{
register header *np = hp->h.next;
free ((pointer) hp); /* Collect garbage. */
free ((pointer) hp); /* Collect garbage. */
hp = np; /* -> next header. */
}
hp = np; /* -> next header. */
}
else
break; /* Rest are not deeper. */
break; /* Rest are not deeper. */
last_alloca_header = hp; /* -> last valid storage. */
last_alloca_header = hp; /* -> last valid storage. */
#ifdef emacs
UNBLOCK_INPUT;
@ -212,7 +212,7 @@ alloca (size)
}
if (size == 0)
return NULL; /* No allocation required. */
return NULL; /* No allocation required. */
/* Allocate combined header + user data storage. */
@ -246,10 +246,10 @@ alloca (size)
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
struct stack_control_header
{
long shgrow:32; /* Number of times stack has grown. */
long shaseg:32; /* Size of increments to stack. */
long shhwm:32; /* High water mark of stack. */
long shsize:32; /* Current size of stack (all segments). */
long shgrow:32; /* Number of times stack has grown. */
long shaseg:32; /* Size of increments to stack. */
long shhwm:32; /* High water mark of stack. */
long shsize:32; /* Current size of stack (all segments). */
};
/* The stack segment linkage control information occurs at
@ -261,21 +261,21 @@ struct stack_control_header
struct stack_segment_linkage
{
long ss[0200]; /* 0200 overflow words. */
long sssize:32; /* Number of words in this segment. */
long ssbase:32; /* Offset to stack base. */
long ss[0200]; /* 0200 overflow words. */
long sssize:32; /* Number of words in this segment. */
long ssbase:32; /* Offset to stack base. */
long:32;
long sspseg:32; /* Offset to linkage control of previous
segment of stack. */
long sspseg:32; /* Offset to linkage control of previous
segment of stack. */
long:32;
long sstcpt:32; /* Pointer to task common address block. */
long sscsnm; /* Private control structure number for
microtasking. */
long ssusr1; /* Reserved for user. */
long ssusr2; /* Reserved for user. */
long sstpid; /* Process ID for pid based multi-tasking. */
long ssgvup; /* Pointer to multitasking thread giveup. */
long sscray[7]; /* Reserved for Cray Research. */
long sstcpt:32; /* Pointer to task common address block. */
long sscsnm; /* Private control structure number for
microtasking. */
long ssusr1; /* Reserved for user. */
long ssusr2; /* Reserved for user. */
long sstpid; /* Process ID for pid based multi-tasking. */
long ssgvup; /* Pointer to multitasking thread giveup. */
long sscray[7]; /* Reserved for Cray Research. */
long ssa0;
long ssa1;
long ssa2;
@ -299,27 +299,27 @@ struct stack_segment_linkage
returned by the STKSTAT library routine. */
struct stk_stat
{
long now; /* Current total stack size. */
long maxc; /* Amount of contiguous space which would
be required to satisfy the maximum
stack demand to date. */
long high_water; /* Stack high-water mark. */
long overflows; /* Number of stack overflow ($STKOFEN) calls. */
long hits; /* Number of internal buffer hits. */
long extends; /* Number of block extensions. */
long stko_mallocs; /* Block allocations by $STKOFEN. */
long underflows; /* Number of stack underflow calls ($STKRETN). */
long stko_free; /* Number of deallocations by $STKRETN. */
long stkm_free; /* Number of deallocations by $STKMRET. */
long segments; /* Current number of stack segments. */
long maxs; /* Maximum number of stack segments so far. */
long pad_size; /* Stack pad size. */
long current_address; /* Current stack segment address. */
long current_size; /* Current stack segment size. This
number is actually corrupted by STKSTAT to
include the fifteen word trailer area. */
long initial_address; /* Address of initial segment. */
long initial_size; /* Size of initial segment. */
long now; /* Current total stack size. */
long maxc; /* Amount of contiguous space which would
be required to satisfy the maximum
stack demand to date. */
long high_water; /* Stack high-water mark. */
long overflows; /* Number of stack overflow ($STKOFEN) calls. */
long hits; /* Number of internal buffer hits. */
long extends; /* Number of block extensions. */
long stko_mallocs; /* Block allocations by $STKOFEN. */
long underflows; /* Number of stack underflow calls ($STKRETN). */
long stko_free; /* Number of deallocations by $STKRETN. */
long stkm_free; /* Number of deallocations by $STKMRET. */
long segments; /* Current number of stack segments. */
long maxs; /* Maximum number of stack segments so far. */
long pad_size; /* Stack pad size. */
long current_address; /* Current stack segment address. */
long current_size; /* Current stack segment size. This
number is actually corrupted by STKSTAT to
include the fifteen word trailer area. */
long initial_address; /* Address of initial segment. */
long initial_size; /* Size of initial segment. */
};
/* The following structure describes the data structure which trails
@ -328,13 +328,13 @@ struct stk_stat
struct stk_trailer
{
long this_address; /* Address of this block. */
long this_size; /* Size of this block (does not include
this trailer). */
long this_address; /* Address of this block. */
long this_size; /* Size of this block (does not include
this trailer). */
long unknown2;
long unknown3;
long link; /* Address of trailer block of previous
segment. */
long link; /* Address of trailer block of previous
segment. */
long unknown5;
long unknown6;
long unknown7;
@ -372,8 +372,8 @@ i00afunc (long *address)
/* Set up the iteration. */
trailer = (struct stk_trailer *) (status.current_address
+ status.current_size
- 15);
+ status.current_size
- 15);
/* There must be at least one stack segment. Therefore it is
a fatal error if "trailer" is null. */
@ -388,10 +388,10 @@ i00afunc (long *address)
block = (long *) trailer->this_address;
size = trailer->this_size;
if (block == 0 || size == 0)
abort ();
abort ();
trailer = (struct stk_trailer *) trailer->link;
if ((block <= address) && (address < (block + size)))
break;
break;
}
/* Set the result to the offset in this segment and add the sizes
@ -407,7 +407,7 @@ i00afunc (long *address)
do
{
if (trailer->this_size <= 0)
abort ();
abort ();
result += trailer->this_size;
trailer = (struct stk_trailer *) trailer->link;
}
@ -470,7 +470,7 @@ i00afunc (long address)
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
#endif
if (pseg == 0)
break;
break;
stkl = stkl - pseg;
ssptr = (struct stack_segment_linkage *) stkl;
size = ssptr->sssize;

View File

@ -1,678 +0,0 @@
/* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises. All rights reserved. */
/*$Id: ansi2knr.c 1002 2003-10-04 10:34:10Z hniksic $*/
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
/*
ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY. No author or distributor accepts responsibility to anyone for the
consequences of using it or for whether it serves any particular purpose or
works at all, unless he says so in writing. Refer to the GNU General Public
License (the "GPL") for full details.
Everyone is granted permission to copy, modify and redistribute ansi2knr,
but only under the conditions described in the GPL. A copy of this license
is supposed to have been given to you along with ansi2knr so you can know
your rights and responsibilities. It should be in a file named COPYLEFT,
or, if there is no file named COPYLEFT, a file named COPYING. Among other
things, the copyright notice and this notice must be preserved on all
copies.
We explicitly state here what we believe is already implied by the GPL: if
the ansi2knr program is distributed as a separate set of sources and a
separate executable file which are aggregated on a storage medium together
with another program, this in itself does not bring the other program under
the GPL, nor does the mere fact that such a program or the procedures for
constructing it invoke the ansi2knr executable bring any other part of the
program under the GPL.
*/
/*
* Usage:
ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]
* --filename provides the file name for the #line directive in the output,
* overriding input_file (if present).
* If no input_file is supplied, input is read from stdin.
* If no output_file is supplied, output goes to stdout.
* There are no error messages.
*
* ansi2knr recognizes function definitions by seeing a non-keyword
* identifier at the left margin, followed by a left parenthesis,
* with a right parenthesis as the last character on the line,
* and with a left brace as the first token on the following line
* (ignoring possible intervening comments), except that a line
* consisting of only
* identifier1(identifier2)
* will not be considered a function definition unless identifier2 is
* the word "void", and a line consisting of
* identifier1(identifier2, <<arbitrary>>)
* will not be considered a function definition.
* ansi2knr will recognize a multi-line header provided
* that no intervening line ends with a left or right brace or a semicolon.
* These algorithms ignore whitespace and comments, except that
* the function name must be the first thing on the line.
* The following constructs will confuse it:
* - Any other construct that starts at the left margin and
* follows the above syntax (such as a macro or function call).
* - Some macros that tinker with the syntax of function headers.
*/
/*
* The original and principal author of ansi2knr is L. Peter Deutsch
* <ghost@aladdin.com>. Other authors are noted in the change history
* that follows (in reverse chronological order):
lpd 1999-04-12 added minor fixes from Pavel Roskin
<pavel_roskin@geocities.com> for clean compilation with
gcc -W -Wall
lpd 1999-03-22 added hack to recognize lines consisting of
identifier1(identifier2, xxx) as *not* being procedures
lpd 1999-02-03 made indentation of preprocessor commands consistent
lpd 1999-01-28 fixed two bugs: a '/' in an argument list caused an
endless loop; quoted strings within an argument list
confused the parser
lpd 1999-01-24 added a check for write errors on the output,
suggested by Jim Meyering <meyering@ascend.com>
lpd 1998-11-09 added further hack to recognize identifier(void)
as being a procedure
lpd 1998-10-23 added hack to recognize lines consisting of
identifier1(identifier2) as *not* being procedures
lpd 1997-12-08 made input_file optional; only closes input and/or
output file if not stdin or stdout respectively; prints
usage message on stderr rather than stdout; adds
--filename switch (changes suggested by
<ceder@lysator.liu.se>)
lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with
compilers that don't understand void, as suggested by
Tom Lane
lpd 1996-01-15 changed to require that the first non-comment token
on the line following a function header be a left brace,
to reduce sensitivity to macros, as suggested by Tom Lane
<tgl@sss.pgh.pa.us>
lpd 1995-06-22 removed #ifndefs whose sole purpose was to define
undefined preprocessor symbols as 0; changed all #ifdefs
for configuration symbols to #ifs
lpd 1995-04-05 changed copyright notice to make it clear that
including ansi2knr in a program does not bring the entire
program under the GPL
lpd 1994-12-18 added conditionals for systems where ctype macros
don't handle 8-bit characters properly, suggested by
Francois Pinard <pinard@iro.umontreal.ca>;
removed --varargs switch (this is now the default)
lpd 1994-10-10 removed CONFIG_BROKETS conditional
lpd 1994-07-16 added some conditionals to help GNU `configure',
suggested by Francois Pinard <pinard@iro.umontreal.ca>;
properly erase prototype args in function parameters,
contributed by Jim Avera <jima@netcom.com>;
correct error in writeblanks (it shouldn't erase EOLs)
lpd 1989-xx-xx original version
*/
/* Most of the conditionals here are to make ansi2knr work with */
/* or without the GNU configure machinery. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <ctype.h>
#if HAVE_CONFIG_H
/*
For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h).
This will define HAVE_CONFIG_H and so, activate the following lines.
*/
# if STDC_HEADERS || HAVE_STRING_H
# include <string.h>
# else
# include <strings.h>
# endif
#else /* not HAVE_CONFIG_H */
/* Otherwise do it the hard way */
# ifdef BSD
# include <strings.h>
# else
# ifdef VMS
extern int strlen(), strncmp();
# else
# include <string.h>
# endif
# endif
#endif /* not HAVE_CONFIG_H */
#if STDC_HEADERS
# include <stdlib.h>
#else
/*
malloc and free should be declared in stdlib.h,
but if you've got a K&R compiler, they probably aren't.
*/
# ifdef MSDOS
# include <malloc.h>
# else
# ifdef VMS
extern char *malloc();
extern void free();
# else
extern char *malloc();
extern int free();
# endif
# endif
#endif
/* Define NULL (for *very* old compilers). */
#ifndef NULL
# define NULL (0)
#endif
/*
* The ctype macros don't always handle 8-bit characters correctly.
* Compensate for this here.
*/
#ifdef isascii
# undef HAVE_ISASCII /* just in case */
# define HAVE_ISASCII 1
#else
#endif
#if STDC_HEADERS || !HAVE_ISASCII
# define is_ascii(c) 1
#else
# define is_ascii(c) isascii(c)
#endif
#define is_space(c) (is_ascii(c) && isspace(c))
#define is_alpha(c) (is_ascii(c) && isalpha(c))
#define is_alnum(c) (is_ascii(c) && isalnum(c))
/* Scanning macros */
#define isidchar(ch) (is_alnum(ch) || (ch) == '_')
#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
/* Forward references */
char *skipspace();
char *scanstring();
int writeblanks();
int test1();
int convert1();
/* The main program */
int
main(argc, argv)
int argc;
char *argv[];
{ FILE *in = stdin;
FILE *out = stdout;
char *filename = 0;
char *program_name = argv[0];
char *output_name = 0;
#define bufsize 5000 /* arbitrary size */
char *buf;
char *line;
char *more;
char *usage =
"Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n";
/*
* In previous versions, ansi2knr recognized a --varargs switch.
* If this switch was supplied, ansi2knr would attempt to convert
* a ... argument to va_alist and va_dcl; if this switch was not
* supplied, ansi2knr would simply drop any such arguments.
* Now, ansi2knr always does this conversion, and we only
* check for this switch for backward compatibility.
*/
int convert_varargs = 1;
int output_error;
while ( argc > 1 && argv[1][0] == '-' ) {
if ( !strcmp(argv[1], "--varargs") ) {
convert_varargs = 1;
argc--;
argv++;
continue;
}
if ( !strcmp(argv[1], "--filename") && argc > 2 ) {
filename = argv[2];
argc -= 2;
argv += 2;
continue;
}
fprintf(stderr, "%s: Unrecognized switch: %s\n", program_name,
argv[1]);
fprintf(stderr, usage);
exit(1);
}
switch ( argc )
{
default:
fprintf(stderr, usage);
exit(0);
case 3:
output_name = argv[2];
out = fopen(output_name, "w");
if ( out == NULL ) {
fprintf(stderr, "%s: Cannot open output file %s\n",
program_name, output_name);
exit(1);
}
/* falls through */
case 2:
in = fopen(argv[1], "r");
if ( in == NULL ) {
fprintf(stderr, "%s: Cannot open input file %s\n",
program_name, argv[1]);
exit(1);
}
if ( filename == 0 )
filename = argv[1];
/* falls through */
case 1:
break;
}
if ( filename )
fprintf(out, "#line 1 \"%s\"\n", filename);
buf = malloc(bufsize);
if ( buf == NULL )
{
fprintf(stderr, "Unable to allocate read buffer!\n");
exit(1);
}
line = buf;
while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
{
test: line += strlen(line);
switch ( test1(buf) )
{
case 2: /* a function header */
convert1(buf, out, 1, convert_varargs);
break;
case 1: /* a function */
/* Check for a { at the start of the next line. */
more = ++line;
f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
goto wl;
if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
goto wl;
switch ( *skipspace(more, 1) )
{
case '{':
/* Definitely a function header. */
convert1(buf, out, 0, convert_varargs);
fputs(more, out);
break;
case 0:
/* The next line was blank or a comment: */
/* keep scanning for a non-comment. */
line += strlen(line);
goto f;
default:
/* buf isn't a function header, but */
/* more might be. */
fputs(buf, out);
strcpy(buf, more);
line = buf;
goto test;
}
break;
case -1: /* maybe the start of a function */
if ( line != buf + (bufsize - 1) ) /* overflow check */
continue;
/* falls through */
default: /* not a function */
wl: fputs(buf, out);
break;
}
line = buf;
}
if ( line != buf )
fputs(buf, out);
free(buf);
if ( output_name ) {
output_error = ferror(out);
output_error |= fclose(out);
} else { /* out == stdout */
fflush(out);
output_error = ferror(out);
}
if ( output_error ) {
fprintf(stderr, "%s: error writing to %s\n", program_name,
(output_name ? output_name : "stdout"));
exit(1);
}
if ( in != stdin )
fclose(in);
return 0;
}
/* Skip over whitespace and comments, in either direction. */
char *
skipspace(p, dir)
register char *p;
register int dir; /* 1 for forward, -1 for backward */
{ for ( ; ; )
{ while ( is_space(*p) )
p += dir;
if ( !(*p == '/' && p[dir] == '*') )
break;
p += dir; p += dir;
while ( !(*p == '*' && p[dir] == '/') )
{ if ( *p == 0 )
return p; /* multi-line comment?? */
p += dir;
}
p += dir; p += dir;
}
return p;
}
/* Scan over a quoted string, in either direction. */
char *
scanstring(p, dir)
register char *p;
register int dir;
{
for (p += dir; ; p += dir)
if (*p == '"' && p[-dir] != '\\')
return p + dir;
}
/*
* Write blanks over part of a string.
* Don't overwrite end-of-line characters.
*/
int
writeblanks(start, end)
char *start;
char *end;
{ char *p;
for ( p = start; p < end; p++ )
if ( *p != '\r' && *p != '\n' )
*p = ' ';
return 0;
}
/*
* Test whether the string in buf is a function definition.
* The string may contain and/or end with a newline.
* Return as follows:
* 0 - definitely not a function definition;
* 1 - definitely a function definition;
* 2 - definitely a function prototype (NOT USED);
* -1 - may be the beginning of a function definition,
* append another line and look again.
* The reason we don't attempt to convert function prototypes is that
* Ghostscript's declaration-generating macros look too much like
* prototypes, and confuse the algorithms.
*/
int
test1(buf)
char *buf;
{ register char *p = buf;
char *bend;
char *endfn;
int contin;
if ( !isidfirstchar(*p) )
return 0; /* no name at left margin */
bend = skipspace(buf + strlen(buf) - 1, -1);
switch ( *bend )
{
case ';': contin = 0 /*2*/; break;
case ')': contin = 1; break;
case '{': return 0; /* not a function */
case '}': return 0; /* not a function */
default: contin = -1;
}
while ( isidchar(*p) )
p++;
endfn = p;
p = skipspace(p, 1);
if ( *p++ != '(' )
return 0; /* not a function */
p = skipspace(p, 1);
if ( *p == ')' )
return 0; /* no parameters */
/* Check that the apparent function name isn't a keyword. */
/* We only need to check for keywords that could be followed */
/* by a left parenthesis (which, unfortunately, is most of them). */
{ static char *words[] =
{ "asm", "auto", "case", "char", "const", "double",
"extern", "float", "for", "if", "int", "long",
"register", "return", "short", "signed", "sizeof",
"static", "switch", "typedef", "unsigned",
"void", "volatile", "while", 0
};
char **key = words;
char *kp;
unsigned len = endfn - buf;
while ( (kp = *key) != 0 )
{ if ( strlen(kp) == len && !strncmp(kp, buf, len) )
return 0; /* name is a keyword */
key++;
}
}
{
char *id = p;
int len;
/*
* Check for identifier1(identifier2) and not
* identifier1(void), or identifier1(identifier2, xxxx).
*/
while ( isidchar(*p) )
p++;
len = p - id;
p = skipspace(p, 1);
if (*p == ',' ||
(*p == ')' && (len != 4 || strncmp(id, "void", 4)))
)
return 0; /* not a function */
}
/*
* If the last significant character was a ), we need to count
* parentheses, because it might be part of a formal parameter
* that is a procedure.
*/
if (contin > 0) {
int level = 0;
for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1))
level += (*p == '(' ? 1 : *p == ')' ? -1 : 0);
if (level > 0)
contin = -1;
}
return contin;
}
/* Convert a recognized function definition or header to K&R syntax. */
int
convert1(buf, out, header, convert_varargs)
char *buf;
FILE *out;
int header; /* Boolean */
int convert_varargs; /* Boolean */
{ char *endfn;
register char *p;
/*
* The breaks table contains pointers to the beginning and end
* of each argument.
*/
char **breaks;
unsigned num_breaks = 2; /* for testing */
char **btop;
char **bp;
char **ap;
char *vararg = 0;
/* Pre-ANSI implementations don't agree on whether strchr */
/* is called strchr or index, so we open-code it here. */
for ( endfn = buf; *(endfn++) != '('; )
;
top: p = endfn;
breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
if ( breaks == NULL )
{ /* Couldn't allocate break table, give up */
fprintf(stderr, "Unable to allocate break table!\n");
fputs(buf, out);
return -1;
}
btop = breaks + num_breaks * 2 - 2;
bp = breaks;
/* Parse the argument list */
do
{ int level = 0;
char *lp = NULL;
char *rp = NULL;
char *end = NULL;
if ( bp >= btop )
{ /* Filled up break table. */
/* Allocate a bigger one and start over. */
free((char *)breaks);
num_breaks <<= 1;
goto top;
}
*bp++ = p;
/* Find the end of the argument */
for ( ; end == NULL; p++ )
{ switch(*p)
{
case ',':
if ( !level ) end = p;
break;
case '(':
if ( !level ) lp = p;
level++;
break;
case ')':
if ( --level < 0 ) end = p;
else rp = p;
break;
case '/':
if (p[1] == '*')
p = skipspace(p, 1) - 1;
break;
case '"':
p = scanstring(p, 1) - 1;
break;
default:
;
}
}
/* Erase any embedded prototype parameters. */
if ( lp && rp )
writeblanks(lp + 1, rp);
p--; /* back up over terminator */
/* Find the name being declared. */
/* This is complicated because of procedure and */
/* array modifiers. */
for ( ; ; )
{ p = skipspace(p - 1, -1);
switch ( *p )
{
case ']': /* skip array dimension(s) */
case ')': /* skip procedure args OR name */
{ int level = 1;
while ( level )
switch ( *--p )
{
case ']': case ')':
level++;
break;
case '[': case '(':
level--;
break;
case '/':
if (p > buf && p[-1] == '*')
p = skipspace(p, -1) + 1;
break;
case '"':
p = scanstring(p, -1) + 1;
break;
default: ;
}
}
if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
{ /* We found the name being declared */
while ( !isidfirstchar(*p) )
p = skipspace(p, 1) + 1;
goto found;
}
break;
default:
goto found;
}
}
found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
{ if ( convert_varargs )
{ *bp++ = "va_alist";
vararg = p-2;
}
else
{ p++;
if ( bp == breaks + 1 ) /* sole argument */
writeblanks(breaks[0], p);
else
writeblanks(bp[-1] - 1, p);
bp--;
}
}
else
{ while ( isidchar(*p) ) p--;
*bp++ = p+1;
}
p = end;
}
while ( *p++ == ',' );
*bp = p;
/* Make a special check for 'void' arglist */
if ( bp == breaks+2 )
{ p = skipspace(breaks[0], 1);
if ( !strncmp(p, "void", 4) )
{ p = skipspace(p+4, 1);
if ( p == breaks[2] - 1 )
{ bp = breaks; /* yup, pretend arglist is empty */
writeblanks(breaks[0], p + 1);
}
}
}
/* Put out the function name and left parenthesis. */
p = buf;
while ( p != endfn ) putc(*p, out), p++;
/* Put out the declaration. */
if ( header )
{ fputs(");", out);
for ( p = breaks[0]; *p; p++ )
if ( *p == '\r' || *p == '\n' )
putc(*p, out);
}
else
{ for ( ap = breaks+1; ap < bp; ap += 2 )
{ p = *ap;
while ( isidchar(*p) )
putc(*p, out), p++;
if ( ap < bp - 1 )
fputs(", ", out);
}
fputs(") ", out);
/* Put out the argument declarations */
for ( ap = breaks+2; ap <= bp; ap += 2 )
(*ap)[-1] = ';';
if ( vararg != 0 )
{ *vararg = 0;
fputs(breaks[0], out); /* any prior args */
fputs("va_dcl", out); /* the final arg */
fputs(bp[0], out);
}
else
fputs(breaks[0], out);
}
free((char *)breaks);
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,12 @@
/* Some autoconf-unrelated preprocessor magic that needs to be done
before including the system includes and therefore cannot belong in
sysdep.h. This file is included at the bottom of config.h. */
*before* including the system includes and therefore cannot belong
in sysdep.h.
/* Alloca-related defines, straight out of the Autoconf manual. */
Everything else related to system tweaking belongs to sysdep.h.
/* AIX requires this to be the first thing in the file. */
#ifndef __GNUC__
# if HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
#pragma alloca
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
void *alloca ();
# endif
# endif
# endif
#endif
This file is included at the bottom of config.h. */
/* Testing for __sun is not enough because it's also defined on SunOS. */
#ifdef __sun
# ifdef __SVR4
# define solaris
@ -59,17 +47,33 @@ void *alloca ();
#define _SVID_SOURCE
#define _BSD_SOURCE
/* Under glibc-based systems we want all GNU extensions as well. This
declares some unnecessary cruft, but also useful functions such as
timegm, FNM_CASEFOLD extension to fnmatch, memrchr, etc. */
#define _GNU_SOURCE
#endif /* NAMESPACE_TWEAKS */
/* Determine whether to use stdarg. Use it only if the compiler
supports ANSI C and stdarg.h is present. We check for both because
there are configurations where stdarg.h exists, but doesn't work.
This check cannot be in sysdep.h because we use it to choose which
system headers to include. */
#ifndef WGET_USE_STDARG
# ifdef __STDC__
# ifdef HAVE_STDARG_H
# define WGET_USE_STDARG
# endif
/* Alloca declaration, based on recommendation in the Autoconf manual.
These have to be after the above namespace tweaks, but before any
non-preprocessor code. */
#if HAVE_ALLOCA_H
# include <alloca.h>
#elif defined WINDOWS
# include <malloc.h>
# ifndef alloca
# define alloca _alloca
# endif
#endif /* not WGET_USE_STDARG */
#elif defined __GNUC__
# define alloca __builtin_alloca
#elif defined _AIX
# define alloca __alloca
#else
# include <stddef.h>
# ifdef __cplusplus
extern "C"
# endif
void *alloca (size_t);
#endif

View File

@ -1,4 +1,4 @@
/* src/config.h. Generated by configure. */
/* src/config.h. Generated from config.h.in by configure. */
/* src/config.h.in. Generated from configure.in by autoheader. */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
@ -24,9 +24,6 @@
/* Define if you want the Opie support for FTP compiled in. */
#define ENABLE_OPIE 1
/* Define to 1 if you have the `access' function. */
#define HAVE_ACCESS 1
/* Define to 1 if you have `alloca', as a function or macro. */
#define HAVE_ALLOCA 1
@ -34,35 +31,44 @@
*/
#define HAVE_ALLOCA_H 1
/* Define to use built-in MD5. */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define when using built-in MD5. */
#define HAVE_BUILTIN_MD5 1
/* Define to 1 if you have the `clock_gettime' function. */
/* #undef HAVE_CLOCK_GETTIME */
/* Define to 1 if you have the `drand48' function. */
#define HAVE_DRAND48 1
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#define HAVE_FSEEKO 1
/* #undef HAVE_FSEEKO */
/* Define to 1 if you have the `ftello' function. */
#define HAVE_FTELLO 1
/* Define to 1 if you have the `getaddrinfo' function. */
#define HAVE_GETADDRINFO 1
/* #undef HAVE_GETADDRINFO */
/* Define to 1 if you have the `gethostbyname' function. */
#define HAVE_GETHOSTBYNAME 1
/* #undef HAVE_GETHOSTBYNAME */
/* Define to 1 if you have the `getpagesize' function. */
/* #undef HAVE_GETPAGESIZE */
#define HAVE_GETPAGESIZE 1
/* Define to 1 if you have the `gettext' function. */
/* #undef HAVE_GETTEXT */
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the `inet_ntoa' function. */
#define HAVE_INET_NTOA 1
/* #undef HAVE_INET_NTOA */
/* Define to 1 if the system has the type `int64_t'. */
#define HAVE_INT64_T 1
/* Define to 1 if the system has the type `intptr_t'. */
#define HAVE_INTPTR_T 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
@ -70,12 +76,21 @@
/* Define to 1 if you have the `isatty' function. */
#define HAVE_ISATTY 1
/* Define to 1 if you have the `bind' library (-lbind). */
#define HAVE_LIBBIND 1
/* Define to 1 if you have the `dl' library (-ldl). */
/* #undef HAVE_LIBDL */
/* Define if you have the gnutls library. */
/* #undef HAVE_LIBGNUTLS */
/* Define to 1 if you have the <libintl.h> header file. */
/* #undef HAVE_LIBINTL_H */
/* Define to 1 if you have the `network' library (-lnetwork). */
/* #undef HAVE_LIBNETWORK */
/* Define to 1 if you have the `nsl' library (-lnsl). */
/* #undef HAVE_LIBNSL */
@ -88,54 +103,36 @@
/* Define if you have the ssl library. */
/* #undef HAVE_LIBSSL */
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the <locale.h> header file. */
/* #undef HAVE_LOCALE_H */
/* Define to 1 if you have the `mbtowc' function. */
#define HAVE_MBTOWC 1
/* Define if we're compiling support for MD5. */
#define HAVE_MD5 1
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mktime' function. */
#define HAVE_MKTIME 1
/* Define to 1 if you have the `memrchr' function. */
/* #undef HAVE_MEMRCHR */
/* Define to 1 if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */
/* Define if you have the nanosleep function. */
/* #undef HAVE_NANOSLEEP */
#define HAVE_NANOSLEEP 1
/* Define this if you want the NLS support. */
/* #undef HAVE_NLS */
/* Define to use OpenSSL MD5. */
/* Define when using OpenSSL MD5. */
/* #undef HAVE_OPENSSL_MD5 */
/* Define to 1 if you have the <pwd.h> header file. */
#define HAVE_PWD_H 1
/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1
/* Define to 1 if you have the <setjmp.h> header file. */
#define HAVE_SETJMP_H 1
/* Define to 1 if you have the `sigblock' function. */
/* #undef HAVE_SIGBLOCK */
/* Define to 1 if you have the `signal' function. */
#define HAVE_SIGNAL 1
/* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1
/* Define to 1 if you have the `sigsetjmp' function. */
#define HAVE_SIGSETJMP 1
@ -148,14 +145,11 @@
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
/* #undef HAVE_SOCKADDR_IN6_SCOPE_ID */
/* Define to use Solaris MD5. */
/* Define when using Solaris MD5. */
/* #undef HAVE_SOLARIS_MD5 */
/* Define if SSL support is being compiled in. */
/* #undef HAVE_SSL */
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define to 1 if stdbool.h conforms to C99. */
#define HAVE_STDBOOL_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
@ -169,9 +163,6 @@
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
@ -181,17 +172,8 @@
/* Define to 1 if you have the `strncasecmp' function. */
#define HAVE_STRNCASECMP 1
/* Define to 1 if you have the `strpbrk' function. */
#define HAVE_STRPBRK 1
/* Define to 1 if you have the `strptime' function. */
#define HAVE_STRPTIME 1
/* Define to 1 if you have the `strstr' function. */
#define HAVE_STRSTR 1
/* Define to 1 if you have the `strtoimax' function. */
#define HAVE_STRTOIMAX 1
/* #undef HAVE_STRPTIME */
/* Define to 1 if you have the `strtoll' function. */
#define HAVE_STRTOLL 1
@ -200,7 +182,7 @@
/* #undef HAVE_STRUCT_SOCKADDR_IN6 */
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
/* #undef HAVE_STRUCT_SOCKADDR_STORAGE */
/* Define to 1 if the system has the type `struct utimbuf'. */
#define HAVE_STRUCT_UTIMBUF 1
@ -235,6 +217,9 @@
/* Define to 1 if the system has the type `uint32_t'. */
#define HAVE_UINT32_T 1
/* Define to 1 if the system has the type `uintptr_t'. */
#define HAVE_UINTPTR_T 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
@ -244,12 +229,24 @@
/* Define to 1 if you have the <utime.h> header file. */
#define HAVE_UTIME_H 1
/* Define to 1 if you have the `vasprintf' function. */
#define HAVE_VASPRINTF 1
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
/* Define to 1 if you have the <wchar.h> header file. */
#define HAVE_WCHAR_H 1
/* Define to 1 if you have the `wcwidth' function. */
/* #undef HAVE_WCWIDTH */
/* Define if fnmatch.h can be included. */
#define HAVE_WORKING_FNMATCH_H 1
/* Define to 1 if the system has the type `_Bool'. */
/* #undef HAVE__BOOL */
/* Define to be the name of the operating system. */
#define OS_TYPE "beos"
@ -268,30 +265,27 @@
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* Define to 1 if the C compiler supports function prototypes. */
#define PROTOTYPES 1
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* The size of a `int', as computed by sizeof. */
/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of a `long', as computed by sizeof. */
/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 4
/* The size of a `long long', as computed by sizeof. */
/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8
/* The size of a `off_t', as computed by sizeof. */
/* The size of `off_t', as computed by sizeof. */
#define SIZEOF_OFF_T 8
/* The size of a `short', as computed by sizeof. */
/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
/* The size of `void *', as computed by sizeof. */
#define SIZEOF_VOID_P 4
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
automatically deduced at runtime.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
@ -300,9 +294,6 @@
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
@ -323,9 +314,6 @@
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Define like PROTOTYPES; this can be used by system headers. */
#define __PROTOTYPES 1
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
@ -338,11 +326,13 @@
/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */
/* Define to `unsigned' if <sys/types.h> does not define. */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to int or size_t on systems without socklen_t. */
/* #undef socklen_t int */
#ifndef __HAIKU__
#define socklen_t int
#endif
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */

View File

@ -23,9 +23,6 @@
/* Define if you want the Opie support for FTP compiled in. */
#undef ENABLE_OPIE
/* Define to 1 if you have the `access' function. */
#undef HAVE_ACCESS
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
@ -33,12 +30,15 @@
*/
#undef HAVE_ALLOCA_H
/* Define to use built-in MD5. */
/* Define when using built-in MD5. */
#undef HAVE_BUILTIN_MD5
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
/* Define to 1 if you have the `drand48' function. */
#undef HAVE_DRAND48
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
@ -57,12 +57,15 @@
/* Define to 1 if you have the `gettext' function. */
#undef HAVE_GETTEXT
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the `inet_ntoa' function. */
#undef HAVE_INET_NTOA
/* Define to 1 if the system has the type `int64_t'. */
#undef HAVE_INT64_T
/* Define to 1 if the system has the type `intptr_t'. */
#undef HAVE_INTPTR_T
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@ -72,6 +75,9 @@
/* Define to 1 if you have the `dl' library (-ldl). */
#undef HAVE_LIBDL
/* Define if you have the gnutls library. */
#undef HAVE_LIBGNUTLS
/* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
@ -87,23 +93,17 @@
/* Define if you have the ssl library. */
#undef HAVE_LIBSSL
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define to 1 if you have the `mbtowc' function. */
#undef HAVE_MBTOWC
/* Define if we're compiling support for MD5. */
#undef HAVE_MD5
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mktime' function. */
#undef HAVE_MKTIME
/* Define to 1 if you have the `memrchr' function. */
#undef HAVE_MEMRCHR
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
@ -114,27 +114,15 @@
/* Define this if you want the NLS support. */
#undef HAVE_NLS
/* Define to use OpenSSL MD5. */
/* Define when using OpenSSL MD5. */
#undef HAVE_OPENSSL_MD5
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
/* Define to 1 if you have the <setjmp.h> header file. */
#undef HAVE_SETJMP_H
/* Define to 1 if you have the `sigblock' function. */
#undef HAVE_SIGBLOCK
/* Define to 1 if you have the `signal' function. */
#undef HAVE_SIGNAL
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if you have the `sigsetjmp' function. */
#undef HAVE_SIGSETJMP
@ -147,14 +135,11 @@
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
#undef HAVE_SOCKADDR_IN6_SCOPE_ID
/* Define to use Solaris MD5. */
/* Define when using Solaris MD5. */
#undef HAVE_SOLARIS_MD5
/* Define if SSL support is being compiled in. */
#undef HAVE_SSL
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
/* Define to 1 if stdbool.h conforms to C99. */
#undef HAVE_STDBOOL_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@ -168,9 +153,6 @@
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
@ -180,18 +162,9 @@
/* Define to 1 if you have the `strncasecmp' function. */
#undef HAVE_STRNCASECMP
/* Define to 1 if you have the `strpbrk' function. */
#undef HAVE_STRPBRK
/* Define to 1 if you have the `strptime' function. */
#undef HAVE_STRPTIME
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define to 1 if you have the `strtoimax' function. */
#undef HAVE_STRTOIMAX
/* Define to 1 if you have the `strtoll' function. */
#undef HAVE_STRTOLL
@ -234,6 +207,9 @@
/* Define to 1 if the system has the type `uint32_t'. */
#undef HAVE_UINT32_T
/* Define to 1 if the system has the type `uintptr_t'. */
#undef HAVE_UINTPTR_T
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@ -243,12 +219,24 @@
/* Define to 1 if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
/* Define to 1 if you have the `vasprintf' function. */
#undef HAVE_VASPRINTF
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
/* Define to 1 if you have the `wcwidth' function. */
#undef HAVE_WCWIDTH
/* Define if fnmatch.h can be included. */
#undef HAVE_WORKING_FNMATCH_H
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
/* Define to be the name of the operating system. */
#undef OS_TYPE
@ -267,30 +255,27 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if the C compiler supports function prototypes. */
#undef PROTOTYPES
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* The size of a `int', as computed by sizeof. */
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of a `long', as computed by sizeof. */
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of a `long long', as computed by sizeof. */
/* The size of `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG
/* The size of a `off_t', as computed by sizeof. */
/* The size of `off_t', as computed by sizeof. */
#undef SIZEOF_OFF_T
/* The size of a `short', as computed by sizeof. */
/* The size of `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* The size of `void *', as computed by sizeof. */
#undef SIZEOF_VOID_P
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
automatically deduced at runtime.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
@ -299,9 +284,6 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
@ -322,9 +304,6 @@
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
/* Define like PROTOTYPES; this can be used by system headers. */
#undef __PROTOTYPES
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
@ -337,7 +316,7 @@
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned' if <sys/types.h> does not define. */
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define to int or size_t on systems without socklen_t. */

View File

@ -1,11 +1,12 @@
/* Establishing and handling network connections.
Copyright (C) 1995, 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GNU Wget.
GNU Wget 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 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
GNU Wget is distributed in the hope that it will be useful,
@ -14,24 +15,23 @@ 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 Wget; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with Wget. If not, see <http://www.gnu.org/licenses/>.
In addition, as a special exception, the Free Software Foundation
gives permission to link the code of its release of Wget with the
OpenSSL project's "OpenSSL" library (or with modified versions of it
that use the same license as the "OpenSSL" library), and distribute
the linked executables. You must obey the GNU General Public License
in all respects for all of the code used other than "OpenSSL". If you
modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
Additional permission under GNU GPL version 3 section 7
If you modify this program, or any covered work, by linking or
combining it with the OpenSSL project's OpenSSL library (or a
modified version of that library), containing parts covered by the
terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
grants you additional permission to convey the resulting work.
Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
@ -47,14 +47,13 @@ so, delete this exception statement from your version. */
#endif /* not WINDOWS */
#include <errno.h>
#ifdef HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif /* HAVE_STRING_H */
#include <string.h>
#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif /* HAVE_SYS_SELECT_H */
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include "wget.h"
#include "utils.h"
@ -62,10 +61,6 @@ so, delete this exception statement from your version. */
#include "connect.h"
#include "hash.h"
#ifndef errno
extern int errno;
#endif
/* Define sockaddr_storage where unavailable (presumably on IPv4-only
hosts). */
@ -82,29 +77,29 @@ extern int errno;
static void
sockaddr_set_data (struct sockaddr *sa, const ip_address *ip, int port)
{
switch (ip->type)
switch (ip->family)
{
case IPV4_ADDRESS:
case AF_INET:
{
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
xzero (*sin);
sin->sin_family = AF_INET;
sin->sin_port = htons (port);
sin->sin_addr = ADDRESS_IPV4_IN_ADDR (ip);
break;
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
xzero (*sin);
sin->sin_family = AF_INET;
sin->sin_port = htons (port);
sin->sin_addr = ip->data.d4;
break;
}
#ifdef ENABLE_IPV6
case IPV6_ADDRESS:
case AF_INET6:
{
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
xzero (*sin6);
sin6->sin6_family = AF_INET6;
sin6->sin6_port = htons (port);
sin6->sin6_addr = ADDRESS_IPV6_IN6_ADDR (ip);
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
xzero (*sin6);
sin6->sin6_family = AF_INET6;
sin6->sin6_port = htons (port);
sin6->sin6_addr = ip->data.d6;
#ifdef HAVE_SOCKADDR_IN6_SCOPE_ID
sin6->sin6_scope_id = ADDRESS_IPV6_SCOPE (ip);
sin6->sin6_scope_id = ip->ipv6_scope;
#endif
break;
break;
}
#endif /* ENABLE_IPV6 */
default:
@ -123,31 +118,31 @@ sockaddr_get_data (const struct sockaddr *sa, ip_address *ip, int *port)
{
case AF_INET:
{
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
if (ip)
{
ip->type = IPV4_ADDRESS;
ADDRESS_IPV4_IN_ADDR (ip) = sin->sin_addr;
}
if (port)
*port = ntohs (sin->sin_port);
break;
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
if (ip)
{
ip->family = AF_INET;
ip->data.d4 = sin->sin_addr;
}
if (port)
*port = ntohs (sin->sin_port);
break;
}
#ifdef ENABLE_IPV6
case AF_INET6:
{
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
if (ip)
{
ip->type = IPV6_ADDRESS;
ADDRESS_IPV6_IN6_ADDR (ip) = sin6->sin6_addr;
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
if (ip)
{
ip->family = AF_INET6;
ip->data.d6 = sin6->sin6_addr;
#ifdef HAVE_SOCKADDR_IN6_SCOPE_ID
ADDRESS_IPV6_SCOPE (ip) = sin6->sin6_scope_id;
ip->ipv6_scope = sin6->sin6_scope_id;
#endif
}
if (port)
*port = ntohs (sin6->sin6_port);
break;
}
if (port)
*port = ntohs (sin6->sin6_port);
break;
}
#endif
default:
@ -174,32 +169,38 @@ sockaddr_size (const struct sockaddr *sa)
}
}
static int
/* Resolve the bind address specified via --bind-address and store it
to SA. The resolved value is stored in a static variable and
reused after the first invocation of this function.
Returns true on success, false on failure. */
static bool
resolve_bind_address (struct sockaddr *sa)
{
struct address_list *al;
/* Make sure this is called only once. opt.bind_address doesn't
change during a Wget run. */
static int called, should_bind;
static bool called, should_bind;
static ip_address ip;
if (called)
{
if (should_bind)
sockaddr_set_data (sa, &ip, 0);
sockaddr_set_data (sa, &ip, 0);
return should_bind;
}
called = 1;
called = true;
al = lookup_host (opt.bind_address, LH_BIND | LH_SILENT);
if (!al)
{
/* #### We should be able to print the error message here. */
logprintf (LOG_NOTQUIET,
_("%s: unable to resolve bind address `%s'; disabling bind.\n"),
exec_name, opt.bind_address);
should_bind = 0;
return 0;
_("%s: unable to resolve bind address `%s'; disabling bind.\n"),
exec_name, opt.bind_address);
should_bind = false;
return false;
}
/* Pick the first address in the list and use it as bind address.
@ -209,8 +210,8 @@ resolve_bind_address (struct sockaddr *sa)
address_list_release (al);
sockaddr_set_data (sa, &ip, 0);
should_bind = 1;
return 1;
should_bind = true;
return true;
}
struct cwt_context {
@ -233,7 +234,7 @@ connect_with_timeout_callback (void *arg)
static int
connect_with_timeout (int fd, const struct sockaddr *addr, socklen_t addrlen,
double timeout)
double timeout)
{
struct cwt_context ctx;
ctx.fd = fd;
@ -266,12 +267,12 @@ connect_to_ip (const ip_address *ip, int port, const char *print)
PRINT being the host name we're connecting to. */
if (print)
{
const char *txt_addr = pretty_print_address (ip);
const char *txt_addr = print_address (ip);
if (print && 0 != strcmp (print, txt_addr))
logprintf (LOG_VERBOSE, _("Connecting to %s|%s|:%d... "),
escnonprint (print), txt_addr, port);
logprintf (LOG_VERBOSE, _("Connecting to %s|%s|:%d... "),
escnonprint (print), txt_addr, port);
else
logprintf (LOG_VERBOSE, _("Connecting to %s:%d... "), txt_addr, port);
logprintf (LOG_VERBOSE, _("Connecting to %s:%d... "), txt_addr, port);
}
/* Store the sockaddr info to SA. */
@ -287,10 +288,9 @@ connect_to_ip (const ip_address *ip, int port, const char *print)
int on = 1;
/* In case of error, we will go on anyway... */
int err = setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof (on));
#ifdef ENABLE_DEBUG
if (err < 0)
DEBUGP (("Failed setting IPV6_V6ONLY: %s", strerror (errno)));
#endif
IF_DEBUG
if (err < 0)
DEBUGP (("Failed setting IPV6_V6ONLY: %s", strerror (errno)));
}
#endif
@ -302,31 +302,31 @@ connect_to_ip (const ip_address *ip, int port, const char *print)
{
int bufsize = opt.limit_rate;
if (bufsize < 512)
bufsize = 512; /* avoid pathologically small values */
bufsize = 512; /* avoid pathologically small values */
#ifdef SO_RCVBUF
setsockopt (sock, SOL_SOCKET, SO_RCVBUF,
(void *)&bufsize, (socklen_t)sizeof (bufsize));
(void *)&bufsize, (socklen_t)sizeof (bufsize));
#endif
/* When we add limit_rate support for writing, which is useful
for POST, we should also set SO_SNDBUF here. */
for POST, we should also set SO_SNDBUF here. */
}
if (opt.bind_address)
{
/* Bind the client side of the socket to the requested
address. */
address. */
struct sockaddr_storage bind_ss;
struct sockaddr *bind_sa = (struct sockaddr *)&bind_ss;
if (resolve_bind_address (bind_sa))
{
{
if (bind (sock, bind_sa, sockaddr_size (bind_sa)) < 0)
goto err;
}
goto err;
}
}
/* Connect the socket to the remote endpoint. */
if (connect_with_timeout (sock, sa, sockaddr_size (sa),
opt.connect_timeout) < 0)
opt.connect_timeout) < 0)
goto err;
/* Success. */
@ -366,7 +366,12 @@ connect_to_host (const char *host, int port)
retry:
if (!al)
return E_HOST;
{
logprintf (LOG_NOTQUIET,
_("%s: unable to resolve host address `%s'\n"),
exec_name, host);
return E_HOST;
}
address_list_get_bounds (al, &start, &end);
for (i = start; i < end; i++)
@ -374,15 +379,15 @@ connect_to_host (const char *host, int port)
const ip_address *ip = address_list_address_at (al, i);
sock = connect_to_ip (ip, port, host);
if (sock >= 0)
{
/* Success. */
address_list_set_connected (al);
address_list_release (al);
return sock;
}
{
/* Success. */
address_list_set_connected (al);
address_list_release (al);
return sock;
}
/* The attempt to connect has failed. Continue with the loop
and try next address. */
and try next address. */
address_list_set_faulty (al, i);
}
@ -392,7 +397,7 @@ connect_to_host (const char *host, int port)
if (address_list_connected_p (al))
{
/* We connected to AL before, but cannot do so now. That might
indicate that our DNS cache entry for HOST has expired. */
indicate that our DNS cache entry for HOST has expired. */
address_list_release (al);
al = lookup_host (host, LH_REFRESH);
goto retry;
@ -419,7 +424,6 @@ int
bind_local (const ip_address *bind_address, int *port)
{
int sock;
int family = AF_INET;
struct sockaddr_storage ss;
struct sockaddr *sa = (struct sockaddr *)&ss;
@ -428,12 +432,7 @@ bind_local (const ip_address *bind_address, int *port)
void *setopt_ptr = (void *)&setopt_val;
socklen_t setopt_size = sizeof (setopt_val);
#ifdef ENABLE_IPV6
if (bind_address->type == IPV6_ADDRESS)
family = AF_INET6;
#endif
sock = socket (family, SOCK_STREAM, 0);
sock = socket (bind_address->family, SOCK_STREAM, 0);
if (sock < 0)
return -1;
@ -455,17 +454,17 @@ bind_local (const ip_address *bind_address, int *port)
{
socklen_t addrlen = sockaddr_size (sa);
if (getsockname (sock, sa, &addrlen) < 0)
{
/* If we can't find out the socket's local address ("name"),
something is seriously wrong with the socket, and it's
unusable for us anyway because we must know the chosen
port. */
fd_close (sock);
return -1;
}
{
/* If we can't find out the socket's local address ("name"),
something is seriously wrong with the socket, and it's
unusable for us anyway because we must know the chosen
port. */
fd_close (sock);
return -1;
}
sockaddr_get_data (sa, NULL, port);
DEBUGP (("binding to address %s using port %i.\n",
pretty_print_address (bind_address), *port));
DEBUGP (("binding to address %s using port %i.\n",
print_address (bind_address), *port));
}
if (listen (sock, 1) < 0)
{
@ -500,9 +499,9 @@ accept_connection (int local_sock)
{
int test = select_fd (local_sock, opt.connect_timeout, WAIT_FOR_READ);
if (test == 0)
errno = ETIMEDOUT;
errno = ETIMEDOUT;
if (test <= 0)
return -1;
return -1;
}
sock = accept (local_sock, sa, &addrlen);
DEBUGP (("Accepted client at socket %d.\n", sock));
@ -510,13 +509,13 @@ accept_connection (int local_sock)
}
/* Get the IP address associated with the connection on FD and store
it to IP. Return 1 on success, 0 otherwise.
it to IP. Return true on success, false otherwise.
If ENDPOINT is ENDPOINT_LOCAL, it returns the address of the local
(client) side of the socket. Else if ENDPOINT is ENDPOINT_PEER, it
returns the address of the remote (peer's) side of the socket. */
int
bool
socket_ip_address (int sock, ip_address *ip, int endpoint)
{
struct sockaddr_storage storage;
@ -531,55 +530,54 @@ socket_ip_address (int sock, ip_address *ip, int endpoint)
else
abort ();
if (ret < 0)
return 0;
return false;
ip->family = sockaddr->sa_family;
switch (sockaddr->sa_family)
{
#ifdef ENABLE_IPV6
case AF_INET6:
{
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)&storage;
ip->type = IPV6_ADDRESS;
ADDRESS_IPV6_IN6_ADDR (ip) = sa6->sin6_addr;
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)&storage;
ip->data.d6 = sa6->sin6_addr;
#ifdef HAVE_SOCKADDR_IN6_SCOPE_ID
ADDRESS_IPV6_SCOPE (ip) = sa6->sin6_scope_id;
ip->ipv6_scope = sa6->sin6_scope_id;
#endif
DEBUGP (("conaddr is: %s\n", pretty_print_address (ip)));
return 1;
DEBUGP (("conaddr is: %s\n", print_address (ip)));
return true;
}
#endif
case AF_INET:
{
struct sockaddr_in *sa = (struct sockaddr_in *)&storage;
ip->type = IPV4_ADDRESS;
ADDRESS_IPV4_IN_ADDR (ip) = sa->sin_addr;
DEBUGP (("conaddr is: %s\n", pretty_print_address (ip)));
return 1;
struct sockaddr_in *sa = (struct sockaddr_in *)&storage;
ip->data.d4 = sa->sin_addr;
DEBUGP (("conaddr is: %s\n", print_address (ip)));
return true;
}
default:
abort ();
}
}
/* Return non-zero if the error from the connect code can be
considered retryable. Wget normally retries after errors, but the
exception are the "unsupported protocol" type errors (possible on
IPv4/IPv6 dual family systems) and "connection refused". */
/* Return true if the error from the connect code can be considered
retryable. Wget normally retries after errors, but the exception
are the "unsupported protocol" type errors (possible on IPv4/IPv6
dual family systems) and "connection refused". */
int
bool
retryable_socket_connect_error (int err)
{
/* Have to guard against some of these values not being defined.
Cannot use a switch statement because some of the values might be
equal. */
if (0
if (false
#ifdef EAFNOSUPPORT
|| err == EAFNOSUPPORT
#endif
#ifdef EPFNOSUPPORT
|| err == EPFNOSUPPORT
#endif
#ifdef ESOCKTNOSUPPORT /* no, "sockt" is not a typo! */
#ifdef ESOCKTNOSUPPORT /* no, "sockt" is not a typo! */
|| err == ESOCKTNOSUPPORT
#endif
#ifdef EPROTONOSUPPORT
@ -589,23 +587,23 @@ retryable_socket_connect_error (int err)
|| err == ENOPROTOOPT
#endif
/* Apparently, older versions of Linux and BSD used EINVAL
instead of EAFNOSUPPORT and such. */
instead of EAFNOSUPPORT and such. */
|| err == EINVAL
)
return 0;
return false;
if (!opt.retry_connrefused)
if (err == ECONNREFUSED
#ifdef ENETUNREACH
|| err == ENETUNREACH /* network is unreachable */
|| err == ENETUNREACH /* network is unreachable */
#endif
#ifdef EHOSTUNREACH
|| err == EHOSTUNREACH /* host is unreachable */
|| err == EHOSTUNREACH /* host is unreachable */
#endif
)
return 0;
)
return false;
return 1;
return true;
}
/* Wait for a single descriptor to become available, timing out after
@ -620,7 +618,6 @@ retryable_socket_connect_error (int err)
int
select_fd (int fd, double maxtime, int wait_for)
{
#ifdef HAVE_SELECT
fd_set fdset;
fd_set *rd = NULL, *wr = NULL;
struct timeval tmout;
@ -641,23 +638,22 @@ select_fd (int fd, double maxtime, int wait_for)
while (result < 0 && errno == EINTR);
return result;
#else /* not HAVE_SELECT */
/* If select() unavailable, just return 1. In most usages in Wget,
this is the appropriate response -- "if we can't poll, go ahead
with the blocking operation". If a specific part of code needs
different behavior, it can use #ifdef HAVE_SELECT to test whether
polling really occurs. */
return 1;
#endif /* not HAVE_SELECT */
}
int
/* Return true iff the connection to the remote site established
through SOCK is still open.
Specifically, this function returns true if SOCK is not ready for
reading. This is because, when the connection closes, the socket
is ready for reading because EOF is about to be delivered. A side
effect of this method is that sockets that have pending data are
considered non-open. This is actually a good thing for callers of
this function, where such pending data can only be unwanted
leftover from a previous request. */
bool
test_socket_open (int sock)
{
#ifdef HAVE_SELECT
fd_set check_set;
struct timeval to;
@ -671,23 +667,18 @@ test_socket_open (int sock)
to.tv_sec = 0;
to.tv_usec = 1;
/* If we get a timeout, then that means still connected */
if (select (sock + 1, &check_set, NULL, NULL, &to) == 0)
{
/* Connection is valid (not EOF), so continue */
return 1;
}
/* We got a timeout, it means we're still connected. */
return true;
else
return 0;
#else
/* Without select, it's hard to know for sure. */
return 1;
#endif
/* Read now would not wait, it means we have either pending data
or EOF/error. */
return false;
}
/* Basic socket operations, mostly EINTR wrappers. */
#ifdef WINDOWS
#if defined(WINDOWS) || defined(MSDOS)
# define read(fd, buf, cnt) recv (fd, buf, cnt, 0)
# define write(fd, buf, cnt) send (fd, buf, cnt, 0)
# define close(fd) closesocket (fd)
@ -753,14 +744,10 @@ sock_close (int fd)
or SSL_read or whatever is necessary. */
static struct hash_table *transport_map;
static int transport_map_modified_tick;
static unsigned int transport_map_modified_tick;
struct transport_info {
fd_reader_t reader;
fd_writer_t writer;
fd_poller_t poller;
fd_peeker_t peeker;
fd_closer_t closer;
struct transport_implementation *imp;
void *ctx;
};
@ -772,9 +759,7 @@ struct transport_info {
call getpeername, etc. */
void
fd_register_transport (int fd, fd_reader_t reader, fd_writer_t writer,
fd_poller_t poller, fd_peeker_t peeker,
fd_closer_t closer, void *ctx)
fd_register_transport (int fd, struct transport_implementation *imp, void *ctx)
{
struct transport_info *info;
@ -784,15 +769,11 @@ fd_register_transport (int fd, fd_reader_t reader, fd_writer_t writer,
assert (fd >= 0);
info = xnew (struct transport_info);
info->reader = reader;
info->writer = writer;
info->poller = poller;
info->peeker = peeker;
info->closer = closer;
info->imp = imp;
info->ctx = ctx;
if (!transport_map)
transport_map = hash_table_new (0, NULL, NULL);
hash_table_put (transport_map, (void *) fd, info);
hash_table_put (transport_map, (void *)(intptr_t) fd, info);
++transport_map_modified_tick;
}
@ -803,7 +784,7 @@ fd_register_transport (int fd, fd_reader_t reader, fd_writer_t writer,
void *
fd_transport_context (int fd)
{
struct transport_info *info = hash_table_get (transport_map, (void *) fd);
struct transport_info *info = hash_table_get (transport_map, (void *)(intptr_t) fd);
return info->ctx;
}
@ -816,23 +797,24 @@ fd_transport_context (int fd)
This is a macro because we want the static storage variables to be
per-function. */
#define LAZY_RETRIEVE_INFO(info) do { \
static struct transport_info *last_info; \
static int last_fd = -1, last_tick; \
if (!transport_map) \
info = NULL; \
else if (last_fd == fd && last_tick == transport_map_modified_tick) \
info = last_info; \
else \
{ \
info = hash_table_get (transport_map, (void *) fd); \
last_fd = fd; \
last_info = info; \
last_tick = transport_map_modified_tick; \
} \
#define LAZY_RETRIEVE_INFO(info) do { \
static struct transport_info *last_info; \
static int last_fd = -1; \
static unsigned int last_tick; \
if (!transport_map) \
info = NULL; \
else if (last_fd == fd && last_tick == transport_map_modified_tick) \
info = last_info; \
else \
{ \
info = hash_table_get (transport_map, (void *)(intptr_t) fd); \
last_fd = fd; \
last_info = info; \
last_tick = transport_map_modified_tick; \
} \
} while (0)
static int
static bool
poll_internal (int fd, struct transport_info *info, int wf, double timeout)
{
if (timeout == -1)
@ -840,16 +822,16 @@ poll_internal (int fd, struct transport_info *info, int wf, double timeout)
if (timeout)
{
int test;
if (info && info->poller)
test = info->poller (fd, timeout, wf, info->ctx);
if (info && info->imp->poller)
test = info->imp->poller (fd, timeout, wf, info->ctx);
else
test = sock_poll (fd, timeout, wf);
test = sock_poll (fd, timeout, wf);
if (test == 0)
errno = ETIMEDOUT;
errno = ETIMEDOUT;
if (test <= 0)
return 0;
return false;
}
return 1;
return true;
}
/* Read no more than BUFSIZE bytes of data from FD, storing them to
@ -864,8 +846,8 @@ fd_read (int fd, char *buf, int bufsize, double timeout)
LAZY_RETRIEVE_INFO (info);
if (!poll_internal (fd, info, WAIT_FOR_READ, timeout))
return -1;
if (info && info->reader)
return info->reader (fd, buf, bufsize, info->ctx);
if (info && info->imp->reader)
return info->imp->reader (fd, buf, bufsize, info->ctx);
else
return sock_read (fd, buf, bufsize);
}
@ -889,8 +871,8 @@ fd_peek (int fd, char *buf, int bufsize, double timeout)
LAZY_RETRIEVE_INFO (info);
if (!poll_internal (fd, info, WAIT_FOR_READ, timeout))
return -1;
if (info && info->peeker)
return info->peeker (fd, buf, bufsize, info->ctx);
if (info && info->imp->peeker)
return info->imp->peeker (fd, buf, bufsize, info->ctx);
else
return sock_peek (fd, buf, bufsize);
}
@ -913,19 +895,48 @@ fd_write (int fd, char *buf, int bufsize, double timeout)
while (bufsize > 0)
{
if (!poll_internal (fd, info, WAIT_FOR_WRITE, timeout))
return -1;
if (info && info->writer)
res = info->writer (fd, buf, bufsize, info->ctx);
return -1;
if (info && info->imp->writer)
res = info->imp->writer (fd, buf, bufsize, info->ctx);
else
res = sock_write (fd, buf, bufsize);
res = sock_write (fd, buf, bufsize);
if (res <= 0)
break;
break;
buf += res;
bufsize -= res;
}
return res;
}
/* Report the most recent error(s) on FD. This should only be called
after fd_* functions, such as fd_read and fd_write, and only if
they return a negative result. For errors coming from other calls
such as setsockopt or fopen, strerror should continue to be
used.
If the transport doesn't support error messages or doesn't supply
one, strerror(errno) is returned. The returned error message
should not be used after fd_close has been called. */
const char *
fd_errstr (int fd)
{
/* Don't bother with LAZY_RETRIEVE_INFO, as this will only be called
in case of error, never in a tight loop. */
struct transport_info *info = NULL;
if (transport_map)
info = hash_table_get (transport_map, (void *)(intptr_t) fd);
if (info && info->imp->errstr)
{
const char *err = info->imp->errstr (fd, info->ctx);
if (err)
return err;
/* else, fall through and print the system error. */
}
return strerror (errno);
}
/* Close the file descriptor FD. */
void
@ -939,16 +950,16 @@ fd_close (int fd)
per socket, so that particular optimization wouldn't work. */
info = NULL;
if (transport_map)
info = hash_table_get (transport_map, (void *) fd);
info = hash_table_get (transport_map, (void *)(intptr_t) fd);
if (info && info->closer)
info->closer (fd, info->ctx);
if (info && info->imp->closer)
info->imp->closer (fd, info->ctx);
else
sock_close (fd);
if (info)
{
hash_table_remove (transport_map, (void *) fd);
hash_table_remove (transport_map, (void *)(intptr_t) fd);
xfree (info);
++transport_map_modified_tick;
}

View File

@ -1,11 +1,12 @@
/* Declarations for connect.
Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GNU Wget.
GNU Wget 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 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
GNU Wget is distributed in the hope that it will be useful,
@ -14,18 +15,18 @@ 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 Wget; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with Wget. If not, see <http://www.gnu.org/licenses/>.
In addition, as a special exception, the Free Software Foundation
gives permission to link the code of its release of Wget with the
OpenSSL project's "OpenSSL" library (or with modified versions of it
that use the same license as the "OpenSSL" library), and distribute
the linked executables. You must obey the GNU General Public License
in all respects for all of the code used other than "OpenSSL". If you
modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
Additional permission under GNU GPL version 3 section 7
If you modify this program, or any covered work, by linking or
combining it with the OpenSSL project's OpenSSL library (or a
modified version of that library), containing parts covered by the
terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
grants you additional permission to convey the resulting work.
Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#ifndef CONNECT_H
#define CONNECT_H
@ -38,40 +39,43 @@ so, delete this exception statement from your version. */
enum {
E_HOST = -100
};
int connect_to_host PARAMS ((const char *, int));
int connect_to_ip PARAMS ((const ip_address *, int, const char *));
int connect_to_host (const char *, int);
int connect_to_ip (const ip_address *, int, const char *);
int bind_local PARAMS ((const ip_address *, int *));
int accept_connection PARAMS ((int));
int bind_local (const ip_address *, int *);
int accept_connection (int);
enum {
ENDPOINT_LOCAL,
ENDPOINT_PEER
};
int socket_ip_address PARAMS ((int, ip_address *, int));
bool socket_ip_address (int, ip_address *, int);
int retryable_socket_connect_error PARAMS ((int));
bool retryable_socket_connect_error (int);
/* Flags for select_fd's WAIT_FOR argument. */
enum {
WAIT_FOR_READ = 1,
WAIT_FOR_WRITE = 2
};
int select_fd PARAMS ((int, double, int));
int test_socket_open PARAMS ((int));
int select_fd (int, double, int);
bool test_socket_open (int);
typedef int (*fd_reader_t) PARAMS ((int, char *, int, void *));
typedef int (*fd_writer_t) PARAMS ((int, char *, int, void *));
typedef int (*fd_poller_t) PARAMS ((int, double, int, void *));
typedef int (*fd_peeker_t) PARAMS ((int, char *, int, void *));
typedef void (*fd_closer_t) PARAMS ((int, void *));
void fd_register_transport PARAMS ((int, fd_reader_t, fd_writer_t,
fd_poller_t, fd_peeker_t, fd_closer_t,
void *));
void *fd_transport_context PARAMS ((int));
struct transport_implementation {
int (*reader) (int, char *, int, void *);
int (*writer) (int, char *, int, void *);
int (*poller) (int, double, int, void *);
int (*peeker) (int, char *, int, void *);
const char *(*errstr) (int, void *);
void (*closer) (int, void *);
};
void fd_register_transport (int, struct transport_implementation *, void *);
void *fd_transport_context (int);
int fd_read (int, char *, int, double);
int fd_write (int, char *, int, double);
int fd_peek (int, char *, int, double);
const char *fd_errstr (int);
void fd_close (int);
int fd_read PARAMS ((int, char *, int, double));
int fd_write PARAMS ((int, char *, int, double));
int fd_peek PARAMS ((int, char *, int, double));
void fd_close PARAMS ((int));
#endif /* CONNECT_H */

View File

@ -1,11 +1,12 @@
/* Conversion of links to local files.
Copyright (C) 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2006, 2007,
2008 Free Software Foundation, Inc.
This file is part of GNU Wget.
GNU Wget 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 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
GNU Wget is distributed in the hope that it will be useful,
@ -14,34 +15,29 @@ 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 Wget; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with Wget. If not, see <http://www.gnu.org/licenses/>.
In addition, as a special exception, the Free Software Foundation
gives permission to link the code of its release of Wget with the
OpenSSL project's "OpenSSL" library (or with modified versions of it
that use the same license as the "OpenSSL" library), and distribute
the linked executables. You must obey the GNU General Public License
in all respects for all of the code used other than "OpenSSL". If you
modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
Additional permission under GNU GPL version 3 section 7
If you modify this program, or any covered work, by linking or
combining it with the OpenSSL project's OpenSSL library (or a
modified version of that library), containing parts covered by the
terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
grants you additional permission to convey the resulting work.
Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif /* HAVE_STRING_H */
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#include <errno.h>
#include <assert.h>
#include <sys/types.h>
#include "wget.h"
#include "convert.h"
@ -50,6 +46,7 @@ so, delete this exception statement from your version. */
#include "utils.h"
#include "hash.h"
#include "ptimer.h"
#include "res.h"
static struct hash_table *dl_file_url_map;
struct hash_table *dl_url_file_map;
@ -58,7 +55,7 @@ struct hash_table *dl_url_file_map;
conversion after Wget is done. */
struct hash_table *downloaded_html_set;
static void convert_links PARAMS ((const char *, struct urlpos *));
static void convert_links (const char *, struct urlpos *);
/* This function is called when the retrieval is done to convert the
links that have been downloaded. It has to be called at the end of
@ -91,7 +88,7 @@ convert_all_links (void)
if (downloaded_html_set)
cnt = hash_table_count (downloaded_html_set);
if (cnt == 0)
return;
goto cleanup;
file_array = alloca_array (char *, cnt);
string_set_to_array (downloaded_html_set, file_array);
@ -102,13 +99,13 @@ convert_all_links (void)
char *file = file_array[i];
/* Determine the URL of the HTML file. get_urls_html will need
it. */
it. */
url = hash_table_get (dl_file_url_map, file);
if (!url)
{
DEBUGP (("Apparently %s has been removed.\n", file));
continue;
}
{
DEBUGP (("Apparently %s has been removed.\n", file));
continue;
}
DEBUGP (("Scanning %s (from %s)\n", file, url));
@ -120,48 +117,48 @@ convert_all_links (void)
links that have been followed from other files. */
for (cur_url = urls; cur_url; cur_url = cur_url->next)
{
char *local_name;
struct url *u = cur_url->url;
{
char *local_name;
struct url *u = cur_url->url;
if (cur_url->link_base_p)
{
/* Base references have been resolved by our parser, so
we turn the base URL into an empty string. (Perhaps
we should remove the tag entirely?) */
cur_url->convert = CO_NULLIFY_BASE;
continue;
}
if (cur_url->link_base_p)
{
/* Base references have been resolved by our parser, so
we turn the base URL into an empty string. (Perhaps
we should remove the tag entirely?) */
cur_url->convert = CO_NULLIFY_BASE;
continue;
}
/* We decide the direction of conversion according to whether
a URL was downloaded. Downloaded URLs will be converted
ABS2REL, whereas non-downloaded will be converted REL2ABS. */
local_name = hash_table_get (dl_url_file_map, u->url);
/* We decide the direction of conversion according to whether
a URL was downloaded. Downloaded URLs will be converted
ABS2REL, whereas non-downloaded will be converted REL2ABS. */
local_name = hash_table_get (dl_url_file_map, u->url);
/* Decide on the conversion type. */
if (local_name)
{
/* We've downloaded this URL. Convert it to relative
/* Decide on the conversion type. */
if (local_name)
{
/* We've downloaded this URL. Convert it to relative
form. We do this even if the URL already is in
relative form, because our directory structure may
not be identical to that on the server (think `-nd',
`--cut-dirs', etc.) */
cur_url->convert = CO_CONVERT_TO_RELATIVE;
cur_url->local_name = xstrdup (local_name);
DEBUGP (("will convert url %s to local %s\n", u->url, local_name));
}
else
{
/* We haven't downloaded this URL. If it's not already
cur_url->convert = CO_CONVERT_TO_RELATIVE;
cur_url->local_name = xstrdup (local_name);
DEBUGP (("will convert url %s to local %s\n", u->url, local_name));
}
else
{
/* We haven't downloaded this URL. If it's not already
complete (including a full host name), convert it to
that form, so it can be reached while browsing this
HTML locally. */
if (!cur_url->link_complete_p)
cur_url->convert = CO_CONVERT_TO_COMPLETE;
cur_url->local_name = NULL;
DEBUGP (("will convert url %s to complete\n", u->url));
}
}
if (!cur_url->link_complete_p)
cur_url->convert = CO_CONVERT_TO_COMPLETE;
cur_url->local_name = NULL;
DEBUGP (("will convert url %s to complete\n", u->url));
}
}
/* Convert the links in the file. */
convert_links (file, urls);
@ -171,19 +168,19 @@ convert_all_links (void)
free_urlpos (urls);
}
secs = ptimer_measure (timer) / 1000;
secs = ptimer_measure (timer);
logprintf (LOG_VERBOSE, _("Converted %d files in %s seconds.\n"),
file_count, print_decimal (secs));
cleanup:
ptimer_destroy (timer);
logprintf (LOG_VERBOSE, _("Converted %d files in %.*f seconds.\n"),
file_count, secs < 10 ? 3 : 1, secs);
}
static void write_backup_file PARAMS ((const char *, downloaded_file_t));
static const char *replace_attr PARAMS ((const char *, int, FILE *,
const char *));
static const char *replace_attr_refresh_hack PARAMS ((const char *, int, FILE *,
const char *, int));
static char *local_quote_string PARAMS ((const char *));
static char *construct_relative PARAMS ((const char *, const char *));
static void write_backup_file (const char *, downloaded_file_t);
static const char *replace_attr (const char *, int, FILE *, const char *);
static const char *replace_attr_refresh_hack (const char *, int, FILE *,
const char *, int);
static char *local_quote_string (const char *);
static char *construct_relative (const char *, const char *);
/* Change the links in one HTML file. LINKS is a list of links in the
document, along with their positions and the desired direction of
@ -209,11 +206,11 @@ convert_links (const char *file, struct urlpos *links)
struct urlpos *dry;
for (dry = links; dry; dry = dry->next)
if (dry->convert != CO_NOCONVERT)
++dry_count;
++dry_count;
if (!dry_count)
{
logputs (LOG_VERBOSE, _("nothing to do.\n"));
return;
logputs (LOG_VERBOSE, _("nothing to do.\n"));
return;
}
}
@ -221,7 +218,7 @@ convert_links (const char *file, struct urlpos *links)
if (!fm)
{
logprintf (LOG_NOTQUIET, _("Cannot convert links in %s: %s\n"),
file, strerror (errno));
file, strerror (errno));
return;
}
@ -236,7 +233,7 @@ convert_links (const char *file, struct urlpos *links)
if (unlink (file) < 0 && errno != ENOENT)
{
logprintf (LOG_NOTQUIET, _("Unable to delete `%s': %s\n"),
file, strerror (errno));
file, strerror (errno));
read_file_free (fm);
return;
}
@ -245,7 +242,7 @@ convert_links (const char *file, struct urlpos *links)
if (!fp)
{
logprintf (LOG_NOTQUIET, _("Cannot convert links in %s: %s\n"),
file, strerror (errno));
file, strerror (errno));
read_file_free (fm);
return;
}
@ -258,16 +255,16 @@ convert_links (const char *file, struct urlpos *links)
char *url_start = fm->content + link->pos;
if (link->pos >= fm->length)
{
DEBUGP (("Something strange is going on. Please investigate."));
break;
}
{
DEBUGP (("Something strange is going on. Please investigate."));
break;
}
/* If the URL is not to be converted, skip it. */
if (link->convert == CO_NOCONVERT)
{
DEBUGP (("Skipping %s at position %d.\n", link->url->url, link->pos));
continue;
}
{
DEBUGP (("Skipping %s at position %d.\n", link->url->url, link->pos));
continue;
}
/* Echo the file contents, up to the offending URL's opening
quote, to the outfile. */
@ -275,52 +272,52 @@ convert_links (const char *file, struct urlpos *links)
p = url_start;
switch (link->convert)
{
case CO_CONVERT_TO_RELATIVE:
/* Convert absolute URL to relative. */
{
char *newname = construct_relative (file, link->local_name);
char *quoted_newname = local_quote_string (newname);
{
case CO_CONVERT_TO_RELATIVE:
/* Convert absolute URL to relative. */
{
char *newname = construct_relative (file, link->local_name);
char *quoted_newname = local_quote_string (newname);
if (!link->link_refresh_p)
p = replace_attr (p, link->size, fp, quoted_newname);
else
p = replace_attr_refresh_hack (p, link->size, fp, quoted_newname,
link->refresh_timeout);
if (!link->link_refresh_p)
p = replace_attr (p, link->size, fp, quoted_newname);
else
p = replace_attr_refresh_hack (p, link->size, fp, quoted_newname,
link->refresh_timeout);
DEBUGP (("TO_RELATIVE: %s to %s at position %d in %s.\n",
link->url->url, newname, link->pos, file));
xfree (newname);
xfree (quoted_newname);
++to_file_count;
break;
}
case CO_CONVERT_TO_COMPLETE:
/* Convert the link to absolute URL. */
{
char *newlink = link->url->url;
char *quoted_newlink = html_quote_string (newlink);
DEBUGP (("TO_RELATIVE: %s to %s at position %d in %s.\n",
link->url->url, newname, link->pos, file));
xfree (newname);
xfree (quoted_newname);
++to_file_count;
break;
}
case CO_CONVERT_TO_COMPLETE:
/* Convert the link to absolute URL. */
{
char *newlink = link->url->url;
char *quoted_newlink = html_quote_string (newlink);
if (!link->link_refresh_p)
p = replace_attr (p, link->size, fp, quoted_newlink);
else
p = replace_attr_refresh_hack (p, link->size, fp, quoted_newlink,
link->refresh_timeout);
if (!link->link_refresh_p)
p = replace_attr (p, link->size, fp, quoted_newlink);
else
p = replace_attr_refresh_hack (p, link->size, fp, quoted_newlink,
link->refresh_timeout);
DEBUGP (("TO_COMPLETE: <something> to %s at position %d in %s.\n",
newlink, link->pos, file));
xfree (quoted_newlink);
++to_url_count;
break;
}
case CO_NULLIFY_BASE:
/* Change the base href to "". */
p = replace_attr (p, link->size, fp, "");
break;
case CO_NOCONVERT:
abort ();
break;
}
DEBUGP (("TO_COMPLETE: <something> to %s at position %d in %s.\n",
newlink, link->pos, file));
xfree (quoted_newlink);
++to_url_count;
break;
}
case CO_NULLIFY_BASE:
/* Change the base href to "". */
p = replace_attr (p, link->size, fp, "");
break;
case CO_NOCONVERT:
abort ();
break;
}
}
/* Output the rest of the file. */
@ -363,7 +360,7 @@ construct_relative (const char *basefile, const char *linkfile)
for (b = basefile, l = linkfile; *b == *l && *b != '\0'; ++b, ++l)
{
if (*b == '/')
start = (b - basefile) + 1;
start = (b - basefile) + 1;
}
basefile += start;
linkfile += start;
@ -384,11 +381,11 @@ construct_relative (const char *basefile, const char *linkfile)
for (b = basefile; *b; b++)
{
if (*b == '/')
++basedirs;
++basedirs;
}
/* Construct LINK as explained above. */
link = (char *)xmalloc (3 * basedirs + strlen (linkfile) + 1);
link = xmalloc (3 * basedirs + strlen (linkfile) + 1);
for (i = 0; i < basedirs; i++)
memcpy (link + 3 * i, "../", 3);
strcpy (link + 3 * i, linkfile);
@ -414,12 +411,12 @@ write_backup_file (const char *file, downloaded_file_t downloaded_file_return)
if (downloaded_file_return == FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED)
{
/* Just write "orig" over "html". We need to do it this way
because when we're checking to see if we've downloaded the
file before (to see if we can skip downloading it), we don't
know if it's a text/html file. Therefore we don't know yet
at that stage that -E is going to cause us to tack on
".html", so we need to compare vs. the original URL plus
".orig", not the original URL plus ".html.orig". */
because when we're checking to see if we've downloaded the
file before (to see if we can skip downloading it), we don't
know if it's a text/html file. Therefore we don't know yet
at that stage that -E is going to cause us to tack on
".html", so we need to compare vs. the original URL plus
".orig", not the original URL plus ".html.orig". */
filename_plus_orig_suffix = alloca (filename_len + 1);
strcpy (filename_plus_orig_suffix, file);
strcpy ((filename_plus_orig_suffix + filename_len) - 4, "orig");
@ -444,42 +441,41 @@ write_backup_file (const char *file, downloaded_file_t downloaded_file_return)
{
/* Rename <file> to <file>.orig before former gets written over. */
if (rename (file, filename_plus_orig_suffix) != 0)
logprintf (LOG_NOTQUIET, _("Cannot back up %s as %s: %s\n"),
file, filename_plus_orig_suffix, strerror (errno));
logprintf (LOG_NOTQUIET, _("Cannot back up %s as %s: %s\n"),
file, filename_plus_orig_suffix, strerror (errno));
/* Remember that we've already written a .orig backup for this file.
Note that we never free this memory since we need it till the
convert_all_links() call, which is one of the last things the
program does before terminating. BTW, I'm not sure if it would be
safe to just set 'converted_file_ptr->string' to 'file' below,
rather than making a copy of the string... Another note is that I
thought I could just add a field to the urlpos structure saying
that we'd written a .orig file for this URL, but that didn't work,
so I had to make this separate list.
-- Dan Harkless <wget@harkless.org>
Note that we never free this memory since we need it till the
convert_all_links() call, which is one of the last things the
program does before terminating. BTW, I'm not sure if it would be
safe to just set 'converted_file_ptr->string' to 'file' below,
rather than making a copy of the string... Another note is that I
thought I could just add a field to the urlpos structure saying
that we'd written a .orig file for this URL, but that didn't work,
so I had to make this separate list.
-- Dan Harkless <wget@harkless.org>
This [adding a field to the urlpos structure] didn't work
because convert_file() is called from convert_all_links at
the end of the retrieval with a freshly built new urlpos
list.
-- Hrvoje Niksic <hniksic@xemacs.org>
-- Hrvoje Niksic <hniksic@xemacs.org>
*/
string_set_add (converted_files, file);
}
}
static int find_fragment PARAMS ((const char *, int, const char **,
const char **));
static bool find_fragment (const char *, int, const char **, const char **);
/* Replace an attribute's original text with NEW_TEXT. */
static const char *
replace_attr (const char *p, int size, FILE *fp, const char *new_text)
{
int quote_flag = 0;
char quote_char = '\"'; /* use "..." for quoting, unless the
original value is quoted, in which
case reuse its quoting char. */
bool quote_flag = false;
char quote_char = '\"'; /* use "..." for quoting, unless the
original value is quoted, in which
case reuse its quoting char. */
const char *frag_beg, *frag_end;
/* Structure of our string is:
@ -492,9 +488,9 @@ replace_attr (const char *p, int size, FILE *fp, const char *new_text)
if (*p == '\"' || *p == '\'')
{
quote_char = *p;
quote_flag = 1;
quote_flag = true;
++p;
size -= 2; /* disregard opening and closing quote */
size -= 2; /* disregard opening and closing quote */
}
putc (quote_char, fp);
fputs (new_text, fp);
@ -516,13 +512,13 @@ replace_attr (const char *p, int size, FILE *fp, const char *new_text)
static const char *
replace_attr_refresh_hack (const char *p, int size, FILE *fp,
const char *new_text, int timeout)
const char *new_text, int timeout)
{
/* "0; URL=..." */
char *new_with_timeout = (char *)alloca (numdigit (timeout)
+ 6 /* "; URL=" */
+ strlen (new_text)
+ 1);
+ 6 /* "; URL=" */
+ strlen (new_text)
+ 1);
sprintf (new_with_timeout, "%d; URL=%s", timeout, new_text);
return replace_attr (p, size, fp, new_with_timeout);
@ -530,36 +526,36 @@ replace_attr_refresh_hack (const char *p, int size, FILE *fp,
/* Find the first occurrence of '#' in [BEG, BEG+SIZE) that is not
preceded by '&'. If the character is not found, return zero. If
the character is found, return 1 and set BP and EP to point to the
beginning and end of the region.
the character is found, return true and set BP and EP to point to
the beginning and end of the region.
This is used for finding the fragment indentifiers in URLs. */
static int
static bool
find_fragment (const char *beg, int size, const char **bp, const char **ep)
{
const char *end = beg + size;
int saw_amp = 0;
bool saw_amp = false;
for (; beg < end; beg++)
{
switch (*beg)
{
case '&':
saw_amp = 1;
break;
case '#':
if (!saw_amp)
{
*bp = beg;
*ep = end;
return 1;
}
/* fallthrough */
default:
saw_amp = 0;
}
{
case '&':
saw_amp = true;
break;
case '#':
if (!saw_amp)
{
*bp = beg;
*ep = end;
return true;
}
/* fallthrough */
default:
saw_amp = false;
}
}
return 0;
return false;
}
/* Quote FILE for use as local reference to an HTML file.
@ -593,26 +589,26 @@ local_quote_string (const char *file)
switch (*from)
{
case '%':
*to++ = '%';
*to++ = '2';
*to++ = '5';
break;
*to++ = '%';
*to++ = '2';
*to++ = '5';
break;
case '#':
*to++ = '%';
*to++ = '2';
*to++ = '3';
break;
*to++ = '%';
*to++ = '2';
*to++ = '3';
break;
case '?':
if (opt.html_extension)
{
*to++ = '%';
*to++ = '3';
*to++ = 'F';
break;
}
/* fallthrough */
if (opt.html_extension)
{
*to++ = '%';
*to++ = '3';
*to++ = 'F';
break;
}
/* fallthrough */
default:
*to++ = *from;
*to++ = *from;
}
*to = '\0';
@ -623,16 +619,16 @@ local_quote_string (const char *file)
downloaded_html_list, and downloaded_html_set. Other code calls
these functions to let us know that a file has been downloaded. */
#define ENSURE_TABLES_EXIST do { \
if (!dl_file_url_map) \
dl_file_url_map = make_string_hash_table (0); \
if (!dl_url_file_map) \
dl_url_file_map = make_string_hash_table (0); \
#define ENSURE_TABLES_EXIST do { \
if (!dl_file_url_map) \
dl_file_url_map = make_string_hash_table (0); \
if (!dl_url_file_map) \
dl_url_file_map = make_string_hash_table (0); \
} while (0)
/* Return 1 if S1 and S2 are the same, except for "/index.html". The
three cases in which it returns one are (substitute any substring
for "foo"):
/* Return true if S1 and S2 are the same, except for "/index.html".
The three cases in which it returns one are (substitute any
substring for "foo"):
m("foo/index.html", "foo/") ==> 1
m("foo/", "foo/index.html") ==> 1
@ -640,7 +636,7 @@ local_quote_string (const char *file)
m("foo", "foo/" ==> 1
m("foo", "foo") ==> 1 */
static int
static bool
match_except_index (const char *s1, const char *s2)
{
int i;
@ -653,14 +649,14 @@ match_except_index (const char *s1, const char *s2)
/* Strings differ at the very beginning -- bail out. We need to
check this explicitly to avoid `lng - 1' reading outside the
array. */
return 0;
return false;
if (!*s1 && !*s2)
/* Both strings hit EOF -- strings are equal. */
return 1;
return true;
else if (*s1 && *s2)
/* Strings are randomly different, e.g. "/foo/bar" and "/foo/qux". */
return 0;
return false;
else if (*s1)
/* S1 is the longer one. */
lng = s1;
@ -679,7 +675,7 @@ match_except_index (const char *s1, const char *s2)
if (*lng == '/' && *(lng + 1) == '\0')
/* foo */
/* foo/ */
return 1;
return true;
return 0 == strcmp (lng, "/index.html");
}
@ -707,8 +703,9 @@ dissociate_urls_from_file_mapper (void *key, void *value, void *arg)
static void
dissociate_urls_from_file (const char *file)
{
hash_table_map (dl_url_file_map, dissociate_urls_from_file_mapper,
(char *)file);
/* Can't use hash_table_iter_* because the table mutates while mapping. */
hash_table_for_each (dl_url_file_map, dissociate_urls_from_file_mapper,
(char *) file);
}
/* Register that URL has been successfully downloaded to FILE. This
@ -731,29 +728,29 @@ register_download (const char *url, const char *file)
if (hash_table_get_pair (dl_file_url_map, file, &old_file, &old_url))
{
if (0 == strcmp (url, old_url))
/* We have somehow managed to download the same URL twice.
Nothing to do. */
return;
/* We have somehow managed to download the same URL twice.
Nothing to do. */
return;
if (match_except_index (url, old_url)
&& !hash_table_contains (dl_url_file_map, url))
/* The two URLs differ only in the "index.html" ending. For
example, one is "http://www.server.com/", and the other is
"http://www.server.com/index.html". Don't remove the old
one, just add the new one as a non-canonical entry. */
goto url_only;
&& !hash_table_contains (dl_url_file_map, url))
/* The two URLs differ only in the "index.html" ending. For
example, one is "http://www.server.com/", and the other is
"http://www.server.com/index.html". Don't remove the old
one, just add the new one as a non-canonical entry. */
goto url_only;
hash_table_remove (dl_file_url_map, file);
xfree (old_file);
xfree (old_url);
/* Remove all the URLs that point to this file. Yes, there can
be more than one such URL, because we store redirections as
multiple entries in dl_url_file_map. For example, if URL1
redirects to URL2 which gets downloaded to FILE, we map both
URL1 and URL2 to FILE in dl_url_file_map. (dl_file_url_map
only points to URL2.) When another URL gets loaded to FILE,
we want both URL1 and URL2 dissociated from it.
be more than one such URL, because we store redirections as
multiple entries in dl_url_file_map. For example, if URL1
redirects to URL2 which gets downloaded to FILE, we map both
URL1 and URL2 to FILE in dl_url_file_map. (dl_file_url_map
only points to URL2.) When another URL gets loaded to FILE,
we want both URL1 and URL2 dissociated from it.
This is a relatively expensive operation because it performs
a linear search of the whole hash table, but it should be
@ -837,7 +834,7 @@ register_html (const char *url, const char *file)
string_set_add (downloaded_html_set, file);
}
static void downloaded_files_free PARAMS ((void));
static void downloaded_files_free (void);
/* Cleanup the data structures associated with this file. */
@ -924,10 +921,10 @@ downloaded_file (downloaded_file_t mode, const char *file)
if (mode == CHECK_FOR_FILE)
{
if (!downloaded_files_hash)
return FILE_NOT_ALREADY_DOWNLOADED;
return FILE_NOT_ALREADY_DOWNLOADED;
ptr = hash_table_get (downloaded_files_hash, file);
if (!ptr)
return FILE_NOT_ALREADY_DOWNLOADED;
return FILE_NOT_ALREADY_DOWNLOADED;
return *ptr;
}
@ -939,24 +936,21 @@ downloaded_file (downloaded_file_t mode, const char *file)
return *ptr;
ptr = downloaded_mode_to_ptr (mode);
hash_table_put (downloaded_files_hash, xstrdup (file), &ptr);
hash_table_put (downloaded_files_hash, xstrdup (file), ptr);
return FILE_NOT_ALREADY_DOWNLOADED;
}
static int
df_free_mapper (void *key, void *value, void *ignored)
{
xfree (key);
return 0;
}
static void
downloaded_files_free (void)
{
if (downloaded_files_hash)
{
hash_table_map (downloaded_files_hash, df_free_mapper, NULL);
hash_table_iterator iter;
for (hash_table_iterate (downloaded_files_hash, &iter);
hash_table_iter_next (&iter);
)
xfree (iter.key);
hash_table_destroy (downloaded_files_hash);
downloaded_files_hash = NULL;
}
@ -984,52 +978,57 @@ html_quote_string (const char *s)
for (i = 0; *s; s++, i++)
{
if (*s == '&')
i += 4; /* `amp;' */
i += 4; /* `amp;' */
else if (*s == '<' || *s == '>')
i += 3; /* `lt;' and `gt;' */
i += 3; /* `lt;' and `gt;' */
else if (*s == '\"')
i += 5; /* `quot;' */
i += 5; /* `quot;' */
else if (*s == ' ')
i += 4; /* #32; */
i += 4; /* #32; */
}
res = (char *)xmalloc (i + 1);
res = xmalloc (i + 1);
s = b;
for (p = res; *s; s++)
{
switch (*s)
{
case '&':
*p++ = '&';
*p++ = 'a';
*p++ = 'm';
*p++ = 'p';
*p++ = ';';
break;
case '<': case '>':
*p++ = '&';
*p++ = (*s == '<' ? 'l' : 'g');
*p++ = 't';
*p++ = ';';
break;
case '\"':
*p++ = '&';
*p++ = 'q';
*p++ = 'u';
*p++ = 'o';
*p++ = 't';
*p++ = ';';
break;
case ' ':
*p++ = '&';
*p++ = '#';
*p++ = '3';
*p++ = '2';
*p++ = ';';
break;
default:
*p++ = *s;
}
{
case '&':
*p++ = '&';
*p++ = 'a';
*p++ = 'm';
*p++ = 'p';
*p++ = ';';
break;
case '<': case '>':
*p++ = '&';
*p++ = (*s == '<' ? 'l' : 'g');
*p++ = 't';
*p++ = ';';
break;
case '\"':
*p++ = '&';
*p++ = 'q';
*p++ = 'u';
*p++ = 'o';
*p++ = 't';
*p++ = ';';
break;
case ' ':
*p++ = '&';
*p++ = '#';
*p++ = '3';
*p++ = '2';
*p++ = ';';
break;
default:
*p++ = *s;
}
}
*p = '\0';
return res;
}
/*
* vim: et ts=2 sw=2
*/

View File

@ -1,11 +1,11 @@
/* Declarations for convert.c
Copyright (C) 2003 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Wget.
GNU Wget 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 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
GNU Wget is distributed in the hope that it will be useful,
@ -14,23 +14,24 @@ 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 Wget; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with Wget. If not, see <http://www.gnu.org/licenses/>.
In addition, as a special exception, the Free Software Foundation
gives permission to link the code of its release of Wget with the
OpenSSL project's "OpenSSL" library (or with modified versions of it
that use the same license as the "OpenSSL" library), and distribute
the linked executables. You must obey the GNU General Public License
in all respects for all of the code used other than "OpenSSL". If you
modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
Additional permission under GNU GPL version 3 section 7
If you modify this program, or any covered work, by linking or
combining it with the OpenSSL project's OpenSSL library (or a
modified version of that library), containing parts covered by the
terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
grants you additional permission to convey the resulting work.
Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#ifndef CONVERT_H
#define CONVERT_H
struct hash_table; /* forward decl */
extern struct hash_table *dl_url_file_map;
extern struct hash_table *downloaded_html_set;
enum convert_options {
@ -92,15 +93,15 @@ typedef enum
CHECK_FOR_FILE
} downloaded_file_t;
downloaded_file_t downloaded_file PARAMS ((downloaded_file_t, const char *));
downloaded_file_t downloaded_file (downloaded_file_t, const char *);
void register_download PARAMS ((const char *, const char *));
void register_redirection PARAMS ((const char *, const char *));
void register_html PARAMS ((const char *, const char *));
void register_delete_file PARAMS ((const char *));
void convert_all_links PARAMS ((void));
void convert_cleanup PARAMS ((void));
void register_download (const char *, const char *);
void register_redirection (const char *, const char *);
void register_html (const char *, const char *);
void register_delete_file (const char *);
void convert_all_links (void);
void convert_cleanup (void);
char *html_quote_string PARAMS ((const char *));
char *html_quote_string (const char *);
#endif /* CONVERT_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
/* Support for cookies.
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008 Free Software Foundation, Inc.
This file is part of GNU Wget.
GNU Wget 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 2 of the License, or (at
the Free Software Foundation; either version 3 of the License, or (at
your option) any later version.
GNU Wget is distributed in the hope that it will be useful, but
@ -14,33 +15,33 @@ 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 Wget; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with Wget. If not, see <http://www.gnu.org/licenses/>.
In addition, as a special exception, the Free Software Foundation
gives permission to link the code of its release of Wget with the
OpenSSL project's "OpenSSL" library (or with modified versions of it
that use the same license as the "OpenSSL" library), and distribute
the linked executables. You must obey the GNU General Public License
in all respects for all of the code used other than "OpenSSL". If you
modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
Additional permission under GNU GPL version 3 section 7
If you modify this program, or any covered work, by linking or
combining it with the OpenSSL project's OpenSSL library (or a
modified version of that library), containing parts covered by the
terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
grants you additional permission to convey the resulting work.
Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#ifndef COOKIES_H
#define COOKIES_H
struct cookie_jar;
struct cookie_jar *cookie_jar_new PARAMS ((void));
void cookie_jar_delete PARAMS ((struct cookie_jar *));
struct cookie_jar *cookie_jar_new (void);
void cookie_jar_delete (struct cookie_jar *);
void cookie_handle_set_cookie PARAMS ((struct cookie_jar *, const char *,
int, const char *, const char *));
char *cookie_header PARAMS ((struct cookie_jar *,
const char *, int, const char *, int));
void cookie_handle_set_cookie (struct cookie_jar *, const char *, int,
const char *, const char *);
char *cookie_header (struct cookie_jar *, const char *, int,
const char *, bool);
void cookie_jar_load PARAMS ((struct cookie_jar *, const char *));
void cookie_jar_save PARAMS ((struct cookie_jar *, const char *));
void cookie_jar_load (struct cookie_jar *, const char *);
void cookie_jar_save (struct cookie_jar *, const char *);
#endif /* COOKIES_H */

View File

@ -1,11 +1,12 @@
/* Basic FTP routines.
Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GNU Wget.
GNU Wget 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 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
GNU Wget is distributed in the hope that it will be useful,
@ -14,18 +15,18 @@ 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 Wget; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with Wget. If not, see <http://www.gnu.org/licenses/>.
In addition, as a special exception, the Free Software Foundation
gives permission to link the code of its release of Wget with the
OpenSSL project's "OpenSSL" library (or with modified versions of it
that use the same license as the "OpenSSL" library), and distribute
the linked executables. You must obey the GNU General Public License
in all respects for all of the code used other than "OpenSSL". If you
modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
Additional permission under GNU GPL version 3 section 7
If you modify this program, or any covered work, by linking or
combining it with the OpenSSL project's OpenSSL library (or a
modified version of that library), containing parts covered by the
terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
grants you additional permission to convey the resulting work.
Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#include <config.h>
@ -34,15 +35,10 @@ so, delete this exception statement from your version. */
#include <stdlib.h>
#include <errno.h>
#ifdef HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/types.h>
#include "wget.h"
#include "utils.h"
@ -71,30 +67,30 @@ ftp_response (int fd, char **ret_line)
char *p;
char *line = fd_read_line (fd);
if (!line)
return FTPRERR;
return FTPRERR;
/* Strip trailing CRLF before printing the line, so that
escnonprint doesn't include bogus \012 and \015. */
escnonprint doesn't include bogus \012 and \015. */
p = strchr (line, '\0');
if (p > line && p[-1] == '\n')
*--p = '\0';
*--p = '\0';
if (p > line && p[-1] == '\r')
*--p = '\0';
*--p = '\0';
if (opt.server_response)
logprintf (LOG_NOTQUIET, "%s\n", escnonprint (line));
logprintf (LOG_NOTQUIET, "%s\n", escnonprint (line));
else
DEBUGP (("%s\n", escnonprint (line)));
/* The last line of output is the one that begins with "ddd ". */
if (ISDIGIT (line[0]) && ISDIGIT (line[1]) && ISDIGIT (line[2])
&& line[3] == ' ')
{
strncpy (ftp_last_respline, line, sizeof (ftp_last_respline));
ftp_last_respline[sizeof (ftp_last_respline) - 1] = '\0';
*ret_line = line;
return FTPOK;
}
&& line[3] == ' ')
{
strncpy (ftp_last_respline, line, sizeof (ftp_last_respline));
ftp_last_respline[sizeof (ftp_last_respline) - 1] = '\0';
*ret_line = line;
return FTPOK;
}
xfree (line);
}
}
@ -109,23 +105,23 @@ ftp_request (const char *command, const char *value)
if (value)
{
/* Check for newlines in VALUE (possibly injected by the %0A URL
escape) making the callers inadvertently send multiple FTP
commands at once. Without this check an attacker could
intentionally redirect to ftp://server/fakedir%0Acommand.../
and execute arbitrary FTP command on a remote FTP server. */
escape) making the callers inadvertently send multiple FTP
commands at once. Without this check an attacker could
intentionally redirect to ftp://server/fakedir%0Acommand.../
and execute arbitrary FTP command on a remote FTP server. */
if (strpbrk (value, "\r\n"))
{
/* Copy VALUE to the stack and modify CR/LF to space. */
char *defanged, *p;
STRDUP_ALLOCA (defanged, value);
for (p = defanged; *p; p++)
if (*p == '\r' || *p == '\n')
*p = ' ';
DEBUGP (("\nDetected newlines in %s \"%s\"; changing to %s \"%s\"\n",
command, escnonprint (value), command, escnonprint (defanged)));
/* Make VALUE point to the defanged copy of the string. */
value = defanged;
}
{
/* Copy VALUE to the stack and modify CR/LF to space. */
char *defanged, *p;
STRDUP_ALLOCA (defanged, value);
for (p = defanged; *p; p++)
if (*p == '\r' || *p == '\n')
*p = ' ';
DEBUGP (("\nDetected newlines in %s \"%s\"; changing to %s \"%s\"\n",
command, escnonprint (value), command, escnonprint (defanged)));
/* Make VALUE point to the defanged copy of the string. */
value = defanged;
}
res = concat_strings (command, " ", value, "\r\n", (char *) 0);
}
else
@ -164,7 +160,7 @@ ftp_login (int csock, const char *acc, const char *pass)
xfree (respline);
/* Send USER username. */
request = ftp_request ("USER", acc);
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -198,29 +194,29 @@ ftp_login (int csock, const char *acc, const char *pass)
for (i = 0; i < countof (skey_head); i++)
{
int l = strlen (skey_head[i]);
int l = strlen (skey_head[i]);
if (0 == strncasecmp (skey_head[i], respline, l))
{
seed = respline + l;
break;
}
{
seed = respline + l;
break;
}
}
if (seed)
{
int skey_sequence = 0;
/* Extract the sequence from SEED. */
for (; ISDIGIT (*seed); seed++)
skey_sequence = 10 * skey_sequence + *seed - '0';
if (*seed == ' ')
++seed;
/* Extract the sequence from SEED. */
for (; ISDIGIT (*seed); seed++)
skey_sequence = 10 * skey_sequence + *seed - '0';
if (*seed == ' ')
++seed;
else
{
xfree (respline);
return FTPLOGREFUSED;
}
/* Replace the password with the SKEY response to the
challenge. */
/* Replace the password with the SKEY response to the
challenge. */
pass = skey_response (skey_sequence, seed, pass);
}
}
@ -228,7 +224,7 @@ ftp_login (int csock, const char *acc, const char *pass)
xfree (respline);
/* Send PASS password. */
request = ftp_request ("PASS", pass);
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -255,13 +251,11 @@ ip_address_to_port_repr (const ip_address *addr, int port, char *buf,
{
unsigned char *ptr;
assert (addr != NULL);
assert (addr->type == IPV4_ADDRESS);
assert (buf != NULL);
assert (addr->family == AF_INET);
/* buf must contain the argument of PORT (of the form a,b,c,d,e,f). */
assert (buflen >= 6 * 4);
ptr = ADDRESS_IPV4_DATA (addr);
ptr = IP_INADDR_DATA (addr);
snprintf (buf, buflen, "%d,%d,%d,%d,%d,%d", ptr[0], ptr[1],
ptr[2], ptr[3], (port & 0xff00) >> 8, port & 0xff);
buf[buflen - 1] = '\0';
@ -285,7 +279,7 @@ ftp_port (int csock, int *local_sock)
if (!socket_ip_address (csock, &addr, ENDPOINT_LOCAL))
return FTPSYSERR;
assert (addr.type == IPV4_ADDRESS);
assert (addr.family == AF_INET);
/* Setting port to 0 lets the system choose a free port. */
port = 0;
@ -300,7 +294,7 @@ ftp_port (int csock, int *local_sock)
/* Send PORT request. */
request = ftp_request ("PORT", bytes);
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -331,32 +325,29 @@ static void
ip_address_to_lprt_repr (const ip_address *addr, int port, char *buf,
size_t buflen)
{
unsigned char *ptr;
unsigned char *ptr = IP_INADDR_DATA (addr);
assert (addr != NULL);
assert (addr->type == IPV4_ADDRESS || addr->type == IPV6_ADDRESS);
assert (buf != NULL);
/* buf must contain the argument of LPRT (of the form af,n,h1,h2,...,hn,p1,p2). */
assert (buflen >= 21 * 4);
/* Construct the argument of LPRT (of the form af,n,h1,h2,...,hn,p1,p2). */
switch (addr->type)
switch (addr->family)
{
case IPV4_ADDRESS:
ptr = ADDRESS_IPV4_DATA (addr);
snprintf (buf, buflen, "%d,%d,%d,%d,%d,%d,%d,%d,%d", 4, 4,
ptr[0], ptr[1], ptr[2], ptr[3], 2,
(port & 0xff00) >> 8, port & 0xff);
buf[buflen - 1] = '\0';
break;
case IPV6_ADDRESS:
ptr = ADDRESS_IPV6_DATA (addr);
snprintf (buf, buflen, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
6, 16, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7],
ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13], ptr[14], ptr[15], 2,
(port & 0xff00) >> 8, port & 0xff);
buf[buflen - 1] = '\0';
break;
case AF_INET:
snprintf (buf, buflen, "%d,%d,%d,%d,%d,%d,%d,%d,%d", 4, 4,
ptr[0], ptr[1], ptr[2], ptr[3], 2,
(port & 0xff00) >> 8, port & 0xff);
break;
case AF_INET6:
snprintf (buf, buflen,
"%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
6, 16,
ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7],
ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13], ptr[14], ptr[15],
2, (port & 0xff00) >> 8, port & 0xff);
break;
default:
abort ();
}
}
@ -378,7 +369,7 @@ ftp_lprt (int csock, int *local_sock)
if (!socket_ip_address (csock, &addr, ENDPOINT_LOCAL))
return FTPSYSERR;
assert (addr.type == IPV4_ADDRESS || addr.type == IPV6_ADDRESS);
assert (addr.family == AF_INET || addr.family == AF_INET6);
/* Setting port to 0 lets the system choose a free port. */
port = 0;
@ -393,7 +384,7 @@ ftp_lprt (int csock, int *local_sock)
/* Send PORT request. */
request = ftp_request ("LPRT", bytes);
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -424,17 +415,14 @@ ip_address_to_eprt_repr (const ip_address *addr, int port, char *buf,
{
int afnum;
assert (addr != NULL);
assert (addr->type == IPV4_ADDRESS || addr->type == IPV6_ADDRESS);
assert (buf != NULL);
/* buf must contain the argument of EPRT (of the form |af|addr|port|).
* 4 chars for the | separators, INET6_ADDRSTRLEN chars for addr
* 1 char for af (1-2) and 5 chars for port (0-65535) */
assert (buflen >= 4 + INET6_ADDRSTRLEN + 1 + 5);
/* Construct the argument of EPRT (of the form |af|addr|port|). */
afnum = (addr->type == IPV4_ADDRESS ? 1 : 2);
snprintf (buf, buflen, "|%d|%s|%d|", afnum, pretty_print_address (addr), port);
afnum = (addr->family == AF_INET ? 1 : 2);
snprintf (buf, buflen, "|%d|%s|%d|", afnum, print_address (addr), port);
buf[buflen - 1] = '\0';
}
@ -458,8 +446,6 @@ ftp_eprt (int csock, int *local_sock)
if (!socket_ip_address (csock, &addr, ENDPOINT_LOCAL))
return FTPSYSERR;
assert (addr.type == IPV4_ADDRESS || addr.type == IPV6_ADDRESS);
/* Setting port to 0 lets the system choose a free port. */
port = 0;
@ -473,7 +459,7 @@ ftp_eprt (int csock, int *local_sock)
/* Send PORT request. */
request = ftp_request ("EPRT", bytes);
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -518,7 +504,7 @@ ftp_pasv (int csock, ip_address *addr, int *port)
/* Form the request. */
request = ftp_request ("PASV", NULL);
/* And send it. */
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -536,7 +522,8 @@ ftp_pasv (int csock, ip_address *addr, int *port)
}
/* Parse the request. */
s = respline;
for (s += 4; *s && !ISDIGIT (*s); s++);
for (s += 4; *s && !ISDIGIT (*s); s++)
;
if (!*s)
return FTPINVPASV;
for (i = 0; i < 6; i++)
@ -555,8 +542,8 @@ ftp_pasv (int csock, ip_address *addr, int *port)
}
xfree (respline);
addr->type = IPV4_ADDRESS;
memcpy (ADDRESS_IPV4_DATA (addr), tmp, 4);
addr->family = AF_INET;
memcpy (IP_INADDR_DATA (addr), tmp, 4);
*port = ((tmp[4] << 8) & 0xff00) + tmp[5];
return FTPOK;
@ -584,7 +571,7 @@ ftp_lpsv (int csock, ip_address *addr, int *port)
request = ftp_request ("LPSV", NULL);
/* And send it. */
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -604,7 +591,8 @@ ftp_lpsv (int csock, ip_address *addr, int *port)
/* Parse the response. */
s = respline;
for (s += 4; *s && !ISDIGIT (*s); s++);
for (s += 4; *s && !ISDIGIT (*s); s++)
;
if (!*s)
return FTPINVPASV;
@ -700,10 +688,10 @@ ftp_lpsv (int csock, ip_address *addr, int *port)
if (af == 4)
{
addr->type = IPV4_ADDRESS;
memcpy (ADDRESS_IPV4_DATA (addr), tmp, 4);
addr->family = AF_INET;
memcpy (IP_INADDR_DATA (addr), tmp, 4);
*port = ((tmpprt[0] << 8) & 0xff00) + tmpprt[1];
DEBUGP (("lpsv addr is: %s\n", pretty_print_address(addr)));
DEBUGP (("lpsv addr is: %s\n", print_address(addr)));
DEBUGP (("tmpprt[0] is: %d\n", tmpprt[0]));
DEBUGP (("tmpprt[1] is: %d\n", tmpprt[1]));
DEBUGP (("*port is: %d\n", *port));
@ -711,10 +699,10 @@ ftp_lpsv (int csock, ip_address *addr, int *port)
else
{
assert (af == 6);
addr->type = IPV6_ADDRESS;
memcpy (ADDRESS_IPV6_DATA (addr), tmp, 16);
addr->family = AF_INET6;
memcpy (IP_INADDR_DATA (addr), tmp, 16);
*port = ((tmpprt[0] << 8) & 0xff00) + tmpprt[1];
DEBUGP (("lpsv addr is: %s\n", pretty_print_address(addr)));
DEBUGP (("lpsv addr is: %s\n", print_address(addr)));
DEBUGP (("tmpprt[0] is: %d\n", tmpprt[0]));
DEBUGP (("tmpprt[1] is: %d\n", tmpprt[1]));
DEBUGP (("*port is: %d\n", *port));
@ -743,10 +731,10 @@ ftp_epsv (int csock, ip_address *ip, int *port)
/* Form the request. */
/* EPSV 1 means that we ask for IPv4 and EPSV 2 means that we ask for IPv6. */
request = ftp_request ("EPSV", (ip->type == IPV4_ADDRESS ? "1" : "2"));
request = ftp_request ("EPSV", (ip->family == AF_INET ? "1" : "2"));
/* And send it. */
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -843,7 +831,7 @@ ftp_type (int csock, int type)
stype[1] = 0;
/* Send TYPE request. */
request = ftp_request ("TYPE", stype);
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -875,7 +863,7 @@ ftp_cwd (int csock, const char *dir)
/* Send CWD request. */
request = ftp_request ("CWD", dir);
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -910,7 +898,7 @@ ftp_rest (int csock, wgint offset)
uerr_t err;
request = ftp_request ("REST", number_to_static_string (offset));
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -941,7 +929,7 @@ ftp_retr (int csock, const char *file)
/* Send RETR request. */
request = ftp_request ("RETR", file);
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -975,33 +963,45 @@ ftp_list (int csock, const char *file)
char *request, *respline;
int nwritten;
uerr_t err;
bool ok = false;
int i = 0;
/* Try `LIST -a' first and revert to `LIST' in case of failure. */
const char *list_commands[] = { "LIST -a",
"LIST" };
/* Send LIST request. */
request = ftp_request ("LIST", file);
nwritten = fd_write (csock, request, strlen (request), -1.0);
if (nwritten < 0)
{
xfree (request);
return WRITEFAILED;
}
xfree (request);
/* Get appropriate respone. */
err = ftp_response (csock, &respline);
if (err != FTPOK)
return err;
if (*respline == '5')
{
xfree (respline);
return FTPNSFOD;
}
if (*respline != '1')
{
xfree (respline);
return FTPRERR;
}
xfree (respline);
/* All OK. */
return FTPOK;
do {
/* Send request. */
request = ftp_request (list_commands[i], file);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
return WRITEFAILED;
}
xfree (request);
/* Get appropriate response. */
err = ftp_response (csock, &respline);
if (err == FTPOK)
{
if (*respline == '5')
{
err = FTPNSFOD;
}
else if (*respline == '1')
{
err = FTPOK;
ok = true;
}
else
{
err = FTPRERR;
}
xfree (respline);
}
++i;
} while (i < countof (list_commands) && !ok);
return err;
}
/* Sends the SYST command to the server. */
@ -1014,7 +1014,7 @@ ftp_syst (int csock, enum stype *server_type)
/* Send SYST request. */
request = ftp_request ("SYST", NULL);
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -1039,12 +1039,14 @@ ftp_syst (int csock, enum stype *server_type)
first word of the server response)? */
request = strtok (NULL, " ");
if (!strcasecmp (request, "VMS"))
if (request == NULL)
*server_type = ST_OTHER;
else if (!strcasecmp (request, "VMS"))
*server_type = ST_VMS;
else if (!strcasecmp (request, "UNIX"))
*server_type = ST_UNIX;
else if (!strcasecmp (request, "WINDOWS_NT")
|| !strcasecmp (request, "WINDOWS2000"))
|| !strcasecmp (request, "WINDOWS2000"))
*server_type = ST_WINNT;
else if (!strcasecmp (request, "MACOS"))
*server_type = ST_MACOS;
@ -1068,7 +1070,7 @@ ftp_pwd (int csock, char **pwd)
/* Send PWD request. */
request = ftp_request ("PWD", NULL);
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);
@ -1116,7 +1118,7 @@ ftp_size (int csock, const char *file, wgint *size)
/* Send PWD request. */
request = ftp_request ("SIZE", file);
nwritten = fd_write (csock, request, strlen (request), -1.0);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
xfree (request);

View File

@ -1,12 +1,12 @@
/* Parsing FTP `ls' output.
Copyright (C) 1995, 1996, 1997, 2000, 2001
Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GNU Wget.
GNU Wget 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 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
GNU Wget is distributed in the hope that it will be useful,
@ -15,41 +15,36 @@ 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 Wget; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with Wget. If not, see <http://www.gnu.org/licenses/>.
In addition, as a special exception, the Free Software Foundation
gives permission to link the code of its release of Wget with the
OpenSSL project's "OpenSSL" library (or with modified versions of it
that use the same license as the "OpenSSL" library), and distribute
the linked executables. You must obey the GNU General Public License
in all respects for all of the code used other than "OpenSSL". If you
modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
Additional permission under GNU GPL version 3 section 7
If you modify this program, or any covered work, by linking or
combining it with the OpenSSL project's OpenSSL library (or a
modified version of that library), containing parts covered by the
terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
grants you additional permission to convey the resulting work.
Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/types.h>
#include <errno.h>
#include <time.h>
#include "wget.h"
#include "utils.h"
#include "ftp.h"
#include "url.h"
#include "convert.h" /* for html_quote_string prototype */
extern FILE *output_stream;
#include "convert.h" /* for html_quote_string prototype */
#include "retr.h" /* for output_stream */
/* Converts symbolic permissions to number-style ones, e.g. string
rwxr-xr-x to 755. For now, it knows nothing of
@ -65,7 +60,7 @@ symperms (const char *s)
{
perms <<= 3;
perms += (((s[0] == 'r') << 2) + ((s[1] == 'w') << 1) +
(s[2] == 'x' || s[2] == 's'));
(s[2] == 'x' || s[2] == 's'));
}
return perms;
}
@ -105,12 +100,12 @@ ftp_parse_unix_ls (const char *file, int ignore_perms)
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
int next, len, i, error, ignore;
int year, month, day; /* for time analysis */
int year, month, day; /* for time analysis */
int hour, min, sec;
struct tm timestruct, *tnow;
time_t timenow;
char *line, *tok, *ptok; /* tokenizer */
char *line, *tok, *ptok; /* tokenizer */
struct fileinfo *dir, *l, cur; /* list creation */
fp = fopen (file, "rb");
@ -127,273 +122,270 @@ ftp_parse_unix_ls (const char *file, int ignore_perms)
len = clean_line (line);
/* Skip if total... */
if (!strncasecmp (line, "total", 5))
{
xfree (line);
continue;
}
{
xfree (line);
continue;
}
/* Get the first token (permissions). */
tok = strtok (line, " ");
if (!tok)
{
xfree (line);
continue;
}
{
xfree (line);
continue;
}
cur.name = NULL;
cur.linkto = NULL;
/* Decide whether we deal with a file or a directory. */
switch (*tok)
{
case '-':
cur.type = FT_PLAINFILE;
DEBUGP (("PLAINFILE; "));
break;
case 'd':
cur.type = FT_DIRECTORY;
DEBUGP (("DIRECTORY; "));
break;
case 'l':
cur.type = FT_SYMLINK;
DEBUGP (("SYMLINK; "));
break;
default:
cur.type = FT_UNKNOWN;
DEBUGP (("UNKNOWN; "));
break;
}
{
case '-':
cur.type = FT_PLAINFILE;
DEBUGP (("PLAINFILE; "));
break;
case 'd':
cur.type = FT_DIRECTORY;
DEBUGP (("DIRECTORY; "));
break;
case 'l':
cur.type = FT_SYMLINK;
DEBUGP (("SYMLINK; "));
break;
default:
cur.type = FT_UNKNOWN;
DEBUGP (("UNKNOWN; "));
break;
}
if (ignore_perms)
{
switch (cur.type)
{
case FT_PLAINFILE:
cur.perms = 0644;
break;
case FT_DIRECTORY:
cur.perms = 0755;
break;
default:
/*cur.perms = 1023;*/ /* #### What is this? --hniksic */
cur.perms = 0644;
}
DEBUGP (("implicit perms %0o; ", cur.perms));
}
{
switch (cur.type)
{
case FT_PLAINFILE:
cur.perms = 0644;
break;
case FT_DIRECTORY:
cur.perms = 0755;
break;
default:
/*cur.perms = 1023;*/ /* #### What is this? --hniksic */
cur.perms = 0644;
}
DEBUGP (("implicit perms %0o; ", cur.perms));
}
else
{
cur.perms = symperms (tok + 1);
DEBUGP (("perms %0o; ", cur.perms));
}
cur.perms = symperms (tok + 1);
DEBUGP (("perms %0o; ", cur.perms));
}
error = ignore = 0; /* Erroneous and ignoring entries are
treated equally for now. */
treated equally for now. */
year = hour = min = sec = 0; /* Silence the compiler. */
month = day = 0;
next = -1;
/* While there are tokens on the line, parse them. Next is the
number of tokens left until the filename.
number of tokens left until the filename.
Use the month-name token as the "anchor" (the place where the
position wrt the file name is "known"). When a month name is
encountered, `next' is set to 5. Also, the preceding
characters are parsed to get the file size.
Use the month-name token as the "anchor" (the place where the
position wrt the file name is "known"). When a month name is
encountered, `next' is set to 5. Also, the preceding
characters are parsed to get the file size.
This tactic is quite dubious when it comes to
internationalization issues (non-English month names), but it
works for now. */
ptok = line;
This tactic is quite dubious when it comes to
internationalization issues (non-English month names), but it
works for now. */
tok = line;
while (ptok = tok,
(tok = strtok (NULL, " ")) != NULL)
{
--next;
if (next < 0) /* a month name was not encountered */
{
for (i = 0; i < 12; i++)
if (!strcmp (tok, months[i]))
break;
/* If we got a month, it means the token before it is the
size, and the filename is three tokens away. */
if (i != 12)
{
wgint size;
(tok = strtok (NULL, " ")) != NULL)
{
--next;
if (next < 0) /* a month name was not encountered */
{
for (i = 0; i < 12; i++)
if (!strcmp (tok, months[i]))
break;
/* If we got a month, it means the token before it is the
size, and the filename is three tokens away. */
if (i != 12)
{
wgint size;
/* Back up to the beginning of the previous token
and parse it with str_to_wgint. */
char *t = ptok;
while (t > line && ISDIGIT (*t))
--t;
if (t == line)
{
/* Something has gone wrong during parsing. */
error = 1;
break;
}
errno = 0;
size = str_to_wgint (t, NULL, 10);
if (size == WGINT_MAX && errno == ERANGE)
/* Out of range -- ignore the size. #### Should
we refuse to start the download. */
cur.size = 0;
else
cur.size = size;
/* Parse the previous token with str_to_wgint. */
if (ptok == line)
{
/* Something has gone wrong during parsing. */
error = 1;
break;
}
errno = 0;
size = str_to_wgint (ptok, NULL, 10);
if (size == WGINT_MAX && errno == ERANGE)
/* Out of range -- ignore the size. #### Should
we refuse to start the download. */
cur.size = 0;
else
cur.size = size;
DEBUGP (("size: %s; ", number_to_static_string(cur.size)));
month = i;
next = 5;
DEBUGP (("month: %s; ", months[month]));
}
}
else if (next == 4) /* days */
{
if (tok[1]) /* two-digit... */
day = 10 * (*tok - '0') + tok[1] - '0';
else /* ...or one-digit */
day = *tok - '0';
DEBUGP (("day: %d; ", day));
}
else if (next == 3)
{
/* This ought to be either the time, or the year. Let's
be flexible!
month = i;
next = 5;
DEBUGP (("month: %s; ", months[month]));
}
}
else if (next == 4) /* days */
{
if (tok[1]) /* two-digit... */
day = 10 * (*tok - '0') + tok[1] - '0';
else /* ...or one-digit */
day = *tok - '0';
DEBUGP (("day: %d; ", day));
}
else if (next == 3)
{
/* This ought to be either the time, or the year. Let's
be flexible!
If we have a number x, it's a year. If we have x:y,
it's hours and minutes. If we have x:y:z, z are
seconds. */
year = 0;
min = hour = sec = 0;
/* We must deal with digits. */
if (ISDIGIT (*tok))
{
/* Suppose it's year. */
for (; ISDIGIT (*tok); tok++)
year = (*tok - '0') + 10 * year;
if (*tok == ':')
{
/* This means these were hours! */
hour = year;
year = 0;
++tok;
/* Get the minutes... */
for (; ISDIGIT (*tok); tok++)
min = (*tok - '0') + 10 * min;
if (*tok == ':')
{
/* ...and the seconds. */
++tok;
for (; ISDIGIT (*tok); tok++)
sec = (*tok - '0') + 10 * sec;
}
}
}
if (year)
DEBUGP (("year: %d (no tm); ", year));
else
DEBUGP (("time: %02d:%02d:%02d (no yr); ", hour, min, sec));
}
else if (next == 2) /* The file name */
{
int fnlen;
char *p;
If we have a number x, it's a year. If we have x:y,
it's hours and minutes. If we have x:y:z, z are
seconds. */
year = 0;
min = hour = sec = 0;
/* We must deal with digits. */
if (ISDIGIT (*tok))
{
/* Suppose it's year. */
for (; ISDIGIT (*tok); tok++)
year = (*tok - '0') + 10 * year;
if (*tok == ':')
{
/* This means these were hours! */
hour = year;
year = 0;
++tok;
/* Get the minutes... */
for (; ISDIGIT (*tok); tok++)
min = (*tok - '0') + 10 * min;
if (*tok == ':')
{
/* ...and the seconds. */
++tok;
for (; ISDIGIT (*tok); tok++)
sec = (*tok - '0') + 10 * sec;
}
}
}
if (year)
DEBUGP (("year: %d (no tm); ", year));
else
DEBUGP (("time: %02d:%02d:%02d (no yr); ", hour, min, sec));
}
else if (next == 2) /* The file name */
{
int fnlen;
char *p;
/* Since the file name may contain a SPC, it is possible
for strtok to handle it wrong. */
fnlen = strlen (tok);
if (fnlen < len - (tok - line))
{
/* So we have a SPC in the file name. Restore the
original. */
tok[fnlen] = ' ';
/* If the file is a symbolic link, it should have a
` -> ' somewhere. */
if (cur.type == FT_SYMLINK)
{
p = strstr (tok, " -> ");
if (!p)
{
error = 1;
break;
}
cur.linkto = xstrdup (p + 4);
DEBUGP (("link to: %s\n", cur.linkto));
/* And separate it from the file name. */
*p = '\0';
}
}
/* If we have the filename, add it to the list of files or
directories. */
/* "." and ".." are an exception! */
if (!strcmp (tok, ".") || !strcmp (tok, ".."))
{
DEBUGP (("\nIgnoring `.' and `..'; "));
ignore = 1;
break;
}
/* Some FTP sites choose to have ls -F as their default
LIST output, which marks the symlinks with a trailing
`@', directory names with a trailing `/' and
executables with a trailing `*'. This is no problem
unless encountering a symbolic link ending with `@',
or an executable ending with `*' on a server without
default -F output. I believe these cases are very
rare. */
fnlen = strlen (tok); /* re-calculate `fnlen' */
cur.name = (char *)xmalloc (fnlen + 1);
memcpy (cur.name, tok, fnlen + 1);
if (fnlen)
{
if (cur.type == FT_DIRECTORY && cur.name[fnlen - 1] == '/')
{
cur.name[fnlen - 1] = '\0';
DEBUGP (("trailing `/' on dir.\n"));
}
else if (cur.type == FT_SYMLINK && cur.name[fnlen - 1] == '@')
{
cur.name[fnlen - 1] = '\0';
DEBUGP (("trailing `@' on link.\n"));
}
else if (cur.type == FT_PLAINFILE
&& (cur.perms & 0111)
&& cur.name[fnlen - 1] == '*')
{
cur.name[fnlen - 1] = '\0';
DEBUGP (("trailing `*' on exec.\n"));
}
} /* if (fnlen) */
else
error = 1;
break;
}
else
abort ();
} /* while */
/* Since the file name may contain a SPC, it is possible
for strtok to handle it wrong. */
fnlen = strlen (tok);
if (fnlen < len - (tok - line))
{
/* So we have a SPC in the file name. Restore the
original. */
tok[fnlen] = ' ';
/* If the file is a symbolic link, it should have a
` -> ' somewhere. */
if (cur.type == FT_SYMLINK)
{
p = strstr (tok, " -> ");
if (!p)
{
error = 1;
break;
}
cur.linkto = xstrdup (p + 4);
DEBUGP (("link to: %s\n", cur.linkto));
/* And separate it from the file name. */
*p = '\0';
}
}
/* If we have the filename, add it to the list of files or
directories. */
/* "." and ".." are an exception! */
if (!strcmp (tok, ".") || !strcmp (tok, ".."))
{
DEBUGP (("\nIgnoring `.' and `..'; "));
ignore = 1;
break;
}
/* Some FTP sites choose to have ls -F as their default
LIST output, which marks the symlinks with a trailing
`@', directory names with a trailing `/' and
executables with a trailing `*'. This is no problem
unless encountering a symbolic link ending with `@',
or an executable ending with `*' on a server without
default -F output. I believe these cases are very
rare. */
fnlen = strlen (tok); /* re-calculate `fnlen' */
cur.name = xmalloc (fnlen + 1);
memcpy (cur.name, tok, fnlen + 1);
if (fnlen)
{
if (cur.type == FT_DIRECTORY && cur.name[fnlen - 1] == '/')
{
cur.name[fnlen - 1] = '\0';
DEBUGP (("trailing `/' on dir.\n"));
}
else if (cur.type == FT_SYMLINK && cur.name[fnlen - 1] == '@')
{
cur.name[fnlen - 1] = '\0';
DEBUGP (("trailing `@' on link.\n"));
}
else if (cur.type == FT_PLAINFILE
&& (cur.perms & 0111)
&& cur.name[fnlen - 1] == '*')
{
cur.name[fnlen - 1] = '\0';
DEBUGP (("trailing `*' on exec.\n"));
}
} /* if (fnlen) */
else
error = 1;
break;
}
else
abort ();
} /* while */
if (!cur.name || (cur.type == FT_SYMLINK && !cur.linkto))
error = 1;
error = 1;
DEBUGP (("\n"));
DEBUGP (("%s\n", cur.name ? cur.name : ""));
if (error || ignore)
{
DEBUGP (("Skipping.\n"));
xfree_null (cur.name);
xfree_null (cur.linkto);
xfree (line);
continue;
}
{
DEBUGP (("Skipping.\n"));
xfree_null (cur.name);
xfree_null (cur.linkto);
xfree (line);
continue;
}
if (!dir)
{
l = dir = xnew (struct fileinfo);
memcpy (l, &cur, sizeof (cur));
l->prev = l->next = NULL;
}
{
l = dir = xnew (struct fileinfo);
memcpy (l, &cur, sizeof (cur));
l->prev = l->next = NULL;
}
else
{
cur.prev = l;
l->next = xnew (struct fileinfo);
l = l->next;
memcpy (l, &cur, sizeof (cur));
l->next = NULL;
}
{
cur.prev = l;
l->next = xnew (struct fileinfo);
l = l->next;
memcpy (l, &cur, sizeof (cur));
l->next = NULL;
}
/* Get the current time. */
timenow = time (NULL);
tnow = localtime (&timenow);
@ -404,21 +396,21 @@ ftp_parse_unix_ls (const char *file, int ignore_perms)
timestruct.tm_mday = day;
timestruct.tm_mon = month;
if (year == 0)
{
/* Some listings will not specify the year if it is "obvious"
that the file was from the previous year. E.g. if today
is 97-01-12, and you see a file of Dec 15th, its year is
1996, not 1997. Thanks to Vladimir Volovich for
mentioning this! */
if (month > tnow->tm_mon)
timestruct.tm_year = tnow->tm_year - 1;
else
timestruct.tm_year = tnow->tm_year;
}
{
/* Some listings will not specify the year if it is "obvious"
that the file was from the previous year. E.g. if today
is 97-01-12, and you see a file of Dec 15th, its year is
1996, not 1997. Thanks to Vladimir Volovich for
mentioning this! */
if (month > tnow->tm_mon)
timestruct.tm_year = tnow->tm_year - 1;
else
timestruct.tm_year = tnow->tm_year;
}
else
timestruct.tm_year = year;
timestruct.tm_year = year;
if (timestruct.tm_year >= 1900)
timestruct.tm_year -= 1900;
timestruct.tm_year -= 1900;
timestruct.tm_wday = 0;
timestruct.tm_yday = 0;
timestruct.tm_isdst = -1;
@ -468,7 +460,7 @@ ftp_parse_winnt_ls (const char *file)
DEBUGP(("Name: '%s'\n", cur.name));
/* First column: mm-dd-yy. Should atoi() on the month fail, january
will be assumed. */
will be assumed. */
tok = strtok(line, "-");
if (tok == NULL) continue;
month = atoi(tok) - 1;
@ -522,43 +514,43 @@ ftp_parse_winnt_ls (const char *file)
while ((tok != NULL) && (*tok == '\0')) tok = strtok(NULL, " ");
if (tok == NULL) continue;
if (*tok == '<')
{
cur.type = FT_DIRECTORY;
cur.size = 0;
cur.perms = 0755;
DEBUGP(("Directory\n"));
}
{
cur.type = FT_DIRECTORY;
cur.size = 0;
cur.perms = 0755;
DEBUGP(("Directory\n"));
}
else
{
wgint size;
cur.type = FT_PLAINFILE;
errno = 0;
size = str_to_wgint (tok, NULL, 10);
if (size == WGINT_MAX && errno == ERANGE)
cur.size = 0; /* overflow */
else
cur.size = size;
cur.perms = 0644;
DEBUGP(("File, size %s bytes\n", number_to_static_string (cur.size)));
}
{
wgint size;
cur.type = FT_PLAINFILE;
errno = 0;
size = str_to_wgint (tok, NULL, 10);
if (size == WGINT_MAX && errno == ERANGE)
cur.size = 0; /* overflow */
else
cur.size = size;
cur.perms = 0644;
DEBUGP(("File, size %s bytes\n", number_to_static_string (cur.size)));
}
cur.linkto = NULL;
/* And put everything into the linked list */
if (!dir)
{
l = dir = xnew (struct fileinfo);
memcpy (l, &cur, sizeof (cur));
l->prev = l->next = NULL;
}
{
l = dir = xnew (struct fileinfo);
memcpy (l, &cur, sizeof (cur));
l->prev = l->next = NULL;
}
else
{
cur.prev = l;
l->next = xnew (struct fileinfo);
l = l->next;
memcpy (l, &cur, sizeof (cur));
l->next = NULL;
}
{
cur.prev = l;
l->next = xnew (struct fileinfo);
l = l->next;
memcpy (l, &cur, sizeof (cur));
l->next = NULL;
}
xfree (line);
}
@ -605,7 +597,7 @@ ftp_parse_vms_ls (const char *file)
int hour, min, sec;
struct tm timestruct;
char *line, *tok; /* tokenizer */
char *line, *tok; /* tokenizer */
struct fileinfo *dir, *l, cur; /* list creation */
fp = fopen (file, "rb");
@ -634,10 +626,10 @@ ftp_parse_vms_ls (const char *file)
char *p;
i = clean_line (line);
if (!i)
{
xfree (line);
break;
}
{
xfree (line);
break;
}
/* First column: Name. A bit of black magic again. The name my be
either ABCD.EXT or ABCD.EXT;NUM and it might be on a separate
@ -650,7 +642,8 @@ ftp_parse_vms_ls (const char *file)
tok = strtok(line, " ");
if (tok == NULL) tok = line;
DEBUGP(("file name: '%s'\n", tok));
for (p = tok ; *p && *p != ';' ; p++);
for (p = tok ; *p && *p != ';' ; p++)
;
if (*p == ';') *p = '\0';
p = tok + strlen(tok) - 4;
if (!strcmp(p, ".DIR")) *p = '\0';
@ -694,7 +687,7 @@ ftp_parse_vms_ls (const char *file)
if (!i)
{
DEBUGP(("confusing VMS listing item, leaving listing parser\n"));
xfree (line);
xfree (line);
break;
}
tok = strtok(line, " ");
@ -715,7 +708,7 @@ ftp_parse_vms_ls (const char *file)
the first strtok(NULL, "-") will return everything until the end
of the line and only the next strtok() call will return NULL. */
DEBUGP(("nonsense in VMS listing, skipping this line\n"));
xfree (line);
xfree (line);
break;
}
for (i=0; i<12; i++) if (!strcmp(tok,months[i])) break;
@ -732,12 +725,14 @@ ftp_parse_vms_ls (const char *file)
min = sec = 0;
p = tok;
hour = atoi (p);
for (; *p && *p != ':'; ++p);
for (; *p && *p != ':'; ++p)
;
if (*p)
min = atoi (++p);
for (; *p && *p != ':'; ++p);
min = atoi (++p);
for (; *p && *p != ':'; ++p)
;
if (*p)
sec = atoi (++p);
sec = atoi (++p);
DEBUGP(("YYYY/MM/DD HH:MM:SS - %d/%02d/%02d %02d:%02d:%02d\n",
year+1900, month, day, hour, min, sec));
@ -769,7 +764,7 @@ ftp_parse_vms_ls (const char *file)
if (tok == NULL)
{
DEBUGP(("confusing VMS permissions, skipping line\n"));
xfree (line);
xfree (line);
continue;
}
/* Permissons have the format "RWED,RWED,RE" */
@ -781,14 +776,14 @@ ftp_parse_vms_ls (const char *file)
/* And put everything into the linked list */
if (!dir)
{
l = dir = (struct fileinfo *)xmalloc (sizeof (struct fileinfo));
l = dir = xnew (struct fileinfo);
memcpy (l, &cur, sizeof (cur));
l->prev = l->next = NULL;
}
else
{
cur.prev = l;
l->next = (struct fileinfo *)xmalloc (sizeof (struct fileinfo));
l->next = xnew (struct fileinfo);
l = l->next;
memcpy (l, &cur, sizeof (cur));
l->next = NULL;
@ -817,21 +812,21 @@ ftp_parse_ls (const char *file, const enum stype system_type)
return ftp_parse_unix_ls (file, 0);
case ST_WINNT:
{
/* Detect whether the listing is simulating the UNIX format */
FILE *fp;
int c;
fp = fopen (file, "rb");
if (!fp)
{
logprintf (LOG_NOTQUIET, "%s: %s\n", file, strerror (errno));
return NULL;
/* Detect whether the listing is simulating the UNIX format */
FILE *fp;
int c;
fp = fopen (file, "rb");
if (!fp)
{
logprintf (LOG_NOTQUIET, "%s: %s\n", file, strerror (errno));
return NULL;
}
c = fgetc(fp);
fclose(fp);
/* If the first character of the file is '0'-'9', it's WINNT
format. */
if (c >= '0' && c <='9')
return ftp_parse_winnt_ls (file);
c = fgetc(fp);
fclose(fp);
/* If the first character of the file is '0'-'9', it's WINNT
format. */
if (c >= '0' && c <='9')
return ftp_parse_winnt_ls (file);
else
return ftp_parse_unix_ls (file, 1);
}
@ -856,16 +851,16 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
{
FILE *fp;
char *upwd;
char *htclfile; /* HTML-clean file name */
char *htclfile; /* HTML-clean file name */
if (!output_stream)
{
fp = fopen (file, "wb");
if (!fp)
{
logprintf (LOG_NOTQUIET, "%s: %s\n", file, strerror (errno));
return FOPENERR;
}
{
logprintf (LOG_NOTQUIET, "%s: %s\n", file, strerror (errno));
return FOPENERR;
}
}
else
fp = output_stream;
@ -876,9 +871,9 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
tmpu = url_escape (u->user);
tmpp = u->passwd ? url_escape (u->passwd) : NULL;
if (tmpp)
upwd = concat_strings (tmpu, ":", tmpp, "@", (char *) 0);
upwd = concat_strings (tmpu, ":", tmpp, "@", (char *) 0);
else
upwd = concat_strings (tmpu, "@", (char *) 0);
upwd = concat_strings (tmpu, "@", (char *) 0);
xfree (tmpu);
xfree_null (tmpp);
}
@ -894,57 +889,58 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
{
fprintf (fp, " ");
if (f->tstamp != -1)
{
/* #### Should we translate the months? Or, even better, use
ISO 8601 dates? */
static const char *months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
struct tm *ptm = localtime ((time_t *)&f->tstamp);
{
/* #### Should we translate the months? Or, even better, use
ISO 8601 dates? */
static const char *months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
time_t tstamp = f->tstamp;
struct tm *ptm = localtime (&tstamp);
fprintf (fp, "%d %s %02d ", ptm->tm_year + 1900, months[ptm->tm_mon],
ptm->tm_mday);
if (ptm->tm_hour)
fprintf (fp, "%02d:%02d ", ptm->tm_hour, ptm->tm_min);
else
fprintf (fp, " ");
}
fprintf (fp, "%d %s %02d ", ptm->tm_year + 1900, months[ptm->tm_mon],
ptm->tm_mday);
if (ptm->tm_hour)
fprintf (fp, "%02d:%02d ", ptm->tm_hour, ptm->tm_min);
else
fprintf (fp, " ");
}
else
fprintf (fp, _("time unknown "));
fprintf (fp, _("time unknown "));
switch (f->type)
{
case FT_PLAINFILE:
fprintf (fp, _("File "));
break;
case FT_DIRECTORY:
fprintf (fp, _("Directory "));
break;
case FT_SYMLINK:
fprintf (fp, _("Link "));
break;
default:
fprintf (fp, _("Not sure "));
break;
}
{
case FT_PLAINFILE:
fprintf (fp, _("File "));
break;
case FT_DIRECTORY:
fprintf (fp, _("Directory "));
break;
case FT_SYMLINK:
fprintf (fp, _("Link "));
break;
default:
fprintf (fp, _("Not sure "));
break;
}
htclfile = html_quote_string (f->name);
fprintf (fp, "<a href=\"ftp://%s%s:%d", upwd, u->host, u->port);
if (*u->dir != '/')
putc ('/', fp);
putc ('/', fp);
fprintf (fp, "%s", u->dir);
if (*u->dir)
putc ('/', fp);
putc ('/', fp);
fprintf (fp, "%s", htclfile);
if (f->type == FT_DIRECTORY)
putc ('/', fp);
putc ('/', fp);
fprintf (fp, "\">%s", htclfile);
if (f->type == FT_DIRECTORY)
putc ('/', fp);
putc ('/', fp);
fprintf (fp, "</a> ");
if (f->type == FT_PLAINFILE)
fprintf (fp, _(" (%s bytes)"), with_thousand_seps (f->size));
fprintf (fp, _(" (%s bytes)"), number_to_static_string (f->size));
else if (f->type == FT_SYMLINK)
fprintf (fp, "-> %s", f->linkto ? f->linkto : "(nil)");
fprintf (fp, "-> %s", f->linkto ? f->linkto : "(nil)");
putc ('\n', fp);
xfree (htclfile);
f = f->next;

View File

@ -1,11 +1,12 @@
/* Opie (s/key) support for FTP.
Copyright (C) 1998 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008 Free Software Foundation, Inc.
This file is part of GNU Wget.
GNU Wget 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 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
GNU Wget is distributed in the hope that it will be useful,
@ -14,28 +15,24 @@ 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 Wget; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with Wget. If not, see <http://www.gnu.org/licenses/>.
In addition, as a special exception, the Free Software Foundation
gives permission to link the code of its release of Wget with the
OpenSSL project's "OpenSSL" library (or with modified versions of it
that use the same license as the "OpenSSL" library), and distribute
the linked executables. You must obey the GNU General Public License
in all respects for all of the code used other than "OpenSSL". If you
modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
Additional permission under GNU GPL version 3 section 7
If you modify this program, or any covered work, by linking or
combining it with the OpenSSL project's OpenSSL library (or a
modified version of that library), containing parts covered by the
terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
grants you additional permission to convey the resulting work.
Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#include <string.h>
#include "wget.h"
#include "gen-md5.h"
@ -2122,8 +2119,8 @@ extract (const unsigned char *s, int start, int length)
static char *
btoe (char *store, const unsigned char *c)
{
unsigned char cp[10]; /* add in room for the parity 2 bits +
extract() slop. */
unsigned char cp[10]; /* add in room for the parity 2 bits +
extract() slop. */
int p, i;
char *store_beg = store;
@ -2159,7 +2156,7 @@ btoe (char *store, const unsigned char *c)
store += STRLEN_1_4 (store);
*store++ = ' ';
memcpy (store, &Wp[extract (cp, 55, 11)][0], 4);
store[4] = '\0'; /* make sure the string is terminated */
store[4] = '\0'; /* make sure the string is terminated */
DEBUGP (("wrote `%s' to STORE\n", store_beg));
return store_beg;

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