Initial import

This commit is contained in:
Tatsuhiro Tsujikawa 2006-02-17 13:35:04 +00:00
commit 52634627bc
101 changed files with 19834 additions and 0 deletions

1
AUTHORS Normal file
View file

@ -0,0 +1 @@
Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

340
COPYING Normal file
View file

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
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
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.
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".
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.
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.
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.
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:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
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.
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.
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.
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:
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,
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,
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 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.
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.
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.
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
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
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.
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.
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
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.
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.
NO WARRANTY
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.
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.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
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.
<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
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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:
Gnomovision version 69, Copyright (C) year 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.
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.
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:
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.

3
ChangeLog Normal file
View file

@ -0,0 +1,3 @@
2006-02-17 Tatsuhiro Tsujikawa <tsujikawa at rednoah dot com>
*Release 0.1.0

182
INSTALL Normal file
View file

@ -0,0 +1,182 @@
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

1
Makefile.am Normal file
View file

@ -0,0 +1 @@
SUBDIRS = src test

582
Makefile.in Normal file
View file

@ -0,0 +1,582 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
TODO config.guess config.sub depcomp install-sh missing \
mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
CPPUNIT_LIBS = @CPPUNIT_LIBS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
SUBDIRS = src test
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
check-am clean clean-generic clean-recursive ctags \
ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
dist-tarZ dist-zip distcheck distclean distclean-generic \
distclean-hdr distclean-recursive distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic maintainer-clean-recursive \
mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

0
NEWS Normal file
View file

27
README Normal file
View file

@ -0,0 +1,27 @@
aria2 - a simple utility for downloading files faster.
1. Disclaimer
-------------
This program comes with no warranty.
You must use this program at your own risk.
2. About aria2
--------------
aria2 has segmented downloading engine in its core. By segmented downloding,
it can download files very much faster than ordinary browsers.
aria2 is in very early development stage. Currently it has following features:
* HTTP GET support
* HTTP Proxy support
* HTTP BASIC authentication support
* HTTP Proxy authentication support
* Segmented download
* Cookie support(currently aria2 ignores "expires")
* It can run as a daemon process.
3. How to build
---------------
$ ./configure
$ make
The executable is aria2c in src directory.

4
TODO Normal file
View file

@ -0,0 +1,4 @@
* Add HTTP POST support
* Add HTTPS support using OpenSSL
* Add expires handling for Cookie
* Add FTP support

931
aclocal.m4 vendored Normal file
View file

@ -0,0 +1,931 @@
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
dnl
dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
AC_DEFUN([AM_PATH_CPPUNIT],
[
AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)],
cppunit_config_prefix="$withval", cppunit_config_prefix="")
AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)],
cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
if test x$cppunit_config_exec_prefix != x ; then
cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
if test x${CPPUNIT_CONFIG+set} != xset ; then
CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
fi
fi
if test x$cppunit_config_prefix != x ; then
cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
if test x${CPPUNIT_CONFIG+set} != xset ; then
CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
fi
fi
AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
cppunit_version_min=$1
AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min)
no_cppunit=""
if test "$CPPUNIT_CONFIG" = "no" ; then
no_cppunit=yes
else
CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
cppunit_version=`$CPPUNIT_CONFIG --version`
cppunit_major_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
cppunit_minor_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
cppunit_micro_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
cppunit_major_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
cppunit_minor_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
cppunit_micro_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
cppunit_version_proper=`expr \
$cppunit_major_version \> $cppunit_major_min \| \
$cppunit_major_version \= $cppunit_major_min \& \
$cppunit_minor_version \> $cppunit_minor_min \| \
$cppunit_major_version \= $cppunit_major_min \& \
$cppunit_minor_version \= $cppunit_minor_min \& \
$cppunit_micro_version \>= $cppunit_micro_min `
if test "$cppunit_version_proper" = "1" ; then
AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
else
AC_MSG_RESULT(no)
no_cppunit=yes
fi
fi
if test "x$no_cppunit" = x ; then
ifelse([$2], , :, [$2])
else
CPPUNIT_CFLAGS=""
CPPUNIT_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(CPPUNIT_CFLAGS)
AC_SUBST(CPPUNIT_LIBS)
])
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.9.6])])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 7
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])
AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 3
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# So let's grep whole file.
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 12
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.58])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
])
])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$1 | $1:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote="\""
_am_result=BSD
fi
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_MKDIR_P
# ---------------
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
#
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
# created by `make install' are always world readable, even if the
# installer happens to have an overly restrictive umask (e.g. 077).
# This was a mistake. There are at least two reasons why we must not
# use `-m 0755':
# - it causes special bits like SGID to be ignored,
# - it may be too restrictive (some setups expect 775 directories).
#
# Do not use -m 0755 and let people choose whatever they expect by
# setting umask.
#
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
# Some implementations (such as Solaris 8's) are not thread-safe: if a
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
# concurrently, both version can detect that a/ is missing, but only
# one can create it and the other will error out. Consequently we
# restrict ourselves to GNU make (using the --version option ensures
# this.)
AC_DEFUN([AM_PROG_MKDIR_P],
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
# We used to keeping the `.' as first argument, in order to
# allow $(mkdir_p) to be used without argument. As in
# $(mkdir_p) $(somedir)
# where $(somedir) is conditionally defined. However this is wrong
# for two reasons:
# 1. if the package is installed by a user who cannot write `.'
# make install will fail,
# 2. the above comment should most certainly read
# $(mkdir_p) $(DESTDIR)$(somedir)
# so it does not work when $(somedir) is undefined and
# $(DESTDIR) is not.
# To support the latter case, we have to write
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
# so the `.' trick is pointless.
mkdir_p='mkdir -p --'
else
# On NextStep and OpenStep, the `mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already
# exists.
for d in ./-p ./--version;
do
test -d $d && rmdir $d
done
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
if test -f "$ac_aux_dir/mkinstalldirs"; then
mkdir_p='$(mkinstalldirs)'
else
mkdir_p='$(install_sh) -d'
fi
fi
AC_SUBST([mkdir_p])])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR

1407
config.guess vendored Executable file

File diff suppressed because it is too large Load diff

141
config.h.in Normal file
View file

@ -0,0 +1,141 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `gethostbyname' function. */
#undef HAVE_GETHOSTBYNAME
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the `mkdir' function. */
#undef HAVE_MKDIR
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the `rmdir' function. */
#undef HAVE_RMDIR
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
/* 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
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* 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
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to the type of arg 1 for `select'. */
#undef SELECT_TYPE_ARG1
/* Define to the type of args 2, 3 and 4 for `select'. */
#undef SELECT_TYPE_ARG234
/* Define to the type of arg 5 for `select'. */
#undef SELECT_TYPE_ARG5
/* 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
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t

1505
config.sub vendored Executable file

File diff suppressed because it is too large Load diff

6755
configure vendored Executable file

File diff suppressed because it is too large Load diff

35
configure.in Normal file
View file

@ -0,0 +1,35 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
AC_PREREQ(2.59)
AC_INIT(aria2c, 0.1.0, tujikawa@rednoah.com)
AM_INIT_AUTOMAKE()
AM_PATH_CPPUNIT(1.10.2)
AC_CONFIG_SRCDIR([src/Socket.h])
AC_CONFIG_HEADERS([config.h])
AC_PROG_RANLIB
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h string.h sys/socket.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([getpagesize gethostbyname gettimeofday memset mkdir rmdir select socket strcasecmp strerror strstr strtol])
AC_CONFIG_FILES([Makefile src/Makefile test/Makefile])
AC_OUTPUT

530
depcomp Executable file
View file

@ -0,0 +1,530 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-07-09.11
# Copyright (C) 1999, 2000, 2003, 2004, 2005 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, 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.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mecanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

251
install-sh Executable file
View file

@ -0,0 +1,251 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

360
missing Executable file
View file

@ -0,0 +1,360 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-06-08.21
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# 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, 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.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

40
mkinstalldirs Executable file
View file

@ -0,0 +1,40 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here

120
src/AbstractCommand.cc Normal file
View file

@ -0,0 +1,120 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "AbstractCommand.h"
#include "DlAbortEx.h"
#include "DlRetryEx.h"
#include "InitiateConnectionCommandFactory.h"
#include <sys/time.h>
#include "Util.h"
#include "message.h"
#define TIMEOUT_SEC 5
AbstractCommand::AbstractCommand(int cuid, Request* req, DownloadEngine* e, Socket* s):
Command(cuid), req(req), e(e), checkSocketIsReadable(false), checkSocketIsWritable(false) {
if(s != NULL) {
socket = new Socket(*s);
e->addSocketForReadCheck(socket);
} else {
socket = NULL;
}
this->checkPoint.tv_sec = 0;
this->checkPoint.tv_usec = 0;
}
AbstractCommand::~AbstractCommand() {
e->deleteSocketForReadCheck(socket);
e->deleteSocketForWriteCheck(socket);
if(socket != NULL) {
delete(socket);
}
}
void AbstractCommand::updateCheckPoint() {
gettimeofday(&checkPoint, NULL);
}
bool AbstractCommand::isTimeoutDetected() {
struct timeval now;
gettimeofday(&now, NULL);
if(checkPoint.tv_sec == 0 && checkPoint.tv_usec == 0) {
return false;
} else {
long long int elapsed = Util::difftv(now, checkPoint);
if(elapsed >= TIMEOUT_SEC*1000000) {
return true;
} else {
return false;
}
}
}
bool AbstractCommand::execute() {
try {
if(checkSocketIsReadable && !socket->isReadable(0)
|| checkSocketIsWritable && !socket->isWritable(0)) {
if(isTimeoutDetected()) {
throw new DlRetryEx(EX_TIME_OUT);
}
updateCheckPoint();
e->commands.push(this);
return false;
}
updateCheckPoint();
Segment seg = { 0, 0, 0, false };
if(e->segmentMan->downloadStarted) {
// get segment information in order to set Range header.
if(!e->segmentMan->getSegment(seg, cuid)) {
// no segment available
e->logger->info(MSG_NO_SEGMENT_AVAILABLE, cuid);
return true;
}
}
return executeInternal(seg);
} catch(DlAbortEx* err) {
e->logger->error(MSG_DOWNLOAD_ABORTED, err);
onError(err);
delete(err);
req->resetUrl();
return true;
} catch(DlRetryEx* err) {
e->logger->error(MSG_RESTARTING_DOWNLOAD, err);
onError(err);
delete(err);
req->resetUrl();
req->addRetryCount();
if(req->noMoreRetry()) {
e->logger->error(MSG_MAX_RETRY);
return true;
} else {
return prepareForRetry();
}
}
}
bool AbstractCommand::prepareForRetry() {
e->commands.push(InitiateConnectionCommandFactory::createInitiateConnectionCommand(cuid, req, e));
return true;
}
void AbstractCommand::onError(Exception* e) {
}

50
src/AbstractCommand.h Normal file
View file

@ -0,0 +1,50 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_ABSTRACT_COMMAND_H_
#define _D_ABSTRACT_COMMAND_H_
#include "Command.h"
#include "Request.h"
#include "DownloadEngine.h"
#include "SegmentMan.h"
class AbstractCommand : public Command {
private:
void updateCheckPoint();
bool isTimeoutDetected();
struct timeval checkPoint;
protected:
Request* req;
DownloadEngine* e;
Socket* socket;
bool checkSocketIsReadable;
bool checkSocketIsWritable;
virtual bool prepareForRetry();
virtual void onError(Exception* e);
virtual bool executeInternal(Segment segment) = 0;
public:
AbstractCommand(int cuid, Request* req, DownloadEngine* e, Socket* s= NULL);
virtual ~AbstractCommand();
bool execute();
};
#endif // _D_ABSTRACT_COMMAND_H_

72
src/AbstractDiskWriter.cc Normal file
View file

@ -0,0 +1,72 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "AbstractDiskWriter.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include "DlAbortEx.h"
#include "File.h"
AbstractDiskWriter::AbstractDiskWriter():fd(0) {}
AbstractDiskWriter::~AbstractDiskWriter() {
if(fd != 0) {
close(fd);
}
}
void AbstractDiskWriter::closeFile() {
if(fd != 0) {
close(fd);
fd = 0;
}
}
void AbstractDiskWriter::openExistingFile(string filename) {
File f(filename);
if(!f.isFile()) {
throw new DlAbortEx(strerror(errno));
}
if((fd = open(filename.c_str(), O_WRONLY, S_IRUSR|S_IWUSR)) < 0) {
throw new DlAbortEx(strerror(errno));
}
}
void AbstractDiskWriter::createFile(string filename, int addFlags) {
// TODO proper filename handling needed
assert(filename.size());
// if(filename.empty()) {
// filename = "index.html";
// }
if((fd = open(filename.c_str(), O_CREAT|O_WRONLY|O_TRUNC|addFlags, S_IRUSR|S_IWUSR)) < 0) {
throw new DlAbortEx(strerror(errno));
}
}
void AbstractDiskWriter::writeDataInternal(const char* data, int len) {
if(write(fd, data, len) < 0) {
throw new DlAbortEx(strerror(errno));
}
}

43
src/AbstractDiskWriter.h Normal file
View file

@ -0,0 +1,43 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_ABSTRACT_DISK_WRITER_H_
#define _D_ABSTRACT_DISK_WRITER_H_
#include "DiskWriter.h"
class AbstractDiskWriter:public DiskWriter {
protected:
int fd;
void createFile(string filename, int addFlags = 0);
void writeDataInternal(const char* data, int len);
public:
AbstractDiskWriter();
virtual ~AbstractDiskWriter();
void closeFile();
void openExistingFile(string filename);
};
#endif // _D_ABSTRACT_DISK_WRITER_H_

126
src/Base64.cc Normal file
View file

@ -0,0 +1,126 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "Base64.h"
string Base64::part_encode(const string& subplain)
{
static char base64_table[64] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', '+', '/',
};
int shift = 2;
char carry = 0;
bool ignore_flag = false;
string crypted;
for(unsigned int index = 0; index < subplain.size(); ++index) {
if(ignore_flag) {
crypted += '=';
} else {
char cur = subplain.at(index) >> shift | carry;
if(subplain.at(index) == 0) ignore_flag = true;
carry = (subplain.at(index) << (6-shift)) & 0x3F;
shift += 2;
crypted += base64_table[(unsigned int)cur];
}
}
if(subplain.at(subplain.size()-1) == 0) {
crypted += '=';
} else {
char cur = subplain.at(subplain.size()-1) & 0x3F;
crypted += base64_table[(unsigned int)cur];
}
return crypted;
}
string Base64::encode(string plain)
{
int remainder = plain.size() % 3;
if( remainder ) remainder = 3-remainder;
for(int i = 0; i < remainder; ++i) plain += (char)0;
string crypted;
int start_pos = 0;
for(unsigned int index = 0; plain.size() > index; index += 3) {
string subplain = plain.substr(start_pos, 3);
string subcrypted = part_encode(subplain);
start_pos += 3;
crypted += subcrypted;
}
return crypted;
}
char Base64::getValue(char ch)
{
char retch;
if(ch >= 'A' && ch <= 'Z') {
retch = ch-'A';
} else if(ch >= 'a' && ch <= 'z') {
retch = ch-'a'+26;
} else if(ch >= '0' && ch <= '9') {
retch = ch-'0'+52;
} else if(ch == '+') {
retch = 62;
} else if(ch == '/') {
retch = 63;
} else {
retch = 0;
}
return retch;
}
string Base64::part_decode(const string& subCrypted)
{
int shift = 2;
string plain;
for(unsigned int index = 0; index < subCrypted.size()-1; ++index) {
if(subCrypted.at(index) == '=') break;
char cur = getValue(subCrypted.at(index)) << shift;
char carry = getValue(subCrypted.at(index+1)) >> (6-shift);
shift += 2;
plain += cur | carry;
}
return plain;
}
string Base64::decode(string crypted)
{
string plain;
int sIndex = 0;
for(int index = 0; crypted.size() > (unsigned int)index; index +=4) {
string subCrypted = crypted.substr(sIndex, 4);
string subPlain = part_decode(subCrypted);
sIndex += 4;
plain += subPlain;
}
return plain;
}

38
src/Base64.h Normal file
View file

@ -0,0 +1,38 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _BASE64_H_
#define _BASE64_H_
#include <string>
using namespace std;
class Base64
{
private:
static string part_encode(const string& subplain);
static string part_decode(const string& subCrypted);
static char getValue(char ch);
public:
static string encode(string plain);
static string decode(string crypted);
};
#endif // _BASE64_H_

173
src/ChunkedEncoding.cc Normal file
View file

@ -0,0 +1,173 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "ChunkedEncoding.h"
#include "DlAbortEx.h"
#include "message.h"
#include <string.h>
#include <errno.h>
#define MAX_BUFSIZE 8192
ChunkedEncoding::ChunkedEncoding() {
strbufSize = 4096;
strbuf = new char[strbufSize];
strbuf[0] = '\0';
state = READ_SIZE;
chunkSize = 0;
}
ChunkedEncoding::~ChunkedEncoding() {
if(strbuf != NULL) {
delete [] strbuf;
}
}
void ChunkedEncoding::init() {
}
bool ChunkedEncoding::finished() {
return state == FINISH ? true : false;
}
void ChunkedEncoding::end() {}
void ChunkedEncoding::inflate(char* outbuf, int& outlen, const char* inbuf, int inlen) {
addBuffer(inbuf, inlen);
char* p = strbuf;
int clen = 0;
while(1) {
if(state == READ_SIZE) {
if(readChunkSize(&p) == 0) {
if(chunkSize == 0) {
state = FINISH;
} else {
state = READ_DATA;
}
} else {
// chunk size is not fully received.
break;
}
} else if(state == READ_DATA) {
if(readData(&p, outbuf, clen, outlen) == 0) {
state = READ_SIZE;
} else {
break;
}
} else {
break;
}
// Was all bytes in strbuf examined?
if(strbuf+strlen(strbuf) <= p) {
break;
}
}
if(strbuf+strlen(strbuf) <= p) {
// make strbuf NULL-string
strbuf[0] = '\0';
} else {
// copy string between [p, strbuf+strlen(strbuf)+1], +1 is for NULL
// character.
char* temp = new char[strbufSize];
memcpy(temp, p, strbuf+strlen(strbuf)-p+1);
delete [] strbuf;
strbuf = temp;
}
outlen = clen;
}
int ChunkedEncoding::readData(char** pp, char* buf, int& len, int maxlen) {
if(buf+len == buf+maxlen) {
return -1;
}
if(chunkSize == 0) {
return readDataEOL(pp);
}
int wsize;
if(strlen(*pp) < (unsigned long int)chunkSize) {
wsize = strlen(*pp) <= (unsigned int)maxlen-len ? strlen(*pp) : maxlen-len;
} else {
wsize = chunkSize <= maxlen-len ? chunkSize : maxlen-len;
}
memcpy(buf+len, *pp, wsize);
chunkSize -= wsize;
len += wsize;
*pp += wsize;
if(chunkSize == 0) {
return readDataEOL(pp);
} else {
return -1;
}
}
int ChunkedEncoding::readDataEOL(char** pp) {
if(strstr(*pp, "\r\n") == *pp) {
*pp += 2;
return 0;
} else if(strlen(*pp) < 2) {
return -1;
} else {
throw new DlAbortEx(EX_INVALID_CHUNK_SIZE);
}
}
// strbuf is NULL terminated string, and inlen is strlen(strbuf).
// therefore, strbuf[inlen] = '\0'
int ChunkedEncoding::readChunkSize(char** pp) {
// we read chunk-size from *pp
char* p = strstr(*pp, "\r\n");
// \r\n is not found. Return -1
if(p == NULL) {
return -1;
}
// We ignore chunk-extension
char* exsp = index(*pp, ';');
if(exsp == NULL) {
exsp = p;
}
// TODO check invalid characters in buffer
chunkSize = strtol(*pp, NULL, 16);
if(chunkSize < 0) {
throw new DlAbortEx(EX_INVALID_CHUNK_SIZE);
} else if(errno == ERANGE && (chunkSize == LONG_MAX || chunkSize == LONG_MIN)) {
throw new DlAbortEx(strerror(errno));
}
*pp = p+2;
return 0;
}
void ChunkedEncoding::addBuffer(const char* inbuf, int inlen) {
if(strlen(strbuf)+inlen >= (unsigned int)strbufSize) {
if(strlen(strbuf)+inlen+1 > MAX_BUFSIZE) {
throw new DlAbortEx(EX_TOO_LARGE_CHUNK, strlen(strbuf)+inlen+1);
}
char* temp = new char[strlen(strbuf)+inlen+1];
memcpy(temp, strbuf, strlen(strbuf)+1);
delete [] strbuf;
strbuf = temp;
strbufSize = strlen(strbuf);
}
int origlen = strlen(strbuf);
memcpy(strbuf+origlen, inbuf, inlen);
strbuf[origlen+inlen] = '\0';
}

56
src/ChunkedEncoding.h Normal file
View file

@ -0,0 +1,56 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_CHUNKED_ENCODING_H_
#define _D_CHUNKED_ENCODING_H_
#include "TransferEncoding.h"
#include "common.h"
class ChunkedEncoding:public TransferEncoding {
private:
enum STATE {
READ_SIZE,
READ_DATA,
FINISH
};
long int chunkSize;
int state;
char* strbuf;
int strbufSize;
int readChunkSize(char** pp);
int readData(char** pp, char* buf, int& len, int maxlen);
void addBuffer(const char* inbuf, int inlen);
int readDataEOL(char** pp);
public:
ChunkedEncoding();
~ChunkedEncoding();
void init();
void inflate(char* outbuf, int& outlen, const char* inbuf, int inlen);
bool finished();
void end();
};
#endif // _D_CHUNKED_ENCODING_H_

36
src/Command.h Normal file
View file

@ -0,0 +1,36 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_COMMAND_H_
#define _D_COMMAND_H_
class Command {
protected:
int cuid;
public:
Command(int cuid):cuid(cuid) {}
virtual ~Command() {}
virtual bool execute() = 0;
int getCuid() const { return cuid; }
};
#endif // _D_COMMAND_H_

33
src/ConnectionException.h Normal file
View file

@ -0,0 +1,33 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_CONNECTION_EXCEPTION_H_
#define _D_CONNECTION_EXCEPTION_H_
#include "DlAbortEx.h"
class ConnectionException:public DlAbortEx {
public:
ConnectionException():DlAbortEx() {}
ConnectionException(string msg):DlAbortEx() {}
};
#endif // _D_CONNECTION_EXCEPTION_H_

81
src/CookieBox.cc Normal file
View file

@ -0,0 +1,81 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "CookieBox.h"
#include "Util.h"
CookieBox::CookieBox() {}
CookieBox::~CookieBox() {}
void CookieBox::add(const Cookie& cookie) {
cookies.push_back(cookie);
}
void CookieBox::add(string cookieStr) {
Cookie c;
parse(c, cookieStr);
cookies.push_back(c);
}
void CookieBox::setField(Cookie& cookie, string name, string value) const {
if(name.size() == string("secure").size() &&
strcasecmp(name.c_str(), "secure") == 0) {
cookie.secure = true;
} else if(name.size() == string("domain").size() && strcasecmp(name.c_str(), "domain") == 0) {
cookie.domain = value;
} else if(name.size() == string("path").size() && strcasecmp(name.c_str(), "path") == 0) {
cookie.path = value;
} else if(name.size() == string("expires").size() && strcasecmp(name.c_str(), "expires") == 0) {
cookie.expires = value;
} else {
cookie.name = name;
cookie.value = value;
}
}
void CookieBox::parse(Cookie& cookie, string cookieStr) const {
cookie.clear();
vector<string> terms;
Util::slice(terms, cookieStr, ';');
for(vector<string>::iterator itr = terms.begin(); itr != terms.end(); itr++) {
pair<string, string> nv;
Util::split(nv, *itr, '=');
setField(cookie, nv.first, nv.second);
}
}
vector<Cookie> CookieBox::criteriaFind(string host, string dir, bool secure) const {
vector<Cookie> result;
for(vector<Cookie>::const_iterator itr = cookies.begin(); itr != cookies.end(); itr++) {
const Cookie& c = *itr;
if((secure || !c.secure && !secure) &&
c.domain.size() <= host.size() &&
c.path.size() <= dir.size() &&
c.domain.compare(0, c.domain.size(), host, host.size()-c.domain.size(), c.domain.size()) == 0 &&
c.path.compare(0, c.path.size(), dir, 0, c.path.size()) == 0) {
// TODO we currently ignore expire date.
result.push_back(c);
}
}
return result;
}

65
src/CookieBox.h Normal file
View file

@ -0,0 +1,65 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_COOKIE_BOX_H_
#define _D_COOKIE_BOX_H_
#include <string>
#include <vector>
using namespace std;
class Cookie {
public:
string name;
string value;
string expires;
string path;
string domain;
bool secure;
public:
Cookie(string name, string value, string expires, string path, string domain, bool secure):name(name), value(value), expires(expires), path(path), domain(domain), secure(secure) {}
Cookie():secure(false) {}
~Cookie() {}
string toString() const {
return name+"="+value;
}
void clear() {
name = value = expires = path = domain = "";
secure = false;
}
};
class CookieBox {
private:
vector<Cookie> cookies;
void setField(Cookie& cookie, string name, string value) const;
public:
CookieBox();
~CookieBox();
void clear();
void add(const Cookie& cookie);
void add(string cookieStr);
void parse(Cookie& cookie, string cookieStr) const;
vector<Cookie> criteriaFind(string host, string dir, bool secure) const;
};
#endif // _D_COOKIE_BOX_H_

39
src/DefaultDiskWriter.cc Normal file
View file

@ -0,0 +1,39 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "DefaultDiskWriter.h"
#include "DlAbortEx.h"
#include <errno.h>
DefaultDiskWriter::DefaultDiskWriter():AbstractDiskWriter() {}
DefaultDiskWriter::~DefaultDiskWriter() {}
void DefaultDiskWriter::initAndOpenFile(string filename) {
createFile(filename);
}
void DefaultDiskWriter::writeData(const char* data, int len, long long int offset) {
if(offset != lseek(fd, offset, SEEK_SET)) {
throw new DlAbortEx(strerror(errno));
}
writeDataInternal(data, len);
}

37
src/DefaultDiskWriter.h Normal file
View file

@ -0,0 +1,37 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_DEFAULT_DISK_WRITER_H_
#define _D_DEFAULT_DISK_WRITER_H_
#include "AbstractDiskWriter.h"
class DefaultDiskWriter:public AbstractDiskWriter {
public:
DefaultDiskWriter();
~DefaultDiskWriter();
void initAndOpenFile(string filename);
void writeData(const char* data, int len, long long int position);
};
#endif // _D_DEFAULT_DISK_WRITER_H_

68
src/DiskWriter.h Normal file
View file

@ -0,0 +1,68 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_DISK_WRITER_H_
#define _D_DISK_WRITER_H_
#include <string>
using namespace std;
/**
* Interface for writing to a binary stream of bytes.
*
*/
class DiskWriter {
public:
virtual ~DiskWriter() {}
/**
* Creates a file output stream to write to the file with the specified name.
* If the file exists, then it is truncated to 0 length.
* @param filename the file name to be opened.
*/
virtual void initAndOpenFile(string filename) = 0;
/**
* Closes this output stream.
*/
virtual void closeFile() = 0;
/**
* Opens a file output stream to write to the file with the specified name.
* If the file doesnot exists, an exception may be throwed.
*
* @param filename the file name to be opened.
*/
virtual void openExistingFile(string filename) = 0;
/*
* Writes len bytes from data to this binary stream at offset position.
* In case where offset position is not concerned(just write data
* sequencially, for example), those subclasses can ignore the offset value.
*
* @param data the data
* @param len the number of bytes to write
* @param position the offset of this binary stream
*/
virtual void writeData(const char* data, int len, long long int position = 0) = 0;
};
#endif // _D_DISK_WRITER_H_

