[uim-commit] r1523 - in trunk: . qt replace uim xim

ekato at freedesktop.org ekato at freedesktop.org
Sun Sep 18 21:39:53 PDT 2005


Author: ekato
Date: 2005-09-18 21:39:50 -0700 (Sun, 18 Sep 2005)
New Revision: 1523

Added:
   trunk/replace/os_dep.h
Modified:
   trunk/configure.ac
   trunk/qt/Makefile.am
   trunk/replace/Makefile.am
   trunk/replace/getpeereid.c
   trunk/replace/setenv.c
   trunk/replace/strsep.c
   trunk/uim/uim-util.c
   trunk/xim/util.h
Log:
* configure.ac : Add #include "os_dep.h" in config.h.in and
  add replace and uim directories to INCLUDES.
* replace/os_dep.h : New header file of function declarations of
  os dependent one.
* replace/strsep.c : Remove uim_strsep as it is defined in
  os_dep.h.
* replace/setenv.c : Move function declaration into os_dep.h.
* replace/getpeereid.c : Don't include unused header files.
* replace/Makefile.am : Add os_dep.h to libreplace_la_SOURCES.
  Remove redundant INCLUDES.
* uim/uim-util.c : Remove function declaration of setenv().
* xim/util.h : Remove function declaration of uim_strsep().
* qt/Makefile.am : Remove redundant INCLUDES.


Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2005-09-19 02:38:22 UTC (rev 1522)
+++ trunk/configure.ac	2005-09-19 04:39:50 UTC (rev 1523)
@@ -766,6 +766,13 @@
             [Enable obsolete table API for hk.scm (broken)])
 fi
 
