Changed glib.h so it's created by merging glib_pre1.h, glibconfig.h, and

glib_pre2.h.  This eliminates the need to install glibconfig.h in $(includedir)
and fixes some builddir != srcdir when compiling multiple archatecture types
from the same source code. -Jay
This commit is contained in:
Jay Painter 1997-12-06 21:45:45 +00:00
parent 4d6f11a6ce
commit 0219b8b6b4
8 changed files with 898 additions and 825 deletions

View File

@ -17,12 +17,23 @@ libglib_la_SOURCES = \
gstring.c
include_HEADERS = \
glib.h \
glibconfig.h
glib.h
libglib_la_LDFLAGS = -version-info 1:0:0
INCLUDES =
INCLUDES = -I$(top_srcdir)
BUILT_SOURCES = glib.h
glib.h: glibconfig.h glib_pre1.h glib_pre2.h
$(srcdir)/makeglib_h $(srcdir)/glib_pre1.h \
$(top_builddir)/glibconfig.h \
$(srcdir)/glib_pre2.h > $@
EXTRA_DIST = \
glib_pre1.h \
glib_pre2.h \
makeglib_h
noinst_PROGRAMS = testglib
testglib_LDADD = $(top_builddir)/libglib.la
@ -36,3 +47,5 @@ files:
release:
$(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"`
$(DEP_FILES) : $(BUILT_SOURCES)

View File

@ -85,12 +85,18 @@ libglib_la_SOURCES = \
gstring.c
include_HEADERS = \
glib.h \
glibconfig.h
glib.h
libglib_la_LDFLAGS = -version-info 1:0:0
INCLUDES =
INCLUDES = -I$(top_srcdir)
BUILT_SOURCES = glib.h
EXTRA_DIST = \
glib_pre1.h \
glib_pre2.h \
makeglib_h
noinst_PROGRAMS = testglib
testglib_LDADD = $(top_builddir)/libglib.la
@ -444,6 +450,11 @@ clean-generic maintainer-clean-generic clean mostlyclean distclean \
maintainer-clean
glib.h: glibconfig.h glib_pre1.h glib_pre2.h
$(srcdir)/makeglib_h $(srcdir)/glib_pre1.h \
$(top_builddir)/glibconfig.h \
$(srcdir)/glib_pre2.h > $@
.PHONY: files release
files:
@ -454,6 +465,8 @@ files:
release:
$(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"`
$(DEP_FILES) : $(BUILT_SOURCES)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

271
glib/configure vendored
View File

@ -1594,19 +1594,16 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
if eval "test x$GCC = xyes"; then
test `echo "$CFLAGS" | grep "\-Wall" > /dev/null 2> /dev/null`
if test ! $?; then
if test ! `echo "$CFLAGS" | grep "\-Wall" 2> /dev/null` ; then
CFLAGS="$CFLAGS -Wall"
fi
if eval "test x$enable_ansi = xyes"; then
test `echo "$CFLAGS" | grep "\-ansi" > /dev/null 2> /dev/null`
if test ! $?; then
if test ! `echo "$CFLAGS" | grep "\-ansi" 2> /dev/null` ; then
CFLAGS="$CFLAGS -ansi"
fi
test `echo "$CFLAGS" | grep "\-pedantic" > /dev/null 2> /dev/null`
if test ! $?; then
if test ! `echo "$CFLAGS" | grep "\-pedantic" 2> /dev/null` ; then
CFLAGS="$CFLAGS -pedantic"
fi
fi
@ -1614,7 +1611,7 @@ fi
# Checks for header files.
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1618: checking how to run the C preprocessor" >&5
echo "configure:1615: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@ -1629,13 +1626,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 1633 "configure"
#line 1630 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@ -1646,13 +1643,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 1650 "configure"
#line 1647 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@ -1675,12 +1672,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:1679: checking for ANSI C header files" >&5
echo "configure:1676: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1684 "configure"
#line 1681 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@ -1688,7 +1685,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -1705,7 +1702,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 1709 "configure"
#line 1706 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@ -1723,7 +1720,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 1727 "configure"
#line 1724 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@ -1744,7 +1741,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 1748 "configure"
#line 1745 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@ -1755,7 +1752,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
if { (eval echo configure:1759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
@ -1781,12 +1778,12 @@ fi
# Checks for library functions.
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
echo "configure:1785: checking for vprintf" >&5
echo "configure:1782: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1790 "configure"
#line 1787 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
@ -1809,7 +1806,7 @@ vprintf();
; return 0; }
EOF
if { (eval echo configure:1813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
@ -1833,12 +1830,12 @@ fi
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
echo "configure:1837: checking for _doprnt" >&5
echo "configure:1834: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1842 "configure"
#line 1839 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
@ -1861,7 +1858,7 @@ _doprnt();
; return 0; }
EOF
if { (eval echo configure:1865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
@ -1887,7 +1884,7 @@ fi
echo $ac_n "checking size of char""... $ac_c" 1>&6
echo "configure:1891: checking size of char" >&5
echo "configure:1888: checking size of char" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1895,7 +1892,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 1899 "configure"
#line 1896 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@ -1906,7 +1903,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:1910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_char=`cat conftestval`
else
@ -1926,7 +1923,7 @@ EOF
echo $ac_n "checking size of short""... $ac_c" 1>&6
echo "configure:1930: checking size of short" >&5
echo "configure:1927: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1934,7 +1931,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 1938 "configure"
#line 1935 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@ -1945,7 +1942,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:1949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_short=`cat conftestval`
else
@ -1965,7 +1962,7 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
echo "configure:1969: checking size of long" >&5
echo "configure:1966: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1973,7 +1970,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 1977 "configure"
#line 1974 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@ -1984,7 +1981,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:1988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
@ -2004,7 +2001,7 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:2008: checking size of int" >&5
echo "configure:2005: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2012,7 +2009,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 2016 "configure"
#line 2013 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@ -2023,7 +2020,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:2027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:2024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@ -2043,7 +2040,7 @@ EOF
echo $ac_n "checking size of void *""... $ac_c" 1>&6
echo "configure:2047: checking size of void *" >&5
echo "configure:2044: checking size of void *" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2051,7 +2048,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 2055 "configure"
#line 2052 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@ -2062,7 +2059,7 @@ main()
exit(0);
}
EOF
if { (eval echo configure:2066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:2063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_void_p=`cat conftestval`
else
@ -2082,56 +2079,15 @@ EOF
echo $ac_n "checking for long double""... $ac_c" 1>&6
echo "configure:2087: checking for long double" >&5
if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$GCC" = yes; then
ac_cv_c_long_double=yes
else
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 2098 "configure"
#include "confdefs.h"
int main() {
/* The Stardent Vistra knows sizeof(long double), but does not support it. */
long double foo = 0.0;
/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
exit(sizeof(long double) < sizeof(double)); }
EOF
if { (eval echo configure:2106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_long_double=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_c_long_double=no
fi
rm -fr conftest*
fi
fi
fi
echo "$ac_t""$ac_cv_c_long_double" 1>&6
if test $ac_cv_c_long_double = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_LONG_DOUBLE 1
EOF
fi
# long doubles were not used, and a portability problem
# AC_C_LONG_DOUBLE
echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:2130: checking for working const" >&5
echo "configure:2086: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2135 "configure"
#line 2091 "configure"
#include "confdefs.h"
int main() {
@ -2180,7 +2136,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
if { (eval echo configure:2184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@ -2201,21 +2157,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
echo "configure:2205: checking for inline" >&5
echo "configure:2161: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
#line 2212 "configure"
#line 2168 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
if { (eval echo configure:2219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@ -2245,17 +2201,17 @@ for ac_hdr in float.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2249: checking for $ac_hdr" >&5
echo "configure:2205: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2254 "configure"
#line 2210 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -2288,17 +2244,17 @@ for ac_hdr in limits.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2292: checking for $ac_hdr" >&5
echo "configure:2248: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2297 "configure"
#line 2253 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -2331,17 +2287,17 @@ for ac_hdr in values.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2335: checking for $ac_hdr" >&5
echo "configure:2291: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2340 "configure"
#line 2296 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -2371,16 +2327,16 @@ fi
done
# Check for strerror and strsignal functions
for ac_func in strerror strsignal
# Check for strerror, strsignal, and memmove functions
for ac_func in strerror strsignal memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2379: checking for $ac_func" >&5
echo "configure:2335: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2384 "configure"
#line 2340 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -2403,7 +2359,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:2407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -2430,9 +2386,9 @@ done
# Check for sys_errlist
echo $ac_n "checking sys_errlist""... $ac_c" 1>&6
echo "configure:2434: checking sys_errlist" >&5
echo "configure:2390: checking sys_errlist" >&5
cat > conftest.$ac_ext <<EOF
#line 2436 "configure"
#line 2392 "configure"
#include "confdefs.h"
int main() {
@ -2443,7 +2399,7 @@ sys_errlist[sys_nerr-1][0] = 0;
; return 0; }
EOF
if { (eval echo configure:2447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
glib_ok=yes
else
@ -2463,9 +2419,9 @@ fi
# Check for sys_siglist
echo $ac_n "checking sys_siglist""... $ac_c" 1>&6
echo "configure:2467: checking sys_siglist" >&5
echo "configure:2423: checking sys_siglist" >&5
cat > conftest.$ac_ext <<EOF
#line 2469 "configure"
#line 2425 "configure"
#include "confdefs.h"
int main() {
@ -2475,7 +2431,7 @@ sys_siglist[1][0] = 0;
; return 0; }
EOF
if { (eval echo configure:2479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
glib_ok=yes
else
@ -2496,16 +2452,16 @@ fi
# Check for sys/select.h
echo $ac_n "checking fd_set and sys/select""... $ac_c" 1>&6
echo "configure:2500: checking fd_set and sys/select" >&5
echo "configure:2456: checking fd_set and sys/select" >&5
cat > conftest.$ac_ext <<EOF
#line 2502 "configure"
#line 2458 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {
fd_set readMask, writeMask;
; return 0; }
EOF
if { (eval echo configure:2509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gtk_ok=yes
else
@ -2517,7 +2473,7 @@ fi
rm -f conftest*
if test $gtk_ok = no; then
cat > conftest.$ac_ext <<EOF
#line 2521 "configure"
#line 2477 "configure"
#include "confdefs.h"
#include <sys/select.h>
EOF
@ -2543,6 +2499,97 @@ EOF
fi
# This stuff is here, only so that we can define these
# things in glibconfig.h. If ../config.h was installed
# (under some other name?) then the definitions would
# belong there. (They are only used in GDK)
# Look for wide string functions in wchar.h or wcstr.h
echo $ac_n "checking for <wchar.h> or <wcstr.h>""... $ac_c" 1>&6
echo "configure:2511: checking for <wchar.h> or <wcstr.h>" >&5
cat > conftest.$ac_ext <<EOF
#line 2513 "configure"
#include "confdefs.h"
#include <wchar.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
gtk_ok=yes
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
gtk_ok=no
fi
rm -f conftest*
if test $gtk_ok = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_WCHAR_H 1
EOF
else
cat > conftest.$ac_ext <<EOF
#line 2538 "configure"
#include "confdefs.h"
#include <wcstr.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
gtk_ok=yes
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
gtk_ok=no
fi
rm -f conftest*
if test $gtk_ok = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_WCSTR_H 1
EOF
fi
fi
# Check for wctype.h (for iswalnum)
echo $ac_n "checking for <wctype.h>""... $ac_c" 1>&6
echo "configure:2566: checking for <wctype.h>" >&5
cat > conftest.$ac_ext <<EOF
#line 2568 "configure"
#include "confdefs.h"
#include <wctype.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2573: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
gtk_ok=yes
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
gtk_ok=no
fi
rm -f conftest*
if test $gtk_ok = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_WCTYPE_H 1
EOF
fi
echo "$ac_t""$gtk_ok" 1>&6
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure

View File

@ -1,691 +0,0 @@
/* 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 Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __G_LIB_H__
#define __G_LIB_H__
#include <glibconfig.h>
#ifdef USE_DMALLOC
#include "dmalloc.h"
#endif
/* glib provides definitions for the extrema of many
* of the standard types. These are:
* G_MINFLOAT
* G_MAXFLOAT
* G_MINDOUBLE
* G_MAXDOUBLE
* G_MINSHORT
* G_MAXSHORT
* G_MININT
* G_MAXINT
* G_MINLONG
* G_MAXLONG
*/
#ifdef HAVE_FLOAT_H
#include <float.h>
#define G_MINFLOAT FLT_MIN
#define G_MAXFLOAT FLT_MAX
#define G_MINDOUBLE DBL_MIN
#define G_MAXDOUBLE DBL_MAX
#elif HAVE_VALUES_H
#include <values.h>
#define G_MINFLOAT MINFLOAT
#define G_MAXFLOAT MAXFLOAT
#define G_MINDOUBLE MINDOUBLE
#define G_MAXDOUBLE MAXDOUBLE
#endif /* HAVE_VALUES_H */
#ifdef HAVE_LIMITS_H
#include <limits.h>
#define G_MINSHORT SHRT_MIN
#define G_MAXSHORT SHRT_MAX
#define G_MININT INT_MIN
#define G_MAXINT INT_MAX
#define G_MINLONG LONG_MIN
#define G_MAXLONG LONG_MAX
#elif HAVE_VALUES_H
#ifdef HAVE_FLOAT_H
#include <values.h>
#endif /* HAVE_FLOAT_H */
#define G_MINSHORT MINSHORT
#define G_MAXSHORT MAXSHORT
#define G_MININT MININT
#define G_MAXINT MAXINT
#define G_MINLONG MINLONG
#define G_MAXLONG MAXLONG
#endif /* HAVE_VALUES_H */
/* Provide definitions for some commonly used macros.
* These are only provided if they haven't already
* been defined. It is assumed that if they are already
* defined then the current definition is correct.
*/
#ifndef FALSE
#define FALSE 0
#endif /* FALSE */
#ifndef TRUE
#define TRUE 1
#endif /* TRUE */
#ifndef NULL
#define NULL ((void*) 0)
#endif /* NULL */
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif /* MAX */
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif /* MIN */
#ifndef ABS
#define ABS(a) (((a) < 0) ? -(a) : (a))
#endif /* ABS */
#ifndef CLAMP
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
#endif /* CLAMP */
#ifndef ATEXIT
#define ATEXIT(proc) (atexit (proc))
#endif /* ATEXIT */
/* Provide macros for easily allocating memory. The macros
* will cast the allocated memory to the specified type
* in order to avoid compiler warnings. (Makes the code neater).
*/
#ifdef __DMALLOC_H__
#define g_new(type,count) ALLOC(type,count)
#define g_new0(type,count) CALLOC(type,count)
#else /* __DMALLOC_H__ */
#define g_new(type, count) \
((type *) g_malloc ((unsigned) sizeof (type) * (count)))
#define g_new0(type, count) \
((type *) g_malloc0 ((unsigned) sizeof (type) * (count)))
#endif /* __DMALLOC_H__ */
#define g_chunk_new(type, chunk) \
((type *) g_mem_chunk_alloc (chunk))
/* Provide macros for error handling. The "assert" macros will
* exit on failur. The "return" macros will exit the current
* function. Two different definitions are given for the macros
* in order to support gcc's __PRETTY_FUNCTION__ capability.
*/
#define g_string(x) #x
#ifdef __GNUC__
#define g_assert(expr) \
if (!(expr)) \
g_error ("file %s: line %d (%s): \"%s\"", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr)
#define g_assert_not_reached() \
g_error ("file %s: line %d (%s): \"should not be reached\"", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__)
#define g_return_if_fail(expr) \
if (!(expr)) \
{ \
g_warning ("file %s: line %d (%s): \"%s\"", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
return; \
}
#define g_return_val_if_fail(expr,val) \
if (!(expr)) \
{ \
g_warning ("file %s: line %d (%s): \"%s\"", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
return val; \
}
#else /* __GNUC__ */
#define g_assert(expr) \
if (!(expr)) \
g_error ("file %s: line %d: \"%s\"", \
__FILE__, \
__LINE__, \
#expr)
#define g_assert_not_reached() \
g_error ("file %s: line %d: \"should not be reached\"", \
__FILE__, \
__LINE__)
#define g_return_if_fail(expr) \
if (!(expr)) \
{ \
g_warning ("file %s: line %d: \"%s\"", \
__FILE__, \
__LINE__, \
#expr); \
return; \
}
#define g_return_val_if_fail(expr, val) \
if (!(expr)) \
{ \
g_warning ("file %s: line %d: \"%s\"", \
__FILE__, \
__LINE__, \
#expr); \
return val; \
}
#endif /* __GNUC__ */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Provide type definitions for commonly used types.
* These are useful because a "gint8" can be adjusted
* to be 1 byte (8 bits) on all platforms. Similarly and
* more importantly, "gint32" can be adjusted to be
* 4 bytes (32 bits) on all platforms.
*/
typedef char gchar;
typedef short gshort;
typedef long glong;
typedef int gint;
typedef char gboolean;
typedef unsigned char guchar;
typedef unsigned short gushort;
typedef unsigned long gulong;
typedef unsigned int guint;
typedef float gfloat;
typedef double gdouble;
/* HAVE_LONG_DOUBLE doesn't work correctly on all platforms.
* Since gldouble isn't used anywhere, just disable it for now */
#if 0
#ifdef HAVE_LONG_DOUBLE
typedef long double gldouble;
#else /* HAVE_LONG_DOUBLE */
typedef double gldouble;
#endif /* HAVE_LONG_DOUBLE */
#endif /* 0 */
typedef void* gpointer;
#if (SIZEOF_CHAR == 1)
typedef signed char gint8;
typedef unsigned char guint8;
#endif /* SIZEOF_CHAR */
#if (SIZEOF_SHORT == 2)
typedef signed short gint16;
typedef unsigned short guint16;
#endif /* SIZEOF_SHORT */
#if (SIZEOF_INT == 4)
typedef signed int gint32;
typedef unsigned int guint32;
#elif (SIZEOF_LONG == 4)
typedef signed long gint32;
typedef unsigned long guint32;
#endif /* SIZEOF_INT */
typedef struct _GList GList;
typedef struct _GSList GSList;
typedef struct _GHashTable GHashTable;
typedef struct _GCache GCache;
typedef struct _GTree GTree;
typedef struct _GTimer GTimer;
typedef struct _GMemChunk GMemChunk;
typedef struct _GListAllocator GListAllocator;
typedef struct _GStringChunk GStringChunk;
typedef struct _GString GString;
typedef struct _GArray GArray;
typedef void (*GFunc) (gpointer data, gpointer user_data);
typedef void (*GHFunc) (gpointer key, gpointer value, gpointer user_data);
typedef guint (*GHashFunc) (gpointer key);
typedef gint (*GCompareFunc) (gpointer a, gpointer b);
typedef gpointer (*GCacheNewFunc) (gpointer key);
typedef gpointer (*GCacheDupFunc) (gpointer value);
typedef void (*GCacheDestroyFunc) (gpointer value);
typedef gint (*GTraverseFunc) (gpointer key,
gpointer value,
gpointer data);
typedef gint (*GSearchFunc) (gpointer key,
gpointer data);
typedef void (*GErrorFunc) (gchar *str);
typedef void (*GWarningFunc) (gchar *str);
typedef void (*GPrintFunc) (gchar *str);
struct _GList
{
gpointer data;
GList *next;
GList *prev;
};
struct _GSList
{
gpointer data;
GSList *next;
};
struct _GString
{
gchar *str;
gint len;
};
struct _GArray
{
gchar *data;
guint len;
};
struct _GHashTable { gint dummy; };
struct _GCache { gint dummy; };
struct _GTree { gint dummy; };
struct _GTimer { gint dummy; };
struct _GMemChunk { gint dummy; };
struct _GListAllocator { gint dummy; };
struct _GStringChunk { gint dummy; };
typedef enum
{
G_IN_ORDER,
G_PRE_ORDER,
G_POST_ORDER
} GTraverseType;
/* Doubly linked lists
*/
GList* g_list_alloc (void);
void g_list_free (GList *list);
void g_list_free_1 (GList *list);
GList* g_list_append (GList *list,
gpointer data);
GList* g_list_prepend (GList *list,
gpointer data);
GList* g_list_insert (GList *list,
gpointer data,
gint position);
GList* g_list_concat (GList *list1,
GList *list2);
GList* g_list_remove (GList *list,
gpointer data);
GList* g_list_remove_link (GList *list,
GList *link);
GList* g_list_reverse (GList *list);
GList* g_list_nth (GList *list,
gint n);
GList* g_list_find (GList *list,
gpointer data);
GList* g_list_last (GList *list);
GList* g_list_first (GList *list);
gint g_list_length (GList *list);
void g_list_foreach (GList *list,
GFunc func,
gpointer user_data);
/* Singly linked lists
*/
GSList* g_slist_alloc (void);
void g_slist_free (GSList *list);
void g_slist_free_1 (GSList *list);
GSList* g_slist_append (GSList *list,
gpointer data);
GSList* g_slist_prepend (GSList *list,
gpointer data);
GSList* g_slist_insert (GSList *list,
gpointer data,
gint position);
GSList* g_slist_concat (GSList *list1,
GSList *list2);
GSList* g_slist_remove (GSList *list,
gpointer data);
GSList* g_slist_remove_link (GSList *list,
GSList *link);
GSList* g_slist_reverse (GSList *list);
GSList* g_slist_nth (GSList *list,
gint n);
GSList* g_slist_find (GSList *list,
gpointer data);
GSList* g_slist_last (GSList *list);
gint g_slist_length (GSList *list);
void g_slist_foreach (GSList *list,
GFunc func,
gpointer user_data);
/* List Allocators
*/
GListAllocator* g_list_allocator_new (void);
void g_list_allocator_free (GListAllocator* allocator);
GListAllocator* g_slist_set_allocator (GListAllocator* allocator);
GListAllocator* g_list_set_allocator (GListAllocator* allocator);
/* Hash tables
*/
GHashTable* g_hash_table_new (GHashFunc hash_func,
GCompareFunc key_compare_func);
void g_hash_table_destroy (GHashTable *hash_table);
void g_hash_table_insert (GHashTable *hash_table,
gpointer key,
gpointer value);
void g_hash_table_remove (GHashTable *hash_table,
gpointer key);
gpointer g_hash_table_lookup (GHashTable *hash_table,
const gpointer key);
void g_hash_table_freeze (GHashTable *hash_table);
void g_hash_table_thaw (GHashTable *hash_table);
void g_hash_table_foreach (GHashTable *hash_table,
GHFunc func,
gpointer user_data);
/* Caches
*/
GCache* g_cache_new (GCacheNewFunc value_new_func,
GCacheDestroyFunc value_destroy_func,
GCacheDupFunc key_dup_func,
GCacheDestroyFunc key_destroy_func,
GHashFunc hash_key_func,
GHashFunc hash_value_func,
GCompareFunc key_compare_func);
void g_cache_destroy (GCache *cache);
gpointer g_cache_insert (GCache *cache,
gpointer key);
void g_cache_remove (GCache *cache,
gpointer value);
void g_cache_key_foreach (GCache *cache,
GHFunc func,
gpointer user_data);
void g_cache_value_foreach (GCache *cache,
GHFunc func,
gpointer user_data);
/* Trees
*/
GTree* g_tree_new (GCompareFunc key_compare_func);
void g_tree_destroy (GTree *tree);
void g_tree_insert (GTree *tree,
gpointer key,
gpointer value);
void g_tree_remove (GTree *tree,
gpointer key);
gpointer g_tree_lookup (GTree *tree,
gpointer key);
void g_tree_traverse (GTree *tree,
GTraverseFunc traverse_func,
GTraverseType traverse_type,
gpointer data);
gpointer g_tree_search (GTree *tree,
GSearchFunc search_func,
gpointer data);
gint g_tree_height (GTree *tree);
gint g_tree_nnodes (GTree *tree);
/* Memory
*/
#ifdef USE_DMALLOC
#define g_malloc(size) (gpointer) MALLOC(size)
#define g_malloc0(size) (gpointer) CALLOC(char,size)
#define g_realloc(mem,size) (gpointer) REALLOC(mem,char,size)
#define g_free(mem) FREE(mem)
#else /* USE_DMALLOC */
gpointer g_malloc (gulong size);
gpointer g_malloc0 (gulong size);
gpointer g_realloc (gpointer mem,
gulong size);
void g_free (gpointer mem);
#endif /* USE_DMALLOC */
void g_mem_profile (void);
void g_mem_check (gpointer mem);
/* "g_mem_chunk_new" creates a new memory chunk.
* Memory chunks are used to allocate pieces of memory which are
* always the same size. Lists are a good example of such a data type.
* The memory chunk allocates and frees blocks of memory as needed.
* Just be sure to call "g_mem_chunk_free" and not "g_free" on data
* allocated in a mem chunk. ("g_free" will most likely cause a seg
* fault...somewhere).
*
* Oh yeah, GMemChunk is an opaque data type. (You don't really
* want to know what's going on inside do you?)
*/
/* ALLOC_ONLY MemChunk's can only allocate memory. The free operation
* is interpreted as a no op. ALLOC_ONLY MemChunk's save 4 bytes per
* atom. (They are also useful for lists which use MemChunk to allocate
* memory but are also part of the MemChunk implementation).
* ALLOC_AND_FREE MemChunk's can allocate and free memory.
*/
#define G_ALLOC_ONLY 1
#define G_ALLOC_AND_FREE 2
GMemChunk* g_mem_chunk_new (gchar *name,
gint atom_size,
gulong area_size,
gint type);
void g_mem_chunk_destroy (GMemChunk *mem_chunk);
gpointer g_mem_chunk_alloc (GMemChunk *mem_chunk);
void g_mem_chunk_free (GMemChunk *mem_chunk,
gpointer mem);
void g_mem_chunk_clean (GMemChunk *mem_chunk);
void g_mem_chunk_reset (GMemChunk *mem_chunk);
void g_mem_chunk_print (GMemChunk *mem_chunk);
void g_mem_chunk_info (void);
/* Ah yes...we have a "g_blow_chunks" function.
* "g_blow_chunks" simply compresses all the chunks. This operation
* consists of freeing every memory area that should be freed (but
* which we haven't gotten around to doing yet). And, no,
* "g_blow_chunks" doesn't follow the naming scheme, but it is a
* much better name than "g_mem_chunk_clean_all" or something
* similar.
*/
void g_blow_chunks (void);
/* Timer
*/
GTimer* g_timer_new (void);
void g_timer_destroy (GTimer *timer);
void g_timer_start (GTimer *timer);
void g_timer_stop (GTimer *timer);
void g_timer_reset (GTimer *timer);
gdouble g_timer_elapsed (GTimer *timer,
gulong *microseconds);
/* Output
*/
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
void g_error (gchar *format, ...) __attribute__ ((format (printf, 1, 2)));
void g_warning (gchar *format, ...) __attribute__ ((format (printf, 1, 2)));
void g_message (gchar *format, ...) __attribute__ ((format (printf, 1, 2)));
void g_print (gchar *format, ...) __attribute__ ((format (printf, 1, 2)));
#else
void g_error (gchar *format, ...);
void g_warning (gchar *format, ...);
void g_message (gchar *format, ...);
void g_print (gchar *format, ...);
#endif
/* Utility functions
*/
gchar* g_strdup (const gchar *str);
gchar* g_strerror (gint errnum);
gchar* g_strsignal (gint signum);
/* We make the assumption that if memmove isn't available, then
* bcopy will do the job. This isn't safe everywhere. (bcopy can't
* necessarily handle overlapping copies) */
#ifdef HAVE_MEMMOVE
#define g_memmove memmove
#else
#define g_memmove(a,b,c) bcopy(b,a,c)
#endif
/* Errors
*/
GErrorFunc g_set_error_handler (GErrorFunc func);
GWarningFunc g_set_warning_handler (GWarningFunc func);
GPrintFunc g_set_message_handler (GPrintFunc func);
GPrintFunc g_set_print_handler (GPrintFunc func);
void g_debug (char *progname);
void g_attach_process (char *progname, int query);
void g_stack_trace (char *progname, int query);
/* String Chunks
*/
GStringChunk* g_string_chunk_new (gint size);
void g_string_chunk_free (GStringChunk *chunk);
gchar* g_string_chunk_insert (GStringChunk *chunk,
gchar* string);
gchar* g_string_chunk_insert_const (GStringChunk *chunk,
gchar* string);
/* Strings
*/
GString* g_string_new (gchar *init);
void g_string_free (GString *string,
gint free_segment);
GString* g_string_assign (GString *lval,
gchar *rval);
GString* g_string_truncate (GString *string,
gint len);
GString* g_string_append (GString *string,
gchar *val);
GString* g_string_append_c (GString *string,
gchar c);
GString* g_string_prepend (GString *string,
gchar *val);
GString* g_string_prepend_c (GString *string,
gchar c);
void g_string_sprintf (GString *string,
gchar *fmt,
...);
void g_string_sprintfa (GString *string,
gchar *fmt,
...);
/* Resizable arrays
*/
#define g_array_append_val(array,type,val) \
g_rarray_append (array, (gpointer) &val, sizeof (type))
#define g_array_append_vals(array,type,vals,nvals) \
g_rarray_append (array, (gpointer) vals, sizeof (type) * nvals)
#define g_array_prepend_val(array,type,val) \
g_rarray_prepend (array, (gpointer) &val, sizeof (type))
#define g_array_prepend_vals(array,type,vals,nvals) \
g_rarray_prepend (array, (gpointer) vals, sizeof (type) * nvals)
#define g_array_truncate(array,type,length) \
g_rarray_truncate (array, length, sizeof (type))
#define g_array_index(array,type,index) \
((type*) array->data)[index]
GArray* g_array_new (gint zero_terminated);
void g_array_free (GArray *array,
gint free_segment);
GArray* g_rarray_append (GArray *array,
gpointer data,
gint size);
GArray* g_rarray_prepend (GArray *array,
gpointer data,
gint size);
GArray* g_rarray_truncate (GArray *array,
gint length,
gint size);
/* Hash Functions
*/
gint g_string_equal (gpointer v,
gpointer v2);
guint g_string_hash (gpointer v);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __G_LIB_H__ */

23
glib/glib_pre1.h Normal file
View File

@ -0,0 +1,23 @@
/* 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 Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __G_LIB_H__
#define __G_LIB_H__
/*
* THIS PORTION PATCHED IN FROM AUTOHEADER
*/

672
glib/glib_pre2.h Normal file
View File

@ -0,0 +1,672 @@
/*
* END AUTOHEADER PATCH-IN
*/
#ifdef USE_DMALLOC
#include "dmalloc.h"
#endif
/* glib provides definitions for the extrema of many
* of the standard types. These are:
* G_MINFLOAT
* G_MAXFLOAT
* G_MINDOUBLE
* G_MAXDOUBLE
* G_MINSHORT
* G_MAXSHORT
* G_MININT
* G_MAXINT
* G_MINLONG
* G_MAXLONG
*/
#ifdef HAVE_FLOAT_H
#include <float.h>
#define G_MINFLOAT FLT_MIN
#define G_MAXFLOAT FLT_MAX
#define G_MINDOUBLE DBL_MIN
#define G_MAXDOUBLE DBL_MAX
#elif HAVE_VALUES_H
#include <values.h>
#define G_MINFLOAT MINFLOAT
#define G_MAXFLOAT MAXFLOAT
#define G_MINDOUBLE MINDOUBLE
#define G_MAXDOUBLE MAXDOUBLE
#endif /* HAVE_VALUES_H */
#ifdef HAVE_LIMITS_H
#include <limits.h>
#define G_MINSHORT SHRT_MIN
#define G_MAXSHORT SHRT_MAX
#define G_MININT INT_MIN
#define G_MAXINT INT_MAX
#define G_MINLONG LONG_MIN
#define G_MAXLONG LONG_MAX
#elif HAVE_VALUES_H
#ifdef HAVE_FLOAT_H
#include <values.h>
#endif /* HAVE_FLOAT_H */
#define G_MINSHORT MINSHORT
#define G_MAXSHORT MAXSHORT
#define G_MININT MININT
#define G_MAXINT MAXINT
#define G_MINLONG MINLONG
#define G_MAXLONG MAXLONG
#endif /* HAVE_VALUES_H */
/* Provide definitions for some commonly used macros.
* These are only provided if they haven't already
* been defined. It is assumed that if they are already
* defined then the current definition is correct.
*/
#ifndef FALSE
#define FALSE 0
#endif /* FALSE */
#ifndef TRUE
#define TRUE 1
#endif /* TRUE */
#ifndef NULL
#define NULL ((void*) 0)
#endif /* NULL */
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif /* MAX */
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif /* MIN */
#ifndef ABS
#define ABS(a) (((a) < 0) ? -(a) : (a))
#endif /* ABS */
#ifndef CLAMP
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
#endif /* CLAMP */
#ifndef ATEXIT
#define ATEXIT(proc) (atexit (proc))
#endif /* ATEXIT */
/* Provide macros for easily allocating memory. The macros
* will cast the allocated memory to the specified type
* in order to avoid compiler warnings. (Makes the code neater).
*/
#ifdef __DMALLOC_H__
#define g_new(type,count) ALLOC(type,count)
#define g_new0(type,count) CALLOC(type,count)
#else /* __DMALLOC_H__ */
#define g_new(type, count) \
((type *) g_malloc ((unsigned) sizeof (type) * (count)))
#define g_new0(type, count) \
((type *) g_malloc0 ((unsigned) sizeof (type) * (count)))
#endif /* __DMALLOC_H__ */
#define g_chunk_new(type, chunk) \
((type *) g_mem_chunk_alloc (chunk))
/* Provide macros for error handling. The "assert" macros will
* exit on failur. The "return" macros will exit the current
* function. Two different definitions are given for the macros
* in order to support gcc's __PRETTY_FUNCTION__ capability.
*/
#define g_string(x) #x
#ifdef __GNUC__
#define g_assert(expr) \
if (!(expr)) \
g_error ("file %s: line %d (%s): \"%s\"", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr)
#define g_assert_not_reached() \
g_error ("file %s: line %d (%s): \"should not be reached\"", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__)
#define g_return_if_fail(expr) \
if (!(expr)) \
{ \
g_warning ("file %s: line %d (%s): \"%s\"", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
return; \
}
#define g_return_val_if_fail(expr,val) \
if (!(expr)) \
{ \
g_warning ("file %s: line %d (%s): \"%s\"", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
return val; \
}
#else /* __GNUC__ */
#define g_assert(expr) \
if (!(expr)) \
g_error ("file %s: line %d: \"%s\"", \
__FILE__, \
__LINE__, \
#expr)
#define g_assert_not_reached() \
g_error ("file %s: line %d: \"should not be reached\"", \
__FILE__, \
__LINE__)
#define g_return_if_fail(expr) \
if (!(expr)) \
{ \
g_warning ("file %s: line %d: \"%s\"", \
__FILE__, \
__LINE__, \
#expr); \
return; \
}
#define g_return_val_if_fail(expr, val) \
if (!(expr)) \
{ \
g_warning ("file %s: line %d: \"%s\"", \
__FILE__, \
__LINE__, \
#expr); \
return val; \
}
#endif /* __GNUC__ */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Provide type definitions for commonly used types.
* These are useful because a "gint8" can be adjusted
* to be 1 byte (8 bits) on all platforms. Similarly and
* more importantly, "gint32" can be adjusted to be
* 4 bytes (32 bits) on all platforms.
*/
typedef char gchar;
typedef short gshort;
typedef long glong;
typedef int gint;
typedef char gboolean;
typedef unsigned char guchar;
typedef unsigned short gushort;
typedef unsigned long gulong;
typedef unsigned int guint;
typedef float gfloat;
typedef double gdouble;
/* HAVE_LONG_DOUBLE doesn't work correctly on all platforms.
* Since gldouble isn't used anywhere, just disable it for now */
#if 0
#ifdef HAVE_LONG_DOUBLE
typedef long double gldouble;
#else /* HAVE_LONG_DOUBLE */
typedef double gldouble;
#endif /* HAVE_LONG_DOUBLE */
#endif /* 0 */
typedef void* gpointer;
#if (SIZEOF_CHAR == 1)
typedef signed char gint8;
typedef unsigned char guint8;
#endif /* SIZEOF_CHAR */
#if (SIZEOF_SHORT == 2)
typedef signed short gint16;
typedef unsigned short guint16;
#endif /* SIZEOF_SHORT */
#if (SIZEOF_INT == 4)
typedef signed int gint32;
typedef unsigned int guint32;
#elif (SIZEOF_LONG == 4)
typedef signed long gint32;
typedef unsigned long guint32;
#endif /* SIZEOF_INT */
typedef struct _GList GList;
typedef struct _GSList GSList;
typedef struct _GHashTable GHashTable;
typedef struct _GCache GCache;
typedef struct _GTree GTree;
typedef struct _GTimer GTimer;
typedef struct _GMemChunk GMemChunk;
typedef struct _GListAllocator GListAllocator;
typedef struct _GStringChunk GStringChunk;
typedef struct _GString GString;
typedef struct _GArray GArray;
typedef void (*GFunc) (gpointer data, gpointer user_data);
typedef void (*GHFunc) (gpointer key, gpointer value, gpointer user_data);
typedef guint (*GHashFunc) (gpointer key);
typedef gint (*GCompareFunc) (gpointer a, gpointer b);
typedef gpointer (*GCacheNewFunc) (gpointer key);
typedef gpointer (*GCacheDupFunc) (gpointer value);
typedef void (*GCacheDestroyFunc) (gpointer value);
typedef gint (*GTraverseFunc) (gpointer key,
gpointer value,
gpointer data);
typedef gint (*GSearchFunc) (gpointer key,
gpointer data);
typedef void (*GErrorFunc) (gchar *str);
typedef void (*GWarningFunc) (gchar *str);
typedef void (*GPrintFunc) (gchar *str);
struct _GList
{
gpointer data;
GList *next;
GList *prev;
};
struct _GSList
{
gpointer data;
GSList *next;
};
struct _GString
{
gchar *str;
gint len;
};
struct _GArray
{
gchar *data;
guint len;
};
struct _GHashTable { gint dummy; };
struct _GCache { gint dummy; };
struct _GTree { gint dummy; };
struct _GTimer { gint dummy; };
struct _GMemChunk { gint dummy; };
struct _GListAllocator { gint dummy; };
struct _GStringChunk { gint dummy; };
typedef enum
{
G_IN_ORDER,
G_PRE_ORDER,
G_POST_ORDER
} GTraverseType;
/* Doubly linked lists
*/
GList* g_list_alloc (void);
void g_list_free (GList *list);
void g_list_free_1 (GList *list);
GList* g_list_append (GList *list,
gpointer data);
GList* g_list_prepend (GList *list,
gpointer data);
GList* g_list_insert (GList *list,
gpointer data,
gint position);
GList* g_list_concat (GList *list1,
GList *list2);
GList* g_list_remove (GList *list,
gpointer data);
GList* g_list_remove_link (GList *list,
GList *link);
GList* g_list_reverse (GList *list);
GList* g_list_nth (GList *list,
gint n);
GList* g_list_find (GList *list,
gpointer data);
GList* g_list_last (GList *list);
GList* g_list_first (GList *list);
gint g_list_length (GList *list);
void g_list_foreach (GList *list,
GFunc func,
gpointer user_data);
/* Singly linked lists
*/
GSList* g_slist_alloc (void);
void g_slist_free (GSList *list);
void g_slist_free_1 (GSList *list);
GSList* g_slist_append (GSList *list,
gpointer data);
GSList* g_slist_prepend (GSList *list,
gpointer data);
GSList* g_slist_insert (GSList *list,
gpointer data,
gint position);
GSList* g_slist_concat (GSList *list1,
GSList *list2);
GSList* g_slist_remove (GSList *list,
gpointer data);
GSList* g_slist_remove_link (GSList *list,
GSList *link);
GSList* g_slist_reverse (GSList *list);
GSList* g_slist_nth (GSList *list,
gint n);
GSList* g_slist_find (GSList *list,
gpointer data);
GSList* g_slist_last (GSList *list);
gint g_slist_length (GSList *list);
void g_slist_foreach (GSList *list,
GFunc func,
gpointer user_data);
/* List Allocators
*/
GListAllocator* g_list_allocator_new (void);
void g_list_allocator_free (GListAllocator* allocator);
GListAllocator* g_slist_set_allocator (GListAllocator* allocator);
GListAllocator* g_list_set_allocator (GListAllocator* allocator);
/* Hash tables
*/
GHashTable* g_hash_table_new (GHashFunc hash_func,
GCompareFunc key_compare_func);
void g_hash_table_destroy (GHashTable *hash_table);
void g_hash_table_insert (GHashTable *hash_table,
gpointer key,
gpointer value);
void g_hash_table_remove (GHashTable *hash_table,
gpointer key);
gpointer g_hash_table_lookup (GHashTable *hash_table,
const gpointer key);
void g_hash_table_freeze (GHashTable *hash_table);
void g_hash_table_thaw (GHashTable *hash_table);
void g_hash_table_foreach (GHashTable *hash_table,
GHFunc func,
gpointer user_data);
/* Caches
*/
GCache* g_cache_new (GCacheNewFunc value_new_func,
GCacheDestroyFunc value_destroy_func,
GCacheDupFunc key_dup_func,
GCacheDestroyFunc key_destroy_func,
GHashFunc hash_key_func,
GHashFunc hash_value_func,
GCompareFunc key_compare_func);
void g_cache_destroy (GCache *cache);
gpointer g_cache_insert (GCache *cache,
gpointer key);
void g_cache_remove (GCache *cache,
gpointer value);
void g_cache_key_foreach (GCache *cache,
GHFunc func,
gpointer user_data);
void g_cache_value_foreach (GCache *cache,
GHFunc func,
gpointer user_data);
/* Trees
*/
GTree* g_tree_new (GCompareFunc key_compare_func);
void g_tree_destroy (GTree *tree);
void g_tree_insert (GTree *tree,
gpointer key,
gpointer value);
void g_tree_remove (GTree *tree,
gpointer key);
gpointer g_tree_lookup (GTree *tree,
gpointer key);
void g_tree_traverse (GTree *tree,
GTraverseFunc traverse_func,
GTraverseType traverse_type,
gpointer data);
gpointer g_tree_search (GTree *tree,
GSearchFunc search_func,
gpointer data);
gint g_tree_height (GTree *tree);
gint g_tree_nnodes (GTree *tree);
/* Memory
*/
#ifdef USE_DMALLOC
#define g_malloc(size) (gpointer) MALLOC(size)
#define g_malloc0(size) (gpointer) CALLOC(char,size)
#define g_realloc(mem,size) (gpointer) REALLOC(mem,char,size)
#define g_free(mem) FREE(mem)
#else /* USE_DMALLOC */
gpointer g_malloc (gulong size);
gpointer g_malloc0 (gulong size);
gpointer g_realloc (gpointer mem,
gulong size);
void g_free (gpointer mem);
#endif /* USE_DMALLOC */
void g_mem_profile (void);
void g_mem_check (gpointer mem);
/* "g_mem_chunk_new" creates a new memory chunk.
* Memory chunks are used to allocate pieces of memory which are
* always the same size. Lists are a good example of such a data type.
* The memory chunk allocates and frees blocks of memory as needed.
* Just be sure to call "g_mem_chunk_free" and not "g_free" on data
* allocated in a mem chunk. ("g_free" will most likely cause a seg
* fault...somewhere).
*
* Oh yeah, GMemChunk is an opaque data type. (You don't really
* want to know what's going on inside do you?)
*/
/* ALLOC_ONLY MemChunk's can only allocate memory. The free operation
* is interpreted as a no op. ALLOC_ONLY MemChunk's save 4 bytes per
* atom. (They are also useful for lists which use MemChunk to allocate
* memory but are also part of the MemChunk implementation).
* ALLOC_AND_FREE MemChunk's can allocate and free memory.
*/
#define G_ALLOC_ONLY 1
#define G_ALLOC_AND_FREE 2
GMemChunk* g_mem_chunk_new (gchar *name,
gint atom_size,
gulong area_size,
gint type);
void g_mem_chunk_destroy (GMemChunk *mem_chunk);
gpointer g_mem_chunk_alloc (GMemChunk *mem_chunk);
void g_mem_chunk_free (GMemChunk *mem_chunk,
gpointer mem);
void g_mem_chunk_clean (GMemChunk *mem_chunk);
void g_mem_chunk_reset (GMemChunk *mem_chunk);
void g_mem_chunk_print (GMemChunk *mem_chunk);
void g_mem_chunk_info (void);
/* Ah yes...we have a "g_blow_chunks" function.
* "g_blow_chunks" simply compresses all the chunks. This operation
* consists of freeing every memory area that should be freed (but
* which we haven't gotten around to doing yet). And, no,
* "g_blow_chunks" doesn't follow the naming scheme, but it is a
* much better name than "g_mem_chunk_clean_all" or something
* similar.
*/
void g_blow_chunks (void);
/* Timer
*/
GTimer* g_timer_new (void);
void g_timer_destroy (GTimer *timer);
void g_timer_start (GTimer *timer);
void g_timer_stop (GTimer *timer);
void g_timer_reset (GTimer *timer);
gdouble g_timer_elapsed (GTimer *timer,
gulong *microseconds);
/* Output
*/
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
void g_error (gchar *format, ...) __attribute__ ((format (printf, 1, 2)));
void g_warning (gchar *format, ...) __attribute__ ((format (printf, 1, 2)));
void g_message (gchar *format, ...) __attribute__ ((format (printf, 1, 2)));
void g_print (gchar *format, ...) __attribute__ ((format (printf, 1, 2)));
#else
void g_error (gchar *format, ...);
void g_warning (gchar *format, ...);
void g_message (gchar *format, ...);
void g_print (gchar *format, ...);
#endif
/* Utility functions
*/
gchar* g_strdup (const gchar *str);
gchar* g_strerror (gint errnum);
gchar* g_strsignal (gint signum);
/* We make the assumption that if memmove isn't available, then
* bcopy will do the job. This isn't safe everywhere. (bcopy can't
* necessarily handle overlapping copies) */
#ifdef HAVE_MEMMOVE
#define g_memmove memmove
#else
#define g_memmove(a,b,c) bcopy(b,a,c)
#endif
/* Errors
*/
GErrorFunc g_set_error_handler (GErrorFunc func);
GWarningFunc g_set_warning_handler (GWarningFunc func);
GPrintFunc g_set_message_handler (GPrintFunc func);
GPrintFunc g_set_print_handler (GPrintFunc func);
void g_debug (char *progname);
void g_attach_process (char *progname, int query);
void g_stack_trace (char *progname, int query);
/* String Chunks
*/
GStringChunk* g_string_chunk_new (gint size);
void g_string_chunk_free (GStringChunk *chunk);
gchar* g_string_chunk_insert (GStringChunk *chunk,
gchar* string);
gchar* g_string_chunk_insert_const (GStringChunk *chunk,
gchar* string);
/* Strings
*/
GString* g_string_new (gchar *init);
void g_string_free (GString *string,
gint free_segment);
GString* g_string_assign (GString *lval,
gchar *rval);
GString* g_string_truncate (GString *string,
gint len);
GString* g_string_append (GString *string,
gchar *val);
GString* g_string_append_c (GString *string,
gchar c);
GString* g_string_prepend (GString *string,
gchar *val);
GString* g_string_prepend_c (GString *string,
gchar c);
void g_string_sprintf (GString *string,
gchar *fmt,
...);
void g_string_sprintfa (GString *string,
gchar *fmt,
...);
/* Resizable arrays
*/
#define g_array_append_val(array,type,val) \
g_rarray_append (array, (gpointer) &val, sizeof (type))
#define g_array_append_vals(array,type,vals,nvals) \
g_rarray_append (array, (gpointer) vals, sizeof (type) * nvals)
#define g_array_prepend_val(array,type,val) \
g_rarray_prepend (array, (gpointer) &val, sizeof (type))
#define g_array_prepend_vals(array,type,vals,nvals) \
g_rarray_prepend (array, (gpointer) vals, sizeof (type) * nvals)
#define g_array_truncate(array,type,length) \
g_rarray_truncate (array, length, sizeof (type))
#define g_array_index(array,type,index) \
((type*) array->data)[index]
GArray* g_array_new (gint zero_terminated);
void g_array_free (GArray *array,
gint free_segment);
GArray* g_rarray_append (GArray *array,
gpointer data,
gint size);
GArray* g_rarray_prepend (GArray *array,
gpointer data,
gint size);
GArray* g_rarray_truncate (GArray *array,
gint length,
gint size);
/* Hash Functions
*/
gint g_string_equal (gpointer v,
gpointer v2);
guint g_string_hash (gpointer v);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __G_LIB_H__ */

View File

@ -6,9 +6,6 @@
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if the `long double' type works. */
#undef HAVE_LONG_DOUBLE
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
@ -22,6 +19,7 @@
#undef HAVE_DOPRNT
#undef HAVE_FLOAT_H
#undef HAVE_LIMITS_H
#undef HAVE_LONG_DOUBLE
#undef HAVE_SYS_SELECT_H
#undef HAVE_STRERROR
#undef HAVE_STRSIGNAL
@ -32,6 +30,10 @@
#undef NO_SYS_ERRLIST
#undef NO_SYS_SIGLIST
#undef HAVE_WCHAR_H
#undef HAVE_WCSTR_H
#undef HAVE_WCTYPE_H
/* #undef PACKAGE */
/* #undef VERSION */
@ -50,15 +52,15 @@
/* The number of bytes in a void *. */
#undef SIZEOF_VOID_P
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the strsignal function. */
#undef HAVE_STRSIGNAL
/* Define if you have the memmove function */
#undef HAVE_MEMMOVE
/* Define if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
@ -67,13 +69,3 @@
/* Define if you have the <values.h> header file. */
#undef HAVE_VALUES_H
/* Define if you have the <wchar.h> header file */
#undef HAVE_WCHAR_H
/* Define if you have the <wcstr.h> header file */
#undef HAVE_WCSTR_H
/* Define if you have the <wctype.h> header file */
#undef HAVE_WCTYPE_H

4
glib/makeglib_h Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
cat $1
cat $2
cat $3