37
src/DlAbortEx.h Normal file
View file

@ -0,0 +1,37 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_DL_ABORT_EX_H_
#define _D_DL_ABORT_EX_H_
#include "Exception.h"
class DlAbortEx:public Exception {
public:
DlAbortEx():Exception() {}
DlAbortEx(string msg, ...):Exception() {
va_list ap;
va_start(ap, msg);
setMsg(msg, ap);
va_end(ap);
}
};
#endif // _D_DL_ABORT_EX_H_

37
src/DlRetryEx.h Normal file
View file

@ -0,0 +1,37 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_DL_RETRY_EX_H_
#define _D_DL_RETRY_EX_H_
#include "Exception.h"
class DlRetryEx:public Exception {
public:
DlRetryEx():Exception() {}
DlRetryEx(string msg, ...):Exception() {
va_list ap;
va_start(ap, msg);
setMsg(msg, ap);
va_end(ap);
}
};
#endif // _D_DL_RETRY_EX_H_

89
src/DownloadCommand.cc Normal file
View file

@ -0,0 +1,89 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "DownloadCommand.h"
#include <sys/time.h>
#include "Util.h"
#include "DlRetryEx.h"
#include "HttpInitiateConnectionCommand.h"
#include "SleepCommand.h"
#include "InitiateConnectionCommandFactory.h"
#include "message.h"
DownloadCommand::DownloadCommand(int cuid, Request* req, DownloadEngine* e, Socket* s):AbstractCommand(cuid, req, e, s) {
AbstractCommand::checkSocketIsReadable = true;
}
DownloadCommand::~DownloadCommand() {}
bool DownloadCommand::executeInternal(Segment seg) {
TransferEncoding* te = NULL;
if(transferEncoding.size()) {
te = getTransferEncoding(transferEncoding);
assert(te != NULL);
}
int bufSize = 4096;
char buf[bufSize];
socket->readData(buf, bufSize);
if(te != NULL) {
int infbufSize = 4096;
char infbuf[infbufSize];
te->inflate(infbuf, infbufSize, buf, bufSize);
e->diskWriter->writeData(infbuf, infbufSize, seg.sp+seg.ds);
} else {
e->diskWriter->writeData(buf, bufSize, seg.sp+seg.ds);
}
seg.ds += bufSize;
if(te != NULL && te->finished()
|| te == NULL && seg.ds >= seg.ep-seg.sp+1
|| e->segmentMan->totalSize == 0 && bufSize == 0) {
if(te != NULL) te->end();
e->logger->info(MSG_DOWNLOAD_COMPLETED, cuid);
seg.ds = seg.ep-seg.sp+1;
seg.finish = true;
e->segmentMan->updateSegment(seg);
// this unit is going to download another segment.
return prepareForNextSegment();
} else {
e->segmentMan->updateSegment(seg);
e->commands.push(this);
return false;
}
}
bool DownloadCommand::prepareForRetry() {
req->resetUrl();
Command* command = InitiateConnectionCommandFactory::createInitiateConnectionCommand(cuid, req, e);
SleepCommand* scom = new SleepCommand(cuid, e, command);
e->commands.push(scom);
return true;
}
bool DownloadCommand::prepareForNextSegment() {
req->resetUrl();
if(!e->segmentMan->finished()) {
return AbstractCommand::prepareForRetry();
} else {
return true;
}
}

48
src/DownloadCommand.h Normal file
View file

@ -0,0 +1,48 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_DOWNLOAD_COMMAND_H_
#define _D_DOWNLOAD_COMMAND_H_
#include "AbstractCommand.h"
#include "TransferEncoding.h"
#include <string>
using namespace std;
class DownloadCommand : public AbstractCommand {
protected:
bool executeInternal(Segment segment);
bool prepareForRetry();
bool prepareForNextSegment();
public:
DownloadCommand(int cuid, Request* req, DownloadEngine* e, Socket* s);
virtual ~DownloadCommand();
virtual TransferEncoding* getTransferEncoding(string transferEncoding) = 0;
string transferEncoding;
};
#endif // _D_DOWNLOAD_COMMAND_H_

163
src/DownloadEngine.cc Normal file
View file

@ -0,0 +1,163 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "DownloadEngine.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "DlAbortEx.h"
#include "Util.h"
using namespace std;
DownloadEngine::DownloadEngine():noWait(false) {}
DownloadEngine::~DownloadEngine() {
assert(rsockets.empty());
assert(wsockets.empty());
}
void DownloadEngine::run() {
struct timeval cp = { 0, 0 };
int speed = 0;
long long int psize = 0;
while(!commands.empty()) {
int max = commands.size();
for(int i = 0; i < max; i++) {
Command* com = commands.front();
commands.pop();
if(com->execute()) {
delete(com);
}
}
if(!noWait && !commands.empty()) {
waitData();
long long int dlSize = segmentMan->getDownloadedSize();
struct timeval now;
gettimeofday(&now, NULL);
if(cp.tv_sec == 0 && cp.tv_usec == 0) {
cp = now;
psize = dlSize;
} else {
long long int elapsed = Util::difftv(now, cp);
if(elapsed >= 500000) {
int nspeed = (int)((dlSize-psize)/(elapsed/1000000.0));
speed = (nspeed+speed)/2;
cp = now;
psize = dlSize;
cout << "\r ";
cout << "\rProgress " << Util::llitos(dlSize, true) << " Bytes/" <<
Util::llitos(segmentMan->totalSize, true) << " Bytes " <<
(segmentMan->totalSize == 0 ? 0 : (dlSize*100)/segmentMan->totalSize) << "% " <<
speed/1000.0 << "KB/s " <<
"(" << commands.size() << " connections)" << flush;
}
}
}
noWait = false;
}
segmentMan->removeIfFinished();
diskWriter->closeFile();
if(segmentMan->finished()) {
cout << "\nThe download was complete. <" << segmentMan->getFilePath() << ">" << endl;
} else {
cout << "\nThe download was not complete because of errors. Check the log." << endl;
}
}
// void DownloadEngine::shortSleep() {
// int wait = rpm == 0 ? 0 : 4096*1000/rpm;
// struct timeval tv;
// int retval;
// tv.tv_sec = 0;
// tv.tv_usec = wait*1000;
// retval = select(0, NULL, NULL, NULL, &tv);
// }
void DownloadEngine::waitData() {
fd_set rfds;
fd_set wfds;
struct timeval tv;
int retval;
FD_ZERO(&rfds);
FD_ZERO(&wfds);
int max = 0;
for(vector<Socket*>::iterator itr = rsockets.begin(); itr != rsockets.end(); itr++) {
FD_SET((*itr)->sockfd, &rfds);
if(max < (*itr)->sockfd) {
max = (*itr)->sockfd;
}
}
for(vector<Socket*>::iterator itr = wsockets.begin(); itr != wsockets.end(); itr++) {
FD_SET((*itr)->sockfd, &wfds);
if(max < (*itr)->sockfd) {
max = (*itr)->sockfd;
}
}
tv.tv_sec = 1;
tv.tv_usec = 0;
retval = select(max+1, &rfds, &wfds, NULL, &tv);
}
bool DownloadEngine::addSocket(vector<Socket*>& sockets, Socket* socket) {
vector<Socket*>::iterator itr = find(sockets.begin(),
sockets.end(),
socket);
if(itr == sockets.end()) {
sockets.push_back(socket);
return true;
} else {
return false;
}
}
bool DownloadEngine::deleteSocket(vector<Socket*>& sockets, Socket* socket) {
vector<Socket*>::iterator itr = find(sockets.begin(),
sockets.end(),
socket);
if(itr != sockets.end()) {
sockets.erase(itr);
return true;
} else {
return false;
}
}
bool DownloadEngine::addSocketForReadCheck(Socket* socket) {
return addSocket(rsockets, socket);
}
bool DownloadEngine::deleteSocketForReadCheck(Socket* socket) {
return deleteSocket(rsockets , socket);
}
bool DownloadEngine::addSocketForWriteCheck(Socket* socket) {
return addSocket(wsockets, socket);
}
bool DownloadEngine::deleteSocketForWriteCheck(Socket* socket) {
return deleteSocket(wsockets, socket);
}

66
src/DownloadEngine.h Normal file
View file

@ -0,0 +1,66 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_DOWNLOAD_ENGINE_H_
#define _D_DOWNLOAD_ENGINE_H_
#include <queue>
#include <vector>
#include "Command.h"
#include "Socket.h"
#include "SegmentMan.h"
#include "common.h"
#include "Logger.h"
#include "DiskWriter.h"
#include "Option.h"
using namespace std;
class DownloadEngine {
private:
void waitData();
vector<Socket*> rsockets;
vector<Socket*> wsockets;
bool addSocket(vector<Socket*>& sockets, Socket* socket);
bool deleteSocket(vector<Socket*>& sockets, Socket* socket);
public:
bool noWait;
queue<Command*> commands;
SegmentMan* segmentMan;
DiskWriter* diskWriter;
Logger* logger;
Option* option;
DownloadEngine();
~DownloadEngine();
void run();
bool addSocketForReadCheck(Socket* socket);
bool deleteSocketForReadCheck(Socket* socket);
bool addSocketForWriteCheck(Socket* socket);
bool deleteSocketForWriteCheck(Socket* socket);
};
#endif // _D_DOWNLOAD_ENGINE_H_

33
src/DownloadMethod.h Normal file
View file

@ -0,0 +1,33 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_DOWNLOAD_METHOD_H_
#define _D_DOWNLOAD_METHOD_H_
#include "Request.h"
class DownloadMethod {
public:
virtual void sendRequest(Request& request) = 0;
virtual void getDataFragment(char* buffer, int len) = 0;
};
#endif // _D_DOWNLOAD_METHOD_H_

48
src/Exception.h Normal file
View file

@ -0,0 +1,48 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_EXCEPTION_H_
#define _D_EXCEPTION_H_
#include <string>
#include <stdarg.h>
using namespace std;
class Exception {
private:
string msg;
protected:
void setMsg(string msgsrc, ...) {
va_list ap;
va_start(ap, msgsrc);
char buf[256];
vsnprintf(buf, sizeof(buf), msgsrc.c_str(), ap);
msg = buf;
va_end(ap);
}
public:
Exception() {}
virtual ~Exception() {}
string getMsg() { return msg; }
};
#endif // _D_EXCEPTION_H_

64
src/File.cc Normal file
View file

@ -0,0 +1,64 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "File.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
File::File(string name):name(name) {}
File::~File() {}
int File::fillStat(struct stat& fstat) {
return stat(name.c_str(), &fstat);
}
bool File::exists() {
struct stat fstat;
return fillStat(fstat) == 0;
}
bool File::isFile() {
struct stat fstat;
if(fillStat(fstat) < 0) {
return false;
}
return S_ISREG(fstat.st_mode) == 1;
}
bool File::isDir() {
struct stat fstat;
if(fillStat(fstat) < 0) {
return false;
}
return S_ISDIR(fstat.st_mode) == 1;
}
bool File::remove() {
if(isFile()) {
return unlink(name.c_str()) == 0;
} else if(isDir()) {
return rmdir(name.c_str()) == 0;
} else {
return false;
}
}

62
src/File.h Normal file
View file

@ -0,0 +1,62 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_FILE_H_
#define _D_FILE_H_
#include <string>
using namespace std;
/**
* Represents file and directory
*/
class File {
private:
string name;
int fillStat(struct stat& fstat);
public:
File(string name);
~File();
/**
* Tests whether the file or directory denoted by name exists.
*/
bool exists();
/**
* Tests whether the file denoted by name is a regular file.
*/
bool isFile();
/**
* Tests whether the file denoted by name is a directory.
*/
bool isDir();
/**
* Deletes the file or directory denoted by name.
* If name denotes a directory, it must be empty in order to delete.
*/
bool remove();
};
#endif // _D_FILE_H_

156
src/HttpConnection.cc Normal file
View file

@ -0,0 +1,156 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "HttpConnection.h"
#include "DlAbortEx.h"
#include "DlRetryEx.h"
#include "Util.h"
#include "Base64.h"
#include "message.h"
HttpConnection::HttpConnection(int cuid, Socket* socket, const Option* op, Logger* logger):cuid(cuid), socket(socket),option(op),logger(logger) {}
void HttpConnection::sendRequest(const Request* req, const Segment& segment) {
string request = createRequest(req, segment);
logger->info(MSG_SENDING_HTTP_REQUEST, cuid, request.c_str());
socket->writeData(request.c_str(), request.size());
}
void HttpConnection::sendProxyRequest(const Request* req) {
string request = string("CONNECT ")+req->getHost()+":"+Util::llitos(req->getPort())+
string(" HTTP/1.1\r\n")+
"Host: "+getHost(req->getHost(), req->getPort())+"\r\n";
if(useProxyAuth()) {
request += "Proxy-Authorization: Basic "+
Base64::encode(option->get("http_proxy_user")+":"+option->get("http_proxy_passwd"))+"\r\n";
}
request += "\r\n";
logger->info(MSG_SENDING_HTTP_REQUEST, cuid, request.c_str());
socket->writeData(request.c_str(), request.size());
}
string HttpConnection::getHost(const string& host, int port) {
return host+(port == 80 ? "" : ":"+Util::llitos(port));
}
string HttpConnection::createRequest(const Request* req, const Segment& segment) {
string request = string("GET ")+req->getCurrentUrl()+string(" HTTP/1.1\r\n")+
"Referer:\r\n"+
"User-Agent: aria2\r\n"+
"Connection: close\r\n"+
"Accept: */*\r\n"+
"Host: "+getHost(req->getHost(), req->getPort())+"\r\n"+
"Pragma: no-cache\r\n"+
"Cache-Control: no-cache\r\n";
if(segment.sp+segment.ds > 0) {
request += "Range: bytes="+Util::llitos(segment.sp+segment.ds)+"-"+Util::llitos(segment.ep)+"\r\n";
}
if(option->get("http_auth_scheme") == "BASIC") {
request += "Authorization: Basic "+
Base64::encode(option->get("http_user")+":"+option->get("http_passwd"))+"\r\n";
}
string cookiesValue;
vector<Cookie> cookies = req->cookieBox->criteriaFind(req->getHost(), req->getDir(), req->getProtocol() == "https" ? true : false);
for(vector<Cookie>::const_iterator itr = cookies.begin(); itr != cookies.end(); itr++) {
cookiesValue += (*itr).toString()+";";
}
if(cookiesValue.size()) {
request += string("Cookie: ")+cookiesValue+"\r\n";
}
request += "\r\n";
return request;
}
int HttpConnection::receiveResponse(HttpHeader& headers) {
string header;
char* buf = NULL;
try {
// read a line of the header
int bufSize = 256;
// TODO limit iteration count
while(1) {
bufSize += 256;
if(bufSize > 2048) {
throw new DlAbortEx(EX_INVALID_HEADER);
}
buf = new char[bufSize];
int tbufSize = bufSize-1;
socket->peekData(buf, tbufSize);
if(tbufSize > 0) {
buf[tbufSize] = '\0';
}
header = buf;
char* p;
if((p = strstr(buf, "\r\n")) == buf) {
throw new DlAbortEx(EX_NO_HEADER);
}
if((p = strstr(buf, "\r\n\r\n")) != NULL) {
*(p+4) = '\0';
header = buf;
tbufSize = header.size();
socket->readData(buf, tbufSize);
delete [] buf;
buf = NULL;
break;
} else {
delete [] buf;
buf = NULL;
}
}
} catch(Exception* e) {
if(buf != NULL) {
delete [] buf;
}
throw;
}
// OK, i got all headers.
logger->info(MSG_RECEIVE_RESPONSE, cuid, header.c_str());
unsigned int p, np;
p = np = 0;
np = header.find("\r\n", p);
if(np == string::npos) {
throw new DlRetryEx(EX_NO_STATUS_HEADER);
}
// check HTTP status value
string status = header.substr(9, 3);
p = np+2;
// retreive status name-value pairs, then push these into map
while((np = header.find("\r\n", p)) != string::npos && np != p) {
string line = header.substr(p, np-p);
p = np+2;
pair<string, string> hp;
Util::split(hp, line, ':');
HttpHeader::value_type nh(hp.first, hp.second);
headers.insert(nh);
}
// TODO rewrite this using strtoul
return (int)strtol(status.c_str(), NULL, 10);
}
bool HttpConnection::useProxy() {
return option->defined("http_proxy_enabled") &&
option->get("http_proxy_enabled") == "true";
}
bool HttpConnection::useProxyAuth() {
return option->defined("http_proxy_auth_enabled") &&
option->get("http_proxy_auth_enabled") == "true";
}

57
src/HttpConnection.h Normal file
View file

