Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes to compile in a modern environment

  • Loading branch information...
commit 9f46feac5f36d57ed34ba2e371927662f7bd8655 1 parent 26a27a6
@ricudis authored
View
11 Mosaic-src/libhtmlw/HTML-PSformat.c
@@ -59,7 +59,12 @@
*
*/
#include "../config.h"
+#if 0
#include <varargs.h>
+#endif
+
+#include <stdarg.h>
+#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -229,9 +234,7 @@ GetDpi(HTMLWidget hw)
*
*/
static int
-PSprintf(format, va_alist)
- char* format;
- va_dcl
+PSprintf(char *format, ...)
{
int len;
char *s;
@@ -251,7 +254,7 @@ PSprintf(format, va_alist)
}
PS_string = s;
}
- va_start(args);
+ va_start(args,format);
len = vsprintf(PS_string+PS_len, format, args);
/* this is a hack to make it work on systems were vsprintf(s,...)
* returns s, instead of the len.
View
1  Mosaic-src/libhtmlw/HTML.c
@@ -82,6 +82,7 @@
#define W_PASSWORD 4
#define W_OPTIONMENU 5
+#include <stdlib.h>
extern int FormatAll();
extern int DocumentWidth();
View
1  Mosaic-src/libhtmlw/HTMLformat.c
@@ -54,6 +54,7 @@
#include "../config.h"
#ifndef VMS
#include <sys/time.h>
+#include <stdlib.h>
struct timeval Tv;
struct timezone Tz;
#else
View
1  Mosaic-src/libhtmlw/HTMLimages.c
@@ -54,6 +54,7 @@
#include "../config.h"
#include <stdio.h>
#include <ctype.h>
+#include <stdlib.h>
#include "HTMLP.h"
#include "NoImage.xbm"
#include "DelayedImage.xbm"
View
2  Mosaic-src/libhtmlw/HTMLjot.c
@@ -116,6 +116,8 @@
#endif /* DEC C, GEC */
#endif /* VMS, GEC for PGE */
+#include <stdlib.h>
+
#include "HTMLP.h"
typedef struct stroke_rec {
View
1  Mosaic-src/libhtmlw/HTMLlists.c
@@ -53,6 +53,7 @@
****************************************************************************/
#include "../config.h"
#include <stdio.h>
+#include <stdlib.h>
#include "HTML.h"
#ifndef DISABLE_TRACE
View
1  Mosaic-src/libhtmlw/HTMLtable.c
@@ -2,6 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
+#include <stdlib.h>
#include "HTMLP.h"
#include "HTML.h"
#include "list.h"
View
1  Mosaic-src/libhtmlw/HTMLwidgets.c
@@ -55,6 +55,7 @@
#include <stdio.h>
#include <ctype.h>
#include <string.h>
+#include <stdlib.h>
#ifdef MOTIF
#include <Xm/Xm.h>
#include <Xm/Frame.h>
View
1  Mosaic-src/libhtmlw/list.c
@@ -21,6 +21,7 @@
* ddt
*/
#include <stdio.h>
+#include <stdlib.h>
#include "listP.h"
#include "../config.h"
#ifndef MALLOC
View
4 Mosaic-src/libnut/str-tools.c
@@ -261,7 +261,7 @@ int rplcLen=0,i,srchLen;
while (*start) {
if (!(found=strstr(start,srch))) {
if (rplcLen>srchLen) {
- realloc((void *)dest,((strlen(dest)+strlen(start)+4)*sizeof(char)));
+ dest=realloc((void *)dest,((strlen(dest)+strlen(start)+4)*sizeof(char)));
strcat(dest,start);
}
else {
@@ -275,7 +275,7 @@ int rplcLen=0,i,srchLen;
for (i=0,next=found; i<srchLen; i++,next++);
*found='\0';
if (rplcLen>srchLen) {
- realloc((void *)dest,((rplcLen+strlen(dest)+strlen(start)+4)*sizeof(char)));
+ dest=realloc((void *)dest,((rplcLen+strlen(dest)+strlen(start)+4)*sizeof(char)));
strcat(dest,start);
if (rplcLen) {
strcat(dest,rplc);
View
2  Mosaic-src/libnut/system.c
@@ -103,7 +103,7 @@ extern char *strdup(char *str);
#ifndef VMS
extern int sys_nerr;
-extern char *sys_errlist[];
+// extern char *sys_errlist[];
extern int errno;
#endif
View
2  Mosaic-src/libnut/url-utils.c
@@ -164,7 +164,7 @@ int rind(char *s, char c) {
}
-int getline(char *s, int n, FILE *f) {
+int mos_getline(char *s, int n, FILE *f) {
register int i=0;
while(1) {
View
2  Mosaic-src/libnut/url-utils.h
@@ -6,7 +6,7 @@ char x2c(char *what);
void unescape_url(char *url);
void plustospace(char *str);
int rind(char *s, char c);
-int getline(char *s, int n, FILE *f);
+int mos_getline(char *s, int n, FILE *f);
void send_fd(FILE *f, FILE *fd);
int ind(char *s, char c);
void escape_shell_cmd(char *cmd);
View
4 Mosaic-src/libwww2/HTInit.c
@@ -489,7 +489,7 @@ PUBLIC void HTFileInit NOARGS
#define MAX_STRING_LEN 256
-static int getline(char *s, int n, FILE *f)
+static int mos_getline(char *s, int n, FILE *f)
{
register int i=0;
@@ -553,7 +553,7 @@ int HTLoadExtensionsConfigFile (char *fn)
return -1;
}
- while(!(getline(l,MAX_STRING_LEN,f)))
+ while(!(mos_getline(l,MAX_STRING_LEN,f)))
{
/* always get rid of leading white space for "line" -- SWP */
for (ptr=l; *ptr && isspace(*ptr); ptr++);
View
2  Mosaic-src/libwww2/HTTCP.c
@@ -72,7 +72,7 @@ PRIVATE char *hostname=0; /* The name of this host */
extern int errno;
#endif /* errno */
-extern char *sys_errlist[]; /* see man perror on cernvax */
+//extern char *sys_errlist[]; /* see man perror on cernvax */
extern int sys_nerr;
/* Report Internet Error
View
15 Mosaic-src/makefiles/Makefile.linux
@@ -97,7 +97,8 @@ xinc = -I/usr/include/X11/Xm
#### For Linux -- You must set "LD_LIBRARY_PATH" to include the path to
#### your X libs, or some may not be found by the loader. Check the
#### loader with "ldd Mosaic" after you build.
-xlibs = -L/usr/X11R6/lib -lXext -lXpm -lXm -lXmu -lXt -lX11 -lICE -lSM
+# xlibs = -L/usr/X11R6/lib -lXext -lXpm -lXm -lXmu -lXt -lX11 -lICE -lSM
+xlibs = -L/usr/X11R6/lib -lXext -lXpm -lXm -lXt -lX11 -lICE -lSM
static_motif_xlibs = -L/usr/X11R6/lib -lXext -lXpm /usr/X11R6/lib/libXm.a -lXmu -lXt -lX11 -lICE -lSM
static_xlibs = /usr/X11R6/lib/libXpm.a /usr/X11R6/lib/libXm.a /usr/X11R6/lib/libXmu.a /usr/X11R6/lib/libXt.a /usr/X11R6/lib/libXext.a /usr/X11R6/lib/libX11.a /usr/X11R6/lib/libSM.a /usr/X11R6/lib/libICE.a
#### For BSD/386:
@@ -135,19 +136,15 @@ static_xlibs = /usr/X11R6/lib/libXpm.a /usr/X11R6/lib/libXm.a /usr/X11R6/lib/lib
#### For inline PNG support, the following should be defined:
#### The libraries currently used are PNGLIB 0.81 and ZLIB 0.95
-pngdir = /xdev/mosaic/libpng/linux
-pnglibdir = $(pngdir)/lib
-pngincludedir = $(pngdir)/include
-pnglibs = $(pnglibdir)/libpng.a $(pnglibdir)/libz.a /usr/lib/libm.a
-pngflags = -I$(pngincludedir) -DHAVE_PNG
+pnglibs = -lpng -lz -lm
+pngflags = -DHAVE_PNG
#### JPEG SUPPORT
#### For inline JPEG support, the following should be defined:
#### The library used is Independent JPEG Group (IJG's) 5.0a.
-jpegdir = /xdev/mosaic/libjpeg/linux
-jpeglibs = $(jpegdir)/lib/libjpeg.a
-jpegflags = -I$(jpegdir)/include -DHAVE_JPEG
+jpeglibs = -ljpeg
+jpegflags = -DHAVE_JPEG
#### KERBEROS SUPPORT
View
1  Mosaic-src/src/accept.c
@@ -58,6 +58,7 @@
#define SCREWY_BLOCKING
#endif
+#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
View
2  Mosaic-src/src/child.c
@@ -58,7 +58,7 @@
#include "child.h"
#include "list.h"
#include <stdio.h>
-
+#include <stdlib.h>
#ifndef DISABLE_TRACE
extern int srcTrace;
View
1  Mosaic-src/src/gifread.c
@@ -63,6 +63,7 @@
#include "../config.h"
#include <stdio.h>
#include <X11/Intrinsic.h>
+#include <stdlib.h>
#include "gifread.h"
/*
View
4 Mosaic-src/src/gui-dialogs.c
@@ -70,6 +70,8 @@
#include <Xm/Protocols.h>
+#include <stdlib.h>
+
#include "libhtmlw/HTML.h"
#include "libnut/system.h"
#include "libnut/str-tools.h"
@@ -88,7 +90,7 @@ extern int is_uncompressed;
/*swp -- for ~ expansion*/
#include <pwd.h>
extern int sys_nerr;
-extern char *sys_errlist[];
+// extern char *sys_errlist[];
extern int errno;
#define __MAX_HOME_LEN__ 256
int pathEval(char *dest, char *src);
View
1  Mosaic-src/src/medcut.c
@@ -54,6 +54,7 @@
#include "../config.h"
#include <X11/Intrinsic.h>
#include <stdio.h>
+#include <stdlib.h>
#define RED 0
#define GREEN 1
View
14 Mosaic-src/src/mo-www.c
@@ -53,7 +53,19 @@
****************************************************************************/
#include "../config.h"
#include "mosaic.h"
-#include "comment.h"
+// #include "comment.h"
+
+#define COMMENT_CARD_FILENAME ".mosaic-cc-"
+#define COMMENT_TIME 5
+
+#define MO_COMMENT_OS "Not Supported" /**/
+
+/* Only in the NCSA binaries! */
+#define EASTER
+#define EASTER_ARRAY
+#define EASTER_EXTERNS
+
+
#include "mo-www.h"
#include "gui-dialogs.h"
#include "gui.h"
View
13 Mosaic-src/src/pixmaps.c
@@ -53,7 +53,18 @@
****************************************************************************/
#include "mosaic.h"
-#include "comment.h"
+// #include "comment.h"
+
+#define COMMENT_CARD_FILENAME ".mosaic-cc-"
+#define COMMENT_TIME 5
+
+#define MO_COMMENT_OS "Not Supported" /**/
+
+/* Only in the NCSA binaries! */
+#define EASTER
+#define EASTER_ARRAY
+#define EASTER_EXTERNS
+
#include "pixmaps.h"
#include "xpmread.h"
#include "xpm.h"
View
1  Mosaic-src/src/proxy-misc.c
@@ -53,6 +53,7 @@
****************************************************************************/
#include "../config.h"
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "proxy.h"
View
19 Mosaic-src/src/readPNG.c
@@ -159,11 +159,24 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
}
/* SWP -- Hopefully to fix cores on bad PNG files */
- png_set_message_fn(png_ptr,png_get_msg_ptr(png_ptr),NULL,NULL);
+// png_set_message_fn(png_ptr,png_get_msg_ptr(png_ptr),NULL,NULL);
/* initialize the structures */
- png_info_init(info_ptr);
- png_read_init(png_ptr);
+ // png_info_init(info_ptr);
+ // png_read_init(png_ptr);
+
+ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL);
+
+ if (!png_ptr) {
+ fprintf(stderr,"\n!!! Cannot png_create_read_struct !!!\n");
+ }
+
+ info_ptr = png_create_info_struct(png_ptr);
+
+ if (!info_ptr) {
+ fprintf(stderr,"\n!!! Cannot png_create_info_struct !!!\n");
+ }
+
/* set up the input control */
png_init_io(png_ptr, infile);
View
2  Mosaic-src/src/xpmhash.c
@@ -52,6 +52,8 @@
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
+#include <stdlib.h>
+
/*
* The following XPM hashing code if from the libXpm code, which I
* am free to use as long as I include the following copyright:
Please sign in to comment.
Something went wrong with that request. Please try again.