Subject: xview3.2 with shared libs
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Hung-Chi Chu <f80204@cc.ee.ntu.edu.tw>
List: current-users
Date: 11/15/1993 17:29:32
Hi,
I have compiled xview3.2 with shared libs. It seems to work.
I spent much time to find a 'bug?' which caused textedit to core
dump when choosing 'Open'. It is due to 'txt_popup.c' passing
STATIC callback functions to 'file_chooser'. LD/i386 doesn't support
RELOC_STATICS_THROUGH_GOT_P like LD/sparc. Is it possible to support
RELOC_STATICS_THROUGH_GOT_P in LD/i386? Maybe Paul Kranenburg knows.
Now I simply remove these 'static' decl.
NOTE: These patches are based on PURE xview3.2 with patch-1 applied.
Some patches are copied from ports for FreeBSD.
PS. Thanks to Paul Kranenburg for all his works.
*** xview3.2/clients/olwm/defaults.c.orig Tue Jun 29 13:11:43 1993
--- xview3.2/clients/olwm/defaults.c Sun Oct 31 16:29:29 1993
***************
*** 80,86 ****
if (homedir != NULL) {
(void) strcpy(filename, homedir);
(void) strcat(filename, "/.Xdefaults-");
! if (0 == gethostname(hostname, sizeof(hostname), &namelen)) {
(void) strcat(filename, hostname);
fileDB = XrmGetFileDatabase(filename);
}
--- 80,86 ----
if (homedir != NULL) {
(void) strcpy(filename, homedir);
(void) strcat(filename, "/.Xdefaults-");
! if (0 == gethostname(hostname, sizeof(hostname))) {
(void) strcat(filename, hostname);
fileDB = XrmGetFileDatabase(filename);
}
*** xview3.2/clients/olwm/olwm.c.orig Tue Jun 29 13:11:52 1993
--- xview3.2/clients/olwm/olwm.c Sun Oct 31 16:29:29 1993
***************
*** 22,27 ****
--- 22,30 ----
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/wait.h>
+ #ifdef __386BSD__
+ #define MAXPID 30000
+ #endif
#include <X11/Xos.h>
#include <X11/Xlib.h>
***************
*** 622,634 ****
void
ReapChildren()
{
! #ifdef SYSV
pid_t pid;
int status;
#else
int oldmask;
int pid;
union wait status;
#endif
if (!deadChildren)
--- 625,643 ----
void
ReapChildren()
{
! #if defined(SYSV)
pid_t pid;
int status;
#else
+ #ifdef __386BSD__
+ pid_t pid;
+ int status;
+ int oldmask;
+ #else
int oldmask;
int pid;
union wait status;
+ #endif
#endif
if (!deadChildren)
*** xview3.2/clients/olwm/Imakefile.orig Tue Jun 29 13:11:41 1993
--- xview3.2/clients/olwm/Imakefile Sun Oct 31 17:44:01 1993
***************
*** 13,20 ****
CFILES.misc.3 =
CFILES.misc.4 = fontset.c
! OFILES.misc.3 = ${CFILES.misc.3:%.c=%.o}
! OFILES.misc.4 = ${CFILES.misc.4:%.c=%.o}
HFILES.misc.3 =
HFILES.misc.4 =
--- 13,20 ----
CFILES.misc.3 =
CFILES.misc.4 = fontset.c
! OFILES.misc.3 = ${CFILES.misc.3:.c=.o}
! OFILES.misc.4 = ${CFILES.misc.4:.c=.o}
HFILES.misc.3 =
HFILES.misc.4 =
***************
*** 27,33 ****
GETTEXT.C =
#endif
! GETTEXT.O = ${GETTEXT.C:%.c=%.o}
HEADERS = cmdstream.h debug.h defaults.h dsdm.h environ.h \
error.h events.h globals.h group.h helpcmd.h i18n.h iconimage.h \
--- 27,33 ----
GETTEXT.C =
#endif
! GETTEXT.O = ${GETTEXT.C:.c=.o}
HEADERS = cmdstream.h debug.h defaults.h dsdm.h environ.h \
error.h events.h globals.h group.h helpcmd.h i18n.h iconimage.h \
*** xview3.2/clients/olwmslave/Imakefile.orig Tue Jun 29 13:12:14 1993
--- xview3.2/clients/olwmslave/Imakefile Sun Oct 31 16:29:30 1993
***************
*** 38,55 ****
mem.c \
olwmslave.c \
propsrecv.c \
! propswin.c
OBJS = \
cmdstream.o \
help_file.o \
! helprecv.o \
helpwin.o \
mem.o \
olwmslave.o \
propsrecv.o \
! propswin.o
ALLFILES = \
--- 38,55 ----
mem.c \
olwmslave.c \
propsrecv.c \
! propswin.c ${GETTEXT.C}
OBJS = \
cmdstream.o \
help_file.o \
! helprecv.o \
helpwin.o \
mem.o \
olwmslave.o \
propsrecv.o \
! propswin.o ${GETTEXT.O}
ALLFILES = \
*** xview3.2/doc/Imakefile.orig Tue Jun 29 13:13:15 1993
--- xview3.2/doc/Imakefile Sun Oct 31 16:29:30 1993
***************
*** 17,23 ****
ALLFILES = $(DOCFILES)
install::
! $(MKDIRHIER) $(DOC_DEST)
InstallNonExecList($(DOCFILES),$(DOC_DEST))
PopulateSCCSTree(h,$(ALLFILES) README)
--- 17,23 ----
ALLFILES = $(DOCFILES)
install::
! $(MKDIRHIER) $(DOC_DEST)
InstallNonExecList($(DOCFILES),$(DOC_DEST))
PopulateSCCSTree(h,$(ALLFILES) README)
*** xview3.2/config/XView.cf.orig Tue Jun 29 13:13:20 1993
--- xview3.2/config/XView.cf Sat Nov 13 20:02:04 1993
***************
*** 101,107 ****
* the appropriate value.
*/
#ifndef XVDestDir
! #define XVDestDir /home/xview
#endif
/*
* Command to add object modules to the library.
--- 101,107 ----
* the appropriate value.
*/
#ifndef XVDestDir
! #define XVDestDir /usr/X386
#endif
/*
* Command to add object modules to the library.
***************
*** 139,145 ****
* installed in $(DESTDIR)/lib/X11/config (aka $(CONFIGDIR)).
*/
#ifndef OnlyNeedsNewXViewConfigInstalled
! #define OnlyNeedsNewXViewConfigInstalled NO
#endif
/*
* If you would like the XView man pages to be installed in
--- 139,145 ----
* installed in $(DESTDIR)/lib/X11/config (aka $(CONFIGDIR)).
*/
#ifndef OnlyNeedsNewXViewConfigInstalled
! #define OnlyNeedsNewXViewConfigInstalled YES
#endif
/*
* If you would like the XView man pages to be installed in
***************
*** 194,200 ****
# if PreR4Server
# define LibXViewDefines -DPRE_R4_ICCCM
# else
! # define LibXViewDefines -DOW_I18N -DFULL_R5 -I$(OPENWINHOME)/include
# endif
#endif
/*
--- 194,200 ----
# if PreR4Server
# define LibXViewDefines -DPRE_R4_ICCCM
# else
! # define LibXViewDefines -DSUNOS41 -DFULL_R5 -I$(OPENWINHOME)/include
# endif
#endif
/*
***************
*** 266,272 ****
* to YES.
*/
#ifndef RedefineTextExtrasMenu
! #define RedefineTextExtrasMenu NO
#endif
/*
* DEC 3100 Config options
--- 266,272 ----
* to YES.
*/
#ifndef RedefineTextExtrasMenu
! #define RedefineTextExtrasMenu YES
#endif
/*
* DEC 3100 Config options
***************
*** 340,346 ****
*/
#ifndef XvI18nLevel
! #define XvI18nLevel 4
#endif
/*
--- 340,346 ----
*/
#ifndef XvI18nLevel
! #define XvI18nLevel 3
#endif
/*
***************
*** 349,355 ****
* NO, as these routines are already part of the OS.
*/
#ifndef XvNeedGettext
! #define XvNeedGettext NO
#endif
/*
--- 349,355 ----
* NO, as these routines are already part of the OS.
*/
#ifndef XvNeedGettext
! #define XvNeedGettext 1
#endif
/*
***************
*** 359,365 ****
* be defined as -PIC
*/
#ifndef PositionIndependentCodeFlag
! #define PositionIndependentCodeFlag -K PIC
#endif
/*
--- 359,365 ----
* be defined as -PIC
*/
#ifndef PositionIndependentCodeFlag
! #define PositionIndependentCodeFlag -fpic
#endif
/*
***************
*** 377,383 ****
* acc SunOS 4.x -strconst
*/
#ifndef StringConstantFlag
! #define StringConstantFlag -xstrconst
#endif
#endif /* XViewCf */
--- 377,385 ----
* acc SunOS 4.x -strconst
*/
#ifndef StringConstantFlag
! #define StringConstantFlag
#endif
+
+ #define SharedXViewRev 0.1
#endif /* XViewCf */
*** xview3.2/config/XView.tmpl.orig Tue Jun 29 13:13:21 1993
--- xview3.2/config/XView.tmpl Sun Nov 14 01:21:35 1993
***************
*** 123,129 ****
XV_CFLAGS.shared =
#endif
DEFINES = $(LOCALE_DEFINES) $(MMAP_DEFINES) $(XV_ALLOC_DEFINES) \
! $(XV_STRDUP_DEFINES) $(XV_CFLAGS.optimized) $(XV_CFLAGS.shared)
#ifdef XVDestDir
XVDESTDIR = XVDestDir
--- 123,129 ----
XV_CFLAGS.shared =
#endif
DEFINES = $(LOCALE_DEFINES) $(MMAP_DEFINES) $(XV_ALLOC_DEFINES) \
! $(XV_STRDUP_DEFINES)
#ifdef XVDestDir
XVDESTDIR = XVDestDir
***************
*** 286,292 ****
*/
#if SharedLibXView
# ifndef InstSharedLibFlags
! # define InstSharedLibFlags -m 0755
# endif
# ifndef PositionIndependentCodeFlag
# define PositionIndependentCodeFlag -pic
--- 286,292 ----
*/
#if SharedLibXView
# ifndef InstSharedLibFlags
! # define InstSharedLibFlags -m 0644
# endif
# ifndef PositionIndependentCodeFlag
# define PositionIndependentCodeFlag -pic
***************
*** 359,365 ****
XVCLIENTSYSDEFINES = -DSVR4 -DSYSV
#else
SYSV_CLIENT_LIB =
! XVCLIENTSYSDEFINES = -DSUNOS41
#endif
/*
--- 359,365 ----
XVCLIENTSYSDEFINES = -DSVR4 -DSYSV
#else
SYSV_CLIENT_LIB =
! XVCLIENTSYSDEFINES = -DSUNOS41
#endif
/*
***************
*** 371,386 ****
*/
#if XvI18nLevel == 4
! XVCLIENTI18NDEFINES = -DOW_I18N_L4 -DOW_I18N_L3 -DOW_I18N -DFULL_R5
! XVCLIENTMISCLIB = -lw
! XVCLIENTINCLUDES = -I$(OPENWINHOME)/include
#else
! XVCLIENTI18NDEFINES = -DOW_I18N_L3
! XVCLIENTMISCLIB =
! XVCLIENTINCLUDES =
#endif
! XVCLIENTDEFINES = $(XVCLIENTSYSDEFINES) $(XVCLIENTI18NDEFINES)
/*
* Define libraries for XView clients
--- 371,386 ----
*/
#if XvI18nLevel == 4
! XVCLIENTI18NDEFINES = -DOW_I18N_L4 -DOW_I18N_L3 -DOW_I18N -DFULL_R5
! XVCLIENTMISCLIB = -lw
! XVCLIENTINCLUDES = -I$(OPENWINHOME)/include
#else
! XVCLIENTI18NDEFINES = -DOW_I18N_L3
! XVCLIENTMISCLIB =
! XVCLIENTINCLUDES =
#endif
! XVCLIENTDEFINES = $(XVCLIENTSYSDEFINES) $(XVCLIENTI18NDEFINES)
/*
* Define libraries for XView clients
*** xview3.2/config/XView.rules.orig Tue Jun 29 13:13:20 1993
--- xview3.2/config/XView.rules Sun Nov 14 02:01:24 1993
***************
*** 110,116 ****
lib/**/libname.so.rev:: solist @@\
-@if [ ! -d dir ]; then mkdir dir; else exit 0; fi @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
! for i in solist; do (set -x; $(CP) sub/$$i dir; $(CP) sub/$$i .); done
#endif /* SubdirNormalSharedLibraryTarget */
--- 110,116 ----
lib/**/libname.so.rev:: solist @@\
-@if [ ! -d dir ]; then mkdir dir; else exit 0; fi @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
! for i in solist; do (set -x; $(CP) sub/$$i dir); done
#endif /* SubdirNormalSharedLibraryTarget */
***************
*** 122,134 ****
*/
#ifndef SubdirNormalSharedLibraryDataTarget
#define SubdirNormalSharedLibraryDataTarget(libname,rev,salist,dir,sub) @@\
! AllTarget(lib/**/libname.sa.rev) @@\
! @@\
! lib/**/libname.sa.rev:: salist @@\
! -@if [ ! -d dir ]; then mkdir dir; else exit 0; fi @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
! for i in salist; do \ @@\
! (set -x; $(CP) sub/$$i dir; $(CP) shared/$$i $(SHARED_DIR)); done
#endif /* SubdirNormalSharedLibraryDataTarget */
--- 122,130 ----
*/
#ifndef SubdirNormalSharedLibraryDataTarget
#define SubdirNormalSharedLibraryDataTarget(libname,rev,salist,dir,sub) @@\
! lib/**/libname.so.rev:: salist @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
! for i in salist; do (set -x; $(CP) shared/$$i $(SHARED_DIR)); done
#endif /* SubdirNormalSharedLibraryDataTarget */
***************
*** 194,229 ****
#if DoRanlibCmd
#ifndef SubdirBuildNormalSharedLibraryDataTarget
! #define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir) @@\
! AllTarget(lib/**/libname.sa.rev) @@\
! @@\
! lib/**/libname.sa.rev:: @@\
! $(RM) $@~ @@\
! (cd sadir; $(AR) ../$@~ ?*.o) @@\
! $(RM) $@ @@\
! $(MV) $@~ $@ @@\
! $(RANLIB) $@ @@\
! @@\
! clean:: @@\
! $(RM) lib/**/libname.sa.rev sadir/?*.o
!
#endif /* SubdirBuildNormalSharedLibraryDataTarget */
#else /* DoRanlibCmd */
#ifndef SubdirBuildNormalSharedLibraryDataTarget
! #define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir) @@\
! AllTarget(lib/**/libname.sa.rev) @@\
! @@\
! lib/**/libname.sa.rev:: @@\
! $(RM) $@~ @@\
! (cd sadir; $(AR) ../$@~ ?*.o) @@\
! $(RM) $@ @@\
! $(MV) $@~ $@ @@\
! @@\
! clean:: @@\
! $(RM) lib/**/libname.sa.rev sadir/?*.o
!
#endif /* SubdirBuildNormalSharedLibraryDataTarget */
#endif /* DoRanlibCmd */
--- 190,202 ----
#if DoRanlibCmd
#ifndef SubdirBuildNormalSharedLibraryDataTarget
! #define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir)
#endif /* SubdirBuildNormalSharedLibraryDataTarget */
#else /* DoRanlibCmd */
#ifndef SubdirBuildNormalSharedLibraryDataTarget
! #define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir)
#endif /* SubdirBuildNormalSharedLibraryDataTarget */
#endif /* DoRanlibCmd */
***************
*** 245,252 ****
@@\
.c.o: @@\
$(RM) $@ shared/$@ @@\
! $(CC) $(PIC) $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) $(STRCONST) -c $*.c \ @@\
-o shared/$*.o @@\
@@\
clean:: @@\
$(RM) strings* @@\
--- 218,226 ----
@@\
.c.o: @@\
$(RM) $@ shared/$@ @@\
! $(CC) $(PIC) $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) -c $*.c \ @@\
-o shared/$*.o @@\
+ $(CC) $(CFLAGS) -c $*.c @@\
@@\
clean:: @@\
$(RM) strings* @@\
***************
*** 312,325 ****
*/
#ifndef SubdirSpecialSharedObjectRule
#define SubdirSpecialSharedObjectRule(objs,depends,options) @@\
- all:: @@\
- -@if [ ! -d shared ]; then mkdir shared; else exit 0; fi @@\
@@\
objs: depends @@\
$(RM) $@ shared/$@ @@\
! $(CC) $(PIC) -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) options $*.c @@\
! $(CP) $*.o shared/$*.o @@\
! $(CC) -c $(SHLIBDEF) $(CFLAGS) options $*.c
#endif /* SubdirSpecialSharedObjectRule */
--- 286,297 ----
*/
#ifndef SubdirSpecialSharedObjectRule
#define SubdirSpecialSharedObjectRule(objs,depends,options) @@\
@@\
objs: depends @@\
$(RM) $@ shared/$@ @@\
! $(CC) $(PIC) -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) options $*.c \ @@\
! -o shared/$*.o @@\
! $(CC) -c $(CFLAGS) options $*.c
#endif /* SubdirSpecialSharedObjectRule */
***************
*** 341,361 ****
#if DoRanlibCmd
#ifndef InstallSharedLibraryDataNoBuild
! #define InstallSharedLibraryDataNoBuild(libname,rev,dest) @@\
! install:: @@\
! -$(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.sa.rev dest @@\
! -$(RANLIB) $(RANLIBINSTFLAGS) dest/lib/**/libname.sa.rev
!
!
#endif /* InstallSharedLibraryDataNoBuild */
#else /* DoRanlibCmd */
#ifndef InstallSharedLibraryDataNoBuild
! #define InstallSharedLibraryDataNoBuild(libname,rev,dest) @@\
! install:: @@\
! -$(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.sa.rev dest
!
#endif /* InstallSharedLibraryDataNoBuild */
#endif /* DoRanlibCmd */
--- 313,325 ----
#if DoRanlibCmd
#ifndef InstallSharedLibraryDataNoBuild
! #define InstallSharedLibraryDataNoBuild(libname,rev,dest)
#endif /* InstallSharedLibraryDataNoBuild */
#else /* DoRanlibCmd */
#ifndef InstallSharedLibraryDataNoBuild
! #define InstallSharedLibraryDataNoBuild(libname,rev,dest)
#endif /* InstallSharedLibraryDataNoBuild */
#endif /* DoRanlibCmd */
***************
*** 366,374 ****
#ifndef InstallSharedLibraryNoBuild
#define InstallSharedLibraryNoBuild(libname,rev,dest) @@\
install:: @@\
! $(RM) /dest/lib/**/libname.so @@\
! $(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.so.rev dest @@\
! (cd dest; $(LN) lib/**/libname.so.rev lib/**/libname.so)
#endif /* InstallSharedLibraryNoBuild */
--- 330,337 ----
#ifndef InstallSharedLibraryNoBuild
#define InstallSharedLibraryNoBuild(libname,rev,dest) @@\
install:: @@\
! $(RM) /dest/lib/**/libname.so @@\
! $(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.so.rev dest
#endif /* InstallSharedLibraryNoBuild */
*** xview3.2/config/Imakefile.orig Tue Jun 29 13:13:19 1993
--- xview3.2/config/Imakefile Mon Nov 1 15:01:17 1993
***************
*** 8,14 ****
/**/# config directory
/**/# @(#)Imakefile 1.9 28 Jun 1993 SMI
! XVFILES = XView.cf XView.lib XView.obj XView.rules XView.tmpl library.tmpl
CFFILES = $(XVFILES) $(HEADERS)
InstallMultipleDestFlags(install,$(CFFILES),$(CONFIGDIR),$(INSTDATFLAGS))
--- 8,14 ----
/**/# config directory
/**/# @(#)Imakefile 1.9 28 Jun 1993 SMI
! XVFILES = XView.cf XView.lib XView.obj XView.prog XView.rules XView.tmpl
CFFILES = $(XVFILES) $(HEADERS)
InstallMultipleDestFlags(install,$(CFFILES),$(CONFIGDIR),$(INSTDATFLAGS))
*** xview3.2/contrib/examples/menus/menu_dir.c.orig Tue Jun 29 13:13:44 1993
--- xview3.2/contrib/examples/menus/menu_dir.c Mon Nov 1 13:57:01 1993
***************
*** 14,20 ****
#include <xview/canvas.h>
#include <sys/stat.h>
#include <dirent.h>
- #include <sys/dirent.h>
#include <X11/Xos.h>
#ifndef MAXPATHLEN
#include <sys/param.h> /* probably sun/BSD specific */
--- 14,19 ----
*** xview3.2/contrib/examples/menus/menu_dir2.c.orig Tue Jun 29 13:13:44 1993
--- xview3.2/contrib/examples/menus/menu_dir2.c Mon Nov 1 13:58:32 1993
***************
*** 14,20 ****
#include <xview/canvas.h>
#include <sys/stat.h>
#include <dirent.h>
- #include <sys/dirent.h>
#include <X11/Xos.h>
#ifndef MAXPATHLEN
#include <sys/param.h>
--- 14,19 ----
*** xview3.2/lib/libxview/base/Imakefile.orig Tue Jun 29 13:14:40 1993
--- xview3.2/lib/libxview/base/Imakefile Sun Oct 31 16:29:31 1993
***************
*** 37,43 ****
drawable.o\
xv_debug.o\
xv_parse.o\
! xv_list.o\
xv_error.o
SRCS=\
--- 37,43 ----
drawable.o\
xv_debug.o\
xv_parse.o\
! xv_list.o\
xv_error.o
SRCS=\
*** xview3.2/lib/libxview/base/xv_debug.h.orig Tue Jun 29 13:14:44 1993
--- xview3.2/lib/libxview/base/xv_debug.h Sun Oct 31 16:29:31 1993
***************
*** 9,19 ****
#ifndef _xv_debug_h_already_included
#define _xv_debug_h_already_included
#ifndef FILE
#ifndef SVR4
- #undef NULL
#endif SVR4
#include <stdio.h>
#endif FILE
#include <xview/pkg.h> /* needed to get definition of Xv_private */
/*
--- 9,24 ----
#ifndef _xv_debug_h_already_included
#define _xv_debug_h_already_included
+ #ifdef NULL
+ #undef NULL
+ #endif
#ifndef FILE
#ifndef SVR4
#endif SVR4
#include <stdio.h>
+ #ifndef NULL
+ #define NULL 0
+ #endif
#endif FILE
#include <xview/pkg.h> /* needed to get definition of Xv_private */
/*
*** xview3.2/lib/libxview/io_stream/file_strms.c.orig Tue Jun 29 13:15:07 1993
--- xview3.2/lib/libxview/io_stream/file_strms.c Sun Oct 31 16:29:33 1993
***************
*** 17,23 ****
--- 17,27 ----
#define GetFISData struct xv_file_input_stream_data *data = (struct xv_file_input_stream_data*) in->client_data
+ #ifndef __386BSD__
static struct xv_file_input_stream_data {
+ #else
+ struct xv_file_input_stream_data {
+ #endif
FILE *fp;
int lineno;
};
***************
*** 156,162 ****
--- 160,170 ----
#define GetFOSData struct xv_file_output_stream_data *data = (struct xv_file_output_stream_data*) out->client_data
+ #ifndef __386BSD__
static struct xv_file_output_stream_data {
+ #else
+ struct xv_file_output_stream_data {
+ #endif
FILE *fp;
int lineno;
};
*** xview3.2/lib/libxview/io_stream/othr_strms.c.orig Tue Jun 29 13:15:05 1993
--- xview3.2/lib/libxview/io_stream/othr_strms.c Sun Oct 31 16:29:34 1993
***************
*** 17,23 ****
--- 17,27 ----
#define GetFCSData struct xv_filter_comments_stream_data *data = (struct xv_filter_comments_stream_data*) in->client_data
+ #ifndef __386BSD__
static struct xv_filter_comments_stream_data {
+ #else
+ struct xv_filter_comments_stream_data {
+ #endif
Bool backed_up;
char backup, lastchar;
};
*** xview3.2/lib/libxview/io_stream/str_strms.c.orig Tue Jun 29 13:15:06 1993
--- xview3.2/lib/libxview/io_stream/str_strms.c Sun Oct 31 16:29:34 1993
***************
*** 17,23 ****
--- 17,27 ----
#define GetSISData struct string_input_stream_data *data = (struct string_input_stream_data*) in->client_data
+ #ifndef __386BSD__
static struct string_input_stream_data {
+ #else
+ struct string_input_stream_data {
+ #endif
char *string;
int charpos;
};
***************
*** 148,154 ****
--- 152,162 ----
#define GetSOSData struct string_output_stream_data *data = (struct string_output_stream_data*) out->client_data
+ #ifndef __386BSD__
static struct string_output_stream_data {
+ #else
+ struct string_output_stream_data {
+ #endif
char *string;
int charpos;
};
*** xview3.2/lib/libxview/sel/seln_impl.h.orig Tue Jun 29 13:15:25 1993
--- xview3.2/lib/libxview/sel/seln_impl.h Sun Oct 31 16:29:40 1993
***************
*** 9,20 ****
* file for terms of the license.
*/
#include <errno.h>
#ifndef FILE
#ifndef SVR4
- #undef NULL
#endif SVR4
#include <stdio.h>
#endif FILE
#include <sys/time.h>
#include <sys/types.h>
--- 9,25 ----
* file for terms of the license.
*/
+ #ifdef NULL
+ #undef NULL
+ #endif
#include <errno.h>
#ifndef FILE
#ifndef SVR4
#endif SVR4
#include <stdio.h>
+ #ifndef NULL
+ #define NULL 0
+ #endif
#endif FILE
#include <sys/time.h>
#include <sys/types.h>
*** xview3.2/lib/libxview/dnd/site.c.orig Tue Jun 29 13:15:58 1993
--- xview3.2/lib/libxview/dnd/site.c Sun Oct 31 16:29:31 1993
***************
*** 246,252 ****
/* (rectNode->rect) is of the wrong type. */
memmove(rect, &(rectNode->rect), sizeof(Rect));
#else
! bcopy(rectNode->rect, rect, sizeof(Rect));
#endif SVR4
return((Xv_opaque)rect);
--- 246,252 ----
/* (rectNode->rect) is of the wrong type. */
memmove(rect, &(rectNode->rect), sizeof(Rect));
#else
! bcopy(&(rectNode->rect), rect, sizeof(Rect));
#endif SVR4
return((Xv_opaque)rect);
*** xview3.2/lib/libxview/selection/sel_util.c.orig Tue Jun 29 13:16:03 1993
--- xview3.2/lib/libxview/selection/sel_util.c Sun Oct 31 16:29:41 1993
***************
*** 601,607 ****
reqTbl->reply = reply;
reqTbl->next = NULL;
(void)XSaveContext( dpy, DefaultRootWindow(dpy),replyCtx,
! (caddr_t *)reqTbl);
return reqTbl;
}
return (Sel_req_tbl *) xv_sel_add_new_req( reqTbl, reply );
--- 601,607 ----
reqTbl->reply = reply;
reqTbl->next = NULL;
(void)XSaveContext( dpy, DefaultRootWindow(dpy),replyCtx,
! (XPointer)reqTbl);
return reqTbl;
}
return (Sel_req_tbl *) xv_sel_add_new_req( reqTbl, reply );
*** xview3.2/lib/libxview/frame/fm_get.c.orig Tue Jun 29 13:16:10 1993
--- xview3.2/lib/libxview/frame/fm_get.c Sun Oct 31 16:29:32 1993
***************
*** 9,15 ****
* pending in the U.S. and foreign countries. See LEGAL_NOTICE
* file for terms of the license.
*/
!
#include <xview_private/fm_impl.h>
#include <xview_private/draw_impl.h>
#include <xview/server.h>
--- 9,15 ----
* pending in the U.S. and foreign countries. See LEGAL_NOTICE
* file for terms of the license.
*/
! #include <ctype.h>
#include <xview_private/fm_impl.h>
#include <xview_private/draw_impl.h>
#include <xview/server.h>
*** xview3.2/lib/libxview/frame/fm_impl.h.orig Tue Jun 29 13:16:15 1993
--- xview3.2/lib/libxview/frame/fm_impl.h Sun Oct 31 16:29:33 1993
***************
*** 17,27 ****
#define _frame_impl_h_already_included
/* standard includes */
#ifndef FILE
#ifndef SVR4
- #undef NULL
#endif SVR4
#include <stdio.h>
#endif FILE
#include <sys/time.h>
#ifdef OW_I18N
--- 17,32 ----
#define _frame_impl_h_already_included
/* standard includes */
+ #ifdef NULL
+ #undef NULL
+ #endif
#ifndef FILE
#ifndef SVR4
#endif SVR4
#include <stdio.h>
+ #ifndef NULL
+ #define NULL 0
+ #endif
#endif FILE
#include <sys/time.h>
#ifdef OW_I18N
*** xview3.2/lib/libxview/frame/frame_base.h.orig Tue Jun 29 13:16:14 1993
--- xview3.2/lib/libxview/frame/frame_base.h Sun Oct 31 16:29:33 1993
***************
*** 17,27 ****
#define _frame_base_h_already_included
/* standard includes */
#ifndef FILE
#ifndef SVR4
- #undef NULL
#endif SVR4
#include <stdio.h>
#endif FILE
#include <sys/time.h>
#include <xview/notify.h>
--- 17,32 ----
#define _frame_base_h_already_included
/* standard includes */
+ #ifdef NULL
+ #undef NULL
+ #endif
#ifndef FILE
#ifndef SVR4
#endif SVR4
#include <stdio.h>
+ #ifndef NULL
+ #define NULL 0
+ #endif
#endif FILE
#include <sys/time.h>
#include <xview/notify.h>
*** xview3.2/lib/libxview/frame/frame_cmd.h.orig Tue Jun 29 13:16:14 1993
--- xview3.2/lib/libxview/frame/frame_cmd.h Sun Oct 31 16:29:33 1993
***************
*** 17,27 ****
#define _frame_cmd_h_already_included
/* standard includes */
#ifndef FILE
#ifndef SVR4
- #undef NULL
#endif SVR4
#include <stdio.h>
#endif FILE
#include <sys/time.h>
#include <xview/notify.h>
--- 17,32 ----
#define _frame_cmd_h_already_included
/* standard includes */
+ #ifdef NULL
+ #undef NULL
+ #endif
#ifndef FILE
#ifndef SVR4
#endif SVR4
#include <stdio.h>
+ #ifndef NULL
+ #define NULL 0
+ #endif
#endif FILE
#include <sys/time.h>
#include <xview/notify.h>
*** xview3.2/lib/libxview/frame/frame_help.h.orig Tue Jun 29 13:16:10 1993
--- xview3.2/lib/libxview/frame/frame_help.h Sun Oct 31 16:29:33 1993
***************
*** 17,27 ****
#define _frame_help_h_already_included
/* standard includes */
#ifndef FILE
#ifndef SVR4
- #undef NULL
#endif SVR4
#include <stdio.h>
#endif FILE
#include <sys/time.h>
#include <xview/notify.h>
--- 17,32 ----
#define _frame_help_h_already_included
/* standard includes */
+ #ifdef NULL
+ #undef NULL
+ #endif
#ifndef FILE
#ifndef SVR4
#endif SVR4
#include <stdio.h>
+ #ifndef NULL
+ #define NULL 0
+ #endif
#endif FILE
#include <sys/time.h>
#include <xview/notify.h>
*** xview3.2/lib/libxview/menu/Imakefile.orig Tue Jun 29 13:16:27 1993
--- xview3.2/lib/libxview/menu/Imakefile Sun Oct 31 16:29:34 1993
***************
*** 28,34 ****
TEXT_OBJS =\
omi.o\
om_public.o\
! om_render.o\
om_set.o\
om_get.o\
om_compat.o
--- 28,34 ----
TEXT_OBJS =\
omi.o\
om_public.o\
! om_render.o\
om_set.o\
om_get.o\
om_compat.o
*** xview3.2/lib/libxview/menu/om_render.c.orig Tue Jun 29 13:16:26 1993
--- xview3.2/lib/libxview/menu/om_render.c Sun Oct 31 16:29:35 1993
***************
*** 470,478 ****
* Define the menu and shadow window dimensions. Note: shadow rect width &
* height = menu rect width & height
*/
! xv_set(m->window, XV_RECT, m->fs_menurect, 0);
if (!m->group_info->three_d)
! xv_set(m->shadow_window, XV_RECT, shadowrect, 0);
XFlush(XV_DISPLAY_FROM_WINDOW(m->window));
--- 470,478 ----
* Define the menu and shadow window dimensions. Note: shadow rect width &
* height = menu rect width & height
*/
! xv_set(m->window, XV_RECT, &m->fs_menurect, 0);
if (!m->group_info->three_d)
! xv_set(m->shadow_window, XV_RECT, &shadowrect, 0);
XFlush(XV_DISPLAY_FROM_WINDOW(m->window));
*** xview3.2/lib/libxview/menu/om_set.c.orig Tue Jun 29 13:16:24 1993
--- xview3.2/lib/libxview/menu/om_set.c Sun Oct 31 16:29:35 1993
***************
*** 12,17 ****
--- 12,18 ----
/* --------------------------------------------------------------------- */
#include <sys/types.h>
+ #include <ctype.h>
#include <xview_private/om_impl.h>
#include <xview_private/draw_impl.h>
#include <xview_private/fm_impl.h>
*** xview3.2/lib/libxview/misc/Imakefile.orig Tue Jun 29 13:16:36 1993
--- xview3.2/lib/libxview/misc/Imakefile Sun Oct 31 17:40:56 1993
***************
*** 29,36 ****
xv_i18n.c \
xv_path.c
! OFILES.misc.3 = ${CFILES.misc.3:%.c=%.o}
! OFILES.misc.4 = ${CFILES.misc.4:%.c=%.o}
HFILES.misc.3 =
HFILES.misc.4 =
--- 29,36 ----
xv_i18n.c \
xv_path.c
! OFILES.misc.3 = ${CFILES.misc.3:.c=.o}
! OFILES.misc.4 = ${CFILES.misc.4:.c=.o}
HFILES.misc.3 =
HFILES.misc.4 =
***************
*** 43,49 ****
GETTEXT.C =
#endif
! GETTEXT.O = ${GETTEXT.C:%.c=%.o}
HDRSPUBLIC= cms_grays.h cms_mono.h cmsrainbow.h cms_rgb.h sun.h \
window_hs.h expandname.h xv_c_types.h attrol.h db.h \
--- 43,49 ----
GETTEXT.C =
#endif
! GETTEXT.O = ${GETTEXT.C:.c=.o}
HDRSPUBLIC= cms_grays.h cms_mono.h cmsrainbow.h cms_rgb.h sun.h \
window_hs.h expandname.h xv_c_types.h attrol.h db.h \
***************
*** 57,63 ****
demorandom.o\
getlogindr.o\
expandname.o\
! expandpath.o\
bitmask.o\
hashfn.o\
db_conv.o\
--- 57,63 ----
demorandom.o\
getlogindr.o\
expandname.o\
! expandpath.o\
bitmask.o\
hashfn.o\
db_conv.o\
***************
*** 76,82 ****
demorandom.c\
getlogindr.c\
expandname.c\
! expandpath.c\
bitmask.c\
hashfn.c\
db_conv.c\
--- 76,82 ----
demorandom.c\
getlogindr.c\
expandname.c\
! expandpath.c\
bitmask.c\
hashfn.c\
db_conv.c\
***************
*** 95,101 ****
demorandom.o\
getlogindr.o\
expandname.o\
! expandpath.o\
bitmask.o\
hashfn.o\
db_conv.o\
--- 95,101 ----
demorandom.o\
getlogindr.o\
expandname.o\
! expandpath.o\
bitmask.o\
hashfn.o\
db_conv.o\
***************
*** 115,121 ****
demorandom.c\
getlogindr.c\
expandname.c\
! expandpath.c\
bitmask.c\
hashfn.c\
db_conv.c\
--- 115,121 ----
demorandom.c\
getlogindr.c\
expandname.c\
! expandpath.c\
bitmask.c\
hashfn.c\
db_conv.c\
*** xview3.2/lib/libxview/misc/expandname.c.orig Tue Jun 29 13:16:30 1993
--- xview3.2/lib/libxview/misc/expandname.c Sun Oct 31 16:29:36 1993
***************
*** 119,125 ****
length += status;
}
(void) close(pivec[0]);
! #ifndef SVR4
while (wait((union wait *) & status) != pid);
#else SVR4
while (wait( & status) != pid);
--- 119,125 ----
length += status;
}
(void) close(pivec[0]);
! #if !defined(SVR4) && !defined(__386BSD__)
while (wait((union wait *) & status) != pid);
#else SVR4
while (wait( & status) != pid);
*** xview3.2/lib/libxview/misc/getlogindr.c.orig Tue Jun 29 13:16:30 1993
--- xview3.2/lib/libxview/misc/getlogindr.c Sun Oct 31 16:29:36 1993
***************
*** 24,30 ****
--- 24,34 ----
xv_getlogindir()
{
extern char *getlogin(), *getenv();
+ #ifndef __3886BSD__
extern struct passwd *getpwnam(), *getpwuid();
+ #else
+ extern struct passwd *getpwnam();
+ #endif
struct passwd *passwdent;
char *home, *loginname;
*** xview3.2/lib/libxview/misc/portable.h.orig Tue Jun 29 13:16:34 1993
--- xview3.2/lib/libxview/misc/portable.h Sun Oct 31 16:29:36 1993
***************
*** 70,76 ****
--- 70,80 ----
#define XV_USE_TERMIOS
#define XV_USE_SVR4_PTYS
#else /* SVR4 */
+ #ifdef __386BSD__
+ #define XV_USE_TERMIOS
+ #else
#undef XV_USE_TERMIOS
+ #endif
#undef XV_USE_SVR4_PTYS
#endif /* SVR4 */
*** xview3.2/lib/libxview/panel/p_list.c.orig Tue Jun 29 13:16:48 1993
--- xview3.2/lib/libxview/panel/p_list.c Sun Oct 31 16:29:40 1993
***************
*** 3789,3795 ****
/* weigh timeval's against multiclick-timeout resource */
is_multiclick = panel_is_multiclick(ip->panel,
! dp->last_click_row->click_time,
&event_time(event)
);
--- 3789,3795 ----
/* weigh timeval's against multiclick-timeout resource */
is_multiclick = panel_is_multiclick(ip->panel,
! &dp->last_click_row->click_time,
&event_time(event)
);
*** xview3.2/lib/libxview/panel/panel_impl.h.orig Tue Jun 29 13:16:50 1993
--- xview3.2/lib/libxview/panel/panel_impl.h Sun Oct 31 16:29:40 1993
***************
*** 9,19 ****
#ifndef panel_impl_defined
#define panel_impl_defined
#ifndef FILE
#ifndef SVR4
- #undef NULL
#endif SVR4
#include <stdio.h>
#endif FILE
#include <sys/types.h>
#include <X11/Xlib.h>
--- 9,24 ----
#ifndef panel_impl_defined
#define panel_impl_defined
+ #ifdef NULL
+ #undef NULL
+ #endif
#ifndef FILE
#ifndef SVR4
#endif SVR4
#include <stdio.h>
+ #ifndef NULL
+ #define NULL 0
+ #endif
#endif FILE
#include <sys/types.h>
#include <X11/Xlib.h>
*** xview3.2/lib/libxview/ttysw/tty_gtty.c.orig Tue Jun 29 13:17:20 1993
--- xview3.2/lib/libxview/ttysw/tty_gtty.c Sun Oct 31 16:29:42 1993
***************
*** 34,39 ****
--- 34,40 ----
*/
#ifdef XV_USE_TERMIOS
+ #ifndef __386BSD__
static struct termios default_modes = {
BRKINT|ICRNL|IXON|IGNPAR|IMAXBEL, /* input modes */
OPOST|ONLCR, /* output modes */
***************
*** 57,62 ****
--- 58,78 ----
CWERASE, /* VWERASE */
CLNEXT, /* VLNEXT */
};
+ #else
+ #include <sys/ttydefaults.h>
+ static struct termios default_modes = {
+ TTYDEF_IFLAG, /* input modes */
+ TTYDEF_OFLAG, /* output modes */
+ TTYDEF_CFLAG, /* control modes */
+ TTYDEF_LFLAG, /* local modes */
+ /* control characters */
+ CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
+ _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
+ CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE,
+
+ TTYDEF_SPEED, TTYDEF_SPEED /* input and output speeds */
+ };
+ #endif
#else /* XV_USE_TERMIOS */
*** xview3.2/lib/libxview/ttysw/tty_impl.h.orig Tue Jun 29 13:17:18 1993
--- xview3.2/lib/libxview/ttysw/tty_impl.h Sun Oct 31 16:29:42 1993
***************
*** 210,216 ****
--- 210,222 ----
* Access functions for tty characteristics.
*/
#ifdef XV_USE_TERMIOS
+ #ifdef __386BSD__
+ #include <sys/ioctl.h>
+ #include <sys/ioctl_compat.h>
+ #define tty_gettabs(t) ((t)->termios.c_oflag & OXTABS)
+ #else
#define tty_gettabs(t) ((t)->termios.c_oflag & XTABS)
+ #endif
#define tty_getdsuspc(t) ((int) ((t)->termios.c_cc[VDSUSP]))
#define tty_geteofc(t) ((int) ((t)->termios.c_cc[VEOF]))
#define tty_geteolc(t) ((int) ((t)->termios.c_cc[VEOL]))
*** xview3.2/lib/libxview/ttysw/tty_init.c.orig Tue Jun 29 13:17:19 1993
--- xview3.2/lib/libxview/ttysw/tty_init.c Sun Oct 31 16:29:43 1993
***************
*** 517,522 ****
--- 517,525 ----
(void) dup2(ttysw->ttysw_tty, 1);
(void) dup2(ttysw->ttysw_tty, 2);
(void) close(ttysw->ttysw_tty);
+ #ifdef __386BSD__
+ (void) ioctl(0, TIOCSCTTY, NULL);
+ #endif
if (*argv == (char *) NULL || strcmp("-c", *argv) == 0) {
/* Process arg list */
***************
*** 955,961 ****
--- 958,968 ----
struct utmpx utmp;
#endif
struct passwd *passwdent;
+ #ifndef __386BSD__
extern struct passwd *getpwuid();
+ #else
+ struct passwd *getpwuid __P((uid_t));
+ #endif
int f;
char *ttyn;
extern char *ttyname();
***************
*** 1007,1019 ****
--- 1014,1035 ----
XV_MSG("Add tty[qrs][0-f] to /etc/ttys file.\n"));
return (0);
}
+ #ifndef __386BSD__
if ((f = open("/etc/utmp", 1)) >= 0) {
+ #else
+ if ((f = open(_PATH_UTMP, 1)) >= 0) {
+ #endif
(void) lseek(f, (long) (ttyslotuse * sizeof(utmp)), 0);
(void) write(f, (char *) &utmp, sizeof(utmp));
(void) close(f);
} else {
(void) fprintf(stderr,
+ #ifndef __386BSD__
XV_MSG("make sure that you can write /etc/utmp!\n"));
+ #else
+ XV_MSG("make sure that you can write "));
+ (void) fprintf(stderr, "%s!\n", _PATH_UTMP);
+ #endif
return (0);
}
return (ttyslotuse);
*** xview3.2/lib/libxview/ttysw/tty_main.c.orig Tue Jun 29 13:17:22 1993
--- xview3.2/lib/libxview/ttysw/tty_main.c Sun Oct 31 16:29:43 1993
***************
*** 906,913 ****
--- 906,917 ----
if (int_ucntl == (tiocsti & 0xff))
ttysw_process_STI(ttysw, owbp, cc - 1);
+ #ifndef XV_USE_TERMIOS
(void) ioctl(ttysw->ttysw_tty, TIOCGETC, &ttysw->tchars);
(void) ioctl(ttysw->ttysw_tty, TIOCGLTC, &ttysw->ltchars);
+ #else
+ (void)tcgetattr(ttysw->ttysw_tty, &ttysw->termios);
+ #endif
ttysw_getp(TTY_VIEW_HANDLE_FROM_TTY_FOLIO(ttysw)); /* jcb for nng */
} else
#ifdef OW_I18N
*** xview3.2/lib/libxview/ttysw/tty_ntfy.c.orig Tue Jun 29 13:17:17 1993
--- xview3.2/lib/libxview/ttysw/tty_ntfy.c Sun Oct 31 16:29:44 1993
***************
*** 171,180 ****
--- 171,184 ----
* SIGWINCHes on resize.
*/
/* Notify process group that terminal has changed. */
+ #ifndef __386BSD__
if (ioctl(ttysw->ttysw_tty, TIOCGPGRP, &pgrp) == -1) {
perror(XV_MSG("ttysw_sigwinch, can't get tty process group"));
return;
}
+ #else
+ pgrp = tcgetpgrp(ttysw->ttysw_pty);
+ #endif
/*
* Only killpg when pgrp is not tool's. This is the case of haven't
* completed ttysw_fork yet (or even tried to do it yet).
***************
*** 204,210 ****
--- 208,218 ----
return;
}
/* Send the signal to the process group of the controlling tty */
+ #ifndef __386BSD__
if (ioctl(ttysw->ttysw_tty, TIOCGPGRP, &control_pg) >= 0) {
+ #else
+ if ((control_pg = tcgetpgrp(ttysw->ttysw_pty)) >= 0) {
+ #endif
/*
* Flush our buffers of completed and partial commands. Be sure to do
* this BEFORE killpg, or we'll flush the prompt coming back from the
***************
*** 227,237 ****
termsw->cmd_started = 0;
termsw->pty_owes_newline = 0;
}
! # if defined(XV_USE_SVR4_PTYS) || defined(sun)
(void) ioctl(ttysw->ttysw_pty, TIOCSIGNAL, &sig);;
! # else
(void) killpg(control_pg, sig);
! # endif
} else
perror(XV_MSG("ioctl"));
}
--- 235,245 ----
termsw->cmd_started = 0;
termsw->pty_owes_newline = 0;
}
! #if defined(XV_USE_SVR4_PTYS) || defined(sun)
(void) ioctl(ttysw->ttysw_pty, TIOCSIGNAL, &sig);;
! #else
(void) killpg(control_pg, sig);
! #endif
} else
perror(XV_MSG("ioctl"));
}
*** xview3.2/lib/libxview/textsw/es_attr.c.orig Tue Jun 29 13:17:31 1993
--- xview3.2/lib/libxview/textsw/es_attr.c Sun Oct 31 16:29:41 1993
***************
*** 25,31 ****
es_set(register Es_handle esh, ...)
#else
es_set(esh, va_alist)
! register Es_handle esh;
va_dcl
#endif
{
--- 25,31 ----
es_set(register Es_handle esh, ...)
#else
es_set(esh, va_alist)
! Es_handle esh;
va_dcl
#endif
{
*** xview3.2/lib/libxview/textsw/txt_again.c.orig Tue Jun 29 13:17:32 1993
--- xview3.2/lib/libxview/textsw/txt_again.c Sun Oct 31 16:29:41 1993
***************
*** 182,187 ****
--- 182,188 ----
* Following is stolen from 3.2ALPHA sprintf(str, fmt, va_alist) SIDE_EFFECT:
* TXTSW_STRING_FREE(ptr_to_string) is modified by this routine.
*/
+ #ifndef __386BSD__
#ifndef SVR4
/* VARARGS2 */
***************
*** 325,330 ****
--- 326,357 ----
#endif /* SVR4 */
+ #else /* __386BSD__*/
+ /*inspiration taken from sprintf.c */
+
+ static int
+ textsw_printf(register string_t *ptr_to_string, char *fmt, ...)
+ {
+ FILE _strbuf;
+ int result;
+ va_list args;
+ _strbuf._flags = __SWR | __SSTR;
+ _strbuf._bf._base = _strbuf._p = (char *) TXTSW_STRING_FREE(ptr_to_string);
+ _strbuf._bf._size = _strbuf._w = ptr_to_string->max_length -
+ TXTSW_STRING_LENGTH(ptr_to_string);
+ VA_START(args, fmt);
+ result = vfprintf (&_strbuf, fmt, args);
+ va_end(args);
+ TXTSW_STRING_FREE(ptr_to_string) = (char *) _strbuf._p;
+ #ifndef lint
+ if (result >= 0)
+ putc('\0', &_strbuf);
+ #endif
+ return (result);
+ }
+
+ #endif /* __386BSD__*/
+
static void
textsw_record_buf(again, buffer, buffer_length)
register string_t *again;
***************
*** 619,624 ****
--- 646,653 ----
*/
/* VARARGS2 */
+ #ifndef __386BSD__
+
static int
#ifdef ANSI_FUNC_PROTO
textsw_scanf(register string_t *ptr_to_string, register char *fmt, ...)
***************
*** 705,710 ****
--- 734,773 ----
#endif /* OW_I18N */
}
+
+ #else /* __386BSD__ */
+ /*inspiration/code taken from sscanf.c */
+
+ static int
+ eofread(cookie, buf, len)
+ void *cookie;
+ char *buf;
+ int len;
+ {
+
+ return (0);
+ }
+
+ static int
+ textsw_scanf(register string_t *ptr_to_string, char *fmt, ...)
+ {
+ FILE _strbuf;
+ int result;
+ va_list args;
+
+ _strbuf._flags = __SRD;
+ _strbuf._bf._base = _strbuf._p = (char *) TXTSW_STRING_BASE(ptr_to_string);
+ _strbuf._bf._size = _strbuf._r = TXTSW_STRING_LENGTH(ptr_to_string);
+ _strbuf._read = eofread;
+ _strbuf._ub._base = NULL;
+ _strbuf._lb._base = NULL;
+ VA_START(args, fmt);
+ result = __svfscanf(&_strbuf, fmt, args);
+ va_end(args);
+ TXTSW_STRING_BASE(ptr_to_string) = (char *) _strbuf._p;
+ return (result);
+ }
+ #endif /*__386BSD__ */
static int
textsw_next_is_delimiter(again)
*** xview3.2/lib/libxview/textsw/txt_e_menu.c.orig Tue Jun 29 13:17:42 1993
--- xview3.2/lib/libxview/textsw/txt_e_menu.c Sun Oct 31 16:29:42 1993
***************
*** 136,142 ****
goto found;
}
! #ifdef notdef
/* Gee, still?... We will try the old fashioned way */
(void) sprintf(tmp, "%s/lib/.%s",
filename, EXTRASMENU);
--- 136,142 ----
goto found;
}
! #ifdef __386BSD__
/* Gee, still?... We will try the old fashioned way */
(void) sprintf(tmp, "%s/lib/.%s",
filename, EXTRASMENU);
*** xview3.2/lib/libxview/textsw/txt_popup.c.orig Tue Jun 29 13:17:38 1993
--- xview3.2/lib/libxview/textsw/txt_popup.c Mon Nov 15 06:12:50 1993
***************
*** 552,558 ****
NULL);
}
! static void
show_dot_files_proc( item, value, event )
Panel_choice_item item;
int value;
--- 552,558 ----
NULL);
}
! void
show_dot_files_proc( item, value, event )
Panel_choice_item item;
int value;
***************
*** 567,573 ****
* FILE_CHOOSER_EXTEN_FUNC, layout extension items within the
* given extension rect.
*/
! static int
fc_exten_func( fc, frame_rect, exten_rect, left_edge, right_edge, max_height )
File_chooser fc;
Rect *frame_rect;
--- 567,573 ----
* FILE_CHOOSER_EXTEN_FUNC, layout extension items within the
* given extension rect.
*/
! int
fc_exten_func( fc, frame_rect, exten_rect, left_edge, right_edge, max_height )
File_chooser fc;
Rect *frame_rect;
*** xview3.2/lib/libxview/file_chooser/Imakefile.orig Tue Jun 29 13:17:58 1993
--- xview3.2/lib/libxview/file_chooser/Imakefile Sat Nov 13 00:06:29 1993
***************
*** 33,48 ****
TEXT_OBJS =\
file_chsr.o\
! fc_layout.o\
! file_list.o\
! path.o\
! xv_path_util.o\
! hist_list.o\
! hist_menu.o\
! fchsr_data.o\
! flist_data.o\
! path_data.o\
! hist_data.o
SRCS =\
--- 33,44 ----
TEXT_OBJS =\
file_chsr.o\
! fc_layout.o\
! file_list.o\
! path.o\
! xv_path_util.o\
! hist_list.o\
! hist_menu.o
SRCS =\
***************
*** 54,61 ****
hist_list.c\
hist_menu.c\
fchsr_data.c\
! flist_data.c\
! path_data.c\
hist_data.c
LIBTARGET = xview
--- 50,57 ----
hist_list.c\
hist_menu.c\
fchsr_data.c\
! flist_data.c\
! path_data.c\
hist_data.c
LIBTARGET = xview
*** xview3.2/lib/libxview/file_chooser/fc_layout.c.orig Tue Jun 29 13:17:55 1993
--- xview3.2/lib/libxview/file_chooser/fc_layout.c Sun Nov 14 22:25:47 1993
***************
*** 464,471 ****
new_height
= (* private->exten_func)( FC_PUBLIC(private),
! private->rect,
! exten_rect,
COLS(2),
private->rect.r_width - COLS(2),
max_height
--- 464,471 ----
new_height
= (* private->exten_func)( FC_PUBLIC(private),
! &private->rect,
! &exten_rect,
COLS(2),
private->rect.r_width - COLS(2),
max_height
*** xview3.2/lib/libxview/file_chooser/file_list.c.orig Tue Jun 29 13:17:56 1993
--- xview3.2/lib/libxview/file_chooser/file_list.c Sun Oct 31 16:29:32 1993
***************
*** 23,29 ****
#include <xview_private/flist_impl.h>
#include <xview_private/portable.h>
!
/* X bitmaps for default glyphs */
#include <images/fl_arrow.xbm>
--- 23,31 ----
#include <xview_private/flist_impl.h>
#include <xview_private/portable.h>
! #ifdef __386BSD__
! #include <regex.h>
! #endif
/* X bitmaps for default glyphs */
#include <images/fl_arrow.xbm>
***************
*** 521,527 ****
--- 523,533 ----
if (status == DESTROY_CLEANUP) {
xv_free_ref( private->directory );
xv_free_ref( private->regex_pattern );
+ #ifndef __386BSD__
xv_free_ref( private->regex_compile );
+ #else
+ xv_free_regex_t( (regex_t *)private->regex_compile );
+ #endif
xv_free_ref( private->dotdot_string );
if ( private->dir_ptr )
(void) closedir( private->dir_ptr );
***************
*** 1175,1187 ****
--- 1181,1196 ----
#endif /* SVR4 */
+ #ifndef __386BSD__
#include <regexp.h>
+ #endif
static void
flist_compile_regex( private )
File_list_private *private;
{
+ #ifndef __386BSD__
char compile_buf[MAXPATHLEN+1];
char *end_ptr;
size_t num_bytes;
***************
*** 1197,1202 ****
--- 1206,1221 ----
xv_free_ref( private->regex_compile );
private->regex_compile = xv_alloc_n(char, num_bytes);
(void) XV_BCOPY(compile_buf, private->regex_compile, num_bytes);
+ #else
+ regex_t *compile_buf = malloc(sizeof(regex_t));
+ if (compile_buf == NULL){
+ fprintf(stderr, "Couldn't allocate compile buffer\n");
+ exit(-1);
+ }
+ regcomp(compile_buf, private->regex_pattern, 0);
+ xv_free_regex_t((regex_t *)private->regex_compile);
+ private->regex_compile = (char *)compile_buf;
+ #endif
}
***************
*** 1205,1211 ****
--- 1224,1234 ----
char *s;
File_list_private *private;
{
+ #ifndef __386BSD__
return step(s, private->regex_compile);
+ #else
+ return !regexec((regex_t *)private->regex_compile, s, 0, NULL, 0);
+ #endif
}
/****************************************************************************/
*** xview3.2/lib/libxview/file_chooser/xv_path_util.h.orig Sun Oct 31 14:36:27 1993
--- xview3.2/lib/libxview/file_chooser/xv_path_util.h Sun Oct 31 16:29:32 1993
***************
*** 41,46 ****
--- 41,47 ----
#define xv_free_ref(str) {if((str)) {xv_free((str)); (str) = NULL;}}
+ #define xv_free_regex_t(str) {if((str)) {regfree((str)); free ((str)); (str) = NULL;}}
EXTERN_FUNCTION(void xv_error_sprintf, (Frame frame, int use_footer, char *format, DOTDOTDOT) );
*** xview3.2/lib/libxview/notify/ndet.h.orig Tue Jun 29 13:18:12 1993
--- xview3.2/lib/libxview/notify/ndet.h Sun Oct 31 16:29:36 1993
***************
*** 17,22 ****
--- 17,26 ----
#ifndef NDET_DEFINED
#define NDET_DEFINED
+ #ifdef __386BSD__
+ #include <signal.h>
+ #endif
+
/*
********************** Detector Loop Notes ****************************
Here is some notes on the detector loop:
*** xview3.2/lib/libxview/notify/ndet_fcntl.c.orig Tue Jun 29 13:18:03 1993
--- xview3.2/lib/libxview/notify/ndet_fcntl.c Sun Oct 31 16:29:37 1993
***************
*** 22,38 ****
--- 22,56 ----
#ifdef SVR4
#include <sys/file.h>
#endif SVR4
+ #ifdef __386BSD__
+ #include <stdarg.h>
+ #endif
extern int
#ifdef SVR4
xv_fcntl(fd, cmd, arg)
#else
+ #ifdef __386BSD__
+ fcntl(int fd, int cmd, ...)
+ #else
fcntl(fd, cmd, arg)
+ #endif
#endif SVR4
+ #ifndef __386BSD__
int fd, cmd, arg;
+ #endif
{
fd_set bit;
int res;
+
+
+ #ifdef __386BSD__
+ int arg;
+ va_list valist;
+ va_start(valist, cmd);
+ arg = va_arg(valist, int);
+ va_end(valist);
+ #endif
/* Set fd bit */
FD_ZERO(&bit);
*** xview3.2/lib/libxview/notify/ndet_loop.c.orig Tue Jun 29 13:18:19 1993
--- xview3.2/lib/libxview/notify/ndet_loop.c Sun Oct 31 16:29:37 1993
***************
*** 224,230 ****
* will return with an EINTR when a signal arrives while IN
* select, not ON THE WAY into select).
*/
! #ifndef SVR4
nfds = syscall(SYS_select,
FD_SETSIZE, &ibits, &obits, &ebits,
(sigisempty(&ndet_sigs_received)) ? timer : &ndet_polling_tv);
--- 224,230 ----
* will return with an EINTR when a signal arrives while IN
* select, not ON THE WAY into select).
*/
! #if !defined(SVR4) && !defined (__386BSD__)
nfds = syscall(SYS_select,
FD_SETSIZE, &ibits, &obits, &ebits,
(sigisempty(&ndet_sigs_received)) ? timer : &ndet_polling_tv);
*** xview3.2/lib/libxview/notify/ndet_read.c.orig Tue Jun 29 13:18:04 1993
--- xview3.2/lib/libxview/notify/ndet_read.c Sun Oct 31 16:29:37 1993
***************
*** 29,39 ****
--- 29,44 ----
static Notify_client ndet_read_nclient = (Notify_client) & ndet_read_done;
+ #ifndef __386BSD__
extern int
read(fd, buf, nbytes)
register int fd;
char *buf;
int nbytes;
+ #else
+ extern int
+ read(int fd, void *buf, size_t nbytes)
+ #endif
{
int ndelay;
Notify_error return_code;
*** xview3.2/lib/libxview/notify/ntfy.h.orig Tue Jun 29 13:18:14 1993
--- xview3.2/lib/libxview/notify/ntfy.h Sun Oct 31 16:29:37 1993
***************
*** 22,27 ****
--- 22,31 ----
#include <sys/rusage.h>
#endif
#include <sys/resource.h>
+ #ifdef __386BSD__
+ #include <sys/wait.h>
+ #include <signal.h>
+ #endif
#include <xview/notify.h>
/*
***************
*** 149,155 ****
*/
typedef struct ntfy_wait3_data {
int pid; /* Process waiting for */
! #ifndef SVR4
union wait status; /* Return value from wait3 */
#else SVR4
int status; /* Return value from wait3 */
--- 153,159 ----
*/
typedef struct ntfy_wait3_data {
int pid; /* Process waiting for */
! #if !defined(SVR4) && !defined(__386BSD__)
union wait status; /* Return value from wait3 */
#else SVR4
int status; /* Return value from wait3 */
*** xview3.2/lib/libxview/notify/ntfy_test.c.orig Tue Jun 29 13:18:12 1993
--- xview3.2/lib/libxview/notify/ntfy_test.c Sun Oct 31 16:29:38 1993
***************
*** 989,995 ****
fprintf(stderr, "%s in unknown destroy status\n", arg1);
goto Error;
}
! if ((ne = notify_post_destroy(client, status)) != NOTIFY_OK) {
if (!(status == DESTROY_CHECKING &&
ne == NOTIFY_DESTROY_VETOED)) {
notify_perror("notify_destroy");
--- 989,995 ----
fprintf(stderr, "%s in unknown destroy status\n", arg1);
goto Error;
}
! if ((ne = notify_post_destroy(client, status), NOTIFY_IMMEDIATE) != NOTIFY_OK) {
if (!(status == DESTROY_CHECKING &&
ne == NOTIFY_DESTROY_VETOED)) {
notify_perror("notify_destroy");
***************
*** 1781,1787 ****
}
/* Send only last client event */
if (*event_count_ptr > 0) {
! (void) notify_event(nclient, *(events + (*event_count_ptr) - 1));
*event_count_ptr--;
}
/* Send fd 1 input */
--- 1781,1787 ----
}
/* Send only last client event */
if (*event_count_ptr > 0) {
! (void) notify_event(nclient, *(events + (*event_count_ptr) - 1), 0);
*event_count_ptr--;
}
/* Send fd 1 input */
*** xview3.2/lib/libxview/notify/ntfyclient.c.orig Tue Jun 29 13:18:11 1993
--- xview3.2/lib/libxview/notify/ntfyclient.c Sun Nov 14 00:36:20 1993
***************
*** 59,65 ****
/* See if hint matches */
if (*client_latest && (*client_latest)->nclient == nclient)
return (*client_latest);
!
if(( client_list == ndet_clients ) && ndet_clients ) {
dummy_client.nclient = nclient;
/* Find client */
--- 59,65 ----
/* See if hint matches */
if (*client_latest && (*client_latest)->nclient == nclient)
return (*client_latest);
! #ifndef __386BSD__
if(( client_list == ndet_clients ) && ndet_clients ) {
dummy_client.nclient = nclient;
/* Find client */
***************
*** 73,79 ****
return (client);
}
}
!
else
/* Search entire list */
for (client = client_list; client; client = next) {
--- 73,81 ----
return (client);
}
}
! #else
! if(0);
! #endif
else
/* Search entire list */
for (client = client_list; client; client = next) {
***************
*** 99,105 ****
{
register NTFY_CLIENT *client;
static NTFY_CLIENT *new_client;
!
if( client_list == &ndet_clients ) {
if( new_client == NTFY_CLIENT_NULL ) {
if ((new_client = ntfy_alloc_client()) == NTFY_CLIENT_NULL)
--- 101,107 ----
{
register NTFY_CLIENT *client;
static NTFY_CLIENT *new_client;
! #ifndef __386BSD__
if( client_list == &ndet_clients ) {
if( new_client == NTFY_CLIENT_NULL ) {
if ((new_client = ntfy_alloc_client()) == NTFY_CLIENT_NULL)
***************
*** 119,125 ****
else
return client;
}
!
else if ((client = ntfy_find_nclient(*client_list, nclient,
client_latest)) != NTFY_CLIENT_NULL)
return client;
--- 121,129 ----
else
return client;
}
! #else
! if (0);
! #endif
else if ((client = ntfy_find_nclient(*client_list, nclient,
client_latest)) != NTFY_CLIENT_NULL)
return client;
***************
*** 163,170 ****
--- 167,176 ----
ntfy_remove_condition(client, condition, who);
}
/* Remove & free client from client_list */
+ #ifndef __386BSD__
if( client_list == &ndet_clients )
tdelete( client, ndet_root, ndet_compar );
+ #endif
ntfy_remove_node((NTFY_NODE **) client_list, (NTFY_NODE *) client);
/* Invalidate condition hint */
*client_latest = NTFY_CLIENT_NULL;
---
Hung-Chi Chu Email: f80204@cc.ee.ntu.edu.tw
------------------------------------------------------------------------------