@ -0,0 +1,57 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_HTTP_CONNECTION_H_
#define _D_HTTP_CONNECTION_H_
#include "SegmentMan.h"
#include "Socket.h"
#include "Request.h"
#include "Option.h"
#include "Logger.h"
#include <map>
#include <string>
using namespace std;
typedef multimap<string, string> HttpHeader;
class HttpConnection {
private:
string getHost(const string& host, int port);
string createRequest(const Request* req, const Segment& segment);
bool useProxy();
bool useProxyAuth();
bool useBasicAuth();
int cuid;
Socket* socket;
const Option* option;
Logger* logger;
public:
HttpConnection(int cuid, Socket* socket, const Option* op, Logger* logger);
void sendRequest(const Request* req, const Segment& segment);
void sendProxyRequest(const Request* req);
int receiveResponse(HttpHeader& headers);
};
#endif // _D_HTTP_CONNECTION_H_

View file

@ -0,0 +1,52 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "HttpDownloadCommand.h"
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
#include "DlRetryEx.h"
#include "HttpRequestCommand.h"
#include "SleepCommand.h"
#include "Util.h"
#include "ChunkedEncoding.h"
using namespace std;
HttpDownloadCommand::HttpDownloadCommand(int cuid, Request* req,
DownloadEngine* e,
Socket* socket):
DownloadCommand(cuid, req, e, socket)
{
ChunkedEncoding* ce = new ChunkedEncoding();
transferEncodings["chunked"] = ce;
}
HttpDownloadCommand::~HttpDownloadCommand() {
for(map<string, TransferEncoding*>::iterator itr = transferEncodings.begin(); itr != transferEncodings.end(); itr++) {
delete((*itr).second);
}
}
TransferEncoding* HttpDownloadCommand::getTransferEncoding(string name) {
return transferEncodings[name];
}

51
src/HttpDownloadCommand.h Normal file
View file

@ -0,0 +1,51 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_HTTP_DOWNLOAD_COMMAND_H_
#define _D_HTTP_DOWNLOAD_COMMAND_H_
#include "DownloadCommand.h"
#include "DownloadEngine.h"
#include "Socket.h"
#include "Request.h"
#include "common.h"
#include "TransferEncoding.h"
#include <string>
#include <map>
using namespace std;
class HttpDownloadCommand:public DownloadCommand {
private:
map<string, TransferEncoding*> transferEncodings;
public:
int cuid;
HttpDownloadCommand(int cuid, Request* req, DownloadEngine* e, Socket* s);
~HttpDownloadCommand();
TransferEncoding* getTransferEncoding(string transferEncoding);
};
#endif // _D_HTTP_DOWNLOAD_COMMAND_H_

View file

@ -0,0 +1,57 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "HttpInitiateConnectionCommand.h"
#include "HttpRequestCommand.h"
#include "HttpProxyRequestCommand.h"
#include "Util.h"
#include "message.h"
HttpInitiateConnectionCommand::HttpInitiateConnectionCommand(int cuid, Request* req, DownloadEngine* e):AbstractCommand(cuid, req, e) {}
HttpInitiateConnectionCommand::~HttpInitiateConnectionCommand() {}
bool HttpInitiateConnectionCommand::executeInternal(Segment segment) {
socket = new Socket();
// socket->establishConnection(...);
Command* command;
if(useProxy()) {
e->logger->info(MSG_CONNECTING_TO_SERVER, cuid,
e->option->get("http_proxy_host").c_str(),
e->option->getAsInt("http_proxy_port"));
socket->establishConnection(e->option->get("http_proxy_host"),
e->option->getAsInt("http_proxy_port"));
command = new HttpProxyRequestCommand(cuid, req, e, socket);
} else {
e->logger->info(MSG_CONNECTING_TO_SERVER, cuid, req->getHost().c_str(),
req->getPort());
socket->establishConnection(req->getHost(), req->getPort());
command = new HttpRequestCommand(cuid, req, e, socket);
}
e->commands.push(command);
return true;
}
bool HttpInitiateConnectionCommand::useProxy() {
return e->option->defined("http_proxy_enabled") &&
e->option->get("http_proxy_enabled") == "true";
}

View file

@ -0,0 +1,47 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_HTTP_INITIATE_CONNECTION_COMMAND_H_
#define _D_HTTP_INITIATE_CONNECTION_COMMAND_H_
#include "AbstractCommand.h"
class HttpInitiateConnectionCommand : public AbstractCommand {
private:
bool useProxy();
protected:
/**
* Connect to the server.
* This method just send connection request to the server.
* Using nonblocking mode of socket, this funtion returns immediately
* after send connection packet to the server.
* Whether or not the connection is established successfully is
* evaluated by RequestCommand.
*/
bool executeInternal(Segment segment);
public:
HttpInitiateConnectionCommand(int cuid, Request* req, DownloadEngine* e);
~HttpInitiateConnectionCommand();
};
#endif // _D_HTTP_INITIATE_CONNECTION_COMMAND_H_

View file

@ -0,0 +1,42 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "HttpProxyRequestCommand.h"
#include "HttpConnection.h"
#include "HttpProxyResponseCommand.h"
HttpProxyRequestCommand::HttpProxyRequestCommand(int cuid, Request* req, DownloadEngine* e, Socket* s):AbstractCommand(cuid, req, e, s) {
AbstractCommand::checkSocketIsWritable = true;
e->deleteSocketForReadCheck(socket);
e->addSocketForWriteCheck(socket);
}
HttpProxyRequestCommand::~HttpProxyRequestCommand() {}
bool HttpProxyRequestCommand::executeInternal(Segment segment) {
socket->setNonBlockingMode();
HttpConnection httpConnection(cuid, socket, e->option, e->logger);
httpConnection.sendProxyRequest(req);
HttpProxyResponseCommand* command = new HttpProxyResponseCommand(cuid, req, e, socket);
e->commands.push(command);
return true;
}

View file

@ -0,0 +1,35 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_HTTP_PROXY_REQUEST_COMMAND_H_
#define _D_HTTP_PROXY_REQUEST_COMMAND_H_
#include "AbstractCommand.h"
class HttpProxyRequestCommand : public AbstractCommand {
protected:
bool executeInternal(Segment segment);
public:
HttpProxyRequestCommand(int cuid, Request* req, DownloadEngine* e, Socket* s);
~HttpProxyRequestCommand();
};
#endif // _D_HTTP_PROXY_REQUEST_COMMAND_H_

View file

@ -0,0 +1,45 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "HttpProxyResponseCommand.h"
#include "HttpRequestCommand.h"
#include "DlRetryEx.h"
#include "HttpConnection.h"
#include "message.h"
HttpProxyResponseCommand::HttpProxyResponseCommand(int cuid, Request* req, DownloadEngine* e, Socket* s):AbstractCommand(cuid, req, e, s) {
AbstractCommand::checkSocketIsReadable = true;
}
HttpProxyResponseCommand::~HttpProxyResponseCommand() {}
bool HttpProxyResponseCommand::executeInternal(Segment segment) {
HttpHeader headers;
HttpConnection httpConnection(cuid, socket, e->option, e->logger);
int status = httpConnection.receiveResponse(headers);
if(status != 200) {
throw new DlRetryEx(EX_PROXY_CONNECTION_FAILED);
}
HttpRequestCommand* command = new HttpRequestCommand(cuid, req, e, socket);
e->commands.push(command);
return true;
}

View file

@ -0,0 +1,35 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_HTTP_PROXY_RESPONSE_COMMAND_H_
#define _D_HTTP_PROXY_RESPONSE_COMMAND_H_
#include "AbstractCommand.h"
class HttpProxyResponseCommand : public AbstractCommand {
protected:
bool executeInternal(Segment segment);
public:
HttpProxyResponseCommand(int cuid, Request* req, DownloadEngine* e, Socket* s);
~HttpProxyResponseCommand();
};
#endif // _D_HTTP_PROXY_RESPONSE_COMMAND_H_

47
src/HttpRequestCommand.cc Normal file
View file

@ -0,0 +1,47 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "HttpRequestCommand.h"
#include "HttpResponseCommand.h"
#include "HttpInitiateConnectionCommand.h"
#include "Socket.h"
#include "Util.h"
#include "HttpConnection.h"
HttpRequestCommand::HttpRequestCommand(int cuid, Request* req, DownloadEngine* e, Socket* s):AbstractCommand(cuid, req, e, s) {
AbstractCommand::checkSocketIsWritable = true;
e->deleteSocketForReadCheck(socket);
e->addSocketForWriteCheck(socket);
}
HttpRequestCommand::~HttpRequestCommand() {}
bool HttpRequestCommand::executeInternal(Segment seg) {
socket->setNonBlockingMode();
HttpConnection httpConnection(cuid, socket, e->option, e->logger);
// set seg to request in order to remember the request range
req->seg = seg;
httpConnection.sendRequest(req, seg);
HttpResponseCommand* command = new HttpResponseCommand(cuid, req, e, socket);
e->commands.push(command);
return true;
}

36
src/HttpRequestCommand.h Normal file
View file

@ -0,0 +1,36 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_HTTP_REQUEST_COMMAND_H_
#define _D_HTTP_REQUEST_COMMAND_H_
#include "AbstractCommand.h"
class HttpRequestCommand:public AbstractCommand {
protected:
bool executeInternal(Segment segment);
public:
HttpRequestCommand(int cuid, Request* req, DownloadEngine* e, Socket* s);
~HttpRequestCommand();
};
#endif // _D_HTTP_REQUEST_COMMAND_H_

148
src/HttpResponseCommand.cc Normal file
View file

@ -0,0 +1,148 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "HttpResponseCommand.h"
#include "DlAbortEx.h"
#include "HttpDownloadCommand.h"
#include "HttpInitiateConnectionCommand.h"
#include "message.h"
#include "Util.h"
HttpResponseCommand::HttpResponseCommand(int cuid, Request* req, DownloadEngine* e, Socket* s):
AbstractCommand(cuid, req, e, s) {
AbstractCommand::checkSocketIsReadable = true;
}
HttpResponseCommand::~HttpResponseCommand() {}
bool HttpResponseCommand::executeInternal(Segment seg) {
if(SEGMENT_EQUAL(req->seg, seg) == false) {
e->logger->info(MSG_SEGMENT_CHANGED, cuid);
return prepareForRetry();
}
HttpHeader headers;
HttpConnection httpConnection(cuid, socket, e->option, e->logger);
int status = httpConnection.receiveResponse(headers);
// check HTTP status number
checkResponse(status, seg);
retrieveCookie(headers);
// check whether Location header exists. If it does, update request object
// with redirected URL.
// then establish a connection to the new host and port
if(headers.count("Location")) {
return handleRedirect((*headers.find("Location")).second, headers);
}
if(!e->segmentMan->downloadStarted) {
string transferEncoding;
headers.find("Transfer-Encoding");
if(headers.count("Transfer-Encoding")) {
return handleOtherEncoding((*headers.find("Transfer-Encoding")).second, headers);
} else {
return handleDefaultEncoding(headers);
}
} else {
if(req->getFile() != e->segmentMan->filename) {
throw new DlAbortEx(EX_FILENAME_MISMATCH, req->getFile().c_str(), e->segmentMan->filename.c_str());
}
createHttpDownloadCommand();
return true;
}
}
void HttpResponseCommand::checkResponse(int status, const Segment& segment) {
if(!(status < 400 && status >= 300 ||
(segment.sp+segment.ds == 0 && status == 200)
|| (segment.sp+segment.ds > 0 && status == 206))) {
throw new DlAbortEx(EX_BAD_STATUS, status);
}
}
bool HttpResponseCommand::handleRedirect(string url, const HttpHeader& headers) {
req->redirectUrl(url);
e->logger->info(MSG_REDIRECT, cuid, url.c_str());
e->noWait = true;
return prepareForRetry();
}
bool HttpResponseCommand::handleDefaultEncoding(const HttpHeader& headers) {
long long int size;
if(headers.count("Content-Length") == 0) {
size = 0;
} else {
size = STRTOLL((*headers.find("Content-Length")).second.c_str());
if(size == LONG_LONG_MAX || size == LONG_LONG_MIN) {
throw new DlAbortEx(EX_TOO_LARGE_FILE, size);
}
}
e->segmentMan->isSplittable = !(size == 0);
e->segmentMan->filename = req->getFile();
e->segmentMan->totalSize = size;
bool segFileExists = e->segmentMan->segmentFileExists();
e->segmentMan->downloadStarted = true;
if(segFileExists) {
e->segmentMan->load();
e->diskWriter->openExistingFile(e->segmentMan->getFilePath());
// send request again to the server with Range header
return prepareForRetry();
} else {
Segment seg;
e->segmentMan->getSegment(seg, cuid);
e->diskWriter->initAndOpenFile(e->segmentMan->getFilePath());
createHttpDownloadCommand();
return true;
}
}
bool HttpResponseCommand::handleOtherEncoding(string transferEncoding, const HttpHeader& headers) {
// we ignore content-length when transfer-encoding is set
e->segmentMan->downloadStarted = true;
e->segmentMan->isSplittable = false;
e->segmentMan->filename = req->getFile();
e->segmentMan->totalSize = 0;
Segment seg;
e->segmentMan->getSegment(seg, cuid);
e->diskWriter->initAndOpenFile(e->segmentMan->getFilePath());
createHttpDownloadCommand(transferEncoding);
return true;
}
void HttpResponseCommand::createHttpDownloadCommand(string transferEncoding) {
HttpDownloadCommand* command = new HttpDownloadCommand(cuid, req, e, socket);
TransferEncoding* enc = NULL;
if(transferEncoding.size() && (enc = command->getTransferEncoding(transferEncoding)) == NULL) {
delete(command);
throw new DlAbortEx(EX_TRANSFER_ENCODING_NOT_SUPPORTED, transferEncoding.c_str());
} else {
if(enc != NULL) {
enc->init();
}
e->commands.push(command);
}
}
void HttpResponseCommand::retrieveCookie(const HttpHeader& headers) {
for(HttpHeader::const_iterator itr = headers.find("Set-Cookie"); itr != headers.end(); itr++) {
Cookie c;
req->cookieBox->parse(c, (*itr).second);
req->cookieBox->add(c);
}
}

43
src/HttpResponseCommand.h Normal file
View file

@ -0,0 +1,43 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_HTTP_RESPONSE_COMMAND_H_
#define _D_HTTP_RESPONSE_COMMAND_H_
#include "AbstractCommand.h"
#include "HttpConnection.h"
class HttpResponseCommand : public AbstractCommand {
private:
void checkResponse(int status, const Segment& segment);
bool handleRedirect(string url, const HttpHeader& headers);
bool handleDefaultEncoding(const HttpHeader& headers);
bool handleOtherEncoding(string transferEncoding, const HttpHeader& headers);
void createHttpDownloadCommand(string transferEncoding = "");
void retrieveCookie(const HttpHeader& headers);
protected:
bool executeInternal(Segment segment);
public:
HttpResponseCommand(int cuid, Request* req, DownloadEngine* e, Socket* s);
~HttpResponseCommand();
};
#endif // _D_HTTP_RESPONSE_COMMAND_H_

View file

@ -0,0 +1,32 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "InitiateConnectionCommandFactory.h"
#include "HttpInitiateConnectionCommand.h"
Command* InitiateConnectionCommandFactory::createInitiateConnectionCommand(int cuid, Request* req, DownloadEngine* e) {
if(req->getProtocol() == "http") {
return new HttpInitiateConnectionCommand(cuid, req, e);
} else {
// these protocols are not supported yet
return NULL;
}
}

View file

@ -0,0 +1,33 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_INITIATE_CONNECTION_COMMAND_FACTORY_H_
#define _D_INITIATE_CONNECTION_COMMAND_FACTORY_H_
#include "Request.h"
#include "DownloadEngine.h"
class InitiateConnectionCommandFactory {
public:
static Command* createInitiateConnectionCommand(int cuid, Request* req, DownloadEngine* e);
};
#endif // _D_INITIATE_CONNECTION_COMMAND_FACTORY_H_

40
src/Logger.h Normal file
View file

@ -0,0 +1,40 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_LOGGER_H_
#define _D_LOGGER_H_
#include <string>
#include "Exception.h"
using namespace std;
class Logger {
public:
virtual ~Logger() {}
virtual void debug(string msg, ...) = 0;
virtual void debug(string msg, Exception* ex, ...) = 0;
virtual void info(string msg, ...) = 0;
virtual void info(string msg, Exception* ex, ...) = 0;
virtual void error(string msg, ...) = 0;
virtual void error(string msg, Exception* ex, ...) = 0;
};
#endif // _D_LOGGER_H_

42
src/Makefile.am Normal file
View file

@ -0,0 +1,42 @@
bin_PROGRAMS = aria2c
aria2c_SOURCES = main.cc
SRCS = Socket.cc Socket.h\
Command.h\
AbstractCommand.cc AbstractCommand.h\
InitiateConnectionCommandFactory.cc InitiateConnectionCommandFactory.h\
DownloadCommand.cc DownloadCommand.h\
HttpInitiateConnectionCommand.cc HttpInitiateConnectionCommand.h\
HttpRequestCommand.cc HttpRequestCommand.h\
HttpResponseCommand.cc HttpResponseCommand.h\
HttpProxyRequestCommand.cc HttpProxyRequestCommand.h\
HttpProxyResponseCommand.cc HttpProxyResponseCommand.h\
HttpDownloadCommand.cc HttpDownloadCommand.h\
HttpConnection.cc HttpConnection.h\
SleepCommand.cc SleepCommand.h\
DownloadEngine.cc DownloadEngine.h\
Segment.h\
SegmentMan.cc SegmentMan.h\
Util.cc Util.h\
Request.cc Request.h\
common.h\
message.h\
Exception.h\
DlAbortEx.h\
DlRetryEx.h\
Logger.h\
SimpleLogger.cc SimpleLogger.h\
TransferEncoding.h\
ChunkedEncoding.cc ChunkedEncoding.h\
DiskWriter.h\
DefaultDiskWriter.cc DefaultDiskWriter.h\
AbstractDiskWriter.cc AbstractDiskWriter.h\
File.cc File.h\
Option.cc Option.h\
Base64.cc Base64.h\
CookieBox.cc CookieBox.h
noinst_LIBRARIES = libaria2c.a
libaria2c_a_SOURCES = $(SRCS)
aria2c_LDADD = libaria2c.a
FLAGS = -Wall -D_FILE_OFFSET_BITS=64
libaria2c_a_CXXFLAGS = $(FLAGS)
aria2c_CXXFLAGS = $(FLAGS)

857
src/Makefile.in Normal file
View file

