--- /dev/null
+include $(top_srcdir)/Makefile.inc
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/navit -I$(top_srcdir)/navit/support -DMODULE=support_glib
+noinst_LTLIBRARIES = libsupport_glib.la
+libsupport_glib_la_SOURCES = fake.c galiasdef.c gatomic.c gerror.c \
+ ghash.c glib_init.c glist.c gmem.c gmessages.c gprimes.c gprintf.c gslice.c \
+ gstrfuncs.c gstring.c gutils.c \
+ fake.h galias.h gerror.h ghash.h glib.h glibconfig.h glibintl.h glist.h \
+ gmacros.h gmem.h gmessages.h gprintf.h gprintfint.h gquark.h gslice.h \
+ gstrfuncs.h gthreadprivate.h gtypes.h
--- /dev/null
+char *
+g_convert(char *in)
+{
+ return g_strdup(in);
+}
--- /dev/null
+#define g_return_if_fail
+#define GMutex void
+#define GPrivate void
+#define g_mutex_new() NULL
+#define g_mutex_lock(x)
+#define g_mutex_unlock(x)
return error;
}
+#if NOT_NEEDED_FOR_NAVIT
/**
* g_error_new:
* @domain: error domain
#define ERROR_OVERWRITTEN_WARNING "GError set over the top of a previous GError or uninitialized memory.\n" \
"This indicates a bug in someone's code. You must ensure an error is NULL before it's set.\n" \
"The overwriting error message was: %s"
+#endif /* NOT_NEEDED_FOR_NAVIT */
/**
* g_set_error:
if (*err == NULL)
*err = new;
+#if NOT_NEEDED_FOR_NAVIT
else
g_warning (ERROR_OVERWRITTEN_WARNING, new->message);
+#endif /* NOT_NEEDED_FOR_NAVIT */
}
+#if NOT_NEEDED_FOR_NAVIT
/**
* g_set_error_literal:
* @err: a return location for a #GError, or %NULL
}
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
#define __G_ERROR_C__
#include "galiasdef.c"
--- /dev/null
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_LIB_H__
+#define __G_LIB_H__
+
+#define __GLIB_H_INSIDE__
+#include <glib/fake.h>
+#include <glib/ghash.h>
+#include <glib/gerror.h>
+#include <glib/gmessages.h>
+#include <glib/gstrfuncs.h>
+
+#undef __GLIB_H_INSIDE__
+
+#endif /* __G_LIB_H__ */
--- /dev/null
+#include "plugin.h"
+
+void
+plugin_init(void)
+{
+}
#define G_GNUC_INTERNAL
+#if NOT_NEEDED_FOR_NAVIT
#define G_THREADS_ENABLED
#define G_THREADS_IMPL_WIN32
+#endif /* NOT_NEEDED_FOR_NAVIT */
typedef struct _GMutex* GStaticMutex;
#define G_STATIC_MUTEX_INIT NULL
#define g_static_mutex_get_mutex(mutex) \
#define G_MODULE_SUFFIX "dll"
+#define HAVE_GOOD_PRINTF
+#define NO_SYS_SIGLIST_DECL
+#define GLIB_STATIC_COMPILATION
+#define G_DISABLE_CHECKS
/* A GPid is an abstraction for a process "handle". It is *not* an
* abstraction for a process identifier in general. GPid is used in
* GLib only for descendant processes spawned with the g_spawn*
#ifndef __GLIBINTL_H__
#define __GLIBINTL_H__
+#if NOT_NEEDED_FOR_NAVIT
#ifndef SIZEOF_CHAR
#error "config.h must be included prior to glibintl.h"
#endif
+#endif /* NOT_NEEDED_FOR_NAVIT */
G_CONST_RETURN gchar *glib_gettext (const gchar *str);
if (mem)
return mem;
+#if NOT_NEEDED_FOR_NAVIT
g_error ("%s: failed to allocate %"G_GSIZE_FORMAT" bytes",
G_STRLOC, n_bytes);
+#endif /* NOT_NEEDED_FOR_NAVIT */
}
return NULL;
if (mem)
return mem;
+#if NOT_NEEDED_FOR_NAVIT
g_error ("%s: failed to allocate %"G_GSIZE_FORMAT" bytes",
G_STRLOC, n_bytes);
+#endif /* NOT_NEEDED_FOR_NAVIT */
}
return NULL;
if (mem)
return mem;
+#if NOT_NEEDED_FOR_NAVIT
g_error ("%s: failed to allocate %"G_GSIZE_FORMAT" bytes",
G_STRLOC, n_bytes);
+#endif /* NOT_NEEDED_FOR_NAVIT */
}
if (mem)
glib_mem_vtable.try_realloc = vtable->try_realloc ? vtable->try_realloc : glib_mem_vtable.realloc;
vtable_set = TRUE;
}
+#if NOT_NEEDED_FOR_NAVIT
else
g_warning (G_STRLOC ": memory allocation vtable lacks one of malloc(), realloc() or free()");
+#endif /* NOT_NEEDED_FOR_NAVIT */
}
+#if NOT_NEEDED_FOR_NAVIT
else
g_warning (G_STRLOC ": memory allocation vtable can only be set once at startup");
+#endif /* NOT_NEEDED_FOR_NAVIT */
}
static void
g_mem_init_nomessage (void)
{
+#if NOT_NEEDED_FOR_NAVIT
gchar buffer[1024];
const gchar *val;
const GDebugKey keys[] = {
{
g_mem_gc_friendly = TRUE;
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
g_mem_initialized = TRUE;
}
#include <errno.h>
#include "glib.h"
+#if NOT_NEEDED_FOR_NAVIT
#include "gdebug.h"
+#endif /* NOT_NEEDED_FOR_NAVIT */
#include "gprintfint.h"
#include "gthreadprivate.h"
#include "galias.h"
+#if NOT_NEEDED_FOR_NAVIT
#ifdef G_OS_WIN32
#include <process.h> /* For getpid() */
#include <io.h>
g_free (string);
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
gsize
g_printf_string_upper_bound (const gchar *format,
va_list args)
return _g_vsnprintf (&c, 1, format, args) + 1;
}
+#if NOT_NEEDED_FOR_NAVIT
void
_g_messages_thread_init_nomessage (void)
{
g_log_set_always_fatal (fatal_mask);
}
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
#define __G_MESSAGES_C__
#include "galiasdef.c"
* [4] allocating ca. 8 chunks per block/page keeps a good balance between
* external and internal fragmentation (<= 12.5%). [Bonwick94]
*/
+#if NOT_NEEDED_FOR_NAVIT
/* --- macros and constants --- */
#define LARGEALIGNMENT (256)
mag->count++;
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
/* --- API functions --- */
gpointer
g_slice_alloc (gsize mem_size)
{
+#if NOT_NEEDED_FOR_NAVIT
gsize chunk_size;
gpointer mem;
guint acat;
if (G_UNLIKELY (allocator->config.debug_blocks))
smc_notify_alloc (mem, mem_size);
return mem;
+#else /* NOT_NEEDED_FOR_NAVIT */
+ return g_malloc(mem_size);
+#endif /* NOT_NEEDED_FOR_NAVIT */
}
gpointer
g_slice_free1 (gsize mem_size,
gpointer mem_block)
{
+#if NOT_NEEDED_FOR_NAVIT
gsize chunk_size = P2ALIGN (mem_size);
guint acat = allocator_categorize (chunk_size);
if (G_UNLIKELY (!mem_block))
memset (mem_block, 0, mem_size);
g_free (mem_block);
}
+#else /* NOT_NEEDED_FOR_NAVIT */
+ g_free(mem_block);
+#endif /* NOT_NEEDED_FOR_NAVIT */
}
void
gsize next_offset)
{
gpointer slice = mem_chain;
+#if NOT_NEEDED_FOR_NAVIT
/* while the thread magazines and the magazine cache are implemented so that
* they can easily be extended to allow for free lists containing more free
* lists for the first level nodes, which would allow O(1) freeing in this
g_mutex_unlock (allocator->slab_mutex);
}
else /* delegate to system malloc */
+#else /* NOT_NEEDED_FOR_NAVIT */
while (slice)
{
guint8 *current = slice;
slice = *(gpointer*) (current + next_offset);
+#if NOT_NEEDED_FOR_NAVIT
if (G_UNLIKELY (allocator->config.debug_blocks) &&
!smc_notify_free (current, mem_size))
abort();
+#endif /* NOT_NEEDED_FOR_NAVIT */
if (G_UNLIKELY (g_mem_gc_friendly))
memset (current, 0, mem_size);
g_free (current);
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
}
+#if NOT_NEEDED_FOR_NAVIT
/* --- single page allocator --- */
static void
allocator_slab_stack_push (Allocator *allocator,
#define __G_SLICE_C__
#include "galiasdef.c"
+#endif /* NOT_NEEDED_FOR_NAVIT */
decimal_point = locale_data->decimal_point;
decimal_point_len = strlen (decimal_point);
+#if NOT_NEEDED_FOR_NAVIT
g_assert (decimal_point_len != 0);
+#endif /* NOT_NEEDED_FOR_NAVIT */
decimal_point_pos = NULL;
end = NULL;
decimal_point = locale_data->decimal_point;
decimal_point_len = strlen (decimal_point);
+#if NOT_NEEDED_FOR_NAVIT
g_assert (decimal_point_len != 0);
+#endif /* NOT_NEEDED_FOR_NAVIT */
if (decimal_point[0] != '.' ||
decimal_point[1] != 0)
return (gint64) result;
}
+#if NOT_NEEDED_FOR_NAVIT
G_CONST_RETURN gchar*
g_strerror (gint errnum)
{
#endif
}
#else /* NO_SYS_ERRLIST */
+#if NOT_NEEDED_FOR_NAVIT
extern int sys_nerr;
extern char *sys_errlist[];
if ((errnum > 0) && (errnum <= sys_nerr))
return sys_errlist [errnum];
+#else /* NOT_NEEDED_FOR_NAVIT */
+ return NULL;
+#endif /* NOT_NEEDED_FOR_NAVIT */
#endif /* NO_SYS_ERRLIST */
msg = g_static_private_get (&msg_private);
}
#else /* NO_SYS_SIGLIST */
+#if NOT_NEEDED_FOR_NAVIT
#ifdef NO_SYS_SIGLIST_DECL
extern char *sys_siglist[]; /*(see Tue Jan 19 00:44:24 1999 in changelog)*/
#endif
return (char*) /* this function should return const --josh */ sys_siglist [signum];
+#else /* NOT_NEEDED_FOR_NAVIT */
+ return NULL;
+#endif /* NOT_NEEDED_FOR_NAVIT */
#endif /* NO_SYS_SIGLIST */
msg = g_static_private_get (&msg_private);
return msg;
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
/* Functions g_strlcpy and g_strlcat were originally developed by
* Todd C. Miller <Todd.Miller@courtesan.com> to simplify writing secure code.
switch (*p)
{
case '\0':
+#if NOT_NEEDED_FOR_NAVIT
g_warning ("g_strcompress: trailing \\");
+#endif /* NOT_NEEDED_FOR_NAVIT */
goto out;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7':
return string;
}
+#if NOT_NEEDED_FOR_NAVIT
/**
* g_strsplit:
* @string: a string to split.
return result;
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
/**
* g_strfreev:
return string;
}
+#if NOT_NEEDED_FOR_NAVIT
/**
* g_strstr_len:
return NULL;
}
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
/**
* g_strrstr:
return NULL;
}
+#if NOT_NEEDED_FOR_NAVIT
/**
* g_strrstr_len:
* @haystack: a nul-terminated string.
return dngettext (domain, msgid, msgid_plural, n);
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
#define __G_STRFUNCS_C__
#include "galiasdef.c"
#include "galias.h"
+#if NOT_NEEDED_FOR_NAVIT
struct _GStringChunk
{
GHashTable *const_table;
gsize this_size;
gsize default_size;
};
+#endif /* NOT_NEEDED_FOR_NAVIT */
/* Hash Functions.
*/
return h;
}
+#if NOT_NEEDED_FOR_NAVIT
#define MY_MAXSIZE ((gsize)-1)
static inline gsize
va_end (args);
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
#define __G_STRING_C__
#include "galiasdef.c"
#endif /* G_PLATFORM_WIN32 */
#ifdef G_OS_WIN32
+#if NOT_NEEDED_FOR_NAVIT
# include <direct.h>
+#endif /* NOT_NEEDED_FOR_NAVIT */
# include <shlobj.h>
/* older SDK (e.g. msvc 5.0) does not have these*/
# ifndef CSIDL_MYMUSIC
#include <libintl.h>
#endif
+#if NOT_NEEDED_FOR_NAVIT
const guint glib_major_version = GLIB_MAJOR_VERSION;
const guint glib_minor_version = GLIB_MINOR_VERSION;
const guint glib_micro_version = GLIB_MICRO_VERSION;
return (G_CONST_RETURN gchar * G_CONST_RETURN *) cache->language_names;
}
+#endif /* NOT_NEEDED_FOR_NAVIT */
/**
* g_direct_hash:
* @v: a #gpointer key
return *(const gint*) v;
}
+#if NOT_NEEDED_FOR_NAVIT
/**
* g_nullify_pointer:
* @nullify_location: the memory address of the pointer.
}
#endif
+#endif /* NOT_NEEDED_FOR_NAVIT */
#define __G_UTILS_C__
#include "galiasdef.c"