diff options
author | Havoc Pennington <hp@redhat.com> | 2001-10-12 20:16:59 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2001-10-12 20:16:59 +0000 |
commit | 977fcec3c7b11fb2e358fff71107c8afd692631a (patch) | |
tree | 971df427688e4b91a05b7d19fb7a82d54f0fe8aa | |
parent | 3559e2cc8ef4317cedf8c8a9091995922caf10dd (diff) | |
download | gconf-977fcec3c7b11fb2e358fff71107c8afd692631a.tar.gz |
don't translate "%s"GCONF_BEFORE_UTF8
2001-10-12 Havoc Pennington <hp@redhat.com>
* backends/xml-entry.c (entry_unset_value): don't translate "%s"
* backends/xml-cache.c (cache_sync_foreach): printf string screwup
* backends/xml-backend.c (query_value): fix printf string derived
from untrusted data
(query_value): ditto
* configure.in: ensure we find the right bdb headers, if we find
the library, error if not. Reported by Samuel Stringham
* backends/xml-entry.c, * backends/xml-backend.c, etc.: fix libxml
headers, should now work with libxml in a funny prefix, reported
by Tim Mooney
* gconf/gconftool.c: fix libxml headers
* backends/bdb.h, backends/bdb.c: s/uint32_t/guint32/ for
portability, reported by several people
* gconf/gconf-internals.c (gconf_double_to_string): use g_snprintf
not plain snprintf for Solaris 2.5.1 friendliness
* doc/gconf/tmpl/gconf-value.sgml: fix docs to mention that pairs
contain only primitive types; pointed out by Gregory Merchan
* configure.in (BDB_CFLAGS): patch from Nils Philippsen to detect
DB 3.1 if available.
Check for popt before OAF, because OAF requires popt;
reported by Drazen Kacar
-rw-r--r-- | ChangeLog | 34 | ||||
-rw-r--r-- | backends/bdb.c | 40 | ||||
-rw-r--r-- | backends/bdb.h | 4 | ||||
-rw-r--r-- | backends/xml-backend.c | 8 | ||||
-rw-r--r-- | backends/xml-cache.c | 2 | ||||
-rw-r--r-- | backends/xml-cache.h | 2 | ||||
-rw-r--r-- | backends/xml-dir.c | 2 | ||||
-rw-r--r-- | backends/xml-dir.h | 2 | ||||
-rw-r--r-- | backends/xml-entry.c | 6 | ||||
-rw-r--r-- | configure.in | 21 | ||||
-rw-r--r-- | doc/gconf/tmpl/gconf-value.sgml | 4 | ||||
-rw-r--r-- | gconf/gconf-error.c | 1 | ||||
-rw-r--r-- | gconf/gconf-internals.c | 4 | ||||
-rw-r--r-- | gconf/gconftool.c | 6 |
14 files changed, 89 insertions, 47 deletions
@@ -1,3 +1,37 @@ +2001-10-12 Havoc Pennington <hp@redhat.com> + + * backends/xml-entry.c (entry_unset_value): don't translate "%s" + + * backends/xml-cache.c (cache_sync_foreach): printf string screwup + + * backends/xml-backend.c (query_value): fix printf string derived + from untrusted data + (query_value): ditto + + * configure.in: ensure we find the right bdb headers, if we find + the library, error if not. Reported by Samuel Stringham + + * backends/xml-entry.c, * backends/xml-backend.c, etc.: fix libxml + headers, should now work with libxml in a funny prefix, reported + by Tim Mooney + + * gconf/gconftool.c: fix libxml headers + + * backends/bdb.h, backends/bdb.c: s/uint32_t/guint32/ for + portability, reported by several people + + * gconf/gconf-internals.c (gconf_double_to_string): use g_snprintf + not plain snprintf for Solaris 2.5.1 friendliness + + * doc/gconf/tmpl/gconf-value.sgml: fix docs to mention that pairs + contain only primitive types; pointed out by Gregory Merchan + + * configure.in (BDB_CFLAGS): patch from Nils Philippsen to detect + DB 3.1 if available. + + Check for popt before OAF, because OAF requires popt; + reported by Drazen Kacar + 2001-10-04 Havoc Pennington <hp@redhat.com> * gconf/gconf-internals.c (gconf_release_lock): do wack-ass juju diff --git a/backends/bdb.c b/backends/bdb.c index eb6d8bfe..98df131c 100644 --- a/backends/bdb.c +++ b/backends/bdb.c @@ -38,7 +38,7 @@ enum eDirectoryId { - INVALID_DIR_ID = (uint32_t) - 1 + INVALID_DIR_ID = (guint32) - 1 }; /* #define GCONF_ENABLE_BDB_DEBUG 1 */ @@ -54,8 +54,8 @@ static DB_ENV *bdb_db_env; extern GConfValue *bdb_get_value (BDB_Store * bdb, const char *key); extern GConfValue *bdb_restore_value (const char *srz); -static uint32_t -add_dir_to_parent (BDB_Store * bdb, uint32_t parent_id, const char *dir); +static guint32 +add_dir_to_parent (BDB_Store * bdb, guint32 parent_id, const char *dir); static char *get_schema_key (BDB_Store * bdb, const char *key); static void @@ -298,7 +298,7 @@ init_dbt_string (DBT * keyp, const char *key) } void -init_dbt_int (DBT * keyp, const uint32_t * key) +init_dbt_int (DBT * keyp, const guint32 * key) { keyp->data = (void *) key; keyp->size = sizeof (*key); @@ -331,12 +331,12 @@ temp_key_int (int akey) /* } */ -static uint32_t +static guint32 get_dir_id (BDB_Store * bdb, const char *dir) { int ret; DBT dirid; - uint32_t n; + guint32 n; if (strcmp (dir, "/") == 0) { @@ -405,11 +405,11 @@ free_dir (char *dir) /* { Functions to create directories and maintain the dir hierarchy */ -static uint32_t +static guint32 get_or_create_dir (BDB_Store * bdb, const char *dir) { - uint32_t parent_id; - uint32_t dir_id; + guint32 parent_id; + guint32 dir_id; char *parent; dir_id = get_dir_id (bdb, dir); @@ -425,11 +425,11 @@ get_or_create_dir (BDB_Store * bdb, const char *dir) return add_dir_to_parent (bdb, parent_id, dir); } -static uint32_t +static guint32 get_lock_id () { static int inited = 0; - static uint32_t id = 0; + static guint32 id = 0; if (!inited) { @@ -439,10 +439,10 @@ get_lock_id () return id; } -static uint32_t -add_dir_to_parent (BDB_Store * bdb, uint32_t parent_id, const char *dirp) +static guint32 +add_dir_to_parent (BDB_Store * bdb, guint32 parent_id, const char *dirp) { - uint32_t dir_id; + guint32 dir_id; int idir; DBT dir; DBT kdir_id; @@ -490,7 +490,7 @@ add_dir_to_parent (BDB_Store * bdb, uint32_t parent_id, const char *dirp) else { /* Increment the directory count and put back to database */ - dir_id = *(uint32_t *) kdir_id.data; + dir_id = *(guint32 *) kdir_id.data; dir_id = ntohl (dir_id); /* dir_id is currently in host format */ dir_id = htonl (dir_id + 1); /* return dir_id to net @@ -559,7 +559,7 @@ put_key (BDB_Store * bdb, const char *keypath, const char *value, size_t len) { DBT val; char *dir = parent_of (keypath); - uint32_t id = get_or_create_dir (bdb, dir); + guint32 id = get_or_create_dir (bdb, dir); int ret; DBT *tkeyp; DBT *skeyp; @@ -918,7 +918,7 @@ bdb_unset_value (BDB_Store * bdb, const char *keypath, const char *locale, GError ** err) { int mode; - uint32_t flags = 0; + guint32 flags = 0; int ret; DBT key; DBT value; @@ -931,7 +931,7 @@ bdb_unset_value (BDB_Store * bdb, const char *keypath, init_dbt_string (&key, keypath); if ((ret = bdb->dbvalp->get (bdb->dbvalp, NULL, &key, &value, flags)) == 0) { - uint32_t dirid; + guint32 dirid; char *dirpath; const char *keyname = gconf_key_key (keypath); /* delete the value */ @@ -979,8 +979,8 @@ bdb_remove_entries (BDB_Store * bdb, const char *dirpath, GError ** err) DBT key; DBT value; int mode; - uint32_t dirid = get_dir_id (bdb, dirpath); - uint32_t flags = 0; + guint32 dirid = get_dir_id (bdb, dirpath); + guint32 flags = 0; CLEAR_STRUCT (key); CLEAR_STRUCT (value); diff --git a/backends/bdb.h b/backends/bdb.h index 7ca57a17..92b9352d 100644 --- a/backends/bdb.h +++ b/backends/bdb.h @@ -155,10 +155,10 @@ BDB_Store *bdb_new (const char *dir, int flags); extern DBT *temp_string_key (const char *key); extern DBT *temp_int_key (int akey); -extern uint32_t get_dir_id (BDB_Store * bdb, const char *dir); +extern guint32 get_dir_id (BDB_Store * bdb, const char *dir); extern void add_key (BDB_Store * bdb, const char *dir, const char *keypath); extern void bdb_set_sysname (const char *name); -extern uint32_t get_or_create_dir (BDB_Store * bdb, const char *dir); +extern guint32 get_or_create_dir (BDB_Store * bdb, const char *dir); int bdb_create (BDB_Store * bdb, const char *dir); int bdb_open (BDB_Store * bdb, const char *dir, int flags); diff --git a/backends/xml-backend.c b/backends/xml-backend.c index b0074901..54ee1fed 100644 --- a/backends/xml-backend.c +++ b/backends/xml-backend.c @@ -26,8 +26,8 @@ #include "xml-cache.h" -#include <gnome-xml/tree.h> -#include <gnome-xml/parser.h> +#include <libxml/tree.h> +#include <libxml/parser.h> #include <stdio.h> #include <time.h> @@ -429,7 +429,7 @@ query_value (GConfSource* source, problem, since some errors may be added that need reporting. */ if (error != NULL) { - gconf_log(GCL_WARNING, error->message); + gconf_log(GCL_WARNING, "%s", error->message); g_error_free(error); error = NULL; } @@ -449,7 +449,7 @@ query_value (GConfSource* source, /* perhaps we should be reporting this error... */ if (error != NULL) { - gconf_log(GCL_WARNING, error->message); + gconf_log(GCL_WARNING, "%s", error->message); g_error_free(error); error = NULL; } diff --git a/backends/xml-cache.c b/backends/xml-cache.c index a211f950..3529981f 100644 --- a/backends/xml-cache.c +++ b/backends/xml-cache.c @@ -150,7 +150,7 @@ cache_sync_foreach(const gchar* key, { sd->failed = TRUE; g_return_if_fail(error != NULL); - gconf_log(GCL_ERR, error->message); + gconf_log(GCL_ERR, "%s", error->message); g_error_free(error); g_return_if_fail(dir_sync_pending(dir)); } diff --git a/backends/xml-cache.h b/backends/xml-cache.h index 1a7658a1..f7625aa4 100644 --- a/backends/xml-cache.h +++ b/backends/xml-cache.h @@ -21,7 +21,7 @@ #define GCONF_XML_CACHE_H #include <gconf/gconf.h> -#include <gnome-xml/tree.h> +#include <libxml/tree.h> #include "xml-dir.h" typedef struct _Cache Cache; diff --git a/backends/xml-dir.c b/backends/xml-dir.c index d5256797..46db0a63 100644 --- a/backends/xml-dir.c +++ b/backends/xml-dir.c @@ -20,7 +20,7 @@ #include "xml-dir.h" #include "xml-entry.h" -#include <gnome-xml/parser.h> +#include <libxml/parser.h> #include <stdio.h> #include <time.h> diff --git a/backends/xml-dir.h b/backends/xml-dir.h index d8ee9bc0..c57350fc 100644 --- a/backends/xml-dir.h +++ b/backends/xml-dir.h @@ -21,7 +21,7 @@ #define GCONF_XML_DIR_H #include <gconf/gconf.h> -#include <gnome-xml/tree.h> +#include <libxml/tree.h> /* Dir stores the information about a given directory */ diff --git a/backends/xml-entry.c b/backends/xml-entry.c index 04714682..ad58e4be 100644 --- a/backends/xml-entry.c +++ b/backends/xml-entry.c @@ -20,8 +20,8 @@ #include "xml-entry.h" #include <gconf/gconf-internals.h> #include <stdlib.h> -#include <gnome-xml/entities.h> -#include <gnome-xml/xmlmemory.h> +#include <libxml/entities.h> +#include <libxml/xmlmemory.h> static void entry_sync_if_needed(Entry* e, GConfValue* val); @@ -197,7 +197,7 @@ entry_unset_value (Entry *e, if (error != NULL) { - gconf_log(GCL_WARNING, _("%s"), error->message); + gconf_log(GCL_WARNING, "%s", error->message); g_error_free(error); error = NULL; } diff --git a/configure.in b/configure.in index 1e96ecba..1dd06cc9 100644 --- a/configure.in +++ b/configure.in @@ -140,6 +140,12 @@ if test "x$docs_only" = "xyes"; then AC_FYI("Only building documentation") else +AC_CHECK_LIB(popt, poptGetArg, POPT_LIBS=-lpopt, + [AC_CHECK_HEADER(popt.h, , AC_MSG_ERROR([[ +*** Couldn't find popt. Please download and install from +*** ftp://ftp.redhat.com/pub/redhat/code/popt and try again.]]))]) +AC_SUBST(POPT_LIBS) + AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(glib not found or too old),gmodule) AM_PATH_OAF(0.2.0,,AC_MSG_ERROR([OAF not found or too old])) AM_PATH_GTK(1.2.0,,HAVE_GTK=no) @@ -161,12 +167,17 @@ AC_SUBST(XML_CFLAGS) BDB_LIBS= BDB_CFLAGS= -AC_CHECK_LIB(db-3, db_env_create, BDB_LIBS=-ldb-3) -AC_CHECK_HEADERS(db3/db.h) +AC_CHECK_LIB(db-3.1, db_env_create, BDB_LIBS=-ldb-3.1) + +if test "x$BDB_LIBS" = x; then + AC_CHECK_LIB(db-3, db_env_create, BDB_LIBS=-ldb-3) +fi if test "x$BDB_LIBS" = x; then AC_MSG_WARN(No db3 library found. Not building bdb backend.) +else + AC_CHECK_HEADERS(db3/db.h, , AC_MSG_ERROR([db3 library found but db3/db.h not found])) fi AM_CONDITIONAL(BDB, test -n "$BDB_LIBS") @@ -174,12 +185,6 @@ AM_CONDITIONAL(BDB, test -n "$BDB_LIBS") AC_SUBST(BDB_LIBS) AC_SUBST(BDB_CFLAGS) -AC_CHECK_LIB(popt, poptGetArg, POPT_LIBS=-lpopt, - [AC_CHECK_HEADER(popt.h, , AC_MSG_ERROR([[ -*** Couldn't find popt. Please download and install from -*** ftp://ftp.redhat.com/pub/redhat/code/popt and try again.]]))]) -AC_SUBST(POPT_LIBS) - AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no) if test x$ORBIT_CONFIG = xno; then AC_MSG_ERROR(Couldn't find orbit-config) diff --git a/doc/gconf/tmpl/gconf-value.sgml b/doc/gconf/tmpl/gconf-value.sgml index 442f921b..d292bdc0 100644 --- a/doc/gconf/tmpl/gconf-value.sgml +++ b/doc/gconf/tmpl/gconf-value.sgml @@ -23,6 +23,7 @@ name with a value, for example if the value "10" is stored at the key A #GConfMetaInfo object holds metainformation about a key, such as its last modification time and the name of the schema associated with it. You should rarely if ever need to use #GConfMetaInfo. +(In fact you can't get the metainfo for a key using the current API.) </para> <!-- ##### SECTION See_Also ##### --> @@ -45,7 +46,8 @@ Used to indicate the type of a #GConfValue. a primitive type (i.e. they may not be lists or pairs), and all elements of a list must have the same type. @GCONF_VALUE_PAIR: Pair of #GConfValue; the first field (car) and the second -field (cdr) may have different types. +field (cdr) may have different types. The two elements of a pair must be primitive +types, not lists or pairs. <!-- ##### STRUCT GConfValue ##### --> <para> diff --git a/gconf/gconf-error.c b/gconf/gconf-error.c index 6c038b66..6eae5c8f 100644 --- a/gconf/gconf-error.c +++ b/gconf/gconf-error.c @@ -141,3 +141,4 @@ gconf_compose_errors (GError* err1, GError* err2) return n; } } + diff --git a/gconf/gconf-internals.c b/gconf/gconf-internals.c index 784fc8ac..c48f1187 100644 --- a/gconf/gconf-internals.c +++ b/gconf/gconf-internals.c @@ -1039,9 +1039,9 @@ gconf_double_to_string(gdouble val) setlocale (LC_NUMERIC, "C"); if (fabs (val) < 1e9 && fabs (val) > 1e-5) - snprintf (str, 100 + DBL_DIG, "%.*g", DBL_DIG, val); + g_snprintf (str, 100 + DBL_DIG, "%.*g", DBL_DIG, val); else - snprintf (str, 100 + DBL_DIG, "%f", val); + g_snprintf (str, 100 + DBL_DIG, "%f", val); setlocale (LC_NUMERIC, old_locale); g_free (old_locale); diff --git a/gconf/gconftool.c b/gconf/gconftool.c index cc631446..1ecda3a7 100644 --- a/gconf/gconftool.c +++ b/gconf/gconftool.c @@ -22,9 +22,9 @@ #include <stdio.h> #include <unistd.h> #include <popt.h> -#include <gnome-xml/tree.h> -#include <gnome-xml/parser.h> -#include <gnome-xml/xmlmemory.h> +#include <libxml/tree.h> +#include <libxml/parser.h> +#include <libxml/xmlmemory.h> #include <stdlib.h> #include <errno.h> |