Gisle Vanem's djgpp/MS-DOS updates

This commit is contained in:
Daniel Stenberg 2004-03-29 12:29:25 +00:00
parent 712d0374f7
commit 126ed14313
7 changed files with 202 additions and 135 deletions

View file

@ -116,16 +116,17 @@
#define DEFAULT_MAXREDIRS 50L
#ifdef __DJGPP__
void *xmalloc(size_t);
#include <dos.h>
char *msdosify(char *);
char *rename_if_dos_device_name(char *);
void xfree(void *);
struct pollfd {
int fd;
int events; /* in param: what to poll for */
int revents; /* out param: what events occured */
};
int poll (struct pollfd *, int, int);
/* we want to glob our own argv[] */
char **__crt0_glob_function (char *arg)
{
(void)arg;
return (char**)0;
}
#endif /* __DJGPP__ */
#ifndef __cplusplus
@ -367,7 +368,7 @@ static void help(void)
" -v/--verbose Make the operation more talkative",
" -V/--version Show version number and quit",
#ifdef __DJGPP__
" --wdebug Turn on WATT-32 debugging under DJGPP",
" --wdebug Turn on Watt-32 debugging under DJGPP",
#endif
" -w/--write-out [format] What to output after completion",
" -x/--proxy <host[:port]> Use HTTP proxy on given port",
@ -2209,6 +2210,8 @@ static void go_sleep(long ms)
#ifdef WIN32
/* Windows offers a millisecond sleep */
Sleep(ms);
#elif defined(__MSDOS__)
delay(ms);
#else
/* Other systems must use select() for this */
struct timeval timeout;
@ -2920,10 +2923,11 @@ operate(struct Configurable *config, int argc, char *argv[])
{
/* This is for DOS, and then we do some major replacing of
bad characters in the file name before using it */
char *file1=xmalloc(PATH_MAX);
char file1 [PATH_MAX];
strcpy(file1, msdosify(outfile));
strcpy(outfile, rename_if_dos_device_name(file1));
xfree(file1);
free (outfile);
outfile = strdup (rename_if_dos_device_name(file1));
}
#endif /* __DJGPP__ */
}
@ -3688,7 +3692,6 @@ rename_if_dos_device_name (char *file_name)
/* We could have a file whose name is a device on MS-DOS. Trying to
* retrieve such a file would fail at best and wedge us at worst. We need
* to rename such files. */
extern char *basename (const char *);
char *base;
struct stat st_buf;
char fname[PATH_MAX];

View file

@ -17,6 +17,8 @@ endif
EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a
CFLAGS += -DUSE_MANUAL -DUSE_ENVIRONMENT
PROGRAM = ../curl.exe
SOURCES = getpass.c homedir.c hugehelp.c main.c urlglob.c writeenv.c writeout.c
OBJECTS = $(SOURCES:.c=.o)
@ -34,7 +36,7 @@ config.h:
#
hugehelp.c: ../docs/MANUAL ../docs/curl.1 mkhelp.pl
groff -Tascii -man ../docs/curl.1 | \
perl -w mkhelp.pl ../docs/MANUAL ../readme > $@
perl -w mkhelp.pl ../docs/MANUAL > $@
clean:
- rm -f $(OBJECTS) Makefile.bak config.h
@ -43,17 +45,23 @@ realclean vclean: clean
- rm -f $(PROGRAM) hugehelp.c
# DO NOT DELETE THIS LINE
getpass.o: getpass.c setup.h config.h ../lib/config.dj
homedir.o: homedir.c setup.h config.h ../lib/config.dj
hugehelp.o: hugehelp.c
main.o: main.c setup.h config.h ../lib/config.dj ../include/curl/curl.h \
getpass.o: getpass.c setup.h config.h ../lib/config.dj ../lib/setup.h \
../lib/config.h getpass.h ../lib/memdebug.h
homedir.o: homedir.c setup.h config.h ../lib/config.dj ../lib/setup.h \
../lib/config.h homedir.h ../lib/memdebug.h
hugehelp.o: hugehelp.c hugehelp.h
main.o: main.c setup.h config.h ../lib/config.dj ../lib/setup.h \
../lib/config.h ../include/curl/curl.h ../include/curl/curlver.h \
../include/curl/types.h ../include/curl/easy.h ../include/curl/multi.h \
../include/curl/mprintf.h urlglob.h writeout.h getpass.h homedir.h \
version.h
urlglob.o: urlglob.c setup.h config.h ../lib/config.dj \
../include/curl/curl.h ../include/curl/types.h ../include/curl/easy.h \
../include/curl/multi.h ../include/curl/mprintf.h urlglob.h
writeenv.o: writeenv.c setup.h config.h ../lib/config.dj
writeout.o: writeout.c setup.h config.h ../lib/config.dj \
../include/curl/curl.h ../include/curl/types.h ../include/curl/easy.h \
../include/curl/multi.h ../include/curl/mprintf.h writeout.h
hugehelp.h version.h ../lib/strtoofft.h ../lib/memdebug.h
urlglob.o: urlglob.c setup.h config.h ../lib/config.dj ../lib/setup.h \
../lib/config.h ../include/curl/curl.h ../include/curl/curlver.h \
../include/curl/types.h ../include/curl/easy.h ../include/curl/multi.h \
../include/curl/mprintf.h urlglob.h ../lib/memdebug.h
writeenv.o: writeenv.c setup.h config.h ../lib/config.dj ../lib/setup.h \
../lib/config.h
writeout.o: writeout.c setup.h config.h ../lib/config.dj ../lib/setup.h \
../lib/config.h ../include/curl/curl.h ../include/curl/curlver.h \
../include/curl/types.h ../include/curl/easy.h ../include/curl/multi.h \
../include/curl/mprintf.h writeout.h

View file

@ -64,6 +64,10 @@ static void internalSetEnv(const char * name, char * value)
/* Add your OS-specific code here. */
#ifdef __riscos__
_kernel_setenv(name, value);
#elif defined (CURLDEBUG)
extern FILE *curl_debuglogfile;
if (curl_debuglogfile)
fprintf (curl_debuglogfile, "ENV %s = %s\n", name, value);
#endif
return;
}
@ -100,6 +104,8 @@ void ourWriteEnv(CURL *curl)
else
internalSetEnv(variables[i].name, NULL);
break;
default:
break;
}
}