+AH_BOTTOM([/* Include os specific header. */
+#include "os_dep.h"])
+
+# Add include path
+INCLUDES='-I$(top_srcdir)/replace -I$(top_srcdir)/uim'
+AC_SUBST(INCLUDES)
+
 # Checks for typedefs, structures, and compiler characteristics.
 AC_HEADER_STDBOOL
 AC_C_CONST

Modified: trunk/qt/Makefile.am
===================================================================
--- trunk/qt/Makefile.am	2005-09-19 02:38:22 UTC (rev 1522)
+++ trunk/qt/Makefile.am	2005-09-19 04:39:50 UTC (rev 1523)
@@ -1,9 +1,6 @@
 EXTRA_DIST = pref-keyeditformbase.ui  pref-olisteditformbase.ui bushu.t
 
 if QT
-
-INCLUDES    = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/qt -I$(top_builddir)/qt
-
 QT_CXXFLAGS = $(UIM_QT_CXXFLAGS)
 QT_LDFLAGS  = $(UIM_QT_LDFLAGS)
 

Modified: trunk/replace/Makefile.am
===================================================================
--- trunk/replace/Makefile.am	2005-09-19 02:38:22 UTC (rev 1522)
+++ trunk/replace/Makefile.am	2005-09-19 04:39:50 UTC (rev 1523)
@@ -1,5 +1,2 @@
-INCLUDES = -I.. -I$(top_srcdir)/uim -I$(top_srcdir)/intl
-
 noinst_LTLIBRARIES = libreplace.la
-libreplace_la_SOURCES = strsep.c getpeereid.c setenv.c
-#libreplace_a_LIBADD = @LIBOBJS@
+libreplace_la_SOURCES = strsep.c getpeereid.c setenv.c os_dep.h

Modified: trunk/replace/getpeereid.c
===================================================================
--- trunk/replace/getpeereid.c	2005-09-19 02:38:22 UTC (rev 1522)
+++ trunk/replace/getpeereid.c	2005-09-19 04:39:50 UTC (rev 1523)
@@ -21,8 +21,6 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/param.h>
-#include "uim.h"
-#include "uim-helper.h"
 
 #if !defined(HAVE_GETPEEREID)
 

Added: trunk/replace/os_dep.h
===================================================================
--- trunk/replace/os_dep.h	2005-09-19 02:38:22 UTC (rev 1522)
+++ trunk/replace/os_dep.h	2005-09-19 04:39:50 UTC (rev 1523)
@@ -0,0 +1,74 @@
+/*
+
+  Copyright (c) 2003-2005 uim Project http://uim.freedesktop.org/
+
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+  3. Neither the name of authors nor the names of its contributors
+     may be used to endorse or promote products derived from this software
+     without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
+  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
+  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  SUCH DAMAGE.
+
+*/
+
+#ifndef _os_dep_h_included_
+#define _os_dep_h_included_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <sys/types.h>
+
+#ifndef HAVE_GETPEEREID
+int getpeereid(int , uid_t *, gid_t *);
+#endif
+
+/*
+ * I doubt uim_setenv and uim_unsetenv are really needed. Only libuim and
+ * uim-module-manager uses setenv and unsetenv. I choose linking libreplace.la
+ * to both of them for OSes not having setenv and unsetenv. If setenv and
+ * unsetenv are used in out of the uim, please uncomment.
+ *
+ * In any cases, we have to upgrade minor version of libuim.
+ * -- omote 09/17/2005
+ */
+#ifndef HAVE_SETENV
+/* #define setenv	uim_setenv */
+int setenv(const char *, const char *, int);
+#endif
+
+#ifndef HAVE_UNSETENV
+/* #define unsetenv	uim_unsetenv */
+void unsetenv(const char *);
+#endif
+
+#ifndef HAVE_STRSEP
+#define strsep	uim_strsep
+char *strsep(char **stringp, const char *delim);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif

Modified: trunk/replace/setenv.c
===================================================================
--- trunk/replace/setenv.c	2005-09-19 02:38:22 UTC (rev 1522)
+++ trunk/replace/setenv.c	2005-09-19 04:39:50 UTC (rev 1523)
@@ -34,12 +34,6 @@
 #if !defined(HAVE_SETENV) || !defined(HAVE_UNSETENV)
 
 static char *__findenv(const char *name, int *offset);
-#ifndef HAVE_SETENV
-int setenv(const char *, const char *, int);
-#endif
-#ifndef HAVE_UNSETENV
-void unsetenv(const char *);
-#endif
 extern char **environ;
 
 /*
@@ -161,27 +155,3 @@
 #endif /* HAVE_UNSETENV */
 
 #endif /* !defined(HAVE_SETENV) || !defined(HAVE_UNSETENV) */
-
-#if 0
-/*
- * I doubt uim_setenv and uim_unsetenv are really needed. Only libuim and
- * uim-module-manager uses setenv and unsetenv. I choose linking libreplace.la
- * to both of them for OSes not having setenv and unsetenv. If setenv and
- * unsetenv are used in out of the uim, please uncomment.
- *
- * In any cases, we have to upgrade minor version of libuim.
- * -- omote 09/17/2005
- */
-
-int
-uim_setenv(const char *name, const char *value, const char *rewrite)
-{
-  setenv(name, value, rewrite);
-}
-
-void
-uim_unsetenv(const char *name)
-{
-  unsetenv(name);
-}
-#endif

Modified: trunk/replace/strsep.c
===================================================================
--- trunk/replace/strsep.c	2005-09-19 02:38:22 UTC (rev 1522)
+++ trunk/replace/strsep.c	2005-09-19 04:39:50 UTC (rev 1523)
@@ -70,15 +70,4 @@
 	}
 	/* NOTREACHED */
 }
-
-/*
- * uim_strsep is needed for keeping libuim's ABI.
- */
-char *
-uim_strsep(char **stringp, const char *delim)
-{
-  strsep(stringp, delim);
-}
-
 #endif /* !defined(HAVE_STRSEP) */
-

Modified: trunk/uim/uim-util.c
===================================================================
--- trunk/uim/uim-util.c	2005-09-19 02:38:22 UTC (rev 1522)
+++ trunk/uim/uim-util.c	2005-09-19 04:39:50 UTC (rev 1523)
@@ -46,13 +46,6 @@
 #include "uim-compat-scm.h"
 #include "uim-util.h"
 
-#ifndef HAVE_SETENV
-int setenv(const char *, const char *, int);
-#endif
-#ifndef HAVE_UNSETENV
-void unsetenv(const char *);
-#endif
-
 extern char *uim_return_str;
 
 /* define constants as procedure to ensure unmodifiable */

Modified: trunk/xim/util.h
===================================================================
--- trunk/xim/util.h	2005-09-19 02:38:22 UTC (rev 1522)
+++ trunk/xim/util.h	2005-09-19 04:39:50 UTC (rev 1523)
@@ -55,14 +55,4 @@
 int vasprintf(char **ptr, const char *fmt, va_list ap);
 #endif
 
-#ifndef HAVE_STRSEP
-#ifdef __cplusplus
-extern "C" {
 #endif
-char *uim_strsep(char **stringp, const char *delim);
-#define strsep	uim_strsep
-#ifdef __cplusplus
-}
-#endif
-#endif
-#endif



More information about the uim-commit mailing list