@ -0,0 +1,857 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = aria2c$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
AR = ar
ARFLAGS = cru
libaria2c_a_AR = $(AR) $(ARFLAGS)
libaria2c_a_LIBADD =
am__objects_1 = libaria2c_a-Socket.$(OBJEXT) \
libaria2c_a-AbstractCommand.$(OBJEXT) \
libaria2c_a-InitiateConnectionCommandFactory.$(OBJEXT) \
libaria2c_a-DownloadCommand.$(OBJEXT) \
libaria2c_a-HttpInitiateConnectionCommand.$(OBJEXT) \
libaria2c_a-HttpRequestCommand.$(OBJEXT) \
libaria2c_a-HttpResponseCommand.$(OBJEXT) \
libaria2c_a-HttpProxyRequestCommand.$(OBJEXT) \
libaria2c_a-HttpProxyResponseCommand.$(OBJEXT) \
libaria2c_a-HttpDownloadCommand.$(OBJEXT) \
libaria2c_a-HttpConnection.$(OBJEXT) \
libaria2c_a-SleepCommand.$(OBJEXT) \
libaria2c_a-DownloadEngine.$(OBJEXT) \
libaria2c_a-SegmentMan.$(OBJEXT) libaria2c_a-Util.$(OBJEXT) \
libaria2c_a-Request.$(OBJEXT) \
libaria2c_a-SimpleLogger.$(OBJEXT) \
libaria2c_a-ChunkedEncoding.$(OBJEXT) \
libaria2c_a-DefaultDiskWriter.$(OBJEXT) \
libaria2c_a-AbstractDiskWriter.$(OBJEXT) \
libaria2c_a-File.$(OBJEXT) libaria2c_a-Option.$(OBJEXT) \
libaria2c_a-Base64.$(OBJEXT) libaria2c_a-CookieBox.$(OBJEXT)
am_libaria2c_a_OBJECTS = $(am__objects_1)
libaria2c_a_OBJECTS = $(am_libaria2c_a_OBJECTS)
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_aria2c_OBJECTS = aria2c-main.$(OBJEXT)
aria2c_OBJECTS = $(am_aria2c_OBJECTS)
aria2c_DEPENDENCIES = libaria2c.a
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libaria2c_a_SOURCES) $(aria2c_SOURCES)
DIST_SOURCES = $(libaria2c_a_SOURCES) $(aria2c_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
CPPUNIT_LIBS = @CPPUNIT_LIBS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
aria2c_SOURCES = main.cc
SRCS = Socket.cc Socket.h\
Command.h\
AbstractCommand.cc AbstractCommand.h\
InitiateConnectionCommandFactory.cc InitiateConnectionCommandFactory.h\
DownloadCommand.cc DownloadCommand.h\
HttpInitiateConnectionCommand.cc HttpInitiateConnectionCommand.h\
HttpRequestCommand.cc HttpRequestCommand.h\
HttpResponseCommand.cc HttpResponseCommand.h\
HttpProxyRequestCommand.cc HttpProxyRequestCommand.h\
HttpProxyResponseCommand.cc HttpProxyResponseCommand.h\
HttpDownloadCommand.cc HttpDownloadCommand.h\
HttpConnection.cc HttpConnection.h\
SleepCommand.cc SleepCommand.h\
DownloadEngine.cc DownloadEngine.h\
Segment.h\
SegmentMan.cc SegmentMan.h\
Util.cc Util.h\
Request.cc Request.h\
common.h\
message.h\
Exception.h\
DlAbortEx.h\
DlRetryEx.h\
Logger.h\
SimpleLogger.cc SimpleLogger.h\
TransferEncoding.h\
ChunkedEncoding.cc ChunkedEncoding.h\
DiskWriter.h\
DefaultDiskWriter.cc DefaultDiskWriter.h\
AbstractDiskWriter.cc AbstractDiskWriter.h\
File.cc File.h\
Option.cc Option.h\
Base64.cc Base64.h\
CookieBox.cc CookieBox.h
noinst_LIBRARIES = libaria2c.a
libaria2c_a_SOURCES = $(SRCS)
aria2c_LDADD = libaria2c.a
FLAGS = -Wall -D_FILE_OFFSET_BITS=64
libaria2c_a_CXXFLAGS = $(FLAGS)
aria2c_CXXFLAGS = $(FLAGS)
all: all-am
.SUFFIXES:
.SUFFIXES: .cc .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
libaria2c.a: $(libaria2c_a_OBJECTS) $(libaria2c_a_DEPENDENCIES)
-rm -f libaria2c.a
$(libaria2c_a_AR) libaria2c.a $(libaria2c_a_OBJECTS) $(libaria2c_a_LIBADD)
$(RANLIB) libaria2c.a
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
aria2c$(EXEEXT): $(aria2c_OBJECTS) $(aria2c_DEPENDENCIES)
@rm -f aria2c$(EXEEXT)
$(CXXLINK) $(aria2c_LDFLAGS) $(aria2c_OBJECTS) $(aria2c_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-AbstractCommand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-AbstractDiskWriter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-Base64.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-ChunkedEncoding.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-CookieBox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-DefaultDiskWriter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-DownloadCommand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-DownloadEngine.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-File.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-HttpConnection.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-HttpDownloadCommand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-HttpInitiateConnectionCommand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-HttpProxyRequestCommand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-HttpProxyResponseCommand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-HttpRequestCommand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-HttpResponseCommand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-InitiateConnectionCommandFactory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-Option.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-Request.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-SegmentMan.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-SimpleLogger.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-SleepCommand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-Socket.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaria2c_a-Util.Po@am__quote@
.cc.o:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
.cc.obj:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
libaria2c_a-Socket.o: Socket.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-Socket.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-Socket.Tpo" -c -o libaria2c_a-Socket.o `test -f 'Socket.cc' || echo '$(srcdir)/'`Socket.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-Socket.Tpo" "$(DEPDIR)/libaria2c_a-Socket.Po"; else rm -f "$(DEPDIR)/libaria2c_a-Socket.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Socket.cc' object='libaria2c_a-Socket.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-Socket.o `test -f 'Socket.cc' || echo '$(srcdir)/'`Socket.cc
libaria2c_a-Socket.obj: Socket.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-Socket.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-Socket.Tpo" -c -o libaria2c_a-Socket.obj `if test -f 'Socket.cc'; then $(CYGPATH_W) 'Socket.cc'; else $(CYGPATH_W) '$(srcdir)/Socket.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-Socket.Tpo" "$(DEPDIR)/libaria2c_a-Socket.Po"; else rm -f "$(DEPDIR)/libaria2c_a-Socket.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Socket.cc' object='libaria2c_a-Socket.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-Socket.obj `if test -f 'Socket.cc'; then $(CYGPATH_W) 'Socket.cc'; else $(CYGPATH_W) '$(srcdir)/Socket.cc'; fi`
libaria2c_a-AbstractCommand.o: AbstractCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-AbstractCommand.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-AbstractCommand.Tpo" -c -o libaria2c_a-AbstractCommand.o `test -f 'AbstractCommand.cc' || echo '$(srcdir)/'`AbstractCommand.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-AbstractCommand.Tpo" "$(DEPDIR)/libaria2c_a-AbstractCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-AbstractCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='AbstractCommand.cc' object='libaria2c_a-AbstractCommand.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-AbstractCommand.o `test -f 'AbstractCommand.cc' || echo '$(srcdir)/'`AbstractCommand.cc
libaria2c_a-AbstractCommand.obj: AbstractCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-AbstractCommand.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-AbstractCommand.Tpo" -c -o libaria2c_a-AbstractCommand.obj `if test -f 'AbstractCommand.cc'; then $(CYGPATH_W) 'AbstractCommand.cc'; else $(CYGPATH_W) '$(srcdir)/AbstractCommand.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-AbstractCommand.Tpo" "$(DEPDIR)/libaria2c_a-AbstractCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-AbstractCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='AbstractCommand.cc' object='libaria2c_a-AbstractCommand.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-AbstractCommand.obj `if test -f 'AbstractCommand.cc'; then $(CYGPATH_W) 'AbstractCommand.cc'; else $(CYGPATH_W) '$(srcdir)/AbstractCommand.cc'; fi`
libaria2c_a-InitiateConnectionCommandFactory.o: InitiateConnectionCommandFactory.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-InitiateConnectionCommandFactory.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-InitiateConnectionCommandFactory.Tpo" -c -o libaria2c_a-InitiateConnectionCommandFactory.o `test -f 'InitiateConnectionCommandFactory.cc' || echo '$(srcdir)/'`InitiateConnectionCommandFactory.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-InitiateConnectionCommandFactory.Tpo" "$(DEPDIR)/libaria2c_a-InitiateConnectionCommandFactory.Po"; else rm -f "$(DEPDIR)/libaria2c_a-InitiateConnectionCommandFactory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InitiateConnectionCommandFactory.cc' object='libaria2c_a-InitiateConnectionCommandFactory.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-InitiateConnectionCommandFactory.o `test -f 'InitiateConnectionCommandFactory.cc' || echo '$(srcdir)/'`InitiateConnectionCommandFactory.cc
libaria2c_a-InitiateConnectionCommandFactory.obj: InitiateConnectionCommandFactory.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-InitiateConnectionCommandFactory.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-InitiateConnectionCommandFactory.Tpo" -c -o libaria2c_a-InitiateConnectionCommandFactory.obj `if test -f 'InitiateConnectionCommandFactory.cc'; then $(CYGPATH_W) 'InitiateConnectionCommandFactory.cc'; else $(CYGPATH_W) '$(srcdir)/InitiateConnectionCommandFactory.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-InitiateConnectionCommandFactory.Tpo" "$(DEPDIR)/libaria2c_a-InitiateConnectionCommandFactory.Po"; else rm -f "$(DEPDIR)/libaria2c_a-InitiateConnectionCommandFactory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InitiateConnectionCommandFactory.cc' object='libaria2c_a-InitiateConnectionCommandFactory.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-InitiateConnectionCommandFactory.obj `if test -f 'InitiateConnectionCommandFactory.cc'; then $(CYGPATH_W) 'InitiateConnectionCommandFactory.cc'; else $(CYGPATH_W) '$(srcdir)/InitiateConnectionCommandFactory.cc'; fi`
libaria2c_a-DownloadCommand.o: DownloadCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-DownloadCommand.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-DownloadCommand.Tpo" -c -o libaria2c_a-DownloadCommand.o `test -f 'DownloadCommand.cc' || echo '$(srcdir)/'`DownloadCommand.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-DownloadCommand.Tpo" "$(DEPDIR)/libaria2c_a-DownloadCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-DownloadCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DownloadCommand.cc' object='libaria2c_a-DownloadCommand.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-DownloadCommand.o `test -f 'DownloadCommand.cc' || echo '$(srcdir)/'`DownloadCommand.cc
libaria2c_a-DownloadCommand.obj: DownloadCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-DownloadCommand.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-DownloadCommand.Tpo" -c -o libaria2c_a-DownloadCommand.obj `if test -f 'DownloadCommand.cc'; then $(CYGPATH_W) 'DownloadCommand.cc'; else $(CYGPATH_W) '$(srcdir)/DownloadCommand.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-DownloadCommand.Tpo" "$(DEPDIR)/libaria2c_a-DownloadCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-DownloadCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DownloadCommand.cc' object='libaria2c_a-DownloadCommand.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-DownloadCommand.obj `if test -f 'DownloadCommand.cc'; then $(CYGPATH_W) 'DownloadCommand.cc'; else $(CYGPATH_W) '$(srcdir)/DownloadCommand.cc'; fi`
libaria2c_a-HttpInitiateConnectionCommand.o: HttpInitiateConnectionCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpInitiateConnectionCommand.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpInitiateConnectionCommand.Tpo" -c -o libaria2c_a-HttpInitiateConnectionCommand.o `test -f 'HttpInitiateConnectionCommand.cc' || echo '$(srcdir)/'`HttpInitiateConnectionCommand.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpInitiateConnectionCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpInitiateConnectionCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpInitiateConnectionCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpInitiateConnectionCommand.cc' object='libaria2c_a-HttpInitiateConnectionCommand.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpInitiateConnectionCommand.o `test -f 'HttpInitiateConnectionCommand.cc' || echo '$(srcdir)/'`HttpInitiateConnectionCommand.cc
libaria2c_a-HttpInitiateConnectionCommand.obj: HttpInitiateConnectionCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpInitiateConnectionCommand.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpInitiateConnectionCommand.Tpo" -c -o libaria2c_a-HttpInitiateConnectionCommand.obj `if test -f 'HttpInitiateConnectionCommand.cc'; then $(CYGPATH_W) 'HttpInitiateConnectionCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpInitiateConnectionCommand.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpInitiateConnectionCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpInitiateConnectionCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpInitiateConnectionCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpInitiateConnectionCommand.cc' object='libaria2c_a-HttpInitiateConnectionCommand.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpInitiateConnectionCommand.obj `if test -f 'HttpInitiateConnectionCommand.cc'; then $(CYGPATH_W) 'HttpInitiateConnectionCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpInitiateConnectionCommand.cc'; fi`
libaria2c_a-HttpRequestCommand.o: HttpRequestCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpRequestCommand.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpRequestCommand.Tpo" -c -o libaria2c_a-HttpRequestCommand.o `test -f 'HttpRequestCommand.cc' || echo '$(srcdir)/'`HttpRequestCommand.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpRequestCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpRequestCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpRequestCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpRequestCommand.cc' object='libaria2c_a-HttpRequestCommand.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpRequestCommand.o `test -f 'HttpRequestCommand.cc' || echo '$(srcdir)/'`HttpRequestCommand.cc
libaria2c_a-HttpRequestCommand.obj: HttpRequestCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpRequestCommand.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpRequestCommand.Tpo" -c -o libaria2c_a-HttpRequestCommand.obj `if test -f 'HttpRequestCommand.cc'; then $(CYGPATH_W) 'HttpRequestCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpRequestCommand.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpRequestCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpRequestCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpRequestCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpRequestCommand.cc' object='libaria2c_a-HttpRequestCommand.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpRequestCommand.obj `if test -f 'HttpRequestCommand.cc'; then $(CYGPATH_W) 'HttpRequestCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpRequestCommand.cc'; fi`
libaria2c_a-HttpResponseCommand.o: HttpResponseCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpResponseCommand.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpResponseCommand.Tpo" -c -o libaria2c_a-HttpResponseCommand.o `test -f 'HttpResponseCommand.cc' || echo '$(srcdir)/'`HttpResponseCommand.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpResponseCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpResponseCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpResponseCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpResponseCommand.cc' object='libaria2c_a-HttpResponseCommand.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpResponseCommand.o `test -f 'HttpResponseCommand.cc' || echo '$(srcdir)/'`HttpResponseCommand.cc
libaria2c_a-HttpResponseCommand.obj: HttpResponseCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpResponseCommand.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpResponseCommand.Tpo" -c -o libaria2c_a-HttpResponseCommand.obj `if test -f 'HttpResponseCommand.cc'; then $(CYGPATH_W) 'HttpResponseCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpResponseCommand.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpResponseCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpResponseCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpResponseCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpResponseCommand.cc' object='libaria2c_a-HttpResponseCommand.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpResponseCommand.obj `if test -f 'HttpResponseCommand.cc'; then $(CYGPATH_W) 'HttpResponseCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpResponseCommand.cc'; fi`
libaria2c_a-HttpProxyRequestCommand.o: HttpProxyRequestCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpProxyRequestCommand.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpProxyRequestCommand.Tpo" -c -o libaria2c_a-HttpProxyRequestCommand.o `test -f 'HttpProxyRequestCommand.cc' || echo '$(srcdir)/'`HttpProxyRequestCommand.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpProxyRequestCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpProxyRequestCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpProxyRequestCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpProxyRequestCommand.cc' object='libaria2c_a-HttpProxyRequestCommand.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpProxyRequestCommand.o `test -f 'HttpProxyRequestCommand.cc' || echo '$(srcdir)/'`HttpProxyRequestCommand.cc
libaria2c_a-HttpProxyRequestCommand.obj: HttpProxyRequestCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpProxyRequestCommand.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpProxyRequestCommand.Tpo" -c -o libaria2c_a-HttpProxyRequestCommand.obj `if test -f 'HttpProxyRequestCommand.cc'; then $(CYGPATH_W) 'HttpProxyRequestCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpProxyRequestCommand.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpProxyRequestCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpProxyRequestCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpProxyRequestCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpProxyRequestCommand.cc' object='libaria2c_a-HttpProxyRequestCommand.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpProxyRequestCommand.obj `if test -f 'HttpProxyRequestCommand.cc'; then $(CYGPATH_W) 'HttpProxyRequestCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpProxyRequestCommand.cc'; fi`
libaria2c_a-HttpProxyResponseCommand.o: HttpProxyResponseCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpProxyResponseCommand.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpProxyResponseCommand.Tpo" -c -o libaria2c_a-HttpProxyResponseCommand.o `test -f 'HttpProxyResponseCommand.cc' || echo '$(srcdir)/'`HttpProxyResponseCommand.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpProxyResponseCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpProxyResponseCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpProxyResponseCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpProxyResponseCommand.cc' object='libaria2c_a-HttpProxyResponseCommand.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpProxyResponseCommand.o `test -f 'HttpProxyResponseCommand.cc' || echo '$(srcdir)/'`HttpProxyResponseCommand.cc
libaria2c_a-HttpProxyResponseCommand.obj: HttpProxyResponseCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpProxyResponseCommand.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpProxyResponseCommand.Tpo" -c -o libaria2c_a-HttpProxyResponseCommand.obj `if test -f 'HttpProxyResponseCommand.cc'; then $(CYGPATH_W) 'HttpProxyResponseCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpProxyResponseCommand.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpProxyResponseCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpProxyResponseCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpProxyResponseCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpProxyResponseCommand.cc' object='libaria2c_a-HttpProxyResponseCommand.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpProxyResponseCommand.obj `if test -f 'HttpProxyResponseCommand.cc'; then $(CYGPATH_W) 'HttpProxyResponseCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpProxyResponseCommand.cc'; fi`
libaria2c_a-HttpDownloadCommand.o: HttpDownloadCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpDownloadCommand.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpDownloadCommand.Tpo" -c -o libaria2c_a-HttpDownloadCommand.o `test -f 'HttpDownloadCommand.cc' || echo '$(srcdir)/'`HttpDownloadCommand.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpDownloadCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpDownloadCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpDownloadCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpDownloadCommand.cc' object='libaria2c_a-HttpDownloadCommand.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpDownloadCommand.o `test -f 'HttpDownloadCommand.cc' || echo '$(srcdir)/'`HttpDownloadCommand.cc
libaria2c_a-HttpDownloadCommand.obj: HttpDownloadCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpDownloadCommand.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpDownloadCommand.Tpo" -c -o libaria2c_a-HttpDownloadCommand.obj `if test -f 'HttpDownloadCommand.cc'; then $(CYGPATH_W) 'HttpDownloadCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpDownloadCommand.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpDownloadCommand.Tpo" "$(DEPDIR)/libaria2c_a-HttpDownloadCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpDownloadCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpDownloadCommand.cc' object='libaria2c_a-HttpDownloadCommand.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpDownloadCommand.obj `if test -f 'HttpDownloadCommand.cc'; then $(CYGPATH_W) 'HttpDownloadCommand.cc'; else $(CYGPATH_W) '$(srcdir)/HttpDownloadCommand.cc'; fi`
libaria2c_a-HttpConnection.o: HttpConnection.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpConnection.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpConnection.Tpo" -c -o libaria2c_a-HttpConnection.o `test -f 'HttpConnection.cc' || echo '$(srcdir)/'`HttpConnection.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpConnection.Tpo" "$(DEPDIR)/libaria2c_a-HttpConnection.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpConnection.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpConnection.cc' object='libaria2c_a-HttpConnection.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpConnection.o `test -f 'HttpConnection.cc' || echo '$(srcdir)/'`HttpConnection.cc
libaria2c_a-HttpConnection.obj: HttpConnection.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-HttpConnection.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-HttpConnection.Tpo" -c -o libaria2c_a-HttpConnection.obj `if test -f 'HttpConnection.cc'; then $(CYGPATH_W) 'HttpConnection.cc'; else $(CYGPATH_W) '$(srcdir)/HttpConnection.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-HttpConnection.Tpo" "$(DEPDIR)/libaria2c_a-HttpConnection.Po"; else rm -f "$(DEPDIR)/libaria2c_a-HttpConnection.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpConnection.cc' object='libaria2c_a-HttpConnection.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-HttpConnection.obj `if test -f 'HttpConnection.cc'; then $(CYGPATH_W) 'HttpConnection.cc'; else $(CYGPATH_W) '$(srcdir)/HttpConnection.cc'; fi`
libaria2c_a-SleepCommand.o: SleepCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-SleepCommand.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-SleepCommand.Tpo" -c -o libaria2c_a-SleepCommand.o `test -f 'SleepCommand.cc' || echo '$(srcdir)/'`SleepCommand.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-SleepCommand.Tpo" "$(DEPDIR)/libaria2c_a-SleepCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-SleepCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SleepCommand.cc' object='libaria2c_a-SleepCommand.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-SleepCommand.o `test -f 'SleepCommand.cc' || echo '$(srcdir)/'`SleepCommand.cc
libaria2c_a-SleepCommand.obj: SleepCommand.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-SleepCommand.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-SleepCommand.Tpo" -c -o libaria2c_a-SleepCommand.obj `if test -f 'SleepCommand.cc'; then $(CYGPATH_W) 'SleepCommand.cc'; else $(CYGPATH_W) '$(srcdir)/SleepCommand.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-SleepCommand.Tpo" "$(DEPDIR)/libaria2c_a-SleepCommand.Po"; else rm -f "$(DEPDIR)/libaria2c_a-SleepCommand.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SleepCommand.cc' object='libaria2c_a-SleepCommand.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-SleepCommand.obj `if test -f 'SleepCommand.cc'; then $(CYGPATH_W) 'SleepCommand.cc'; else $(CYGPATH_W) '$(srcdir)/SleepCommand.cc'; fi`
libaria2c_a-DownloadEngine.o: DownloadEngine.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-DownloadEngine.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-DownloadEngine.Tpo" -c -o libaria2c_a-DownloadEngine.o `test -f 'DownloadEngine.cc' || echo '$(srcdir)/'`DownloadEngine.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-DownloadEngine.Tpo" "$(DEPDIR)/libaria2c_a-DownloadEngine.Po"; else rm -f "$(DEPDIR)/libaria2c_a-DownloadEngine.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DownloadEngine.cc' object='libaria2c_a-DownloadEngine.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-DownloadEngine.o `test -f 'DownloadEngine.cc' || echo '$(srcdir)/'`DownloadEngine.cc
libaria2c_a-DownloadEngine.obj: DownloadEngine.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-DownloadEngine.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-DownloadEngine.Tpo" -c -o libaria2c_a-DownloadEngine.obj `if test -f 'DownloadEngine.cc'; then $(CYGPATH_W) 'DownloadEngine.cc'; else $(CYGPATH_W) '$(srcdir)/DownloadEngine.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-DownloadEngine.Tpo" "$(DEPDIR)/libaria2c_a-DownloadEngine.Po"; else rm -f "$(DEPDIR)/libaria2c_a-DownloadEngine.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DownloadEngine.cc' object='libaria2c_a-DownloadEngine.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-DownloadEngine.obj `if test -f 'DownloadEngine.cc'; then $(CYGPATH_W) 'DownloadEngine.cc'; else $(CYGPATH_W) '$(srcdir)/DownloadEngine.cc'; fi`
libaria2c_a-SegmentMan.o: SegmentMan.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-SegmentMan.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-SegmentMan.Tpo" -c -o libaria2c_a-SegmentMan.o `test -f 'SegmentMan.cc' || echo '$(srcdir)/'`SegmentMan.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-SegmentMan.Tpo" "$(DEPDIR)/libaria2c_a-SegmentMan.Po"; else rm -f "$(DEPDIR)/libaria2c_a-SegmentMan.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SegmentMan.cc' object='libaria2c_a-SegmentMan.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-SegmentMan.o `test -f 'SegmentMan.cc' || echo '$(srcdir)/'`SegmentMan.cc
libaria2c_a-SegmentMan.obj: SegmentMan.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-SegmentMan.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-SegmentMan.Tpo" -c -o libaria2c_a-SegmentMan.obj `if test -f 'SegmentMan.cc'; then $(CYGPATH_W) 'SegmentMan.cc'; else $(CYGPATH_W) '$(srcdir)/SegmentMan.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-SegmentMan.Tpo" "$(DEPDIR)/libaria2c_a-SegmentMan.Po"; else rm -f "$(DEPDIR)/libaria2c_a-SegmentMan.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SegmentMan.cc' object='libaria2c_a-SegmentMan.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-SegmentMan.obj `if test -f 'SegmentMan.cc'; then $(CYGPATH_W) 'SegmentMan.cc'; else $(CYGPATH_W) '$(srcdir)/SegmentMan.cc'; fi`
libaria2c_a-Util.o: Util.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-Util.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-Util.Tpo" -c -o libaria2c_a-Util.o `test -f 'Util.cc' || echo '$(srcdir)/'`Util.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-Util.Tpo" "$(DEPDIR)/libaria2c_a-Util.Po"; else rm -f "$(DEPDIR)/libaria2c_a-Util.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Util.cc' object='libaria2c_a-Util.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-Util.o `test -f 'Util.cc' || echo '$(srcdir)/'`Util.cc
libaria2c_a-Util.obj: Util.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-Util.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-Util.Tpo" -c -o libaria2c_a-Util.obj `if test -f 'Util.cc'; then $(CYGPATH_W) 'Util.cc'; else $(CYGPATH_W) '$(srcdir)/Util.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-Util.Tpo" "$(DEPDIR)/libaria2c_a-Util.Po"; else rm -f "$(DEPDIR)/libaria2c_a-Util.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Util.cc' object='libaria2c_a-Util.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-Util.obj `if test -f 'Util.cc'; then $(CYGPATH_W) 'Util.cc'; else $(CYGPATH_W) '$(srcdir)/Util.cc'; fi`
libaria2c_a-Request.o: Request.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-Request.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-Request.Tpo" -c -o libaria2c_a-Request.o `test -f 'Request.cc' || echo '$(srcdir)/'`Request.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-Request.Tpo" "$(DEPDIR)/libaria2c_a-Request.Po"; else rm -f "$(DEPDIR)/libaria2c_a-Request.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Request.cc' object='libaria2c_a-Request.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-Request.o `test -f 'Request.cc' || echo '$(srcdir)/'`Request.cc
libaria2c_a-Request.obj: Request.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-Request.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-Request.Tpo" -c -o libaria2c_a-Request.obj `if test -f 'Request.cc'; then $(CYGPATH_W) 'Request.cc'; else $(CYGPATH_W) '$(srcdir)/Request.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-Request.Tpo" "$(DEPDIR)/libaria2c_a-Request.Po"; else rm -f "$(DEPDIR)/libaria2c_a-Request.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Request.cc' object='libaria2c_a-Request.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-Request.obj `if test -f 'Request.cc'; then $(CYGPATH_W) 'Request.cc'; else $(CYGPATH_W) '$(srcdir)/Request.cc'; fi`
libaria2c_a-SimpleLogger.o: SimpleLogger.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-SimpleLogger.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-SimpleLogger.Tpo" -c -o libaria2c_a-SimpleLogger.o `test -f 'SimpleLogger.cc' || echo '$(srcdir)/'`SimpleLogger.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-SimpleLogger.Tpo" "$(DEPDIR)/libaria2c_a-SimpleLogger.Po"; else rm -f "$(DEPDIR)/libaria2c_a-SimpleLogger.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SimpleLogger.cc' object='libaria2c_a-SimpleLogger.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-SimpleLogger.o `test -f 'SimpleLogger.cc' || echo '$(srcdir)/'`SimpleLogger.cc
libaria2c_a-SimpleLogger.obj: SimpleLogger.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-SimpleLogger.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-SimpleLogger.Tpo" -c -o libaria2c_a-SimpleLogger.obj `if test -f 'SimpleLogger.cc'; then $(CYGPATH_W) 'SimpleLogger.cc'; else $(CYGPATH_W) '$(srcdir)/SimpleLogger.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-SimpleLogger.Tpo" "$(DEPDIR)/libaria2c_a-SimpleLogger.Po"; else rm -f "$(DEPDIR)/libaria2c_a-SimpleLogger.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SimpleLogger.cc' object='libaria2c_a-SimpleLogger.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-SimpleLogger.obj `if test -f 'SimpleLogger.cc'; then $(CYGPATH_W) 'SimpleLogger.cc'; else $(CYGPATH_W) '$(srcdir)/SimpleLogger.cc'; fi`
libaria2c_a-ChunkedEncoding.o: ChunkedEncoding.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-ChunkedEncoding.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-ChunkedEncoding.Tpo" -c -o libaria2c_a-ChunkedEncoding.o `test -f 'ChunkedEncoding.cc' || echo '$(srcdir)/'`ChunkedEncoding.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-ChunkedEncoding.Tpo" "$(DEPDIR)/libaria2c_a-ChunkedEncoding.Po"; else rm -f "$(DEPDIR)/libaria2c_a-ChunkedEncoding.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ChunkedEncoding.cc' object='libaria2c_a-ChunkedEncoding.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-ChunkedEncoding.o `test -f 'ChunkedEncoding.cc' || echo '$(srcdir)/'`ChunkedEncoding.cc
libaria2c_a-ChunkedEncoding.obj: ChunkedEncoding.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-ChunkedEncoding.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-ChunkedEncoding.Tpo" -c -o libaria2c_a-ChunkedEncoding.obj `if test -f 'ChunkedEncoding.cc'; then $(CYGPATH_W) 'ChunkedEncoding.cc'; else $(CYGPATH_W) '$(srcdir)/ChunkedEncoding.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-ChunkedEncoding.Tpo" "$(DEPDIR)/libaria2c_a-ChunkedEncoding.Po"; else rm -f "$(DEPDIR)/libaria2c_a-ChunkedEncoding.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ChunkedEncoding.cc' object='libaria2c_a-ChunkedEncoding.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-ChunkedEncoding.obj `if test -f 'ChunkedEncoding.cc'; then $(CYGPATH_W) 'ChunkedEncoding.cc'; else $(CYGPATH_W) '$(srcdir)/ChunkedEncoding.cc'; fi`
libaria2c_a-DefaultDiskWriter.o: DefaultDiskWriter.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-DefaultDiskWriter.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-DefaultDiskWriter.Tpo" -c -o libaria2c_a-DefaultDiskWriter.o `test -f 'DefaultDiskWriter.cc' || echo '$(srcdir)/'`DefaultDiskWriter.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-DefaultDiskWriter.Tpo" "$(DEPDIR)/libaria2c_a-DefaultDiskWriter.Po"; else rm -f "$(DEPDIR)/libaria2c_a-DefaultDiskWriter.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DefaultDiskWriter.cc' object='libaria2c_a-DefaultDiskWriter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-DefaultDiskWriter.o `test -f 'DefaultDiskWriter.cc' || echo '$(srcdir)/'`DefaultDiskWriter.cc
libaria2c_a-DefaultDiskWriter.obj: DefaultDiskWriter.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-DefaultDiskWriter.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-DefaultDiskWriter.Tpo" -c -o libaria2c_a-DefaultDiskWriter.obj `if test -f 'DefaultDiskWriter.cc'; then $(CYGPATH_W) 'DefaultDiskWriter.cc'; else $(CYGPATH_W) '$(srcdir)/DefaultDiskWriter.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-DefaultDiskWriter.Tpo" "$(DEPDIR)/libaria2c_a-DefaultDiskWriter.Po"; else rm -f "$(DEPDIR)/libaria2c_a-DefaultDiskWriter.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DefaultDiskWriter.cc' object='libaria2c_a-DefaultDiskWriter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-DefaultDiskWriter.obj `if test -f 'DefaultDiskWriter.cc'; then $(CYGPATH_W) 'DefaultDiskWriter.cc'; else $(CYGPATH_W) '$(srcdir)/DefaultDiskWriter.cc'; fi`
libaria2c_a-AbstractDiskWriter.o: AbstractDiskWriter.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-AbstractDiskWriter.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-AbstractDiskWriter.Tpo" -c -o libaria2c_a-AbstractDiskWriter.o `test -f 'AbstractDiskWriter.cc' || echo '$(srcdir)/'`AbstractDiskWriter.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-AbstractDiskWriter.Tpo" "$(DEPDIR)/libaria2c_a-AbstractDiskWriter.Po"; else rm -f "$(DEPDIR)/libaria2c_a-AbstractDiskWriter.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='AbstractDiskWriter.cc' object='libaria2c_a-AbstractDiskWriter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-AbstractDiskWriter.o `test -f 'AbstractDiskWriter.cc' || echo '$(srcdir)/'`AbstractDiskWriter.cc
libaria2c_a-AbstractDiskWriter.obj: AbstractDiskWriter.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-AbstractDiskWriter.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-AbstractDiskWriter.Tpo" -c -o libaria2c_a-AbstractDiskWriter.obj `if test -f 'AbstractDiskWriter.cc'; then $(CYGPATH_W) 'AbstractDiskWriter.cc'; else $(CYGPATH_W) '$(srcdir)/AbstractDiskWriter.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-AbstractDiskWriter.Tpo" "$(DEPDIR)/libaria2c_a-AbstractDiskWriter.Po"; else rm -f "$(DEPDIR)/libaria2c_a-AbstractDiskWriter.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='AbstractDiskWriter.cc' object='libaria2c_a-AbstractDiskWriter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-AbstractDiskWriter.obj `if test -f 'AbstractDiskWriter.cc'; then $(CYGPATH_W) 'AbstractDiskWriter.cc'; else $(CYGPATH_W) '$(srcdir)/AbstractDiskWriter.cc'; fi`
libaria2c_a-File.o: File.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-File.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-File.Tpo" -c -o libaria2c_a-File.o `test -f 'File.cc' || echo '$(srcdir)/'`File.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-File.Tpo" "$(DEPDIR)/libaria2c_a-File.Po"; else rm -f "$(DEPDIR)/libaria2c_a-File.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='File.cc' object='libaria2c_a-File.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-File.o `test -f 'File.cc' || echo '$(srcdir)/'`File.cc
libaria2c_a-File.obj: File.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-File.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-File.Tpo" -c -o libaria2c_a-File.obj `if test -f 'File.cc'; then $(CYGPATH_W) 'File.cc'; else $(CYGPATH_W) '$(srcdir)/File.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-File.Tpo" "$(DEPDIR)/libaria2c_a-File.Po"; else rm -f "$(DEPDIR)/libaria2c_a-File.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='File.cc' object='libaria2c_a-File.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-File.obj `if test -f 'File.cc'; then $(CYGPATH_W) 'File.cc'; else $(CYGPATH_W) '$(srcdir)/File.cc'; fi`
libaria2c_a-Option.o: Option.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-Option.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-Option.Tpo" -c -o libaria2c_a-Option.o `test -f 'Option.cc' || echo '$(srcdir)/'`Option.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-Option.Tpo" "$(DEPDIR)/libaria2c_a-Option.Po"; else rm -f "$(DEPDIR)/libaria2c_a-Option.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Option.cc' object='libaria2c_a-Option.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-Option.o `test -f 'Option.cc' || echo '$(srcdir)/'`Option.cc
libaria2c_a-Option.obj: Option.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-Option.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-Option.Tpo" -c -o libaria2c_a-Option.obj `if test -f 'Option.cc'; then $(CYGPATH_W) 'Option.cc'; else $(CYGPATH_W) '$(srcdir)/Option.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-Option.Tpo" "$(DEPDIR)/libaria2c_a-Option.Po"; else rm -f "$(DEPDIR)/libaria2c_a-Option.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Option.cc' object='libaria2c_a-Option.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-Option.obj `if test -f 'Option.cc'; then $(CYGPATH_W) 'Option.cc'; else $(CYGPATH_W) '$(srcdir)/Option.cc'; fi`
libaria2c_a-Base64.o: Base64.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-Base64.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-Base64.Tpo" -c -o libaria2c_a-Base64.o `test -f 'Base64.cc' || echo '$(srcdir)/'`Base64.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-Base64.Tpo" "$(DEPDIR)/libaria2c_a-Base64.Po"; else rm -f "$(DEPDIR)/libaria2c_a-Base64.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Base64.cc' object='libaria2c_a-Base64.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-Base64.o `test -f 'Base64.cc' || echo '$(srcdir)/'`Base64.cc
libaria2c_a-Base64.obj: Base64.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-Base64.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-Base64.Tpo" -c -o libaria2c_a-Base64.obj `if test -f 'Base64.cc'; then $(CYGPATH_W) 'Base64.cc'; else $(CYGPATH_W) '$(srcdir)/Base64.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-Base64.Tpo" "$(DEPDIR)/libaria2c_a-Base64.Po"; else rm -f "$(DEPDIR)/libaria2c_a-Base64.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Base64.cc' object='libaria2c_a-Base64.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-Base64.obj `if test -f 'Base64.cc'; then $(CYGPATH_W) 'Base64.cc'; else $(CYGPATH_W) '$(srcdir)/Base64.cc'; fi`
libaria2c_a-CookieBox.o: CookieBox.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-CookieBox.o -MD -MP -MF "$(DEPDIR)/libaria2c_a-CookieBox.Tpo" -c -o libaria2c_a-CookieBox.o `test -f 'CookieBox.cc' || echo '$(srcdir)/'`CookieBox.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-CookieBox.Tpo" "$(DEPDIR)/libaria2c_a-CookieBox.Po"; else rm -f "$(DEPDIR)/libaria2c_a-CookieBox.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CookieBox.cc' object='libaria2c_a-CookieBox.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-CookieBox.o `test -f 'CookieBox.cc' || echo '$(srcdir)/'`CookieBox.cc
libaria2c_a-CookieBox.obj: CookieBox.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -MT libaria2c_a-CookieBox.obj -MD -MP -MF "$(DEPDIR)/libaria2c_a-CookieBox.Tpo" -c -o libaria2c_a-CookieBox.obj `if test -f 'CookieBox.cc'; then $(CYGPATH_W) 'CookieBox.cc'; else $(CYGPATH_W) '$(srcdir)/CookieBox.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libaria2c_a-CookieBox.Tpo" "$(DEPDIR)/libaria2c_a-CookieBox.Po"; else rm -f "$(DEPDIR)/libaria2c_a-CookieBox.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CookieBox.cc' object='libaria2c_a-CookieBox.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libaria2c_a_CXXFLAGS) $(CXXFLAGS) -c -o libaria2c_a-CookieBox.obj `if test -f 'CookieBox.cc'; then $(CYGPATH_W) 'CookieBox.cc'; else $(CYGPATH_W) '$(srcdir)/CookieBox.cc'; fi`
aria2c-main.o: main.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-main.o -MD -MP -MF "$(DEPDIR)/aria2c-main.Tpo" -c -o aria2c-main.o `test -f 'main.cc' || echo '$(srcdir)/'`main.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-main.Tpo" "$(DEPDIR)/aria2c-main.Po"; else rm -f "$(DEPDIR)/aria2c-main.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='main.cc' object='aria2c-main.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-main.o `test -f 'main.cc' || echo '$(srcdir)/'`main.cc
aria2c-main.obj: main.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-main.obj -MD -MP -MF "$(DEPDIR)/aria2c-main.Tpo" -c -o aria2c-main.obj `if test -f 'main.cc'; then $(CYGPATH_W) 'main.cc'; else $(CYGPATH_W) '$(srcdir)/main.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-main.Tpo" "$(DEPDIR)/aria2c-main.Po"; else rm -f "$(DEPDIR)/aria2c-main.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='main.cc' object='aria2c-main.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-main.obj `if test -f 'main.cc'; then $(CYGPATH_W) 'main.cc'; else $(CYGPATH_W) '$(srcdir)/main.cc'; fi`
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LIBRARIES) $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-noinstLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

52
src/Option.cc Normal file
View file

@ -0,0 +1,52 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "Option.h"
Option::Option() {}
Option::~Option() {}
void Option::put(const string& name, const string& value) {
table[name] = value;
}
bool Option::defined(const string& name) const {
return table.count(name) == 1;
}
string Option::get(const string& name) const {
map<string, string>::const_iterator itr = table.find(name);
if(itr == table.end()) {
return "";
} else {
return (*itr).second;
}
}
int Option::getAsInt(const string& name) const {
map<string, string>::const_iterator itr = table.find(name);
if(itr == table.end()) {
return 0;
} else {
return (int)strtol((*itr).second.c_str(), NULL, 10);
}
}

43
src/Option.h Normal file
View file

@ -0,0 +1,43 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_OPTION_H_
#define _D_OPTION_H_
#include <string>
#include <map>
using namespace std;
class Option {
private:
map<string, string> table;
public:
Option();
~Option();
void put(const string& name, const string& value);
bool defined(const string& name) const;
string get(const string& name) const;
int getAsInt(const string& name) const;
};
#endif // _D_OPTION_H_

View file

@ -0,0 +1,69 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "PreAllocationDiskWriter.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include "DlAbortEx.h"
PreAllocationDiskWriter::PreAllocationDiskWriter(unsigned long int size):AbstractDiskWriter(),size(size) {}
PreAllocationDiskWriter::~PreAllocationDiskWriter() {}
void PreAllocationDiskWriter::initAndOpenFile(string filename) {
createFile(filename, O_DIRECT);
int pageSize = getpagesize();
char* buf;
int size = pageSize*4;
int rt = posix_memalign((void**)&buf, pageSize, size);
if(rt != 0) {
throw new DlAbortEx(strerror(rt));
}
memset(buf, 0, size);
int x = size/4096;
int r = size%4096;
for(int i = 0; i < x; i++) {
if(write(fd, buf, size) < 0) {
free(buf);
throw new DlAbortEx(strerror(errno));
}
}
free(buf);
closeFile();
openExistingFile(filename);
char cbuf[4096];
memset(cbuf, 0, sizeof(cbuf));
if(write(fd, cbuf, r) < 0) {
throw new DlAbortEx(strerror(errno));
}
}
void PreAllocationDiskWriter::writeData(const char* data, int len, unsigned long int offset) {
int x = lseek(fd, offset, SEEK_SET);
// TODO check the return value of write
writeDataInternal(data, len);
}

View file

@ -0,0 +1,40 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_PRE_ALLOCATION_DISK_WRITER_H_
#define _D_PRE_ALLOCATION_DISK_WRITER_H_
#include "AbstractDiskWriter.h"
class PreAllocationDiskWriter:public AbstractDiskWriter {
private:
unsigned long int size;
public:
PreAllocationDiskWriter(unsigned long int size);
~PreAllocationDiskWriter();
void initAndOpenFile(string filename);
void writeData(const char* data, int len, unsigned long int position);
};
#endif // _D_PRE_ALLOCATION_DISK_WRITER_H_

110
src/Request.cc Normal file
View file

@ -0,0 +1,110 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "Request.h"
#include "Util.h"
#define MAX_RETRY_COUNT 5
Request::Request():port(0), retryCount(0) {
defaultPorts["http"] = 80;
seg.sp = 0;
seg.ep = 0;
seg.ds = 0;
seg.finish = false;
cookieBox = new CookieBox();
}
Request::~Request() {}
bool Request::setUrl(string url) {
this->url = url;
return parseUrl(url);
}
bool Request::resetUrl() {
return setUrl(url);
}
bool Request::redirectUrl(string url) {
return parseUrl(url);
}
bool Request::parseUrl(string url) {
currentUrl = url;
host = "";
port = 0;
dir = "";
file = "";
if(url.find_first_not_of(SAFE_CHARS) != string::npos) {
return false;
}
unsigned int hp = url.find("://");
if(hp == string::npos) return false;
protocol = url.substr(0, hp);
int defPort;
if((defPort = defaultPorts[protocol]) == 0) {
return false;
}
hp += 3;
if(url.size() <= hp) return false;
unsigned int hep = url.find("/", hp);
if(hep == string::npos) {
hep = url.size();
}
pair<string, string> hostAndPort;
Util::split(hostAndPort, url.substr(hp, hep-hp), ':');
host = hostAndPort.first;
if(hostAndPort.second != "") {
// TODO rewrite this using strtoul function. If strtoul fails,
// return false.
port = (int)strtol(hostAndPort.second.c_str(), NULL, 10);
if(!(0 < port && port <= 65535)) {
return false;
}
} else {
// If port is not specified, then we leave it 0.
port = defPort;
}
unsigned int direp = url.find_last_of("/");
if(direp == string::npos || direp <= hep) {
dir = "/";
direp = hep;
} else {
dir = url.substr(hep, direp-hep);
}
if(url.size() > direp+1) {
file = url.substr(direp+1);
}
return true;
}
void Request::resetRetryCount() {
this->retryCount = 0;
}
void Request::addRetryCount() {
retryCount++;
}
bool Request::noMoreRetry() {
return retryCount >= MAX_RETRY_COUNT;
}

79
src/Request.h Normal file
View file

@ -0,0 +1,79 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_REQUEST_H_
#define _D_REQUEST_H_
#include <string>
#include <map>
#include <Segment.h>
#include "CookieBox.h"
using namespace std;
#define SAFE_CHARS "abcdefghijklmnopqrstuvwxyz"\
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"\
"0123456789"\
":/?[]@"\
"!$&'()*+,;="\
"-._~"\
"%"
class Request {
private:
string url;
string currentUrl;
string protocol;
string host;
int port;
string dir;
string file;
map<string, int> defaultPorts;
int retryCount;
bool parseUrl(string url);
public:
Segment seg;
CookieBox* cookieBox;
public:
Request();
virtual ~Request();
// Parses URL and sets url, host, port, dir, file fields.
// Returns true if parsing goes successful, otherwise returns false.
bool setUrl(string url);
// Parses URL and sets host, port, dir, file fields.
// url field are not altered by this method.
// Returns true if parsing goes successful, otherwise returns false.
bool redirectUrl(string url);
bool resetUrl();
void resetRetryCount();
void addRetryCount();
bool noMoreRetry();
string getUrl() const { return url; }
string getCurrentUrl() const { return currentUrl; }
string getProtocol() const { return protocol; }
string getHost() const { return host; }
int getPort() const { return port; }
string getDir() const { return dir; }
string getFile() const { return file;}
};
#endif // _D_REQUEST_H_

45
src/Segment.h Normal file
View file

@ -0,0 +1,45 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_SEGMENT_H_
#define _D_SEGMENT_H_
/**
* Segment represents a download segment.
* sp, ep is a offset from a begining of a file.
* Therefore, if a file size is x, then 0 <= sp <= ep <= x-1.
* sp, ep is used in Http Range header.
* e.g. Range: bytes=sp-ep
* ds is downloaded bytes.
* If a download of this segement is complete, finish must be set to true.
*/
typedef struct {
int cuid;
long long int sp;
long long int ep;
long long int ds;
bool finish;
} Segment;
#define SEGMENT_EQUAL(X, Y) (X.cuid == Y.cuid && X.sp == Y.sp && X.ep == Y.ep && X.ds == Y.ds && X.finish == Y.finish ? true : false)
#endif // _D_SEGMENT_H_

231
src/SegmentMan.cc Normal file
View file

@ -0,0 +1,231 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "SegmentMan.h"
#include "DlAbortEx.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include "Util.h"
#include "File.h"
#include "message.h"
SegmentMan::SegmentMan():totalSize(0),isSplittable(true),downloadStarted(false),dir(".") {}
SegmentMan::~SegmentMan() {}
void SegmentMan::unregisterId(int cuid) {
for(vector<Segment>::iterator itr = segments.begin(); itr != segments.end(); itr++) {
if((*itr).cuid == cuid) {
cuid = 0;
}
}
}
bool SegmentMan::getSegment(Segment& seg, int cuid) {
//Segment s = { 0, 0, 0, false };
if(segments.empty()) {
logger->debug("assign new segment { sp = 0, ep = "+(totalSize == 0 ? "0" : Util::llitos(totalSize-1))+" } to cuid "+Util::llitos(cuid));
//seg = { cuid, 0, totalSize == 0 ? 0 : totalSize-1, 0, false };
seg.cuid = cuid;
seg.sp = 0;
seg.ep = totalSize == 0 ? 0 : totalSize-1;
seg.ds = 0;
seg.finish = false;
segments.push_back(seg);
return true;
}
for(vector<Segment>::iterator itr = segments.begin(); itr != segments.end(); itr++) {
if((*itr).cuid == cuid && !(*itr).finish) {
// logger->debug("return an existing segment { "
// "sp = "+Util::ulitos((*itr).sp)+", "+
// "ep = "+Util::ulitos((*itr).ep)+", "
// "ds = "+Util::ulitos((*itr).ds)+" } to "+
// "cuid "+Util::ulitos((*itr).cuid));
seg = *itr;
return true;
}
}
if(!isSplittable) {
return false;
}
for(vector<Segment>::iterator itr = segments.begin(); itr != segments.end(); itr++) {
Segment& s = *itr;
if(s.finish) {
continue;
}
if(s.cuid == 0) {
s.cuid = cuid;
seg = s;
return true;
}
}
for(vector<Segment>::iterator itr = segments.begin(); itr != segments.end(); itr++) {
Segment& s = *itr;
if(s.finish) {
continue;
}
if(s.ep-(s.sp+s.ds) > 524288) {
long long int nep = (s.ep-(s.sp+s.ds))/2+(s.sp+s.ds);
//nseg = { cuid, nep+1, s.ep, 0, false };
seg.cuid = cuid;
seg.sp = nep+1;
seg.ep = s.ep;
seg.ds = 0;
seg.finish = false;
s.ep = nep;
logger->debug("return new segment { "
"sp = "+Util::llitos(seg.sp)+", "+
"ep = "+Util::llitos(seg.ep)+", "
"ds = "+Util::llitos(seg.ds)+" } to "+
"cuid "+Util::llitos(cuid));
logger->debug("update segment { "
"sp = "+Util::llitos(s.sp)+", "+
"ep = "+Util::llitos(s.ep)+", "
"ds = "+Util::llitos(s.ds)+" } of "+
"cuid "+Util::llitos(s.cuid));
segments.push_back(seg);
return true;
}
}
return false;
}
void SegmentMan::updateSegment(const Segment& segment) {
for(vector<Segment>::iterator itr = segments.begin(); itr != segments.end(); itr++) {
if((*itr).cuid == segment.cuid &&
(*itr).sp == segment.sp &&
(*itr).ep == segment.ep) {
*itr = segment;
break;
}
}
}
bool SegmentMan::segmentFileExists() {
if(!isSplittable) {
return false;
}
string segFilename = getSegmentFilePath();
File f(segFilename);
if(f.isFile()) {
logger->info(MSG_SEGMENT_FILE_EXISTS, segFilename.c_str());
return true;
} else {
logger->info(MSG_SEGMENT_FILE_DOES_NOT_EXIST, segFilename.c_str());
return false;
}
}
void SegmentMan::load() {
if(!isSplittable) {
return;
}
string segFilename = getSegmentFilePath();
logger->info(MSG_LOADING_SEGMENT_FILE, segFilename.c_str());
FILE* segFile = openSegFile(segFilename, "r+");
read(segFile);
fclose(segFile);
logger->info(MSG_LOADED_SEGMENT_FILE);
for(vector<Segment>::iterator itr = segments.begin(); itr != segments.end();
itr++) {
(*itr).cuid = 0;
}
}
void SegmentMan::save() {
if(!isSplittable) {
return;
}
string segFilename = getSegmentFilePath();
logger->info(MSG_SAVING_SEGMENT_FILE, segFilename.c_str());
FILE* segFile = openSegFile(segFilename, "w");
for(vector<Segment>::iterator itr = segments.begin(); itr != segments.end(); itr++) {
if(fwrite(&*itr, sizeof(Segment), 1, segFile) < 1) {
throw new DlAbortEx(strerror(errno));
}
}
fclose(segFile);
logger->info(MSG_SAVED_SEGMENT_FILE);
}
FILE* SegmentMan::openSegFile(string segFilename, string mode) {
FILE* segFile = fopen(segFilename.c_str(), mode.c_str());
if(segFile == NULL) {
throw new DlAbortEx(strerror(errno));
}
return segFile;
}
void SegmentMan::read(FILE* file) {
assert(file != NULL);
while(1) {
Segment seg;
if(fread(&seg, sizeof(Segment), 1, file) < 1) {
if(ferror(file)) {
throw new DlAbortEx(strerror(errno));
} else if(feof(file)) {
break;
}
}
segments.push_back(seg);
}
}
void SegmentMan::remove() {
if(!isSplittable) {
return;
}
if(segmentFileExists()) {
File f(getSegmentFilePath());
f.remove();
}
}
bool SegmentMan::finished() {
if(!downloadStarted || segments.size() == 0) {
return false;
}
for(vector<Segment>::iterator itr = segments.begin(); itr != segments.end(); itr++) {
if(!(*itr).finish) {
return false;
}
}
return true;
}
void SegmentMan::removeIfFinished() {
if(finished()) {
remove();
}
}
long long int SegmentMan::getDownloadedSize() {
long long int size = 0;
for(vector<Segment>::iterator itr = segments.begin(); itr != segments.end(); itr++) {
size += (*itr).ds;
}
return size;
}

164
src/SegmentMan.h Normal file
View file

@ -0,0 +1,164 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_SEGMENT_MAN_H_
#define _D_SEGMENT_MAN_H_
#include <vector>
#include "common.h"
#include "Logger.h"
#include "Segment.h"
using namespace std;
#define SEGMENT_FILE_EXTENSION ".aria2"
/**
* This class holds the download progress of the one download entry.
*/
class SegmentMan {
private:
void read(FILE* file);
FILE* openSegFile(string segFilename, string mode);
public:
/**
* The total number of bytes to download.
* If Transfer-Encoding is Chunked or Content-Length header is not provided,
* then this value is set to be 0.
*/
long long int totalSize;
/**
* Represents whether this download is splittable.
* In Split download(or segmented download), http client establishes
* more than one connections to the server, and downloads sevral parts of
* a file at the same time. This boosts download speed.
* This value is true by default. If total number of bytes is not known or
* Chunked transfer encoding is used, then this value is set to be 0 by
* DownloadCommand class.
*/
bool isSplittable;
/**
* Represents whether the download is start or not.
* The default value is false.
*/
bool downloadStarted;
/**
* Holds segments.
*/
vector<Segment> segments;
/**
* Respresents the file name of the downloaded file.
* If the URL does not contain file name part(http://www.rednoah.com/, for
* example), this value may be 0 length string.
* The default value is 0 length string.
*/
string filename;
/**
* directory to store a file
*/
string dir;
/**
* User defined file name for downloaded content
*/
string ufilename;
Logger* logger;
SegmentMan();
~SegmentMan();
/**
* Returns dir+"/"+filename.
* If filename is empty, then returns dir+"/"+"inex.html";
*/
string getFilePath() {
return (dir == "" ? "." : dir)+"/"+
(ufilename == "" ?
(filename == "" ? "index.html" : filename) : ufilename);
}
string getSegmentFilePath() {
return getFilePath()+SEGMENT_FILE_EXTENSION;
}
/**
* Sets the cuid of the holded segments with specified cuid to 0.
*/
void unregisterId(int cuid);
/**
* There is a segment available for DownloadCommand specified by cuid,
* fills segment and returns true.
* There is no segment available, then returns false and segment is
* undefined in this case.
*
* @param segment segment to attach for cuid.
* @param cuid cuid of DownloadCommand.
* @returns true: there is a segment available, false: there is no segment
* available.
*/
bool getSegment(Segment& segment, int cuid);
/**
* Updates the ds value of the specified segment.
* Only a segment x is updated where x.sp == sgment.sp &amp;&amp; x.ep ==
* segment.ep &amp;&amp; x.ds == segment.ds &amp;&amp;x.cuid == segment.cuid
* is true.
*
* @param segment segment to update
*/
void updateSegment(const Segment& segment);
/**
* Returns true only if the segment data file exists.
* The file name of the segment data is filename appended by ".aria2".
* If isSplittable is false, then returns simply false without any operation.
*/
bool segmentFileExists();
/**
* Loads the segment data file.
* If isSplittable is false, then returns without any operation.
*/
void load();
/**
* Saves the segment data file.
* If isSplittable is false, then returns without any operation.
*/
void save();
/**
* Removes the segment data file.
* If isSplittable is false, then returns without any operation.
*/
void remove();
/**
* Returs true when the download has finished.
* If downloadStarted is false or the number of the segments of this object
* holds is 0, then returns false.
*/
bool finished();
/**
* if finished() is true, then call remove()
*/
void removeIfFinished();
/**
* Returns the total number of bytes to be downloaded.
*/
long long int getDownloadedSize();
};
#endif // _D_SEGMENT_MAN_H_

103
src/SimpleLogger.cc Normal file
View file

@ -0,0 +1,103 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "SimpleLogger.h"
#include <stdarg.h>
SimpleLogger::SimpleLogger(string filename) {
file = fopen(filename.c_str(), "a");
}
SimpleLogger::SimpleLogger(FILE* logfile) {
file = logfile;
}
SimpleLogger::~SimpleLogger() {
if(file != NULL) {
fclose(file);
}
}
void SimpleLogger::writeLog(int level, string msg, va_list ap, Exception* e) {
string levelStr;
switch(level) {
case DEBUG:
levelStr = "DEBUG";
break;
case ERROR:
levelStr = "ERROR";
break;
case INFO:
default:
levelStr = "INFO";
}
vfprintf(file, string(levelStr+" - "+msg+"\n").c_str(), ap);
if(e != NULL) {
fprintf(file, string(levelStr+" - exception: "+e->getMsg()+"\n").c_str());
}
fflush(stdout);
}
void SimpleLogger::debug(string msg, ...) {
va_list ap;
va_start(ap, msg);
writeLog(DEBUG, msg, ap);
va_end(ap);
}
void SimpleLogger::debug(string msg, Exception* e, ...) {
va_list ap;
va_start(ap, e);
writeLog(DEBUG, msg, ap, e);
va_end(ap);
}
void SimpleLogger::info(string msg, ...) {
va_list ap;
va_start(ap, msg);
writeLog(INFO, msg, ap);
va_end(ap);
}
void SimpleLogger::info(string msg, Exception* e, ...) {
va_list ap;
va_start(ap, e);
writeLog(INFO, msg, ap, e);
va_end(ap);
}
void SimpleLogger::error(string msg, ...) {
va_list ap;
va_start(ap, msg);
writeLog(ERROR, msg, ap);
va_end(ap);
}
void SimpleLogger::error(string msg, Exception* e, ...) {
va_list ap;
va_start(ap, e);
writeLog(ERROR, msg, ap, e);
va_end(ap);
}

49
src/SimpleLogger.h Normal file
View file

@ -0,0 +1,49 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_SIMPLE_LOGGER_H_
#define _D_SIMPLE_LOGGER_H_
#include "Logger.h"
class SimpleLogger:public Logger {
private:
enum LEVEL {
DEBUG,
INFO,
ERROR};
void writeLog(int level, string msg, va_list ap, Exception* e = NULL);
FILE* file;
public:
SimpleLogger(string filename);
SimpleLogger(FILE* logfile);
~SimpleLogger();
void debug(string msg, ...);
void debug(string msg, Exception* ex, ...);
void info(string msg, ...);
void info(string msg, Exception* ex, ...);
void error(string msg, ...);
void error(string msg, Exception* ex, ...);
};
#endif // _D_SIMPLE_LOGGER_H_

50
src/SleepCommand.cc Normal file
View file

@ -0,0 +1,50 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "SleepCommand.h"
#include "Util.h"
#define WAIT_SEC 5
SleepCommand::SleepCommand(int cuid, DownloadEngine* e, Command* nextCommand):
Command(cuid), engine(e), nextCommand(nextCommand) {
gettimeofday(&checkPoint, NULL);
}
SleepCommand::~SleepCommand() {
if(nextCommand != NULL) {
delete(nextCommand);
}
}
bool SleepCommand::execute() {
struct timeval now;
gettimeofday(&now, NULL);
if(Util::difftv(now, checkPoint) >= WAIT_SEC*1000000) {
engine->commands.push(nextCommand);
nextCommand = NULL;
return true;
} else {
engine->commands.push(this);
return false;
}
}

40
src/SleepCommand.h Normal file
View file

@ -0,0 +1,40 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_SLEEP_COMMAND_H_
#define _D_SLEEP_COMMAND_H_
#include "DownloadEngine.h"
#include "Command.h"
#include <sys/time.h>
class SleepCommand:public Command {
private:
DownloadEngine* engine;
Command* nextCommand;
struct timeval checkPoint;
public:
SleepCommand(int cuid, DownloadEngine* e, Command* nextCommand);
~SleepCommand();
bool execute();
};
#endif // _D_SLEEP_COMMAND_H_

164
src/Socket.cc Normal file
View file

@ -0,0 +1,164 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "Socket.h"
#include <unistd.h>
#include <fcntl.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <netdb.h>
#include "DlRetryEx.h"
#include "DlAbortEx.h"
#include <errno.h>
Socket::Socket():sockfd(-1) {}
Socket::Socket(const Socket& s) {
sockfd = dup(s.sockfd);
}
Socket::~Socket() {
closeConnection();
}
Socket& Socket::operator=(const Socket& s) {
if(this != &s) {
closeConnection();
sockfd = dup(s.sockfd);
}
return *this;
}
void Socket::establishConnection(string host, int port) {
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if(sockfd >= 0) {
socklen_t sockopt = 1;
if(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &sockopt, sizeof(int)) < 0) {
close(sockfd);
sockfd = -1;
throw new DlAbortEx(strerror(errno));
}
} else {
throw new DlAbortEx(strerror(errno));
}
struct sockaddr_in sockaddr;
memset((char*)&sockaddr, 0, sizeof(sockaddr));
sockaddr.sin_family = AF_INET;
sockaddr.sin_port = htons(port);
if(inet_aton(host.c_str(), &sockaddr.sin_addr)) {
// ok
} else {
struct addrinfo ai;
ai.ai_flags = 0;
ai.ai_family = PF_INET;
ai.ai_socktype = SOCK_STREAM;
ai.ai_protocol = 0;
ai.ai_addr = (struct sockaddr*)&sockaddr;
struct addrinfo* res;
int ec;
if((ec = getaddrinfo(host.c_str(), NULL, &ai, &res)) != 0) {
throw new DlAbortEx(gai_strerror(ec));
}
sockaddr.sin_addr = ((struct sockaddr_in*)res->ai_addr)->sin_addr;
freeaddrinfo(res);
}
// make socket non-blocking mode
int flags = fcntl(sockfd, F_GETFL, 0);
fcntl(sockfd, F_SETFL, flags|O_NONBLOCK);
if(connect(sockfd, (struct sockaddr*)&sockaddr, (socklen_t)sizeof(sockaddr)) == -1 && errno != EINPROGRESS) {
throw new DlAbortEx(strerror(errno));
}
}
void Socket::setNonBlockingMode() {
int flags = fcntl(sockfd, F_GETFL, 0);
fcntl(sockfd, F_SETFL, flags&~O_NONBLOCK);
}
void Socket::closeConnection() {
if(sockfd != -1) {
close(sockfd);
sockfd = -1;
}
}
bool Socket::isWritable(int timeout) {
fd_set fds;
FD_ZERO(&fds);
FD_SET(sockfd, &fds);
struct timeval tv;
tv.tv_sec = timeout;
tv.tv_usec = 0;
int r = select(sockfd+1, NULL, &fds, NULL, &tv);
if(r == 1) {
return true;
} else if(r == 0) {
// time out
return false;
} else {
throw new DlRetryEx(strerror(errno));
}
}
bool Socket::isReadable(int timeout) {
fd_set fds;
FD_ZERO(&fds);
FD_SET(sockfd, &fds);
struct timeval tv;
tv.tv_sec = timeout;
tv.tv_usec = 0;
int r = select(sockfd+1, &fds, NULL, NULL, &tv);
if(r == 1) {
return true;
} else if(r == 0) {
// time out
return false;
} else {
throw new DlRetryEx(strerror(errno));
}
}
void Socket::writeData(const char* data, int len, int timeout) {
if(!isWritable(timeout) || send(sockfd, data, (size_t)len, 0) != len) {
throw new DlRetryEx(strerror(errno));
}
}
void Socket::readData(char* data, int& len, int timeout) {
if(!isReadable(timeout) || (len = recv(sockfd, data, (size_t)len, 0)) < 0) {
throw new DlRetryEx(strerror(errno));
}
}
void Socket::peekData(char* data, int& len, int timeout) {
if(!isReadable(timeout) || (len = recv(sockfd, data, (size_t)len, MSG_PEEK)) < 0) {
throw new DlRetryEx(strerror(errno));
}
}

