Compare commits
28 Commits
curl-6_5
...
curl-6_5_1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a2d2569c7d | ||
![]() |
9e4d9346a7 | ||
![]() |
9efd212745 | ||
![]() |
d75b87605d | ||
![]() |
211b9e552d | ||
![]() |
bc5c4b8953 | ||
![]() |
7826133bff | ||
![]() |
ba37e24abd | ||
![]() |
fe43488fc5 | ||
![]() |
fb071e04c1 | ||
![]() |
f78a69b7d5 | ||
![]() |
f9a839d906 | ||
![]() |
ff3fd842d8 | ||
![]() |
35140201b5 | ||
![]() |
b4fc921a0a | ||
![]() |
339bdd1e08 | ||
![]() |
e3ef8b66a1 | ||
![]() |
739b3f241d | ||
![]() |
d48939c0c0 | ||
![]() |
0aa3f705c2 | ||
![]() |
14253f34f4 | ||
![]() |
ab05797500 | ||
![]() |
8629719e0e | ||
![]() |
570b4c3b59 | ||
![]() |
333c21b8cc | ||
![]() |
8898ff9e04 | ||
![]() |
912fd9b165 | ||
![]() |
5992252b3d |
56
BUGS
Normal file
56
BUGS
Normal file
@@ -0,0 +1,56 @@
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
BUGS
|
||||
|
||||
Curl has grown substantially from that day, several years ago, when I
|
||||
started fiddling with it. When I write this, there are 16500 lines of source
|
||||
code, and by the time you read this it has probably grown even more.
|
||||
|
||||
Of course there are lots of bugs left. And lots of misfeatures.
|
||||
|
||||
To help us make curl the stable and solid product we want it to be, we need
|
||||
bug reports and bug fixes. If you can't fix a bug yourself and submit a fix
|
||||
for it, try to report an as detailed report as possible to the curl mailing
|
||||
list to allow one of us to have a go at a solution. You should also post
|
||||
your bug/problem at curl's bug tracking system over at
|
||||
|
||||
http://sourceforge.net/bugs/?group_id=976
|
||||
|
||||
When reporting a bug, you should include information that will help us
|
||||
understand what's wrong, what's expected and how to repeat it. You therefore
|
||||
need to supply your operating system's name and version number (uname -a
|
||||
under a unix is fine), what version of curl you're using (curl -v is fine),
|
||||
what URL you were working with and anything else you think matters.
|
||||
|
||||
If curl crashed, causing a core dump (in unix), there is hardly any use to
|
||||
send that huge file to anyone of us. Unless we have an exact same system
|
||||
setup as you, we can't do much with it. What we instead ask of you is to get
|
||||
a stack trace and send that (much smaller) output to us instead!
|
||||
|
||||
The address and how to subscribe to the mailing list is detailed in the
|
||||
README.curl file.
|
||||
|
||||
HOW TO GET A STACK TRACE with a common unix debugger
|
||||
====================================================
|
||||
|
||||
First, you must make sure that you compile all sources with -g and that you
|
||||
don't 'strip' the final executable.
|
||||
|
||||
Run the program until it bangs.
|
||||
|
||||
Run your debugger on the core file, like '<debugger> curl core'. <debugger>
|
||||
should be replaced with the name of your debugger, in most cases that will
|
||||
be 'gdb', but 'dbx' and others also occur.
|
||||
|
||||
When the debugger has finnished loading the core file and presents you a
|
||||
prompt, you can give the compiler instructions. Enter 'where' (without the
|
||||
quotes) and press return.
|
||||
|
||||
The list that is presented is the stack trace. If everything worked, it is
|
||||
supposed to contain the chaing of functions that were called when curl
|
||||
crashed.
|
||||
|
44
CHANGES
44
CHANGES
@@ -6,7 +6,49 @@
|
||||
|
||||
History of Changes
|
||||
|
||||
Version XX
|
||||
Version 6.5.1
|
||||
|
||||
Daniel (20 March 2000):
|
||||
- An anynomous post on sourceforge correctly pointed out a possible buffer
|
||||
overflow in the curl_unescape() function for URL convertions. The main
|
||||
problem with this bug is that the ftp download uses that function and this
|
||||
single- byte overflow could lead to very odd bugs (as one reported by Janne
|
||||
Johansson).
|
||||
|
||||
Daniel (19 March 2000):
|
||||
- Marco G. Salvagno <mgs@whiz.cjb.net> supplied me with a series of patches
|
||||
that now allows curl to get compiled on OS/2. It even includes a section in
|
||||
the INSTALL file. Very nice job!
|
||||
|
||||
Daniel (17 March 2000):
|
||||
- Wham Bang <wham_bang@yahoo.com> (is that Pascal Gaudette?) supplied a patch
|
||||
for the lib/Makefile.vc6 file. We still need some fixes for the
|
||||
config-win32.h since it appears that VC++ and mingw32 have different
|
||||
opinions about (at least) unistd.h's existance.
|
||||
|
||||
Daniel (15 March 2000):
|
||||
- I modified the -D/--dump-header workings so that it doesn't write anything
|
||||
to the file until it needs to. This way, you can actually use -b and -D
|
||||
on the same file if you want repeated invokes to store and read the cookies
|
||||
in that one single file.
|
||||
|
||||
- Poked around in lots of texts. Added the BUGS file for bug reporting stuff.
|
||||
Added the classic HTTP POST question to the FAQ, removed some #ifdef WIN32
|
||||
stuff from the sources (they're covered by the config-win32.h now).
|
||||
|
||||
- Pascal Gaudette <pascal@gaudette.org> fixed a missing ldap.c problem in the
|
||||
Makefile.vc6 file. He also addressed a problem in src/config-win32.h.
|
||||
|
||||
Daniel (14 March 2000):
|
||||
- Paul Harrington pointed out that the 'http_code' variable in the -w output
|
||||
was never written. I fixed it now.
|
||||
|
||||
- Janne Johansson <jj@dynarc.se> reported the complaints that OpenBSD does
|
||||
when getdate.c #includes malloc.h. It claims stdlib.h should be included
|
||||
instead. I added #ifdef HAVE_MALLOC_H code in getdate.y and two checks in
|
||||
the configure.in for malloc.h and stdlib.h.
|
||||
|
||||
Version 6.5
|
||||
|
||||
Daniel (13 March 2000):
|
||||
- <curl@spam.wolvesbane.net> pointed out that the way curl sent cookies in a
|
||||
|
@@ -1,4 +1,10 @@
|
||||
Date: 1999-08-04
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
CONTRIBUTE
|
||||
|
||||
To Think About When Contributing Source Code
|
||||
|
||||
|
38
FAQ
38
FAQ
@@ -1,8 +1,13 @@
|
||||
Date: 19 November 1999
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Frequently Asked Questions about Curl
|
||||
FAQ
|
||||
|
||||
1. Problems connecting to SSL servers.
|
||||
Problems connecting to SSL servers.
|
||||
===================================
|
||||
|
||||
It took a very long time before I could sort out why curl had problems
|
||||
to connect to certain SSL servers when using SSLeay or OpenSSL v0.9+.
|
||||
@@ -17,11 +22,13 @@ Date: 19 November 1999
|
||||
I have also seen examples where the remote server didn't like the SSLv2
|
||||
request and instead you had to force curl to use SSLv3 with -3/--sslv3.
|
||||
|
||||
2. Does curl support resume?
|
||||
Does curl support resume?
|
||||
=========================
|
||||
|
||||
Yes. Both ways on FTP, download ways on HTTP.
|
||||
|
||||
3. Is libcurl thread safe?
|
||||
Is libcurl thread safe?
|
||||
=======================
|
||||
|
||||
Yes, as far as curl's own code goes. It does use system calls that often
|
||||
aren't thread safe in most environments, such as gethostbyname().
|
||||
@@ -29,3 +36,24 @@ Date: 19 November 1999
|
||||
I am very interested in once and for all getting some kind of report or
|
||||
README file from those who have used libcurl in a threaded environment,
|
||||
since I haven't and I get this question more and more frequently!
|
||||
|
||||
Why doesn't my posting using -F work?
|
||||
=====================================
|
||||
|
||||
You can't simply use -F or -d at your choice. The web server that will
|
||||
receive your post assumes one of the formats. If the form you're trying to
|
||||
"fake" sets the type to 'multipart/form-data', than and only then you must
|
||||
use the -F type. In all the most common cases, you should use -d which then
|
||||
causes a posting with the type 'application/x-www-form-urlencoded'.
|
||||
|
||||
Does curl support custom FTP commands?
|
||||
======================================
|
||||
|
||||
Yes it does, you can tell curl to perform optional commands both before
|
||||
and/or after a file transfer. Study the -Q/--quote option.
|
||||
|
||||
Since curl is used for file transfers, you don't use curl to just perform
|
||||
ftp commands without transfering anything. Therefore you must always specify
|
||||
a URL to transfer to/from even when doing custom FTP commands.
|
||||
|
||||
|
10
FEATURES
10
FEATURES
@@ -1,7 +1,16 @@
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
FEATURES
|
||||
|
||||
Misc
|
||||
- full URL syntax
|
||||
- custom maximum download time
|
||||
- custom least download speed acceptable
|
||||
- custom output result after completion
|
||||
- multiple URLs
|
||||
- guesses protocol from host name unless specified
|
||||
- uses .netrc
|
||||
@@ -21,6 +30,7 @@ HTTP
|
||||
- follow redirects
|
||||
- custom HTTP request
|
||||
- cookie get/send
|
||||
- understands the netscape cookie file
|
||||
- custom headers (that can replace internally generated headers)
|
||||
- custom user-agent string
|
||||
- custom referer string
|
||||
|
61
INSTALL
61
INSTALL
@@ -6,6 +6,37 @@
|
||||
|
||||
How To Compile
|
||||
|
||||
Curl has been compiled and built on numerous different operating systems. The
|
||||
way to proceed is mainly devided in two different ways: the unix way or the
|
||||
windows way.
|
||||
|
||||
If you're using Windows (95, 98, NT) or OS/2, you should continue reading from
|
||||
the Win32 header below. All other systems should be capable of being installed
|
||||
as described un the the UNIX header.
|
||||
|
||||
PORTS
|
||||
=====
|
||||
Just to show off, this is a probably incomplete list of known hardware and
|
||||
operating systems that curl has been compiled for:
|
||||
|
||||
Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7
|
||||
Sparc SunOS 4.1.*
|
||||
i386 Linux 1.3, 2.0, 2.2
|
||||
MIPS IRIX 6.2, 6.5
|
||||
HP-PA HP-UX
|
||||
Alpha DEC OSF 4
|
||||
i386 Solaris 2.7
|
||||
PowerPC Mac OS X
|
||||
Power AIX 4.3.1
|
||||
- Ultrix
|
||||
i386 FreeBSD
|
||||
i386 NetBSD
|
||||
i386 OpenBSD
|
||||
m68k OpenBSD
|
||||
i386 Windows 95, 98, NT
|
||||
i386 OS/2
|
||||
m68k AmigaOS 3
|
||||
|
||||
UNIX
|
||||
====
|
||||
|
||||
@@ -167,6 +198,36 @@ Win32
|
||||
the SSL libs and define the USE_SSLEAY symbol.
|
||||
|
||||
|
||||
IBM OS/2
|
||||
========
|
||||
|
||||
Building under OS/2 is not much different from building under unix.
|
||||
You need:
|
||||
|
||||
- emx 0.9d
|
||||
- GNU make
|
||||
- GNU patch
|
||||
- ksh
|
||||
- GNU bison
|
||||
- GNU file utilities
|
||||
- GNU sed
|
||||
- autoconf 2.13
|
||||
|
||||
If you want to build with OpenSSL, SSLeay, or OpenLDAP support, you'll
|
||||
need to download those libraries, too. Dirk Ohme has done some work to
|
||||
port SSL libraries under OS/2, but it looks like he doesn't care about emx.
|
||||
You'll find his patches on: http://come.to/Dirk.Ohme
|
||||
|
||||
If during the linking you get an error about _errno being an undefined
|
||||
symbol referenced from the text segment, you need to add -D__ST_MT_ERRNO__
|
||||
in your definitions.
|
||||
|
||||
If everything seems to work fine but there's no curl.exe, you need to add
|
||||
-Zexe to your linker flags.
|
||||
|
||||
If you're getting huge binaries, probably your makefiles have the -g in
|
||||
CFLAGS.
|
||||
|
||||
OpenSSL/SSLeay
|
||||
==============
|
||||
|
||||
|
16
README
16
README
@@ -26,3 +26,19 @@ README
|
||||
Sweden -- ftp://ftp.sunet.se/pub/www/utilities/curl/
|
||||
Germany -- ftp://ftp.fu-berlin.de/pub/unix/network/curl/
|
||||
China -- http://www.pshowing.com/curl/
|
||||
|
||||
To download the very latest source off the CVS server do this:
|
||||
|
||||
cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl login
|
||||
|
||||
(just press enter when asked for password)
|
||||
|
||||
cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl co .
|
||||
|
||||
(now, you'll get all the latest sources downloaded into your current
|
||||
directory. Note that this does not create a directory named curl or
|
||||
anything)
|
||||
|
||||
cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl logout
|
||||
|
||||
(you're off the hook!)
|
||||
|
51
README.curl
51
README.curl
@@ -135,9 +135,13 @@ UPLOADING
|
||||
|
||||
curl -T uploadfile -u user:passwd ftp://ftp.upload.com/
|
||||
|
||||
NOTE: Curl is not currently supporing ftp upload through a proxy! The reason
|
||||
for this is simply that proxies are seldomly configured to allow this and
|
||||
that no author has supplied code that makes it possible!
|
||||
Upload a local file to get appended to the remote file using ftp:
|
||||
|
||||
curl -T localfile -a ftp://ftp.upload.com/remotefile
|
||||
|
||||
NOTE: Curl does not support ftp upload through a proxy! The reason for this
|
||||
is simply that proxies are seldomly configured to allow this and that no
|
||||
author has supplied code that makes it possible!
|
||||
|
||||
HTTP
|
||||
|
||||
@@ -457,9 +461,9 @@ FTP and firewalls
|
||||
|
||||
HTTPS
|
||||
|
||||
Secure HTTP requires SSLeay to be installed and used when curl is built. If
|
||||
that is done, curl is capable of retrieving and posting documents using the
|
||||
HTTPS procotol.
|
||||
Secure HTTP requires SSL libraries to be installed and used when curl is
|
||||
built. If that is done, curl is capable of retrieving and posting documents
|
||||
using the HTTPS procotol.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -472,9 +476,10 @@ HTTPS
|
||||
browsers (Netscape and MSEI both use the so called PKCS#12 format). If you
|
||||
want curl to use the certificates you use with your (favourite) browser, you
|
||||
may need to download/compile a converter that can convert your browser's
|
||||
formatted certificates to PEM formatted ones. Dr Stephen N. Henson has
|
||||
written a patch for SSLeay that adds this functionality. You can get his
|
||||
patch (that requires an SSLeay installation) from his site at:
|
||||
formatted certificates to PEM formatted ones. This kind of converter is
|
||||
included in recent versions of OpenSSL, and for older versions Dr Stephen
|
||||
N. Henson has written a patch for SSLeay that adds this functionality. You
|
||||
can get his patch (that requires an SSLeay installation) from his site at:
|
||||
http://www.drh-consultancy.demon.co.uk/
|
||||
|
||||
Example on how to automatically retrieve a document using a certificate with
|
||||
@@ -601,6 +606,34 @@ ENVIRONMENT VARIABLES
|
||||
|
||||
The usage of the -x/--proxy flag overrides the environment variables.
|
||||
|
||||
NETRC
|
||||
|
||||
Unix introduced the .netrc concept a long time ago. It is a way for a user
|
||||
to specify name and password for commonly visited ftp sites in a file so
|
||||
that you don't have to type them in each time you visit those sites. You
|
||||
realize this is a big security risk if someone else gets hold of your
|
||||
passwords, so therefor most unix programs won't read this file unless it is
|
||||
only readable by yourself (curl doesn't care though).
|
||||
|
||||
Curl supports .netrc files if told so (using the -n/--netrc option). This is
|
||||
not restricted to only ftp, but curl can use it for all protocols where
|
||||
authentication is used.
|
||||
|
||||
A very simple .netrc file could look something like:
|
||||
|
||||
machine curl.haxx.nu login iamdaniel password mysecret
|
||||
|
||||
CUSTOM OUTPUT
|
||||
|
||||
To better allow script programmers to get to know about the progress of
|
||||
curl, the -w/--write-out option was introduced. Using this, you can specify
|
||||
what information from the previous transfer you want to extract.
|
||||
|
||||
To display the amount of bytes downloaded together with some text and an
|
||||
ending newline:
|
||||
|
||||
curl -w 'We downloaded %{size_download} bytes\n' www.download.com
|
||||
|
||||
MAILING LIST
|
||||
|
||||
We have an open mailing list to discuss curl, its development and things
|
||||
|
33
TODO
33
TODO
@@ -24,18 +24,17 @@ TODO
|
||||
|
||||
* HTTP Pipelining/persistant connections
|
||||
|
||||
- I'm gonna introduce HTTP "pipelining". Curl should be able
|
||||
to request for several HTTP documents in one connect. It is the beginning
|
||||
for supporing more advanced functions in the future, like web site
|
||||
- We should introduce HTTP "pipelining". Curl could be able to request for
|
||||
several HTTP documents in one connect. It would be the beginning for
|
||||
supporing more advanced functions in the future, like web site
|
||||
mirroring. This will require that the urlget() function supports several
|
||||
documents from a single HTTP server, which it doesn't today.
|
||||
|
||||
- When curl supports fetching several documents from the same
|
||||
server using pipelining, I'd like to offer that function to the command
|
||||
line. Anyone has a good idea how? The current way of specifying one URL
|
||||
with the output sent to the stdout or a file gets in the way. Imagine a
|
||||
syntax that supports "additional documents from the same server" in a way
|
||||
similar to:
|
||||
- When curl supports fetching several documents from the same server using
|
||||
pipelining, I'd like to offer that function to the command line. Anyone has
|
||||
a good idea how? The current way of specifying one URL with the output sent
|
||||
to the stdout or a file gets in the way. Imagine a syntax that supports
|
||||
"additional documents from the same server" in a way similar to:
|
||||
|
||||
curl <main URL> --more-doc <path> --more-doc <path>
|
||||
|
||||
@@ -52,12 +51,11 @@ TODO
|
||||
And some friendly person's server source code is available at
|
||||
http://hopf.math.nwu.edu/digestauth/index.html
|
||||
|
||||
Then there's the Apache mod_digest source code too of course.
|
||||
It seems as if Netscape doesn't support this, and not many servers
|
||||
do. Although this is a lot better authentication method than the more
|
||||
common "Basic". Basic sends the password in cleartext over the network,
|
||||
this "Digest" method uses a challange-response protocol which increases
|
||||
security quite a lot.
|
||||
Then there's the Apache mod_digest source code too of course. It seems as
|
||||
if Netscape doesn't support this, and not many servers do. Although this is
|
||||
a lot better authentication method than the more common "Basic". Basic
|
||||
sends the password in cleartext over the network, this "Digest" method uses
|
||||
a challange-response protocol which increases security quite a lot.
|
||||
|
||||
* Different FTP Upload Through Web Proxy
|
||||
I don't know any web proxies that allow CONNECT through on port 21, but
|
||||
@@ -88,3 +86,8 @@ TODO
|
||||
(http://search.ietf.org/internet-drafts/draft-murray-auth-ftp-ssl-05.txt)
|
||||
|
||||
* HTTP POST resume using Range:
|
||||
|
||||
* Make curl capable of verifying the server's certificate when connecting
|
||||
with HTTPS://.
|
||||
|
||||
* Make the timeout work as expected!
|
||||
|
@@ -169,3 +169,6 @@
|
||||
|
||||
/* Define if you have the setvbuf function. */
|
||||
#define HAVE_SETVBUF 1
|
||||
|
||||
/* Define if you have the RAND_screen function when using SSL */
|
||||
#define HAVE_RAND_SCREEN 1
|
||||
|
@@ -37,6 +37,9 @@
|
||||
/* The number of bytes in a long long. */
|
||||
#undef SIZEOF_LONG_LONG
|
||||
|
||||
/* Define if you have the RAND_screen function. */
|
||||
#undef HAVE_RAND_SCREEN
|
||||
|
||||
/* Define if you have the RAND_status function. */
|
||||
#undef HAVE_RAND_STATUS
|
||||
|
||||
@@ -121,6 +124,9 @@
|
||||
/* Define if you have the <io.h> header file. */
|
||||
#undef HAVE_IO_H
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the <net/if.h> header file. */
|
||||
#undef HAVE_NET_IF_H
|
||||
|
||||
@@ -160,6 +166,9 @@
|
||||
/* Define if you have the <ssl.h> header file. */
|
||||
#undef HAVE_SSL_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
|
@@ -2,7 +2,7 @@ dnl $Id$
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(lib/urldata.h)
|
||||
AM_CONFIG_HEADER(config.h src/config.h)
|
||||
AM_INIT_AUTOMAKE(curl,"6.5")
|
||||
AM_INIT_AUTOMAKE(curl,"6.5.1")
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
@@ -119,6 +119,8 @@ dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS( \
|
||||
unistd.h \
|
||||
malloc.h \
|
||||
stdlib.h \
|
||||
arpa/inet.h \
|
||||
net/if.h \
|
||||
netinet/in.h \
|
||||
@@ -183,7 +185,8 @@ AC_CHECK_FUNCS( socket \
|
||||
getpass \
|
||||
closesocket \
|
||||
setvbuf \
|
||||
RAND_status
|
||||
RAND_status \
|
||||
RAND_screen
|
||||
)
|
||||
|
||||
|
||||
|
12
curl.1
12
curl.1
@@ -193,7 +193,7 @@ Makes curl scan the
|
||||
file in the user's home directory for login name and password. This is
|
||||
typically used for ftp on unix. If used with http, curl will enable user
|
||||
authentication. See
|
||||
.BR netrc(4)
|
||||
.BR netrc(5)
|
||||
for details on the file format. Curl will not complain if that file
|
||||
hasn't the right permissions (it should not be world nor group
|
||||
readable). The environment variable "HOME" is used to find the home
|
||||
@@ -212,8 +212,9 @@ will output the data in chunks, not necessarily exactly when the data arrives.
|
||||
Using this option will disable that buffering.
|
||||
.IP "-o/--output <file>"
|
||||
Write output to <file> instead of stdout. If you are using {} or [] to fetch
|
||||
multiple documents, you can use #[num] in the <file> specifier. That variable
|
||||
will be replaced with the current string for the URL being fetched. Like in:
|
||||
multiple documents, you can use '#' followed by a number in the <file>
|
||||
specifier. That variable will be replaced with the current string for the URL
|
||||
being fetched. Like in:
|
||||
|
||||
curl http://{one,two}.site.com -o "file_#1.txt"
|
||||
|
||||
@@ -553,10 +554,10 @@ If you do find any (or have other suggestions), mail Daniel Stenberg
|
||||
- Linas Vepstas <linas@linas.org>
|
||||
- Bjorn Reese <breese@mail1.stofanet.dk>
|
||||
- Johan Anderson <johan@homemail.com>
|
||||
- Kjell Ericson <Kjell.Ericson@sth.frontec.se>
|
||||
- Kjell Ericson <Kjell.Ericson@haxx,nu>
|
||||
- Troy Engel <tengel@sonic.net>
|
||||
- Ryan Nelson <ryan@inch.com>
|
||||
- Bjorn Stenberg <Bjorn.Stenberg@sth.frontec.se>
|
||||
- Bjorn Stenberg <Bjorn.Stenberg@haxx.nu>
|
||||
- Angus Mackay <amackay@gus.ml.org>
|
||||
- Eric Young <eay@cryptsoft.com>
|
||||
- Simon Dick <simond@totally.irrelevant.org>
|
||||
@@ -586,6 +587,7 @@ If you do find any (or have other suggestions), mail Daniel Stenberg
|
||||
- Ellis Pritchard <ellis@citria.com>
|
||||
- Damien Adant <dams@usa.net>
|
||||
- Chris <cbayliss@csc.come>
|
||||
- Marco G. Salvagno <mgs@whiz.cjb.net>
|
||||
.SH WWW
|
||||
http://curl.haxx.nu
|
||||
.SH FTP
|
||||
|
@@ -7,7 +7,7 @@ AUTOMAKE_OPTIONS = foreign no-dependencies
|
||||
noinst_LIBRARIES = libcurl.a
|
||||
|
||||
# Some flags needed when trying to cause warnings ;-)
|
||||
CFLAGS = -g #-Wall -pedantic
|
||||
#CFLAGS = -g -Wall -pedantic
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
|
||||
|
@@ -36,6 +36,7 @@ RELEASE_OBJS= \
|
||||
formdatar.obj \
|
||||
ftpr.obj \
|
||||
httpr.obj \
|
||||
ldapr.obj \
|
||||
dictr.obj \
|
||||
telnetr.obj \
|
||||
getdater.obj \
|
||||
@@ -50,9 +51,9 @@ RELEASE_OBJS= \
|
||||
speedcheckr.obj \
|
||||
ssluser.obj \
|
||||
timevalr.obj \
|
||||
uploadr.obj \
|
||||
urlr.obj \
|
||||
filer.obj \
|
||||
writeoutr.obj \
|
||||
versionr.obj
|
||||
|
||||
DEBUG_OBJS= \
|
||||
@@ -63,6 +64,7 @@ DEBUG_OBJS= \
|
||||
formdatad.obj \
|
||||
ftpd.obj \
|
||||
httpd.obj \
|
||||
ldapd.obj \
|
||||
dictd.obj \
|
||||
telnetd.obj \
|
||||
getdated.obj \
|
||||
@@ -77,9 +79,9 @@ DEBUG_OBJS= \
|
||||
speedcheckd.obj \
|
||||
sslused.obj \
|
||||
timevald.obj \
|
||||
uploadd.obj \
|
||||
urld.obj \
|
||||
filed.obj \
|
||||
writeoutd.obj \
|
||||
versiond.obj
|
||||
|
||||
RELEASE_SSL_OBJS= \
|
||||
@@ -90,6 +92,7 @@ RELEASE_SSL_OBJS= \
|
||||
formdatars.obj \
|
||||
ftprs.obj \
|
||||
httprs.obj \
|
||||
ldaprs.obj \
|
||||
dictrs.obj \
|
||||
telnetrs.obj \
|
||||
getdaters.obj \
|
||||
@@ -104,9 +107,9 @@ RELEASE_SSL_OBJS= \
|
||||
speedcheckrs.obj \
|
||||
sslusers.obj \
|
||||
timevalrs.obj \
|
||||
uploadrs.obj \
|
||||
urlrs.obj \
|
||||
filers.obj \
|
||||
writeouts.obj \
|
||||
versionrs.obj
|
||||
|
||||
LINK_OBJS= \
|
||||
@@ -117,6 +120,7 @@ LINK_OBJS= \
|
||||
formdata.obj \
|
||||
ftp.obj \
|
||||
http.obj \
|
||||
ldap.obj \
|
||||
dict.obj \
|
||||
telnet.obj \
|
||||
getdate.obj \
|
||||
@@ -131,9 +135,9 @@ LINK_OBJS= \
|
||||
speedcheck.obj \
|
||||
ssluse.obj \
|
||||
timeval.obj \
|
||||
upload.obj \
|
||||
url.obj \
|
||||
file.obj \
|
||||
writeout.obj \
|
||||
version.obj
|
||||
|
||||
all : release
|
||||
@@ -163,6 +167,8 @@ ftpr.obj: ftp.c
|
||||
$(CCR) $(CFLAGS) ftp.c
|
||||
httpr.obj: http.c
|
||||
$(CCR) $(CFLAGS) http.c
|
||||
ldapr.obj: ldap.c
|
||||
$(CCR) $(CFLAGS) ldap.c
|
||||
dictr.obj: dict.c
|
||||
$(CCR) $(CFLAGS) dict.c
|
||||
telnetr.obj: telnet.c
|
||||
@@ -191,12 +197,12 @@ ssluser.obj: ssluse.c
|
||||
$(CCR) $(CFLAGS) ssluse.c
|
||||
timevalr.obj: timeval.c
|
||||
$(CCR) $(CFLAGS) timeval.c
|
||||
uploadr.obj: upload.c
|
||||
$(CCR) $(CFLAGS) upload.c
|
||||
urlr.obj: url.c
|
||||
$(CCR) $(CFLAGS) url.c
|
||||
filer.obj: file.c
|
||||
$(CCR) $(CFLAGS) file.c
|
||||
writeoutr.obj: writeout.c
|
||||
$(CCR) $(CFLAGS) writeout.c
|
||||
versionr.obj: version.c
|
||||
$(CCR) $(CFLAGS) version.c
|
||||
|
||||
@@ -215,6 +221,8 @@ ftpd.obj: ftp.c
|
||||
$(CCD) $(CFLAGS) ftp.c
|
||||
httpd.obj: http.c
|
||||
$(CCD) $(CFLAGS) http.c
|
||||
ldapd.obj: ldap.c
|
||||
$(CCR) $(CFLAGS) ldap.c
|
||||
dictd.obj: dict.c
|
||||
$(CCD) $(CFLAGS) dict.c
|
||||
telnetd.obj: telnet.c
|
||||
@@ -243,12 +251,12 @@ sslused.obj: ssluse.c
|
||||
$(CCD) $(CFLAGS) ssluse.c
|
||||
timevald.obj: timeval.c
|
||||
$(CCD) $(CFLAGS) timeval.c
|
||||
uploadd.obj: upload.c
|
||||
$(CCD) $(CFLAGS) upload.c
|
||||
urld.obj: url.c
|
||||
$(CCD) $(CFLAGS) url.c
|
||||
filed.obj: file.c
|
||||
$(CCD) $(CFLAGS) file.c
|
||||
writeoutd.obj: writeout.c
|
||||
$(CCR) $(CFLAGS) writeout.c
|
||||
versiond.obj: version.c
|
||||
$(CCD) $(CFLAGS) version.c
|
||||
|
||||
@@ -268,6 +276,8 @@ ftprs.obj: ftp.c
|
||||
$(CCRS) $(CFLAGS) ftp.c
|
||||
httprs.obj: http.c
|
||||
$(CCRS) $(CFLAGS) http.c
|
||||
ldaprs.obj: ldap.c
|
||||
$(CCR) $(CFLAGS) ldap.c
|
||||
dictrs.obj: dict.c
|
||||
$(CCRS) $(CFLAGS) dict.c
|
||||
telnetrs.obj: telnet.c
|
||||
@@ -296,12 +306,12 @@ sslusers.obj: ssluse.c
|
||||
$(CCRS) $(CFLAGS) ssluse.c
|
||||
timevalrs.obj: timeval.c
|
||||
$(CCRS) $(CFLAGS) timeval.c
|
||||
uploadrs.obj: upload.c
|
||||
$(CCRS) $(CFLAGS) upload.c
|
||||
urlrs.obj: url.c
|
||||
$(CCRS) $(CFLAGS) url.c
|
||||
filers.obj: file.c
|
||||
$(CCRS) $(CFLAGS) file.c
|
||||
writeoutrs.obj: writeout.c
|
||||
$(CCR) $(CFLAGS) writeout.c
|
||||
versionrs.obj: version.c
|
||||
$(CCRS) $(CFLAGS) version.c
|
||||
|
||||
|
@@ -322,7 +322,7 @@ Transfer (struct UrlData *data,
|
||||
/* obviously, the header is requested to be written to
|
||||
this file: */
|
||||
if((p - data->headerbuff) !=
|
||||
fwrite (data->headerbuff, 1, p - data->headerbuff,
|
||||
data->fwrite (data->headerbuff, 1, p - data->headerbuff,
|
||||
data->writeheader)) {
|
||||
failf (data, "Failed writing output");
|
||||
return URG_WRITE_ERROR;
|
||||
@@ -392,7 +392,8 @@ Transfer (struct UrlData *data,
|
||||
}
|
||||
if(data->writeheader) {
|
||||
/* the header is requested to be written to this file */
|
||||
if(hbuflen != fwrite (p, 1, hbuflen, data->writeheader)) {
|
||||
if(hbuflen != data->fwrite (p, 1, hbuflen,
|
||||
data->writeheader)) {
|
||||
failf (data, "Failed writing output");
|
||||
return URG_WRITE_ERROR;
|
||||
}
|
||||
|
@@ -47,7 +47,7 @@
|
||||
|
||||
char *curl_escape(char *string)
|
||||
{
|
||||
int alloc=strlen(string);
|
||||
int alloc=strlen(string)+1;
|
||||
char *ns = malloc(alloc);
|
||||
unsigned char in;
|
||||
int newlen = alloc;
|
||||
@@ -83,7 +83,7 @@ char *curl_escape(char *string)
|
||||
|
||||
char *curl_unescape(char *string)
|
||||
{
|
||||
int alloc = strlen(string);
|
||||
int alloc = strlen(string)+1;
|
||||
char *ns = malloc(alloc);
|
||||
unsigned char in;
|
||||
int index=0;
|
||||
|
@@ -118,10 +118,10 @@ UrgError file(struct UrlData *data, char *path, long *bytecountp)
|
||||
int fd;
|
||||
char *actual_path = curl_unescape(path);
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
int i;
|
||||
|
||||
/* change path separators from '/' to '\\' for Windows */
|
||||
/* change path separators from '/' to '\\' for Windows and OS/2 */
|
||||
for (i=0; actual_path[i] != '\0'; ++i)
|
||||
if (actual_path[i] == '/')
|
||||
actual_path[i] = '\\';
|
||||
|
20
lib/ftp.c
20
lib/ftp.c
@@ -244,13 +244,7 @@ static int GetLastResponse(int sockfd, char *buf,
|
||||
char *getmyhost(void)
|
||||
{
|
||||
static char myhost[256];
|
||||
#if !defined(WIN32) && !defined(HAVE_UNAME) && !defined(HAVE_GETHOSTNAME)
|
||||
/* We have no means of finding the local host name! */
|
||||
strcpy(myhost, "localhost");
|
||||
#endif
|
||||
#if defined(WIN32) || !defined(HAVE_UNAME)
|
||||
gethostname(myhost, 256);
|
||||
#else
|
||||
#ifdef HAVE_UNAME
|
||||
struct utsname ugnm;
|
||||
|
||||
if (uname(&ugnm) < 0)
|
||||
@@ -258,6 +252,13 @@ char *getmyhost(void)
|
||||
|
||||
(void) strncpy(myhost, ugnm.nodename, 255);
|
||||
myhost[255] = '\0';
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTNAME
|
||||
gethostname(myhost, 256);
|
||||
#endif
|
||||
#if !defined(HAVE_UNAME) && !defined(HAVE_GETHOSTNAME)
|
||||
/* We have no means of finding the local host name! */
|
||||
strcpy(myhost, "localhost");
|
||||
#endif
|
||||
return myhost;
|
||||
}
|
||||
@@ -425,7 +426,8 @@ UrgError _ftp(struct UrlData *data,
|
||||
}
|
||||
if(data->writeheader) {
|
||||
/* the header is requested to be written to this file */
|
||||
if(strlen(buf) != fwrite (buf, 1, strlen(buf), data->writeheader)) {
|
||||
if(strlen(buf) != data->fwrite (buf, 1, strlen(buf),
|
||||
data->writeheader)) {
|
||||
failf (data, "Failed writing output");
|
||||
return URG_WRITE_ERROR;
|
||||
}
|
||||
@@ -583,7 +585,7 @@ UrgError _ftp(struct UrlData *data,
|
||||
struct hostent * answer;
|
||||
|
||||
unsigned long address;
|
||||
#if defined(HAVE_INET_ADDR) || defined(WIN32)
|
||||
#if defined(HAVE_INET_ADDR)
|
||||
address = inet_addr(newhost);
|
||||
answer = gethostbyaddr((char *) &address, sizeof(address),
|
||||
AF_INET);
|
||||
|
413
lib/getdate.c
413
lib/getdate.c
@@ -1,25 +1,25 @@
|
||||
|
||||
/* A Bison parser, made from getdate.y
|
||||
by GNU Bison version 1.28 */
|
||||
/* A Bison parser, made from getdate.y with Bison version GNU Bison version 1.21
|
||||
*/
|
||||
|
||||
#define YYBISON 1 /* Identify Bison output. */
|
||||
|
||||
#define tAGO 257
|
||||
#define tDAY 258
|
||||
#define tDAY_UNIT 259
|
||||
#define tDAYZONE 260
|
||||
#define tDST 261
|
||||
#define tHOUR_UNIT 262
|
||||
#define tID 263
|
||||
#define tMERIDIAN 264
|
||||
#define tMINUTE_UNIT 265
|
||||
#define tMONTH 266
|
||||
#define tMONTH_UNIT 267
|
||||
#define tSEC_UNIT 268
|
||||
#define tSNUMBER 269
|
||||
#define tUNUMBER 270
|
||||
#define tYEAR_UNIT 271
|
||||
#define tZONE 272
|
||||
#define tAGO 258
|
||||
#define tDAY 259
|
||||
#define tDAY_UNIT 260
|
||||
#define tDAYZONE 261
|
||||
#define tDST 262
|
||||
#define tHOUR_UNIT 263
|
||||
#define tID 264
|
||||
#define tMERIDIAN 265
|
||||
#define tMINUTE_UNIT 266
|
||||
#define tMONTH 267
|
||||
#define tMONTH_UNIT 268
|
||||
#define tSEC_UNIT 269
|
||||
#define tSNUMBER 270
|
||||
#define tUNUMBER 271
|
||||
#define tYEAR_UNIT 272
|
||||
#define tZONE 273
|
||||
|
||||
#line 1 "getdate.y"
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/malloc.h>
|
||||
#else
|
||||
#include <malloc.h>
|
||||
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@@ -61,6 +61,12 @@
|
||||
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h> /* for `free'; used by Bison 1.27 */
|
||||
#else
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
@@ -206,11 +212,28 @@ static int yyRelSeconds;
|
||||
static int yyRelYear;
|
||||
|
||||
|
||||
#line 189 "getdate.y"
|
||||
#line 195 "getdate.y"
|
||||
typedef union {
|
||||
int Number;
|
||||
enum _MERIDIAN Meridian;
|
||||
} YYSTYPE;
|
||||
|
||||
#ifndef YYLTYPE
|
||||
typedef
|
||||
struct yyltype
|
||||
{
|
||||
int timestamp;
|
||||
int first_line;
|
||||
int first_column;
|
||||
int last_line;
|
||||
int last_column;
|
||||
char *text;
|
||||
}
|
||||
yyltype;
|
||||
|
||||
#define YYLTYPE yyltype
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef __cplusplus
|
||||
@@ -225,7 +248,7 @@ typedef union {
|
||||
#define YYFLAG -32768
|
||||
#define YYNTBASE 22
|
||||
|
||||
#define YYTRANSLATE(x) ((unsigned)(x) <= 272 ? yytranslate[x] : 32)
|
||||
#define YYTRANSLATE(x) ((unsigned)(x) <= 273 ? yytranslate[x] : 32)
|
||||
|
||||
static const char yytranslate[] = { 0,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
@@ -253,9 +276,9 @@ static const char yytranslate[] = { 0,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
|
||||
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
||||
17, 18
|
||||
2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
|
||||
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18
|
||||
};
|
||||
|
||||
#if YYDEBUG != 0
|
||||
@@ -289,22 +312,18 @@ static const short yyrhs[] = { -1,
|
||||
|
||||
#if YYDEBUG != 0
|
||||
static const short yyrline[] = { 0,
|
||||
205, 206, 209, 212, 215, 218, 221, 224, 227, 233,
|
||||
239, 248, 254, 266, 269, 272, 278, 282, 286, 292,
|
||||
296, 314, 320, 326, 330, 335, 339, 346, 354, 357,
|
||||
360, 363, 366, 369, 372, 375, 378, 381, 384, 387,
|
||||
390, 393, 396, 399, 402, 405, 408, 413, 446, 450
|
||||
211, 212, 215, 218, 221, 224, 227, 230, 233, 239,
|
||||
245, 254, 260, 272, 275, 278, 284, 288, 292, 298,
|
||||
302, 320, 326, 332, 336, 341, 345, 352, 360, 363,
|
||||
366, 369, 372, 375, 378, 381, 384, 387, 390, 393,
|
||||
396, 399, 402, 405, 408, 411, 414, 419, 452, 456
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
|
||||
|
||||
static const char * const yytname[] = { "$","error","$undefined.","tAGO","tDAY",
|
||||
static const char * const yytname[] = { "$","error","$illegal.","tAGO","tDAY",
|
||||
"tDAY_UNIT","tDAYZONE","tDST","tHOUR_UNIT","tID","tMERIDIAN","tMINUTE_UNIT",
|
||||
"tMONTH","tMONTH_UNIT","tSEC_UNIT","tSNUMBER","tUNUMBER","tYEAR_UNIT","tZONE",
|
||||
"':'","','","'/'","spec","item","time","zone","day","date","rel","relunit","number",
|
||||
"o_merid", NULL
|
||||
"o_merid",""
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -374,15 +393,14 @@ static const short yycheck[] = { 0,
|
||||
56
|
||||
};
|
||||
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
|
||||
#line 3 "/usr/lib/bison.simple"
|
||||
/* This file comes from bison-1.28. */
|
||||
#line 3 "/usr/gnu/lib/bison.simple"
|
||||
|
||||
/* Skeleton output parser for bison,
|
||||
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
|
||||
|
||||
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)
|
||||
the Free Software Foundation; either version 1, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -392,67 +410,43 @@ static const short yycheck[] = { 0,
|
||||
|
||||
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. */
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* As a special exception, when this file is copied by Bison into a
|
||||
Bison output file, you may use that output file without restriction.
|
||||
This special exception was added by the Free Software Foundation
|
||||
in version 1.24 of Bison. */
|
||||
|
||||
#ifndef alloca
|
||||
#ifdef __GNUC__
|
||||
#define alloca __builtin_alloca
|
||||
#else /* not GNU C. */
|
||||
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
|
||||
#include <alloca.h>
|
||||
#else /* not sparc */
|
||||
#if defined (MSDOS) && !defined (__TURBOC__)
|
||||
#include <malloc.h>
|
||||
#else /* not MSDOS, or __TURBOC__ */
|
||||
#if defined(_AIX)
|
||||
#include <malloc.h>
|
||||
#pragma alloca
|
||||
#else /* not MSDOS, __TURBOC__, or _AIX */
|
||||
#ifdef __hpux
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
void *alloca (unsigned int);
|
||||
};
|
||||
#else /* not __cplusplus */
|
||||
void *alloca (unsigned int);
|
||||
#endif /* not __cplusplus */
|
||||
#endif /* __hpux */
|
||||
#endif /* not _AIX */
|
||||
#endif /* not MSDOS, or __TURBOC__ */
|
||||
#endif /* not sparc. */
|
||||
#endif /* not GNU C. */
|
||||
#endif /* alloca not defined. */
|
||||
|
||||
/* This is the parser code that is written into each bison parser
|
||||
when the %semantic_parser declaration is not specified in the grammar.
|
||||
It was written by Richard Stallman by simplifying the hairy parser
|
||||
used when %semantic_parser is specified. */
|
||||
|
||||
#ifndef YYSTACK_USE_ALLOCA
|
||||
#ifdef alloca
|
||||
#define YYSTACK_USE_ALLOCA
|
||||
#else /* alloca not defined */
|
||||
#ifdef __GNUC__
|
||||
#define YYSTACK_USE_ALLOCA
|
||||
#define alloca __builtin_alloca
|
||||
#else /* not GNU C. */
|
||||
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
|
||||
#define YYSTACK_USE_ALLOCA
|
||||
#include <alloca.h>
|
||||
#else /* not sparc */
|
||||
/* We think this test detects Watcom and Microsoft C. */
|
||||
/* This used to test MSDOS, but that is a bad idea
|
||||
since that symbol is in the user namespace. */
|
||||
#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
|
||||
#if 0 /* No need for malloc.h, which pollutes the namespace;
|
||||
instead, just don't use alloca. */
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#else /* not MSDOS, or __TURBOC__ */
|
||||
#if defined(_AIX)
|
||||
/* I don't know what this was needed for, but it pollutes the namespace.
|
||||
So I turned it off. rms, 2 May 1997. */
|
||||
/* #include <malloc.h> */
|
||||
#pragma alloca
|
||||
#define YYSTACK_USE_ALLOCA
|
||||
#else /* not MSDOS, or __TURBOC__, or _AIX */
|
||||
#if 0
|
||||
#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
|
||||
and on HPUX 10. Eventually we can turn this on. */
|
||||
#define YYSTACK_USE_ALLOCA
|
||||
#define alloca __builtin_alloca
|
||||
#endif /* __hpux */
|
||||
#endif
|
||||
#endif /* not _AIX */
|
||||
#endif /* not MSDOS, or __TURBOC__ */
|
||||
#endif /* not sparc */
|
||||
#endif /* not GNU C */
|
||||
#endif /* alloca not defined */
|
||||
#endif /* YYSTACK_USE_ALLOCA not defined */
|
||||
|
||||
#ifdef YYSTACK_USE_ALLOCA
|
||||
#define YYSTACK_ALLOC alloca
|
||||
#else
|
||||
#define YYSTACK_ALLOC malloc
|
||||
#endif
|
||||
|
||||
/* Note: there must be only one dollar sign in this file.
|
||||
It is replaced by the list of actions, each action
|
||||
as one case of the switch. */
|
||||
@@ -461,8 +455,8 @@ static const short yycheck[] = { 0,
|
||||
#define yyclearin (yychar = YYEMPTY)
|
||||
#define YYEMPTY -2
|
||||
#define YYEOF 0
|
||||
#define YYACCEPT goto yyacceptlab
|
||||
#define YYABORT goto yyabortlab
|
||||
#define YYACCEPT return(0)
|
||||
#define YYABORT return(1)
|
||||
#define YYERROR goto yyerrlab1
|
||||
/* Like YYERROR except do call yyerror.
|
||||
This remains here temporarily to ease the
|
||||
@@ -491,18 +485,10 @@ while (0)
|
||||
|
||||
#ifdef YYPURE
|
||||
#ifdef YYLSP_NEEDED
|
||||
#ifdef YYLEX_PARAM
|
||||
#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
|
||||
#else
|
||||
#define YYLEX yylex(&yylval, &yylloc)
|
||||
#endif
|
||||
#else /* not YYLSP_NEEDED */
|
||||
#ifdef YYLEX_PARAM
|
||||
#define YYLEX yylex(&yylval, YYLEX_PARAM)
|
||||
#else
|
||||
#define YYLEX yylex(&yylval)
|
||||
#endif
|
||||
#endif /* not YYLSP_NEEDED */
|
||||
#endif
|
||||
|
||||
/* If nonreentrant, generate the variables here */
|
||||
@@ -543,24 +529,24 @@ int yydebug; /* nonzero means print parse trace */
|
||||
#ifndef YYMAXDEPTH
|
||||
#define YYMAXDEPTH 10000
|
||||
#endif
|
||||
|
||||
/* Define __yy_memcpy. Note that the size argument
|
||||
should be passed with type unsigned int, because that is what the non-GCC
|
||||
definitions require. With GCC, __builtin_memcpy takes an arg
|
||||
of type size_t, but it can handle unsigned int. */
|
||||
|
||||
/* Prevent warning if -Wstrict-prototypes. */
|
||||
#ifdef __GNUC__
|
||||
int yyparse (void);
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
|
||||
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
|
||||
#define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
|
||||
#else /* not GNU C or C++ */
|
||||
#ifndef __cplusplus
|
||||
|
||||
/* This is the most reliable way to avoid incompatibilities
|
||||
in available built-in functions on various systems. */
|
||||
static void
|
||||
__yy_memcpy (to, from, count)
|
||||
char *to;
|
||||
__yy_bcopy (from, to, count)
|
||||
char *from;
|
||||
unsigned int count;
|
||||
char *to;
|
||||
int count;
|
||||
{
|
||||
register char *f = from;
|
||||
register char *t = to;
|
||||
@@ -575,10 +561,10 @@ __yy_memcpy (to, from, count)
|
||||
/* This is the most reliable way to avoid incompatibilities
|
||||
in available built-in functions on various systems. */
|
||||
static void
|
||||
__yy_memcpy (char *to, char *from, unsigned int count)
|
||||
__yy_bcopy (char *from, char *to, int count)
|
||||
{
|
||||
register char *t = to;
|
||||
register char *f = from;
|
||||
register char *t = to;
|
||||
register int i = count;
|
||||
|
||||
while (i-- > 0)
|
||||
@@ -588,46 +574,16 @@ __yy_memcpy (char *to, char *from, unsigned int count)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#line 217 "/usr/lib/bison.simple"
|
||||
|
||||
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
|
||||
into yyparse. The argument should have type void *.
|
||||
It should actually point to an object.
|
||||
Grammar actions can access the variable by casting it
|
||||
to the proper pointer type. */
|
||||
|
||||
#ifdef YYPARSE_PARAM
|
||||
#ifdef __cplusplus
|
||||
#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
|
||||
#define YYPARSE_PARAM_DECL
|
||||
#else /* not __cplusplus */
|
||||
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
|
||||
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
|
||||
#endif /* not __cplusplus */
|
||||
#else /* not YYPARSE_PARAM */
|
||||
#define YYPARSE_PARAM_ARG
|
||||
#define YYPARSE_PARAM_DECL
|
||||
#endif /* not YYPARSE_PARAM */
|
||||
|
||||
/* Prevent warning if -Wstrict-prototypes. */
|
||||
#ifdef __GNUC__
|
||||
#ifdef YYPARSE_PARAM
|
||||
int yyparse (void *);
|
||||
#else
|
||||
int yyparse (void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#line 184 "/usr/gnu/lib/bison.simple"
|
||||
int
|
||||
yyparse(YYPARSE_PARAM_ARG)
|
||||
YYPARSE_PARAM_DECL
|
||||
yyparse()
|
||||
{
|
||||
register int yystate;
|
||||
register int yyn;
|
||||
register short *yyssp;
|
||||
register YYSTYPE *yyvsp;
|
||||
int yyerrstatus; /* number of tokens to shift before error messages enabled */
|
||||
int yychar1 = 0; /* lookahead token as an internal (translated) token number */
|
||||
int yychar1; /* lookahead token as an internal (translated) token number */
|
||||
|
||||
short yyssa[YYINITDEPTH]; /* the state stack */
|
||||
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
|
||||
@@ -646,7 +602,6 @@ yyparse(YYPARSE_PARAM_ARG)
|
||||
#endif
|
||||
|
||||
int yystacksize = YYINITDEPTH;
|
||||
int yyfree_stacks = 0;
|
||||
|
||||
#ifdef YYPURE
|
||||
int yychar;
|
||||
@@ -707,20 +662,13 @@ yynewstate:
|
||||
#ifdef yyoverflow
|
||||
/* Each stack pointer address is followed by the size of
|
||||
the data in use in that stack, in bytes. */
|
||||
yyoverflow("parser stack overflow",
|
||||
&yyss1, size * sizeof (*yyssp),
|
||||
&yyvs1, size * sizeof (*yyvsp),
|
||||
#ifdef YYLSP_NEEDED
|
||||
/* This used to be a conditional around just the two extra args,
|
||||
but that might be undefined if yyoverflow is a macro. */
|
||||
yyoverflow("parser stack overflow",
|
||||
&yyss1, size * sizeof (*yyssp),
|
||||
&yyvs1, size * sizeof (*yyvsp),
|
||||
&yyls1, size * sizeof (*yylsp),
|
||||
&yystacksize);
|
||||
#else
|
||||
yyoverflow("parser stack overflow",
|
||||
&yyss1, size * sizeof (*yyssp),
|
||||
&yyvs1, size * sizeof (*yyvsp),
|
||||
&yystacksize);
|
||||
#endif
|
||||
&yystacksize);
|
||||
|
||||
yyss = yyss1; yyvs = yyvs1;
|
||||
#ifdef YYLSP_NEEDED
|
||||
@@ -731,32 +679,18 @@ yynewstate:
|
||||
if (yystacksize >= YYMAXDEPTH)
|
||||
{
|
||||
yyerror("parser stack overflow");
|
||||
if (yyfree_stacks)
|
||||
{
|
||||
free (yyss);
|
||||
free (yyvs);
|
||||
#ifdef YYLSP_NEEDED
|
||||
free (yyls);
|
||||
#endif
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
yystacksize *= 2;
|
||||
if (yystacksize > YYMAXDEPTH)
|
||||
yystacksize = YYMAXDEPTH;
|
||||
#ifndef YYSTACK_USE_ALLOCA
|
||||
yyfree_stacks = 1;
|
||||
#endif
|
||||
yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
|
||||
__yy_memcpy ((char *)yyss, (char *)yyss1,
|
||||
size * (unsigned int) sizeof (*yyssp));
|
||||
yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
|
||||
__yy_memcpy ((char *)yyvs, (char *)yyvs1,
|
||||
size * (unsigned int) sizeof (*yyvsp));
|
||||
yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
|
||||
__yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
|
||||
yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
|
||||
__yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
|
||||
#ifdef YYLSP_NEEDED
|
||||
yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
|
||||
__yy_memcpy ((char *)yyls, (char *)yyls1,
|
||||
size * (unsigned int) sizeof (*yylsp));
|
||||
yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
|
||||
__yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
|
||||
#endif
|
||||
#endif /* no yyoverflow */
|
||||
|
||||
@@ -895,7 +829,6 @@ yydefault:
|
||||
/* Do a reduction. yyn is the number of a rule to reduce with. */
|
||||
yyreduce:
|
||||
yylen = yyr2[yyn];
|
||||
if (yylen > 0)
|
||||
yyval = yyvsp[1-yylen]; /* implement default value of the action */
|
||||
|
||||
#if YYDEBUG != 0
|
||||
@@ -917,37 +850,37 @@ yyreduce:
|
||||
switch (yyn) {
|
||||
|
||||
case 3:
|
||||
#line 209 "getdate.y"
|
||||
#line 215 "getdate.y"
|
||||
{
|
||||
yyHaveTime++;
|
||||
;
|
||||
break;}
|
||||
case 4:
|
||||
#line 212 "getdate.y"
|
||||
#line 218 "getdate.y"
|
||||
{
|
||||
yyHaveZone++;
|
||||
;
|
||||
break;}
|
||||
case 5:
|
||||
#line 215 "getdate.y"
|
||||
#line 221 "getdate.y"
|
||||
{
|
||||
yyHaveDate++;
|
||||
;
|
||||
break;}
|
||||
case 6:
|
||||
#line 218 "getdate.y"
|
||||
#line 224 "getdate.y"
|
||||
{
|
||||
yyHaveDay++;
|
||||
;
|
||||
break;}
|
||||
case 7:
|
||||
#line 221 "getdate.y"
|
||||
#line 227 "getdate.y"
|
||||
{
|
||||
yyHaveRel++;
|
||||
;
|
||||
break;}
|
||||
case 9:
|
||||
#line 227 "getdate.y"
|
||||
#line 233 "getdate.y"
|
||||
{
|
||||
yyHour = yyvsp[-1].Number;
|
||||
yyMinutes = 0;
|
||||
@@ -956,7 +889,7 @@ case 9:
|
||||
;
|
||||
break;}
|
||||
case 10:
|
||||
#line 233 "getdate.y"
|
||||
#line 239 "getdate.y"
|
||||
{
|
||||
yyHour = yyvsp[-3].Number;
|
||||
yyMinutes = yyvsp[-1].Number;
|
||||
@@ -965,7 +898,7 @@ case 10:
|
||||
;
|
||||
break;}
|
||||
case 11:
|
||||
#line 239 "getdate.y"
|
||||
#line 245 "getdate.y"
|
||||
{
|
||||
yyHour = yyvsp[-3].Number;
|
||||
yyMinutes = yyvsp[-1].Number;
|
||||
@@ -977,7 +910,7 @@ case 11:
|
||||
;
|
||||
break;}
|
||||
case 12:
|
||||
#line 248 "getdate.y"
|
||||
#line 254 "getdate.y"
|
||||
{
|
||||
yyHour = yyvsp[-5].Number;
|
||||
yyMinutes = yyvsp[-3].Number;
|
||||
@@ -986,7 +919,7 @@ case 12:
|
||||
;
|
||||
break;}
|
||||
case 13:
|
||||
#line 254 "getdate.y"
|
||||
#line 260 "getdate.y"
|
||||
{
|
||||
yyHour = yyvsp[-5].Number;
|
||||
yyMinutes = yyvsp[-3].Number;
|
||||
@@ -999,53 +932,53 @@ case 13:
|
||||
;
|
||||
break;}
|
||||
case 14:
|
||||
#line 266 "getdate.y"
|
||||
#line 272 "getdate.y"
|
||||
{
|
||||
yyTimezone = yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 15:
|
||||
#line 269 "getdate.y"
|
||||
#line 275 "getdate.y"
|
||||
{
|
||||
yyTimezone = yyvsp[0].Number - 60;
|
||||
;
|
||||
break;}
|
||||
case 16:
|
||||
#line 273 "getdate.y"
|
||||
#line 279 "getdate.y"
|
||||
{
|
||||
yyTimezone = yyvsp[-1].Number - 60;
|
||||
;
|
||||
break;}
|
||||
case 17:
|
||||
#line 278 "getdate.y"
|
||||
#line 284 "getdate.y"
|
||||
{
|
||||
yyDayOrdinal = 1;
|
||||
yyDayNumber = yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 18:
|
||||
#line 282 "getdate.y"
|
||||
#line 288 "getdate.y"
|
||||
{
|
||||
yyDayOrdinal = 1;
|
||||
yyDayNumber = yyvsp[-1].Number;
|
||||
;
|
||||
break;}
|
||||
case 19:
|
||||
#line 286 "getdate.y"
|
||||
#line 292 "getdate.y"
|
||||
{
|
||||
yyDayOrdinal = yyvsp[-1].Number;
|
||||
yyDayNumber = yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 20:
|
||||
#line 292 "getdate.y"
|
||||
#line 298 "getdate.y"
|
||||
{
|
||||
yyMonth = yyvsp[-2].Number;
|
||||
yyDay = yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 21:
|
||||
#line 296 "getdate.y"
|
||||
#line 302 "getdate.y"
|
||||
{
|
||||
/* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY.
|
||||
The goal in recognizing YYYY/MM/DD is solely to support legacy
|
||||
@@ -1066,7 +999,7 @@ case 21:
|
||||
;
|
||||
break;}
|
||||
case 22:
|
||||
#line 314 "getdate.y"
|
||||
#line 320 "getdate.y"
|
||||
{
|
||||
/* ISO 8601 format. yyyy-mm-dd. */
|
||||
yyYear = yyvsp[-2].Number;
|
||||
@@ -1075,7 +1008,7 @@ case 22:
|
||||
;
|
||||
break;}
|
||||
case 23:
|
||||
#line 320 "getdate.y"
|
||||
#line 326 "getdate.y"
|
||||
{
|
||||
/* e.g. 17-JUN-1992. */
|
||||
yyDay = yyvsp[-2].Number;
|
||||
@@ -1084,14 +1017,14 @@ case 23:
|
||||
;
|
||||
break;}
|
||||
case 24:
|
||||
#line 326 "getdate.y"
|
||||
#line 332 "getdate.y"
|
||||
{
|
||||
yyMonth = yyvsp[-1].Number;
|
||||
yyDay = yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 25:
|
||||
#line 330 "getdate.y"
|
||||
#line 336 "getdate.y"
|
||||
{
|
||||
yyMonth = yyvsp[-3].Number;
|
||||
yyDay = yyvsp[-2].Number;
|
||||
@@ -1099,14 +1032,14 @@ case 25:
|
||||
;
|
||||
break;}
|
||||
case 26:
|
||||
#line 335 "getdate.y"
|
||||
#line 341 "getdate.y"
|
||||
{
|
||||
yyMonth = yyvsp[0].Number;
|
||||
yyDay = yyvsp[-1].Number;
|
||||
;
|
||||
break;}
|
||||
case 27:
|
||||
#line 339 "getdate.y"
|
||||
#line 345 "getdate.y"
|
||||
{
|
||||
yyMonth = yyvsp[-1].Number;
|
||||
yyDay = yyvsp[-2].Number;
|
||||
@@ -1114,7 +1047,7 @@ case 27:
|
||||
;
|
||||
break;}
|
||||
case 28:
|
||||
#line 346 "getdate.y"
|
||||
#line 352 "getdate.y"
|
||||
{
|
||||
yyRelSeconds = -yyRelSeconds;
|
||||
yyRelMinutes = -yyRelMinutes;
|
||||
@@ -1125,115 +1058,115 @@ case 28:
|
||||
;
|
||||
break;}
|
||||
case 30:
|
||||
#line 357 "getdate.y"
|
||||
#line 363 "getdate.y"
|
||||
{
|
||||
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 31:
|
||||
#line 360 "getdate.y"
|
||||
#line 366 "getdate.y"
|
||||
{
|
||||
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 32:
|
||||
#line 363 "getdate.y"
|
||||
#line 369 "getdate.y"
|
||||
{
|
||||
yyRelYear += yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 33:
|
||||
#line 366 "getdate.y"
|
||||
#line 372 "getdate.y"
|
||||
{
|
||||
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 34:
|
||||
#line 369 "getdate.y"
|
||||
#line 375 "getdate.y"
|
||||
{
|
||||
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 35:
|
||||
#line 372 "getdate.y"
|
||||
#line 378 "getdate.y"
|
||||
{
|
||||
yyRelMonth += yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 36:
|
||||
#line 375 "getdate.y"
|
||||
#line 381 "getdate.y"
|
||||
{
|
||||
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 37:
|
||||
#line 378 "getdate.y"
|
||||
#line 384 "getdate.y"
|
||||
{
|
||||
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 38:
|
||||
#line 381 "getdate.y"
|
||||
#line 387 "getdate.y"
|
||||
{
|
||||
yyRelDay += yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 39:
|
||||
#line 384 "getdate.y"
|
||||
#line 390 "getdate.y"
|
||||
{
|
||||
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 40:
|
||||
#line 387 "getdate.y"
|
||||
#line 393 "getdate.y"
|
||||
{
|
||||
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 41:
|
||||
#line 390 "getdate.y"
|
||||
#line 396 "getdate.y"
|
||||
{
|
||||
yyRelHour += yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 42:
|
||||
#line 393 "getdate.y"
|
||||
#line 399 "getdate.y"
|
||||
{
|
||||
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 43:
|
||||
#line 396 "getdate.y"
|
||||
#line 402 "getdate.y"
|
||||
{
|
||||
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 44:
|
||||
#line 399 "getdate.y"
|
||||
#line 405 "getdate.y"
|
||||
{
|
||||
yyRelMinutes += yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 45:
|
||||
#line 402 "getdate.y"
|
||||
#line 408 "getdate.y"
|
||||
{
|
||||
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 46:
|
||||
#line 405 "getdate.y"
|
||||
#line 411 "getdate.y"
|
||||
{
|
||||
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 47:
|
||||
#line 408 "getdate.y"
|
||||
#line 414 "getdate.y"
|
||||
{
|
||||
yyRelSeconds += yyvsp[0].Number;
|
||||
;
|
||||
break;}
|
||||
case 48:
|
||||
#line 414 "getdate.y"
|
||||
#line 420 "getdate.y"
|
||||
{
|
||||
if (yyHaveTime && yyHaveDate && !yyHaveRel)
|
||||
yyYear = yyvsp[0].Number;
|
||||
@@ -1266,20 +1199,20 @@ case 48:
|
||||
;
|
||||
break;}
|
||||
case 49:
|
||||
#line 447 "getdate.y"
|
||||
#line 453 "getdate.y"
|
||||
{
|
||||
yyval.Meridian = MER24;
|
||||
;
|
||||
break;}
|
||||
case 50:
|
||||
#line 451 "getdate.y"
|
||||
#line 457 "getdate.y"
|
||||
{
|
||||
yyval.Meridian = yyvsp[0].Meridian;
|
||||
;
|
||||
break;}
|
||||
}
|
||||
/* the action file gets copied in in place of this dollarsign */
|
||||
#line 543 "/usr/lib/bison.simple"
|
||||
#line 457 "/usr/gnu/lib/bison.simple"
|
||||
|
||||
yyvsp -= yylen;
|
||||
yyssp -= yylen;
|
||||
@@ -1474,32 +1407,8 @@ yyerrhandle:
|
||||
|
||||
yystate = yyn;
|
||||
goto yynewstate;
|
||||
|
||||
yyacceptlab:
|
||||
/* YYACCEPT comes here. */
|
||||
if (yyfree_stacks)
|
||||
{
|
||||
free (yyss);
|
||||
free (yyvs);
|
||||
#ifdef YYLSP_NEEDED
|
||||
free (yyls);
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
|
||||
yyabortlab:
|
||||
/* YYABORT comes here. */
|
||||
if (yyfree_stacks)
|
||||
{
|
||||
free (yyss);
|
||||
free (yyvs);
|
||||
#ifdef YYLSP_NEEDED
|
||||
free (yyls);
|
||||
#endif
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#line 456 "getdate.y"
|
||||
#line 462 "getdate.y"
|
||||
|
||||
|
||||
/* Include this file down here because bison inserts code above which
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/malloc.h>
|
||||
#else
|
||||
#include <malloc.h>
|
||||
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@@ -37,6 +37,12 @@
|
||||
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h> /* for `free'; used by Bison 1.27 */
|
||||
#else
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
|
@@ -76,7 +76,9 @@ char *getpass(const char *prompt)
|
||||
FILE *outfp;
|
||||
static char buf[INPUT_BUFFER];
|
||||
RETSIGTYPE (*sigint)();
|
||||
#ifndef __EMX__
|
||||
RETSIGTYPE (*sigtstp)();
|
||||
#endif
|
||||
size_t bytes_read;
|
||||
int infd;
|
||||
int outfd;
|
||||
@@ -92,7 +94,11 @@ char *getpass(const char *prompt)
|
||||
#endif
|
||||
|
||||
sigint = signal(SIGINT, SIG_IGN);
|
||||
/* 20000318 mgs
|
||||
* this is needed by the emx system, SIGTSTP is not a supported signal */
|
||||
#ifndef __EMX__
|
||||
sigtstp = signal(SIGTSTP, SIG_IGN);
|
||||
#endif
|
||||
|
||||
if( (infp=fopen("/dev/tty", "r")) == NULL )
|
||||
{
|
||||
|
@@ -253,7 +253,7 @@ UrgError http(struct UrlData *data, char *ppath, char *host, long *bytecount)
|
||||
|
||||
thistime = localtime(&data->timevalue);
|
||||
|
||||
#if defined(HAVE_STRFTIME) || defined(WIN32)
|
||||
#ifdef HAVE_STRFTIME
|
||||
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
|
||||
strftime(buf, BUFSIZE-1, "%a, %d %b %Y %H:%M:%S %Z", thistime);
|
||||
#else
|
||||
|
@@ -48,6 +48,13 @@
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
/* 20000318 mgs
|
||||
* later we use _scrsize to determine the screen width, this emx library
|
||||
* function needs stdlib.h to be included */
|
||||
#if defined(__EMX__)
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include "urldata.h"
|
||||
|
||||
@@ -365,6 +372,11 @@ static int width = 0;
|
||||
|
||||
void ProgressInit(struct UrlData *data, int max/*, int options, int moremax*/)
|
||||
{
|
||||
#ifdef __EMX__
|
||||
/* 20000318 mgs */
|
||||
int scr_size [2];
|
||||
#endif
|
||||
|
||||
if(data->conf&(CONF_NOPROGRESS|CONF_MUTE))
|
||||
return;
|
||||
|
||||
@@ -372,10 +384,25 @@ void ProgressInit(struct UrlData *data, int max/*, int options, int moremax*/)
|
||||
|
||||
/* TODO: get terminal width through ansi escapes or something similar.
|
||||
try to update width when xterm is resized... - 19990617 larsa */
|
||||
#ifndef __EMX__
|
||||
/* 20000318 mgs
|
||||
* OS/2 users most likely won't have this env var set, and besides that
|
||||
* we're using our own way to determine screen width */
|
||||
if (curl_GetEnv("COLUMNS") != NULL)
|
||||
width = atoi(curl_GetEnv("COLUMNS"));
|
||||
else
|
||||
width = 79;
|
||||
#else
|
||||
/* 20000318 mgs
|
||||
* We use this emx library call to get the screen width, and subtract
|
||||
* one from what we got in order to avoid a problem with the cursor
|
||||
* advancing to the next line if we print a string that is as long as
|
||||
* the screen is wide. */
|
||||
|
||||
_scrsize(scr_size);
|
||||
width = scr_size[0] - 1;
|
||||
#endif
|
||||
|
||||
|
||||
progressmax = max;
|
||||
if(-1 == max)
|
||||
|
@@ -169,7 +169,7 @@ UrgSSLConnect (struct UrlData *data)
|
||||
#endif
|
||||
{
|
||||
/* We need to seed the PRNG properly! */
|
||||
#ifdef WIN32
|
||||
#ifdef HAVE_RAND_SCREEN
|
||||
/* This one gets a random value by reading the currently shown screen */
|
||||
RAND_screen();
|
||||
#else
|
||||
|
@@ -102,6 +102,9 @@ void WriteOut(struct UrlData *data)
|
||||
case VAR_EFFECTIVE_URL:
|
||||
fprintf(stream, "%s", data->url?data->url:"");
|
||||
break;
|
||||
case VAR_HTTP_CODE:
|
||||
fprintf(stream, "%03d", data->progress.httpcode);
|
||||
break;
|
||||
case VAR_TOTAL_TIME:
|
||||
fprintf(stream, "%.3f", data->progress.timespent);
|
||||
break;
|
||||
|
21
src/main.c
21
src/main.c
@@ -859,6 +859,7 @@ int main(int argc, char *argv[])
|
||||
char errorbuffer[URLGET_ERROR_SIZE];
|
||||
|
||||
struct OutStruct outs;
|
||||
struct OutStruct heads;
|
||||
|
||||
char *url = NULL;
|
||||
#ifdef GLOBURL
|
||||
@@ -878,6 +879,13 @@ int main(int argc, char *argv[])
|
||||
int i;
|
||||
|
||||
outs.stream = stdout;
|
||||
#ifdef __EMX__
|
||||
/* 20000318 mgs
|
||||
* we call _fsetmode to fix the problem with fwrite converting newline
|
||||
* characters (you get mangled text files, and corrupted binary files when
|
||||
* you download to stdout and redirect it to a file). */
|
||||
_fsetmode(stdout, "b");
|
||||
#endif
|
||||
|
||||
memset(&config, 0, sizeof(struct Configurable));
|
||||
|
||||
@@ -1086,14 +1094,12 @@ int main(int argc, char *argv[])
|
||||
/* open file for output: */
|
||||
if(strcmp(config.headerfile,"-"))
|
||||
{
|
||||
headerfilep=(FILE *) fopen(config.headerfile, "wb");
|
||||
if (!headerfilep) {
|
||||
helpf("Can't open '%s'!\n", config.headerfile);
|
||||
return URG_WRITE_ERROR;
|
||||
}
|
||||
heads.filename = config.headerfile;
|
||||
headerfilep=NULL;
|
||||
}
|
||||
else
|
||||
headerfilep=stdout;
|
||||
heads.stream = headerfilep;
|
||||
}
|
||||
|
||||
if(outs.stream && isatty(fileno(outs.stream)) &&
|
||||
@@ -1147,7 +1153,7 @@ int main(int argc, char *argv[])
|
||||
URGTAG_CRLF, config.crlf,
|
||||
URGTAG_QUOTE, config.quote,
|
||||
URGTAG_POSTQUOTE, config.postquote,
|
||||
URGTAG_WRITEHEADER, headerfilep,
|
||||
URGTAG_WRITEHEADER, &heads,
|
||||
URGTAG_COOKIEFILE, config.cookiefile,
|
||||
URGTAG_SSLVERSION, config.ssl_version,
|
||||
URGTAG_TIMECONDITION, config.timecond,
|
||||
@@ -1165,6 +1171,9 @@ int main(int argc, char *argv[])
|
||||
/* it wasn't directed to stdout or stderr so close the file! */
|
||||
fclose(config.errors);
|
||||
|
||||
if(!headerfilep && heads.stream)
|
||||
fclose(heads.stream);
|
||||
|
||||
if(urlbuffer)
|
||||
free(urlbuffer);
|
||||
if (config.outfile && outs.stream)
|
||||
|
10
src/setup.h
10
src/setup.h
@@ -82,10 +82,20 @@ int fileno( FILE *stream);
|
||||
#define DIR_CHAR "\\"
|
||||
#define DOT_CHAR "_"
|
||||
#else
|
||||
#ifdef __EMX__
|
||||
/* 20000318 mgs
|
||||
* OS/2 supports leading dots in filenames if the volume is formatted
|
||||
* with JFS or HPFS. */
|
||||
#define PATH_CHAR ";"
|
||||
#define DIR_CHAR "\\"
|
||||
#define DOT_CHAR "."
|
||||
#else
|
||||
|
||||
#define PATH_CHAR ":"
|
||||
#define DIR_CHAR "/"
|
||||
#define DOT_CHAR "."
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __SETUP_H */
|
||||
|
Reference in New Issue
Block a user