]> code.delx.au - gnu-emacs/blobdiff - src/xrdb.c
Merge from mainline.
[gnu-emacs] / src / xrdb.c
index 72b9e07738e99776e9871dcf389e1fcc58943230..64879fbc4d369033448a08eade96df19af08b86a 100644 (file)
@@ -1,6 +1,6 @@
 /* Deal with the X Resource Manager.
    Copyright (C) 1990, 1993, 1994, 2000, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+                 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
 Author: Joseph Arceneaux
 Created: 4/90
@@ -22,10 +22,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
-
 #include <errno.h>
 #include <epaths.h>
 
@@ -48,12 +45,17 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "lisp.h"
 
+#ifdef USE_MOTIF
+/* For Vdouble_click_time.  */
+#include "keyboard.h"
+#endif
+
 extern char *getenv (const char *);
 
 extern struct passwd *getpwuid (uid_t);
 extern struct passwd *getpwnam (const char *);
 
-extern char *get_system_name (void);
+extern const char *get_system_name (void);
 
 char *x_get_string_resource (XrmDatabase rdb, const char *name,
                             const char *class);
@@ -71,8 +73,9 @@ char *x_customization_string;
 /* Return the value of the emacs.customization (Emacs.Customization)
    resource, for later use in search path decoding.  If we find no
    such resource, return zero.  */
-char *
-x_get_customization_string (XrmDatabase db, const char *name, const char *class)
+static char *
+x_get_customization_string (XrmDatabase db, const char *name,
+                           const char *class)
 {
   char *full_name
     = (char *) alloca (strlen (name) + sizeof ("customization") + 3);
@@ -127,7 +130,7 @@ x_get_customization_string (XrmDatabase db, const char *name, const char *class)
    Return NULL otherwise.  */
 
 static char *
-magic_file_p (const char *string, int string_len, const char *class, const char *escaped_suffix, const char *suffix)
+magic_file_p (const char *string, EMACS_INT string_len, const char *class, const char *escaped_suffix, const char *suffix)
 {
   char *lang = getenv ("LANG");
 
@@ -334,16 +337,17 @@ static XrmDatabase
 get_system_app (const char *class)
 {
   XrmDatabase db = NULL;
-  char *path;
+  const char *path;
+  char *p;
 
   path = getenv ("XFILESEARCHPATH");
   if (! path) path = PATH_X_DEFAULTS;
 
-  path = search_magic_path (path, class, 0, 0);
-  if (path)
+  p = search_magic_path (path, class, 0, 0);
+  if (p)
     {
-      db = XrmGetFileDatabase (path);
-      xfree (path);
+      db = XrmGetFileDatabase (p);
+      xfree (p);
     }
 
   return db;
@@ -360,7 +364,7 @@ get_fallback (Display *display)
 static XrmDatabase
 get_user_app (const char *class)
 {
-  char *path;
+  const char *path;
   char *file = 0;
   char *free_it = 0;
 
@@ -438,7 +442,8 @@ get_environ_db (void)
 {
   XrmDatabase db;
   char *p;
-  char *path = 0, *home = 0, *host;
+  char *path = 0, *home = 0;
+  const char *host;
 
   if ((p = getenv ("XENVIRONMENT")) == NULL)
     {
@@ -602,8 +607,9 @@ x_load_resources (Display *display, const char *xrm_string,
 /* Retrieve the value of the resource specified by NAME with class CLASS
    and of type TYPE from database RDB.  The value is returned in RET_VALUE. */
 
-int
-x_get_resource (XrmDatabase rdb, const char *name, const char *class, XrmRepresentation expected_type, XrmValue *ret_value)
+static int
+x_get_resource (XrmDatabase rdb, const char *name, const char *class,
+               XrmRepresentation expected_type, XrmValue *ret_value)
 {
   XrmValue value;
   XrmName namelist[100];
@@ -758,5 +764,3 @@ main (argc, argv)
 }
 #endif /* TESTRM */
 
-/* arch-tag: 37e6fbab-ed05-4363-9e76-6c4109ed511f
-   (do not change this comment) */