76
src/Socket.h Normal file
View file

@ -0,0 +1,76 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_SOCKET_H_
#define _D_SOCKET_H_
#include <string>
using namespace std;
class Socket {
public:
// socket endpoint descriptor
int sockfd;
public:
Socket();
Socket(const Socket& s);
~Socket();
Socket& operator=(const Socket& s);
/**
* Connects to the server named host and the destination port is port.
* This method make socket non-blocking mode.
* To make the socket blocking mode, call setNonBlockingMode() after
* the connection is established.
*/
void establishConnection(string host, int port);
void setNonBlockingMode();
// Closes the connection which this socket object has
void closeConnection();
// examines whether the socket of this Socket object is available for writing.
// returns true if the socket is available for writing, otherwise returns false.
bool isWritable(int timeout);
// examines whether the socket of this Socket object is available for reading.
// returns true if the socket is available for reading, otherwise returns false.
bool isReadable(int timeout);
// writes characters into the socket. data is a pointer pointing the first
// byte of the data and len is the length of the data.
void writeData(const char* data, int len, int timeout = 5);
// Reads up to len bytes from this socket.
// data is a pointer pointing the first
// byte of the data, which must be allocated before this method is called.
// len is the size of the allocated memory. When this method returns
// successfully, len is replaced by the size of the read data.
void readData(char* data, int& len, int timeout = 5);
// Reads up to len bytes from this socket, but bytes are not removed from
// this socket.
void peekData(char* data, int& len, int timeout = 5);
};
#endif // _D_SOCKET_H_

