/* Written by jla, 4/90 */
+#ifdef emacs
+#include "config.h"
+#endif
+
+#if 1 /* I'd really appreciate it if this code could go away... -JimB */
+/* this avoids lossage in the `dual-universe' headers on AT&T SysV X11 */
+#ifdef USG5
+#define SYSV
+#include <unistd.h>
+#endif /* USG5 */
+
+#endif /* 1 */
+
+/* This should be included before the X include files; otherwise, we get
+ warnings about redefining NULL under BSD 4.3. */
+#include <sys/param.h>
+
#include <X11/Xlib.h>
#include <X11/Xatom.h>
+#if 0
#include <X11/Xos.h>
+#endif
#include <X11/X.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>
-#include <sys/param.h>
#ifdef VMS
#include "vms-pwd.h"
#else
#include <pwd.h>
#endif
#include <sys/stat.h>
-#include <sys/types.h>
-#ifdef emacs
-#include "config.h"
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 256
#endif
extern char *getenv ();
-extern uid_t getuid ();
+extern short getuid (); /* If this causes portability problems,
+ I think we should just delete it; it'll
+ default to `int' anyway. */
extern struct passwd *getpwuid ();
extern struct passwd *getpwnam ();
{
struct stat status;
- return (access (path, R_OK) == 0 /* exists and is readable */
+ return (access (path, 4) == 0 /* exists and is readable */
&& stat (path, &status) == 0 /* get the status */
&& (status.st_mode & S_IFDIR) == 0); /* not a directory */
}
XrmDatabase db;
char *xdefs;
+#ifdef HAVE_X11R4
xdefs = XResourceManagerString (display);
+#else
+ xdefs = display->xdefaults;
+#endif
+
if (xdefs != NULL)
db = XrmGetStringDatabase (xdefs);
else
&& (type == expected_type))
{
if (type == x_rm_string)
- (char *) ret_value->addr = value.addr;
+ ret_value->addr = (char *) value.addr;
else
bcopy (value.addr, ret_value->addr, ret_value->size);