Commit 2fd6b001 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Move glib library into a subdirectory, make all GLib include files include

Tue Jun 26 11:43:46 2001  Owen Taylor  <otaylor@redhat.com>

	* configure.in Makefile.am *.[ch] glib/*.[ch] glib/Makefile.am:
	Move glib library into a subdirectory, make all GLib include
	files include as <glib/glist.h>

	* tests/testglib.c tests/testgdate.c tests/testgdateparser.c
	  tests/timeloop.c tests/timeloop-basic.c: Move all tests into
	the tests/ subdirectory.
parent 2c9c0fab
*.lo
*.obj
*.lib
*.dll
*.exe
.deps
.libs
Makefile
Makefile.in
_libs
......@@ -20,7 +13,6 @@ glib.spec
glibconfig-sysdefs.h
glibconfig.h
glibconfig.h.win32
libglib-1.3.la
libtool
makefile.cygwin
makefile.mingw
......@@ -29,11 +21,6 @@ so_locations
stamp-gc-h
stamp-h
stamp-h.in
testgdate
testgdateparser
testglib
timeloop
timeloop-basic
annotations
logs
glib.rc
......
Tue Jun 26 11:43:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in Makefile.am *.[ch] glib/*.[ch] glib/Makefile.am:
Move glib library into a subdirectory, make all GLib include
files include as <glib/glist.h>
* tests/testglib.c tests/testgdate.c tests/testgdateparser.c
tests/timeloop.c tests/timeloop-basic.c: Move all tests into
the tests/ subdirectory.
Sat Jun 23 17:34:38 2001 Tim Janik <timj@gtk.org>
* gmessages.c (g_logv): use G_BREAKPOINT() instead of raise(5).
......
Tue Jun 26 11:43:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in Makefile.am *.[ch] glib/*.[ch] glib/Makefile.am:
Move glib library into a subdirectory, make all GLib include
files include as <glib/glist.h>
* tests/testglib.c tests/testgdate.c tests/testgdateparser.c
tests/timeloop.c tests/timeloop-basic.c: Move all tests into
the tests/ subdirectory.
Sat Jun 23 17:34:38 2001 Tim Janik <timj@gtk.org>
* gmessages.c (g_logv): use G_BREAKPOINT() instead of raise(5).
......
Tue Jun 26 11:43:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in Makefile.am *.[ch] glib/*.[ch] glib/Makefile.am:
Move glib library into a subdirectory, make all GLib include
files include as <glib/glist.h>
* tests/testglib.c tests/testgdate.c tests/testgdateparser.c
tests/timeloop.c tests/timeloop-basic.c: Move all tests into
the tests/ subdirectory.
Sat Jun 23 17:34:38 2001 Tim Janik <timj@gtk.org>
* gmessages.c (g_logv): use G_BREAKPOINT() instead of raise(5).
......
Tue Jun 26 11:43:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in Makefile.am *.[ch] glib/*.[ch] glib/Makefile.am:
Move glib library into a subdirectory, make all GLib include
files include as <glib/glist.h>
* tests/testglib.c tests/testgdate.c tests/testgdateparser.c
tests/timeloop.c tests/timeloop-basic.c: Move all tests into
the tests/ subdirectory.
Sat Jun 23 17:34:38 2001 Tim Janik <timj@gtk.org>
* gmessages.c (g_logv): use G_BREAKPOINT() instead of raise(5).
......
Tue Jun 26 11:43:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in Makefile.am *.[ch] glib/*.[ch] glib/Makefile.am:
Move glib library into a subdirectory, make all GLib include
files include as <glib/glist.h>
* tests/testglib.c tests/testgdate.c tests/testgdateparser.c
tests/timeloop.c tests/timeloop-basic.c: Move all tests into
the tests/ subdirectory.
Sat Jun 23 17:34:38 2001 Tim Janik <timj@gtk.org>
* gmessages.c (g_logv): use G_BREAKPOINT() instead of raise(5).
......
Tue Jun 26 11:43:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in Makefile.am *.[ch] glib/*.[ch] glib/Makefile.am:
Move glib library into a subdirectory, make all GLib include
files include as <glib/glist.h>
* tests/testglib.c tests/testgdate.c tests/testgdateparser.c
tests/timeloop.c tests/timeloop-basic.c: Move all tests into
the tests/ subdirectory.
Sat Jun 23 17:34:38 2001 Tim Janik <timj@gtk.org>
* gmessages.c (g_logv): use G_BREAKPOINT() instead of raise(5).
......
Tue Jun 26 11:43:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in Makefile.am *.[ch] glib/*.[ch] glib/Makefile.am:
Move glib library into a subdirectory, make all GLib include
files include as <glib/glist.h>
* tests/testglib.c tests/testgdate.c tests/testgdateparser.c
tests/timeloop.c tests/timeloop-basic.c: Move all tests into
the tests/ subdirectory.
Sat Jun 23 17:34:38 2001 Tim Janik <timj@gtk.org>
* gmessages.c (g_logv): use G_BREAKPOINT() instead of raise(5).
......
Tue Jun 26 11:43:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in Makefile.am *.[ch] glib/*.[ch] glib/Makefile.am:
Move glib library into a subdirectory, make all GLib include
files include as <glib/glist.h>
* tests/testglib.c tests/testgdate.c tests/testgdateparser.c
tests/timeloop.c tests/timeloop-basic.c: Move all tests into
the tests/ subdirectory.
Sat Jun 23 17:34:38 2001 Tim Janik <timj@gtk.org>
* gmessages.c (g_logv): use G_BREAKPOINT() instead of raise(5).
......
......@@ -2,7 +2,7 @@
AUTOMAKE_OPTIONS = 1.4
SUBDIRS = . m4macros gobject gmodule gthread docs tests build
SUBDIRS = . m4macros glib gobject gmodule gthread docs tests build
INCLUDES = -DG_LOG_DOMAIN=g_log_domain_glib @GLIB_DEBUG_FLAGS@ \
-DG_DISABLE_DEPRECATED -DGLIB_COMPILATION
......@@ -41,107 +41,6 @@ BUILT_EXTRA_DIST = \
glib.rc \
glib.spec
lib_LTLIBRARIES = libglib-1.3.la
libglib_1_3_la_SOURCES = \
garray.c \
gasyncqueue.c \
gbacktrace.c \
gcache.c \
gcompletion.c \
gconvert.c \
gdataset.c \
gdate.c \
gerror.c \
gfileutils.c \
ghash.c \
ghook.c \
giochannel.c \
glibintl.h \
glist.c \
gmain.c \
gmarkup.c \
gmem.c \
gmessages.c \
gnode.c \
gpattern.c \
gprimes.c \
gqsort.c \
gqueue.c \
grel.c \
grand.c \
gscanner.c \
gshell.c \
gslist.c \
gstrfuncs.c \
gstring.c \
gthread.c \
gthreadpool.c \
gtimer.c \
gtree.c \
guniprop.c \
gutf8.c \
gunibreak.h \
gunibreak.c \
gunichartables.h \
gunidecomp.h \
gunidecomp.c \
gutils.c
EXTRA_libglib_1_3_la_SOURCES = \
giounix.c \
giowin32.c \
gspawn.c \
gspawn-win32.c \
gwin32.c
glibincludedir=$(includedir)/glib-2.0
glibinclude_HEADERS = \
galloca.h \
garray.h \
gasyncqueue.h \
gbacktrace.h \
gcache.h \
gcompletion.h \
gconvert.h \
gdataset.h \
gdate.h \
gerror.h \
gfileutils.h \
ghash.h \
ghook.h \
giochannel.h \
glib.h \
glib-object.h \
glist.h \
gmacros.h \
gmain.h \
gmarkup.h \
gmem.h \
gmessages.h \
gnode.h \
gpattern.h \
gprimes.h \
gqsort.h \
gquark.h \
gqueue.h \
grand.h \
grel.h \
gscanner.h \
gshell.h \
gslist.h \
gspawn.h \
gstrfuncs.h \
gstring.h \
gthread.h \
gthreadpool.h \
gtimer.h \
gtree.h \
gtypes.h \
gunicode.h \
gutils.h \
gwin32.h
configexecincludedir = $(libdir)/glib-2.0/include
#configexecinclude_DATA = glibconfig.h
......@@ -161,36 +60,6 @@ stamp-gc-h: config.status
CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=glibconfig.h ./config.status
echo timestamp > stamp-gc-h
libglib_1_3_la_LIBADD = @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@
libglib_1_3_la_DEPENDENCIES = @GIO@ @GSPAWN@ @PLATFORMDEP@
if PLATFORM_WIN32
no_undefined = -no-undefined
endif
if OS_WIN32
# This requires a very new libtool
export_symbols = -export-symbols glib.def
endif
libglib_1_3_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-export-dynamic $(no_undefined) $(export_symbols)
if OS_WIN32
bin_PROGRAMS = gspawn-win32-helper
gspawn_win32_helper_LDADD = libglib-1.3.la
endif
if ENABLE_TIMELOOP
timeloop = timeloop
endif
noinst_PROGRAMS = testglib testgdate testgdateparser $(timeloop)
testglib_LDADD = libglib-1.3.la
testgdate_LDADD = libglib-1.3.la
testgdateparser_LDADD = libglib-1.3.la
if ENABLE_TIMELOOP
timeloop_LDADD = libglib-1.3.la
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = glib-2.0.pc gobject-2.0.pc gmodule-2.0.pc gthread-2.0.pc
......
......@@ -8,7 +8,7 @@ ORIGDIR=`pwd`
cd $srcdir
PROJECT=GLib
TEST_TYPE=-f
FILE=glib.h
FILE=glib/glib.h
DIE=0
......
......@@ -7,7 +7,7 @@ builtin(include, acglib.m4)dnl
AC_PREREQ(2.13)
# Process this file with autoconf to produce a configure script.
AC_INIT(glist.c)
AC_INIT(glib/glib.h)
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS+set}
......@@ -1535,7 +1535,7 @@ case "$CONFIG_OTHER" in
#ifndef __G_LIBCONFIG_H__
#define __G_LIBCONFIG_H__
#include <gmacros.h>
#include <glib/gmacros.h>
_______EOF
......@@ -2039,6 +2039,7 @@ glib.spec
Makefile
build/Makefile
build/win32/Makefile
glib/Makefile
gmodule/gmoduleconf.h
gmodule/Makefile
gobject/Makefile
......
......@@ -3,6 +3,7 @@ Makefile.in
glib-decl-list.txt
glib-decl.txt
glib-unused.txt
glib-undocumented.txt
html
sgml
*.stamp
......
......@@ -7,7 +7,7 @@ DOC_MODULE=glib
DOC_MAIN_SGML_FILE=glib-docs.sgml
# The directory containing the source code. Relative to $(srcdir)
DOC_SOURCE_DIR=../../..
DOC_SOURCE_DIR=../../../glib
# Extra options to supply to gtkdoc-scan
SCAN_OPTIONS=--deprecated-guards="G_DISABLE_DEPRECATED"
......@@ -19,8 +19,8 @@ MKDB_OPTIONS=
FIXXREF_OPTIONS=
# Used for dependencies
HFILE_GLOB=$(top_srcdir)/*.h $(top_srcdir)/gmodule/*.h
CFILE_GLOB=$(top_srcdir)/*.c $(top_srcdir)/gmodule/*.c
HFILE_GLOB=$(top_srcdir)/glib/*.h $(top_srcdir)/gmodule/*.h
CFILE_GLOB=$(top_srcdir)/glib/*.c $(top_srcdir)/gmodule/*.c
# Headers to ignore
IGNORE_HFILES= \
......
......@@ -3,6 +3,7 @@ Makefile.in
gobject-decl.txt
gobject-unused.txt
gobject-decl-list.txt
gobject-undocumented.txt
html
sgml
*.stamp
......
/* 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_ALLOCA_H__
#define __G_ALLOCA_H__
#include <gtypes.h>
#ifdef __GNUC__
/* GCC does the right thing */
# undef alloca
# define alloca(size) __builtin_alloca (size)
#elif defined (GLIB_HAVE_ALLOCA_H)
/* a native and working alloca.h is there */
# include <alloca.h>
#else /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */
# ifdef _MSC_VER
# include <malloc.h>
# define alloca _alloca
# else /* !_MSC_VER */
# ifdef _AIX
#pragma alloca
# else /* !_AIX */
# ifndef alloca /* predefined by HP cc +Olibcalls */
G_BEGIN_DECLS
char *alloca ();
G_END_DECLS
# endif /* !alloca */
# endif /* !_AIX */
# endif /* !_MSC_VER */
#endif /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */
#define g_alloca(size) alloca (size)
#endif /* __G_ALLOCA_H__ */
/* 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/.
*/
/*
* MT safe
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <stdlib.h>
#include "glib.h"
#define MIN_ARRAY_SIZE 16
typedef struct _GRealArray GRealArray;
struct _GRealArray
{
guint8 *data;
guint len;
guint alloc;
guint elt_size;
guint zero_terminated : 1;
guint clear : 1;
};
#define g_array_elt_len(array,i) ((array)->elt_size * (i))
#define g_array_elt_pos(array,i) ((array)->data + g_array_elt_len((array),(i)))
#define g_array_elt_zero(array, pos, len) \
(memset (g_array_elt_pos ((array), pos), 0, g_array_elt_len ((array), len)))
#define g_array_zero_terminate(array) G_STMT_START{ \
if ((array)->zero_terminated) \
g_array_elt_zero ((array), (array)->len, 1); \
}G_STMT_END
static gint g_nearest_pow (gint num) G_GNUC_CONST;
static void g_array_maybe_expand (GRealArray *array,
gint len);
static GMemChunk *array_mem_chunk = NULL;
G_LOCK_DEFINE_STATIC (array_mem_chunk);
GArray*
g_array_new (gboolean zero_terminated,
gboolean clear,
guint elt_size)
{
return (GArray*) g_array_sized_new (zero_terminated, clear, elt_size, 0);
}
GArray* g_array_sized_new (gboolean zero_terminated,
gboolean clear,
guint elt_size,
guint reserved_size)
{
GRealArray *array;
G_LOCK (array_mem_chunk);
if (!array_mem_chunk)
array_mem_chunk = g_mem_chunk_new ("array mem chunk",
sizeof (GRealArray),
1024, G_ALLOC_AND_FREE);
array = g_chunk_new (GRealArray, array_mem_chunk);
G_UNLOCK (array_mem_chunk);
array->data = NULL;
array->len = 0;
array->alloc = 0;
array->zero_terminated = (zero_terminated ? 1 : 0);
array->clear = (clear ? 1 : 0);
array->elt_size = elt_size;
if (array->zero_terminated || reserved_size != 0)
{
g_array_maybe_expand (array, reserved_size);
g_array_zero_terminate(array);
}
return (GArray*) array;
}
gchar*
g_array_free (GArray *array,
gboolean free_segment)
{
gchar* segment;
g_return_val_if_fail (array, NULL);
if (free_segment)
{
g_free (array->data);
segment = NULL;
}
else
segment = array->data;
G_LOCK (array_mem_chunk);
g_mem_chunk_free (array_mem_chunk, array);
G_UNLOCK (array_mem_chunk);
return segment;
}
GArray*
g_array_append_vals (GArray *farray,
gconstpointer data,
guint len)
{
GRealArray *array = (GRealArray*) farray;
g_array_maybe_expand (array, len);
memcpy (g_array_elt_pos (array, array->len), data,
g_array_elt_len (array, len));
array->len += len;
g_array_zero_terminate (array);
return farray;
}
GArray*
g_array_prepend_vals (GArray *farray,
gconstpointer data,
guint len)
{
GRealArray *array = (GRealArray*) farray;
g_array_maybe_expand (array, len);
g_memmove (g_array_elt_pos (array, len), g_array_elt_pos (array, 0),
g_array_elt_len (array, array->len));
memcpy (g_array_elt_pos (array, 0), data, g_array_elt_len (array, len));
array->len += len;
g_array_zero_terminate (array);
return farray;
}
GArray*
g_array_insert_vals (GArray *farray,
guint index,
gconstpointer data,
guint len)
{
GRealArray *array = (GRealArray*) farray;
g_array_maybe_expand (array, len);
g_memmove (g_array_elt_pos (array, len + index),
g_array_elt_pos (array, index),
g_array_elt_len (array, array->len - index));
memcpy (g_array_elt_pos (array, index), data, g_array_elt_len (array, len));
array->len += len;
g_array_zero_terminate (array);
return farray;
}
GArray*
g_array_set_size (GArray *farray,
guint length)
{
GRealArray *array = (GRealArray*) farray;
if (length > array->len)
{
g_array_maybe_expand (array, length - array->len);
if (array->clear)
g_array_elt_zero (array, array->len, length - array->len);
}
#ifdef ENABLE_GC_FRIENDLY
else if (length < array->len)
g_array_elt_zero (array, length, array->len - length);
#endif /* ENABLE_GC_FRIENDLY */
array->len = length;
g_array_zero_terminate (array);
return farray;
}
GArray*
g_array_remove_index (GArray* farray,
guint index)
{
GRealArray* array = (GRealArray*) farray;
g_return_val_if_fail (array, NULL);
g_return_val_if_fail (index < array->len, NULL);
if (index != array->len - 1)
g_memmove (g_array_elt_pos (array, index),
g_array_elt_pos (array, index + 1),
g_array_elt_len (array, array->len - index - 1));
array->len -= 1;
#ifdef ENABLE_GC_FRIENDLY
g_array_elt_zero (array, array->len, 1);
#else /* !ENABLE_GC_FRIENDLY */
g_array_zero_terminate (array);
#endif /* ENABLE_GC_FRIENDLY */
return farray;
}
GArray*
g_array_remove_index_fast (GArray* farray,
guint index)
{
GRealArray* array = (GRealArray*) farray;
g_return_val_if_fail (array, NULL);
g_return_val_if_fail (index < array->len, NULL);
if (index != array->len - 1)
memcpy (g_array_elt_pos (array, index),
g_array_elt_pos (array, array->len - 1),
g_array_elt_len (array, 1));
array->len -= 1;
#ifdef ENABLE_GC_FRIENDLY
g_array_elt_zero (array, array->len, 1);
#else /* !ENABLE_GC_FRIENDLY */
g_array_zero_terminate (array);
#endif /* ENABLE_GC_FRIENDLY */
return farray;
}
void
g_array_sort (GArray *farray,
GCompareFunc compare_func)
{
GRealArray *array = (GRealArray*) farray;
g_return_if_fail (array != NULL);
g_return_if_fail (array->data != NULL);
qsort (array->data,