33
src/SocketIOException.h Normal file
View file

@ -0,0 +1,33 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_SOCKET_IO_EXCEPTION_H_
#define _D_SOCKET_IO_EXCEPTION_H_
#include "DlRetryEx.h"
class SocketIOException:public DlRetryEx {
public:
SocketIOException():DlRetryEx() {};
SocketIOException(string msg):DlRetryEx(msg) {};
};
#endif // _D_SOCKET_IO_EXCEPTION_H_

36
src/TimeoutException.h Normal file
View file

@ -0,0 +1,36 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_TIMEOUT_EXCEPTION_H_
#define _D_TIMEOUT_EXCEPTION_H_
class TimeoutException {
public:
int err;
string msg;
public:
TimeoutException():err(0), msg("") {};
TimeoutException(int err):err(err), msg("") {};
TimeoutException(string msg):err(0), msg(msg) {};
TimeoutException(int err, string msg):err(err), msg(msg) {}
};
#endif // _D_TIMEOUT_EXCEPTION_H_

35
src/TransferEncoding.h Normal file
View file

@ -0,0 +1,35 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_TRANSFER_ENCODING_H_
#define _D_TRANSFER_ENCODING_H_
class TransferEncoding {
public:
virtual ~TransferEncoding() {}
virtual void init() = 0;
virtual void inflate(char* outbuf, int& outlen, const char* inbuf, int inlen) = 0;
virtual bool finished() = 0;
virtual void end() = 0;
};
#endif // _D_TRANSFER_ENCODING_H_

110
src/Util.cc Normal file
View file

@ -0,0 +1,110 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "Util.h"
string Util::itos(int value, bool comma) {
string str = llitos(value, comma);
return str;
}
string Util::llitos(long long int value, bool comma)
{
string str;
bool flag = false;
if(value < 0) {
flag = true;
value = -value;
} else if(value == 0) {
str = "0";
return str;
}
int count = 0;
while(value) {
++count;
char digit = value%10+'0';
str.insert(str.begin(), digit);
value /= 10;
if(comma && count > 3 && count%3 == 1) {
str.insert(str.begin()+1, ',');
}
}
if(flag) {
str.insert(str.begin(), '-');
}
return str;
}
string Util::trim(string src) {
unsigned int sp = src.find_first_not_of(" ");
unsigned int ep = src.find_last_not_of(" ");
if(sp == string::npos || ep == string::npos) {
return "";
} else {
return src.substr(sp, ep-sp+1);
}
}
void Util::split(pair<string, string>& hp, string src, char delim) {
hp.first = "";
hp.second = "";
unsigned int p = src.find(delim);
if(p == string::npos) {
hp.first = src;
hp.second = "";
} else {
hp.first = trim(src.substr(0, p));
hp.second = trim(src.substr(p+1));
/*
unsigned int p2 = src.find_first_not_of(" ", p+1);
if(p2 == string::npos) {
hp.second = "";
} else {
hp.second = src.substr(p2);
}
*/
}
}
long long int Util::difftv(struct timeval tv1, struct timeval tv2) {
if(tv1.tv_sec < tv2.tv_sec || tv1.tv_sec == tv2.tv_sec && tv1.tv_usec < tv2.tv_usec) {
return 0;
}
return ((tv1.tv_sec-tv2.tv_sec)*1000000+
tv1.tv_usec-tv2.tv_usec);
}
void Util::slice(vector<string>& result, string src, char delim) {
int p = 0;
while(1) {
unsigned int np = src.find(delim, p);
if(np == string::npos) {
string term = trim(src.substr(p));
if(term.size() > 0) {
result.push_back(term);
}
break;
}
string term = src.substr(p, np-p);
p = np+1;
result.push_back(trim(term));
}
}

54
src/Util.h Normal file
View file

