[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LYNX-DEV DOS suggestions (for development code ac-0.73)
From: |
Doug Kaufman |
Subject: |
LYNX-DEV DOS suggestions (for development code ac-0.73) |
Date: |
Sun, 28 Sep 1997 13:25:58 -0700 (PDT) |
The changes made with FNAMES_8_3 and HTML_SUFFIX seem to work well to
keep the suffix in the suggested filename to 3 characters or less.
I've looked at the getpid() function in DJGPP. Pid seems to be an
integer limited to 5 characters (probably limited to 16384), although I
haven't found the documentation. In order to keep the basename of the
suggested filename to 8 characters or less, we need to keep "counter" to
3 characters or less, and get rid of the other characters.
Since the standard DOS switch character is "/", the change in LYMain.c
to replace "/" with "\", is probably also necessary.
I have added USE_ZLIB to the makefile for DOS. Is there a drawback to
using ZLIB?
I moved LYNX_TEMP_SPACE in the code, so that it overrides "TMP" and
"TEMP". This wouldn't be defined unless the user specifically wanted
a different temporary directory for lynx. This will put lynx_386's
behavior back into compliance with the documentation in userdefs.h.
The distribution archive still contains
"about_lynx/about_lynx-dev.html", despite the fact that it was renamed
"about_lynx/lynx-dev.html" several versions ago. I don't believe that we
need both versions in the distribution.
I didn't make any changes in userdefs.h, but wondered if now that we
have "FNAMES_8_3", we shouldn't change some of the standard defines
that exceed 8+3 (e.g. .lynxsig, .mime.types, .mailcap), using ifdef
FNAMES_8_3.
Appended are some suggested patches. Thanks for fixing my previous
patches.
Doug
__
Doug Kaufman
Internet: address@hidden (preferred)
address@hidden
*** lynx2-7-1/src/LYMain.c Tue Sep 23 22:42:00 1997
--- lynx2-7-1/src/LYMain.c.new Sun Sep 28 01:11:30 1997
***************
*** 654,659 ****
--- 654,662 ----
StrAllocCat(lynx_version_putenv_command, LYNX_VERSION);
putenv(lynx_version_putenv_command);
#endif /* VMS */
+ if ((cp = getenv("LYNX_TEMP_SPACE")) != NULL)
+ StrAllocCopy(lynx_temp_space, cp);
+ else
#ifdef DOSPATH
if ((cp = getenv("TEMP")) != NULL)
StrAllocCopy(lynx_temp_space, cp);
***************
*** 661,669 ****
StrAllocCopy(lynx_temp_space, cp);
else
#endif
- if ((cp = getenv("LYNX_TEMP_SPACE")) != NULL)
- StrAllocCopy(lynx_temp_space, cp);
- else
StrAllocCopy(lynx_temp_space, TEMP_SPACE);
if ((cp = strchr(lynx_temp_space, '~'))) {
*(cp++) = '\0';
--- 664,669 ----
***************
*** 716,726 ****
--- 716,734 ----
StrAllocCat(lynx_temp_space, ":");
}
#else
+ #ifndef __DJGPP__
{
if (((len = strlen(lynx_temp_space)) > 1) &&
lynx_temp_space[len-1] != '/') {
StrAllocCat(lynx_temp_space, "/");
}
+ #else
+ {
+ if (((len = strlen(lynx_temp_space)) > 1) &&
+ lynx_temp_space[len-1] != '\\') {
+ StrAllocCat(lynx_temp_space, "\\");
+ }
+ #endif /* __DJGPP__ */
}
#endif /* VMS */
#ifdef VMS
*** lynx2-7-1/src/LYUtils.c Thu Sep 25 01:41:52 1997
--- lynx2-7-1/src/LYUtils.c.new Sun Sep 28 11:46:32 1997
***************
*** 3177,3189 ****
--- 3177,3203 ----
{
static int counter = 0;
FILE *fp = NULL;
+ #ifdef FNAMES_8_3
+ int LYMaxTempCount = 1000; /* Arbitrary limit. Make it configurable? */
+ #else
int LYMaxTempCount = 10000; /* Arbitrary limit. Make it configurable? */
+ #endif /* FNAMES_8_3 */
if (action == REMOVE_FILES) {
/*
* Remove all temporary files with .txt or .html suffixes. - FM
*/
for (; counter > 0; counter--) {
+ #ifdef FNAMES_8_3
+ sprintf(namebuffer,
+ "%s%d%u.txt",
+ lynx_temp_space, (int)getpid(), counter-1);
+ remove(namebuffer);
+ sprintf(namebuffer,
+ "%s%d%u%s",
+ lynx_temp_space, (int)getpid(), counter-1, HTML_SUFFIX);
+ remove(namebuffer);
+ #else
sprintf(namebuffer,
"%sL%d%uTMP.txt",
lynx_temp_space, (int)getpid(), counter-1);
***************
*** 3192,3197 ****
--- 3206,3212 ----
"%sL%d%uTMP%s",
lynx_temp_space, (int)getpid(), counter-1, HTML_SUFFIX);
remove(namebuffer);
+ #endif /* FNAMES_8_3 */
}
} else {
/*
***************
*** 3211,3219 ****
--- 3226,3240 ----
* should be done consistently by always using HTML_SUFFIX
* where filenames are generated for new local files. - kw
*/
+ #ifdef FNAMES_8_3
+ sprintf(namebuffer,
+ "%s%d%u.txt",
+ lynx_temp_space, (int)getpid(), counter);
+ #else
sprintf(namebuffer,
"%sL%d%uTMP.txt",
lynx_temp_space, (int)getpid(), counter);
+ #endif /* FNAMES_8_3
if ((fp = fopen(namebuffer, "r")) != NULL) {
fclose(fp);
if (TRACE)
***************
*** 3223,3231 ****
--- 3244,3258 ----
counter++;
continue;
}
+ #ifdef FNAMES_8_3
+ sprintf(namebuffer,
+ "%s%d%u.bin",
+ lynx_temp_space, (int)getpid(), counter);
+ #else
sprintf(namebuffer,
"%sL%d%uTMP.bin",
lynx_temp_space, (int)getpid(), counter);
+ #endif /* FNAMES_8_3 */
if ((fp = fopen(namebuffer, "r")) != NULL) {
fclose(fp);
if (TRACE)
***************
*** 3235,3243 ****
--- 3262,3276 ----
counter++;
continue;
}
+ #ifdef FNAMES_8_3
+ sprintf(namebuffer,
+ "%s%d%u%s",
+ lynx_temp_space, (int)getpid(), counter++, HTML_SUFFIX);
+ #else
sprintf(namebuffer,
"%sL%d%uTMP%s",
lynx_temp_space, (int)getpid(), counter++, HTML_SUFFIX);
+ #endif /* FNAMES_8_3 */
if ((fp = fopen(namebuffer, "r")) != NULL) {
fclose(fp);
if (TRACE)
*** lynx2-7-1/WWW/Library/djgpp/makefile Sat Aug 16 17:29:00 1997
--- lynx2-7-1/WWW/Library/djgpp/makefile.new Sun Sep 28 08:59:50 1997
***************
*** 7,13 ****
# The ASIS repository's name for the machine we are on
#ASIS_MACH = hardware/os
! CFLAGS = -O3 -DEXP_CHARTRANS -DCOLOR_CURSES -DDOSPATH -DNOUSERS -DDEBUG
-I../../../djgpp/tcplib/include -I../../../djgpp/tcplib/include/tcp
LFLAGS =
CC = gcc
--- 7,13 ----
# The ASIS repository's name for the machine we are on
#ASIS_MACH = hardware/os
! CFLAGS = -O3 -DUSE_ZLIB -DEXP_CHARTRANS -DCOLOR_CURSES -DDOSPATH -DNOUSERS
-DDEBUG -I../../../djgpp/tcplib/include -I../../../djgpp/tcplib/include/tcp
-I../../.. -I../../../src
LFLAGS =
CC = gcc
*** lynx2-7-1/src/makefile.dos Sun Aug 17 17:24:02 1997
--- lynx2-7-1/src/makefile.dos.new Sun Sep 28 12:32:32 1997
***************
*** 12,20 ****
CFLAGS= $(MCFLAGS) -I.. $(SLANGINC)
CC = gcc
! MCFLAGS = -O3 -DUSE_EXTERNALS -DNCURSES_VERSION -DEXP_CHARTRANS
-DCOLOR_CURSES -DNCURSES -DFANCY_CURSES -DACCESS_AUTH -DNO_CUSERID -DNOUSERS
-DDOSPATH -DNO_TTYTYPE -DNO_UTMP -I../WWW/library/implementation -I../curses
-I../djgpp/tcplib/include -I../djgpp/tcplib/include/tcp
! WWWLIB = ../WWW/library/djgpp/libwww.a ../curses/pdcurses.a
../djgpp/tcplib/obj/libtcp.a
CHRTR= chrtrans/
all: lynx
--- 12,22 ----
CFLAGS= $(MCFLAGS) -I.. $(SLANGINC)
CC = gcc
! MCFLAGS = -O3 -DUSE_ZLIB -DALT_CHAR_SET -DUSE_EXTERNALS -DNCURSES_VERSION
-DEXP_CHARTRANS -DCOLOR_CURSES -DNCURSES -DFANCY_CURSES -DACCESS_AUTH
-DNO_CUSERID -DNOUSERS -DDOSPATH -DNO_TTYTYPE -DNO_UTMP
-I../WWW/library/implementation -I../curses -I../djgpp/tcplib/include
-I../djgpp/tcplib/include/tcp
! WWWLIB = ../WWW/library/djgpp/libwww.a ../curses/pdcurses.a
../djgpp/tcplib/obj/libtcp.a
CHRTR= chrtrans/
+ LIBS = -lz
+ CMN=../WWW/Library/Implementation/
all: lynx
***************
*** 26,31 ****
--- 28,34 ----
message:
@echo "Compiling Lynx sources"
+
dbg: $(OBJS) $(WWWLIB)
@echo "Making Lynx code"
$(CC) -g $(OBJS) $(CFLAGS) $(WWWLIB) $(SLANGLIB) $(LIBS)
***************
*** 55,63 ****
LYCharUtils.o: LYCharUtils.c ../userdefs.h
LYExtern.o: LYExtern.c ../userdefs.h
LYCookie.o: ../userdefs.h
!
! #UCdomap.o: UCdomap.c ../userdefs.h lycharsets.h
! #UCdomap.o: UCdomap.c chrtrans/UCkd.h chrtrans/makeuctb chrtrans/makeuctb.c \
! # UCdomap.h UCMap.h ../userdefs.h
! #UCAux.o : UCAux.c $(CMN)UCAux.h $(CMN)UCDefs.h
--- 58,65 ----
LYCharUtils.o: LYCharUtils.c ../userdefs.h
LYExtern.o: LYExtern.c ../userdefs.h
LYCookie.o: ../userdefs.h
! UCdomap.o: UCdomap.c \
! UCdomap.h $(CMN)UCMap.h ../userdefs.h
! $(CC) -c $(CFLAGS) -o $@ $<
! UCAux.o : UCAux.c $(CMN)UCAux.h $(CMN)UCDefs.h
- LYNX-DEV DOS suggestions (for development code ac-0.73),
Doug Kaufman <=
Re: LYNX-DEV DOS suggestions (for development code ac-0.73), Nelson Henry Eric, 1997/09/29