@ -0,0 +1,54 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_UTIL_H_
#define _D_UTIL_H_
#include <string>
#include <utility>
#include <vector>
#include <sys/time.h>
using namespace std;
#define STRTOLL(X) strtoll(X, (char**)NULL, 10);
class Util {
public:
static void split(pair<string, string>& hp, string src, char delim);
static string llitos(long long int value, bool comma = false);
static string itos(int value, bool comma = false);
/**
* Computes difference in milli second between tv1 and tv2,
* assuming tv1 is newer than tv2.
* If tv1 is older than tv2, then this method returns 0.
*/
static long long int difftv(struct timeval tv1, struct timeval tv2);
/**
* Take a string src which is a deliminated list and add its elements
* into result. result is not cleared before conversion begins.
*/
static void slice(vector<string>& result, string src, char delim);
static string trim(string src);
};
#endif // _D_UTIL_H_

28
src/common.h Normal file
View file

@ -0,0 +1,28 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include <iostream>
#include <assert.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
using namespace std;

290
src/main.cc Normal file
View file

@ -0,0 +1,290 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#include "HttpInitiateConnectionCommand.h"
#include "DownloadEngine.h"
#include "SegmentMan.h"
#include "SimpleLogger.h"
#include "common.h"
#include "DefaultDiskWriter.h"
#include "Util.h"
#include "InitiateConnectionCommandFactory.h"
#include <vector>
#include <algorithm>
#include <signal.h>
#include <unistd.h>
#include <libgen.h>
#include <utility>
extern char* optarg;
extern int optind, opterr, optopt;
#include <getopt.h>
using namespace std;
void clearRequest(Request* req) {
delete(req);
}
DownloadEngine* e;
void handler(int signal) {
cout << "\nSIGINT signal received." << endl;
e->segmentMan->save();
if(e->diskWriter != NULL) {
e->diskWriter->closeFile();
}
exit(0);
}
void addCommand(int cuid, const char* url, vector<Request*> requests) {
Request* req = new Request();
if(req->setUrl(url)) {
e->commands.push(InitiateConnectionCommandFactory::createInitiateConnectionCommand(cuid, req, e));
requests.push_back(req);
} else {
cerr << "Unrecognized URL or unsupported protocol: " << req->getUrl() << endl;
delete(req);
}
}
void showVersion() {
cout << PACKAGE_NAME << " version " << PACKAGE_VERSION << endl;
cout << "Copyright (C) 2006 Tatsuhiro Tsujikawa" << endl;
cout << endl;
cout << "This program is free software; you can redistribute it and/or modify" << endl;
cout << "it under the terms of the GNU General Public License as published by" << endl;
cout << "the Free Software Foundation; either version 2 of the License, or" << endl;
cout << "(at your option) any later version." << endl;
cout << endl;
cout << "This program is distributed in the hope that it will be useful," << endl;
cout << "but WITHOUT ANY WARRANTY; without even the implied warranty of" << endl;
cout << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" << endl;
cout << "GNU General Public License for more details." << endl;
cout << endl;
cout << "You should have received a copy of the GNU General Public License" << endl;
cout << "along with this program; if not, write to the Free Software" << endl;
cout << "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" << endl;
cout << endl;
cout << "Contact Info: Tasuhiro Tsujikawa <tujikawa at rednoah dot com>" << endl;
cout << endl;
}
void showUsage() {
cout << "Usage: " << PACKAGE_NAME << " [options] URL ..." << endl;
cout << "Options:" << endl;
cout << " -d, --dir=DIR The directory to store downloaded file." << endl;
cout << " -o, --out=FILE The file name for downloaded file." << endl;
cout << " -l, --log=LOG The file path to store log. If '-' is specified," << endl;
cout << " log is written to stdout." << endl;
cout << " -D, --daemon Run as daemon." << endl;
cout << " -s, --split=N Download a file using s connections. s must be" << endl;
cout << " between 1 and 5. If this option is specified the" << endl;
cout << " first URL is used, and the other URLs are ignored." << endl;
cout << " --http-proxy=HOST:PORT Use HTTP proxy server. This affects to all" << endl;
cout << " URLs." << endl;
cout << " --http-user=USER Set HTTP user. This affects to all URLs." << endl;
cout << " --http-passwd=PASSWD Set HTTP password. This affects to all URLs." << endl;
cout << " --http-proxy-user=USER Set HTTP proxy user. This affects to all URLs" << endl;
cout << " --http-proxy-passwd=PASSWD Set HTTP proxy password. This affects to all URLs." << endl;
cout << " --http-auth-scheme=SCHEME Set HTTP authentication scheme. Currently, BASIC" << endl;
cout << " is the only supported scheme." << endl;
cout << " -v, --version Print the version number and exit." << endl;
cout << " -h, --help Print this message and exit." << endl;
cout << "URL:" << endl;
cout << " You can specify multiple URLs. All URLs must point to the same file" << endl;
cout << " or a download fails." << endl;
cout << "Examples:" << endl;
cout << " Download a file by 1 connection:" << endl;
cout << " aria2c http://AAA.BBB.CCC/file.zip" << endl;
cout << " Download a file by 2 connections:" << endl;
cout << " aria2c -s 2 http://AAA.BBB.CCC/file.zip" << endl;
cout << " Download a file by 2 connections, each connects to a different server." << endl;
cout << " aria2c http://AAA.BBB.CCC/file.zip http://DDD.EEE.FFF/GGG/file.zip" << endl;
cout << "Reports bugs to <tujikawa at rednoah dot com>" << endl;
}
int main(int argc, char* argv[]) {
bool stdoutLog = false;
string logfile;
string dir;
string ufilename;
int split = 0;
bool daemonMode = false;
int c;
Option* op = new Option();
while(1) {
int optIndex = 0;
int lopt;
static struct option longOpts[] = {
{ "daemon", no_argument, NULL, 'D' },
{ "dir", required_argument, NULL, 'd' },
{ "out", required_argument, NULL, 'o' },
{ "log", required_argument, NULL, 'l' },
{ "split", required_argument, NULL, 's' },
{ "http-proxy", required_argument, &lopt, 1 },
{ "http-user", required_argument, &lopt, 2 },
{ "http-passwd", required_argument, &lopt, 3 },
{ "http-proxy-user", required_argument, &lopt, 4 },
{ "http-proxy-passwd", required_argument, &lopt, 5 },
{ "http-auth-scheme", required_argument, &lopt, 6 },
{ "version", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
{ 0, 0, 0, 0 }
};
c = getopt_long(argc, argv, "Dd:o:l:s:vh", longOpts, &optIndex);
if(c == -1) {
break;
}
switch(c) {
case 0:{
switch(lopt) {
case 1: {
pair<string, string> proxy;
Util::split(proxy, optarg, ':');
int port = (int)strtol(proxy.second.c_str(), NULL, 10);
if(proxy.first.empty() || proxy.second.empty() ||
!(0 < port && port <= 65535)) {
cerr << "unrecognized proxy format" << endl;
showUsage();
exit(1);
}
op->put("http_proxy_host", proxy.first);
op->put("http_proxy_port", proxy.second);
op->put("http_proxy_enabled", "true");
break;
}
case 2:
op->put("http_user", optarg);
break;
case 3:
op->put("http_passwd", optarg);
break;
case 4:
op->put("http_proxy_user", optarg);
op->put("http_proxy_auth_enabled", "true");
break;
case 5:
op->put("http_proxy_passwd", optarg);
break;
case 6:
if(string("BASIC") == optarg) {
op->put("http_auth_scheme", "BASIC");
} else {
cerr << "Currently, supported authentication scheme is BASIC." << endl;
}
break;
}
break;
}
case 'D':
daemonMode = true;
break;
case 'd':
dir = optarg;
break;
case 'o':
ufilename = optarg;
break;
case 'l':
if(strcmp("-", optarg) == 0) {
stdoutLog = true;
} else {
logfile = optarg;
}
break;
case 's':
split = (int)strtol(optarg, NULL, 10);
if(!(1 < split && split < 5)) {
cerr << "split must be between 1 and 5." << endl;
showUsage();
exit(1);
}
break;
case 'v':
showVersion();
exit(0);
case 'h':
showUsage();
exit(0);
default:
showUsage();
exit(1);
}
}
if(optind == argc) {
cerr << "specify at least one URL" << endl;
showUsage();
exit(1);
}
if(daemonMode) {
if(daemon(1, 1) < 0) {
perror("daemon failed");
exit(1);
}
}
SimpleLogger* logger;
if(stdoutLog) {
logger = new SimpleLogger(stdout);
} else if(logfile.size()) {
logger = new SimpleLogger(logfile);
} else {
logger = new SimpleLogger("/dev/null");
}
e = new DownloadEngine();
e->logger = logger;
e->option = op;
e->diskWriter = new DefaultDiskWriter();
e->segmentMan = new SegmentMan();
e->segmentMan->dir = dir;
e->segmentMan->ufilename = ufilename;
e->segmentMan->logger = logger;
vector<Request*> requests;
if(split > 0) {
for(int i = 1; i <= split; i++) {
addCommand(i, argv[optind], requests);
}
} else {
for(int i = 1; optind < argc; i++) {
addCommand(i, argv[optind++], requests);
}
}
struct sigaction sigact;
sigact.sa_handler = handler;
sigact.sa_flags = 0;
sigemptyset(&sigact.sa_mask);
sigaction(SIGINT, &sigact, NULL);
e->run();
for_each(requests.begin(), requests.end(), clearRequest);
requests.clear();
delete(logger);
delete(e->segmentMan);
delete(e->option);
delete(e->diskWriter);
delete(e);
return 0;
}

55
src/message.h Normal file
View file

@ -0,0 +1,55 @@
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_MESSAGE_H_
#define _D_MESSAGE_H_
#define MSG_DOWNLOAD_COMPLETED "CUID#%d - The download for one segment completed successfully."
#define MSG_NO_SEGMENT_AVAILABLE "CUID#%d - No segment available."
#define MSG_CONNECTING_TO_SERVER "CUID#%d - Connecting to %s:%d"
#define MSG_SEGMENT_CHANGED "CUID#%d - The segment changed. We send the request again with new Range header."
#define MSG_REDIRECT "CUID#%d - Redirecting to %s"
#define MSG_SENDING_HTTP_REQUEST "CUID#%d - Sending the request:\n%s"
#define MSG_RECEIVE_RESPONSE "CUID#%d - Response received:\n%s"
#define MSG_DOWNLOAD_ABORTED "CUID#%d - Download aborted."
#define MSG_RESTARTING_DOWNLOAD "CUID#%d - Restarting the download."
#define MSG_MAX_RETRY "CUID#%d - The retry count reached its max value. Download aborted."
#define MSG_SEGMENT_FILE_EXISTS "The segment file %s exists."
#define MSG_SEGMENT_FILE_DOES_NOT_EXIST "The segment file %s does not exist."
#define MSG_SAVING_SEGMENT_FILE "Saving the segment file %s"
#define MSG_SAVED_SEGMENT_FILE "The segment file was saved successfully."
#define MSG_LOADING_SEGMENT_FILE "Loading the segment file %s."
#define MSG_LOADED_SEGMENT_FILE "The segment file was loaded successfully."
#define EX_TIME_OUT "Timeout."
#define EX_INVALID_CHUNK_SIZE "Invalid chunk size."
#define EX_TOO_LARGE_CHUNK "Too large chunk. size = %d"
#define EX_INVALID_HEADER "Invalid header."
#define EX_NO_HEADER "No header found."
#define EX_NO_STATUS_HEADER "No status header."
#define EX_PROXY_CONNECTION_FAILED "Proxy connection failed."
#define EX_FILENAME_MISMATCH "The requested filename and the previously registered one are not same. %s != %s"
#define EX_BAD_STATUS "The response status is not successful. status = %d"
#define EX_TOO_LARGE_FILE "Too large file size. size = %d"
#define EX_TRANSFER_ENCODING_NOT_SUPPORTED "Transfer encoding %s is not supported."
#endif // _D_MESSAGE_H_

19
src/right.txt Normal file
View file

@ -0,0 +1,19 @@
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

1
stamp-h Normal file
View file

@ -0,0 +1 @@
timestamp

1
stamp-h.in Normal file
View file

@ -0,0 +1 @@
timestamp

1
test/4096chunk.txt Normal file
View file

@ -0,0 +1 @@
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

16
test/AllTest.cc Normal file
View file

@ -0,0 +1,16 @@
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
int main(int argc, char* argv[]) {
CppUnit::Test* suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
CppUnit::TextUi::TestRunner runner;
runner.addTest(suite);
runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), std::cerr));
// Run the tests.
bool successfull = runner.run();
return successfull ? 0 : 1;
}

34
test/Base64Test.cc Normal file
View file

@ -0,0 +1,34 @@
#include "Base64.h"
#include <string>
#include <cppunit/extensions/HelperMacros.h>
using namespace std;
class Base64Test:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(Base64Test);
CPPUNIT_TEST(testEncode);
CPPUNIT_TEST(testDecode);
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp() {
}
void testEncode();
void testDecode();
};
CPPUNIT_TEST_SUITE_REGISTRATION( Base64Test );
void Base64Test::testEncode() {
CPPUNIT_ASSERT_EQUAL(string("SGVsbG8gV29ybGQh"),
Base64::encode("Hello World!"));
}
void Base64Test::testDecode() {
CPPUNIT_ASSERT_EQUAL(string("Hello World!"),
Base64::decode("SGVsbG8gV29ybGQh"));
}

View file

@ -0,0 +1,69 @@
#include "ChunkedEncoding.h"
#include <fstream>
#include <iostream>
#include <string>
#include <cppunit/extensions/HelperMacros.h>
using namespace std;
class ChunkedEncodingTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(ChunkedEncodingTest);
CPPUNIT_TEST(testInflate1);
CPPUNIT_TEST(testInflateLargeChunk);
CPPUNIT_TEST_SUITE_END();
private:
ChunkedEncoding* enc;
public:
void setUp() {
enc = new ChunkedEncoding();
enc->init();
}
void testInflate1();
void testInflateLargeChunk();
};
CPPUNIT_TEST_SUITE_REGISTRATION( ChunkedEncodingTest );
void ChunkedEncodingTest::testInflate1() {
string msg = "a\r\n1234567890\r\n";
char buf[100];
int len = sizeof(buf);
enc->inflate(buf, len, msg.c_str(), msg.size());
buf[len] = '\0';
CPPUNIT_ASSERT_EQUAL(string("1234567890"), string(buf));
// second pass
len = sizeof(buf);
msg = "3;extensionIgnored\r\n123\r\n0\r\n";
enc->inflate(buf, len, msg.c_str(), msg.size());
buf[len] = '\0';
CPPUNIT_ASSERT_EQUAL(string("123"), string(buf));
// input is over
CPPUNIT_ASSERT(enc->finished());
}
void ChunkedEncodingTest::testInflateLargeChunk() {
// give over 4096 character chunk
fstream is("4096chunk.txt", ios::in);
if(is.fail()) {
CPPUNIT_FAIL("cannot open file 4096chunk.txt");
}
string body;
is >> body;
char buf[4097];
int len = sizeof(buf);
for(int i = 0; i < 2; i++) {
string msg = "1000\r\n"+body+"\r\n";
len = sizeof(buf);
enc->inflate(buf, len, msg.c_str(), msg.size());
buf[len] = '\0';
CPPUNIT_ASSERT_EQUAL(body, string(buf));
}
enc->inflate(buf, len, "0\r\n", 3);
CPPUNIT_ASSERT_EQUAL(0, len);
CPPUNIT_ASSERT(enc->finished());
}

90
test/CookieBoxTest.cc Normal file
View file

@ -0,0 +1,90 @@
#include "CookieBox.h"
#include <string>
#include <cppunit/extensions/HelperMacros.h>
using namespace std;
class CookieBoxTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(CookieBoxTest);
CPPUNIT_TEST(testParse);
CPPUNIT_TEST(testCriteriaFind);
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp() {
}
void testParse();
void testCriteriaFind();
};
CPPUNIT_TEST_SUITE_REGISTRATION( CookieBoxTest );
void CookieBoxTest::testParse() {
CookieBox box;
string str = "JSESSIONID=123456789; expires=Sat, 16-02-2006 19:38:00 JST; path=/; domain=localhost; secure";
Cookie c;
box.parse(c, str);
CPPUNIT_ASSERT_EQUAL(string("JSESSIONID"), c.name);
CPPUNIT_ASSERT_EQUAL(string("123456789"), c.value);
CPPUNIT_ASSERT_EQUAL(string("Sat, 16-02-2006 19:38:00 JST"), c.expires);
CPPUNIT_ASSERT_EQUAL(string("/"), c.path);
CPPUNIT_ASSERT_EQUAL(string("localhost"), c.domain);
CPPUNIT_ASSERT_EQUAL(true, c.secure);
string str2 = "JSESSIONID=123456789";
box.parse(c, str2);
CPPUNIT_ASSERT_EQUAL(string("JSESSIONID"), c.name);
CPPUNIT_ASSERT_EQUAL(string("123456789"), c.value);
CPPUNIT_ASSERT_EQUAL(string(""), c.expires);
CPPUNIT_ASSERT_EQUAL(string(""), c.path);
CPPUNIT_ASSERT_EQUAL(string(""), c.domain);
CPPUNIT_ASSERT_EQUAL(false, c.secure);
}
void CookieBoxTest::testCriteriaFind() {
Cookie c1("SESSIONID1", "1", "", "/downloads", "rednoah.com", false);
Cookie c2("SESSIONID2", "2", "", "/downloads", "rednoah.com", false);
Cookie c3("USER", "user", "", "/home", "aria.rednoah.com", false);
Cookie c4("PASS", "pass", "", "/downloads", "rednoah.com", true);
CookieBox box;
box.add(c1);
box.add(c2);
box.add(c3);
box.add(c4);
vector<Cookie> result1 = box.criteriaFind("rednoah.com", "/downloads", false);
CPPUNIT_ASSERT_EQUAL(2, (int)result1.size());
vector<Cookie>::iterator itr = result1.begin();
CPPUNIT_ASSERT_EQUAL(string("SESSIONID1=1"), (*itr).toString());
itr++;
CPPUNIT_ASSERT_EQUAL(string("SESSIONID2=2"), (*itr).toString());
result1 = box.criteriaFind("rednoah.com", "/downloads", true);
CPPUNIT_ASSERT_EQUAL(3, (int)result1.size());
itr = result1.begin();
CPPUNIT_ASSERT_EQUAL(string("SESSIONID1=1"), (*itr).toString());
itr++;
CPPUNIT_ASSERT_EQUAL(string("SESSIONID2=2"), (*itr).toString());
itr++;
CPPUNIT_ASSERT_EQUAL(string("PASS=pass"), (*itr).toString());
result1 = box.criteriaFind("aria.rednoah.com", "/", false);
CPPUNIT_ASSERT_EQUAL(0, (int)result1.size());
result1 = box.criteriaFind("aria.rednoah.com", "/home", false);
CPPUNIT_ASSERT_EQUAL(1, (int)result1.size());
itr = result1.begin();
CPPUNIT_ASSERT_EQUAL(string("USER=user"), (*itr).toString());
}

88
test/FileTest.cc Normal file
View file

@ -0,0 +1,88 @@
#include "File.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string>
#include <cppunit/extensions/HelperMacros.h>
using namespace std;
class FileTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(FileTest);
CPPUNIT_TEST(testExists);
CPPUNIT_TEST(testIsFile);
CPPUNIT_TEST(testIsDir);
CPPUNIT_TEST(testRemove);
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp() {
}
void testExists();
void testIsFile();
void testIsDir();
void testRemove();
};
CPPUNIT_TEST_SUITE_REGISTRATION( FileTest );
void FileTest::testExists() {
File f("FileTest.cc");
CPPUNIT_ASSERT(f.exists());
File f2("NonExistentFile");
CPPUNIT_ASSERT(!f2.exists());
File d1("../test");
CPPUNIT_ASSERT(d1.exists());
}
void FileTest::testIsFile() {
File f("FileTest.cc");
CPPUNIT_ASSERT(f.isFile());
File f2("NonExistentFile");
CPPUNIT_ASSERT(!f2.isFile());
File d1("../test");
CPPUNIT_ASSERT(!d1.isFile());
}
void FileTest::testIsDir() {
File f("FileTest.cc");
CPPUNIT_ASSERT(!f.isDir());
File f2("NonExistentFile");
CPPUNIT_ASSERT(!f2.isDir());
File d1("../test");
CPPUNIT_ASSERT(d1.isDir());
}
void FileTest::testRemove() {
int fd;
string name = "/tmp/aria2test";
if((fd = creat(name.c_str(), S_IRUSR|S_IWUSR)) < 0) {
CPPUNIT_FAIL("cannot create test file");
}
close(fd);
File f(name);
CPPUNIT_ASSERT(f.isFile());
CPPUNIT_ASSERT(f.remove());
CPPUNIT_ASSERT(!f.exists());
// delete the file again
CPPUNIT_ASSERT(!f.remove());
string dir = "/tmp/aria2testdir";
mkdir(dir.c_str(), 0777);
File d(dir);
CPPUNIT_ASSERT(d.exists());
CPPUNIT_ASSERT(d.remove());
CPPUNIT_ASSERT(!d.exists());
// delete the directory again
CPPUNIT_ASSERT(!d.remove());
}

13
test/Makefile.am Normal file
View file

@ -0,0 +1,13 @@
TESTS = aria2c
check_PROGRAMS = $(TESTS)
aria2c_SOURCES = AllTest.cc\
RequestTest.cc\
ChunkedEncodingTest.cc\
FileTest.cc\
OptionTest.cc\
Base64Test.cc\
UtilTest.cc\
CookieBoxTest.cc
aria2c_CXXFLAGS = ${CPPUNIT_CFLAGS} -I../src -Wall -D_FILE_OFFSET_BITS=64
aria2c_LDFLAGS = ${CPPUNIT_LIBS}
aria2c_LDADD = ../src/libaria2c.a

584
test/Makefile.in Normal file
View file

@ -0,0 +1,584 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
check_PROGRAMS = $(am__EXEEXT_1)
subdir = test
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__EXEEXT_1 = aria2c$(EXEEXT)
am_aria2c_OBJECTS = aria2c-AllTest.$(OBJEXT) \
aria2c-RequestTest.$(OBJEXT) \
aria2c-ChunkedEncodingTest.$(OBJEXT) aria2c-FileTest.$(OBJEXT) \
aria2c-OptionTest.$(OBJEXT) aria2c-Base64Test.$(OBJEXT) \
aria2c-UtilTest.$(OBJEXT) aria2c-CookieBoxTest.$(OBJEXT)
aria2c_OBJECTS = $(am_aria2c_OBJECTS)
aria2c_DEPENDENCIES = ../src/libaria2c.a
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
SOURCES = $(aria2c_SOURCES)
DIST_SOURCES = $(aria2c_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
CPPUNIT_LIBS = @CPPUNIT_LIBS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
TESTS = aria2c
aria2c_SOURCES = AllTest.cc\
RequestTest.cc\
ChunkedEncodingTest.cc\
FileTest.cc\
OptionTest.cc\
Base64Test.cc\
UtilTest.cc\
CookieBoxTest.cc
aria2c_CXXFLAGS = ${CPPUNIT_CFLAGS} -I../src -Wall -D_FILE_OFFSET_BITS=64
aria2c_LDFLAGS = ${CPPUNIT_LIBS}
aria2c_LDADD = ../src/libaria2c.a
all: all-am
.SUFFIXES:
.SUFFIXES: .cc .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu test/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
clean-checkPROGRAMS:
-test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
aria2c$(EXEEXT): $(aria2c_OBJECTS) $(aria2c_DEPENDENCIES)
@rm -f aria2c$(EXEEXT)
$(CXXLINK) $(aria2c_LDFLAGS) $(aria2c_OBJECTS) $(aria2c_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-AllTest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-Base64Test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-ChunkedEncodingTest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-CookieBoxTest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-FileTest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-OptionTest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-RequestTest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-UtilTest.Po@am__quote@
.cc.o:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
.cc.obj:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
aria2c-AllTest.o: AllTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-AllTest.o -MD -MP -MF "$(DEPDIR)/aria2c-AllTest.Tpo" -c -o aria2c-AllTest.o `test -f 'AllTest.cc' || echo '$(srcdir)/'`AllTest.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-AllTest.Tpo" "$(DEPDIR)/aria2c-AllTest.Po"; else rm -f "$(DEPDIR)/aria2c-AllTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='AllTest.cc' object='aria2c-AllTest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-AllTest.o `test -f 'AllTest.cc' || echo '$(srcdir)/'`AllTest.cc
aria2c-AllTest.obj: AllTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-AllTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-AllTest.Tpo" -c -o aria2c-AllTest.obj `if test -f 'AllTest.cc'; then $(CYGPATH_W) 'AllTest.cc'; else $(CYGPATH_W) '$(srcdir)/AllTest.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-AllTest.Tpo" "$(DEPDIR)/aria2c-AllTest.Po"; else rm -f "$(DEPDIR)/aria2c-AllTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='AllTest.cc' object='aria2c-AllTest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-AllTest.obj `if test -f 'AllTest.cc'; then $(CYGPATH_W) 'AllTest.cc'; else $(CYGPATH_W) '$(srcdir)/AllTest.cc'; fi`
aria2c-RequestTest.o: RequestTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-RequestTest.o -MD -MP -MF "$(DEPDIR)/aria2c-RequestTest.Tpo" -c -o aria2c-RequestTest.o `test -f 'RequestTest.cc' || echo '$(srcdir)/'`RequestTest.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-RequestTest.Tpo" "$(DEPDIR)/aria2c-RequestTest.Po"; else rm -f "$(DEPDIR)/aria2c-RequestTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RequestTest.cc' object='aria2c-RequestTest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-RequestTest.o `test -f 'RequestTest.cc' || echo '$(srcdir)/'`RequestTest.cc
aria2c-RequestTest.obj: RequestTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-RequestTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-RequestTest.Tpo" -c -o aria2c-RequestTest.obj `if test -f 'RequestTest.cc'; then $(CYGPATH_W) 'RequestTest.cc'; else $(CYGPATH_W) '$(srcdir)/RequestTest.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-RequestTest.Tpo" "$(DEPDIR)/aria2c-RequestTest.Po"; else rm -f "$(DEPDIR)/aria2c-RequestTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RequestTest.cc' object='aria2c-RequestTest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-RequestTest.obj `if test -f 'RequestTest.cc'; then $(CYGPATH_W) 'RequestTest.cc'; else $(CYGPATH_W) '$(srcdir)/RequestTest.cc'; fi`
aria2c-ChunkedEncodingTest.o: ChunkedEncodingTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-ChunkedEncodingTest.o -MD -MP -MF "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo" -c -o aria2c-ChunkedEncodingTest.o `test -f 'ChunkedEncodingTest.cc' || echo '$(srcdir)/'`ChunkedEncodingTest.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo" "$(DEPDIR)/aria2c-ChunkedEncodingTest.Po"; else rm -f "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ChunkedEncodingTest.cc' object='aria2c-ChunkedEncodingTest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-ChunkedEncodingTest.o `test -f 'ChunkedEncodingTest.cc' || echo '$(srcdir)/'`ChunkedEncodingTest.cc
aria2c-ChunkedEncodingTest.obj: ChunkedEncodingTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-ChunkedEncodingTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo" -c -o aria2c-ChunkedEncodingTest.obj `if test -f 'ChunkedEncodingTest.cc'; then $(CYGPATH_W) 'ChunkedEncodingTest.cc'; else $(CYGPATH_W) '$(srcdir)/ChunkedEncodingTest.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo" "$(DEPDIR)/aria2c-ChunkedEncodingTest.Po"; else rm -f "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ChunkedEncodingTest.cc' object='aria2c-ChunkedEncodingTest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-ChunkedEncodingTest.obj `if test -f 'ChunkedEncodingTest.cc'; then $(CYGPATH_W) 'ChunkedEncodingTest.cc'; else $(CYGPATH_W) '$(srcdir)/ChunkedEncodingTest.cc'; fi`
aria2c-FileTest.o: FileTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-FileTest.o -MD -MP -MF "$(DEPDIR)/aria2c-FileTest.Tpo" -c -o aria2c-FileTest.o `test -f 'FileTest.cc' || echo '$(srcdir)/'`FileTest.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-FileTest.Tpo" "$(DEPDIR)/aria2c-FileTest.Po"; else rm -f "$(DEPDIR)/aria2c-FileTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FileTest.cc' object='aria2c-FileTest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-FileTest.o `test -f 'FileTest.cc' || echo '$(srcdir)/'`FileTest.cc
aria2c-FileTest.obj: FileTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-FileTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-FileTest.Tpo" -c -o aria2c-FileTest.obj `if test -f 'FileTest.cc'; then $(CYGPATH_W) 'FileTest.cc'; else $(CYGPATH_W) '$(srcdir)/FileTest.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-FileTest.Tpo" "$(DEPDIR)/aria2c-FileTest.Po"; else rm -f "$(DEPDIR)/aria2c-FileTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FileTest.cc' object='aria2c-FileTest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-FileTest.obj `if test -f 'FileTest.cc'; then $(CYGPATH_W) 'FileTest.cc'; else $(CYGPATH_W) '$(srcdir)/FileTest.cc'; fi`
aria2c-OptionTest.o: OptionTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-OptionTest.o -MD -MP -MF "$(DEPDIR)/aria2c-OptionTest.Tpo" -c -o aria2c-OptionTest.o `test -f 'OptionTest.cc' || echo '$(srcdir)/'`OptionTest.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-OptionTest.Tpo" "$(DEPDIR)/aria2c-OptionTest.Po"; else rm -f "$(DEPDIR)/aria2c-OptionTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OptionTest.cc' object='aria2c-OptionTest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-OptionTest.o `test -f 'OptionTest.cc' || echo '$(srcdir)/'`OptionTest.cc
aria2c-OptionTest.obj: OptionTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-OptionTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-OptionTest.Tpo" -c -o aria2c-OptionTest.obj `if test -f 'OptionTest.cc'; then $(CYGPATH_W) 'OptionTest.cc'; else $(CYGPATH_W) '$(srcdir)/OptionTest.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-OptionTest.Tpo" "$(DEPDIR)/aria2c-OptionTest.Po"; else rm -f "$(DEPDIR)/aria2c-OptionTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OptionTest.cc' object='aria2c-OptionTest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-OptionTest.obj `if test -f 'OptionTest.cc'; then $(CYGPATH_W) 'OptionTest.cc'; else $(CYGPATH_W) '$(srcdir)/OptionTest.cc'; fi`
aria2c-Base64Test.o: Base64Test.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-Base64Test.o -MD -MP -MF "$(DEPDIR)/aria2c-Base64Test.Tpo" -c -o aria2c-Base64Test.o `test -f 'Base64Test.cc' || echo '$(srcdir)/'`Base64Test.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-Base64Test.Tpo" "$(DEPDIR)/aria2c-Base64Test.Po"; else rm -f "$(DEPDIR)/aria2c-Base64Test.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Base64Test.cc' object='aria2c-Base64Test.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-Base64Test.o `test -f 'Base64Test.cc' || echo '$(srcdir)/'`Base64Test.cc
aria2c-Base64Test.obj: Base64Test.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-Base64Test.obj -MD -MP -MF "$(DEPDIR)/aria2c-Base64Test.Tpo" -c -o aria2c-Base64Test.obj `if test -f 'Base64Test.cc'; then $(CYGPATH_W) 'Base64Test.cc'; else $(CYGPATH_W) '$(srcdir)/Base64Test.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-Base64Test.Tpo" "$(DEPDIR)/aria2c-Base64Test.Po"; else rm -f "$(DEPDIR)/aria2c-Base64Test.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Base64Test.cc' object='aria2c-Base64Test.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-Base64Test.obj `if test -f 'Base64Test.cc'; then $(CYGPATH_W) 'Base64Test.cc'; else $(CYGPATH_W) '$(srcdir)/Base64Test.cc'; fi`
aria2c-UtilTest.o: UtilTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-UtilTest.o -MD -MP -MF "$(DEPDIR)/aria2c-UtilTest.Tpo" -c -o aria2c-UtilTest.o `test -f 'UtilTest.cc' || echo '$(srcdir)/'`UtilTest.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-UtilTest.Tpo" "$(DEPDIR)/aria2c-UtilTest.Po"; else rm -f "$(DEPDIR)/aria2c-UtilTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UtilTest.cc' object='aria2c-UtilTest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-UtilTest.o `test -f 'UtilTest.cc' || echo '$(srcdir)/'`UtilTest.cc
aria2c-UtilTest.obj: UtilTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-UtilTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-UtilTest.Tpo" -c -o aria2c-UtilTest.obj `if test -f 'UtilTest.cc'; then $(CYGPATH_W) 'UtilTest.cc'; else $(CYGPATH_W) '$(srcdir)/UtilTest.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-UtilTest.Tpo" "$(DEPDIR)/aria2c-UtilTest.Po"; else rm -f "$(DEPDIR)/aria2c-UtilTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UtilTest.cc' object='aria2c-UtilTest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-UtilTest.obj `if test -f 'UtilTest.cc'; then $(CYGPATH_W) 'UtilTest.cc'; else $(CYGPATH_W) '$(srcdir)/UtilTest.cc'; fi`
aria2c-CookieBoxTest.o: CookieBoxTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-CookieBoxTest.o -MD -MP -MF "$(DEPDIR)/aria2c-CookieBoxTest.Tpo" -c -o aria2c-CookieBoxTest.o `test -f 'CookieBoxTest.cc' || echo '$(srcdir)/'`CookieBoxTest.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-CookieBoxTest.Tpo" "$(DEPDIR)/aria2c-CookieBoxTest.Po"; else rm -f "$(DEPDIR)/aria2c-CookieBoxTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CookieBoxTest.cc' object='aria2c-CookieBoxTest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-CookieBoxTest.o `test -f 'CookieBoxTest.cc' || echo '$(srcdir)/'`CookieBoxTest.cc
aria2c-CookieBoxTest.obj: CookieBoxTest.cc
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-CookieBoxTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-CookieBoxTest.Tpo" -c -o aria2c-CookieBoxTest.obj `if test -f 'CookieBoxTest.cc'; then $(CYGPATH_W) 'CookieBoxTest.cc'; else $(CYGPATH_W) '$(srcdir)/CookieBoxTest.cc'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-CookieBoxTest.Tpo" "$(DEPDIR)/aria2c-CookieBoxTest.Po"; else rm -f "$(DEPDIR)/aria2c-CookieBoxTest.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CookieBoxTest.cc' object='aria2c-CookieBoxTest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-CookieBoxTest.obj `if test -f 'CookieBoxTest.cc'; then $(CYGPATH_W) 'CookieBoxTest.cc'; else $(CYGPATH_W) '$(srcdir)/CookieBoxTest.cc'; fi`
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list='$(TESTS)'; \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
echo "XPASS: $$tst"; \
;; \
*) \
echo "PASS: $$tst"; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xfail=`expr $$xfail + 1`; \
echo "XFAIL: $$tst"; \
;; \
*) \
failed=`expr $$failed + 1`; \
echo "FAIL: $$tst"; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
echo "SKIP: $$tst"; \
fi; \
done; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="All $$all tests passed"; \
else \
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all tests failed"; \
else \
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
skipped="($$skip tests were not run)"; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
test -z "$$skipped" || echo "$$skipped"; \
test -z "$$report" || echo "$$report"; \
echo "$$dashes"; \
test "$$failed" -eq 0; \
else :; fi
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
clean-checkPROGRAMS clean-generic ctags distclean \
distclean-compile distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

40
test/OptionTest.cc Normal file
View file

@ -0,0 +1,40 @@
#include "Option.h"
#include <string>
#include <cppunit/extensions/HelperMacros.h>
using namespace std;
class OptionTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(OptionTest);
CPPUNIT_TEST(testPutAndGet);
CPPUNIT_TEST(testPutAndGetAsInt);
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp() {
}
void testPutAndGet();
void testPutAndGetAsInt();
};
CPPUNIT_TEST_SUITE_REGISTRATION( OptionTest );
void OptionTest::testPutAndGet() {
Option op;
op.put("key", "value");
CPPUNIT_ASSERT(op.defined("key"));
CPPUNIT_ASSERT_EQUAL(string("value"), op.get("key"));
}
void OptionTest::testPutAndGetAsInt() {
Option op;
op.put("key", "1000");
CPPUNIT_ASSERT(op.defined("key"));
CPPUNIT_ASSERT_EQUAL(1000, op.getAsInt("key"));
}

184
test/RequestTest.cc Normal file
View file

@ -0,0 +1,184 @@
#include "Request.h"
#include <cppunit/extensions/HelperMacros.h>
class RequestTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(RequestTest);
CPPUNIT_TEST(testSetUrl1);
CPPUNIT_TEST(testSetUrl2);
CPPUNIT_TEST(testSetUrl3);
CPPUNIT_TEST(testSetUrl4);
CPPUNIT_TEST(testSetUrl5);
CPPUNIT_TEST(testSetUrl6);
CPPUNIT_TEST(testSetUrl7);
CPPUNIT_TEST(testSetUrl8);
CPPUNIT_TEST(testSetUrl9);
CPPUNIT_TEST(testSetUrl10);
CPPUNIT_TEST(testRedirectUrl);
CPPUNIT_TEST(testResetUrl);
CPPUNIT_TEST(testSafeChar);
CPPUNIT_TEST_SUITE_END();
public:
void testSetUrl1();
void testSetUrl2();
void testSetUrl3();
void testSetUrl4();
void testSetUrl5();
void testSetUrl6();
void testSetUrl7();
void testSetUrl8();
void testSetUrl9();
void testSetUrl10();
void testRedirectUrl();
void testResetUrl();
void testSafeChar();
};
CPPUNIT_TEST_SUITE_REGISTRATION( RequestTest );
void RequestTest::testSetUrl1() {
Request req;
bool v = req.setUrl("http://aria.rednoah.com/");
CPPUNIT_ASSERT(v);
CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com/"), req.getUrl());
CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com/"), req.getCurrentUrl());
CPPUNIT_ASSERT_EQUAL(string("http"), req.getProtocol());
CPPUNIT_ASSERT_EQUAL(80, req.getPort());
CPPUNIT_ASSERT_EQUAL(string("aria.rednoah.com"), req.getHost());
CPPUNIT_ASSERT_EQUAL(string("/"), req.getDir());
CPPUNIT_ASSERT_EQUAL(string(""), req.getFile());
}
void RequestTest::testSetUrl2() {
Request req;
bool v = req.setUrl("http://aria.rednoah.com:8080/index.html");
CPPUNIT_ASSERT(v);
CPPUNIT_ASSERT_EQUAL(string("http"), req.getProtocol());
CPPUNIT_ASSERT_EQUAL(8080, req.getPort());
CPPUNIT_ASSERT_EQUAL(string("aria.rednoah.com"), req.getHost());
CPPUNIT_ASSERT_EQUAL(string("/"), req.getDir());
CPPUNIT_ASSERT_EQUAL(string("index.html"), req.getFile());
}
void RequestTest::testSetUrl3() {
Request req;
bool v = req.setUrl("http://aria.rednoah.com/aria2/index.html");
CPPUNIT_ASSERT(v);
CPPUNIT_ASSERT_EQUAL(string("http"), req.getProtocol());
CPPUNIT_ASSERT_EQUAL(80, req.getPort());
CPPUNIT_ASSERT_EQUAL(string("aria.rednoah.com"), req.getHost());
CPPUNIT_ASSERT_EQUAL(string("/aria2"), req.getDir());
CPPUNIT_ASSERT_EQUAL(string("index.html"), req.getFile());
}
void RequestTest::testSetUrl4() {
Request req;
bool v = req.setUrl("http://aria.rednoah.com/aria2/aria3/index.html");
CPPUNIT_ASSERT(v);
CPPUNIT_ASSERT_EQUAL(string("http"), req.getProtocol());
CPPUNIT_ASSERT_EQUAL(80, req.getPort());
CPPUNIT_ASSERT_EQUAL(string("aria.rednoah.com"), req.getHost());
CPPUNIT_ASSERT_EQUAL(string("/aria2/aria3"), req.getDir());
CPPUNIT_ASSERT_EQUAL(string("index.html"), req.getFile());
}
void RequestTest::testSetUrl5() {
Request req;
bool v = req.setUrl("http://aria.rednoah.com/aria2/aria3/");
CPPUNIT_ASSERT(v);
CPPUNIT_ASSERT_EQUAL(string("http"), req.getProtocol());
CPPUNIT_ASSERT_EQUAL(80, req.getPort());
CPPUNIT_ASSERT_EQUAL(string("aria.rednoah.com"), req.getHost());
CPPUNIT_ASSERT_EQUAL(string("/aria2/aria3"), req.getDir());
CPPUNIT_ASSERT_EQUAL(string(""), req.getFile());
}
void RequestTest::testSetUrl6() {
Request req;
bool v = req.setUrl("http://aria.rednoah.com/aria2/aria3");
CPPUNIT_ASSERT(v);
CPPUNIT_ASSERT_EQUAL(string("http"), req.getProtocol());
CPPUNIT_ASSERT_EQUAL(80, req.getPort());
CPPUNIT_ASSERT_EQUAL(string("aria.rednoah.com"), req.getHost());
CPPUNIT_ASSERT_EQUAL(string("/aria2"), req.getDir());
CPPUNIT_ASSERT_EQUAL(string("aria3"), req.getFile());
}
void RequestTest::testSetUrl7() {
Request req;
bool v = req.setUrl("http://");
CPPUNIT_ASSERT(!v);
}
void RequestTest::testSetUrl8() {
Request req;
bool v = req.setUrl("http:/aria.rednoah.com");
CPPUNIT_ASSERT(!v);
}
void RequestTest::testSetUrl9() {
Request req;
bool v = req.setUrl("h");
CPPUNIT_ASSERT(!v);
}
void RequestTest::testSetUrl10() {
Request req;
bool v = req.setUrl("");
CPPUNIT_ASSERT(!v);
}
void RequestTest::testRedirectUrl() {
Request req;
bool v = req.setUrl("http://aria.rednoah.com:8080/aria2/index.html");
bool v2 = req.redirectUrl("http://aria.rednoah.co.jp/");
CPPUNIT_ASSERT(v2);
// url must be the same
CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com:8080/aria2/index.html"),
req.getUrl());
// currentUrl must be updated
CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.co.jp/"), req.getCurrentUrl());
CPPUNIT_ASSERT_EQUAL(string("http"), req.getProtocol());
CPPUNIT_ASSERT_EQUAL(string("aria.rednoah.co.jp"), req.getHost());
CPPUNIT_ASSERT_EQUAL(80, req.getPort());
CPPUNIT_ASSERT_EQUAL(string("/"), req.getDir());
CPPUNIT_ASSERT_EQUAL(string(""), req.getFile());
}
void RequestTest::testResetUrl() {
Request req;
bool v = req.setUrl("http://aria.rednoah.com:8080/aria2/index.html");
bool v2 = req.redirectUrl("ftp://aria.rednoah.co.jp/");
bool v3 = req.resetUrl();
CPPUNIT_ASSERT(v3);
// currentUrl must equal to url
CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com:8080/aria2/index.html"), req.getUrl());
CPPUNIT_ASSERT_EQUAL(req.getUrl(), req.getCurrentUrl());
CPPUNIT_ASSERT_EQUAL(string("http"), req.getProtocol());
CPPUNIT_ASSERT_EQUAL(8080, req.getPort());
CPPUNIT_ASSERT_EQUAL(string("aria.rednoah.com"), req.getHost());
CPPUNIT_ASSERT_EQUAL(string("/aria2"), req.getDir());
CPPUNIT_ASSERT_EQUAL(string("index.html"), req.getFile());
}
void RequestTest::testSafeChar() {
Request req;
bool v = req.setUrl("http://aria.rednoah.com/|<>");
CPPUNIT_ASSERT(!v);
}

27
test/RequestToString.cc Normal file
View file

@ -0,0 +1,27 @@
#ifndef _D_REQUEST_TO_STRING_H_
#define _D_REQUEST_TO_STRING_H_
#include "Util.h"
#include "Request.h"
#include <string>
using namespace std;
class RequestToString {
private:
Request* req;
public:
RequestToString(Request* req) {
this->req = req;
}
string toString() {
return "url = "+req->url+"\n"+
"protocol = "+req->protocol+"\n"+
"host = "+req->host+"\n"+
"port = "+Util::ulitos(req->port)+"\n"+
"dir = "+req->dir+"\n"+
"file = "+req->file;
}
#endif // _D_REQUEST_TO_STRING_H_

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