Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 4679 → Rev 4680

/contrib/media/updf/include/FLAC/Makefile
0,0 → 1,262
# Generated automatically from Makefile.in by configure.
# Makefile.in generated automatically by automake 1.4 from Makefile.am
 
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
 
# flac - Command-line FLAC encoder/decoder
# Copyright (C) 2000,2001 Josh Coalson
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
SHELL = /bin/sh
 
srcdir = .
top_srcdir = ../..
prefix = /usr/local
exec_prefix = ${prefix}
 
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
oldincludedir = /usr/include
 
DESTDIR =
 
pkgdatadir = $(datadir)/flac
pkglibdir = $(libdir)/flac
pkgincludedir = $(includedir)/flac
 
top_builddir = ../..
 
ACLOCAL = aclocal
AUTOCONF = autoconf
AUTOMAKE = automake
AUTOHEADER = autoheader
 
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
transform = s,x,x,
 
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = i686-pc-linux-gnu
host_triplet = i686-pc-linux-gnu
AS = @AS@
AWK =
CC = gcc
DLLTOOL = @DLLTOOL@
FLaC__SIZE16 = short
FLaC__SIZE32 = int
FLaC__SIZE64 = long long
FLaC__USIZE16 = unsigned short
FLaC__USIZE32 = unsigned int
FLaC__USIZE64 = unsigned long long
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LN_S = ln -s
MAKEINFO = makeinfo
NASM = nasm
OBJDUMP = @OBJDUMP@
OBJ_FORMAT = elf
PACKAGE = flac
RANLIB = ranlib
VERSION = 1.0
XMMS_CFLAGS =
XMMS_CONFIG = no
XMMS_DATA_DIR =
XMMS_EFFECT_PLUGIN_DIR =
XMMS_GENERAL_PLUGIN_DIR =
XMMS_INPUT_PLUGIN_DIR =
XMMS_LIBS =
XMMS_OUTPUT_PLUGIN_DIR =
XMMS_PLUGIN_DIR =
XMMS_VERSION =
XMMS_VISUALIZATION_PLUGIN_DIR =
 
includedir = ${prefix}/include/FLAC
 
include_HEADERS = all.h assert.h file_decoder.h format.h ordinals.h seek_table.h stream_decoder.h stream_encoder.h utility.h
 
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = ordinals.h
HEADERS = $(include_HEADERS)
 
DIST_COMMON = Makefile.am Makefile.in ordinals.h.in
 
 
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps include/FLAC/Makefile
 
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
ordinals.h: $(top_builddir)/config.status ordinals.h.in
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(includedir)
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \
$(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \
done
 
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
list='$(include_HEADERS)'; for p in $$list; do \
rm -f $(DESTDIR)$(includedir)/$$p; \
done
 
tags: TAGS
 
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
 
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
 
mostlyclean-tags:
 
clean-tags:
 
distclean-tags:
-rm -f TAGS ID
 
maintainer-clean-tags:
 
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 
subdir = include/FLAC
 
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
 
install-data-am: install-includeHEADERS
install-data: install-data-am
 
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am: uninstall-includeHEADERS
uninstall: uninstall-am
all-am: Makefile $(HEADERS)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
$(mkinstalldirs) $(DESTDIR)$(includedir)
 
 
mostlyclean-generic:
 
clean-generic:
 
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
 
maintainer-clean-generic:
mostlyclean-am: mostlyclean-tags mostlyclean-generic
 
mostlyclean: mostlyclean-am
 
clean-am: clean-tags clean-generic mostlyclean-am
 
clean: clean-am
 
distclean-am: distclean-tags distclean-generic clean-am
-rm -f libtool
 
distclean: distclean-am
 
maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
 
maintainer-clean: maintainer-clean-am
 
.PHONY: uninstall-includeHEADERS install-includeHEADERS tags \
mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
distdir info-am info dvi-am dvi check check-am installcheck-am \
installcheck install-exec-am install-exec install-data-am install-data \
install-am install uninstall-am uninstall all-redirect all-am all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
# 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:
/contrib/media/updf/include/FLAC/Makefile.am
0,0 → 1,29
# flac - Command-line FLAC encoder/decoder
# Copyright (C) 2000,2001 Josh Coalson
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
includedir = ${prefix}/include/FLAC
 
include_HEADERS = \
all.h \
assert.h \
file_decoder.h \
format.h \
ordinals.h \
seek_table.h \
stream_decoder.h \
stream_encoder.h \
utility.h
/contrib/media/updf/include/FLAC/Makefile.in
0,0 → 1,262
# Makefile.in generated automatically by automake 1.4 from Makefile.am
 
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
 
# flac - Command-line FLAC encoder/decoder
# Copyright (C) 2000,2001 Josh Coalson
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
SHELL = @SHELL@
 
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
 
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
oldincludedir = /usr/include
 
DESTDIR =
 
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
 
top_builddir = ../..
 
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
 
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
 
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
AS = @AS@
AWK = @AWK@
CC = @CC@
DLLTOOL = @DLLTOOL@
FLaC__SIZE16 = @FLaC__SIZE16@
FLaC__SIZE32 = @FLaC__SIZE32@
FLaC__SIZE64 = @FLaC__SIZE64@
FLaC__USIZE16 = @FLaC__USIZE16@
FLaC__USIZE32 = @FLaC__USIZE32@
FLaC__USIZE64 = @FLaC__USIZE64@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAKEINFO = @MAKEINFO@
NASM = @NASM@
OBJDUMP = @OBJDUMP@
OBJ_FORMAT = @OBJ_FORMAT@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
VERSION = @VERSION@
XMMS_CFLAGS = @XMMS_CFLAGS@
XMMS_CONFIG = @XMMS_CONFIG@
XMMS_DATA_DIR = @XMMS_DATA_DIR@
XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@
XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@
XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@
XMMS_LIBS = @XMMS_LIBS@
XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@
XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@
XMMS_VERSION = @XMMS_VERSION@
XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@
 
includedir = ${prefix}/include/FLAC
 
include_HEADERS = all.h assert.h file_decoder.h format.h ordinals.h seek_table.h stream_decoder.h stream_encoder.h utility.h
 
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = ordinals.h
HEADERS = $(include_HEADERS)
 
DIST_COMMON = Makefile.am Makefile.in ordinals.h.in
 
 
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps include/FLAC/Makefile
 
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
ordinals.h: $(top_builddir)/config.status ordinals.h.in
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(includedir)
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \
$(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \
done
 
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
list='$(include_HEADERS)'; for p in $$list; do \
rm -f $(DESTDIR)$(includedir)/$$p; \
done
 
tags: TAGS
 
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
 
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
 
mostlyclean-tags:
 
clean-tags:
 
distclean-tags:
-rm -f TAGS ID
 
maintainer-clean-tags:
 
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 
subdir = include/FLAC
 
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
 
install-data-am: install-includeHEADERS
install-data: install-data-am
 
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am: uninstall-includeHEADERS
uninstall: uninstall-am
all-am: Makefile $(HEADERS)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
$(mkinstalldirs) $(DESTDIR)$(includedir)
 
 
mostlyclean-generic:
 
clean-generic:
 
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
 
maintainer-clean-generic:
mostlyclean-am: mostlyclean-tags mostlyclean-generic
 
mostlyclean: mostlyclean-am
 
clean-am: clean-tags clean-generic mostlyclean-am
 
clean: clean-am
 
distclean-am: distclean-tags distclean-generic clean-am
-rm -f libtool
 
distclean: distclean-am
 
maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
 
maintainer-clean: maintainer-clean-am
 
.PHONY: uninstall-includeHEADERS install-includeHEADERS tags \
mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
distdir info-am info dvi-am dvi check check-am installcheck-am \
installcheck install-exec-am install-exec install-data-am install-data \
install-am install uninstall-am uninstall all-redirect all-am all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
# 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:
/contrib/media/updf/include/FLAC/all.h
0,0 → 1,32
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000,2001 Josh Coalson
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
 
#ifndef FLAC__ALL_H
#define FLAC__ALL_H
 
#include "assert.h"
#include "file_decoder.h"
#include "format.h"
#include "ordinals.h"
#include "seek_table.h"
#include "stream_decoder.h"
#include "stream_encoder.h"
#include "utility.h"
 
#endif
/contrib/media/updf/include/FLAC/assert.h
0,0 → 1,31
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2001 Josh Coalson
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
 
#ifndef FLAC__ASSERT_H
#define FLAC__ASSERT_H
 
/* we need this since some compilers (like MSVC) leave asserts on release code (and we don't want to use their ASSERT) */
#ifdef DEBUG
#include <assert.h>
#define FLAC__ASSERT(x) assert(x)
#else
#define FLAC__ASSERT(x)
#endif
 
#endif
/contrib/media/updf/include/FLAC/file_decoder.h
0,0 → 1,136
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000,2001 Josh Coalson
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
 
#ifndef FLAC__FILE_DECODER_H
#define FLAC__FILE_DECODER_H
 
#include "stream_decoder.h"
 
typedef enum {
FLAC__FILE_DECODER_OK = 0,
FLAC__FILE_DECODER_SEEKING,
FLAC__FILE_DECODER_END_OF_FILE,
FLAC__FILE_DECODER_ERROR_OPENING_FILE,
FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR,
FLAC__FILE_DECODER_SEEK_ERROR,
FLAC__FILE_DECODER_STREAM_ERROR,
FLAC__FILE_DECODER_MD5_ERROR,
FLAC__FILE_DECODER_STREAM_DECODER_ERROR,
FLAC__FILE_DECODER_ALREADY_INITIALIZED,
FLAC__FILE_DECODER_INVALID_CALLBACK,
FLAC__FILE_DECODER_UNINITIALIZED
} FLAC__FileDecoderState;
extern const char *FLAC__FileDecoderStateString[];
 
/***********************************************************************
*
* class FLAC__FileDecoder : public FLAC__StreamDecoder
*
***********************************************************************/
 
struct FLAC__FileDecoderProtected;
struct FLAC__FileDecoderPrivate;
typedef struct {
struct FLAC__FileDecoderProtected *protected;
struct FLAC__FileDecoderPrivate *private;
} FLAC__FileDecoder;
 
/***********************************************************************
*
* Class constructor/destructor
*
***********************************************************************/
 
/*
* Any parameters that are not set before FLAC__file_decoder_init()
* will take on the defaults from the constructor, shown below.
* For more on what the parameters mean, see the documentation.
*
* FLAC__bool md5_checking (DEFAULT: false) MD5 checking will be turned off if a seek is requested
* (*write_callback)() (DEFAULT: NULL ) The callbacks are the only values that MUST be set before FLAC__file_decoder_init()
* (*metadata_callback)() (DEFAULT: NULL )
* (*error_callback)() (DEFAULT: NULL )
* void* client_data (DEFAULT: NULL ) passed back through the callbacks
*/
FLAC__FileDecoder *FLAC__file_decoder_new();
void FLAC__file_decoder_delete(FLAC__FileDecoder *);
 
/***********************************************************************
*
* Public class method prototypes
*
***********************************************************************/
 
/*
* Various "set" methods. These may only be called when the decoder
* is in the state FLAC__FILE_DECODER_UNINITIALIZED, i.e. after
* FLAC__file_decoder_new() or FLAC__file_decoder_finish(), but
* before FLAC__file_decoder_init(). If this is the case they will
* return true, otherwise false.
*
* NOTE that these functions do not validate the values as many are
* interdependent. The FLAC__file_decoder_init() function will do
* this, so make sure to pay attention to the state returned by
* FLAC__file_decoder_init().
*
* Any parameters that are not set before FLAC__file_decoder_init()
* will take on the defaults from the constructor. NOTE that
* FLAC__file_decoder_flush() or FLAC__file_decoder_reset() do
* NOT reset the values to the constructor defaults.
*/
FLAC__bool FLAC__file_decoder_set_md5_checking(const FLAC__FileDecoder *decoder, FLAC__bool value);
FLAC__bool FLAC__file_decoder_set_filename(const FLAC__FileDecoder *decoder, const char *value);
FLAC__bool FLAC__file_decoder_set_write_callback(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderWriteStatus (*value)(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *buffer[], void *client_data));
FLAC__bool FLAC__file_decoder_set_metadata_callback(const FLAC__FileDecoder *decoder, void (*value)(const FLAC__FileDecoder *decoder, const FLAC__StreamMetaData *metadata, void *client_data));
FLAC__bool FLAC__file_decoder_set_error_callback(const FLAC__FileDecoder *decoder, void (*value)(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data));
FLAC__bool FLAC__file_decoder_set_client_data(const FLAC__FileDecoder *decoder, void *value);
 
/*
* Various "get" methods
*/
FLAC__FileDecoderState FLAC__file_decoder_get_state(const FLAC__FileDecoder *decoder);
FLAC__bool FLAC__file_decoder_get_md5_checking(const FLAC__FileDecoder *decoder);
 
/*
* Initialize the instance; should be called after construction and
* 'set' calls but before any of the 'process' or 'seek' calls. Will
* set and return the decoder state, which will be FLAC__FILE_DECODER_OK
* if initializationsucceeded.
*/
FLAC__FileDecoderState FLAC__file_decoder_init(FLAC__FileDecoder *decoder);
 
/*
* Flush the decoding buffer, release resources, and return the decoder
* state to FLAC__FILE_DECODER_UNINITIALIZED. Only returns false if
* md5_checking is set AND the stored MD5 sum is non-zero AND the stored
* MD5 sum and computed MD5 sum do not match.
*/
FLAC__bool FLAC__file_decoder_finish(FLAC__FileDecoder *decoder);
 
/*
* Methods for decoding the data
*/
FLAC__bool FLAC__file_decoder_process_whole_file(FLAC__FileDecoder *decoder);
FLAC__bool FLAC__file_decoder_process_metadata(FLAC__FileDecoder *decoder);
FLAC__bool FLAC__file_decoder_process_one_frame(FLAC__FileDecoder *decoder);
FLAC__bool FLAC__file_decoder_process_remaining_frames(FLAC__FileDecoder *decoder);
 
FLAC__bool FLAC__file_decoder_seek_absolute(FLAC__FileDecoder *decoder, FLAC__uint64 sample);
 
#endif
/contrib/media/updf/include/FLAC/format.h
0,0 → 1,476
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000,2001 Josh Coalson
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
 
#ifndef FLAC__FORMAT_H
#define FLAC__FORMAT_H
 
#include "ordinals.h"
 
/* changing the following values to be higher will break the framing and hence the stream format, so DON'T! */
#define FLAC__MIN_BLOCK_SIZE (16u)
#define FLAC__MAX_BLOCK_SIZE (65535u)
#define FLAC__MAX_CHANNELS (8u)
#define FLAC__MIN_BITS_PER_SAMPLE (4u)
/*NOTE: only up to 24 because of the current predictor coefficient quantization and the fact we use FLAC__int32s for all work */
#define FLAC__MAX_BITS_PER_SAMPLE (24u)
/* the following is ((2 ** 20) - 1) div 10 */
#define FLAC__MAX_SAMPLE_RATE (1048570u)
#define FLAC__MAX_LPC_ORDER (32u)
#define FLAC__MIN_QLP_COEFF_PRECISION (5u)
/* changing FLAC__MAX_FIXED_ORDER also means changing all of fixed.c and more, so DON'T! */
#define FLAC__MAX_FIXED_ORDER (4u)
#define FLAC__MAX_RICE_PARTITION_ORDER (15u)
 
/* VERSION should come from configure */
#ifdef VERSION
#define FLAC__VERSION_STRING VERSION
#endif
 
extern const FLAC__byte FLAC__STREAM_SYNC_STRING[4]; /* = "fLaC" */;
extern const unsigned FLAC__STREAM_SYNC; /* = 0x664C6143 */;
extern const unsigned FLAC__STREAM_SYNC_LEN; /* = 32 bits */;
 
 
/*****************************************************************************
*
* NOTE: Within the bitstream, all fixed-width numbers are big-endian coded.
* All numbers are unsigned unless otherwise noted.
*
*****************************************************************************/
 
 
/*****************************************************************************
*
* Subframe structures
*
*****************************************************************************/
 
/*****************************************************************************/
 
typedef enum {
FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0
} FLAC__EntropyCodingMethodType;
extern const char *FLAC__EntropyCodingMethodTypeString[];
 
/*****************************************************************************
*
* 4: partition order => (2 ** order) subdivisions
*/
typedef struct {
unsigned order;
unsigned parameters[1 << FLAC__MAX_RICE_PARTITION_ORDER];
unsigned raw_bits[1 << FLAC__MAX_RICE_PARTITION_ORDER];
} FLAC__EntropyCodingMethod_PartitionedRice;
 
extern const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN; /* = 4 bits */
extern const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN; /* = 4 bits */
extern const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN; /* = 5 bits */
 
extern const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER; /* = (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN)-1 */
 
/*****************************************************************************
*
* 2: entropy coding method:
* 00: partitioned rice coding
* 01-11: reserved
* ?: entropy coding method data
*/
typedef struct {
FLAC__EntropyCodingMethodType type;
union {
FLAC__EntropyCodingMethod_PartitionedRice partitioned_rice;
} data;
} FLAC__EntropyCodingMethod;
 
extern const unsigned FLAC__ENTROPY_CODING_METHOD_TYPE_LEN; /* = 2 bits */
 
/*****************************************************************************/
 
typedef enum {
FLAC__SUBFRAME_TYPE_CONSTANT = 0,
FLAC__SUBFRAME_TYPE_VERBATIM = 1,
FLAC__SUBFRAME_TYPE_FIXED = 2,
FLAC__SUBFRAME_TYPE_LPC = 3
} FLAC__SubframeType;
extern const char *FLAC__SubframeTypeString[];
 
/*****************************************************************************
*
* n: constant value for signal; n = frame's bits-per-sample
*/
typedef struct {
FLAC__int32 value;
} FLAC__Subframe_Constant;
 
/*****************************************************************************
*
* n*i: unencoded signal; n = frame's bits-per-sample, i = frame's blocksize
*/
typedef struct {
const FLAC__int32 *data;
} FLAC__Subframe_Verbatim;
 
/*****************************************************************************
*
* n: unencoded warm-up samples (n = fixed-predictor order * bits per sample)
* ?: entropy coding method info
* ?: encoded residual ((blocksize minus fixed-predictor order) samples)
* The order is stored in the main subframe header
*/
typedef struct {
FLAC__EntropyCodingMethod entropy_coding_method;
unsigned order;
FLAC__int32 warmup[FLAC__MAX_FIXED_ORDER];
const FLAC__int32 *residual;
} FLAC__Subframe_Fixed;
 
/*****************************************************************************
*
* n: unencoded warm-up samples (n = lpc order * bits per sample)
* 4: (qlp coeff precision in bits)-1 (1111 = invalid, use to check for erroneous sync)
* 5: qlp shift needed in bits (signed)
* n: unencoded predictor coefficients (n = lpc order * qlp coeff precision)
* ?: entropy coding method info
* ?: encoded residual ((blocksize minus lpc order) samples)
* The order is stored in the main subframe header
*/
typedef struct {
FLAC__EntropyCodingMethod entropy_coding_method;
unsigned order;
unsigned qlp_coeff_precision;
int quantization_level;
FLAC__int32 qlp_coeff[FLAC__MAX_LPC_ORDER];
FLAC__int32 warmup[FLAC__MAX_LPC_ORDER];
const FLAC__int32 *residual;
} FLAC__Subframe_LPC;
 
extern const unsigned FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN; /* = 4 bits */
extern const unsigned FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN; /* = 5 bits */
 
/*****************************************************************************
*
* 1: zero pad, to prevent sync-fooling string of 1s (use to check for erroneous sync)
* 6: subframe type
* 000000: constant value
* 000001: verbatim
* 00001x: reserved
* 0001xx: reserved
* 001xxx: fixed predictor, xxx=order <= 4, else reserved
* 01xxxx: reserved
* 1xxxxx: lpc, xxxxx=order-1
* 1: 'wasted bits' flag
* 0: no wasted bits in source subblock
* 1: all samples in source subblock contain n 0 least significant bits. n-1 follows, unary coded, i.e. n=3, 001 follows, n=7, 0000001 follows.
* ?: unary coded (n-1)
* ?: subframe-specific data (c.f. FLAC__Subframe_*)
*/
typedef struct {
FLAC__SubframeType type;
union {
FLAC__Subframe_Constant constant;
FLAC__Subframe_Fixed fixed;
FLAC__Subframe_LPC lpc;
FLAC__Subframe_Verbatim verbatim;
} data;
unsigned wasted_bits;
} FLAC__Subframe;
 
extern const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN; /* = 1 bit */
extern const unsigned FLAC__SUBFRAME_TYPE_LEN; /* = 6 bits */
extern const unsigned FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN; /* = 1 bit */
 
extern const unsigned FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK; /* = 0x00 */
extern const unsigned FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK; /* = 0x02 */
extern const unsigned FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK; /* = 0x10 */
extern const unsigned FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK; /* = 0x40 */
 
/*****************************************************************************/
 
 
/*****************************************************************************
*
* Frame structures
*
*****************************************************************************/
 
typedef enum {
FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT = 0,
FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE = 1,
FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE = 2,
FLAC__CHANNEL_ASSIGNMENT_MID_SIDE = 3
} FLAC__ChannelAssignment;
extern const char *FLAC__ChannelAssignmentString[];
 
typedef enum {
FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER,
FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER
} FLAC__FrameNumberType;
extern const char *FLAC__FrameNumberTypeString[];
 
/*****************************************************************************
*
* 14: sync code '11111111111110'
* 2: reserved
* 00: currently required value
* 01-11: reserved
* 4: blocksize in samples
* 0000: get from stream header => implies constant blocksize throughout stream
* 0001: 192 samples (AES/EBU) => implies constant blocksize throughout stream
* 0010-0101: 576 * (2^(n-2)) samples, i.e. 576/1152/2304/4608 => implies constant blocksize throughout stream
* 0110: get 8 bit (blocksize-1) from end of header => possibly variable blocksize throughout stream unless it's the last frame
* 0111: get 16 bit (blocksize-1) from end of header => possibly variable blocksize throughout stream unless it's the last frame
* 1000-1111: 256 * (2^(n-8)) samples, i.e. 256/512/1024/2048/4096/8192/16384/32768 => implies constant blocksize throughout stream
* 4: sample rate:
* 0000: get from stream header
* 0001-0011: reserved
* 0100: 8kHz
* 0101: 16kHz
* 0110: 22.05kHz
* 0111: 24kHz
* 1000: 32kHz
* 1001: 44.1kHz
* 1010: 48kHz
* 1011: 96kHz
* 1100: get 8 bit sample rate (in kHz) from end of header
* 1101: get 16 bit sample rate (in Hz) from end of header
* 1110: get 16 bit sample rate (in tens of Hz) from end of header
* 1111: invalid, to prevent sync-fooling string of 1s (use to check for erroneous sync)
* 4: channel assignment
* 0000-0111: (number of independent channels)-1. when == 0001, channel 0 is the left channel and channel 1 is the right
* 1000: left/side stereo : channel 0 is the left channel, channel 1 is the side(difference) channel
* 1001: right/side stereo: channel 0 is the side(difference) channel, channel 1 is the right channel
* 1010: mid/side stereo : channel 0 is the mid(average) channel, channel 1 is the side(difference) channel
* 1011-1111: reserved
* 3: sample size in bits
* 000: get from stream header
* 001: 8 bits per sample
* 010: 12 bits per sample
* 011: reserved
* 100: 16 bits per sample
* 101: 20 bits per sample
* 110: 24 bits per sample
* 111: reserved
* 1: zero pad, to prevent sync-fooling string of 1s (use to check for erroneous sync)
* ?: if(variable blocksize)
* 8-56: 'UTF-8' coded sample number (decoded number is 0-36 bits) (use to check for erroneous sync)
* else
* 8-48: 'UTF-8' coded frame number (decoded number is 0-31 bits) (use to check for erroneous sync)
* ?: if(blocksize bits == 11x)
* 8/16 bit (blocksize-1)
* ?: if(sample rate bits == 11xx)
* 8/16 bit sample rate
* 8: CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0) of everything before the crc, including the sync code
*/
typedef struct {
unsigned blocksize; /* in samples */
unsigned sample_rate; /* in Hz */
unsigned channels;
FLAC__ChannelAssignment channel_assignment;
unsigned bits_per_sample;
FLAC__FrameNumberType number_type;
union {
FLAC__uint32 frame_number;
FLAC__uint64 sample_number;
} number;
FLAC__uint8 crc;
} FLAC__FrameHeader;
 
extern const unsigned FLAC__FRAME_HEADER_SYNC; /* = 0x3ffe */
extern const unsigned FLAC__FRAME_HEADER_SYNC_LEN; /* = 14 bits */
extern const unsigned FLAC__FRAME_HEADER_RESERVED_LEN; /* = 2 bits */
extern const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN; /* = 4 bits */
extern const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN; /* = 4 bits */
extern const unsigned FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN; /* = 4 bits */
extern const unsigned FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN; /* = 3 bits */
extern const unsigned FLAC__FRAME_HEADER_ZERO_PAD_LEN; /* = 1 bit */
extern const unsigned FLAC__FRAME_HEADER_CRC_LEN; /* = 8 bits */
 
/*****************************************************************************
*
* 16: CRC-16 (polynomial = x^16 + x^15 + x^2 + x^0, initialized with 0) of everything before the crc, back to and including the frame header sync code
*/
typedef struct {
FLAC__uint16 crc;
} FLAC__FrameFooter;
 
extern const unsigned FLAC__FRAME_FOOTER_CRC_LEN; /* = 16 bits */
 
typedef struct {
FLAC__FrameHeader header;
FLAC__Subframe subframes[FLAC__MAX_CHANNELS];
FLAC__FrameFooter footer;
} FLAC__Frame;
 
/*****************************************************************************/
 
 
/*****************************************************************************
*
* Meta-data structures
*
*****************************************************************************/
 
typedef enum {
FLAC__METADATA_TYPE_STREAMINFO = 0,
FLAC__METADATA_TYPE_PADDING = 1,
FLAC__METADATA_TYPE_APPLICATION = 2,
FLAC__METADATA_TYPE_SEEKTABLE = 3
} FLAC__MetaDataType;
extern const char *FLAC__MetaDataTypeString[];
 
/*****************************************************************************
*
* 16: minimum blocksize (in samples) of all blocks in the stream
* 16: maximum blocksize (in samples) of all blocks in the stream
* 24: minimum framesize (in bytes) of all frames in the stream; 0 => unknown
* 24: maximum framesize (in bytes) of all frames in the stream; 0 => unknown
* 20: sample rate in Hz, 0 is invalid
* 3: (number of channels)-1
* 5: (bits per sample)-1
* 36: total samples, 0 => unknown
*128: MD5 digest of the original unencoded audio data
*---- -----------------
* 34 bytes total
*/
typedef struct {
unsigned min_blocksize, max_blocksize;
unsigned min_framesize, max_framesize;
unsigned sample_rate;
unsigned channels;
unsigned bits_per_sample;
FLAC__uint64 total_samples;
FLAC__byte md5sum[16];
} FLAC__StreamMetaData_StreamInfo;
 
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN; /* = 16 bits */
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN; /* = 16 bits */
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN; /* = 24 bits */
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN; /* = 24 bits */
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN; /* = 20 bits */
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN; /* = 3 bits */
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN; /* = 5 bits */
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN; /* = 36 bits */
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /* = 128 bits */
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_LENGTH; /* = 34 bytes */
 
/*****************************************************************************
*
* n: '0' bits
*----- -----------------
* n/8 bytes total
*/
typedef struct {
int dummy; /* conceptually this is an empty struct since we don't store the padding bytes */
/* empty structs are allowed by C++ but not C, hence the 'dummy' */
} FLAC__StreamMetaData_Padding;
 
/*****************************************************************************
*
* 32: Registered application ID
* n: Application data
*------- -----------------
* 4+n/8 bytes total
*/
typedef struct {
FLAC__byte id[4];
FLAC__byte *data;
} FLAC__StreamMetaData_Application;
 
extern const unsigned FLAC__STREAM_METADATA_APPLICATION_ID_LEN; /* = 32 bits */
 
/*****************************************************************************
*
* 64: sample number of target frame
* 64: offset, in bytes, of target frame with respect to beginning of first frame
* 16: number of samples in the target frame
*----- -----------------
* 18 bytes total
*/
typedef struct {
FLAC__uint64 sample_number;
FLAC__uint64 stream_offset;
unsigned frame_samples;
} FLAC__StreamMetaData_SeekPoint;
 
extern const unsigned FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN; /* = 64 bits */
extern const unsigned FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN; /* = 64 bits */
extern const unsigned FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN; /* = 16 bits */
extern const unsigned FLAC__STREAM_METADATA_SEEKPOINT_LEN; /* = 18 bytes */
 
extern const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; /* = 0xffffffffffffffff */
 
/*****************************************************************************
*
* 0: num_points is implied by the metadata block 'length' field (i.e. num_points = length / 18)
* n*18*8: seek points (n = num_points, 18 is the size of a seek point in bytes)
* ------- -----------------
* n*18 bytes total
*
* NOTE: the seek points must be sorted by ascending sample number.
* NOTE: each seek point's sample number must be the first sample of the target frame.
* NOTE: each seek point's sample number must be unique within the table.
* NOTE: existence of a SEEKTABLE block implies a correct setting of total_samples in the stream_info block.
* NOTE: behavior is undefined when more than one SEEKTABLE block is present in a stream.
*/
typedef struct {
unsigned num_points;
FLAC__StreamMetaData_SeekPoint *points;
} FLAC__StreamMetaData_SeekTable;
 
/*****************************************************************************
*
* 1: =1 if this is the last meta-data block, else =0
* 7: meta-data type (c.f. FLAC__MetaDataType)
* 24: length (in bytes) of the block-specific data to follow
*---- -----------------
* 4 bytes total
*/
typedef struct {
FLAC__MetaDataType type;
FLAC__bool is_last;
unsigned length; /* in bytes */
union {
FLAC__StreamMetaData_StreamInfo stream_info;
FLAC__StreamMetaData_Padding padding;
FLAC__StreamMetaData_Application application;
FLAC__StreamMetaData_SeekTable seek_table;
} data;
} FLAC__StreamMetaData;
 
extern const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN; /* = 1 bits */
extern const unsigned FLAC__STREAM_METADATA_TYPE_LEN; /* = 7 bits */
extern const unsigned FLAC__STREAM_METADATA_LENGTH_LEN; /* = 24 bits */
 
/*****************************************************************************/
 
 
/*****************************************************************************
*
* Stream structures
*
*****************************************************************************/
 
typedef struct {
FLAC__StreamMetaData_StreamInfo stream_info;
FLAC__Frame *frames;
} FLAC__Stream;
 
/*****************************************************************************/
 
#endif
/contrib/media/updf/include/FLAC/ordinals.h
0,0 → 1,56
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000,2001 Josh Coalson
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
 
#ifndef FLAC__ORDINALS_H
#define FLAC__ORDINALS_H
 
#ifdef true
#undef true
#endif
#ifdef false
#undef false
#endif
#define true 1
#define false 0
 
typedef int FLAC__bool;
 
typedef signed char FLAC__int8;
typedef unsigned char FLAC__uint8;
 
#ifdef _MSC_VER
typedef __int16 FLAC__int16;
typedef __int32 FLAC__int32;
typedef __int64 FLAC__int64;
typedef unsigned __int16 FLAC__uint16;
typedef unsigned __int32 FLAC__uint32;
typedef unsigned __int64 FLAC__uint64;
#else
typedef short FLAC__int16;
typedef int FLAC__int32;
typedef long long FLAC__int64;
typedef unsigned short FLAC__uint16;
typedef unsigned int FLAC__uint32;
typedef unsigned long long FLAC__uint64;
#endif
 
typedef FLAC__uint8 FLAC__byte;
typedef float FLAC__real;
 
#endif
/contrib/media/updf/include/FLAC/ordinals.h.in
0,0 → 1,56
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000,2001 Josh Coalson
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
 
#ifndef FLAC__ORDINALS_H
#define FLAC__ORDINALS_H
 
#ifdef true
#undef true
#endif
#ifdef false
#undef false
#endif
#define true 1
#define false 0
 
typedef int FLAC__bool;
 
typedef signed char FLAC__int8;
typedef unsigned char FLAC__uint8;
 
#ifdef _MSC_VER
typedef __int16 FLAC__int16;
typedef __int32 FLAC__int32;
typedef __int64 FLAC__int64;
typedef unsigned __int16 FLAC__uint16;
typedef unsigned __int32 FLAC__uint32;
typedef unsigned __int64 FLAC__uint64;
#else
typedef @FLaC__SIZE16@ FLAC__int16;
typedef @FLaC__SIZE32@ FLAC__int32;
typedef @FLaC__SIZE64@ FLAC__int64;
typedef @FLaC__USIZE16@ FLAC__uint16;
typedef @FLaC__USIZE32@ FLAC__uint32;
typedef @FLaC__USIZE64@ FLAC__uint64;
#endif
 
typedef FLAC__uint8 FLAC__byte;
typedef float FLAC__real;
 
#endif
/contrib/media/updf/include/FLAC/seek_table.h
0,0 → 1,27
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2001 Josh Coalson
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
 
#ifndef FLAC__SEEK_TABLE_H
#define FLAC__SEEK_TABLE_H
 
#include "format.h"
 
FLAC__bool FLAC__seek_table_is_valid(const FLAC__StreamMetaData_SeekTable *seek_table);
 
#endif
/contrib/media/updf/include/FLAC/stream_decoder.h
0,0 → 1,164
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000,2001 Josh Coalson
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
 
#ifndef FLAC__STREAM_DECODER_H
#define FLAC__STREAM_DECODER_H
 
#include "format.h"
 
typedef enum {
FLAC__STREAM_DECODER_SEARCH_FOR_METADATA = 0,
FLAC__STREAM_DECODER_READ_METADATA,
FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC,
FLAC__STREAM_DECODER_READ_FRAME,
FLAC__STREAM_DECODER_END_OF_STREAM,
FLAC__STREAM_DECODER_ABORTED,
FLAC__STREAM_DECODER_UNPARSEABLE_STREAM,
FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR,
FLAC__STREAM_DECODER_ALREADY_INITIALIZED,
FLAC__STREAM_DECODER_INVALID_CALLBACK,
FLAC__STREAM_DECODER_UNINITIALIZED
} FLAC__StreamDecoderState;
extern const char *FLAC__StreamDecoderStateString[];
 
typedef enum {
FLAC__STREAM_DECODER_READ_CONTINUE,
FLAC__STREAM_DECODER_READ_END_OF_STREAM,
FLAC__STREAM_DECODER_READ_ABORT
} FLAC__StreamDecoderReadStatus;
extern const char *FLAC__StreamDecoderReadStatusString[];
 
typedef enum {
FLAC__STREAM_DECODER_WRITE_CONTINUE,
FLAC__STREAM_DECODER_WRITE_ABORT
} FLAC__StreamDecoderWriteStatus;
extern const char *FLAC__StreamDecoderWriteStatusString[];
 
typedef enum {
FLAC__STREAM_DECODER_ERROR_LOST_SYNC,
FLAC__STREAM_DECODER_ERROR_BAD_HEADER,
FLAC__STREAM_DECODER_ERROR_FRAME_CRC_MISMATCH
} FLAC__StreamDecoderErrorStatus;
extern const char *FLAC__StreamDecoderErrorStatusString[];
 
/***********************************************************************
*
* class FLAC__StreamDecoder
*
***********************************************************************/
 
struct FLAC__StreamDecoderProtected;
struct FLAC__StreamDecoderPrivate;
typedef struct {
struct FLAC__StreamDecoderProtected *protected;
struct FLAC__StreamDecoderPrivate *private;
} FLAC__StreamDecoder;
 
/***********************************************************************
*
* Class constructor/destructor
*
***********************************************************************/
 
/*
* Any parameters that are not set before FLAC__stream_decoder_init()
* will take on the defaults from the constructor, shown below.
* For more on what the parameters mean, see the documentation.
*
* (*read_callback)() (DEFAULT: NULL ) The callbacks are the only values that MUST be set before FLAC__stream_decoder_init()
* (*write_callback)() (DEFAULT: NULL )
* (*metadata_callback)() (DEFAULT: NULL )
* (*error_callback)() (DEFAULT: NULL )
* void* client_data (DEFAULT: NULL ) passed back through the callbacks
*/
FLAC__StreamDecoder *FLAC__stream_decoder_new();
void FLAC__stream_decoder_delete(FLAC__StreamDecoder *);
 
/***********************************************************************
*
* Public class method prototypes
*
***********************************************************************/
 
/*
* Various "set" methods. These may only be called when the decoder
* is in the state FLAC__STREAM_DECODER_UNINITIALIZED, i.e. after
* FLAC__stream_decoder_new() or FLAC__stream_decoder_finish(), but
* before FLAC__stream_decoder_init(). If this is the case they will
* return true, otherwise false.
*
* NOTE that these functions do not validate the values as many are
* interdependent. The FLAC__stream_decoder_init() function will do
* this, so make sure to pay attention to the state returned by
* FLAC__stream_decoder_init().
*
* Any parameters that are not set before FLAC__stream_decoder_init()
* will take on the defaults from the constructor. NOTE that
* FLAC__stream_decoder_flush() or FLAC__stream_decoder_reset() do
* NOT reset the values to the constructor defaults.
*/
FLAC__bool FLAC__stream_decoder_set_read_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderReadStatus (*value)(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data));
FLAC__bool FLAC__stream_decoder_set_write_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderWriteStatus (*value)(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *buffer[], void *client_data));
FLAC__bool FLAC__stream_decoder_set_metadata_callback(const FLAC__StreamDecoder *decoder, void (*value)(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetaData *metadata, void *client_data));
FLAC__bool FLAC__stream_decoder_set_error_callback(const FLAC__StreamDecoder *decoder, void (*value)(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data));
FLAC__bool FLAC__stream_decoder_set_client_data(const FLAC__StreamDecoder *decoder, void *value);
 
/*
* Methods to return the current stream decoder state, number
* of channels, channel assignment, bits-per-sample, sample
* rate in Hz, and blocksize in samples. All but the decoder
* state will only be valid after decoding has started.
*/
FLAC__StreamDecoderState FLAC__stream_decoder_get_state(const FLAC__StreamDecoder *decoder);
unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder);
FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment(const FLAC__StreamDecoder *decoder);
unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder);
unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder);
unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder);
 
/*
* Initialize the instance; should be called after construction and
* 'set' calls but before any of the 'process' calls. Will set and
* return the decoder state, which will be
* FLAC__STREAM_DECODER_SEARCH_FOR_METADATA if initialization
* succeeded.
*/
FLAC__StreamDecoderState FLAC__stream_decoder_init(FLAC__StreamDecoder *decoder);
 
/*
* Flush the decoding buffer, release resources, and return the decoder
* state to FLAC__STREAM_DECODER_UNINITIALIZED.
*/
void FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder);
 
/*
* state control methods
*/
FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder);
FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder);
 
/*
* Methods for decoding the data
*/
FLAC__bool FLAC__stream_decoder_process_whole_stream(FLAC__StreamDecoder *decoder);
FLAC__bool FLAC__stream_decoder_process_metadata(FLAC__StreamDecoder *decoder);
FLAC__bool FLAC__stream_decoder_process_one_frame(FLAC__StreamDecoder *decoder);
FLAC__bool FLAC__stream_decoder_process_remaining_frames(FLAC__StreamDecoder *decoder);
 
#endif
/contrib/media/updf/include/FLAC/stream_encoder.h
0,0 → 1,193
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000,2001 Josh Coalson
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
 
#ifndef FLAC__STREAM_ENCODER_H
#define FLAC__STREAM_ENCODER_H
 
#include "format.h"
 
typedef enum {
FLAC__STREAM_ENCODER_OK = 0,
FLAC__STREAM_ENCODER_INVALID_CALLBACK,
FLAC__STREAM_ENCODER_INVALID_NUMBER_OF_CHANNELS,
FLAC__STREAM_ENCODER_INVALID_BITS_PER_SAMPLE,
FLAC__STREAM_ENCODER_INVALID_SAMPLE_RATE,
FLAC__STREAM_ENCODER_INVALID_BLOCK_SIZE,
FLAC__STREAM_ENCODER_INVALID_QLP_COEFF_PRECISION,
FLAC__STREAM_ENCODER_MID_SIDE_CHANNELS_MISMATCH,
FLAC__STREAM_ENCODER_MID_SIDE_SAMPLE_SIZE_MISMATCH,
FLAC__STREAM_ENCODER_ILLEGAL_MID_SIDE_FORCE,
FLAC__STREAM_ENCODER_BLOCK_SIZE_TOO_SMALL_FOR_LPC_ORDER,
FLAC__STREAM_ENCODER_NOT_STREAMABLE,
FLAC__STREAM_ENCODER_FRAMING_ERROR,
FLAC__STREAM_ENCODER_INVALID_SEEK_TABLE,
FLAC__STREAM_ENCODER_FATAL_ERROR_WHILE_ENCODING,
FLAC__STREAM_ENCODER_FATAL_ERROR_WHILE_WRITING, /* that is, the write_callback returned an error */
FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR,
FLAC__STREAM_ENCODER_ALREADY_INITIALIZED,
FLAC__STREAM_ENCODER_UNINITIALIZED
} FLAC__StreamEncoderState;
extern const char *FLAC__StreamEncoderStateString[];
 
typedef enum {
FLAC__STREAM_ENCODER_WRITE_OK = 0,
FLAC__STREAM_ENCODER_WRITE_FATAL_ERROR
} FLAC__StreamEncoderWriteStatus;
extern const char *FLAC__StreamEncoderWriteStatusString[];
 
/***********************************************************************
*
* class FLAC__StreamEncoder
*
***********************************************************************/
 
struct FLAC__StreamEncoderProtected;
struct FLAC__StreamEncoderPrivate;
typedef struct {
struct FLAC__StreamEncoderProtected *protected;
struct FLAC__StreamEncoderPrivate *private;
} FLAC__StreamEncoder;
 
/***********************************************************************
*
* Class constructor/destructor
*
***********************************************************************/
 
/*
* Any parameters that are not set before FLAC__stream_encoder_init()
* will take on the defaults from the constructor, shown below.
* For more on what the parameters mean, see the documentation.
*
* FLAC__bool streamable_subset (DEFAULT: true ) true to limit encoder to generating a Subset stream, else false
* FLAC__bool do_mid_side_stereo (DEFAULT: false) if true then channels must be 2
* FLAC__bool loose_mid_side_stereo (DEFAULT: false) if true then do_mid_side_stereo must be true
* unsigned channels (DEFAULT: 2 ) must be <= FLAC__MAX_CHANNELS
* unsigned bits_per_sample (DEFAULT: 16 ) do not give the encoder wider data than what you specify here or bad things will happen!
* unsigned sample_rate (DEFAULT: 44100)
* unsigned blocksize (DEFAULT: 1152 )
* unsigned max_lpc_order (DEFAULT: 0 ) 0 => encoder will not try general LPC, only fixed predictors; must be <= FLAC__MAX_LPC_ORDER
* unsigned qlp_coeff_precision (DEFAULT: 0 ) >= FLAC__MIN_QLP_COEFF_PRECISION, or 0 to let encoder select based on blocksize;
* qlp_coeff_precision+bits_per_sample must be < 32
* FLAC__bool do_qlp_coeff_prec_search (DEFAULT: false) false => use qlp_coeff_precision, true => search around qlp_coeff_precision, take best
* FLAC__bool do_escape_coding (DEFAULT: false) true => search for escape codes in the entropy coding stage for slightly better compression
* FLAC__bool do_exhaustive_model_search (DEFAULT: false) false => use estimated bits per residual for scoring, true => generate all, take shortest
* unsigned min_residual_partition_order (DEFAULT: 0 ) 0 => estimate Rice parameter based on residual variance; >0 => partition residual, use parameter
* unsigned max_residual_partition_order (DEFAULT: 0 ) for each based on mean; min_ and max_ specify the min and max Rice partition order
* unsigned rice_parameter_search_dist (DEFAULT: 0 ) 0 => try only calc'd parameter k; else try all [k-dist..k+dist] parameters, use best
* FLAC__uint64 total_samples_estimate (DEFAULT: 0 ) may be 0 if unknown. acts as a placeholder in the STREAMINFO until the actual total is calculated
* const FLAC__StreamMetaData_SeekTable *seek_table (DEFAULT: NULL) optional seek_table to prepend, NULL => no seek table
* unsigned padding (DEFAULT: 0 ) size of PADDING block to add (goes after seek table); 0 => do not add a PADDING block
* FLAC__bool last_metadata_is_last (DEFAULT: true ) the value the encoder will use for the 'is_last' flag of the last metadata block it writes; set
* this to false if you will be adding more metadata blocks before the audio frames, else true
* (*write_callback)() (DEFAULT: NULL ) The callbacks are the only values that MUST be set before FLAC__stream_encoder_init()
* (*metadata_callback)() (DEFAULT: NULL )
* void* client_data (DEFAULT: NULL ) passed back through the callbacks
*/
FLAC__StreamEncoder *FLAC__stream_encoder_new();
void FLAC__stream_encoder_delete(FLAC__StreamEncoder *encoder);
 
/***********************************************************************
*
* Public class method prototypes
*
***********************************************************************/
 
/*
* Various "set" methods. These may only be called when the encoder
* is in the state FLAC__STREAM_ENCODER_UNINITIALIZED, i.e. after
* FLAC__stream_encoder_new() or FLAC__stream_encoder_finish(), but
* before FLAC__stream_encoder_init(). If this is the case they will
* return true, otherwise false.
*
* NOTE that these functions do not validate the values as many are
* interdependent. The FLAC__stream_encoder_init() function will do
* this, so make sure to pay attention to the state returned by
* FLAC__stream_encoder_init().
*
* Any parameters that are not set before FLAC__stream_encoder_init()
* will take on the defaults from the constructor. NOTE that
* FLAC__stream_encoder_finish() does NOT reset the values to the
* constructor defaults.
*/
FLAC__bool FLAC__stream_encoder_set_streamable_subset(const FLAC__StreamEncoder *encoder, FLAC__bool value);
FLAC__bool FLAC__stream_encoder_set_do_mid_side_stereo(const FLAC__StreamEncoder *encoder, FLAC__bool value);
FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(const FLAC__StreamEncoder *encoder, FLAC__bool value);
FLAC__bool FLAC__stream_encoder_set_channels(const FLAC__StreamEncoder *encoder, unsigned value);
FLAC__bool FLAC__stream_encoder_set_bits_per_sample(const FLAC__StreamEncoder *encoder, unsigned value);
FLAC__bool FLAC__stream_encoder_set_sample_rate(const FLAC__StreamEncoder *encoder, unsigned value);
FLAC__bool FLAC__stream_encoder_set_blocksize(const FLAC__StreamEncoder *encoder, unsigned value);
FLAC__bool FLAC__stream_encoder_set_max_lpc_order(const FLAC__StreamEncoder *encoder, unsigned value);
FLAC__bool FLAC__stream_encoder_set_qlp_coeff_precision(const FLAC__StreamEncoder *encoder, unsigned value);
FLAC__bool FLAC__stream_encoder_set_do_qlp_coeff_prec_search(const FLAC__StreamEncoder *encoder, FLAC__bool value);
FLAC__bool FLAC__stream_encoder_set_do_escape_coding(const FLAC__StreamEncoder *encoder, FLAC__bool value);
FLAC__bool FLAC__stream_encoder_set_do_exhaustive_model_search(const FLAC__StreamEncoder *encoder, FLAC__bool value);
FLAC__bool FLAC__stream_encoder_set_min_residual_partition_order(const FLAC__StreamEncoder *encoder, unsigned value);
FLAC__bool FLAC__stream_encoder_set_max_residual_partition_order(const FLAC__StreamEncoder *encoder, unsigned value);
FLAC__bool FLAC__stream_encoder_set_rice_parameter_search_dist(const FLAC__StreamEncoder *encoder, unsigned value);
FLAC__bool FLAC__stream_encoder_set_total_samples_estimate(const FLAC__StreamEncoder *encoder, FLAC__uint64 value);
FLAC__bool FLAC__stream_encoder_set_seek_table(const FLAC__StreamEncoder *encoder, const FLAC__StreamMetaData_SeekTable *value);
FLAC__bool FLAC__stream_encoder_set_padding(const FLAC__StreamEncoder *encoder, unsigned value);
FLAC__bool FLAC__stream_encoder_set_last_metadata_is_last(const FLAC__StreamEncoder *encoder, FLAC__bool value);
FLAC__bool FLAC__stream_encoder_set_write_callback(const FLAC__StreamEncoder *encoder, FLAC__StreamEncoderWriteStatus (*value)(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data));
FLAC__bool FLAC__stream_encoder_set_metadata_callback(const FLAC__StreamEncoder *encoder, void (*value)(const FLAC__StreamEncoder *encoder, const FLAC__StreamMetaData *metadata, void *client_data));
FLAC__bool FLAC__stream_encoder_set_client_data(const FLAC__StreamEncoder *encoder, void *value);
 
/*
* Various "get" methods
*/
FLAC__StreamEncoderState FLAC__stream_encoder_get_state(const FLAC__StreamEncoder *encoder);
FLAC__bool FLAC__stream_encoder_get_streamable_subset(const FLAC__StreamEncoder *encoder);
FLAC__bool FLAC__stream_encoder_get_do_mid_side_stereo(const FLAC__StreamEncoder *encoder);
FLAC__bool FLAC__stream_encoder_get_loose_mid_side_stereo(const FLAC__StreamEncoder *encoder);
unsigned FLAC__stream_encoder_get_channels(const FLAC__StreamEncoder *encoder);
unsigned FLAC__stream_encoder_get_bits_per_sample(const FLAC__StreamEncoder *encoder);
unsigned FLAC__stream_encoder_get_sample_rate(const FLAC__StreamEncoder *encoder);
unsigned FLAC__stream_encoder_get_blocksize(const FLAC__StreamEncoder *encoder);
unsigned FLAC__stream_encoder_get_max_lpc_order(const FLAC__StreamEncoder *encoder);
unsigned FLAC__stream_encoder_get_qlp_coeff_precision(const FLAC__StreamEncoder *encoder);
FLAC__bool FLAC__stream_encoder_get_do_qlp_coeff_prec_search(const FLAC__StreamEncoder *encoder);
FLAC__bool FLAC__stream_encoder_get_do_escape_coding(const FLAC__StreamEncoder *encoder);
FLAC__bool FLAC__stream_encoder_get_do_exhaustive_model_search(const FLAC__StreamEncoder *encoder);
unsigned FLAC__stream_encoder_get_min_residual_partition_order(const FLAC__StreamEncoder *encoder);
unsigned FLAC__stream_encoder_get_max_residual_partition_order(const FLAC__StreamEncoder *encoder);
unsigned FLAC__stream_encoder_get_rice_parameter_search_dist(const FLAC__StreamEncoder *encoder);
 
/*
* Initialize the instance; should be called after construction and
* 'set' calls but before any of the 'process' calls. Will set and
* return the encoder state, which will be FLAC__STREAM_ENCODER_OK
* if initialization succeeded.
*/
FLAC__StreamEncoderState FLAC__stream_encoder_init(FLAC__StreamEncoder *encoder);
 
/*
* Flush the encoding buffer, release resources, and return the encoder
* state to FLAC__STREAM_ENCODER_UNINITIALIZED. Note that this can
* generate one or more write_callback()s before returning.
*/
void FLAC__stream_encoder_finish(FLAC__StreamEncoder *encoder);
 
/*
* Methods for encoding the data
*/
FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 *buf[], unsigned samples);
FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder, const FLAC__int32 buf[], unsigned samples);
 
#endif
/contrib/media/updf/include/FLAC/utility.h
0,0 → 1,27
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2001 Josh Coalson
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
 
#ifndef FLAC__UTILITY_H
#define FLAC__UTILITY_H
 
#include "format.h"
 
FLAC__bool FLAC__utility_get_streaminfo(const char *filename, FLAC__StreamMetaData_StreamInfo *streaminfo);
 
#endif
/contrib/media/updf/include/GPL_stuff.h
0,0 → 1,23
#ifndef __GPL_stuff_h__
#define __GPL_stuff_h__
 
#define GPL_base_text \
"Yacas is Free Software--Free as in Freedom--so you can redistribute Yacas or\n" \
"modify it under certain conditions. Yacas comes with ABSOLUTELY NO WARRANTY.\n" \
"See the GNU General Public License (GPL) for the full conditions.\n"
 
#define Yacas_Web_info \
"See http://yacas.sf.net for more information and documentation on Yacas.\n"
 
#define Yacas_help_info \
"Type ?license or ?licence to see the GPL; type ?warranty for warranty info.\n"
 
// This is the full text for systems where the online help (?blah) is available
#define GPL_blurb GPL_base_text Yacas_help_info Yacas_Web_info "\n"
 
// This is for systems where online help (?blah) is normally not available
#define GPL_blurb_nohelp GPL_base_text Yacas_Web_info "\n"
 
 
 
#endif
/contrib/media/updf/include/SDL/SDL.h
0,0 → 1,97
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* Main include header for the SDL library */
 
#ifndef _SDL_H
#define _SDL_H
 
#include "SDL_main.h"
#include "SDL_types.h"
#include "SDL_getenv.h"
#include "SDL_error.h"
#include "SDL_rwops.h"
#include "SDL_timer.h"
#include "SDL_audio.h"
#include "SDL_cdrom.h"
#include "SDL_joystick.h"
#include "SDL_events.h"
#include "SDL_video.h"
#include "SDL_byteorder.h"
#include "SDL_version.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* As of version 0.5, SDL is loaded dynamically into the application */
 
/* These are the flags which may be passed to SDL_Init() -- you should
specify the subsystems which you will be using in your application.
*/
#define SDL_INIT_TIMER 0x00000001
#define SDL_INIT_AUDIO 0x00000010
#define SDL_INIT_VIDEO 0x00000020
#define SDL_INIT_CDROM 0x00000100
#define SDL_INIT_JOYSTICK 0x00000200
#define SDL_INIT_NOPARACHUTE 0x00100000 /* Don't catch fatal signals */
#define SDL_INIT_EVENTTHREAD 0x01000000 /* Not supported on all OS's */
#define SDL_INIT_EVERYTHING 0x0000FFFF
 
/* This function loads the SDL dynamically linked library and initializes
* the subsystems specified by 'flags' (and those satisfying dependencies)
* Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
* signal handlers for some commonly ignored fatal signals (like SIGSEGV)
*/
extern DECLSPEC int SDL_Init(Uint32 flags);
 
/* This function initializes specific SDL subsystems */
extern DECLSPEC int SDL_InitSubSystem(Uint32 flags);
 
/* This function cleans up specific SDL subsystems */
extern DECLSPEC void SDL_QuitSubSystem(Uint32 flags);
 
/* This function returns mask of the specified subsystems which have
been initialized.
If 'flags' is 0, it returns a mask of all initialized subsystems.
*/
extern DECLSPEC Uint32 SDL_WasInit(Uint32 flags);
 
/* This function cleans up all initialized subsystems and unloads the
* dynamically linked library. You should call it upon all exit conditions.
*/
extern DECLSPEC void SDL_Quit(void);
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_H */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_active.h
0,0 → 1,60
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_active.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* Include file for SDL application focus event handling */
 
#ifndef _SDL_active_h
#define _SDL_active_h
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* The available application states */
#define SDL_APPMOUSEFOCUS 0x01 /* The app has mouse coverage */
#define SDL_APPINPUTFOCUS 0x02 /* The app has input focus */
#define SDL_APPACTIVE 0x04 /* The application is active */
 
/* Function prototypes */
/*
* This function returns the current state of the application, which is a
* bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
* SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
* see your application, otherwise it has been iconified or disabled.
*/
extern DECLSPEC Uint8 SDL_GetAppState(void);
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_active_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_anim.h
0,0 → 1,60
/*
SDL_anim: an animation library for SDL
Copyright (C) 2001, 2002 Michael Leonhard
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Michael Leonhard
mike@tamale.net
*/
 
#ifndef _SDLanim_h
#define _SDLanim_h
 
#include "SDL.h"
#include "begin_code.h"
 
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
struct SDL_Animation;
typedef struct SDL_Animation {
SDL_Surface *surface;
int frames, w, h;
Uint32 duration;
} SDL_Animation;
 
extern DECLSPEC struct SDL_Animation *Anim_Load( const char *file );
extern DECLSPEC void Anim_Free( SDL_Animation *anim );
extern DECLSPEC int Anim_GetFrameNum( SDL_Animation *anim, Uint32 start, Uint32 now );
extern DECLSPEC int Anim_BlitFrame( SDL_Animation *anim, Uint32 start, Uint32 now, SDL_Surface *dest, SDL_Rect *dr );
extern DECLSPEC void Anim_GetFrameRect( SDL_Animation *anim, int frame, SDL_Rect *rect );
extern DECLSPEC int Anim_BlitFrameNum( SDL_Animation *anim, int frame, SDL_Surface *dest, SDL_Rect *dr );
extern DECLSPEC int Anim_DisplayFormat( SDL_Animation *anim );
/* We'll use SDL for reporting errors */
#define Anim_SetError SDL_SetError
#define Anim_GetError SDL_GetError
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
};
#endif
 
#include "SDL/close_code.h"
 
#endif /* _SDL_anim_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_audio.h
0,0 → 1,260
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_audio.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* Access to the raw audio mixing buffer for the SDL library */
 
#ifndef _SDL_audio_h
#define _SDL_audio_h
 
#include <stdio.h>
 
#include "SDL_main.h"
#include "SDL_types.h"
#include "SDL_error.h"
#include "SDL_rwops.h"
#include "SDL_byteorder.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* The calculated values in this structure are calculated by SDL_OpenAudio() */
typedef struct {
int freq; /* DSP frequency -- samples per second */
Uint16 format; /* Audio data format */
Uint8 channels; /* Number of channels: 1 mono, 2 stereo */
Uint8 silence; /* Audio buffer silence value (calculated) */
Uint16 samples; /* Audio buffer size in samples */
Uint16 padding; /* Necessary for some compile environments */
Uint32 size; /* Audio buffer size in bytes (calculated) */
/* This function is called when the audio device needs more data.
'stream' is a pointer to the audio data buffer
'len' is the length of that buffer in bytes.
Once the callback returns, the buffer will no longer be valid.
Stereo samples are stored in a LRLRLR ordering.
*/
void (*callback)(void *userdata, Uint8 *stream, int len);
void *userdata;
} SDL_AudioSpec;
 
/* Audio format flags (defaults to LSB byte order) */
#define AUDIO_U8 0x0008 /* Unsigned 8-bit samples */
#define AUDIO_S8 0x8008 /* Signed 8-bit samples */
#define AUDIO_U16LSB 0x0010 /* Unsigned 16-bit samples */
#define AUDIO_S16LSB 0x8010 /* Signed 16-bit samples */
#define AUDIO_U16MSB 0x1010 /* As above, but big-endian byte order */
#define AUDIO_S16MSB 0x9010 /* As above, but big-endian byte order */
#define AUDIO_U16 AUDIO_U16LSB
#define AUDIO_S16 AUDIO_S16LSB
 
/* Native audio byte ordering */
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define AUDIO_U16SYS AUDIO_U16LSB
#define AUDIO_S16SYS AUDIO_S16LSB
#else
#define AUDIO_U16SYS AUDIO_U16MSB
#define AUDIO_S16SYS AUDIO_S16MSB
#endif
 
 
/* A structure to hold a set of audio conversion filters and buffers */
typedef struct SDL_AudioCVT {
int needed; /* Set to 1 if conversion possible */
Uint16 src_format; /* Source audio format */
Uint16 dst_format; /* Target audio format */
double rate_incr; /* Rate conversion increment */
Uint8 *buf; /* Buffer to hold entire audio data */
int len; /* Length of original audio buffer */
int len_cvt; /* Length of converted audio buffer */
int len_mult; /* buffer must be len*len_mult big */
double len_ratio; /* Given len, final size is len*len_ratio */
void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
int filter_index; /* Current audio conversion function */
} SDL_AudioCVT;
 
 
/* Function prototypes */
 
/* These functions are used internally, and should not be used unless you
* have a specific need to specify the audio driver you want to use.
* You should normally use SDL_Init() or SDL_InitSubSystem().
*/
extern DECLSPEC int SDL_AudioInit(const char *driver_name);
extern DECLSPEC void SDL_AudioQuit(void);
 
/* This function fills the given character buffer with the name of the
* current audio driver, and returns a pointer to it if the audio driver has
* been initialized. It returns NULL if no driver has been initialized.
*/
extern DECLSPEC char *SDL_AudioDriverName(char *namebuf, int maxlen);
 
/*
* This function opens the audio device with the desired parameters, and
* returns 0 if successful, placing the actual hardware parameters in the
* structure pointed to by 'obtained'. If 'obtained' is NULL, the audio
* data passed to the callback function will be guaranteed to be in the
* requested format, and will be automatically converted to the hardware
* audio format if necessary. This function returns -1 if it failed
* to open the audio device, or couldn't set up the audio thread.
*
* When filling in the desired audio spec structure,
* 'desired->freq' should be the desired audio frequency in samples-per-second.
* 'desired->format' should be the desired audio format.
* 'desired->samples' is the desired size of the audio buffer, in samples.
* This number should be a power of two, and may be adjusted by the audio
* driver to a value more suitable for the hardware. Good values seem to
* range between 512 and 8096 inclusive, depending on the application and
* CPU speed. Smaller values yield faster response time, but can lead
* to underflow if the application is doing heavy processing and cannot
* fill the audio buffer in time. A stereo sample consists of both right
* and left channels in LR ordering.
* Note that the number of samples is directly related to time by the
* following formula: ms = (samples*1000)/freq
* 'desired->size' is the size in bytes of the audio buffer, and is
* calculated by SDL_OpenAudio().
* 'desired->silence' is the value used to set the buffer to silence,
* and is calculated by SDL_OpenAudio().
* 'desired->callback' should be set to a function that will be called
* when the audio device is ready for more data. It is passed a pointer
* to the audio buffer, and the length in bytes of the audio buffer.
* This function usually runs in a separate thread, and so you should
* protect data structures that it accesses by calling SDL_LockAudio()
* and SDL_UnlockAudio() in your code.
* 'desired->userdata' is passed as the first parameter to your callback
* function.
*
* The audio device starts out playing silence when it's opened, and should
* be enabled for playing by calling SDL_PauseAudio(0) when you are ready
* for your audio callback function to be called. Since the audio driver
* may modify the requested size of the audio buffer, you should allocate
* any local mixing buffers after you open the audio device.
*/
extern DECLSPEC int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);
 
/*
* Get the current audio state:
*/
typedef enum {
SDL_AUDIO_STOPPED = 0,
SDL_AUDIO_PLAYING,
SDL_AUDIO_PAUSED
} SDL_audiostatus;
extern DECLSPEC SDL_audiostatus SDL_GetAudioStatus(void);
 
/*
* This function pauses and unpauses the audio callback processing.
* It should be called with a parameter of 0 after opening the audio
* device to start playing sound. This is so you can safely initialize
* data for your callback function after opening the audio device.
* Silence will be written to the audio device during the pause.
*/
extern DECLSPEC void SDL_PauseAudio(int pause_on);
 
/*
* This function loads a WAVE from the data source, automatically freeing
* that source if 'freesrc' is non-zero. For example, to load a WAVE file,
* you could do:
* SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
*
* If this function succeeds, it returns the given SDL_AudioSpec,
* filled with the audio data format of the wave data, and sets
* 'audio_buf' to a malloc()'d buffer containing the audio data,
* and sets 'audio_len' to the length of that audio buffer, in bytes.
* You need to free the audio buffer with SDL_FreeWAV() when you are
* done with it.
*
* This function returns NULL and sets the SDL error message if the
* wave file cannot be opened, uses an unknown data format, or is
* corrupt. Currently raw and MS-ADPCM WAVE files are supported.
*/
extern DECLSPEC SDL_AudioSpec *SDL_LoadWAV_RW(SDL_RWops *src, int freesrc,
SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
 
/* Compatibility convenience function -- loads a WAV from a file */
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
 
/*
* This function frees data previously allocated with SDL_LoadWAV_RW()
*/
extern DECLSPEC void SDL_FreeWAV(Uint8 *audio_buf);
 
/*
* This function takes a source format and rate and a destination format
* and rate, and initializes the 'cvt' structure with information needed
* by SDL_ConvertAudio() to convert a buffer of audio data from one format
* to the other.
* This function returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
Uint16 src_format, Uint8 src_channels, int src_rate,
Uint16 dst_format, Uint8 dst_channels, int dst_rate);
 
/* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
* created an audio buffer cvt->buf, and filled it with cvt->len bytes of
* audio data in the source format, this function will convert it in-place
* to the desired format.
* The data conversion may expand the size of the audio data, so the buffer
* cvt->buf should be allocated after the cvt structure is initialized by
* SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long.
*/
extern DECLSPEC int SDL_ConvertAudio(SDL_AudioCVT *cvt);
 
/*
* This takes two audio buffers of the playing audio format and mixes
* them, performing addition, volume adjustment, and overflow clipping.
* The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
* for full audio volume. Note this does not change hardware volume.
* This is provided for convenience -- you can mix your own audio data.
*/
#define SDL_MIX_MAXVOLUME 128
extern DECLSPEC void SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume);
 
/*
* The lock manipulated by these functions protects the callback function.
* During a LockAudio/UnlockAudio pair, you can be guaranteed that the
* callback function is not running. Do not call these from the callback
* function or you will cause deadlock.
*/
extern DECLSPEC void SDL_LockAudio(void);
extern DECLSPEC void SDL_UnlockAudio(void);
 
/*
* This function shuts down audio processing and closes the audio device.
*/
extern DECLSPEC void SDL_CloseAudio(void);
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_audio_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_bdf.h
0,0 → 1,120
/*
SDL_bdf - renders BDF fonts
Copyright (C) 2002-2003 Andre de Leiradella
 
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.1 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
 
For information about SDL_bdf contact leiradella@bigfoot.com
 
Version 1.0: first public release.
Version 1.1: removed SDL dependecies, now SDL_bdf can be used with any graphics
library.
Version 1.2: fixed BDF_SizeH and BDF_SizeEntitiesH to return the correct sizes.
*/
#ifndef __SDL_bdf_h__
#define __SDL_bdf_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Error codes. */
 
/* No error. */
#define BDF_OK 0
/* Not enough memory reading BDF font. */
#define BDF_MEMORYERROR 1
/* Error reading BDF font. */
#define BDF_READERROR 2
/* Can only handle BDF font varsions up to 2.2. */
#define BDF_WRONGVERSION 3
/* Can only handle horizontal BDF fonts. */
#define BDF_CANNOTHANDLEVERTICAL 4
/* Character found past end of BDF font. */
#define BDF_TOOMANYCHARACTERS 5
/* BDF font is missing characters. */
#define BDF_TOOFEWCHARACTERS 6
/* Error parsing BDF font. */
#define BDF_PARSEERROR 7
 
/* A BDF character. */
typedef struct {
char *name;
int code;
int dwx0, dwy0;
int dwx1, dwy1;
int bbw, bbh, bbxoff0x, bbyoff0y, wbytes;
unsigned char *bits;
} BDF_Char;
 
/* A BDF font. */
typedef struct {
int metricsSet, numChars;
BDF_Char *chars;
BDF_Char *code[256];
} BDF_Font;
 
/*
Function to put a pixel on the surface, it receives a pointer to the surface
(whatever format it may be), the x and y coordinates and the color.
*/
typedef void (*BDF_PutPixel)(void *, int, int, unsigned int);
 
/*
Function to read a byte, it receives an user defined void pointer and must
return a value in the range [0..255] or -1 to indicate EOF.
*/
typedef int (*BDF_ReadByte)(void *);
 
/*
Opens a BDF font, it receives the function that will produce the stream of
bytes, the user defined void pointer that will be passed to getbyte and a
pointer to an int that will receive the error code. Returns the BDF font.
*/
extern BDF_Font *BDF_OpenFont(BDF_ReadByte getbyte, void *info, int *error);
/*
Closes the font and frees all associated memory.
*/
extern void BDF_CloseFont(BDF_Font *font);
/*
Determines the size of the horizontal text, returns the width and height of the
smallest rectangle that can acomodate the rendered text and the start position
in x0 and y0 on where the text must be rendered to exactly fit the rectangle.
This is because the render functions take the y parameter as the baseline of
the text to allow different fonts (e.g. normal and italic) to be mixed in the
same line. It handles NULL pointers for pieces of information you don't want.
*/
extern void BDF_SizeH(BDF_Font *font, char *text, int *x0, int *y0, int *width, int *height);
/*
Same as above but accepts entities in the form &...;
*/
extern void BDF_SizeEntitiesH(BDF_Font *font, char *text, int *x0, int *y0, int *width, int *height);
/*
Draws the text at the given surface starting at position (x, y). It calls
putpixel with the surface, coordinates and color to draw the pixel (doesn't
clip). Returns the next x coordinate to continue to render more text. Only
accepts characters in the range [0..255].
*/
extern int BDF_DrawH(void *surface, BDF_PutPixel putpixel, BDF_Font *font, char *text, int x, int y, unsigned int color);
/*
Same as above but accepts entities in the form &...;
*/
extern int BDF_DrawEntitiesH(void *, BDF_PutPixel, BDF_Font *, char *, int, int, unsigned int);
 
#ifdef __cplusplus
};
#endif
 
#endif
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_byteorder.h
0,0 → 1,52
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_byteorder.h,v 1.3 2001/05/10 20:25:51 hercules Exp $";
#endif
 
/* Macros for determining the byte-order of this platform */
 
#ifndef _SDL_byteorder_h
#define _SDL_byteorder_h
 
/* The two types of endianness */
#define SDL_LIL_ENDIAN 1234
#define SDL_BIG_ENDIAN 4321
 
/* Pardon the mess, I'm trying to determine the endianness of this host.
I'm doing it by preprocessor defines rather than some sort of configure
script so that application code can use this too. The "right" way would
be to dynamically generate this file on install, but that's a lot of work.
*/
#if defined(__i386__) || defined(__ia64__) || defined(WIN32UNDEFINED) || \
(defined(__alpha__) || defined(__alpha)) || \
defined(__arm__) || \
(defined(__mips__) && defined(__MIPSEL__)) || \
defined(__LITTLE_ENDIAN__)
#define SDL_BYTEORDER SDL_LIL_ENDIAN
#else
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#endif
 
#endif /* _SDL_byteorder_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_byteorder.h.BAK
0,0 → 1,52
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_byteorder.h,v 1.3 2001/05/10 20:25:51 hercules Exp $";
#endif
 
/* Macros for determining the byte-order of this platform */
 
#ifndef _SDL_byteorder_h
#define _SDL_byteorder_h
 
/* The two types of endianness */
#define SDL_LIL_ENDIAN 1234
#define SDL_BIG_ENDIAN 4321
 
/* Pardon the mess, I'm trying to determine the endianness of this host.
I'm doing it by preprocessor defines rather than some sort of configure
script so that application code can use this too. The "right" way would
be to dynamically generate this file on install, but that's a lot of work.
*/
#if defined(__i386__) || defined(__ia64__) || defined(WIN32) || \
(defined(__alpha__) || defined(__alpha)) || \
defined(__arm__) || \
(defined(__mips__) && defined(__MIPSEL__)) || \
defined(__LITTLE_ENDIAN__)
#define SDL_BYTEORDER SDL_LIL_ENDIAN
#else
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#endif
 
#endif /* _SDL_byteorder_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_cdrom.h
0,0 → 1,175
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_cdrom.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* This is the CD-audio control API for Simple DirectMedia Layer */
 
#ifndef _SDL_cdrom_h
#define _SDL_cdrom_h
 
#include "SDL_types.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* In order to use these functions, SDL_Init() must have been called
with the SDL_INIT_CDROM flag. This causes SDL to scan the system
for CD-ROM drives, and load appropriate drivers.
*/
 
/* The maximum number of CD-ROM tracks on a disk */
#define SDL_MAX_TRACKS 99
 
/* The types of CD-ROM track possible */
#define SDL_AUDIO_TRACK 0x00
#define SDL_DATA_TRACK 0x04
 
/* The possible states which a CD-ROM drive can be in. */
typedef enum {
CD_TRAYEMPTY,
CD_STOPPED,
CD_PLAYING,
CD_PAUSED,
CD_ERROR = -1
} CDstatus;
 
/* Given a status, returns true if there's a disk in the drive */
#define CD_INDRIVE(status) ((int)status > 0)
 
typedef struct {
Uint8 id; /* Track number */
Uint8 type; /* Data or audio track */
Uint16 unused;
Uint32 length; /* Length, in frames, of this track */
Uint32 offset; /* Offset, in frames, from start of disk */
} SDL_CDtrack;
 
/* This structure is only current as of the last call to SDL_CDStatus() */
typedef struct SDL_CD {
int id; /* Private drive identifier */
CDstatus status; /* Current drive status */
 
/* The rest of this structure is only valid if there's a CD in drive */
int numtracks; /* Number of tracks on disk */
int cur_track; /* Current track position */
int cur_frame; /* Current frame offset within current track */
SDL_CDtrack track[SDL_MAX_TRACKS+1];
} SDL_CD;
 
/* Conversion functions from frames to Minute/Second/Frames and vice versa */
#define CD_FPS 75
#define FRAMES_TO_MSF(f, M,S,F) { \
int value = f; \
*(F) = value%CD_FPS; \
value /= CD_FPS; \
*(S) = value%60; \
value /= 60; \
*(M) = value; \
}
#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
 
/* CD-audio API functions: */
 
/* Returns the number of CD-ROM drives on the system, or -1 if
SDL_Init() has not been called with the SDL_INIT_CDROM flag.
*/
extern DECLSPEC int SDL_CDNumDrives(void);
 
/* Returns a human-readable, system-dependent identifier for the CD-ROM.
Example:
"/dev/cdrom"
"E:"
"/dev/disk/ide/1/master"
*/
extern DECLSPEC const char * SDL_CDName(int drive);
 
/* Opens a CD-ROM drive for access. It returns a drive handle on success,
or NULL if the drive was invalid or busy. This newly opened CD-ROM
becomes the default CD used when other CD functions are passed a NULL
CD-ROM handle.
Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.
*/
extern DECLSPEC SDL_CD * SDL_CDOpen(int drive);
 
/* This function returns the current status of the given drive.
If the drive has a CD in it, the table of contents of the CD and current
play position of the CD will be stored in the SDL_CD structure.
*/
extern DECLSPEC CDstatus SDL_CDStatus(SDL_CD *cdrom);
 
/* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
until the end of the CD. This function will skip data tracks.
This function should only be called after calling SDL_CDStatus() to
get track information about the CD.
For example:
// Play entire CD:
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
// Play last track:
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
}
// Play first and second track and 10 seconds of third track:
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
 
This function returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDL_CDPlayTracks(SDL_CD *cdrom,
int start_track, int start_frame, int ntracks, int nframes);
 
/* Play the given CD starting at 'start' frame for 'length' frames.
It returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDL_CDPlay(SDL_CD *cdrom, int start, int length);
 
/* Pause play -- returns 0, or -1 on error */
extern DECLSPEC int SDL_CDPause(SDL_CD *cdrom);
 
/* Resume play -- returns 0, or -1 on error */
extern DECLSPEC int SDL_CDResume(SDL_CD *cdrom);
 
/* Stop play -- returns 0, or -1 on error */
extern DECLSPEC int SDL_CDStop(SDL_CD *cdrom);
 
/* Eject CD-ROM -- returns 0, or -1 on error */
extern DECLSPEC int SDL_CDEject(SDL_CD *cdrom);
 
/* Closes the handle for the CD-ROM drive */
extern DECLSPEC void SDL_CDClose(SDL_CD *cdrom);
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_video_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_copying.h
0,0 → 1,27
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_copying.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_cpuinfo.h
0,0 → 1,78
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2004 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@libsdl.org
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_cpuinfo.h,v 1.5 2004/01/24 05:47:18 slouken Exp $";
#endif
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* CPU feature detection for SDL */
 
#ifndef _SDL_cpuinfo_h
#define _SDL_cpuinfo_h
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* This function returns true if the CPU has the RDTSC instruction
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC();
 
/* This function returns true if the CPU has MMX features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX();
 
/* This function returns true if the CPU has MMX Ext. features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt();
 
/* This function returns true if the CPU has 3DNow features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow();
 
/* This function returns true if the CPU has 3DNow! Ext. features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt();
 
/* This function returns true if the CPU has SSE features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE();
 
/* This function returns true if the CPU has SSE2 features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2();
 
/* This function returns true if the CPU has AltiVec features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec();
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_cpuinfo_h */
/contrib/media/updf/include/SDL/SDL_draw.h
0,0 → 1,114
/*!
\file SDL_draw.h
\author Mario Palomo Torrero <mpalomo@ihman.com>
\author Jose M. de la Huerga Fernández
\author Pepe González Mora
\date 05-2002
 
Drawing primitives for SDL. Main header file.
 
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 Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef SDL_DRAW_H
#define SDL_DRAW_H
 
#include "SDL.h"
#include "begin_code.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
 
extern DECLSPEC void Draw_Init(void);
 
extern DECLSPEC
void (*Draw_Pixel)(SDL_Surface *super,
Sint16 x, Sint16 y, Uint32 color);
 
extern DECLSPEC
void (*Draw_Line)(SDL_Surface *super,
Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2,
Uint32 color);
 
extern DECLSPEC
void (*Draw_Circle)(SDL_Surface *super,
Sint16 x0, Sint16 y0, Uint16 r,
Uint32 color);
 
extern DECLSPEC
void (*Draw_FillCircle)(SDL_Surface *super,
Sint16 x0, Sint16 y0, Uint16 r,
Uint32 color);
 
extern DECLSPEC
void (*Draw_HLine)(SDL_Surface *super,
Sint16 x0,Sint16 y0, Sint16 x1,
Uint32 color);
 
extern DECLSPEC
void (*Draw_VLine)(SDL_Surface *super,
Sint16 x0,Sint16 y0, Sint16 y1,
Uint32 color);
 
extern DECLSPEC
void (*Draw_Rect)(SDL_Surface *super,
Sint16 x,Sint16 y, Uint16 w,Uint16 h,
Uint32 color);
 
/* We wrap SDL_FillRect with the SDL_draw name convention */
#define Draw_FillRect(SUPER, X, Y, W, H, COLOR) \
do { \
SDL_Rect r = {(X), (Y), (W), (H)}; \
SDL_FillRect((SUPER), &r, (COLOR)); \
}while(0)
 
 
extern DECLSPEC
void (*Draw_Ellipse)(SDL_Surface *super,
Sint16 x0, Sint16 y0,
Uint16 Xradius, Uint16 Yradius,
Uint32 color);
 
extern DECLSPEC
void (*Draw_FillEllipse)(SDL_Surface *super,
Sint16 x0, Sint16 y0,
Uint16 Xradius, Uint16 Yradius,
Uint32 color);
 
extern DECLSPEC
void (*Draw_Round)(SDL_Surface *super,
Sint16 x0,Sint16 y0, Uint16 w,Uint16 h,
Uint16 corner, Uint32 color);
 
extern DECLSPEC
void (*Draw_FillRound)(SDL_Surface *super,
Sint16 x0,Sint16 y0, Uint16 w,Uint16 h,
Uint16 corner, Uint32 color);
 
 
/* We'll use SDL for reporting errors */
#define Draw_SetError SDL_SetError
#define Draw_GetError SDL_GetError
 
 
#ifdef __cplusplus
} /* extern "C" */
#endif
 
#include "close_code.h"
 
#endif /* SDL_DRAW_H */
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_endian.h
0,0 → 1,138
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_endian.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* Functions for reading and writing endian-specific values */
 
#ifndef _SDL_endian_h
#define _SDL_endian_h
 
/* These functions read and write data of the specified endianness,
dynamically translating to the host machine endianness.
 
e.g.: If you want to read a 16 bit value on big-endian machine from
an open file containing little endian values, you would use:
value = SDL_ReadLE16(rp);
Note that the read/write functions use SDL_RWops pointers
instead of FILE pointers. This allows you to read and write
endian values from large chunks of memory as well as files
and other data sources.
*/
 
#include <stdio.h>
 
#include "SDL_types.h"
#include "SDL_rwops.h"
#include "SDL_byteorder.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* Use inline functions for compilers that support them, and static
functions for those that do not. Because these functions become
static for compilers that do not support inline functions, this
header should only be included in files that actually use them.
*/
#ifndef SDL_Swap16
static __inline__ Uint16 SDL_Swap16(Uint16 D) {
return((D<<8)|(D>>8));
}
#endif
#ifndef SDL_Swap32
static __inline__ Uint32 SDL_Swap32(Uint32 D) {
return((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000FF00)|(D>>24));
}
#endif
#ifdef SDL_HAS_64BIT_TYPE
#ifndef SDL_Swap64
static __inline__ Uint64 SDL_Swap64(Uint64 val) {
Uint32 hi, lo;
 
/* Separate into high and low 32-bit values and swap them */
lo = (Uint32)(val&0xFFFFFFFF);
val >>= 32;
hi = (Uint32)(val&0xFFFFFFFF);
val = SDL_Swap32(lo);
val <<= 32;
val |= SDL_Swap32(hi);
return(val);
}
#endif
#else
#ifndef SDL_Swap64
/* This is mainly to keep compilers from complaining in SDL code.
If there is no real 64-bit datatype, then compilers will complain about
the fake 64-bit datatype that SDL provides when it compiles user code.
*/
#define SDL_Swap64(X) (X)
#endif
#endif /* SDL_HAS_64BIT_TYPE */
 
 
/* Byteswap item from the specified endianness to the native endianness */
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define SDL_SwapLE16(X) (X)
#define SDL_SwapLE32(X) (X)
#define SDL_SwapLE64(X) (X)
#define SDL_SwapBE16(X) SDL_Swap16(X)
#define SDL_SwapBE32(X) SDL_Swap32(X)
#define SDL_SwapBE64(X) SDL_Swap64(X)
#else
#define SDL_SwapLE16(X) SDL_Swap16(X)
#define SDL_SwapLE32(X) SDL_Swap32(X)
#define SDL_SwapLE64(X) SDL_Swap64(X)
#define SDL_SwapBE16(X) (X)
#define SDL_SwapBE32(X) (X)
#define SDL_SwapBE64(X) (X)
#endif
 
/* Read an item of the specified endianness and return in native format */
extern DECLSPEC Uint16 SDL_ReadLE16(SDL_RWops *src);
extern DECLSPEC Uint16 SDL_ReadBE16(SDL_RWops *src);
extern DECLSPEC Uint32 SDL_ReadLE32(SDL_RWops *src);
extern DECLSPEC Uint32 SDL_ReadBE32(SDL_RWops *src);
extern DECLSPEC Uint64 SDL_ReadLE64(SDL_RWops *src);
extern DECLSPEC Uint64 SDL_ReadBE64(SDL_RWops *src);
 
/* Write an item of native format to the specified endianness */
extern DECLSPEC int SDL_WriteLE16(SDL_RWops *dst, Uint16 value);
extern DECLSPEC int SDL_WriteBE16(SDL_RWops *dst, Uint16 value);
extern DECLSPEC int SDL_WriteLE32(SDL_RWops *dst, Uint32 value);
extern DECLSPEC int SDL_WriteBE32(SDL_RWops *dst, Uint32 value);
extern DECLSPEC int SDL_WriteLE64(SDL_RWops *dst, Uint64 value);
extern DECLSPEC int SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_endian_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_error.h
0,0 → 1,62
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_error.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* Simple error message routines for SDL */
 
#ifndef _SDL_error_h
#define _SDL_error_h
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* Public functions */
extern DECLSPEC void SDL_SetError(const char *fmt, ...);
extern DECLSPEC char * SDL_GetError(void);
extern DECLSPEC void SDL_ClearError(void);
 
/* Private error message function - used internally */
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
typedef enum {
SDL_ENOMEM,
SDL_EFREAD,
SDL_EFWRITE,
SDL_EFSEEK,
SDL_LASTERROR
} SDL_errorcode;
extern void SDL_Error(SDL_errorcode code);
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_error_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_events.h
0,0 → 1,335
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_events.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* Include file for SDL event handling */
 
#ifndef _SDL_events_h
#define _SDL_events_h
 
#include "SDL_types.h"
#include "SDL_active.h"
#include "SDL_keyboard.h"
#include "SDL_mouse.h"
#include "SDL_joystick.h"
#include "SDL_quit.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* Event enumerations */
enum { SDL_NOEVENT = 0, /* Unused (do not remove) */
SDL_ACTIVEEVENT, /* Application loses/gains visibility */
SDL_KEYDOWN, /* Keys pressed */
SDL_KEYUP, /* Keys released */
SDL_MOUSEMOTION, /* Mouse moved */
SDL_MOUSEBUTTONDOWN, /* Mouse button pressed */
SDL_MOUSEBUTTONUP, /* Mouse button released */
SDL_JOYAXISMOTION, /* Joystick axis motion */
SDL_JOYBALLMOTION, /* Joystick trackball motion */
SDL_JOYHATMOTION, /* Joystick hat position change */
SDL_JOYBUTTONDOWN, /* Joystick button pressed */
SDL_JOYBUTTONUP, /* Joystick button released */
SDL_QUIT, /* User-requested quit */
SDL_SYSWMEVENT, /* System specific event */
SDL_EVENT_RESERVEDA, /* Reserved for future use.. */
SDL_EVENT_RESERVEDB, /* Reserved for future use.. */
SDL_VIDEORESIZE, /* User resized video mode */
SDL_VIDEOEXPOSE, /* Screen needs to be redrawn */
SDL_EVENT_RESERVED2, /* Reserved for future use.. */
SDL_EVENT_RESERVED3, /* Reserved for future use.. */
SDL_EVENT_RESERVED4, /* Reserved for future use.. */
SDL_EVENT_RESERVED5, /* Reserved for future use.. */
SDL_EVENT_RESERVED6, /* Reserved for future use.. */
SDL_EVENT_RESERVED7, /* Reserved for future use.. */
/* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
SDL_USEREVENT = 24,
SDL_PAINT_WND = 31,
/* This last event is only for bounding internal arrays
It is the number of bits in the event mask datatype -- Uint32
*/
SDL_NUMEVENTS = 32
};
 
/* Predefined event masks */
#define SDL_EVENTMASK(X) (1<<(X))
enum {
SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)|
SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)|
SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION),
SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION),
SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION),
SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP),
SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)|
SDL_EVENTMASK(SDL_JOYBALLMOTION)|
SDL_EVENTMASK(SDL_JOYHATMOTION)|
SDL_EVENTMASK(SDL_JOYBUTTONDOWN)|
SDL_EVENTMASK(SDL_JOYBUTTONUP),
SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE),
SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
};
#define SDL_ALLEVENTS 0xFFFFFFFF
 
/* Application visibility event structure */
typedef struct {
Uint8 type; /* SDL_ACTIVEEVENT */
Uint8 gain; /* Whether given states were gained or lost (1/0) */
Uint8 state; /* A mask of the focus states */
} SDL_ActiveEvent;
 
/* Keyboard event structure */
typedef struct {
Uint8 type; /* SDL_KEYDOWN or SDL_KEYUP */
Uint8 which; /* The keyboard device index */
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
SDL_keysym keysym;
} SDL_KeyboardEvent;
 
/* Mouse motion event structure */
typedef struct {
Uint8 type; /* SDL_MOUSEMOTION */
Uint8 which; /* The mouse device index */
Uint8 state; /* The current button state */
Uint16 x, y; /* The X/Y coordinates of the mouse */
Sint16 xrel; /* The relative motion in the X direction */
Sint16 yrel; /* The relative motion in the Y direction */
} SDL_MouseMotionEvent;
 
/* Mouse button event structure */
typedef struct {
Uint8 type; /* SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
Uint8 which; /* The mouse device index */
Uint8 button; /* The mouse button index */
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
Uint16 x, y; /* The X/Y coordinates of the mouse at press time */
} SDL_MouseButtonEvent;
 
/* Joystick axis motion event structure */
typedef struct {
Uint8 type; /* SDL_JOYAXISMOTION */
Uint8 which; /* The joystick device index */
Uint8 axis; /* The joystick axis index */
Sint16 value; /* The axis value (range: -32768 to 32767) */
} SDL_JoyAxisEvent;
 
/* Joystick trackball motion event structure */
typedef struct {
Uint8 type; /* SDL_JOYBALLMOTION */
Uint8 which; /* The joystick device index */
Uint8 ball; /* The joystick trackball index */
Sint16 xrel; /* The relative motion in the X direction */
Sint16 yrel; /* The relative motion in the Y direction */
} SDL_JoyBallEvent;
 
/* Joystick hat position change event structure */
typedef struct {
Uint8 type; /* SDL_JOYHATMOTION */
Uint8 which; /* The joystick device index */
Uint8 hat; /* The joystick hat index */
Uint8 value; /* The hat position value:
8 1 2
7 0 3
6 5 4
Note that zero means the POV is centered.
*/
} SDL_JoyHatEvent;
 
/* Joystick button event structure */
typedef struct {
Uint8 type; /* SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
Uint8 which; /* The joystick device index */
Uint8 button; /* The joystick button index */
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
} SDL_JoyButtonEvent;
 
/* The "window resized" event
When you get this event, you are responsible for setting a new video
mode with the new width and height.
*/
typedef struct {
Uint8 type; /* SDL_VIDEORESIZE */
int w; /* New width */
int h; /* New height */
} SDL_ResizeEvent;
 
/* The "screen redraw" event */
typedef struct {
Uint8 type; /* SDL_VIDEOEXPOSE */
} SDL_ExposeEvent;
 
/* The "quit requested" event */
typedef struct {
Uint8 type; /* SDL_QUIT */
} SDL_QuitEvent;
 
/* A user-defined event type */
typedef struct {
Uint8 type; /* SDL_USEREVENT through SDL_NUMEVENTS-1 */
int code; /* User defined event code */
void *data1; /* User defined data pointer */
void *data2; /* User defined data pointer */
} SDL_UserEvent;
 
/* If you want to use this event, you should include SDL_syswm.h */
struct SDL_SysWMmsg;
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
typedef struct {
Uint8 type;
SDL_SysWMmsg *msg;
} SDL_SysWMEvent;
 
/* General event structure */
typedef union {
Uint8 type;
SDL_ActiveEvent active;
SDL_KeyboardEvent key;
SDL_MouseMotionEvent motion;
SDL_MouseButtonEvent button;
SDL_JoyAxisEvent jaxis;
SDL_JoyBallEvent jball;
SDL_JoyHatEvent jhat;
SDL_JoyButtonEvent jbutton;
SDL_ResizeEvent resize;
SDL_ExposeEvent expose;
SDL_QuitEvent quit;
SDL_UserEvent user;
SDL_SysWMEvent syswm;
} SDL_Event;
 
 
/* Function prototypes */
 
/* Pumps the event loop, gathering events from the input devices.
This function updates the event queue and internal input device state.
This should only be run in the thread that sets the video mode.
*/
extern DECLSPEC void SDL_PumpEvents(void);
 
/* Checks the event queue for messages and optionally returns them.
If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
the back of the event queue.
If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
of the event queue, matching 'mask', will be returned and will not
be removed from the queue.
If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
of the event queue, matching 'mask', will be returned and will be
removed from the queue.
This function returns the number of events actually stored, or -1
if there was an error. This function is thread-safe.
*/
typedef enum {
SDL_ADDEVENT,
SDL_PEEKEVENT,
SDL_GETEVENT
} SDL_eventaction;
/* */
extern DECLSPEC int SDL_PeepEvents(SDL_Event *events, int numevents,
SDL_eventaction action, Uint32 mask);
 
/* Polls for currently pending events, and returns 1 if there are any pending
events, or 0 if there are none available. If 'event' is not NULL, the next
event is removed from the queue and stored in that area.
*/
extern DECLSPEC int SDL_PollEvent(SDL_Event *event);
 
/* Waits indefinitely for the next available event, returning 1, or 0 if there
was an error while waiting for events. If 'event' is not NULL, the next
event is removed from the queue and stored in that area.
*/
extern DECLSPEC int SDL_WaitEvent(SDL_Event *event);
 
/* Add an event to the event queue.
This function returns 0, or -1 if the event couldn't be added to
the event queue. If the event queue is full, this function fails.
*/
extern DECLSPEC int SDL_PushEvent(SDL_Event *event);
 
/*
This function sets up a filter to process all events before they
change internal state and are posted to the internal event queue.
 
The filter is protypted as:
*/
typedef int (*SDL_EventFilter)(const SDL_Event *event);
/*
If the filter returns 1, then the event will be added to the internal queue.
If it returns 0, then the event will be dropped from the queue, but the
internal state will still be updated. This allows selective filtering of
dynamically arriving events.
 
WARNING: Be very careful of what you do in the event filter function, as
it may run in a different thread!
 
There is one caveat when dealing with the SDL_QUITEVENT event type. The
event filter is only called when the window manager desires to close the
application window. If the event filter returns 1, then the window will
be closed, otherwise the window will remain open if possible.
If the quit event is generated by an interrupt signal, it will bypass the
internal queue and be delivered to the application at the next event poll.
*/
extern DECLSPEC void SDL_SetEventFilter(SDL_EventFilter filter);
 
/*
Return the current event filter - can be used to "chain" filters.
If there is no event filter set, this function returns NULL.
*/
extern DECLSPEC SDL_EventFilter SDL_GetEventFilter(void);
 
/*
This function allows you to set the state of processing certain events.
If 'state' is set to SDL_IGNORE, that event will be automatically dropped
from the event queue and will not event be filtered.
If 'state' is set to SDL_ENABLE, that event will be processed normally.
If 'state' is set to SDL_QUERY, SDL_EventState() will return the
current processing state of the specified event.
*/
#define SDL_QUERY -1
#define SDL_IGNORE 0
#define SDL_DISABLE 0
#define SDL_ENABLE 1
extern DECLSPEC Uint8 SDL_EventState(Uint8 type, int state);
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_events_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_flic.h
0,0 → 1,102
/*
SDL_flic - renders FLIC animations
Copyright (C) 2003 Andre de Leiradella
 
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.1 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
 
For information about SDL_flic contact leiradella@bigfoot.com
 
Version 1.0: first public release.
Version 1.1: fixed bug to set *error to FLI_OK when returning successfully from FLI_Open
added function FLI_Reset to reset the animation to the first frame
Version 1.2: added function FLI_Skip to skip the current frame without rendering
FLI_Animation->surface is now correctly locked and unlocked
the rwops stream is now part of the FLI_Animation structure and is closed inside FLI_Close
renamed FLI_Reset to FLI_Rewind
added function FLI_Version that returns the library version
*/
#ifndef __SDL_flic_h__
#define __SDL_flic_h__
 
#include <SDL.h>
#include <setjmp.h>
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Supported formats. */
#define FLI_FLI 0xAF11
#define FLI_FLC 0xAF12
 
/* Error codes. */
 
/* No error. */
#define FLI_OK 0
/* Error reading the file. */
#define FLI_READERROR 1
/* Invalid frame size (corrupted file). */
#define FLI_CORRUPTEDFILE 2
/* Error in SDL operation. */
#define FLI_SDLERROR 3
/* Out of memory. */
#define FLI_OUTOFMEMORY 4
 
/*
The animation structure, all members are read-only, don't try to longjmp to
error.
*/
typedef struct {
Uint32 format, numframes, width, height, depth, delay, offframe1, nextframe, offnextframe;
/* rwops is where the animation is read from. */
SDL_RWops *rwops;
/* surface is where the frames is rendered to. */
SDL_Surface *surface;
/* error is used to longjmp in case of error so to avoid a chain of if's. */
jmp_buf error;
} FLI_Animation;
 
/*
Returns the library version in the format MAJOR << 16 | MINOR.
*/
extern int FLI_Version(void);
/*
Opens a FLIC animation and return a pointer to it. rwops is left at the same
point it was before the the call. error receives the result of the call.
*/
extern FLI_Animation *FLI_Open(SDL_RWops *rwops, int *error);
/*
Closes the animation, closes the stream and frees all used memory.
*/
extern void FLI_Close(FLI_Animation *flic);
/*
Renders the next frame of the animation returning an int to indicate if it was
successfull or not.
*/
extern int FLI_NextFrame(FLI_Animation *flic);
/*
Rewinds the animation to the first frame.
*/
extern int FLI_Rewind(FLI_Animation *flic);
/*
Skips the current frame of the animation without rendering it.
*/
extern int FLI_Skip(FLI_Animation *flic);
 
#ifdef __cplusplus
};
#endif
 
#endif
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_getenv.h
0,0 → 1,30
 
/* Not all environments have a working getenv()/putenv() */
 
#if defined(macintosh) || defined(_WIN32_WCE)
#define NEED_SDL_GETENV
#endif
 
#ifdef NEED_SDL_GETENV
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* Put a variable of the form "name=value" into the environment */
extern DECLSPEC int SDL_putenv(const char *variable);
#define putenv(X) SDL_putenv(X)
 
/* Retrieve a variable named "name" from the environment */
extern DECLSPEC char *SDL_getenv(const char *name);
#define getenv(X) SDL_getenv(X)
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* NEED_GETENV */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_image.h
0,0 → 1,93
/*
IMGLIB: An example image loading library for use with SDL
Copyright (C) 1999 Sam Lantinga
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
 
This program 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 General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
5635-34 Springhouse Dr.
Pleasanton, CA 94588 (USA)
slouken@devolution.com
*/
 
/* A simple library to load images of various formats as SDL surfaces */
 
#ifndef _IMG_h
#define _IMG_h
 
#include "SDL.h"
#include "begin_code.h"
 
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* Load an image from an SDL data source.
The 'type' may be one of: "BMP", "GIF", "PNG", etc.
 
If the image format supports a transparent pixel, SDL will set the
colorkey for the surface. You can enable RLE acceleration on the
surface afterwards by calling:
SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
*/
extern DECLSPEC SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc,
char *type);
/* Convenience functions */
extern DECLSPEC SDL_Surface *IMG_Load(const char *file);
extern DECLSPEC SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc);
 
/* Invert the alpha of a surface for use with OpenGL
This function is now a no-op, and only provided for backwards compatibility.
*/
extern DECLSPEC int IMG_InvertAlpha(int on);
 
/* Functions to detect a file type, given a seekable source */
extern DECLSPEC int IMG_isBMP(SDL_RWops *src);
extern DECLSPEC int IMG_isPNM(SDL_RWops *src);
extern DECLSPEC int IMG_isXPM(SDL_RWops *src);
extern DECLSPEC int IMG_isXCF(SDL_RWops *src);
extern DECLSPEC int IMG_isPCX(SDL_RWops *src);
extern DECLSPEC int IMG_isGIF(SDL_RWops *src);
extern DECLSPEC int IMG_isJPG(SDL_RWops *src);
extern DECLSPEC int IMG_isTIF(SDL_RWops *src);
extern DECLSPEC int IMG_isPNG(SDL_RWops *src);
 
/* Individual loading functions */
extern DECLSPEC SDL_Surface *IMG_LoadBMP_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadXPM_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadGIF_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadTIF_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src);
extern DECLSPEC SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src);
 
/* We'll use SDL for reporting errors */
#define IMG_SetError SDL_SetError
#define IMG_GetError SDL_GetError
 
/* used internally, NOT an exported function */
extern DECLSPEC int IMG_string_equals(const char *str1, const char *str2);
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _IMG_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_joystick.h
0,0 → 1,171
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_joystick.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* Include file for SDL joystick event handling */
 
#ifndef _SDL_joystick_h
#define _SDL_joystick_h
 
#include "SDL_types.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* In order to use these functions, SDL_Init() must have been called
with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
for joysticks, and load appropriate drivers.
*/
 
/* The joystick structure used to identify an SDL joystick */
struct _SDL_Joystick;
typedef struct _SDL_Joystick SDL_Joystick;
 
 
/* Function prototypes */
/*
* Count the number of joysticks attached to the system
*/
extern DECLSPEC int SDL_NumJoysticks(void);
 
/*
* Get the implementation dependent name of a joystick.
* This can be called before any joysticks are opened.
* If no name can be found, this function returns NULL.
*/
extern DECLSPEC const char *SDL_JoystickName(int device_index);
 
/*
* Open a joystick for use - the index passed as an argument refers to
* the N'th joystick on the system. This index is the value which will
* identify this joystick in future joystick events.
*
* This function returns a joystick identifier, or NULL if an error occurred.
*/
extern DECLSPEC SDL_Joystick *SDL_JoystickOpen(int device_index);
 
/*
* Returns 1 if the joystick has been opened, or 0 if it has not.
*/
extern DECLSPEC int SDL_JoystickOpened(int device_index);
 
/*
* Get the device index of an opened joystick.
*/
extern DECLSPEC int SDL_JoystickIndex(SDL_Joystick *joystick);
 
/*
* Get the number of general axis controls on a joystick
*/
extern DECLSPEC int SDL_JoystickNumAxes(SDL_Joystick *joystick);
 
/*
* Get the number of trackballs on a joystick
* Joystick trackballs have only relative motion events associated
* with them and their state cannot be polled.
*/
extern DECLSPEC int SDL_JoystickNumBalls(SDL_Joystick *joystick);
 
/*
* Get the number of POV hats on a joystick
*/
extern DECLSPEC int SDL_JoystickNumHats(SDL_Joystick *joystick);
 
/*
* Get the number of buttons on a joystick
*/
extern DECLSPEC int SDL_JoystickNumButtons(SDL_Joystick *joystick);
 
/*
* Update the current state of the open joysticks.
* This is called automatically by the event loop if any joystick
* events are enabled.
*/
extern DECLSPEC void SDL_JoystickUpdate(void);
 
/*
* Enable/disable joystick event polling.
* If joystick events are disabled, you must call SDL_JoystickUpdate()
* yourself and check the state of the joystick when you want joystick
* information.
* The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
*/
extern DECLSPEC int SDL_JoystickEventState(int state);
 
/*
* Get the current state of an axis control on a joystick
* The state is a value ranging from -32768 to 32767.
* The axis indices start at index 0.
*/
extern DECLSPEC Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
 
/*
* Get the current state of a POV hat on a joystick
* The return value is one of the following positions:
*/
#define SDL_HAT_CENTERED 0x00
#define SDL_HAT_UP 0x01
#define SDL_HAT_RIGHT 0x02
#define SDL_HAT_DOWN 0x04
#define SDL_HAT_LEFT 0x08
#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
/*
* The hat indices start at index 0.
*/
extern DECLSPEC Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
 
/*
* Get the ball axis change since the last poll
* This returns 0, or -1 if you passed it invalid parameters.
* The ball indices start at index 0.
*/
extern DECLSPEC int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
 
/*
* Get the current state of a button on a joystick
* The button indices start at index 0.
*/
extern DECLSPEC Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
 
/*
* Close a joystick previously opened with SDL_JoystickOpen()
*/
extern DECLSPEC void SDL_JoystickClose(SDL_Joystick *joystick);
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_joystick_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_keyboard.h
0,0 → 1,124
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_keyboard.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* Include file for SDL keyboard event handling */
 
#ifndef _SDL_keyboard_h
#define _SDL_keyboard_h
 
#include "SDL_types.h"
#include "SDL_keysym.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* Keysym structure
- The scancode is hardware dependent, and should not be used by general
applications. If no hardware scancode is available, it will be 0.
 
- The 'unicode' translated character is only available when character
translation is enabled by the SDL_EnableUNICODE() API. If non-zero,
this is a UNICODE character corresponding to the keypress. If the
high 9 bits of the character are 0, then this maps to the equivalent
ASCII character:
char ch;
if ( (keysym.unicode & 0xFF80) == 0 ) {
ch = keysym.unicode & 0x7F;
} else {
An international character..
}
*/
typedef struct {
Uint8 scancode; /* hardware specific scancode */
SDLKey sym; /* SDL virtual keysym */
SDLMod mod; /* current key modifiers */
Uint16 unicode; /* translated character */
} SDL_keysym;
 
/* This is the mask which refers to all hotkey bindings */
#define SDL_ALL_HOTKEYS 0xFFFFFFFF
 
/* Function prototypes */
/*
* Enable/Disable UNICODE translation of keyboard input.
* This translation has some overhead, so translation defaults off.
* If 'enable' is 1, translation is enabled.
* If 'enable' is 0, translation is disabled.
* If 'enable' is -1, the translation state is not changed.
* It returns the previous state of keyboard translation.
*/
extern DECLSPEC int SDL_EnableUNICODE(int enable);
 
/*
* Enable/Disable keyboard repeat. Keyboard repeat defaults to off.
* 'delay' is the initial delay in ms between the time when a key is
* pressed, and keyboard repeat begins.
* 'interval' is the time in ms between keyboard repeat events.
*/
#define SDL_DEFAULT_REPEAT_DELAY 500
#define SDL_DEFAULT_REPEAT_INTERVAL 30
/*
* If 'delay' is set to 0, keyboard repeat is disabled.
*/
extern DECLSPEC int SDL_EnableKeyRepeat(int delay, int interval);
 
/*
* Get a snapshot of the current state of the keyboard.
* Returns an array of keystates, indexed by the SDLK_* syms.
* Used:
* Uint8 *keystate = SDL_GetKeyState(NULL);
* if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed.
*/
extern DECLSPEC Uint8 * SDL_GetKeyState(int *numkeys);
 
/*
* Get the current key modifier state
*/
extern DECLSPEC SDLMod SDL_GetModState(void);
 
/*
* Set the current key modifier state
* This does not change the keyboard state, only the key modifier flags.
*/
extern DECLSPEC void SDL_SetModState(SDLMod modstate);
 
/*
* Get the name of an SDL virtual keysym
*/
extern DECLSPEC char * SDL_GetKeyName(SDLKey key);
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_keyboard_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_keysym.h
0,0 → 1,315
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_keysym.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
#ifndef _SDL_keysym_h
#define _SDL_keysym_h
 
/* What we really want is a mapping of every raw key on the keyboard.
To support international keyboards, we use the range 0xA1 - 0xFF
as international virtual keycodes. We'll follow in the footsteps of X11...
The names of the keys
*/
typedef enum {
/* The keyboard syms have been cleverly chosen to map to ASCII */
SDLK_UNKNOWN = 0,
SDLK_FIRST = 0,
SDLK_BACKSPACE = 8,
SDLK_TAB = 9,
SDLK_CLEAR = 12,
SDLK_RETURN = 13,
SDLK_PAUSE = 19,
SDLK_ESCAPE = 27,
SDLK_SPACE = 32,
SDLK_EXCLAIM = 33,
SDLK_QUOTEDBL = 34,
SDLK_HASH = 35,
SDLK_DOLLAR = 36,
SDLK_AMPERSAND = 38,
SDLK_QUOTE = 39,
SDLK_LEFTPAREN = 40,
SDLK_RIGHTPAREN = 41,
SDLK_ASTERISK = 42,
SDLK_PLUS = 43,
SDLK_COMMA = 44,
SDLK_MINUS = 45,
SDLK_PERIOD = 46,
SDLK_SLASH = 47,
SDLK_0 = 48,
SDLK_1 = 49,
SDLK_2 = 50,
SDLK_3 = 51,
SDLK_4 = 52,
SDLK_5 = 53,
SDLK_6 = 54,
SDLK_7 = 55,
SDLK_8 = 56,
SDLK_9 = 57,
SDLK_COLON = 58,
SDLK_SEMICOLON = 59,
SDLK_LESS = 60,
SDLK_EQUALS = 61,
SDLK_GREATER = 62,
SDLK_QUESTION = 63,
SDLK_AT = 64,
/*
Skip uppercase letters
*/
SDLK_LEFTBRACKET = 91,
SDLK_BACKSLASH = 92,
SDLK_RIGHTBRACKET = 93,
SDLK_CARET = 94,
SDLK_UNDERSCORE = 95,
SDLK_BACKQUOTE = 96,
SDLK_a = 97,
SDLK_b = 98,
SDLK_c = 99,
SDLK_d = 100,
SDLK_e = 101,
SDLK_f = 102,
SDLK_g = 103,
SDLK_h = 104,
SDLK_i = 105,
SDLK_j = 106,
SDLK_k = 107,
SDLK_l = 108,
SDLK_m = 109,
SDLK_n = 110,
SDLK_o = 111,
SDLK_p = 112,
SDLK_q = 113,
SDLK_r = 114,
SDLK_s = 115,
SDLK_t = 116,
SDLK_u = 117,
SDLK_v = 118,
SDLK_w = 119,
SDLK_x = 120,
SDLK_y = 121,
SDLK_z = 122,
SDLK_DELETE = 127,
/* End of ASCII mapped keysyms */
 
/* International keyboard syms */
SDLK_WORLD_0 = 160, /* 0xA0 */
SDLK_WORLD_1 = 161,
SDLK_WORLD_2 = 162,
SDLK_WORLD_3 = 163,
SDLK_WORLD_4 = 164,
SDLK_WORLD_5 = 165,
SDLK_WORLD_6 = 166,
SDLK_WORLD_7 = 167,
SDLK_WORLD_8 = 168,
SDLK_WORLD_9 = 169,
SDLK_WORLD_10 = 170,
SDLK_WORLD_11 = 171,
SDLK_WORLD_12 = 172,
SDLK_WORLD_13 = 173,
SDLK_WORLD_14 = 174,
SDLK_WORLD_15 = 175,
SDLK_WORLD_16 = 176,
SDLK_WORLD_17 = 177,
SDLK_WORLD_18 = 178,
SDLK_WORLD_19 = 179,
SDLK_WORLD_20 = 180,
SDLK_WORLD_21 = 181,
SDLK_WORLD_22 = 182,
SDLK_WORLD_23 = 183,
SDLK_WORLD_24 = 184,
SDLK_WORLD_25 = 185,
SDLK_WORLD_26 = 186,
SDLK_WORLD_27 = 187,
SDLK_WORLD_28 = 188,
SDLK_WORLD_29 = 189,
SDLK_WORLD_30 = 190,
SDLK_WORLD_31 = 191,
SDLK_WORLD_32 = 192,
SDLK_WORLD_33 = 193,
SDLK_WORLD_34 = 194,
SDLK_WORLD_35 = 195,
SDLK_WORLD_36 = 196,
SDLK_WORLD_37 = 197,
SDLK_WORLD_38 = 198,
SDLK_WORLD_39 = 199,
SDLK_WORLD_40 = 200,
SDLK_WORLD_41 = 201,
SDLK_WORLD_42 = 202,
SDLK_WORLD_43 = 203,
SDLK_WORLD_44 = 204,
SDLK_WORLD_45 = 205,
SDLK_WORLD_46 = 206,
SDLK_WORLD_47 = 207,
SDLK_WORLD_48 = 208,
SDLK_WORLD_49 = 209,
SDLK_WORLD_50 = 210,
SDLK_WORLD_51 = 211,
SDLK_WORLD_52 = 212,
SDLK_WORLD_53 = 213,
SDLK_WORLD_54 = 214,
SDLK_WORLD_55 = 215,
SDLK_WORLD_56 = 216,
SDLK_WORLD_57 = 217,
SDLK_WORLD_58 = 218,
SDLK_WORLD_59 = 219,
SDLK_WORLD_60 = 220,
SDLK_WORLD_61 = 221,
SDLK_WORLD_62 = 222,
SDLK_WORLD_63 = 223,
SDLK_WORLD_64 = 224,
SDLK_WORLD_65 = 225,
SDLK_WORLD_66 = 226,
SDLK_WORLD_67 = 227,
SDLK_WORLD_68 = 228,
SDLK_WORLD_69 = 229,
SDLK_WORLD_70 = 230,
SDLK_WORLD_71 = 231,
SDLK_WORLD_72 = 232,
SDLK_WORLD_73 = 233,
SDLK_WORLD_74 = 234,
SDLK_WORLD_75 = 235,
SDLK_WORLD_76 = 236,
SDLK_WORLD_77 = 237,
SDLK_WORLD_78 = 238,
SDLK_WORLD_79 = 239,
SDLK_WORLD_80 = 240,
SDLK_WORLD_81 = 241,
SDLK_WORLD_82 = 242,
SDLK_WORLD_83 = 243,
SDLK_WORLD_84 = 244,
SDLK_WORLD_85 = 245,
SDLK_WORLD_86 = 246,
SDLK_WORLD_87 = 247,
SDLK_WORLD_88 = 248,
SDLK_WORLD_89 = 249,
SDLK_WORLD_90 = 250,
SDLK_WORLD_91 = 251,
SDLK_WORLD_92 = 252,
SDLK_WORLD_93 = 253,
SDLK_WORLD_94 = 254,
SDLK_WORLD_95 = 255, /* 0xFF */
 
/* Numeric keypad */
SDLK_KP0 = 256,
SDLK_KP1 = 257,
SDLK_KP2 = 258,
SDLK_KP3 = 259,
SDLK_KP4 = 260,
SDLK_KP5 = 261,
SDLK_KP6 = 262,
SDLK_KP7 = 263,
SDLK_KP8 = 264,
SDLK_KP9 = 265,
SDLK_KP_PERIOD = 266,
SDLK_KP_DIVIDE = 267,
SDLK_KP_MULTIPLY = 268,
SDLK_KP_MINUS = 269,
SDLK_KP_PLUS = 270,
SDLK_KP_ENTER = 271,
SDLK_KP_EQUALS = 272,
 
/* Arrows + Home/End pad */
SDLK_UP = 273,
SDLK_DOWN = 274,
SDLK_RIGHT = 275,
SDLK_LEFT = 276,
SDLK_INSERT = 277,
SDLK_HOME = 278,
SDLK_END = 279,
SDLK_PAGEUP = 280,
SDLK_PAGEDOWN = 281,
 
/* Function keys */
SDLK_F1 = 282,
SDLK_F2 = 283,
SDLK_F3 = 284,
SDLK_F4 = 285,
SDLK_F5 = 286,
SDLK_F6 = 287,
SDLK_F7 = 288,
SDLK_F8 = 289,
SDLK_F9 = 290,
SDLK_F10 = 291,
SDLK_F11 = 292,
SDLK_F12 = 293,
SDLK_F13 = 294,
SDLK_F14 = 295,
SDLK_F15 = 296,
 
/* Key state modifier keys */
SDLK_NUMLOCK = 300,
SDLK_CAPSLOCK = 301,
SDLK_SCROLLOCK = 302,
SDLK_RSHIFT = 303,
SDLK_LSHIFT = 304,
SDLK_RCTRL = 305,
SDLK_LCTRL = 306,
SDLK_RALT = 307,
SDLK_LALT = 308,
SDLK_RMETA = 309,
SDLK_LMETA = 310,
SDLK_LSUPER = 311, /* Left "Windows" key */
SDLK_RSUPER = 312, /* Right "Windows" key */
SDLK_MODE = 313, /* "Alt Gr" key */
SDLK_COMPOSE = 314, /* Multi-key compose key */
 
/* Miscellaneous function keys */
SDLK_HELP = 315,
SDLK_PRINT = 316,
SDLK_SYSREQ = 317,
SDLK_BREAK = 318,
SDLK_MENU = 319,
SDLK_POWER = 320, /* Power Macintosh power key */
SDLK_EURO = 321, /* Some european keyboards */
 
/* Add any other keys here */
 
SDLK_LAST
} SDLKey;
 
/* Enumeration of valid key mods (possibly OR'd together) */
typedef enum {
KMOD_NONE = 0x0000,
KMOD_LSHIFT= 0x0001,
KMOD_RSHIFT= 0x0002,
KMOD_LCTRL = 0x0040,
KMOD_RCTRL = 0x0080,
KMOD_LALT = 0x0100,
KMOD_RALT = 0x0200,
KMOD_LMETA = 0x0400,
KMOD_RMETA = 0x0800,
KMOD_NUM = 0x1000,
KMOD_CAPS = 0x2000,
KMOD_MODE = 0x4000,
KMOD_RESERVED = 0x8000
} SDLMod;
 
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
#define KMOD_META (KMOD_LMETA|KMOD_RMETA)
 
#endif /* _SDL_keysym_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_loadso.h
0,0 → 1,76
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2004 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@libsdl.org
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_loadso.h,v 1.5 2004/01/04 16:49:07 slouken Exp $";
#endif
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* System dependent library loading routines */
 
/* Some things to keep in mind:
- These functions only work on C function names. Other languages may
have name mangling and intrinsic language support that varies from
compiler to compiler.
- Make sure you declare your function pointers with the same calling
convention as the actual library function. Your code will crash
mysteriously if you do not do this.
- Avoid namespace collisions. If you load a symbol from the library,
it is not defined whether or not it goes into the global symbol
namespace for the application. If it does and it conflicts with
symbols in your code or other shared libraries, you will not get
the results you expect. :)
*/
 
 
#ifndef _SDL_loadso_h
#define _SDL_loadso_h
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* This function dynamically loads a shared object and returns a pointer
* to the object handle (or NULL if there was an error).
* The 'sofile' parameter is a system dependent name of the object file.
*/
extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile);
 
/* Given an object handle, this function looks up the address of the
* named function in the shared object and returns it. This address
* is no longer valid after calling SDL_UnloadObject().
*/
extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name);
 
/* Unload a shared object from memory */
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_loadso_h */
/contrib/media/updf/include/SDL/SDL_main.h
0,0 → 1,97
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_main.h,v 1.3 2001/06/07 14:28:11 hercules Exp $";
#endif
 
#ifndef _SDL_main_h
#define _SDL_main_h
 
/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
 
#if defined(WIN32UNDEFINED) || (defined(__MWERKS__) && !defined(__BEOS__)) || \
defined(macintosh) || defined(__APPLE__)
 
#ifdef __cplusplus
#define C_LINKAGE "C"
#else
#define C_LINKAGE
#endif /* __cplusplus */
 
/* The application's main() function must be called with C linkage,
and should be declared like this:
#ifdef __cplusplus
extern "C"
#endif
int main(int argc, char *argv[])
{
}
*/
#define main SDL_main
 
/* The prototype for the application's main() function */
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
 
 
/* From the SDL library code -- needed for registering the app on Win32 */
#if defined(WIN32UNDEFINED)
#include "SDL_types.h"
#include "begin_code.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* This should be called from your WinMain() function, if any */
extern DECLSPEC int SDL_RegisterApp(char *name, Uint32 style, void *hInst);
 
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif
 
/* From the SDL library code -- needed for registering QuickDraw on MacOS */
#if defined(macintosh)
#include "begin_code.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Forward declaration so we don't need to include QuickDraw.h */
struct QDGlobals;
 
/* This should be called from your main() function, if any */
extern DECLSPEC void SDL_InitQuickDraw(struct QDGlobals *the_qd);
 
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif
 
#endif /* Need to redefine main()? */
 
#endif /* _SDL_main_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_main.h.BAK
0,0 → 1,97
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_main.h,v 1.3 2001/06/07 14:28:11 hercules Exp $";
#endif
 
#ifndef _SDL_main_h
#define _SDL_main_h
 
/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
 
#if defined(WIN32) || (defined(__MWERKS__) && !defined(__BEOS__)) || \
defined(macintosh) || defined(__APPLE__)
 
#ifdef __cplusplus
#define C_LINKAGE "C"
#else
#define C_LINKAGE
#endif /* __cplusplus */
 
/* The application's main() function must be called with C linkage,
and should be declared like this:
#ifdef __cplusplus
extern "C"
#endif
int main(int argc, char *argv[])
{
}
*/
#define main SDL_main
 
/* The prototype for the application's main() function */
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
 
 
/* From the SDL library code -- needed for registering the app on Win32 */
#if defined(WIN32)
#include "SDL_types.h"
#include "begin_code.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* This should be called from your WinMain() function, if any */
extern DECLSPEC int SDL_RegisterApp(char *name, Uint32 style, void *hInst);
 
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif
 
/* From the SDL library code -- needed for registering QuickDraw on MacOS */
#if defined(macintosh)
#include "begin_code.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Forward declaration so we don't need to include QuickDraw.h */
struct QDGlobals;
 
/* This should be called from your main() function, if any */
extern DECLSPEC void SDL_InitQuickDraw(struct QDGlobals *the_qd);
 
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif
 
#endif /* Need to redefine main()? */
 
#endif /* _SDL_main_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_mixer.h
0,0 → 1,235
/*
MIXERLIB: An audio mixer library based on the SDL library
Copyright (C) 1997-1999 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
5635-34 Springhouse Dr.
Pleasanton, CA 94588 (USA)
slouken@devolution.com
*/
 
#ifndef _MIXER_H_
#define _MIXER_H_
 
#include "SDL_types.h"
#include "SDL_rwops.h"
#include "SDL_audio.h"
#include "SDL_byteorder.h"
#include "begin_code.h"
 
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* The default mixer has 8 simultaneous mixing channels */
#ifndef MIX_CHANNELS
#define MIX_CHANNELS 8
#endif
 
/* Good default values for a PC soundcard */
#define MIX_DEFAULT_FREQUENCY 22050
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define MIX_DEFAULT_FORMAT AUDIO_S16LSB
#else
#define MIX_DEFAULT_FORMAT AUDIO_S16MSB
#endif
#define MIX_DEFAULT_CHANNELS 2
#define MIX_MAX_VOLUME 128 /* Volume of a chunk */
 
/* The internal format for an audio chunk */
typedef struct {
int allocated;
Uint8 *abuf;
Uint32 alen;
Uint8 volume; /* Per-sample volume, 0-128 */
} Mix_Chunk;
 
/* The different fading types supported */
typedef enum {
MIX_NO_FADING,
MIX_FADING_OUT,
MIX_FADING_IN
} Mix_Fading;
 
/* The internal format for a music chunk interpreted via mikmod */
typedef struct _Mix_Music Mix_Music;
 
/* Open the mixer with a certain audio format */
extern DECLSPEC int Mix_OpenAudio(int frequency, Uint16 format, int channels,
int chunksize);
 
/* Dynamically change the number of channels managed by the mixer.
If decreasing the number of channels, the upper channels are
stopped.
This function returns the new number of allocated channels.
*/
extern DECLSPEC int Mix_AllocateChannels(int numchans);
 
/* Find out what the actual audio device parameters are.
This function returns 1 if the audio has been opened, 0 otherwise.
*/
extern DECLSPEC int Mix_QuerySpec(int *frequency,Uint16 *format,int *channels);
 
/* Load a wave file or a music (.mod .s3m .it .xm) file */
extern DECLSPEC Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc);
#define Mix_LoadWAV(file) Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
extern DECLSPEC Mix_Music *Mix_LoadMUS(const char *file);
 
#if 0 /* This hasn't been hooked into music.c yet */
/* Load a music file from an SDL_RWop object (MikMod-specific currently)
Matt Campbell (matt@campbellhome.dhs.org) April 2000 */
extern DECLSPEC Mix_Music *Mix_LoadMUS_RW(SDL_RWops *rw);
#endif
 
/* Load a wave file of the mixer format from a memory buffer */
extern DECLSPEC Mix_Chunk *Mix_QuickLoad_WAV(Uint8 *mem);
 
/* Free an audio chunk previously loaded */
extern DECLSPEC void Mix_FreeChunk(Mix_Chunk *chunk);
extern DECLSPEC void Mix_FreeMusic(Mix_Music *music);
 
/* Set a function that is called after all mixing is performed.
This can be used to provide real-time visual display of the audio stream
or add a custom mixer filter for the stream data.
*/
extern DECLSPEC void Mix_SetPostMix(void (*mix_func)
(void *udata, Uint8 *stream, int len), void *arg);
 
/* Add your own music player or additional mixer function.
If 'mix_func' is NULL, the default music player is re-enabled.
*/
extern DECLSPEC void Mix_HookMusic(void (*mix_func)
(void *udata, Uint8 *stream, int len), void *arg);
 
/* Add your own callback when the music has finished playing.
*/
extern DECLSPEC void Mix_HookMusicFinished(void (*music_finished)(void));
 
/* Get a pointer to the user data for the current music hook */
extern DECLSPEC void *Mix_GetMusicHookData(void);
 
/* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate
them dynamically to the next sample if requested with a -1 value below.
Returns the number of reserved channels.
*/
extern DECLSPEC int Mix_ReserveChannels(int num);
 
/* Channel grouping functions */
 
/* Attach a tag to a channel. A tag can be assigned to several mixer
channels, to form groups of channels.
If 'tag' is -1, the tag is removed (actually -1 is the tag used to
represent the group of all the channels).
Returns true if everything was OK.
*/
extern DECLSPEC int Mix_GroupChannel(int which, int tag);
/* Assign several consecutive channels to a group */
extern DECLSPEC int Mix_GroupChannels(int from, int to, int tag);
/* Finds the first available channel in a group of channels */
extern DECLSPEC int Mix_GroupAvailable(int tag);
/* Returns the number of channels in a group. This is also a subtle
way to get the total number of channels when 'tag' is -1
*/
extern DECLSPEC int Mix_GroupCount(int tag);
/* Finds the "oldest" sample playing in a group of channels */
extern DECLSPEC int Mix_GroupOldest(int tag);
/* Finds the "most recent" (i.e. last) sample playing in a group of channels */
extern DECLSPEC int Mix_GroupNewer(int tag);
 
/* Play an audio chunk on a specific channel.
If the specified channel is -1, play on the first free channel.
If 'loops' is greater than zero, loop the sound that many times.
If 'loops' is -1, loop inifinitely (~65000 times).
Returns which channel was used to play the sound.
*/
#define Mix_PlayChannel(channel,chunk,loops) Mix_PlayChannelTimed(channel,chunk,loops,-1)
/* The same as above, but the sound is played at most 'ticks' milliseconds */
extern DECLSPEC int Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks);
extern DECLSPEC int Mix_PlayMusic(Mix_Music *music, int loops);
 
/* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */
extern DECLSPEC int Mix_FadeInMusic(Mix_Music *music, int loops, int ms);
#define Mix_FadeInChannel(channel,chunk,loops,ms) Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1)
extern DECLSPEC int Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks);
 
/* Set the volume in the range of 0-128 of a specific channel or chunk.
If the specified channel is -1, set volume for all channels.
Returns the original volume.
If the specified volume is -1, just return the current volume.
*/
extern DECLSPEC int Mix_Volume(int channel, int volume);
extern DECLSPEC int Mix_VolumeChunk(Mix_Chunk *chunk, int volume);
extern DECLSPEC int Mix_VolumeMusic(int volume);
 
/* Halt playing of a particular channel */
extern DECLSPEC int Mix_HaltChannel(int channel);
extern DECLSPEC int Mix_HaltGroup(int tag);
extern DECLSPEC int Mix_HaltMusic(void);
 
/* Change the expiration delay for a particular channel.
The sample will stop playing after the 'ticks' milliseconds have elapsed,
or remove the expiration if 'ticks' is -1
*/
extern DECLSPEC int Mix_ExpireChannel(int channel, int ticks);
 
/* Halt a channel, fading it out progressively till it's silent
The ms parameter indicates the number of milliseconds the fading
will take.
*/
extern DECLSPEC int Mix_FadeOutChannel(int which, int ms);
extern DECLSPEC int Mix_FadeOutGroup(int tag, int ms);
extern DECLSPEC int Mix_FadeOutMusic(int ms);
 
/* Query the fading status of a channel */
extern DECLSPEC Mix_Fading Mix_FadingMusic(void);
extern DECLSPEC Mix_Fading Mix_FadingChannel(int which);
 
/* Pause/Resume a particular channel */
extern DECLSPEC void Mix_Pause(int channel);
extern DECLSPEC void Mix_Resume(int channel);
extern DECLSPEC int Mix_Paused(int channel);
 
/* Pause/Resume the music stream */
extern DECLSPEC void Mix_PauseMusic(void);
extern DECLSPEC void Mix_ResumeMusic(void);
extern DECLSPEC void Mix_RewindMusic(void);
extern DECLSPEC int Mix_PausedMusic(void);
 
/* Check the status of a specific channel.
If the specified channel is -1, check all channels.
*/
extern DECLSPEC int Mix_Playing(int channel);
extern DECLSPEC int Mix_PlayingMusic(void);
 
/* Stop music and set external music playback command */
extern DECLSPEC int Mix_SetMusicCMD(const char *command);
 
/* Close the mixer, halting all playing audio */
extern DECLSPEC void Mix_CloseAudio(void);
 
/* We'll use SDL for reporting errors */
#define Mix_SetError SDL_SetError
#define Mix_GetError SDL_GetError
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _MIXER_H_ */
/contrib/media/updf/include/SDL/SDL_mouse.h
0,0 → 1,136
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_mouse.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* Include file for SDL mouse event handling */
 
#ifndef _SDL_mouse_h
#define _SDL_mouse_h
 
#include "SDL_types.h"
#include "SDL_video.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
typedef struct WMcursor WMcursor; /* Implementation dependent */
typedef struct {
SDL_Rect area; /* The area of the mouse cursor */
Sint16 hot_x, hot_y; /* The "tip" of the cursor */
Uint8 *data; /* B/W cursor data */
Uint8 *mask; /* B/W cursor mask */
Uint8 *save[2]; /* Place to save cursor area */
WMcursor *wm_cursor; /* Window-manager cursor */
} SDL_Cursor;
 
/* Function prototypes */
/*
* Retrieve the current state of the mouse.
* The current button state is returned as a button bitmask, which can
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* current mouse cursor position. You can pass NULL for either x or y.
*/
extern DECLSPEC Uint8 SDL_GetMouseState(int *x, int *y);
 
/*
* Retrieve the current state of the mouse.
* The current button state is returned as a button bitmask, which can
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* mouse deltas since the last call to SDL_GetRelativeMouseState().
*/
extern DECLSPEC Uint8 SDL_GetRelativeMouseState(int *x, int *y);
 
/*
* Set the position of the mouse cursor (generates a mouse motion event)
*/
extern DECLSPEC void SDL_WarpMouse(Uint16 x, Uint16 y);
 
/*
* Create a cursor using the specified data and mask (in MSB format).
* The cursor width must be a multiple of 8 bits.
*
* The cursor is created in black and white according to the following:
* data mask resulting pixel on screen
* 0 1 White
* 1 1 Black
* 0 0 Transparent
* 1 0 Inverted color if possible, black if not.
*
* Cursors created with this function must be freed with SDL_FreeCursor().
*/
extern DECLSPEC SDL_Cursor *SDL_CreateCursor
(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
 
/*
* Set the currently active cursor to the specified one.
* If the cursor is currently visible, the change will be immediately
* represented on the display.
*/
extern DECLSPEC void SDL_SetCursor(SDL_Cursor *cursor);
 
/*
* Returns the currently active cursor.
*/
extern DECLSPEC SDL_Cursor * SDL_GetCursor(void);
 
/*
* Deallocates a cursor created with SDL_CreateCursor().
*/
extern DECLSPEC void SDL_FreeCursor(SDL_Cursor *cursor);
 
/*
* Toggle whether or not the cursor is shown on the screen.
* The cursor start off displayed, but can be turned off.
* SDL_ShowCursor() returns 1 if the cursor was being displayed
* before the call, or 0 if it was not. You can query the current
* state by passing a 'toggle' value of -1.
*/
extern DECLSPEC int SDL_ShowCursor(int toggle);
 
/* Used as a mask when testing buttons in buttonstate
Button 1: Left mouse button
Button 2: Middle mouse button
Button 3: Right mouse button
*/
#define SDL_BUTTON(X) (SDL_PRESSED<<(X-1))
#define SDL_BUTTON_LEFT 1
#define SDL_BUTTON_MIDDLE 2
#define SDL_BUTTON_RIGHT 3
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_mouse_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_mutex.h
0,0 → 1,163
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_mutex.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
#ifndef _SDL_mutex_h
#define _SDL_mutex_h
 
/* Functions to provide thread synchronization primitives
 
These are independent of the other SDL routines.
*/
 
#include "SDL_main.h"
#include "SDL_types.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* Synchronization functions which can time out return this value
if they time out.
*/
#define SDL_MUTEX_TIMEDOUT 1
 
/* This is the timeout value which corresponds to never time out */
#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
 
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Mutex functions */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
/* The SDL mutex structure, defined in SDL_mutex.c */
struct SDL_mutex;
typedef struct SDL_mutex SDL_mutex;
 
/* Create a mutex, initialized unlocked */
extern DECLSPEC SDL_mutex * SDL_CreateMutex(void);
 
/* Lock the mutex (Returns 0, or -1 on error) */
#define SDL_LockMutex(m) SDL_mutexP(m)
extern DECLSPEC int SDL_mutexP(SDL_mutex *mutex);
 
/* Unlock the mutex (Returns 0, or -1 on error) */
#define SDL_UnlockMutex(m) SDL_mutexV(m)
extern DECLSPEC int SDL_mutexV(SDL_mutex *mutex);
 
/* Destroy a mutex */
extern DECLSPEC void SDL_DestroyMutex(SDL_mutex *mutex);
 
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Semaphore functions */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
/* The SDL semaphore structure, defined in SDL_sem.c */
struct SDL_semaphore;
typedef struct SDL_semaphore SDL_sem;
 
/* Create a semaphore, initialized with value, returns NULL on failure. */
extern DECLSPEC SDL_sem * SDL_CreateSemaphore(Uint32 initial_value);
 
/* Destroy a semaphore */
extern DECLSPEC void SDL_DestroySemaphore(SDL_sem *sem);
 
/* This function suspends the calling thread until the semaphore pointed
* to by sem has a positive count. It then atomically decreases the semaphore
* count.
*/
extern DECLSPEC int SDL_SemWait(SDL_sem *sem);
 
/* Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds,
SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error.
*/
extern DECLSPEC int SDL_SemTryWait(SDL_sem *sem);
 
/* Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if
the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
the allotted time, and -1 on error.
On some platforms this function is implemented by looping with a delay
of 1 ms, and so should be avoided if possible.
*/
extern DECLSPEC int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms);
 
/* Atomically increases the semaphore's count (not blocking), returns 0,
or -1 on error.
*/
extern DECLSPEC int SDL_SemPost(SDL_sem *sem);
 
/* Returns the current count of the semaphore */
extern DECLSPEC Uint32 SDL_SemValue(SDL_sem *sem);
 
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Condition variable functions */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
/* The SDL condition variable structure, defined in SDL_cond.c */
struct SDL_cond;
typedef struct SDL_cond SDL_cond;
 
/* Create a condition variable */
extern DECLSPEC SDL_cond * SDL_CreateCond(void);
 
/* Destroy a condition variable */
extern DECLSPEC void SDL_DestroyCond(SDL_cond *cond);
 
/* Restart one of the threads that are waiting on the condition variable,
returns 0 or -1 on error.
*/
extern DECLSPEC int SDL_CondSignal(SDL_cond *cond);
 
/* Restart all threads that are waiting on the condition variable,
returns 0 or -1 on error.
*/
extern DECLSPEC int SDL_CondBroadcast(SDL_cond *cond);
 
/* Wait on the condition variable, unlocking the provided mutex.
The mutex must be locked before entering this function!
Returns 0 when it is signaled, or -1 on error.
*/
extern DECLSPEC int SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);
 
/* Waits for at most 'ms' milliseconds, and returns 0 if the condition
variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
signaled in the allotted time, and -1 on error.
On some platforms this function is implemented by looping with a delay
of 1 ms, and so should be avoided if possible.
*/
extern DECLSPEC int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_mutex_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_name.h
0,0 → 1,11
 
#ifndef _SDLname_h_
#define _SDLname_h_
 
#if defined(__STDC__) || defined(__cplusplus)
#define NeedFunctionPrototypes 1
#endif
 
#define SDL_NAME(X) SDL_##X
 
#endif /* _SDLname_h_ */
/contrib/media/updf/include/SDL/SDL_opengl.h
0,0 → 1,5968
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2004 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@libsdl.org
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_opengl.h,v 1.9 2004/02/17 23:29:52 slouken Exp $";
#endif
 
/* This is a simple file to encapsulate the OpenGL API headers */
 
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
#define NOMINMAX /* Don't defined min() and max() */
#endif
#include <windows.h>
#endif
#if defined(__APPLE__) && defined(__MACH__)
#include <OpenGL/gl.h> /* Header File For The OpenGL Library */
#include <OpenGL/glu.h> /* Header File For The GLU Library */
#else
#ifndef NO_SDL_GLEXT
#define __glext_h_ /* Don't let gl.h include glext.h */
#endif
#include <GL/gl.h> /* Header File For The OpenGL Library */
#include <GL/glu.h> /* Header File For The GLU Library */
#ifndef NO_SDL_GLEXT
#undef __glext_h_
#endif
#endif
 
/* This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials.
It is included here because glext.h is not available on some systems.
If you don't want this version included, simply define "NO_SDL_GLEXT"
*/
#ifndef NO_SDL_GLEXT
#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY)
#define __glext_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2002 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: This software was created using the
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
** not been independently verified as being compliant with the OpenGL(R)
** version 1.2.1 Specification.
*/
 
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
 
#ifndef APIENTRY
#define APIENTRY
#endif
#ifndef APIENTRYP
#define APIENTRYP APIENTRY *
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
 
/*************************************************************/
 
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated 2003/1/12 */
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
#define GL_GLEXT_VERSION 21
 
#ifndef GL_VERSION_1_2
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
#define GL_UNSIGNED_INT_8_8_8_8 0x8035
#define GL_UNSIGNED_INT_10_10_10_2 0x8036
#define GL_RESCALE_NORMAL 0x803A
#define GL_TEXTURE_BINDING_3D 0x806A
#define GL_PACK_SKIP_IMAGES 0x806B
#define GL_PACK_IMAGE_HEIGHT 0x806C
#define GL_UNPACK_SKIP_IMAGES 0x806D
#define GL_UNPACK_IMAGE_HEIGHT 0x806E
#define GL_TEXTURE_3D 0x806F
#define GL_PROXY_TEXTURE_3D 0x8070
#define GL_TEXTURE_DEPTH 0x8071
#define GL_TEXTURE_WRAP_R 0x8072
#define GL_MAX_3D_TEXTURE_SIZE 0x8073
#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
#define GL_BGR 0x80E0
#define GL_BGRA 0x80E1
#define GL_MAX_ELEMENTS_VERTICES 0x80E8
#define GL_MAX_ELEMENTS_INDICES 0x80E9
#define GL_CLAMP_TO_EDGE 0x812F
#define GL_TEXTURE_MIN_LOD 0x813A
#define GL_TEXTURE_MAX_LOD 0x813B
#define GL_TEXTURE_BASE_LEVEL 0x813C
#define GL_TEXTURE_MAX_LEVEL 0x813D
#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
#define GL_SINGLE_COLOR 0x81F9
#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
#endif
 
#ifndef GL_ARB_imaging
#define GL_CONSTANT_COLOR 0x8001
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
#define GL_CONSTANT_ALPHA 0x8003
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
#define GL_BLEND_COLOR 0x8005
#define GL_FUNC_ADD 0x8006
#define GL_MIN 0x8007
#define GL_MAX 0x8008
#define GL_BLEND_EQUATION 0x8009
#define GL_FUNC_SUBTRACT 0x800A
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
#define GL_CONVOLUTION_1D 0x8010
#define GL_CONVOLUTION_2D 0x8011
#define GL_SEPARABLE_2D 0x8012
#define GL_CONVOLUTION_BORDER_MODE 0x8013
#define GL_CONVOLUTION_FILTER_SCALE 0x8014
#define GL_CONVOLUTION_FILTER_BIAS 0x8015
#define GL_REDUCE 0x8016
#define GL_CONVOLUTION_FORMAT 0x8017
#define GL_CONVOLUTION_WIDTH 0x8018
#define GL_CONVOLUTION_HEIGHT 0x8019
#define GL_MAX_CONVOLUTION_WIDTH 0x801A
#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
#define GL_HISTOGRAM 0x8024
#define GL_PROXY_HISTOGRAM 0x8025
#define GL_HISTOGRAM_WIDTH 0x8026
#define GL_HISTOGRAM_FORMAT 0x8027
#define GL_HISTOGRAM_RED_SIZE 0x8028
#define GL_HISTOGRAM_GREEN_SIZE 0x8029
#define GL_HISTOGRAM_BLUE_SIZE 0x802A
#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
#define GL_HISTOGRAM_SINK 0x802D
#define GL_MINMAX 0x802E
#define GL_MINMAX_FORMAT 0x802F
#define GL_MINMAX_SINK 0x8030
#define GL_TABLE_TOO_LARGE 0x8031
#define GL_COLOR_MATRIX 0x80B1
#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
#define GL_COLOR_TABLE 0x80D0
#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
#define GL_PROXY_COLOR_TABLE 0x80D3
#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
#define GL_COLOR_TABLE_SCALE 0x80D6
#define GL_COLOR_TABLE_BIAS 0x80D7
#define GL_COLOR_TABLE_FORMAT 0x80D8
#define GL_COLOR_TABLE_WIDTH 0x80D9
#define GL_COLOR_TABLE_RED_SIZE 0x80DA
#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
#define GL_CONSTANT_BORDER 0x8151
#define GL_REPLICATE_BORDER 0x8153
#define GL_CONVOLUTION_BORDER_COLOR 0x8154
#endif
 
#ifndef GL_VERSION_1_3
#define GL_TEXTURE0 0x84C0
#define GL_TEXTURE1 0x84C1
#define GL_TEXTURE2 0x84C2
#define GL_TEXTURE3 0x84C3
#define GL_TEXTURE4 0x84C4
#define GL_TEXTURE5 0x84C5
#define GL_TEXTURE6 0x84C6
#define GL_TEXTURE7 0x84C7
#define GL_TEXTURE8 0x84C8
#define GL_TEXTURE9 0x84C9
#define GL_TEXTURE10 0x84CA
#define GL_TEXTURE11 0x84CB
#define GL_TEXTURE12 0x84CC
#define GL_TEXTURE13 0x84CD
#define GL_TEXTURE14 0x84CE
#define GL_TEXTURE15 0x84CF
#define GL_TEXTURE16 0x84D0
#define GL_TEXTURE17 0x84D1
#define GL_TEXTURE18 0x84D2
#define GL_TEXTURE19 0x84D3
#define GL_TEXTURE20 0x84D4
#define GL_TEXTURE21 0x84D5
#define GL_TEXTURE22 0x84D6
#define GL_TEXTURE23 0x84D7
#define GL_TEXTURE24 0x84D8
#define GL_TEXTURE25 0x84D9
#define GL_TEXTURE26 0x84DA
#define GL_TEXTURE27 0x84DB
#define GL_TEXTURE28 0x84DC
#define GL_TEXTURE29 0x84DD
#define GL_TEXTURE30 0x84DE
#define GL_TEXTURE31 0x84DF
#define GL_ACTIVE_TEXTURE 0x84E0
#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
#define GL_MAX_TEXTURE_UNITS 0x84E2
#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
#define GL_MULTISAMPLE 0x809D
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
#define GL_SAMPLE_COVERAGE 0x80A0
#define GL_SAMPLE_BUFFERS 0x80A8
#define GL_SAMPLES 0x80A9
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
#define GL_MULTISAMPLE_BIT 0x20000000
#define GL_NORMAL_MAP 0x8511
#define GL_REFLECTION_MAP 0x8512
#define GL_TEXTURE_CUBE_MAP 0x8513
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
#define GL_COMPRESSED_ALPHA 0x84E9
#define GL_COMPRESSED_LUMINANCE 0x84EA
#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
#define GL_COMPRESSED_INTENSITY 0x84EC
#define GL_COMPRESSED_RGB 0x84ED
#define GL_COMPRESSED_RGBA 0x84EE
#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
#define GL_TEXTURE_COMPRESSED 0x86A1
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
#define GL_CLAMP_TO_BORDER 0x812D
#define GL_CLAMP_TO_BORDER_SGIS 0x812D
#define GL_COMBINE 0x8570
#define GL_COMBINE_RGB 0x8571
#define GL_COMBINE_ALPHA 0x8572
#define GL_SOURCE0_RGB 0x8580
#define GL_SOURCE1_RGB 0x8581
#define GL_SOURCE2_RGB 0x8582
#define GL_SOURCE0_ALPHA 0x8588
#define GL_SOURCE1_ALPHA 0x8589
#define GL_SOURCE2_ALPHA 0x858A
#define GL_OPERAND0_RGB 0x8590
#define GL_OPERAND1_RGB 0x8591
#define GL_OPERAND2_RGB 0x8592
#define GL_OPERAND0_ALPHA 0x8598
#define GL_OPERAND1_ALPHA 0x8599
#define GL_OPERAND2_ALPHA 0x859A
#define GL_RGB_SCALE 0x8573
#define GL_ADD_SIGNED 0x8574
#define GL_INTERPOLATE 0x8575
#define GL_SUBTRACT 0x84E7
#define GL_CONSTANT 0x8576
#define GL_PRIMARY_COLOR 0x8577
#define GL_PREVIOUS 0x8578
#define GL_DOT3_RGB 0x86AE
#define GL_DOT3_RGBA 0x86AF
#endif
 
#ifndef GL_VERSION_1_4
#define GL_BLEND_DST_RGB 0x80C8
#define GL_BLEND_SRC_RGB 0x80C9
#define GL_BLEND_DST_ALPHA 0x80CA
#define GL_BLEND_SRC_ALPHA 0x80CB
#define GL_POINT_SIZE_MIN 0x8126
#define GL_POINT_SIZE_MAX 0x8127
#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
#define GL_GENERATE_MIPMAP 0x8191
#define GL_GENERATE_MIPMAP_HINT 0x8192
#define GL_DEPTH_COMPONENT16 0x81A5
#define GL_DEPTH_COMPONENT24 0x81A6
#define GL_DEPTH_COMPONENT32 0x81A7
#define GL_MIRRORED_REPEAT 0x8370
#define GL_FOG_COORDINATE_SOURCE 0x8450
#define GL_FOG_COORDINATE 0x8451
#define GL_FRAGMENT_DEPTH 0x8452
#define GL_CURRENT_FOG_COORDINATE 0x8453
#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
#define GL_FOG_COORDINATE_ARRAY 0x8457
#define GL_COLOR_SUM 0x8458
#define GL_CURRENT_SECONDARY_COLOR 0x8459
#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
#define GL_SECONDARY_COLOR_ARRAY 0x845E
#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
#define GL_TEXTURE_FILTER_CONTROL 0x8500
#define GL_TEXTURE_LOD_BIAS 0x8501
#define GL_INCR_WRAP 0x8507
#define GL_DECR_WRAP 0x8508
#define GL_TEXTURE_DEPTH_SIZE 0x884A
#define GL_DEPTH_TEXTURE_MODE 0x884B
#define GL_TEXTURE_COMPARE_MODE 0x884C
#define GL_TEXTURE_COMPARE_FUNC 0x884D
#define GL_COMPARE_R_TO_TEXTURE 0x884E
#endif
 
#ifndef GL_VERSION_1_5
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
#define GL_QUERY_COUNTER_BITS 0x8864
#define GL_CURRENT_QUERY 0x8865
#define GL_QUERY_RESULT 0x8866
#define GL_QUERY_RESULT_AVAILABLE 0x8867
#define GL_ARRAY_BUFFER 0x8892
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_ARRAY_BUFFER_BINDING 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
#define GL_READ_ONLY 0x88B8
#define GL_WRITE_ONLY 0x88B9
#define GL_READ_WRITE 0x88BA
#define GL_BUFFER_ACCESS 0x88BB
#define GL_BUFFER_MAPPED 0x88BC
#define GL_BUFFER_MAP_POINTER 0x88BD
#define GL_STREAM_DRAW 0x88E0
#define GL_STREAM_READ 0x88E1
#define GL_STREAM_COPY 0x88E2
#define GL_STATIC_DRAW 0x88E4
#define GL_STATIC_READ 0x88E5
#define GL_STATIC_COPY 0x88E6
#define GL_DYNAMIC_DRAW 0x88E8
#define GL_DYNAMIC_READ 0x88E9
#define GL_DYNAMIC_COPY 0x88EA
#define GL_SAMPLES_PASSED 0x8914
#define GL_FOG_COORD_SOURCE GL_FOG_COORDINATE_SOURCE
#define GL_FOG_COORD GL_FOG_COORDINATE
#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
#define GL_SRC0_RGB GL_SOURCE0_RGB
#define GL_SRC1_RGB GL_SOURCE1_RGB
#define GL_SRC2_RGB GL_SOURCE2_RGB
#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA
#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
#endif
 
#ifndef GL_ARB_multitexture
#define GL_TEXTURE0_ARB 0x84C0
#define GL_TEXTURE1_ARB 0x84C1
#define GL_TEXTURE2_ARB 0x84C2
#define GL_TEXTURE3_ARB 0x84C3
#define GL_TEXTURE4_ARB 0x84C4
#define GL_TEXTURE5_ARB 0x84C5
#define GL_TEXTURE6_ARB 0x84C6
#define GL_TEXTURE7_ARB 0x84C7
#define GL_TEXTURE8_ARB 0x84C8
#define GL_TEXTURE9_ARB 0x84C9
#define GL_TEXTURE10_ARB 0x84CA
#define GL_TEXTURE11_ARB 0x84CB
#define GL_TEXTURE12_ARB 0x84CC
#define GL_TEXTURE13_ARB 0x84CD
#define GL_TEXTURE14_ARB 0x84CE
#define GL_TEXTURE15_ARB 0x84CF
#define GL_TEXTURE16_ARB 0x84D0
#define GL_TEXTURE17_ARB 0x84D1
#define GL_TEXTURE18_ARB 0x84D2
#define GL_TEXTURE19_ARB 0x84D3
#define GL_TEXTURE20_ARB 0x84D4
#define GL_TEXTURE21_ARB 0x84D5
#define GL_TEXTURE22_ARB 0x84D6
#define GL_TEXTURE23_ARB 0x84D7
#define GL_TEXTURE24_ARB 0x84D8
#define GL_TEXTURE25_ARB 0x84D9
#define GL_TEXTURE26_ARB 0x84DA
#define GL_TEXTURE27_ARB 0x84DB
#define GL_TEXTURE28_ARB 0x84DC
#define GL_TEXTURE29_ARB 0x84DD
#define GL_TEXTURE30_ARB 0x84DE
#define GL_TEXTURE31_ARB 0x84DF
#define GL_ACTIVE_TEXTURE_ARB 0x84E0
#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
#endif
 
#ifndef GL_ARB_transpose_matrix
#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
#endif
 
#ifndef GL_ARB_multisample
#define GL_MULTISAMPLE_ARB 0x809D
#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
#define GL_SAMPLE_COVERAGE_ARB 0x80A0
#define GL_SAMPLE_BUFFERS_ARB 0x80A8
#define GL_SAMPLES_ARB 0x80A9
#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
#define GL_MULTISAMPLE_BIT_ARB 0x20000000
#endif
 
#ifndef GL_ARB_texture_env_add
#endif
 
#ifndef GL_ARB_texture_cube_map
#define GL_NORMAL_MAP_ARB 0x8511
#define GL_REFLECTION_MAP_ARB 0x8512
#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
#endif
 
#ifndef GL_ARB_texture_compression
#define GL_COMPRESSED_ALPHA_ARB 0x84E9
#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
#define GL_COMPRESSED_RGB_ARB 0x84ED
#define GL_COMPRESSED_RGBA_ARB 0x84EE
#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
#endif
 
#ifndef GL_ARB_texture_border_clamp
#define GL_CLAMP_TO_BORDER_ARB 0x812D
#endif
 
#ifndef GL_ARB_point_parameters
#define GL_POINT_SIZE_MIN_ARB 0x8126
#define GL_POINT_SIZE_MAX_ARB 0x8127
#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
#endif
 
#ifndef GL_ARB_vertex_blend
#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
#define GL_VERTEX_BLEND_ARB 0x86A7
#define GL_CURRENT_WEIGHT_ARB 0x86A8
#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
#define GL_WEIGHT_ARRAY_ARB 0x86AD
#define GL_MODELVIEW0_ARB 0x1700
#define GL_MODELVIEW1_ARB 0x850A
#define GL_MODELVIEW2_ARB 0x8722
#define GL_MODELVIEW3_ARB 0x8723
#define GL_MODELVIEW4_ARB 0x8724
#define GL_MODELVIEW5_ARB 0x8725
#define GL_MODELVIEW6_ARB 0x8726
#define GL_MODELVIEW7_ARB 0x8727
#define GL_MODELVIEW8_ARB 0x8728
#define GL_MODELVIEW9_ARB 0x8729
#define GL_MODELVIEW10_ARB 0x872A
#define GL_MODELVIEW11_ARB 0x872B
#define GL_MODELVIEW12_ARB 0x872C
#define GL_MODELVIEW13_ARB 0x872D
#define GL_MODELVIEW14_ARB 0x872E
#define GL_MODELVIEW15_ARB 0x872F
#define GL_MODELVIEW16_ARB 0x8730
#define GL_MODELVIEW17_ARB 0x8731
#define GL_MODELVIEW18_ARB 0x8732
#define GL_MODELVIEW19_ARB 0x8733
#define GL_MODELVIEW20_ARB 0x8734
#define GL_MODELVIEW21_ARB 0x8735
#define GL_MODELVIEW22_ARB 0x8736
#define GL_MODELVIEW23_ARB 0x8737
#define GL_MODELVIEW24_ARB 0x8738
#define GL_MODELVIEW25_ARB 0x8739
#define GL_MODELVIEW26_ARB 0x873A
#define GL_MODELVIEW27_ARB 0x873B
#define GL_MODELVIEW28_ARB 0x873C
#define GL_MODELVIEW29_ARB 0x873D
#define GL_MODELVIEW30_ARB 0x873E
#define GL_MODELVIEW31_ARB 0x873F
#endif
 
#ifndef GL_ARB_matrix_palette
#define GL_MATRIX_PALETTE_ARB 0x8840
#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
#endif
 
#ifndef GL_ARB_texture_env_combine
#define GL_COMBINE_ARB 0x8570
#define GL_COMBINE_RGB_ARB 0x8571
#define GL_COMBINE_ALPHA_ARB 0x8572
#define GL_SOURCE0_RGB_ARB 0x8580
#define GL_SOURCE1_RGB_ARB 0x8581
#define GL_SOURCE2_RGB_ARB 0x8582
#define GL_SOURCE0_ALPHA_ARB 0x8588
#define GL_SOURCE1_ALPHA_ARB 0x8589
#define GL_SOURCE2_ALPHA_ARB 0x858A
#define GL_OPERAND0_RGB_ARB 0x8590
#define GL_OPERAND1_RGB_ARB 0x8591
#define GL_OPERAND2_RGB_ARB 0x8592
#define GL_OPERAND0_ALPHA_ARB 0x8598
#define GL_OPERAND1_ALPHA_ARB 0x8599
#define GL_OPERAND2_ALPHA_ARB 0x859A
#define GL_RGB_SCALE_ARB 0x8573
#define GL_ADD_SIGNED_ARB 0x8574
#define GL_INTERPOLATE_ARB 0x8575
#define GL_SUBTRACT_ARB 0x84E7
#define GL_CONSTANT_ARB 0x8576
#define GL_PRIMARY_COLOR_ARB 0x8577
#define GL_PREVIOUS_ARB 0x8578
#endif
 
#ifndef GL_ARB_texture_env_crossbar
#endif
 
#ifndef GL_ARB_texture_env_dot3
#define GL_DOT3_RGB_ARB 0x86AE
#define GL_DOT3_RGBA_ARB 0x86AF
#endif
 
#ifndef GL_ARB_texture_mirrored_repeat
#define GL_MIRRORED_REPEAT_ARB 0x8370
#endif
 
#ifndef GL_ARB_depth_texture
#define GL_DEPTH_COMPONENT16_ARB 0x81A5
#define GL_DEPTH_COMPONENT24_ARB 0x81A6
#define GL_DEPTH_COMPONENT32_ARB 0x81A7
#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
#endif
 
#ifndef GL_ARB_shadow
#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
#endif
 
#ifndef GL_ARB_shadow_ambient
#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
#endif
 
#ifndef GL_ARB_window_pos
#endif
 
#ifndef GL_ARB_vertex_program
#define GL_COLOR_SUM_ARB 0x8458
#define GL_VERTEX_PROGRAM_ARB 0x8620
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
#define GL_PROGRAM_LENGTH_ARB 0x8627
#define GL_PROGRAM_STRING_ARB 0x8628
#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
#define GL_CURRENT_MATRIX_ARB 0x8641
#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
#define GL_PROGRAM_BINDING_ARB 0x8677
#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
#define GL_PROGRAM_FORMAT_ARB 0x8876
#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
#define GL_MATRIX0_ARB 0x88C0
#define GL_MATRIX1_ARB 0x88C1
#define GL_MATRIX2_ARB 0x88C2
#define GL_MATRIX3_ARB 0x88C3
#define GL_MATRIX4_ARB 0x88C4
#define GL_MATRIX5_ARB 0x88C5
#define GL_MATRIX6_ARB 0x88C6
#define GL_MATRIX7_ARB 0x88C7
#define GL_MATRIX8_ARB 0x88C8
#define GL_MATRIX9_ARB 0x88C9
#define GL_MATRIX10_ARB 0x88CA
#define GL_MATRIX11_ARB 0x88CB
#define GL_MATRIX12_ARB 0x88CC
#define GL_MATRIX13_ARB 0x88CD
#define GL_MATRIX14_ARB 0x88CE
#define GL_MATRIX15_ARB 0x88CF
#define GL_MATRIX16_ARB 0x88D0
#define GL_MATRIX17_ARB 0x88D1
#define GL_MATRIX18_ARB 0x88D2
#define GL_MATRIX19_ARB 0x88D3
#define GL_MATRIX20_ARB 0x88D4
#define GL_MATRIX21_ARB 0x88D5
#define GL_MATRIX22_ARB 0x88D6
#define GL_MATRIX23_ARB 0x88D7
#define GL_MATRIX24_ARB 0x88D8
#define GL_MATRIX25_ARB 0x88D9
#define GL_MATRIX26_ARB 0x88DA
#define GL_MATRIX27_ARB 0x88DB
#define GL_MATRIX28_ARB 0x88DC
#define GL_MATRIX29_ARB 0x88DD
#define GL_MATRIX30_ARB 0x88DE
#define GL_MATRIX31_ARB 0x88DF
#endif
 
#ifndef GL_ARB_fragment_program
#define GL_FRAGMENT_PROGRAM_ARB 0x8804
#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
#endif
 
#ifndef GL_ARB_vertex_buffer_object
#define GL_BUFFER_SIZE_ARB 0x8764
#define GL_BUFFER_USAGE_ARB 0x8765
#define GL_ARRAY_BUFFER_ARB 0x8892
#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
#define GL_READ_ONLY_ARB 0x88B8
#define GL_WRITE_ONLY_ARB 0x88B9
#define GL_READ_WRITE_ARB 0x88BA
#define GL_BUFFER_ACCESS_ARB 0x88BB
#define GL_BUFFER_MAPPED_ARB 0x88BC
#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
#define GL_STREAM_DRAW_ARB 0x88E0
#define GL_STREAM_READ_ARB 0x88E1
#define GL_STREAM_COPY_ARB 0x88E2
#define GL_STATIC_DRAW_ARB 0x88E4
#define GL_STATIC_READ_ARB 0x88E5
#define GL_STATIC_COPY_ARB 0x88E6
#define GL_DYNAMIC_DRAW_ARB 0x88E8
#define GL_DYNAMIC_READ_ARB 0x88E9
#define GL_DYNAMIC_COPY_ARB 0x88EA
#endif
 
#ifndef GL_ARB_occlusion_query
#define GL_QUERY_COUNTER_BITS_ARB 0x8864
#define GL_CURRENT_QUERY_ARB 0x8865
#define GL_QUERY_RESULT_ARB 0x8866
#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
#define GL_SAMPLES_PASSED_ARB 0x8914
#endif
 
#ifndef GL_ARB_shader_objects
#define GL_PROGRAM_OBJECT_ARB 0x8B40
#define GL_SHADER_OBJECT_ARB 0x8B48
#define GL_OBJECT_TYPE_ARB 0x8B4E
#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
#define GL_FLOAT_VEC2_ARB 0x8B50
#define GL_FLOAT_VEC3_ARB 0x8B51
#define GL_FLOAT_VEC4_ARB 0x8B52
#define GL_INT_VEC2_ARB 0x8B53
#define GL_INT_VEC3_ARB 0x8B54
#define GL_INT_VEC4_ARB 0x8B55
#define GL_BOOL_ARB 0x8B56
#define GL_BOOL_VEC2_ARB 0x8B57
#define GL_BOOL_VEC3_ARB 0x8B58
#define GL_BOOL_VEC4_ARB 0x8B59
#define GL_FLOAT_MAT2_ARB 0x8B5A
#define GL_FLOAT_MAT3_ARB 0x8B5B
#define GL_FLOAT_MAT4_ARB 0x8B5C
#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
#endif
 
#ifndef GL_ARB_vertex_shader
#define GL_VERTEX_SHADER_ARB 0x8B31
#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
#endif
 
#ifndef GL_ARB_fragment_shader
#define GL_FRAGMENT_SHADER_ARB 0x8B30
#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
#endif
 
#ifndef GL_ARB_shading_language_100
#endif
 
#ifndef GL_ARB_texture_non_power_of_two
#endif
 
#ifndef GL_ARB_point_sprite
#define GL_POINT_SPRITE_ARB 0x8861
#define GL_COORD_REPLACE_ARB 0x8862
#endif
 
#ifndef GL_EXT_abgr
#define GL_ABGR_EXT 0x8000
#endif
 
#ifndef GL_EXT_blend_color
#define GL_CONSTANT_COLOR_EXT 0x8001
#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
#define GL_CONSTANT_ALPHA_EXT 0x8003
#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
#define GL_BLEND_COLOR_EXT 0x8005
#endif
 
#ifndef GL_EXT_polygon_offset
#define GL_POLYGON_OFFSET_EXT 0x8037
#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
#endif
 
#ifndef GL_EXT_texture
#define GL_ALPHA4_EXT 0x803B
#define GL_ALPHA8_EXT 0x803C
#define GL_ALPHA12_EXT 0x803D
#define GL_ALPHA16_EXT 0x803E
#define GL_LUMINANCE4_EXT 0x803F
#define GL_LUMINANCE8_EXT 0x8040
#define GL_LUMINANCE12_EXT 0x8041
#define GL_LUMINANCE16_EXT 0x8042
#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
#define GL_INTENSITY_EXT 0x8049
#define GL_INTENSITY4_EXT 0x804A
#define GL_INTENSITY8_EXT 0x804B
#define GL_INTENSITY12_EXT 0x804C
#define GL_INTENSITY16_EXT 0x804D
#define GL_RGB2_EXT 0x804E
#define GL_RGB4_EXT 0x804F
#define GL_RGB5_EXT 0x8050
#define GL_RGB8_EXT 0x8051
#define GL_RGB10_EXT 0x8052
#define GL_RGB12_EXT 0x8053
#define GL_RGB16_EXT 0x8054
#define GL_RGBA2_EXT 0x8055
#define GL_RGBA4_EXT 0x8056
#define GL_RGB5_A1_EXT 0x8057
#define GL_RGBA8_EXT 0x8058
#define GL_RGB10_A2_EXT 0x8059
#define GL_RGBA12_EXT 0x805A
#define GL_RGBA16_EXT 0x805B
#define GL_TEXTURE_RED_SIZE_EXT 0x805C
#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
#define GL_REPLACE_EXT 0x8062
#define GL_PROXY_TEXTURE_1D_EXT 0x8063
#define GL_PROXY_TEXTURE_2D_EXT 0x8064
#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
#endif
 
#ifndef GL_EXT_texture3D
#define GL_PACK_SKIP_IMAGES_EXT 0x806B
#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
#define GL_TEXTURE_3D_EXT 0x806F
#define GL_PROXY_TEXTURE_3D_EXT 0x8070
#define GL_TEXTURE_DEPTH_EXT 0x8071
#define GL_TEXTURE_WRAP_R_EXT 0x8072
#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
#endif
 
#ifndef GL_SGIS_texture_filter4
#define GL_FILTER4_SGIS 0x8146
#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
#endif
 
#ifndef GL_EXT_subtexture
#endif
 
#ifndef GL_EXT_copy_texture
#endif
 
#ifndef GL_EXT_histogram
#define GL_HISTOGRAM_EXT 0x8024
#define GL_PROXY_HISTOGRAM_EXT 0x8025
#define GL_HISTOGRAM_WIDTH_EXT 0x8026
#define GL_HISTOGRAM_FORMAT_EXT 0x8027
#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
#define GL_HISTOGRAM_SINK_EXT 0x802D
#define GL_MINMAX_EXT 0x802E
#define GL_MINMAX_FORMAT_EXT 0x802F
#define GL_MINMAX_SINK_EXT 0x8030
#define GL_TABLE_TOO_LARGE_EXT 0x8031
#endif
 
#ifndef GL_EXT_convolution
#define GL_CONVOLUTION_1D_EXT 0x8010
#define GL_CONVOLUTION_2D_EXT 0x8011
#define GL_SEPARABLE_2D_EXT 0x8012
#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
#define GL_REDUCE_EXT 0x8016
#define GL_CONVOLUTION_FORMAT_EXT 0x8017
#define GL_CONVOLUTION_WIDTH_EXT 0x8018
#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
#endif
 
#ifndef GL_SGI_color_matrix
#define GL_COLOR_MATRIX_SGI 0x80B1
#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
#endif
 
#ifndef GL_SGI_color_table
#define GL_COLOR_TABLE_SGI 0x80D0
#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
#endif
 
#ifndef GL_SGIS_pixel_texture
#define GL_PIXEL_TEXTURE_SGIS 0x8353
#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
#endif
 
#ifndef GL_SGIX_pixel_texture
#define GL_PIXEL_TEX_GEN_SGIX 0x8139
#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
#endif
 
#ifndef GL_SGIS_texture4D
#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
#define GL_TEXTURE_4D_SGIS 0x8134
#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
#define GL_TEXTURE_4DSIZE_SGIS 0x8136
#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
#endif
 
#ifndef GL_SGI_texture_color_table
#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
#endif
 
#ifndef GL_EXT_cmyka
#define GL_CMYK_EXT 0x800C
#define GL_CMYKA_EXT 0x800D
#define GL_PACK_CMYK_HINT_EXT 0x800E
#define GL_UNPACK_CMYK_HINT_EXT 0x800F
#endif
 
#ifndef GL_EXT_texture_object
#define GL_TEXTURE_PRIORITY_EXT 0x8066
#define GL_TEXTURE_RESIDENT_EXT 0x8067
#define GL_TEXTURE_1D_BINDING_EXT 0x8068
#define GL_TEXTURE_2D_BINDING_EXT 0x8069
#define GL_TEXTURE_3D_BINDING_EXT 0x806A
#endif
 
#ifndef GL_SGIS_detail_texture
#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
#define GL_LINEAR_DETAIL_SGIS 0x8097
#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
#endif
 
#ifndef GL_SGIS_sharpen_texture
#define GL_LINEAR_SHARPEN_SGIS 0x80AD
#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
#endif
 
#ifndef GL_EXT_packed_pixels
#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
#endif
 
#ifndef GL_SGIS_texture_lod
#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
#endif
 
#ifndef GL_SGIS_multisample
#define GL_MULTISAMPLE_SGIS 0x809D
#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
#define GL_SAMPLE_MASK_SGIS 0x80A0
#define GL_1PASS_SGIS 0x80A1
#define GL_2PASS_0_SGIS 0x80A2
#define GL_2PASS_1_SGIS 0x80A3
#define GL_4PASS_0_SGIS 0x80A4
#define GL_4PASS_1_SGIS 0x80A5
#define GL_4PASS_2_SGIS 0x80A6
#define GL_4PASS_3_SGIS 0x80A7
#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
#define GL_SAMPLES_SGIS 0x80A9
#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
#define GL_SAMPLE_PATTERN_SGIS 0x80AC
#endif
 
#ifndef GL_EXT_rescale_normal
#define GL_RESCALE_NORMAL_EXT 0x803A
#endif
 
#ifndef GL_EXT_vertex_array
#define GL_VERTEX_ARRAY_EXT 0x8074
#define GL_NORMAL_ARRAY_EXT 0x8075
#define GL_COLOR_ARRAY_EXT 0x8076
#define GL_INDEX_ARRAY_EXT 0x8077
#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
#endif
 
#ifndef GL_EXT_misc_attribute
#endif
 
#ifndef GL_SGIS_generate_mipmap
#define GL_GENERATE_MIPMAP_SGIS 0x8191
#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
#endif
 
#ifndef GL_SGIX_clipmap
#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
#endif
 
#ifndef GL_SGIX_shadow
#define GL_TEXTURE_COMPARE_SGIX 0x819A
#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
#endif
 
#ifndef GL_SGIS_texture_edge_clamp
#define GL_CLAMP_TO_EDGE_SGIS 0x812F
#endif
 
#ifndef GL_EXT_blend_minmax
#define GL_FUNC_ADD_EXT 0x8006
#define GL_MIN_EXT 0x8007
#define GL_MAX_EXT 0x8008
#define GL_BLEND_EQUATION_EXT 0x8009
#endif
 
#ifndef GL_EXT_blend_subtract
#define GL_FUNC_SUBTRACT_EXT 0x800A
#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
#endif
 
#ifndef GL_EXT_blend_logic_op
#endif
 
#ifndef GL_SGIX_interlace
#define GL_INTERLACE_SGIX 0x8094
#endif
 
#ifndef GL_SGIX_pixel_tiles
#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
#endif
 
#ifndef GL_SGIS_texture_select
#define GL_DUAL_ALPHA4_SGIS 0x8110
#define GL_DUAL_ALPHA8_SGIS 0x8111
#define GL_DUAL_ALPHA12_SGIS 0x8112
#define GL_DUAL_ALPHA16_SGIS 0x8113
#define GL_DUAL_LUMINANCE4_SGIS 0x8114
#define GL_DUAL_LUMINANCE8_SGIS 0x8115
#define GL_DUAL_LUMINANCE12_SGIS 0x8116
#define GL_DUAL_LUMINANCE16_SGIS 0x8117
#define GL_DUAL_INTENSITY4_SGIS 0x8118
#define GL_DUAL_INTENSITY8_SGIS 0x8119
#define GL_DUAL_INTENSITY12_SGIS 0x811A
#define GL_DUAL_INTENSITY16_SGIS 0x811B
#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
#define GL_QUAD_ALPHA4_SGIS 0x811E
#define GL_QUAD_ALPHA8_SGIS 0x811F
#define GL_QUAD_LUMINANCE4_SGIS 0x8120
#define GL_QUAD_LUMINANCE8_SGIS 0x8121
#define GL_QUAD_INTENSITY4_SGIS 0x8122
#define GL_QUAD_INTENSITY8_SGIS 0x8123
#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
#endif
 
#ifndef GL_SGIX_sprite
#define GL_SPRITE_SGIX 0x8148
#define GL_SPRITE_MODE_SGIX 0x8149
#define GL_SPRITE_AXIS_SGIX 0x814A
#define GL_SPRITE_TRANSLATION_SGIX 0x814B
#define GL_SPRITE_AXIAL_SGIX 0x814C
#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
#endif
 
#ifndef GL_SGIX_texture_multi_buffer
#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
#endif
 
#ifndef GL_EXT_point_parameters
#define GL_POINT_SIZE_MIN_EXT 0x8126
#define GL_POINT_SIZE_MAX_EXT 0x8127
#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
#define GL_DISTANCE_ATTENUATION_EXT 0x8129
#endif
 
#ifndef GL_SGIS_point_parameters
#define GL_POINT_SIZE_MIN_SGIS 0x8126
#define GL_POINT_SIZE_MAX_SGIS 0x8127
#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
#endif
 
#ifndef GL_SGIX_instruments
#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
#endif
 
#ifndef GL_SGIX_texture_scale_bias
#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
#endif
 
#ifndef GL_SGIX_framezoom
#define GL_FRAMEZOOM_SGIX 0x818B
#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
#endif
 
#ifndef GL_SGIX_tag_sample_buffer
#endif
 
#ifndef GL_FfdMaskSGIX
#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
#endif
 
#ifndef GL_SGIX_polynomial_ffd
#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
#define GL_DEFORMATIONS_MASK_SGIX 0x8196
#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
#endif
 
#ifndef GL_SGIX_reference_plane
#define GL_REFERENCE_PLANE_SGIX 0x817D
#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
#endif
 
#ifndef GL_SGIX_flush_raster
#endif
 
#ifndef GL_SGIX_depth_texture
#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
#endif
 
#ifndef GL_SGIS_fog_function
#define GL_FOG_FUNC_SGIS 0x812A
#define GL_FOG_FUNC_POINTS_SGIS 0x812B
#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
#endif
 
#ifndef GL_SGIX_fog_offset
#define GL_FOG_OFFSET_SGIX 0x8198
#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
#endif
 
#ifndef GL_HP_image_transform
#define GL_IMAGE_SCALE_X_HP 0x8155
#define GL_IMAGE_SCALE_Y_HP 0x8156
#define GL_IMAGE_TRANSLATE_X_HP 0x8157
#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
#define GL_IMAGE_MAG_FILTER_HP 0x815C
#define GL_IMAGE_MIN_FILTER_HP 0x815D
#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
#define GL_CUBIC_HP 0x815F
#define GL_AVERAGE_HP 0x8160
#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
#endif
 
#ifndef GL_HP_convolution_border_modes
#define GL_IGNORE_BORDER_HP 0x8150
#define GL_CONSTANT_BORDER_HP 0x8151
#define GL_REPLICATE_BORDER_HP 0x8153
#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
#endif
 
#ifndef GL_INGR_palette_buffer
#endif
 
#ifndef GL_SGIX_texture_add_env
#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
#endif
 
#ifndef GL_EXT_color_subtable
#endif
 
#ifndef GL_PGI_vertex_hints
#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
#define GL_COLOR3_BIT_PGI 0x00010000
#define GL_COLOR4_BIT_PGI 0x00020000
#define GL_EDGEFLAG_BIT_PGI 0x00040000
#define GL_INDEX_BIT_PGI 0x00080000
#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
#define GL_MAT_EMISSION_BIT_PGI 0x00800000
#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
#define GL_MAT_SHININESS_BIT_PGI 0x02000000
#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
#define GL_NORMAL_BIT_PGI 0x08000000
#define GL_TEXCOORD1_BIT_PGI 0x10000000
#define GL_TEXCOORD2_BIT_PGI 0x20000000
#define GL_TEXCOORD3_BIT_PGI 0x40000000
#define GL_TEXCOORD4_BIT_PGI 0x80000000
#define GL_VERTEX23_BIT_PGI 0x00000004
#define GL_VERTEX4_BIT_PGI 0x00000008
#endif
 
#ifndef GL_PGI_misc_hints
#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
#define GL_CLIP_NEAR_HINT_PGI 0x1A220
#define GL_CLIP_FAR_HINT_PGI 0x1A221
#define GL_WIDE_LINE_HINT_PGI 0x1A222
#define GL_BACK_NORMALS_HINT_PGI 0x1A223
#endif
 
#ifndef GL_EXT_paletted_texture
#define GL_COLOR_INDEX1_EXT 0x80E2
#define GL_COLOR_INDEX2_EXT 0x80E3
#define GL_COLOR_INDEX4_EXT 0x80E4
#define GL_COLOR_INDEX8_EXT 0x80E5
#define GL_COLOR_INDEX12_EXT 0x80E6
#define GL_COLOR_INDEX16_EXT 0x80E7
#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
#endif
 
#ifndef GL_EXT_clip_volume_hint
#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
#endif
 
#ifndef GL_SGIX_list_priority
#define GL_LIST_PRIORITY_SGIX 0x8182
#endif
 
#ifndef GL_SGIX_ir_instrument1
#define GL_IR_INSTRUMENT1_SGIX 0x817F
#endif
 
#ifndef GL_SGIX_calligraphic_fragment
#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
#endif
 
#ifndef GL_SGIX_texture_lod_bias
#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
#endif
 
#ifndef GL_SGIX_shadow_ambient
#define GL_SHADOW_AMBIENT_SGIX 0x80BF
#endif
 
#ifndef GL_EXT_index_texture
#endif
 
#ifndef GL_EXT_index_material
#define GL_INDEX_MATERIAL_EXT 0x81B8
#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
#endif
 
#ifndef GL_EXT_index_func
#define GL_INDEX_TEST_EXT 0x81B5
#define GL_INDEX_TEST_FUNC_EXT 0x81B6
#define GL_INDEX_TEST_REF_EXT 0x81B7
#endif
 
#ifndef GL_EXT_index_array_formats
#define GL_IUI_V2F_EXT 0x81AD
#define GL_IUI_V3F_EXT 0x81AE
#define GL_IUI_N3F_V2F_EXT 0x81AF
#define GL_IUI_N3F_V3F_EXT 0x81B0
#define GL_T2F_IUI_V2F_EXT 0x81B1
#define GL_T2F_IUI_V3F_EXT 0x81B2
#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
#endif
 
#ifndef GL_EXT_compiled_vertex_array
#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
#endif
 
#ifndef GL_EXT_cull_vertex
#define GL_CULL_VERTEX_EXT 0x81AA
#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
#endif
 
#ifndef GL_SGIX_ycrcb
#define GL_YCRCB_422_SGIX 0x81BB
#define GL_YCRCB_444_SGIX 0x81BC
#endif
 
#ifndef GL_SGIX_fragment_lighting
#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
#define GL_LIGHT_ENV_MODE_SGIX 0x8407
#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
#endif
 
#ifndef GL_IBM_rasterpos_clip
#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
#endif
 
#ifndef GL_HP_texture_lighting
#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
#endif
 
#ifndef GL_EXT_draw_range_elements
#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
#endif
 
#ifndef GL_WIN_phong_shading
#define GL_PHONG_WIN 0x80EA
#define GL_PHONG_HINT_WIN 0x80EB
#endif
 
#ifndef GL_WIN_specular_fog
#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
#endif
 
#ifndef GL_EXT_light_texture
#define GL_FRAGMENT_MATERIAL_EXT 0x8349
#define GL_FRAGMENT_NORMAL_EXT 0x834A
#define GL_FRAGMENT_COLOR_EXT 0x834C
#define GL_ATTENUATION_EXT 0x834D
#define GL_SHADOW_ATTENUATION_EXT 0x834E
#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
#define GL_TEXTURE_LIGHT_EXT 0x8350
#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
/* reuse GL_FRAGMENT_DEPTH_EXT */
#endif
 
#ifndef GL_SGIX_blend_alpha_minmax
#define GL_ALPHA_MIN_SGIX 0x8320
#define GL_ALPHA_MAX_SGIX 0x8321
#endif
 
#ifndef GL_SGIX_impact_pixel_texture
#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184
#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185
#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186
#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189
#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A
#endif
 
#ifndef GL_EXT_bgra
#define GL_BGR_EXT 0x80E0
#define GL_BGRA_EXT 0x80E1
#endif
 
#ifndef GL_SGIX_async
#define GL_ASYNC_MARKER_SGIX 0x8329
#endif
 
#ifndef GL_SGIX_async_pixel
#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
#endif
 
#ifndef GL_SGIX_async_histogram
#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
#endif
 
#ifndef GL_INTEL_texture_scissor
#endif
 
#ifndef GL_INTEL_parallel_arrays
#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
#endif
 
#ifndef GL_HP_occlusion_test
#define GL_OCCLUSION_TEST_HP 0x8165
#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
#endif
 
#ifndef GL_EXT_pixel_transform
#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
#define GL_PIXEL_MAG_FILTER_EXT 0x8331
#define GL_PIXEL_MIN_FILTER_EXT 0x8332
#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
#define GL_CUBIC_EXT 0x8334
#define GL_AVERAGE_EXT 0x8335
#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
#endif
 
#ifndef GL_EXT_pixel_transform_color_table
#endif
 
#ifndef GL_EXT_shared_texture_palette
#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
#endif
 
#ifndef GL_EXT_separate_specular_color
#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
#define GL_SINGLE_COLOR_EXT 0x81F9
#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
#endif
 
#ifndef GL_EXT_secondary_color
#define GL_COLOR_SUM_EXT 0x8458
#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
#endif
 
#ifndef GL_EXT_texture_perturb_normal
#define GL_PERTURB_EXT 0x85AE
#define GL_TEXTURE_NORMAL_EXT 0x85AF
#endif
 
#ifndef GL_EXT_multi_draw_arrays
#endif
 
#ifndef GL_EXT_fog_coord
#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
#define GL_FOG_COORDINATE_EXT 0x8451
#define GL_FRAGMENT_DEPTH_EXT 0x8452
#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
#endif
 
#ifndef GL_REND_screen_coordinates
#define GL_SCREEN_COORDINATES_REND 0x8490
#define GL_INVERTED_SCREEN_W_REND 0x8491
#endif
 
#ifndef GL_EXT_coordinate_frame
#define GL_TANGENT_ARRAY_EXT 0x8439
#define GL_BINORMAL_ARRAY_EXT 0x843A
#define GL_CURRENT_TANGENT_EXT 0x843B
#define GL_CURRENT_BINORMAL_EXT 0x843C
#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
#define GL_MAP1_TANGENT_EXT 0x8444
#define GL_MAP2_TANGENT_EXT 0x8445
#define GL_MAP1_BINORMAL_EXT 0x8446
#define GL_MAP2_BINORMAL_EXT 0x8447
#endif
 
#ifndef GL_EXT_texture_env_combine
#define GL_COMBINE_EXT 0x8570
#define GL_COMBINE_RGB_EXT 0x8571
#define GL_COMBINE_ALPHA_EXT 0x8572
#define GL_RGB_SCALE_EXT 0x8573
#define GL_ADD_SIGNED_EXT 0x8574
#define GL_INTERPOLATE_EXT 0x8575
#define GL_CONSTANT_EXT 0x8576
#define GL_PRIMARY_COLOR_EXT 0x8577
#define GL_PREVIOUS_EXT 0x8578
#define GL_SOURCE0_RGB_EXT 0x8580
#define GL_SOURCE1_RGB_EXT 0x8581
#define GL_SOURCE2_RGB_EXT 0x8582
#define GL_SOURCE0_ALPHA_EXT 0x8588
#define GL_SOURCE1_ALPHA_EXT 0x8589
#define GL_SOURCE2_ALPHA_EXT 0x858A
#define GL_OPERAND0_RGB_EXT 0x8590
#define GL_OPERAND1_RGB_EXT 0x8591
#define GL_OPERAND2_RGB_EXT 0x8592
#define GL_OPERAND0_ALPHA_EXT 0x8598
#define GL_OPERAND1_ALPHA_EXT 0x8599
#define GL_OPERAND2_ALPHA_EXT 0x859A
#endif
 
#ifndef GL_APPLE_specular_vector
#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
#endif
 
#ifndef GL_APPLE_transform_hint
#define GL_TRANSFORM_HINT_APPLE 0x85B1
#endif
 
#ifndef GL_SGIX_fog_scale
#define GL_FOG_SCALE_SGIX 0x81FC
#define GL_FOG_SCALE_VALUE_SGIX 0x81FD
#endif
 
#ifndef GL_SUNX_constant_data
#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
#endif
 
#ifndef GL_SUN_global_alpha
#define GL_GLOBAL_ALPHA_SUN 0x81D9
#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
#endif
 
#ifndef GL_SUN_triangle_list
#define GL_RESTART_SUN 0x0001
#define GL_REPLACE_MIDDLE_SUN 0x0002
#define GL_REPLACE_OLDEST_SUN 0x0003
#define GL_TRIANGLE_LIST_SUN 0x81D7
#define GL_REPLACEMENT_CODE_SUN 0x81D8
#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
#define GL_R1UI_V3F_SUN 0x85C4
#define GL_R1UI_C4UB_V3F_SUN 0x85C5
#define GL_R1UI_C3F_V3F_SUN 0x85C6
#define GL_R1UI_N3F_V3F_SUN 0x85C7
#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
#define GL_R1UI_T2F_V3F_SUN 0x85C9
#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
#endif
 
#ifndef GL_SUN_vertex
#endif
 
#ifndef GL_EXT_blend_func_separate
#define GL_BLEND_DST_RGB_EXT 0x80C8
#define GL_BLEND_SRC_RGB_EXT 0x80C9
#define GL_BLEND_DST_ALPHA_EXT 0x80CA
#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
#endif
 
#ifndef GL_INGR_color_clamp
#define GL_RED_MIN_CLAMP_INGR 0x8560
#define GL_GREEN_MIN_CLAMP_INGR 0x8561
#define GL_BLUE_MIN_CLAMP_INGR 0x8562
#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
#define GL_RED_MAX_CLAMP_INGR 0x8564
#define GL_GREEN_MAX_CLAMP_INGR 0x8565
#define GL_BLUE_MAX_CLAMP_INGR 0x8566
#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
#endif
 
#ifndef GL_INGR_interlace_read
#define GL_INTERLACE_READ_INGR 0x8568
#endif
 
#ifndef GL_EXT_stencil_wrap
#define GL_INCR_WRAP_EXT 0x8507
#define GL_DECR_WRAP_EXT 0x8508
#endif
 
#ifndef GL_EXT_422_pixels
#define GL_422_EXT 0x80CC
#define GL_422_REV_EXT 0x80CD
#define GL_422_AVERAGE_EXT 0x80CE
#define GL_422_REV_AVERAGE_EXT 0x80CF
#endif
 
#ifndef GL_NV_texgen_reflection
#define GL_NORMAL_MAP_NV 0x8511
#define GL_REFLECTION_MAP_NV 0x8512
#endif
 
#ifndef GL_EXT_texture_cube_map
#define GL_NORMAL_MAP_EXT 0x8511
#define GL_REFLECTION_MAP_EXT 0x8512
#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
#endif
 
#ifndef GL_SUN_convolution_border_modes
#define GL_WRAP_BORDER_SUN 0x81D4
#endif
 
#ifndef GL_EXT_texture_env_add
#endif
 
#ifndef GL_EXT_texture_lod_bias
#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
#endif
 
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
#endif
 
#ifndef GL_EXT_vertex_weighting
#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH
#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX
#define GL_MODELVIEW1_MATRIX_EXT 0x8506
#define GL_VERTEX_WEIGHTING_EXT 0x8509
#define GL_MODELVIEW0_EXT GL_MODELVIEW
#define GL_MODELVIEW1_EXT 0x850A
#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
#endif
 
#ifndef GL_NV_light_max_exponent
#define GL_MAX_SHININESS_NV 0x8504
#define GL_MAX_SPOT_EXPONENT_NV 0x8505
#endif
 
#ifndef GL_NV_vertex_array_range
#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
#endif
 
#ifndef GL_NV_register_combiners
#define GL_REGISTER_COMBINERS_NV 0x8522
#define GL_VARIABLE_A_NV 0x8523
#define GL_VARIABLE_B_NV 0x8524
#define GL_VARIABLE_C_NV 0x8525
#define GL_VARIABLE_D_NV 0x8526
#define GL_VARIABLE_E_NV 0x8527
#define GL_VARIABLE_F_NV 0x8528
#define GL_VARIABLE_G_NV 0x8529
#define GL_CONSTANT_COLOR0_NV 0x852A
#define GL_CONSTANT_COLOR1_NV 0x852B
#define GL_PRIMARY_COLOR_NV 0x852C
#define GL_SECONDARY_COLOR_NV 0x852D
#define GL_SPARE0_NV 0x852E
#define GL_SPARE1_NV 0x852F
#define GL_DISCARD_NV 0x8530
#define GL_E_TIMES_F_NV 0x8531
#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
#define GL_UNSIGNED_IDENTITY_NV 0x8536
#define GL_UNSIGNED_INVERT_NV 0x8537
#define GL_EXPAND_NORMAL_NV 0x8538
#define GL_EXPAND_NEGATE_NV 0x8539
#define GL_HALF_BIAS_NORMAL_NV 0x853A
#define GL_HALF_BIAS_NEGATE_NV 0x853B
#define GL_SIGNED_IDENTITY_NV 0x853C
#define GL_SIGNED_NEGATE_NV 0x853D
#define GL_SCALE_BY_TWO_NV 0x853E
#define GL_SCALE_BY_FOUR_NV 0x853F
#define GL_SCALE_BY_ONE_HALF_NV 0x8540
#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
#define GL_COMBINER_INPUT_NV 0x8542
#define GL_COMBINER_MAPPING_NV 0x8543
#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
#define GL_COMBINER_MUX_SUM_NV 0x8547
#define GL_COMBINER_SCALE_NV 0x8548
#define GL_COMBINER_BIAS_NV 0x8549
#define GL_COMBINER_AB_OUTPUT_NV 0x854A
#define GL_COMBINER_CD_OUTPUT_NV 0x854B
#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
#define GL_COLOR_SUM_CLAMP_NV 0x854F
#define GL_COMBINER0_NV 0x8550
#define GL_COMBINER1_NV 0x8551
#define GL_COMBINER2_NV 0x8552
#define GL_COMBINER3_NV 0x8553
#define GL_COMBINER4_NV 0x8554
#define GL_COMBINER5_NV 0x8555
#define GL_COMBINER6_NV 0x8556
#define GL_COMBINER7_NV 0x8557
/* reuse GL_TEXTURE0_ARB */
/* reuse GL_TEXTURE1_ARB */
/* reuse GL_ZERO */
/* reuse GL_NONE */
/* reuse GL_FOG */
#endif
 
#ifndef GL_NV_fog_distance
#define GL_FOG_DISTANCE_MODE_NV 0x855A
#define GL_EYE_RADIAL_NV 0x855B
#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
/* reuse GL_EYE_PLANE */
#endif
 
#ifndef GL_NV_texgen_emboss
#define GL_EMBOSS_LIGHT_NV 0x855D
#define GL_EMBOSS_CONSTANT_NV 0x855E
#define GL_EMBOSS_MAP_NV 0x855F
#endif
 
#ifndef GL_NV_blend_square
#endif
 
#ifndef GL_NV_texture_env_combine4
#define GL_COMBINE4_NV 0x8503
#define GL_SOURCE3_RGB_NV 0x8583
#define GL_SOURCE3_ALPHA_NV 0x858B
#define GL_OPERAND3_RGB_NV 0x8593
#define GL_OPERAND3_ALPHA_NV 0x859B
#endif
 
#ifndef GL_MESA_resize_buffers
#endif
 
#ifndef GL_MESA_window_pos
#endif
 
#ifndef GL_EXT_texture_compression_s3tc
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
#endif
 
#ifndef GL_IBM_cull_vertex
#define GL_CULL_VERTEX_IBM 103050
#endif
 
#ifndef GL_IBM_multimode_draw_arrays
#endif
 
#ifndef GL_IBM_vertex_array_lists
#define GL_VERTEX_ARRAY_LIST_IBM 103070
#define GL_NORMAL_ARRAY_LIST_IBM 103071
#define GL_COLOR_ARRAY_LIST_IBM 103072
#define GL_INDEX_ARRAY_LIST_IBM 103073
#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
#endif
 
#ifndef GL_SGIX_subsample
#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
#endif
 
#ifndef GL_SGIX_ycrcb_subsample
#endif
 
#ifndef GL_SGIX_ycrcba
#define GL_YCRCB_SGIX 0x8318
#define GL_YCRCBA_SGIX 0x8319
#endif
 
#ifndef GL_SGI_depth_pass_instrument
#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310
#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
#endif
 
#ifndef GL_3DFX_texture_compression_FXT1
#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
#endif
 
#ifndef GL_3DFX_multisample
#define GL_MULTISAMPLE_3DFX 0x86B2
#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
#define GL_SAMPLES_3DFX 0x86B4
#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
#endif
 
#ifndef GL_3DFX_tbuffer
#endif
 
#ifndef GL_EXT_multisample
#define GL_MULTISAMPLE_EXT 0x809D
#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
#define GL_SAMPLE_MASK_EXT 0x80A0
#define GL_1PASS_EXT 0x80A1
#define GL_2PASS_0_EXT 0x80A2
#define GL_2PASS_1_EXT 0x80A3
#define GL_4PASS_0_EXT 0x80A4
#define GL_4PASS_1_EXT 0x80A5
#define GL_4PASS_2_EXT 0x80A6
#define GL_4PASS_3_EXT 0x80A7
#define GL_SAMPLE_BUFFERS_EXT 0x80A8
#define GL_SAMPLES_EXT 0x80A9
#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
#define GL_SAMPLE_PATTERN_EXT 0x80AC
#define GL_MULTISAMPLE_BIT_EXT 0x20000000
#endif
 
#ifndef GL_SGIX_vertex_preclip
#define GL_VERTEX_PRECLIP_SGIX 0x83EE
#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
#endif
 
#ifndef GL_SGIX_convolution_accuracy
#define GL_CONVOLUTION_HINT_SGIX 0x8316
#endif
 
#ifndef GL_SGIX_resample
#define GL_PACK_RESAMPLE_SGIX 0x842C
#define GL_UNPACK_RESAMPLE_SGIX 0x842D
#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
#endif
 
#ifndef GL_SGIS_point_line_texgen
#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
#define GL_EYE_POINT_SGIS 0x81F4
#define GL_OBJECT_POINT_SGIS 0x81F5
#define GL_EYE_LINE_SGIS 0x81F6
#define GL_OBJECT_LINE_SGIS 0x81F7
#endif
 
#ifndef GL_SGIS_texture_color_mask
#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
#endif
 
#ifndef GL_EXT_texture_env_dot3
#define GL_DOT3_RGB_EXT 0x8740
#define GL_DOT3_RGBA_EXT 0x8741
#endif
 
#ifndef GL_ATI_texture_mirror_once
#define GL_MIRROR_CLAMP_ATI 0x8742
#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
#endif
 
#ifndef GL_NV_fence
#define GL_ALL_COMPLETED_NV 0x84F2
#define GL_FENCE_STATUS_NV 0x84F3
#define GL_FENCE_CONDITION_NV 0x84F4
#endif
 
#ifndef GL_IBM_texture_mirrored_repeat
#define GL_MIRRORED_REPEAT_IBM 0x8370
#endif
 
#ifndef GL_NV_evaluators
#define GL_EVAL_2D_NV 0x86C0
#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
#define GL_MAP_TESSELLATION_NV 0x86C2
#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
#endif
 
#ifndef GL_NV_packed_depth_stencil
#define GL_DEPTH_STENCIL_NV 0x84F9
#define GL_UNSIGNED_INT_24_8_NV 0x84FA
#endif
 
#ifndef GL_NV_register_combiners2
#define GL_PER_STAGE_CONSTANTS_NV 0x8535
#endif
 
#ifndef GL_NV_texture_compression_vtc
#endif
 
#ifndef GL_NV_texture_rectangle
#define GL_TEXTURE_RECTANGLE_NV 0x84F5
#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
#endif
 
#ifndef GL_NV_texture_shader
#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
#define GL_SHADER_CONSISTENT_NV 0x86DD
#define GL_TEXTURE_SHADER_NV 0x86DE
#define GL_SHADER_OPERATION_NV 0x86DF
#define GL_CULL_MODES_NV 0x86E0
#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
#define GL_CONST_EYE_NV 0x86E5
#define GL_PASS_THROUGH_NV 0x86E6
#define GL_CULL_FRAGMENT_NV 0x86E7
#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
#define GL_DOT_PRODUCT_NV 0x86EC
#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
#define GL_HILO_NV 0x86F4
#define GL_DSDT_NV 0x86F5
#define GL_DSDT_MAG_NV 0x86F6
#define GL_DSDT_MAG_VIB_NV 0x86F7
#define GL_HILO16_NV 0x86F8
#define GL_SIGNED_HILO_NV 0x86F9
#define GL_SIGNED_HILO16_NV 0x86FA
#define GL_SIGNED_RGBA_NV 0x86FB
#define GL_SIGNED_RGBA8_NV 0x86FC
#define GL_SIGNED_RGB_NV 0x86FE
#define GL_SIGNED_RGB8_NV 0x86FF
#define GL_SIGNED_LUMINANCE_NV 0x8701
#define GL_SIGNED_LUMINANCE8_NV 0x8702
#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
#define GL_SIGNED_ALPHA_NV 0x8705
#define GL_SIGNED_ALPHA8_NV 0x8706
#define GL_SIGNED_INTENSITY_NV 0x8707
#define GL_SIGNED_INTENSITY8_NV 0x8708
#define GL_DSDT8_NV 0x8709
#define GL_DSDT8_MAG8_NV 0x870A
#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
#define GL_HI_SCALE_NV 0x870E
#define GL_LO_SCALE_NV 0x870F
#define GL_DS_SCALE_NV 0x8710
#define GL_DT_SCALE_NV 0x8711
#define GL_MAGNITUDE_SCALE_NV 0x8712
#define GL_VIBRANCE_SCALE_NV 0x8713
#define GL_HI_BIAS_NV 0x8714
#define GL_LO_BIAS_NV 0x8715
#define GL_DS_BIAS_NV 0x8716
#define GL_DT_BIAS_NV 0x8717
#define GL_MAGNITUDE_BIAS_NV 0x8718
#define GL_VIBRANCE_BIAS_NV 0x8719
#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
#define GL_TEXTURE_HI_SIZE_NV 0x871B
#define GL_TEXTURE_LO_SIZE_NV 0x871C
#define GL_TEXTURE_DS_SIZE_NV 0x871D
#define GL_TEXTURE_DT_SIZE_NV 0x871E
#define GL_TEXTURE_MAG_SIZE_NV 0x871F
#endif
 
#ifndef GL_NV_texture_shader2
#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
#endif
 
#ifndef GL_NV_vertex_array_range2
#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
#endif
 
#ifndef GL_NV_vertex_program
#define GL_VERTEX_PROGRAM_NV 0x8620
#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
#define GL_CURRENT_ATTRIB_NV 0x8626
#define GL_PROGRAM_LENGTH_NV 0x8627
#define GL_PROGRAM_STRING_NV 0x8628
#define GL_MODELVIEW_PROJECTION_NV 0x8629
#define GL_IDENTITY_NV 0x862A
#define GL_INVERSE_NV 0x862B
#define GL_TRANSPOSE_NV 0x862C
#define GL_INVERSE_TRANSPOSE_NV 0x862D
#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
#define GL_MAX_TRACK_MATRICES_NV 0x862F
#define GL_MATRIX0_NV 0x8630
#define GL_MATRIX1_NV 0x8631
#define GL_MATRIX2_NV 0x8632
#define GL_MATRIX3_NV 0x8633
#define GL_MATRIX4_NV 0x8634
#define GL_MATRIX5_NV 0x8635
#define GL_MATRIX6_NV 0x8636
#define GL_MATRIX7_NV 0x8637
#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
#define GL_CURRENT_MATRIX_NV 0x8641
#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
#define GL_PROGRAM_PARAMETER_NV 0x8644
#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
#define GL_PROGRAM_TARGET_NV 0x8646
#define GL_PROGRAM_RESIDENT_NV 0x8647
#define GL_TRACK_MATRIX_NV 0x8648
#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
#endif
 
#ifndef GL_SGIX_texture_coordinate_clamp
#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
#endif
 
#ifndef GL_SGIX_scalebias_hint
#define GL_SCALEBIAS_HINT_SGIX 0x8322
#endif
 
#ifndef GL_OML_interlace
#define GL_INTERLACE_OML 0x8980
#define GL_INTERLACE_READ_OML 0x8981
#endif
 
#ifndef GL_OML_subsample
#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
#endif
 
#ifndef GL_OML_resample
#define GL_PACK_RESAMPLE_OML 0x8984
#define GL_UNPACK_RESAMPLE_OML 0x8985
#define GL_RESAMPLE_REPLICATE_OML 0x8986
#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
#define GL_RESAMPLE_AVERAGE_OML 0x8988
#define GL_RESAMPLE_DECIMATE_OML 0x8989
#endif
 
#ifndef GL_NV_copy_depth_to_color
#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
#endif
 
#ifndef GL_ATI_envmap_bumpmap
#define GL_BUMP_ROT_MATRIX_ATI 0x8775
#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
#define GL_BUMP_TEX_UNITS_ATI 0x8778
#define GL_DUDV_ATI 0x8779
#define GL_DU8DV8_ATI 0x877A
#define GL_BUMP_ENVMAP_ATI 0x877B
#define GL_BUMP_TARGET_ATI 0x877C
#endif
 
#ifndef GL_ATI_fragment_shader
#define GL_FRAGMENT_SHADER_ATI 0x8920
#define GL_REG_0_ATI 0x8921
#define GL_REG_1_ATI 0x8922
#define GL_REG_2_ATI 0x8923
#define GL_REG_3_ATI 0x8924
#define GL_REG_4_ATI 0x8925
#define GL_REG_5_ATI 0x8926
#define GL_REG_6_ATI 0x8927
#define GL_REG_7_ATI 0x8928
#define GL_REG_8_ATI 0x8929
#define GL_REG_9_ATI 0x892A
#define GL_REG_10_ATI 0x892B
#define GL_REG_11_ATI 0x892C
#define GL_REG_12_ATI 0x892D
#define GL_REG_13_ATI 0x892E
#define GL_REG_14_ATI 0x892F
#define GL_REG_15_ATI 0x8930
#define GL_REG_16_ATI 0x8931
#define GL_REG_17_ATI 0x8932
#define GL_REG_18_ATI 0x8933
#define GL_REG_19_ATI 0x8934
#define GL_REG_20_ATI 0x8935
#define GL_REG_21_ATI 0x8936
#define GL_REG_22_ATI 0x8937
#define GL_REG_23_ATI 0x8938
#define GL_REG_24_ATI 0x8939
#define GL_REG_25_ATI 0x893A
#define GL_REG_26_ATI 0x893B
#define GL_REG_27_ATI 0x893C
#define GL_REG_28_ATI 0x893D
#define GL_REG_29_ATI 0x893E
#define GL_REG_30_ATI 0x893F
#define GL_REG_31_ATI 0x8940
#define GL_CON_0_ATI 0x8941
#define GL_CON_1_ATI 0x8942
#define GL_CON_2_ATI 0x8943
#define GL_CON_3_ATI 0x8944
#define GL_CON_4_ATI 0x8945
#define GL_CON_5_ATI 0x8946
#define GL_CON_6_ATI 0x8947
#define GL_CON_7_ATI 0x8948
#define GL_CON_8_ATI 0x8949
#define GL_CON_9_ATI 0x894A
#define GL_CON_10_ATI 0x894B
#define GL_CON_11_ATI 0x894C
#define GL_CON_12_ATI 0x894D
#define GL_CON_13_ATI 0x894E
#define GL_CON_14_ATI 0x894F
#define GL_CON_15_ATI 0x8950
#define GL_CON_16_ATI 0x8951
#define GL_CON_17_ATI 0x8952
#define GL_CON_18_ATI 0x8953
#define GL_CON_19_ATI 0x8954
#define GL_CON_20_ATI 0x8955
#define GL_CON_21_ATI 0x8956
#define GL_CON_22_ATI 0x8957
#define GL_CON_23_ATI 0x8958
#define GL_CON_24_ATI 0x8959
#define GL_CON_25_ATI 0x895A
#define GL_CON_26_ATI 0x895B
#define GL_CON_27_ATI 0x895C
#define GL_CON_28_ATI 0x895D
#define GL_CON_29_ATI 0x895E
#define GL_CON_30_ATI 0x895F
#define GL_CON_31_ATI 0x8960
#define GL_MOV_ATI 0x8961
#define GL_ADD_ATI 0x8963
#define GL_MUL_ATI 0x8964
#define GL_SUB_ATI 0x8965
#define GL_DOT3_ATI 0x8966
#define GL_DOT4_ATI 0x8967
#define GL_MAD_ATI 0x8968
#define GL_LERP_ATI 0x8969
#define GL_CND_ATI 0x896A
#define GL_CND0_ATI 0x896B
#define GL_DOT2_ADD_ATI 0x896C
#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
#define GL_NUM_PASSES_ATI 0x8970
#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
#define GL_SWIZZLE_STR_ATI 0x8976
#define GL_SWIZZLE_STQ_ATI 0x8977
#define GL_SWIZZLE_STR_DR_ATI 0x8978
#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
#define GL_SWIZZLE_STRQ_ATI 0x897A
#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
#define GL_RED_BIT_ATI 0x00000001
#define GL_GREEN_BIT_ATI 0x00000002
#define GL_BLUE_BIT_ATI 0x00000004
#define GL_2X_BIT_ATI 0x00000001
#define GL_4X_BIT_ATI 0x00000002
#define GL_8X_BIT_ATI 0x00000004
#define GL_HALF_BIT_ATI 0x00000008
#define GL_QUARTER_BIT_ATI 0x00000010
#define GL_EIGHTH_BIT_ATI 0x00000020
#define GL_SATURATE_BIT_ATI 0x00000040
#define GL_COMP_BIT_ATI 0x00000002
#define GL_NEGATE_BIT_ATI 0x00000004
#define GL_BIAS_BIT_ATI 0x00000008
#endif
 
#ifndef GL_ATI_pn_triangles
#define GL_PN_TRIANGLES_ATI 0x87F0
#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
#endif
 
#ifndef GL_ATI_vertex_array_object
#define GL_STATIC_ATI 0x8760
#define GL_DYNAMIC_ATI 0x8761
#define GL_PRESERVE_ATI 0x8762
#define GL_DISCARD_ATI 0x8763
#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
#endif
 
#ifndef GL_EXT_vertex_shader
#define GL_VERTEX_SHADER_EXT 0x8780
#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
#define GL_OP_INDEX_EXT 0x8782
#define GL_OP_NEGATE_EXT 0x8783
#define GL_OP_DOT3_EXT 0x8784
#define GL_OP_DOT4_EXT 0x8785
#define GL_OP_MUL_EXT 0x8786
#define GL_OP_ADD_EXT 0x8787
#define GL_OP_MADD_EXT 0x8788
#define GL_OP_FRAC_EXT 0x8789
#define GL_OP_MAX_EXT 0x878A
#define GL_OP_MIN_EXT 0x878B
#define GL_OP_SET_GE_EXT 0x878C
#define GL_OP_SET_LT_EXT 0x878D
#define GL_OP_CLAMP_EXT 0x878E
#define GL_OP_FLOOR_EXT 0x878F
#define GL_OP_ROUND_EXT 0x8790
#define GL_OP_EXP_BASE_2_EXT 0x8791
#define GL_OP_LOG_BASE_2_EXT 0x8792
#define GL_OP_POWER_EXT 0x8793
#define GL_OP_RECIP_EXT 0x8794
#define GL_OP_RECIP_SQRT_EXT 0x8795
#define GL_OP_SUB_EXT 0x8796
#define GL_OP_CROSS_PRODUCT_EXT 0x8797
#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
#define GL_OP_MOV_EXT 0x8799
#define GL_OUTPUT_VERTEX_EXT 0x879A
#define GL_OUTPUT_COLOR0_EXT 0x879B
#define GL_OUTPUT_COLOR1_EXT 0x879C
#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
#define GL_OUTPUT_FOG_EXT 0x87BD
#define GL_SCALAR_EXT 0x87BE
#define GL_VECTOR_EXT 0x87BF
#define GL_MATRIX_EXT 0x87C0
#define GL_VARIANT_EXT 0x87C1
#define GL_INVARIANT_EXT 0x87C2
#define GL_LOCAL_CONSTANT_EXT 0x87C3
#define GL_LOCAL_EXT 0x87C4
#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
#define GL_X_EXT 0x87D5
#define GL_Y_EXT 0x87D6
#define GL_Z_EXT 0x87D7
#define GL_W_EXT 0x87D8
#define GL_NEGATIVE_X_EXT 0x87D9
#define GL_NEGATIVE_Y_EXT 0x87DA
#define GL_NEGATIVE_Z_EXT 0x87DB
#define GL_NEGATIVE_W_EXT 0x87DC
#define GL_ZERO_EXT 0x87DD
#define GL_ONE_EXT 0x87DE
#define GL_NEGATIVE_ONE_EXT 0x87DF
#define GL_NORMALIZED_RANGE_EXT 0x87E0
#define GL_FULL_RANGE_EXT 0x87E1
#define GL_CURRENT_VERTEX_EXT 0x87E2
#define GL_MVP_MATRIX_EXT 0x87E3
#define GL_VARIANT_VALUE_EXT 0x87E4
#define GL_VARIANT_DATATYPE_EXT 0x87E5
#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
#define GL_VARIANT_ARRAY_EXT 0x87E8
#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
#define GL_INVARIANT_VALUE_EXT 0x87EA
#define GL_INVARIANT_DATATYPE_EXT 0x87EB
#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
#endif
 
#ifndef GL_ATI_vertex_streams
#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
#define GL_VERTEX_STREAM0_ATI 0x876C
#define GL_VERTEX_STREAM1_ATI 0x876D
#define GL_VERTEX_STREAM2_ATI 0x876E
#define GL_VERTEX_STREAM3_ATI 0x876F
#define GL_VERTEX_STREAM4_ATI 0x8770
#define GL_VERTEX_STREAM5_ATI 0x8771
#define GL_VERTEX_STREAM6_ATI 0x8772
#define GL_VERTEX_STREAM7_ATI 0x8773
#define GL_VERTEX_SOURCE_ATI 0x8774
#endif
 
#ifndef GL_ATI_element_array
#define GL_ELEMENT_ARRAY_ATI 0x8768
#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
#endif
 
#ifndef GL_SUN_mesh_array
#define GL_QUAD_MESH_SUN 0x8614
#define GL_TRIANGLE_MESH_SUN 0x8615
#endif
 
#ifndef GL_SUN_slice_accum
#define GL_SLICE_ACCUM_SUN 0x85CC
#endif
 
#ifndef GL_NV_multisample_filter_hint
#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
#endif
 
#ifndef GL_NV_depth_clamp
#define GL_DEPTH_CLAMP_NV 0x864F
#endif
 
#ifndef GL_NV_occlusion_query
#define GL_PIXEL_COUNTER_BITS_NV 0x8864
#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
#define GL_PIXEL_COUNT_NV 0x8866
#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
#endif
 
#ifndef GL_NV_point_sprite
#define GL_POINT_SPRITE_NV 0x8861
#define GL_COORD_REPLACE_NV 0x8862
#define GL_POINT_SPRITE_R_MODE_NV 0x8863
#endif
 
#ifndef GL_NV_texture_shader3
#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
#define GL_HILO8_NV 0x885E
#define GL_SIGNED_HILO8_NV 0x885F
#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
#endif
 
#ifndef GL_NV_vertex_program1_1
#endif
 
#ifndef GL_EXT_shadow_funcs
#endif
 
#ifndef GL_EXT_stencil_two_side
#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
#endif
 
#ifndef GL_ATI_text_fragment_shader
#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
#endif
 
#ifndef GL_APPLE_client_storage
#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
#endif
 
#ifndef GL_APPLE_element_array
#define GL_ELEMENT_ARRAY_APPLE 0x8768
#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769
#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A
#endif
 
#ifndef GL_APPLE_fence
#define GL_DRAW_PIXELS_APPLE 0x8A0A
#define GL_FENCE_APPLE 0x8A0B
#endif
 
#ifndef GL_APPLE_vertex_array_object
#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
#endif
 
#ifndef GL_APPLE_vertex_array_range
#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
#define GL_STORAGE_CACHED_APPLE 0x85BE
#define GL_STORAGE_SHARED_APPLE 0x85BF
#endif
 
#ifndef GL_APPLE_ycbcr_422
#define GL_YCBCR_422_APPLE 0x85B9
#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
#endif
 
#ifndef GL_S3_s3tc
#define GL_RGB_S3TC 0x83A0
#define GL_RGB4_S3TC 0x83A1
#define GL_RGBA_S3TC 0x83A2
#define GL_RGBA4_S3TC 0x83A3
#endif
 
#ifndef GL_ATI_draw_buffers
#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
#define GL_DRAW_BUFFER0_ATI 0x8825
#define GL_DRAW_BUFFER1_ATI 0x8826
#define GL_DRAW_BUFFER2_ATI 0x8827
#define GL_DRAW_BUFFER3_ATI 0x8828
#define GL_DRAW_BUFFER4_ATI 0x8829
#define GL_DRAW_BUFFER5_ATI 0x882A
#define GL_DRAW_BUFFER6_ATI 0x882B
#define GL_DRAW_BUFFER7_ATI 0x882C
#define GL_DRAW_BUFFER8_ATI 0x882D
#define GL_DRAW_BUFFER9_ATI 0x882E
#define GL_DRAW_BUFFER10_ATI 0x882F
#define GL_DRAW_BUFFER11_ATI 0x8830
#define GL_DRAW_BUFFER12_ATI 0x8831
#define GL_DRAW_BUFFER13_ATI 0x8832
#define GL_DRAW_BUFFER14_ATI 0x8833
#define GL_DRAW_BUFFER15_ATI 0x8834
#endif
 
#ifndef GL_ATI_texture_env_combine3
#define GL_MODULATE_ADD_ATI 0x8744
#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
#define GL_MODULATE_SUBTRACT_ATI 0x8746
#endif
 
#ifndef GL_ATI_texture_float
#define GL_RGBA_FLOAT32_ATI 0x8814
#define GL_RGB_FLOAT32_ATI 0x8815
#define GL_ALPHA_FLOAT32_ATI 0x8816
#define GL_INTENSITY_FLOAT32_ATI 0x8817
#define GL_LUMINANCE_FLOAT32_ATI 0x8818
#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
#define GL_RGBA_FLOAT16_ATI 0x881A
#define GL_RGB_FLOAT16_ATI 0x881B
#define GL_ALPHA_FLOAT16_ATI 0x881C
#define GL_INTENSITY_FLOAT16_ATI 0x881D
#define GL_LUMINANCE_FLOAT16_ATI 0x881E
#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
#endif
 
#ifndef GL_NV_float_buffer
#define GL_FLOAT_R_NV 0x8880
#define GL_FLOAT_RG_NV 0x8881
#define GL_FLOAT_RGB_NV 0x8882
#define GL_FLOAT_RGBA_NV 0x8883
#define GL_FLOAT_R16_NV 0x8884
#define GL_FLOAT_R32_NV 0x8885
#define GL_FLOAT_RG16_NV 0x8886
#define GL_FLOAT_RG32_NV 0x8887
#define GL_FLOAT_RGB16_NV 0x8888
#define GL_FLOAT_RGB32_NV 0x8889
#define GL_FLOAT_RGBA16_NV 0x888A
#define GL_FLOAT_RGBA32_NV 0x888B
#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
#define GL_FLOAT_RGBA_MODE_NV 0x888E
#endif
 
#ifndef GL_NV_fragment_program
#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
#define GL_FRAGMENT_PROGRAM_NV 0x8870
#define GL_MAX_TEXTURE_COORDS_NV 0x8871
#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
#define GL_PROGRAM_ERROR_STRING_NV 0x8874
#endif
 
#ifndef GL_NV_half_float
#define GL_HALF_FLOAT_NV 0x140B
#endif
 
#ifndef GL_NV_pixel_data_range
#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
#endif
 
#ifndef GL_NV_primitive_restart
#define GL_PRIMITIVE_RESTART_NV 0x8558
#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
#endif
 
#ifndef GL_NV_texture_expand_normal
#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
#endif
 
#ifndef GL_NV_vertex_program2
#endif
 
#ifndef GL_ATI_map_object_buffer
#endif
 
#ifndef GL_ATI_separate_stencil
#define GL_STENCIL_BACK_FUNC_ATI 0x8800
#define GL_STENCIL_BACK_FAIL_ATI 0x8801
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
#endif
 
#ifndef GL_ATI_vertex_attrib_array_object
#endif
 
#ifndef GL_EXT_depth_bounds_test
#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
#define GL_DEPTH_BOUNDS_EXT 0x8891
#endif
 
#ifndef GL_EXT_texture_mirror_clamp
#define GL_MIRROR_CLAMP_EXT 0x8742
#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
#endif
 
#ifndef GL_EXT_blend_equation_separate
#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION
#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
#endif
 
#ifndef GL_MESA_pack_invert
#define GL_PACK_INVERT_MESA 0x8758
#endif
 
#ifndef GL_MESA_ycbcr_texture
#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
#define GL_YCBCR_MESA 0x8757
#endif
 
 
/*************************************************************/
 
#include <stddef.h>
#ifndef GL_VERSION_1_5
/* GL types for handling large vertex buffer objects */
typedef ptrdiff_t GLintptr;
typedef ptrdiff_t GLsizeiptr;
#endif
 
#ifndef GL_ARB_vertex_buffer_object
/* GL types for handling large vertex buffer objects */
typedef ptrdiff_t GLintptrARB;
typedef ptrdiff_t GLsizeiptrARB;
#endif
 
#ifndef GL_ARB_shader_objects
/* GL types for handling shader object handles and characters */
typedef char GLcharARB; /* native character */
typedef unsigned int GLhandleARB; /* shader object handle */
#endif
 
#ifndef GL_NV_half_float
/* GL type for representing NVIDIA "half" floating point type in host memory */
typedef unsigned short GLhalfNV;
#endif
 
#ifndef GL_VERSION_1_2
#define GL_VERSION_1_2 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
GLAPI void APIENTRY glBlendEquation (GLenum);
GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *);
GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *);
GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei);
GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *);
GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei);
GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat);
GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *);
GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint);
GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *);
GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei);
GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *);
GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean);
GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean);
GLAPI void APIENTRY glResetHistogram (GLenum);
GLAPI void APIENTRY glResetMinmax (GLenum);
GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
#endif
 
#ifndef GL_VERSION_1_3
#define GL_VERSION_1_3 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glActiveTexture (GLenum);
GLAPI void APIENTRY glClientActiveTexture (GLenum);
GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble);
GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat);
GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *);
GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint);
GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *);
GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort);
GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *);
GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble);
GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *);
GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat);
GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *);
GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint);
GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *);
GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort);
GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *);
GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *);
GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *);
GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint);
GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *);
GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *);
GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *);
GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *);
GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint);
GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *);
GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *);
GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *);
GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *);
GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *);
GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *);
GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
#endif
 
#ifndef GL_VERSION_1_4
#define GL_VERSION_1_4 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
GLAPI void APIENTRY glFogCoordf (GLfloat);
GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
GLAPI void APIENTRY glFogCoordd (GLdouble);
GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat);
GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *);
GLAPI void APIENTRY glPointParameteri (GLenum, GLint);
GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *);
GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte);
GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *);
GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *);
GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *);
GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint);
GLAPI void APIENTRY glSecondaryColor3iv (const GLint *);
GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort);
GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *);
GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte);
GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *);
GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint);
GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *);
GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort);
GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *);
GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble);
GLAPI void APIENTRY glWindowPos2dv (const GLdouble *);
GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat);
GLAPI void APIENTRY glWindowPos2fv (const GLfloat *);
GLAPI void APIENTRY glWindowPos2i (GLint, GLint);
GLAPI void APIENTRY glWindowPos2iv (const GLint *);
GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort);
GLAPI void APIENTRY glWindowPos2sv (const GLshort *);
GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glWindowPos3dv (const GLdouble *);
GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glWindowPos3fv (const GLfloat *);
GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint);
GLAPI void APIENTRY glWindowPos3iv (const GLint *);
GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort);
GLAPI void APIENTRY glWindowPos3sv (const GLshort *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
#endif
 
#ifndef GL_VERSION_1_5
#define GL_VERSION_1_5 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *);
GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *);
GLAPI GLboolean APIENTRY glIsQuery (GLuint);
GLAPI void APIENTRY glBeginQuery (GLenum, GLuint);
GLAPI void APIENTRY glEndQuery (GLenum);
GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *);
GLAPI void APIENTRY glBindBuffer (GLenum, GLuint);
GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *);
GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *);
GLAPI GLboolean APIENTRY glIsBuffer (GLuint);
GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum);
GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *);
GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum);
GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum);
GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
#endif
 
#ifndef GL_ARB_multitexture
#define GL_ARB_multitexture 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glActiveTextureARB (GLenum);
GLAPI void APIENTRY glClientActiveTextureARB (GLenum);
GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble);
GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *);
GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat);
GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *);
GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint);
GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *);
GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort);
GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *);
GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *);
GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint);
GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *);
GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort);
GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *);
GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *);
GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *);
GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *);
GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *);
GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *);
GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
#endif
 
#ifndef GL_ARB_transpose_matrix
#define GL_ARB_transpose_matrix 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *);
GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *);
GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *);
GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
#endif
 
#ifndef GL_ARB_multisample
#define GL_ARB_multisample 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
#endif
 
#ifndef GL_ARB_texture_env_add
#define GL_ARB_texture_env_add 1
#endif
 
#ifndef GL_ARB_texture_cube_map
#define GL_ARB_texture_cube_map 1
#endif
 
#ifndef GL_ARB_texture_compression
#define GL_ARB_texture_compression 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
#endif
 
#ifndef GL_ARB_texture_border_clamp
#define GL_ARB_texture_border_clamp 1
#endif
 
#ifndef GL_ARB_point_parameters
#define GL_ARB_point_parameters 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
#endif
 
#ifndef GL_ARB_vertex_blend
#define GL_ARB_vertex_blend 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *);
GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *);
GLAPI void APIENTRY glWeightivARB (GLint, const GLint *);
GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *);
GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *);
GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *);
GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *);
GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *);
GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glVertexBlendARB (GLint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
#endif
 
#ifndef GL_ARB_matrix_palette
#define GL_ARB_matrix_palette 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint);
GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *);
GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *);
GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *);
GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
#endif
 
#ifndef GL_ARB_texture_env_combine
#define GL_ARB_texture_env_combine 1
#endif
 
#ifndef GL_ARB_texture_env_crossbar
#define GL_ARB_texture_env_crossbar 1
#endif
 
#ifndef GL_ARB_texture_env_dot3
#define GL_ARB_texture_env_dot3 1
#endif
 
#ifndef GL_ARB_texture_mirror_repeat
#define GL_ARB_texture_mirror_repeat 1
#endif
 
#ifndef GL_ARB_depth_texture
#define GL_ARB_depth_texture 1
#endif
 
#ifndef GL_ARB_shadow
#define GL_ARB_shadow 1
#endif
 
#ifndef GL_ARB_shadow_ambient
#define GL_ARB_shadow_ambient 1
#endif
 
#ifndef GL_ARB_window_pos
#define GL_ARB_window_pos 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble);
GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *);
GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat);
GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *);
GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint);
GLAPI void APIENTRY glWindowPos2ivARB (const GLint *);
GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort);
GLAPI void APIENTRY glWindowPos2svARB (const GLshort *);
GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *);
GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *);
GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint);
GLAPI void APIENTRY glWindowPos3ivARB (const GLint *);
GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort);
GLAPI void APIENTRY glWindowPos3svARB (const GLshort *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
#endif
 
#ifndef GL_ARB_vertex_program
#define GL_ARB_vertex_program 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble);
GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat);
GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort);
GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *);
GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *);
GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *);
GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *);
GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *);
GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *);
GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *);
GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *);
GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *);
GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *);
GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint);
GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint);
GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint);
GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *);
GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *);
GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *);
GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *);
GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *);
GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *);
GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *);
GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *);
GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *);
GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *);
GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *);
GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *);
GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *);
GLAPI GLboolean APIENTRY glIsProgramARB (GLuint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
#endif
 
#ifndef GL_ARB_fragment_program
#define GL_ARB_fragment_program 1
/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
#endif
 
#ifndef GL_ARB_vertex_buffer_object
#define GL_ARB_vertex_buffer_object 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint);
GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *);
GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *);
GLAPI GLboolean APIENTRY glIsBufferARB (GLuint);
GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum);
GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum);
GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
#endif
 
#ifndef GL_ARB_occlusion_query
#define GL_ARB_occlusion_query 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *);
GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *);
GLAPI GLboolean APIENTRY glIsQueryARB (GLuint);
GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint);
GLAPI void APIENTRY glEndQueryARB (GLenum);
GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
#endif
 
#ifndef GL_ARB_shader_objects
#define GL_ARB_shader_objects 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB);
GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum);
GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB);
GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum);
GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
GLAPI void APIENTRY glCompileShaderARB (GLhandleARB);
GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB);
GLAPI void APIENTRY glLinkProgramARB (GLhandleARB);
GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB);
GLAPI void APIENTRY glValidateProgramARB (GLhandleARB);
GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat);
GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat);
GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glUniform1iARB (GLint, GLint);
GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint);
GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint);
GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint);
GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *);
GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *);
GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *);
GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *);
GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *);
GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *);
GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *);
GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *);
GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *);
GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
#endif
 
#ifndef GL_ARB_vertex_shader
#define GL_ARB_vertex_shader 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *);
GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
#endif
 
#ifndef GL_ARB_fragment_shader
#define GL_ARB_fragment_shader 1
#endif
 
#ifndef GL_ARB_shading_language_100
#define GL_ARB_shading_language_100 1
#endif
 
#ifndef GL_ARB_texture_non_power_of_two
#define GL_ARB_texture_non_power_of_two 1
#endif
 
#ifndef GL_ARB_point_sprite
#define GL_ARB_point_sprite 1
#endif
 
#ifndef GL_EXT_abgr
#define GL_EXT_abgr 1
#endif
 
#ifndef GL_EXT_blend_color
#define GL_EXT_blend_color 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
#endif
 
#ifndef GL_EXT_polygon_offset
#define GL_EXT_polygon_offset 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
#endif
 
#ifndef GL_EXT_texture
#define GL_EXT_texture 1
#endif
 
#ifndef GL_EXT_texture3D
#define GL_EXT_texture3D 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
#endif
 
#ifndef GL_SGIS_texture_filter4
#define GL_SGIS_texture_filter4 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
#endif
 
#ifndef GL_EXT_subtexture
#define GL_EXT_subtexture 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
#endif
 
#ifndef GL_EXT_copy_texture
#define GL_EXT_copy_texture 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei);
GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
#endif
 
#ifndef GL_EXT_histogram
#define GL_EXT_histogram 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean);
GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean);
GLAPI void APIENTRY glResetHistogramEXT (GLenum);
GLAPI void APIENTRY glResetMinmaxEXT (GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
#endif
 
#ifndef GL_EXT_convolution
#define GL_EXT_convolution 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat);
GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *);
GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint);
GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *);
GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei);
GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *);
GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
#endif
 
#ifndef GL_EXT_color_matrix
#define GL_EXT_color_matrix 1
#endif
 
#ifndef GL_SGI_color_table
#define GL_SGI_color_table 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *);
GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *);
GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei);
GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *);
GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
#endif
 
#ifndef GL_SGIX_pixel_texture
#define GL_SGIX_pixel_texture 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPixelTexGenSGIX (GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
#endif
 
#ifndef GL_SGIS_pixel_texture
#define GL_SGIS_pixel_texture 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint);
GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *);
GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat);
GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *);
GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *);
GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
#endif
 
#ifndef GL_SGIS_texture4D
#define GL_SGIS_texture4D 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
#endif
 
#ifndef GL_SGI_texture_color_table
#define GL_SGI_texture_color_table 1
#endif
 
#ifndef GL_EXT_cmyka
#define GL_EXT_cmyka 1
#endif
 
#ifndef GL_EXT_texture_object
#define GL_EXT_texture_object 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *);
GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint);
GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *);
GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *);
GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint);
GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
#endif
 
#ifndef GL_SGIS_detail_texture
#define GL_SGIS_detail_texture 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
#endif
 
#ifndef GL_SGIS_sharpen_texture
#define GL_SGIS_sharpen_texture 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
#endif
 
#ifndef GL_EXT_packed_pixels
#define GL_EXT_packed_pixels 1
#endif
 
#ifndef GL_SGIS_texture_lod
#define GL_SGIS_texture_lod 1
#endif
 
#ifndef GL_SGIS_multisample
#define GL_SGIS_multisample 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean);
GLAPI void APIENTRY glSamplePatternSGIS (GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
#endif
 
#ifndef GL_EXT_rescale_normal
#define GL_EXT_rescale_normal 1
#endif
 
#ifndef GL_EXT_vertex_array
#define GL_EXT_vertex_array 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glArrayElementEXT (GLint);
GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei);
GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *);
GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *);
GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
#endif
 
#ifndef GL_EXT_misc_attribute
#define GL_EXT_misc_attribute 1
#endif
 
#ifndef GL_SGIS_generate_mipmap
#define GL_SGIS_generate_mipmap 1
#endif
 
#ifndef GL_SGIX_clipmap
#define GL_SGIX_clipmap 1
#endif
 
#ifndef GL_SGIX_shadow
#define GL_SGIX_shadow 1
#endif
 
#ifndef GL_SGIS_texture_edge_clamp
#define GL_SGIS_texture_edge_clamp 1
#endif
 
#ifndef GL_SGIS_texture_border_clamp
#define GL_SGIS_texture_border_clamp 1
#endif
 
#ifndef GL_EXT_blend_minmax
#define GL_EXT_blend_minmax 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBlendEquationEXT (GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
#endif
 
#ifndef GL_EXT_blend_subtract
#define GL_EXT_blend_subtract 1
#endif
 
#ifndef GL_EXT_blend_logic_op
#define GL_EXT_blend_logic_op 1
#endif
 
#ifndef GL_SGIX_interlace
#define GL_SGIX_interlace 1
#endif
 
#ifndef GL_SGIX_pixel_tiles
#define GL_SGIX_pixel_tiles 1
#endif
 
#ifndef GL_SGIX_texture_select
#define GL_SGIX_texture_select 1
#endif
 
#ifndef GL_SGIX_sprite
#define GL_SGIX_sprite 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat);
GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *);
GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint);
GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
#endif
 
#ifndef GL_SGIX_texture_multi_buffer
#define GL_SGIX_texture_multi_buffer 1
#endif
 
#ifndef GL_EXT_point_parameters
#define GL_EXT_point_parameters 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat);
GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
#endif
 
#ifndef GL_SGIS_point_parameters
#define GL_SGIS_point_parameters 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat);
GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
#endif
 
#ifndef GL_SGIX_instruments
#define GL_SGIX_instruments 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *);
GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *);
GLAPI void APIENTRY glReadInstrumentsSGIX (GLint);
GLAPI void APIENTRY glStartInstrumentsSGIX (void);
GLAPI void APIENTRY glStopInstrumentsSGIX (GLint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
#endif
 
#ifndef GL_SGIX_texture_scale_bias
#define GL_SGIX_texture_scale_bias 1
#endif
 
#ifndef GL_SGIX_framezoom
#define GL_SGIX_framezoom 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFrameZoomSGIX (GLint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
#endif
 
#ifndef GL_SGIX_tag_sample_buffer
#define GL_SGIX_tag_sample_buffer 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTagSampleBufferSGIX (void);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
#endif
 
#ifndef GL_SGIX_polynomial_ffd
#define GL_SGIX_polynomial_ffd 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
GLAPI void APIENTRY glDeformSGIX (GLbitfield);
GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
#endif
 
#ifndef GL_SGIX_reference_plane
#define GL_SGIX_reference_plane 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
#endif
 
#ifndef GL_SGIX_flush_raster
#define GL_SGIX_flush_raster 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFlushRasterSGIX (void);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
#endif
 
#ifndef GL_SGIX_depth_texture
#define GL_SGIX_depth_texture 1
#endif
 
#ifndef GL_SGIS_fog_function
#define GL_SGIS_fog_function 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *);
GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
#endif
 
#ifndef GL_SGIX_fog_offset
#define GL_SGIX_fog_offset 1
#endif
 
#ifndef GL_HP_image_transform
#define GL_HP_image_transform 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint);
GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat);
GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *);
GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *);
GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
#endif
 
#ifndef GL_HP_convolution_border_modes
#define GL_HP_convolution_border_modes 1
#endif
 
#ifndef GL_SGIX_texture_add_env
#define GL_SGIX_texture_add_env 1
#endif
 
#ifndef GL_EXT_color_subtable
#define GL_EXT_color_subtable 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
#endif
 
#ifndef GL_PGI_vertex_hints
#define GL_PGI_vertex_hints 1
#endif
 
#ifndef GL_PGI_misc_hints
#define GL_PGI_misc_hints 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glHintPGI (GLenum, GLint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
#endif
 
#ifndef GL_EXT_paletted_texture
#define GL_EXT_paletted_texture 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
#endif
 
#ifndef GL_EXT_clip_volume_hint
#define GL_EXT_clip_volume_hint 1
#endif
 
#ifndef GL_SGIX_list_priority
#define GL_SGIX_list_priority 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat);
GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *);
GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint);
GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
#endif
 
#ifndef GL_SGIX_ir_instrument1
#define GL_SGIX_ir_instrument1 1
#endif
 
#ifndef GL_SGIX_calligraphic_fragment
#define GL_SGIX_calligraphic_fragment 1
#endif
 
#ifndef GL_SGIX_texture_lod_bias
#define GL_SGIX_texture_lod_bias 1
#endif
 
#ifndef GL_SGIX_shadow_ambient
#define GL_SGIX_shadow_ambient 1
#endif
 
#ifndef GL_EXT_index_texture
#define GL_EXT_index_texture 1
#endif
 
#ifndef GL_EXT_index_material
#define GL_EXT_index_material 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
#endif
 
#ifndef GL_EXT_index_func
#define GL_EXT_index_func 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
#endif
 
#ifndef GL_EXT_index_array_formats
#define GL_EXT_index_array_formats 1
#endif
 
#ifndef GL_EXT_compiled_vertex_array
#define GL_EXT_compiled_vertex_array 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei);
GLAPI void APIENTRY glUnlockArraysEXT (void);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
#endif
 
#ifndef GL_EXT_cull_vertex
#define GL_EXT_cull_vertex 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *);
GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
#endif
 
#ifndef GL_SGIX_ycrcb
#define GL_SGIX_ycrcb 1
#endif
 
#ifndef GL_SGIX_fragment_lighting
#define GL_SGIX_fragment_lighting 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum);
GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat);
GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *);
GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint);
GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *);
GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat);
GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *);
GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint);
GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *);
GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat);
GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *);
GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint);
GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *);
GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
#endif
 
#ifndef GL_IBM_rasterpos_clip
#define GL_IBM_rasterpos_clip 1
#endif
 
#ifndef GL_HP_texture_lighting
#define GL_HP_texture_lighting 1
#endif
 
#ifndef GL_EXT_draw_range_elements
#define GL_EXT_draw_range_elements 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
#endif
 
#ifndef GL_WIN_phong_shading
#define GL_WIN_phong_shading 1
#endif
 
#ifndef GL_WIN_specular_fog
#define GL_WIN_specular_fog 1
#endif
 
#ifndef GL_EXT_light_texture
#define GL_EXT_light_texture 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glApplyTextureEXT (GLenum);
GLAPI void APIENTRY glTextureLightEXT (GLenum);
GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
#endif
 
#ifndef GL_SGIX_blend_alpha_minmax
#define GL_SGIX_blend_alpha_minmax 1
#endif
 
#ifndef GL_EXT_bgra
#define GL_EXT_bgra 1
#endif
 
#ifndef GL_SGIX_async
#define GL_SGIX_async 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint);
GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *);
GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *);
GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei);
GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei);
GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
#endif
 
#ifndef GL_SGIX_async_pixel
#define GL_SGIX_async_pixel 1
#endif
 
#ifndef GL_SGIX_async_histogram
#define GL_SGIX_async_histogram 1
#endif
 
#ifndef GL_INTEL_parallel_arrays
#define GL_INTEL_parallel_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *);
GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *);
GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *);
GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
#endif
 
#ifndef GL_HP_occlusion_test
#define GL_HP_occlusion_test 1
#endif
 
#ifndef GL_EXT_pixel_transform
#define GL_EXT_pixel_transform 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint);
GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat);
GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *);
GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
#endif
 
#ifndef GL_EXT_pixel_transform_color_table
#define GL_EXT_pixel_transform_color_table 1
#endif
 
#ifndef GL_EXT_shared_texture_palette
#define GL_EXT_shared_texture_palette 1
#endif
 
#ifndef GL_EXT_separate_specular_color
#define GL_EXT_separate_specular_color 1
#endif
 
#ifndef GL_EXT_secondary_color
#define GL_EXT_secondary_color 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte);
GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *);
GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *);
GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *);
GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint);
GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *);
GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort);
GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *);
GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte);
GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *);
GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint);
GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *);
GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort);
GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *);
GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
#endif
 
#ifndef GL_EXT_texture_perturb_normal
#define GL_EXT_texture_perturb_normal 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTextureNormalEXT (GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
#endif
 
#ifndef GL_EXT_multi_draw_arrays
#define GL_EXT_multi_draw_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
#endif
 
#ifndef GL_EXT_fog_coord
#define GL_EXT_fog_coord 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFogCoordfEXT (GLfloat);
GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *);
GLAPI void APIENTRY glFogCoorddEXT (GLdouble);
GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *);
GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
#endif
 
#ifndef GL_REND_screen_coordinates
#define GL_REND_screen_coordinates 1
#endif
 
#ifndef GL_EXT_coordinate_frame
#define GL_EXT_coordinate_frame 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte);
GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *);
GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *);
GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *);
GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint);
GLAPI void APIENTRY glTangent3ivEXT (const GLint *);
GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort);
GLAPI void APIENTRY glTangent3svEXT (const GLshort *);
GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte);
GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *);
GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *);
GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *);
GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint);
GLAPI void APIENTRY glBinormal3ivEXT (const GLint *);
GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort);
GLAPI void APIENTRY glBinormal3svEXT (const GLshort *);
GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
#endif
 
#ifndef GL_EXT_texture_env_combine
#define GL_EXT_texture_env_combine 1
#endif
 
#ifndef GL_APPLE_specular_vector
#define GL_APPLE_specular_vector 1
#endif
 
#ifndef GL_APPLE_transform_hint
#define GL_APPLE_transform_hint 1
#endif
 
#ifndef GL_SGIX_fog_scale
#define GL_SGIX_fog_scale 1
#endif
 
#ifndef GL_SUNX_constant_data
#define GL_SUNX_constant_data 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFinishTextureSUNX (void);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
#endif
 
#ifndef GL_SUN_global_alpha
#define GL_SUN_global_alpha 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte);
GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort);
GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint);
GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat);
GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble);
GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte);
GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort);
GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
#endif
 
#ifndef GL_SUN_triangle_list
#define GL_SUN_triangle_list 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint);
GLAPI void APIENTRY glReplacementCodeusSUN (GLushort);
GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte);
GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *);
GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *);
GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *);
GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
#endif
 
#ifndef GL_SUN_vertex
#define GL_SUN_vertex 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat);
GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *);
GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *);
GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *);
GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *);
GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *);
GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
#endif
 
#ifndef GL_EXT_blend_func_separate
#define GL_EXT_blend_func_separate 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
#endif
 
#ifndef GL_INGR_blend_func_separate
#define GL_INGR_blend_func_separate 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
#endif
 
#ifndef GL_INGR_color_clamp
#define GL_INGR_color_clamp 1
#endif
 
#ifndef GL_INGR_interlace_read
#define GL_INGR_interlace_read 1
#endif
 
#ifndef GL_EXT_stencil_wrap
#define GL_EXT_stencil_wrap 1
#endif
 
#ifndef GL_EXT_422_pixels
#define GL_EXT_422_pixels 1
#endif
 
#ifndef GL_NV_texgen_reflection
#define GL_NV_texgen_reflection 1
#endif
 
#ifndef GL_SUN_convolution_border_modes
#define GL_SUN_convolution_border_modes 1
#endif
 
#ifndef GL_EXT_texture_env_add
#define GL_EXT_texture_env_add 1
#endif
 
#ifndef GL_EXT_texture_lod_bias
#define GL_EXT_texture_lod_bias 1
#endif
 
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_EXT_texture_filter_anisotropic 1
#endif
 
#ifndef GL_EXT_vertex_weighting
#define GL_EXT_vertex_weighting 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glVertexWeightfEXT (GLfloat);
GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *);
GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
#endif
 
#ifndef GL_NV_light_max_exponent
#define GL_NV_light_max_exponent 1
#endif
 
#ifndef GL_NV_vertex_array_range
#define GL_NV_vertex_array_range 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
#endif
 
#ifndef GL_NV_register_combiners
#define GL_NV_register_combiners 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *);
GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint);
GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
#endif
 
#ifndef GL_NV_fog_distance
#define GL_NV_fog_distance 1
#endif
 
#ifndef GL_NV_texgen_emboss
#define GL_NV_texgen_emboss 1
#endif
 
#ifndef GL_NV_blend_square
#define GL_NV_blend_square 1
#endif
 
#ifndef GL_NV_texture_env_combine4
#define GL_NV_texture_env_combine4 1
#endif
 
#ifndef GL_MESA_resize_buffers
#define GL_MESA_resize_buffers 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glResizeBuffersMESA (void);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
#endif
 
#ifndef GL_MESA_window_pos
#define GL_MESA_window_pos 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble);
GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *);
GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat);
GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *);
GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint);
GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *);
GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort);
GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *);
GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *);
GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *);
GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint);
GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *);
GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort);
GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *);
GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *);
GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *);
GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint);
GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *);
GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
#endif
 
#ifndef GL_IBM_cull_vertex
#define GL_IBM_cull_vertex 1
#endif
 
#ifndef GL_IBM_multimode_draw_arrays
#define GL_IBM_multimode_draw_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint);
GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
#endif
 
#ifndef GL_IBM_vertex_array_lists
#define GL_IBM_vertex_array_lists 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint);
GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
#endif
 
#ifndef GL_SGIX_subsample
#define GL_SGIX_subsample 1
#endif
 
#ifndef GL_SGIX_ycrcba
#define GL_SGIX_ycrcba 1
#endif
 
#ifndef GL_SGIX_ycrcb_subsample
#define GL_SGIX_ycrcb_subsample 1
#endif
 
#ifndef GL_SGIX_depth_pass_instrument
#define GL_SGIX_depth_pass_instrument 1
#endif
 
#ifndef GL_3DFX_texture_compression_FXT1
#define GL_3DFX_texture_compression_FXT1 1
#endif
 
#ifndef GL_3DFX_multisample
#define GL_3DFX_multisample 1
#endif
 
#ifndef GL_3DFX_tbuffer
#define GL_3DFX_tbuffer 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTbufferMask3DFX (GLuint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
#endif
 
#ifndef GL_EXT_multisample
#define GL_EXT_multisample 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean);
GLAPI void APIENTRY glSamplePatternEXT (GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
#endif
 
#ifndef GL_SGIX_vertex_preclip
#define GL_SGIX_vertex_preclip 1
#endif
 
#ifndef GL_SGIX_convolution_accuracy
#define GL_SGIX_convolution_accuracy 1
#endif
 
#ifndef GL_SGIX_resample
#define GL_SGIX_resample 1
#endif
 
#ifndef GL_SGIS_point_line_texgen
#define GL_SGIS_point_line_texgen 1
#endif
 
#ifndef GL_SGIS_texture_color_mask
#define GL_SGIS_texture_color_mask 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
#endif
 
#ifndef GL_SGIX_igloo_interface
#define GL_SGIX_igloo_interface 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
#endif
 
#ifndef GL_EXT_texture_env_dot3
#define GL_EXT_texture_env_dot3 1
#endif
 
#ifndef GL_ATI_texture_mirror_once
#define GL_ATI_texture_mirror_once 1
#endif
 
#ifndef GL_NV_fence
#define GL_NV_fence 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
GLAPI GLboolean APIENTRY glIsFenceNV (GLuint);
GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glFinishFenceNV (GLuint);
GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
#endif
 
#ifndef GL_NV_evaluators
#define GL_NV_evaluators 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *);
GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *);
GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *);
GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *);
GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
#endif
 
#ifndef GL_NV_packed_depth_stencil
#define GL_NV_packed_depth_stencil 1
#endif
 
#ifndef GL_NV_register_combiners2
#define GL_NV_register_combiners2 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *);
GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
#endif
 
#ifndef GL_NV_texture_compression_vtc
#define GL_NV_texture_compression_vtc 1
#endif
 
#ifndef GL_NV_texture_rectangle
#define GL_NV_texture_rectangle 1
#endif
 
#ifndef GL_NV_texture_shader
#define GL_NV_texture_shader 1
#endif
 
#ifndef GL_NV_texture_shader2
#define GL_NV_texture_shader2 1
#endif
 
#ifndef GL_NV_vertex_array_range2
#define GL_NV_vertex_array_range2 1
#endif
 
#ifndef GL_NV_vertex_program
#define GL_NV_vertex_program 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint);
GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *);
GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *);
GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *);
GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *);
GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *);
GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *);
GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *);
GLAPI GLboolean APIENTRY glIsProgramNV (GLuint);
GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *);
GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *);
GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *);
GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *);
GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *);
GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum);
GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble);
GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *);
GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *);
GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *);
GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *);
GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *);
GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
#endif
 
#ifndef GL_SGIX_texture_coordinate_clamp
#define GL_SGIX_texture_coordinate_clamp 1
#endif
 
#ifndef GL_SGIX_scalebias_hint
#define GL_SGIX_scalebias_hint 1
#endif
 
#ifndef GL_OML_interlace
#define GL_OML_interlace 1
#endif
 
#ifndef GL_OML_subsample
#define GL_OML_subsample 1
#endif
 
#ifndef GL_OML_resample
#define GL_OML_resample 1
#endif
 
#ifndef GL_NV_copy_depth_to_color
#define GL_NV_copy_depth_to_color 1
#endif
 
#ifndef GL_ATI_envmap_bumpmap
#define GL_ATI_envmap_bumpmap 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *);
GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *);
GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *);
GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
#endif
 
#ifndef GL_ATI_fragment_shader
#define GL_ATI_fragment_shader 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint);
GLAPI void APIENTRY glBindFragmentShaderATI (GLuint);
GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint);
GLAPI void APIENTRY glBeginFragmentShaderATI (void);
GLAPI void APIENTRY glEndFragmentShaderATI (void);
GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum);
GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum);
GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
#endif
 
#ifndef GL_ATI_pn_triangles
#define GL_ATI_pn_triangles 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint);
GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
#endif
 
#ifndef GL_ATI_vertex_array_object
#define GL_ATI_vertex_array_object 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum);
GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint);
GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum);
GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glFreeObjectBufferATI (GLuint);
GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint);
GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *);
GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *);
GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint);
GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
#endif
 
#ifndef GL_EXT_vertex_shader
#define GL_EXT_vertex_shader 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBeginVertexShaderEXT (void);
GLAPI void APIENTRY glEndVertexShaderEXT (void);
GLAPI void APIENTRY glBindVertexShaderEXT (GLuint);
GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint);
GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint);
GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint);
GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint);
GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint);
GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint);
GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint);
GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint);
GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *);
GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *);
GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *);
GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *);
GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *);
GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *);
GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *);
GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *);
GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *);
GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *);
GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *);
GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint);
GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint);
GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum);
GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum);
GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum);
GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum);
GLAPI GLuint APIENTRY glBindParameterEXT (GLenum);
GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum);
GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *);
GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *);
GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *);
GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *);
GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
#endif
 
#ifndef GL_ATI_vertex_streams
#define GL_ATI_vertex_streams 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort);
GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint);
GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat);
GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble);
GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *);
GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort);
GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint);
GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *);
GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint);
GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *);
GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint);
GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *);
GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte);
GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *);
GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *);
GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint);
GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *);
GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *);
GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *);
GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum);
GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint);
GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
#endif
 
#ifndef GL_ATI_element_array
#define GL_ATI_element_array 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *);
GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei);
GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
#endif
 
#ifndef GL_SUN_mesh_array
#define GL_SUN_mesh_array 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
#endif
 
#ifndef GL_SUN_slice_accum
#define GL_SUN_slice_accum 1
#endif
 
#ifndef GL_NV_multisample_filter_hint
#define GL_NV_multisample_filter_hint 1
#endif
 
#ifndef GL_NV_depth_clamp
#define GL_NV_depth_clamp 1
#endif
 
#ifndef GL_NV_occlusion_query
#define GL_NV_occlusion_query 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *);
GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *);
GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint);
GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint);
GLAPI void APIENTRY glEndOcclusionQueryNV (void);
GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
#endif
 
#ifndef GL_NV_point_sprite
#define GL_NV_point_sprite 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint);
GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
#endif
 
#ifndef GL_NV_texture_shader3
#define GL_NV_texture_shader3 1
#endif
 
#ifndef GL_NV_vertex_program1_1
#define GL_NV_vertex_program1_1 1
#endif
 
#ifndef GL_EXT_shadow_funcs
#define GL_EXT_shadow_funcs 1
#endif
 
#ifndef GL_EXT_stencil_two_side
#define GL_EXT_stencil_two_side 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
#endif
 
#ifndef GL_ATI_text_fragment_shader
#define GL_ATI_text_fragment_shader 1
#endif
 
#ifndef GL_APPLE_client_storage
#define GL_APPLE_client_storage 1
#endif
 
#ifndef GL_APPLE_element_array
#define GL_APPLE_element_array 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *);
GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei);
GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei);
GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei);
GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
#endif
 
#ifndef GL_APPLE_fence
#define GL_APPLE_fence 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *);
GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *);
GLAPI void APIENTRY glSetFenceAPPLE (GLuint);
GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint);
GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint);
GLAPI void APIENTRY glFinishFenceAPPLE (GLuint);
GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint);
GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
#endif
 
#ifndef GL_APPLE_vertex_array_object
#define GL_APPLE_vertex_array_object 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *);
GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
#endif
 
#ifndef GL_APPLE_vertex_array_range
#define GL_APPLE_vertex_array_range 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *);
GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *);
GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
#endif
 
#ifndef GL_APPLE_ycbcr_422
#define GL_APPLE_ycbcr_422 1
#endif
 
#ifndef GL_S3_s3tc
#define GL_S3_s3tc 1
#endif
 
#ifndef GL_ATI_draw_buffers
#define GL_ATI_draw_buffers 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
#endif
 
#ifndef GL_ATI_texture_env_combine3
#define GL_ATI_texture_env_combine3 1
#endif
 
#ifndef GL_ATI_texture_float
#define GL_ATI_texture_float 1
#endif
 
#ifndef GL_NV_float_buffer
#define GL_NV_float_buffer 1
#endif
 
#ifndef GL_NV_fragment_program
#define GL_NV_fragment_program 1
/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *);
GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *);
GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *);
GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
#endif
 
#ifndef GL_NV_half_float
#define GL_NV_half_float 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *);
GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *);
GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *);
GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *);
GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *);
GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *);
GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV);
GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *);
GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *);
GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *);
GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *);
GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV);
GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *);
GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *);
GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *);
GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *);
GLAPI void APIENTRY glFogCoordhNV (GLhalfNV);
GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *);
GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *);
GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV);
GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *);
GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV);
GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *);
GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *);
GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *);
GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *);
GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *);
GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *);
GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *);
GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
#endif
 
#ifndef GL_NV_pixel_data_range
#define GL_NV_pixel_data_range 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *);
GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
#endif
 
#ifndef GL_NV_primitive_restart
#define GL_NV_primitive_restart 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPrimitiveRestartNV (void);
GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
#endif
 
#ifndef GL_NV_texture_expand_normal
#define GL_NV_texture_expand_normal 1
#endif
 
#ifndef GL_NV_vertex_program2
#define GL_NV_vertex_program2 1
#endif
 
#ifndef GL_ATI_map_object_buffer
#define GL_ATI_map_object_buffer 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint);
GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
#endif
 
#ifndef GL_ATI_separate_stencil
#define GL_ATI_separate_stencil 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum);
GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
#endif
 
#ifndef GL_ATI_vertex_attrib_array_object
#define GL_ATI_vertex_attrib_array_object 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint);
GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
#endif
 
#ifndef GL_EXT_depth_bounds_test
#define GL_EXT_depth_bounds_test 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
#endif
 
#ifndef GL_EXT_texture_mirror_clamp
#define GL_EXT_texture_mirror_clamp 1
#endif
 
#ifndef GL_EXT_blend_equation_separate
#define GL_EXT_blend_equation_separate 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
#endif
 
#ifndef GL_MESA_pack_invert
#define GL_MESA_pack_invert 1
#endif
 
#ifndef GL_MESA_ycbcr_texture
#define GL_MESA_ycbcr_texture 1
#endif
 
 
#ifdef __cplusplus
}
#endif
 
#endif
#endif /* NO_SDL_GLEXT */
/contrib/media/updf/include/SDL/SDL_quit.h
0,0 → 1,52
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_quit.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* Include file for SDL quit event handling */
 
#ifndef _SDL_quit_h
#define _SDL_quit_h
 
/*
An SDL_QUITEVENT is generated when the user tries to close the application
window. If it is ignored or filtered out, the window will remain open.
If it is not ignored or filtered, it is queued normally and the window
is allowed to close. When the window is closed, screen updates will
complete, but have no effect.
 
SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
and SIGTERM (system termination request), if handlers do not already
exist, that generate SDL_QUITEVENT events as well. There is no way
to determine the cause of an SDL_QUITEVENT, but setting a signal
handler in your application will override the default generation of
quit events for that signal.
*/
 
/* There are no functions directly affecting the quit event */
#define SDL_QuitRequested() \
(SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK))
 
#endif /* _SDL_quit_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_rwops.h
0,0 → 1,113
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_rwops.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* This file provides a general interface for SDL to read and write
data sources. It can easily be extended to files, memory, etc.
*/
 
#ifndef _SDL_RWops_h
#define _SDL_RWops_h
 
#include <stdio.h>
 
#include "SDL_types.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* This is the read/write operation structure -- very basic */
 
typedef struct SDL_RWops {
/* Seek to 'offset' relative to whence, one of stdio's whence values:
SEEK_SET, SEEK_CUR, SEEK_END
Returns the final offset in the data source.
*/
int (*seek)(struct SDL_RWops *context, int offset, int whence);
 
/* Read up to 'num' objects each of size 'objsize' from the data
source to the area pointed at by 'ptr'.
Returns the number of objects read, or -1 if the read failed.
*/
int (*read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
 
/* Write exactly 'num' objects each of size 'objsize' from the area
pointed at by 'ptr' to data source.
Returns 'num', or -1 if the write failed.
*/
int (*write)(struct SDL_RWops *context, const void *ptr, int size, int num);
 
/* Close and free an allocated SDL_FSops structure */
int (*close)(struct SDL_RWops *context);
 
Uint32 type;
union {
struct {
int autoclose;
FILE *fp;
} stdio;
struct {
Uint8 *base;
Uint8 *here;
Uint8 *stop;
} mem;
struct {
void *data1;
} unknown;
} hidden;
 
} SDL_RWops;
 
 
/* Functions to create SDL_RWops structures from various data sources */
 
extern DECLSPEC SDL_RWops * SDL_RWFromFile(const char *file, const char *mode);
 
extern DECLSPEC SDL_RWops * SDL_RWFromFP(FILE *fp, int autoclose);
 
extern DECLSPEC SDL_RWops * SDL_RWFromMem(void *mem, int size);
 
extern DECLSPEC SDL_RWops * SDL_AllocRW(void);
extern DECLSPEC void SDL_FreeRW(SDL_RWops *area);
 
/* Macros to easily read and write from an SDL_RWops structure */
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, SEEK_CUR)
#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
#define SDL_RWclose(ctx) (ctx)->close(ctx)
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_RWops_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_syswm.h
0,0 → 1,165
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_syswm.h,v 1.5 2001/07/08 09:00:06 hercules Exp $";
#endif
 
/* Include file for SDL custom system window manager hooks */
 
#ifndef _SDL_syswm_h
#define _SDL_syswm_h
 
#include "SDL_version.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* Your application has access to a special type of event 'SDL_SYSWMEVENT',
which contains window-manager specific information and arrives whenever
an unhandled window event occurs. This event is ignored by default, but
you can enable it with SDL_EventState()
*/
#ifdef SDL_PROTOTYPES_ONLY
struct SDL_SysWMinfo;
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
#else
 
/* This is the structure for custom window manager events */
#if (defined(unix) || defined(__unix__) || defined(_AIX) || defined(__OpenBSD__)) && \
(!defined(DISABLE_X11) && !defined(__CYGWIN32__))
/* AIX is unix, of course, but the native compiler CSet doesn't define unix */
#include <X11/Xlib.h>
#include <X11/Xatom.h>
 
/* These are the various supported subsystems under UNIX */
typedef enum {
SDL_SYSWM_X11
} SDL_SYSWM_TYPE;
 
/* The UNIX custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union {
XEvent xevent;
} event;
};
 
/* The UNIX custom window manager information structure.
When this structure is returned, it holds information about which
low level system it is using, and will be one of SDL_SYSWM_TYPE.
*/
typedef struct {
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union {
struct {
Display *display; /* The X11 display */
Window window; /* The X11 display window */
/* These locking functions should be called around
any X11 functions using the display variable.
They lock the event thread, so should not be
called around event functions or from event filters.
*/
void (*lock_func)(void);
void (*unlock_func)(void);
 
/* Introduced in SDL 1.0.2 */
Window fswindow; /* The X11 fullscreen window */
Window wmwindow; /* The X11 managed input window */
} x11;
} info;
} SDL_SysWMinfo;
 
#elif defined(ENABLE_NANOX)
#include <microwin/nano-X.h>
 
/* The generic custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
int data;
};
 
/* The windows custom window manager information structure */
typedef struct {
SDL_version version ;
GR_WINDOW_ID window ; /* The display window */
} SDL_SysWMinfo;
 
#elif defined(WIN32UNDEFINED)
#include <windows.h>
 
/* The windows custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
HWND hwnd; /* The window for the message */
UINT msg; /* The type of message */
WPARAM wParam; /* WORD message parameter */
LPARAM lParam; /* LONG message parameter */
};
 
/* The windows custom window manager information structure */
typedef struct {
SDL_version version;
HWND window; /* The Win32 display window */
} SDL_SysWMinfo;
 
#else
 
/* The generic custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
int data;
};
 
/* The generic custom window manager information structure */
typedef struct {
SDL_version version;
int data;
} SDL_SysWMinfo;
 
#endif /* OS type */
 
#endif /* SDL_PROTOTYPES_ONLY */
 
/* Function prototypes */
/*
* This function gives you custom hooks into the window manager information.
* It fills the structure pointed to by 'info' with custom information and
* returns 1 if the function is implemented. If it's not implemented, or
* the version member of the 'info' structure is invalid, it returns 0.
*/
extern DECLSPEC int SDL_GetWMInfo(SDL_SysWMinfo *info);
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_syswm_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_syswm.h.BAK
0,0 → 1,165
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_syswm.h,v 1.5 2001/07/08 09:00:06 hercules Exp $";
#endif
 
/* Include file for SDL custom system window manager hooks */
 
#ifndef _SDL_syswm_h
#define _SDL_syswm_h
 
#include "SDL_version.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* Your application has access to a special type of event 'SDL_SYSWMEVENT',
which contains window-manager specific information and arrives whenever
an unhandled window event occurs. This event is ignored by default, but
you can enable it with SDL_EventState()
*/
#ifdef SDL_PROTOTYPES_ONLY
struct SDL_SysWMinfo;
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
#else
 
/* This is the structure for custom window manager events */
#if (defined(unix) || defined(__unix__) || defined(_AIX) || defined(__OpenBSD__)) && \
(!defined(DISABLE_X11) && !defined(__CYGWIN32__))
/* AIX is unix, of course, but the native compiler CSet doesn't define unix */
#include <X11/Xlib.h>
#include <X11/Xatom.h>
 
/* These are the various supported subsystems under UNIX */
typedef enum {
SDL_SYSWM_X11
} SDL_SYSWM_TYPE;
 
/* The UNIX custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union {
XEvent xevent;
} event;
};
 
/* The UNIX custom window manager information structure.
When this structure is returned, it holds information about which
low level system it is using, and will be one of SDL_SYSWM_TYPE.
*/
typedef struct {
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union {
struct {
Display *display; /* The X11 display */
Window window; /* The X11 display window */
/* These locking functions should be called around
any X11 functions using the display variable.
They lock the event thread, so should not be
called around event functions or from event filters.
*/
void (*lock_func)(void);
void (*unlock_func)(void);
 
/* Introduced in SDL 1.0.2 */
Window fswindow; /* The X11 fullscreen window */
Window wmwindow; /* The X11 managed input window */
} x11;
} info;
} SDL_SysWMinfo;
 
#elif defined(ENABLE_NANOX)
#include <microwin/nano-X.h>
 
/* The generic custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
int data;
};
 
/* The windows custom window manager information structure */
typedef struct {
SDL_version version ;
GR_WINDOW_ID window ; /* The display window */
} SDL_SysWMinfo;
 
#elif defined(WIN32)
#include <windows.h>
 
/* The windows custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
HWND hwnd; /* The window for the message */
UINT msg; /* The type of message */
WPARAM wParam; /* WORD message parameter */
LPARAM lParam; /* LONG message parameter */
};
 
/* The windows custom window manager information structure */
typedef struct {
SDL_version version;
HWND window; /* The Win32 display window */
} SDL_SysWMinfo;
 
#else
 
/* The generic custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
int data;
};
 
/* The generic custom window manager information structure */
typedef struct {
SDL_version version;
int data;
} SDL_SysWMinfo;
 
#endif /* OS type */
 
#endif /* SDL_PROTOTYPES_ONLY */
 
/* Function prototypes */
/*
* This function gives you custom hooks into the window manager information.
* It fills the structure pointed to by 'info' with custom information and
* returns 1 if the function is implemented. If it's not implemented, or
* the version member of the 'info' structure is invalid, it returns 0.
*/
extern DECLSPEC int SDL_GetWMInfo(SDL_SysWMinfo *info);
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_syswm_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_thread.h
0,0 → 1,79
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_thread.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
#ifndef _SDL_thread_h
#define _SDL_thread_h
 
/* Header for the SDL thread management routines
 
These are independent of the other SDL routines.
*/
 
#include "SDL_main.h"
#include "SDL_types.h"
 
/* Thread synchronization primitives */
#include "SDL_mutex.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* The SDL thread structure, defined in SDL_thread.c */
struct SDL_Thread;
typedef struct SDL_Thread SDL_Thread;
 
/* Create a thread */
extern DECLSPEC SDL_Thread * SDL_CreateThread(int (*fn)(void *), void *data);
 
/* Get the 32-bit thread identifier for the current thread */
extern DECLSPEC Uint32 SDL_ThreadID(void);
 
/* Get the 32-bit thread identifier for the specified thread,
equivalent to SDL_ThreadID() if the specified thread is NULL.
*/
extern DECLSPEC Uint32 SDL_GetThreadID(SDL_Thread *thread);
 
/* Wait for a thread to finish.
The return code for the thread function is placed in the area
pointed to by 'status', if 'status' is not NULL.
*/
extern DECLSPEC void SDL_WaitThread(SDL_Thread *thread, int *status);
 
/* Forcefully kill a thread without worrying about its state */
extern DECLSPEC void SDL_KillThread(SDL_Thread *thread);
 
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_thread_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_timer.h
0,0 → 1,118
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_timer.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
#ifndef _SDL_timer_h
#define _SDL_timer_h
 
/* Header for the SDL time management routines */
 
#include "SDL_main.h"
#include "SDL_types.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* This is the OS scheduler timeslice, in milliseconds */
#define SDL_TIMESLICE 10
 
/* This is the maximum resolution of the SDL timer on all platforms */
#define TIMER_RESOLUTION 10 /* Experimentally determined */
 
/* Get the number of milliseconds since the SDL library initialization.
* Note that this value wraps if the program runs for more than ~49 days.
*/
extern DECLSPEC Uint32 SDL_GetTicks(void);
 
/* Wait a specified number of milliseconds before returning */
extern DECLSPEC void SDL_Delay(Uint32 ms);
 
/* Function prototype for the timer callback function */
typedef Uint32 (*SDL_TimerCallback)(Uint32 interval);
 
/* Set a callback to run after the specified number of milliseconds has
* elapsed. The callback function is passed the current timer interval
* and returns the next timer interval. If the returned value is the
* same as the one passed in, the periodic alarm continues, otherwise a
* new alarm is scheduled. If the callback returns 0, the periodic alarm
* is cancelled.
*
* To cancel a currently running timer, call SDL_SetTimer(0, NULL);
*
* The timer callback function may run in a different thread than your
* main code, and so shouldn't call any functions from within itself.
*
* The maximum resolution of this timer is 10 ms, which means that if
* you request a 16 ms timer, your callback will run approximately 20 ms
* later on an unloaded system. If you wanted to set a flag signaling
* a frame update at 30 frames per second (every 33 ms), you might set a
* timer for 30 ms:
* SDL_SetTimer((33/10)*10, flag_update);
*
* If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init().
*
* Under UNIX, you should not use raise or use SIGALRM and this function
* in the same program, as it is implemented using setitimer(). You also
* should not use this function in multi-threaded applications as signals
* to multi-threaded apps have undefined behavior in some implementations.
*/
extern DECLSPEC int SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
 
/* New timer API, supports multiple timers
* Written by Stephane Peter <megastep@lokigames.com>
*/
 
/* Function prototype for the new timer callback function.
* The callback function is passed the current timer interval and returns
* the next timer interval. If the returned value is the same as the one
* passed in, the periodic alarm continues, otherwise a new alarm is
* scheduled. If the callback returns 0, the periodic alarm is cancelled.
*/
typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);
 
/* Definition of the timer ID type */
typedef struct _SDL_TimerID *SDL_TimerID;
 
/* Add a new timer to the pool of timers already running.
Returns a timer ID, or NULL when an error occurs.
*/
extern DECLSPEC SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
 
/* Remove one of the multiple timers knowing its ID.
* Returns a boolean value indicating success.
*/
extern DECLSPEC SDL_bool SDL_RemoveTimer(SDL_TimerID t);
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_timer_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_ttf.h
0,0 → 1,176
/*
SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts
Copyright (C) 1997 Sam Lantinga
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
 
This program 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 General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
5635-34 Springhouse Dr.
Pleasanton, CA 94588 (USA)
slouken@devolution.com
*/
 
/* This library is a wrapper around the excellent FreeType 1.0 library,
available at:
http://www.physiol.med.tu-muenchen.de/~robert/freetype.html
*/
 
#ifndef _SDLttf_h
#define _SDLttf_h
 
#include "SDL.h"
#include "begin_code.h"
 
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* The internal structure containing font information */
typedef struct _TTF_Font TTF_Font;
 
/* Initialize the TTF engine - returns 0 if successful, -1 on error */
extern DECLSPEC int TTF_Init(void);
 
/* Open a font file and create a font of the specified point size */
extern DECLSPEC TTF_Font *TTF_OpenFont(const char *file, int ptsize);
 
/* Set and retrieve the font style
This font style is implemented by modifying the font glyphs, and
doesn't reflect any inherent properties of the truetype font file.
*/
#define TTF_STYLE_NORMAL 0x00
#define TTF_STYLE_BOLD 0x01
#define TTF_STYLE_ITALIC 0x02
#define TTF_STYLE_UNDERLINE 0x04
extern DECLSPEC int TTF_GetFontStyle(TTF_Font *font);
extern DECLSPEC void TTF_SetFontStyle(TTF_Font *font, int style);
 
/* Get the total height of the font - usually equal to point size */
extern DECLSPEC int TTF_FontHeight(TTF_Font *font);
 
/* Get the offset from the baseline to the top of the font
This is a positive value, relative to the baseline.
*/
extern DECLSPEC int TTF_FontAscent(TTF_Font *font);
 
/* Get the offset from the baseline to the bottom of the font
This is a negative value, relative to the baseline.
*/
extern DECLSPEC int TTF_FontDescent(TTF_Font *font);
 
/* Get the recommended spacing between lines of text for this font */
extern DECLSPEC int TTF_FontLineSkip(TTF_Font *font);
 
/* Get the metrics (dimensions) of a glyph */
extern DECLSPEC int TTF_GlyphMetrics(TTF_Font *font, Uint16 ch,
int *minx, int *maxx,
int *miny, int *maxy, int *advance);
 
/* Get the dimensions of a rendered string of text */
extern DECLSPEC int TTF_SizeText(TTF_Font *font, const char *text, int *w, int *h);
extern DECLSPEC int TTF_SizeUTF8(TTF_Font *font, const char *text, int *w, int *h);
extern DECLSPEC int TTF_SizeUNICODE(TTF_Font *font, const Uint16 *text, int *w, int *h);
 
/* Create an 8-bit palettized surface and render the given text at
fast quality with the given font and color. The 0 pixel is the
colorkey, giving a transparent background, and the 1 pixel is set
to the text color.
This function returns the new surface, or NULL if there was an error.
*/
extern DECLSPEC SDL_Surface *TTF_RenderText_Solid(TTF_Font *font,
const char *text, SDL_Color fg);
extern DECLSPEC SDL_Surface *TTF_RenderUTF8_Solid(TTF_Font *font,
const char *text, SDL_Color fg);
extern DECLSPEC SDL_Surface *TTF_RenderUNICODE_Solid(TTF_Font *font,
const Uint16 *text, SDL_Color fg);
 
/* Create an 8-bit palettized surface and render the given glyph at
fast quality with the given font and color. The 0 pixel is the
colorkey, giving a transparent background, and the 1 pixel is set
to the text color. The glyph is rendered without any padding or
centering in the X direction, and aligned normally in the Y direction.
This function returns the new surface, or NULL if there was an error.
*/
extern DECLSPEC SDL_Surface *TTF_RenderGlyph_Solid(TTF_Font *font,
Uint16 ch, SDL_Color fg);
 
/* Create an 8-bit palettized surface and render the given text at
high quality with the given font and colors. The 0 pixel is background,
while other pixels have varying degrees of the foreground color.
This function returns the new surface, or NULL if there was an error.
*/
extern DECLSPEC SDL_Surface *TTF_RenderText_Shaded(TTF_Font *font,
const char *text, SDL_Color fg, SDL_Color bg);
extern DECLSPEC SDL_Surface *TTF_RenderUTF8_Shaded(TTF_Font *font,
const char *text, SDL_Color fg, SDL_Color bg);
extern DECLSPEC SDL_Surface *TTF_RenderUNICODE_Shaded(TTF_Font *font,
const Uint16 *text, SDL_Color fg, SDL_Color bg);
 
/* Create an 8-bit palettized surface and render the given glyph at
high quality with the given font and colors. The 0 pixel is background,
while other pixels have varying degrees of the foreground color.
The glyph is rendered without any padding or centering in the X
direction, and aligned normally in the Y direction.
This function returns the new surface, or NULL if there was an error.
*/
extern DECLSPEC SDL_Surface *TTF_RenderGlyph_Shaded(TTF_Font *font,
Uint16 ch, SDL_Color fg, SDL_Color bg);
 
/* Create a 32-bit ARGB surface and render the given text at high quality,
using alpha blending to dither the font with the given color.
This function returns the new surface, or NULL if there was an error.
*/
extern DECLSPEC SDL_Surface *TTF_RenderText_Blended(TTF_Font *font,
const char *text, SDL_Color fg);
extern DECLSPEC SDL_Surface *TTF_RenderUTF8_Blended(TTF_Font *font,
const char *text, SDL_Color fg);
extern DECLSPEC SDL_Surface *TTF_RenderUNICODE_Blended(TTF_Font *font,
const Uint16 *text, SDL_Color fg);
 
/* Create a 32-bit ARGB surface and render the given glyph at high quality,
using alpha blending to dither the font with the given color.
The glyph is rendered without any padding or centering in the X
direction, and aligned normally in the Y direction.
This function returns the new surface, or NULL if there was an error.
*/
extern DECLSPEC SDL_Surface *TTF_RenderGlyph_Blended(TTF_Font *font,
Uint16 ch, SDL_Color fg);
 
/* For compatibility with previous versions, here are the old functions */
#define TTF_RenderText(font, text, fg, bg) \
TTF_RenderText_Shaded(font, text, fg, bg)
#define TTF_RenderUTF8(font, text, fg, bg) \
TTF_RenderUTF8_Shaded(font, text, fg, bg)
#define TTF_RenderUNICODE(font, text, fg, bg) \
TTF_RenderUNICODE_Shaded(font, text, fg, bg)
 
/* Close an opened font file */
extern DECLSPEC void TTF_CloseFont(TTF_Font *font);
 
/* De-initialize the TTF engine */
extern DECLSPEC void TTF_Quit(void);
 
/* We'll use SDL for reporting errors */
#define TTF_SetError SDL_SetError
#define TTF_GetError SDL_GetError
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
};
#endif
#include "close_code.h"
 
#endif /* _SDLttf_h */
/contrib/media/updf/include/SDL/SDL_types.h
0,0 → 1,87
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_types.h,v 1.2 2001/04/26 16:50:17 hercules Exp $";
#endif
 
/* General data types used by the SDL library */
 
#ifndef _SDL_types_h
#define _SDL_types_h
 
/* The number of elements in a table */
#define SDL_TABLESIZE(table) (sizeof(table)/sizeof(table[0]))
 
/* Basic data types */
typedef enum {
SDL_FALSE = 0,
SDL_TRUE = 1
} SDL_bool;
typedef unsigned char Uint8;
typedef signed char Sint8;
typedef unsigned short Uint16;
typedef signed short Sint16;
typedef unsigned int Uint32;
typedef signed int Sint32;
 
/* Figure out how to support 64-bit datatypes */
#if !defined(__STRICT_ANSI__)
#if defined(__GNUC__) || defined(__MWERKS__) /* MJS */
#define SDL_HAS_64BIT_TYPE long long
#elif defined(_MSC_VER) /* VC++ */
#define SDL_HAS_64BIT_TYPE __int64
#endif
#endif /* !__STRICT_ANSI__ */
 
/* The 64-bit datatype isn't supported on all platforms */
#ifdef SDL_HAS_64BIT_TYPE
typedef unsigned SDL_HAS_64BIT_TYPE Uint64;
typedef SDL_HAS_64BIT_TYPE Sint64;
#else
/* This is really just a hack to prevent the compiler from complaining */
typedef struct {
Uint32 hi;
Uint32 lo;
} Uint64, Sint64;
#endif
 
/* Make sure the types really have the right sizes */
#define SDL_COMPILE_TIME_ASSERT(name, x) \
typedef int SDL_dummy_ ## name[(x) * 2 - 1]
 
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
 
#undef SDL_COMPILE_TIME_ASSERT
 
/* General keyboard/mouse state definitions */
enum { SDL_PRESSED = 0x01, SDL_RELEASED = 0x00 };
 
#endif
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_version.h
0,0 → 1,90
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_version.h,v 1.3 2001/06/19 13:35:05 hercules Exp $";
#endif
 
/* This header defines the current SDL version */
 
#ifndef _SDL_version_h
#define _SDL_version_h
 
#include "SDL_types.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
#define SDL_MAJOR_VERSION 1
#define SDL_MINOR_VERSION 2
#define SDL_PATCHLEVEL 2
 
typedef struct {
Uint8 major;
Uint8 minor;
Uint8 patch;
} SDL_version;
 
/* This macro can be used to fill a version structure with the compile-time
* version of the SDL library.
*/
#define SDL_VERSION(X) \
{ \
(X)->major = SDL_MAJOR_VERSION; \
(X)->minor = SDL_MINOR_VERSION; \
(X)->patch = SDL_PATCHLEVEL; \
}
 
/* This macro turns the version numbers into a numeric value:
(1,2,3) -> (1203)
This assumes that there will never be more than 100 patchlevels
*/
#define SDL_VERSIONNUM(X, Y, Z) \
(X)*1000 + (Y)*100 + (Z)
 
/* This is the version number macro for the current SDL version */
#define SDL_COMPILEDVERSION \
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
 
/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
#define SDL_VERSION_ATLEAST(X, Y, Z) \
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
 
/* This function gets the version of the dynamically linked SDL library.
it should NOT be used to fill a version structure, instead you should
use the SDL_Version() macro.
*/
extern DECLSPEC const SDL_version * SDL_Linked_Version(void);
 
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_version_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/SDL_video.h
0,0 → 1,891
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_video.h,v 1.3 2001/06/07 14:28:11 hercules Exp $";
#endif
 
/* Header file for access to the SDL raw framebuffer window */
 
#ifndef _SDL_video_h
#define _SDL_video_h
 
#include <stdio.h>
 
#include "SDL_types.h"
#include "SDL_mutex.h"
#include "SDL_rwops.h"
 
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
 
/* Transparency definitions: These define alpha as the opacity of a surface */
#define SDL_ALPHA_OPAQUE 255
#define SDL_ALPHA_TRANSPARENT 0
 
/* Useful data types */
typedef struct {
Sint16 x, y;
Uint16 w, h;
} SDL_Rect;
 
typedef struct {
Uint8 r;
Uint8 g;
Uint8 b;
Uint8 unused;
} SDL_Color;
 
typedef struct {
int ncolors;
SDL_Color *colors;
} SDL_Palette;
 
/* Everything in the pixel format structure is read-only */
typedef struct SDL_PixelFormat {
SDL_Palette *palette;
Uint8 BitsPerPixel;
Uint8 BytesPerPixel;
Uint8 Rloss;
Uint8 Gloss;
Uint8 Bloss;
Uint8 Aloss;
Uint8 Rshift;
Uint8 Gshift;
Uint8 Bshift;
Uint8 Ashift;
Uint32 Rmask;
Uint32 Gmask;
Uint32 Bmask;
Uint32 Amask;
 
/* RGB color key information */
Uint32 colorkey;
/* Alpha value information (per-surface alpha) */
Uint8 alpha;
} SDL_PixelFormat;
 
/* typedef for private surface blitting functions */
struct SDL_Surface;
typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
struct SDL_Surface *dst, SDL_Rect *dstrect);
 
/* This structure should be treated as read-only, except for 'pixels',
which, if not NULL, contains the raw pixel data for the surface.
*/
typedef struct SDL_Surface {
Uint32 flags; /* Read-only */
SDL_PixelFormat *format; /* Read-only */
int w, h; /* Read-only */
Uint16 pitch; /* Read-only */
void *pixels; /* Read-write */
int offset; /* Private */
 
/* Hardware-specific surface info */
struct private_hwdata *hwdata;
 
/* clipping information */
SDL_Rect clip_rect; /* Read-only */
Uint32 unused1; /* for binary compatibility */
 
/* Allow recursive locks */
Uint32 locked; /* Private */
 
/* info for fast blit mapping to other surfaces */
struct SDL_BlitMap *map; /* Private */
 
/* format version, bumped at every change to invalidate blit maps */
unsigned int format_version; /* Private */
 
/* Reference count -- used when freeing surface */
int refcount; /* Read-mostly */
} SDL_Surface;
 
/* These are the currently supported flags for the SDL_surface */
/* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
#define SDL_SWSURFACE 0x00000000 /* Surface is in system memory */
#define SDL_HWSURFACE 0x00000001 /* Surface is in video memory */
#define SDL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */
/* Available for SDL_SetVideoMode() */
#define SDL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
#define SDL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
#define SDL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */
#define SDL_FULLSCREEN 0x80000000 /* Surface is a full screen display */
#define SDL_OPENGL 0x00000002 /* Create an OpenGL rendering context */
#define SDL_OPENGLBLIT 0x0000000A /* Create an OpenGL rendering context and use it for blitting */
#define SDL_RESIZABLE 0x00000010 /* This video mode may be resized */
#define SDL_NOFRAME 0x00000020 /* No window caption or edge frame */
/* Used internally (read-only) */
#define SDL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */
#define SDL_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
#define SDL_RLEACCELOK 0x00002000 /* Private flag */
#define SDL_RLEACCEL 0x00004000 /* Surface is RLE encoded */
#define SDL_SRCALPHA 0x00010000 /* Blit uses source alpha blending */
#define SDL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
 
/* Evaluates to true if the surface needs to be locked before access */
#define SDL_MUSTLOCK(surface) \
(surface->offset || \
((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
 
 
/* Useful for determining the video hardware capabilities */
typedef struct {
Uint32 hw_available :1; /* Flag: Can you create hardware surfaces? */
Uint32 wm_available :1; /* Flag: Can you talk to a window manager? */
Uint32 UnusedBits1 :6;
Uint32 UnusedBits2 :1;
Uint32 blit_hw :1; /* Flag: Accelerated blits HW --> HW */
Uint32 blit_hw_CC :1; /* Flag: Accelerated blits with Colorkey */
Uint32 blit_hw_A :1; /* Flag: Accelerated blits with Alpha */
Uint32 blit_sw :1; /* Flag: Accelerated blits SW --> HW */
Uint32 blit_sw_CC :1; /* Flag: Accelerated blits with Colorkey */
Uint32 blit_sw_A :1; /* Flag: Accelerated blits with Alpha */
Uint32 blit_fill :1; /* Flag: Accelerated color fill */
Uint32 UnusedBits3 :16;
Uint32 video_mem; /* The total amount of video memory (in K) */
SDL_PixelFormat *vfmt; /* Value: The format of the video surface */
} SDL_VideoInfo;
 
 
/* The most common video overlay formats.
For an explanation of these pixel formats, see:
http://www.webartz.com/fourcc/indexyuv.htm
 
For information on the relationship between color spaces, see:
http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
*/
#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U (3 planes) */
#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V (3 planes) */
#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
 
/* The YUV hardware video overlay */
typedef struct SDL_Overlay {
Uint32 format; /* Read-only */
int w, h; /* Read-only */
int planes; /* Read-only */
Uint16 *pitches; /* Read-only */
Uint8 **pixels; /* Read-write */
 
/* Hardware-specific surface info */
struct private_yuvhwfuncs *hwfuncs;
struct private_yuvhwdata *hwdata;
 
/* Special flags */
Uint32 hw_overlay :1; /* Flag: This overlay hardware accelerated? */
Uint32 UnusedBits :31;
} SDL_Overlay;
 
 
/* Public enumeration for setting the OpenGL window attributes. */
typedef enum {
SDL_GL_RED_SIZE,
SDL_GL_GREEN_SIZE,
SDL_GL_BLUE_SIZE,
SDL_GL_ALPHA_SIZE,
SDL_GL_BUFFER_SIZE,
SDL_GL_DOUBLEBUFFER,
SDL_GL_DEPTH_SIZE,
SDL_GL_STENCIL_SIZE,
SDL_GL_ACCUM_RED_SIZE,
SDL_GL_ACCUM_GREEN_SIZE,
SDL_GL_ACCUM_BLUE_SIZE,
SDL_GL_ACCUM_ALPHA_SIZE
} SDL_GLattr;
 
/* flags for SDL_SetPalette() */
#define SDL_LOGPAL 0x01
#define SDL_PHYSPAL 0x02
 
/* Function prototypes */
 
/* These functions are used internally, and should not be used unless you
* have a specific need to specify the video driver you want to use.
* You should normally use SDL_Init() or SDL_InitSubSystem().
*
* SDL_VideoInit() initializes the video subsystem -- sets up a connection
* to the window manager, etc, and determines the current video mode and
* pixel format, but does not initialize a window or graphics mode.
* Note that event handling is activated by this routine.
*
* If you use both sound and video in your application, you need to call
* SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
* you won't be able to set full-screen display modes.
*/
extern DECLSPEC int SDL_VideoInit(const char *driver_name, Uint32 flags);
extern DECLSPEC void SDL_VideoQuit(void);
 
/* This function fills the given character buffer with the name of the
* video driver, and returns a pointer to it if the video driver has
* been initialized. It returns NULL if no driver has been initialized.
*/
extern DECLSPEC char *SDL_VideoDriverName(char *namebuf, int maxlen);
 
/*
* This function returns a pointer to the current display surface.
* If SDL is doing format conversion on the display surface, this
* function returns the publicly visible surface, not the real video
* surface.
*/
extern DECLSPEC SDL_Surface * SDL_GetVideoSurface(void);
 
/*
* This function returns a read-only pointer to information about the
* video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt'
* member of the returned structure will contain the pixel format of the
* "best" video mode.
*/
extern DECLSPEC const SDL_VideoInfo * SDL_GetVideoInfo(void);
 
/*
* Check to see if a particular video mode is supported.
* It returns 0 if the requested mode is not supported under any bit depth,
* or returns the bits-per-pixel of the closest available mode with the
* given width and height. If this bits-per-pixel is different from the
* one used when setting the video mode, SDL_SetVideoMode() will succeed,
* but will emulate the requested bits-per-pixel with a shadow surface.
*
* The arguments to SDL_VideoModeOK() are the same ones you would pass to
* SDL_SetVideoMode()
*/
extern DECLSPEC int SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
 
/*
* Return a pointer to an array of available screen dimensions for the
* given format and video flags, sorted largest to smallest. Returns
* NULL if there are no dimensions available for a particular format,
* or (SDL_Rect **)-1 if any dimension is okay for the given format.
*
* If 'format' is NULL, the mode list will be for the format given
* by SDL_GetVideoInfo()->vfmt
*/
extern DECLSPEC SDL_Rect ** SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
 
/*
* Set up a video mode with the specified width, height and bits-per-pixel.
*
* If 'bpp' is 0, it is treated as the current display bits per pixel.
*
* If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
* requested bits-per-pixel, but will return whatever video pixel format is
* available. The default is to emulate the requested pixel format if it
* is not natively available.
*
* If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
* video memory, if possible, and you may have to call SDL_LockSurface()
* in order to access the raw framebuffer. Otherwise, the video surface
* will be created in system memory.
*
* If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
* updates asynchronously, but you must always lock before accessing pixels.
* SDL will wait for updates to complete before returning from the lock.
*
* If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
* that the colors set by SDL_SetColors() will be the colors you get.
* Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
* of the colors exactly the way they are requested, and you should look
* at the video surface structure to determine the actual palette.
* If SDL cannot guarantee that the colors you request can be set,
* i.e. if the colormap is shared, then the video surface may be created
* under emulation in system memory, overriding the SDL_HWSURFACE flag.
*
* If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
* a fullscreen video mode. The default is to create a windowed mode
* if the current graphics system has a window manager.
* If the SDL library is able to set a fullscreen video mode, this flag
* will be set in the surface that is returned.
*
* If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
* two surfaces in video memory and swap between them when you call
* SDL_Flip(). This is usually slower than the normal single-buffering
* scheme, but prevents "tearing" artifacts caused by modifying video
* memory while the monitor is refreshing. It should only be used by
* applications that redraw the entire screen on every update.
*
* If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
* window manager, if any, to resize the window at runtime. When this
* occurs, SDL will send a SDL_VIDEORESIZE event to you application,
* and you must respond to the event by re-calling SDL_SetVideoMode()
* with the requested size (or another size that suits the application).
*
* If SDL_NOFRAME is set in 'flags', the SDL library will create a window
* without any title bar or frame decoration. Fullscreen video modes have
* this flag set automatically.
*
* This function returns the video framebuffer surface, or NULL if it fails.
*
* If you rely on functionality provided by certain video flags, check the
* flags of the returned surface to make sure that functionality is available.
* SDL will fall back to reduced functionality if the exact flags you wanted
* are not available.
*/
extern DECLSPEC SDL_Surface *SDL_SetVideoMode
(int width, int height, int bpp, Uint32 flags);
 
/*
* Makes sure the given list of rectangles is updated on the given screen.
* If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
* screen.
* These functions should not be called while 'screen' is locked.
*/
extern DECLSPEC void SDL_UpdateRects
(SDL_Surface *screen, int numrects, SDL_Rect *rects);
extern DECLSPEC void SDL_UpdateRect
(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
 
/*
* On hardware that supports double-buffering, this function sets up a flip
* and returns. The hardware will wait for vertical retrace, and then swap
* video buffers before the next video surface blit or lock will return.
* On hardware that doesn not support double-buffering, this is equivalent
* to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
* The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
* setting the video mode for this function to perform hardware flipping.
* This function returns 0 if successful, or -1 if there was an error.
*/
extern DECLSPEC int SDL_Flip(SDL_Surface *screen);
 
/*
* Set the gamma correction for each of the color channels.
* The gamma values range (approximately) between 0.1 and 10.0
*
* If this function isn't supported directly by the hardware, it will
* be emulated using gamma ramps, if available. If successful, this
* function returns 0, otherwise it returns -1.
*/
extern DECLSPEC int SDL_SetGamma(float red, float green, float blue);
 
/*
* Set the gamma translation table for the red, green, and blue channels
* of the video hardware. Each table is an array of 256 16-bit quantities,
* representing a mapping between the input and output for that channel.
* The input is the index into the array, and the output is the 16-bit
* gamma value at that index, scaled to the output color precision.
*
* You may pass NULL for any of the channels to leave it unchanged.
* If the call succeeds, it will return 0. If the display driver or
* hardware does not support gamma translation, or otherwise fails,
* this function will return -1.
*/
extern DECLSPEC int SDL_SetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue);
 
/*
* Retrieve the current values of the gamma translation tables.
*
* You must pass in valid pointers to arrays of 256 16-bit quantities.
* Any of the pointers may be NULL to ignore that channel.
* If the call succeeds, it will return 0. If the display driver or
* hardware does not support gamma translation, or otherwise fails,
* this function will return -1.
*/
extern DECLSPEC int SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue);
 
/*
* Sets a portion of the colormap for the given 8-bit surface. If 'surface'
* is not a palettized surface, this function does nothing, returning 0.
* If all of the colors were set as passed to SDL_SetColors(), it will
* return 1. If not all the color entries were set exactly as given,
* it will return 0, and you should look at the surface palette to
* determine the actual color palette.
*
* When 'surface' is the surface associated with the current display, the
* display colormap will be updated with the requested colors. If
* SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
* will always return 1, and the palette is guaranteed to be set the way
* you desire, even if the window colormap has to be warped or run under
* emulation.
*/
extern DECLSPEC int SDL_SetColors(SDL_Surface *surface,
SDL_Color *colors, int firstcolor, int ncolors);
 
/*
* Sets a portion of the colormap for a given 8-bit surface.
* 'flags' is one or both of:
* SDL_LOGPAL -- set logical palette, which controls how blits are mapped
* to/from the surface,
* SDL_PHYSPAL -- set physical palette, which controls how pixels look on
* the screen
* Only screens have physical palettes. Separate change of physical/logical
* palettes is only possible if the screen has SDL_HWPALETTE set.
*
* The return value is 1 if all colours could be set as requested, and 0
* otherwise.
*
* SDL_SetColors() is equivalent to calling this function with
* flags = (SDL_LOGPAL|SDL_PHYSPAL).
*/
extern DECLSPEC int SDL_SetPalette(SDL_Surface *surface, int flags,
SDL_Color *colors, int firstcolor,
int ncolors);
 
/*
* Maps an RGB triple to an opaque pixel value for a given pixel format
*/
extern DECLSPEC Uint32 SDL_MapRGB
(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b);
 
/*
* Maps an RGBA quadruple to a pixel value for a given pixel format
*/
extern DECLSPEC Uint32 SDL_MapRGBA(SDL_PixelFormat *format,
Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 
/*
* Maps a pixel value into the RGB components for a given pixel format
*/
extern DECLSPEC void SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt,
Uint8 *r, Uint8 *g, Uint8 *b);
 
/*
* Maps a pixel value into the RGBA components for a given pixel format
*/
extern DECLSPEC void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt,
Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
 
/*
* Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
* If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
* If the depth is greater than 8 bits, the pixel format is set using the
* flags '[RGB]mask'.
* If the function runs out of memory, it will return NULL.
*
* The 'flags' tell what kind of surface to create.
* SDL_SWSURFACE means that the surface should be created in system memory.
* SDL_HWSURFACE means that the surface should be created in video memory,
* with the same format as the display surface. This is useful for surfaces
* that will not change much, to take advantage of hardware acceleration
* when being blitted to the display surface.
* SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
* this surface, but you must always lock it before accessing the pixels.
* SDL will wait for current blits to finish before returning from the lock.
* SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
* If the hardware supports acceleration of colorkey blits between
* two surfaces in video memory, SDL will try to place the surface in
* video memory. If this isn't possible or if there is no hardware
* acceleration available, the surface will be placed in system memory.
* SDL_SRCALPHA means that the surface will be used for alpha blits and
* if the hardware supports hardware acceleration of alpha blits between
* two surfaces in video memory, to place the surface in video memory
* if possible, otherwise it will be placed in system memory.
* If the surface is created in video memory, blits will be _much_ faster,
* but the surface format must be identical to the video surface format,
* and the only way to access the pixels member of the surface is to use
* the SDL_LockSurface() and SDL_UnlockSurface() calls.
* If the requested surface actually resides in video memory, SDL_HWSURFACE
* will be set in the flags member of the returned surface. If for some
* reason the surface could not be placed in video memory, it will not have
* the SDL_HWSURFACE flag set, and will be created in system memory instead.
*/
#define SDL_AllocSurface SDL_CreateRGBSurface
extern DECLSPEC SDL_Surface *SDL_CreateRGBSurface
(Uint32 flags, int width, int height, int depth,
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
extern DECLSPEC SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels,
int width, int height, int depth, int pitch,
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
extern DECLSPEC void SDL_FreeSurface(SDL_Surface *surface);
 
/*
* SDL_LockSurface() sets up a surface for directly accessing the pixels.
* Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
* to and read from 'surface->pixels', using the pixel format stored in
* 'surface->format'. Once you are done accessing the surface, you should
* use SDL_UnlockSurface() to release it.
*
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
* to 0, then you can read and write to the surface at any time, and the
* pixel format of the surface will not change. In particular, if the
* SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
* will not need to lock the display surface before accessing it.
*
* No operating system or library calls should be made between lock/unlock
* pairs, as critical system locks may be held during this time.
*
* SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
*/
extern DECLSPEC int SDL_LockSurface(SDL_Surface *surface);
extern DECLSPEC void SDL_UnlockSurface(SDL_Surface *surface);
 
/*
* Load a surface from a seekable SDL data source (memory or file.)
* If 'freesrc' is non-zero, the source will be closed after being read.
* Returns the new surface, or NULL if there was an error.
* The new surface should be freed with SDL_FreeSurface().
*/
extern DECLSPEC SDL_Surface * SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
 
/* Convenience macro -- load a surface from a file */
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
 
/*
* Save a surface to a seekable SDL data source (memory or file.)
* If 'freedst' is non-zero, the source will be closed after being written.
* Returns 0 if successful or -1 if there was an error.
*/
extern DECLSPEC int SDL_SaveBMP_RW
(SDL_Surface *surface, SDL_RWops *dst, int freedst);
 
/* Convenience macro -- save a surface to a file */
#define SDL_SaveBMP(surface, file) \
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
 
/*
* Sets the color key (transparent pixel) in a blittable surface.
* If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
* 'key' will be the transparent pixel in the source image of a blit.
* SDL_RLEACCEL requests RLE acceleration for the surface if present,
* and removes RLE acceleration if absent.
* If 'flag' is 0, this function clears any current color key.
* This function returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDL_SetColorKey
(SDL_Surface *surface, Uint32 flag, Uint32 key);
 
/*
* This function sets the alpha value for the entire surface, as opposed to
* using the alpha component of each pixel. This value measures the range
* of transparency of the surface, 0 being completely transparent to 255
* being completely opaque. An 'alpha' value of 255 causes blits to be
* opaque, the source pixels copied to the destination (the default). Note
* that per-surface alpha can be combined with colorkey transparency.
*
* If 'flag' is 0, alpha blending is disabled for the surface.
* If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
* OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
* surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
*/
extern DECLSPEC int SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);
 
/*
* Sets the clipping rectangle for the destination surface in a blit.
*
* If the clip rectangle is NULL, clipping will be disabled.
* If the clip rectangle doesn't intersect the surface, the function will
* return SDL_FALSE and blits will be completely clipped. Otherwise the
* function returns SDL_TRUE and blits to the surface will be clipped to
* the intersection of the surface area and the clipping rectangle.
*
* Note that blits are automatically clipped to the edges of the source
* and destination surfaces.
*/
extern DECLSPEC SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect);
 
/*
* Gets the clipping rectangle for the destination surface in a blit.
* 'rect' must be a pointer to a valid rectangle which will be filled
* with the correct values.
*/
extern DECLSPEC void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
 
/*
* Creates a new surface of the specified format, and then copies and maps
* the given surface to it so the blit of the converted surface will be as
* fast as possible. If this function fails, it returns NULL.
*
* The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
* semantics. You can also pass SDL_RLEACCEL in the flags parameter and
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting
* surface.
*
* This function is used internally by SDL_DisplayFormat().
*/
extern DECLSPEC SDL_Surface *SDL_ConvertSurface
(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
 
/*
* This performs a fast blit from the source surface to the destination
* surface. It assumes that the source and destination rectangles are
* the same size. If either 'srcrect' or 'dstrect' are NULL, the entire
* surface (src or dst) is copied. The final blit rectangles are saved
* in 'srcrect' and 'dstrect' after all clipping is performed.
* If the blit is successful, it returns 0, otherwise it returns -1.
*
* The blit function should not be called on a locked surface.
*
* The blit semantics for surfaces with and without alpha and colorkey
* are defined as follows:
*
* RGBA->RGB:
* SDL_SRCALPHA set:
* alpha-blend (using alpha-channel).
* SDL_SRCCOLORKEY ignored.
* SDL_SRCALPHA not set:
* copy RGB.
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* RGB values of the source colour key, ignoring alpha in the
* comparison.
*
* RGB->RGBA:
* SDL_SRCALPHA set:
* alpha-blend (using the source per-surface alpha value);
* set destination alpha to opaque.
* SDL_SRCALPHA not set:
* copy RGB, set destination alpha to opaque.
* both:
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* source colour key.
*
* RGBA->RGBA:
* SDL_SRCALPHA set:
* alpha-blend (using the source alpha channel) the RGB values;
* leave destination alpha untouched. [Note: is this correct?]
* SDL_SRCCOLORKEY ignored.
* SDL_SRCALPHA not set:
* copy all of RGBA to the destination.
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* RGB values of the source colour key, ignoring alpha in the
* comparison.
*
* RGB->RGB:
* SDL_SRCALPHA set:
* alpha-blend (using the source per-surface alpha value).
* SDL_SRCALPHA not set:
* copy RGB.
* both:
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* source colour key.
*
* If either of the surfaces were in video memory, and the blit returns -2,
* the video memory was lost, so it should be reloaded with artwork and
* re-blitted:
while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
while ( SDL_LockSurface(image) < 0 )
Sleep(10);
-- Write image pixels to image->pixels --
SDL_UnlockSurface(image);
}
* This happens under DirectX 5.0 when the system switches away from your
* fullscreen application. The lock will also fail until you have access
* to the video memory again.
*/
/* You should call SDL_BlitSurface() unless you know exactly how SDL
blitting works internally and how to use the other blit functions.
*/
#define SDL_BlitSurface SDL_UpperBlit
 
/* This is the public blit function, SDL_BlitSurface(), and it performs
rectangle validation and clipping before passing it to SDL_LowerBlit()
*/
extern DECLSPEC int SDL_UpperBlit
(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect);
/* This is a semi-private blit function and it performs low-level surface
blitting only.
*/
extern DECLSPEC int SDL_LowerBlit
(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect);
 
/*
* This function performs a fast fill of the given rectangle with 'color'
* The given rectangle is clipped to the destination surface clip area
* and the final fill rectangle is saved in the passed in pointer.
* If 'dstrect' is NULL, the whole surface will be filled with 'color'
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
* This function returns 0 on success, or -1 on error.
*/
extern DECLSPEC int SDL_FillRect
(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
 
/*
* This function takes a surface and copies it to a new surface of the
* pixel format and colors of the video framebuffer, suitable for fast
* blitting onto the display surface. It calls SDL_ConvertSurface()
*
* If you want to take advantage of hardware colorkey or alpha blit
* acceleration, you should set the colorkey and alpha value before
* calling this function.
*
* If the conversion fails or runs out of memory, it returns NULL
*/
extern DECLSPEC SDL_Surface * SDL_DisplayFormat(SDL_Surface *surface);
 
/*
* This function takes a surface and copies it to a new surface of the
* pixel format and colors of the video framebuffer (if possible),
* suitable for fast alpha blitting onto the display surface.
* The new surface will always have an alpha channel.
*
* If you want to take advantage of hardware colorkey or alpha blit
* acceleration, you should set the colorkey and alpha value before
* calling this function.
*
* If the conversion fails or runs out of memory, it returns NULL
*/
extern DECLSPEC SDL_Surface * SDL_DisplayFormatAlpha(SDL_Surface *surface);
 
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* YUV video surface overlay functions */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
/* This function creates a video output overlay
Calling the returned surface an overlay is something of a misnomer because
the contents of the display surface underneath the area where the overlay
is shown is undefined - it may be overwritten with the converted YUV data.
*/
extern DECLSPEC SDL_Overlay *SDL_CreateYUVOverlay(int width, int height,
Uint32 format, SDL_Surface *display);
 
/* Lock an overlay for direct access, and unlock it when you are done */
extern DECLSPEC int SDL_LockYUVOverlay(SDL_Overlay *overlay);
extern DECLSPEC void SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
 
/* Blit a video overlay to the display surface.
The contents of the video surface underneath the blit destination are
not defined.
The width and height of the destination rectangle may be different from
that of the overlay, but currently only 2x scaling is supported.
*/
extern DECLSPEC int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
 
/* Free a video overlay */
extern DECLSPEC void SDL_FreeYUVOverlay(SDL_Overlay *overlay);
 
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* OpenGL support functions. */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
/*
* Dynamically load a GL driver, if SDL is built with dynamic GL.
*
* SDL links normally with the OpenGL library on your system by default,
* but you can compile it to dynamically load the GL driver at runtime.
* If you do this, you need to retrieve all of the GL functions used in
* your program from the dynamic library using SDL_GL_GetProcAddress().
*
* This is disabled in default builds of SDL.
*/
extern DECLSPEC int SDL_GL_LoadLibrary(const char *path);
 
/*
* Get the address of a GL function (for extension functions)
*/
extern DECLSPEC void *SDL_GL_GetProcAddress(const char* proc);
 
/*
* Set an attribute of the OpenGL subsystem before intialization.
*/
extern DECLSPEC int SDL_GL_SetAttribute(SDL_GLattr attr, int value);
 
/*
* Get an attribute of the OpenGL subsystem from the windowing
* interface, such as glX. This is of course different from getting
* the values from SDL's internal OpenGL subsystem, which only
* stores the values you request before initialization.
*
* Developers should track the values they pass into SDL_GL_SetAttribute
* themselves if they want to retrieve these values.
*/
extern DECLSPEC int SDL_GL_GetAttribute(SDL_GLattr attr, int* value);
 
/*
* Swap the OpenGL buffers, if double-buffering is supported.
*/
extern DECLSPEC void SDL_GL_SwapBuffers(void);
 
/*
* Internal functions that should not be called unless you have read
* and understood the source code for these functions.
*/
extern DECLSPEC void SDL_GL_UpdateRects(int numrects, SDL_Rect* rects);
extern DECLSPEC void SDL_GL_Lock(void);
extern DECLSPEC void SDL_GL_Unlock(void);
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* These functions allow interaction with the window manager, if any. */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
/*
* Sets/Gets the title and icon text of the display window
*/
extern DECLSPEC void SDL_WM_SetCaption(const char *title, const char *icon);
extern DECLSPEC void SDL_WM_GetCaption(char **title, char **icon);
 
/*
* Sets the icon for the display window.
* This function must be called before the first call to SDL_SetVideoMode().
* It takes an icon surface, and a mask in MSB format.
* If 'mask' is NULL, the entire icon surface will be used as the icon.
*/
extern DECLSPEC void SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);
 
/*
* This function iconifies the window, and returns 1 if it succeeded.
* If the function succeeds, it generates an SDL_APPACTIVE loss event.
* This function is a noop and returns 0 in non-windowed environments.
*/
extern DECLSPEC int SDL_WM_IconifyWindow(void);
 
/*
* Toggle fullscreen mode without changing the contents of the screen.
* If the display surface does not require locking before accessing
* the pixel information, then the memory pointers will not change.
*
* If this function was able to toggle fullscreen mode (change from
* running in a window to fullscreen, or vice-versa), it will return 1.
* If it is not implemented, or fails, it returns 0.
*
* The next call to SDL_SetVideoMode() will set the mode fullscreen
* attribute based on the flags parameter - if SDL_FULLSCREEN is not
* set, then the display will be windowed by default where supported.
*
* This is currently only implemented in the X11 video driver.
*/
extern DECLSPEC int SDL_WM_ToggleFullScreen(SDL_Surface *surface);
 
/*
* This function allows you to set and query the input grab state of
* the application. It returns the new input grab state.
*/
typedef enum {
SDL_GRAB_QUERY = -1,
SDL_GRAB_OFF = 0,
SDL_GRAB_ON = 1,
SDL_GRAB_FULLSCREEN /* Used internally */
} SDL_GrabMode;
/*
* Grabbing means that the mouse is confined to the application window,
* and nearly all keyboard input is passed directly to the application,
* and not interpreted by a window manager, if any.
*/
extern DECLSPEC SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode);
 
/* Not in public API at the moment - do not use! */
extern DECLSPEC int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
 
#endif /* _SDL_video_h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/begin_code.h
0,0 → 1,91
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
/* This file sets things up for C dynamic library function definitions,
static inlined functions, and structures aligned at 4-byte alignment.
If you don't like ugly C preprocessor code, don't look at this file. :)
*/
 
/* This shouldn't be nested -- included it around code only. */
#ifdef _begin_code_h
#error Nested inclusion of begin_code.h
#endif
#define _begin_code_h
 
/* Some compilers use a special export keyword */
#ifndef DECLSPEC
# ifdef __BEOS__
# if defined(__GNUC__)
# define DECLSPEC __declspec(dllexport)
# else
# define DECLSPEC __declspec(export)
# endif
# else
# ifdef WIN32UNDEFINED
# define DECLSPEC __declspec(dllexport)
# else
# define DECLSPEC
# endif
# endif
#endif
 
/* Force structure packing at 4 byte alignment.
This is necessary if the header is included in code which has structure
packing set to an alternate value, say for loading structures from disk.
The packing is reset to the previous value in close_code.h
*/
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
#ifdef _MSC_VER
#pragma warning(disable: 4103)
#endif
#ifdef __BORLANDC__
#pragma nopackwarning
#endif
#pragma pack(push,4)
#endif /* Compiler needs structure packing set */
 
/* Set up compiler-specific options for inlining functions */
#ifndef SDL_INLINE_OKAY
#ifdef __GNUC__
#define SDL_INLINE_OKAY
#else
/* Add any special compiler-specific cases here */
#if defined(_MSC_VER)
#define __inline__ __inline
#define SDL_INLINE_OKAY
#else
#if !defined(__MRC__) && !defined(_SGI_SOURCE)
#define __inline__ inline
#define SDL_INLINE_OKAY
#endif /* Not a funky compiler */
#endif /* Visual C++ */
#endif /* GNU C */
#endif /* SDL_INLINE_OKAY */
 
/* If inlining isn't supported, remove "__inline__", turning static
inlined functions into static functions (resulting in code bloat
in all files which include the offending header files)
*/
#ifndef SDL_INLINE_OKAY
#define __inline__
#endif
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/begin_code.h.BAK
0,0 → 1,91
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
/* This file sets things up for C dynamic library function definitions,
static inlined functions, and structures aligned at 4-byte alignment.
If you don't like ugly C preprocessor code, don't look at this file. :)
*/
 
/* This shouldn't be nested -- included it around code only. */
#ifdef _begin_code_h
#error Nested inclusion of begin_code.h
#endif
#define _begin_code_h
 
/* Some compilers use a special export keyword */
#ifndef DECLSPEC
# ifdef __BEOS__
# if defined(__GNUC__)
# define DECLSPEC __declspec(dllexport)
# else
# define DECLSPEC __declspec(export)
# endif
# else
# ifdef WIN32
# define DECLSPEC __declspec(dllexport)
# else
# define DECLSPEC
# endif
# endif
#endif
 
/* Force structure packing at 4 byte alignment.
This is necessary if the header is included in code which has structure
packing set to an alternate value, say for loading structures from disk.
The packing is reset to the previous value in close_code.h
*/
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
#ifdef _MSC_VER
#pragma warning(disable: 4103)
#endif
#ifdef __BORLANDC__
#pragma nopackwarning
#endif
#pragma pack(push,4)
#endif /* Compiler needs structure packing set */
 
/* Set up compiler-specific options for inlining functions */
#ifndef SDL_INLINE_OKAY
#ifdef __GNUC__
#define SDL_INLINE_OKAY
#else
/* Add any special compiler-specific cases here */
#if defined(_MSC_VER)
#define __inline__ __inline
#define SDL_INLINE_OKAY
#else
#if !defined(__MRC__) && !defined(_SGI_SOURCE)
#define __inline__ inline
#define SDL_INLINE_OKAY
#endif /* Not a funky compiler */
#endif /* Visual C++ */
#endif /* GNU C */
#endif /* SDL_INLINE_OKAY */
 
/* If inlining isn't supported, remove "__inline__", turning static
inlined functions into static functions (resulting in code bloat
in all files which include the offending header files)
*/
#ifndef SDL_INLINE_OKAY
#define __inline__
#endif
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/SDL/close_code.h
0,0 → 1,36
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
 
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
Sam Lantinga
slouken@devolution.com
*/
 
/* This file reverses the effects of begin_code.h and should be included
after you finish any function and structure declarations in your headers
*/
 
#undef _begin_code_h
 
/* Reset structure packing at previous byte alignment */
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
#ifdef __BORLANDC__
#pragma nopackwarning
#endif
#pragma pack(pop)
#endif /* Compiler needs structure packing set */
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/algorithm
0,0 → 1,17
#ifndef _ALGORITHM_INCLUDED
#define _ALGORITHM_INCLUDED
#include <vector>
#include <stdlib.h>
namespace std
{
static bool (*__cmpfn)(const void* elem1, const void* elem2);
static int __compare(const void* elem1, const void* elem2)
{return __cmpfn(elem1,elem2)?-1:1;}
template<class T, class Pred>
void sort(T* first, T* last, Pred pr)
{
__cmpfn=(bool(*)(const void*,const void*))pr;
qsort(first,last-first,sizeof(*first),&__compare);
}
}
#endif
/contrib/media/updf/include/all.h
0,0 → 1,40
 
/// ===========================================================
 
#include "kolibri.h"
#include "stdlib.h"
#include "string.h"
 
#include "globals.h"
#include "prototypes.h"
 
#include "console.c"
 
#include "cmd_about.c"
#include "cmd_help.c"
#include "cmd_ver.c"
#include "cmd_pwd.c"
#include "cmd_ls.c"
#include "cmd_ps.c"
#include "cmd_kill.c"
#include "cmd_echo.c"
#include "cmd_date.c"
#include "cmd_exit.c"
#include "cmd_cd.c"
#include "cmd_free.c"
#include "cmd_reboot.c"
#include "cmd_mkdir.c"
#include "cmd_rmdir.c"
#include "cmd_rm.c"
#include "cmd_touch.c"
#include "cmd_alias.c"
#include "cmd_more.c"
#include "cmd_clear.c"
 
#include "module_command.c"
#include "module_program.c"
#include "module_script.c"
#include "module_executable.c"
#include "module_alias.c"
 
/// ===========================================================
/contrib/media/updf/include/ansidecl.h
0,0 → 1,251
/* ANSI and traditional C compatability macros
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
Free Software Foundation, Inc.
This file is part of the GNU C Library.
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
 
This program 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 General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
 
/* ANSI and traditional C compatibility macros
 
ANSI C is assumed if __STDC__ is #defined.
 
Macro ANSI C definition Traditional C definition
----- ---- - ---------- ----------- - ----------
PTR `void *' `char *'
LONG_DOUBLE `long double' `double'
VOLATILE `volatile' `'
SIGNED `signed' `'
PTRCONST `void *const' `char *'
ANSI_PROTOTYPES 1 not defined
 
CONST is also defined, but is obsolete. Just use const.
 
obsolete -- DEFUN (name, arglist, args)
 
Defines function NAME.
 
ARGLIST lists the arguments, separated by commas and enclosed in
parentheses. ARGLIST becomes the argument list in traditional C.
 
ARGS list the arguments with their types. It becomes a prototype in
ANSI C, and the type declarations in traditional C. Arguments should
be separated with `AND'. For functions with a variable number of
arguments, the last thing listed should be `DOTS'.
 
obsolete -- DEFUN_VOID (name)
 
Defines a function NAME, which takes no arguments.
 
obsolete -- EXFUN (name, (prototype)) -- obsolete.
 
Replaced by PARAMS. Do not use; will disappear someday soon.
Was used in external function declarations.
In ANSI C it is `NAME PROTOTYPE' (so PROTOTYPE should be enclosed in
parentheses). In traditional C it is `NAME()'.
For a function that takes no arguments, PROTOTYPE should be `(void)'.
 
obsolete -- PROTO (type, name, (prototype) -- obsolete.
 
This one has also been replaced by PARAMS. Do not use.
 
PARAMS ((args))
 
We could use the EXFUN macro to handle prototype declarations, but
the name is misleading and the result is ugly. So we just define a
simple macro to handle the parameter lists, as in:
 
static int foo PARAMS ((int, char));
 
This produces: `static int foo();' or `static int foo (int, char);'
 
EXFUN would have done it like this:
 
static int EXFUN (foo, (int, char));
 
but the function is not external...and it's hard to visually parse
the function name out of the mess. EXFUN should be considered
obsolete; new code should be written to use PARAMS.
 
DOTS is also obsolete.
 
Examples:
 
extern int printf PARAMS ((const char *format, ...));
*/
 
#ifndef _ANSIDECL_H
 
#define _ANSIDECL_H 1
 
 
/* Every source file includes this file,
so they will all get the switch for lint. */
/* LINTLIBRARY */
 
 
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
/* All known AIX compilers implement these things (but don't always
define __STDC__). The RISC/OS MIPS compiler defines these things
in SVR4 mode, but does not define __STDC__. */
 
#define PTR void *
#define PTRCONST void *CONST
#define LONG_DOUBLE long double
 
#ifndef IN_GCC
#define AND ,
#define NOARGS void
#define VOLATILE volatile
#define SIGNED signed
#endif /* ! IN_GCC */
 
#define PARAMS(paramlist) paramlist
#define ANSI_PROTOTYPES 1
 
#define VPARAMS(ARGS) ARGS
#define VA_START(va_list,var) va_start(va_list,var)
 
/* These are obsolete. Do not use. */
#ifndef IN_GCC
#define CONST const
#define DOTS , ...
#define PROTO(type, name, arglist) type name arglist
#define EXFUN(name, proto) name proto
#define DEFUN(name, arglist, args) name(args)
#define DEFUN_VOID(name) name(void)
#endif /* ! IN_GCC */
 
#else /* Not ANSI C. */
 
#define PTR char *
#define PTRCONST PTR
#define LONG_DOUBLE double
 
#ifndef IN_GCC
#define AND ;
#define NOARGS
#define VOLATILE
#define SIGNED
#endif /* !IN_GCC */
 
#ifndef const /* some systems define it in header files for non-ansi mode */
#define const
#endif
 
#define PARAMS(paramlist) ()
 
#define VPARAMS(ARGS) (va_alist) va_dcl
#define VA_START(va_list,var) va_start(va_list)
 
/* These are obsolete. Do not use. */
#ifndef IN_GCC
#define CONST
#define DOTS
#define PROTO(type, name, arglist) type name ()
#define EXFUN(name, proto) name()
#define DEFUN(name, arglist, args) name arglist args;
#define DEFUN_VOID(name) name()
#endif /* ! IN_GCC */
 
#endif /* ANSI C. */
 
/* Using MACRO(x,y) in cpp #if conditionals does not work with some
older preprocessors. Thus we can't define something like this:
 
#define HAVE_GCC_VERSION(MAJOR, MINOR) \
(__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
 
and then test "#if HAVE_GCC_VERSION(2,7)".
 
So instead we use the macro below and test it against specific values. */
 
/* This macro simplifies testing whether we are using gcc, and if it
is of a particular minimum version. (Both major & minor numbers are
significant.) This macro will evaluate to 0 if we are not using
gcc at all. */
#ifndef GCC_VERSION
#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#endif /* GCC_VERSION */
 
/* Define macros for some gcc attributes. This permits us to use the
macros freely, and know that they will come into play for the
version of gcc in which they are supported. */
 
#if (GCC_VERSION < 2007)
# define __attribute__(x)
#endif
 
/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
#ifndef ATTRIBUTE_MALLOC
# if (GCC_VERSION >= 2096)
# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
# else
# define ATTRIBUTE_MALLOC
# endif /* GNUC >= 2.96 */
#endif /* ATTRIBUTE_MALLOC */
 
/* Attributes on labels were valid as of gcc 2.93. */
#ifndef ATTRIBUTE_UNUSED_LABEL
# if (GCC_VERSION >= 2093)
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
# else
# define ATTRIBUTE_UNUSED_LABEL
# endif /* GNUC >= 2.93 */
#endif /* ATTRIBUTE_UNUSED_LABEL */
 
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif /* ATTRIBUTE_UNUSED */
 
#ifndef ATTRIBUTE_NORETURN
#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
#endif /* ATTRIBUTE_NORETURN */
 
#ifndef ATTRIBUTE_PRINTF
#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
#endif /* ATTRIBUTE_PRINTF */
 
/* We use __extension__ in some places to suppress -pedantic warnings
about GCC extensions. This feature didn't work properly before
gcc 2.8. */
#if GCC_VERSION < 2008
#define __extension__
#endif
 
/* Bootstrap support: Autoconf will possibly define the `inline' or
`const' keywords as macros, however this is only valid for the
stage1 compiler. If we detect a modern version of gcc,
unconditionally reset the values. This makes sure the right thing
happens in stage2 and later. We need to do this very early;
i.e. before any header files that might use these keywords.
Otherwise conflicts might occur. */
 
#if (GCC_VERSION >= 2007)
# ifdef __STDC__
# undef const
# endif
# undef inline
# define inline __inline__ /* __inline__ prevents -pedantic warnings */
# ifndef HAVE_LONG_DOUBLE
# define HAVE_LONG_DOUBLE 1
# endif
#endif /* GCC >= 2.7 */
 
#endif /* ansidecl.h */
/contrib/media/updf/include/anumber.h
0,0 → 1,102
 
#ifndef __anumber_h__
#define __anumber_h__
 
#include "grower.h"
#include "yacasbase.h"
#include "lispassert.h"
#include "lispstring.h"
 
 
 
/* Quantities derived from the platform-dependent types for doing
* arithmetic.
*/
 
#define WordBits (8*sizeof(PlatWord))
#define WordBase (((PlatDoubleWord)1)<<WordBits)
#define WordMask (WordBase-1)
 
// The default is 8, but it is suspected mose numbers will be short integers that fit into
// one or two words. For these numbers memory allocation will be a lot more friendly.
class ANumberOps : public ArrOpsPOD<PlatWord>
{
public:
ANumberOps() {}
inline int granularity() const { return 2; }
};
 
 
/* Class ANumber represents an arbitrary precision number. it is
* basically an array of PlatWord objects, with the first element
* being the least significant. iExp <= 0 for integers.
*/
class ANumber : public CArrayGrower<PlatWord,ANumberOps>
{
public:
typedef CArrayGrower<PlatWord,ANumberOps> ASuper;
public:
ANumber(const LispChar * aString,LispInt aPrecision,LispInt aBase=10);
ANumber(LispInt aPrecision);
ANumber(PlatWord *aArray, LispInt aSize, LispInt aPrecision);
//TODO the properties of this object are set in the member initialization list, but then immediately overwritten by the CopyFrom. We can make this slightly cleaner by only initializing once.
inline ANumber(ANumber& aOther) : ASuper(),iExp(0),iNegative(LispFalse),iPrecision(0),iTensExp(0)
{
CopyFrom(aOther);
}
~ANumber();
void CopyFrom(const ANumber& aOther);
LispBoolean ExactlyEqual(const ANumber& aOther);
void SetTo(const LispChar * aString,LispInt aBase=10);
inline void SetPrecision(LispInt aPrecision) {iPrecision = aPrecision;}
void ChangePrecision(LispInt aPrecision);
void RoundBits(void);
void DropTrailZeroes();
 
public:
LispInt iExp;
LispInt iNegative;
LispInt iPrecision;
LispInt iTensExp;
};
 
inline LispBoolean IsPositive(ANumber& a) { return !a.iNegative; }
inline LispBoolean IsNegative(ANumber& a) { return a.iNegative; }
inline LispBoolean IsEven(ANumber& a) { return ((a[0]&1) == 0); }
inline LispBoolean IsOdd(ANumber& a) { return ((a[0]&1) == 1); }
inline LispInt Precision(ANumber& a) { return !a.iPrecision; }
 
LispBoolean BaseLessThan(ANumber& a1, ANumber& a2);
void BaseDivide(ANumber& aQuotient, ANumber& aRemainder, ANumber& a1, ANumber& a2);
 
void IntegerDivide(ANumber& aQuotient, ANumber& aRemainder, ANumber& a1, ANumber& a2);
 
LispBoolean Significant(ANumber& a);
 
LispInt WordDigits(LispInt aPrecision, LispInt aBase);
 
// Operations on ANumber.
void Negate(ANumber& aNumber);
void ANumberToString(LispString& aResult, ANumber& aNumber, LispInt aBase, LispBoolean aForceFloat=0);
void Add(ANumber& aResult, ANumber& a1, ANumber& a2);
void Subtract(ANumber& aResult, ANumber& a1, ANumber& a2);
void Multiply(ANumber& aResult, ANumber& a1, ANumber& a2);
void Divide(ANumber& aQuotient, ANumber& aRemainder, ANumber& a1, ANumber& a2);
LispBoolean GreaterThan(ANumber& a1, ANumber& a2);
LispBoolean LessThan(ANumber& a1, ANumber& a2);
void BaseShiftRight(ANumber& a, LispInt aNrBits);
void BaseShiftLeft(ANumber& a, LispInt aNrBits);
void BaseGcd(ANumber& aResult, ANumber& a1, ANumber& a2);
void Sqrt(ANumber& aResult, ANumber& N);
 
void PrintNumber(char* prefix,ANumber& aNumber);
 
#define CORRECT_DIVISION
void NormalizeFloat(ANumber& a2, LispInt digitsNeeded);
 
 
#include "anumber.inl"
 
 
#endif
 
/contrib/media/updf/include/ar.h
0,0 → 1,20
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef _AR_H_
#define _AR_H_
 
#define ARMAG "!<arch>\n"
#define SARMAG 8
 
#define ARFMAG "`\n"
 
struct ar_hdr {
char ar_name[16];
char ar_date[12];
char ar_uid[6];
char ar_gid[6];
char ar_mode[8];
char ar_size[10];
char ar_fmag[2];
};
 
#endif
/contrib/media/updf/include/archiver.h
0,0 → 1,16
 
#ifndef __archiver_h__
#define __archiver_h__
 
#include "yacasbase.h"
#include "compressedfiles.h"
 
class CCompressedArchive : public YacasBase
{
public:
CCompressedArchive(unsigned char * aBuffer, LispInt aFullSize, LispInt aCompressed);
CompressedFiles iFiles;
};
 
#endif // __archiver_h__
 
/contrib/media/updf/include/arggetter.h
0,0 → 1,47
 
#ifndef __arggetter_h__
#define __arggetter_h__
 
#include "yacasbase.h"
 
 
 
/// Get an argument that should be a (long) integer
LispString * GetIntegerArgument(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
/// Get a string (atom)
LispString * GetStringArgument(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
/// Get the atomic string of the argument
LispString * GetAtomArgument(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
/// Get an argument that should be a short integer
LispInt GetShortIntegerArgument(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
/// Get a list argument
void GetListArgument(LispPtr& aResult, LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
/// Get a void* pointer to a struct encapsulated in a generic class
void* GetVoidStruct(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr, LispChar * aTypeString);
 
 
#define ListArgument(_list,_argnr) LispPtr _list; GetListArgument(_list, aEnvironment,aStackTop,_argnr)
#define IntegerArgument(_i,_argnr) LispString * _i = GetIntegerArgument(aEnvironment,aStackTop,_argnr)
#define ShortIntegerArgument(_i,_argnr) LispInt _i = GetShortIntegerArgument(aEnvironment,aStackTop,_argnr)
#define InpStringArgument(_i,_argnr) LispChar * _i = GetStringArgument(aEnvironment,aStackTop,_argnr)->c_str()
 
#define DoubleFloatArgument(_i,_argnr) double _i = GetDoubleFloatArgument(aEnvironment,aStackTop,_argnr)
#define VoidStructArgument(_typ,_i,_argnr,_name) _typ _i = (_typ)GetVoidStruct(aEnvironment,aStackTop,_argnr,_name)
 
 
void ReturnShortInteger(LispEnvironment& aEnvironment,
LispPtr& aResult, LispInt r);
void SetShortIntegerConstant(LispEnvironment& aEnvironment,
LispChar * aName,
LispInt aValue);
double GetDoubleFloatArgument(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
void ReturnDoubleFloat(LispEnvironment& aEnvironment,LispPtr& aResult, double r);
void ReturnVoidStruct(LispEnvironment& aEnvironment,
LispPtr& aResult,
LispChar * aName,
void* aData,
void (*aFree)(void*));
 
 
#endif
 
/contrib/media/updf/include/arpa/ftp.h
0,0 → 1,109
/*
* Copyright (c) 1983, 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ftp.h 8.1 (Berkeley) 6/2/93
*/
 
#ifndef _ARPA_FTP_H
#define _ARPA_FTP_H
 
/* Definitions for FTP; see RFC-765. */
 
/*
* Reply codes.
*/
#define PRELIM 1 /* positive preliminary */
#define COMPLETE 2 /* positive completion */
#define CONTINUE 3 /* positive intermediate */
#define TRANSIENT 4 /* transient negative completion */
#define ERROR 5 /* permanent negative completion */
 
/*
* Type codes
*/
#define TYPE_A 1 /* ASCII */
#define TYPE_E 2 /* EBCDIC */
#define TYPE_I 3 /* image */
#define TYPE_L 4 /* local byte size */
 
#ifdef FTP_NAMES
char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
#endif
 
/*
* Form codes
*/
#define FORM_N 1 /* non-print */
#define FORM_T 2 /* telnet format effectors */
#define FORM_C 3 /* carriage control (ASA) */
#ifdef FTP_NAMES
char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
#endif
 
/*
* Structure codes
*/
#define STRU_F 1 /* file (no record structure) */
#define STRU_R 2 /* record structure */
#define STRU_P 3 /* page structure */
#ifdef FTP_NAMES
char *strunames[] = {"0", "File", "Record", "Page" };
#endif
 
/*
* Mode types
*/
#define MODE_S 1 /* stream */
#define MODE_B 2 /* block */
#define MODE_C 3 /* compressed */
#ifdef FTP_NAMES
char *modenames[] = {"0", "Stream", "Block", "Compressed" };
#endif
 
/*
* Record Tokens
*/
#define REC_ESC '\377' /* Record-mode Escape */
#define REC_EOR '\001' /* Record-mode End-of-Record */
#define REC_EOF '\002' /* Record-mode End-of-File */
 
/*
* Block Header
*/
#define BLK_EOR 0x80 /* Block is End-of-Record */
#define BLK_EOF 0x40 /* Block is End-of-File */
#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
#define BLK_RESTART 0x10 /* Block is Restart Marker */
 
#define BLK_BYTECOUNT 2 /* Bytes in this block */
 
#endif /* !_ARPA_FTP_H */
/contrib/media/updf/include/arpa/inet.h
0,0 → 1,24
#ifndef _ARPA_INET_H
#define _ARPA_INET_H
 
#include <sys/cdefs.h>
#include <sys/types.h>
#include <netinet/in.h>
 
__BEGIN_DECLS
 
int inet_aton(const char* cp, struct in_addr* inp) ;
unsigned long int inet_addr(const char* cp) ;
unsigned long int inet_network(const char* cp) ;
char* inet_ntoa(struct in_addr in) ;
char* inet_ntoa_r(struct in_addr in,char* buf) ;
struct in_addr inet_makeaddr(int net, int host) ;
unsigned long int inet_lnaof(struct in_addr in) ;
unsigned long int inet_netof(struct in_addr in) ;
 
int inet_pton (int AF, const char* CP, void* BUF) ;
const char* inet_ntop (int AF, const void* CP, char* BUF, size_t LEN) ;
 
__END_DECLS
 
#endif
/contrib/media/updf/include/arpa/nameser.h
0,0 → 1,258
#ifndef _ARPA_NAMESER_H
#define _ARPA_NAMESER_H
 
#include <sys/cdefs.h>
#include <endian.h>
 
__BEGIN_DECLS
 
#define NS_PACKETSZ 512 /* maximum packet size */
#define NS_MAXDNAME 1025 /* maximum domain name */
#define NS_MAXCDNAME 255 /* maximum compressed domain name */
#define NS_MAXLABEL 63 /* maximum length of domain label */
#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
#define NS_INT32SZ 4 /* #/bytes of data in a u_int32_t */
#define NS_INT16SZ 2 /* #/bytes of data in a u_int16_t */
#define NS_INT8SZ 1 /* #/bytes of data in a u_int8_t */
#define NS_INADDRSZ 4 /* IPv4 T_A */
#define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */
#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
 
/*
* Currently defined type values for resources and queries.
*/
typedef enum __ns_type {
ns_t_invalid = 0, /* Cookie. */
ns_t_a = 1, /* Host address. */
ns_t_ns = 2, /* Authoritative server. */
ns_t_md = 3, /* Mail destination. */
ns_t_mf = 4, /* Mail forwarder. */
ns_t_cname = 5, /* Canonical name. */
ns_t_soa = 6, /* Start of authority zone. */
ns_t_mb = 7, /* Mailbox domain name. */
ns_t_mg = 8, /* Mail group member. */
ns_t_mr = 9, /* Mail rename name. */
ns_t_null = 10, /* Null resource record. */
ns_t_wks = 11, /* Well known service. */
ns_t_ptr = 12, /* Domain name pointer. */
ns_t_hinfo = 13, /* Host information. */
ns_t_minfo = 14, /* Mailbox information. */
ns_t_mx = 15, /* Mail routing information. */
ns_t_txt = 16, /* Text strings. */
ns_t_rp = 17, /* Responsible person. */
ns_t_afsdb = 18, /* AFS cell database. */
ns_t_x25 = 19, /* X_25 calling address. */
ns_t_isdn = 20, /* ISDN calling address. */
ns_t_rt = 21, /* Router. */
ns_t_nsap = 22, /* NSAP address. */
ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
ns_t_sig = 24, /* Security signature. */
ns_t_key = 25, /* Security key. */
ns_t_px = 26, /* X.400 mail mapping. */
ns_t_gpos = 27, /* Geographical position (withdrawn). */
ns_t_aaaa = 28, /* Ip6 Address. */
ns_t_loc = 29, /* Location Information. */
ns_t_nxt = 30, /* Next domain (security). */
ns_t_eid = 31, /* Endpoint identifier. */
ns_t_nimloc = 32, /* Nimrod Locator. */
ns_t_srv = 33, /* Server Selection. */
ns_t_atma = 34, /* ATM Address */
ns_t_naptr = 35, /* Naming Authority PoinTeR */
ns_t_kx = 36, /* Key Exchange */
ns_t_cert = 37, /* Certification record */
ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */
ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
ns_t_sink = 40, /* Kitchen sink (experimentatl) */
ns_t_opt = 41, /* EDNS0 option (meta-RR) */
ns_t_tsig = 250, /* Transaction signature. */
ns_t_ixfr = 251, /* Incremental zone transfer. */
ns_t_axfr = 252, /* Transfer zone of authority. */
ns_t_mailb = 253, /* Transfer mailbox records. */
ns_t_maila = 254, /* Transfer mail agent records. */
ns_t_any = 255, /* Wildcard match. */
ns_t_zxfr = 256, /* BIND-specific, nonstandard. */
ns_t_max = 65536
} ns_type;
 
/*
* Values for class field
*/
typedef enum __ns_class {
ns_c_invalid = 0, /* Cookie. */
ns_c_in = 1, /* Internet. */
ns_c_2 = 2, /* unallocated/unsupported. */
ns_c_chaos = 3, /* MIT Chaos-net. */
ns_c_hs = 4, /* MIT Hesiod. */
/* Query class values which do not appear in resource records */
ns_c_none = 254, /* for prereq. sections in update requests */
ns_c_any = 255, /* Wildcard match. */
ns_c_max = 65536
} ns_class;
 
/*
* Currently defined opcodes.
*/
typedef enum __ns_opcode {
ns_o_query = 0, /* Standard query. */
ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
ns_o_status = 2, /* Name server status query (unsupported). */
/* Opcode 3 is undefined/reserved. */
ns_o_notify = 4, /* Zone change notification. */
ns_o_update = 5, /* Zone update message. */
ns_o_max = 6
} ns_opcode;
 
/*
* Currently defined response codes.
*/
typedef enum __ns_rcode {
ns_r_noerror = 0, /* No error occurred. */
ns_r_formerr = 1, /* Format error. */
ns_r_servfail = 2, /* Server failure. */
ns_r_nxdomain = 3, /* Name error. */
ns_r_notimpl = 4, /* Unimplemented. */
ns_r_refused = 5, /* Operation refused. */
/* these are for BIND_UPDATE */
ns_r_yxdomain = 6, /* Name exists */
ns_r_yxrrset = 7, /* RRset exists */
ns_r_nxrrset = 8, /* RRset does not exist */
ns_r_notauth = 9, /* Not authoritative for zone */
ns_r_notzone = 10, /* Zone of record different from zone section */
ns_r_max = 11,
/* The following are TSIG extended errors */
ns_r_badsig = 16,
ns_r_badkey = 17,
ns_r_badtime = 18
} ns_rcode;
 
typedef struct {
unsigned id :16; /* query identification number */
#if BYTE_ORDER == BIG_ENDIAN
/* fields in third byte */
unsigned qr: 1; /* response flag */
unsigned opcode: 4; /* purpose of message */
unsigned aa: 1; /* authoritive answer */
unsigned tc: 1; /* truncated message */
unsigned rd: 1; /* recursion desired */
/* fields in fourth byte */
unsigned ra: 1; /* recursion available */
unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
unsigned ad: 1; /* authentic data from named */
unsigned cd: 1; /* checking disabled by resolver */
unsigned rcode :4; /* response code */
#endif
#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
/* fields in third byte */
unsigned rd :1; /* recursion desired */
unsigned tc :1; /* truncated message */
unsigned aa :1; /* authoritive answer */
unsigned opcode :4; /* purpose of message */
unsigned qr :1; /* response flag */
/* fields in fourth byte */
unsigned rcode :4; /* response code */
unsigned cd: 1; /* checking disabled by resolver */
unsigned ad: 1; /* authentic data from named */
unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
unsigned ra :1; /* recursion available */
#endif
/* remaining bytes */
unsigned qdcount :16; /* number of question entries */
unsigned ancount :16; /* number of answer entries */
unsigned nscount :16; /* number of authority entries */
unsigned arcount :16; /* number of resource entries */
} HEADER;
 
#define PACKETSZ NS_PACKETSZ
#define MAXDNAME NS_MAXDNAME
#define MAXCDNAME NS_MAXCDNAME
#define MAXLABEL NS_MAXLABEL
#define HFIXEDSZ NS_HFIXEDSZ
#define QFIXEDSZ NS_QFIXEDSZ
#define RRFIXEDSZ NS_RRFIXEDSZ
#define INT32SZ NS_INT32SZ
#define INT16SZ NS_INT16SZ
#define INADDRSZ NS_INADDRSZ
#define IN6ADDRSZ NS_IN6ADDRSZ
#define INDIR_MASK NS_CMPRSFLGS
#define NAMESERVER_PORT NS_DEFAULTPORT
 
#define S_ZONE ns_s_zn
#define S_PREREQ ns_s_pr
#define S_UPDATE ns_s_ud
#define S_ADDT ns_s_ar
 
#define QUERY ns_o_query
#define IQUERY ns_o_iquery
#define STATUS ns_o_status
#define NS_NOTIFY_OP ns_o_notify
#define NS_UPDATE_OP ns_o_update
 
#define NOERROR ns_r_noerror
#define FORMERR ns_r_formerr
#define SERVFAIL ns_r_servfail
#define NXDOMAIN ns_r_nxdomain
#define NOTIMP ns_r_notimpl
#define REFUSED ns_r_refused
#define YXDOMAIN ns_r_yxdomain
#define YXRRSET ns_r_yxrrset
#define NXRRSET ns_r_nxrrset
#define NOTAUTH ns_r_notauth
#define NOTZONE ns_r_notzone
 
#define DELETE ns_uop_delete
#define ADD ns_uop_add
 
#define T_A ns_t_a
#define T_NS ns_t_ns
#define T_MD ns_t_md
#define T_MF ns_t_mf
#define T_CNAME ns_t_cname
#define T_SOA ns_t_soa
#define T_MB ns_t_mb
#define T_MG ns_t_mg
#define T_MR ns_t_mr
#define T_NULL ns_t_null
#define T_WKS ns_t_wks
#define T_PTR ns_t_ptr
#define T_HINFO ns_t_hinfo
#define T_MINFO ns_t_minfo
#define T_MX ns_t_mx
#define T_TXT ns_t_txt
#define T_RP ns_t_rp
#define T_AFSDB ns_t_afsdb
#define T_X25 ns_t_x25
#define T_ISDN ns_t_isdn
#define T_RT ns_t_rt
#define T_NSAP ns_t_nsap
#define T_NSAP_PTR ns_t_nsap_ptr
#define T_SIG ns_t_sig
#define T_KEY ns_t_key
#define T_PX ns_t_px
#define T_GPOS ns_t_gpos
#define T_AAAA ns_t_aaaa
#define T_LOC ns_t_loc
#define T_NXT ns_t_nxt
#define T_EID ns_t_eid
#define T_NIMLOC ns_t_nimloc
#define T_SRV ns_t_srv
#define T_ATMA ns_t_atma
#define T_NAPTR ns_t_naptr
#define T_TSIG ns_t_tsig
#define T_IXFR ns_t_ixfr
#define T_AXFR ns_t_axfr
#define T_MAILB ns_t_mailb
#define T_MAILA ns_t_maila
#define T_ANY ns_t_any
 
#define C_IN ns_c_in
#define C_CHAOS ns_c_chaos
#define C_HS ns_c_hs
#define C_NONE ns_c_none
#define C_ANY ns_c_any
 
__END_DECLS
 
#endif
/contrib/media/updf/include/arpa/telnet.h
0,0 → 1,319
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)telnet.h 8.2 (Berkeley) 12/15/93
*/
 
#ifndef _ARPA_TELNET_H
#define _ARPA_TELNET_H
 
/*
* Definitions for the TELNET protocol.
*/
#define IAC 255 /* interpret as command: */
#define DONT 254 /* you are not to use option */
#define DO 253 /* please, you use option */
#define WONT 252 /* I won't use option */
#define WILL 251 /* I will use option */
#define SB 250 /* interpret as subnegotiation */
#define GA 249 /* you may reverse the line */
#define EL 248 /* erase the current line */
#define EC 247 /* erase the current character */
#define AYT 246 /* are you there */
#define AO 245 /* abort output--but let prog finish */
#define IP 244 /* interrupt process--permanently */
#define BREAK 243 /* break */
#define DM 242 /* data mark--for connect. cleaning */
#define NOP 241 /* nop */
#define SE 240 /* end sub negotiation */
#define EOR 239 /* end of record (transparent mode) */
#define ABORT 238 /* Abort process */
#define SUSP 237 /* Suspend process */
#define xEOF 236 /* End of file: EOF is already used... */
 
#define SYNCH 242 /* for telfunc calls */
 
#ifdef TELCMDS
char *telcmds[] = {
"EOF", "SUSP", "ABORT", "EOR",
"SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
"EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0,
};
#else
extern char *telcmds[];
#endif
 
#define TELCMD_FIRST xEOF
#define TELCMD_LAST IAC
#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
(unsigned int)(x) >= TELCMD_FIRST)
#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
 
/* telnet options */
#define TELOPT_BINARY 0 /* 8-bit data path */
#define TELOPT_ECHO 1 /* echo */
#define TELOPT_RCP 2 /* prepare to reconnect */
#define TELOPT_SGA 3 /* suppress go ahead */
#define TELOPT_NAMS 4 /* approximate message size */
#define TELOPT_STATUS 5 /* give status */
#define TELOPT_TM 6 /* timing mark */
#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
#define TELOPT_NAOL 8 /* negotiate about output line width */
#define TELOPT_NAOP 9 /* negotiate about output page size */
#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
#define TELOPT_XASCII 17 /* extended ascic character set */
#define TELOPT_LOGOUT 18 /* force logout */
#define TELOPT_BM 19 /* byte macro */
#define TELOPT_DET 20 /* data entry terminal */
#define TELOPT_SUPDUP 21 /* supdup protocol */
#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
#define TELOPT_SNDLOC 23 /* send location */
#define TELOPT_TTYPE 24 /* terminal type */
#define TELOPT_EOR 25 /* end or record */
#define TELOPT_TUID 26 /* TACACS user identification */
#define TELOPT_OUTMRK 27 /* output marking */
#define TELOPT_TTYLOC 28 /* terminal location number */
#define TELOPT_3270REGIME 29 /* 3270 regime */
#define TELOPT_X3PAD 30 /* X.3 PAD */
#define TELOPT_NAWS 31 /* window size */
#define TELOPT_TSPEED 32 /* terminal speed */
#define TELOPT_LFLOW 33 /* remote flow control */
#define TELOPT_LINEMODE 34 /* Linemode option */
#define TELOPT_XDISPLOC 35 /* X Display Location */
#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
#define TELOPT_AUTHENTICATION 37/* Authenticate */
#define TELOPT_ENCRYPT 38 /* Encryption option */
#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
#define TELOPT_EXOPL 255 /* extended-options-list */
 
 
#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
#ifdef TELOPTS
char *telopts[NTELOPTS+1] = {
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
"NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
"NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
"DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
"SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
"TACACS UID", "OUTPUT MARKING", "TTYLOC",
"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
"ENCRYPT", "NEW-ENVIRON",
0,
};
#define TELOPT_FIRST TELOPT_BINARY
#define TELOPT_LAST TELOPT_NEW_ENVIRON
#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
#endif
 
/* sub-option qualifiers */
#define TELQUAL_IS 0 /* option is... */
#define TELQUAL_SEND 1 /* send option */
#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
 
#define LFLOW_OFF 0 /* Disable remote flow control */
#define LFLOW_ON 1 /* Enable remote flow control */
#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
 
/*
* LINEMODE suboptions
*/
 
#define LM_MODE 1
#define LM_FORWARDMASK 2
#define LM_SLC 3
 
#define MODE_EDIT 0x01
#define MODE_TRAPSIG 0x02
#define MODE_ACK 0x04
#define MODE_SOFT_TAB 0x08
#define MODE_LIT_ECHO 0x10
 
#define MODE_MASK 0x1f
 
/* Not part of protocol, but needed to simplify things... */
#define MODE_FLOW 0x0100
#define MODE_ECHO 0x0200
#define MODE_INBIN 0x0400
#define MODE_OUTBIN 0x0800
#define MODE_FORCE 0x1000
 
#define SLC_SYNCH 1
#define SLC_BRK 2
#define SLC_IP 3
#define SLC_AO 4
#define SLC_AYT 5
#define SLC_EOR 6
#define SLC_ABORT 7
#define SLC_EOF 8
#define SLC_SUSP 9
#define SLC_EC 10
#define SLC_EL 11
#define SLC_EW 12
#define SLC_RP 13
#define SLC_LNEXT 14
#define SLC_XON 15
#define SLC_XOFF 16
#define SLC_FORW1 17
#define SLC_FORW2 18
 
#define NSLC 18
 
/*
* For backwards compatability, we define SLC_NAMES to be the
* list of names if SLC_NAMES is not defined.
*/
#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
"ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
"LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
#ifdef SLC_NAMES
char *slc_names[] = {
SLC_NAMELIST
};
#else
extern char *slc_names[];
#define SLC_NAMES SLC_NAMELIST
#endif
 
#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
#define SLC_NAME(x) slc_names[x]
 
#define SLC_NOSUPPORT 0
#define SLC_CANTCHANGE 1
#define SLC_VARIABLE 2
#define SLC_DEFAULT 3
#define SLC_LEVELBITS 0x03
 
#define SLC_FUNC 0
#define SLC_FLAGS 1
#define SLC_VALUE 2
 
#define SLC_ACK 0x80
#define SLC_FLUSHIN 0x40
#define SLC_FLUSHOUT 0x20
 
#define OLD_ENV_VAR 1
#define OLD_ENV_VALUE 0
#define NEW_ENV_VAR 0
#define NEW_ENV_VALUE 1
#define ENV_ESC 2
#define ENV_USERVAR 3
 
/*
* AUTHENTICATION suboptions
*/
 
/*
* Who is authenticating who ...
*/
#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
#define AUTH_WHO_SERVER 1 /* Server authenticating client */
#define AUTH_WHO_MASK 1
 
/*
* amount of authentication done
*/
#define AUTH_HOW_ONE_WAY 0
#define AUTH_HOW_MUTUAL 2
#define AUTH_HOW_MASK 2
 
#define AUTHTYPE_NULL 0
#define AUTHTYPE_KERBEROS_V4 1
#define AUTHTYPE_KERBEROS_V5 2
#define AUTHTYPE_SPX 3
#define AUTHTYPE_MINK 4
#define AUTHTYPE_CNT 5
 
#define AUTHTYPE_TEST 99
 
#ifdef AUTH_NAMES
char *authtype_names[] = {
"NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
};
#else
extern char *authtype_names[];
#endif
 
#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
#define AUTHTYPE_NAME(x) authtype_names[x]
 
/*
* ENCRYPTion suboptions
*/
#define ENCRYPT_IS 0 /* I pick encryption type ... */
#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
#define ENCRYPT_REPLY 2 /* Initial setup response */
#define ENCRYPT_START 3 /* Am starting to send encrypted */
#define ENCRYPT_END 4 /* Am ending encrypted */
#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
#define ENCRYPT_REQEND 6 /* Request you send encrypting */
#define ENCRYPT_ENC_KEYID 7
#define ENCRYPT_DEC_KEYID 8
#define ENCRYPT_CNT 9
 
#define ENCTYPE_ANY 0
#define ENCTYPE_DES_CFB64 1
#define ENCTYPE_DES_OFB64 2
#define ENCTYPE_CNT 3
 
#ifdef ENCRYPT_NAMES
char *encrypt_names[] = {
"IS", "SUPPORT", "REPLY", "START", "END",
"REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
0,
};
char *enctype_names[] = {
"ANY", "DES_CFB64", "DES_OFB64", 0,
};
#else
extern char *encrypt_names[];
extern char *enctype_names[];
#endif
 
 
#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
#define ENCRYPT_NAME(x) encrypt_names[x]
 
#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
#define ENCTYPE_NAME(x) enctype_names[x]
#endif /* _ARPA_TELNET_H */
/contrib/media/updf/include/arpa/tftp.h
0,0 → 1,80
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)tftp.h 8.1 (Berkeley) 6/2/93
*/
 
#ifndef _ARPA_TFTP_H
#define _ARPA_TFTP_H
 
/*
* Trivial File Transfer Protocol (IEN-133)
*/
#define SEGSIZE 512 /* data segment size */
 
/*
* Packet types.
*/
#define RRQ 01 /* read request */
#define WRQ 02 /* write request */
#define DATA 03 /* data packet */
#define ACK 04 /* acknowledgement */
#define ERROR 05 /* error code */
 
struct tftphdr {
short th_opcode; /* packet type */
union {
short tu_block; /* block # */
short tu_code; /* error code */
char tu_stuff[1]; /* request packet stuff */
} th_u;
char th_data[1]; /* data or error string */
};
 
#define th_block th_u.tu_block
#define th_code th_u.tu_code
#define th_stuff th_u.tu_stuff
#define th_msg th_data
 
/*
* Error codes.
*/
#define EUNDEF 0 /* not defined */
#define ENOTFOUND 1 /* file not found */
#define EACCESS 2 /* access violation */
#define ENOSPACE 3 /* disk full or allocation exceeded */
#define EBADOP 4 /* illegal TFTP operation */
#define EBADID 5 /* unknown transfer ID */
#define EEXISTS 6 /* file already exists */
#define ENOUSER 7 /* no such user */
 
#endif /* _ARPA_TFTP_H */
/contrib/media/updf/include/arrayclass.h
0,0 → 1,27
 
#ifndef __arrayclass_h__
#define __arrayclass_h__
 
#include "yacasbase.h"
#include "lispobject.h"
#include "genericobject.h"
 
class ArrayClass : public GenericClass
{
public: //required
ArrayClass(LispInt aSize,LispObject* aInitialItem);
virtual ~ArrayClass();
virtual LispChar * Send(LispArgList& aArgList);
virtual LispChar * TypeName();
public: //array-specific
inline LispInt Size();
inline LispObject* GetElement(LispInt aItem); // TODO: 1-based, ...
inline void SetElement(LispInt aItem,LispObject* aObject);
 
private:
LispPtrArray iArray;
};
 
#include "arrayclass.inl"
#endif
 
/contrib/media/updf/include/asm/byteorder.h
0,0 → 1,43
#ifndef _I386_BYTEORDER_H
#define _I386_BYTEORDER_H
 
#include <asm/types.h>
#include __DEV_CONFIG_H
 
#ifdef __GNUC__
 
static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
{
#ifdef CONFIG_X86_BSWAP
__asm__("bswap %0" : "=r" (x) : "0" (x));
#else
__asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
"rorl $16,%0\n\t" /* swap words */
"xchgb %b0,%h0" /* swap higher bytes */
:"=q" (x)
: "0" (x));
#endif
return x;
}
 
static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
{
__asm__("xchgb %b0,%h0" /* swap bytes */ \
: "=q" (x) \
: "0" (x)); \
return x;
}
 
#define __arch__swab32(x) ___arch__swab32(x)
#define __arch__swab16(x) ___arch__swab16(x)
 
#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
# define __BYTEORDER_HAS_U64__
# define __SWAB_64_THRU_32__
#endif
 
#endif /* __GNUC__ */
 
#include <linux/byteorder/little_endian.h>
 
#endif /* _I386_BYTEORDER_H */
/contrib/media/updf/include/asm/types.h
0,0 → 1,4
#ifndef _I386_TYPES_H
#define _I386_TYPES_H
 
#endif
/contrib/media/updf/include/assert.h
0,0 → 1,31
/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#undef assert
#undef unimpl
 
#define assert(test) ((void)((test)||(__dj_assert(#test,__FILE__,__LINE__),0)))
#define unimpl() __dj_unimp("Called unimplemented function in file \"" __FILE__ "\"\n")
 
#ifndef __dj_include_assert_h_
#define __dj_include_assert_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifdef _MSC_VER
void __declspec(noreturn) __dj_assert(const char *,const char *,int);
void __declspec(noreturn) __dj_unimp(const char *fn);
#else
void __dj_assert(const char *,const char *,int) __attribute__((__noreturn__));
void __dj_unimp(const char *fn) __attribute__((__noreturn__));
#endif
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_assert_h_ */
 
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
/contrib/media/updf/include/backward/algo.h
0,0 → 1,112
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_ALGO_H
#define _CPP_BACKWARD_ALGO_H 1
 
#include "backward_warning.h"
#include "algobase.h"
#include "tempbuf.h"
#include "iterator.h"
#include <bits/stl_algo.h>
#include <bits/stl_numeric.h>
 
// Names from <stl_algo.h>
using std::for_each;
using std::find;
using std::find_if;
using std::adjacent_find;
using std::count;
using std::count_if;
using std::search;
using std::search_n;
using std::swap_ranges;
using std::transform;
using std::replace;
using std::replace_if;
using std::replace_copy;
using std::replace_copy_if;
using std::generate;
using std::generate_n;
using std::remove;
using std::remove_if;
using std::remove_copy;
using std::remove_copy_if;
using std::unique;
using std::unique_copy;
using std::reverse;
using std::reverse_copy;
using std::rotate;
using std::rotate_copy;
using std::random_shuffle;
using std::random_sample;
using std::random_sample_n;
using std::partition;
using std::stable_partition;
using std::sort;
using std::stable_sort;
using std::partial_sort;
using std::partial_sort_copy;
using std::nth_element;
using std::lower_bound;
using std::upper_bound;
using std::equal_range;
using std::binary_search;
using std::merge;
using std::inplace_merge;
using std::includes;
using std::set_union;
using std::set_intersection;
using std::set_difference;
using std::set_symmetric_difference;
using std::min_element;
using std::max_element;
using std::next_permutation;
using std::prev_permutation;
using std::find_first_of;
using std::find_end;
using std::is_sorted;
using std::is_heap;
 
// Names from stl_heap.h
using std::push_heap;
using std::pop_heap;
using std::make_heap;
using std::sort_heap;
 
// Names from stl_numeric.h
using std::accumulate;
using std::inner_product;
using std::partial_sum;
using std::adjacent_difference;
using std::power;
using std::iota;
 
#endif /* _CPP_BACKWARD_ALGO_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/algobase.h
0,0 → 1,60
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_ALGOBASE_H
#define _CPP_BACKWARD_ALGOBASE_H 1
 
#include "backward_warning.h"
#include "pair.h"
#include "iterator.h"
#include <bits/stl_algobase.h>
#include <bits/stl_uninitialized.h>
 
// Names from stl_algobase.h
using std::iter_swap;
using std::swap;
using std::min;
using std::max;
using std::copy;
using std::copy_backward;
using std::copy_n;
using std::fill;
using std::fill_n;
using std::mismatch;
using std::equal;
using std::lexicographical_compare;
using std::lexicographical_compare_3way;
 
// Names from stl_uninitialized.h
using std::uninitialized_copy;
using std::uninitialized_copy_n;
using std::uninitialized_fill;
using std::uninitialized_fill_n;
 
#endif /* _CPP_BACKWARD_ALGOBASE_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/alloc.h
0,0 → 1,36
/*
* Copyright (c) 1996-1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_ALLOC_H
#define _CPP_BACKWARD_ALLOC_H 1
 
#include "backward_warning.h"
#include <bits/c++config.h>
#include <bits/stl_alloc.h>
 
using std::__malloc_alloc_template;
using std::malloc_alloc;
using std::simple_alloc;
using std::debug_alloc;
#ifndef __USE_MALLOC
using std::__default_alloc_template;
#endif
using std::alloc;
using std::single_client_alloc;
using std::allocator;
 
#endif /* _CPP_BACKWARD_ALLOC_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/backward_warning.h
0,0 → 1,38
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_BACKWARD_WARNING_H
#define _CPP_BACKWARD_BACKWARD_WARNING_H 1
 
#ifdef __DEPRECATED
#warning This file includes at least one deprecated or antiquated header. \
Please use the <X> header instead of <X.h> header for 'C++' includes \
and use the <cX> header instead of <X.h> header for 'C' includes. \
To disable this warning use -Wno-deprecated.
#endif
 
#endif
/contrib/media/updf/include/backward/bvector.h
0,0 → 1,42
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef __SGI_STL_BVECTOR_H
#define __SGI_STL_BVECTOR_H
 
 
#include "backward_warning.h"
#include <bits/std_vector.h>
 
using std::bit_vector;
 
#endif /* __SGI_STL_BVECTOR_H */
 
// Local Variables:
// mode:C++
// End:
 
 
/contrib/media/updf/include/backward/complex.h
0,0 → 1,43
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_COMPLEX_H
#define _CPP_BACKWARD_COMPLEX_H 1
 
#include "backward_warning.h"
#include <bits/std_complex.h>
 
using std::complex;
typedef complex<float> float_complex;
typedef complex<double> double_complex;
typedef complex<long double> long_double_complex;
 
#endif
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/defalloc.h
0,0 → 1,88
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
// Inclusion of this file is DEPRECATED. This is the original HP
// default allocator. It is provided only for backward compatibility.
// This file WILL BE REMOVED in a future release.
//
// DO NOT USE THIS FILE unless you have an old container implementation
// that requires an allocator with the HP-style interface.
//
// Standard-conforming allocators have a very different interface. The
// standard default allocator is declared in the header <memory>.
 
#ifndef _CPP_BACKWARD_DEFALLOC_H
#define _CPP_BACKWARD_DEFALLOC_H 1
 
#include "backward_warning.h"
#include "new.h"
#include <stddef.h>
#include <stdlib.h>
#include <limits.h>
#include "iostream.h"
#include "algobase.h"
 
 
template <class _Tp>
inline _Tp* allocate(ptrdiff_t __size, _Tp*) {
set_new_handler(0);
_Tp* __tmp = (_Tp*)(::operator new((size_t)(__size * sizeof(_Tp))));
if (__tmp == 0) {
cerr << "out of memory" << endl;
exit(1);
}
return __tmp;
}
 
 
template <class _Tp>
inline void deallocate(_Tp* __buffer) {
::operator delete(__buffer);
}
 
template <class _Tp>
class allocator {
public:
typedef _Tp value_type;
typedef _Tp* pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
pointer allocate(size_type __n) {
return ::allocate((difference_type)__n, (pointer)0);
}
void deallocate(pointer __p) { ::deallocate(__p); }
pointer address(reference __x) { return (pointer)&__x; }
const_pointer const_address(const_reference __x) {
return (const_pointer)&__x;
}
size_type init_page_size() {
return max(size_type(1), size_type(4096/sizeof(_Tp)));
}
size_type max_size() const {
return max(size_type(1), size_type(UINT_MAX/sizeof(_Tp)));
}
};
 
class allocator<void> {
public:
typedef void* pointer;
};
 
 
 
#endif /* _CPP_BACKWARD_DEFALLOC_H */
/contrib/media/updf/include/backward/deque.h
0,0 → 1,41
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_DEQUE_H
#define _CPP_BACKWARD_DEQUE_H 1
 
#include "backward_warning.h"
#include "algobase.h"
#include "alloc.h"
#include <bits/std_deque.h>
 
using std::deque;
 
#endif /* _CPP_BACKWARD_DEQUE_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/fstream.h
0,0 → 1,52
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_FSTREAM_H
#define _CPP_BACKWARD_FSTREAM_H 1
 
#include "backward_warning.h"
#include <bits/std_fstream.h>
 
using std::filebuf;
using std::ifstream;
using std::ofstream;
using std::fstream;
using std::streampos;
 
#ifdef _GLIBCPP_USE_WCHAR_T
using std::wfilebuf;
using std::wifstream;
using std::wofstream;
using std::wfstream;
using std::wstreampos;
#endif
 
#endif
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/function.h
0,0 → 1,98
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_FUNCTION_H
#define _CPP_BACKWARD_FUNCTION_H 1
 
#include "backward_warning.h"
#include <bits/c++config.h>
#include <stddef.h>
#include <bits/stl_function.h>
 
// Names from stl_function.h
using std::unary_function;
using std::binary_function;
using std::plus;
using std::minus;
using std::multiplies;
using std::divides;
using std::identity_element;
using std::modulus;
using std::negate;
using std::equal_to;
using std::not_equal_to;
using std::greater;
using std::less;
using std::greater_equal;
using std::less_equal;
using std::logical_and;
using std::logical_or;
using std::logical_not;
using std::unary_negate;
using std::binary_negate;
using std::not1;
using std::not2;
using std::binder1st;
using std::binder2nd;
using std::bind1st;
using std::bind2nd;
using std::unary_compose;
using std::binary_compose;
using std::compose1;
using std::compose2;
using std::pointer_to_unary_function;
using std::pointer_to_binary_function;
using std::ptr_fun;
using std::identity;
using std::select1st;
using std::select2nd;
using std::project1st;
using std::project2nd;
using std::constant_void_fun;
using std::constant_unary_fun;
using std::constant_binary_fun;
using std::constant0;
using std::constant1;
using std::constant2;
using std::subtractive_rng;
using std::mem_fun_t;
using std::const_mem_fun_t;
using std::mem_fun_ref_t;
using std::const_mem_fun_ref_t;
using std::mem_fun1_t;
using std::const_mem_fun1_t;
using std::mem_fun1_ref_t;
using std::const_mem_fun1_ref_t;
using std::mem_fun;
using std::mem_fun_ref;
using std::mem_fun1;
using std::mem_fun1_ref;
 
#endif /* _CPP_BACKWARD_FUNCTION_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/hash_map.h
0,0 → 1,43
/*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
#ifndef _CPP_BACKWARD_HASH_MAP_H
#define _CPP_BACKWARD_HASH_MAP_H 1
 
#include "backward_warning.h"
#include "algobase.h"
#include <ext/hash_map>
 
using std::hash;
using std::hashtable;
using std::hash_map;
using std::hash_multimap;
 
#endif /* _CPP_BACKWARD_HASH_MAP_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/hash_set.h
0,0 → 1,40
/*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
#ifndef _CPP_BACKWARD_HASH_SET_H
#define _CPP_BACKWARD_HASH_SET_H 1
 
#include "backward_warning.h"
#include "algobase.h"
#include <ext/hash_set>
 
using std::hash;
using std::hashtable;
using std::hash_set;
using std::hash_multiset;
 
#endif /* _CPP_BACKWARD_HASH_SET_H */
 
/contrib/media/updf/include/backward/hashtable.h
0,0 → 1,47
/*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef _CPP_BACKWARD_HASHTABLE_H
#define _CPP_BACKWARD_HASHTABLE_H 1
 
#include "backward_warning.h"
#include <ext/stl_hashtable.h>
#include "algo.h"
#include "alloc.h"
#include "vector.h"
 
using std::hash;
using std::hashtable;
 
#endif /* _CPP_BACKWARD_HASHTABLE_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/heap.h
0,0 → 1,42
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_HEAP_H
#define _CPP_BACKWARD_HEAP_H 1
 
#include "backward_warning.h"
#include <bits/c++config.h>
#include <bits/stl_heap.h>
 
using std::push_heap;
using std::pop_heap;
using std::make_heap;
using std::sort_heap;
 
#endif /* _CPP_BACKWARD_HEAP_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/iomanip.h
0,0 → 1,70
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_IOMANIP_H
#define _CPP_BACKWARD_IOMANIP_H 1
 
#include "backward_warning.h"
#include "iostream.h"
#include <bits/std_iomanip.h>
 
// These are from <ios> as per [27.4].
using std::boolalpha;
using std::noboolalpha;
using std::showbase;
using std::noshowbase;
using std::showpoint;
using std::noshowpoint;
using std::showpos;
using std::noshowpos;
using std::skipws;
using std::noskipws;
using std::uppercase;
using std::nouppercase;
using std::internal;
using std::left;
using std::right;
using std::dec;
using std::hex;
using std::oct;
using std::fixed;
using std::scientific;
 
// These are from <iomanip> as per [27.6]. Manipulators from <istream>
// and <ostream> (e.g., endl) are made available via <iostream.h>.
using std::resetiosflags;
using std::setiosflags;
using std::setbase;
using std::setfill;
using std::setprecision;
using std::setw;
 
#endif
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/iostream.h
0,0 → 1,60
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_IOSTREAM_H
#define _CPP_BACKWARD_IOSTREAM_H 1
 
#include "backward_warning.h"
#include <bits/std_iostream.h>
 
using std::iostream;
using std::ostream;
using std::istream;
using std::ios;
using std::streambuf;
 
using std::cout;
using std::cin;
using std::cerr;
using std::clog;
#ifdef _GLIBCPP_USE_WCHAR_T
using std::wcout;
using std::wcin;
using std::wcerr;
using std::wclog;
#endif
 
using std::ws;
using std::endl;
using std::ends;
using std::flush;
 
#endif
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/istream.h
0,0 → 1,43
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_ISTREAM_H
#define _CPP_BACKWARD_ISTREAM_H 1
 
#include "backward_warning.h"
#include "iostream.h"
 
#endif
 
// Local Variables:
// mode:C++
// End:
 
 
 
 
 
/contrib/media/updf/include/backward/iterator.h
0,0 → 1,88
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_ITERATOR_H
#define _CPP_BACKWARD_ITERATOR_H 1
 
#include "backward_warning.h"
#include "function.h"
#include <stddef.h>
#include "iostream.h"
#include "iterator.h"
 
#include <bits/stl_construct.h>
#include <bits/stl_raw_storage_iter.h>
 
// Names from stl_iterator.h
using std::input_iterator_tag;
using std::output_iterator_tag;
using std::forward_iterator_tag;
using std::bidirectional_iterator_tag;
using std::random_access_iterator_tag;
 
#if 0
using std::iterator;
#endif
using std::input_iterator;
using std::output_iterator;
using std::forward_iterator;
using std::bidirectional_iterator;
using std::random_access_iterator;
 
using std::iterator_traits;
 
using std::iterator_category;
using std::distance_type;
using std::value_type;
 
using std::distance;
using std::advance;
 
using std::insert_iterator;
using std::front_insert_iterator;
using std::back_insert_iterator;
using std::inserter;
using std::front_inserter;
using std::back_inserter;
 
using std::reverse_iterator;
using std::reverse_bidirectional_iterator;
 
using std::istream_iterator;
using std::ostream_iterator;
 
// Names from stl_construct.h
using std::construct;
using std::destroy;
 
// Names from stl_raw_storage_iter.h
using std::raw_storage_iterator;
 
#endif /* _CPP_BACKWARD_ITERATOR_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/list.h
0,0 → 1,41
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_LIST_H
#define _CPP_BACKWARD_LIST_H 1
 
#include "backward_warning.h"
#include "algobase.h"
#include "alloc.h"
#include <bits/std_list.h>
 
using std::list;
 
#endif /* _CPP_BACKWARD_LIST_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/map.h
0,0 → 1,40
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_MAP_H
#define _CPP_BACKWARD_MAP_H 1
 
#include "backward_warning.h"
#include "tree.h"
#include <bits/std_map.h>
 
using std::map;
 
#endif /* _CPP_BACKWARD_MAP_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/multimap.h
0,0 → 1,40
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_MULTIMAP_H
#define _CPP_BACKWARD_MULTIMAP_H 1
 
#include "backward_warning.h"
#include "tree.h"
#include <bits/std_map.h>
 
using std::multimap;
 
#endif /* _CPP_BACKWARD_MULTIMAP_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/multiset.h
0,0 → 1,40
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_MULTISET_H
#define _CPP_BACKWARD_MULTISET_H 1
 
#include "backward_warning.h"
#include "tree.h"
#include <bits/std_set.h>
 
using std::multiset;
 
#endif /* _CPP_BACKWARD_MULTISET_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/new.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
// Copyright (C) 2000 Free Software Foundation
 
// This file is part of GNU CC.
//
// GNU CC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// GNU CC 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with GNU CC; see the file COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_NEW_H
#define _CPP_BACKWARD_NEW_H 1
 
#include "backward_warning.h"
#include <new>
 
using std::bad_alloc;
using std::nothrow_t;
using std::nothrow;
using std::new_handler;
using std::set_new_handler;
 
#endif
/contrib/media/updf/include/backward/ostream.h
0,0 → 1,38
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_OSTREAM_H
#define _CPP_BACKWARD_OSTREAM_H 1
 
#include "backward_warning.h"
#include "iostream.h"
 
#endif
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/pair.h
0,0 → 1,41
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_PAIR_H
#define _CPP_BACKWARD_PAIR_H 1
 
#include "backward_warning.h"
#include <bits/c++config.h>
#include <bits/stl_pair.h>
 
using std::pair;
using std::make_pair;
 
#endif /* _CPP_BACKWARD_PAIR_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/queue.h
0,0 → 1,41
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_QUEUE_H
#define _CPP_BACKWARD_QUEUE_H 1
 
#include "backward_warning.h"
#include <bits/std_queue.h>
 
using std::queue;
using std::priority_queue;
 
#endif
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/rope.h
0,0 → 1,31
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_ROPE_H
#define _CPP_BACKWARD_ROPE_H 1
 
#include "backward_warning.h"
#include "hashtable.h"
#include <ext/rope>
 
using std::char_producer;
using std::sequence_buffer;
using std::rope;
using std::crope;
using std::wrope;
 
#endif /* _CPP_BACKWARD_ROPE_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/set.h
0,0 → 1,40
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_SET_H
#define _CPP_BACKWARD_SET_H 1
 
#include "backward_warning.h"
#include "tree.h"
#include <bits/std_set.h>
 
using std::set;
 
#endif /* _CPP_BACKWARD_SET_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/slist.h
0,0 → 1,27
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
#ifndef _CPP_BACKWARD_SLIST_H
#define _CPP_BACKWARD_SLIST_H 1
 
#include "backward_warning.h"
#include <ext/slist>
 
using std::slist;
 
#endif /* _CPP_BACKWARD_SLIST_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/stack.h
0,0 → 1,43
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_STACK_H
#define _CPP_BACKWARD_STACK_H 1
 
#include "backward_warning.h"
#include "vector.h"
#include "deque.h"
#include "heap.h"
#include "queue.h"
#include <bits/std_stack.h>
 
using std::stack;
 
#endif /* _CPP_BACKWARD_STACK_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/stream.h
0,0 → 1,38
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_STREAM_H
#define _CPP_BACKWARD_STREAM_H 1
 
#include "backward_warning.h"
#include "iostream.h"
 
#endif
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/streambuf.h
0,0 → 1,40
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_STREAMBUF_H
#define _CPP_BACKWARD_STREAMBUF_H 1
 
#include "backward_warning.h"
#include <bits/std_streambuf.h>
 
using std::streambuf;
 
#endif
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/strstream
0,0 → 1,159
/*
* Copyright (c) 1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
// WARNING: The classes defined in this header are DEPRECATED. This
// header is defined in section D.7.1 of the C++ standard, and it
// MAY BE REMOVED in a future standard revision. You should use the
// header <sstream> instead.
 
#ifndef __SGI_STL_STRSTREAM
#define __SGI_STL_STRSTREAM
 
#include "backward_warning.h"
#include <bits/std_iosfwd.h>
#include <bits/std_ios.h>
#include <bits/std_istream.h>
#include <bits/std_ostream.h>
#include <bits/std_string.h>
 
namespace std
{
 
//----------------------------------------------------------------------
// Class strstreambuf, a streambuf class that manages an array of char.
// Note that this class is not a template.
 
class strstreambuf : public basic_streambuf<char, char_traits<char> >
{
public: // Types.
typedef char_traits<char> _Traits;
typedef basic_streambuf<char, _Traits> _Base;
 
public: // Constructor, destructor
explicit strstreambuf(streamsize __initial_capacity = 0);
strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
 
strstreambuf(char* __get, streamsize __n, char* __put = 0);
strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0);
strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0);
 
strstreambuf(const char* __get, streamsize __n);
strstreambuf(const signed char* __get, streamsize __n);
strstreambuf(const unsigned char* __get, streamsize __n);
 
virtual ~strstreambuf();
 
public: // strstreambuf operations.
void freeze(bool = true);
char* str();
int pcount() const;
 
protected: // Overridden virtual member functions.
virtual int_type overflow(int_type __c = _Traits::eof());
virtual int_type pbackfail(int_type __c = _Traits::eof());
virtual int_type underflow();
virtual _Base* setbuf(char* __buf, streamsize __n);
virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir,
ios_base::openmode __mode
= ios_base::in | ios_base::out);
virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
= ios_base::in | ios_base::out);
 
private: // Helper functions.
// Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
char* _M_alloc(size_t);
void _M_free(char*);
 
// Helper function used in constructors.
void _M_setup(char* __get, char* __put, streamsize __n);
 
private: // Data members.
void* (*_M_alloc_fun)(size_t);
void (*_M_free_fun)(void*);
 
bool _M_dynamic : 1;
bool _M_frozen : 1;
bool _M_constant : 1;
};
 
//----------------------------------------------------------------------
// Class istrstream, an istream that manages a strstreambuf.
 
class istrstream : public basic_istream<char>
{
public:
explicit istrstream(char*);
explicit istrstream(const char*);
istrstream(char* , streamsize);
istrstream(const char*, streamsize);
virtual ~istrstream();
 
strstreambuf* rdbuf() const;
char* str();
 
private:
strstreambuf _M_buf;
};
 
//----------------------------------------------------------------------
// Class ostrstream
 
class ostrstream : public basic_ostream<char>
{
public:
ostrstream();
ostrstream(char*, int, ios_base::openmode = ios_base::out);
virtual ~ostrstream();
 
strstreambuf* rdbuf() const;
void freeze(bool = true);
char* str();
int pcount() const;
 
private:
strstreambuf _M_buf;
};
 
//----------------------------------------------------------------------
// Class strstream
 
class strstream : public basic_iostream<char>
{
public:
typedef char char_type;
typedef char_traits<char>::int_type int_type;
typedef char_traits<char>::pos_type pos_type;
typedef char_traits<char>::off_type off_type;
 
strstream();
strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out);
virtual ~strstream();
 
strstreambuf* rdbuf() const;
void freeze(bool = true);
int pcount() const;
char* str();
 
private:
strstreambuf _M_buf;
};
 
} // namespace std
 
#endif /* __SGI_STL_STRSTREAM */
 
// Local Variables:
// mode:C++
// End:
 
 
/contrib/media/updf/include/backward/strstream.h
0,0 → 1,41
// -*- C++ -*- forwarding header.
// Copyright (C) 2000 Free Software Foundation
 
// This file is part of GNU CC.
//
// GNU CC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// GNU CC 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with GNU CC; see the file COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BACKWARD_STRSTREAM_H
#define _CPP_BACKWARD_STRSTREAM_H 1
 
#include "strstream"
 
using std::strstreambuf;
using std::istrstream;
using std::ostrstream;
using std::strstream;
 
#endif
 
/contrib/media/updf/include/backward/tempbuf.h
0,0 → 1,49
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_TEMPBUF_H
#define _CPP_BACKWARD_TEMPBUF_H 1
 
#include "backward_warning.h"
#include "pair.h"
#include "iterator.h"
#include <limits.h>
#include <stddef.h>
#include <stdlib.h>
#include <bits/type_traits.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_tempbuf.h>
 
using std::get_temporary_buffer;
using std::return_temporary_buffer;
using std::temporary_buffer;
 
#endif /* _CPP_BACKWARD_TEMPBUF_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/tree.h
0,0 → 1,27
 
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
#ifndef _CPP_EXT_TREE
#define _CPP_EXT_TREE 1
 
#include "backward_warning.h"
#include <bits/stl_tree.h>
 
using std::rb_tree;
 
#endif
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/backward/vector.h
0,0 → 1,41
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BACKWARD_VECTOR_H
#define _CPP_BACKWARD_VECTOR_H 1
 
#include "backward_warning.h"
#include "algobase.h"
#include "alloc.h"
#include <bits/std_vector.h>
 
using std::vector;
 
#endif /* _CPP_BACKWARD_VECTOR_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bfd.h
0,0 → 1,3612
/* Main header file for the bfd library -- portable access to object files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001
Free Software Foundation, Inc.
Contributed by Cygnus Support.
 
** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them;
** instead, change bfd-in.h or the other BFD source files processed to
** generate these files.
 
This file is part of BFD, the Binary File Descriptor library.
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
 
This program 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 General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
 
/* bfd.h -- The only header file required by users of the bfd library
 
The bfd.h file is generated from bfd-in.h and various .c files; if you
change it, your changes will probably be lost.
 
All the prototypes and definitions following the comment "THE FOLLOWING
IS EXTRACTED FROM THE SOURCE" are extracted from the source files for
BFD. If you change it, someone oneday will extract it from the source
again, and your changes will be lost. To save yourself from this bind,
change the definitions in the source in the bfd directory. Type "make
docs" and then "make headers" in that directory, and magically this file
will change to reflect your changes.
 
If you don't have the tools to perform the extraction, then you are
safe from someone on your system trampling over your header files.
You should still maintain the equivalence between the source and this
file though; every change you make to the .c file should be reflected
here. */
 
#ifndef __BFD_H_SEEN__
#define __BFD_H_SEEN__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include "ansidecl.h"
 
/* These two lines get substitutions done by commands in Makefile.in. */
#define BFD_VERSION "2.11.90.0.8"
#define BFD_ARCH_SIZE 32
#define BFD_HOST_64BIT_LONG 0
#if 0
#define BFD_HOST_64_BIT
#define BFD_HOST_U_64_BIT
#endif
 
#if BFD_ARCH_SIZE >= 64
#define BFD64
#endif
 
#ifndef INLINE
#if __GNUC__ >= 2
#define INLINE __inline__
#else
#define INLINE
#endif
#endif
 
/* forward declaration */
typedef struct _bfd bfd;
 
/* To squelch erroneous compiler warnings ("illegal pointer
combination") from the SVR3 compiler, we would like to typedef
boolean to int (it doesn't like functions which return boolean.
Making sure they are never implicitly declared to return int
doesn't seem to help). But this file is not configured based on
the host. */
/* General rules: functions which are boolean return true on success
and false on failure (unless they're a predicate). -- bfd.doc */
/* I'm sure this is going to break something and someone is going to
force me to change it. */
/* typedef enum boolean {false, true} boolean; */
/* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */
/* It gets worse if the host also defines a true/false enum... -sts */
/* And even worse if your compiler has built-in boolean types... -law */
#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
#define TRUE_FALSE_ALREADY_DEFINED
#endif
#ifdef MPW
/* Pre-emptive strike - get the file with the enum. */
#include <Types.h>
#define TRUE_FALSE_ALREADY_DEFINED
#endif /* MPW */
#ifndef TRUE_FALSE_ALREADY_DEFINED
typedef enum bfd_boolean {false, true} boolean;
#define BFD_TRUE_FALSE
#else
/* Use enum names that will appear nowhere else. */
typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;
#endif
 
/* A pointer to a position in a file. */
/* FIXME: This should be using off_t from <sys/types.h>.
For now, try to avoid breaking stuff by not including <sys/types.h> here.
This will break on systems with 64-bit file offsets (e.g. 4.4BSD).
Probably the best long-term answer is to avoid using file_ptr AND off_t
in this header file, and to handle this in the BFD implementation
rather than in its interface. */
/* typedef off_t file_ptr; */
typedef long int file_ptr;
 
/* Support for different sizes of target format ints and addresses.
If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be
set to 1 above. Otherwise, if gcc is being used, this code will
use gcc's "long long" type. Otherwise, BFD_HOST_64_BIT must be
defined above. */
 
#ifndef BFD_HOST_64_BIT
# if BFD_HOST_64BIT_LONG
# define BFD_HOST_64_BIT long
# define BFD_HOST_U_64_BIT unsigned long
# else
# ifdef __GNUC__
# if __GNUC__ >= 2
# define BFD_HOST_64_BIT long long
# define BFD_HOST_U_64_BIT unsigned long long
# endif /* __GNUC__ >= 2 */
# endif /* ! defined (__GNUC__) */
# endif /* ! BFD_HOST_64BIT_LONG */
#endif /* ! defined (BFD_HOST_64_BIT) */
 
#ifdef BFD64
 
#ifndef BFD_HOST_64_BIT
#error No 64 bit integer type available
#endif /* ! defined (BFD_HOST_64_BIT) */
 
typedef BFD_HOST_U_64_BIT bfd_vma;
typedef BFD_HOST_64_BIT bfd_signed_vma;
typedef BFD_HOST_U_64_BIT bfd_size_type;
typedef BFD_HOST_U_64_BIT symvalue;
 
#ifndef fprintf_vma
#if BFD_HOST_64BIT_LONG
#define sprintf_vma(s,x) sprintf (s, "%016lx", x)
#define fprintf_vma(f,x) fprintf (f, "%016lx", x)
#else
#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
#define fprintf_vma(s,x) \
fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
#define sprintf_vma(s,x) \
sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
#endif
#endif
 
#else /* not BFD64 */
 
/* Represent a target address. Also used as a generic unsigned type
which is guaranteed to be big enough to hold any arithmetic types
we need to deal with. */
typedef unsigned long bfd_vma;
 
/* A generic signed type which is guaranteed to be big enough to hold any
arithmetic types we need to deal with. Can be assumed to be compatible
with bfd_vma in the same way that signed and unsigned ints are compatible
(as parameters, in assignment, etc). */
typedef long bfd_signed_vma;
 
typedef unsigned long symvalue;
typedef unsigned long bfd_size_type;
 
/* Print a bfd_vma x on stream s. */
#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
 
#endif /* not BFD64 */
 
#define printf_vma(x) fprintf_vma(stdout,x)
 
typedef unsigned int flagword; /* 32 bits of flags */
typedef unsigned char bfd_byte;
/** File formats */
 
typedef enum bfd_format {
bfd_unknown = 0, /* file format is unknown */
bfd_object, /* linker/assember/compiler output */
bfd_archive, /* object archive file */
bfd_core, /* core dump */
bfd_type_end} /* marks the end; don't use it! */
bfd_format;
 
/* Values that may appear in the flags field of a BFD. These also
appear in the object_flags field of the bfd_target structure, where
they indicate the set of flags used by that backend (not all flags
are meaningful for all object file formats) (FIXME: at the moment,
the object_flags values have mostly just been copied from backend
to another, and are not necessarily correct). */
 
/* No flags. */
#define BFD_NO_FLAGS 0x00
 
/* BFD contains relocation entries. */
#define HAS_RELOC 0x01
 
/* BFD is directly executable. */
#define EXEC_P 0x02
 
/* BFD has line number information (basically used for F_LNNO in a
COFF header). */
#define HAS_LINENO 0x04
 
/* BFD has debugging information. */
#define HAS_DEBUG 0x08
 
/* BFD has symbols. */
#define HAS_SYMS 0x10
 
/* BFD has local symbols (basically used for F_LSYMS in a COFF
header). */
#define HAS_LOCALS 0x20
 
/* BFD is a dynamic object. */
#define DYNAMIC 0x40
 
/* Text section is write protected (if D_PAGED is not set, this is
like an a.out NMAGIC file) (the linker sets this by default, but
clears it for -r or -N). */
#define WP_TEXT 0x80
 
/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
linker sets this by default, but clears it for -r or -n or -N). */
#define D_PAGED 0x100
 
/* BFD is relaxable (this means that bfd_relax_section may be able to
do something) (sometimes bfd_relax_section can do something even if
this is not set). */
#define BFD_IS_RELAXABLE 0x200
 
/* This may be set before writing out a BFD to request using a
traditional format. For example, this is used to request that when
writing out an a.out object the symbols not be hashed to eliminate
duplicates. */
#define BFD_TRADITIONAL_FORMAT 0x400
 
/* This flag indicates that the BFD contents are actually cached in
memory. If this is set, iostream points to a bfd_in_memory struct. */
#define BFD_IN_MEMORY 0x800
/* symbols and relocation */
 
/* A count of carsyms (canonical archive symbols). */
typedef unsigned long symindex;
 
/* How to perform a relocation. */
typedef const struct reloc_howto_struct reloc_howto_type;
 
#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
 
/* General purpose part of a symbol X;
target specific parts are in libcoff.h, libaout.h, etc. */
 
#define bfd_get_section(x) ((x)->section)
#define bfd_get_output_section(x) ((x)->section->output_section)
#define bfd_set_section(x,y) ((x)->section) = (y)
#define bfd_asymbol_base(x) ((x)->section->vma)
#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
#define bfd_asymbol_name(x) ((x)->name)
/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
#define bfd_asymbol_bfd(x) ((x)->the_bfd)
#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)
 
/* A canonical archive symbol. */
/* This is a type pun with struct ranlib on purpose! */
typedef struct carsym {
char *name;
file_ptr file_offset; /* look here to find the file */
} carsym; /* to make these you call a carsymogen */
 
/* Used in generating armaps (archive tables of contents).
Perhaps just a forward definition would do? */
struct orl { /* output ranlib */
char **name; /* symbol name */
file_ptr pos; /* bfd* or file position */
int namidx; /* index into string table */
};
/* Linenumber stuff */
typedef struct lineno_cache_entry {
unsigned int line_number; /* Linenumber from start of function*/
union {
struct symbol_cache_entry *sym; /* Function name */
unsigned long offset; /* Offset into section */
} u;
} alent;
/* object and core file sections */
 
#define align_power(addr, align) \
( ((addr) + ((1<<(align))-1)) & (-1 << (align)))
 
typedef struct sec *sec_ptr;
 
#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
#define bfd_section_name(bfd, ptr) ((ptr)->name)
#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
 
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
 
#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma= (val)), ((ptr)->user_set_vma = (boolean)true), true)
#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
 
typedef struct stat stat_type;
typedef enum bfd_print_symbol
{
bfd_print_symbol_name,
bfd_print_symbol_more,
bfd_print_symbol_all
} bfd_print_symbol_type;
 
/* Information about a symbol that nm needs. */
 
typedef struct _symbol_info
{
symvalue value;
char type;
CONST char *name; /* Symbol name. */
unsigned char stab_type; /* Stab type. */
char stab_other; /* Stab other. */
short stab_desc; /* Stab desc. */
CONST char *stab_name; /* String for stab type. */
} symbol_info;
 
/* Get the name of a stabs type code. */
 
extern const char *bfd_get_stab_name PARAMS ((int));
/* Hash table routines. There is no way to free up a hash table. */
 
/* An element in the hash table. Most uses will actually use a larger
structure, and an instance of this will be the first field. */
 
struct bfd_hash_entry
{
/* Next entry for this hash code. */
struct bfd_hash_entry *next;
/* String being hashed. */
const char *string;
/* Hash code. This is the full hash code, not the index into the
table. */
unsigned long hash;
};
 
/* A hash table. */
 
struct bfd_hash_table
{
/* The hash array. */
struct bfd_hash_entry **table;
/* The number of slots in the hash table. */
unsigned int size;
/* A function used to create new elements in the hash table. The
first entry is itself a pointer to an element. When this
function is first invoked, this pointer will be NULL. However,
having the pointer permits a hierarchy of method functions to be
built each of which calls the function in the superclass. Thus
each function should be written to allocate a new block of memory
only if the argument is NULL. */
struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *));
/* An objalloc for this hash table. This is a struct objalloc *,
but we use PTR to avoid requiring the inclusion of objalloc.h. */
PTR memory;
};
 
/* Initialize a hash table. */
extern boolean bfd_hash_table_init
PARAMS ((struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *)));
 
/* Initialize a hash table specifying a size. */
extern boolean bfd_hash_table_init_n
PARAMS ((struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *),
unsigned int size));
 
/* Free up a hash table. */
extern void bfd_hash_table_free PARAMS ((struct bfd_hash_table *));
 
/* Look up a string in a hash table. If CREATE is true, a new entry
will be created for this string if one does not already exist. The
COPY argument must be true if this routine should copy the string
into newly allocated memory when adding an entry. */
extern struct bfd_hash_entry *bfd_hash_lookup
PARAMS ((struct bfd_hash_table *, const char *, boolean create,
boolean copy));
 
/* Replace an entry in a hash table. */
extern void bfd_hash_replace
PARAMS ((struct bfd_hash_table *, struct bfd_hash_entry *old,
struct bfd_hash_entry *nw));
 
/* Base method for creating a hash table entry. */
extern struct bfd_hash_entry *bfd_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
const char *));
 
/* Grab some space for a hash table entry. */
extern PTR bfd_hash_allocate PARAMS ((struct bfd_hash_table *,
unsigned int));
 
/* Traverse a hash table in a random order, calling a function on each
element. If the function returns false, the traversal stops. The
INFO argument is passed to the function. */
extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *,
boolean (*) (struct bfd_hash_entry *,
PTR),
PTR info));
/* Semi-portable string concatenation in cpp.
The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors.
The problem is, "32_" is not a valid preprocessing token, and we don't
want extra underscores (e.g., "nlm_32_"). The XCAT2 macro will cause the
inner CAT macros to be evaluated first, producing still-valid pp-tokens.
Then the final concatenation can be done. (Sigh.) */
#ifndef CAT
#ifdef SABER
#define CAT(a,b) a##b
#define CAT3(a,b,c) a##b##c
#define CAT4(a,b,c,d) a##b##c##d
#else
#if defined(__STDC__) || defined(ALMOST_STDC)
#define CAT(a,b) a##b
#define CAT3(a,b,c) a##b##c
#define XCAT2(a,b) CAT(a,b)
#define CAT4(a,b,c,d) XCAT2(CAT(a,b),CAT(c,d))
#else
#define CAT(a,b) a/**/b
#define CAT3(a,b,c) a/**/b/**/c
#define CAT4(a,b,c,d) a/**/b/**/c/**/d
#endif
#endif
#endif
 
#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
/* User program access to BFD facilities */
 
/* Direct I/O routines, for programs which know more about the object
file than BFD does. Use higher level routines if possible. */
 
extern bfd_size_type bfd_read
PARAMS ((PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd));
extern bfd_size_type bfd_write
PARAMS ((const PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd));
extern int bfd_seek PARAMS ((bfd *abfd, file_ptr fp, int direction));
extern long bfd_tell PARAMS ((bfd *abfd));
extern int bfd_flush PARAMS ((bfd *abfd));
extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
 
/* Cast from const char * to char * so that caller can assign to
a char * without a warning. */
#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
#define bfd_get_format(abfd) ((abfd)->format)
#define bfd_get_target(abfd) ((abfd)->xvec->name)
#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
#define bfd_family_coff(abfd) \
(bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
#define bfd_header_big_endian(abfd) \
((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
#define bfd_header_little_endian(abfd) \
((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
#define bfd_get_file_flags(abfd) ((abfd)->flags)
#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
#define bfd_my_archive(abfd) ((abfd)->my_archive)
#define bfd_has_map(abfd) ((abfd)->has_armap)
 
#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
#define bfd_usrdata(abfd) ((abfd)->usrdata)
 
#define bfd_get_start_address(abfd) ((abfd)->start_address)
#define bfd_get_symcount(abfd) ((abfd)->symcount)
#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
#define bfd_count_sections(abfd) ((abfd)->section_count)
 
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
 
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true)
 
extern boolean bfd_cache_close PARAMS ((bfd *abfd));
/* NB: This declaration should match the autogenerated one in libbfd.h. */
 
extern boolean bfd_record_phdr
PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma,
boolean, boolean, unsigned int, struct sec **));
 
/* Byte swapping routines. */
 
bfd_vma bfd_getb64 PARAMS ((const unsigned char *));
bfd_vma bfd_getl64 PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getb_signed_64 PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getl_signed_64 PARAMS ((const unsigned char *));
bfd_vma bfd_getb32 PARAMS ((const unsigned char *));
bfd_vma bfd_getl32 PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getb_signed_32 PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getl_signed_32 PARAMS ((const unsigned char *));
bfd_vma bfd_getb16 PARAMS ((const unsigned char *));
bfd_vma bfd_getl16 PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getb_signed_16 PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getl_signed_16 PARAMS ((const unsigned char *));
void bfd_putb64 PARAMS ((bfd_vma, unsigned char *));
void bfd_putl64 PARAMS ((bfd_vma, unsigned char *));
void bfd_putb32 PARAMS ((bfd_vma, unsigned char *));
void bfd_putl32 PARAMS ((bfd_vma, unsigned char *));
void bfd_putb16 PARAMS ((bfd_vma, unsigned char *));
void bfd_putl16 PARAMS ((bfd_vma, unsigned char *));
 
/* Byte swapping routines which take size and endiannes as arguments. */
 
bfd_vma bfd_get_bits PARAMS ((bfd_byte *, int, boolean));
void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean));
/* Externally visible ECOFF routines. */
 
#if defined(__STDC__) || defined(ALMOST_STDC)
struct ecoff_debug_info;
struct ecoff_debug_swap;
struct ecoff_extr;
struct symbol_cache_entry;
struct bfd_link_info;
struct bfd_link_hash_entry;
struct bfd_elf_version_tree;
#endif
extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd));
extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value));
extern boolean bfd_ecoff_set_regmasks
PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask,
unsigned long *cprmask));
extern PTR bfd_ecoff_debug_init
PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap,
struct bfd_link_info *));
extern void bfd_ecoff_debug_free
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap,
struct bfd_link_info *));
extern boolean bfd_ecoff_debug_accumulate
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap,
bfd *input_bfd, struct ecoff_debug_info *input_debug,
const struct ecoff_debug_swap *input_swap,
struct bfd_link_info *));
extern boolean bfd_ecoff_debug_accumulate_other
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
struct bfd_link_info *));
extern boolean bfd_ecoff_debug_externals
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
boolean relocateable,
boolean (*get_extr) (struct symbol_cache_entry *,
struct ecoff_extr *),
void (*set_index) (struct symbol_cache_entry *,
bfd_size_type)));
extern boolean bfd_ecoff_debug_one_external
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
const char *name, struct ecoff_extr *esym));
extern bfd_size_type bfd_ecoff_debug_size
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap));
extern boolean bfd_ecoff_write_debug
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, file_ptr where));
extern boolean bfd_ecoff_write_accumulated_debug
PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
struct bfd_link_info *info, file_ptr where));
extern boolean bfd_mips_ecoff_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **));
 
/* Externally visible ELF routines. */
 
struct bfd_link_needed_list
{
struct bfd_link_needed_list *next;
bfd *by;
const char *name;
};
 
extern boolean bfd_elf32_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
extern boolean bfd_elf64_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_elf_get_bfd_needed_list
PARAMS ((bfd *, struct bfd_link_needed_list **));
extern boolean bfd_elf32_size_dynamic_sections
PARAMS ((bfd *, const char *, const char *, boolean, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
extern boolean bfd_elf64_size_dynamic_sections
PARAMS ((bfd *, const char *, const char *, boolean, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *));
extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *));
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
PARAMS ((bfd *, struct bfd_link_info *));
 
/* Return an upper bound on the number of bytes required to store a
copy of ABFD's program header table entries. Return -1 if an error
occurs; bfd_get_error will return an appropriate code. */
extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd));
 
/* Copy ABFD's program header table entries to *PHDRS. The entries
will be stored as an array of Elf_Internal_Phdr structures, as
defined in include/elf/internal.h. To find out how large the
buffer needs to be, call bfd_get_elf_phdr_upper_bound.
 
Return the number of program header table entries read, or -1 if an
error occurs; bfd_get_error will return an appropriate code. */
extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs));
 
/* Return the arch_size field of an elf bfd, or -1 if not elf. */
extern int bfd_get_arch_size PARAMS ((bfd *));
 
/* Return true if address "naturally" sign extends, or -1 if not elf. */
extern int bfd_get_sign_extend_vma PARAMS ((bfd *));
 
extern boolean bfd_m68k_elf32_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **));
 
/* SunOS shared library support routines for the linker. */
 
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_sunos_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_sunos_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **,
struct sec **));
 
/* Linux shared library support routines for the linker. */
 
extern boolean bfd_i386linux_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_m68klinux_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_sparclinux_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
 
/* mmap hacks */
 
struct _bfd_window_internal;
typedef struct _bfd_window_internal bfd_window_internal;
 
typedef struct _bfd_window {
/* What the user asked for. */
PTR data;
bfd_size_type size;
/* The actual window used by BFD. Small user-requested read-only
regions sharing a page may share a single window into the object
file. Read-write versions shouldn't until I've fixed things to
keep track of which portions have been claimed by the
application; don't want to give the same region back when the
application wants two writable copies! */
struct _bfd_window_internal *i;
} bfd_window;
 
extern void bfd_init_window PARAMS ((bfd_window *));
extern void bfd_free_window PARAMS ((bfd_window *));
extern boolean bfd_get_file_window
PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean));
 
/* XCOFF support routines for the linker. */
 
extern boolean bfd_xcoff_link_record_set
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
bfd_size_type));
extern boolean bfd_xcoff_import_symbol
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
bfd_vma, const char *, const char *, const char *));
extern boolean bfd_xcoff_export_symbol
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
boolean));
extern boolean bfd_xcoff_link_count_reloc
PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_xcoff_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_xcoff_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *,
unsigned long, unsigned long, unsigned long, boolean,
int, boolean, boolean, struct sec **));
 
/* Externally visible COFF routines. */
 
#if defined(__STDC__) || defined(ALMOST_STDC)
struct internal_syment;
union internal_auxent;
#endif
 
extern boolean bfd_coff_get_syment
PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *));
 
extern boolean bfd_coff_get_auxent
PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
 
extern boolean bfd_coff_set_symbol_class
PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
 
extern boolean bfd_m68k_coff_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **));
 
/* ARM Interworking support. Called from linker. */
extern boolean bfd_arm_allocate_interworking_sections
PARAMS ((struct bfd_link_info *));
 
extern boolean bfd_arm_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *, int));
 
extern boolean bfd_arm_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *));
 
/* PE ARM Interworking support. Called from linker. */
extern boolean bfd_arm_pe_allocate_interworking_sections
PARAMS ((struct bfd_link_info *));
 
extern boolean bfd_arm_pe_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *, int));
 
extern boolean bfd_arm_pe_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *));
 
/* ELF ARM Interworking support. Called from linker. */
extern boolean bfd_elf32_arm_allocate_interworking_sections
PARAMS ((struct bfd_link_info *));
 
extern boolean bfd_elf32_arm_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *, int));
 
extern boolean bfd_elf32_arm_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *));
 
/* TI COFF load page support. */
extern void bfd_ticoff_set_section_load_page
PARAMS ((struct sec *, int));
 
extern int bfd_ticoff_get_section_load_page
PARAMS ((struct sec *));
 
/* And more from the source. */
void
bfd_init PARAMS ((void));
 
bfd *
bfd_openr PARAMS ((CONST char *filename, CONST char *target));
 
bfd *
bfd_fdopenr PARAMS ((CONST char *filename, CONST char *target, int fd));
 
bfd *
bfd_openstreamr PARAMS ((const char *, const char *, PTR));
 
bfd *
bfd_openw PARAMS ((CONST char *filename, CONST char *target));
 
boolean
bfd_close PARAMS ((bfd *abfd));
 
boolean
bfd_close_all_done PARAMS ((bfd *));
 
bfd *
bfd_create PARAMS ((CONST char *filename, bfd *templ));
 
boolean
bfd_make_writable PARAMS ((bfd *abfd));
 
boolean
bfd_make_readable PARAMS ((bfd *abfd));
 
 
/* Byte swapping macros for user section data. */
 
#define bfd_put_8(abfd, val, ptr) \
((void) (*((unsigned char *) (ptr)) = (unsigned char) (val)))
#define bfd_put_signed_8 \
bfd_put_8
#define bfd_get_8(abfd, ptr) \
(*(unsigned char *) (ptr))
#define bfd_get_signed_8(abfd, ptr) \
((*(unsigned char *) (ptr) ^ 0x80) - 0x80)
 
#define bfd_put_16(abfd, val, ptr) \
BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
#define bfd_put_signed_16 \
bfd_put_16
#define bfd_get_16(abfd, ptr) \
BFD_SEND(abfd, bfd_getx16, (ptr))
#define bfd_get_signed_16(abfd, ptr) \
BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
 
#define bfd_put_32(abfd, val, ptr) \
BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))
#define bfd_put_signed_32 \
bfd_put_32
#define bfd_get_32(abfd, ptr) \
BFD_SEND(abfd, bfd_getx32, (ptr))
#define bfd_get_signed_32(abfd, ptr) \
BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
 
#define bfd_put_64(abfd, val, ptr) \
BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))
#define bfd_put_signed_64 \
bfd_put_64
#define bfd_get_64(abfd, ptr) \
BFD_SEND(abfd, bfd_getx64, (ptr))
#define bfd_get_signed_64(abfd, ptr) \
BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
 
#define bfd_get(bits, abfd, ptr) \
((bits) == 8 ? bfd_get_8 (abfd, ptr) \
: (bits) == 16 ? bfd_get_16 (abfd, ptr) \
: (bits) == 32 ? bfd_get_32 (abfd, ptr) \
: (bits) == 64 ? bfd_get_64 (abfd, ptr) \
: (abort (), (bfd_vma) - 1))
 
#define bfd_put(bits, abfd, val, ptr) \
((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
: (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
: (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
: (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
: (abort (), (void) 0))
 
 
/* Byte swapping macros for file header data. */
 
#define bfd_h_put_8(abfd, val, ptr) \
bfd_put_8 (abfd, val, ptr)
#define bfd_h_put_signed_8(abfd, val, ptr) \
bfd_put_8 (abfd, val, ptr)
#define bfd_h_get_8(abfd, ptr) \
bfd_get_8 (abfd, ptr)
#define bfd_h_get_signed_8(abfd, ptr) \
bfd_get_signed_8 (abfd, ptr)
 
#define bfd_h_put_16(abfd, val, ptr) \
BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
#define bfd_h_put_signed_16 \
bfd_h_put_16
#define bfd_h_get_16(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx16,(ptr))
#define bfd_h_get_signed_16(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))
 
#define bfd_h_put_32(abfd, val, ptr) \
BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
#define bfd_h_put_signed_32 \
bfd_h_put_32
#define bfd_h_get_32(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx32,(ptr))
#define bfd_h_get_signed_32(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))
 
#define bfd_h_put_64(abfd, val, ptr) \
BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
#define bfd_h_put_signed_64 \
bfd_h_put_64
#define bfd_h_get_64(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx64,(ptr))
#define bfd_h_get_signed_64(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
 
/* This structure is used for a comdat section, as in PE. A comdat
section is associated with a particular symbol. When the linker
sees a comdat section, it keeps only one of the sections with a
given name and associated with a given symbol. */
 
struct bfd_comdat_info
{
/* The name of the symbol associated with a comdat section. */
const char *name;
 
/* The local symbol table index of the symbol associated with a
comdat section. This is only meaningful to the object file format
specific code; it is not an index into the list returned by
bfd_canonicalize_symtab. */
long symbol;
};
 
typedef struct sec
{
/* The name of the section; the name isn't a copy, the pointer is
the same as that passed to bfd_make_section. */
 
const char *name;
 
/* A unique sequence number. */
 
int id;
 
/* Which section is it; 0..nth. */
 
int index;
 
/* The next section in the list belonging to the BFD, or NULL. */
 
struct sec *next;
 
/* The field flags contains attributes of the section. Some
flags are read in from the object file, and some are
synthesized from other information. */
 
flagword flags;
 
#define SEC_NO_FLAGS 0x000
 
/* Tells the OS to allocate space for this section when loading.
This is clear for a section containing debug information only. */
#define SEC_ALLOC 0x001
 
/* Tells the OS to load the section from the file when loading.
This is clear for a .bss section. */
#define SEC_LOAD 0x002
 
/* The section contains data still to be relocated, so there is
some relocation information too. */
#define SEC_RELOC 0x004
 
#if 0 /* Obsolete ? */
#define SEC_BALIGN 0x008
#endif
 
/* A signal to the OS that the section contains read only data. */
#define SEC_READONLY 0x010
 
/* The section contains code only. */
#define SEC_CODE 0x020
 
/* The section contains data only. */
#define SEC_DATA 0x040
 
/* The section will reside in ROM. */
#define SEC_ROM 0x080
 
/* The section contains constructor information. This section
type is used by the linker to create lists of constructors and
destructors used by <<g++>>. When a back end sees a symbol
which should be used in a constructor list, it creates a new
section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
the symbol to it, and builds a relocation. To build the lists
of constructors, all the linker has to do is catenate all the
sections called <<__CTOR_LIST__>> and relocate the data
contained within - exactly the operations it would peform on
standard data. */
#define SEC_CONSTRUCTOR 0x100
 
/* The section is a constructor, and should be placed at the
end of the text, data, or bss section(?). */
#define SEC_CONSTRUCTOR_TEXT 0x1100
#define SEC_CONSTRUCTOR_DATA 0x2100
#define SEC_CONSTRUCTOR_BSS 0x3100
 
/* The section has contents - a data section could be
<<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
<<SEC_HAS_CONTENTS>> */
#define SEC_HAS_CONTENTS 0x200
 
/* An instruction to the linker to not output the section
even if it has information which would normally be written. */
#define SEC_NEVER_LOAD 0x400
 
/* The section is a COFF shared library section. This flag is
only for the linker. If this type of section appears in
the input file, the linker must copy it to the output file
without changing the vma or size. FIXME: Although this
was originally intended to be general, it really is COFF
specific (and the flag was renamed to indicate this). It
might be cleaner to have some more general mechanism to
allow the back end to control what the linker does with
sections. */
#define SEC_COFF_SHARED_LIBRARY 0x800
 
/* The section has GOT references. This flag is only for the
linker, and is currently only used by the elf32-hppa back end.
It will be set if global offset table references were detected
in this section, which indicate to the linker that the section
contains PIC code, and must be handled specially when doing a
static link. */
#define SEC_HAS_GOT_REF 0x4000
 
/* The section contains common symbols (symbols may be defined
multiple times, the value of a symbol is the amount of
space it requires, and the largest symbol value is the one
used). Most targets have exactly one of these (which we
translate to bfd_com_section_ptr), but ECOFF has two. */
#define SEC_IS_COMMON 0x8000
 
/* The section contains only debugging information. For
example, this is set for ELF .debug and .stab sections.
strip tests this flag to see if a section can be
discarded. */
#define SEC_DEBUGGING 0x10000
 
/* The contents of this section are held in memory pointed to
by the contents field. This is checked by bfd_get_section_contents,
and the data is retrieved from memory if appropriate. */
#define SEC_IN_MEMORY 0x20000
 
/* The contents of this section are to be excluded by the
linker for executable and shared objects unless those
objects are to be further relocated. */
#define SEC_EXCLUDE 0x40000
 
/* The contents of this section are to be sorted by the
based on the address specified in the associated symbol
table. */
#define SEC_SORT_ENTRIES 0x80000
 
/* When linking, duplicate sections of the same name should be
discarded, rather than being combined into a single section as
is usually done. This is similar to how common symbols are
handled. See SEC_LINK_DUPLICATES below. */
#define SEC_LINK_ONCE 0x100000
 
/* If SEC_LINK_ONCE is set, this bitfield describes how the linker
should handle duplicate sections. */
#define SEC_LINK_DUPLICATES 0x600000
 
/* This value for SEC_LINK_DUPLICATES means that duplicate
sections with the same name should simply be discarded. */
#define SEC_LINK_DUPLICATES_DISCARD 0x0
 
/* This value for SEC_LINK_DUPLICATES means that the linker
should warn if there are any duplicate sections, although
it should still only link one copy. */
#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000
 
/* This value for SEC_LINK_DUPLICATES means that the linker
should warn if any duplicate sections are a different size. */
#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000
 
/* This value for SEC_LINK_DUPLICATES means that the linker
should warn if any duplicate sections contain different
contents. */
#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000
 
/* This section was created by the linker as part of dynamic
relocation or other arcane processing. It is skipped when
going through the first-pass output, trusting that someone
else up the line will take care of it later. */
#define SEC_LINKER_CREATED 0x800000
 
/* This section should not be subject to garbage collection. */
#define SEC_KEEP 0x1000000
 
/* This section contains "short" data, and should be placed
"near" the GP. */
#define SEC_SMALL_DATA 0x2000000
 
/* This section contains data which may be shared with other
executables or shared objects. */
#define SEC_SHARED 0x4000000
 
/* When a section with this flag is being linked, then if the size of
the input section is less than a page, it should not cross a page
boundary. If the size of the input section is one page or more, it
should be aligned on a page boundary. */
#define SEC_BLOCK 0x8000000
 
/* Conditionally link this section; do not link if there are no
references found to any symbol in the section. */
#define SEC_CLINK 0x10000000
 
/* Attempt to merge identical entities in the section.
Entity size is given in the entsize field. */
#define SEC_MERGE 0x20000000
 
/* If given with SEC_MERGE, entities to merge are zero terminated
strings where entsize specifies character size instead of fixed
size entries. */
#define SEC_STRINGS 0x40000000
 
/* End of section flags. */
 
/* Some internal packed boolean fields. */
 
/* See the vma field. */
unsigned int user_set_vma : 1;
 
/* Whether relocations have been processed. */
unsigned int reloc_done : 1;
 
/* A mark flag used by some of the linker backends. */
unsigned int linker_mark : 1;
 
/* A mark flag used by some linker backends for garbage collection. */
unsigned int gc_mark : 1;
 
/* Used by the ELF code to mark sections which have been allocated to segments. */
unsigned int segment_mark : 1;
 
/* End of internal packed boolean fields. */
 
/* The virtual memory address of the section - where it will be
at run time. The symbols are relocated against this. The
user_set_vma flag is maintained by bfd; if it's not set, the
backend can assign addresses (for example, in <<a.out>>, where
the default address for <<.data>> is dependent on the specific
target and various flags). */
 
bfd_vma vma;
 
/* The load address of the section - where it would be in a
rom image; really only used for writing section header
information. */
 
bfd_vma lma;
 
/* The size of the section in octets, as it will be output.
Contains a value even if the section has no contents (e.g., the
size of <<.bss>>). This will be filled in after relocation. */
 
bfd_size_type _cooked_size;
 
/* The original size on disk of the section, in octets. Normally this
value is the same as the size, but if some relaxing has
been done, then this value will be bigger. */
 
bfd_size_type _raw_size;
 
/* If this section is going to be output, then this value is the
offset in *bytes* into the output section of the first byte in the
input section (byte ==> smallest addressable unit on the
target). In most cases, if this was going to start at the
100th octet (8-bit quantity) in the output section, this value
would be 100. However, if the target byte size is 16 bits
(bfd_octets_per_byte is "2"), this value would be 50. */
 
bfd_vma output_offset;
 
/* The output section through which to map on output. */
 
struct sec *output_section;
 
/* The alignment requirement of the section, as an exponent of 2 -
e.g., 3 aligns to 2^3 (or 8). */
 
unsigned int alignment_power;
 
/* If an input section, a pointer to a vector of relocation
records for the data in this section. */
 
struct reloc_cache_entry *relocation;
 
/* If an output section, a pointer to a vector of pointers to
relocation records for the data in this section. */
 
struct reloc_cache_entry **orelocation;
 
/* The number of relocation records in one of the above */
 
unsigned reloc_count;
 
/* Information below is back end specific - and not always used
or updated. */
 
/* File position of section data. */
 
file_ptr filepos;
 
/* File position of relocation info. */
 
file_ptr rel_filepos;
 
/* File position of line data. */
 
file_ptr line_filepos;
 
/* Pointer to data for applications. */
 
PTR userdata;
 
/* If the SEC_IN_MEMORY flag is set, this points to the actual
contents. */
unsigned char *contents;
 
/* Attached line number information. */
 
alent *lineno;
 
/* Number of line number records. */
 
unsigned int lineno_count;
 
/* Entity size for merging purposes. */
 
unsigned int entsize;
 
/* Optional information about a COMDAT entry; NULL if not COMDAT. */
 
struct bfd_comdat_info *comdat;
 
/* Points to the kept section if this section is a link-once section,
and is discarded. */
struct sec *kept_section;
 
/* When a section is being output, this value changes as more
linenumbers are written out. */
 
file_ptr moving_line_filepos;
 
/* What the section number is in the target world. */
 
int target_index;
 
PTR used_by_bfd;
 
/* If this is a constructor section then here is a list of the
relocations created to relocate items within it. */
 
struct relent_chain *constructor_chain;
 
/* The BFD which owns the section. */
 
bfd *owner;
 
/* A symbol which points at this section only */
struct symbol_cache_entry *symbol;
struct symbol_cache_entry **symbol_ptr_ptr;
 
struct bfd_link_order *link_order_head;
struct bfd_link_order *link_order_tail;
} asection ;
 
/* These sections are global, and are managed by BFD. The application
and target back end are not permitted to change the values in
these sections. New code should use the section_ptr macros rather
than referring directly to the const sections. The const sections
may eventually vanish. */
#define BFD_ABS_SECTION_NAME "*ABS*"
#define BFD_UND_SECTION_NAME "*UND*"
#define BFD_COM_SECTION_NAME "*COM*"
#define BFD_IND_SECTION_NAME "*IND*"
 
/* the absolute section */
extern const asection bfd_abs_section;
#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
/* Pointer to the undefined section */
extern const asection bfd_und_section;
#define bfd_und_section_ptr ((asection *) &bfd_und_section)
#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
/* Pointer to the common section */
extern const asection bfd_com_section;
#define bfd_com_section_ptr ((asection *) &bfd_com_section)
/* Pointer to the indirect section */
extern const asection bfd_ind_section;
#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
 
extern const struct symbol_cache_entry * const bfd_abs_symbol;
extern const struct symbol_cache_entry * const bfd_com_symbol;
extern const struct symbol_cache_entry * const bfd_und_symbol;
extern const struct symbol_cache_entry * const bfd_ind_symbol;
#define bfd_get_section_size_before_reloc(section) \
((section)->reloc_done ? (abort (), (bfd_size_type) 1) \
: (section)->_raw_size)
#define bfd_get_section_size_after_reloc(section) \
((section)->reloc_done ? (section)->_cooked_size \
: (abort (), (bfd_size_type) 1))
asection *
bfd_get_section_by_name PARAMS ((bfd *abfd, const char *name));
 
char *
bfd_get_unique_section_name PARAMS ((bfd *abfd,
const char *templat,
int *count));
 
asection *
bfd_make_section_old_way PARAMS ((bfd *abfd, const char *name));
 
asection *
bfd_make_section_anyway PARAMS ((bfd *abfd, const char *name));
 
asection *
bfd_make_section PARAMS ((bfd *, const char *name));
 
boolean
bfd_set_section_flags PARAMS ((bfd *abfd, asection *sec, flagword flags));
 
void
bfd_map_over_sections PARAMS ((bfd *abfd,
void (*func) (bfd *abfd,
asection *sect,
PTR obj),
PTR obj));
 
boolean
bfd_set_section_size PARAMS ((bfd *abfd, asection *sec, bfd_size_type val));
 
boolean
bfd_set_section_contents PARAMS ((bfd *abfd,
asection *section,
PTR data,
file_ptr offset,
bfd_size_type count));
 
boolean
bfd_get_section_contents PARAMS ((bfd *abfd, asection *section, PTR location,
file_ptr offset, bfd_size_type count));
 
boolean
bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, bfd *obfd, asection *osec));
 
#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
BFD_SEND (obfd, _bfd_copy_private_section_data, \
(ibfd, isection, obfd, osection))
void
_bfd_strip_section_from_output PARAMS ((struct bfd_link_info *info, asection *section));
 
enum bfd_architecture
{
bfd_arch_unknown, /* File arch not known */
bfd_arch_obscure, /* Arch known, not one of these */
bfd_arch_m68k, /* Motorola 68xxx */
#define bfd_mach_m68000 1
#define bfd_mach_m68008 2
#define bfd_mach_m68010 3
#define bfd_mach_m68020 4
#define bfd_mach_m68030 5
#define bfd_mach_m68040 6
#define bfd_mach_m68060 7
#define bfd_mach_cpu32 8
#define bfd_mach_mcf5200 9
#define bfd_mach_mcf5206e 10
#define bfd_mach_mcf5307 11
#define bfd_mach_mcf5407 12
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
lower number indicates a machine type that
only accepts a subset of the instructions
available to machines with higher numbers.
The exception is the "ca", which is
incompatible with all other machines except
"core". */
 
#define bfd_mach_i960_core 1
#define bfd_mach_i960_ka_sa 2
#define bfd_mach_i960_kb_sb 3
#define bfd_mach_i960_mc 4
#define bfd_mach_i960_xa 5
#define bfd_mach_i960_ca 6
#define bfd_mach_i960_jx 7
#define bfd_mach_i960_hx 8
 
bfd_arch_a29k, /* AMD 29000 */
bfd_arch_sparc, /* SPARC */
#define bfd_mach_sparc 1
/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
#define bfd_mach_sparc_sparclet 2
#define bfd_mach_sparc_sparclite 3
#define bfd_mach_sparc_v8plus 4
#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */
#define bfd_mach_sparc_sparclite_le 6
#define bfd_mach_sparc_v9 7
#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */
#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns */
#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns */
/* Nonzero if MACH has the v9 instruction set. */
#define bfd_mach_sparc_v9_p(mach) \
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
&& (mach) != bfd_mach_sparc_sparclite_le)
bfd_arch_mips, /* MIPS Rxxxx */
#define bfd_mach_mips3000 3000
#define bfd_mach_mips3900 3900
#define bfd_mach_mips4000 4000
#define bfd_mach_mips4010 4010
#define bfd_mach_mips4100 4100
#define bfd_mach_mips4111 4111
#define bfd_mach_mips4300 4300
#define bfd_mach_mips4400 4400
#define bfd_mach_mips4600 4600
#define bfd_mach_mips4650 4650
#define bfd_mach_mips5000 5000
#define bfd_mach_mips6000 6000
#define bfd_mach_mips8000 8000
#define bfd_mach_mips10000 10000
#define bfd_mach_mips16 16
#define bfd_mach_mips32 32
#define bfd_mach_mips32_4k 3204113 /* 32, 04, octal 'K' */
#define bfd_mach_mips5 5
#define bfd_mach_mips64 64
#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
bfd_arch_i386, /* Intel 386 */
#define bfd_mach_i386_i386 0
#define bfd_mach_i386_i8086 1
#define bfd_mach_i386_i386_intel_syntax 2
#define bfd_mach_x86_64 3
#define bfd_mach_x86_64_intel_syntax 4
bfd_arch_we32k, /* AT&T WE32xxx */
bfd_arch_tahoe, /* CCI/Harris Tahoe */
bfd_arch_i860, /* Intel 860 */
bfd_arch_i370, /* IBM 360/370 Mainframes */
bfd_arch_romp, /* IBM ROMP PC/RT */
bfd_arch_alliant, /* Alliant */
bfd_arch_convex, /* Convex */
bfd_arch_m88k, /* Motorola 88xxx */
bfd_arch_pyramid, /* Pyramid Technology */
bfd_arch_h8300, /* Hitachi H8/300 */
#define bfd_mach_h8300 1
#define bfd_mach_h8300h 2
#define bfd_mach_h8300s 3
bfd_arch_pdp11, /* DEC PDP-11 */
bfd_arch_powerpc, /* PowerPC */
#define bfd_mach_ppc 0
#define bfd_mach_ppc_403 403
#define bfd_mach_ppc_403gc 4030
#define bfd_mach_ppc_505 505
#define bfd_mach_ppc_601 601
#define bfd_mach_ppc_602 602
#define bfd_mach_ppc_603 603
#define bfd_mach_ppc_ec603e 6031
#define bfd_mach_ppc_604 604
#define bfd_mach_ppc_620 620
#define bfd_mach_ppc_630 630
#define bfd_mach_ppc_750 750
#define bfd_mach_ppc_860 860
#define bfd_mach_ppc_a35 35
#define bfd_mach_ppc_rs64ii 642
#define bfd_mach_ppc_rs64iii 643
#define bfd_mach_ppc_7400 7400
bfd_arch_rs6000, /* IBM RS/6000 */
#define bfd_mach_rs6k 0
#define bfd_mach_rs6k_rs1 6001
#define bfd_mach_rs6k_rsc 6003
#define bfd_mach_rs6k_rs2 6002
bfd_arch_hppa, /* HP PA RISC */
bfd_arch_d10v, /* Mitsubishi D10V */
#define bfd_mach_d10v 0
#define bfd_mach_d10v_ts2 2
#define bfd_mach_d10v_ts3 3
bfd_arch_d30v, /* Mitsubishi D30V */
bfd_arch_m68hc11, /* Motorola 68HC11 */
bfd_arch_m68hc12, /* Motorola 68HC12 */
bfd_arch_z8k, /* Zilog Z8000 */
#define bfd_mach_z8001 1
#define bfd_mach_z8002 2
bfd_arch_h8500, /* Hitachi H8/500 */
bfd_arch_sh, /* Hitachi SH */
#define bfd_mach_sh 0
#define bfd_mach_sh2 0x20
#define bfd_mach_sh_dsp 0x2d
#define bfd_mach_sh3 0x30
#define bfd_mach_sh3_dsp 0x3d
#define bfd_mach_sh3e 0x3e
#define bfd_mach_sh4 0x40
bfd_arch_alpha, /* Dec Alpha */
#define bfd_mach_alpha_ev4 0x10
#define bfd_mach_alpha_ev5 0x20
#define bfd_mach_alpha_ev6 0x30
bfd_arch_arm, /* Advanced Risc Machines ARM */
#define bfd_mach_arm_2 1
#define bfd_mach_arm_2a 2
#define bfd_mach_arm_3 3
#define bfd_mach_arm_3M 4
#define bfd_mach_arm_4 5
#define bfd_mach_arm_4T 6
#define bfd_mach_arm_5 7
#define bfd_mach_arm_5T 8
#define bfd_mach_arm_5TE 9
#define bfd_mach_arm_XScale 10
bfd_arch_ns32k, /* National Semiconductors ns32000 */
bfd_arch_w65, /* WDC 65816 */
bfd_arch_tic30, /* Texas Instruments TMS320C30 */
bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
bfd_arch_tic80, /* TI TMS320c80 (MVP) */
bfd_arch_v850, /* NEC V850 */
#define bfd_mach_v850 0
#define bfd_mach_v850e 'E'
#define bfd_mach_v850ea 'A'
bfd_arch_arc, /* ARC Cores */
#define bfd_mach_arc_5 0
#define bfd_mach_arc_6 1
#define bfd_mach_arc_7 2
#define bfd_mach_arc_8 3
bfd_arch_m32r, /* Mitsubishi M32R/D */
#define bfd_mach_m32r 0 /* backwards compatibility */
#define bfd_mach_m32rx 'x'
bfd_arch_mn10200, /* Matsushita MN10200 */
bfd_arch_mn10300, /* Matsushita MN10300 */
#define bfd_mach_mn10300 300
#define bfd_mach_am33 330
bfd_arch_fr30,
#define bfd_mach_fr30 0x46523330
bfd_arch_mcore,
bfd_arch_ia64, /* HP/Intel ia64 */
#define bfd_mach_ia64_elf64 0
#define bfd_mach_ia64_elf32 1
bfd_arch_pj,
bfd_arch_avr, /* Atmel AVR microcontrollers */
#define bfd_mach_avr1 1
#define bfd_mach_avr2 2
#define bfd_mach_avr3 3
#define bfd_mach_avr4 4
#define bfd_mach_avr5 5
bfd_arch_cris, /* Axis CRIS */
bfd_arch_s390, /* IBM s390 */
#define bfd_mach_s390_esa 0
#define bfd_mach_s390_esame 1
bfd_arch_openrisc, /* OpenRISC */
bfd_arch_last
};
 
typedef struct bfd_arch_info
{
int bits_per_word;
int bits_per_address;
int bits_per_byte;
enum bfd_architecture arch;
unsigned long mach;
const char *arch_name;
const char *printable_name;
unsigned int section_align_power;
/* True if this is the default machine for the architecture. */
boolean the_default;
const struct bfd_arch_info * (*compatible)
PARAMS ((const struct bfd_arch_info *a,
const struct bfd_arch_info *b));
 
boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
 
const struct bfd_arch_info *next;
} bfd_arch_info_type;
const char *
bfd_printable_name PARAMS ((bfd *abfd));
 
const bfd_arch_info_type *
bfd_scan_arch PARAMS ((const char *string));
 
const char **
bfd_arch_list PARAMS ((void));
 
const bfd_arch_info_type *
bfd_arch_get_compatible PARAMS ((
const bfd *abfd,
const bfd *bbfd));
 
void
bfd_set_arch_info PARAMS ((bfd *abfd, const bfd_arch_info_type *arg));
 
enum bfd_architecture
bfd_get_arch PARAMS ((bfd *abfd));
 
unsigned long
bfd_get_mach PARAMS ((bfd *abfd));
 
unsigned int
bfd_arch_bits_per_byte PARAMS ((bfd *abfd));
 
unsigned int
bfd_arch_bits_per_address PARAMS ((bfd *abfd));
 
const bfd_arch_info_type *
bfd_get_arch_info PARAMS ((bfd *abfd));
 
const bfd_arch_info_type *
bfd_lookup_arch PARAMS ((enum bfd_architecture
arch,
unsigned long machine));
 
const char *
bfd_printable_arch_mach PARAMS ((enum bfd_architecture arch, unsigned long machine));
 
unsigned int
bfd_octets_per_byte PARAMS ((bfd *abfd));
 
unsigned int
bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch,
unsigned long machine));
 
typedef enum bfd_reloc_status
{
/* No errors detected */
bfd_reloc_ok,
 
/* The relocation was performed, but there was an overflow. */
bfd_reloc_overflow,
 
/* The address to relocate was not within the section supplied. */
bfd_reloc_outofrange,
 
/* Used by special functions */
bfd_reloc_continue,
 
/* Unsupported relocation size requested. */
bfd_reloc_notsupported,
 
/* Unused */
bfd_reloc_other,
 
/* The symbol to relocate against was undefined. */
bfd_reloc_undefined,
 
/* The relocation was performed, but may not be ok - presently
generated only when linking i960 coff files with i960 b.out
symbols. If this type is returned, the error_message argument
to bfd_perform_relocation will be set. */
bfd_reloc_dangerous
}
bfd_reloc_status_type;
 
 
typedef struct reloc_cache_entry
{
/* A pointer into the canonical table of pointers */
struct symbol_cache_entry **sym_ptr_ptr;
 
/* offset in section */
bfd_size_type address;
 
/* addend for relocation value */
bfd_vma addend;
 
/* Pointer to how to perform the required relocation */
reloc_howto_type *howto;
 
} arelent;
enum complain_overflow
{
/* Do not complain on overflow. */
complain_overflow_dont,
 
/* Complain if the bitfield overflows, whether it is considered
as signed or unsigned. */
complain_overflow_bitfield,
 
/* Complain if the value overflows when considered as signed
number. */
complain_overflow_signed,
 
/* Complain if the value overflows when considered as an
unsigned number. */
complain_overflow_unsigned
};
 
struct reloc_howto_struct
{
/* The type field has mainly a documentary use - the back end can
do what it wants with it, though normally the back end's
external idea of what a reloc number is stored
in this field. For example, a PC relative word relocation
in a coff environment has the type 023 - because that's
what the outside world calls a R_PCRWORD reloc. */
unsigned int type;
 
/* The value the final relocation is shifted right by. This drops
unwanted data from the relocation. */
unsigned int rightshift;
 
/* The size of the item to be relocated. This is *not* a
power-of-two measure. To get the number of bytes operated
on by a type of relocation, use bfd_get_reloc_size. */
int size;
 
/* The number of bits in the item to be relocated. This is used
when doing overflow checking. */
unsigned int bitsize;
 
/* Notes that the relocation is relative to the location in the
data section of the addend. The relocation function will
subtract from the relocation value the address of the location
being relocated. */
boolean pc_relative;
 
/* The bit position of the reloc value in the destination.
The relocated value is left shifted by this amount. */
unsigned int bitpos;
 
/* What type of overflow error should be checked for when
relocating. */
enum complain_overflow complain_on_overflow;
 
/* If this field is non null, then the supplied function is
called rather than the normal function. This allows really
strange relocation methods to be accomodated (e.g., i960 callj
instructions). */
bfd_reloc_status_type (*special_function)
PARAMS ((bfd *abfd,
arelent *reloc_entry,
struct symbol_cache_entry *symbol,
PTR data,
asection *input_section,
bfd *output_bfd,
char **error_message));
 
/* The textual name of the relocation type. */
char *name;
 
/* Some formats record a relocation addend in the section contents
rather than with the relocation. For ELF formats this is the
distinction between USE_REL and USE_RELA (though the code checks
for USE_REL == 1/0). The value of this field is TRUE if the
addend is recorded with the section contents; when performing a
partial link (ld -r) the section contents (the data) will be
modified. The value of this field is FALSE if addends are
recorded with the relocation (in arelent.addend); when performing
a partial link the relocation will be modified.
All relocations for all ELF USE_RELA targets should set this field
to FALSE (values of TRUE should be looked on with suspicion).
However, the converse is not true: not all relocations of all ELF
USE_REL targets set this field to TRUE. Why this is so is peculiar
to each particular target. For relocs that aren't used in partial
links (e.g. GOT stuff) it doesn't matter what this is set to. */
boolean partial_inplace;
 
/* The src_mask selects which parts of the read in data
are to be used in the relocation sum. E.g., if this was an 8 bit
byte of data which we read and relocated, this would be
0x000000ff. When we have relocs which have an addend, such as
sun4 extended relocs, the value in the offset part of a
relocating field is garbage so we never use it. In this case
the mask would be 0x00000000. */
bfd_vma src_mask;
 
/* The dst_mask selects which parts of the instruction are replaced
into the instruction. In most cases src_mask == dst_mask,
except in the above special case, where dst_mask would be
0x000000ff, and src_mask would be 0x00000000. */
bfd_vma dst_mask;
 
/* When some formats create PC relative instructions, they leave
the value of the pc of the place being relocated in the offset
slot of the instruction, so that a PC relative relocation can
be made just by adding in an ordinary offset (e.g., sun3 a.out).
Some formats leave the displacement part of an instruction
empty (e.g., m88k bcs); this flag signals the fact.*/
boolean pcrel_offset;
 
};
#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
{(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
 
#define EMPTY_HOWTO(C) \
HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false)
 
#define HOWTO_PREPARE(relocation, symbol) \
{ \
if (symbol != (asymbol *)NULL) { \
if (bfd_is_com_section (symbol->section)) { \
relocation = 0; \
} \
else { \
relocation = symbol->value; \
} \
} \
}
unsigned int
bfd_get_reloc_size PARAMS ((reloc_howto_type *));
 
typedef struct relent_chain {
arelent relent;
struct relent_chain *next;
} arelent_chain;
bfd_reloc_status_type
bfd_check_overflow PARAMS ((enum complain_overflow how,
unsigned int bitsize,
unsigned int rightshift,
unsigned int addrsize,
bfd_vma relocation));
 
bfd_reloc_status_type
bfd_perform_relocation PARAMS ((bfd *abfd,
arelent *reloc_entry,
PTR data,
asection *input_section,
bfd *output_bfd,
char **error_message));
 
bfd_reloc_status_type
bfd_install_relocation PARAMS ((bfd *abfd,
arelent *reloc_entry,
PTR data, bfd_vma data_start,
asection *input_section,
char **error_message));
 
enum bfd_reloc_code_real {
_dummy_first_bfd_reloc_code_real,
 
 
/* Basic absolute relocations of N bits. */
BFD_RELOC_64,
BFD_RELOC_32,
BFD_RELOC_26,
BFD_RELOC_24,
BFD_RELOC_16,
BFD_RELOC_14,
BFD_RELOC_8,
 
/* PC-relative relocations. Sometimes these are relative to the address
of the relocation itself; sometimes they are relative to the start of
the section containing the relocation. It depends on the specific target.
 
The 24-bit relocation is used in some Intel 960 configurations. */
BFD_RELOC_64_PCREL,
BFD_RELOC_32_PCREL,
BFD_RELOC_24_PCREL,
BFD_RELOC_16_PCREL,
BFD_RELOC_12_PCREL,
BFD_RELOC_8_PCREL,
 
/* For ELF. */
BFD_RELOC_32_GOT_PCREL,
BFD_RELOC_16_GOT_PCREL,
BFD_RELOC_8_GOT_PCREL,
BFD_RELOC_32_GOTOFF,
BFD_RELOC_16_GOTOFF,
BFD_RELOC_LO16_GOTOFF,
BFD_RELOC_HI16_GOTOFF,
BFD_RELOC_HI16_S_GOTOFF,
BFD_RELOC_8_GOTOFF,
BFD_RELOC_32_PLT_PCREL,
BFD_RELOC_24_PLT_PCREL,
BFD_RELOC_16_PLT_PCREL,
BFD_RELOC_8_PLT_PCREL,
BFD_RELOC_32_PLTOFF,
BFD_RELOC_16_PLTOFF,
BFD_RELOC_LO16_PLTOFF,
BFD_RELOC_HI16_PLTOFF,
BFD_RELOC_HI16_S_PLTOFF,
BFD_RELOC_8_PLTOFF,
 
/* Relocations used by 68K ELF. */
BFD_RELOC_68K_GLOB_DAT,
BFD_RELOC_68K_JMP_SLOT,
BFD_RELOC_68K_RELATIVE,
 
/* Linkage-table relative. */
BFD_RELOC_32_BASEREL,
BFD_RELOC_16_BASEREL,
BFD_RELOC_LO16_BASEREL,
BFD_RELOC_HI16_BASEREL,
BFD_RELOC_HI16_S_BASEREL,
BFD_RELOC_8_BASEREL,
BFD_RELOC_RVA,
 
/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
BFD_RELOC_8_FFnn,
 
/* These PC-relative relocations are stored as word displacements --
i.e., byte displacements shifted right two bits. The 30-bit word
displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
signed 16-bit displacement is used on the MIPS, and the 23-bit
displacement is used on the Alpha. */
BFD_RELOC_32_PCREL_S2,
BFD_RELOC_16_PCREL_S2,
BFD_RELOC_23_PCREL_S2,
 
/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
the target word. These are used on the SPARC. */
BFD_RELOC_HI22,
BFD_RELOC_LO10,
 
/* For systems that allocate a Global Pointer register, these are
displacements off that register. These relocation types are
handled specially, because the value the register will have is
decided relatively late. */
BFD_RELOC_GPREL16,
BFD_RELOC_GPREL32,
 
/* Reloc types used for i960/b.out. */
BFD_RELOC_I960_CALLJ,
 
/* SPARC ELF relocations. There is probably some overlap with other
relocation types already defined. */
BFD_RELOC_NONE,
BFD_RELOC_SPARC_WDISP22,
BFD_RELOC_SPARC22,
BFD_RELOC_SPARC13,
BFD_RELOC_SPARC_GOT10,
BFD_RELOC_SPARC_GOT13,
BFD_RELOC_SPARC_GOT22,
BFD_RELOC_SPARC_PC10,
BFD_RELOC_SPARC_PC22,
BFD_RELOC_SPARC_WPLT30,
BFD_RELOC_SPARC_COPY,
BFD_RELOC_SPARC_GLOB_DAT,
BFD_RELOC_SPARC_JMP_SLOT,
BFD_RELOC_SPARC_RELATIVE,
BFD_RELOC_SPARC_UA32,
 
/* I think these are specific to SPARC a.out (e.g., Sun 4). */
BFD_RELOC_SPARC_BASE13,
BFD_RELOC_SPARC_BASE22,
 
/* SPARC64 relocations */
#define BFD_RELOC_SPARC_64 BFD_RELOC_64
BFD_RELOC_SPARC_10,
BFD_RELOC_SPARC_11,
BFD_RELOC_SPARC_OLO10,
BFD_RELOC_SPARC_HH22,
BFD_RELOC_SPARC_HM10,
BFD_RELOC_SPARC_LM22,
BFD_RELOC_SPARC_PC_HH22,
BFD_RELOC_SPARC_PC_HM10,
BFD_RELOC_SPARC_PC_LM22,
BFD_RELOC_SPARC_WDISP16,
BFD_RELOC_SPARC_WDISP19,
BFD_RELOC_SPARC_7,
BFD_RELOC_SPARC_6,
BFD_RELOC_SPARC_5,
#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
BFD_RELOC_SPARC_PLT64,
BFD_RELOC_SPARC_HIX22,
BFD_RELOC_SPARC_LOX10,
BFD_RELOC_SPARC_H44,
BFD_RELOC_SPARC_M44,
BFD_RELOC_SPARC_L44,
BFD_RELOC_SPARC_REGISTER,
 
/* SPARC little endian relocation */
BFD_RELOC_SPARC_REV32,
 
/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
"addend" in some special way.
For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
writing; when reading, it will be the absolute section symbol. The
addend is the displacement in bytes of the "lda" instruction from
the "ldah" instruction (which is at the address of this reloc). */
BFD_RELOC_ALPHA_GPDISP_HI16,
 
/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
with GPDISP_HI16 relocs. The addend is ignored when writing the
relocations out, and is filled in with the file's GP value on
reading, for convenience. */
BFD_RELOC_ALPHA_GPDISP_LO16,
 
/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
relocation except that there is no accompanying GPDISP_LO16
relocation. */
BFD_RELOC_ALPHA_GPDISP,
 
/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
the assembler turns it into a LDQ instruction to load the address of
the symbol, and then fills in a register in the real instruction.
 
The LITERAL reloc, at the LDQ instruction, refers to the .lita
section symbol. The addend is ignored when writing, but is filled
in with the file's GP value on reading, for convenience, as with the
GPDISP_LO16 reloc.
 
The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
It should refer to the symbol to be referenced, as with 16_GOTOFF,
but it generates output not based on the position within the .got
section, but relative to the GP value chosen for the file during the
final link stage.
 
The LITUSE reloc, on the instruction using the loaded address, gives
information to the linker that it might be able to use to optimize
away some literal section references. The symbol is ignored (read
as the absolute section symbol), and the "addend" indicates the type
of instruction using the register:
1 - "memory" fmt insn
2 - byte-manipulation (byte offset reg)
3 - jsr (target of branch)
 
The GNU linker currently doesn't do any of this optimizing. */
BFD_RELOC_ALPHA_LITERAL,
BFD_RELOC_ALPHA_ELF_LITERAL,
BFD_RELOC_ALPHA_LITUSE,
 
/* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to
process the explicit !<reloc>!sequence relocations, and are mapped
into the normal relocations at the end of processing. */
BFD_RELOC_ALPHA_USER_LITERAL,
BFD_RELOC_ALPHA_USER_LITUSE_BASE,
BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF,
BFD_RELOC_ALPHA_USER_LITUSE_JSR,
BFD_RELOC_ALPHA_USER_GPDISP,
BFD_RELOC_ALPHA_USER_GPRELHIGH,
BFD_RELOC_ALPHA_USER_GPRELLOW,
 
/* The HINT relocation indicates a value that should be filled into the
"hint" field of a jmp/jsr/ret instruction, for possible branch-
prediction logic which may be provided on some processors. */
BFD_RELOC_ALPHA_HINT,
 
/* The LINKAGE relocation outputs a linkage pair in the object file,
which is filled by the linker. */
BFD_RELOC_ALPHA_LINKAGE,
 
/* The CODEADDR relocation outputs a STO_CA in the object file,
which is filled by the linker. */
BFD_RELOC_ALPHA_CODEADDR,
 
/* Bits 27..2 of the relocation address shifted right 2 bits;
simple reloc otherwise. */
BFD_RELOC_MIPS_JMP,
 
/* The MIPS16 jump instruction. */
BFD_RELOC_MIPS16_JMP,
 
/* MIPS16 GP relative reloc. */
BFD_RELOC_MIPS16_GPREL,
 
/* High 16 bits of 32-bit value; simple reloc. */
BFD_RELOC_HI16,
 
/* High 16 bits of 32-bit value but the low 16 bits will be sign
extended and added to form the final result. If the low 16
bits form a negative number, we need to add one to the high value
to compensate for the borrow when the low bits are added. */
BFD_RELOC_HI16_S,
 
/* Low 16 bits. */
BFD_RELOC_LO16,
 
/* Like BFD_RELOC_HI16_S, but PC relative. */
BFD_RELOC_PCREL_HI16_S,
 
/* Like BFD_RELOC_LO16, but PC relative. */
BFD_RELOC_PCREL_LO16,
 
/* Relocation relative to the global pointer. */
#define BFD_RELOC_MIPS_GPREL BFD_RELOC_GPREL16
 
/* Relocation against a MIPS literal section. */
BFD_RELOC_MIPS_LITERAL,
 
/* MIPS ELF relocations. */
BFD_RELOC_MIPS_GOT16,
BFD_RELOC_MIPS_CALL16,
#define BFD_RELOC_MIPS_GPREL32 BFD_RELOC_GPREL32
BFD_RELOC_MIPS_GOT_HI16,
BFD_RELOC_MIPS_GOT_LO16,
BFD_RELOC_MIPS_CALL_HI16,
BFD_RELOC_MIPS_CALL_LO16,
BFD_RELOC_MIPS_SUB,
BFD_RELOC_MIPS_GOT_PAGE,
BFD_RELOC_MIPS_GOT_OFST,
BFD_RELOC_MIPS_GOT_DISP,
 
 
/* i386/elf relocations */
BFD_RELOC_386_GOT32,
BFD_RELOC_386_PLT32,
BFD_RELOC_386_COPY,
BFD_RELOC_386_GLOB_DAT,
BFD_RELOC_386_JUMP_SLOT,
BFD_RELOC_386_RELATIVE,
BFD_RELOC_386_GOTOFF,
BFD_RELOC_386_GOTPC,
 
/* x86-64/elf relocations */
BFD_RELOC_X86_64_GOT32,
BFD_RELOC_X86_64_PLT32,
BFD_RELOC_X86_64_COPY,
BFD_RELOC_X86_64_GLOB_DAT,
BFD_RELOC_X86_64_JUMP_SLOT,
BFD_RELOC_X86_64_RELATIVE,
BFD_RELOC_X86_64_GOTPCREL,
BFD_RELOC_X86_64_32S,
 
/* ns32k relocations */
BFD_RELOC_NS32K_IMM_8,
BFD_RELOC_NS32K_IMM_16,
BFD_RELOC_NS32K_IMM_32,
BFD_RELOC_NS32K_IMM_8_PCREL,
BFD_RELOC_NS32K_IMM_16_PCREL,
BFD_RELOC_NS32K_IMM_32_PCREL,
BFD_RELOC_NS32K_DISP_8,
BFD_RELOC_NS32K_DISP_16,
BFD_RELOC_NS32K_DISP_32,
BFD_RELOC_NS32K_DISP_8_PCREL,
BFD_RELOC_NS32K_DISP_16_PCREL,
BFD_RELOC_NS32K_DISP_32_PCREL,
 
/* PDP11 relocations */
BFD_RELOC_PDP11_DISP_8_PCREL,
BFD_RELOC_PDP11_DISP_6_PCREL,
 
/* Picojava relocs. Not all of these appear in object files. */
BFD_RELOC_PJ_CODE_HI16,
BFD_RELOC_PJ_CODE_LO16,
BFD_RELOC_PJ_CODE_DIR16,
BFD_RELOC_PJ_CODE_DIR32,
BFD_RELOC_PJ_CODE_REL16,
BFD_RELOC_PJ_CODE_REL32,
 
/* Power(rs6000) and PowerPC relocations. */
BFD_RELOC_PPC_B26,
BFD_RELOC_PPC_BA26,
BFD_RELOC_PPC_TOC16,
BFD_RELOC_PPC_B16,
BFD_RELOC_PPC_B16_BRTAKEN,
BFD_RELOC_PPC_B16_BRNTAKEN,
BFD_RELOC_PPC_BA16,
BFD_RELOC_PPC_BA16_BRTAKEN,
BFD_RELOC_PPC_BA16_BRNTAKEN,
BFD_RELOC_PPC_COPY,
BFD_RELOC_PPC_GLOB_DAT,
BFD_RELOC_PPC_JMP_SLOT,
BFD_RELOC_PPC_RELATIVE,
BFD_RELOC_PPC_LOCAL24PC,
BFD_RELOC_PPC_EMB_NADDR32,
BFD_RELOC_PPC_EMB_NADDR16,
BFD_RELOC_PPC_EMB_NADDR16_LO,
BFD_RELOC_PPC_EMB_NADDR16_HI,
BFD_RELOC_PPC_EMB_NADDR16_HA,
BFD_RELOC_PPC_EMB_SDAI16,
BFD_RELOC_PPC_EMB_SDA2I16,
BFD_RELOC_PPC_EMB_SDA2REL,
BFD_RELOC_PPC_EMB_SDA21,
BFD_RELOC_PPC_EMB_MRKREF,
BFD_RELOC_PPC_EMB_RELSEC16,
BFD_RELOC_PPC_EMB_RELST_LO,
BFD_RELOC_PPC_EMB_RELST_HI,
BFD_RELOC_PPC_EMB_RELST_HA,
BFD_RELOC_PPC_EMB_BIT_FLD,
BFD_RELOC_PPC_EMB_RELSDA,
 
/* IBM 370/390 relocations */
BFD_RELOC_I370_D12,
 
/* The type of reloc used to build a contructor table - at the moment
probably a 32 bit wide absolute relocation, but the target can choose.
It generally does map to one of the other relocation types. */
BFD_RELOC_CTOR,
 
/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
not stored in the instruction. */
BFD_RELOC_ARM_PCREL_BRANCH,
 
/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
not stored in the instruction. The 2nd lowest bit comes from a 1 bit
field in the instruction. */
BFD_RELOC_ARM_PCREL_BLX,
 
/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
not stored in the instruction. The 2nd lowest bit comes from a 1 bit
field in the instruction. */
BFD_RELOC_THUMB_PCREL_BLX,
 
/* These relocs are only used within the ARM assembler. They are not
(at present) written to any object files. */
BFD_RELOC_ARM_IMMEDIATE,
BFD_RELOC_ARM_ADRL_IMMEDIATE,
BFD_RELOC_ARM_OFFSET_IMM,
BFD_RELOC_ARM_SHIFT_IMM,
BFD_RELOC_ARM_SWI,
BFD_RELOC_ARM_MULTI,
BFD_RELOC_ARM_CP_OFF_IMM,
BFD_RELOC_ARM_ADR_IMM,
BFD_RELOC_ARM_LDR_IMM,
BFD_RELOC_ARM_LITERAL,
BFD_RELOC_ARM_IN_POOL,
BFD_RELOC_ARM_OFFSET_IMM8,
BFD_RELOC_ARM_HWLITERAL,
BFD_RELOC_ARM_THUMB_ADD,
BFD_RELOC_ARM_THUMB_IMM,
BFD_RELOC_ARM_THUMB_SHIFT,
BFD_RELOC_ARM_THUMB_OFFSET,
BFD_RELOC_ARM_GOT12,
BFD_RELOC_ARM_GOT32,
BFD_RELOC_ARM_JUMP_SLOT,
BFD_RELOC_ARM_COPY,
BFD_RELOC_ARM_GLOB_DAT,
BFD_RELOC_ARM_PLT32,
BFD_RELOC_ARM_RELATIVE,
BFD_RELOC_ARM_GOTOFF,
BFD_RELOC_ARM_GOTPC,
 
/* Hitachi SH relocs. Not all of these appear in object files. */
BFD_RELOC_SH_PCDISP8BY2,
BFD_RELOC_SH_PCDISP12BY2,
BFD_RELOC_SH_IMM4,
BFD_RELOC_SH_IMM4BY2,
BFD_RELOC_SH_IMM4BY4,
BFD_RELOC_SH_IMM8,
BFD_RELOC_SH_IMM8BY2,
BFD_RELOC_SH_IMM8BY4,
BFD_RELOC_SH_PCRELIMM8BY2,
BFD_RELOC_SH_PCRELIMM8BY4,
BFD_RELOC_SH_SWITCH16,
BFD_RELOC_SH_SWITCH32,
BFD_RELOC_SH_USES,
BFD_RELOC_SH_COUNT,
BFD_RELOC_SH_ALIGN,
BFD_RELOC_SH_CODE,
BFD_RELOC_SH_DATA,
BFD_RELOC_SH_LABEL,
BFD_RELOC_SH_LOOP_START,
BFD_RELOC_SH_LOOP_END,
BFD_RELOC_SH_COPY,
BFD_RELOC_SH_GLOB_DAT,
BFD_RELOC_SH_JMP_SLOT,
BFD_RELOC_SH_RELATIVE,
BFD_RELOC_SH_GOTPC,
 
/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
be zero and is not stored in the instruction. */
BFD_RELOC_THUMB_PCREL_BRANCH9,
BFD_RELOC_THUMB_PCREL_BRANCH12,
BFD_RELOC_THUMB_PCREL_BRANCH23,
 
/* ARC Cores relocs.
ARC 22 bit pc-relative branch. The lowest two bits must be zero and are
not stored in the instruction. The high 20 bits are installed in bits 26
through 7 of the instruction. */
BFD_RELOC_ARC_B22_PCREL,
 
/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not
stored in the instruction. The high 24 bits are installed in bits 23
through 0. */
BFD_RELOC_ARC_B26,
 
/* Mitsubishi D10V relocs.
This is a 10-bit reloc with the right 2 bits
assumed to be 0. */
BFD_RELOC_D10V_10_PCREL_R,
 
/* Mitsubishi D10V relocs.
This is a 10-bit reloc with the right 2 bits
assumed to be 0. This is the same as the previous reloc
except it is in the left container, i.e.,
shifted left 15 bits. */
BFD_RELOC_D10V_10_PCREL_L,
 
/* This is an 18-bit reloc with the right 2 bits
assumed to be 0. */
BFD_RELOC_D10V_18,
 
/* This is an 18-bit reloc with the right 2 bits
assumed to be 0. */
BFD_RELOC_D10V_18_PCREL,
 
/* Mitsubishi D30V relocs.
This is a 6-bit absolute reloc. */
BFD_RELOC_D30V_6,
 
/* This is a 6-bit pc-relative reloc with
the right 3 bits assumed to be 0. */
BFD_RELOC_D30V_9_PCREL,
 
/* This is a 6-bit pc-relative reloc with
the right 3 bits assumed to be 0. Same
as the previous reloc but on the right side
of the container. */
BFD_RELOC_D30V_9_PCREL_R,
 
/* This is a 12-bit absolute reloc with the
right 3 bitsassumed to be 0. */
BFD_RELOC_D30V_15,
 
/* This is a 12-bit pc-relative reloc with
the right 3 bits assumed to be 0. */
BFD_RELOC_D30V_15_PCREL,
 
/* This is a 12-bit pc-relative reloc with
the right 3 bits assumed to be 0. Same
as the previous reloc but on the right side
of the container. */
BFD_RELOC_D30V_15_PCREL_R,
 
/* This is an 18-bit absolute reloc with
the right 3 bits assumed to be 0. */
BFD_RELOC_D30V_21,
 
/* This is an 18-bit pc-relative reloc with
the right 3 bits assumed to be 0. */
BFD_RELOC_D30V_21_PCREL,
 
/* This is an 18-bit pc-relative reloc with
the right 3 bits assumed to be 0. Same
as the previous reloc but on the right side
of the container. */
BFD_RELOC_D30V_21_PCREL_R,
 
/* This is a 32-bit absolute reloc. */
BFD_RELOC_D30V_32,
 
/* This is a 32-bit pc-relative reloc. */
BFD_RELOC_D30V_32_PCREL,
 
/* Mitsubishi M32R relocs.
This is a 24 bit absolute address. */
BFD_RELOC_M32R_24,
 
/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
BFD_RELOC_M32R_10_PCREL,
 
/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
BFD_RELOC_M32R_18_PCREL,
 
/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
BFD_RELOC_M32R_26_PCREL,
 
/* This is a 16-bit reloc containing the high 16 bits of an address
used when the lower 16 bits are treated as unsigned. */
BFD_RELOC_M32R_HI16_ULO,
 
/* This is a 16-bit reloc containing the high 16 bits of an address
used when the lower 16 bits are treated as signed. */
BFD_RELOC_M32R_HI16_SLO,
 
/* This is a 16-bit reloc containing the lower 16 bits of an address. */
BFD_RELOC_M32R_LO16,
 
/* This is a 16-bit reloc containing the small data area offset for use in
add3, load, and store instructions. */
BFD_RELOC_M32R_SDA16,
 
/* This is a 9-bit reloc */
BFD_RELOC_V850_9_PCREL,
 
/* This is a 22-bit reloc */
BFD_RELOC_V850_22_PCREL,
 
/* This is a 16 bit offset from the short data area pointer. */
BFD_RELOC_V850_SDA_16_16_OFFSET,
 
/* This is a 16 bit offset (of which only 15 bits are used) from the
short data area pointer. */
BFD_RELOC_V850_SDA_15_16_OFFSET,
 
/* This is a 16 bit offset from the zero data area pointer. */
BFD_RELOC_V850_ZDA_16_16_OFFSET,
 
/* This is a 16 bit offset (of which only 15 bits are used) from the
zero data area pointer. */
BFD_RELOC_V850_ZDA_15_16_OFFSET,
 
/* This is an 8 bit offset (of which only 6 bits are used) from the
tiny data area pointer. */
BFD_RELOC_V850_TDA_6_8_OFFSET,
 
/* This is an 8bit offset (of which only 7 bits are used) from the tiny
data area pointer. */
BFD_RELOC_V850_TDA_7_8_OFFSET,
 
/* This is a 7 bit offset from the tiny data area pointer. */
BFD_RELOC_V850_TDA_7_7_OFFSET,
 
/* This is a 16 bit offset from the tiny data area pointer. */
BFD_RELOC_V850_TDA_16_16_OFFSET,
 
/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
data area pointer. */
BFD_RELOC_V850_TDA_4_5_OFFSET,
 
/* This is a 4 bit offset from the tiny data area pointer. */
BFD_RELOC_V850_TDA_4_4_OFFSET,
 
/* This is a 16 bit offset from the short data area pointer, with the
bits placed non-contigously in the instruction. */
BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
 
/* This is a 16 bit offset from the zero data area pointer, with the
bits placed non-contigously in the instruction. */
BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
 
/* This is a 6 bit offset from the call table base pointer. */
BFD_RELOC_V850_CALLT_6_7_OFFSET,
 
/* This is a 16 bit offset from the call table base pointer. */
BFD_RELOC_V850_CALLT_16_16_OFFSET,
 
 
/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
instruction. */
BFD_RELOC_MN10300_32_PCREL,
 
/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
instruction. */
BFD_RELOC_MN10300_16_PCREL,
 
/* This is a 8bit DP reloc for the tms320c30, where the most
significant 8 bits of a 24 bit word are placed into the least
significant 8 bits of the opcode. */
BFD_RELOC_TIC30_LDP,
 
/* This is a 7bit reloc for the tms320c54x, where the least
significant 7 bits of a 16 bit word are placed into the least
significant 7 bits of the opcode. */
BFD_RELOC_TIC54X_PARTLS7,
 
/* This is a 9bit DP reloc for the tms320c54x, where the most
significant 9 bits of a 16 bit word are placed into the least
significant 9 bits of the opcode. */
BFD_RELOC_TIC54X_PARTMS9,
 
/* This is an extended address 23-bit reloc for the tms320c54x. */
BFD_RELOC_TIC54X_23,
 
/* This is a 16-bit reloc for the tms320c54x, where the least
significant 16 bits of a 23-bit extended address are placed into
the opcode. */
BFD_RELOC_TIC54X_16_OF_23,
 
/* This is a reloc for the tms320c54x, where the most
significant 7 bits of a 23-bit extended address are placed into
the opcode. */
BFD_RELOC_TIC54X_MS7_OF_23,
 
/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
BFD_RELOC_FR30_48,
 
/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
two sections. */
BFD_RELOC_FR30_20,
 
/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
4 bits. */
BFD_RELOC_FR30_6_IN_4,
 
/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
into 8 bits. */
BFD_RELOC_FR30_8_IN_8,
 
/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
into 8 bits. */
BFD_RELOC_FR30_9_IN_8,
 
/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
into 8 bits. */
BFD_RELOC_FR30_10_IN_8,
 
/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
short offset into 8 bits. */
BFD_RELOC_FR30_9_PCREL,
 
/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
short offset into 11 bits. */
BFD_RELOC_FR30_12_PCREL,
 
/* Motorola Mcore relocations. */
BFD_RELOC_MCORE_PCREL_IMM8BY4,
BFD_RELOC_MCORE_PCREL_IMM11BY2,
BFD_RELOC_MCORE_PCREL_IMM4BY2,
BFD_RELOC_MCORE_PCREL_32,
BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
BFD_RELOC_MCORE_RVA,
 
/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
short offset into 7 bits. */
BFD_RELOC_AVR_7_PCREL,
 
/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
short offset into 12 bits. */
BFD_RELOC_AVR_13_PCREL,
 
/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
program memory address) into 16 bits. */
BFD_RELOC_AVR_16_PM,
 
/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
data memory address) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_LO8_LDI,
 
/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
of data memory address) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_HI8_LDI,
 
/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
of program memory address) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_HH8_LDI,
 
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
(usually data memory address) into 8 bit immediate value of SUBI insn. */
BFD_RELOC_AVR_LO8_LDI_NEG,
 
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
(high 8 bit of data memory address) into 8 bit immediate value of
SUBI insn. */
BFD_RELOC_AVR_HI8_LDI_NEG,
 
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
(most high 8 bit of program memory address) into 8 bit immediate value
of LDI or SUBI insn. */
BFD_RELOC_AVR_HH8_LDI_NEG,
 
/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
command address) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_LO8_LDI_PM,
 
/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
of command address) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_HI8_LDI_PM,
 
/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
of command address) into 8 bit immediate value of LDI insn. */
BFD_RELOC_AVR_HH8_LDI_PM,
 
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
(usually command address) into 8 bit immediate value of SUBI insn. */
BFD_RELOC_AVR_LO8_LDI_PM_NEG,
 
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
(high 8 bit of 16 bit command address) into 8 bit immediate value
of SUBI insn. */
BFD_RELOC_AVR_HI8_LDI_PM_NEG,
 
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
(high 6 bit of 22 bit command address) into 8 bit immediate
value of SUBI insn. */
BFD_RELOC_AVR_HH8_LDI_PM_NEG,
 
/* This is a 32 bit reloc for the AVR that stores 23 bit value
into 22 bits. */
BFD_RELOC_AVR_CALL,
 
/* Direct 12 bit. */
BFD_RELOC_390_12,
 
/* 12 bit GOT offset. */
BFD_RELOC_390_GOT12,
 
/* 32 bit PC relative PLT address. */
BFD_RELOC_390_PLT32,
 
/* Copy symbol at runtime. */
BFD_RELOC_390_COPY,
 
/* Create GOT entry. */
BFD_RELOC_390_GLOB_DAT,
 
/* Create PLT entry. */
BFD_RELOC_390_JMP_SLOT,
 
/* Adjust by program base. */
BFD_RELOC_390_RELATIVE,
 
/* 32 bit PC relative offset to GOT. */
BFD_RELOC_390_GOTPC,
 
/* 16 bit GOT offset. */
BFD_RELOC_390_GOT16,
 
/* PC relative 16 bit shifted by 1. */
BFD_RELOC_390_PC16DBL,
 
/* 16 bit PC rel. PLT shifted by 1. */
BFD_RELOC_390_PLT16DBL,
 
/* PC relative 32 bit shifted by 1. */
BFD_RELOC_390_PC32DBL,
 
/* 32 bit PC rel. PLT shifted by 1. */
BFD_RELOC_390_PLT32DBL,
 
/* 32 bit PC rel. GOT shifted by 1. */
BFD_RELOC_390_GOTPCDBL,
 
/* 64 bit GOT offset. */
BFD_RELOC_390_GOT64,
 
/* 64 bit PC relative PLT address. */
BFD_RELOC_390_PLT64,
 
/* 32 bit rel. offset to GOT entry. */
BFD_RELOC_390_GOTENT,
 
/* These two relocations are used by the linker to determine which of
the entries in a C++ virtual function table are actually used. When
the --gc-sections option is given, the linker will zero out the entries
that are not used, so that the code for those functions need not be
included in the output.
 
VTABLE_INHERIT is a zero-space relocation used to describe to the
linker the inheritence tree of a C++ virtual function table. The
relocation's symbol should be the parent class' vtable, and the
relocation should be located at the child vtable.
 
VTABLE_ENTRY is a zero-space relocation that describes the use of a
virtual function table entry. The reloc's symbol should refer to the
table of the class mentioned in the code. Off of that base, an offset
describes the entry that is being used. For Rela hosts, this offset
is stored in the reloc's addend. For Rel hosts, we are forced to put
this offset in the reloc's section offset. */
BFD_RELOC_VTABLE_INHERIT,
BFD_RELOC_VTABLE_ENTRY,
 
/* Intel IA64 Relocations. */
BFD_RELOC_IA64_IMM14,
BFD_RELOC_IA64_IMM22,
BFD_RELOC_IA64_IMM64,
BFD_RELOC_IA64_DIR32MSB,
BFD_RELOC_IA64_DIR32LSB,
BFD_RELOC_IA64_DIR64MSB,
BFD_RELOC_IA64_DIR64LSB,
BFD_RELOC_IA64_GPREL22,
BFD_RELOC_IA64_GPREL64I,
BFD_RELOC_IA64_GPREL32MSB,
BFD_RELOC_IA64_GPREL32LSB,
BFD_RELOC_IA64_GPREL64MSB,
BFD_RELOC_IA64_GPREL64LSB,
BFD_RELOC_IA64_LTOFF22,
BFD_RELOC_IA64_LTOFF64I,
BFD_RELOC_IA64_PLTOFF22,
BFD_RELOC_IA64_PLTOFF64I,
BFD_RELOC_IA64_PLTOFF64MSB,
BFD_RELOC_IA64_PLTOFF64LSB,
BFD_RELOC_IA64_FPTR64I,
BFD_RELOC_IA64_FPTR32MSB,
BFD_RELOC_IA64_FPTR32LSB,
BFD_RELOC_IA64_FPTR64MSB,
BFD_RELOC_IA64_FPTR64LSB,
BFD_RELOC_IA64_PCREL21B,
BFD_RELOC_IA64_PCREL21BI,
BFD_RELOC_IA64_PCREL21M,
BFD_RELOC_IA64_PCREL21F,
BFD_RELOC_IA64_PCREL22,
BFD_RELOC_IA64_PCREL60B,
BFD_RELOC_IA64_PCREL64I,
BFD_RELOC_IA64_PCREL32MSB,
BFD_RELOC_IA64_PCREL32LSB,
BFD_RELOC_IA64_PCREL64MSB,
BFD_RELOC_IA64_PCREL64LSB,
BFD_RELOC_IA64_LTOFF_FPTR22,
BFD_RELOC_IA64_LTOFF_FPTR64I,
BFD_RELOC_IA64_LTOFF_FPTR64MSB,
BFD_RELOC_IA64_LTOFF_FPTR64LSB,
BFD_RELOC_IA64_SEGREL32MSB,
BFD_RELOC_IA64_SEGREL32LSB,
BFD_RELOC_IA64_SEGREL64MSB,
BFD_RELOC_IA64_SEGREL64LSB,
BFD_RELOC_IA64_SECREL32MSB,
BFD_RELOC_IA64_SECREL32LSB,
BFD_RELOC_IA64_SECREL64MSB,
BFD_RELOC_IA64_SECREL64LSB,
BFD_RELOC_IA64_REL32MSB,
BFD_RELOC_IA64_REL32LSB,
BFD_RELOC_IA64_REL64MSB,
BFD_RELOC_IA64_REL64LSB,
BFD_RELOC_IA64_LTV32MSB,
BFD_RELOC_IA64_LTV32LSB,
BFD_RELOC_IA64_LTV64MSB,
BFD_RELOC_IA64_LTV64LSB,
BFD_RELOC_IA64_IPLTMSB,
BFD_RELOC_IA64_IPLTLSB,
BFD_RELOC_IA64_COPY,
BFD_RELOC_IA64_TPREL22,
BFD_RELOC_IA64_TPREL64MSB,
BFD_RELOC_IA64_TPREL64LSB,
BFD_RELOC_IA64_LTOFF_TP22,
BFD_RELOC_IA64_LTOFF22X,
BFD_RELOC_IA64_LDXMOV,
 
/* Motorola 68HC11 reloc.
This is the 8 bits high part of an absolute address. */
BFD_RELOC_M68HC11_HI8,
 
/* Motorola 68HC11 reloc.
This is the 8 bits low part of an absolute address. */
BFD_RELOC_M68HC11_LO8,
 
/* Motorola 68HC11 reloc.
This is the 3 bits of a value. */
BFD_RELOC_M68HC11_3B,
 
/* These relocs are only used within the CRIS assembler. They are not
(at present) written to any object files. */
BFD_RELOC_CRIS_BDISP8,
BFD_RELOC_CRIS_UNSIGNED_5,
BFD_RELOC_CRIS_SIGNED_6,
BFD_RELOC_CRIS_UNSIGNED_6,
BFD_RELOC_CRIS_UNSIGNED_4,
 
/* Relocs used in ELF shared libraries for CRIS. */
BFD_RELOC_CRIS_COPY,
BFD_RELOC_CRIS_GLOB_DAT,
BFD_RELOC_CRIS_JUMP_SLOT,
BFD_RELOC_CRIS_RELATIVE,
 
/* 32-bit offset to symbol-entry within GOT. */
BFD_RELOC_CRIS_32_GOT,
 
/* 16-bit offset to symbol-entry within GOT. */
BFD_RELOC_CRIS_16_GOT,
 
/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
BFD_RELOC_CRIS_32_GOTPLT,
 
/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
BFD_RELOC_CRIS_16_GOTPLT,
 
/* 32-bit offset to symbol, relative to GOT. */
BFD_RELOC_CRIS_32_GOTREL,
 
/* 32-bit offset to symbol with PLT entry, relative to GOT. */
BFD_RELOC_CRIS_32_PLT_GOTREL,
 
/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
BFD_RELOC_CRIS_32_PLT_PCREL,
 
/* Intel i860 Relocations. */
BFD_RELOC_860_COPY,
BFD_RELOC_860_GLOB_DAT,
BFD_RELOC_860_JUMP_SLOT,
BFD_RELOC_860_RELATIVE,
BFD_RELOC_860_PC26,
BFD_RELOC_860_PLT26,
BFD_RELOC_860_PC16,
BFD_RELOC_860_LOW0,
BFD_RELOC_860_SPLIT0,
BFD_RELOC_860_LOW1,
BFD_RELOC_860_SPLIT1,
BFD_RELOC_860_LOW2,
BFD_RELOC_860_SPLIT2,
BFD_RELOC_860_LOW3,
BFD_RELOC_860_LOGOT0,
BFD_RELOC_860_SPGOT0,
BFD_RELOC_860_LOGOT1,
BFD_RELOC_860_SPGOT1,
BFD_RELOC_860_LOGOTOFF0,
BFD_RELOC_860_SPGOTOFF0,
BFD_RELOC_860_LOGOTOFF1,
BFD_RELOC_860_SPGOTOFF1,
BFD_RELOC_860_LOGOTOFF2,
BFD_RELOC_860_LOGOTOFF3,
BFD_RELOC_860_LOPC,
BFD_RELOC_860_HIGHADJ,
BFD_RELOC_860_HAGOT,
BFD_RELOC_860_HAGOTOFF,
BFD_RELOC_860_HAPC,
BFD_RELOC_860_HIGH,
BFD_RELOC_860_HIGOT,
BFD_RELOC_860_HIGOTOFF,
 
/* OpenRISC Relocations. */
BFD_RELOC_OPENRISC_ABS_26,
BFD_RELOC_OPENRISC_REL_26,
BFD_RELOC_UNUSED };
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
reloc_howto_type *
bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
 
const char *
bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code));
 
 
typedef struct symbol_cache_entry
{
/* A pointer to the BFD which owns the symbol. This information
is necessary so that a back end can work out what additional
information (invisible to the application writer) is carried
with the symbol.
 
This field is *almost* redundant, since you can use section->owner
instead, except that some symbols point to the global sections
bfd_{abs,com,und}_section. This could be fixed by making
these globals be per-bfd (or per-target-flavor). FIXME. */
 
struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
 
/* The text of the symbol. The name is left alone, and not copied; the
application may not alter it. */
CONST char *name;
 
/* The value of the symbol. This really should be a union of a
numeric value with a pointer, since some flags indicate that
a pointer to another symbol is stored here. */
symvalue value;
 
/* Attributes of a symbol: */
 
#define BSF_NO_FLAGS 0x00
 
/* The symbol has local scope; <<static>> in <<C>>. The value
is the offset into the section of the data. */
#define BSF_LOCAL 0x01
 
/* The symbol has global scope; initialized data in <<C>>. The
value is the offset into the section of the data. */
#define BSF_GLOBAL 0x02
 
/* The symbol has global scope and is exported. The value is
the offset into the section of the data. */
#define BSF_EXPORT BSF_GLOBAL /* no real difference */
 
/* A normal C symbol would be one of:
<<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
<<BSF_GLOBAL>> */
 
/* The symbol is a debugging record. The value has an arbitary
meaning, unless BSF_DEBUGGING_RELOC is also set. */
#define BSF_DEBUGGING 0x08
 
/* The symbol denotes a function entry point. Used in ELF,
perhaps others someday. */
#define BSF_FUNCTION 0x10
 
/* Used by the linker. */
#define BSF_KEEP 0x20
#define BSF_KEEP_G 0x40
 
/* A weak global symbol, overridable without warnings by
a regular global symbol of the same name. */
#define BSF_WEAK 0x80
 
/* This symbol was created to point to a section, e.g. ELF's
STT_SECTION symbols. */
#define BSF_SECTION_SYM 0x100
 
/* The symbol used to be a common symbol, but now it is
allocated. */
#define BSF_OLD_COMMON 0x200
 
/* The default value for common data. */
#define BFD_FORT_COMM_DEFAULT_VALUE 0
 
/* In some files the type of a symbol sometimes alters its
location in an output file - ie in coff a <<ISFCN>> symbol
which is also <<C_EXT>> symbol appears where it was
declared and not at the end of a section. This bit is set
by the target BFD part to convey this information. */
 
#define BSF_NOT_AT_END 0x400
 
/* Signal that the symbol is the label of constructor section. */
#define BSF_CONSTRUCTOR 0x800
 
/* Signal that the symbol is a warning symbol. The name is a
warning. The name of the next symbol is the one to warn about;
if a reference is made to a symbol with the same name as the next
symbol, a warning is issued by the linker. */
#define BSF_WARNING 0x1000
 
/* Signal that the symbol is indirect. This symbol is an indirect
pointer to the symbol with the same name as the next symbol. */
#define BSF_INDIRECT 0x2000
 
/* BSF_FILE marks symbols that contain a file name. This is used
for ELF STT_FILE symbols. */
#define BSF_FILE 0x4000
 
/* Symbol is from dynamic linking information. */
#define BSF_DYNAMIC 0x8000
 
/* The symbol denotes a data object. Used in ELF, and perhaps
others someday. */
#define BSF_OBJECT 0x10000
 
/* This symbol is a debugging symbol. The value is the offset
into the section of the data. BSF_DEBUGGING should be set
as well. */
#define BSF_DEBUGGING_RELOC 0x20000
 
flagword flags;
 
/* A pointer to the section to which this symbol is
relative. This will always be non NULL, there are special
sections for undefined and absolute symbols. */
struct sec *section;
 
/* Back end special data. */
union
{
PTR p;
bfd_vma i;
} udata;
 
} asymbol;
#define bfd_get_symtab_upper_bound(abfd) \
BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
boolean
bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym));
 
boolean
bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name));
 
#define bfd_is_local_label_name(abfd, name) \
BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
#define bfd_canonicalize_symtab(abfd, location) \
BFD_SEND (abfd, _bfd_canonicalize_symtab,\
(abfd, location))
boolean
bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count));
 
void
bfd_print_symbol_vandf PARAMS ((PTR file, asymbol *symbol));
 
#define bfd_make_empty_symbol(abfd) \
BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
#define bfd_make_debug_symbol(abfd,ptr,size) \
BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
int
bfd_decode_symclass PARAMS ((asymbol *symbol));
 
boolean
bfd_is_undefined_symclass PARAMS ((int symclass));
 
void
bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret));
 
boolean
bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym));
 
#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
(ibfd, isymbol, obfd, osymbol))
struct _bfd
{
/* The filename the application opened the BFD with. */
CONST char *filename;
 
/* A pointer to the target jump table. */
const struct bfd_target *xvec;
 
/* To avoid dragging too many header files into every file that
includes `<<bfd.h>>', IOSTREAM has been declared as a "char
*", and MTIME as a "long". Their correct types, to which they
are cast when used, are "FILE *" and "time_t". The iostream
is the result of an fopen on the filename. However, if the
BFD_IN_MEMORY flag is set, then iostream is actually a pointer
to a bfd_in_memory struct. */
PTR iostream;
 
/* Is the file descriptor being cached? That is, can it be closed as
needed, and re-opened when accessed later? */
 
boolean cacheable;
 
/* Marks whether there was a default target specified when the
BFD was opened. This is used to select which matching algorithm
to use to choose the back end. */
 
boolean target_defaulted;
 
/* The caching routines use these to maintain a
least-recently-used list of BFDs */
 
struct _bfd *lru_prev, *lru_next;
 
/* When a file is closed by the caching routines, BFD retains
state information on the file here: */
 
file_ptr where;
 
/* and here: (``once'' means at least once) */
 
boolean opened_once;
 
/* Set if we have a locally maintained mtime value, rather than
getting it from the file each time: */
 
boolean mtime_set;
 
/* File modified time, if mtime_set is true: */
 
long mtime;
 
/* Reserved for an unimplemented file locking extension.*/
 
int ifd;
 
/* The format which belongs to the BFD. (object, core, etc.) */
 
bfd_format format;
 
/* The direction the BFD was opened with*/
 
enum bfd_direction {no_direction = 0,
read_direction = 1,
write_direction = 2,
both_direction = 3} direction;
 
/* Format_specific flags*/
 
flagword flags;
 
/* Currently my_archive is tested before adding origin to
anything. I believe that this can become always an add of
origin, with origin set to 0 for non archive files. */
 
file_ptr origin;
 
/* Remember when output has begun, to stop strange things
from happening. */
boolean output_has_begun;
 
/* Pointer to linked list of sections*/
struct sec *sections;
 
/* The number of sections */
unsigned int section_count;
 
/* Stuff only useful for object files:
The start address. */
bfd_vma start_address;
 
/* Used for input and output*/
unsigned int symcount;
 
/* Symbol table for output BFD (with symcount entries) */
struct symbol_cache_entry **outsymbols;
 
/* Pointer to structure which contains architecture information*/
const struct bfd_arch_info *arch_info;
 
/* Stuff only useful for archives:*/
PTR arelt_data;
struct _bfd *my_archive; /* The containing archive BFD. */
struct _bfd *next; /* The next BFD in the archive. */
struct _bfd *archive_head; /* The first BFD in the archive. */
boolean has_armap;
 
/* A chain of BFD structures involved in a link. */
struct _bfd *link_next;
 
/* A field used by _bfd_generic_link_add_archive_symbols. This will
be used only for archive elements. */
int archive_pass;
 
/* Used by the back end to hold private data. */
 
union
{
struct aout_data_struct *aout_data;
struct artdata *aout_ar_data;
struct _oasys_data *oasys_obj_data;
struct _oasys_ar_data *oasys_ar_data;
struct coff_tdata *coff_obj_data;
struct pe_tdata *pe_obj_data;
struct xcoff_tdata *xcoff_obj_data;
struct ecoff_tdata *ecoff_obj_data;
struct ieee_data_struct *ieee_data;
struct ieee_ar_data_struct *ieee_ar_data;
struct srec_data_struct *srec_data;
struct ihex_data_struct *ihex_data;
struct tekhex_data_struct *tekhex_data;
struct elf_obj_tdata *elf_obj_data;
struct nlm_obj_tdata *nlm_obj_data;
struct bout_data_struct *bout_data;
struct sun_core_struct *sun_core_data;
struct sco5_core_struct *sco5_core_data;
struct trad_core_struct *trad_core_data;
struct som_data_struct *som_data;
struct hpux_core_struct *hpux_core_data;
struct hppabsd_core_struct *hppabsd_core_data;
struct sgi_core_struct *sgi_core_data;
struct lynx_core_struct *lynx_core_data;
struct osf_core_struct *osf_core_data;
struct cisco_core_struct *cisco_core_data;
struct versados_data_struct *versados_data;
struct netbsd_core_struct *netbsd_core_data;
PTR any;
} tdata;
 
/* Used by the application to hold private data*/
PTR usrdata;
 
/* Where all the allocated stuff under this BFD goes. This is a
struct objalloc *, but we use PTR to avoid requiring the inclusion of
objalloc.h. */
PTR memory;
};
 
typedef enum bfd_error
{
bfd_error_no_error = 0,
bfd_error_system_call,
bfd_error_invalid_target,
bfd_error_wrong_format,
bfd_error_invalid_operation,
bfd_error_no_memory,
bfd_error_no_symbols,
bfd_error_no_armap,
bfd_error_no_more_archived_files,
bfd_error_malformed_archive,
bfd_error_file_not_recognized,
bfd_error_file_ambiguously_recognized,
bfd_error_no_contents,
bfd_error_nonrepresentable_section,
bfd_error_no_debug_section,
bfd_error_bad_value,
bfd_error_file_truncated,
bfd_error_file_too_big,
bfd_error_invalid_error_code
} bfd_error_type;
 
bfd_error_type
bfd_get_error PARAMS ((void));
 
void
bfd_set_error PARAMS ((bfd_error_type error_tag));
 
CONST char *
bfd_errmsg PARAMS ((bfd_error_type error_tag));
 
void
bfd_perror PARAMS ((CONST char *message));
 
typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...));
 
bfd_error_handler_type
bfd_set_error_handler PARAMS ((bfd_error_handler_type));
 
void
bfd_set_error_program_name PARAMS ((const char *));
 
bfd_error_handler_type
bfd_get_error_handler PARAMS ((void));
 
long
bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect));
 
long
bfd_canonicalize_reloc PARAMS ((bfd *abfd,
asection *sec,
arelent **loc,
asymbol **syms));
 
void
bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count)
);
 
boolean
bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags));
 
int
bfd_get_arch_size PARAMS ((bfd *abfd));
 
int
bfd_get_sign_extend_vma PARAMS ((bfd *abfd));
 
boolean
bfd_set_start_address PARAMS ((bfd *abfd, bfd_vma vma));
 
long
bfd_get_mtime PARAMS ((bfd *abfd));
 
long
bfd_get_size PARAMS ((bfd *abfd));
 
int
bfd_get_gp_size PARAMS ((bfd *abfd));
 
void
bfd_set_gp_size PARAMS ((bfd *abfd, int i));
 
bfd_vma
bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base));
 
boolean
bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
 
#define bfd_copy_private_bfd_data(ibfd, obfd) \
BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
(ibfd, obfd))
boolean
bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
 
#define bfd_merge_private_bfd_data(ibfd, obfd) \
BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
(ibfd, obfd))
boolean
bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
 
#define bfd_set_private_flags(abfd, flags) \
BFD_SEND (abfd, _bfd_set_private_flags, \
(abfd, flags))
#define bfd_sizeof_headers(abfd, reloc) \
BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
 
#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))
 
/* Do these three do anything useful at all, for any back end? */
#define bfd_debug_info_start(abfd) \
BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
 
#define bfd_debug_info_end(abfd) \
BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
 
#define bfd_debug_info_accumulate(abfd, section) \
BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
 
 
#define bfd_stat_arch_elt(abfd, stat) \
BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
 
#define bfd_update_armap_timestamp(abfd) \
BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
 
#define bfd_set_arch_mach(abfd, arch, mach)\
BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
 
#define bfd_relax_section(abfd, section, link_info, again) \
BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
 
#define bfd_gc_sections(abfd, link_info) \
BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
 
#define bfd_merge_sections(abfd, link_info) \
BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
 
#define bfd_link_hash_table_create(abfd) \
BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
 
#define bfd_link_add_symbols(abfd, info) \
BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
 
#define bfd_final_link(abfd, info) \
BFD_SEND (abfd, _bfd_final_link, (abfd, info))
 
#define bfd_free_cached_info(abfd) \
BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
 
#define bfd_get_dynamic_symtab_upper_bound(abfd) \
BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
 
#define bfd_print_private_bfd_data(abfd, file)\
BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
 
#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
 
#define bfd_get_dynamic_reloc_upper_bound(abfd) \
BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
 
#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
 
extern bfd_byte *bfd_get_relocated_section_contents
PARAMS ((bfd *, struct bfd_link_info *,
struct bfd_link_order *, bfd_byte *,
boolean, asymbol **));
 
symindex
bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym));
 
boolean
bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head));
 
bfd *
bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous));
 
CONST char *
bfd_core_file_failing_command PARAMS ((bfd *abfd));
 
int
bfd_core_file_failing_signal PARAMS ((bfd *abfd));
 
boolean
core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd));
 
#define BFD_SEND(bfd, message, arglist) \
((*((bfd)->xvec->message)) arglist)
 
#ifdef DEBUG_BFD_SEND
#undef BFD_SEND
#define BFD_SEND(bfd, message, arglist) \
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
((*((bfd)->xvec->message)) arglist) : \
(bfd_assert (__FILE__,__LINE__), NULL))
#endif
#define BFD_SEND_FMT(bfd, message, arglist) \
(((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
 
#ifdef DEBUG_BFD_SEND
#undef BFD_SEND_FMT
#define BFD_SEND_FMT(bfd, message, arglist) \
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
(((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
(bfd_assert (__FILE__,__LINE__), NULL))
#endif
enum bfd_flavour {
bfd_target_unknown_flavour,
bfd_target_aout_flavour,
bfd_target_coff_flavour,
bfd_target_ecoff_flavour,
bfd_target_xcoff_flavour,
bfd_target_elf_flavour,
bfd_target_ieee_flavour,
bfd_target_nlm_flavour,
bfd_target_oasys_flavour,
bfd_target_tekhex_flavour,
bfd_target_srec_flavour,
bfd_target_ihex_flavour,
bfd_target_som_flavour,
bfd_target_os9k_flavour,
bfd_target_versados_flavour,
bfd_target_msdos_flavour,
bfd_target_ovax_flavour,
bfd_target_evax_flavour
};
 
enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
 
/* Forward declaration. */
typedef struct bfd_link_info _bfd_link_info;
 
typedef struct bfd_target
{
char *name;
enum bfd_flavour flavour;
enum bfd_endian byteorder;
enum bfd_endian header_byteorder;
flagword object_flags;
flagword section_flags;
char symbol_leading_char;
char ar_pad_char;
unsigned short ar_max_namelen;
bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *));
bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *));
void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *));
bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *));
void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));
bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *));
void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *));
bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *));
void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *));
bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *));
void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));
bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *));
void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
 
/* Generic entry points. */
#define BFD_JUMP_TABLE_GENERIC(NAME)\
CAT(NAME,_close_and_cleanup),\
CAT(NAME,_bfd_free_cached_info),\
CAT(NAME,_new_section_hook),\
CAT(NAME,_get_section_contents),\
CAT(NAME,_get_section_contents_in_window)
 
/* Called when the BFD is being closed to do any necessary cleanup. */
boolean (*_close_and_cleanup) PARAMS ((bfd *));
/* Ask the BFD to free all cached information. */
boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
/* Called when a new section is created. */
boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
/* Read the contents of a section. */
boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
file_ptr, bfd_size_type));
boolean (*_bfd_get_section_contents_in_window)
PARAMS ((bfd *, sec_ptr, bfd_window *,
file_ptr, bfd_size_type));
 
/* Entry points to copy private data. */
#define BFD_JUMP_TABLE_COPY(NAME)\
CAT(NAME,_bfd_copy_private_bfd_data),\
CAT(NAME,_bfd_merge_private_bfd_data),\
CAT(NAME,_bfd_copy_private_section_data),\
CAT(NAME,_bfd_copy_private_symbol_data),\
CAT(NAME,_bfd_set_private_flags),\
CAT(NAME,_bfd_print_private_bfd_data)\
/* Called to copy BFD general private data from one object file
to another. */
boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
/* Called to merge BFD general private data from one object file
to a common output file when linking. */
boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
/* Called to copy BFD private section data from one object file
to another. */
boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
bfd *, sec_ptr));
/* Called to copy BFD private symbol data from one symbol
to another. */
boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
bfd *, asymbol *));
/* Called to set private backend flags */
boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
 
/* Called to print private BFD data */
boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
 
/* Core file entry points. */
#define BFD_JUMP_TABLE_CORE(NAME)\
CAT(NAME,_core_file_failing_command),\
CAT(NAME,_core_file_failing_signal),\
CAT(NAME,_core_file_matches_executable_p)
char * (*_core_file_failing_command) PARAMS ((bfd *));
int (*_core_file_failing_signal) PARAMS ((bfd *));
boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
 
/* Archive entry points. */
#define BFD_JUMP_TABLE_ARCHIVE(NAME)\
CAT(NAME,_slurp_armap),\
CAT(NAME,_slurp_extended_name_table),\
CAT(NAME,_construct_extended_name_table),\
CAT(NAME,_truncate_arname),\
CAT(NAME,_write_armap),\
CAT(NAME,_read_ar_hdr),\
CAT(NAME,_openr_next_archived_file),\
CAT(NAME,_get_elt_at_index),\
CAT(NAME,_generic_stat_arch_elt),\
CAT(NAME,_update_armap_timestamp)
boolean (*_bfd_slurp_armap) PARAMS ((bfd *));
boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
boolean (*_bfd_construct_extended_name_table)
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *));
boolean (*write_armap) PARAMS ((bfd *arch,
unsigned int elength,
struct orl *map,
unsigned int orl_count,
int stridx));
PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));
bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i))
bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));
int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
 
/* Entry points used for symbols. */
#define BFD_JUMP_TABLE_SYMBOLS(NAME)\
CAT(NAME,_get_symtab_upper_bound),\
CAT(NAME,_get_symtab),\
CAT(NAME,_make_empty_symbol),\
CAT(NAME,_print_symbol),\
CAT(NAME,_get_symbol_info),\
CAT(NAME,_bfd_is_local_label_name),\
CAT(NAME,_get_lineno),\
CAT(NAME,_find_nearest_line),\
CAT(NAME,_bfd_make_debug_symbol),\
CAT(NAME,_read_minisymbols),\
CAT(NAME,_minisymbol_to_symbol)
long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));
long (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
struct symbol_cache_entry **));
struct symbol_cache_entry *
(*_bfd_make_empty_symbol) PARAMS ((bfd *));
void (*_bfd_print_symbol) PARAMS ((bfd *, PTR,
struct symbol_cache_entry *,
bfd_print_symbol_type));
#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e))
void (*_bfd_get_symbol_info) PARAMS ((bfd *,
struct symbol_cache_entry *,
symbol_info *));
#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
 
alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
struct sec *section, struct symbol_cache_entry **symbols,
bfd_vma offset, CONST char **file, CONST char **func,
unsigned int *line));
/* Back-door to allow format-aware applications to create debug symbols
while using BFD for everything else. Currently used by the assembler
when creating COFF files. */
asymbol * (*_bfd_make_debug_symbol) PARAMS ((
bfd *abfd,
void *ptr,
unsigned long size));
#define bfd_read_minisymbols(b, d, m, s) \
BFD_SEND (b, _read_minisymbols, (b, d, m, s))
long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,
unsigned int *));
#define bfd_minisymbol_to_symbol(b, d, m, f) \
BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,
asymbol *));
 
/* Routines for relocs. */
#define BFD_JUMP_TABLE_RELOCS(NAME)\
CAT(NAME,_get_reloc_upper_bound),\
CAT(NAME,_canonicalize_reloc),\
CAT(NAME,_bfd_reloc_type_lookup)
long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
struct symbol_cache_entry **));
/* See documentation on reloc types. */
reloc_howto_type *
(*reloc_type_lookup) PARAMS ((bfd *abfd,
bfd_reloc_code_real_type code));
 
/* Routines used when writing an object file. */
#define BFD_JUMP_TABLE_WRITE(NAME)\
CAT(NAME,_set_arch_mach),\
CAT(NAME,_set_section_contents)
boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,
unsigned long));
boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
file_ptr, bfd_size_type));
 
/* Routines used by the linker. */
#define BFD_JUMP_TABLE_LINK(NAME)\
CAT(NAME,_sizeof_headers),\
CAT(NAME,_bfd_get_relocated_section_contents),\
CAT(NAME,_bfd_relax_section),\
CAT(NAME,_bfd_link_hash_table_create),\
CAT(NAME,_bfd_link_add_symbols),\
CAT(NAME,_bfd_final_link),\
CAT(NAME,_bfd_link_split_section),\
CAT(NAME,_bfd_gc_sections),\
CAT(NAME,_bfd_merge_sections)
int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
struct bfd_link_info *, struct bfd_link_order *,
bfd_byte *data, boolean relocateable,
struct symbol_cache_entry **));
 
boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
struct bfd_link_info *, boolean *again));
 
/* Create a hash table for the linker. Different backends store
different information in this table. */
struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
 
/* Add symbols from this object file into the hash table. */
boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
 
/* Do a link based on the link_order structures attached to each
section of the BFD. */
boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
 
/* Should this section be split up into smaller pieces during linking. */
boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
 
/* Remove sections that are not referenced from the output. */
boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
 
/* Attempt to merge SEC_MERGE sections. */
boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *));
 
/* Routines to handle dynamic symbols and relocs. */
#define BFD_JUMP_TABLE_DYNAMIC(NAME)\
CAT(NAME,_get_dynamic_symtab_upper_bound),\
CAT(NAME,_canonicalize_dynamic_symtab),\
CAT(NAME,_get_dynamic_reloc_upper_bound),\
CAT(NAME,_canonicalize_dynamic_reloc)
/* Get the amount of memory required to hold the dynamic symbols. */
long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
/* Read in the dynamic symbols. */
long (*_bfd_canonicalize_dynamic_symtab)
PARAMS ((bfd *, struct symbol_cache_entry **));
/* Get the amount of memory required to hold the dynamic relocs. */
long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
/* Read in the dynamic relocs. */
long (*_bfd_canonicalize_dynamic_reloc)
PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
 
/* Opposite endian version of this target. */
const struct bfd_target * alternative_target;
 
PTR backend_data;
 
} bfd_target;
boolean
bfd_set_default_target PARAMS ((const char *name));
 
const bfd_target *
bfd_find_target PARAMS ((CONST char *target_name, bfd *abfd));
 
const char **
bfd_target_list PARAMS ((void));
 
const bfd_target *
bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *));
 
boolean
bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
 
boolean
bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching));
 
boolean
bfd_set_format PARAMS ((bfd *abfd, bfd_format format));
 
CONST char *
bfd_format_string PARAMS ((bfd_format format));
 
#ifdef __cplusplus
}
#endif
#endif
/contrib/media/updf/include/bio.h
0,0 → 1,125
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __BIO_H
#define __BIO_H
/**
@file bio.h
@brief Implementation of an individual bit input-output (BIO)
 
The functions in BIO.C have for goal to realize an individual bit input - output.
*/
 
/** @defgroup BIO BIO - Individual bit input-output stream */
/*@{*/
 
/**
Individual bit input-output stream (BIO)
*/
typedef struct opj_bio {
/** pointer to the start of the buffer */
unsigned char *start;
/** pointer to the end of the buffer */
unsigned char *end;
/** pointer to the present position in the buffer */
unsigned char *bp;
/** temporary place where each byte is read or written */
unsigned int buf;
/** coder : number of bits free to write. decoder : number of bits read */
int ct;
} opj_bio_t;
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Create a new BIO handle
@return Returns a new BIO handle if successful, returns NULL otherwise
*/
opj_bio_t* bio_create(void);
/**
Destroy a previously created BIO handle
@param bio BIO handle to destroy
*/
void bio_destroy(opj_bio_t *bio);
/**
Number of bytes written.
@param bio BIO handle
@return Returns the number of bytes written
*/
int bio_numbytes(opj_bio_t *bio);
/**
Init encoder
@param bio BIO handle
@param bp Output buffer
@param len Output buffer length
*/
void bio_init_enc(opj_bio_t *bio, unsigned char *bp, int len);
/**
Init decoder
@param bio BIO handle
@param bp Input buffer
@param len Input buffer length
*/
void bio_init_dec(opj_bio_t *bio, unsigned char *bp, int len);
/**
Write bits
@param bio BIO handle
@param v Value of bits
@param n Number of bits to write
*/
void bio_write(opj_bio_t *bio, int v, int n);
/**
Read bits
@param bio BIO handle
@param n Number of bits to read
@return Returns the corresponding read number
*/
int bio_read(opj_bio_t *bio, int n);
/**
Flush bits
@param bio BIO handle
@return Returns 1 if successful, returns 0 otherwise
*/
int bio_flush(opj_bio_t *bio);
/**
Passes the ending bits (coming from flushing)
@param bio BIO handle
@return Returns 1 if successful, returns 0 otherwise
*/
int bio_inalign(opj_bio_t *bio);
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __BIO_H */
 
/contrib/media/updf/include/bios.h
0,0 → 1,115
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_bios_h_
#define __dj_include_bios_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
int bioscom(int _cmd, char _data, int _port);
int biosdisk(int _cmd, int _drive, int _head, int _track, int _sector,
int _nsects, void *_buffer);
int biosequip(void);
int bioskey(int cmd);
int biosmemory(void);
int biosprint(int _cmd, int _byte, int _port);
long biostime(int _cmd, long _newtime);
 
/*
* For compatibility with other DOS C compilers.
*/
 
/* Disk parameters for _bios_disk() function. */
struct _diskinfo_t {
unsigned drive; /* Drive number. */
unsigned head; /* Head number. */
unsigned track; /* Track number. */
unsigned sector; /* Sector number. */
unsigned nsectors; /* Number of sectors to read/write/verify. */
void *buffer; /* Buffer for reading/writing/verifying. */
};
#define diskinfo_t _diskinfo_t
 
/* Constants for _bios_disk() function. */
#define _DISK_RESET 0 /* Reset disk controller. */
#define _DISK_STATUS 1 /* Get disk status. */
#define _DISK_READ 2 /* Read disk sectors. */
#define _DISK_WRITE 3 /* Write disk sectors. */
#define _DISK_VERIFY 4 /* Verify disk sectors. */
#define _DISK_FORMAT 5 /* Format disk track. */
 
/* Constants fot _bios_serialcom() function. */
#define _COM_INIT 0 /* Init serial port. */
#define _COM_SEND 1 /* Send character. */
#define _COM_RECEIVE 2 /* Receive character. */
#define _COM_STATUS 3 /* Get serial port status. */
 
#define _COM_CHR7 2 /* 7 bits characters. */
#define _COM_CHR8 3 /* 8 bits characters. */
 
#define _COM_STOP1 0 /* 1 stop bit. */
#define _COM_STOP2 4 /* 2 stop bits. */
 
#define _COM_NOPARITY 0 /* No parity. */
#define _COM_ODDPARITY 8 /* Odd parity. */
#define _COM_SPACEPARITY 16 /* Space parity. */
#define _COM_EVENPARITY 24 /* Even parity. */
 
#define _COM_110 0 /* 110 baud. */
#define _COM_150 32 /* 150 baud. */
#define _COM_300 64 /* 300 baud. */
#define _COM_600 96 /* 600 baud. */
#define _COM_1200 128 /* 1200 baud. */
#define _COM_2400 160 /* 2400 baud. */
#define _COM_4800 192 /* 4800 baud. */
#define _COM_9600 224 /* 9600 baud. */
 
/* Constants for _bios_keybrd() function. */
#define _KEYBRD_READ 0 /* Read character. */
#define _KEYBRD_READY 1 /* Check character. */
#define _KEYBRD_SHIFTSTATUS 2 /* Get shift status. */
 
#define _NKEYBRD_READ 0x10 /* Read extended character. */
#define _NKEYBRD_READY 0x11 /* Check extended character. */
#define _NKEYBRD_SHIFTSTATUS 0x12 /* Get exteded shift status. */
 
/* Constans for _bios_printer() function. */
#define _PRINTER_WRITE 0 /* Write character. */
#define _PRINTER_INIT 1 /* Initialize printer. */
#define _PRINTER_STATUS 2 /* Get printer status. */
 
/* Constants for _bios_timeofday() function. */
#define _TIME_GETCLOCK 0 /* Get current clock count. */
#define _TIME_SETCLOCK 1 /* Set current clock count. */
 
#define _bios_equiplist() ((unsigned)biosequip())
#define _bios_memsize() ((unsigned)biosmemory())
#define _bios_printer(_c, _p, _d) ((unsigned)biosprint(_c, _d, _p))
#define _bios_serialcom(_c, _p, _d) ((unsigned)bioscom(_c, _d, _p))
#define _bios_keybrd(_c) ((unsigned)bioskey(_c))
 
unsigned _bios_disk(unsigned _cmd, struct _diskinfo_t *_di);
unsigned _bios_timeofday(unsigned _cmd, unsigned long *_timeval);
 
/* For int86(), int86x() and union REGS. */
#include <dos.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_bios_h_ */
/contrib/media/updf/include/bits/basic_file.h
0,0 → 1,252
// Wrapper of C-language FILE struct -*- C++ -*-
 
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.8 File-based streams
//
 
#ifndef _CPP_BASIC_FILE
#define _CPP_BASIC_FILE 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
#include <bits/std_ios.h>
 
namespace std
{
// Ulrich is going to make some detailed comment here, explaining
// all this unpleasantness, providing detailed performance analysis
// as to why we have to do all this lame vtable hacking instead of a
// sane, function-based approach. This verbiage will provide a clear
// and detailed description of the whole object-layout,
// vtable-swapping, sordid history of this hack.
template<typename _CharT>
struct __basic_file_base: public __c_file_type
{
virtual
~__basic_file_base() { };
 
virtual int
overflow(int __c = EOF) = 0;
 
virtual int
underflow() = 0;
 
virtual int
uflow() = 0;
 
virtual int
pbackfail(int __c) = 0;
 
virtual streamsize
xsputn(const _CharT* __s, streamsize __n) = 0;
 
virtual streamsize
xsgetn(_CharT* __s, streamsize __n) = 0;
 
virtual streamoff
seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode = ios_base::in | ios_base::out) = 0;
 
virtual streamoff
seekpos(streamoff __pos,
ios_base::openmode __mode = ios_base::in | ios_base::out) = 0;
 
virtual streambuf*
setbuf(_CharT* __b, int __len) = 0;
 
virtual int
sync() = 0;
 
virtual int
doallocate() = 0;
 
virtual streamsize
sys_read(_CharT* __s, streamsize __n) = 0;
 
virtual streamsize
sys_write(const _CharT* __s, streamsize __n) = 0;
 
virtual streamoff
sys_seek(streamoff __off, ios_base::seekdir __way) = 0;
 
virtual int
sys_close() = 0;
 
virtual int
sys_stat(void* __v) = 0;
 
virtual int
showmanyc() = 0;
 
virtual void
imbue(void* __v) = 0;
};
 
// Some of these member functions are based on libio/filebuf.cc.
// Also note that the order and number of virtual functions has to precisely
// match the order and number in the _IO_jump_t struct defined in libioP.h.
template<typename _CharT>
#ifdef _GLIBCPP_BASIC_FILE_INHERITANCE
class __basic_file: public __basic_file_base<_CharT>
#else
class __basic_file
#endif
{
#if _GLIBCPP_BASIC_FILE_ENCAPSULATION
__c_file_type* _M_cfile;
bool _M_cfile_created;
#else
# ifdef _GLIBCPP_USE_WCHAR_T
__c_wfile_type _M_wfile;
# endif
#endif
 
public:
__basic_file(__c_lock* __lock = 0);
void
_M_open_mode(ios_base::openmode __mode, int& __p_mode, int& __rw_mode,
char* __c_mode);
// Equivalent to the normal fopen function.
__basic_file*
open(const char* __name, ios_base::openmode __mode, int __prot = 0664);
 
// Used for opening the standard streams, cin, cout, cerr, clog,
// and their wide-stream equivalents. Instead of calling open, it
// just sets __c_file_type->_fileno and the respective _flags bits, and
// returns.
__basic_file*
sys_open(__c_file_type* __file, ios_base::openmode __mode);
 
_CharT
sys_getc();
 
_CharT
sys_ungetc(_CharT);
 
__basic_file*
close();
 
bool
is_open();
 
// NB: Must match FILE specific jump table starting here--this
// means all virtual functions starting with the dtor must match,
// slot by slot. For glibc-based dystems, this means the _IO_FILE
// as the FILE struct and _IO_jump_t as the jump table.
virtual
~__basic_file(); // Takes the place of __finish.
 
virtual int
overflow(int __c = EOF);
 
virtual int
underflow();
 
virtual int
uflow();
 
virtual int
pbackfail(int __c);
 
// A complex "write" function that sets all of __c_file_type's
// pointers and associated data members correctly and manages its
// relation to the external byte sequence.
virtual streamsize
xsputn(const _CharT* __s, streamsize __n);
 
// A complex "read" function that sets all of __c_file_type's
// pointers and associated data members correctly and manages its
// relation to the external byte sequence.
virtual streamsize
xsgetn(_CharT* __s, streamsize __n);
 
// A complex "seekoff" function that sets all of __c_file_type's
// pointers and associated data members correctly and manages its
// relation to the external byte sequence.
virtual streamoff
seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode = ios_base::in | ios_base::out);
 
// A complex "seekpos" function that sets all of __c_file_type's
// pointers and associated data members correctly and manages its
// relation to the external byte sequence.
virtual streamoff
seekpos(streamoff __pos,
ios_base::openmode __mode = ios_base::in | ios_base::out);
 
virtual streambuf*
setbuf(_CharT* __b, int __len);
 
virtual int
sync();
 
virtual int
doallocate();
 
// A simple read function for the external byte sequence, that
// does no mucking around with or setting of the pointers or flags
// in __c_file_type.
virtual streamsize
sys_read(_CharT* __s, streamsize __n);
 
// A simple write function for the external byte sequence, that
// does no mucking around with or setting of the pointers or flags
// in __c_file_type.
virtual streamsize
sys_write(const _CharT* __s, streamsize __n);
 
// A simple seek function for the external byte sequence, that
// does no mucking around with or setting of the pointers or flags
// in __c_file_type.
virtual streamoff
sys_seek(streamoff __off, ios_base::seekdir __way);
 
virtual int
sys_close();
 
virtual int
sys_stat(void* __v);
 
virtual int
showmanyc();
 
virtual void
imbue(void* __v);
};
} // namespace std
 
// Now include the bits that are dependant on the underlying I/O
// model chosen at configure time.
#include <bits/basic_file_model.h>
 
#endif // _CPP_BASIC_FILE
/contrib/media/updf/include/bits/basic_ios.h
0,0 → 1,218
// Iostreams base classes -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BITS_BASICIOS_H
#define _CPP_BITS_BASICIOS_H 1
 
#pragma GCC system_header
 
#include <bits/sbuf_iter.h>
#include <bits/locale_facets.h>
 
namespace std
{
// 27.4.5 Template class basic_ios
template<typename _CharT, typename _Traits>
class basic_ios : public ios_base
{
public:
// Types:
typedef _CharT char_type;
typedef typename _Traits::int_type int_type;
typedef typename _Traits::pos_type pos_type;
typedef typename _Traits::off_type off_type;
typedef _Traits traits_type;
 
// Non-standard Types:
typedef ctype<_CharT> __ctype_type;
typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter;
typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter;
typedef num_get<_CharT, __istreambuf_iter> __numget_type;
// Data members:
private:
basic_ostream<_CharT, _Traits>* _M_tie;
char_type _M_fill;
iostate _M_exception;
 
protected:
basic_streambuf<_CharT, _Traits>* _M_streambuf;
iostate _M_streambuf_state;
 
// Cached use_facet<ctype>, which is based on the current locale info.
const __ctype_type* _M_ios_fctype;
// From ostream.
const __numput_type* _M_fnumput;
// From istream.
const __numget_type* _M_fnumget;
 
public:
inline const __ctype_type*
_M_get_fctype_ios(void)
{ return _M_ios_fctype; }
 
operator void*() const
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
 
inline bool
operator!() const
{ return this->fail(); }
 
inline iostate
rdstate() const
{ return _M_streambuf_state; }
 
inline void
clear(iostate __state = goodbit)
{
if (this->rdbuf())
_M_streambuf_state = __state;
else
_M_streambuf_state = __state | badbit;
if ((this->rdstate() & this->exceptions()))
__throw_ios_failure("basic_ios::clear(iostate) caused exception");
}
 
inline void
setstate(iostate __state)
{ this->clear(this->rdstate() | __state); }
 
inline bool
good() const
{ return this->rdstate() == 0; }
 
inline bool
eof() const
{ return (this->rdstate() & eofbit) != 0; }
 
inline bool
fail() const
{ return (this->rdstate() & (badbit | failbit)) != 0; }
 
inline bool
bad() const
{ return (this->rdstate() & badbit) != 0; }
 
inline iostate
exceptions() const
{ return _M_exception; }
 
inline void
exceptions(iostate __except)
{
_M_exception = __except;
this->clear(_M_streambuf_state);
}
 
// Constructor/destructor:
explicit
basic_ios(basic_streambuf<_CharT, _Traits>* __sb) : ios_base()
{ this->init(__sb); }
 
virtual
~basic_ios() { }
// Members:
inline basic_ostream<_CharT, _Traits>*
tie() const
{ return _M_tie; }
 
inline basic_ostream<_CharT, _Traits>*
tie(basic_ostream<_CharT, _Traits>* __tiestr)
{
basic_ostream<_CharT, _Traits>* __old = _M_tie;
_M_tie = __tiestr;
return __old;
}
 
inline basic_streambuf<_CharT, _Traits>*
rdbuf() const
{ return _M_streambuf; }
 
basic_streambuf<_CharT, _Traits>*
rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
 
basic_ios&
copyfmt(const basic_ios& __rhs);
 
inline char_type
fill() const
{ return _M_fill; }
 
inline char_type
fill(char_type __ch)
{
char_type __old = _M_fill;
_M_fill = __ch;
return __old;
}
 
// Locales:
locale
imbue(const locale& __loc);
 
char
narrow(char_type __c, char __dfault) const;
 
char_type
widen(char __c) const;
protected:
// 27.4.5.1 basic_ios constructors
basic_ios() : ios_base()
{ }
 
void
init(basic_streambuf<_CharT, _Traits>* __sb);
 
bool
_M_check_facet(const locale::facet* __f)
{
bool __ret = false;
if (__f)
__ret = true;
else
__throw_bad_cast();
return __ret;
}
 
void
_M_cache_facets(const locale& __loc);
};
} // namespace std
 
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#include <bits/basic_ios.tcc>
#endif
 
#endif /* _CPP_BITS_BASICIOS_H */
 
 
/contrib/media/updf/include/bits/basic_ios.tcc
0,0 → 1,145
// basic_ios locale and locale-related member functions -*- C++ -*-
 
// Copyright (C) 1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BITS_BASICIOS_TCC
#define _CPP_BITS_BASICIOS_TCC 1
 
namespace std
{
template<typename _CharT, typename _Traits>
basic_streambuf<_CharT, _Traits>*
basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
{
basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
_M_streambuf = __sb;
this->clear();
return __old;
}
 
template<typename _CharT, typename _Traits>
basic_ios<_CharT, _Traits>&
basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
{
// Per 27.1.1.1, do not call imbue, yet must trash all caches
// associated with imbue()
 
// Alloc any new word array first, so if it fails we have "rollback".
_Words* __words = (__rhs._M_word_limit <= _S_local_words) ?
_M_word_array : new _Words[__rhs._M_word_limit];
 
// XXX This is the only reason _Callback_list was defined
// inline. The suspicion is that this increased compilation
// times dramatically for functions that use this member
// function (inserters_extractors, ios_manip_fmtflags). FIX ME,
// clean this stuff up. Callbacks are broken right now, anyway.
 
// Bump refs before doing callbacks, for safety.
_Callback_list* __cb = __rhs._M_callbacks;
if (__cb)
__cb->_M_add_reference();
_M_call_callbacks(erase_event);
if (_M_words != _M_word_array)
delete [] _M_words;
_M_dispose_callbacks();
 
_M_callbacks = __cb; // NB: Don't want any added during above.
for (int __i = 0; __i < __rhs._M_word_limit; ++__i)
__words[__i] = __rhs._M_words[__i];
if (_M_words != _M_word_array)
delete [] _M_words;
_M_words = __words;
_M_word_limit = __rhs._M_word_limit;
 
this->flags(__rhs.flags());
this->width(__rhs.width());
this->precision(__rhs.precision());
this->tie(__rhs.tie());
this->fill(__rhs.fill());
// The next is required to be the last assignment.
this->exceptions(__rhs.exceptions());
_M_call_callbacks(copyfmt_event);
return *this;
}
 
template<typename _CharT, typename _Traits>
char
basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
{ return _M_ios_fctype->narrow(__c, __dfault); }
 
template<typename _CharT, typename _Traits>
_CharT
basic_ios<_CharT, _Traits>::widen(char __c) const
{ return _M_ios_fctype->widen(__c); }
 
// Locales:
template<typename _CharT, typename _Traits>
locale
basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
{
locale __old(this->getloc());
ios_base::imbue(__loc);
_M_cache_facets(__loc);
if (this->rdbuf() != 0)
this->rdbuf()->pubimbue(__loc);
return __old;
}
 
template<typename _CharT, typename _Traits>
void
basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
{
// NB: This may be called more than once on the same object.
ios_base::_M_init();
_M_cache_facets(_M_ios_locale);
_M_tie = 0;
_M_fill = this->widen(' ');
_M_exception = goodbit;
_M_streambuf = __sb;
_M_streambuf_state = __sb ? goodbit : badbit;
}
 
template<typename _CharT, typename _Traits>
void
basic_ios<_CharT, _Traits>::_M_cache_facets(const locale& __loc)
{
if (has_facet<__ctype_type>(__loc))
_M_ios_fctype = &use_facet<__ctype_type>(__loc);
// Should be filled in by ostream and istream, respectively.
if (has_facet<__numput_type>(__loc))
_M_fnumput = &use_facet<__numput_type>(__loc);
if (has_facet<__numget_type>(__loc))
_M_fnumget = &use_facet<__numget_type>(__loc);
}
} // namespace std
 
#endif // _CPP_BITS_BASICIOS_TCC
 
 
 
/contrib/media/updf/include/bits/basic_string.h
0,0 → 1,1045
// Components for manipulating sequences of characters -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 21 Strings library
//
 
#ifndef _CPP_BITS_STRING_H
#define _CPP_BITS_STRING_H 1
 
#pragma GCC system_header
 
#include <bits/atomicity.h>
 
namespace std
{
 
// Documentation? What's that?
// Nathan Myers <ncm@cantrip.org>.
//
// A string looks like this:
//
// [_Rep]
// _M_length
// [basic_string<char_type>] _M_capacity
// _M_dataplus _M_state
// _M_p ----------------> unnamed array of char_type
// Where the _M_p points to the first character in the string, and
// you cast it to a pointer-to-_Rep and subtract 1 to get a
// pointer to the header.
// This approach has the enormous advantage that a string object
// requires only one allocation. All the ugliness is confined
// within a single pair of inline functions, which each compile to
// a single "add" instruction: _Rep::_M_data(), and
// string::_M_rep(); and the allocation function which gets a
// block of raw bytes and with room enough and constructs a _Rep
// object at the front.
// The reason you want _M_data pointing to the character array and
// not the _Rep is so that the debugger can see the string
// contents. (Probably we should add a non-inline member to get
// the _Rep for the debugger to use, so users can check the actual
// string length.)
// Note that the _Rep object is a POD so that you can have a
// static "empty string" _Rep object already "constructed" before
// static constructors have run. The reference-count encoding is
// chosen so that a 0 indicates one reference, so you never try to
// destroy the empty-string _Rep object.
// All but the last paragraph is considered pretty conventional
// for a C++ string implementation.
// 21.3 Template class basic_string
template<typename _CharT, typename _Traits, typename _Alloc>
class basic_string
{
// Types:
public:
typedef _Traits traits_type;
typedef typename _Traits::char_type value_type;
typedef _Alloc allocator_type;
typedef typename _Alloc::size_type size_type;
typedef typename _Alloc::difference_type difference_type;
typedef typename _Alloc::reference reference;
typedef typename _Alloc::const_reference const_reference;
typedef typename _Alloc::pointer pointer;
typedef typename _Alloc::const_pointer const_pointer;
typedef __normal_iterator<pointer, basic_string> iterator;
typedef __normal_iterator<const_pointer, basic_string> const_iterator;
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
private:
// _Rep: string representation
// Invariants:
// 1. String really contains _M_length + 1 characters; last is set
// to 0 only on call to c_str(). We avoid instantiating
// _CharT() where the interface does not require it.
// 2. _M_capacity >= _M_length
// Allocated memory is always _M_capacity + (1 * sizeof(_CharT)).
// 3. _M_references has three states:
// -1: leaked, one reference, no ref-copies allowed, non-const.
// 0: one reference, non-const.
// n>0: n + 1 references, operations require a lock, const.
// 4. All fields==0 is an empty string, given the extra storage
// beyond-the-end for a null terminator; thus, the shared
// empty string representation needs no constructor.
 
struct _Rep
{
// Types:
typedef typename _Alloc::rebind<char>::other _Raw_bytes_alloc;
 
// (Public) Data members:
 
// The maximum number of individual char_type elements of an
// individual string is determined by _S_max_size. This is the
// value that will be returned by max_size(). (Whereas npos
// is the maximum number of bytes the allocator can allocate.)
// If one was to divvy up the theoretical largest size string,
// with a terminating character and m _CharT elements, it'd
// look like this:
// npos = sizeof(_Rep) + (m * sizeof(_CharT)) + sizeof(_CharT)
// Solving for m:
// m = ((npos - sizeof(_Rep))/sizeof(CharT)) - 1
// In addition, this implementation quarters this ammount.
static const size_type _S_max_size;
static const _CharT _S_terminal;
 
size_type _M_length;
size_type _M_capacity;
_Atomic_word _M_references;
bool
_M_is_leaked() const
{ return _M_references < 0; }
 
bool
_M_is_shared() const
{ return _M_references > 0; }
 
void
_M_set_leaked()
{ _M_references = -1; }
 
void
_M_set_sharable()
{ _M_references = 0; }
 
_CharT*
_M_refdata() throw()
{ return reinterpret_cast<_CharT*> (this + 1); }
 
_CharT&
operator[](size_t __s) throw()
{ return _M_refdata() [__s]; }
 
_CharT*
_M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2)
{ return (!_M_is_leaked() && __alloc1 == __alloc2) ?
_M_refcopy() : _M_clone(__alloc1); }
 
// Create & Destroy
static _Rep*
_S_create(size_t, const _Alloc&);
 
void
_M_dispose(const _Alloc& __a)
{
if (__exchange_and_add(&_M_references, -1) <= 0)
_M_destroy(__a);
} // XXX MT
 
void
_M_destroy(const _Alloc&) throw();
 
_CharT*
_M_refcopy() throw()
{
__atomic_add(&_M_references, 1);
return _M_refdata();
} // XXX MT
 
_CharT*
_M_clone(const _Alloc&, size_type __res = 0);
 
#if _GLIBCPP_ALLOC_CONTROL
// These function pointers allow you to modify the allocation
// policy used by the string classes. By default they expand by
// powers of two, but this may be excessive for space-critical
// applications.
// Returns true if ALLOCATED is too much larger than LENGTH
static bool (*_S_excess_slop) (size_t __length, size_t __allocated);
 
inline static bool
__default_excess(size_t, size_t);
#else
inline static bool
_S_excess_slop(size_t, size_t);
#endif
};
 
// Use empty-base optimization: http://www.cantrip.org/emptyopt.html
struct _Alloc_hider : _Alloc
{
_Alloc_hider(_CharT* __dat, const _Alloc& __a)
: _Alloc(__a), _M_p(__dat) { }
 
_CharT* _M_p; // The actual data.
};
 
public:
// Data Members (public):
// NB: This is an unsigned type, and thus represents the maximum
// size that the allocator can hold.
static const size_type npos = static_cast<size_type>(-1);
 
private:
// Data Members (private):
mutable _Alloc_hider _M_dataplus;
 
// The following storage is init'd to 0 by the linker, resulting
// (carefully) in an empty string with one reference.
static size_type _S_empty_rep_storage[(sizeof(_Rep) + sizeof(_CharT) + sizeof(size_type) - 1)/sizeof(size_type)];
 
_CharT*
_M_data() const
{ return _M_dataplus._M_p; }
 
_CharT*
_M_data(_CharT* __p)
{ return (_M_dataplus._M_p = __p); }
 
_Rep*
_M_rep() const
{ return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }
 
// For the internal use we have functions similar to `begin'/`end'
// but they do not call _M_leak.
iterator
_M_ibegin() const { return iterator(_M_data()); }
 
iterator
_M_iend() const { return iterator(_M_data() + this->size()); }
 
void
_M_leak() // for use in begin() & non-const op[]
{
if (!_M_rep()->_M_is_leaked())
_M_leak_hard();
}
 
iterator
_M_check(size_type __pos) const
{
if (__pos > this->size())
__throw_out_of_range("basic_string::_M_check");
return _M_ibegin() + __pos;
}
 
// NB: _M_fold doesn't check for a bad __pos1 value.
iterator
_M_fold(size_type __pos, size_type __off) const
{
bool __testoff = __off < this->size() - __pos;
size_type __newoff = __testoff ? __off : this->size() - __pos;
return (_M_ibegin() + __pos + __newoff);
}
 
// _S_copy_chars is a separate template to permit specialization
// to optimize for the common case of pointers as iterators.
template<class _Iterator>
static void
_S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
{
for (; __k1 != __k2; ++__k1, ++__p)
traits_type::assign(*__p, *__k1); //these types are off
}
 
static void
_S_copy_chars(_CharT* __p, iterator __k1, iterator __k2)
{ _S_copy_chars(__p, __k1.base(), __k2.base()); }
 
static void
_S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
{ _S_copy_chars(__p, __k1.base(), __k2.base()); }
static void
_S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
{ traits_type::copy(__p, __k1, __k2 - __k1); }
 
static void
_S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
{ traits_type::copy(__p, __k1, __k2 - __k1); }
 
void
_M_mutate(size_type __pos, size_type __len1, size_type __len2);
 
void
_M_leak_hard();
 
static _Rep&
_S_empty_rep()
{ return *reinterpret_cast<_Rep*>(&_S_empty_rep_storage); }
 
public:
// Construct/copy/destroy:
// NB: We overload ctors in some cases instead of using default
// arguments, per 17.4.4.4 para. 2 item 2.
 
inline
basic_string();
 
explicit
basic_string(const _Alloc& __a);
 
// NB: per LWG issue 42, semantics different from IS:
basic_string(const basic_string& __str);
basic_string(const basic_string& __str, size_type __pos,
size_type __n = npos);
basic_string(const basic_string& __str, size_type __pos,
size_type __n, const _Alloc& __a);
 
basic_string(const _CharT* __s, size_type __n,
const _Alloc& __a = _Alloc());
basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
 
template<class _InputIterator>
basic_string(_InputIterator __begin, _InputIterator __end,
const _Alloc& __a = _Alloc());
 
~basic_string()
{ _M_rep()->_M_dispose(this->get_allocator()); }
 
basic_string&
operator=(const basic_string& __str) { return this->assign(__str); }
 
basic_string&
operator=(const _CharT* __s) { return this->assign(__s); }
 
basic_string&
operator=(_CharT __c) { return this->assign(1, __c); }
 
// Iterators:
iterator
begin()
{
_M_leak();
return iterator(_M_data());
}
 
const_iterator
begin() const
{ return const_iterator(_M_data()); }
 
iterator
end()
{
_M_leak();
return iterator(_M_data() + this->size());
}
 
const_iterator
end() const
{ return const_iterator(_M_data() + this->size()); }
 
reverse_iterator
rbegin()
{ return reverse_iterator(this->end()); }
 
const_reverse_iterator
rbegin() const
{ return const_reverse_iterator(this->end()); }
 
reverse_iterator
rend()
{ return reverse_iterator(this->begin()); }
 
const_reverse_iterator
rend() const
{ return const_reverse_iterator(this->begin()); }
 
public:
// Capacity:
size_type
size() const { return _M_rep()->_M_length; }
 
size_type
length() const { return _M_rep()->_M_length; }
 
size_type
max_size() const { return _Rep::_S_max_size; }
 
void
resize(size_type __n, _CharT __c);
 
void
resize(size_type __n) { this->resize(__n, _CharT()); }
 
size_type
capacity() const { return _M_rep()->_M_capacity; }
 
void
reserve(size_type __res_arg = 0);
 
void
clear() { _M_mutate(0, this->size(), 0); }
 
bool
empty() const { return this->size() == 0; }
 
// Element access:
const_reference
operator[] (size_type __pos) const
{ return _M_data()[__pos]; }
 
reference
operator[](size_type __pos)
{
_M_leak();
return _M_data()[__pos];
}
 
const_reference
at(size_type __n) const
{
if (__n >= this->size())
__throw_out_of_range("basic_string::at");
return _M_data()[__n];
}
 
reference
at(size_type __n)
{
if (__n >= size())
__throw_out_of_range("basic_string::at");
_M_leak();
return _M_data()[__n];
}
 
// Modifiers:
basic_string&
operator+=(const basic_string& __str) { return this->append(__str); }
 
basic_string&
operator+=(const _CharT* __s) { return this->append(__s); }
 
basic_string&
operator+=(_CharT __c) { return this->append(size_type(1), __c); }
 
basic_string&
append(const basic_string& __str);
 
basic_string&
append(const basic_string& __str, size_type __pos, size_type __n);
 
basic_string&
append(const _CharT* __s, size_type __n);
 
basic_string&
append(const _CharT* __s)
{ return this->append(__s, traits_type::length(__s)); }
 
basic_string&
append(size_type __n, _CharT __c);
 
template<class _InputIterator>
basic_string&
append(_InputIterator __first, _InputIterator __last)
{ return this->replace(_M_iend(), _M_iend(), __first, __last); }
 
void
push_back(_CharT __c)
{ this->replace(_M_iend(), _M_iend(), 1, __c); }
 
basic_string&
assign(const basic_string& __str);
 
basic_string&
assign(const basic_string& __str, size_type __pos, size_type __n)
{
return this->assign(__str._M_check(__pos), __str._M_fold(__pos, __n));
}
 
basic_string&
assign(const _CharT* __s, size_type __n)
{ return this->assign(__s, __s + __n); }
 
basic_string&
assign(const _CharT* __s)
{ return this->assign(__s, __s + traits_type::length(__s)); }
 
basic_string&
assign(size_type __n, _CharT __c)
{ return this->replace(_M_ibegin(), _M_iend(), __n, __c); }
 
template<class _InputIterator>
basic_string&
assign(_InputIterator __first, _InputIterator __last)
{ return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
 
void
insert(iterator __p, size_type __n, _CharT __c)
{ this->replace(__p, __p, __n, __c); }
 
template<class _InputIterator>
void insert(iterator __p, _InputIterator __beg, _InputIterator __end)
{ this->replace(__p, __p, __beg, __end); }
 
basic_string&
insert(size_type __pos1, const basic_string& __str)
{
iterator __p = _M_check(__pos1);
this->replace(__p, __p, __str._M_ibegin(), __str._M_iend());
return *this;
}
 
basic_string&
insert(size_type __pos1, const basic_string& __str,
size_type __pos2, size_type __n)
{
iterator __p = _M_check(__pos1);
this->replace(__p, __p, __str._M_check(__pos2),
__str._M_fold(__pos2, __n));
return *this;
}
 
basic_string&
insert(size_type __pos, const _CharT* __s, size_type __n)
{
iterator __p = _M_check(__pos);
this->replace(__p, __p, __s, __s + __n);
return *this;
}
 
basic_string&
insert(size_type __pos, const _CharT* __s)
{ return this->insert(__pos, __s, traits_type::length(__s)); }
 
basic_string&
insert(size_type __pos, size_type __n, _CharT __c)
{
this->insert(_M_check(__pos), __n, __c);
return *this;
}
 
iterator
insert(iterator __p, _CharT __c = _CharT())
{
size_type __pos = __p - _M_ibegin();
this->insert(_M_check(__pos), size_type(1), __c);
_M_rep()->_M_set_leaked();
return this->_M_ibegin() + __pos;
}
 
basic_string&
erase(size_type __pos = 0, size_type __n = npos)
{
return this->replace(_M_check(__pos), _M_fold(__pos, __n),
_M_data(), _M_data());
}
 
iterator
erase(iterator __position)
{
size_type __i = __position - _M_ibegin();
this->replace(__position, __position + 1, _M_data(), _M_data());
_M_rep()->_M_set_leaked();
return _M_ibegin() + __i;
}
 
iterator
erase(iterator __first, iterator __last)
{
size_type __i = __first - _M_ibegin();
this->replace(__first, __last, _M_data(), _M_data());
_M_rep()->_M_set_leaked();
return _M_ibegin() + __i;
}
 
basic_string&
replace(size_type __pos, size_type __n, const basic_string& __str)
{
return this->replace(_M_check(__pos), _M_fold(__pos, __n),
__str.begin(), __str.end());
}
 
basic_string&
replace(size_type __pos1, size_type __n1, const basic_string& __str,
size_type __pos2, size_type __n2);
 
basic_string&
replace(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2)
{
return this->replace(_M_check(__pos), _M_fold(__pos, __n1),
__s, __s + __n2);
}
 
basic_string&
replace(size_type __pos, size_type __n1, const _CharT* __s)
{
return this->replace(_M_check(__pos), _M_fold(__pos, __n1),
__s, __s + traits_type::length(__s));
}
 
basic_string&
replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
{
return this->replace(_M_check(__pos), _M_fold(__pos, __n1), __n2, __c);
}
 
basic_string&
replace(iterator __i1, iterator __i2, const basic_string& __str)
{ return this->replace(__i1, __i2, __str.begin(), __str.end()); }
 
basic_string&
replace(iterator __i1, iterator __i2,
const _CharT* __s, size_type __n)
{ return this->replace(__i1, __i2, __s, __s + __n); }
 
basic_string&
replace(iterator __i1, iterator __i2, const _CharT* __s)
{ return this->replace(__i1, __i2, __s,
__s + traits_type::length(__s)); }
 
basic_string&
replace(iterator __i1, iterator __i2, size_type __n, _CharT __c);
 
template<class _InputIterator>
basic_string&
replace(iterator __i1, iterator __i2,
_InputIterator __k1, _InputIterator __k2)
{ return _M_replace(__i1, __i2, __k1, __k2,
typename iterator_traits<_InputIterator>::iterator_category()); }
 
private:
template<class _InputIterator>
basic_string&
_M_replace(iterator __i1, iterator __i2, _InputIterator __k1,
_InputIterator __k2, input_iterator_tag);
 
template<class _FwdIterator>
basic_string&
_M_replace(iterator __i1, iterator __i2, _FwdIterator __k1,
_FwdIterator __k2, forward_iterator_tag);
 
// _S_construct_aux is used to implement the 21.3.1 para 15 which
// requires special behaviour if _InIter is an integral type
template<class _InIter>
static _CharT*
_S_construct_aux(_InIter __beg, _InIter __end, const _Alloc& __a,
__false_type)
{
typedef typename iterator_traits<_InIter>::iterator_category _Tag;
return _S_construct(__beg, __end, __a, _Tag());
}
template<class _InIter>
static _CharT*
_S_construct_aux(_InIter __beg, _InIter __end, const _Alloc& __a,
__true_type)
{
return _S_construct(static_cast<size_type>(__beg),
static_cast<value_type>(__end), __a);
}
template<class _InIter>
static _CharT*
_S_construct(_InIter __beg, _InIter __end, const _Alloc& __a)
{
typedef typename _Is_integer<_InIter>::_Integral _Integral;
return _S_construct_aux(__beg, __end, __a, _Integral());
}
 
// For Input Iterators, used in istreambuf_iterators, etc.
template<class _InIter>
static _CharT*
_S_construct(_InIter __beg, _InIter __end, const _Alloc& __a,
input_iterator_tag);
// For forward_iterators up to random_access_iterators, used for
// string::iterator, _CharT*, etc.
template<class _FwdIter>
static _CharT*
_S_construct(_FwdIter __end, _FwdIter __beg, const _Alloc& __a,
forward_iterator_tag);
 
static _CharT*
_S_construct(size_type __req, _CharT __c, const _Alloc& __a);
 
public:
 
size_type
copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
 
void
swap(basic_string<_CharT, _Traits, _Alloc>& __s);
 
// String operations:
const _CharT*
c_str() const
{
// MT: This assumes concurrent writes are OK.
size_type __n = this->size();
traits_type::assign(_M_data()[__n], _Rep::_S_terminal);
return _M_data();
}
 
const _CharT*
data() const { return _M_data(); }
 
allocator_type
get_allocator() const { return _M_dataplus; }
 
size_type
find(const _CharT* __s, size_type __pos, size_type __n) const;
 
size_type
find(const basic_string& __str, size_type __pos = 0) const
{ return this->find(__str.data(), __pos, __str.size()); }
 
size_type
find(const _CharT* __s, size_type __pos = 0) const
{ return this->find(__s, __pos, traits_type::length(__s)); }
 
size_type
find(_CharT __c, size_type __pos = 0) const;
 
size_type
rfind(const basic_string& __str, size_type __pos = npos) const
{ return this->rfind(__str.data(), __pos, __str.size()); }
 
size_type
rfind(const _CharT* __s, size_type __pos, size_type __n) const;
 
size_type
rfind(const _CharT* __s, size_type __pos = npos) const
{ return this->rfind(__s, __pos, traits_type::length(__s)); }
 
size_type
rfind(_CharT __c, size_type __pos = npos) const;
 
size_type
find_first_of(const basic_string& __str, size_type __pos = 0) const
{ return this->find_first_of(__str.data(), __pos, __str.size()); }
 
size_type
find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
 
size_type
find_first_of(const _CharT* __s, size_type __pos = 0) const
{ return this->find_first_of(__s, __pos, traits_type::length(__s)); }
 
size_type
find_first_of(_CharT __c, size_type __pos = 0) const
{ return this->find(__c, __pos); }
 
size_type
find_last_of(const basic_string& __str, size_type __pos = npos) const
{ return this->find_last_of(__str.data(), __pos, __str.size()); }
 
size_type
find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
 
size_type
find_last_of(const _CharT* __s, size_type __pos = npos) const
{ return this->find_last_of(__s, __pos, traits_type::length(__s)); }
 
size_type
find_last_of(_CharT __c, size_type __pos = npos) const
{ return this->rfind(__c, __pos); }
 
size_type
find_first_not_of(const basic_string& __str, size_type __pos = 0) const
{ return this->find_first_not_of(__str.data(), __pos, __str.size()); }
 
size_type
find_first_not_of(const _CharT* __s, size_type __pos,
size_type __n) const;
 
size_type
find_first_not_of(const _CharT* __s, size_type __pos = 0) const
{ return this->find_first_not_of(__s, __pos, traits_type::length(__s)); }
 
size_type
find_first_not_of(_CharT __c, size_type __pos = 0) const;
 
size_type
find_last_not_of(const basic_string& __str, size_type __pos = npos) const
{ return this->find_last_not_of(__str.data(), __pos, __str.size()); }
 
size_type
find_last_not_of(const _CharT* __s, size_type __pos,
size_type __n) const;
size_type
find_last_not_of(const _CharT* __s, size_type __pos = npos) const
{ return this->find_last_not_of(__s, __pos, traits_type::length(__s)); }
 
size_type
find_last_not_of(_CharT __c, size_type __pos = npos) const;
 
basic_string
substr(size_type __pos = 0, size_type __n = npos) const
{
if (__pos > this->size())
__throw_out_of_range("basic_string::substr");
return basic_string(*this, __pos, __n);
}
 
int
compare(const basic_string& __str) const
{
size_type __size = this->size();
size_type __osize = __str.size();
size_type __len = min(__size, __osize);
int __r = traits_type::compare(_M_data(), __str.data(), __len);
if (!__r)
__r = __size - __osize;
return __r;
}
 
int
compare(size_type __pos, size_type __n, const basic_string& __str) const;
 
int
compare(size_type __pos1, size_type __n1, const basic_string& __str,
size_type __pos2, size_type __n2) const;
 
int
compare(const _CharT* __s) const;
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 5. String::compare specification questionable
int
compare(size_type __pos, size_type __n1, const _CharT* __s) const;
 
int
compare(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2) const;
#endif
};
 
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_string<_CharT, _Traits, _Alloc>::
basic_string()
: _M_dataplus(_S_empty_rep()._M_refcopy(), _Alloc()) { }
 
// operator+
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{
basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
__str.append(__rhs);
return __str;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>
operator+(const _CharT* __lhs,
const basic_string<_CharT,_Traits,_Alloc>& __rhs);
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>
operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{
basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
__str.append(__rhs);
return __str;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
{
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
__string_type __str(__lhs);
__str.append(__size_type(1), __rhs);
return __str;
}
 
// operator ==
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) == 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) == 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) == 0; }
 
// operator !=
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) != 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) != 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) != 0; }
 
// operator <
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) < 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) < 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) > 0; }
 
// operator >
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) > 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) > 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) < 0; }
 
// operator <=
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) <= 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) <= 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) >= 0; }
 
// operator >=
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) >= 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) >= 0; }
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) <= 0; }
 
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline void
swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ __lhs.swap(__rhs); }
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Alloc>& __str);
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os,
const basic_string<_CharT, _Traits, _Alloc>& __str);
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_istream<_CharT,_Traits>&
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
 
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_istream<_CharT,_Traits>&
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Alloc>& __str);
} // namespace std
 
#endif /* _CPP_BITS_STRING_H */
/contrib/media/updf/include/bits/basic_string.tcc
0,0 → 1,862
// Components for manipulating sequences of characters -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 21 Strings library
//
 
// This file is included by <string>. It is not meant to be included
// separately.
 
// Written by Jason Merrill based upon the specification by Takanori Adachi
// in ANSI X3J16/94-0013R2. Rewritten by Nathan Myers to ISO-14882.
 
#ifndef _CPP_BITS_STRING_TCC
#define _CPP_BITS_STRING_TCC 1
 
namespace std
{
template<typename _CharT, typename _Traits, typename _Alloc>
const _CharT
basic_string<_CharT, _Traits, _Alloc>::
_Rep::_S_terminal = _CharT();
 
template<typename _CharT, typename _Traits, typename _Alloc>
const typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
_Rep::_S_max_size = (((npos - sizeof(_Rep))/sizeof(_CharT)) - 1) / 4;
 
template<typename _CharT, typename _Traits, typename _Alloc>
const typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::npos;
 
// Linker sets _S_empty_rep_storage to all 0s (one reference, empty string)
// at static init time (before static ctors are run).
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::_S_empty_rep_storage[
(sizeof(_Rep) + sizeof(_CharT) + sizeof(size_type) - 1)/sizeof(size_type)];
 
// NB: This is the special case for Input Iterators, used in
// istreambuf_iterators, etc.
// Input Iterators have a cost structure very different from
// pointers, calling for a different coding style.
template<typename _CharT, typename _Traits, typename _Alloc>
template<typename _InIter>
_CharT*
basic_string<_CharT, _Traits, _Alloc>::
_S_construct(_InIter __beg, _InIter __end, const _Alloc& __a,
input_iterator_tag)
{
if (__beg == __end && __a == _Alloc())
return _S_empty_rep()._M_refcopy();
// Avoid reallocation for common case.
_CharT __buf[100];
size_type __i = 0;
while (__beg != __end && __i < sizeof(__buf) / sizeof(_CharT))
{
__buf[__i++] = *__beg;
++__beg;
}
_Rep* __r = _Rep::_S_create(__i, __a);
traits_type::copy(__r->_M_refdata(), __buf, __i);
__r->_M_length = __i;
try
{
// NB: this loop looks precisely this way because
// it avoids comparing __beg != __end any more
// than strictly necessary; != might be expensive!
for (;;)
{
_CharT* __p = __r->_M_refdata() + __r->_M_length;
_CharT* __last = __r->_M_refdata() + __r->_M_capacity;
for (;;)
{
if (__beg == __end)
{
__r->_M_length = __p - __r->_M_refdata();
*__p = _Rep::_S_terminal; // grrr.
return __r->_M_refdata();
}
if (__p == __last)
break;
*__p++ = *__beg;
++__beg;
}
// Allocate more space.
size_type __len = __p - __r->_M_refdata();
_Rep* __another = _Rep::_S_create(__len + 1, __a);
traits_type::copy(__another->_M_refdata(),
__r->_M_refdata(), __len);
__r->_M_destroy(__a);
__r = __another;
__r->_M_length = __len;
}
}
catch(...)
{
__r->_M_destroy(__a);
__throw_exception_again;
}
return 0;
}
template<typename _CharT, typename _Traits, typename _Alloc>
template <class _InIter>
_CharT*
basic_string<_CharT,_Traits,_Alloc>::
_S_construct(_InIter __beg, _InIter __end, const _Alloc& __a,
forward_iterator_tag)
{
size_type __dnew = static_cast<size_type>(distance(__beg, __end));
 
if (__beg == __end && __a == _Alloc())
return _S_empty_rep()._M_refcopy();
 
// Check for out_of_range and length_error exceptions.
_Rep* __r = _Rep::_S_create(__dnew, __a);
try
{ _S_copy_chars(__r->_M_refdata(), __beg, __end); }
catch(...)
{
__r->_M_destroy(__a);
__throw_exception_again;
}
__r->_M_length = __dnew;
 
__r->_M_refdata()[__dnew] = _Rep::_S_terminal; // grrr.
return __r->_M_refdata();
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
_CharT*
basic_string<_CharT,_Traits, _Alloc>::
_S_construct(size_type __n, _CharT __c, const _Alloc& __a)
{
if (__n == 0 && __a == _Alloc())
return _S_empty_rep()._M_refcopy();
 
// Check for out_of_range and length_error exceptions.
_Rep* __r = _Rep::_S_create(__n, __a);
try
{
if (__n)
traits_type::assign(__r->_M_refdata(), __n, __c);
}
catch(...)
{
__r->_M_destroy(__a);
__throw_exception_again;
}
__r->_M_length = __n;
__r->_M_refdata()[__n] = _Rep::_S_terminal; // grrr
return __r->_M_refdata();
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const basic_string& __str)
: _M_dataplus(__str._M_rep()->_M_grab(_Alloc(), __str.get_allocator()),
__str.get_allocator())
{ }
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const _Alloc& __a)
: _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a)
{ }
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const basic_string& __str, size_type __pos, size_type __n)
: _M_dataplus(_S_construct(__str._M_check(__pos),
__str._M_fold(__pos, __n), _Alloc()), _Alloc())
{ }
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const basic_string& __str, size_type __pos,
size_type __n, const _Alloc& __a)
: _M_dataplus(_S_construct(__str._M_check(__pos),
__str._M_fold(__pos, __n), __a), __a)
{ }
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const _CharT* __s, size_type __n, const _Alloc& __a)
: _M_dataplus(_S_construct(__s, __s + __n, __a), __a)
{ }
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const _CharT* __s, const _Alloc& __a)
: _M_dataplus(_S_construct(__s, __s + traits_type::length(__s), __a), __a)
{ }
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(size_type __n, _CharT __c, const _Alloc& __a)
: _M_dataplus(_S_construct(__n, __c, __a), __a)
{ }
template<typename _CharT, typename _Traits, typename _Alloc>
template<typename _InputIter>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(_InputIter __beg, _InputIter __end, const _Alloc& __a)
: _M_dataplus(_S_construct(__beg, __end, __a), __a)
{ }
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::assign(const basic_string& __str)
{
if (_M_rep() != __str._M_rep())
{
// XXX MT
allocator_type __a = this->get_allocator();
_CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
_M_rep()->_M_dispose(__a);
_M_data(__tmp);
}
return *this;
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_M_destroy(const _Alloc& __a) throw ()
{
size_type __size = sizeof(_Rep) + (_M_capacity + 1) * sizeof(_CharT);
_Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size);
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::_M_leak_hard()
{
if (_M_rep()->_M_is_shared())
_M_mutate(0, 0, 0);
_M_rep()->_M_set_leaked();
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::
_M_mutate(size_type __pos, size_type __len1, size_type __len2)
{
size_type __old_size = this->size();
const size_type __new_size = __old_size + __len2 - __len1;
const _CharT* __src = _M_data() + __pos + __len1;
const size_type __how_much = __old_size - __pos - __len1;
if (_M_rep()->_M_is_shared() || __new_size > capacity())
{
// Must reallocate.
allocator_type __a = get_allocator();
_Rep* __r = _Rep::_S_create(__new_size, __a);
try
{
if (__pos)
traits_type::copy(__r->_M_refdata(), _M_data(), __pos);
if (__how_much)
traits_type::copy(__r->_M_refdata() + __pos + __len2,
__src, __how_much);
}
catch(...)
{
__r->_M_dispose(get_allocator());
__throw_exception_again;
}
_M_rep()->_M_dispose(__a);
_M_data(__r->_M_refdata());
}
else if (__how_much && __len1 != __len2)
{
// Work in-place
traits_type::move(_M_data() + __pos + __len2, __src, __how_much);
}
_M_rep()->_M_set_sharable();
_M_rep()->_M_length = __new_size;
_M_data()[__new_size] = _Rep::_S_terminal; // grrr. (per 21.3.4)
// You cannot leave those LWG people alone for a second.
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::reserve(size_type __res)
{
if (__res > this->capacity() || _M_rep()->_M_is_shared())
{
if (__res > this->max_size())
__throw_length_error("basic_string::reserve");
allocator_type __a = get_allocator();
_CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
_M_rep()->_M_dispose(__a);
_M_data(__tmp);
}
}
template<typename _CharT, typename _Traits, typename _Alloc>
void basic_string<_CharT, _Traits, _Alloc>::swap(basic_string& __s)
{
if (_M_rep()->_M_is_leaked())
_M_rep()->_M_set_sharable();
if (__s._M_rep()->_M_is_leaked())
__s._M_rep()->_M_set_sharable();
if (this->get_allocator() == __s.get_allocator())
{
_CharT* __tmp = _M_data();
_M_data(__s._M_data());
__s._M_data(__tmp);
}
// The code below can usually be optimized away.
else
{
basic_string __tmp1(_M_ibegin(), _M_iend(), __s.get_allocator());
basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
this->get_allocator());
*this = __tmp2;
__s = __tmp1;
}
}
 
#ifdef _GLIBCPP_ALLOC_CONTROL
template<typename _CharT, typename _Traits, typename _Alloc>
bool (*basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_excess_slop)
(size_t, size_t) =
basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_default_excess;
#endif
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::_Rep*
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_S_create(size_t __capacity, const _Alloc& __alloc)
{
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 83. String::npos vs. string::max_size()
if (__capacity > _S_max_size)
#else
if (__capacity == npos)
#endif
__throw_length_error("basic_string::_S_create");
 
// NB: Need an array of char_type[__capacity], plus a
// terminating null char_type() element, plus enough for the
// _Rep data structure. Whew. Seemingly so needy, yet so elemental.
size_t __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
// NB: Might throw, but no worries about a leak, mate: _Rep()
// does not throw.
void* __place = _Raw_bytes_alloc(__alloc).allocate(__size);
_Rep *__p = new (__place) _Rep;
__p->_M_capacity = __capacity;
__p->_M_set_sharable(); // one reference
__p->_M_length = 0;
return __p;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
_CharT*
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_M_clone(const _Alloc& __alloc, size_type __res)
{
_Rep* __r = _Rep::_S_create(_M_length + __res, __alloc);
if (_M_length)
{
try
{ traits_type::copy(__r->_M_refdata(), _M_refdata(), _M_length); }
catch(...)
{
__r->_M_destroy(__alloc);
__throw_exception_again;
}
}
__r->_M_length = _M_length;
return __r->_M_refdata();
}
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
#ifdef _GLIBCPP_ALLOC_CONTROL
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_S_default_excess(size_t __s, size_t __r)
#else
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_S_excess_slop(size_t __s, size_t __r)
#endif
{
return 2 * (__s <= 16 ? 16 : __s) < __r;
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::resize(size_type __n, _CharT __c)
{
if (__n > max_size())
__throw_length_error("basic_string::resize");
size_type __size = this->size();
if (__size < __n)
this->append(__n - __size, __c);
else if (__n < __size)
this->erase(__n);
// else nothing (in particular, avoid calling _M_mutate() unnecessarily.)
}
template<typename _CharT, typename _Traits, typename _Alloc>
template<typename _InputIter>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
_M_replace(iterator __i1, iterator __i2, _InputIter __k1,
_InputIter __k2, input_iterator_tag)
{
basic_string __s(__k1, __k2);
return this->replace(__i1, __i2, __s._M_ibegin(), __s._M_iend());
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
template<typename _ForwardIter>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
_M_replace(iterator __i1, iterator __i2, _ForwardIter __k1,
_ForwardIter __k2, forward_iterator_tag)
{
size_type __dold = __i2 - __i1;
size_type __dmax = this->max_size();
size_type __dnew = static_cast<size_type>(distance(__k1, __k2));
 
if (__dmax <= __dnew)
__throw_length_error("basic_string::_M_replace");
size_type __off = __i1 - _M_ibegin();
_M_mutate(__off, __dold, __dnew);
// Invalidated __i1, __i2
if (__dnew)
_S_copy_chars(_M_data() + __off, __k1, __k2);
return *this;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
replace(size_type __pos1, size_type __n1, const basic_string& __str,
size_type __pos2, size_type __n2)
{
return this->replace(_M_check(__pos1), _M_fold(__pos1, __n1),
__str._M_check(__pos2),
__str._M_fold(__pos2, __n2));
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>&
basic_string<_CharT,_Traits,_Alloc>::
append(const basic_string& __str)
{
// Iff appending itself, string needs to pre-reserve the
// correct size so that _M_mutate does not clobber the
// iterators formed here.
size_type __size = __str.size();
size_type __len = __size + this->size();
if (__len > this->capacity())
this->reserve(__len);
return this->replace(_M_iend(), _M_iend(), __str._M_ibegin(),
__str._M_iend());
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>&
basic_string<_CharT,_Traits,_Alloc>::
append(const basic_string& __str, size_type __pos, size_type __n)
{
// Iff appending itself, string needs to pre-reserve the
// correct size so that _M_mutate does not clobber the
// iterators formed here.
size_type __len = min(__str.size() - __pos, __n) + this->size();
if (__len > this->capacity())
this->reserve(__len);
return this->replace(_M_iend(), _M_iend(), __str._M_check(__pos),
__str._M_fold(__pos, __n));
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>&
basic_string<_CharT,_Traits,_Alloc>::
append(const _CharT* __s, size_type __n)
{
size_type __len = __n + this->size();
if (__len > this->capacity())
this->reserve(__len);
return this->replace(_M_iend(), _M_iend(), __s, __s + __n);
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>&
basic_string<_CharT,_Traits,_Alloc>::
append(size_type __n, _CharT __c)
{
size_type __len = __n + this->size();
if (__len > this->capacity())
this->reserve(__len);
return this->replace(_M_iend(), _M_iend(), __n, __c);
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>
operator+(const _CharT* __lhs,
const basic_string<_CharT,_Traits,_Alloc>& __rhs)
{
typedef basic_string<_CharT,_Traits,_Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
__size_type __len = _Traits::length(__lhs);
__string_type __str;
__str.reserve(__len + __rhs.size());
__str.append(__lhs, __lhs + __len);
__str.append(__rhs);
return __str;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>
operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
{
typedef basic_string<_CharT,_Traits,_Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
__string_type __str;
__size_type __len = __rhs.size();
__str.reserve(__len + 1);
__str.append(__size_type(1), __lhs);
__str.append(__rhs);
return __str;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
replace(iterator __i1, iterator __i2, size_type __n2, _CharT __c)
{
size_type __n1 = __i2 - __i1;
size_type __off1 = __i1 - _M_ibegin();
if (max_size() - (this->size() - __n1) <= __n2)
__throw_length_error("basic_string::replace");
_M_mutate (__off1, __n1, __n2);
// Invalidated __i1, __i2
if (__n2)
traits_type::assign(_M_data() + __off1, __n2, __c);
return *this;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
copy(_CharT* __s, size_type __n, size_type __pos) const
{
if (__pos > this->size())
__throw_out_of_range("basic_string::copy");
if (__n > this->size() - __pos)
__n = this->size() - __pos;
traits_type::copy(__s, _M_data() + __pos, __n);
// 21.3.5.7 par 3: do not append null. (good.)
return __n;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find(const _CharT* __s, size_type __pos, size_type __n) const
{
size_type __size = this->size();
size_t __xpos = __pos;
const _CharT* __data = _M_data();
for (; __xpos + __n <= __size; ++__xpos)
if (traits_type::compare(__data + __xpos, __s, __n) == 0)
return __xpos;
return npos;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find(_CharT __c, size_type __pos) const
{
size_type __size = this->size();
size_type __ret = npos;
if (__pos < __size)
{
const _CharT* __data = _M_data();
size_type __n = __size - __pos;
const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
if (__p)
__ret = __p - __data;
}
return __ret;
}
 
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
rfind(const _CharT* __s, size_type __pos, size_type __n) const
{
size_type __size = this->size();
if (__n <= __size)
{
__pos = std::min(__size - __n ,__pos);
const _CharT* __data = _M_data();
do
{
if (traits_type::compare(__data + __pos, __s, __n) == 0)
return __pos;
}
while (__pos-- > 0);
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
rfind(_CharT __c, size_type __pos) const
{
size_type __size = this->size();
if (__size)
{
size_t __xpos = __size - 1;
if (__xpos > __pos)
__xpos = __pos;
for (++__xpos; __xpos-- > 0; )
if (traits_type::eq(_M_data()[__xpos], __c))
return __xpos;
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
{
for (; __n && __pos < this->size(); ++__pos)
{
const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
if (__p)
return __pos;
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
{
size_type __size = this->size();
if (__size && __n)
{
if (--__size > __pos)
__size = __pos;
do
{
if (traits_type::find(__s, __n, _M_data()[__size]))
return __size;
}
while (__size-- != 0);
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
size_t __xpos = __pos;
for (; __n && __xpos < this->size(); ++__xpos)
if (!traits_type::find(__s, __n, _M_data()[__xpos]))
return __xpos;
return npos;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_not_of(_CharT __c, size_type __pos) const
{
size_t __xpos = __pos;
for (; __xpos < this->size(); ++__xpos)
if (!traits_type::eq(_M_data()[__xpos], __c))
return __xpos;
return npos;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
size_type __size = this->size();
if (__size && __n)
{
if (--__size > __pos)
__size = __pos;
do
{
if (!traits_type::find(__s, __n, _M_data()[__size]))
return __size;
}
while (__size--);
}
return npos;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_last_not_of(_CharT __c, size_type __pos) const
{
size_type __size = this->size();
if (__size)
{
if (--__size > __pos)
__size = __pos;
do
{
if (!traits_type::eq(_M_data()[__size], __c))
return __size;
}
while (__size--);
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string<_CharT, _Traits, _Alloc>::
compare(size_type __pos, size_type __n, const basic_string& __str) const
{
size_type __size = this->size();
size_type __osize = __str.size();
if (__pos > __size)
__throw_out_of_range("basic_string::compare");
size_type __rsize= min(__size - __pos, __n);
size_type __len = min(__rsize, __osize);
int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
if (!__r)
__r = __rsize - __osize;
return __r;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string<_CharT, _Traits, _Alloc>::
compare(size_type __pos1, size_type __n1, const basic_string& __str,
size_type __pos2, size_type __n2) const
{
size_type __size = this->size();
size_type __osize = __str.size();
if (__pos1 > __size || __pos2 > __osize)
__throw_out_of_range("basic_string::compare");
size_type __rsize = min(__size - __pos1, __n1);
size_type __rosize = min(__osize - __pos2, __n2);
size_type __len = min(__rsize, __rosize);
int __r = traits_type::compare(_M_data() + __pos1,
__str.data() + __pos2, __len);
if (!__r)
__r = __rsize - __rosize;
return __r;
}
 
 
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string<_CharT, _Traits, _Alloc>::
compare(const _CharT* __s) const
{
size_type __size = this->size();
int __r = traits_type::compare(_M_data(), __s, __size);
if (!__r)
__r = __size - traits_type::length(__s);
return __r;
}
 
 
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string <_CharT,_Traits,_Alloc>::
compare(size_type __pos, size_type __n1, const _CharT* __s) const
{
size_type __size = this->size();
if (__pos > __size)
__throw_out_of_range("basic_string::compare");
size_type __osize = traits_type::length(__s);
size_type __rsize = min(__size - __pos, __n1);
size_type __len = min(__rsize, __osize);
int __r = traits_type::compare(_M_data() + __pos, __s, __len);
if (!__r)
__r = __rsize - __osize;
return __r;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string <_CharT,_Traits,_Alloc>::
compare(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2) const
{
size_type __size = this->size();
if (__pos > __size)
__throw_out_of_range("basic_string::compare");
size_type __osize = min(traits_type::length(__s), __n2);
size_type __rsize = min(__size - __pos, __n1);
size_type __len = min(__rsize, __osize);
int __r = traits_type::compare(_M_data() + __pos, __s, __len);
if (!__r)
__r = __rsize - __osize;
return __r;
}
 
template <class _CharT, class _Traits, class _Alloc>
void
_S_string_copy(const basic_string<_CharT, _Traits, _Alloc>& __str,
_CharT* __buf, typename _Alloc::size_type __bufsiz)
{
typedef typename _Alloc::size_type size_type;
size_type __strsize = __str.size();
size_type __bytes = min(__strsize, __bufsiz - 1);
_Traits::copy(__buf, __str.data(), __bytes);
__buf[__bytes] = _CharT();
}
} // namespace std
 
#endif
/contrib/media/updf/include/bits/boost_concept_check.h
0,0 → 1,895
//
// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify,
// sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
//
 
// GCC Note: based on version 1.12.0 of the Boost library.
#ifndef _GLIBCPP_BOOST_CONCEPT_CHECK
#define _GLIBCPP_BOOST_CONCEPT_CHECK 1
 
#pragma GCC system_header
#include <bits/stl_iterator_base_types.h> // for traits and tags
#include <utility> // for pair<>
 
 
namespace __gnu_cxx
{
 
#define _IsUnused __attribute__ ((__unused__))
 
template <class _Concept>
void __function_requires()
{
void (_Concept::*__x)() _IsUnused = &_Concept::__constraints;
}
 
 
// ??? Should the "concept_checking*" structs begin with more than _ ?
#define _GLIBCPP_CLASS_REQUIRES(_type_var, _ns, _concept) \
typedef void (_ns::_concept <_type_var>::* _func##_type_var##_concept)(); \
template <_func##_type_var##_concept _Tp1> \
struct _concept_checking##_type_var##_concept { }; \
typedef _concept_checking##_type_var##_concept< \
&_ns::_concept <_type_var>::__constraints> \
_concept_checking_typedef##_type_var##_concept
 
#define _GLIBCPP_CLASS_REQUIRES2(_type_var1, _type_var2, _ns, _concept) \
typedef void (_ns::_concept <_type_var1,_type_var2>::* _func##_type_var1##_type_var2##_concept)(); \
template <_func##_type_var1##_type_var2##_concept _Tp1> \
struct _concept_checking##_type_var1##_type_var2##_concept { }; \
typedef _concept_checking##_type_var1##_type_var2##_concept< \
&_ns::_concept <_type_var1,_type_var2>::__constraints> \
_concept_checking_typedef##_type_var1##_type_var2##_concept
 
#define _GLIBCPP_CLASS_REQUIRES3(_type_var1, _type_var2, _type_var3, _ns, _concept) \
typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3>::* _func##_type_var1##_type_var2##_type_var3##_concept)(); \
template <_func##_type_var1##_type_var2##_type_var3##_concept _Tp1> \
struct _concept_checking##_type_var1##_type_var2##_type_var3##_concept { }; \
typedef _concept_checking##_type_var1##_type_var2##_type_var3##_concept< \
&_ns::_concept <_type_var1,_type_var2,_type_var3>::__constraints> \
_concept_checking_typedef##_type_var1##_type_var2##_type_var3##_concept
 
#define _GLIBCPP_CLASS_REQUIRES4(_type_var1, _type_var2, _type_var3, _type_var4, _ns, _concept) \
typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::* _func##_type_var1##_type_var2##_type_var3##_type_var4##_concept)(); \
template <_func##_type_var1##_type_var2##_type_var3##_type_var4##_concept _Tp1> \
struct _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept { }; \
typedef _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept< \
&_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::__constraints> \
_concept_checking_typedef##_type_var1##_type_var2##_type_var3##_type_var4##_concept
 
 
template <class _Tp1, class _Tp2>
struct _Aux_require_same { };
 
template <class _Tp>
struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
 
template <class _Tp1, class _Tp2>
struct _SameTypeConcept
{
void __constraints() {
typedef typename _Aux_require_same<_Tp1, _Tp2>::_Type _Required;
}
};
 
template <class _Tp>
struct _IntegerConcept {
void __constraints() {
__error_type_must_be_an_integer_type();
}
};
template <> struct _IntegerConcept<short> { void __constraints() {} };
template <> struct _IntegerConcept<unsigned short> { void __constraints(){} };
template <> struct _IntegerConcept<int> { void __constraints() {} };
template <> struct _IntegerConcept<unsigned int> { void __constraints() {} };
template <> struct _IntegerConcept<long> { void __constraints() {} };
template <> struct _IntegerConcept<unsigned long> { void __constraints() {} };
#ifdef _GLIBCPP_USE_LONG_LONG
template <> struct _IntegerConcept<long long> { void __constraints() {} };
template <> struct _IntegerConcept<unsigned long long>
{ void __constraints() {} };
#endif
 
template <class _Tp>
struct _SignedIntegerConcept {
void __constraints() {
__error_type_must_be_a_signed_integer_type();
}
};
template <> struct _SignedIntegerConcept<short> { void __constraints() {} };
template <> struct _SignedIntegerConcept<int> { void __constraints() {} };
template <> struct _SignedIntegerConcept<long> { void __constraints() {} };
#ifdef _GLIBCPP_USE_LONG_LONG
template <> struct _SignedIntegerConcept<long long> { void __constraints(){}};
#endif
 
template <class _Tp>
struct _UnsignedIntegerConcept {
void __constraints() {
__error_type_must_be_an_unsigned_integer_type();
}
};
template <> struct _UnsignedIntegerConcept<unsigned short>
{ void __constraints() {} };
template <> struct _UnsignedIntegerConcept<unsigned int>
{ void __constraints() {} };
template <> struct _UnsignedIntegerConcept<unsigned long>
{ void __constraints() {} };
#ifdef _GLIBCPP_USE_LONG_LONG
template <> struct _UnsignedIntegerConcept<unsigned long long>
{ void __constraints() {} };
#endif
 
//===========================================================================
// Basic Concepts
 
template <class _Tp>
struct _DefaultConstructibleConcept
{
void __constraints() {
_Tp __a _IsUnused; // require default constructor
}
};
 
template <class _Tp>
struct _AssignableConcept
{
void __constraints() {
__a = __a; // require assignment operator
__const_constraints(__a);
}
void __const_constraints(const _Tp& __b) {
__a = __b; // const required for argument to assignment
}
_Tp __a;
};
 
template <class _Tp>
struct _CopyConstructibleConcept
{
void __constraints() {
_Tp __a(__b); // require copy constructor
_Tp* __ptr _IsUnused = &__a; // require address of operator
__const_constraints(__a);
}
void __const_constraints(const _Tp& __a) {
_Tp __c(__a) _IsUnused; // require const copy constructor
const _Tp* __ptr _IsUnused = &__a; // require const address of operator
}
_Tp __b;
};
 
// The SGI STL version of Assignable requires copy constructor and operator=
template <class _Tp>
struct _SGIAssignableConcept
{
void __constraints() {
_Tp __b(__a) _IsUnused;
__a = __a; // require assignment operator
__const_constraints(__a);
}
void __const_constraints(const _Tp& __b) {
_Tp __c(__b) _IsUnused;
__a = __b; // const required for argument to assignment
}
_Tp __a;
};
 
template <class _From, class _To>
struct _ConvertibleConcept
{
void __constraints() {
_To __y _IsUnused = __x;
}
_From __x;
};
 
// The C++ standard requirements for many concepts talk about return
// types that must be "convertible to bool". The problem with this
// requirement is that it leaves the door open for evil proxies that
// define things like operator|| with strange return types. Two
// possible solutions are:
// 1) require the return type to be exactly bool
// 2) stay with convertible to bool, and also
// specify stuff about all the logical operators.
// For now we just test for convertible to bool.
template <class _Tp>
void __aux_require_boolean_expr(const _Tp& __t) {
bool __x _IsUnused = __t;
}
 
// FIXME
template <class _Tp>
struct _EqualityComparableConcept
{
void __constraints() {
__aux_require_boolean_expr(__a == __b);
__aux_require_boolean_expr(__a != __b);
}
_Tp __a, __b;
};
 
template <class _Tp>
struct _LessThanComparableConcept
{
void __constraints() {
__aux_require_boolean_expr(__a < __b);
}
_Tp __a, __b;
};
 
// This is equivalent to SGI STL's LessThanComparable.
template <class _Tp>
struct _ComparableConcept
{
void __constraints() {
__aux_require_boolean_expr(__a < __b);
__aux_require_boolean_expr(__a > __b);
__aux_require_boolean_expr(__a <= __b);
__aux_require_boolean_expr(__a >= __b);
}
_Tp __a, __b;
};
 
#define _GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(_OP,_NAME) \
template <class _First, class _Second> \
struct _NAME { \
void __constraints() { (void)__constraints_(); } \
bool __constraints_() { \
return __a _OP __b; \
} \
_First __a; \
_Second __b; \
}
 
#define _GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(_OP,_NAME) \
template <class _Ret, class _First, class _Second> \
struct _NAME { \
void __constraints() { (void)__constraints_(); } \
_Ret __constraints_() { \
return __a _OP __b; \
} \
_First __a; \
_Second __b; \
}
 
_GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(==, _EqualOpConcept);
_GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(!=, _NotEqualOpConcept);
_GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<, _LessThanOpConcept);
_GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<=, _LessEqualOpConcept);
_GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>, _GreaterThanOpConcept);
_GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>=, _GreaterEqualOpConcept);
 
_GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(+, _PlusOpConcept);
_GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(*, _TimesOpConcept);
_GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(/, _DivideOpConcept);
_GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(-, _SubtractOpConcept);
_GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(%, _ModOpConcept);
 
#undef _GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT
#undef _GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT
 
//===========================================================================
// Function Object Concepts
 
template <class _Func, class _Return>
struct _GeneratorConcept
{
void __constraints() {
const _Return& __r _IsUnused = __f();// require operator() member function
}
_Func __f;
};
 
 
template <class _Func>
struct _GeneratorConcept<_Func,void>
{
void __constraints() {
__f(); // require operator() member function
}
_Func __f;
};
 
template <class _Func, class _Return, class _Arg>
struct _UnaryFunctionConcept
{
void __constraints() {
__r = __f(__arg); // require operator()
}
_Func __f;
_Arg __arg;
_Return __r;
};
 
template <class _Func, class _Arg>
struct _UnaryFunctionConcept<_Func, void, _Arg> {
void __constraints() {
__f(__arg); // require operator()
}
_Func __f;
_Arg __arg;
};
 
template <class _Func, class _Return, class _First, class _Second>
struct _BinaryFunctionConcept
{
void __constraints() {
__r = __f(__first, __second); // require operator()
}
_Func __f;
_First __first;
_Second __second;
_Return __r;
};
 
template <class _Func, class _First, class _Second>
struct _BinaryFunctionConcept<_Func, void, _First, _Second>
{
void __constraints() {
__f(__first, __second); // require operator()
}
_Func __f;
_First __first;
_Second __second;
};
 
template <class _Func, class _Arg>
struct _UnaryPredicateConcept
{
void __constraints() {
__aux_require_boolean_expr(__f(__arg)); // require op() returning bool
}
_Func __f;
_Arg __arg;
};
 
template <class _Func, class _First, class _Second>
struct _BinaryPredicateConcept
{
void __constraints() {
__aux_require_boolean_expr(__f(__a, __b)); // require op() returning bool
}
_Func __f;
_First __a;
_Second __b;
};
 
// use this when functor is used inside a container class like std::set
template <class _Func, class _First, class _Second>
struct _Const_BinaryPredicateConcept {
void __constraints() {
__const_constraints(__f);
}
void __const_constraints(const _Func& __fun) {
__function_requires<_BinaryPredicateConcept<_Func, _First, _Second> >();
// operator() must be a const member function
__aux_require_boolean_expr(__fun(__a, __b));
}
_Func __f;
_First __a;
_Second __b;
};
 
//===========================================================================
// Iterator Concepts
 
template <class _Tp>
struct _TrivialIteratorConcept
{
void __constraints() {
__function_requires< _DefaultConstructibleConcept<_Tp> >();
__function_requires< _AssignableConcept<_Tp> >();
__function_requires< _EqualityComparableConcept<_Tp> >();
typedef typename std::iterator_traits<_Tp>::value_type _V;
(void)*__i; // require dereference operator
}
_Tp __i;
};
 
template <class _Tp>
struct _Mutable_TrivialIteratorConcept
{
void __constraints() {
__function_requires< _TrivialIteratorConcept<_Tp> >();
*__i = *__j; // require dereference and assignment
}
_Tp __i, __j;
};
 
template <class _Tp>
struct _InputIteratorConcept
{
void __constraints() {
__function_requires< _TrivialIteratorConcept<_Tp> >();
// require iterator_traits typedef's
typedef typename std::iterator_traits<_Tp>::difference_type _D;
__function_requires< _SignedIntegerConcept<_D> >();
typedef typename std::iterator_traits<_Tp>::reference _R;
typedef typename std::iterator_traits<_Tp>::pointer _Pt;
typedef typename std::iterator_traits<_Tp>::iterator_category _Cat;
__function_requires< _ConvertibleConcept<
typename std::iterator_traits<_Tp>::iterator_category,
std::input_iterator_tag> >();
++__i; // require preincrement operator
__i++; // require postincrement operator
}
_Tp __i;
};
 
template <class _Tp, class _ValueT>
struct _OutputIteratorConcept
{
void __constraints() {
__function_requires< _AssignableConcept<_Tp> >();
++__i; // require preincrement operator
__i++; // require postincrement operator
*__i++ = __t; // require postincrement and assignment
}
_Tp __i;
_ValueT __t;
};
 
template <class _Tp>
struct _ForwardIteratorConcept
{
void __constraints() {
__function_requires< _InputIteratorConcept<_Tp> >();
__function_requires< _ConvertibleConcept<
typename std::iterator_traits<_Tp>::iterator_category,
std::forward_iterator_tag> >();
typedef typename std::iterator_traits<_Tp>::reference _R;
_R __r _IsUnused = *__i;
}
_Tp __i;
};
 
template <class _Tp>
struct _Mutable_ForwardIteratorConcept
{
void __constraints() {
__function_requires< _ForwardIteratorConcept<_Tp> >();
*__i++ = *__i; // require postincrement and assignment
}
_Tp __i;
};
 
template <class _Tp>
struct _BidirectionalIteratorConcept
{
void __constraints() {
__function_requires< _ForwardIteratorConcept<_Tp> >();
__function_requires< _ConvertibleConcept<
typename std::iterator_traits<_Tp>::iterator_category,
std::bidirectional_iterator_tag> >();
--__i; // require predecrement operator
__i--; // require postdecrement operator
}
_Tp __i;
};
 
template <class _Tp>
struct _Mutable_BidirectionalIteratorConcept
{
void __constraints() {
__function_requires< _BidirectionalIteratorConcept<_Tp> >();
__function_requires< _Mutable_ForwardIteratorConcept<_Tp> >();
*__i-- = *__i; // require postdecrement and assignment
}
_Tp __i;
};
 
 
template <class _Tp>
struct _RandomAccessIteratorConcept
{
void __constraints() {
__function_requires< _BidirectionalIteratorConcept<_Tp> >();
__function_requires< _ComparableConcept<_Tp> >();
__function_requires< _ConvertibleConcept<
typename std::iterator_traits<_Tp>::iterator_category,
std::random_access_iterator_tag> >();
// ??? We don't use _R, are we just checking for "referenceability"?
typedef typename std::iterator_traits<_Tp>::reference _R;
 
__i += __n; // require assignment addition operator
__i = __i + __n; __i = __n + __i; // require addition with difference type
__i -= __n; // require assignment subtraction op
__i = __i - __n; // require subtraction with
// difference type
__n = __i - __j; // require difference operator
(void)__i[__n]; // require element access operator
}
_Tp __a, __b;
_Tp __i, __j;
typename std::iterator_traits<_Tp>::difference_type __n;
};
 
template <class _Tp>
struct _Mutable_RandomAccessIteratorConcept
{
void __constraints() {
__function_requires< _RandomAccessIteratorConcept<_Tp> >();
__function_requires< _Mutable_BidirectionalIteratorConcept<_Tp> >();
__i[__n] = *__i; // require element access and assignment
}
_Tp __i;
typename std::iterator_traits<_Tp>::difference_type __n;
};
 
//===========================================================================
// Container Concepts
 
template <class _Container>
struct _ContainerConcept
{
typedef typename _Container::value_type _Value_type;
typedef typename _Container::difference_type _Difference_type;
typedef typename _Container::size_type _Size_type;
typedef typename _Container::const_reference _Const_reference;
typedef typename _Container::const_pointer _Const_pointer;
typedef typename _Container::const_iterator _Const_iterator;
 
void __constraints() {
__function_requires< _InputIteratorConcept<_Const_iterator> >();
__function_requires< _AssignableConcept<_Container> >();
const _Container __c;
__i = __c.begin();
__i = __c.end();
__n = __c.size();
__n = __c.max_size();
__b = __c.empty();
}
bool __b;
_Const_iterator __i;
_Size_type __n;
};
 
template <class _Container>
struct _Mutable_ContainerConcept
{
typedef typename _Container::value_type _Value_type;
typedef typename _Container::reference _Reference;
typedef typename _Container::iterator _Iterator;
typedef typename _Container::pointer _Pointer;
void __constraints() {
__function_requires< _ContainerConcept<_Container> >();
__function_requires< _AssignableConcept<_Value_type> >();
__function_requires< _InputIteratorConcept<_Iterator> >();
 
__i = __c.begin();
__i = __c.end();
__c.swap(__c2);
}
_Iterator __i;
_Container __c, __c2;
};
 
template <class _ForwardContainer>
struct _ForwardContainerConcept
{
void __constraints() {
__function_requires< _ContainerConcept<_ForwardContainer> >();
typedef typename _ForwardContainer::const_iterator _Const_iterator;
__function_requires< _ForwardIteratorConcept<_Const_iterator> >();
}
};
 
template <class _ForwardContainer>
struct _Mutable_ForwardContainerConcept
{
void __constraints() {
__function_requires< _ForwardContainerConcept<_ForwardContainer> >();
__function_requires< _Mutable_ContainerConcept<_ForwardContainer> >();
typedef typename _ForwardContainer::iterator _Iterator;
__function_requires< _Mutable_ForwardIteratorConcept<_Iterator> >();
}
};
 
template <class _ReversibleContainer>
struct _ReversibleContainerConcept
{
typedef typename _ReversibleContainer::const_iterator _Const_iterator;
typedef typename _ReversibleContainer::const_reverse_iterator
_Const_reverse_iterator;
 
void __constraints() {
__function_requires< _ForwardContainerConcept<_ReversibleContainer> >();
__function_requires< _BidirectionalIteratorConcept<_Const_iterator> >();
__function_requires<
_BidirectionalIteratorConcept<_Const_reverse_iterator> >();
 
const _ReversibleContainer __c;
_Const_reverse_iterator __i = __c.rbegin();
__i = __c.rend();
}
};
 
template <class _ReversibleContainer>
struct _Mutable_ReversibleContainerConcept
{
typedef typename _ReversibleContainer::iterator _Iterator;
typedef typename _ReversibleContainer::reverse_iterator _Reverse_iterator;
 
void __constraints() {
__function_requires<_ReversibleContainerConcept<_ReversibleContainer> >();
__function_requires<
_Mutable_ForwardContainerConcept<_ReversibleContainer> >();
__function_requires<_Mutable_BidirectionalIteratorConcept<_Iterator> >();
__function_requires<
_Mutable_BidirectionalIteratorConcept<_Reverse_iterator> >();
 
_Reverse_iterator __i = __c.rbegin();
__i = __c.rend();
}
_ReversibleContainer __c;
};
 
template <class _RandomAccessContainer>
struct _RandomAccessContainerConcept
{
typedef typename _RandomAccessContainer::size_type _Size_type;
typedef typename _RandomAccessContainer::const_reference _Const_reference;
typedef typename _RandomAccessContainer::const_iterator _Const_iterator;
typedef typename _RandomAccessContainer::const_reverse_iterator
_Const_reverse_iterator;
 
void __constraints() {
__function_requires<
_ReversibleContainerConcept<_RandomAccessContainer> >();
__function_requires< _RandomAccessIteratorConcept<_Const_iterator> >();
__function_requires<
_RandomAccessIteratorConcept<_Const_reverse_iterator> >();
 
const _RandomAccessContainer __c;
_Const_reference __r _IsUnused = __c[__n];
}
_Size_type __n;
};
 
template <class _RandomAccessContainer>
struct _Mutable_RandomAccessContainerConcept
{
typedef typename _RandomAccessContainer::size_type _Size_type;
typedef typename _RandomAccessContainer::reference _Reference;
typedef typename _RandomAccessContainer::iterator _Iterator;
typedef typename _RandomAccessContainer::reverse_iterator _Reverse_iterator;
 
void __constraints() {
__function_requires<
_RandomAccessContainerConcept<_RandomAccessContainer> >();
__function_requires<
_Mutable_ReversibleContainerConcept<_RandomAccessContainer> >();
__function_requires< _Mutable_RandomAccessIteratorConcept<_Iterator> >();
__function_requires<
_Mutable_RandomAccessIteratorConcept<_Reverse_iterator> >();
 
_Reference __r _IsUnused = __c[__i];
}
_Size_type __i;
_RandomAccessContainer __c;
};
 
// A Sequence is inherently mutable
template <class _Sequence>
struct _SequenceConcept
{
typedef typename _Sequence::reference _Reference;
typedef typename _Sequence::const_reference _Const_reference;
 
void __constraints() {
// Matt Austern's book puts DefaultConstructible here, the C++
// standard places it in Container
// function_requires< DefaultConstructible<Sequence> >();
__function_requires< _Mutable_ForwardContainerConcept<_Sequence> >();
__function_requires< _DefaultConstructibleConcept<_Sequence> >();
 
_Sequence
__c(__n) _IsUnused,
__c2(__n, __t) _IsUnused,
__c3(__first, __last) _IsUnused;
 
__c.insert(__p, __t);
__c.insert(__p, __n, __t);
__c.insert(__p, __first, __last);
 
__c.erase(__p);
__c.erase(__p, __q);
 
_Reference __r _IsUnused = __c.front();
 
__const_constraints(__c);
}
void __const_constraints(const _Sequence& __c) {
_Const_reference __r _IsUnused = __c.front();
}
typename _Sequence::value_type __t;
typename _Sequence::size_type __n;
typename _Sequence::value_type *__first, *__last;
typename _Sequence::iterator __p, __q;
};
 
template <class _FrontInsertionSequence>
struct _FrontInsertionSequenceConcept
{
void __constraints() {
__function_requires< _SequenceConcept<_FrontInsertionSequence> >();
 
__c.push_front(__t);
__c.pop_front();
}
_FrontInsertionSequence __c;
typename _FrontInsertionSequence::value_type __t;
};
 
template <class _BackInsertionSequence>
struct _BackInsertionSequenceConcept
{
typedef typename _BackInsertionSequence::reference _Reference;
typedef typename _BackInsertionSequence::const_reference _Const_reference;
 
void __constraints() {
__function_requires< _SequenceConcept<_BackInsertionSequence> >();
 
__c.push_back(__t);
__c.pop_back();
_Reference __r _IsUnused = __c.back();
}
void __const_constraints(const _BackInsertionSequence& __c) {
_Const_reference __r _IsUnused = __c.back();
};
_BackInsertionSequence __c;
typename _BackInsertionSequence::value_type __t;
};
 
template <class _AssociativeContainer>
struct _AssociativeContainerConcept
{
void __constraints() {
__function_requires< _ForwardContainerConcept<_AssociativeContainer> >();
__function_requires<
_DefaultConstructibleConcept<_AssociativeContainer> >();
__i = __c.find(__k);
__r = __c.equal_range(__k);
__c.erase(__k);
__c.erase(__i);
__c.erase(__r.first, __r.second);
__const_constraints(__c);
}
void __const_constraints(const _AssociativeContainer& __c) {
__ci = __c.find(__k);
__n = __c.count(__k);
__cr = __c.equal_range(__k);
}
typedef typename _AssociativeContainer::iterator _Iterator;
typedef typename _AssociativeContainer::const_iterator _Const_iterator;
 
_AssociativeContainer __c;
_Iterator __i;
std::pair<_Iterator,_Iterator> __r;
_Const_iterator __ci;
std::pair<_Const_iterator,_Const_iterator> __cr;
typename _AssociativeContainer::key_type __k;
typename _AssociativeContainer::size_type __n;
};
 
template <class _UniqueAssociativeContainer>
struct _UniqueAssociativeContainerConcept
{
void __constraints() {
__function_requires<
_AssociativeContainerConcept<_UniqueAssociativeContainer> >();
_UniqueAssociativeContainer __c(__first, __last);
__pos_flag = __c.insert(__t);
__c.insert(__first, __last);
}
std::pair<typename _UniqueAssociativeContainer::iterator, bool> __pos_flag;
typename _UniqueAssociativeContainer::value_type __t;
typename _UniqueAssociativeContainer::value_type *__first, *__last;
};
 
template <class _MultipleAssociativeContainer>
struct _MultipleAssociativeContainerConcept
{
void __constraints() {
__function_requires<
_AssociativeContainerConcept<_MultipleAssociativeContainer> >();
 
_MultipleAssociativeContainer __c(__first, __last);
__pos = __c.insert(__t);
__c.insert(__first, __last);
 
}
typename _MultipleAssociativeContainer::iterator __pos _IsUnused;
typename _MultipleAssociativeContainer::value_type __t;
typename _MultipleAssociativeContainer::value_type *__first, *__last;
};
 
template <class _SimpleAssociativeContainer>
struct _SimpleAssociativeContainerConcept
{
void __constraints() {
__function_requires<
_AssociativeContainerConcept<_SimpleAssociativeContainer> >();
typedef typename _SimpleAssociativeContainer::key_type _Key_type;
typedef typename _SimpleAssociativeContainer::value_type _Value_type;
typedef typename _Aux_require_same<_Key_type, _Value_type>::_Type
_Requqired;
}
};
 
template <class _SimpleAssociativeContainer>
struct _PairAssociativeContainerConcept
{
void __constraints() {
__function_requires<
_AssociativeContainerConcept<_SimpleAssociativeContainer> >();
typedef typename _SimpleAssociativeContainer::key_type _Key_type;
typedef typename _SimpleAssociativeContainer::value_type _Value_type;
typedef typename _SimpleAssociativeContainer::mapped_type _Mapped_type;
typedef std::pair<const _Key_type, _Mapped_type> _Required_value_type;
typedef typename _Aux_require_same<_Value_type,
_Required_value_type>::_Type _Required;
}
};
 
template <class _SortedAssociativeContainer>
struct _SortedAssociativeContainerConcept
{
void __constraints() {
__function_requires<
_AssociativeContainerConcept<_SortedAssociativeContainer> >();
__function_requires<
_ReversibleContainerConcept<_SortedAssociativeContainer> >();
 
_SortedAssociativeContainer
__c(__kc) _IsUnused,
__c2(__first, __last) _IsUnused,
__c3(__first, __last, __kc) _IsUnused;
 
__p = __c.upper_bound(__k);
__p = __c.lower_bound(__k);
__r = __c.equal_range(__k);
__c.insert(__p, __t);
}
void __const_constraints(const _SortedAssociativeContainer& __c) {
__kc = __c.key_comp();
__vc = __c.value_comp();
 
__cp = __c.upper_bound(__k);
__cp = __c.lower_bound(__k);
__cr = __c.equal_range(__k);
}
typename _SortedAssociativeContainer::key_compare __kc;
typename _SortedAssociativeContainer::value_compare __vc;
typename _SortedAssociativeContainer::value_type __t;
typename _SortedAssociativeContainer::key_type __k;
typedef typename _SortedAssociativeContainer::iterator _Iterator;
typedef typename _SortedAssociativeContainer::const_iterator
_Const_iterator;
 
_Iterator __p;
_Const_iterator __cp;
std::pair<_Iterator,_Iterator> __r;
std::pair<_Const_iterator,_Const_iterator> __cr;
typename _SortedAssociativeContainer::value_type *__first, *__last;
};
 
// HashedAssociativeContainer
 
} // namespace __gnu_cxx
 
#undef _IsUnused
 
#endif // _GLIBCPP_BOOST_CONCEPT_CHECK
 
 
/contrib/media/updf/include/bits/c++config
0,0 → 1,112
// Predefined symbols and macros -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CPPCONFIG
#define _CPP_CPPCONFIG 1
 
// Pick up any OS-specific definitions.
#include <bits/os_defines.h>
 
// The current version of the C++ library in compressed ISO date format.
#define __GLIBCPP__ 20010615
 
// This is necessary until GCC supports separate template
// compilation.
#define _GLIBCPP_NO_TEMPLATE_EXPORT 1
 
// This is a hack around not having either pre-compiled headers or
// export compilation. If defined, the io, string, and valarray
// headers will include all the necessary bits. If not defined, the
// implementation optimizes the headers for the most commonly-used
// types. For the io library, this means that larger, out-of-line
// member functions are only declared, and definitions are not parsed
// by the compiler, but instead instantiated into the library binary.
#define _GLIBCPP_FULLY_COMPLIANT_HEADERS 1
 
// Define this to permit user-level control of the expansion of string
// buffers (via a fn pointer), see basic_string.* for more.
//#define _GLIBCPP_ALLOC_CONTROL
 
// To enable older, ARM-style iostreams and other anachronisms use this.
//#define _GLIBCPP_DEPRECATED 1
 
// Use corrected code from the committee library group's issues list.
#define _GLIBCPP_RESOLVE_LIB_DEFECTS 1
 
// Enable concept checking code from the boost libraries.
//#define _GLIBCPP_CONCEPT_CHECKS 1
 
// Map gthr.h abstraction to that required for STL. Do not key off of
// __GTHREADS at this point since we haven't seen the correct symbol
// yet, instead setup so that include/bits/stl_threads.h will know to
// include gthr.h instead of any other type of thread support. Note:
// that gthr.h may well map to gthr-single.h which is a correct way to
// express no threads support in gcc. As a user, do not define
// _NOTHREADS without consideration of the consequences (e.g. it is an
// internal ABI change).
#define __STL_GTHREADS
#define __STL_THREADS
#define __STL_VOLATILE volatile
 
// This is also a user hook, but via -f[no-]exceptions, not direct #defines.
#ifdef __EXCEPTIONS
# define __STL_USE_EXCEPTIONS
# define __STL_TRY try
# define __STL_CATCH_ALL catch(...)
# define __STL_THROW(x) throw x
# define __STL_RETHROW throw
# define __STL_NOTHROW throw()
# define __STL_UNWIND(action) catch(...) { action; throw; }
#else
# define __STL_TRY
# define __STL_CATCH_ALL if (false)
# define __STL_THROW(x)
# define __STL_RETHROW
# define __STL_NOTHROW
# define __STL_UNWIND(action)
#endif
 
// Default to the typically high-speed, pool-based allocator (as
// libstdc++-v2) instead of the malloc-based allocator (libstdc++-v3
// snapshots). See libstdc++-v3/docs/html/17_intro/howto.html for
// details on why you don't want to override this setting. Ensure
// that threads are properly configured on your platform before
// assigning blame to the STL container-memory allocator. After doing
// so, please report any possible issues to libstdc++@gcc.gnu.org .
// Do not blindly #define __USE_MALLOC here or on the command line.
 
// The remainder of the prewritten config is mostly automatic; all the
// user hooks are listed above.
 
// XXX
// Only used in the SGI rope extensions; this is from stl_config.h and
// should be cleaned up.
# define __stl_assert(expr)
 
// End of prewritten config; the discovered settings follow.
/contrib/media/updf/include/bits/char_traits.h
0,0 → 1,275
// Character Traits for use by standard string and iostream -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 21 Strings library
//
 
#ifndef _CPP_BITS_CHAR_TRAITS_H
#define _CPP_BITS_CHAR_TRAITS_H 1
 
#pragma GCC system_header
 
#include <bits/std_cstring.h> // For memmove, memset, memchr
#include <bits/fpos.h> // For streampos
 
namespace std
{
// 21.1.2 Basis for explicit _Traits specialization
// NB: That for any given actual character type this definition is
// probably wrong.
template<class _CharT>
struct char_traits
{
typedef _CharT char_type;
// Unsigned as wint_t in unsigned.
typedef unsigned long int_type;
typedef streampos pos_type;
typedef streamoff off_type;
typedef mbstate_t state_type;
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
 
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
 
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
 
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{
for (size_t __i = 0; __i < __n; ++__i)
if (!eq(__s1[__i], __s2[__i]))
return lt(__s1[__i], __s2[__i]) ? -1 : 1;
return 0;
}
 
static size_t
length(const char_type* __s)
{
const char_type* __p = __s;
while (*__p) ++__p;
return (__p - __s);
}
 
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{
for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
if (*__p == __a) return __p;
return 0;
}
 
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
 
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
 
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{
for (char_type* __p = __s; __p < __s + __n; ++__p)
assign(*__p, __a);
return __s;
}
 
static char_type
to_char_type(const int_type& __c)
{ return char_type(__c); }
 
static int_type
to_int_type(const char_type& __c) { return int_type(__c); }
 
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
 
static int_type
eof() { return static_cast<int_type>(-1); }
 
static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? int_type(0) : __c; }
};
 
 
// 21.1.4 char_traits specializations
template<>
struct char_traits<char>
{
typedef char char_type;
typedef int int_type;
typedef streampos pos_type;
typedef streamoff off_type;
typedef mbstate_t state_type;
 
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
 
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
 
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
 
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{ return memcmp(__s1, __s2, __n); }
 
static size_t
length(const char_type* __s)
{ return strlen(__s); }
 
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{ return static_cast<const char_type*>(memchr(__s, __a, __n)); }
 
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(memmove(__s1, __s2, __n)); }
 
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }
 
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{ return static_cast<char_type*>(memset(__s, __a, __n)); }
 
static char_type
to_char_type(const int_type& __c)
{ return static_cast<char_type>(__c); }
 
// To keep both the byte 0xff and the eof symbol 0xffffffff
// from ending up as 0xffffffff.
static int_type
to_int_type(const char_type& __c)
{ return static_cast<int_type>(static_cast<unsigned char>(__c)); }
 
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
 
static int_type
eof() { return static_cast<int_type>(EOF); }
 
static int_type
not_eof(const int_type& __c)
{ return (__c == eof()) ? 0 : __c; }
};
 
 
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
struct char_traits<wchar_t>
{
typedef wchar_t char_type;
typedef wint_t int_type;
typedef streamoff off_type;
typedef wstreampos pos_type;
typedef mbstate_t state_type;
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
 
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
 
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
 
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemcmp(__s1, __s2, __n); }
 
static size_t
length(const char_type* __s)
{ return wcslen(__s); }
 
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{ return wmemchr(__s, __a, __n); }
 
static char_type*
move(char_type* __s1, const char_type* __s2, int_type __n)
{ return wmemmove(__s1, __s2, __n); }
 
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemcpy(__s1, __s2, __n); }
 
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{ return wmemset(__s, __a, __n); }
 
static char_type
to_char_type(const int_type& __c) { return char_type(__c); }
 
static int_type
to_int_type(const char_type& __c) { return int_type(__c); }
 
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
 
static int_type
eof() { return static_cast<int_type>(WEOF); }
 
static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? 0 : __c; }
};
#endif //_GLIBCPP_USE_WCHAR_T
 
template<typename _CharT, typename _Traits>
struct _Char_traits_match
{
_CharT _M_c;
_Char_traits_match(_CharT const& __c) : _M_c(__c) { }
 
bool
operator()(_CharT const& __a) { return _Traits::eq(_M_c, __a); }
};
} // namespace std
 
#endif
/contrib/media/updf/include/bits/codecvt.h
0,0 → 1,717
// Locale support (codecvt) -*- C++ -*-
 
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 22.2.1.5 Template class codecvt
//
 
// Warning: this file is not meant for user inclusion. Use <locale>.
 
// Written by Benjamin Kosnik <bkoz@cygnus.com>
 
#ifndef _CPP_BITS_CODECVT_H
#define _CPP_BITS_CODECVT_H 1
 
#pragma GCC system_header
 
// XXX
// __enc_traits may need to move up the locale header hierarchy,
// depending on if ctype ends up using it.
 
#ifdef _GLIBCPP_USE_WCHAR_T
// Extensions to use icov for dealing with character encodings,
// including conversions and comparisons between various character
// sets. This object encapsulates data that may need to be shared between
// char_traits, codecvt and ctype.
 
#if _GLIBCPP_USE_SHADOW_HEADERS
using _C_legacy::CODESET;
#endif
 
class __enc_traits
{
public:
// Types:
// NB: A conversion descriptor subsumes and enhances the
// functionality of a simple state type such as mbstate_t.
typedef iconv_t __desc_type;
protected:
// Data Members:
// Max size of charset encoding name
static const int _S_max_size = 32;
// Name of internal character set encoding.
char _M_int_enc[_S_max_size];
// Name of external character set encoding.
char _M_ext_enc[_S_max_size];
 
// Conversion descriptor between external encoding to internal encoding.
__desc_type _M_in_desc;
// Conversion descriptor between internal encoding to external encoding.
__desc_type _M_out_desc;
 
// Details the byte-order marker for the external encoding, if necessary.
int _M_ext_bom;
 
// Details the byte-order marker for the internal encoding, if necessary.
int _M_int_bom;
 
public:
__enc_traits()
: _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
{
// __intc_end = whatever we are using internally, which is
// UCS4 (linux)
// UCS2 == UNICODE (microsoft, java, aix, whatever...)
// XXX Currently don't know how to get this data from target system...
strcpy(_M_int_enc, "UCS4");
 
// __extc_end = external codeset in current locale
strcpy(_M_ext_enc, nl_langinfo(CODESET));
}
 
__enc_traits(const char* __int, const char* __ext, int __ibom = 0,
int __ebom = 0)
: _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
{
strncpy(_M_int_enc, __int, _S_max_size);
strncpy(_M_ext_enc, __ext, _S_max_size);
}
 
// 21.1.2 traits typedefs
// p4
// typedef STATE_T state_type
// requires: state_type shall meet the requirements of
// CopyConstructible types (20.1.3)
__enc_traits(const __enc_traits& __obj)
{
strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
_M_ext_bom = __obj._M_ext_bom;
_M_int_bom = __obj._M_int_bom;
}
 
~__enc_traits()
{
iconv_close(_M_in_desc);
iconv_close(_M_out_desc);
}
 
// Initializes
void
_M_init()
{
_M_in_desc = iconv_open(_M_int_enc, _M_ext_enc);
_M_out_desc = iconv_open(_M_ext_enc, _M_int_enc);
if (_M_out_desc == iconv_t(-1) || _M_in_desc == iconv_t(-1))
{
// XXX Extended error checking.
}
}
 
bool
_M_good()
{
return _M_out_desc && _M_in_desc
&& _M_out_desc != iconv_t(-1) && _M_in_desc != iconv_t(-1);
}
 
const __desc_type*
_M_get_in_descriptor()
{ return &_M_in_desc; }
 
const __desc_type*
_M_get_out_descriptor()
{ return &_M_out_desc; }
 
const char*
_M_get_internal_enc()
{ return _M_int_enc; }
 
const char*
_M_get_external_enc()
{ return _M_ext_enc; }
 
int
_M_get_external_bom()
{ return _M_ext_bom; }
 
int
_M_get_internal_bom()
{ return _M_int_bom; }
};
#endif //_GLIBCPP_USE_WCHAR_T
 
 
// 22.2.1.5 Template class codecvt
class codecvt_base
{
public:
enum result
{
ok,
partial,
error,
noconv
};
};
 
// Template class __codecvt_abstract_base
// NB: An abstract base class that fills in the public inlines, so
// that the specializations don't have to re-copy the public
// interface.
template<typename _InternT, typename _ExternT, typename _StateT>
class __codecvt_abstract_base
: public locale::facet, public codecvt_base
{
public:
// Types:
typedef codecvt_base::result result;
typedef _InternT intern_type;
typedef _ExternT extern_type;
typedef _StateT state_type;
// 22.2.1.5.1 codecvt members
result
out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const
{
return this->do_out(__state, __from, __from_end, __from_next,
__to, __to_end, __to_next);
}
 
result
unshift(state_type& __state, extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const
{ return this->do_unshift(__state, __to,__to_end,__to_next); }
 
result
in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const
{
return this->do_in(__state, __from, __from_end, __from_next,
__to, __to_end, __to_next);
}
 
int
encoding() const throw()
{ return this->do_encoding(); }
 
bool
always_noconv() const throw()
{ return this->do_always_noconv(); }
 
int
length(const state_type& __state, const extern_type* __from,
const extern_type* __end, size_t __max) const
{ return this->do_length(__state, __from, __end, __max); }
 
int
max_length() const throw()
{ return this->do_max_length(); }
 
protected:
explicit
__codecvt_abstract_base(size_t __refs = 0) : locale::facet(__refs) { }
 
virtual
~__codecvt_abstract_base() { }
 
virtual result
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const = 0;
 
virtual result
do_unshift(state_type& __state, extern_type* __to,
extern_type* __to_end, extern_type*& __to_next) const = 0;
virtual result
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const = 0;
virtual int
do_encoding() const throw() = 0;
 
virtual bool
do_always_noconv() const throw() = 0;
 
virtual int
do_length(const state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const = 0;
 
virtual int
do_max_length() const throw() = 0;
};
 
// 22.2.1.5 Template class codecvt
// NB: Generic, mostly useless implementation.
template<typename _InternT, typename _ExternT, typename _StateT>
class codecvt
: public __codecvt_abstract_base<_InternT, _ExternT, _StateT>
{
public:
// Types:
typedef codecvt_base::result result;
typedef _InternT intern_type;
typedef _ExternT extern_type;
typedef _StateT state_type;
 
// Data Members:
static locale::id id;
 
explicit
codecvt(size_t __refs = 0)
: __codecvt_abstract_base<_InternT,_ExternT,_StateT> (__refs) { }
 
protected:
virtual
~codecvt() { }
};
 
template<typename _InternT, typename _ExternT, typename _StateT>
locale::id codecvt<_InternT, _ExternT, _StateT>::id;
 
#ifdef _GLIBCPP_USE_WCHAR_T
// partial specialization
// This specialization takes advantage of iconv to provide code
// conversions between a large number of character encodings.
template<typename _InternT, typename _ExternT>
class codecvt<_InternT, _ExternT, __enc_traits>
: public __codecvt_abstract_base<_InternT, _ExternT, __enc_traits>
{
public:
// Types:
typedef codecvt_base::result result;
typedef _InternT intern_type;
typedef _ExternT extern_type;
typedef __enc_traits state_type;
typedef __enc_traits::__desc_type __desc_type;
typedef __enc_traits __enc_type;
 
// Data Members:
static locale::id id;
 
explicit
codecvt(size_t __refs = 0)
: __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
{ }
 
explicit
codecvt(__enc_type* __enc, size_t __refs = 0)
: __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
{ }
 
protected:
virtual
~codecvt() { }
 
virtual result
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const;
 
virtual result
do_unshift(state_type& __state, extern_type* __to,
extern_type* __to_end, extern_type*& __to_next) const;
 
virtual result
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const;
 
virtual int
do_encoding() const throw();
 
virtual bool
do_always_noconv() const throw();
 
virtual int
do_length(const state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const;
 
virtual int
do_max_length() const throw();
};
 
template<typename _InternT, typename _ExternT>
locale::id
codecvt<_InternT, _ExternT, __enc_traits>::id;
 
// This adaptor works around the signature problems of the second
// argument to iconv(): SUSv2 and others use 'const char**', but glibc 2.2
// uses 'char**', which is what the standard is (apparently) due to use
// in the future. Using this adaptor, g++ will do the work for us.
template<typename _T>
inline size_t
__iconv_adaptor(size_t(*iconv_func)(iconv_t, _T, size_t*, char**, size_t*),
iconv_t cd, char** inbuf, size_t* inbytesleft,
char** outbuf, size_t* outbytesleft)
{
return iconv_func(cd, (_T)inbuf, inbytesleft, outbuf, outbytesleft);
}
 
template<typename _InternT, typename _ExternT>
codecvt_base::result
codecvt<_InternT, _ExternT, __enc_traits>::
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const
{
result __ret = error;
if (__state._M_good())
{
typedef state_type::__desc_type __desc_type;
const __desc_type* __desc = __state._M_get_out_descriptor();
const size_t __fmultiple = sizeof(intern_type) / sizeof(char);
size_t __flen = __fmultiple * (__from_end - __from);
const size_t __tmultiple = sizeof(extern_type) / sizeof(char);
size_t __tlen = __tmultiple * (__to_end - __to);
// Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to);
char* __cfrom;
size_t __conv;
 
// Some encodings need a byte order marker as the first item
// in the byte stream, to designate endian-ness. The default
// value for the byte order marker is NULL, so if this is
// the case, it's not necessary and we can just go on our
// merry way.
int __int_bom = __state._M_get_internal_bom();
if (__int_bom)
{
size_t __size = __from_end - __from;
intern_type* __cfixed = static_cast<intern_type*>(__builtin_alloca(sizeof(intern_type) * (__size + 1)));
__cfixed[0] = static_cast<intern_type>(__int_bom);
char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
__cfrom = reinterpret_cast<char*>(__cfixed);
__conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
&__flen, &__cto, &__tlen);
}
else
{
intern_type* __cfixed = const_cast<intern_type*>(__from);
__cfrom = reinterpret_cast<char*>(__cfixed);
__conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
&__flen, &__cto, &__tlen);
}
 
if (__conv != size_t(-1))
{
__from_next = reinterpret_cast<const intern_type*>(__cfrom);
__to_next = reinterpret_cast<extern_type*>(__cto);
__ret = ok;
}
else
{
if (__flen < static_cast<size_t>(__from_end - __from))
{
__from_next = reinterpret_cast<const intern_type*>(__cfrom);
__to_next = reinterpret_cast<extern_type*>(__cto);
__ret = partial;
}
else
__ret = error;
}
}
return __ret;
}
 
template<typename _InternT, typename _ExternT>
codecvt_base::result
codecvt<_InternT, _ExternT, __enc_traits>::
do_unshift(state_type& __state, extern_type* __to,
extern_type* __to_end, extern_type*& __to_next) const
{
result __ret = error;
if (__state._M_good())
{
typedef state_type::__desc_type __desc_type;
const __desc_type* __desc = __state._M_get_in_descriptor();
const size_t __tmultiple = sizeof(intern_type) / sizeof(char);
size_t __tlen = __tmultiple * (__to_end - __to);
// Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to);
size_t __conv = __iconv_adaptor(iconv,*__desc, NULL, NULL,
&__cto, &__tlen);
if (__conv != size_t(-1))
{
__to_next = reinterpret_cast<extern_type*>(__cto);
if (__tlen == __tmultiple * (__to_end - __to))
__ret = noconv;
else if (__tlen == 0)
__ret = ok;
else
__ret = partial;
}
else
__ret = error;
}
return __ret;
}
template<typename _InternT, typename _ExternT>
codecvt_base::result
codecvt<_InternT, _ExternT, __enc_traits>::
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const
{
result __ret = error;
if (__state._M_good())
{
typedef state_type::__desc_type __desc_type;
const __desc_type* __desc = __state._M_get_in_descriptor();
const size_t __fmultiple = sizeof(extern_type) / sizeof(char);
size_t __flen = __fmultiple * (__from_end - __from);
const size_t __tmultiple = sizeof(intern_type) / sizeof(char);
size_t __tlen = __tmultiple * (__to_end - __to);
// Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to);
char* __cfrom;
size_t __conv;
 
// Some encodings need a byte order marker as the first item
// in the byte stream, to designate endian-ness. The default
// value for the byte order marker is NULL, so if this is
// the case, it's not necessary and we can just go on our
// merry way.
int __ext_bom = __state._M_get_external_bom();
if (__ext_bom)
{
size_t __size = __from_end - __from;
extern_type* __cfixed = static_cast<extern_type*>(__builtin_alloca(sizeof(extern_type) * (__size + 1)));
__cfixed[0] = static_cast<extern_type>(__ext_bom);
char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
__cfrom = reinterpret_cast<char*>(__cfixed);
__conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
&__flen, &__cto, &__tlen);
}
else
{
extern_type* __cfixed = const_cast<extern_type*>(__from);
__cfrom = reinterpret_cast<char*>(__cfixed);
__conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
&__flen, &__cto, &__tlen);
}
 
if (__conv != size_t(-1))
{
__from_next = reinterpret_cast<const extern_type*>(__cfrom);
__to_next = reinterpret_cast<intern_type*>(__cto);
__ret = ok;
}
else
{
if (__flen < static_cast<size_t>(__from_end - __from))
{
__from_next = reinterpret_cast<const extern_type*>(__cfrom);
__to_next = reinterpret_cast<intern_type*>(__cto);
__ret = partial;
}
else
__ret = error;
}
}
return __ret;
}
template<typename _InternT, typename _ExternT>
int
codecvt<_InternT, _ExternT, __enc_traits>::
do_encoding() const throw()
{ return 0; }
template<typename _InternT, typename _ExternT>
bool
codecvt<_InternT, _ExternT, __enc_traits>::
do_always_noconv() const throw()
{ return false; }
template<typename _InternT, typename _ExternT>
int
codecvt<_InternT, _ExternT, __enc_traits>::
do_length(const state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const
{ return min(__max, static_cast<size_t>(__end - __from)); }
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 74. Garbled text for codecvt::do_max_length
template<typename _InternT, typename _ExternT>
int
codecvt<_InternT, _ExternT, __enc_traits>::
do_max_length() const throw()
{ return 1; }
#endif
#endif /* _GLIBCPP_USE_WCHAR_T */
 
// codecvt<char, char, mbstate_t> required specialization
template<>
class codecvt<char, char, mbstate_t>
: public __codecvt_abstract_base<char, char, mbstate_t>
{
public:
// Types:
typedef char intern_type;
typedef char extern_type;
typedef mbstate_t state_type;
 
// Data Members:
static locale::id id;
 
explicit
codecvt(size_t __refs = 0);
 
protected:
virtual
~codecvt();
 
virtual result
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const;
 
virtual result
do_unshift(state_type& __state, extern_type* __to,
extern_type* __to_end, extern_type*& __to_next) const;
 
virtual result
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const;
 
virtual int
do_encoding() const throw();
 
virtual bool
do_always_noconv() const throw();
 
virtual int
do_length(const state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const;
 
virtual int
do_max_length() const throw();
};
 
#ifdef _GLIBCPP_USE_WCHAR_T
// codecvt<wchar_t, char, mbstate_t> required specialization
template<>
class codecvt<wchar_t, char, mbstate_t>
: public __codecvt_abstract_base<wchar_t, char, mbstate_t>
{
public:
// Types:
typedef wchar_t intern_type;
typedef char extern_type;
typedef mbstate_t state_type;
 
// Data Members:
static locale::id id;
 
explicit
codecvt(size_t __refs = 0);
 
protected:
virtual
~codecvt();
 
virtual result
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const;
 
virtual result
do_unshift(state_type& __state,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const;
 
virtual result
do_in(state_type& __state,
const extern_type* __from, const extern_type* __from_end,
const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const;
 
virtual
int do_encoding() const throw();
 
virtual
bool do_always_noconv() const throw();
 
virtual
int do_length(const state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const;
 
virtual int
do_max_length() const throw();
};
#endif //_GLIBCPP_USE_WCHAR_T
 
// 22.2.1.6 Template class codecvt_byname
template<typename _InternT, typename _ExternT, typename _StateT>
class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT>
{
public:
explicit
codecvt_byname(const char*, size_t __refs = 0)
: codecvt<_InternT, _ExternT, _StateT>(__refs) { }
protected:
virtual
~codecvt_byname() { }
};
 
#endif // _CPP_BITS_CODECVT_H
 
// Local Variables:
// mode:c++
// End:
 
/contrib/media/updf/include/bits/concept_check.h
0,0 → 1,81
// Concept-checking control -*- C++ -*-
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _GLIBCPP_CONCEPT_CHECK
#define _GLIBCPP_CONCEPT_CHECK 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
 
// All places in libstdc++-v3 where these are used, or /might/ be used, or
// don't need to be used, or perhaps /should/ be used, are commented with
// "concept requirements" (and maybe some more text). So grep like crazy
// if you're looking for additional places to use these.
 
// Concept-checking code is off by default unless users turn it on via
// configure options or editing c++config.h.
 
#ifndef _GLIBCPP_CONCEPT_CHECKS
 
#define __glibcpp_function_requires(...)
#define __glibcpp_class_requires(_a,_b)
#define __glibcpp_class_requires2(_a,_b,_c)
#define __glibcpp_class_requires3(_a,_b,_c,_d)
#define __glibcpp_class_requires4(_a,_b,_c,_d,_e)
 
#else // the checks are on
 
#include <bits/boost_concept_check.h>
 
// Note that the obvious and elegant approach of
//
//#define glibcpp_function_requires(C) \
// boost::function_requires< boost::C >()
//
// won't work due to concept templates with more than one parameter, e.g.,
// BinaryPredicateConcept. The preprocessor tries to split things up on
// the commas in the template argument list. We can't use an inner pair of
// parenthesis to hide the commas, because "boost::(Temp<Foo,Bar>)" isn't
// a valid instantiation pattern. Thus, we steal a feature from C99.
 
#define __glibcpp_function_requires(...) \
__gnu_cxx::__function_requires< __gnu_cxx::__VA_ARGS__ >()
#define __glibcpp_class_requires(_a,_C) \
_GLIBCPP_CLASS_REQUIRES(_a, __gnu_cxx, _C)
#define __glibcpp_class_requires2(_a,_b,_C) \
_GLIBCPP_CLASS_REQUIRES2(_a, _b, __gnu_cxx, _C)
#define __glibcpp_class_requires3(_a,_b,_c,_C) \
_GLIBCPP_CLASS_REQUIRES3(_a, _b, _c, __gnu_cxx, _C)
#define __glibcpp_class_requires4(_a,_b,_c,_d,_C) \
_GLIBCPP_CLASS_REQUIRES4(_a, _b, _c, _d, __gnu_cxx, _C)
 
#endif // enable/disable
 
#endif // _GLIBCPP_CONCEPT_CHECK
/contrib/media/updf/include/bits/concept_checks.h
0,0 → 1,811
/*
* Copyright (c) 1999
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef __CONCEPT_CHECKS_H
#define __CONCEPT_CHECKS_H
 
/*
Use these macro like assertions, but they assert properties
on types (usually template arguments). In technical terms they
verify whether a type "models" a "concept".
 
This set of requirements and the terminology used here is derived
from the book "Generic Programming and the STL" by Matt Austern
(Addison Wesley). For further information please consult that
book. The requirements also are intended to match the ANSI/ISO C++
standard.
 
This file covers the basic concepts and the iterator concepts.
There are several other files that provide the requirements
for the STL containers:
container_concepts.h
sequence_concepts.h
assoc_container_concepts.h
 
Jeremy Siek, 1999
 
TO DO:
- some issues with regards to concept classification and mutability
including AssociativeContianer -> ForwardContainer
and SortedAssociativeContainer -> ReversibleContainer
- HashedAssociativeContainer
- Allocator
- Function Object Concepts
 
*/
 
#ifndef __STL_USE_CONCEPT_CHECKS
 
// Some compilers lack the features that are necessary for concept checks.
// On those compilers we define the concept check macros to do nothing.
#define __STL_REQUIRES(__type_var, __concept) do {} while(0)
#define __STL_CLASS_REQUIRES(__type_var, __concept) \
static int __##__type_var##_##__concept
#define __STL_CONVERTIBLE(__type_x, __type_y) do {} while(0)
#define __STL_REQUIRES_SAME_TYPE(__type_x, __type_y) do {} while(0)
#define __STL_CLASS_REQUIRES_SAME_TYPE(__type_x, __type_y) \
static int __##__type_x##__type_y##_require_same_type
#define __STL_GENERATOR_CHECK(__func, __ret) do {} while(0)
#define __STL_CLASS_GENERATOR_CHECK(__func, __ret) \
static int __##__func##__ret##_generator_check
#define __STL_UNARY_FUNCTION_CHECK(__func, __ret, __arg) do {} while(0)
#define __STL_CLASS_UNARY_FUNCTION_CHECK(__func, __ret, __arg) \
static int __##__func##__ret##__arg##_unary_function_check
#define __STL_BINARY_FUNCTION_CHECK(__func, __ret, __first, __second) \
do {} while(0)
#define __STL_CLASS_BINARY_FUNCTION_CHECK(__func, __ret, __first, __second) \
static int __##__func##__ret##__first##__second##_binary_function_check
#define __STL_REQUIRES_BINARY_OP(__opname, __ret, __first, __second) \
do {} while(0)
#define __STL_CLASS_REQUIRES_BINARY_OP(__opname, __ret, __first, __second) \
static int __##__opname##__ret##__first##__second##_require_binary_op
 
#else /* __STL_USE_CONCEPT_CHECKS */
 
// This macro tests whether the template argument "__type_var"
// satisfies the requirements of "__concept". Here is a list of concepts
// that we know how to check:
// _Allocator
// _Assignable
// _DefaultConstructible
// _EqualityComparable
// _LessThanComparable
// _TrivialIterator
// _InputIterator
// _OutputIterator
// _ForwardIterator
// _BidirectionalIterator
// _RandomAccessIterator
// _Mutable_TrivialIterator
// _Mutable_ForwardIterator
// _Mutable_BidirectionalIterator
// _Mutable_RandomAccessIterator
 
#define __STL_REQUIRES(__type_var, __concept) \
do { \
void (*__x)( __type_var ) = __concept##_concept_specification< __type_var >\
::__concept##_requirement_violation; __x = __x; } while (0)
 
// Use this to check whether type X is convertible to type Y
#define __STL_CONVERTIBLE(__type_x, __type_y) \
do { \
void (*__x)( __type_x , __type_y ) = _STL_CONVERT_ERROR< __type_x , \
__type_y >::__type_X_is_not_convertible_to_type_Y; \
__x = __x; } while (0)
 
// Use this to test whether two template arguments are the same type
#define __STL_REQUIRES_SAME_TYPE(__type_x, __type_y) \
do { \
void (*__x)( __type_x , __type_y ) = _STL_SAME_TYPE_ERROR< __type_x, \
__type_y >::__type_X_not_same_as_type_Y; \
__x = __x; } while (0)
 
 
// function object checks
#define __STL_GENERATOR_CHECK(__func, __ret) \
do { \
__ret (*__x)( __func&) = \
_STL_GENERATOR_ERROR< \
__func, __ret>::__generator_requirement_violation; \
__x = __x; } while (0)
 
 
#define __STL_UNARY_FUNCTION_CHECK(__func, __ret, __arg) \
do { \
__ret (*__x)( __func&, const __arg& ) = \
_STL_UNARY_FUNCTION_ERROR< \
__func, __ret, __arg>::__unary_function_requirement_violation; \
__x = __x; } while (0)
 
 
#define __STL_BINARY_FUNCTION_CHECK(__func, __ret, __first, __second) \
do { \
__ret (*__x)( __func&, const __first&, const __second& ) = \
_STL_BINARY_FUNCTION_ERROR< \
__func, __ret, __first, __second>::__binary_function_requirement_violation; \
__x = __x; } while (0)
 
 
#define __STL_REQUIRES_BINARY_OP(__opname, __ret, __first, __second) \
do { \
__ret (*__x)( __first&, __second& ) = _STL_BINARY##__opname##_ERROR< \
__ret, __first, __second>::__binary_operator_requirement_violation; \
__ret (*__y)( const __first&, const __second& ) = \
_STL_BINARY##__opname##_ERROR< __ret, __first, __second>:: \
__const_binary_operator_requirement_violation; \
__y = __y; __x = __x; } while (0)
 
 
#ifdef __STL_NO_FUNCTION_PTR_IN_CLASS_TEMPLATE
 
#define __STL_CLASS_REQUIRES(__type_var, __concept)
#define __STL_CLASS_REQUIRES_SAME_TYPE(__type_x, __type_y)
#define __STL_CLASS_GENERATOR_CHECK(__func, __ret)
#define __STL_CLASS_UNARY_FUNCTION_CHECK(__func, __ret, __arg)
#define __STL_CLASS_BINARY_FUNCTION_CHECK(__func, __ret, __first, __second)
#define __STL_CLASS_REQUIRES_BINARY_OP(__opname, __ret, __first, __second)
 
#else
 
// Use this macro inside of template classes, where you would
// like to place requirements on the template arguments to the class
// Warning: do not pass pointers and such (e.g. T*) in as the __type_var,
// since the type_var is used to construct identifiers. Instead typedef
// the pointer type, then use the typedef name for the __type_var.
#define __STL_CLASS_REQUIRES(__type_var, __concept) \
typedef void (* __func##__type_var##__concept)( __type_var ); \
template <__func##__type_var##__concept _Tp1> \
struct __dummy_struct_##__type_var##__concept { }; \
static __dummy_struct_##__type_var##__concept< \
__concept##_concept_specification< \
__type_var>::__concept##_requirement_violation> \
__dummy_ptr_##__type_var##__concept
 
 
#define __STL_CLASS_REQUIRES_SAME_TYPE(__type_x, __type_y) \
typedef void (* __func_##__type_x##__type_y##same_type)( __type_x, \
__type_y ); \
template < __func_##__type_x##__type_y##same_type _Tp1> \
struct __dummy_struct_##__type_x##__type_y##_same_type { }; \
static __dummy_struct_##__type_x##__type_y##_same_type< \
_STL_SAME_TYPE_ERROR<__type_x, __type_y>::__type_X_not_same_as_type_Y> \
__dummy_ptr_##__type_x##__type_y##_same_type
 
 
#define __STL_CLASS_GENERATOR_CHECK(__func, __ret) \
typedef __ret (* __f_##__func##__ret##_generator)( __func& ); \
template <__f_##__func##__ret##_generator _Tp1> \
struct __dummy_struct_##__func##__ret##_generator { }; \
static __dummy_struct_##__func##__ret##_generator< \
_STL_GENERATOR_ERROR< \
__func, __ret>::__generator_requirement_violation> \
__dummy_ptr_##__func##__ret##_generator
 
 
#define __STL_CLASS_UNARY_FUNCTION_CHECK(__func, __ret, __arg) \
typedef __ret (* __f_##__func##__ret##__arg##_unary_check)( __func&, \
const __arg& ); \
template <__f_##__func##__ret##__arg##_unary_check _Tp1> \
struct __dummy_struct_##__func##__ret##__arg##_unary_check { }; \
static __dummy_struct_##__func##__ret##__arg##_unary_check< \
_STL_UNARY_FUNCTION_ERROR< \
__func, __ret, __arg>::__unary_function_requirement_violation> \
__dummy_ptr_##__func##__ret##__arg##_unary_check
 
 
#define __STL_CLASS_BINARY_FUNCTION_CHECK(__func, __ret, __first, __second) \
typedef __ret (* __f_##__func##__ret##__first##__second##_binary_check)( __func&, const __first&,\
const __second& ); \
template <__f_##__func##__ret##__first##__second##_binary_check _Tp1> \
struct __dummy_struct_##__func##__ret##__first##__second##_binary_check { }; \
static __dummy_struct_##__func##__ret##__first##__second##_binary_check< \
_STL_BINARY_FUNCTION_ERROR<__func, __ret, __first, __second>:: \
__binary_function_requirement_violation> \
__dummy_ptr_##__func##__ret##__first##__second##_binary_check
 
 
#define __STL_CLASS_REQUIRES_BINARY_OP(__opname, __ret, __first, __second) \
typedef __ret (* __f_##__func##__ret##__first##__second##_binary_op)(const __first&, \
const __second& ); \
template <__f_##__func##__ret##__first##__second##_binary_op _Tp1> \
struct __dummy_struct_##__func##__ret##__first##__second##_binary_op { }; \
static __dummy_struct_##__func##__ret##__first##__second##_binary_op< \
_STL_BINARY##__opname##_ERROR<__ret, __first, __second>:: \
__binary_operator_requirement_violation> \
__dummy_ptr_##__func##__ret##__first##__second##_binary_op
 
#endif
 
/* helper class for finding non-const version of a type. Need to have
something to assign to etc. when testing constant iterators. */
 
template <class _Tp>
struct _Mutable_trait {
typedef _Tp _Type;
};
template <class _Tp>
struct _Mutable_trait<const _Tp> {
typedef _Tp _Type;
};
 
 
/* helper function for avoiding compiler warnings about unused variables */
template <class _Type>
void __sink_unused_warning(_Type) { }
 
template <class _TypeX, class _TypeY>
struct _STL_CONVERT_ERROR {
static void
__type_X_is_not_convertible_to_type_Y(_TypeX __x, _TypeY) {
_TypeY __y = __x;
__sink_unused_warning(__y);
}
};
 
 
template <class _Type> struct __check_equal { };
 
template <class _TypeX, class _TypeY>
struct _STL_SAME_TYPE_ERROR {
static void
__type_X_not_same_as_type_Y(_TypeX , _TypeY ) {
__check_equal<_TypeX> t1 = __check_equal<_TypeY>();
}
};
 
 
// Some Functon Object Checks
 
template <class _Func, class _Ret>
struct _STL_GENERATOR_ERROR {
static _Ret __generator_requirement_violation(_Func& __f) {
return __f();
}
};
 
template <class _Func>
struct _STL_GENERATOR_ERROR<_Func, void> {
static void __generator_requirement_violation(_Func& __f) {
__f();
}
};
 
 
template <class _Func, class _Ret, class _Arg>
struct _STL_UNARY_FUNCTION_ERROR {
static _Ret
__unary_function_requirement_violation(_Func& __f,
const _Arg& __arg) {
return __f(__arg);
}
};
 
template <class _Func, class _Arg>
struct _STL_UNARY_FUNCTION_ERROR<_Func, void, _Arg> {
static void
__unary_function_requirement_violation(_Func& __f,
const _Arg& __arg) {
__f(__arg);
}
};
 
template <class _Func, class _Ret, class _First, class _Second>
struct _STL_BINARY_FUNCTION_ERROR {
static _Ret
__binary_function_requirement_violation(_Func& __f,
const _First& __first,
const _Second& __second) {
return __f(__first, __second);
}
};
 
template <class _Func, class _First, class _Second>
struct _STL_BINARY_FUNCTION_ERROR<_Func, void, _First, _Second> {
static void
__binary_function_requirement_violation(_Func& __f,
const _First& __first,
const _Second& __second) {
__f(__first, __second);
}
};
 
 
#define __STL_DEFINE_BINARY_OP_CHECK(_OP, _NAME) \
template <class _Ret, class _First, class _Second> \
struct _STL_BINARY##_NAME##_ERROR { \
static _Ret \
__const_binary_operator_requirement_violation(const _First& __first, \
const _Second& __second) { \
return __first _OP __second; \
} \
static _Ret \
__binary_operator_requirement_violation(_First& __first, \
_Second& __second) { \
return __first _OP __second; \
} \
}
 
__STL_DEFINE_BINARY_OP_CHECK(==, _OP_EQUAL);
__STL_DEFINE_BINARY_OP_CHECK(!=, _OP_NOT_EQUAL);
__STL_DEFINE_BINARY_OP_CHECK(<, _OP_LESS_THAN);
__STL_DEFINE_BINARY_OP_CHECK(<=, _OP_LESS_EQUAL);
__STL_DEFINE_BINARY_OP_CHECK(>, _OP_GREATER_THAN);
__STL_DEFINE_BINARY_OP_CHECK(>=, _OP_GREATER_EQUAL);
__STL_DEFINE_BINARY_OP_CHECK(+, _OP_PLUS);
__STL_DEFINE_BINARY_OP_CHECK(*, _OP_TIMES);
__STL_DEFINE_BINARY_OP_CHECK(/, _OP_DIVIDE);
__STL_DEFINE_BINARY_OP_CHECK(-, _OP_SUBTRACT);
__STL_DEFINE_BINARY_OP_CHECK(%, _OP_MOD);
// ...
 
// TODO, add unary operators (prefix and postfix)
 
/*
The presence of this class is just to trick EDG into displaying
these error messages before any other errors. Without the
classes, the errors in the functions get reported after
other class errors deep inside the library. The name
choice just makes for an eye catching error message :)
*/
struct _STL_ERROR {
 
template <class _Type>
static _Type
__default_constructor_requirement_violation(_Type) {
return _Type();
}
template <class _Type>
static _Type
__assignment_operator_requirement_violation(_Type __a) {
__a = __a;
return __a;
}
template <class _Type>
static _Type
__copy_constructor_requirement_violation(_Type __a) {
_Type __c(__a);
return __c;
}
template <class _Type>
static _Type
__const_parameter_required_for_copy_constructor(_Type /* __a */,
const _Type& __b) {
_Type __c(__b);
return __c;
}
template <class _Type>
static _Type
__const_parameter_required_for_assignment_operator(_Type __a,
const _Type& __b) {
__a = __b;
return __a;
}
template <class _Type>
static _Type
__less_than_comparable_requirement_violation(_Type __a, _Type __b) {
if (__a < __b) return __a;
return __b;
}
template <class _Type>
static _Type
__equality_comparable_requirement_violation(_Type __a, _Type __b) {
if (__a == __b || __a != __b) return __a;
return __b;
}
template <class _Iterator>
static void
__dereference_operator_requirement_violation(_Iterator __i) {
__sink_unused_warning(*__i);
}
template <class _Iterator>
static void
__dereference_operator_and_assignment_requirement_violation(_Iterator __i) {
*__i = *__i;
}
template <class _Iterator>
static void
__preincrement_operator_requirement_violation(_Iterator __i) {
++__i;
}
template <class _Iterator>
static void
__postincrement_operator_requirement_violation(_Iterator __i) {
__i++;
}
template <class _Iterator>
static void
__predecrement_operator_requirement_violation(_Iterator __i) {
--__i;
}
template <class _Iterator>
static void
__postdecrement_operator_requirement_violation(_Iterator __i) {
__i--;
}
template <class _Iterator, class _Type>
static void
__postincrement_operator_and_assignment_requirement_violation(_Iterator __i,
_Type __t) {
*__i++ = __t;
}
template <class _Iterator, class _Distance>
static _Iterator
__iterator_addition_assignment_requirement_violation(_Iterator __i,
_Distance __n) {
__i += __n;
return __i;
}
template <class _Iterator, class _Distance>
static _Iterator
__iterator_addition_requirement_violation(_Iterator __i, _Distance __n) {
__i = __i + __n;
__i = __n + __i;
return __i;
}
template <class _Iterator, class _Distance>
static _Iterator
__iterator_subtraction_assignment_requirement_violation(_Iterator __i,
_Distance __n) {
__i -= __n;
return __i;
}
template <class _Iterator, class _Distance>
static _Iterator
__iterator_subtraction_requirement_violation(_Iterator __i, _Distance __n) {
__i = __i - __n;
return __i;
}
template <class _Iterator, class _Distance>
static _Distance
__difference_operator_requirement_violation(_Iterator __i, _Iterator __j,
_Distance __n) {
__n = __i - __j;
return __n;
}
template <class _Exp, class _Type, class _Distance>
static _Type
__element_access_operator_requirement_violation(_Exp __x, _Type*,
_Distance __n) {
return __x[__n];
}
template <class _Exp, class _Type, class _Distance>
static void
__element_assignment_operator_requirement_violation(_Exp __x,
_Type* __t,
_Distance __n) {
__x[__n] = *__t;
}
 
}; /* _STL_ERROR */
 
/* Associated Type Requirements */
 
__STL_BEGIN_NAMESPACE
template <class _Iterator> struct iterator_traits;
__STL_END_NAMESPACE
 
template <class _Iter>
struct __value_type_type_definition_requirement_violation {
typedef typename __STD::iterator_traits<_Iter>::value_type value_type;
};
 
template <class _Iter>
struct __difference_type_type_definition_requirement_violation {
typedef typename __STD::iterator_traits<_Iter>::difference_type
difference_type;
};
 
template <class _Iter>
struct __reference_type_definition_requirement_violation {
typedef typename __STD::iterator_traits<_Iter>::reference reference;
};
 
template <class _Iter>
struct __pointer_type_definition_requirement_violation {
typedef typename __STD::iterator_traits<_Iter>::pointer pointer;
};
 
template <class _Iter>
struct __iterator_category_type_definition_requirement_violation {
typedef typename __STD::iterator_traits<_Iter>::iterator_category
iterator_category;
};
 
/* Assignable Requirements */
 
 
template <class _Type>
struct _Assignable_concept_specification {
static void _Assignable_requirement_violation(_Type __a) {
_STL_ERROR::__assignment_operator_requirement_violation(__a);
_STL_ERROR::__copy_constructor_requirement_violation(__a);
_STL_ERROR::__const_parameter_required_for_copy_constructor(__a,__a);
_STL_ERROR::__const_parameter_required_for_assignment_operator(__a,__a);
}
};
 
/* DefaultConstructible Requirements */
 
 
template <class _Type>
struct _DefaultConstructible_concept_specification {
static void _DefaultConstructible_requirement_violation(_Type __a) {
_STL_ERROR::__default_constructor_requirement_violation(__a);
}
};
 
/* EqualityComparable Requirements */
 
template <class _Type>
struct _EqualityComparable_concept_specification {
static void _EqualityComparable_requirement_violation(_Type __a) {
_STL_ERROR::__equality_comparable_requirement_violation(__a, __a);
}
};
 
/* LessThanComparable Requirements */
template <class _Type>
struct _LessThanComparable_concept_specification {
static void _LessThanComparable_requirement_violation(_Type __a) {
_STL_ERROR::__less_than_comparable_requirement_violation(__a, __a);
}
};
 
/* TrivialIterator Requirements */
 
template <class _TrivialIterator>
struct _TrivialIterator_concept_specification {
static void
_TrivialIterator_requirement_violation(_TrivialIterator __i) {
typedef typename
__value_type_type_definition_requirement_violation<_TrivialIterator>::
value_type __T;
// Refinement of Assignable
_Assignable_concept_specification<_TrivialIterator>::
_Assignable_requirement_violation(__i);
// Refinement of DefaultConstructible
_DefaultConstructible_concept_specification<_TrivialIterator>::
_DefaultConstructible_requirement_violation(__i);
// Refinement of EqualityComparable
_EqualityComparable_concept_specification<_TrivialIterator>::
_EqualityComparable_requirement_violation(__i);
// Valid Expressions
_STL_ERROR::__dereference_operator_requirement_violation(__i);
}
};
 
template <class _TrivialIterator>
struct _Mutable_TrivialIterator_concept_specification {
static void
_Mutable_TrivialIterator_requirement_violation(_TrivialIterator __i) {
_TrivialIterator_concept_specification<_TrivialIterator>::
_TrivialIterator_requirement_violation(__i);
// Valid Expressions
_STL_ERROR::__dereference_operator_and_assignment_requirement_violation(__i);
}
};
 
/* InputIterator Requirements */
 
template <class _InputIterator>
struct _InputIterator_concept_specification {
static void
_InputIterator_requirement_violation(_InputIterator __i) {
// Refinement of TrivialIterator
_TrivialIterator_concept_specification<_InputIterator>::
_TrivialIterator_requirement_violation(__i);
// Associated Types
__difference_type_type_definition_requirement_violation<_InputIterator>();
__reference_type_definition_requirement_violation<_InputIterator>();
__pointer_type_definition_requirement_violation<_InputIterator>();
__iterator_category_type_definition_requirement_violation<_InputIterator>();
// Valid Expressions
_STL_ERROR::__preincrement_operator_requirement_violation(__i);
_STL_ERROR::__postincrement_operator_requirement_violation(__i);
}
};
 
/* OutputIterator Requirements */
 
template <class _OutputIterator>
struct _OutputIterator_concept_specification {
static void
_OutputIterator_requirement_violation(_OutputIterator __i) {
// Refinement of Assignable
_Assignable_concept_specification<_OutputIterator>::
_Assignable_requirement_violation(__i);
// Associated Types
__iterator_category_type_definition_requirement_violation<_OutputIterator>();
// Valid Expressions
_STL_ERROR::__dereference_operator_requirement_violation(__i);
_STL_ERROR::__preincrement_operator_requirement_violation(__i);
_STL_ERROR::__postincrement_operator_requirement_violation(__i);
_STL_ERROR::
__postincrement_operator_and_assignment_requirement_violation(__i, *__i);
}
};
 
/* ForwardIterator Requirements */
 
template <class _ForwardIterator>
struct _ForwardIterator_concept_specification {
static void
_ForwardIterator_requirement_violation(_ForwardIterator __i) {
// Refinement of InputIterator
_InputIterator_concept_specification<_ForwardIterator>::
_InputIterator_requirement_violation(__i);
}
};
 
template <class _ForwardIterator>
struct _Mutable_ForwardIterator_concept_specification {
static void
_Mutable_ForwardIterator_requirement_violation(_ForwardIterator __i) {
_ForwardIterator_concept_specification<_ForwardIterator>::
_ForwardIterator_requirement_violation(__i);
// Refinement of OutputIterator
_OutputIterator_concept_specification<_ForwardIterator>::
_OutputIterator_requirement_violation(__i);
}
};
 
/* BidirectionalIterator Requirements */
 
template <class _BidirectionalIterator>
struct _BidirectionalIterator_concept_specification {
static void
_BidirectionalIterator_requirement_violation(_BidirectionalIterator __i) {
// Refinement of ForwardIterator
_ForwardIterator_concept_specification<_BidirectionalIterator>::
_ForwardIterator_requirement_violation(__i);
// Valid Expressions
_STL_ERROR::__predecrement_operator_requirement_violation(__i);
_STL_ERROR::__postdecrement_operator_requirement_violation(__i);
}
};
 
template <class _BidirectionalIterator>
struct _Mutable_BidirectionalIterator_concept_specification {
static void
_Mutable_BidirectionalIterator_requirement_violation(
_BidirectionalIterator __i)
{
_BidirectionalIterator_concept_specification<_BidirectionalIterator>::
_BidirectionalIterator_requirement_violation(__i);
// Refinement of mutable_ForwardIterator
_Mutable_ForwardIterator_concept_specification<_BidirectionalIterator>::
_Mutable_ForwardIterator_requirement_violation(__i);
typedef typename
__value_type_type_definition_requirement_violation<
_BidirectionalIterator>::value_type __T;
typename _Mutable_trait<__T>::_Type* __tmp_ptr = 0;
// Valid Expressions
_STL_ERROR::
__postincrement_operator_and_assignment_requirement_violation(__i,
*__tmp_ptr);
}
};
 
/* RandomAccessIterator Requirements */
 
template <class _RandAccIter>
struct _RandomAccessIterator_concept_specification {
static void
_RandomAccessIterator_requirement_violation(_RandAccIter __i) {
// Refinement of BidirectionalIterator
_BidirectionalIterator_concept_specification<_RandAccIter>::
_BidirectionalIterator_requirement_violation(__i);
// Refinement of LessThanComparable
_LessThanComparable_concept_specification<_RandAccIter>::
_LessThanComparable_requirement_violation(__i);
typedef typename
__value_type_type_definition_requirement_violation<_RandAccIter>
::value_type
value_type;
typedef typename
__difference_type_type_definition_requirement_violation<_RandAccIter>
::difference_type
_Dist;
typedef typename _Mutable_trait<_Dist>::_Type _MutDist;
 
// Valid Expressions
_STL_ERROR::__iterator_addition_assignment_requirement_violation(__i,
_MutDist());
_STL_ERROR::__iterator_addition_requirement_violation(__i,
_MutDist());
_STL_ERROR::
__iterator_subtraction_assignment_requirement_violation(__i,
_MutDist());
_STL_ERROR::__iterator_subtraction_requirement_violation(__i,
_MutDist());
_STL_ERROR::__difference_operator_requirement_violation(__i, __i,
_MutDist());
typename _Mutable_trait<value_type>::_Type* __dummy_ptr = 0;
_STL_ERROR::__element_access_operator_requirement_violation(__i,
__dummy_ptr,
_MutDist());
}
};
 
template <class _RandAccIter>
struct _Mutable_RandomAccessIterator_concept_specification {
static void
_Mutable_RandomAccessIterator_requirement_violation(_RandAccIter __i)
{
_RandomAccessIterator_concept_specification<_RandAccIter>::
_RandomAccessIterator_requirement_violation(__i);
// Refinement of mutable_BidirectionalIterator
_Mutable_BidirectionalIterator_concept_specification<_RandAccIter>::
_Mutable_BidirectionalIterator_requirement_violation(__i);
typedef typename
__value_type_type_definition_requirement_violation<_RandAccIter>
::value_type
value_type;
typedef typename
__difference_type_type_definition_requirement_violation<_RandAccIter>
::difference_type
_Dist;
 
typename _Mutable_trait<value_type>::_Type* __tmp_ptr = 0;
// Valid Expressions
_STL_ERROR::__element_assignment_operator_requirement_violation(__i,
__tmp_ptr, _Dist());
}
};
 
#define __STL_TYPEDEF_REQUIREMENT(__REQUIREMENT) \
template <class Type> \
struct __##__REQUIREMENT##__typedef_requirement_violation { \
typedef typename Type::__REQUIREMENT __REQUIREMENT; \
}
 
__STL_TYPEDEF_REQUIREMENT(value_type);
__STL_TYPEDEF_REQUIREMENT(difference_type);
__STL_TYPEDEF_REQUIREMENT(size_type);
__STL_TYPEDEF_REQUIREMENT(reference);
__STL_TYPEDEF_REQUIREMENT(const_reference);
__STL_TYPEDEF_REQUIREMENT(pointer);
__STL_TYPEDEF_REQUIREMENT(const_pointer);
 
 
template <class _Alloc>
struct _Allocator_concept_specification {
static void
_Allocator_requirement_violation(_Alloc __a) {
// Refinement of DefaultConstructible
_DefaultConstructible_concept_specification<_Alloc>::
_DefaultConstructible_requirement_violation(__a);
// Refinement of EqualityComparable
_EqualityComparable_concept_specification<_Alloc>::
_EqualityComparable_requirement_violation(__a);
// Associated Types
__value_type__typedef_requirement_violation<_Alloc>();
__difference_type__typedef_requirement_violation<_Alloc>();
__size_type__typedef_requirement_violation<_Alloc>();
__reference__typedef_requirement_violation<_Alloc>();
__const_reference__typedef_requirement_violation<_Alloc>();
__pointer__typedef_requirement_violation<_Alloc>();
__const_pointer__typedef_requirement_violation<_Alloc>();
typedef typename _Alloc::value_type _Tp;
//__STL_REQUIRES_SAME_TYPE(typename _Alloc::__STL_TEMPLATE rebind<_Tp>::other,
// _Alloc);
}
};
 
#endif /* __STL_USE_CONCEPT_CHECKS */
 
#endif /* __CONCEPT_CHECKS_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/container_concepts.h
0,0 → 1,244
/*
* Copyright (c) 1999
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef __STL_CONTAINER_CONCEPTS_H
#define __STL_CONTAINER_CONCEPTS_H
 
 
#include <bits/concept_checks.h>
 
#ifdef __STL_USE_CONCEPT_CHECKS
 
 
// This file covers the following concepts:
// _Container
// _ForwardContainer
// _ReversibleContainer
// _const_ReversibleContainer
// _RandomAccessContainer
//
 
struct _ERROR_IN_STL_CONTAINER {
 
/* Container expresssions */
 
template <class _Container>
static void
__begin_iterator_accessor_requirement_violation(_Container __c) {
__c.begin();
}
template <class _Container>
static void
__const_begin_iterator_accessor_requirement_violation(const _Container& __c) {
__c.begin();
}
template <class _Container>
static void
__end_iterator_accessor_requirement_violation(_Container __c) {
__c.end();
}
template <class _Container>
static void
__const_end_iterator_accessor_requirement_violation(const _Container& __c) {
__c.end();
}
 
template <class _Container>
static void
__rbegin_iterator_accessor_requirement_violation(_Container __c) {
__c.rbegin();
}
template <class _Container>
static void
__const_rbegin_iterator_accessor_requirement_violation(const _Container& __c) {
__c.rbegin();
}
template <class _Container>
static void
__rend_iterator_accessor_requirement_violation(_Container __c) {
__c.rend();
}
template <class _Container>
static void
__const_rend_iterator_accessor_requirement_violation(const _Container& __c) {
__c.rend();
}
template <class _Container>
static void
__size_function_must_be_const(const _Container& __c) {
__c.size();
}
template <class _Container>
static void
__size_function_requirement_violation(_Container& __c) {
__c.size();
__size_function_must_be_const(__c);
}
template <class _Container>
static void
__max_size_function_must_be_const(const _Container& __c) {
__c.max_size();
}
template <class _Container>
static void
__max_size_function_requirement_violation(_Container& __c) {
__c.max_size();
__max_size_function_must_be_const(__c);
}
template <class _Container>
static void
__empty_function_must_be_const(const _Container& __c) {
__c.empty();
}
template <class _Container>
static void
__empty_function_requirement_violation(_Container& __c) {
__c.empty();
__empty_function_must_be_const(__c);
}
template <class _Container>
static void
__swap_function_requirement_violation(_Container& __c) {
__c.swap(__c);
}
 
};
 
 
__STL_TYPEDEF_REQUIREMENT(iterator);
__STL_TYPEDEF_REQUIREMENT(const_iterator);
 
/* Containers */
 
template <class _Container>
struct _Container_concept_specification {
static void
_Container_requirement_violation(_Container __c) {
// Refinement of Assignable
_Assignable_concept_specification<_Container>::_Assignable_requirement_violation(__c);
// Associated Types
__value_type__typedef_requirement_violation<_Container>();
__difference_type__typedef_requirement_violation<_Container>();
__size_type__typedef_requirement_violation<_Container>();
__reference__typedef_requirement_violation<_Container>();
__const_reference__typedef_requirement_violation<_Container>();
__pointer__typedef_requirement_violation<_Container>();
__const_pointer__typedef_requirement_violation<_Container>();
__iterator__typedef_requirement_violation<_Container>();
__const_iterator__typedef_requirement_violation<_Container>();
// Valid Expressions
_ERROR_IN_STL_CONTAINER::__const_begin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__const_end_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__begin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__end_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__size_function_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__max_size_function_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__empty_function_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__swap_function_requirement_violation(__c);
// Requirements on Iterators
typedef typename _Container::iterator iter;
typedef typename _Container::const_iterator const_iter;
_InputIterator_concept_specification<const_iter>::_InputIterator_requirement_violation(const_iter());
_InputIterator_concept_specification<iter>::_InputIterator_requirement_violation(iter());
}
};
 
template <class _ForwardContainer>
struct _ForwardContainer_concept_specification {
static void
_ForwardContainer_requirement_violation(_ForwardContainer __c) {
// Refinement of Container
_Container_concept_specification<_ForwardContainer>::_Container_requirement_violation(__c);
// Requirements on Iterators
typedef typename _ForwardContainer::iterator iter;
typedef typename _ForwardContainer::const_iterator const_iter;
_ForwardIterator_concept_specification<const_iter>::_ForwardIterator_requirement_violation(const_iter());
_Mutable_ForwardIterator_concept_specification<iter>::_Mutable_ForwardIterator_requirement_violation(iter());
}
};
 
 
__STL_TYPEDEF_REQUIREMENT(reverse_iterator);
__STL_TYPEDEF_REQUIREMENT(const_reverse_iterator);
 
template <class _ReversibleContainer>
struct _ReversibleContainer_concept_specification {
static void
_ReversibleContainer_requirement_violation(_ReversibleContainer __c) {
// Refinement of ForwardContainer
_ForwardContainer_concept_specification<_ReversibleContainer>::_ForwardContainer_requirement_violation(__c);
// Associated types
__reverse_iterator__typedef_requirement_violation<_ReversibleContainer>();
__const_reverse_iterator__typedef_requirement_violation<_ReversibleContainer>();
// Valid Expressions
_ERROR_IN_STL_CONTAINER::__const_rbegin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__const_rend_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__rbegin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__rend_iterator_accessor_requirement_violation(__c);
// Requirements on Iterators
typedef typename _ReversibleContainer::iterator iter;
typedef typename _ReversibleContainer::const_iterator const_iter;
_BidirectionalIterator_concept_specification<const_iter>::_BidirectionalIterator_requirement_violation(const_iter());
_Mutable_BidirectionalIterator_concept_specification<iter>::_Mutable_BidirectionalIterator_requirement_violation(iter());
}
};
 
template <class _ReversibleContainer>
struct _const_ReversibleContainer_concept_specification {
static void
_const_ReversibleContainer_requirement_violation(_ReversibleContainer __c) {
// Refinement of Container (JGS, not ForwardContainer)
_Container_concept_specification<_ReversibleContainer>::_Container_requirement_violation(__c);
// Associated types
__reverse_iterator__typedef_requirement_violation<_ReversibleContainer>();
__const_reverse_iterator__typedef_requirement_violation<_ReversibleContainer>();
// Valid Expressions
_ERROR_IN_STL_CONTAINER::__const_rbegin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__const_rend_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__rbegin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__rend_iterator_accessor_requirement_violation(__c);
// Requirements on Iterators
typedef typename _ReversibleContainer::iterator iter;
typedef typename _ReversibleContainer::const_iterator const_iter;
_BidirectionalIterator_concept_specification<const_iter>::_BidirectionalIterator_requirement_violation(const_iter());
}
};
 
 
template <class _RandomAccessContainer>
struct _RandomAccessContainer_concept_specification {
static void
_RandomAccessContainer_requirement_violation(_RandomAccessContainer __c) {
// Refinement of ReversibleContainer
_ReversibleContainer_concept_specification<_RandomAccessContainer>::_ReversibleContainer_requirement_violation(__c);
// Valid Expressions
typedef typename _RandomAccessContainer::value_type __T;
typedef typename _RandomAccessContainer::difference_type _Dist;
typedef typename _Mutable_trait<__T>::_Type Type;
typedef Type* _TypePtr;
typedef typename _Mutable_trait<_Dist>::_Type Dist;
_STL_ERROR::__element_access_operator_requirement_violation(__c,
_TypePtr(),
Dist());
// Requirements on Iterators
typedef typename _RandomAccessContainer::iterator iter;
typedef typename _RandomAccessContainer::const_iterator const_iter;
_RandomAccessIterator_concept_specification<const_iter>::_RandomAccessIterator_requirement_violation(const_iter());
_Mutable_RandomAccessIterator_concept_specification<iter>::_Mutable_RandomAccessIterator_requirement_violation(iter());
}
};
 
#endif /* if __STL_USE_CONCEPT_CHECKS */
 
#endif /* __STL_CONTAINER_CONCEPTS_H */
/contrib/media/updf/include/bits/cpp_type_traits.h
0,0 → 1,297
// The -*- C++ -*- type traits classes for internal use in libstdc++
 
// Copyright (C) 2000-2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Written by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
 
#ifndef _CPP_BITS_CPP_TYPE_TRAITS_H
#define _CPP_BITS_CPP_TYPE_TRAITS_H 1
 
#pragma GCC system_header
 
//
// This file provides some compile-time information about various types.
// These representations were designed, on purpose, to be constant-expressions
// and not types as found in <stl/bits/type_traits.h>. In particular, they
// can be used in control structures and the optimizer hopefully will do
// the obvious thing.
//
// Why integral expressions, and not functions nor types?
// Firstly, these compile-time entities are used as template-arguments
// so function return values won't work: We need compile-time entities.
// We're left with types and constant integral expressions.
// Secondly, from the point of view of ease of use, type-based compile-time
// information is -not- *that* convenient. On has to write lots of
// overloaded functions and to hope that the compiler will select the right
// one. As a net effect, the overall structure isn't very clear at first
// glance.
// Thirdly, partial ordering and overload resolution (of function templates)
// is highly costly in terms of compiler-resource. It is a Good Thing to
// keep these resource consumption as least as possible.
//
// See valarray_array.h for a case use.
//
// -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06.
//
 
namespace std
{
template<typename _Tp>
struct __is_void
{
enum
{
_M_type = 0
};
};
 
template<>
struct __is_void<void>
{
enum
{
_M_type = 1
};
};
 
//
// Integer types
//
template<typename _Tp>
struct __is_integer
{
enum
{
_M_type = 0
};
};
 
// Thirteen specializations (yes there are eleven standard integer
// types; 'long long' and 'unsigned long long' are supported as
// extensions)
template<>
struct __is_integer<bool>
{
enum
{
_M_type = 1
};
};
template<>
struct __is_integer<char>
{
enum
{
_M_type = 1
};
};
 
template<>
struct __is_integer<signed char>
{
enum
{
_M_type = 1
};
};
template<>
struct __is_integer<unsigned char>
{
enum
{
_M_type = 1
};
};
 
# ifdef _GLIBCPP_USE_WCHAR_T
template<>
struct __is_integer<wchar_t>
{
enum
{
_M_type = 1
};
};
# endif
template<>
struct __is_integer<short>
{
enum
{
_M_type = 1
};
};
 
template<>
struct __is_integer<unsigned short>
{
enum
{
_M_type = 1
};
};
 
template<>
struct __is_integer<int>
{
enum
{
_M_type = 1
};
};
 
template<>
struct __is_integer<unsigned int>
{
enum
{
_M_type = 1
};
};
 
template<>
struct __is_integer<long>
{
enum
{
_M_type = 1
};
};
 
template<>
struct __is_integer<unsigned long>
{
enum
{
_M_type = 1
};
};
 
# ifdef _GLIBCPP_USE_LONG_LONG
template<>
struct __is_integer<long long>
{
enum
{
_M_type = 1
};
};
 
template<>
struct __is_integer<unsigned long long>
{
enum
{
_M_type = 1
};
};
# endif
 
//
// Floating point types
//
template<typename _Tp>
struct __is_floating
{
enum
{
_M_type = 0
};
};
 
// three specializations (float, double and 'long double')
template<>
struct __is_floating<float>
{
enum
{
_M_type = 1
};
};
 
template<>
struct __is_floating<double>
{
enum
{
_M_type = 1
};
};
 
template<>
struct __is_floating<long double>
{
enum
{
_M_type = 1
};
};
 
//
// An arithmetic type is an integer type or a floating point type
//
template<typename _Tp>
struct __is_arithmetic
{
enum
{
_M_type = __is_integer<_Tp>::_M_type || __is_floating<_Tp>::_M_type
};
};
 
//
// A fundamental type is `void' or and arithmetic type
//
template<typename _Tp>
struct __is_fundamental
{
enum
{
_M_type = __is_void<_Tp>::_M_type || __is_arithmetic<_Tp>::_M_type
};
};
 
//
// For the immediate use, the following is a good approximation
//
template<typename _Tp>
struct __is_pod
{
enum
{
_M_type = __is_fundamental<_Tp>::_M_type
};
};
 
} // namespace std
 
 
#endif //_CPP_BITS_CPP_TYPE_TRAITS_H
/contrib/media/updf/include/bits/endian.h
0,0 → 1,7
/* i386 is little-endian. */
 
#ifndef _ENDIAN_H
# error "Never use <bits/endian.h> directly; include <endian.h> instead."
#endif
 
#define __BYTE_ORDER __LITTLE_ENDIAN
/contrib/media/updf/include/bits/fpos.h
0,0 → 1,121
// File position object and stream types
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27 Input/output library
//
 
#ifndef _CPP_BITS_FPOS_H
#define _CPP_BITS_FPOS_H 1
 
#pragma GCC system_header
 
#include <bits/c++io.h>
#include <bits/std_cwchar.h> // For mbstate_t.
 
namespace std
{
// 27.4.1 Types
 
// 27.4.3 Template class fpos
template<typename _StateT>
class fpos
{
public:
// Types:
typedef _StateT __state_type;
 
private:
streamoff _M_off;
__state_type _M_st;
 
public:
__state_type
state() const { return _M_st; }
 
void
state(__state_type __st) { _M_st = __st; }
 
// NB: The standard defines only the implicit copy ctor and the
// previous two members. The rest is a "conforming extension".
fpos(): _M_off(streamoff()), _M_st(__state_type()) { }
 
fpos(streamoff __off, __state_type __st = __state_type())
: _M_off(__off), _M_st(__st) { }
 
operator streamoff() const { return _M_off; }
 
fpos&
operator+=(streamoff __off) { _M_off += __off; return *this; }
 
fpos&
operator-=(streamoff __off) { _M_off -= __off; return *this; }
 
fpos
operator+(streamoff __off)
{
fpos __t(*this);
__t += __off;
return __t;
}
 
fpos
operator-(streamoff __off)
{
fpos __t(*this);
__t -= __off;
return __t;
}
 
bool
operator==(const fpos& __pos) const
{ return _M_off == __pos._M_off; }
 
bool
operator!=(const fpos& __pos) const
{ return _M_off != __pos._M_off; }
streamoff
_M_position() const { return _M_off; }
 
void
_M_position(streamoff __off) { _M_off = __off; }
};
 
// 27.2, paragraph 10 about fpos/char_traits circularity
typedef fpos<mbstate_t> streampos;
# ifdef _GLIBCPP_USE_WCHAR_T
typedef fpos<mbstate_t> wstreampos;
# endif
} // namespace std
 
#endif
 
 
 
/contrib/media/updf/include/bits/fstream.tcc
0,0 → 1,605
// File based streams -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.8 File-based streams
//
 
#ifndef _CPP_BITS_FSTREAM_TCC
#define _CPP_BITS_FSTREAM_TCC 1
 
namespace std
{
template<typename _CharT, typename _Traits>
void
basic_filebuf<_CharT, _Traits>::
_M_allocate_file()
{
if (!_M_file)
{
_M_buf_unified = true; // Tie input to output for basic_filebuf.
try
{ _M_file = new __file_type(&_M_lock); }
catch(...)
{
delete _M_file;
__throw_exception_again;
}
}
}
 
template<typename _CharT, typename _Traits>
void
basic_filebuf<_CharT, _Traits>::
_M_allocate_internal_buffer()
{
if (!_M_buf && _M_buf_size_opt)
{
_M_buf_size = _M_buf_size_opt;
 
// Allocate internal buffer.
try { _M_buf = new char_type[_M_buf_size]; }
catch(...)
{
delete [] _M_buf;
__throw_exception_again;
}
_M_buf_allocated = true;
}
}
 
// Both close and setbuf need to deallocate internal buffers, if it exists.
template<typename _CharT, typename _Traits>
void
basic_filebuf<_CharT, _Traits>::
_M_destroy_internal_buffer()
{
if (_M_buf_allocated)
{
delete [] _M_buf;
_M_buf = NULL;
_M_buf_allocated = false;
this->setg(NULL, NULL, NULL);
this->setp(NULL, NULL);
}
}
 
template<typename _CharT, typename _Traits>
void
basic_filebuf<_CharT, _Traits>::
_M_allocate_pback_buffer()
{
if (!_M_pback && _M_pback_size)
{
// Allocate pback buffer.
try
{ _M_pback = new char_type[_M_pback_size]; }
catch(...)
{
delete [] _M_pback;
__throw_exception_again;
}
}
}
 
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::
basic_filebuf()
: __streambuf_type(), _M_file(NULL), _M_state_cur(__state_type()),
_M_state_beg(__state_type()), _M_buf_allocated(false),
_M_last_overflowed(false)
{ }
 
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::
basic_filebuf(__c_file_type* __f, ios_base::openmode __mode, int_type __s)
: __streambuf_type(), _M_file(NULL), _M_state_cur(__state_type()),
_M_state_beg(__state_type()), _M_buf_allocated(false),
_M_last_overflowed(false)
{
_M_allocate_file();
_M_file->sys_open(__f, __mode);
if (this->is_open())
{
_M_mode = __mode;
if (__s)
{
_M_buf_size_opt = __s;
_M_allocate_internal_buffer();
_M_set_indeterminate();
}
_M_allocate_pback_buffer();
}
}
 
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::__filebuf_type*
basic_filebuf<_CharT, _Traits>::
open(const char* __s, ios_base::openmode __mode)
{
__filebuf_type *__ret = NULL;
if (!this->is_open())
{
_M_allocate_file();
_M_file->open(__s, __mode);
if (this->is_open())
{
_M_allocate_internal_buffer();
_M_allocate_pback_buffer();
_M_mode = __mode;
// For time being, set both (in/out) sets of pointers.
_M_set_indeterminate();
if (__mode & ios_base::ate
&& this->seekoff(0, ios_base::end, __mode) < 0)
this->close();
__ret = this;
}
}
return __ret;
}
 
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::__filebuf_type*
basic_filebuf<_CharT, _Traits>::
close()
{
__filebuf_type *__ret = NULL;
if (this->is_open())
{
bool __testput = _M_out_cur && _M_out_beg < _M_out_end;
if (__testput)
_M_really_overflow(traits_type::eof());
 
// NB: Do this here so that re-opened filebufs will be cool...
_M_pback_destroy();
 
#if 0
// XXX not done
if (_M_last_overflowed)
{
_M_output_unshift();
_M_really_overflow(traits_type::eof());
}
#endif
 
_M_mode = ios_base::openmode(0);
_M_destroy_internal_buffer();
 
if (_M_pback)
{
delete [] _M_pback;
_M_pback = NULL;
}
__ret = this;
}
 
// Can actually allocate this file as part of an open and never
// have it be opened.....
if (_M_file)
{
delete _M_file;
_M_file = NULL;
}
_M_last_overflowed = false;
return __ret;
}
 
template<typename _CharT, typename _Traits>
streamsize
basic_filebuf<_CharT, _Traits>::
showmanyc()
{
streamsize __ret = -1;
bool __testin = _M_mode & ios_base::in;
 
if (__testin)
{
bool __testeof = false;
if (_M_in_cur >= _M_in_end)
__testeof = this->underflow() == traits_type::eof();
if (!__testeof)
__ret = _M_in_end - _M_in_cur;
}
_M_last_overflowed = false;
return __ret;
}
 
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
underflow()
{
int_type __ret = traits_type::eof();
bool __testin = _M_mode & ios_base::in;
bool __testout = _M_mode & ios_base::out;
 
// XXX Should re-enable codecvt bits disabled after 2.90.8.
if (__testin)
{
// Check for pback madness, and if so swich back to the
// normal buffers and jet outta here before expensive
// fileops happen...
if (_M_pback_init)
{
_M_pback_destroy();
if (_M_in_cur < _M_in_end)
return traits_type::to_int_type(*_M_in_cur);
}
 
bool __testget = _M_in_cur && _M_in_beg < _M_in_cur;
bool __testinit = _M_is_indeterminate();
// Sync internal and external buffers.
// NB: __testget -> __testput as _M_buf_unified here.
if (__testget)
{
if (__testout)
_M_really_overflow();
#if _GLIBCPP_AVOID_FSEEK
else if ((_M_in_cur - _M_in_beg) == 1)
_M_file->sys_getc();
#endif
else
_M_file->seekoff(_M_in_cur - _M_in_beg,
ios_base::cur, ios_base::in);
}
 
if (__testinit || __testget)
{
// Assume buffered case, need to refill internal buffers.
streamsize __size = _M_file->xsgetn(_M_in_beg, _M_buf_size);
if (0 < __size)
{
_M_set_determinate(__size);
if (__testout)
_M_out_cur = _M_in_cur;
__ret = traits_type::to_int_type(*_M_in_cur);
#if _GLIBCPP_AVOID_FSEEK
if (__size == 1)
_M_file->sys_ungetc(*_M_in_cur);
else
{
#endif
streamoff __p = _M_file->seekoff(0 - __size, ios_base::cur,
ios_base::in);
if (__p == -1)
{
// XXX Something is wrong, do error checking.
}
#if _GLIBCPP_AVOID_FSEEK
}
#endif
}
}
}
_M_last_overflowed = false;
return __ret;
}
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
pbackfail(int_type __i)
{
int_type __ret = traits_type::eof();
bool __testin = _M_mode & ios_base::in;
 
if (__testin)
{
bool __testpb = _M_in_beg < _M_in_cur;
char_type __c = traits_type::to_char_type(__i);
bool __testeof = traits_type::eq_int_type(__i, __ret);
 
if (__testpb)
{
bool __testout = _M_mode & ios_base::out;
bool __testeq = traits_type::eq(__c, this->gptr()[-1]);
 
// Try to put back __c into input sequence in one of three ways.
// Order these tests done in is unspecified by the standard.
if (!__testeof && __testeq)
{
--_M_in_cur;
if (__testout)
--_M_out_cur;
__ret = __i;
}
else if (__testeof)
{
--_M_in_cur;
if (__testout)
--_M_out_cur;
__ret = traits_type::not_eof(__i);
}
else if (!__testeof)
{
--_M_in_cur;
if (__testout)
--_M_out_cur;
_M_pback_create();
*_M_in_cur = __c;
__ret = __i;
}
}
else
{
// At the beginning of the buffer, need to make a
// putback position available.
this->seekoff(-1, ios_base::cur);
this->underflow();
if (!__testeof)
{
if (!traits_type::eq(__c, *_M_in_cur))
{
_M_pback_create();
*_M_in_cur = __c;
}
__ret = __i;
}
else
__ret = traits_type::not_eof(__i);
}
}
_M_last_overflowed = false;
return __ret;
}
 
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
overflow(int_type __c)
{
int_type __ret = traits_type::eof();
bool __testput = _M_out_cur && _M_out_cur < _M_buf + _M_buf_size;
bool __testout = _M_mode & ios_base::out;
if (__testout)
{
if (__testput)
{
*_M_out_cur = traits_type::to_char_type(__c);
_M_out_cur_move(1);
__ret = traits_type::not_eof(__c);
}
else
__ret = this->_M_really_overflow(__c);
}
 
_M_last_overflowed = false; // Set in _M_really_overflow, below.
return __ret;
}
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
_M_really_overflow(int_type __c)
{
int_type __ret = traits_type::eof();
bool __testput = _M_out_cur && _M_out_beg < _M_out_end;
bool __testunbuffered = _M_file && !_M_buf_size;
 
if (__testput || __testunbuffered)
{
#if 1
int __plen = _M_out_end - _M_out_beg;
streamsize __len = 0;
 
if (__plen)
__len = _M_file->xsputn(_M_out_beg, __plen);
 
if (__c !=traits_type::eof())
{
char_type __pending = traits_type::to_char_type(__c);
__len += _M_file->xsputn(&__pending, 1);
++__plen;
}
 
// NB: Need this so that external byte sequence reflects
// internal buffer.
_M_file->sync();
if (__len == __plen)
{
_M_set_indeterminate();
__ret = traits_type::not_eof(__c);
}
#else
// Part one: Allocate temporary conversion buffer on
// stack. Convert internal buffer plus __c (ie,
// "pending sequence") to temporary conversion buffer.
int __plen = _M_out_end - _M_out_beg;
char_type* __pbuf = static_cast<char_type*>(__builtin_alloca(sizeof(char_type) * __plen + 1));
traits_type::copy(__pbuf, this->pbase(), __plen);
if (!__testeof)
{
__pbuf[__plen] = traits_type::to_char_type(__c);
++__plen;
}
 
char_type* __pend;
char* __conv_buf = static_cast<char*>(__builtin_alloca(__plen));
char* __conv_end;
_M_state_beg = _M_state_cur;
 
__res_type __r = _M_fcvt->out(_M_state_cur,
__pbuf, __pbuf + __plen,
const_cast<const char_type*&>(__pend),
__conv_buf, __conv_buf + __plen,
__conv_end);
// Part two: (Re)spill converted "pending sequence"
// contents (now in temporary conversion buffer) to
// external buffer (_M_file->_IO_*) using
// _M_file->sys_write(), and do error (minimal) checking.
if (__r != codecvt_base::error)
{
streamsize __len = _M_file->xsputn(__conv_buf, __plen);
// NB: Need this so that external byte sequence reflects
// internal buffer.
_M_file->sync();
if (__len == __plen)
{
_M_set_indeterminate();
__ret = traits_type::not_eof(__c);
}
}
#endif
}
_M_last_overflowed = true;
return __ret;
}
 
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::__streambuf_type*
basic_filebuf<_CharT, _Traits>::
setbuf(char_type* __s, streamsize __n)
{
if (!this->is_open() && __s == 0 && __n == 0)
_M_buf_size_opt = 0;
else if (__s && __n)
{
// This is implementation-defined behavior, and assumes
// that an external char_type array of length (__s + __n)
// exists and has been pre-allocated. If this is not the
// case, things will quickly blow up.
// Step 1: Destroy the current internal array.
_M_destroy_internal_buffer();
// Step 2: Use the external array.
_M_buf = __s;
_M_buf_size_opt = _M_buf_size = __n;
_M_set_indeterminate();
// Step 3: Make sure a pback buffer is allocated.
_M_allocate_pback_buffer();
}
_M_last_overflowed = false;
return this;
}
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::pos_type
basic_filebuf<_CharT, _Traits>::
seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
{
pos_type __ret = pos_type(off_type(-1));
bool __testopen = this->is_open();
bool __testin = __mode & ios_base::in && _M_mode & ios_base::in;
bool __testout = __mode & ios_base::out && _M_mode & ios_base::out;
 
// Should probably do has_facet checks here.
int __width = use_facet<__codecvt_type>(_M_buf_locale).encoding();
if (__width < 0)
__width = 0;
bool __testfail = __off != 0 && __width <= 0;
if (__testopen && !__testfail && (__testin || __testout))
{
// Ditch any pback buffers to avoid confusion.
_M_pback_destroy();
 
if (__way != ios_base::cur || __off != 0)
{
off_type __computed_off = __width * __off;
bool __testget = _M_in_cur && _M_in_beg < _M_in_end;
bool __testput = _M_out_cur && _M_out_beg < _M_out_end;
// Sync the internal and external streams.
// out
if (__testput || _M_last_overflowed)
{
// Part one: update the output sequence.
this->sync();
// Part two: output unshift sequence.
_M_output_unshift();
}
//in
// NB: underflow() rewinds the external buffer.
else if (__testget && __way == ios_base::cur)
__computed_off += _M_in_cur - _M_in_beg;
__ret = _M_file->seekoff(__computed_off, __way, __mode);
_M_set_indeterminate();
}
// NB: Need to do this in case _M_file in indeterminate
// state, ie _M_file->_offset == -1
else
{
__ret = _M_file->seekoff(__off, ios_base::cur, __mode);
__ret += max(_M_out_cur, _M_in_cur) - _M_buf;
}
}
_M_last_overflowed = false;
return __ret;
}
 
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::pos_type
basic_filebuf<_CharT, _Traits>::
seekpos(pos_type __pos, ios_base::openmode __mode)
{
pos_type __ret;
off_type __off = __pos;
 
__ret = this->seekoff(__off, ios_base::beg, __mode);
 
_M_last_overflowed = false;
return __ret;
}
 
template<typename _CharT, typename _Traits>
void
basic_filebuf<_CharT, _Traits>::
_M_output_unshift()
{ }
 
template<typename _CharT, typename _Traits>
void
basic_filebuf<_CharT, _Traits>::
imbue(const locale& __loc)
{
bool __testbeg = gptr() == eback() && pptr() == pbase();
 
if (__testbeg && _M_buf_locale != __loc)
{
_M_buf_locale = __loc;
_M_buf_locale_init = true;
}
 
// NB this may require the reconversion of previously
// converted chars. This in turn may cause the reconstruction
// of the original file. YIKES!!
// XXX The part in the above comment is not done.
_M_last_overflowed = false;
}
} // namespace std
 
#endif // _CPP_BITS_FSTREAM_TCC
 
 
/contrib/media/updf/include/bits/functexcept.h
0,0 → 1,85
// Function-Based Exception Support -*- C++ -*-
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 19.1 Exception classes
//
 
#include <exception_defines.h>
 
namespace std
{
// Helper for exception objects in <except>
void
__throw_bad_exception(void);
 
// Helper for exception objects in <new>
void
__throw_bad_alloc(void);
 
// Helper for exception objects in <typeinfo>
void
__throw_bad_cast(void);
 
void
__throw_bad_typeid(void);
 
// Helpers for exception objects in <stdexcept>
void
__throw_logic_error(const char* __s);
 
void
__throw_domain_error(const char* __s);
 
void
__throw_invalid_argument(const char* __s);
 
void
__throw_length_error(const char* __s);
 
void
__throw_out_of_range(const char* __s);
 
void
__throw_runtime_error(const char* __s);
 
void
__throw_range_error(const char* __s);
 
void
__throw_overflow_error(const char* __s);
 
void
__throw_underflow_error(const char* __s);
 
// Helpers for exception objects in basic_ios
void
__throw_ios_failure(const char* __s);
} // namespace std
 
/contrib/media/updf/include/bits/generic_shadow.h
0,0 → 1,59
// generic C header shadow file -*- C++ -*-
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// This file is included by all the standard C <foo.h> headers
// after defining _SHADOW_NAME.
 
#ifdef _IN_C_LEGACY_ /* sub-included by a C header */
 
// Get out of the "swamp."
} // Close extern "C"
} // Close namespace _C_legacy::
 
# undef _IN_C_LEGACY_
# include _SHADOW_NAME
 
// Dive back into the "swamp."
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
#else /* not _IN_C_LEGACY_: directly included by user program */
# include _SHADOW_NAME
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
 
using namespace ::_C_legacy::_C_shadow;
#endif /* _IN_C_LEGACY_ */
 
 
/contrib/media/updf/include/bits/gslice.h
0,0 → 1,119
// The template and inlines for the -*- C++ -*- gslice class.
 
// Copyright (C) 1997-2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
 
#ifndef _CPP_BITS_GSLICE_H
#define _CPP_BITS_GSLICE_H 1
 
#pragma GCC system_header
 
namespace std {
class gslice
{
public:
gslice ();
gslice (size_t, const valarray<size_t>&, const valarray<size_t>&);
// XXX: the IS says the copy-ctor and copy-assignment operators are
// synthetized by the compiler but they are just unsuitable
// for a ref-counted semantic
gslice(const gslice&);
~gslice();
 
// XXX: See the note above.
gslice& operator= (const gslice&);
size_t start () const;
valarray<size_t> size () const;
valarray<size_t> stride () const;
private:
struct _Indexer {
size_t _M_count;
size_t _M_start;
valarray<size_t> _M_size;
valarray<size_t> _M_stride;
valarray<size_t> _M_index;
_Indexer(size_t, const valarray<size_t>&,
const valarray<size_t>&);
void _M_increment_use() { ++_M_count; }
size_t _M_decrement_use() { return --_M_count; }
};
 
_Indexer* _M_index;
template<typename _Tp> friend class valarray;
};
inline size_t
gslice::start () const
{ return _M_index ? _M_index->_M_start : 0; }
inline valarray<size_t>
gslice::size () const
{ return _M_index ? _M_index->_M_size : valarray<size_t>(); }
inline valarray<size_t>
gslice::stride () const
{ return _M_index ? _M_index->_M_stride : valarray<size_t>(); }
inline gslice::gslice () : _M_index(0) {}
 
inline
gslice::gslice(size_t __o, const valarray<size_t>& __l,
const valarray<size_t>& __s)
: _M_index(new gslice::_Indexer(__o, __l, __s)) {}
 
inline
gslice::gslice(const gslice& __g) : _M_index(__g._M_index)
{ if (_M_index) _M_index->_M_increment_use(); }
inline
gslice::~gslice()
{ if (_M_index && _M_index->_M_decrement_use() == 0) delete _M_index; }
 
inline gslice&
gslice::operator= (const gslice& __g)
{
if (__g._M_index) __g._M_index->_M_increment_use();
if (_M_index && _M_index->_M_decrement_use() == 0) delete _M_index;
_M_index = __g._M_index;
return *this;
}
} // std::
 
 
#endif /* _CPP_BITS_GSLICE_H */
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/gslice_array.h
0,0 → 1,171
// The template and inlines for the -*- C++ -*- gslice_array class.
 
// Copyright (C) 1997-2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
 
#ifndef _CPP_BITS_GSLICE_ARRAY
#define _CPP_BITS_GSLICE_ARRAY 1
 
#pragma GCC system_header
 
namespace std {
 
template<typename _Tp> class gslice_array
{
public:
typedef _Tp value_type;
 
void operator= (const valarray<_Tp>&) const;
void operator*= (const valarray<_Tp>&) const;
void operator/= (const valarray<_Tp>&) const;
void operator%= (const valarray<_Tp>&) const;
void operator+= (const valarray<_Tp>&) const;
void operator-= (const valarray<_Tp>&) const;
void operator^= (const valarray<_Tp>&) const;
void operator&= (const valarray<_Tp>&) const;
void operator|= (const valarray<_Tp>&) const;
void operator<<=(const valarray<_Tp>&) const;
void operator>>=(const valarray<_Tp>&) const;
void operator=(const _Tp&);
 
template<class _Dom>
void operator= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator*= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator/= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator%= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator+= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator-= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator^= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator&= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator|= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator<<= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator>>= (const _Expr<_Dom,_Tp>&) const;
private:
_Array<_Tp> _M_array;
const valarray<size_t>& _M_index;
friend class valarray<_Tp>;
gslice_array (_Array<_Tp>, const valarray<size_t>&);
 
// this constructor needs to be implemented.
gslice_array (const gslice_array&);
 
// not implemented
gslice_array();
gslice_array& operator= (const gslice_array&);
};
 
template<typename _Tp>
inline
gslice_array<_Tp>::gslice_array (_Array<_Tp> __a,
const valarray<size_t>& __i)
: _M_array (__a), _M_index (__i) {}
 
 
template<typename _Tp>
inline
gslice_array<_Tp>::gslice_array (const gslice_array<_Tp>& __a)
: _M_array (__a._M_array), _M_index (__a._M_index) {}
 
template<typename _Tp>
inline void
gslice_array<_Tp>::operator= (const _Tp& __t)
{
__valarray_fill (_M_array, _Array<size_t>(_M_index),
_M_index.size(), __t);
}
 
template<typename _Tp>
inline void
gslice_array<_Tp>::operator= (const valarray<_Tp>& __v) const
{
__valarray_copy (_Array<_Tp> (__v), __v.size (),
_M_array, _Array<size_t>(_M_index));
}
 
template<typename _Tp>
template<class E>
inline void
gslice_array<_Tp>::operator= (const _Expr<E, _Tp>& __e) const
{
__valarray_copy (__e, _M_index.size(), _M_array,
_Array<size_t>(_M_index));
}
 
#undef _DEFINE_VALARRAY_OPERATOR
#define _DEFINE_VALARRAY_OPERATOR(op, name) \
template<typename _Tp> \
inline void \
gslice_array<_Tp>::operator op##= (const valarray<_Tp>& __v) const \
{ \
_Array_augmented_##name (_M_array, _Array<size_t>(_M_index), \
_Array<_Tp> (__v), __v.size ()); \
} \
\
template<typename _Tp> template<class E> \
inline void \
gslice_array<_Tp>::operator op##= (const _Expr<E, _Tp>& __e) const \
{ \
_Array_augmented_##name (_M_array, _Array<size_t>(_M_index), __e, \
_M_index.size()); \
}
 
_DEFINE_VALARRAY_OPERATOR(*, multiplies)
_DEFINE_VALARRAY_OPERATOR(/, divides)
_DEFINE_VALARRAY_OPERATOR(%, modulus)
_DEFINE_VALARRAY_OPERATOR(+, plus)
_DEFINE_VALARRAY_OPERATOR(-, minus)
_DEFINE_VALARRAY_OPERATOR(^, xor)
_DEFINE_VALARRAY_OPERATOR(&, and)
_DEFINE_VALARRAY_OPERATOR(|, or)
_DEFINE_VALARRAY_OPERATOR(<<, shift_left)
_DEFINE_VALARRAY_OPERATOR(>>, shift_right)
 
#undef _DEFINE_VALARRAY_OPERATOR
 
} // std::
 
#endif /* _CPP_BITS_GSLICE_ARRAY */
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/indirect_array.h
0,0 → 1,162
// The template and inlines for the -*- C++ -*- indirect_array class.
 
// Copyright (C) 1997-2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
 
#ifndef _CPP_BITS_INDIRECT_ARRAY_H
#define _CPP_BITS_INDIRECT_ARRAY_H 1
 
#pragma GCC system_header
 
namespace std {
 
template <class _Tp> class indirect_array
{
public:
typedef _Tp value_type;
void operator= (const valarray<_Tp>&) const;
void operator*= (const valarray<_Tp>&) const;
void operator/= (const valarray<_Tp>&) const;
void operator%= (const valarray<_Tp>&) const;
void operator+= (const valarray<_Tp>&) const;
void operator-= (const valarray<_Tp>&) const;
void operator^= (const valarray<_Tp>&) const;
void operator&= (const valarray<_Tp>&) const;
void operator|= (const valarray<_Tp>&) const;
void operator<<= (const valarray<_Tp>&) const;
void operator>>= (const valarray<_Tp>&) const;
void operator= (const _Tp&);
// ~indirect_array();
 
template<class _Dom>
void operator= (const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
void operator*= (const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
void operator/= (const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
void operator%= (const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
void operator+= (const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
void operator-= (const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
void operator^= (const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
void operator&= (const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
void operator|= (const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
void operator<<= (const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
void operator>>= (const _Expr<_Dom, _Tp>&) const;
 
private:
indirect_array (const indirect_array&);
indirect_array (_Array<_Tp>, size_t, _Array<size_t>);
 
friend class valarray<_Tp>;
friend class gslice_array<_Tp>;
 
const size_t _M_sz;
const _Array<size_t> _M_index;
const _Array<_Tp> _M_array;
 
// not implemented
indirect_array ();
indirect_array& operator= (const indirect_array&);
};
 
template<typename _Tp>
inline indirect_array<_Tp>::indirect_array(const indirect_array<_Tp>& __a)
: _M_sz (__a._M_sz), _M_index (__a._M_index),
_M_array (__a._M_array) {}
template<typename _Tp>
inline
indirect_array<_Tp>::indirect_array (_Array<_Tp> __a, size_t __s,
_Array<size_t> __i)
: _M_sz (__s), _M_index (__i), _M_array (__a) {}
// template<typename _Tp>
// inline indirect_array<_Tp>::~indirect_array() {}
 
template<typename _Tp>
inline void
indirect_array<_Tp>::operator= (const _Tp& __t)
{ __valarray_fill(_M_array, _M_index, _M_sz, __t); }
 
template<typename _Tp>
inline void
indirect_array<_Tp>::operator= (const valarray<_Tp>& __v) const
{ __valarray_copy (_Array<_Tp> (__v), _M_sz, _M_array, _M_index); }
 
template<typename _Tp>
template<class _Dom>
inline void
indirect_array<_Tp>::operator= (const _Expr<_Dom,_Tp>& __e) const
{ __valarray_copy (__e, _M_sz, _M_array, _M_index); }
 
#undef _DEFINE_VALARRAY_OPERATOR
#define _DEFINE_VALARRAY_OPERATOR(op, name) \
template<typename _Tp> \
inline void \
indirect_array<_Tp>::operator op##= (const valarray<_Tp>& __v) const \
{ \
_Array_augmented_##name (_M_array, _M_index, _Array<_Tp> (__v), _M_sz); \
} \
\
template<typename _Tp> template<class _Dom> \
inline void \
indirect_array<_Tp>::operator op##= (const _Expr<_Dom,_Tp>& __e) const \
{ \
_Array_augmented_##name (_M_array, _M_index, __e, _M_sz); \
}
 
_DEFINE_VALARRAY_OPERATOR(*, multiplies)
_DEFINE_VALARRAY_OPERATOR(/, divides)
_DEFINE_VALARRAY_OPERATOR(%, modulus)
_DEFINE_VALARRAY_OPERATOR(+, plus)
_DEFINE_VALARRAY_OPERATOR(-, minus)
_DEFINE_VALARRAY_OPERATOR(^, xor)
_DEFINE_VALARRAY_OPERATOR(&, and)
_DEFINE_VALARRAY_OPERATOR(|, or)
_DEFINE_VALARRAY_OPERATOR(<<, shift_left)
_DEFINE_VALARRAY_OPERATOR(>>, shift_right)
 
#undef _DEFINE_VALARRAY_OPERATOR
 
} // std::
 
#endif /* _CPP_BITS_INDIRECT_ARRAY_H */
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/ios_base.h
0,0 → 1,569
// Iostreams base classes -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.8 File-based streams
//
 
#ifndef _CPP_BITS_IOSBASE_H
#define _CPP_BITS_IOSBASE_H 1
 
#pragma GCC system_header
 
namespace std
{
// The following definitions of bitmask types are enums, not ints,
// as permitted (but not required) in the standard, in order to provide
// better type safety in iostream calls. A side effect is that
// expressions involving them are no longer compile-time constants.
enum _Ios_Fmtflags { _M_ios_fmtflags_end = 1L << 16 };
 
inline _Ios_Fmtflags
operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
{ return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
 
inline _Ios_Fmtflags
operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
{ return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
 
inline _Ios_Fmtflags
operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
{ return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
 
inline _Ios_Fmtflags
operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
{ return __a = __a | __b; }
 
inline _Ios_Fmtflags
operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
{ return __a = __a & __b; }
 
inline _Ios_Fmtflags
operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
{ return __a = __a ^ __b; }
 
inline _Ios_Fmtflags
operator~(_Ios_Fmtflags __a)
{ return _Ios_Fmtflags(~static_cast<int>(__a)); }
 
 
enum _Ios_Openmode { _M_ios_openmode_end = 1L << 16 };
 
inline _Ios_Openmode
operator&(_Ios_Openmode __a, _Ios_Openmode __b)
{ return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
 
inline _Ios_Openmode
operator|(_Ios_Openmode __a, _Ios_Openmode __b)
{ return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
 
inline _Ios_Openmode
operator^(_Ios_Openmode __a, _Ios_Openmode __b)
{ return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
 
inline _Ios_Openmode
operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
{ return __a = __a | __b; }
 
inline _Ios_Openmode
operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
{ return __a = __a & __b; }
 
inline _Ios_Openmode
operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
{ return __a = __a ^ __b; }
 
inline _Ios_Openmode
operator~(_Ios_Openmode __a)
{ return _Ios_Openmode(~static_cast<int>(__a)); }
 
 
enum _Ios_Iostate { _M_ios_iostate_end = 1L << 16 };
 
inline _Ios_Iostate
operator&(_Ios_Iostate __a, _Ios_Iostate __b)
{ return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
 
inline _Ios_Iostate
operator|(_Ios_Iostate __a, _Ios_Iostate __b)
{ return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
 
inline _Ios_Iostate
operator^(_Ios_Iostate __a, _Ios_Iostate __b)
{ return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
 
inline _Ios_Iostate
operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
{ return __a = __a | __b; }
 
inline _Ios_Iostate
operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
{ return __a = __a & __b; }
 
inline _Ios_Iostate
operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
{ return __a = __a ^ __b; }
 
inline _Ios_Iostate
operator~(_Ios_Iostate __a)
{ return _Ios_Iostate(~static_cast<int>(__a)); }
 
enum _Ios_Seekdir { _M_ios_seekdir_end = 1L << 16 };
 
// 27.4.2 Class ios_base
class ios_base
{
public:
// 27.4.2.1.1 Class ios_base::failure
class failure : public exception
{
public:
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// Can't do exception(_msg) as defined in 27.4.2.1.1
explicit
failure(const string& __str) throw();
 
virtual
~failure() throw();
 
virtual const char*
what() const throw();
private:
enum { _M_bufsize = 256 };
char _M_name[_M_bufsize];
#endif
};
 
// 27.4.2.1.2 Type ios_base::fmtflags
typedef _Ios_Fmtflags fmtflags;
// 27.4.2.1.2 Type fmtflags
static const fmtflags boolalpha = fmtflags(__ios_flags::_S_boolalpha);
static const fmtflags dec = fmtflags(__ios_flags::_S_dec);
static const fmtflags fixed = fmtflags(__ios_flags::_S_fixed);
static const fmtflags hex = fmtflags(__ios_flags::_S_hex);
static const fmtflags internal = fmtflags(__ios_flags::_S_internal);
static const fmtflags left = fmtflags(__ios_flags::_S_left);
static const fmtflags oct = fmtflags(__ios_flags::_S_oct);
static const fmtflags right = fmtflags(__ios_flags::_S_right);
static const fmtflags scientific = fmtflags(__ios_flags::_S_scientific);
static const fmtflags showbase = fmtflags(__ios_flags::_S_showbase);
static const fmtflags showpoint = fmtflags(__ios_flags::_S_showpoint);
static const fmtflags showpos = fmtflags(__ios_flags::_S_showpos);
static const fmtflags skipws = fmtflags(__ios_flags::_S_skipws);
static const fmtflags unitbuf = fmtflags(__ios_flags::_S_unitbuf);
static const fmtflags uppercase = fmtflags(__ios_flags::_S_uppercase);
static const fmtflags adjustfield = fmtflags(__ios_flags::_S_adjustfield);
static const fmtflags basefield = fmtflags(__ios_flags::_S_basefield);
static const fmtflags floatfield = fmtflags(__ios_flags::_S_floatfield);
 
// 27.4.2.1.3 Type ios_base::iostate
typedef _Ios_Iostate iostate;
static const iostate badbit = iostate(__ios_flags::_S_badbit);
static const iostate eofbit = iostate(__ios_flags::_S_eofbit);
static const iostate failbit = iostate(__ios_flags::_S_failbit);
static const iostate goodbit = iostate(0);
 
// 27.4.2.1.4 Type openmode
typedef _Ios_Openmode openmode;
static const openmode app = openmode(__ios_flags::_S_app);
static const openmode ate = openmode(__ios_flags::_S_ate);
static const openmode binary = openmode(__ios_flags::_S_bin);
static const openmode in = openmode(__ios_flags::_S_in);
static const openmode out = openmode(__ios_flags::_S_out);
static const openmode trunc = openmode(__ios_flags::_S_trunc);
 
// 27.4.2.1.5 Type seekdir
typedef _Ios_Seekdir seekdir;
static const seekdir beg = seekdir(0);
static const seekdir cur = seekdir(SEEK_CUR);
static const seekdir end = seekdir(SEEK_END);
 
#ifdef _GLIBCPP_DEPRECATED
typedef int io_state;
typedef int open_mode;
typedef int seek_dir;
#endif
 
// Callbacks;
enum event
{
erase_event,
imbue_event,
copyfmt_event
};
 
typedef void (*event_callback) (event, ios_base&, int);
 
void
register_callback(event_callback __fn, int __index);
 
protected:
// Data Members
streamsize _M_precision;
streamsize _M_width;
fmtflags _M_flags;
 
// 27.4.2.6 Members for callbacks
// 27.4.2.6 ios_base callbacks
struct _Callback_list
{
// Data Members
_Callback_list* _M_next;
ios_base::event_callback _M_fn;
int _M_index;
int _M_refcount; // 0 means one reference.
_Callback_list(ios_base::event_callback __fn, int __index,
_Callback_list* __cb)
: _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
void
_M_add_reference() { ++_M_refcount; } // XXX MT
int
_M_remove_reference() { return _M_refcount--; } // 0 => OK to delete
};
 
_Callback_list* _M_callbacks;
 
void
_M_call_callbacks(event __ev) throw();
 
void
_M_dispose_callbacks(void);
 
// 27.4.2.5 Members for iword/pword storage
struct _Words
{
void* _M_pword;
long _M_iword;
};
 
static const int _S_local_words = 8;
_Words _M_word_array[_S_local_words]; // Guaranteed storage
_Words _M_dummy; // Only for failed iword/pword calls.
_Words* _M_words;
int _M_word_limit;
_Words&
_M_grow_words(int __index);
 
// Members for locale and locale caching.
locale _M_ios_locale;
 
void
_M_init();
 
public:
 
// 27.4.2.1.6 Class ios_base::Init
// Used to initialize standard streams. In theory, g++ could use
// -finit-priority to order this stuff correctly without going
// through these machinations.
class Init
{
friend class ios_base;
public:
Init();
~Init();
static void
_S_ios_create(bool __sync);
static void
_S_ios_destroy();
 
private:
static int _S_ios_base_init;
static bool _S_synced_with_stdio;
};
 
// Fmtflags state:
inline fmtflags
flags() const { return _M_flags; }
 
inline fmtflags
flags(fmtflags __fmtfl)
{
fmtflags __old = _M_flags;
_M_flags = __fmtfl;
return __old;
}
 
inline fmtflags
setf(fmtflags __fmtfl)
{
fmtflags __old = _M_flags;
_M_flags |= __fmtfl;
return __old;
}
 
inline fmtflags
setf(fmtflags __fmtfl, fmtflags __mask)
{
fmtflags __old = _M_flags;
_M_flags &= ~__mask;
_M_flags |= (__fmtfl & __mask);
return __old;
}
 
inline void
unsetf(fmtflags __mask) { _M_flags &= ~__mask; }
 
inline streamsize
precision() const { return _M_precision; }
 
inline streamsize
precision(streamsize __prec)
{
streamsize __old = _M_precision;
_M_precision = __prec;
return __old;
}
 
inline streamsize
width() const { return _M_width; }
 
inline streamsize
width(streamsize __wide)
{
streamsize __old = _M_width;
_M_width = __wide;
return __old;
}
 
static bool
sync_with_stdio(bool __sync = true);
 
// Locales:
locale
imbue(const locale& __loc);
 
inline locale
getloc() const { return _M_ios_locale; }
 
// Storage:
static int
xalloc() throw();
 
inline long&
iword(int __ix)
{
_Words& __word = (__ix < _M_word_limit)
? _M_words[__ix] : _M_grow_words(__ix);
return __word._M_iword;
}
 
inline void*&
pword(int __ix)
{
_Words& __word = (__ix < _M_word_limit)
? _M_words[__ix] : _M_grow_words(__ix);
return __word._M_pword;
}
 
// Destructor
~ios_base();
 
protected:
ios_base();
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
private:
ios_base(const ios_base&);
 
ios_base&
operator=(const ios_base&);
#endif
};
// 27.4.5.1 fmtflags manipulators:
inline ios_base&
boolalpha(ios_base& __base)
{
__base.setf(ios_base::boolalpha);
return __base;
}
 
inline ios_base&
noboolalpha(ios_base& __base)
{
__base.unsetf(ios_base::boolalpha);
return __base;
}
 
inline ios_base&
showbase(ios_base& __base)
{
__base.setf(ios_base::showbase);
return __base;
}
 
inline ios_base&
noshowbase(ios_base& __base)
{
__base.unsetf(ios_base::showbase);
return __base;
}
 
inline ios_base&
showpoint(ios_base& __base)
{
__base.setf(ios_base::showpoint);
return __base;
}
 
inline ios_base&
noshowpoint(ios_base& __base)
{
__base.unsetf(ios_base::showpoint);
return __base;
}
 
inline ios_base&
showpos(ios_base& __base)
{
__base.setf(ios_base::showpos);
return __base;
}
 
inline ios_base&
noshowpos(ios_base& __base)
{
__base.unsetf(ios_base::showpos);
return __base;
}
 
inline ios_base&
skipws(ios_base& __base)
{
__base.setf(ios_base::skipws);
return __base;
}
inline ios_base&
noskipws(ios_base& __base)
{
__base.unsetf(ios_base::skipws);
return __base;
}
 
inline ios_base&
uppercase(ios_base& __base)
{
__base.setf(ios_base::uppercase);
return __base;
}
 
inline ios_base&
nouppercase(ios_base& __base)
{
__base.unsetf(ios_base::uppercase);
return __base;
}
 
inline ios_base&
unitbuf(ios_base& __base)
{
__base.setf(ios_base::unitbuf);
return __base;
}
 
inline ios_base&
nounitbuf(ios_base& __base)
{
__base.unsetf(ios_base::unitbuf);
return __base;
}
 
// 27.4.5.2 adjustfield anipulators:
inline ios_base&
internal(ios_base& __base)
{
__base.setf(ios_base::internal, ios_base::adjustfield);
return __base;
}
 
inline ios_base&
left(ios_base& __base)
{
__base.setf(ios_base::left, ios_base::adjustfield);
return __base;
}
inline ios_base&
right(ios_base& __base)
{
__base.setf(ios_base::right, ios_base::adjustfield);
return __base;
}
// 27.4.5.3 basefield anipulators:
inline ios_base&
dec(ios_base& __base)
{
__base.setf(ios_base::dec, ios_base::basefield);
return __base;
}
inline ios_base&
hex(ios_base& __base)
{
__base.setf(ios_base::hex, ios_base::basefield);
return __base;
}
 
inline ios_base&
oct(ios_base& __base)
{
__base.setf(ios_base::oct, ios_base::basefield);
return __base;
}
// 27.4.5.4 floatfield anipulators:
inline ios_base&
fixed(ios_base& __base)
{
__base.setf(ios_base::fixed, ios_base::floatfield);
return __base;
}
 
inline ios_base&
scientific(ios_base& __base)
{
__base.setf(ios_base::scientific, ios_base::floatfield);
return __base;
}
 
} // namespace std
 
#endif /* _CPP_BITS_IOSBASE_H */
 
/contrib/media/updf/include/bits/istream.tcc
0,0 → 1,1239
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.6.2 Output streams
//
 
#include <bits/std_locale.h>
#include <bits/std_ostream.h> // for flush()
 
namespace std
{
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>::sentry::
sentry(basic_istream<_CharT, _Traits>& __in, bool __noskipws)
{
if (__in.good())
{
if (__in.tie())
__in.tie()->flush();
if (!__noskipws && (__in.flags() & ios_base::skipws))
{
const __int_type __eof = traits_type::eof();
const __ctype_type* __ctype = __in._M_get_fctype_ios();
__streambuf_type* __sb = __in.rdbuf();
__int_type __c = __sb->sgetc();
while (__c != __eof && __ctype->is(ctype_base::space, __c))
__c = __sb->snextc();
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//195. Should basic_istream::sentry's constructor ever set eofbit?
if (__c == __eof)
__in.setstate(ios_base::eofbit);
#endif
}
}
 
if (__in.good())
_M_ok = true;
else
{
_M_ok = false;
__in.setstate(ios_base::failbit);
}
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(__istream_type& (*__pf)(__istream_type&))
{
__pf(*this);
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(__ios_type& (*__pf)(__ios_type&))
{
__pf(*this);
return *this;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(ios_base& (*__pf)(ios_base&))
{
__pf(*this);
return *this;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(bool& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(short& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(unsigned short& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(int& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(unsigned int& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(long& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(unsigned long& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
#ifdef _GLIBCPP_USE_LONG_LONG
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(long long& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(unsigned long long& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
#endif
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(float& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(double& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(long double& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(void*& __n)
{
sentry __cerb(*this, false);
if (__cerb)
{
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (_M_check_facet(_M_fnumget))
_M_fnumget->get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(__streambuf_type* __sbout)
{
streamsize __xtrct = 0;
__streambuf_type* __sbin = this->rdbuf();
sentry __cerb(*this, false);
if (__sbout && __cerb)
__xtrct = __copy_streambufs(*this, __sbin, __sbout);
if (!__sbout || !__xtrct)
this->setstate(ios_base::failbit);
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>::int_type
basic_istream<_CharT, _Traits>::
get(void)
{
const int_type __eof = traits_type::eof();
int_type __c = __eof;
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
try
{
__c = this->rdbuf()->sbumpc();
// 27.6.1.1 paragraph 3
if (__c != __eof)
_M_gcount = 1;
else
this->setstate(ios_base::eofbit | ios_base::failbit);
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return __c;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
get(char_type& __c)
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
try
{
const int_type __eof = traits_type::eof();
int_type __bufval = this->rdbuf()->sbumpc();
// 27.6.1.1 paragraph 3
if (__bufval != __eof)
{
_M_gcount = 1;
__c = traits_type::to_char_type(__bufval);
}
else
this->setstate(ios_base::eofbit | ios_base::failbit);
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
get(char_type* __s, streamsize __n, char_type __delim)
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb && __n > 1)
{
try
{
const int_type __idelim = traits_type::to_int_type(__delim);
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sbumpc();
bool __testdelim = __c == __idelim;
bool __testeof = __c == __eof;
while (_M_gcount < __n - 1 && !__testeof && !__testdelim)
{
*__s++ = traits_type::to_char_type(__c);
++_M_gcount;
__c = __sb->sbumpc();
__testeof = __c == __eof;
__testdelim = __c == __idelim;
}
if (__testdelim || _M_gcount == __n - 1)
__sb->sputbackc(__c);
if (__testeof)
this->setstate(ios_base::eofbit);
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
*__s = char_type();
if (!_M_gcount)
this->setstate(ios_base::failbit);
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
get(__streambuf_type& __sb, char_type __delim)
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
int_type __c;
__streambuf_type* __this_sb = this->rdbuf();
try
{
const int_type __idelim = traits_type::to_int_type(__delim);
const int_type __eof = traits_type::eof();
__c = __this_sb->sbumpc();
bool __testdelim = __c == __idelim;
bool __testeof = __c == __eof;
bool __testput = true;
while (!__testeof && !__testdelim
&& (__testput = __sb.sputc(traits_type::to_char_type(__c))
!= __eof))
{
++_M_gcount;
__c = __this_sb->sbumpc();
__testeof = __c == __eof;
__testdelim = __c == __idelim;
}
if (__testdelim || !__testput)
__this_sb->sputbackc(traits_type::to_char_type(__c));
if (__testeof)
this->setstate(ios_base::eofbit);
}
catch(exception& __fail)
{
// Exception may result from sputc->overflow.
__this_sb->sputbackc(traits_type::to_char_type(__c));
}
}
if (!_M_gcount)
this->setstate(ios_base::failbit);
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
getline(char_type* __s, streamsize __n, char_type __delim)
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
try
{
__streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sbumpc();
++_M_gcount;
const int_type __idelim = traits_type::to_int_type(__delim);
const int_type __eof = traits_type::eof();
bool __testdelim = __c == __idelim;
bool __testeof = __c == __eof;
while (_M_gcount < __n && !__testeof && !__testdelim)
{
*__s++ = traits_type::to_char_type(__c);
__c = __sb->sbumpc();
++_M_gcount;
__testeof = __c == __eof;
__testdelim = __c == __idelim;
}
if (__testeof)
{
--_M_gcount;
this->setstate(ios_base::eofbit);
}
else if (!__testdelim)
{
--_M_gcount;
__sb->sputbackc(traits_type::to_char_type(__c));
this->setstate(ios_base::failbit);
}
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
*__s = char_type();
if (!_M_gcount)
this->setstate(ios_base::failbit);
return *this;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
ignore(streamsize __n, int_type __delim)
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb && __n > 0)
{
try
{
const int_type __idelim = traits_type::to_int_type(__delim);
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sbumpc();
bool __testdelim = __c == __idelim;
bool __testeof = __c == __eof;
__n = min(__n, numeric_limits<streamsize>::max());
while (_M_gcount < __n - 1 && !__testeof && !__testdelim)
{
++_M_gcount;
__c = __sb->sbumpc();
__testeof = __c == __eof;
__testdelim = __c == __idelim;
}
if ((_M_gcount == __n - 1 && !__testeof) || __testdelim)
++_M_gcount;
if (__testeof)
this->setstate(ios_base::eofbit);
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>::int_type
basic_istream<_CharT, _Traits>::
peek(void)
{
int_type __c = traits_type::eof();
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
try
{ __c = this->rdbuf()->sgetc(); }
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return __c;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
read(char_type* __s, streamsize __n)
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
if (__n > 0)
{
try
{
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sbumpc();
bool __testeof = __c == __eof;
while (_M_gcount < __n - 1 && !__testeof)
{
*__s++ = traits_type::to_char_type(__c);
++_M_gcount;
__c = __sb->sbumpc();
__testeof = __c == __eof;
}
if (__testeof)
this->setstate(ios_base::eofbit | ios_base::failbit);
else
{
// _M_gcount == __n - 1
*__s++ = traits_type::to_char_type(__c);
++_M_gcount;
}
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
}
else
this->setstate(ios_base::failbit);
return *this;
}
template<typename _CharT, typename _Traits>
streamsize
basic_istream<_CharT, _Traits>::
readsome(char_type* __s, streamsize __n)
{
const int_type __eof = traits_type::eof();
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
if (__n > 0)
{
try
{
streamsize __num = this->rdbuf()->in_avail();
if (__num != static_cast<streamsize>(__eof))
{
__num = min(__num, __n);
_M_gcount = this->rdbuf()->sgetn(__s, __num);
}
else
this->setstate(ios_base::eofbit);
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
}
else
this->setstate(ios_base::failbit);
return _M_gcount;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
putback(char_type __c)
{
sentry __cerb(*this, true);
if (__cerb)
{
try
{
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
if (!__sb || __sb->sputbackc(__c) == __eof)
this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
else
this->setstate(ios_base::failbit);
return *this;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
unget(void)
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
try
{
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
if (!__sb || __eof == __sb->sungetc())
this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
else
this->setstate(ios_base::failbit);
return *this;
}
template<typename _CharT, typename _Traits>
int
basic_istream<_CharT, _Traits>::
sync(void)
{
int __ret = traits_type::eof();
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
try
{
__streambuf_type* __sb = this->rdbuf();
if (!__sb || __ret == __sb->pubsync())
this->setstate(ios_base::badbit);
else
__ret = 0;
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return __ret;
}
template<typename _CharT, typename _Traits>
typename basic_istream<_CharT, _Traits>::pos_type
basic_istream<_CharT, _Traits>::
tellg(void)
{
pos_type __ret = pos_type(-1);
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
try
{
__ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return __ret;
}
 
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
seekg(pos_type __pos)
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
try
{
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::in);
 
// 129. Need error indication from seekp() and seekg()
if (__err == pos_type(off_type(-1)))
this->setstate(failbit);
#endif
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
seekg(off_type __off, ios_base::seekdir __dir)
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
{
try
{
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
pos_type __err = this->rdbuf()->pubseekoff(__off, __dir,
ios_base::in);
 
// 129. Need error indication from seekp() and seekg()
if (__err == pos_type(off_type(-1)))
this->setstate(failbit);
#endif
}
catch(exception& __fail)
{
// 27.6.1.3 paragraph 1
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
// 27.6.1.2.3 Character extraction templates
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
try
{ __in.get(__c); }
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
__in.setstate(ios_base::badbit);
if ((__in.exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
else
__in.setstate(ios_base::failbit);
return __in;
}
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::__streambuf_type __streambuf_type;
typedef typename _Traits::int_type int_type;
typedef _CharT char_type;
typedef ctype<_CharT> __ctype_type;
streamsize __extracted = 0;
 
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
try
{
// Figure out how many characters to extract.
streamsize __num = __in.width();
if (__num == 0)
__num = numeric_limits<streamsize>::max();
__streambuf_type* __sb = __in.rdbuf();
const __ctype_type* __ctype = __in._M_get_fctype_ios();
int_type __c = __sb->sbumpc();
const int_type __eof = _Traits::eof();
bool __testsp = __ctype->is(ctype_base::space, __c);
bool __testeof = __c == __eof;
while (__extracted < __num - 1 && !__testeof && !__testsp)
{
*__s++ = __c;
++__extracted;
__c = __sb->sbumpc();
__testeof = __c == __eof;
__testsp = __ctype->is(ctype_base::space, __c);
}
if (!__testeof)
__sb->sputbackc(__c);
else
__in.setstate(ios_base::eofbit);
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//68. Extractors for char* should store null at end
*__s = char_type();
#endif
__in.width(0);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
__in.setstate(ios_base::badbit);
if ((__in.exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
if (!__extracted)
__in.setstate(ios_base::failbit);
return __in;
}
 
// 27.6.1.4 Standard basic_istream manipulators
template<typename _CharT, typename _Traits>
basic_istream<_CharT,_Traits>&
ws(basic_istream<_CharT,_Traits>& __in)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::__streambuf_type __streambuf_type;
typedef typename __istream_type::__ctype_type __ctype_type;
typedef typename __istream_type::int_type __int_type;
typedef typename __istream_type::char_type __char_type;
 
__streambuf_type* __sb = __in.rdbuf();
const __ctype_type* __ctype = __in._M_get_fctype_ios();
const __int_type __eof = _Traits::eof();
__int_type __c;
bool __testeof;
bool __testsp;
 
do
{
__c = __sb->sbumpc();
__testeof = __c == __eof;
__testsp = __ctype->is(ctype_base::space, __c);
}
while (!__testeof && __testsp);
 
if (!__testeof && !__testsp)
__sb->sputbackc(__c);
else
__in.setstate(ios_base::eofbit);
 
return __in;
}
 
// 21.3.7.9 basic_string::getline and operators
template<typename _CharT, typename _Traits, typename _Alloc>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __in,
basic_string<_CharT, _Traits, _Alloc>& __str)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::int_type __int_type;
typedef typename __istream_type::__streambuf_type __streambuf_type;
typedef typename __istream_type::__ctype_type __ctype_type;
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
__size_type __extracted = 0;
 
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
__str.erase();
streamsize __w = __in.width();
__size_type __n;
__n = __w > 0 ? static_cast<__size_type>(__w) : __str.max_size();
 
__streambuf_type* __sb = __in.rdbuf();
const __ctype_type* __ctype = __in._M_get_fctype_ios();
__int_type __c = __sb->sbumpc();
const __int_type __eof = _Traits::eof();
bool __testsp = __ctype->is(ctype_base::space, __c);
bool __testeof = __c == __eof;
 
while (__extracted < __n && !__testeof && !__testsp)
{
__str += _Traits::to_char_type(__c);
++__extracted;
__c = __sb->sbumpc();
__testeof = __c == __eof;
__testsp = __ctype->is(ctype_base::space, __c);
}
if (!__testeof)
__sb->sputbackc(__c);
else
__in.setstate(ios_base::eofbit);
__in.width(0);
}
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 2000-02-01 Number to be determined
if (!__extracted)
__in.setstate (ios_base::failbit);
#endif
return __in;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>& __in,
basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::int_type __int_type;
typedef typename __istream_type::__streambuf_type __streambuf_type;
typedef typename __istream_type::__ctype_type __ctype_type;
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
 
__size_type __extracted = 0;
bool __testdelim = false;
typename __istream_type::sentry __cerb(__in, true);
if (__cerb)
{
__str.erase();
__size_type __n = __str.max_size();
 
__int_type __idelim = _Traits::to_int_type(__delim);
__streambuf_type* __sb = __in.rdbuf();
__int_type __c = __sb->sbumpc();
const __int_type __eof = _Traits::eof();
__testdelim = __c == __idelim;
bool __testeof = __c == __eof;
 
while (__extracted <= __n && !__testeof && !__testdelim)
{
__str += _Traits::to_char_type(__c);
++__extracted;
__c = __sb->sbumpc();
__testeof = __c == __eof;
__testdelim = __c == __idelim;
}
if (__testeof)
__in.setstate(ios_base::eofbit);
}
if (!__extracted && !__testdelim)
__in.setstate(ios_base::failbit);
return __in;
}
 
template<class _CharT, class _Traits, class _Alloc>
inline basic_istream<_CharT,_Traits>&
getline(basic_istream<_CharT, _Traits>& __in,
basic_string<_CharT,_Traits,_Alloc>& __str)
{ return getline(__in, __str, __in.widen('\n')); }
} // namespace std
 
// Local Variables:
// mode:C++
// End:
 
/contrib/media/updf/include/bits/limits_generic.h
0,0 → 1,788
// The template and inlines for the -*- C++ -*- numeric_limits classes.
 
// Copyright (C) 2000-2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Note: this is not a conforming implementation.
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
 
//
// ISO 14882:1998
// 18.2.1
//
 
#ifndef _CPP_NUMERIC_LIMITS
#define _CPP_NUMERIC_LIMITS 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
#include <bits/std_cfloat.h>
#include <bits/std_climits.h>
#if defined( _GLIBCPP_USE_WCHAR_T)
#include <bits/std_cwchar.h>
#endif
 
namespace std {
 
enum float_round_style {
round_indeterminate = -1,
round_toward_zero = 0,
round_to_nearest = 1,
round_toward_infinity = 2,
round_toward_neg_infinity = 3
};
 
enum float_denorm_style {
denorm_indeterminate = -1,
denorm_absent = 0,
denorm_present = 1
};
 
template<typename _T> struct numeric_limits {
static const bool is_specialized = false;
 
static _T min() throw() { return static_cast<_T>(0); }
static _T max() throw() { return static_cast<_T>(0); }
 
static const int digits = 0;
static const int digits10 = 0;
static const bool is_signed = false;
static const bool is_integer = false;
static const bool is_exact = false;
static const int radix = 0;
 
static _T epsilon() throw() { return static_cast<_T>(0); }
static _T round_error() throw() { return static_cast<_T>(0); }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static _T infinity() throw() { return static_cast<_T>(0); }
static _T quiet_NaN() throw() { return static_cast<_T>(0); }
static _T signaling_NaN() throw() { return static_cast<_T>(0); }
static _T denorm_min() throw() { return static_cast<_T>(0); }
 
static const bool is_iec559 = false;
static const bool is_bounded = false;
static const bool is_modulo = false;
 
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<typename _T> _T __limits_infinity();
template<typename _T> _T __limits_quiet_NaN();
template<typename _T> _T __limits_signaling_NaN();
template<typename _T> _T __limits_denorm_min();
 
template<> struct numeric_limits<bool> {
static const bool is_specialized = true;
 
static bool min() throw()
{ return false; }
static bool max() throw()
{ return true; }
 
static const int digits = 1;
static const int digits10 = 0;
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;
static const int radix = 2;
static bool epsilon() throw()
{ return 0; }
static bool round_error() throw()
{ return 0; }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static bool infinity() throw()
{ return static_cast<bool>(0); }
static bool quiet_NaN() throw()
{ return static_cast<bool>(0); }
static bool signaling_NaN() throw()
{ return static_cast<bool>(0); }
static bool denorm_min() throw()
{ return static_cast<bool>(0); }
 
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = false;
 
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<> struct numeric_limits<char> {
static const bool is_specialized = true;
 
static char min() throw()
{ return CHAR_MIN; }
static char max() throw()
{ return CHAR_MAX; }
 
static const int digits = 7;
static const int digits10 = 2;
static const bool is_signed = true;
static const bool is_integer = true;
static const bool is_exact = true;
static const int radix = 2;
static char epsilon() throw()
{ return 0; }
static char round_error() throw()
{ return 0; }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static char infinity() throw()
{ return static_cast<char>(0); }
static char quiet_NaN() throw()
{ return static_cast<char>(0); }
static char signaling_NaN() throw()
{ return static_cast<char>(0); }
static char denorm_min() throw()
{ return static_cast<char>(0); }
 
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = false;
 
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<> struct numeric_limits<signed char> {
static const bool is_specialized = true;
 
static signed char min() throw()
{ return SCHAR_MIN; }
static signed char max() throw()
{ return SCHAR_MAX; }
 
static const int digits = 7;
static const int digits10 = 2;
static const bool is_signed = true;
static const bool is_integer = true;
static const bool is_exact = true;
static const int radix = 2;
static signed char epsilon() throw()
{ return 0; }
static signed char round_error() throw()
{ return 0; }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static signed char infinity() throw()
{ return static_cast<signed char>(0); }
static signed char quiet_NaN() throw()
{ return static_cast<signed char>(0); }
static signed char signaling_NaN() throw()
{ return static_cast<signed char>(0); }
static signed char denorm_min() throw()
{ return static_cast<signed char>(0); }
 
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = false;
 
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<> struct numeric_limits<unsigned char> {
static const bool is_specialized = true;
 
static unsigned char min() throw()
{ return 0; }
static unsigned char max() throw()
{ return UCHAR_MAX; }
 
static const int digits = 8;
static const int digits10 = 2;
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;
static const int radix = 2;
static unsigned char epsilon() throw()
{ return 0; }
static unsigned char round_error() throw()
{ return 0; }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static unsigned char infinity() throw()
{ return static_cast<unsigned char>(0); }
static unsigned char quiet_NaN() throw()
{ return static_cast<unsigned char>(0); }
static unsigned char signaling_NaN() throw()
{ return static_cast<unsigned char>(0); }
static unsigned char denorm_min() throw()
{ return static_cast<unsigned char>(0); }
 
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = true;
 
static const bool traps = true;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
#if defined( _GLIBCPP_USE_WCHAR_T)
template<> struct numeric_limits<wchar_t> {
static const bool is_specialized = true;
 
static wchar_t min() throw()
{ return WCHAR_MIN; }
static wchar_t max() throw()
{ return WCHAR_MAX; }
 
static const int digits = 31;
static const int digits10 = 9;
static const bool is_signed = true;
static const bool is_integer = true;
static const bool is_exact = true;
static const int radix = 2;
static wchar_t epsilon() throw()
{ return 0; }
static wchar_t round_error() throw()
{ return 0; }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static wchar_t infinity() throw()
{ return static_cast<wchar_t>(0); }
static wchar_t quiet_NaN() throw()
{ return static_cast<wchar_t>(0); }
static wchar_t signaling_NaN() throw()
{ return static_cast<wchar_t>(0); }
static wchar_t denorm_min() throw()
{ return static_cast<wchar_t>(0); }
 
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = false;
 
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
#endif
 
template<> struct numeric_limits<short> {
static const bool is_specialized = true;
 
static short min() throw()
{ return SHRT_MIN; }
static short max() throw()
{ return SHRT_MAX; }
 
static const int digits = 15;
static const int digits10 = 4;
static const bool is_signed = true;
static const bool is_integer = true;
static const bool is_exact = true;
static const int radix = 2;
static short epsilon() throw()
{ return 0; }
static short round_error() throw()
{ return 0; }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static short infinity() throw()
{ return static_cast<short>(0); }
static short quiet_NaN() throw()
{ return static_cast<short>(0); }
static short signaling_NaN() throw()
{ return static_cast<short>(0); }
static short denorm_min() throw()
{ return static_cast<short>(0); }
 
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = false;
 
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<> struct numeric_limits<unsigned short> {
static const bool is_specialized = true;
 
static unsigned short min() throw()
{ return 0; }
static unsigned short max() throw()
{ return USHRT_MAX; }
 
static const int digits = 16;
static const int digits10 = 4;
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;
static const int radix = 2;
static unsigned short epsilon() throw()
{ return 0; }
static unsigned short round_error() throw()
{ return 0; }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static unsigned short infinity() throw()
{ return static_cast<unsigned short>(0); }
static unsigned short quiet_NaN() throw()
{ return static_cast<unsigned short>(0); }
static unsigned short signaling_NaN() throw()
{ return static_cast<unsigned short>(0); }
static unsigned short denorm_min() throw()
{ return static_cast<unsigned short>(0); }
 
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = true;
 
static const bool traps = true;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<> struct numeric_limits<int> {
static const bool is_specialized = true;
 
static int min() throw()
{ return INT_MIN; }
static int max() throw()
{ return INT_MAX; }
 
static const int digits = 31;
static const int digits10 = 9;
static const bool is_signed = true;
static const bool is_integer = true;
static const bool is_exact = true;
static const int radix = 2;
static int epsilon() throw()
{ return 0; }
static int round_error() throw()
{ return 0; }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static int infinity() throw()
{ return static_cast<int>(0); }
static int quiet_NaN() throw()
{ return static_cast<int>(0); }
static int signaling_NaN() throw()
{ return static_cast<int>(0); }
static int denorm_min() throw()
{ return static_cast<int>(0); }
 
static const bool is_iec559 = true;
static const bool is_bounded = true;
static const bool is_modulo = false;
 
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<> struct numeric_limits<unsigned int> {
static const bool is_specialized = true;
 
static unsigned int min() throw()
{ return 0; }
static unsigned int max() throw()
{ return UINT_MAX; }
 
static const int digits = 32;
static const int digits10 = 9;
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;
static const int radix = 2;
static unsigned int epsilon() throw()
{ return 0; }
static unsigned int round_error() throw()
{ return 0; }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static unsigned int infinity() throw()
{ return static_cast<unsigned int>(0); }
static unsigned int quiet_NaN() throw()
{ return static_cast<unsigned int>(0); }
static unsigned int signaling_NaN() throw()
{ return static_cast<unsigned int>(0); }
static unsigned int denorm_min() throw()
{ return static_cast<unsigned int>(0); }
 
static const bool is_iec559 = true;
static const bool is_bounded = true;
static const bool is_modulo = true;
 
static const bool traps = true;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<> struct numeric_limits<long> {
static const bool is_specialized = true;
 
static long min() throw()
{ return LONG_MIN; }
static long max() throw()
{ return LONG_MAX; }
 
static const int digits = 31;
static const int digits10 = 9;
static const bool is_signed = true;
static const bool is_integer = true;
static const bool is_exact = true;
static const int radix = 2;
static long epsilon() throw()
{ return 0; }
static long round_error() throw()
{ return 0; }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static long infinity() throw()
{ return static_cast<long>(0); }
static long quiet_NaN() throw()
{ return static_cast<long>(0); }
static long signaling_NaN() throw()
{ return static_cast<long>(0); }
static long denorm_min() throw()
{ return static_cast<long>(0); }
 
static const bool is_iec559 = true;
static const bool is_bounded = true;
static const bool is_modulo = false;
 
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<> struct numeric_limits<unsigned long> {
static const bool is_specialized = true;
 
static unsigned long min() throw()
{ return 0; }
static unsigned long max() throw()
{ return ULONG_MAX; }
 
static const int digits = 32;
static const int digits10 = 9;
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;
static const int radix = 2;
static unsigned long epsilon() throw()
{ return 0; }
static unsigned long round_error() throw()
{ return 0; }
 
static const int min_exponent = 0;
static const int min_exponent10 = 0;
static const int max_exponent = 0;
static const int max_exponent10 = 0;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static unsigned long infinity() throw()
{ return static_cast<unsigned long>(0); }
static unsigned long quiet_NaN() throw()
{ return static_cast<unsigned long>(0); }
static unsigned long signaling_NaN() throw()
{ return static_cast<unsigned long>(0); }
static unsigned long denorm_min() throw()
{ return static_cast<unsigned long>(0); }
 
static const bool is_iec559 = true;
static const bool is_bounded = true;
static const bool is_modulo = true;
 
static const bool traps = true;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<> struct numeric_limits<float> {
static const bool is_specialized = true;
 
static float min() throw()
{ return FLT_MIN; }
static float max() throw()
{ return FLT_MAX; }
 
static const int digits = FLT_MANT_DIG;
static const int digits10 = FLT_DIG;
static const bool is_signed = true;
static const bool is_integer = false;
static const bool is_exact = false;
static const int radix = FLT_RADIX;
static float epsilon() throw()
{ return FLT_EPSILON; }
static float round_error() throw()
{ return FLT_ROUNDS; }
 
static const int min_exponent = FLT_MIN_EXP;
static const int min_exponent10 = FLT_MIN_10_EXP;
static const int max_exponent = FLT_MAX_EXP;
static const int max_exponent10 = FLT_MAX_10_EXP;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static float infinity() throw()
{ return static_cast<float>(0); }
static float quiet_NaN() throw()
{ return static_cast<float>(0); }
static float signaling_NaN() throw()
{ return static_cast<float>(0); }
static float denorm_min() throw()
{ return static_cast<float>(0); }
 
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = false;
 
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<> struct numeric_limits<double> {
static const bool is_specialized = true;
 
static double min() throw()
{ return DBL_MIN; }
static double max() throw()
{ return DBL_MAX; }
 
static const int digits = DBL_MANT_DIG;
static const int digits10 = DBL_DIG;
static const bool is_signed = true;
static const bool is_integer = false;
static const bool is_exact = false;
static const int radix = 2;
static double epsilon() throw()
{ return DBL_EPSILON; }
static double round_error() throw()
{ return 1.0; }
 
static const int min_exponent = DBL_MIN_EXP;
static const int min_exponent10 = DBL_MIN_10_EXP;
static const int max_exponent = DBL_MAX_EXP;
static const int max_exponent10 = DBL_MAX_10_EXP;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static double infinity() throw()
{ return static_cast<double>(0); }
static double quiet_NaN() throw()
{ return static_cast<double>(0); }
static double signaling_NaN() throw()
{ return static_cast<double>(0); }
static double denorm_min() throw()
{ return static_cast<double>(0); }
 
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = false;
 
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
template<> struct numeric_limits<long double> {
static const bool is_specialized = true;
 
static double min() throw()
{ return LDBL_MIN; }
static double max() throw()
{ return LDBL_MAX; }
 
static const int digits = LDBL_MANT_DIG;
static const int digits10 = LDBL_DIG;
static const bool is_signed = true;
static const bool is_integer = false;
static const bool is_exact = false;
static const int radix = 2;
static double epsilon() throw()
{ return LDBL_EPSILON; }
static double round_error() throw()
{ return 1.0L; }
 
static const int min_exponent = LDBL_MIN_EXP;
static const int min_exponent10 = LDBL_MIN_10_EXP;
static const int max_exponent = LDBL_MAX_EXP;
static const int max_exponent10 = LDBL_MAX_10_EXP;
 
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
static const float_denorm_style has_denorm = denorm_absent;
static const bool has_denorm_loss = false;
 
static double infinity() throw()
{ return static_cast<double>(0); }
static double quiet_NaN() throw()
{ return static_cast<double>(0); }
static double signaling_NaN() throw()
{ return static_cast<double>(0); }
static double denorm_min() throw()
{ return static_cast<double>(0); }
 
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = false;
 
static const bool traps = false;
static const bool tinyness_before = false;
static const float_round_style round_style = round_toward_zero;
};
 
} // namespace std
 
#endif // _CPP_NUMERIC_LIMITS
/contrib/media/updf/include/bits/locale_facets.h
0,0 → 1,1601
// Locale support -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 22.1 Locales
//
 
// Warning: this file is not meant for user inclusion. Use <locale>.
 
#ifndef _CPP_BITS_LOCFACETS_H
#define _CPP_BITS_LOCFACETS_H 1
 
#pragma GCC system_header
 
#include <bits/std_ctime.h> // For struct tm
#include <bits/std_ios.h> // For ios_base
#ifdef _GLIBCPP_USE_WCHAR_T
# include <langinfo.h> // For codecvt
# include <bits/std_cwctype.h> // For wctype_t
# include <iconv.h> // For codecvt using iconv, iconv_t
#endif
 
namespace std
{
// 22.2.1.1 Template class ctype
// Include host-specific ctype enums for ctype_base.
#include <bits/ctype_base.h>
 
// __ctype_abstract_base is the common base for ctype<_CharT>.
template<typename _CharT>
class __ctype_abstract_base : public locale::facet, public ctype_base
{
public:
// Types:
typedef _CharT char_type;
 
bool
is(mask __m, char_type __c) const
{ return this->do_is(__m, __c); }
 
const char_type*
is(const char_type *__lo, const char_type *__hi, mask *__vec) const
{ return this->do_is(__lo, __hi, __vec); }
 
const char_type*
scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
{ return this->do_scan_is(__m, __lo, __hi); }
 
const char_type*
scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
{ return this->do_scan_not(__m, __lo, __hi); }
 
char_type
toupper(char_type __c) const
{ return this->do_toupper(__c); }
 
const char_type*
toupper(char_type *__lo, const char_type* __hi) const
{ return this->do_toupper(__lo, __hi); }
 
char_type
tolower(char_type __c) const
{ return this->do_tolower(__c); }
 
const char_type*
tolower(char_type* __lo, const char_type* __hi) const
{ return this->do_tolower(__lo, __hi); }
 
char_type
widen(char __c) const
{ return this->do_widen(__c); }
 
const char*
widen(const char* __lo, const char* __hi, char_type* __to) const
{ return this->do_widen(__lo, __hi, __to); }
 
char
narrow(char_type __c, char __dfault) const
{ return this->do_narrow(__c, __dfault); }
 
const char_type*
narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char *__to) const
{ return this->do_narrow(__lo, __hi, __dfault, __to); }
 
protected:
explicit
__ctype_abstract_base(size_t __refs = 0): locale::facet(__refs) { }
 
virtual
~__ctype_abstract_base() { }
virtual bool
do_is(mask __m, char_type __c) const = 0;
 
virtual const char_type*
do_is(const char_type* __lo, const char_type* __hi,
mask* __vec) const = 0;
 
virtual const char_type*
do_scan_is(mask __m, const char_type* __lo,
const char_type* __hi) const = 0;
 
virtual const char_type*
do_scan_not(mask __m, const char_type* __lo,
const char_type* __hi) const = 0;
 
virtual char_type
do_toupper(char_type) const = 0;
 
virtual const char_type*
do_toupper(char_type* __lo, const char_type* __hi) const = 0;
 
virtual char_type
do_tolower(char_type) const = 0;
 
virtual const char_type*
do_tolower(char_type* __lo, const char_type* __hi) const = 0;
virtual char_type
do_widen(char) const = 0;
 
virtual const char*
do_widen(const char* __lo, const char* __hi,
char_type* __dest) const = 0;
 
virtual char
do_narrow(char_type, char __dfault) const = 0;
 
virtual const char_type*
do_narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char* __dest) const = 0;
};
 
// NB: Generic, mostly useless implementation.
template<typename _CharT>
class ctype : public __ctype_abstract_base<_CharT>
{
public:
// Types:
typedef _CharT char_type;
typedef typename ctype::mask mask;
 
explicit
ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { }
 
static locale::id id;
 
protected:
virtual
~ctype() { }
 
virtual bool
do_is(mask __m, char_type __c) const
{ return false; }
 
virtual const char_type*
do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const
{ return __hi; }
 
virtual const char_type*
do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
{ return __hi; }
 
virtual const char_type*
do_scan_not(mask __m, const char_type* __lo,
const char_type* __hi) const
{ return __hi; }
 
virtual char_type
do_toupper(char_type __c) const
{ return __c; }
 
virtual const char_type*
do_toupper(char_type* __lo, const char_type* __hi) const
{ return __hi; }
 
virtual char_type
do_tolower(char_type __c) const
{ return __c; }
 
virtual const char_type*
do_tolower(char_type* __lo, const char_type* __hi) const
{ return __hi; }
virtual char_type
do_widen(char __c) const
{ return char_type(); }
 
virtual const char*
do_widen(const char* __lo, const char* __hi, char_type* __dest) const
{ return __hi; }
 
virtual char
do_narrow(char_type, char __dfault) const
{ return __dfault; }
 
virtual const char_type*
do_narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char* __dest) const
{ return __hi; }
};
 
template<typename _CharT>
locale::id ctype<_CharT>::id;
 
// 22.2.1.3 ctype specializations
template<>
class ctype<char> : public __ctype_abstract_base<char>
{
public:
// Types:
typedef char char_type;
 
private:
// Data Members:
bool _M_del;
__to_type const& _M_toupper;
__to_type const& _M_tolower;
const mask* const& _M_ctable;
const mask* _M_table;
public:
static locale::id id;
static const size_t table_size = 1 + static_cast<unsigned char>(-1);
 
explicit
ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
 
inline bool
is(mask __m, char __c) const;
inline const char*
is(const char* __lo, const char* __hi, mask* __vec) const;
inline const char*
scan_is(mask __m, const char* __lo, const char* __hi) const;
 
inline const char*
scan_not(mask __m, const char* __lo, const char* __hi) const;
protected:
virtual
~ctype();
 
const mask*
table() const throw()
{ return _M_table; }
 
const mask*
classic_table() throw()
{ return _M_ctable; }
 
virtual bool
do_is(mask __m, char_type __c) const;
 
virtual const char_type*
do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
 
virtual const char_type*
do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
 
virtual const char_type*
do_scan_not(mask __m, const char_type* __lo,
const char_type* __hi) const;
 
virtual char_type
do_toupper(char_type) const;
 
virtual const char_type*
do_toupper(char_type* __lo, const char_type* __hi) const;
 
virtual char_type
do_tolower(char_type) const;
 
virtual const char_type*
do_tolower(char_type* __lo, const char_type* __hi) const;
virtual char_type
do_widen(char) const;
 
virtual const char*
do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
 
virtual char
do_narrow(char_type, char __dfault) const;
 
virtual const char_type*
do_narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char* __dest) const;
};
template<>
const ctype<char>&
use_facet<ctype<char> >(const locale& __loc);
 
#ifdef _GLIBCPP_USE_WCHAR_T
// ctype<wchar_t> specialization
template<>
class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
{
public:
// Types:
typedef wchar_t char_type;
typedef wctype_t __wmask_type;
 
// Data Members:
static locale::id id;
 
explicit
ctype(size_t __refs = 0);
 
protected:
__wmask_type
_M_convert_to_wmask(const mask __m) const;
 
virtual
~ctype();
 
virtual bool
do_is(mask __m, char_type __c) const;
 
virtual const char_type*
do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
 
virtual const char_type*
do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
 
virtual const char_type*
do_scan_not(mask __m, const char_type* __lo,
const char_type* __hi) const;
 
virtual char_type
do_toupper(char_type) const;
 
virtual const char_type*
do_toupper(char_type* __lo, const char_type* __hi) const;
 
virtual char_type
do_tolower(char_type) const;
 
virtual const char_type*
do_tolower(char_type* __lo, const char_type* __hi) const;
virtual char_type
do_widen(char) const;
 
virtual const char*
do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
 
virtual char
do_narrow(char_type, char __dfault) const;
 
virtual const char_type*
do_narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char* __dest) const;
 
};
 
template<>
const ctype<wchar_t>&
use_facet<ctype<wchar_t> >(const locale& __loc);
#endif //_GLIBCPP_USE_WCHAR_T
 
// Include host-specific ctype inlines.
#include <bits/ctype_inline.h>
 
// 22.2.1.2 Template class ctype_byname
template<typename _CharT>
class ctype_byname : public ctype<_CharT>
{
public:
typedef _CharT char_type;
 
explicit
ctype_byname(const char*, size_t __refs = 0);
 
protected:
virtual
~ctype_byname() { }
};
 
// 22.2.1.4 Class ctype_byname specialization
template<>
ctype_byname<char>::ctype_byname(const char*, size_t refs);
 
 
// 22.2.1.5 Template class codecvt
#include <bits/codecvt.h>
 
template<typename _CharT, typename _InIter>
class _Numeric_get; // forward
 
// _Format_cache holds the information extracted from the numpunct<>
// and moneypunct<> facets in a form optimized for parsing and
// formatting. It is stored via a void* pointer in the pword()
// array of an iosbase object passed to the _get and _put facets.
// NB: contains no user-serviceable parts.
template<typename _CharT>
class _Format_cache
{
public:
// Types:
typedef _CharT char_type;
typedef char_traits<_CharT> traits_type;
typedef basic_string<_CharT> string_type;
typedef typename string_type::size_type size_type;
 
// Forward decls and Friends:
friend class locale;
template<typename _Char, typename _InIter>
friend class _Numeric_get;
friend class num_get<_CharT>;
friend class num_put<_CharT>;
friend class time_get<_CharT>;
friend class money_get<_CharT>;
friend class time_put<_CharT>;
friend class money_put<_CharT>;
 
// Data Members:
 
// ios_base::pword() reserved cell
static int _S_pword_ix;
 
// True iff data members are consistent with the current locale,
// ie imbue sets this to false.
bool _M_valid;
 
// A list of valid numeric literals: for the standard "C" locale,
// this would usually be: "-+xX0123456789abcdef0123456789ABCDEF"
static const char _S_literals[];
 
// NB: Code depends on the order of definitions of the names
// these are indices into _S_literals, above.
// This string is formatted for putting, not getting. (output, not input)
enum
{
_S_minus,
_S_plus,
_S_x,
_S_X,
_S_digits,
_S_digits_end = _S_digits + 16,
_S_udigits = _S_digits_end,
_S_udigits_end = _S_udigits + 16,
_S_ee = _S_digits + 14, // For scientific notation, 'E'
_S_Ee = _S_udigits + 14 // For scientific notation, 'e'
};
 
// The sign used to separate decimal values: for standard US
// locales, this would usually be: "."
// Abstracted from numpunct::decimal_point().
char_type _M_decimal_point;
 
// The sign used to separate groups of digits into smaller
// strings that the eye can parse with less difficulty: for
// standard US locales, this would usually be: ","
// Abstracted from numpunct::thousands_sep().
char_type _M_thousands_sep;
 
// However the US's "false" and "true" are translated.
// From numpunct::truename() and numpunct::falsename(), respectively.
string_type _M_truename;
string_type _M_falsename;
 
// If we are checking groupings. This should be equivalent to
// numpunct::groupings().size() != 0
bool _M_use_grouping;
 
// If we are using numpunct's groupings, this is the current
// grouping string in effect (from numpunct::grouping()).
string _M_grouping;
 
_Format_cache();
 
~_Format_cache() throw() { }
 
// Given a member of the ios heirarchy as an argument, extract
// out all the current formatting information into a
// _Format_cache object and return a pointer to it.
static _Format_cache<_CharT>*
_S_get(ios_base& __ios);
 
void
_M_populate(ios_base&);
 
static void
_S_callback(ios_base::event __event, ios_base& __ios, int __ix) throw();
};
 
template<typename _CharT>
int _Format_cache<_CharT>::_S_pword_ix;
 
template<typename _CharT>
const char _Format_cache<_CharT>::
_S_literals[] = "-+xX0123456789abcdef0123456789ABCDEF";
 
template<> _Format_cache<char>::_Format_cache();
#ifdef _GLIBCPP_USE_WCHAR_T
template<> _Format_cache<wchar_t>::_Format_cache();
#endif
 
// _Numeric_get is used by num_get, money_get, and time_get to help
// in parsing out numbers.
template<typename _CharT, typename _InIter>
class _Numeric_get
{
public:
// Types:
typedef _CharT char_type;
typedef _InIter iter_type;
 
// Forward decls and Friends:
template<typename _Char, typename _InIterT>
friend class num_get;
template<typename _Char, typename _InIterT>
friend class time_get;
template<typename _Char, typename _InIterT>
friend class money_get;
template<typename _Char, typename _InIterT>
friend class num_put;
template<typename _Char, typename _InIterT>
friend class time_put;
template<typename _Char, typename _InIterT>
friend class money_put;
 
private:
explicit
_Numeric_get() { }
 
virtual
~_Numeric_get() { }
 
iter_type
_M_get_digits(iter_type __in, iter_type __end) const;
};
 
template<typename _CharT, typename _InIter>
class num_get : public locale::facet
{
public:
// Types:
typedef _CharT char_type;
typedef _InIter iter_type;
typedef char_traits<_CharT> __traits_type;
 
static locale::id id;
 
explicit
num_get(size_t __refs = 0) : locale::facet(__refs) { }
 
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, bool& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, short& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
 
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, int& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
#endif
 
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
 
#ifdef _GLIBCPP_USE_LONG_LONG
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long long& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
#endif
 
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned short& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
 
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned int& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
 
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned long& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
 
#ifdef _GLIBCPP_USE_LONG_LONG
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned long long& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
#endif
 
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, float& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
 
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, double& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
 
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long double& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
 
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, void*& __v) const
{ return do_get(__in, __end, __io, __err, __v); }
 
protected:
virtual ~num_get() { }
 
// This consolidates the extraction, storage and
// error-processing parts of the do_get(...) overloaded member
// functions.
// NB: This is specialized for char.
void
_M_extract(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, char* __xtrc,
int& __base, bool __fp = true) const;
 
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, short&) const;
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, int&) const;
#endif
virtual iter_type
do_get (iter_type, iter_type, ios_base&, ios_base::iostate&, long&) const;
#ifdef _GLIBCPP_USE_LONG_LONG
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
long long&) const;
#endif
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
unsigned short&) const;
virtual iter_type
do_get(iter_type, iter_type, ios_base&,
ios_base::iostate& __err, unsigned int&) const;
virtual iter_type
do_get(iter_type, iter_type, ios_base&,
ios_base::iostate& __err, unsigned long&) const;
#ifdef _GLIBCPP_USE_LONG_LONG
virtual iter_type
do_get(iter_type, iter_type, ios_base&,
ios_base::iostate& __err, unsigned long long&) const;
#endif
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
float&) const;
 
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
double&) const;
 
virtual iter_type
do_get(iter_type, iter_type, ios_base&,
ios_base::iostate& __err, long double&) const;
 
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
void*&) const;
};
 
template<typename _CharT, typename _InIter>
locale::id num_get<_CharT, _InIter>::id;
 
// Declare specialized extraction member function.
template<>
void
num_get<char, istreambuf_iterator<char> >::
_M_extract(istreambuf_iterator<char> __beg,
istreambuf_iterator<char> __end, ios_base& __io,
ios_base::iostate& __err, char* __xtrc,
int& __base, bool __fp) const;
 
// _Numeric_put is used by num_put, money_put, and time_put
// to help in formatting out numbers.
template<typename _CharT, typename _OutIter>
class _Numeric_put
{
public:
typedef _CharT char_type;
typedef _OutIter iter_type;
protected:
explicit
_Numeric_put() { }
 
virtual
~_Numeric_put() { }
};
 
template<typename _CharT, typename _OutIter>
class num_put : public locale::facet
{
public:
// Types:
typedef _CharT char_type;
typedef _OutIter iter_type;
 
static locale::id id;
 
explicit
num_put(size_t __refs = 0) : locale::facet(__refs) { }
 
iter_type
put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const
{ return do_put(__s, __f, __fill, __v); }
 
iter_type
put(iter_type __s, ios_base& __f, char_type __fill, long __v) const
{ return do_put(__s, __f, __fill, __v); }
 
iter_type
put(iter_type __s, ios_base& __f, char_type __fill,
unsigned long __v) const
{ return do_put(__s, __f, __fill, __v); }
 
#ifdef _GLIBCPP_USE_LONG_LONG
iter_type
put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const
{ return do_put(__s, __f, __fill, __v); }
 
iter_type
put(iter_type __s, ios_base& __f, char_type __fill,
unsigned long long __v) const
{ return do_put(__s, __f, __fill, __v); }
#endif
 
iter_type
put(iter_type __s, ios_base& __f, char_type __fill, double __v) const
{ return do_put(__s, __f, __fill, __v); }
 
iter_type
put(iter_type __s, ios_base& __f, char_type __fill,
long double __v) const
{ return do_put(__s, __f, __fill, __v); }
 
iter_type
put(iter_type __s, ios_base& __f, char_type __fill,
const void* __v) const
{ return do_put(__s, __f, __fill, __v); }
 
protected:
virtual
~num_put() { };
 
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, bool __v) const;
 
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, long __v) const;
 
#ifdef _GLIBCPP_USE_LONG_LONG
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, long long __v) const;
#endif
 
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, unsigned long) const;
 
#ifdef _GLIBCPP_USE_LONG_LONG
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, unsigned long long) const;
#endif
 
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, double __v) const;
 
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
 
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, const void* __v) const;
};
 
template <typename _CharT, typename _OutIter>
locale::id num_put<_CharT, _OutIter>::id;
 
template<typename _CharT>
class numpunct : public locale::facet
{
public:
// Types:
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
 
static locale::id id;
 
private:
char_type _M_decimal_point;
char_type _M_thousands_sep;
string _M_grouping;
string_type _M_truename;
string_type _M_falsename;
 
public:
explicit
numpunct(size_t __refs = 0) : locale::facet(__refs)
{ _M_initialize_numpunct(); }
 
explicit
numpunct(__c_locale __cloc, size_t __refs = 0) : locale::facet(__refs)
{ _M_initialize_numpunct(__cloc); }
 
char_type
decimal_point() const
{ return do_decimal_point(); }
 
char_type
thousands_sep() const
{ return do_thousands_sep(); }
 
string
grouping() const
{ return do_grouping(); }
 
string_type
truename() const
{ return do_truename(); }
 
string_type
falsename() const
{ return do_falsename(); }
 
protected:
virtual
~numpunct() { }
 
virtual char_type
do_decimal_point() const
{ return _M_decimal_point; }
 
virtual char_type
do_thousands_sep() const
{ return _M_thousands_sep; }
 
virtual string
do_grouping() const
{ return _M_grouping; }
 
virtual string_type
do_truename() const
{ return _M_truename; }
 
virtual string_type
do_falsename() const
{ return _M_falsename; }
 
// For use at construction time only.
void
_M_initialize_numpunct(__c_locale __cloc = NULL);
};
 
template<typename _CharT>
locale::id numpunct<_CharT>::id;
 
template<typename _CharT>
void
numpunct<_CharT>::_M_initialize_numpunct(__c_locale /*__cloc*/)
{
// NB: Cannot be made generic.
}
 
template<>
void
numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
void
numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc);
#endif
 
 
template<typename _CharT>
class numpunct_byname : public numpunct<_CharT>
{
__c_locale _M_c_locale_numpunct;
public:
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
 
explicit
numpunct_byname(const char* __s, size_t __refs = 0)
: numpunct<_CharT>(__refs)
{
_S_create_c_locale(_M_c_locale_numpunct, __s);
_M_initialize_numpunct(_M_c_locale_numpunct);
}
 
protected:
virtual
~numpunct_byname()
{ _S_destroy_c_locale(_M_c_locale_numpunct); }
};
 
 
template<typename _CharT>
class collate : public locale::facet
{
public:
// Types:
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
 
static locale::id id;
 
explicit
collate(size_t __refs = 0) : locale::facet(__refs) { }
 
int
compare(const _CharT* __lo1, const _CharT* __hi1,
const _CharT* __lo2, const _CharT* __hi2) const
{ return this->do_compare(__lo1, __hi1, __lo2, __hi2); }
 
string_type
transform(const _CharT* __lo, const _CharT* __hi) const
{ return this->do_transform(__lo, __hi); }
 
long
hash(const _CharT* __lo, const _CharT* __hi) const
{ return this->do_hash(__lo, __hi); }
protected:
~collate() { } // virtual
 
virtual int
do_compare(const _CharT* __lo1, const _CharT* __hi1,
const _CharT* __lo2, const _CharT* __hi2) const;
 
virtual string_type
do_transform(const _CharT* __lo, const _CharT* __hi) const;
 
virtual long
do_hash(const _CharT* __lo, const _CharT* __hi) const;
};
 
template<typename _CharT>
locale::id collate<_CharT>::id;
 
// Required specializations.
template<>
int
collate<char>::do_compare(const char* __lo1, const char* __hi1,
const char* __lo2, const char* __hi2) const;
 
template<>
string
collate<char>::do_transform(const char* __lo, const char* __hi) const;
 
template<>
long
collate<char>::do_hash(const char* __lo, const char* __hi) const;
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
int
collate<wchar_t>::do_compare(const wchar_t* __lo1, const wchar_t* __hi1,
const wchar_t* __lo2,
const wchar_t* __hi2) const;
 
template<>
wstring
collate<wchar_t>::do_transform(const wchar_t* __lo,
const wchar_t* __hi) const;
 
template<>
long
collate<wchar_t>::do_hash(const wchar_t* __lo, const wchar_t* __hi) const;
#endif
 
template<typename _CharT>
class collate_byname : public collate<_CharT>
{
public:
// Types:
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
 
explicit
collate_byname(const char*, size_t __refs = 0);
 
protected:
virtual
~collate_byname() { }
};
 
template<>
collate_byname<char>::collate_byname(const char*, size_t __refs);
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
collate_byname<wchar_t>::collate_byname(const char*, size_t __refs);
#endif
 
class time_base
{
public:
enum dateorder { no_order, dmy, mdy, ymd, ydm };
};
 
template<typename _CharT, typename _InIter>
class time_get : public locale::facet, public time_base
{
public:
// Types:
typedef _CharT char_type;
typedef _InIter iter_type;
 
static locale::id id;
 
explicit
time_get(size_t __refs = 0)
: locale::facet (__refs), _M_daynames(0), _M_monthnames(0) { }
 
dateorder
date_order() const
{ return do_date_order(); }
 
iter_type
get_time(iter_type __s, iter_type __end, ios_base& __f,
ios_base::iostate& __err, tm* __t) const
{ return do_get_time(__s, __end, __f, __err, __t); }
 
iter_type
get_date(iter_type __s, iter_type __end, ios_base& __f,
ios_base::iostate& __err, tm* __t) const
{ return do_get_date(__s, __end, __f, __err, __t); }
 
iter_type
get_weekday(iter_type __s, iter_type __end, ios_base& __f,
ios_base::iostate& __err, tm* __t) const
{ return do_get_weekday(__s,__end,__f,__err,__t); }
 
iter_type
get_monthname(iter_type __s, iter_type __end, ios_base& __f,
ios_base::iostate& __err, tm* __t) const
{ return do_get_monthname(__s,__end,__f,__err,__t); }
 
iter_type
get_year(iter_type __s, iter_type __end, ios_base& __f,
ios_base::iostate& __err, tm* __t) const
{ return do_get_year(__s,__end,__f,__err,__t); }
 
protected:
virtual
~time_get()
{
delete [] _M_monthnames;
delete [] _M_daynames;
}
 
virtual dateorder
do_date_order() const
{ return time_base::ymd; }
 
virtual iter_type
do_get_time(iter_type __s, iter_type /*__end*/, ios_base&,
ios_base::iostate& /*__err*/, tm* /*__t*/) const
{ return __s; }
 
virtual iter_type
do_get_date(iter_type __s, iter_type /*__end*/, ios_base&,
ios_base::iostate& /*__err*/, tm* /*__t*/) const
{ return __s; }
 
virtual iter_type
do_get_weekday(iter_type __s, iter_type __end, ios_base&,
ios_base::iostate& __err, tm* __t) const;
 
virtual iter_type
do_get_monthname(iter_type __s, iter_type __end, ios_base&,
ios_base::iostate& __err, tm* __t) const;
 
virtual iter_type
do_get_year(iter_type __s, iter_type /*__end*/, ios_base&,
ios_base::iostate& /*__err*/, tm* /*__t*/) const
{ return __s; }
 
mutable basic_string<_CharT>* _M_daynames;
mutable basic_string<_CharT>* _M_monthnames;
};
 
template<typename _CharT, typename _InIter>
locale::id time_get<_CharT, _InIter>::id;
 
template<typename _CharT, typename _InIter>
class time_get_byname : public time_get<_CharT, _InIter>
{
public:
typedef _CharT char_type;
typedef _InIter iter_type;
 
explicit
time_get_byname(const char*, size_t __refs = 0)
: time_get<_CharT, _InIter>(__refs) { }
protected:
virtual
~time_get_byname() { }
};
 
template<typename _CharT, typename _OutIter>
class time_put : public locale::facet, public time_base
{
public:
typedef _CharT char_type;
typedef _OutIter iter_type;
 
static locale::id id;
 
explicit
time_put(size_t __refs = 0) : locale::facet (__refs) { }
 
// NB: this is a nonvirtual, calls do_put in a loop.
iter_type
put(iter_type __s, ios_base& /*__f*/, char_type /*__fill*/,
const tm* /*__tmb*/, const _CharT* /*__pattern*/,
const _CharT* /*__pat_end*/) const
{ return __s; }
 
iter_type
put(iter_type __s, ios_base& __f, char_type __fill,
const tm* __tmb, char __format, char __modifier = 0) const
{ return do_put(__s, __f, __fill, __tmb, __format, __modifier); }
 
protected:
virtual
~time_put() { }
 
virtual iter_type
do_put(iter_type __s, ios_base&, char_type, const tm* /*__t*/,
char /*__format*/, char /*__mod*/) const
{ return __s; }
};
 
template<typename _CharT, typename _OutIter>
locale::id time_put<_CharT, _OutIter>::id;
 
template<typename _CharT, typename _OutIter>
class time_put_byname : public time_put<_CharT, _OutIter>
{
public:
typedef _CharT char_type;
typedef _OutIter iter_type;
 
explicit
time_put_byname(const char*, size_t __refs = 0)
: time_put<_CharT, _OutIter> (__refs) { }
 
protected:
virtual
~time_put_byname() { }
};
 
 
template<typename _CharT, typename _InIter>
class money_get : public locale::facet
{
public:
typedef _CharT char_type;
typedef _InIter iter_type;
typedef basic_string<_CharT> string_type;
 
static locale::id id;
 
explicit
money_get(size_t __refs = 0) : locale::facet(__refs) { }
 
iter_type
get(iter_type __s, iter_type __end, bool __intl,
ios_base& __f, ios_base::iostate& __err, long double& __units) const
{ return do_get(__s, __end, __intl, __f, __err, __units); }
 
iter_type
get(iter_type __s, iter_type __end, bool __intl, ios_base& __f,
ios_base::iostate& __err, string_type& __digits) const
{ return do_get(__s, __end, __intl, __f, __err, __digits); }
 
protected:
virtual
~money_get() { }
 
virtual iter_type
do_get(iter_type __s, iter_type /*__end*/, bool /*__intl*/,
ios_base& /*__io*/, ios_base::iostate& /*__err*/,
long double& /*__units*/) const
{ return __s; }
 
virtual iter_type
do_get(iter_type __s, iter_type /*__end*/, bool /*__intl*/,
ios_base& /*__io*/, ios_base::iostate& /*__err*/,
string_type& /*__digits*/) const
{ return __s; }
};
 
template<typename _CharT, typename _InIter>
locale::id money_get<_CharT, _InIter>::id;
 
template<typename _CharT, typename _OutIter>
class money_put : public locale::facet
{
public:
typedef _CharT char_type;
typedef _OutIter iter_type;
typedef basic_string<_CharT> string_type;
 
static locale::id id;
 
explicit
money_put(size_t __refs = 0) : locale::facet(__refs) { }
 
iter_type
put(iter_type __s, bool __intl, ios_base& __f,
char_type __fill, long double __units) const
{ return do_put(__s, __intl, __f, __fill, __units); }
 
iter_type
put(iter_type __s, bool __intl, ios_base& __f,
char_type __fill, const string_type& __digits) const
{ return do_put(__s, __intl, __f, __fill, __digits); }
 
protected:
virtual
~money_put() { }
 
virtual iter_type
do_put(iter_type __s, bool, ios_base& /*__io*/, char_type /*__fill*/,
long double /*__units*/) const
{ return __s; }
 
virtual iter_type
do_put(iter_type __s, bool, ios_base& /*__io*/, char_type /*__fill*/,
const string_type& /*__digits*/) const
{ return __s; }
};
 
template<typename _CharT, typename _OutIter>
locale::id money_put<_CharT, _OutIter>::id;
 
struct money_base
{
enum part { none, space, symbol, sign, value };
struct pattern { char field[4]; };
 
static const pattern _S_default_pattern;
 
// Construct and return valid pattern consisting of some combination of:
// space none symbol sign value
static pattern
_S_construct_pattern(char __preceeds, char __space, char __posn);
};
 
template<typename _CharT, bool _Intl>
class moneypunct : public locale::facet, public money_base
{
public:
// Types:
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
 
static const bool intl = _Intl;
static locale::id id;
 
private:
char_type _M_decimal_point;
char_type _M_thousands_sep;
string _M_grouping;
string_type _M_curr_symbol;
string_type _M_positive_sign;
string_type _M_negative_sign;
int _M_frac_digits;
pattern _M_pos_format;
pattern _M_neg_format;
 
public:
explicit
moneypunct(size_t __refs = 0) : locale::facet(__refs)
{ _M_initialize_moneypunct(); }
 
explicit
moneypunct(__c_locale __cloc, size_t __refs = 0) : locale::facet(__refs)
{ _M_initialize_moneypunct(__cloc); }
 
char_type
decimal_point() const
{ return this->do_decimal_point(); }
char_type
thousands_sep() const
{ return this->do_thousands_sep(); }
string
grouping() const
{ return this->do_grouping(); }
 
string_type
curr_symbol() const
{ return this->do_curr_symbol(); }
 
string_type
positive_sign() const
{ return this->do_positive_sign(); }
 
string_type
negative_sign() const
{ return this->do_negative_sign(); }
 
int
frac_digits() const
{ return this->do_frac_digits(); }
 
pattern
pos_format() const
{ return this->do_pos_format(); }
 
pattern
neg_format() const
{ return this->do_neg_format(); }
 
protected:
virtual
~moneypunct() { }
 
virtual char_type
do_decimal_point() const
{ return _M_decimal_point; }
virtual char_type
do_thousands_sep() const
{ return _M_thousands_sep; }
virtual string
do_grouping() const
{ return _M_grouping; }
 
virtual string_type
do_curr_symbol() const
{ return _M_curr_symbol; }
 
virtual string_type
do_positive_sign() const
{ return _M_positive_sign; }
 
virtual string_type
do_negative_sign() const
{ return _M_negative_sign; }
 
virtual int
do_frac_digits() const
{ return _M_frac_digits; }
 
virtual pattern
do_pos_format() const
{ return _M_pos_format; }
 
virtual pattern
do_neg_format() const
{ return _M_neg_format; }
 
// For use at construction time only.
void
_M_initialize_moneypunct(__c_locale __cloc = NULL);
};
 
template<typename _CharT, bool _Intl>
locale::id moneypunct<_CharT, _Intl>::id;
 
template<typename _CharT, bool _Intl>
const bool moneypunct<_CharT, _Intl>::intl;
 
template<typename _CharT, bool _Intl>
void
moneypunct<_CharT, _Intl>::_M_initialize_moneypunct(__c_locale /*__cloc*/)
{
// NB: Cannot be made generic.
}
 
template<>
void
moneypunct<char>::_M_initialize_moneypunct(__c_locale __cloc);
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
void
moneypunct<wchar_t>::_M_initialize_moneypunct(__c_locale __cloc);
#endif
 
template<typename _CharT, bool _Intl>
class moneypunct_byname : public moneypunct<_CharT, _Intl>
{
__c_locale _M_c_locale_moneypunct;
public:
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
 
static const bool intl = _Intl;
 
explicit
moneypunct_byname(const char* __s, size_t __refs = 0)
: moneypunct<_CharT, _Intl>(__refs)
{
_S_create_c_locale(_M_c_locale_moneypunct, __s);
_M_initialize_moneypunct(_M_c_locale_moneypunct);
}
 
protected:
virtual
~moneypunct_byname()
{ _S_destroy_c_locale(_M_c_locale_moneypunct); }
};
 
template<typename _CharT, bool _Intl>
const bool moneypunct_byname<_CharT, _Intl>::intl;
 
 
struct messages_base
{
typedef int catalog;
};
 
template<typename _CharT>
class messages : public locale::facet, public messages_base
{
public:
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
 
static locale::id id;
 
explicit
messages(size_t __refs = 0) : locale::facet(__refs) { }
 
catalog
open(const basic_string<char>& __s, const locale& __loc) const
{ return do_open(__s, __loc); }
 
string_type
get(catalog __c, int __set, int __msgid, const string_type& __s) const
{ return do_get(__c,__set,__msgid,__s); }
 
void
close(catalog __c) const
{ return do_close(__c); }
 
protected:
virtual
~messages() { }
 
// NB: Probably these should be pure, and implemented only in
// specializations of messages<>. But for now...
virtual catalog
do_open(const basic_string<char>&, const locale&) const
{ return 0; }
 
virtual string_type
do_get(catalog, int, int /*__msgid*/, const string_type& __dfault) const
{ return __dfault; }
 
virtual void
do_close(catalog) const { }
};
 
template<typename _CharT>
locale::id messages<_CharT>::id;
 
template<typename _CharT>
class messages_byname : public messages<_CharT>
{
public:
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
 
explicit
messages_byname(const char*, size_t __refs = 0);
 
protected:
virtual
~messages_byname() { }
};
 
template<>
messages_byname<char>::messages_byname(const char*, size_t __refs);
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
messages_byname<wchar_t>::messages_byname(const char*, size_t __refs);
#endif
 
// Subclause convenience interfaces, inlines
// NB: these are inline
// because, when used in a loop, some compilers can hoist the body
// out of the loop; then it's just as fast as the C is*() function.
template<typename _CharT>
inline bool
isspace(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); }
 
template<typename _CharT>
inline bool
isprint(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); }
 
template<typename _CharT>
inline bool
iscntrl(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); }
 
template<typename _CharT>
inline bool
isupper(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); }
 
template<typename _CharT>
inline bool islower(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }
 
template<typename _CharT>
inline bool
isalpha(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); }
 
template<typename _CharT>
inline bool
isdigit(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); }
 
template<typename _CharT>
inline bool
ispunct(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); }
 
template<typename _CharT>
inline bool
isxdigit(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); }
 
template<typename _CharT>
inline bool
isalnum(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); }
 
template<typename _CharT>
inline bool
isgraph(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); }
 
template<typename _CharT>
inline _CharT
toupper(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).toupper(__c); }
 
template<typename _CharT>
inline _CharT
tolower(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
} // namespace std
 
#endif /* _CPP_BITS_LOCFACETS_H */
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/locale_facets.tcc
0,0 → 1,1227
// Locale support -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Warning: this file is not meant for user inclusion. Use <locale>.
 
#ifndef _CPP_BITS_LOCFACETS_TCC
#define _CPP_BITS_LOCFACETS_TCC 1
 
#include <bits/std_cerrno.h>
#include <bits/std_clocale.h> // For localeconv
#include <bits/std_cstdlib.h> // For strof, strtold
#include <bits/std_limits.h> // For numeric_limits
#include <bits/std_memory.h> // For auto_ptr
#include <bits/sbuf_iter.h> // For streambuf_iterators
#include <bits/std_cctype.h> // For isspace
#include <typeinfo> // For bad_cast
#include <bits/std_vector.h>
 
 
namespace std
{
template<typename _Facet>
locale
locale::combine(const locale& __other)
{
locale __copy(*this);
__copy._M_impl->_M_replace_facet(__other._M_impl, &_Facet::id);
return __copy;
}
 
template<typename _CharT, typename _Traits, typename _Alloc>
bool
locale::operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1,
const basic_string<_CharT, _Traits, _Alloc>& __s2) const
{
typedef std::collate<_CharT> __collate_type;
const __collate_type* __fcoll = &use_facet<__collate_type>(*this);
return (__fcoll->compare(__s1.data(), __s1.data() + __s1.length(),
__s2.data(), __s2.data() + __s2.length()) < 0);
}
 
template<typename _Facet>
const _Facet&
use_facet(const locale& __loc)
{
typedef locale::_Impl::__vec_facet __vec_facet;
size_t __i = _Facet::id._M_index;
__vec_facet* __facet = __loc._M_impl->_M_facets;
const locale::facet* __fp = (*__facet)[__i];
if (__fp == 0 || __i >= __facet->size())
__throw_bad_cast();
return static_cast<const _Facet&>(*__fp);
}
 
template<typename _Facet>
bool
has_facet(const locale& __loc) throw()
{
typedef locale::_Impl::__vec_facet __vec_facet;
size_t __i = _Facet::id._M_index;
__vec_facet* __facet = __loc._M_impl->_M_facets;
return (__i < __facet->size() && (*__facet)[__i] != 0);
}
 
// __match_parallel
// matches input __s against a set of __ntargs strings in __targets,
// placing in __matches a vector of indices into __targets which
// match, and in __remain the number of such matches. If it hits
// end of sequence before it minimizes the set, sets __eof.
// Empty strings are never matched.
template<typename _InIter, typename _CharT>
_InIter
__match_parallel(_InIter __s, _InIter __end, int __ntargs,
const basic_string<_CharT>* __targets,
int* __matches, int& __remain, bool& __eof)
{
typedef basic_string<_CharT> __string_type;
__eof = false;
for (int __ti = 0; __ti < __ntargs; ++__ti)
__matches[__ti] = __ti;
__remain = __ntargs;
size_t __pos = 0;
do
{
int __ti = 0;
while (__ti < __remain && __pos == __targets[__matches[__ti]].size())
++__ti;
if (__ti == __remain)
{
if (__pos == 0) __remain = 0;
return __s;
}
if (__s == __end)
__eof = true;
bool __matched = false;
for (int __ti2 = 0; __ti2 < __remain; )
{
const __string_type& __target = __targets[__matches[__ti2]];
if (__pos < __target.size())
{
if (__eof || __target[__pos] != *__s)
{
__matches[__ti2] = __matches[--__remain];
continue;
}
__matched = true;
}
++__ti2;
}
if (__matched)
{
++__s;
++__pos;
}
for (int __ti3 = 0; __ti3 < __remain;)
{
if (__pos > __targets[__matches[__ti3]].size())
{
__matches[__ti3] = __matches[--__remain];
continue;
}
++__ti3;
}
}
while (__remain);
return __s;
}
 
template<typename _CharT>
_Format_cache<_CharT>::_Format_cache()
: _M_valid(true), _M_use_grouping(false)
{ }
 
template<>
_Format_cache<char>::_Format_cache();
 
template<>
_Format_cache<wchar_t>::_Format_cache();
 
template<typename _CharT>
void
_Format_cache<_CharT>::_M_populate(ios_base& __io)
{
locale __loc = __io.getloc ();
numpunct<_CharT> const& __np = use_facet<numpunct<_CharT> >(__loc);
_M_truename = __np.truename();
_M_falsename = __np.falsename();
_M_thousands_sep = __np.thousands_sep();
_M_decimal_point = __np.decimal_point();
_M_grouping = __np.grouping();
_M_use_grouping = _M_grouping.size() != 0 && _M_grouping.data()[0] != 0;
_M_valid = true;
}
 
// This function is always called via a pointer installed in
// an ios_base by ios_base::register_callback.
template<typename _CharT>
void
_Format_cache<_CharT>::
_S_callback(ios_base::event __ev, ios_base& __ios, int __ix) throw()
{
void*& __p = __ios.pword(__ix);
switch (__ev)
{
case ios_base::erase_event:
delete static_cast<_Format_cache<_CharT>*>(__p);
__p = 0;
break;
case ios_base::copyfmt_event:
// If just stored zero, the callback would get registered again.
try
{ __p = new _Format_cache<_CharT>; }
catch(...)
{ }
break;
case ios_base::imbue_event:
static_cast<_Format_cache<_CharT>*>(__p)->_M_valid = false;
break;
}
}
 
template<typename _CharT>
_Format_cache<_CharT>*
_Format_cache<_CharT>::_S_get(ios_base& __ios)
{
if (!_S_pword_ix)
_S_pword_ix = ios_base::xalloc(); // XXX MT
void*& __p = __ios.pword(_S_pword_ix);
 
// XXX What if pword fails? must check failbit, throw.
if (__p == 0) // XXX MT? maybe sentry takes care of it
{
auto_ptr<_Format_cache<_CharT> > __ap(new _Format_cache<_CharT>);
__ios.register_callback(&_Format_cache<_CharT>::_S_callback,
_S_pword_ix);
__p = __ap.release();
}
_Format_cache<_CharT>* __ncp = static_cast<_Format_cache<_CharT>*>(__p);
if (!__ncp->_M_valid)
__ncp->_M_populate(__ios);
 
return __ncp;
}
 
// This member function takes an (w)istreambuf_iterator object and
// parses it into a generic char array suitable for parsing with
// strto[l,ll,f,d]. The thought was to encapsulate the conversion
// into this one function, and thus the num_get::do_get member
// functions can just adjust for the type of the overloaded
// argument and process the char array returned from _M_extract.
// Other things were also considered, including a fused
// multiply-add loop that would obviate the need for any call to
// strto... at all: however, it would b e a bit of a pain, because
// you'd have to be able to return either floating or integral
// types, etc etc. The current approach seems to be smack dab in
// the middle between an unoptimized approach using sscanf, and
// some kind of hyper-optimized approach alluded to above.
 
// XXX
// Need to do partial specialization to account for differences
// between character sets. For char, this is pretty
// straightforward, but for wchar_t, the conversion to a plain-jane
// char type is a bit more involved.
template<typename _CharT, typename _InIter>
void
num_get<_CharT, _InIter>::
_M_extract(_InIter /*__beg*/, _InIter /*__end*/, ios_base& /*__io*/,
ios_base::iostate& /*__err*/, char* /*__xtrc*/,
int& /*__base*/, bool /*__fp*/) const
{
// XXX Not currently done: need to expand upon char version below.
}
 
template<>
void
num_get<char, istreambuf_iterator<char> >::
_M_extract(istreambuf_iterator<char> __beg,
istreambuf_iterator<char> __end, ios_base& __io,
ios_base::iostate& __err, char* __xtrc, int& __base,
bool __fp) const;
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// NB: This is an unresolved library defect #17
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, bool& __v) const
{
// Parse bool values as long
if (!(__io.flags() & ios_base::boolalpha))
{
// NB: We can't just call do_get(long) here, as it might
// refer to a derived class.
 
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
char __xtrc[32] = {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
long __l = strtol(__xtrc, &__sanity, __base);
if (!(__err & ios_base::failbit)
&& __l <= 1
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0)
__v = __l;
else
__err |= ios_base::failbit;
}
 
// Parse bool values as alphanumeric
else
{
typedef _Format_cache<char_type> __fcache_type;
__fcache_type* __fmt = __fcache_type::_S_get(__io);
const char_type* __true = __fmt->_M_truename.c_str();
const char_type* __false = __fmt->_M_falsename.c_str();
const size_t __truelen = __traits_type::length(__true) - 1;
const size_t __falselen = __traits_type::length(__false) - 1;
 
for (size_t __pos = 0; __beg != __end; ++__pos)
{
char_type __c = *__beg++;
bool __testf = __c == __false[__pos];
bool __testt = __c == __true[__pos];
if (!(__testf || __testt))
{
__err |= ios_base::failbit;
break;
}
else if (__testf && __pos == __falselen)
{
__v = 0;
break;
}
else if (__testt && __pos == __truelen)
{
__v = 1;
break;
}
}
if (__beg == __end)
__err |= ios_base::eofbit;
}
 
return __beg;
}
#endif
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, short& __v) const
{
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
char __xtrc[32]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
long __l = strtol(__xtrc, &__sanity, __base);
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0
&& __l >= SHRT_MIN && __l <= SHRT_MAX)
__v = static_cast<short>(__l);
else
__err |= ios_base::failbit;
 
return __beg;
}
 
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, int& __v) const
{
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
char __xtrc[32] = {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
long __l = strtol(__xtrc, &__sanity, __base);
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0
&& __l >= INT_MIN && __l <= INT_MAX)
__v = static_cast<int>(__l);
else
__err |= ios_base::failbit;
 
return __beg;
}
#endif
 
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long& __v) const
{
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
char __xtrc[32]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
long __l = strtol(__xtrc, &__sanity, __base);
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0)
__v = __l;
else
__err |= ios_base::failbit;
 
return __beg;
}
 
#ifdef _GLIBCPP_USE_LONG_LONG
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long long& __v) const
{
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
char __xtrc[32]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
long long __ll = strtoll(__xtrc, &__sanity, __base);
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0)
__v = __ll;
else
__err |= ios_base::failbit;
 
return __beg;
}
#endif
 
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned short& __v) const
{
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
char __xtrc[32]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
unsigned long __ul = strtoul(__xtrc, &__sanity, __base);
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0
&& __ul <= USHRT_MAX)
__v = static_cast<unsigned short>(__ul);
else
__err |= ios_base::failbit;
 
return __beg;
}
 
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned int& __v) const
{
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
char __xtrc[32]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
unsigned long __ul = strtoul(__xtrc, &__sanity, __base);
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0
&& __ul <= UINT_MAX)
__v = static_cast<unsigned int>(__ul);
else
__err |= ios_base::failbit;
 
return __beg;
}
 
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned long& __v) const
{
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
char __xtrc[32] = {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
unsigned long __ul = strtoul(__xtrc, &__sanity, __base);
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0)
__v = __ul;
else
__err |= ios_base::failbit;
 
return __beg;
}
 
#ifdef _GLIBCPP_USE_LONG_LONG
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned long long& __v) const
{
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
char __xtrc[32]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
unsigned long long __ull = strtoull(__xtrc, &__sanity, __base);
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0)
__v = __ull;
else
__err |= ios_base::failbit;
 
return __beg;
}
#endif
 
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, float& __v) const
{
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 256 for
// floating-point types.
char __xtrc[32]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, true);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
#ifdef _GLIBCPP_USE_C99
float __f = strtof(__xtrc, &__sanity);
#else
float __f = static_cast<float>(strtod(__xtrc, &__sanity));
#endif
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0)
__v = __f;
else
__err |= ios_base::failbit;
 
return __beg;
}
 
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, double& __v) const
{
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 256 for
// floating-point types.
char __xtrc[32]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, true);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
double __d = strtod(__xtrc, &__sanity);
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0)
__v = __d;
else
__err |= ios_base::failbit;
 
return __beg;
}
 
#if defined(_GLIBCPP_USE_C99) && !defined(__hpux)
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long double& __v) const
{
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 256 for
// floating-point types.
char __xtrc[32]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, true);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
long double __ld = strtold(__xtrc, &__sanity);
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0)
__v = __ld;
else
__err |= ios_base::failbit;
 
return __beg;
}
#else
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long double& __v) const
{
// Stage 1: extract
char __xtrc[32]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, true);
 
// Stage 2: determine a conversion specifier.
ios_base::fmtflags __basefield = __io.flags() & ios_base::basefield;
const char* __conv;
if (__basefield == ios_base::oct)
__conv = "%Lo";
else if (__basefield == ios_base::hex)
__conv = "%LX";
else if (__basefield == 0)
__conv = "%Li";
else
__conv = "%Lg";
 
// Stage 3: store results.
long double __ld;
int __p = sscanf(__xtrc, __conv, &__ld);
if (__p
&& static_cast<typename __traits_type::int_type>(__p)
!= __traits_type::eof())
__v = __ld;
else
__err |= ios_base::failbit;
 
return __beg;
}
#endif
 
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, void*& __v) const
{
// Prepare for hex formatted input
typedef ios_base::fmtflags fmtflags;
fmtflags __fmt = __io.flags();
fmtflags __fmtmask = ~(ios_base::showpos | ios_base::basefield
| ios_base::uppercase | ios_base::internal);
__io.flags(__fmt & __fmtmask | (ios_base::hex | ios_base::showbase));
 
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
char __xtrc[32]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
 
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
void* __vp = reinterpret_cast<void*>(strtoul(__xtrc, &__sanity, __base));
if (!(__err & ios_base::failbit)
&& __sanity != __xtrc && *__sanity == '\0' && errno == 0)
__v = __vp;
else
__err |= ios_base::failbit;
 
// Reset from hex formatted input
__io.flags(__fmt);
return __beg;
}
 
// __pad is specialized for ostreambuf_iterator, random access iterator.
template <typename _CharT, typename _OutIter>
inline _OutIter
__pad(_OutIter __s, _CharT __fill, int __padding);
 
template <typename _CharT, typename _RaIter>
_RaIter
__pad(_RaIter __s, _CharT __fill, int __padding,
random_access_iterator_tag)
{
fill_n(__s, __fill);
return __s + __padding;
}
 
template <typename _CharT, typename _OutIter, typename _Tag>
_OutIter
__pad(_OutIter __s, _CharT __fill, int __padding, _Tag)
{
while (--__padding >= 0) { *__s = __fill; ++__s; }
return __s;
}
 
template <typename _CharT, typename _OutIter>
inline _OutIter
__pad(_OutIter __s, _CharT __fill, int __padding)
{
return __pad(__s, __fill, __padding,
typename iterator_traits<_OutIter>::iterator_category());
}
 
template <typename _CharT, typename _OutIter>
_OutIter
__pad_numeric(_OutIter __s, ios_base::fmtflags /*__flags*/,
_CharT /*__fill*/, int /*__width*/,
_CharT const* /*__first*/, _CharT const* /*__middle*/,
_CharT const* /*__last*/)
{
// XXX Not currently done: non streambuf_iterator
return __s;
}
 
// Partial specialization for ostreambuf_iterator.
template <typename _CharT>
ostreambuf_iterator<_CharT>
__pad_numeric(ostreambuf_iterator<_CharT> __s, ios_base::fmtflags __flags,
_CharT __fill, int __width, _CharT const* __first,
_CharT const* __middle, _CharT const* __last)
{
typedef ostreambuf_iterator<_CharT> __out_iter;
int __padding = __width - (__last - __first);
if (__padding < 0)
__padding = 0;
ios_base::fmtflags __aflags = __flags & ios_base::adjustfield;
bool __testfield = __padding == 0 || __aflags == ios_base::left
|| __aflags == ios_base::internal;
 
// This was needlessly complicated.
if (__first != __middle)
{
if (!__testfield)
{
__pad(__s, __fill, __padding);
__padding = 0;
}
copy(__first, __middle, __s);
}
__out_iter __s2 = __s;
 
if (__padding && __aflags != ios_base::left)
{
__pad(__s2, __fill, __padding);
__padding = 0;
}
__out_iter __s3 = copy(__middle, __last, __s2);
if (__padding)
__pad(__s3, __fill, __padding);
return __s3;
}
 
template <typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
{
const _Format_cache<_CharT>* __fmt = _Format_cache<_CharT>::_S_get(__io);
ios_base::fmtflags __flags = __io.flags();
 
if ((__flags & ios_base::boolalpha) == 0)
{
unsigned long __uv = __v;
return __output_integer(__s, __io, __fill, false, __uv);
}
else
{
const char_type* __first;
const char_type* __last;
if (__v)
{
__first = __fmt->_M_truename.data();
__last = __first + __fmt->_M_truename.size();
}
else
{
__first = __fmt->_M_falsename.data();
__last = __first + __fmt->_M_falsename.size();
}
copy(__first, __last, __s);
}
return __s;
}
 
// __group_digits inserts "group separator" characters into an array
// of characters. It's recursive, one iteration per group. It moves
// the characters in the buffer this way: "xxxx12345" -> "12,345xxx".
// Call this only with __grouping != __grend.
template <typename _CharT>
_CharT*
__group_digits(_CharT* __s, _CharT __grsep, char const* __grouping,
char const* __grend, _CharT const* __first,
_CharT const* __last)
{
if (__last - __first > *__grouping)
{
__s = __group_digits(__s, __grsep,
(__grouping + 1 == __grend ? __grouping : __grouping + 1),
__grend, __first, __last - *__grouping);
__first = __last - *__grouping;
*__s++ = __grsep;
}
do
{
*__s++ = *__first++;
}
while (__first != __last);
return __s;
}
 
template <typename _CharT, typename _OutIter, typename _ValueT>
_OutIter
__output_integer(_OutIter __s, ios_base& __io, _CharT __fill, bool __neg,
_ValueT __v)
{
// Leave room for "+/-," "0x," and commas.
const long _M_room = numeric_limits<_ValueT>::digits10 * 2 + 4;
_CharT __digits[_M_room];
_CharT* __front = __digits + _M_room;
ios_base::fmtflags __flags = __io.flags();
const _Format_cache<_CharT>* __fmt = _Format_cache<_CharT>::_S_get(__io);
char const* __table = __fmt->_S_literals + __fmt->_S_digits;
 
ios_base::fmtflags __basefield = (__flags & __io.basefield);
_CharT* __sign_end = __front;
if (__basefield == ios_base::hex)
{
if (__flags & ios_base::uppercase)
__table += 16; // use ABCDEF
do
*--__front = __table[__v & 15];
while ((__v >>= 4) != 0);
__sign_end = __front;
if (__flags & ios_base::showbase)
{
*--__front = __fmt->_S_literals[__fmt->_S_x +
((__flags & ios_base::uppercase) ? 1 : 0)];
*--__front = __table[0];
}
}
else if (__basefield == ios_base::oct)
{
do
*--__front = __table[__v & 7];
while ((__v >>= 3) != 0);
if (__flags & ios_base::showbase
&& static_cast<char>(*__front) != __table[0])
*--__front = __table[0];
__sign_end = __front;
}
else
{
// NB: This is _lots_ faster than using ldiv.
do
*--__front = __table[__v % 10];
while ((__v /= 10) != 0);
__sign_end = __front;
// NB: ios_base:hex || ios_base::oct assumed to be unsigned.
if (__neg || (__flags & ios_base::showpos))
*--__front = __fmt->_S_literals[__fmt->_S_plus - __neg];
}
 
// XXX should specialize!
if (!__fmt->_M_use_grouping && !__io.width())
return copy(__front, __digits + _M_room, __s);
 
if (!__fmt->_M_use_grouping)
return __pad_numeric(__s, __flags, __fill, __io.width(0),
__front, __sign_end, __digits + _M_room);
 
_CharT* __p = __digits;
while (__front < __sign_end)
*__p++ = *__front++;
const char* __gr = __fmt->_M_grouping.data();
__front = __group_digits(__p, __fmt->_M_thousands_sep, __gr,
__gr + __fmt->_M_grouping.size(), __sign_end, __digits + _M_room);
return __pad_numeric(__s, __flags, __fill, __io.width(0),
__digits, __p, __front);
}
 
template <typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
{
unsigned long __uv = __v;
bool __neg = false;
if (__v < 0)
{
__neg = true;
__uv = -__uv;
}
return __output_integer(__s, __io, __fill, __neg, __uv);
}
 
template <typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill,
unsigned long __v) const
{ return __output_integer(__s, __io, __fill, false, __v); }
 
#ifdef _GLIBCPP_USE_LONG_LONG
template <typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __b, char_type __fill, long long __v) const
{
unsigned long long __uv = __v;
bool __neg = false;
if (__v < 0)
{
__neg = true;
__uv = -__uv;
}
return __output_integer(__s, __b, __fill, __neg, __uv);
}
 
template <typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill,
unsigned long long __v) const
{ return __output_integer(__s, __io, __fill, false, __v); }
#endif
 
// Generic helper function
template<typename _CharT, typename _Traits, typename _OutIter>
_OutIter
__output_float(_OutIter __s, ios_base& __io, _CharT __fill,
const char* __sptr, size_t __slen)
{
// XXX Not currently done: non streambuf_iterator
return __s;
}
 
// Partial specialization for ostreambuf_iterator.
template<typename _CharT, typename _Traits>
ostreambuf_iterator<_CharT, _Traits>
__output_float(ostreambuf_iterator<_CharT, _Traits> __s, ios_base& __io,
_CharT __fill, const char* __sptr, size_t __slen)
{
size_t __padding = __io.width() > streamsize(__slen) ?
__io.width() -__slen : 0;
locale __loc = __io.getloc();
ctype<_CharT> const& __ct = use_facet<ctype<_CharT> >(__loc);
ios_base::fmtflags __adjfield = __io.flags() & ios_base::adjustfield;
const char* const __eptr = __sptr + __slen;
// [22.2.2.2.2.19] Table 61
if (__adjfield == ios_base::internal)
{
// [22.2.2.2.2.14]; widen()
if (__sptr < __eptr && (*__sptr == '+' || *__sptr == '-'))
{
__s = __ct.widen(*__sptr);
++__s;
++__sptr;
}
__s = __pad(__s, __fill, __padding);
__padding = 0;
}
else if (__adjfield != ios_base::left)
{
__s = __pad(__s, __fill, __padding);
__padding = 0;
}
// the "C" locale decimal character
char __decimal_point = *(localeconv()->decimal_point);
const _Format_cache<_CharT>* __fmt = _Format_cache<_CharT>::_S_get(__io);
for (; __sptr != __eptr; ++__s, ++__sptr)
{
// [22.2.2.2.2.17]; decimal point conversion
if (*__sptr == __decimal_point)
__s = __fmt->_M_decimal_point;
// [22.2.2.2.2.14]; widen()
else
__s = __ct.widen(*__sptr);
}
// [22.2.2.2.2.19] Table 61
if (__padding)
__pad(__s, __fill, __padding);
__io.width(0);
return __s;
}
 
bool
__build_float_format(ios_base& __io, char* __fptr, char __modifier,
streamsize __prec);
 
template <typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
{
const streamsize __max_prec = numeric_limits<double>::digits10 + 3;
streamsize __prec = __io.precision();
// Protect against sprintf() buffer overflows.
if (__prec > __max_prec)
__prec = __max_prec;
// The *2 provides for signs, exp, 'E', and pad.
char __sbuf[__max_prec * 2];
size_t __slen;
// Long enough for the max format spec.
char __fbuf[16];
if (__build_float_format(__io, __fbuf, 0, __prec))
__slen = sprintf(__sbuf, __fbuf, __prec, __v);
else
__slen = sprintf(__sbuf, __fbuf, __v);
// [22.2.2.2.2] Stages 2-4.
return __output_float(__s, __io, __fill, __sbuf, __slen);
}
 
template <typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill,
long double __v) const
{
const streamsize __max_prec = numeric_limits<long double>::digits10 + 3;
streamsize __prec = __io.precision();
// Protect against sprintf() buffer overflows.
if (__prec > __max_prec)
__prec = __max_prec;
// The *2 provides for signs, exp, 'E', and pad.
char __sbuf[__max_prec * 2];
size_t __slen;
// Long enough for the max format spec.
char __fbuf[16];
// 'L' as per [22.2.2.2.2] Table 59
if (__build_float_format(__io, __fbuf, 'L', __prec))
__slen = sprintf(__sbuf, __fbuf, __prec, __v);
else
__slen = sprintf(__sbuf, __fbuf, __v);
// [22.2.2.2.2] Stages 2-4
return __output_float(__s, __io, __fill, __sbuf, __slen);
}
 
template <typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill,
const void* __v) const
{
typedef ios_base::fmtflags fmtflags;
fmtflags __fmt = __io.flags();
fmtflags __fmtmask = ~(ios_base::showpos | ios_base::basefield
| ios_base::uppercase | ios_base::internal);
__io.flags(__fmt & __fmtmask | (ios_base::hex | ios_base::showbase));
try {
_OutIter __s2 = __output_integer(__s, __io, __fill, false,
reinterpret_cast<unsigned long>(__v));
__io.flags(__fmt);
return __s2;
}
catch (...) {
__io.flags(__fmt);
__throw_exception_again;
}
}
 
// Support for time_get:
// Note that these partial specializations could, and maybe should,
// be changed to full specializations (by eliminating the _Dummy
// argument) and moved to a .cc file.
template<typename _CharT, typename _Dummy = int>
struct _Weekdaynames;
 
template<typename _Dummy>
struct _Weekdaynames<char, _Dummy>
{ static const char* const _S_names[14]; };
 
template<typename _Dummy>
const char* const
_Weekdaynames<char, _Dummy>::_S_names[14] =
{
"Sun", "Sunday",
"Mon", "Monday", "Tue", "Tuesday", "Wed", "Wednesday",
"Thu", "Thursday", "Fri", "Friday", "Sat", "Saturday"
};
 
#ifdef _GLIBCPP_USE_WCHAR_T
template<typename _Dummy>
struct _Weekdaynames<wchar_t, _Dummy>
{ static const wchar_t* const _S_names[14]; };
 
template<typename _Dummy>
const wchar_t* const
_Weekdaynames<wchar_t, _Dummy>::_S_names[14] =
{
L"Sun", L"Sunday",
L"Mon", L"Monday", L"Tue", L"Tuesday", L"Wed", L"Wednesday",
L"Thu", L"Thursday", L"Fri", L"Friday", L"Sat", L"Saturday"
};
#endif
 
template<typename _CharT, typename _Dummy = int>
struct _Monthnames;
 
template<typename _Dummy>
struct _Monthnames<char,_Dummy>
{ static const char* const _S_names[24]; };
 
template<typename _Dummy>
const char* const
_Monthnames<char,_Dummy>::_S_names[24] =
{
"Jan", "January", "Feb", "February", "Mar", "March",
"Apr", "April", "May", "May", "Jun", "June",
"Jul", "July", "Aug", "August", "Sep", "September",
"Oct", "October", "Nov", "November", "Dec", "December"
};
 
#ifdef _GLIBCPP_USE_WCHAR_T
template<typename _Dummy>
struct _Monthnames<wchar_t, _Dummy>
{ static const wchar_t* const _S_names[24]; };
 
template<typename _Dummy>
const wchar_t* const
_Monthnames<wchar_t,_Dummy>::_S_names[24] =
{
L"Jan", L"January", L"Feb", L"February", L"Mar", L"March",
L"Apr", L"April", L"May", L"May", L"Jun", L"June",
L"Jul", L"July", L"Aug", L"August", L"Sep", L"September",
L"Oct", L"October", L"Nov", L"November", L"Dec", L"December"
};
#endif
 
template<typename _CharT, typename _InIter>
_InIter
time_get<_CharT, _InIter>::
do_get_weekday(iter_type __s, iter_type __end,
ios_base& __io, ios_base::iostate& __err, tm* __t) const
{
if (!_M_daynames)
{
_M_daynames = new basic_string<_CharT>[14];
for (int __i = 0; __i < 14; ++__i)
_M_daynames[__i] = _Weekdaynames<_CharT>::_S_names[__i];
}
bool __at_eof = false;
int __remain = 0;
int __matches[14];
iter_type __out = __match_parallel(__s, __end, 14, _M_daynames,
__matches, __remain, __at_eof);
__err = ios_base::iostate(0);
if (__at_eof) __err |= __io.eofbit;
if (__remain == 1 ||
__remain == 2 && (__matches[0]>>1) == (__matches[1]>>1))
__t->tm_wday = (__matches[0]>>1);
else
__err |= __io.failbit;
return __out;
}
 
template<typename _CharT, typename _InIter>
_InIter
time_get<_CharT, _InIter>::
do_get_monthname(iter_type __s, iter_type __end,
ios_base& __io, ios_base::iostate& __err, tm* __t) const
{
if (!_M_monthnames)
{
_M_monthnames = new basic_string<_CharT>[24];
for (int __i = 0; __i < 24; ++__i)
_M_monthnames[__i] = _Monthnames<_CharT>::_S_names[__i];
}
bool __at_eof = false;
int __remain = 0;
int __matches[24];
iter_type __out = __match_parallel( __s, __end, 24, _M_monthnames,
__matches, __remain, __at_eof);
__err = ios_base::iostate(0);
if (__at_eof) __err |= __io.eofbit;
if (__remain == 1 ||
__remain == 2 && (__matches[0]>>1) == (__matches[1]>>1))
__t->tm_mon = (__matches[0]>>1);
else
__err |= __io.failbit;
return __out;
}
} // std::
 
#endif /* _CPP_BITS_LOCFACETS_TCC */
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/localefwd.h
0,0 → 1,459
// Locale support -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 22.1 Locales
//
 
#ifndef _CPP_BITS_LOCCORE_H
#define _CPP_BITS_LOCCORE_H 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
#include <bits/c++locale.h> // Defines __c_locale.
#include <bits/std_climits.h> // For CHAR_BIT
#include <bits/std_string.h> // For string
#include <bits/std_cctype.h> // For isspace, etc.
#include <bits/functexcept.h>
 
namespace std
{
// NB: Don't instantiate required wchar_t facets if no wchar_t support.
#ifdef _GLIBCPP_USE_WCHAR_T
# define _GLIBCPP_NUM_FACETS 26
#else
# define _GLIBCPP_NUM_FACETS 13
#endif
 
// 22.1.1 Locale
template<typename _Tp, typename _Alloc>
class vector;
class locale;
 
// 22.1.3 Convenience interfaces
template<typename _CharT>
inline bool
isspace(_CharT, const locale&);
 
template<typename _CharT>
inline bool
isprint(_CharT, const locale&);
 
template<typename _CharT>
inline bool
iscntrl(_CharT, const locale&);
 
template<typename _CharT>
inline bool
isupper(_CharT, const locale&);
 
template<typename _CharT>
inline bool
islower(_CharT, const locale&);
 
template<typename _CharT>
inline bool
isalpha(_CharT, const locale&);
 
template<typename _CharT>
inline bool
isdigit(_CharT, const locale&);
 
template<typename _CharT>
inline bool
ispunct(_CharT, const locale&);
 
template<typename _CharT>
inline bool
isxdigit(_CharT, const locale&);
 
template<typename _CharT>
inline bool
isalnum(_CharT, const locale&);
 
template<typename _CharT>
inline bool
isgraph(_CharT, const locale&);
 
template<typename _CharT>
inline _CharT
toupper(_CharT, const locale&);
 
template<typename _CharT>
inline _CharT
tolower(_CharT, const locale&);
 
 
// 22.2.1 and 22.2.1.3 ctype
class ctype_base;
template<typename _CharT>
class ctype;
template<> class ctype<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template<> class ctype<wchar_t>;
#endif
template<typename _CharT>
class ctype_byname;
// NB: Specialized for char and wchar_t in locale_facets.h.
 
class codecvt_base;
template<typename _InternT, typename _ExternT, typename _StateT>
class codecvt;
template<> class codecvt<char, char, mbstate_t>;
#ifdef _GLIBCPP_USE_WCHAR_T
template<> class codecvt<wchar_t, char, mbstate_t>;
#endif
template<typename _InternT, typename _ExternT, typename _StateT>
class codecvt_byname;
 
// 22.2.2 and 22.2.3 numeric
template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
class num_get;
template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
class num_put;
template<typename _CharT> class numpunct;
template<typename _CharT> class numpunct_byname;
 
// 22.2.4 collation
template<typename _CharT>
class collate;
template<typename _CharT> class
collate_byname;
 
// 22.2.5 date and time
class time_base;
template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
class time_get;
template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
class time_get_byname;
template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
class time_put;
template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
class time_put_byname;
 
// 22.2.6 money
class money_base;
template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
class money_get;
template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
class money_put;
template<typename _CharT, bool _Intl = false>
class moneypunct;
template<typename _CharT, bool _Intl = false>
class moneypunct_byname;
 
// 22.2.7 message retrieval
class messages_base;
template<typename _CharT>
class messages;
template<typename _CharT>
class messages_byname;
 
// 22.1.1 Class locale
class locale
{
public:
// Types:
typedef unsigned int category;
 
// Forward decls and friends:
class facet;
class id;
class _Impl;
 
friend class facet;
friend class _Impl;
 
template<typename _Facet>
friend const _Facet&
use_facet(const locale&);
template<typename _Facet>
friend bool
has_facet(const locale&) throw();
// Category values:
// NB: Order must match _S_facet_categories definition in locale.cc
static const category none = 0;
static const category ctype = 1L << 0;
static const category numeric = 1L << 1;
static const category collate = 1L << 2;
static const category time = 1L << 3;
static const category monetary = 1L << 4;
static const category messages = 1L << 5;
static const category all = (collate | ctype | monetary |
numeric | time | messages);
 
// Construct/copy/destroy:
locale() throw();
 
locale(const locale& __other) throw();
 
explicit
locale(const char* __std_name);
 
locale(const locale& __base, const char* __s, category __cat);
 
locale(const locale& __base, const locale& __add, category __cat);
 
template<typename _Facet>
locale(const locale& __other, _Facet* __f);
 
~locale() throw();
 
const locale&
operator=(const locale& __other) throw();
 
template<typename _Facet>
locale
combine(const locale& __other);
 
// Locale operations:
string
name() const;
 
bool
operator==(const locale& __other) const throw ();
 
inline bool
operator!=(const locale& __other) const throw ()
{ return !(this->operator==(__other)); }
 
template<typename _Char, typename _Traits, typename _Alloc>
bool
operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
const basic_string<_Char, _Traits, _Alloc>& __s2) const;
 
// Global locale objects:
static locale
global(const locale&);
 
static const locale&
classic();
 
private:
// The (shared) implementation
_Impl* _M_impl;
 
// The "C" reference locale
static _Impl* _S_classic;
 
// Current global reference locale
static _Impl* _S_global;
 
static const size_t _S_num_categories = 6;
static const size_t _S_num_facets = _GLIBCPP_NUM_FACETS;
 
explicit
locale(_Impl*) throw();
 
static inline void
_S_initialize()
{ if (!_S_classic) classic(); }
 
static category
_S_normalize_category(category);
 
void
_M_coalesce(const locale& __base, const locale& __add, category __cat);
};
 
 
// locale implementation object
class locale::_Impl
{
public:
// Types.
typedef vector<facet*, allocator<facet*> > __vec_facet;
 
// Friends.
friend class locale;
friend class locale::facet;
 
template<typename _Facet>
friend const _Facet&
use_facet(const locale&);
 
template<typename _Facet>
friend bool
has_facet(const locale&) throw();
 
private:
// Data Members.
size_t _M_references;
__vec_facet* _M_facets;
string _M_names[_S_num_categories];
__c_locale _M_c_locale;
static const locale::id* const _S_id_ctype[];
static const locale::id* const _S_id_numeric[];
static const locale::id* const _S_id_collate[];
static const locale::id* const _S_id_time[];
static const locale::id* const _S_id_monetary[];
static const locale::id* const _S_id_messages[];
static const locale::id* const* const _S_facet_categories[];
 
inline void
_M_add_reference() throw()
{ ++_M_references; } // XXX MT
 
inline void
_M_remove_reference() throw()
{
if (_M_references-- == 0) // XXX MT
{
try
{ delete this; }
catch(...)
{ }
}
}
 
_Impl(const _Impl&, size_t);
_Impl(string __name, size_t);
~_Impl() throw();
 
bool
_M_check_same_name()
{
bool __ret = true;
for (size_t i = 0; i < _S_num_categories - 1; ++i)
__ret &= _M_names[i] == _M_names[i + 1];
return __ret;
}
void
_M_replace_categories(const _Impl*, category);
 
void
_M_replace_category(const _Impl*, const locale::id* const*);
 
void
_M_replace_facet(const _Impl*, const locale::id*);
 
void
_M_install_facet(const locale::id*, facet*);
 
template<typename _Facet>
inline void
_M_init_facet(_Facet* __facet)
{ _M_install_facet(&_Facet::id, __facet); }
};
 
template<typename _Facet>
locale::locale(const locale& __other, _Facet* __f)
{
_M_impl = new _Impl(*__other._M_impl, 1);
_M_impl->_M_install_facet(&_Facet::id, __f);
for (size_t __i = 0; __i < _S_num_categories; ++__i)
_M_impl->_M_names[__i] = "*";
}
 
// 22.1.1.1.2 Class locale::facet
class locale::facet
{
friend class locale;
friend class locale::_Impl;
 
protected:
explicit
facet(size_t __refs = 0) throw();
 
virtual
~facet() { };
 
static void
_S_create_c_locale(__c_locale& __cloc, const char* __s);
 
static void
_S_destroy_c_locale(__c_locale& __cloc);
 
private:
size_t _M_references;
 
void
_M_add_reference() throw();
 
void
_M_remove_reference() throw();
 
facet(const facet&); // not defined
 
void
operator=(const facet&); // not defined
};
 
 
// 22.1.1.1.3 Class locale::id
class locale::id
{
private:
friend class locale;
friend class locale::_Impl;
template<typename _Facet>
friend const _Facet&
use_facet(const locale&);
template<typename _Facet>
friend bool
has_facet(const locale&) throw ();
 
// NB: There is no accessor for _M_index because it may be used
// before the constructor is run; the effect of calling a member
// function (even an inline) would be undefined.
mutable size_t _M_index;
 
// Last id number assigned
static size_t _S_highwater;
 
void
operator=(const id&); // not defined
 
id(const id&); // not defined
 
public:
// NB: This class is always a static data member, and thus can be
// counted on to be zero-initialized.
// XXX id() : _M_index(0) { }
id() { }
};
 
template<typename _Facet>
const _Facet&
use_facet(const locale& __loc);
 
template<typename _Facet>
bool
has_facet(const locale& __loc) throw();
} // namespace std
 
#endif /* _CPP_BITS_LOCCORE_H */
 
// Local Variables:
// mode:c++
// End:
 
/contrib/media/updf/include/bits/mask_array.h
0,0 → 1,162
// The template and inlines for the -*- C++ -*- mask_array class.
 
// Copyright (C) 1997-2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
 
#ifndef _CPP_BITS_MASK_ARRAY_H
#define _CPP_BITS_MASK_ARRAY_H 1
 
#pragma GCC system_header
 
namespace std {
 
template <class _Tp> class mask_array
{
public:
typedef _Tp value_type;
void operator= (const valarray<_Tp>&) const;
void operator*= (const valarray<_Tp>&) const;
void operator/= (const valarray<_Tp>&) const;
void operator%= (const valarray<_Tp>&) const;
void operator+= (const valarray<_Tp>&) const;
void operator-= (const valarray<_Tp>&) const;
void operator^= (const valarray<_Tp>&) const;
void operator&= (const valarray<_Tp>&) const;
void operator|= (const valarray<_Tp>&) const;
void operator<<=(const valarray<_Tp>&) const;
void operator>>=(const valarray<_Tp>&) const;
void operator= (const _Tp&);
// ~mask_array ();
template<class _Dom>
void operator= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator*= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator/= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator%= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator+= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator-= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator^= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator&= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator|= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator<<=(const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator>>=(const _Expr<_Dom,_Tp>&) const;
 
private:
mask_array (_Array<_Tp>, size_t, _Array<bool>);
friend class valarray<_Tp>;
const size_t _M_sz;
const _Array<bool> _M_mask;
const _Array<_Tp> _M_array;
mask_array (const mask_array&);
// not implemented
mask_array ();
mask_array& operator= (const mask_array&);
};
 
 
template<typename _Tp>
inline mask_array<_Tp>::mask_array (const mask_array<_Tp>& a)
: _M_sz (a._M_sz), _M_mask (a._M_mask), _M_array (a._M_array) {}
 
template<typename _Tp>
inline
mask_array<_Tp>::mask_array (_Array<_Tp> __a, size_t __s, _Array<bool> __m)
: _M_sz (__s), _M_mask (__m), _M_array (__a) {}
// template<typename _Tp>
// inline mask_array<_Tp>::~mask_array () {}
template<typename _Tp>
inline void
mask_array<_Tp>::operator= (const _Tp& __t)
{ __valarray_fill (_M_array, _M_sz, _M_mask, __t); }
template<typename _Tp>
inline void
mask_array<_Tp>::operator= (const valarray<_Tp>& __v) const
{ __valarray_copy (_Array<_Tp> (__v), __v.size (), _M_array, _M_mask); }
 
template<typename _Tp>
template<class E>
inline void
mask_array<_Tp>::operator= (const _Expr<E, _Tp>& __e) const
{ __valarray_copy (__e, __e.size (), _M_array, _M_mask); }
 
#undef _DEFINE_VALARRAY_OPERATOR
#define _DEFINE_VALARRAY_OPERATOR(op, name) \
template<typename _Tp> \
inline void \
mask_array<_Tp>::operator op##= (const valarray<_Tp>& __v) const \
{ \
_Array_augmented_##name (_M_array, _M_mask, \
_Array<_Tp> (__v), __v.size ()); \
} \
\
template<typename _Tp> template<class E> \
inline void \
mask_array<_Tp>::operator op##= (const _Expr<E, _Tp>& __e) const \
{ \
_Array_augmented_##name (_M_array, _M_mask, __e, __e.size ()); \
}
 
_DEFINE_VALARRAY_OPERATOR(*, multiplies)
_DEFINE_VALARRAY_OPERATOR(/, divides)
_DEFINE_VALARRAY_OPERATOR(%, modulus)
_DEFINE_VALARRAY_OPERATOR(+, plus)
_DEFINE_VALARRAY_OPERATOR(-, minus)
_DEFINE_VALARRAY_OPERATOR(^, xor)
_DEFINE_VALARRAY_OPERATOR(&, and)
_DEFINE_VALARRAY_OPERATOR(|, or)
_DEFINE_VALARRAY_OPERATOR(<<, shift_left)
_DEFINE_VALARRAY_OPERATOR(>>, shift_right)
 
#undef _DEFINE_VALARRAY_OPERATOR
} // std::
 
#endif /* _CPP_BITS_MASK_ARRAY_H */
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/ostream.tcc
0,0 → 1,755
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.6.2 Output streams
//
 
#include <bits/std_locale.h>
 
namespace std
{
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>::sentry::
sentry(basic_ostream<_CharT,_Traits>& __os)
: _M_ok(__os.good()), _M_os(__os)
{
// XXX MT
if (_M_ok && __os.tie())
__os.tie()->flush();
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(__ostream_type& (*__pf)(__ostream_type&))
{
sentry __cerb(*this);
if (__cerb)
{
try
{ __pf(*this); }
catch(exception& __fail)
{
// 27.6.2.5.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(__ios_type& (*__pf)(__ios_type&))
{
sentry __cerb(*this);
if (__cerb)
{
try
{ __pf(*this); }
catch(exception& __fail)
{
// 27.6.2.5.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(ios_base& (*__pf)(ios_base&))
{
sentry __cerb(*this);
if (__cerb)
{
try
{ __pf(*this); }
catch(exception& __fail)
{
// 27.6.2.5.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(bool __n)
{
sentry __cerb(*this);
if (__cerb)
{
try
{
if (_M_check_facet(_M_fnumput))
if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long __n)
{
sentry __cerb(*this);
if (__cerb)
{
try
{
char_type __c = this->fill();
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
if (_M_check_facet(_M_fnumput))
{
bool __b = false;
if (__fmt & ios_base::oct || __fmt & ios_base::hex)
{
unsigned long __l = static_cast<unsigned long>(__n);
__b = _M_fnumput->put(*this, *this, __c, __l).failed();
}
else
__b = _M_fnumput->put(*this, *this, __c, __n).failed();
if (__b)
this->setstate(ios_base::badbit);
}
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
{
sentry __cerb(*this);
if (__cerb)
{
try
{
if (_M_check_facet(_M_fnumput))
if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
#ifdef _GLIBCPP_USE_LONG_LONG
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long long __n)
{
sentry __cerb(*this);
if (__cerb)
{
try
{
char_type __c = this->fill();
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
if (_M_check_facet(_M_fnumput))
{
bool __b = false;
if (__fmt & ios_base::oct || __fmt & ios_base::hex)
{
unsigned long long __l;
__l = static_cast<unsigned long long>(__n);
__b = _M_fnumput->put(*this, *this, __c, __l).failed();
}
else
__b = _M_fnumput->put(*this, *this, __c, __n).failed();
if (__b)
this->setstate(ios_base::badbit);
}
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
{
sentry __cerb(*this);
if (__cerb)
{
try
{
if (_M_check_facet(_M_fnumput))
if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
#endif
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(double __n)
{
sentry __cerb(*this);
if (__cerb)
{
try
{
if (_M_check_facet(_M_fnumput))
if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long double __n)
{
sentry __cerb(*this);
if (__cerb)
{
try
{
if (_M_check_facet(_M_fnumput))
if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
{
sentry __cerb(*this);
if (__cerb)
{
try
{
if (_M_check_facet(_M_fnumput))
if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type* __sbin)
{
streamsize __xtrct = 0;
__streambuf_type* __sbout = this->rdbuf();
sentry __cerb(*this);
if (__sbin && __cerb)
__xtrct = __copy_streambufs(*this, __sbin, __sbout);
if (!__sbin || !__xtrct)
this->setstate(ios_base::failbit);
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::put(char_type __c)
{
sentry __cerb(*this);
if (__cerb)
{
int_type __put = rdbuf()->sputc(__c);
if (__put != traits_type::to_int_type(__c))
this->setstate(ios_base::badbit);
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::write(const _CharT* __s, streamsize __n)
{
sentry __cerb(*this);
if (__cerb)
{
streamsize __put = this->rdbuf()->sputn(__s, __n);
if ( __put != __n)
this->setstate(ios_base::badbit);
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::flush()
{
sentry __cerb(*this);
if (__cerb)
{
if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
this->setstate(ios_base::badbit);
}
return *this;
}
template<typename _CharT, typename _Traits>
typename basic_ostream<_CharT, _Traits>::pos_type
basic_ostream<_CharT, _Traits>::tellp()
{
pos_type __ret = pos_type(-1);
bool __testok = this->fail() != true;
if (__testok)
__ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
return __ret;
}
 
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
{
bool __testok = this->fail() != true;
if (__testok)
{
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::out);
 
// 129. Need error indication from seekp() and seekg()
if (__err == pos_type(off_type(-1)))
this->setstate(failbit);
#endif
}
return *this;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
seekp(off_type __off, ios_base::seekdir __d)
{
bool __testok = this->fail() != true;
if (__testok)
{
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
pos_type __err = this->rdbuf()->pubseekoff(__off, __d,
ios_base::out);
 
// 129. Need error indication from seekp() and seekg()
if (__err == pos_type(off_type(-1)))
this->setstate(failbit);
}
#endif
return *this;
}
 
// 27.6.2.5.4 Character inserters
 
// Construct correctly padded string, as per 22.2.2.2.2
// Similar in theory to __pad_numeric, from num_put, but it doesn't
// use _S_fill: perhaps it should.
// Assumes
// __newlen > __oldlen
// __news is allocated for __newlen size
template<typename _CharT, typename _Traits>
void
__pad_char(basic_ios<_CharT, _Traits>& __ios,
_CharT* __news, const _CharT* __olds,
const streamsize __newlen, const streamsize __oldlen)
{
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename traits_type::int_type int_type;
int_type __plen = static_cast<size_t>(__newlen - __oldlen);
char_type* __pads = static_cast<char_type*>(__builtin_alloca(sizeof(char_type) * __plen));
traits_type::assign(__pads, __plen, __ios.fill());
 
char_type* __beg;
char_type* __end;
size_t __mod = 0;
size_t __beglen; //either __plen or __oldlen
ios_base::fmtflags __fmt = __ios.flags() & ios_base::adjustfield;
 
if (__fmt == ios_base::left)
{
// Padding last.
__beg = const_cast<char_type*>(__olds);
__beglen = __oldlen;
__end = __pads;
}
else if (__fmt == ios_base::internal)
{
// Pad after the sign, if there is one.
// Pad after 0[xX], if there is one.
// Who came up with these rules, anyway? Jeeze.
typedef _Format_cache<_CharT> __cache_type;
__cache_type const* __fmt = __cache_type::_S_get(__ios);
const char_type* __minus = traits_type::find(__olds, __oldlen,
__fmt->_S_minus);
const char_type* __plus = traits_type::find(__olds, __oldlen,
__fmt->_S_plus);
bool __testsign = __minus || __plus;
bool __testhex = __olds[0] == '0'
&& (__olds[1] == 'x' || __olds[1] == 'X');
 
if (__testhex)
{
__news[0] = __olds[0];
__news[1] = __olds[1];
__mod += 2;
__beg = const_cast<char_type*>(__olds + __mod);
__beglen = __oldlen - __mod;
__end = __pads;
}
else if (__testsign)
{
__mod += __plen;
const char_type* __sign = __minus ? __minus + 1: __plus + 1;
__beg = const_cast<char_type*>(__olds);
__beglen = __sign - __olds;
__end = const_cast<char_type*>(__sign + __plen);
traits_type::copy(__news + __beglen, __pads, __plen);
}
else
{
// Padding first.
__beg = __pads;
__beglen = __plen;
__end = const_cast<char_type*>(__olds);
}
}
else
{
// Padding first.
__beg = __pads;
__beglen = __plen;
__end = const_cast<char_type*>(__olds);
}
 
traits_type::copy(__news, __beg, __beglen);
traits_type::copy(__news + __beglen, __end, __newlen - __beglen - __mod);
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
try
{
streamsize __w = __out.width();
_CharT* __pads = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w));
__pads[0] = __c;
streamsize __len = 1;
if (__w > __len)
{
__pad_char(__out, __pads, &__c, __w, __len);
__len = __w;
}
__out.write(__pads, __len);
__out.width(0);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return __out;
}
// Specialization
template <class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __out, char __c)
{
typedef basic_ostream<char, _Traits> __ostream_type;
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
try
{
streamsize __w = __out.width();
char* __pads = static_cast<char*>(__builtin_alloca(__w + 1));
__pads[0] = __c;
streamsize __len = 1;
if (__w > __len)
{
__pad_char(__out, __pads, &__c, __w, __len);
__len = __w;
}
__out.write(__pads, __len);
__out.width(0);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return __out;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
try
{
streamsize __w = __out.width();
_CharT* __pads = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w));
streamsize __len = static_cast<streamsize>(_Traits::length(__s));
if (__w > __len)
{
__pad_char(__out, __pads, __s, __w, __len);
__s = __pads;
__len = __w;
}
__out.write(__s, __len);
__out.width(0);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return __out;
}
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 167. Improper use of traits_type::length()
typedef char_traits<char> __ctraits_type;
#endif
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
size_t __clen = __ctraits_type::length(__s);
_CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * (__clen + 1)));
for (size_t __i = 0; __i <= __clen; ++__i)
__ws[__i] = __out.widen(__s[__i]);
_CharT* __str = __ws;
try
{
streamsize __len = static_cast<streamsize>(__clen);
streamsize __w = __out.width();
_CharT* __pads = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w));
if (__w > __len)
{
__pad_char(__out, __pads, __ws, __w, __len);
__str = __pads;
__len = __w;
}
__out.write(__str, __len);
__out.width(0);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return __out;
}
 
// Partial specializationss
template<class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
{
typedef basic_ostream<char, _Traits> __ostream_type;
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
try
{
streamsize __w = __out.width();
char* __pads = static_cast<char*>(__builtin_alloca(__w));
streamsize __len = static_cast<streamsize>(_Traits::length(__s));
if (__w > __len)
{
__pad_char(__out, __pads, __s, __w, __len);
__s = __pads;
__len = __w;
}
__out.write(__s, __len);
__out.width(0);
}
catch(exception& __fail)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
__out.setstate(ios_base::badbit);
if ((__out.exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
}
}
return __out;
}
 
// 21.3.7.9 basic_string::operator<<
template<typename _CharT, typename _Traits, typename _Alloc>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __out,
const basic_string<_CharT, _Traits, _Alloc>& __str)
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
const _CharT* __s = __str.data();
streamsize __w = __out.width();
_CharT* __pads = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w));
streamsize __len = static_cast<streamsize>(__str.size());
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 25. String operator<< uses width() value wrong
#endif
if (__w > __len)
{
__pad_char(__out, __pads, __s, __w, __len);
__s = __pads;
__len = __w;
}
streamsize __res = __out.rdbuf()->sputn(__s, __len);
__out.width(0);
if (__res != __len)
__out.setstate(ios_base::failbit);
}
return __out;
}
} // namespace std
// Local Variables:
// mode:C++
// End:
 
/contrib/media/updf/include/bits/poll.h
0,0 → 1,50
/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
 
The GNU C 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.1 of the License, or (at your option) any later version.
 
The GNU C 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 the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
 
#ifndef _SYS_POLL_H
# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
#endif
 
/* Event types that can be polled for. These bits may be set in `events'
to indicate the interesting event types; they will appear in `revents'
to indicate the status of the file descriptor. */
#define POLLIN 0x001 /* There is data to read. */
#define POLLPRI 0x002 /* There is urgent data to read. */
#define POLLOUT 0x004 /* Writing now will not block. */
 
#ifdef __USE_XOPEN
/* These values are defined in XPG4.2. */
# define POLLRDNORM 0x040 /* Normal data may be read. */
# define POLLRDBAND 0x080 /* Priority data may be read. */
# define POLLWRNORM 0x100 /* Writing now will not block. */
# define POLLWRBAND 0x200 /* Priority data may be written. */
#endif
 
#ifdef __USE_GNU
/* These are extensions for Linux. */
# define POLLMSG 0x400
# define POLLREMOVE 0x1000
# define POLLRDHUP 0x2000
#endif
 
/* Event types always implicitly polled for. These bits need not be set in
`events', but they will appear in `revents' to indicate the status of
the file descriptor. */
#define POLLERR 0x008 /* Error condition. */
#define POLLHUP 0x010 /* Hung up. */
#define POLLNVAL 0x020 /* Invalid polling request. */
/contrib/media/updf/include/bits/pthread_allocimpl.h
0,0 → 1,491
/*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BITS_PTHREAD_ALLOCIMPL_H
#define _CPP_BITS_PTHREAD_ALLOCIMPL_H 1
 
// Pthread-specific node allocator.
// This is similar to the default allocator, except that free-list
// information is kept separately for each thread, avoiding locking.
// This should be reasonably fast even in the presence of threads.
// The down side is that storage may not be well-utilized.
// It is not an error to allocate memory in thread A and deallocate
// it in thread B. But this effectively transfers ownership of the memory,
// so that it can only be reallocated by thread B. Thus this can effectively
// result in a storage leak if it's done on a regular basis.
// It can also result in frequent sharing of
// cache lines among processors, with potentially serious performance
// consequences.
 
#include <bits/c++config.h>
#include <bits/std_cerrno.h>
#include <bits/stl_alloc.h>
#ifndef __RESTRICT
# define __RESTRICT
#endif
 
#include <new>
 
namespace std
{
 
#define __STL_DATA_ALIGNMENT 8
 
union _Pthread_alloc_obj {
union _Pthread_alloc_obj * __free_list_link;
char __client_data[__STL_DATA_ALIGNMENT]; /* The client sees this. */
};
 
// Pthread allocators don't appear to the client to have meaningful
// instances. We do in fact need to associate some state with each
// thread. That state is represented by
// _Pthread_alloc_per_thread_state<_Max_size>.
 
template<size_t _Max_size>
struct _Pthread_alloc_per_thread_state {
typedef _Pthread_alloc_obj __obj;
enum { _S_NFREELISTS = _Max_size/__STL_DATA_ALIGNMENT };
_Pthread_alloc_obj* volatile __free_list[_S_NFREELISTS];
_Pthread_alloc_per_thread_state<_Max_size> * __next;
// Free list link for list of available per thread structures.
// When one of these becomes available for reuse due to thread
// termination, any objects in its free list remain associated
// with it. The whole structure may then be used by a newly
// created thread.
_Pthread_alloc_per_thread_state() : __next(0)
{
memset((void *)__free_list, 0, (size_t) _S_NFREELISTS * sizeof(__obj *));
}
// Returns an object of size __n, and possibly adds to size n free list.
void *_M_refill(size_t __n);
};
 
// Pthread-specific allocator.
// The argument specifies the largest object size allocated from per-thread
// free lists. Larger objects are allocated using malloc_alloc.
// Max_size must be a power of 2.
template <size_t _Max_size = 128>
class _Pthread_alloc_template {
 
public: // but only for internal use:
 
typedef _Pthread_alloc_obj __obj;
 
// Allocates a chunk for nobjs of size size. nobjs may be reduced
// if it is inconvenient to allocate the requested number.
static char *_S_chunk_alloc(size_t __size, int &__nobjs);
 
enum {_S_ALIGN = __STL_DATA_ALIGNMENT};
 
static size_t _S_round_up(size_t __bytes) {
return (((__bytes) + (int) _S_ALIGN-1) & ~((int) _S_ALIGN - 1));
}
static size_t _S_freelist_index(size_t __bytes) {
return (((__bytes) + (int) _S_ALIGN-1)/(int)_S_ALIGN - 1);
}
 
private:
// Chunk allocation state. And other shared state.
// Protected by _S_chunk_allocator_lock.
static pthread_mutex_t _S_chunk_allocator_lock;
static char *_S_start_free;
static char *_S_end_free;
static size_t _S_heap_size;
static _Pthread_alloc_per_thread_state<_Max_size>* _S_free_per_thread_states;
static pthread_key_t _S_key;
static bool _S_key_initialized;
// Pthread key under which per thread state is stored.
// Allocator instances that are currently unclaimed by any thread.
static void _S_destructor(void *instance);
// Function to be called on thread exit to reclaim per thread
// state.
static _Pthread_alloc_per_thread_state<_Max_size> *_S_new_per_thread_state();
// Return a recycled or new per thread state.
static _Pthread_alloc_per_thread_state<_Max_size> *_S_get_per_thread_state();
// ensure that the current thread has an associated
// per thread state.
class _M_lock;
friend class _M_lock;
class _M_lock {
public:
_M_lock () { pthread_mutex_lock(&_S_chunk_allocator_lock); }
~_M_lock () { pthread_mutex_unlock(&_S_chunk_allocator_lock); }
};
 
public:
 
/* n must be > 0 */
static void * allocate(size_t __n)
{
__obj * volatile * __my_free_list;
__obj * __RESTRICT __result;
_Pthread_alloc_per_thread_state<_Max_size>* __a;
 
if (__n > _Max_size) {
return(malloc_alloc::allocate(__n));
}
if (!_S_key_initialized ||
!(__a = (_Pthread_alloc_per_thread_state<_Max_size>*)
pthread_getspecific(_S_key))) {
__a = _S_get_per_thread_state();
}
__my_free_list = __a -> __free_list + _S_freelist_index(__n);
__result = *__my_free_list;
if (__result == 0) {
void *__r = __a -> _M_refill(_S_round_up(__n));
return __r;
}
*__my_free_list = __result -> __free_list_link;
return (__result);
};
 
/* p may not be 0 */
static void deallocate(void *__p, size_t __n)
{
__obj *__q = (__obj *)__p;
__obj * volatile * __my_free_list;
_Pthread_alloc_per_thread_state<_Max_size>* __a;
 
if (__n > _Max_size) {
malloc_alloc::deallocate(__p, __n);
return;
}
if (!_S_key_initialized ||
!(__a = (_Pthread_alloc_per_thread_state<_Max_size> *)
pthread_getspecific(_S_key))) {
__a = _S_get_per_thread_state();
}
__my_free_list = __a->__free_list + _S_freelist_index(__n);
__q -> __free_list_link = *__my_free_list;
*__my_free_list = __q;
}
 
static void * reallocate(void *__p, size_t __old_sz, size_t __new_sz);
 
} ;
 
typedef _Pthread_alloc_template<> pthread_alloc;
 
 
template <size_t _Max_size>
void _Pthread_alloc_template<_Max_size>::_S_destructor(void * __instance)
{
_M_lock __lock_instance; // Need to acquire lock here.
_Pthread_alloc_per_thread_state<_Max_size>* __s =
(_Pthread_alloc_per_thread_state<_Max_size> *)__instance;
__s -> __next = _S_free_per_thread_states;
_S_free_per_thread_states = __s;
}
 
template <size_t _Max_size>
_Pthread_alloc_per_thread_state<_Max_size> *
_Pthread_alloc_template<_Max_size>::_S_new_per_thread_state()
{
/* lock already held here. */
if (0 != _S_free_per_thread_states) {
_Pthread_alloc_per_thread_state<_Max_size> *__result =
_S_free_per_thread_states;
_S_free_per_thread_states = _S_free_per_thread_states -> __next;
return __result;
} else {
return new _Pthread_alloc_per_thread_state<_Max_size>;
}
}
 
template <size_t _Max_size>
_Pthread_alloc_per_thread_state<_Max_size> *
_Pthread_alloc_template<_Max_size>::_S_get_per_thread_state()
{
/*REFERENCED*/
_M_lock __lock_instance; // Need to acquire lock here.
int __ret_code;
_Pthread_alloc_per_thread_state<_Max_size> * __result;
if (!_S_key_initialized) {
if (pthread_key_create(&_S_key, _S_destructor)) {
std::__throw_bad_alloc(); // defined in funcexcept.h
}
_S_key_initialized = true;
}
__result = _S_new_per_thread_state();
__ret_code = pthread_setspecific(_S_key, __result);
if (__ret_code) {
if (__ret_code == ENOMEM) {
std::__throw_bad_alloc();
} else {
// EINVAL
abort();
}
}
return __result;
}
 
/* We allocate memory in large chunks in order to avoid fragmenting */
/* the malloc heap too much. */
/* We assume that size is properly aligned. */
template <size_t _Max_size>
char *_Pthread_alloc_template<_Max_size>
::_S_chunk_alloc(size_t __size, int &__nobjs)
{
{
char * __result;
size_t __total_bytes;
size_t __bytes_left;
/*REFERENCED*/
_M_lock __lock_instance; // Acquire lock for this routine
 
__total_bytes = __size * __nobjs;
__bytes_left = _S_end_free - _S_start_free;
if (__bytes_left >= __total_bytes) {
__result = _S_start_free;
_S_start_free += __total_bytes;
return(__result);
} else if (__bytes_left >= __size) {
__nobjs = __bytes_left/__size;
__total_bytes = __size * __nobjs;
__result = _S_start_free;
_S_start_free += __total_bytes;
return(__result);
} else {
size_t __bytes_to_get =
2 * __total_bytes + _S_round_up(_S_heap_size >> 4);
// Try to make use of the left-over piece.
if (__bytes_left > 0) {
_Pthread_alloc_per_thread_state<_Max_size>* __a =
(_Pthread_alloc_per_thread_state<_Max_size>*)
pthread_getspecific(_S_key);
__obj * volatile * __my_free_list =
__a->__free_list + _S_freelist_index(__bytes_left);
 
((__obj *)_S_start_free) -> __free_list_link = *__my_free_list;
*__my_free_list = (__obj *)_S_start_free;
}
# ifdef _SGI_SOURCE
// Try to get memory that's aligned on something like a
// cache line boundary, so as to avoid parceling out
// parts of the same line to different threads and thus
// possibly different processors.
{
const int __cache_line_size = 128; // probable upper bound
__bytes_to_get &= ~(__cache_line_size-1);
_S_start_free = (char *)memalign(__cache_line_size, __bytes_to_get);
if (0 == _S_start_free) {
_S_start_free = (char *)malloc_alloc::allocate(__bytes_to_get);
}
}
# else /* !SGI_SOURCE */
_S_start_free = (char *)malloc_alloc::allocate(__bytes_to_get);
# endif
_S_heap_size += __bytes_to_get;
_S_end_free = _S_start_free + __bytes_to_get;
}
}
// lock is released here
return(_S_chunk_alloc(__size, __nobjs));
}
 
 
/* Returns an object of size n, and optionally adds to size n free list.*/
/* We assume that n is properly aligned. */
/* We hold the allocation lock. */
template <size_t _Max_size>
void *_Pthread_alloc_per_thread_state<_Max_size>
::_M_refill(size_t __n)
{
int __nobjs = 128;
char * __chunk =
_Pthread_alloc_template<_Max_size>::_S_chunk_alloc(__n, __nobjs);
__obj * volatile * __my_free_list;
__obj * __result;
__obj * __current_obj, * __next_obj;
int __i;
 
if (1 == __nobjs) {
return(__chunk);
}
__my_free_list = __free_list
+ _Pthread_alloc_template<_Max_size>::_S_freelist_index(__n);
 
/* Build free list in chunk */
__result = (__obj *)__chunk;
*__my_free_list = __next_obj = (__obj *)(__chunk + __n);
for (__i = 1; ; __i++) {
__current_obj = __next_obj;
__next_obj = (__obj *)((char *)__next_obj + __n);
if (__nobjs - 1 == __i) {
__current_obj -> __free_list_link = 0;
break;
} else {
__current_obj -> __free_list_link = __next_obj;
}
}
return(__result);
}
 
template <size_t _Max_size>
void *_Pthread_alloc_template<_Max_size>
::reallocate(void *__p, size_t __old_sz, size_t __new_sz)
{
void * __result;
size_t __copy_sz;
 
if (__old_sz > _Max_size
&& __new_sz > _Max_size) {
return(realloc(__p, __new_sz));
}
if (_S_round_up(__old_sz) == _S_round_up(__new_sz)) return(__p);
__result = allocate(__new_sz);
__copy_sz = __new_sz > __old_sz? __old_sz : __new_sz;
memcpy(__result, __p, __copy_sz);
deallocate(__p, __old_sz);
return(__result);
}
 
template <size_t _Max_size>
_Pthread_alloc_per_thread_state<_Max_size> *
_Pthread_alloc_template<_Max_size>::_S_free_per_thread_states = 0;
 
template <size_t _Max_size>
pthread_key_t _Pthread_alloc_template<_Max_size>::_S_key;
 
template <size_t _Max_size>
bool _Pthread_alloc_template<_Max_size>::_S_key_initialized = false;
 
template <size_t _Max_size>
pthread_mutex_t _Pthread_alloc_template<_Max_size>::_S_chunk_allocator_lock
= PTHREAD_MUTEX_INITIALIZER;
 
template <size_t _Max_size>
char *_Pthread_alloc_template<_Max_size>
::_S_start_free = 0;
 
template <size_t _Max_size>
char *_Pthread_alloc_template<_Max_size>
::_S_end_free = 0;
 
template <size_t _Max_size>
size_t _Pthread_alloc_template<_Max_size>
::_S_heap_size = 0;
 
 
template <class _Tp>
class pthread_allocator {
typedef pthread_alloc _S_Alloc; // The underlying allocator.
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef _Tp value_type;
 
template <class _NewType> struct rebind {
typedef pthread_allocator<_NewType> other;
};
 
pthread_allocator() __STL_NOTHROW {}
pthread_allocator(const pthread_allocator& a) __STL_NOTHROW {}
template <class _OtherType>
pthread_allocator(const pthread_allocator<_OtherType>&)
__STL_NOTHROW {}
~pthread_allocator() __STL_NOTHROW {}
 
pointer address(reference __x) const { return &__x; }
const_pointer address(const_reference __x) const { return &__x; }
 
// __n is permitted to be 0. The C++ standard says nothing about what
// the return value is when __n == 0.
_Tp* allocate(size_type __n, const void* = 0) {
return __n != 0 ? static_cast<_Tp*>(_S_Alloc::allocate(__n * sizeof(_Tp)))
: 0;
}
 
// p is not permitted to be a null pointer.
void deallocate(pointer __p, size_type __n)
{ _S_Alloc::deallocate(__p, __n * sizeof(_Tp)); }
 
size_type max_size() const __STL_NOTHROW
{ return size_t(-1) / sizeof(_Tp); }
 
void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
void destroy(pointer _p) { _p->~_Tp(); }
};
 
template<>
class pthread_allocator<void> {
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
 
template <class _NewType> struct rebind {
typedef pthread_allocator<_NewType> other;
};
};
 
template <size_t _Max_size>
inline bool operator==(const _Pthread_alloc_template<_Max_size>&,
const _Pthread_alloc_template<_Max_size>&)
{
return true;
}
 
template <class _T1, class _T2>
inline bool operator==(const pthread_allocator<_T1>&,
const pthread_allocator<_T2>& a2)
{
return true;
}
 
template <class _T1, class _T2>
inline bool operator!=(const pthread_allocator<_T1>&,
const pthread_allocator<_T2>&)
{
return false;
}
 
template <class _Tp, size_t _Max_size>
struct _Alloc_traits<_Tp, _Pthread_alloc_template<_Max_size> >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, _Pthread_alloc_template<_Max_size> > _Alloc_type;
typedef __allocator<_Tp, _Pthread_alloc_template<_Max_size> >
allocator_type;
};
 
template <class _Tp, class _Atype, size_t _Max>
struct _Alloc_traits<_Tp, __allocator<_Atype, _Pthread_alloc_template<_Max> > >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, _Pthread_alloc_template<_Max> > _Alloc_type;
typedef __allocator<_Tp, _Pthread_alloc_template<_Max> > allocator_type;
};
 
template <class _Tp, class _Atype>
struct _Alloc_traits<_Tp, pthread_allocator<_Atype> >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, _Pthread_alloc_template<> > _Alloc_type;
typedef pthread_allocator<_Tp> allocator_type;
};
 
 
} // namespace std
 
#endif /* _CPP_BITS_PTHREAD_ALLOCIMPL_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/sbuf_iter.h
0,0 → 1,203
// Streambuf iterators
 
// Copyright (C) 1997-2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// XXX Should specialize copy, find algorithms for streambuf iterators.
 
#ifndef _CPP_BITS_SBUF_ITER_H
#define _CPP_BITS_SBUF_ITER_H 1
 
#pragma GCC system_header
 
namespace std
{
template<typename _CharT, typename _Traits>
class ostreambuf_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef basic_streambuf<_CharT, _Traits> streambuf_type;
typedef basic_ostream<_CharT, _Traits> ostream_type;
 
private:
streambuf_type* _M_sbuf;
bool _M_failed;
 
public:
inline
ostreambuf_iterator(ostream_type& __s) throw ()
: _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { }
ostreambuf_iterator(streambuf_type* __s) throw ()
: _M_sbuf(__s), _M_failed(!_M_sbuf) { }
 
ostreambuf_iterator&
operator=(_CharT __c);
 
ostreambuf_iterator&
operator*() throw()
{ return *this; }
 
ostreambuf_iterator&
operator++(int) throw()
{ return *this; }
 
ostreambuf_iterator&
operator++() throw()
{ return *this; }
 
bool
failed() const throw()
{ return _M_failed; }
};
 
template<typename _CharT, typename _Traits>
inline ostreambuf_iterator<_CharT, _Traits>&
ostreambuf_iterator<_CharT, _Traits>::operator=(_CharT __c)
{
if (!_M_failed &&
_Traits::eq_int_type(_M_sbuf->sputc(__c),_Traits::eof()))
_M_failed = true;
return *this;
}
 
 
// 24.5.3 Template class istreambuf_iterator
template<typename _CharT, typename _Traits>
class istreambuf_iterator
: public iterator<input_iterator_tag, _CharT, typename _Traits::off_type,
_CharT*, _CharT&>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename _Traits::int_type int_type;
typedef basic_streambuf<_CharT, _Traits> streambuf_type;
typedef basic_istream<_CharT, _Traits> istream_type;
// Non-standard Types:
typedef istreambuf_iterator<_CharT, _Traits> __istreambufiter_type;
 
private:
// 24.5.3 istreambuf_iterator
// p 1
// If the end of stream is reached (streambuf_type::sgetc()
// returns traits_type::eof()), the iterator becomes equal to
// the "end of stream" iterator value.
// NB: This implementation assumes the "end of stream" value
// is EOF, or -1.
streambuf_type* _M_sbuf;
int_type _M_c;
 
public:
istreambuf_iterator() throw()
: _M_sbuf(NULL), _M_c(-2) { }
istreambuf_iterator(istream_type& __s) throw()
: _M_sbuf(__s.rdbuf()), _M_c(-2) { }
 
istreambuf_iterator(streambuf_type* __s) throw()
: _M_sbuf(__s), _M_c(-2) { }
// NB: This should really have an int_type return
// value, so "end of stream" postion can be checked without
// hacking.
char_type
operator*() const
{
// The result of operator*() on an end of stream is undefined.
char_type __ret;
if (_M_sbuf && _M_c != static_cast<int_type>(-2))
__ret = _M_c;
else if (_M_sbuf)
__ret = traits_type::to_char_type(_M_sbuf->sgetc());
else
__ret = static_cast<char_type>(traits_type::eof());
return __ret;
}
__istreambufiter_type&
operator++()
{
if (_M_sbuf)
_M_sbuf->sbumpc();
_M_c = -2;
return *this;
}
 
__istreambufiter_type
operator++(int)
{
__istreambufiter_type __old = *this;
if (_M_sbuf)
__old._M_c = _M_sbuf->sbumpc();
_M_c = -2;
return __old;
}
 
bool
equal(const __istreambufiter_type& __b)
{
int_type __eof = traits_type::eof();
bool __thiseof = !_M_sbuf || _M_sbuf->sgetc() == __eof;
bool __beof = !__b._M_sbuf
|| __b._M_sbuf->sgetc() == __eof;
return (__thiseof && __beof || (!__thiseof && !__beof));
}
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 110 istreambuf_iterator::equal not const
// NB: there is also number 111 pending on this function.
bool
equal(const __istreambufiter_type& __b) const
{
int_type __eof = traits_type::eof();
bool __thiseof = !_M_sbuf || _M_sbuf->sgetc() == __eof;
bool __beof = !__b._M_sbuf
|| __b._M_sbuf->sgetc() == __eof;
return (__thiseof && __beof || (!__thiseof && !__beof));
}
#endif
};
 
template<typename _CharT, typename _Traits>
inline bool
operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
const istreambuf_iterator<_CharT, _Traits>& __b)
{ return __a.equal(__b); }
 
template<typename _CharT, typename _Traits>
inline bool
operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
const istreambuf_iterator<_CharT, _Traits>& __b)
{ return !__a.equal(__b); }
} // namespace std
#endif
/contrib/media/updf/include/bits/sequence_concepts.h
0,0 → 1,206
/*
* Copyright (c) 1999
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _STL_SEQUENCE_CONCEPTS_H
#define _STL_SEQUENCE_CONCEPTS_H 1
 
#pragma GCC system_header
 
#include <bits/container_concepts.h>
 
#ifdef __STL_USE_CONCEPT_CHECKS
 
// This file covers the following concepts:
// _Sequence
// _FrontInsertionSequence
// _BackInsertionSequence
 
struct _ERROR_IN_STL_SEQ {
 
template <class _XX>
static void
__fill_constructor_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
typename _XX::difference_type __n = typename _XX::difference_type();
_XX __x(__n, __t);
__sink_unused_warning(__x);
}
template <class _XX>
static void
__fill_default_constructor_requirement_violation(_XX& __s) {
_STL_ERROR::__default_constructor_requirement_violation(*__s.begin());
typename _XX::difference_type __n = typename _XX::difference_type();
_XX __x(__n);
__sink_unused_warning(__x);
}
template <class _XX>
static void
__range_constructor_requirement_violation(_XX& __s) {
_XX __x(__s.begin(), __s.end());
__sink_unused_warning(__x);
}
template <class _XX>
static void
__insert_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
typename _XX::iterator __p = typename _XX::iterator();
__p = __s.insert(__p, __t);
}
template <class _XX>
static void
__fill_insert_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
typename _XX::iterator __p = typename _XX::iterator();
typename _XX::difference_type __n = typename _XX::difference_type();
__s.insert(__p, __n, __t);
}
template <class _XX>
static void
__range_insert_function_requirement_violation(_XX& __s) {
typename _XX::iterator __p = typename _XX::iterator();
typename _XX::iterator __i = typename _XX::iterator();
typename _XX::iterator __j = typename _XX::iterator();
__s.insert(__p, __i, __j);
}
template <class _XX>
static void
__insert_element_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
std::pair<typename _XX::iterator, bool> __r;
__r = __s.insert(__t);
__sink_unused_warning(__r);
}
template <class _XX>
static void
__unconditional_insert_element_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
typename _XX::iterator __p;
__p = __s.insert(__t);
__sink_unused_warning(__p);
}
template <class _XX>
static void
__erase_function_requirement_violation(_XX& __s) {
typename _XX::iterator __p = typename _XX::iterator();
__p = __s.erase(__p);
}
template <class _XX>
static void
__range_erase_function_requirement_violation(_XX& __s) {
typename _XX::iterator __p = typename _XX::iterator();
typename _XX::iterator __q = typename _XX::iterator();
__p = __s.erase(__p, __q);
}
template <class _XX>
static void
__const_front_function_requirement_violation(const _XX& __s) {
typename _XX::const_reference __t = __s.front();
__sink_unused_warning(__t);
}
template <class _XX>
static void
__front_function_requirement_violation(_XX& __s) {
typename _XX::reference __t = __s.front();
__const_front_function_requirement_violation(__s);
__sink_unused_warning(__t);
}
template <class _XX>
static void
__const_back_function_requirement_violation(const _XX& __s) {
typename _XX::const_reference __t = __s.back();
__sink_unused_warning(__t);
}
template <class _XX>
static void
__back_function_requirement_violation(_XX& __s) {
typename _XX::reference __t = __s.back();
__const_back_function_requirement_violation(__s);
__sink_unused_warning(__t);
}
template <class _XX>
static void
__push_front_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
__s.push_front(__t);
}
template <class _XX>
static void
__pop_front_function_requirement_violation(_XX& __s) {
__s.pop_front();
}
template <class _XX>
static void
__push_back_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
__s.push_back(__t);
}
template <class _XX>
static void
__pop_back_function_requirement_violation(_XX& __s) {
__s.pop_back();
}
 
};
 
/* Sequence Containers */
 
template <class _Sequence>
struct _Sequence_concept_specification {
static void
_Sequence_requirement_violation(_Sequence __s) {
// Refinement of ForwardContainer
_ForwardContainer_concept_specification<_Sequence>::_ForwardContainer_requirement_violation(__s);
// Refinement of DefaultConstructible
_DefaultConstructible_concept_specification<_Sequence>::_DefaultConstructible_requirement_violation(__s);
// Valid Expressions
_ERROR_IN_STL_SEQ::__fill_constructor_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__fill_default_constructor_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__range_constructor_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__insert_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__fill_insert_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__range_insert_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__erase_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__range_erase_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__front_function_requirement_violation(__s);
}
};
 
template <class _FrontInsertionSequence>
struct _FrontInsertionSequence_concept_specification {
static void
_FrontInsertionSequence_requirement_violation(_FrontInsertionSequence __s) {
// Refinement of Sequence
_Sequence_concept_specification<_FrontInsertionSequence>::_Sequence_requirement_violation(__s);
// Valid Expressions
_ERROR_IN_STL_SEQ::__push_front_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__pop_front_function_requirement_violation(__s);
}
};
 
template <class _BackInsertionSequence>
struct _BackInsertionSequence_concept_specification {
static void
_BackInsertionSequence_requirement_violation(_BackInsertionSequence __s) {
// Refinement of Sequence
_Sequence_concept_specification<_BackInsertionSequence>::_Sequence_requirement_violation(__s);
// Valid Expressions
_ERROR_IN_STL_SEQ::__back_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__push_back_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__pop_back_function_requirement_violation(__s);
}
};
 
#endif /* if __STL_USE_CONCEPT_CHECKS */
 
 
#endif /* _STL_SEQUENCE_CONCEPTS_H */
/contrib/media/updf/include/bits/slice.h
0,0 → 1,80
// The template and inlines for the -*- C++ -*- slice class.
 
// Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
 
#ifndef _CPP_BITS_SLICE_H
#define _CPP_BITS_SLICE_H 1
 
#pragma GCC system_header
 
namespace std
{
 
class slice
{
public:
slice ();
slice (size_t, size_t, size_t);
 
size_t start () const;
size_t size () const;
size_t stride () const;
 
private:
size_t _M_off; // offset
size_t _M_sz; // size
size_t _M_st; // stride unit
};
 
inline slice::slice () {}
 
inline slice::slice (size_t __o, size_t __d, size_t __s)
: _M_off (__o), _M_sz (__d), _M_st (__s) {}
 
inline size_t
slice::start () const
{ return _M_off; }
 
inline size_t
slice::size () const
{ return _M_sz; }
 
inline size_t
slice::stride () const
{ return _M_st; }
 
} // std::
 
 
#endif /* _CPP_BITS_SLICE_H */
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/slice_array.h
0,0 → 1,164
// The template and inlines for the -*- C++ -*- slice_array class.
 
// Copyright (C) 1997-1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
 
#ifndef _CPP_BITS_SLICE_ARRAY_H
#define _CPP_BITS_SLICE_ARRAY_H 1
 
#pragma GCC system_header
 
namespace std
{
template<typename _Tp>
class slice_array
{
public:
typedef _Tp value_type;
void operator= (const valarray<_Tp>&) const;
void operator*= (const valarray<_Tp>&) const;
void operator/= (const valarray<_Tp>&) const;
void operator%= (const valarray<_Tp>&) const;
void operator+= (const valarray<_Tp>&) const;
void operator-= (const valarray<_Tp>&) const;
void operator^= (const valarray<_Tp>&) const;
void operator&= (const valarray<_Tp>&) const;
void operator|= (const valarray<_Tp>&) const;
void operator<<= (const valarray<_Tp>&) const;
void operator>>= (const valarray<_Tp>&) const;
void operator= (const _Tp &);
// ~slice_array ();
template<class _Dom>
void operator= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator*= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator/= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator%= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator+= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator-= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator^= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator&= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator|= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator<<= (const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator>>= (const _Expr<_Dom,_Tp>&) const;
private:
friend class valarray<_Tp>;
slice_array(_Array<_Tp>, const slice&);
const size_t _M_sz;
const size_t _M_stride;
const _Array<_Tp> _M_array;
// this constructor is implemented since we need to return a value.
slice_array (const slice_array&);
 
// not implemented
slice_array ();
slice_array& operator= (const slice_array&);
};
 
template<typename _Tp>
inline slice_array<_Tp>::slice_array (_Array<_Tp> __a, const slice& __s)
: _M_sz (__s.size ()), _M_stride (__s.stride ()),
_M_array (__a.begin () + __s.start ()) {}
 
template<typename _Tp>
inline slice_array<_Tp>::slice_array(const slice_array<_Tp>& a)
: _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {}
// template<typename _Tp>
// inline slice_array<_Tp>::~slice_array () {}
 
template<typename _Tp>
inline void
slice_array<_Tp>::operator= (const _Tp& __t)
{ __valarray_fill (_M_array, _M_sz, _M_stride, __t); }
template<typename _Tp>
inline void
slice_array<_Tp>::operator= (const valarray<_Tp>& __v) const
{ __valarray_copy (_Array<_Tp> (__v), _M_array, _M_sz, _M_stride); }
template<typename _Tp>
template<class _Dom>
inline void
slice_array<_Tp>::operator= (const _Expr<_Dom,_Tp>& __e) const
{ __valarray_copy (__e, _M_sz, _M_array, _M_stride); }
 
#undef _DEFINE_VALARRAY_OPERATOR
#define _DEFINE_VALARRAY_OPERATOR(op, name) \
template<typename _Tp> \
inline void \
slice_array<_Tp>::operator op##= (const valarray<_Tp>& __v) const \
{ \
_Array_augmented_##name (_M_array, _M_sz, _M_stride, _Array<_Tp> (__v));\
} \
\
template<typename _Tp> template<class _Dom> \
inline void \
slice_array<_Tp>::operator op##= (const _Expr<_Dom,_Tp>& __e) const \
{ \
_Array_augmented_##name (_M_array, _M_stride, __e, _M_sz); \
}
 
_DEFINE_VALARRAY_OPERATOR(*, multiplies)
_DEFINE_VALARRAY_OPERATOR(/, divides)
_DEFINE_VALARRAY_OPERATOR(%, modulus)
_DEFINE_VALARRAY_OPERATOR(+, plus)
_DEFINE_VALARRAY_OPERATOR(-, minus)
_DEFINE_VALARRAY_OPERATOR(^, xor)
_DEFINE_VALARRAY_OPERATOR(&, and)
_DEFINE_VALARRAY_OPERATOR(|, or)
_DEFINE_VALARRAY_OPERATOR(<<, shift_left)
_DEFINE_VALARRAY_OPERATOR(>>, shift_right)
 
#undef _DEFINE_VALARRAY_OPERATOR
 
} // std::
 
#endif /* _CPP_BITS_SLICE_ARRAY_H */
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/sstream.tcc
0,0 → 1,213
// String based streams -*- C++ -*-
 
// Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.7 String-based streams
//
 
#ifndef _CPP_BITS_SSTREAM_TCC
#define _CPP_BITS_SSTREAM_TCC 1
 
#include <bits/std_sstream.h>
 
namespace std
{
 
template <class _CharT, class _Traits, class _Alloc>
basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
basic_stringbuf<_CharT, _Traits, _Alloc>::
pbackfail(int_type __c)
{
int_type __ret = traits_type::eof();
bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
bool __testpos = _M_in_cur && _M_in_beg < _M_in_cur;
// Try to put back __c into input sequence in one of three ways.
// Order these tests done in is unspecified by the standard.
if (__testpos)
{
if (traits_type::eq(traits_type::to_char_type(__c), this->gptr()[-1])
&& !__testeof)
{
--_M_in_cur;
__ret = __c;
}
else if (!__testeof)
{
--_M_in_cur;
*_M_in_cur = traits_type::to_char_type(__c);
__ret = __c;
}
else if (__testeof)
{
--_M_in_cur;
__ret = traits_type::not_eof(__c);
}
}
return __ret;
}
template <class _CharT, class _Traits, class _Alloc>
basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
basic_stringbuf<_CharT, _Traits, _Alloc>::
overflow(int_type __c)
{
int_type __ret = traits_type::eof();
bool __testeof = traits_type::eq_int_type(__c, __ret);
bool __testwrite = _M_out_cur < _M_buf + _M_buf_size;
bool __testout = _M_mode & ios_base::out;
 
// Try to append __c into output sequence in one of two ways.
// Order these tests done in is unspecified by the standard.
if (__testout)
{
if (!__testeof)
{
__size_type __len = max(_M_buf_size, _M_buf_size_opt);
__len *= 2;
 
if (__testwrite)
__ret = this->sputc(__c);
else if (__len <= _M_string.max_size())
{
// Force-allocate, re-sync.
_M_string = this->str();
_M_string.reserve(__len);
_M_buf_size = static_cast<int_type>(__len);
_M_really_sync(_M_in_cur - _M_in_beg,
_M_out_cur - _M_out_beg);
*_M_out_cur = traits_type::to_char_type(__c);
_M_out_cur_move(1);
__ret = __c;
}
}
else
__ret = traits_type::not_eof(__c);
}
return __ret;
}
 
template <class _CharT, class _Traits, class _Alloc>
basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
basic_stringbuf<_CharT, _Traits, _Alloc>::
seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
{
pos_type __ret = pos_type(off_type(-1));
bool __testin = __mode & ios_base::in && _M_mode & ios_base::in;
bool __testout = __mode & ios_base::out && _M_mode & ios_base::out;
bool __testboth = __testin && __testout && __way != ios_base::cur;
if (_M_buf_size && ((__testin != __testout) || __testboth))
{
char_type* __beg = _M_buf;
char_type* __curi = NULL;
char_type* __curo = NULL;
char_type* __endi = NULL;
char_type* __endo = NULL;
 
if (__testin)
{
__curi = this->gptr();
__endi = this->egptr();
}
if (__testout)
{
__curo = this->pptr();
__endo = this->epptr();
}
 
off_type __newoffi = 0;
off_type __newoffo = 0;
if (__way == ios_base::cur)
{
__newoffi = __curi - __beg;
__newoffo = __curo - __beg;
}
else if (__way == ios_base::end)
{
__newoffi = __endi - __beg;
__newoffo = __endo - __beg;
}
 
if (__testin
&& __newoffi + __off >= 0 && __endi - __beg >= __newoffi + __off)
{
_M_in_cur = __beg + __newoffi + __off;
__ret = pos_type(__newoffi);
}
if (__testout
&& __newoffo + __off >= 0 && __endo - __beg >= __newoffo + __off)
{
_M_out_cur_move(__newoffo + __off - (_M_out_cur - __beg));
__ret = pos_type(__newoffo);
}
}
return __ret;
}
 
template <class _CharT, class _Traits, class _Alloc>
basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
basic_stringbuf<_CharT, _Traits, _Alloc>::
seekpos(pos_type __sp, ios_base::openmode __mode)
{
pos_type __ret = pos_type(off_type(-1));
off_type __pos = __sp._M_position();
char_type* __beg = NULL;
char_type* __end = NULL;
bool __testin = __mode & ios_base::in && _M_mode & ios_base::in;
bool __testout = __mode & ios_base::out && _M_mode & ios_base::out;
if (__testin)
{
__beg = this->eback();
__end = this->egptr();
}
if (__testout)
{
__beg = this->pbase();
__end = _M_buf + _M_buf_size;
}
if (0 <= __pos && __pos <= __end - __beg)
{
// Need to set both of these if applicable
if (__testin)
_M_in_cur = _M_in_beg + __pos;
if (__testout)
_M_out_cur_move((__pos) - (_M_out_cur - __beg));
__ret = pos_type(off_type(__pos));
}
return __ret;
}
 
} // namespace std
 
#endif /* _CPP_BITS_SSTREAM_TCC */
 
/contrib/media/updf/include/bits/std_algorithm.h
0,0 → 1,42
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_ALGORITHM
#define _CPP_ALGORITHM 1
 
#pragma GCC system_header
 
#include <bits/stl_algobase.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_tempbuf.h>
#include <bits/stl_algo.h>
 
#endif /* _CPP_ALGORITHM */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/std_bitset.h
0,0 → 1,782
/*
* Copyright (c) 1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef __SGI_STL_BITSET
#define __SGI_STL_BITSET
 
#pragma GCC system_header
 
// A bitset of size N has N % (sizeof(unsigned long) * CHAR_BIT) unused
// bits. (They are the high- order bits in the highest word.) It is
// a class invariant of class bitset<> that those unused bits are
// always zero.
 
// Most of the actual code isn't contained in bitset<> itself, but in the
// base class _Base_bitset. The base class works with whole words, not with
// individual bits. This allows us to specialize _Base_bitset for the
// important special case where the bitset is only a single word.
 
// The C++ standard does not define the precise semantics of operator[].
// In this implementation the const version of operator[] is equivalent
// to test(), except that it does no range checking. The non-const version
// returns a reference to a bit, again without doing any range checking.
 
 
#include <bits/std_cstddef.h> // for size_t
#include <bits/std_cstring.h> // for memset
#include <bits/std_string.h>
#include <bits/std_stdexcept.h> // for invalid_argument, out_of_range,
// overflow_error
 
#include <bits/std_ostream.h> // for ostream (operator<<)
#include <bits/std_istream.h> // for istream (operator>>)
 
#define _GLIBCPP_BITSET_BITS_PER_WORD (CHAR_BIT*sizeof(unsigned long))
#define __BITSET_WORDS(__n) \
((__n) < 1 ? 1 : ((__n) + _GLIBCPP_BITSET_BITS_PER_WORD - 1)/_GLIBCPP_BITSET_BITS_PER_WORD)
 
namespace std
{
 
// structure to aid in counting bits
template<bool __dummy>
struct _Bit_count {
static unsigned char _S_bit_count[256];
};
 
// Mapping from 8 bit unsigned integers to the index of the first one
// bit:
template<bool __dummy>
struct _First_one {
static unsigned char _S_first_one[256];
};
 
//
// Base class: general case.
//
 
template<size_t _Nw>
struct _Base_bitset {
typedef unsigned long _WordT;
 
_WordT _M_w[_Nw]; // 0 is the least significant word.
 
_Base_bitset( void ) { _M_do_reset(); }
_Base_bitset(unsigned long __val) {
_M_do_reset();
_M_w[0] = __val;
}
 
static size_t _S_whichword( size_t __pos )
{ return __pos / _GLIBCPP_BITSET_BITS_PER_WORD; }
static size_t _S_whichbyte( size_t __pos )
{ return (__pos % _GLIBCPP_BITSET_BITS_PER_WORD) / CHAR_BIT; }
static size_t _S_whichbit( size_t __pos )
{ return __pos % _GLIBCPP_BITSET_BITS_PER_WORD; }
static _WordT _S_maskbit( size_t __pos )
{ return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
 
_WordT& _M_getword(size_t __pos) { return _M_w[_S_whichword(__pos)]; }
_WordT _M_getword(size_t __pos) const { return _M_w[_S_whichword(__pos)]; }
 
_WordT& _M_hiword() { return _M_w[_Nw - 1]; }
_WordT _M_hiword() const { return _M_w[_Nw - 1]; }
 
void _M_do_and(const _Base_bitset<_Nw>& __x) {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_M_w[__i] &= __x._M_w[__i];
}
}
 
void _M_do_or(const _Base_bitset<_Nw>& __x) {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_M_w[__i] |= __x._M_w[__i];
}
}
 
void _M_do_xor(const _Base_bitset<_Nw>& __x) {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_M_w[__i] ^= __x._M_w[__i];
}
}
 
void _M_do_left_shift(size_t __shift);
void _M_do_right_shift(size_t __shift);
 
void _M_do_flip() {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_M_w[__i] = ~_M_w[__i];
}
}
 
void _M_do_set() {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_M_w[__i] = ~static_cast<_WordT>(0);
}
}
 
void _M_do_reset() { memset(_M_w, 0, _Nw * sizeof(_WordT)); }
 
bool _M_is_equal(const _Base_bitset<_Nw>& __x) const {
for (size_t __i = 0; __i < _Nw; ++__i) {
if (_M_w[__i] != __x._M_w[__i])
return false;
}
return true;
}
 
bool _M_is_any() const {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
if ( _M_w[__i] != static_cast<_WordT>(0) )
return true;
}
return false;
}
 
size_t _M_do_count() const {
size_t __result = 0;
const unsigned char* __byte_ptr = (const unsigned char*)_M_w;
const unsigned char* __end_ptr = (const unsigned char*)(_M_w+_Nw);
 
while ( __byte_ptr < __end_ptr ) {
__result += _Bit_count<true>::_S_bit_count[*__byte_ptr];
__byte_ptr++;
}
return __result;
}
 
unsigned long _M_do_to_ulong() const;
 
// find first "on" bit
size_t _M_do_find_first(size_t __not_found) const;
 
// find the next "on" bit that follows "prev"
size_t _M_do_find_next(size_t __prev, size_t __not_found) const;
};
 
//
// Definitions of non-inline functions from _Base_bitset.
//
 
template<size_t _Nw>
void _Base_bitset<_Nw>::_M_do_left_shift(size_t __shift)
{
if (__shift != 0) {
const size_t __wshift = __shift / _GLIBCPP_BITSET_BITS_PER_WORD;
const size_t __offset = __shift % _GLIBCPP_BITSET_BITS_PER_WORD;
 
if (__offset == 0)
for (size_t __n = _Nw - 1; __n >= __wshift; --__n)
_M_w[__n] = _M_w[__n - __wshift];
 
else {
const size_t __sub_offset = _GLIBCPP_BITSET_BITS_PER_WORD - __offset;
for (size_t __n = _Nw - 1; __n > __wshift; --__n)
_M_w[__n] = (_M_w[__n - __wshift] << __offset) |
(_M_w[__n - __wshift - 1] >> __sub_offset);
_M_w[__wshift] = _M_w[0] << __offset;
}
 
fill(_M_w + 0, _M_w + __wshift, static_cast<_WordT>(0));
}
}
 
template<size_t _Nw>
void _Base_bitset<_Nw>::_M_do_right_shift(size_t __shift)
{
if (__shift != 0) {
const size_t __wshift = __shift / _GLIBCPP_BITSET_BITS_PER_WORD;
const size_t __offset = __shift % _GLIBCPP_BITSET_BITS_PER_WORD;
const size_t __limit = _Nw - __wshift - 1;
 
if (__offset == 0)
for (size_t __n = 0; __n <= __limit; ++__n)
_M_w[__n] = _M_w[__n + __wshift];
 
else {
const size_t __sub_offset = _GLIBCPP_BITSET_BITS_PER_WORD - __offset;
for (size_t __n = 0; __n < __limit; ++__n)
_M_w[__n] = (_M_w[__n + __wshift] >> __offset) |
(_M_w[__n + __wshift + 1] << __sub_offset);
_M_w[__limit] = _M_w[_Nw-1] >> __offset;
}
 
fill(_M_w + __limit + 1, _M_w + _Nw, static_cast<_WordT>(0));
}
}
 
template<size_t _Nw>
unsigned long _Base_bitset<_Nw>::_M_do_to_ulong() const
{
for (size_t __i = 1; __i < _Nw; ++__i)
if (_M_w[__i])
__STL_THROW(overflow_error("bitset"));
return _M_w[0];
}
 
template<size_t _Nw>
size_t _Base_bitset<_Nw>::_M_do_find_first(size_t __not_found) const
{
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_WordT __thisword = _M_w[__i];
if ( __thisword != static_cast<_WordT>(0) ) {
// find byte within word
for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
unsigned char __this_byte
= static_cast<unsigned char>(__thisword & (~(unsigned char)0));
if ( __this_byte )
return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT +
_First_one<true>::_S_first_one[__this_byte];
 
__thisword >>= CHAR_BIT;
}
}
}
// not found, so return an indication of failure.
return __not_found;
}
 
template<size_t _Nw>
size_t
_Base_bitset<_Nw>::_M_do_find_next(size_t __prev, size_t __not_found) const
{
// make bound inclusive
++__prev;
 
// check out of bounds
if ( __prev >= _Nw * _GLIBCPP_BITSET_BITS_PER_WORD )
return __not_found;
 
// search first word
size_t __i = _S_whichword(__prev);
_WordT __thisword = _M_w[__i];
 
// mask off bits below bound
__thisword &= (~static_cast<_WordT>(0)) << _S_whichbit(__prev);
 
if ( __thisword != static_cast<_WordT>(0) ) {
// find byte within word
// get first byte into place
__thisword >>= _S_whichbyte(__prev) * CHAR_BIT;
for ( size_t __j = _S_whichbyte(__prev); __j < sizeof(_WordT); __j++ ) {
unsigned char __this_byte
= static_cast<unsigned char>(__thisword & (~(unsigned char)0));
if ( __this_byte )
return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT +
_First_one<true>::_S_first_one[__this_byte];
 
__thisword >>= CHAR_BIT;
}
}
 
// check subsequent words
__i++;
for ( ; __i < _Nw; __i++ ) {
__thisword = _M_w[__i];
if ( __thisword != static_cast<_WordT>(0) ) {
// find byte within word
for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
unsigned char __this_byte
= static_cast<unsigned char>(__thisword & (~(unsigned char)0));
if ( __this_byte )
return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT +
_First_one<true>::_S_first_one[__this_byte];
 
__thisword >>= CHAR_BIT;
}
}
}
 
// not found, so return an indication of failure.
return __not_found;
} // end _M_do_find_next
 
 
// ------------------------------------------------------------
 
//
// Base class: specialization for a single word.
//
 
template<> struct _Base_bitset<1> {
typedef unsigned long _WordT;
_WordT _M_w;
 
_Base_bitset( void ) : _M_w(0) {}
_Base_bitset(unsigned long __val) : _M_w(__val) {}
 
static size_t _S_whichword( size_t __pos )
{ return __pos / _GLIBCPP_BITSET_BITS_PER_WORD; }
static size_t _S_whichbyte( size_t __pos )
{ return (__pos % _GLIBCPP_BITSET_BITS_PER_WORD) / CHAR_BIT; }
static size_t _S_whichbit( size_t __pos )
{ return __pos % _GLIBCPP_BITSET_BITS_PER_WORD; }
static _WordT _S_maskbit( size_t __pos )
{ return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
 
_WordT& _M_getword(size_t) { return _M_w; }
_WordT _M_getword(size_t) const { return _M_w; }
 
_WordT& _M_hiword() { return _M_w; }
_WordT _M_hiword() const { return _M_w; }
 
void _M_do_and(const _Base_bitset<1>& __x) { _M_w &= __x._M_w; }
void _M_do_or(const _Base_bitset<1>& __x) { _M_w |= __x._M_w; }
void _M_do_xor(const _Base_bitset<1>& __x) { _M_w ^= __x._M_w; }
void _M_do_left_shift(size_t __shift) { _M_w <<= __shift; }
void _M_do_right_shift(size_t __shift) { _M_w >>= __shift; }
void _M_do_flip() { _M_w = ~_M_w; }
void _M_do_set() { _M_w = ~static_cast<_WordT>(0); }
void _M_do_reset() { _M_w = 0; }
 
bool _M_is_equal(const _Base_bitset<1>& __x) const
{ return _M_w == __x._M_w; }
bool _M_is_any() const
{ return _M_w != 0; }
 
size_t _M_do_count() const {
size_t __result = 0;
const unsigned char* __byte_ptr = (const unsigned char*)&_M_w;
const unsigned char* __end_ptr
= ((const unsigned char*)&_M_w)+sizeof(_M_w);
while ( __byte_ptr < __end_ptr ) {
__result += _Bit_count<true>::_S_bit_count[*__byte_ptr];
__byte_ptr++;
}
return __result;
}
 
unsigned long _M_do_to_ulong() const { return _M_w; }
 
size_t _M_do_find_first(size_t __not_found) const;
 
// find the next "on" bit that follows "prev"
size_t _M_do_find_next(size_t __prev, size_t __not_found) const;
 
};
 
 
// ------------------------------------------------------------
// Helper class to zero out the unused high-order bits in the highest word.
 
template <size_t _Extrabits> struct _Sanitize {
static void _M_do_sanitize(unsigned long& __val)
{ __val &= ~((~static_cast<unsigned long>(0)) << _Extrabits); }
};
 
template<> struct _Sanitize<0> {
static void _M_do_sanitize(unsigned long) {}
};
 
 
 
// ------------------------------------------------------------
// Class bitset.
// _Nb may be any nonzero number of type size_t.
 
template<size_t _Nb>
class bitset : private _Base_bitset<__BITSET_WORDS(_Nb)>
{
private:
typedef _Base_bitset<__BITSET_WORDS(_Nb)> _Base;
typedef unsigned long _WordT;
 
private:
void _M_do_sanitize() {
_Sanitize<_Nb%_GLIBCPP_BITSET_BITS_PER_WORD>::_M_do_sanitize(this->_M_hiword());
}
 
public:
 
// bit reference:
class reference;
friend class reference;
 
class reference {
friend class bitset;
 
_WordT *_M_wp;
size_t _M_bpos;
 
// left undefined
reference();
 
public:
reference( bitset& __b, size_t __pos ) {
_M_wp = &__b._M_getword(__pos);
_M_bpos = _Base::_S_whichbit(__pos);
}
 
~reference() {}
 
// for b[i] = __x;
reference& operator=(bool __x) {
if ( __x )
*_M_wp |= _Base::_S_maskbit(_M_bpos);
else
*_M_wp &= ~_Base::_S_maskbit(_M_bpos);
 
return *this;
}
 
// for b[i] = b[__j];
reference& operator=(const reference& __j) {
if ( (*(__j._M_wp) & _Base::_S_maskbit(__j._M_bpos)) )
*_M_wp |= _Base::_S_maskbit(_M_bpos);
else
*_M_wp &= ~_Base::_S_maskbit(_M_bpos);
 
return *this;
}
 
// flips the bit
bool operator~() const
{ return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) == 0; }
 
// for __x = b[i];
operator bool() const
{ return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) != 0; }
 
// for b[i].flip();
reference& flip() {
*_M_wp ^= _Base::_S_maskbit(_M_bpos);
return *this;
}
};
 
// 23.3.5.1 constructors:
bitset() {}
bitset(unsigned long __val) : _Base_bitset<__BITSET_WORDS(_Nb)>(__val)
{ _M_do_sanitize(); }
 
template<class _CharT, class _Traits, class _Alloc>
explicit bitset(const basic_string<_CharT, _Traits, _Alloc>& __s,
size_t __pos = 0)
: _Base()
{
if (__pos > __s.size())
__STL_THROW(out_of_range("bitset"));
_M_copy_from_string(__s, __pos,
basic_string<_CharT, _Traits, _Alloc>::npos);
}
template<class _CharT, class _Traits, class _Alloc>
bitset(const basic_string<_CharT, _Traits, _Alloc>& __s,
size_t __pos,
size_t __n)
: _Base()
{
if (__pos > __s.size())
__STL_THROW(out_of_range("bitset"));
_M_copy_from_string(__s, __pos, __n);
}
 
// 23.3.5.2 bitset operations:
bitset<_Nb>& operator&=(const bitset<_Nb>& __rhs) {
this->_M_do_and(__rhs);
return *this;
}
 
bitset<_Nb>& operator|=(const bitset<_Nb>& __rhs) {
this->_M_do_or(__rhs);
return *this;
}
 
bitset<_Nb>& operator^=(const bitset<_Nb>& __rhs) {
this->_M_do_xor(__rhs);
return *this;
}
 
bitset<_Nb>& operator<<=(size_t __pos) {
this->_M_do_left_shift(__pos);
this->_M_do_sanitize();
return *this;
}
 
bitset<_Nb>& operator>>=(size_t __pos) {
this->_M_do_right_shift(__pos);
this->_M_do_sanitize();
return *this;
}
 
//
// Extension:
// Versions of single-bit set, reset, flip, test with no range checking.
//
 
bitset<_Nb>& _Unchecked_set(size_t __pos) {
this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
return *this;
}
 
bitset<_Nb>& _Unchecked_set(size_t __pos, int __val) {
if (__val)
this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
else
this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos);
 
return *this;
}
 
bitset<_Nb>& _Unchecked_reset(size_t __pos) {
this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos);
return *this;
}
 
bitset<_Nb>& _Unchecked_flip(size_t __pos) {
this->_M_getword(__pos) ^= _Base::_S_maskbit(__pos);
return *this;
}
 
bool _Unchecked_test(size_t __pos) const {
return (this->_M_getword(__pos) & _Base::_S_maskbit(__pos))
!= static_cast<_WordT>(0);
}
 
// Set, reset, and flip.
 
bitset<_Nb>& set() {
this->_M_do_set();
this->_M_do_sanitize();
return *this;
}
 
bitset<_Nb>& set(size_t __pos, bool __val = true) {
if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
 
return _Unchecked_set(__pos, __val);
}
 
bitset<_Nb>& reset() {
this->_M_do_reset();
return *this;
}
 
bitset<_Nb>& reset(size_t __pos) {
if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
 
return _Unchecked_reset(__pos);
}
 
bitset<_Nb>& flip() {
this->_M_do_flip();
this->_M_do_sanitize();
return *this;
}
 
bitset<_Nb>& flip(size_t __pos) {
if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
 
return _Unchecked_flip(__pos);
}
 
bitset<_Nb> operator~() const {
return bitset<_Nb>(*this).flip();
}
 
// element access:
//for b[i];
reference operator[](size_t __pos) { return reference(*this,__pos); }
bool operator[](size_t __pos) const { return _Unchecked_test(__pos); }
 
unsigned long to_ulong() const { return this->_M_do_to_ulong(); }
 
template <class _CharT, class _Traits, class _Alloc>
basic_string<_CharT, _Traits, _Alloc> to_string() const {
basic_string<_CharT, _Traits, _Alloc> __result;
_M_copy_to_string(__result);
return __result;
}
 
// Helper functions for string operations.
template<class _CharT, class _Traits, class _Alloc>
void _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s,
size_t,
size_t);
 
template<class _CharT, class _Traits, class _Alloc>
void _M_copy_to_string(basic_string<_CharT,_Traits,_Alloc>&) const;
 
size_t count() const { return this->_M_do_count(); }
 
size_t size() const { return _Nb; }
 
bool operator==(const bitset<_Nb>& __rhs) const {
return this->_M_is_equal(__rhs);
}
bool operator!=(const bitset<_Nb>& __rhs) const {
return !this->_M_is_equal(__rhs);
}
 
bool test(size_t __pos) const {
if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
 
return _Unchecked_test(__pos);
}
 
bool any() const { return this->_M_is_any(); }
bool none() const { return !this->_M_is_any(); }
 
bitset<_Nb> operator<<(size_t __pos) const
{ return bitset<_Nb>(*this) <<= __pos; }
bitset<_Nb> operator>>(size_t __pos) const
{ return bitset<_Nb>(*this) >>= __pos; }
 
//
// EXTENSIONS: bit-find operations. These operations are
// experimental, and are subject to change or removal in future
// versions.
//
 
// find the index of the first "on" bit
size_t _Find_first() const
{ return this->_M_do_find_first(_Nb); }
 
// find the index of the next "on" bit after prev
size_t _Find_next( size_t __prev ) const
{ return this->_M_do_find_next(__prev, _Nb); }
 
};
 
//
// Definitions of non-inline member functions.
//
 
template <size_t _Nb>
template<class _CharT, class _Traits, class _Alloc>
void bitset<_Nb>
::_M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s,
size_t __pos,
size_t __n)
{
reset();
const size_t __nbits = min(_Nb, min(__n, __s.size() - __pos));
for (size_t __i = 0; __i < __nbits; ++__i) {
switch(__s[__pos + __nbits - __i - 1]) {
case '0':
break;
case '1':
set(__i);
break;
default:
__STL_THROW(invalid_argument("bitset"));
}
}
}
 
template <size_t _Nb>
template <class _CharT, class _Traits, class _Alloc>
void bitset<_Nb>
::_M_copy_to_string(basic_string<_CharT, _Traits, _Alloc>& __s) const
{
__s.assign(_Nb, '0');
for (size_t __i = 0; __i < _Nb; ++__i)
if (_Unchecked_test(__i))
__s[_Nb - 1 - __i] = '1';
}
 
// ------------------------------------------------------------
 
//
// 23.3.5.3 bitset operations:
//
 
template <size_t _Nb>
inline bitset<_Nb> operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) {
bitset<_Nb> __result(__x);
__result &= __y;
return __result;
}
 
 
template <size_t _Nb>
inline bitset<_Nb> operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) {
bitset<_Nb> __result(__x);
__result |= __y;
return __result;
}
 
template <size_t _Nb>
inline bitset<_Nb> operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) {
bitset<_Nb> __result(__x);
__result ^= __y;
return __result;
}
 
template <class _CharT, class _Traits, size_t _Nb>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
{
typedef typename _Traits::char_type char_type;
basic_string<_CharT, _Traits> __tmp;
__tmp.reserve(_Nb);
 
// Skip whitespace
typename basic_istream<_CharT, _Traits>::sentry __sentry(__is);
if (__sentry) {
basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf();
for (size_t __i = 0; __i < _Nb; ++__i) {
static typename _Traits::int_type __eof = _Traits::eof();
 
typename _Traits::int_type __c1 = __buf->sbumpc();
if (_Traits::eq_int_type(__c1, __eof)) {
__is.setstate(ios_base::eofbit);
break;
}
else {
char_type __c2 = _Traits::to_char_type(__c1);
char_type __c = __is.narrow(__c2, '*');
 
if (__c == '0' || __c == '1')
__tmp.push_back(__c);
else if (_Traits::eq_int_type(__buf->sputbackc(__c2), __eof)) {
__is.setstate(ios_base::failbit);
break;
}
}
}
 
if (__tmp.empty())
__is.setstate(ios_base::failbit);
else
__x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb);
}
 
return __is;
}
 
template <class _CharT, class _Traits, size_t _Nb>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x)
{
basic_string<_CharT, _Traits> __tmp;
__x._M_copy_to_string(__tmp);
return __os << __tmp;
}
 
} // namespace std
 
#undef __BITSET_WORDS
 
#endif /* __SGI_STL_BITSET */
 
 
// Local Variables:
// mode:C++
// End:
 
/contrib/media/updf/include/bits/std_complex.h
0,0 → 1,1025
// The template and inlines for the -*- C++ -*- complex number classes.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 26.2 Complex Numbers
// Note: this is not a conforming implementation.
// Initially implemented by Ulrich Drepper <drepper@cygnus.com>
// Improved by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
//
 
#ifndef _CPP_COMPLEX
#define _CPP_COMPLEX 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
#include <bits/std_cmath.h>
#include <bits/std_sstream.h>
 
namespace std
{
// Forward declarations
template<typename _Tp> class complex;
template<> class complex<float>;
template<> class complex<double>;
template<> class complex<long double>;
 
template<typename _Tp> _Tp abs(const complex<_Tp>&);
template<typename _Tp> _Tp arg(const complex<_Tp>&);
template<typename _Tp> _Tp norm(const complex<_Tp>&);
 
template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&);
template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp&);
 
// Transcendentals:
template<typename _Tp> complex<_Tp> cos(const complex<_Tp>&);
template<typename _Tp> complex<_Tp> cosh(const complex<_Tp>&);
template<typename _Tp> complex<_Tp> exp(const complex<_Tp>&);
template<typename _Tp> complex<_Tp> log(const complex<_Tp>&);
template<typename _Tp> complex<_Tp> log10(const complex<_Tp>&);
template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, int);
template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, const _Tp&);
template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&,
const complex<_Tp>&);
template<typename _Tp> complex<_Tp> pow(const _Tp&, const complex<_Tp>&);
template<typename _Tp> complex<_Tp> sin(const complex<_Tp>&);
template<typename _Tp> complex<_Tp> sinh(const complex<_Tp>&);
template<typename _Tp> complex<_Tp> sqrt(const complex<_Tp>&);
template<typename _Tp> complex<_Tp> tan(const complex<_Tp>&);
template<typename _Tp> complex<_Tp> tanh(const complex<_Tp>&);
// 26.2.2 Primary template class complex
template<typename _Tp>
class complex
{
public:
typedef _Tp value_type;
complex(const _Tp& = _Tp(), const _Tp & = _Tp());
 
// Let's the compiler synthetize the copy constructor
// complex (const complex<_Tp>&);
template<typename _Up>
complex(const complex<_Up>&);
_Tp real() const;
_Tp imag() const;
 
complex<_Tp>& operator=(const _Tp&);
complex<_Tp>& operator+=(const _Tp&);
complex<_Tp>& operator-=(const _Tp&);
complex<_Tp>& operator*=(const _Tp&);
complex<_Tp>& operator/=(const _Tp&);
 
// Let's the compiler synthetize the
// copy and assignment operator
// complex<_Tp>& operator= (const complex<_Tp>&);
template<typename _Up>
complex<_Tp>& operator=(const complex<_Up>&);
template<typename _Up>
complex<_Tp>& operator+=(const complex<_Up>&);
template<typename _Up>
complex<_Tp>& operator-=(const complex<_Up>&);
template<typename _Up>
complex<_Tp>& operator*=(const complex<_Up>&);
template<typename _Up>
complex<_Tp>& operator/=(const complex<_Up>&);
 
private:
_Tp _M_real, _M_imag;
};
 
template<typename _Tp>
inline _Tp
complex<_Tp>::real() const { return _M_real; }
 
template<typename _Tp>
inline _Tp
complex<_Tp>::imag() const { return _M_imag; }
 
template<typename _Tp>
inline
complex<_Tp>::complex(const _Tp& __r, const _Tp& __i)
: _M_real(__r), _M_imag(__i) { }
 
template<typename _Tp>
template<typename _Up>
inline
complex<_Tp>::complex(const complex<_Up>& __z)
: _M_real(__z.real()), _M_imag(__z.imag()) { }
template<typename _Tp>
complex<_Tp>&
complex<_Tp>::operator=(const _Tp& __t)
{
_M_real = __t;
_M_imag = _Tp();
return *this;
}
 
// 26.2.5/1
template<typename _Tp>
inline complex<_Tp>&
complex<_Tp>::operator+=(const _Tp& __t)
{
_M_real += __t;
return *this;
}
 
// 26.2.5/3
template<typename _Tp>
inline complex<_Tp>&
complex<_Tp>::operator-=(const _Tp& __t)
{
_M_real -= __t;
return *this;
}
 
// 26.2.5/5
template<typename _Tp>
complex<_Tp>&
complex<_Tp>::operator*=(const _Tp& __t)
{
_M_real *= __t;
_M_imag *= __t;
return *this;
}
 
// 26.2.5/7
template<typename _Tp>
complex<_Tp>&
complex<_Tp>::operator/=(const _Tp& __t)
{
_M_real /= __t;
_M_imag /= __t;
return *this;
}
 
template<typename _Tp>
template<typename _Up>
complex<_Tp>&
complex<_Tp>::operator=(const complex<_Up>& __z)
{
_M_real = __z.real();
_M_imag = __z.imag();
return *this;
}
 
// 26.2.5/9
template<typename _Tp>
template<typename _Up>
complex<_Tp>&
complex<_Tp>::operator+=(const complex<_Up>& __z)
{
_M_real += __z.real();
_M_imag += __z.imag();
return *this;
}
 
// 26.2.5/11
template<typename _Tp>
template<typename _Up>
complex<_Tp>&
complex<_Tp>::operator-=(const complex<_Up>& __z)
{
_M_real -= __z.real();
_M_imag -= __z.imag();
return *this;
}
 
// 26.2.5/13
// XXX: This is a grammar school implementation.
template<typename _Tp>
template<typename _Up>
complex<_Tp>&
complex<_Tp>::operator*=(const complex<_Up>& __z)
{
const _Tp __r = _M_real * __z.real() - _M_imag * __z.imag();
_M_imag = _M_real * __z.imag() + _M_imag * __z.real();
_M_real = __r;
return *this;
}
 
// 26.2.5/15
// XXX: This is a grammar school implementation.
template<typename _Tp>
template<typename _Up>
complex<_Tp>&
complex<_Tp>::operator/=(const complex<_Up>& __z)
{
const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag();
const _Tp __n = norm(__z);
_M_imag = (_M_real * __z.imag() - _M_imag * __z.real()) / __n;
_M_real = __r / __n;
return *this;
}
// Operators:
template<typename _Tp>
inline complex<_Tp>
operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
{ return complex<_Tp> (__x) += __y; }
 
template<typename _Tp>
inline complex<_Tp>
operator+(const complex<_Tp>& __x, const _Tp& __y)
{ return complex<_Tp> (__x) += __y; }
 
template<typename _Tp>
inline complex<_Tp>
operator+(const _Tp& __x, const complex<_Tp>& __y)
{ return complex<_Tp> (__y) += __x; }
 
template<typename _Tp>
inline complex<_Tp>
operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
{ return complex<_Tp> (__x) -= __y; }
template<typename _Tp>
inline complex<_Tp>
operator-(const complex<_Tp>& __x, const _Tp& __y)
{ return complex<_Tp> (__x) -= __y; }
 
template<typename _Tp>
inline complex<_Tp>
operator-(const _Tp& __x, const complex<_Tp>& __y)
{ return complex<_Tp> (__x) -= __y; }
 
template<typename _Tp>
inline complex<_Tp>
operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
{ return complex<_Tp> (__x) *= __y; }
 
template<typename _Tp>
inline complex<_Tp>
operator*(const complex<_Tp>& __x, const _Tp& __y)
{ return complex<_Tp> (__x) *= __y; }
 
template<typename _Tp>
inline complex<_Tp>
operator*(const _Tp& __x, const complex<_Tp>& __y)
{ return complex<_Tp> (__y) *= __x; }
 
template<typename _Tp>
inline complex<_Tp>
operator/(const complex<_Tp>& __x, const complex<_Tp>& __y)
{ return complex<_Tp> (__x) /= __y; }
template<typename _Tp>
inline complex<_Tp>
operator/(const complex<_Tp>& __x, const _Tp& __y)
{ return complex<_Tp> (__x) /= __y; }
 
template<typename _Tp>
inline complex<_Tp>
operator/(const _Tp& __x, const complex<_Tp>& __y)
{ return complex<_Tp> (__x) /= __y; }
 
template<typename _Tp>
inline complex<_Tp>
operator+(const complex<_Tp>& __x)
{ return __x; }
 
template<typename _Tp>
inline complex<_Tp>
operator-(const complex<_Tp>& __x)
{ return complex<_Tp>(-__x.real(), -__x.imag()); }
 
template<typename _Tp>
inline bool
operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
{ return __x.real() == __y.real() && __x.imag() == __y.imag(); }
 
template<typename _Tp>
inline bool
operator==(const complex<_Tp>& __x, const _Tp& __y)
{ return __x.real() == __y && __x.imag() == _Tp(); }
 
template<typename _Tp>
inline bool
operator==(const _Tp& __x, const complex<_Tp>& __y)
{ return __x == __y.real() && _Tp() == __y.imag(); }
 
template<typename _Tp>
inline bool
operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
{ return __x.real() != __y.real() || __x.imag() != __y.imag(); }
 
template<typename _Tp>
inline bool
operator!=(const complex<_Tp>& __x, const _Tp& __y)
{ return __x.real() != __y || __x.imag() != _Tp(); }
 
template<typename _Tp>
inline bool
operator!=(const _Tp& __x, const complex<_Tp>& __y)
{ return __x != __y.real() || _Tp() != __y.imag(); }
 
template<typename _Tp, typename _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
{
_Tp __re_x, __im_x;
_CharT __ch;
__is >> __ch;
if (__ch == '(')
{
__is >> __re_x >> __ch;
if (__ch == ',')
{
__is >> __im_x >> __ch;
if (__ch == ')')
__x = complex<_Tp>(__re_x, __im_x);
else
__is.setstate(ios_base::failbit);
}
else if (__ch == ')')
__x = complex<_Tp>(__re_x, _Tp(0));
else
__is.setstate(ios_base::failbit);
}
else
{
__is.putback(__ch);
__is >> __re_x;
__x = complex<_Tp>(__re_x, _Tp(0));
}
return __is;
}
 
template<typename _Tp, typename _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
{
basic_ostringstream<_CharT, _Traits> __s;
__s.flags(__os.flags());
__s.imbue(__os.getloc());
__s.precision(__os.precision());
__s << '(' << __x.real() << "," << __x.imag() << ')';
return __os << __s.str();
}
 
// Values
template<typename _Tp>
inline _Tp
real(const complex<_Tp>& __z)
{ return __z.real(); }
template<typename _Tp>
inline _Tp
imag(const complex<_Tp>& __z)
{ return __z.imag(); }
 
template<typename _Tp>
inline _Tp
abs(const complex<_Tp>& __z)
{
_Tp __x = __z.real();
_Tp __y = __z.imag();
const _Tp __s = abs(__x) + abs(__y);
if (__s == _Tp()) // well ...
return __s;
__x /= __s;
__y /= __s;
return __s * sqrt(__x * __x + __y * __y);
}
 
template<typename _Tp>
inline _Tp
arg(const complex<_Tp>& __z)
{ return atan2(__z.imag(), __z.real()); }
 
template<typename _Tp>
inline _Tp
norm(const complex<_Tp>& __z)
{
_Tp __res = abs(__z);
return __res * __res;
}
 
template<typename _Tp>
inline complex<_Tp>
polar(const _Tp& __rho, const _Tp& __theta)
{ return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); }
 
template<typename _Tp>
inline complex<_Tp>
conj(const complex<_Tp>& __z)
{ return complex<_Tp>(__z.real(), -__z.imag()); }
// Transcendentals
template<typename _Tp>
inline complex<_Tp>
cos(const complex<_Tp>& __z)
{
const _Tp __x = __z.real();
const _Tp __y = __z.imag();
return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y));
}
 
template<typename _Tp>
inline complex<_Tp>
cosh(const complex<_Tp>& __z)
{
const _Tp __x = __z.real();
const _Tp __y = __z.imag();
return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y));
}
 
template<typename _Tp>
inline complex<_Tp>
exp(const complex<_Tp>& __z)
{ return polar(exp(__z.real()), __z.imag()); }
 
template<typename _Tp>
inline complex<_Tp>
log(const complex<_Tp>& __z)
{ return complex<_Tp>(log(abs(__z)), arg(__z)); }
 
template<typename _Tp>
inline complex<_Tp>
log10(const complex<_Tp>& __z)
{ return log(__z) / log(_Tp(10.0)); }
 
template<typename _Tp>
inline complex<_Tp>
sin(const complex<_Tp>& __z)
{
const _Tp __x = __z.real();
const _Tp __y = __z.imag();
return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y));
}
 
template<typename _Tp>
inline complex<_Tp>
sinh(const complex<_Tp>& __z)
{
const _Tp __x = __z.real();
const _Tp __y = __z.imag();
return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y));
}
 
template<typename _Tp>
complex<_Tp>
sqrt(const complex<_Tp>& __z)
{
_Tp __x = __z.real();
_Tp __y = __z.imag();
 
if (__x == _Tp())
{
_Tp __t = sqrt(abs(__y) / 2);
return complex<_Tp>(__t, __y < _Tp() ? -__t : __t);
}
else
{
_Tp __t = sqrt(2 * (abs(__z) + abs(__x)));
_Tp __u = __t / 2;
return __x > _Tp()
? complex<_Tp>(__u, __y / __t)
: complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u);
}
}
 
template<typename _Tp>
inline complex<_Tp>
tan(const complex<_Tp>& __z)
{
return sin(__z) / cos(__z);
}
 
template<typename _Tp>
inline complex<_Tp>
tanh(const complex<_Tp>& __z)
{
return sinh(__z) / cosh(__z);
}
 
template<typename _Tp>
inline complex<_Tp>
pow(const complex<_Tp>& __z, int __n)
{
return __pow_helper(__z, __n);
}
 
template<typename _Tp>
inline complex<_Tp>
pow(const complex<_Tp>& __x, const _Tp& __y)
{
return exp(__y * log(__x));
}
 
template<typename _Tp>
inline complex<_Tp>
pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
{
return exp(__y * log(__x));
}
 
template<typename _Tp>
inline complex<_Tp>
pow(const _Tp& __x, const complex<_Tp>& __y)
{
return exp(__y * log(__x));
}
 
// 26.2.3 complex specializations
// complex<float> specialization
template<> class complex<float>
{
public:
typedef float value_type;
complex(float = 0.0f, float = 0.0f);
#ifdef _GLIBCPP_BUGGY_COMPLEX
complex(const complex& __z) : _M_value(__z._M_value) { }
#endif
explicit complex(const complex<double>&);
explicit complex(const complex<long double>&);
 
float real() const;
float imag() const;
 
complex<float>& operator=(float);
complex<float>& operator+=(float);
complex<float>& operator-=(float);
complex<float>& operator*=(float);
complex<float>& operator/=(float);
// Let's the compiler synthetize the copy and assignment
// operator. It always does a pretty good job.
// complex& operator= (const complex&);
template<typename _Tp>
complex<float>&operator=(const complex<_Tp>&);
template<typename _Tp>
complex<float>& operator+=(const complex<_Tp>&);
template<class _Tp>
complex<float>& operator-=(const complex<_Tp>&);
template<class _Tp>
complex<float>& operator*=(const complex<_Tp>&);
template<class _Tp>
complex<float>&operator/=(const complex<_Tp>&);
 
private:
typedef __complex__ float _ComplexT;
_ComplexT _M_value;
 
complex(_ComplexT __z) : _M_value(__z) { }
friend class complex<double>;
friend class complex<long double>;
};
 
inline float
complex<float>::real() const
{ return __real__ _M_value; }
 
inline float
complex<float>::imag() const
{ return __imag__ _M_value; }
 
inline
complex<float>::complex(float r, float i)
{
__real__ _M_value = r;
__imag__ _M_value = i;
}
 
inline complex<float>&
complex<float>::operator=(float __f)
{
__real__ _M_value = __f;
__imag__ _M_value = 0.0f;
return *this;
}
 
inline complex<float>&
complex<float>::operator+=(float __f)
{
__real__ _M_value += __f;
return *this;
}
 
inline complex<float>&
complex<float>::operator-=(float __f)
{
__real__ _M_value -= __f;
return *this;
}
 
inline complex<float>&
complex<float>::operator*=(float __f)
{
_M_value *= __f;
return *this;
}
 
inline complex<float>&
complex<float>::operator/=(float __f)
{
_M_value /= __f;
return *this;
}
 
template<typename _Tp>
inline complex<float>&
complex<float>::operator=(const complex<_Tp>& __z)
{
__real__ _M_value = __z.real();
__imag__ _M_value = __z.imag();
return *this;
}
 
template<typename _Tp>
inline complex<float>&
complex<float>::operator+=(const complex<_Tp>& __z)
{
__real__ _M_value += __z.real();
__imag__ _M_value += __z.imag();
return *this;
}
template<typename _Tp>
inline complex<float>&
complex<float>::operator-=(const complex<_Tp>& __z)
{
__real__ _M_value -= __z.real();
__imag__ _M_value -= __z.imag();
return *this;
}
 
template<typename _Tp>
inline complex<float>&
complex<float>::operator*=(const complex<_Tp>& __z)
{
_ComplexT __t;
__real__ __t = __z.real();
__imag__ __t = __z.imag();
_M_value *= __t;
return *this;
}
 
template<typename _Tp>
inline complex<float>&
complex<float>::operator/=(const complex<_Tp>& __z)
{
_ComplexT __t;
__real__ __t = __z.real();
__imag__ __t = __z.imag();
_M_value /= __t;
return *this;
}
 
// 26.2.3 complex specializations
// complex<double> specialization
template<> class complex<double>
{
public:
typedef double value_type;
 
complex(double =0.0, double =0.0);
#ifdef _GLIBCPP_BUGGY_COMPLEX
complex(const complex& __z) : _M_value(__z._M_value) { }
#endif
complex(const complex<float>&);
explicit complex(const complex<long double>&);
double real() const;
double imag() const;
complex<double>& operator=(double);
complex<double>& operator+=(double);
complex<double>& operator-=(double);
complex<double>& operator*=(double);
complex<double>& operator/=(double);
 
// The compiler will synthetize this, efficiently.
// complex& operator= (const complex&);
template<typename _Tp>
complex<double>& operator=(const complex<_Tp>&);
template<typename _Tp>
complex<double>& operator+=(const complex<_Tp>&);
template<typename _Tp>
complex<double>& operator-=(const complex<_Tp>&);
template<typename _Tp>
complex<double>& operator*=(const complex<_Tp>&);
template<typename _Tp>
complex<double>& operator/=(const complex<_Tp>&);
 
private:
typedef __complex__ double _ComplexT;
_ComplexT _M_value;
 
complex(_ComplexT __z) : _M_value(__z) { }
friend class complex<float>;
friend class complex<long double>;
};
 
inline double
complex<double>::real() const
{ return __real__ _M_value; }
 
inline double
complex<double>::imag() const
{ return __imag__ _M_value; }
 
inline
complex<double>::complex(double __r, double __i)
{
__real__ _M_value = __r;
__imag__ _M_value = __i;
}
 
inline complex<double>&
complex<double>::operator=(double __d)
{
__real__ _M_value = __d;
__imag__ _M_value = 0.0;
return *this;
}
 
inline complex<double>&
complex<double>::operator+=(double __d)
{
__real__ _M_value += __d;
return *this;
}
 
inline complex<double>&
complex<double>::operator-=(double __d)
{
__real__ _M_value -= __d;
return *this;
}
 
inline complex<double>&
complex<double>::operator*=(double __d)
{
_M_value *= __d;
return *this;
}
 
inline complex<double>&
complex<double>::operator/=(double __d)
{
_M_value /= __d;
return *this;
}
 
template<typename _Tp>
inline complex<double>&
complex<double>::operator=(const complex<_Tp>& __z)
{
__real__ _M_value = __z.real();
__imag__ _M_value = __z.imag();
return *this;
}
template<typename _Tp>
inline complex<double>&
complex<double>::operator+=(const complex<_Tp>& __z)
{
__real__ _M_value += __z.real();
__imag__ _M_value += __z.imag();
return *this;
}
 
template<typename _Tp>
inline complex<double>&
complex<double>::operator-=(const complex<_Tp>& __z)
{
__real__ _M_value -= __z.real();
__imag__ _M_value -= __z.imag();
return *this;
}
 
template<typename _Tp>
inline complex<double>&
complex<double>::operator*=(const complex<_Tp>& __z)
{
_ComplexT __t;
__real__ __t = __z.real();
__imag__ __t = __z.imag();
_M_value *= __t;
return *this;
}
 
template<typename _Tp>
inline complex<double>&
complex<double>::operator/=(const complex<_Tp>& __z)
{
_ComplexT __t;
__real__ __t = __z.real();
__imag__ __t = __z.imag();
_M_value /= __t;
return *this;
}
 
// 26.2.3 complex specializations
// complex<long double> specialization
template<> class complex<long double>
{
public:
typedef long double value_type;
 
complex(long double = 0.0L, long double = 0.0L);
#ifdef _GLIBCPP_BUGGY_COMPLEX
complex(const complex& __z) : _M_value(__z._M_value) { }
#endif
complex(const complex<float>&);
complex(const complex<double>&);
 
long double real() const;
long double imag() const;
 
complex<long double>& operator= (long double);
complex<long double>& operator+= (long double);
complex<long double>& operator-= (long double);
complex<long double>& operator*= (long double);
complex<long double>& operator/= (long double);
 
// The compiler knows how to do this efficiently
// complex& operator= (const complex&);
template<typename _Tp>
complex<long double>& operator=(const complex<_Tp>&);
template<typename _Tp>
complex<long double>& operator+=(const complex<_Tp>&);
template<typename _Tp>
complex<long double>& operator-=(const complex<_Tp>&);
template<typename _Tp>
complex<long double>& operator*=(const complex<_Tp>&);
template<typename _Tp>
complex<long double>& operator/=(const complex<_Tp>&);
 
private:
typedef __complex__ long double _ComplexT;
_ComplexT _M_value;
 
complex(_ComplexT __z) : _M_value(__z) { }
 
friend class complex<float>;
friend class complex<double>;
};
 
inline
complex<long double>::complex(long double __r, long double __i)
{
__real__ _M_value = __r;
__imag__ _M_value = __i;
}
 
inline long double
complex<long double>::real() const
{ return __real__ _M_value; }
 
inline long double
complex<long double>::imag() const
{ return __imag__ _M_value; }
 
inline complex<long double>&
complex<long double>::operator=(long double __r)
{
__real__ _M_value = __r;
__imag__ _M_value = 0.0L;
return *this;
}
 
inline complex<long double>&
complex<long double>::operator+=(long double __r)
{
__real__ _M_value += __r;
return *this;
}
 
inline complex<long double>&
complex<long double>::operator-=(long double __r)
{
__real__ _M_value -= __r;
return *this;
}
 
inline complex<long double>&
complex<long double>::operator*=(long double __r)
{
__real__ _M_value *= __r;
return *this;
}
 
inline complex<long double>&
complex<long double>::operator/=(long double __r)
{
__real__ _M_value /= __r;
return *this;
}
 
template<typename _Tp>
inline complex<long double>&
complex<long double>::operator=(const complex<_Tp>& __z)
{
__real__ _M_value = __z.real();
__imag__ _M_value = __z.imag();
return *this;
}
 
template<typename _Tp>
inline complex<long double>&
complex<long double>::operator+=(const complex<_Tp>& __z)
{
__real__ _M_value += __z.real();
__imag__ _M_value += __z.imag();
return *this;
}
 
template<typename _Tp>
inline complex<long double>&
complex<long double>::operator-=(const complex<_Tp>& __z)
{
__real__ _M_value -= __z.real();
__imag__ _M_value -= __z.imag();
return *this;
}
template<typename _Tp>
inline complex<long double>&
complex<long double>::operator*=(const complex<_Tp>& __z)
{
_ComplexT __t;
__real__ __t = __z.real();
__imag__ __t = __z.imag();
_M_value *= __t;
return *this;
}
 
template<typename _Tp>
inline complex<long double>&
complex<long double>::operator/=(const complex<_Tp>& __z)
{
_ComplexT __t;
__real__ __t = __z.real();
__imag__ __t = __z.imag();
_M_value /= __t;
return *this;
}
 
// These bits have to be at the end of this file, so that the
// specializations have all been defined.
// ??? No, they have to be there because of compiler limitation at
// inlining. It suffices that class specializations be defined.
inline
complex<float>::complex(const complex<double>& __z)
: _M_value(_ComplexT(__z._M_value)) { }
 
inline
complex<float>::complex(const complex<long double>& __z)
: _M_value(_ComplexT(__z._M_value)) { }
 
inline
complex<double>::complex(const complex<float>& __z)
: _M_value(_ComplexT(__z._M_value)) { }
 
inline
complex<double>::complex(const complex<long double>& __z)
{
__real__ _M_value = __z.real();
__imag__ _M_value = __z.imag();
}
 
inline
complex<long double>::complex(const complex<float>& __z)
: _M_value(_ComplexT(__z._M_value)) { }
 
inline
complex<long double>::complex(const complex<double>& __z)
: _M_value(_ComplexT(__z._M_value)) { }
} // namespace std
 
#endif /* _CPP_COMPLEX */
/contrib/media/updf/include/bits/std_deque.h
0,0 → 1,43
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_DEQUE
#define _CPP_DEQUE 1
 
#pragma GCC system_header
 
#include <bits/functexcept.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_deque.h>
 
#endif /* _CPP_DEQUE */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/std_fstream.h
0,0 → 1,425
// File based streams -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.8 File-based streams
//
 
#ifndef _CPP_FSTREAM
#define _CPP_FSTREAM 1
 
#pragma GCC system_header
 
#include <bits/std_istream.h>
#include <bits/std_ostream.h>
#include <bits/basic_file.h>
#include <bits/std_locale.h> // For codecvt
#include <bits/gthr.h>
 
namespace std
{
template<typename _CharT, typename _Traits>
class basic_filebuf : public basic_streambuf<_CharT, _Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
// Non-standard Types:
typedef basic_streambuf<char_type, traits_type> __streambuf_type;
typedef basic_filebuf<char_type, traits_type> __filebuf_type;
typedef __basic_file<char_type> __file_type;
typedef typename traits_type::state_type __state_type;
typedef codecvt<char_type, char, __state_type> __codecvt_type;
typedef typename __codecvt_type::result __res_type;
typedef ctype<char_type> __ctype_type;
 
friend class ios_base; // For sync_with_stdio.
 
private:
// Data Members:
// External buffer.
__file_type* _M_file;
 
// Current and beginning state type for codecvt.
__state_type _M_state_cur;
__state_type _M_state_beg;
 
// MT lock inherited from libio or other low-level io library.
__c_lock _M_lock;
 
// Set iff _M_buf is allocated memory from _M_allocate_internal_buffer..
bool _M_buf_allocated;
 
// XXX Needed?
bool _M_last_overflowed;
public:
// Constructors/destructor:
basic_filebuf();
 
// Non-standard ctor:
basic_filebuf(__c_file_type* __f, ios_base::openmode __mode,
int_type __s = static_cast<int_type>(BUFSIZ));
virtual
~basic_filebuf()
{
this->close();
_M_last_overflowed = false;
}
 
// Members:
bool
is_open(void) const { return _M_file ? _M_file->is_open() : false; }
__filebuf_type*
open(const char* __s, ios_base::openmode __mode);
__filebuf_type*
close(void);
 
protected:
void
_M_allocate_internal_buffer();
 
void
_M_destroy_internal_buffer();
 
void
_M_allocate_pback_buffer();
 
// Create __file_type object and initialize it properly.
void
_M_allocate_file();
 
// Overridden virtual functions:
virtual streamsize
showmanyc(void);
// Stroustrup, 1998, p. 628
// underflow() and uflow() functions are called to get the next
// charater from the real input source when the buffer is empty.
// Buffered input uses underflow()
virtual int_type
underflow(void);
 
virtual int_type
pbackfail(int_type __c = _Traits::eof());
 
// NB: For what the standard expects of the overflow function,
// see _M_really_overflow(), below. Because basic_streambuf's
// sputc/sputn call overflow directly, and the complications of
// this implementation's setting of the initial pointers all
// equal to _M_buf when initializing, it seems essential to have
// this in actuality be a helper function that checks for the
// eccentricities of this implementation, and then call
// overflow() if indeed the buffer is full.
virtual int_type
overflow(int_type __c = _Traits::eof());
 
// Stroustrup, 1998, p 648
// The overflow() function is called to transfer characters to the
// real output destination when the buffer is full. A call to
// overflow(c) outputs the contents of the buffer plus the
// character c.
// 27.5.2.4.5
// Consume some sequence of the characters in the pending sequence.
int_type
_M_really_overflow(int_type __c = _Traits::eof());
virtual __streambuf_type*
setbuf(char_type* __s, streamsize __n);
virtual pos_type
seekoff(off_type __off, ios_base::seekdir __way,
ios_base::openmode __mode = ios_base::in | ios_base::out);
 
virtual pos_type
seekpos(pos_type __pos,
ios_base::openmode __mode = ios_base::in | ios_base::out);
 
virtual int
sync(void)
{
bool __testput = _M_out_cur && _M_out_beg < _M_out_end;
if (__testput)
{
// Make sure that libio resyncs its idea of the file position
// with the external file.
_M_file->sync();
 
// Need to restore current position. This interpreted as
// the position of the external byte sequence (_M_file)
// plus the offset in the current internal buffer
// (_M_out_beg - _M_out_cur)
streamoff __cur = _M_file->seekoff(0, ios_base::cur);
off_type __off = _M_out_cur - _M_out_beg;
_M_really_overflow();
_M_file->seekpos(__cur + __off);
}
_M_last_overflowed = false;
return 0;
}
virtual void
imbue(const locale& __loc);
 
virtual streamsize
xsgetn(char_type* __s, streamsize __n)
{
streamsize __ret = 0;
// Clear out pback buffer before going on to the real deal...
if (_M_pback_init)
{
while (__ret < __n && _M_in_cur < _M_in_end)
{
*__s = *_M_in_cur;
++__ret;
++__s;
++_M_in_cur;
}
_M_pback_destroy();
}
if (__ret < __n)
__ret += __streambuf_type::xsgetn(__s, __n - __ret);
return __ret;
}
virtual streamsize
xsputn(const char_type* __s, streamsize __n)
{
_M_pback_destroy();
return __streambuf_type::xsputn(__s, __n);
}
void
_M_output_unshift();
};
 
 
// 27.8.1.5 Template class basic_ifstream
template<typename _CharT, typename _Traits>
class basic_ifstream : public basic_istream<_CharT, _Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
 
// Non-standard types:
typedef basic_filebuf<char_type, traits_type> __filebuf_type;
typedef basic_istream<char_type, traits_type> __istream_type;
private:
__filebuf_type _M_filebuf;
 
public:
// Constructors/Destructors:
basic_ifstream()
: __istream_type(NULL), _M_filebuf()
{ this->init(&_M_filebuf); }
 
explicit
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
: __istream_type(NULL), _M_filebuf()
{
this->init(&_M_filebuf);
this->open(__s, __mode);
}
~basic_ifstream()
{ }
 
// Members:
__filebuf_type*
rdbuf() const
{ return const_cast<__filebuf_type*>(&_M_filebuf); }
 
bool
is_open(void) { return _M_filebuf.is_open(); }
 
void
open(const char* __s, ios_base::openmode __mode = ios_base::in)
{
if (_M_filebuf.open(__s, __mode | ios_base::in) == NULL)
this->setstate(ios_base::failbit);
}
 
void
close(void)
{
if (!_M_filebuf.close())
this->setstate(ios_base::failbit);
}
};
 
// 27.8.1.8 Template class basic_ofstream
template<typename _CharT, typename _Traits>
class basic_ofstream : public basic_ostream<_CharT,_Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
 
// Non-standard types:
typedef basic_filebuf<char_type, traits_type> __filebuf_type;
typedef basic_ostream<char_type, traits_type> __ostream_type;
private:
__filebuf_type _M_filebuf;
 
public:
// Constructors:
basic_ofstream()
: __ostream_type(NULL), _M_filebuf()
{ this->init(&_M_filebuf); }
explicit
basic_ofstream(const char* __s,
ios_base::openmode __mode = ios_base::out|ios_base::trunc)
: __ostream_type(NULL), _M_filebuf()
{
this->init(&_M_filebuf);
this->open(__s, __mode);
}
 
~basic_ofstream()
{ }
 
// Members:
__filebuf_type*
rdbuf(void) const
{ return const_cast<__filebuf_type*>(&_M_filebuf); }
bool
is_open(void) { return _M_filebuf.is_open(); }
 
void
open(const char* __s,
ios_base::openmode __mode = ios_base::out | ios_base::trunc)
{
if (!_M_filebuf.open(__s, __mode | ios_base::out))
this->setstate(ios_base::failbit);
}
 
void
close(void)
{
if (!_M_filebuf.close())
setstate(ios_base::failbit);
}
};
 
 
// 27.8.1.11 Template class basic_fstream
template<typename _CharT, typename _Traits>
class basic_fstream : public basic_iostream<_CharT, _Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
 
// Non-standard types:
typedef basic_filebuf<char_type, traits_type> __filebuf_type;
typedef basic_ios<char_type, traits_type> __ios_type;
typedef basic_iostream<char_type, traits_type> __iostream_type;
 
private:
__filebuf_type _M_filebuf;
public:
// Constructors/destructor:
basic_fstream()
: __iostream_type(NULL), _M_filebuf()
{ this->init(&_M_filebuf); }
 
explicit
basic_fstream(const char* __s,
ios_base::openmode __mode = ios_base::in | ios_base::out)
: __iostream_type(NULL), _M_filebuf()
{
this->init(&_M_filebuf);
this->open(__s, __mode);
}
~basic_fstream()
{ }
// Members:
__filebuf_type*
rdbuf(void) const
{ return const_cast<__filebuf_type*>(&_M_filebuf); }
 
bool
is_open(void) { return _M_filebuf.is_open(); }
 
void
open(const char* __s,
ios_base::openmode __mode = ios_base::in | ios_base::out)
{
if (!_M_filebuf.open(__s, __mode))
setstate(ios_base::failbit);
}
 
void
close(void)
{
if (!_M_filebuf.close())
setstate(ios_base::failbit);
}
};
} // namespace std
 
 
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/fstream.tcc>
#endif
#endif
 
#endif
 
/contrib/media/updf/include/bits/std_functional.h
0,0 → 1,28
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
#ifndef _CPP_FUNCTIONAL
#define _CPP_FUNCTIONAL 1
 
#pragma GCC system_header
#include <bits/c++config.h>
#include <bits/std_cstddef.h>
#include <bits/stl_function.h>
 
#endif /* _CPP_FUNCTIONAL */
 
// Local Variables:
// mode:C++
// End:
 
/contrib/media/updf/include/bits/std_iomanip.h
0,0 → 1,218
// Standard stream manipulators -*- C++ -*-
 
// Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.6.3 Standard manipulators
//
 
#ifndef _CPP_IOMANIP
#define _CPP_IOMANIP 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
#include <bits/std_istream.h>
#include <bits/std_functional.h>
 
namespace std
{
 
struct _Resetiosflags { ios_base::fmtflags _M_mask; };
 
inline _Resetiosflags
resetiosflags(ios_base::fmtflags __mask)
{
_Resetiosflags __x;
__x._M_mask = __mask;
return __x;
}
 
template <class _CharT, class _Traits>
basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Resetiosflags __f)
{
__is.setf(ios_base::fmtflags(0), __f._M_mask);
return __is;
}
 
template <class _CharT, class _Traits>
basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Resetiosflags __f)
{
__os.setf(ios_base::fmtflags(0), __f._M_mask);
return __os;
}
 
 
struct _Setiosflags { ios_base::fmtflags _M_mask; };
 
inline _Setiosflags
setiosflags (ios_base::fmtflags __mask)
{
_Setiosflags __x;
__x._M_mask = __mask;
return __x;
}
 
template <class _CharT, class _Traits>
basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Setiosflags __f)
{
__is.setf(__f._M_mask);
return __is;
}
 
template <class _CharT, class _Traits>
basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setiosflags __f)
{
__os.setf(__f._M_mask);
return __os;
}
 
 
struct _Setbase { int _M_base; };
 
inline _Setbase
setbase (int __base)
{
_Setbase __x;
__x._M_base = __base;
return __x;
}
 
template <class _CharT, class _Traits>
basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Setbase __f)
{
__is.setf(__f._M_base == 8 ? ios_base::oct :
__f._M_base == 10 ? ios_base::dec :
__f._M_base == 16 ? ios_base::hex :
ios_base::fmtflags(0), ios_base::basefield);
return __is;
}
template <class _CharT, class _Traits>
basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setbase __f)
{
__os.setf(__f._M_base == 8 ? ios_base::oct :
__f._M_base == 10 ? ios_base::dec :
__f._M_base == 16 ? ios_base::hex :
ios_base::fmtflags(0), ios_base::basefield);
return __os;
}
 
template<class _CharT>
struct _Setfill { _CharT _M_c; };
 
template<class _CharT>
_Setfill<_CharT>
setfill(_CharT __c)
{
_Setfill<_CharT> __x;
__x._M_c = __c;
return __x;
}
 
template <class _CharT, class _Traits>
basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Setfill<_CharT> __f)
{
__is.fill(__f._M_c);
return __is;
}
 
template <class _CharT, class _Traits>
basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setfill<_CharT> __f)
{
__os.fill(__f._M_c);
return __os;
}
 
 
struct _Setprecision { int _M_n; };
 
inline _Setprecision
setprecision(int __n)
{
_Setprecision __x;
__x._M_n = __n;
return __x;
}
 
template <class _CharT, class _Traits>
basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Setprecision __f)
{
__is.precision(__f._M_n);
return __is;
}
 
template <class _CharT, class _Traits>
basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setprecision __f)
{
__os.precision(__f._M_n);
return __os;
}
 
 
struct _Setw { int _M_n; };
 
inline _Setw
setw(int __n)
{
_Setw __x;
__x._M_n = __n;
return __x;
}
 
template <class _CharT, class _Traits>
basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Setw __f)
{
__is.width(__f._M_n);
return __is;
}
 
template <class _CharT, class _Traits>
basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setw __f)
{
__os.width(__f._M_n);
return __os;
}
 
} // namespace std
 
#endif /* __IOMANIP */
 
/contrib/media/updf/include/bits/std_ios.h
0,0 → 1,49
// Iostreams base classes -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.4 Iostreams base classes
//
 
#ifndef _CPP_IOS
#define _CPP_IOS 1
 
#pragma GCC system_header
 
#include <bits/std_iosfwd.h>
#include <exception> // For ios_base::failure
#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos
#include <bits/std_cstdio.h> // For SEEK_SET, SEEK_CUR, SEEK_END
#include <bits/localefwd.h> // For class locale
#include <bits/ios_base.h> // For ios_base declarations.
#include <bits/std_streambuf.h>
#include <bits/basic_ios.h>
 
#endif /* _CPP_IOS */
 
/contrib/media/updf/include/bits/std_iosfwd.h
0,0 → 1,136
// Forwarding declarations -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.2 Forward declarations
//
 
#ifndef _CPP_IOSFWD
#define _CPP_IOSFWD 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
#include <bits/stringfwd.h> // For string forward declarations.
#include <bits/fpos.h>
#include <bits/functexcept.h>
 
namespace std
{
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ios;
 
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_streambuf;
 
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_istream;
 
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ostream;
 
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_iostream;
 
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_stringbuf;
 
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_istringstream;
 
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_ostringstream;
 
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_stringstream;
 
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_filebuf;
 
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ifstream;
 
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ofstream;
 
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_fstream;
 
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class istreambuf_iterator;
 
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class ostreambuf_iterator;
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// Not included.
class ios_base;
#endif
 
typedef basic_ios<char> ios;
typedef basic_streambuf<char> streambuf;
typedef basic_istream<char> istream;
typedef basic_ostream<char> ostream;
typedef basic_iostream<char> iostream;
typedef basic_stringbuf<char> stringbuf;
typedef basic_istringstream<char> istringstream;
typedef basic_ostringstream<char> ostringstream;
typedef basic_stringstream<char> stringstream;
typedef basic_filebuf<char> filebuf;
typedef basic_ifstream<char> ifstream;
typedef basic_ofstream<char> ofstream;
typedef basic_fstream<char> fstream;
 
#ifdef _GLIBCPP_USE_WCHAR_T
typedef basic_ios<wchar_t> wios;
typedef basic_streambuf<wchar_t> wstreambuf;
typedef basic_istream<wchar_t> wistream;
typedef basic_ostream<wchar_t> wostream;
typedef basic_iostream<wchar_t> wiostream;
typedef basic_stringbuf<wchar_t> wstringbuf;
typedef basic_istringstream<wchar_t> wistringstream;
typedef basic_ostringstream<wchar_t> wostringstream;
typedef basic_stringstream<wchar_t> wstringstream;
typedef basic_filebuf<wchar_t> wfilebuf;
typedef basic_ifstream<wchar_t> wifstream;
typedef basic_ofstream<wchar_t> wofstream;
typedef basic_fstream<wchar_t> wfstream;
#endif
} // namespace std
 
#endif // _CPP_IOSFWD
 
 
 
 
 
/contrib/media/updf/include/bits/std_iostream.h
0,0 → 1,62
// Standard iostream objects -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.3 Standard iostream objects
//
 
#ifndef _CPP_IOSTREAM
#define _CPP_IOSTREAM 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
#include <bits/std_ostream.h>
#include <bits/std_istream.h>
 
namespace std
{
extern istream cin;
extern ostream cout;
extern ostream cerr;
extern ostream clog;
#ifdef _GLIBCPP_USE_WCHAR_T
extern wistream wcin;
extern wostream wcout;
extern wostream wcerr;
extern wostream wclog;
#endif
 
// For construction of filebuffers for cout, cin, cerr, clog et. al.
static ios_base::Init __ioinit;
} // namespace std
 
#endif
 
 
/contrib/media/updf/include/bits/std_istream.h
0,0 → 1,295
// Input streams -*- C++ -*-
 
// Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.6.1 Input streams
//
 
#ifndef _CPP_ISTREAM
#define _CPP_ISTREAM 1
 
#pragma GCC system_header
 
#include <bits/std_ios.h>
#include <bits/std_limits.h> // For numeric_limits
 
namespace std
{
// 27.6.1.1 Template class basic_istream
template<typename _CharT, typename _Traits>
class basic_istream : virtual public basic_ios<_CharT, _Traits>
{
public:
// Types (inherited from basic_ios (27.4.4)):
typedef _CharT char_type;
typedef typename _Traits::int_type int_type;
typedef typename _Traits::pos_type pos_type;
typedef typename _Traits::off_type off_type;
typedef _Traits traits_type;
// Non-standard Types:
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_ios<_CharT, _Traits> __ios_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter;
typedef num_get<_CharT, __istreambuf_iter> __numget_type;
typedef ctype<_CharT> __ctype_type;
 
protected:
// Data Members:
streamsize _M_gcount;
 
public:
// 27.6.1.1.1 Constructor/destructor:
explicit
basic_istream(__streambuf_type* __sb)
{
this->init(__sb);
_M_gcount = streamsize(0);
}
 
virtual
~basic_istream()
{ _M_gcount = streamsize(0); }
 
// 27.6.1.1.2 Prefix/suffix:
class sentry;
friend class sentry;
 
// 27.6.1.2 Formatted input:
// 27.6.1.2.3 basic_istream::operator>>
__istream_type&
operator>>(__istream_type& (*__pf)(__istream_type&));
 
__istream_type&
operator>>(__ios_type& (*__pf)(__ios_type&));
 
__istream_type&
operator>>(ios_base& (*__pf)(ios_base&));
// 27.6.1.2.2 Arithmetic Extractors
__istream_type&
operator>>(bool& __n);
__istream_type&
operator>>(short& __n);
__istream_type&
operator>>(unsigned short& __n);
 
__istream_type&
operator>>(int& __n);
__istream_type&
operator>>(unsigned int& __n);
 
__istream_type&
operator>>(long& __n);
__istream_type&
operator>>(unsigned long& __n);
 
#ifdef _GLIBCPP_USE_LONG_LONG
__istream_type&
operator>>(long long& __n);
 
__istream_type&
operator>>(unsigned long long& __n);
#endif
 
__istream_type&
operator>>(float& __f);
 
__istream_type&
operator>>(double& __f);
 
__istream_type&
operator>>(long double& __f);
 
__istream_type&
operator>>(void*& __p);
 
__istream_type&
operator>>(__streambuf_type* __sb);
// 27.6.1.3 Unformatted input:
inline streamsize
gcount(void) const
{ return _M_gcount; }
int_type
get(void);
 
__istream_type&
get(char_type& __c);
 
__istream_type&
get(char_type* __s, streamsize __n, char_type __delim);
 
inline __istream_type&
get(char_type* __s, streamsize __n)
{ return get(__s, __n, this->widen('\n')); }
 
__istream_type&
get(__streambuf_type& __sb, char_type __delim);
 
inline __istream_type&
get(__streambuf_type& __sb)
{ return get(__sb, this->widen('\n')); }
 
__istream_type&
getline(char_type* __s, streamsize __n, char_type __delim);
 
inline __istream_type&
getline(char_type* __s, streamsize __n)
{ return getline(__s, __n, this->widen('\n')); }
 
__istream_type&
ignore(streamsize __n = 1, int_type __delim = traits_type::eof());
int_type
peek(void);
__istream_type&
read(char_type* __s, streamsize __n);
 
streamsize
readsome(char_type* __s, streamsize __n);
__istream_type&
putback(char_type __c);
 
__istream_type&
unget(void);
 
int
sync(void);
 
pos_type
tellg(void);
 
__istream_type&
seekg(pos_type);
 
__istream_type&
seekg(off_type, ios_base::seekdir);
 
private:
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// Not defined.
__istream_type&
operator=(const __istream_type&);
 
basic_istream(const __istream_type&);
#endif
};
template<typename _CharT, typename _Traits>
class basic_istream<_CharT, _Traits>::sentry
{
public:
typedef _Traits traits_type;
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef __istream_type::__ctype_type __ctype_type;
typedef typename _Traits::int_type __int_type;
 
explicit
sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
 
operator bool() { return _M_ok; }
 
private:
bool _M_ok;
};
 
// 27.6.1.2.3 Character extraction templates
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c);
 
template<class _Traits>
basic_istream<char, _Traits>&
operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
{ return (__in >> reinterpret_cast<char&>(__c)); }
 
template<class _Traits>
basic_istream<char, _Traits>&
operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
{ return (__in >> reinterpret_cast<char&>(__c)); }
 
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s);
template<class _Traits>
basic_istream<char,_Traits>&
operator>>(basic_istream<char,_Traits>& __in, unsigned char* __s)
{ return (__in >> reinterpret_cast<char*>(__s)); }
 
template<class _Traits>
basic_istream<char,_Traits>&
operator>>(basic_istream<char,_Traits>& __in, signed char* __s)
{ return (__in >> reinterpret_cast<char*>(__s)); }
 
// 27.6.1.5 Template class basic_iostream
template<typename _CharT, typename _Traits>
class basic_iostream
: public basic_istream<_CharT, _Traits>,
public basic_ostream<_CharT, _Traits>
{
public:
// Non-standard Types:
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef basic_ostream<_CharT, _Traits> __ostream_type;
 
explicit
basic_iostream(basic_streambuf<_CharT, _Traits>* __sb)
: __istream_type(__sb), __ostream_type(__sb)
{ }
 
virtual
~basic_iostream() { }
};
 
// 27.6.1.4 Standard basic_istream manipulators
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
ws(basic_istream<_CharT, _Traits>& __is);
} // namespace std
 
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/istream.tcc>
#endif
#endif
 
#endif /* _CPP_ISTREAM */
 
/contrib/media/updf/include/bits/std_iterator.h
0,0 → 1,43
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_ITERATOR
#define _CPP_ITERATOR 1
 
#pragma GCC system_header
#include <bits/c++config.h>
#include <bits/std_cstddef.h>
#include <bits/std_iosfwd.h>
#include <bits/stl_iterator_base_types.h>
#include <bits/stl_iterator_base_funcs.h>
#include <bits/stl_iterator.h>
 
#endif /* _CPP_ITERATOR */
 
// Local Variables:
// mode:C++
// End:
 
/contrib/media/updf/include/bits/std_list.h
0,0 → 1,42
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_LIST
#define _CPP_LIST 1
 
#pragma GCC system_header
 
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_list.h>
 
#endif /* _CPP_LIST */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/std_locale.h
0,0 → 1,47
// Locale support -*- C++ -*-
 
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 22.1 Locales
//
 
#ifndef _CPP_LOCALE
#define _CPP_LOCALE 1
 
#pragma GCC system_header
 
#include <bits/localefwd.h>
#include <bits/locale_facets.h>
#include <bits/locale_facets.tcc>
 
#endif
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/std_map.h
0,0 → 1,42
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_MAP
#define _CPP_MAP 1
 
#pragma GCC system_header
 
#ifndef _CPP_BITS_STL_TREE_H
#include <bits/stl_tree.h>
#endif
#include <bits/stl_map.h>
#include <bits/stl_multimap.h>
 
#endif /* _CPP_MAP */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/std_memory.h
0,0 → 1,116
/*
* Copyright (c) 1997-1999
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
#ifndef _CPP_MEMORY
#define _CPP_MEMORY 1
 
#pragma GCC system_header
 
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_iterator_base_types.h> //for iterator_traits
#include <bits/stl_tempbuf.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_raw_storage_iter.h>
 
namespace std
{
 
template<class _Tp1> struct auto_ptr_ref {
_Tp1* _M_ptr;
auto_ptr_ref(_Tp1* __p) : _M_ptr(__p) {}
};
 
template <class _Tp> class auto_ptr {
private:
_Tp* _M_ptr;
 
public:
typedef _Tp element_type;
 
explicit auto_ptr(_Tp* __p = 0) __STL_NOTHROW : _M_ptr(__p) {}
auto_ptr(auto_ptr& __a) __STL_NOTHROW : _M_ptr(__a.release()) {}
 
template <class _Tp1> auto_ptr(auto_ptr<_Tp1>& __a) __STL_NOTHROW
: _M_ptr(__a.release()) {}
 
auto_ptr& operator=(auto_ptr& __a) __STL_NOTHROW {
reset(__a.release());
return *this;
}
 
template <class _Tp1>
auto_ptr& operator=(auto_ptr<_Tp1>& __a) __STL_NOTHROW {
reset(__a.release());
return *this;
}
// Note: The C++ standard says there is supposed to be an empty throw
// specification here, but omitting it is standard conforming. Its
// presence can be detected only if _Tp::~_Tp() throws, but (17.4.3.6/2)
// this is prohibited.
~auto_ptr() { delete _M_ptr; }
_Tp& operator*() const __STL_NOTHROW {
return *_M_ptr;
}
_Tp* operator->() const __STL_NOTHROW {
return _M_ptr;
}
_Tp* get() const __STL_NOTHROW {
return _M_ptr;
}
_Tp* release() __STL_NOTHROW {
_Tp* __tmp = _M_ptr;
_M_ptr = 0;
return __tmp;
}
void reset(_Tp* __p = 0) __STL_NOTHROW {
if (__p != _M_ptr) {
delete _M_ptr;
_M_ptr = __p;
}
}
 
// According to the C++ standard, these conversions are required. Most
// present-day compilers, however, do not enforce that requirement---and,
// in fact, most present-day compilers do not support the language
// features that these conversions rely on.
public:
auto_ptr(auto_ptr_ref<_Tp> __ref) __STL_NOTHROW
: _M_ptr(__ref._M_ptr) {}
 
auto_ptr& operator=(auto_ptr_ref<_Tp> __ref) __STL_NOTHROW {
if (__ref._M_ptr != this->get()) {
delete _M_ptr;
_M_ptr = __ref._M_ptr;
}
return *this;
}
 
template <class _Tp1> operator auto_ptr_ref<_Tp1>() __STL_NOTHROW
{ return auto_ptr_ref<_Tp>(this->release()); }
template <class _Tp1> operator auto_ptr<_Tp1>() __STL_NOTHROW
{ return auto_ptr<_Tp1>(this->release()); }
};
 
} // namespace std
 
#endif /* _CPP_MEMORY */
 
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/std_numeric.h
0,0 → 1,41
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_NUMERIC
#define _CPP_NUMERIC 1
 
#pragma GCC system_header
#include <bits/c++config.h>
#include <bits/std_cstddef.h>
#include <bits/std_iterator.h>
#include <bits/stl_function.h>
#include <bits/stl_numeric.h>
 
#endif /* _CPP_NUMERIC */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/std_ostream.h
0,0 → 1,283
// Output streams -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.6.2 Output streams
//
 
#ifndef _CPP_OSTREAM
#define _CPP_OSTREAM 1
 
#pragma GCC system_header
 
#include <bits/std_ios.h>
 
namespace std
{
// 27.6.2.1 Template class basic_ostream
template<typename _CharT, typename _Traits>
class basic_ostream : virtual public basic_ios<_CharT, _Traits>
{
public:
 
// Types (inherited from basic_ios (27.4.4)):
typedef _CharT char_type;
typedef typename _Traits::int_type int_type;
typedef typename _Traits::pos_type pos_type;
typedef typename _Traits::off_type off_type;
typedef _Traits traits_type;
// Non-standard Types:
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_ios<_CharT, _Traits> __ios_type;
typedef basic_ostream<_CharT, _Traits> __ostream_type;
typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter;
typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
typedef ctype<_CharT> __ctype_type;
 
// 27.6.2.2 Constructor/destructor:
explicit
basic_ostream(__streambuf_type* __sb)
{ this->init(__sb); }
 
virtual
~basic_ostream() { }
 
// 27.6.2.3 Prefix/suffix:
class sentry;
friend class sentry;
// 27.6.2.5 Formatted output:
// 27.6.2.5.3 basic_ostream::operator<<
__ostream_type&
operator<<(__ostream_type& (*__pf)(__ostream_type&));
__ostream_type&
operator<<(__ios_type& (*__pf)(__ios_type&));
__ostream_type&
operator<<(ios_base& (*__pf) (ios_base&));
 
// 27.6.2.5.2 Arithmetic Inserters
__ostream_type&
operator<<(long __n);
__ostream_type&
operator<<(unsigned long __n);
 
__ostream_type&
operator<<(bool __n);
 
__ostream_type&
operator<<(short __n)
{
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
if (__fmt & ios_base::oct || __fmt & ios_base::hex)
return this->operator<<(static_cast<unsigned long>
(static_cast<unsigned short>(__n)));
else
return this->operator<<(static_cast<long>(__n));
}
 
__ostream_type&
operator<<(unsigned short __n)
{ return this->operator<<(static_cast<unsigned long>(__n)); }
 
__ostream_type&
operator<<(int __n)
{
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
if (__fmt & ios_base::oct || __fmt & ios_base::hex)
return this->operator<<(static_cast<unsigned long>
(static_cast<unsigned int>(__n)));
else
return this->operator<<(static_cast<long>(__n));
}
 
__ostream_type&
operator<<(unsigned int __n)
{ return this->operator<<(static_cast<unsigned long>(__n)); }
 
#ifdef _GLIBCPP_USE_LONG_LONG
__ostream_type&
operator<<(long long __n);
 
__ostream_type&
operator<<(unsigned long long __n);
#endif
 
__ostream_type&
operator<<(double __f);
 
__ostream_type&
operator<<(float __f)
{ return this->operator<<(static_cast<double>(__f)); }
 
__ostream_type&
operator<<(long double __f);
 
__ostream_type&
operator<<(const void* __p);
 
__ostream_type&
operator<<(__streambuf_type* __sb);
 
// Unformatted output:
__ostream_type&
put(char_type __c);
 
__ostream_type&
write(const char_type* __s, streamsize __n);
 
__ostream_type&
flush();
 
// Seeks:
pos_type
tellp();
 
__ostream_type&
seekp(pos_type);
 
__ostream_type&
seekp(off_type, ios_base::seekdir);
 
private:
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// Not defined.
__ostream_type&
operator=(const __ostream_type&);
 
basic_ostream(const __ostream_type&);
#endif
};
 
// 27.6.2.3 Class basic_ostream::sentry
template <typename _CharT, typename _Traits>
class basic_ostream<_CharT, _Traits>::sentry
{
// Data Members:
bool _M_ok;
basic_ostream<_CharT,_Traits>& _M_os;
public:
explicit
sentry(basic_ostream<_CharT,_Traits>& __os);
 
~sentry()
{
// XXX MT
if (_M_os.flags() & ios_base::unitbuf && !uncaught_exception())
{
// Can't call flush directly or else will get into recursive lock.
if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
_M_os.setstate(ios_base::badbit);
}
}
 
operator bool()
{ return _M_ok; }
};
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c);
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
{ return (__out << __out.widen(__c)); }
 
// Specialization
template <class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __out, char __c);
 
// Signed and unsigned
template<class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
{ return (__out << static_cast<char>(__c)); }
template<class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
{ return (__out << static_cast<char>(__c)); }
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s);
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits> &
operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s);
 
// Partial specializationss
template<class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __out, const char* __s);
// Signed and unsigned
template<class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
{ return (__out << reinterpret_cast<const char*>(__s)); }
 
template<class _Traits>
basic_ostream<char, _Traits> &
operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
{ return (__out << reinterpret_cast<const char*>(__s)); }
 
// 27.6.2.7 Standard basic_ostream manipulators
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
endl(basic_ostream<_CharT, _Traits>& __os)
{ return flush(__os.put(__os.widen('\n'))); }
 
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
ends(basic_ostream<_CharT, _Traits>& __os)
{ return __os.put(_CharT()); }
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
flush(basic_ostream<_CharT, _Traits>& __os)
{ return __os.flush(); }
 
} // namespace std
 
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/ostream.tcc>
#endif
#endif
 
#endif /* _CPP_OSTREAM */
 
/contrib/media/updf/include/bits/std_queue.h
0,0 → 1,46
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_QUEUE
#define _CPP_QUEUE 1
 
#pragma GCC system_header
#include <bits/c++config.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_vector.h>
#include <bits/stl_heap.h>
#include <bits/stl_deque.h>
#include <bits/stl_function.h>
#include <bits/stl_queue.h>
 
#endif /* _CPP_QUEUE */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/std_set.h
0,0 → 1,42
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_SET
#define _CPP_SET 1
 
#pragma GCC system_header
 
#ifndef _CPP_BITS_STL_TREE_H /* XXX is this guard needed? */
#include <bits/stl_tree.h>
#endif
#include <bits/stl_set.h>
#include <bits/stl_multiset.h>
 
#endif /* _CPP_SET */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/std_sstream.h
0,0 → 1,367
// String based streams -*- C++ -*-
 
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.7 String-based streams
//
 
#ifndef _CPP_SSTREAM
#define _CPP_SSTREAM 1
 
#pragma GCC system_header
 
#include <bits/std_istream.h>
#include <bits/std_ostream.h>
 
namespace std
{
template<typename _CharT, typename _Traits, typename _Alloc>
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 251. basic_stringbuf missing allocator_type
typedef _Alloc allocator_type;
#endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
 
// Non-standard Types:
typedef basic_streambuf<char_type, traits_type> __streambuf_type;
typedef basic_string<char_type, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
 
private:
// Data Members:
__string_type _M_string;
public:
// Constructors:
explicit
basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out)
: __streambuf_type(), _M_string()
{ _M_stringbuf_init(__mode); }
 
explicit
basic_stringbuf(const __string_type& __str,
ios_base::openmode __mode = ios_base::in | ios_base::out)
: __streambuf_type(), _M_string(__str.c_str())
{ _M_stringbuf_init(__mode); }
 
// Get and set:
__string_type
str() const
{
if (_M_mode & ios_base::out)
{
// This is the deal: _M_string.size() is value that
// represents the size of the intial string that makes
// _M_string, and may not be the correct size of the
// current stringbuf internal buffer.
__size_type __len = _M_string.size();
if (_M_out_cur > _M_out_beg)
__len = max(__size_type(_M_out_end - _M_out_beg), __len);
return __string_type(_M_out_beg, _M_out_beg + __len);
}
else
return _M_string;
}
 
void
str(const __string_type& __s)
{
_M_string = __s;
_M_stringbuf_init(_M_mode);
}
 
protected:
// Common initialization code for both ctors goes here.
void
_M_stringbuf_init(ios_base::openmode __mode)
{
// _M_buf_size is a convenient alias for "what the streambuf
// thinks the allocated size of the string really is." This is
// necessary as ostringstreams are implemented with the
// streambufs having control of the allocation and
// re-allocation of the internal string object, _M_string.
_M_buf_size = _M_string.size();
 
// NB: Start ostringstream buffers at 1024 bytes. This is an
// experimental value (pronounced "arbitrary" in some of the
// hipper english-speaking countries), and can be changed to
// suite particular needs.
_M_buf_size_opt = 512;
_M_mode = __mode;
if (_M_mode & ios_base::ate)
_M_really_sync(0, _M_buf_size);
else
_M_really_sync(0, 0);
}
 
// Overridden virtual functions:
virtual int_type
underflow()
{
if (_M_in_cur && _M_in_cur < _M_in_end)
return traits_type::to_int_type(*gptr());
else
return traits_type::eof();
}
 
virtual int_type
pbackfail(int_type __c = traits_type::eof());
 
virtual int_type
overflow(int_type __c = traits_type::eof());
 
virtual __streambuf_type*
setbuf(char_type* __s, streamsize __n)
{
if (__s && __n)
{
_M_string = __string_type(__s, __n);
_M_really_sync(0, 0);
}
return this;
}
 
virtual pos_type
seekoff(off_type __off, ios_base::seekdir __way,
ios_base::openmode __mode = ios_base::in | ios_base::out);
 
virtual pos_type
seekpos(pos_type __sp,
ios_base::openmode __mode = ios_base::in | ios_base::out);
 
// Internal function for correctly updating the internal buffer
// for a particular _M_string, due to initialization or
// re-sizing of an existing _M_string.
// Assumes: contents of _M_string and internal buffer match exactly.
// __i == _M_in_cur - _M_in_beg
// __o == _M_out_cur - _M_out_beg
virtual int
_M_really_sync(__size_type __i, __size_type __o)
{
char_type* __base = const_cast<char_type*>(_M_string.data());
bool __testin = _M_mode & ios_base::in;
bool __testout = _M_mode & ios_base::out;
__size_type __len = _M_string.size();
 
_M_buf = __base;
if (__testin)
this->setg(__base, __base + __i, __base + __len);
if (__testout)
{
this->setp(__base, __base + __len);
_M_out_cur += __o;
}
return 0;
}
};
 
 
// 27.7.2 Template class basic_istringstream
template<typename _CharT, typename _Traits, typename _Alloc>
class basic_istringstream : public basic_istream<_CharT, _Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 251. basic_stringbuf missing allocator_type
typedef _Alloc allocator_type;
#endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
 
// Non-standard types:
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
typedef basic_istream<char_type, traits_type> __istream_type;
 
private:
__stringbuf_type _M_stringbuf;
 
public:
// Constructors:
explicit
basic_istringstream(ios_base::openmode __mode = ios_base::in)
: __istream_type(NULL), _M_stringbuf(__mode | ios_base::in)
{ this->init(&_M_stringbuf); }
 
explicit
basic_istringstream(const __string_type& __str,
ios_base::openmode __mode = ios_base::in)
: __istream_type(NULL), _M_stringbuf(__str, __mode | ios_base::in)
{ this->init(&_M_stringbuf); }
 
~basic_istringstream()
{ }
 
// Members:
__stringbuf_type*
rdbuf() const
{ return const_cast<__stringbuf_type*>(&_M_stringbuf); }
 
__string_type
str() const
{ return _M_stringbuf.str(); }
void
str(const __string_type& __s)
{ _M_stringbuf.str(__s); }
};
 
 
// 27.7.3 Template class basic_ostringstream
template <typename _CharT, typename _Traits, typename _Alloc>
class basic_ostringstream : public basic_ostream<_CharT, _Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 251. basic_stringbuf missing allocator_type
typedef _Alloc allocator_type;
#endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
 
// Non-standard types:
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
typedef basic_ostream<char_type, traits_type> __ostream_type;
 
private:
__stringbuf_type _M_stringbuf;
 
public:
// Constructors/destructor:
explicit
basic_ostringstream(ios_base::openmode __mode = ios_base::out)
: __ostream_type(NULL), _M_stringbuf(__mode | ios_base::out)
{ this->init(&_M_stringbuf); }
 
explicit
basic_ostringstream(const __string_type __str,
ios_base::openmode __mode = ios_base::out)
: __ostream_type(NULL), _M_stringbuf(__str, __mode | ios_base::out)
{ this->init(&_M_stringbuf); }
 
~basic_ostringstream()
{ }
 
// Members:
__stringbuf_type*
rdbuf() const
{ return const_cast<__stringbuf_type*>(&_M_stringbuf); }
 
__string_type
str() const
{ return _M_stringbuf.str(); }
void
str(const __string_type& __s)
{ _M_stringbuf.str(__s); }
};
// 27.7.4 Template class basic_stringstream
template <typename _CharT, typename _Traits, typename _Alloc>
class basic_stringstream : public basic_iostream<_CharT, _Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 251. basic_stringbuf missing allocator_type
typedef _Alloc allocator_type;
#endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
 
// Non-standard Types:
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
typedef basic_iostream<char_type, traits_type> __iostream_type;
 
private:
__stringbuf_type _M_stringbuf;
 
public:
// Constructors/destructors
explicit
basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in)
: __iostream_type(NULL), _M_stringbuf(__m)
{ this->init(&_M_stringbuf); }
 
explicit
basic_stringstream(const __string_type& __str,
ios_base::openmode __m = ios_base::out | ios_base::in)
: __iostream_type(NULL), _M_stringbuf(__str, __m)
{ this->init(&_M_stringbuf); }
 
~basic_stringstream()
{ }
 
// Members:
__stringbuf_type*
rdbuf() const
{ return const_cast<__stringbuf_type*>(&_M_stringbuf); }
 
__string_type
str() const
{ return _M_stringbuf.str(); }
 
void
str(const __string_type& __s)
{ _M_stringbuf.str(__s); }
};
} // namespace std
 
 
 
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/sstream.tcc>
#endif
#endif
 
#endif // _CPP_SSTREAM
/contrib/media/updf/include/bits/std_stack.h
0,0 → 1,43
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_STACK
#define _CPP_STACK 1
 
#pragma GCC system_header
 
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_deque.h>
#include <bits/stl_stack.h>
 
#endif /* _CPP_STACK */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/std_stdexcept.h
0,0 → 1,117
// Standard exception classes -*- C++ -*-
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 19.1 Exception classes
//
 
#ifndef _CPP_STDEXCEPT
#define _CPP_STDEXCEPT 1
 
#pragma GCC system_header
 
#include <exception>
#include <string>
 
namespace std
{
class logic_error : public exception
{
string _M_msg;
 
public:
explicit
logic_error(const string& __arg);
 
virtual
~logic_error() throw();
 
virtual const char*
what() const throw();
};
 
class domain_error : public logic_error
{
public:
explicit domain_error(const string& __arg);
};
 
class invalid_argument : public logic_error
{
public:
explicit invalid_argument(const string& __arg);
};
 
class length_error : public logic_error
{
public:
explicit length_error(const string& __arg);
};
 
class out_of_range : public logic_error
{
public:
explicit out_of_range(const string& __arg);
};
 
class runtime_error : public exception
{
string _M_msg;
 
public:
explicit
runtime_error(const string& __arg);
 
virtual
~runtime_error() throw();
 
virtual const char*
what() const throw();
};
 
class range_error : public runtime_error
{
public:
explicit range_error(const string& __arg);
};
 
class overflow_error : public runtime_error
{
public:
explicit overflow_error(const string& __arg);
};
 
class underflow_error : public runtime_error
{
public:
explicit underflow_error(const string& __arg);
};
} // namespace std
 
#endif // _CPP_STDEXCEPT
/contrib/media/updf/include/bits/std_streambuf.h
0,0 → 1,534
// Stream buffer classes -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.5 Stream buffers
//
 
#ifndef _CPP_STREAMBUF
#define _CPP_STREAMBUF 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
#include <bits/std_iosfwd.h>
#include <bits/std_cstdio.h> // For SEEK_SET, SEEK_CUR, SEEK_END
#include <bits/localefwd.h>
#include <bits/ios_base.h>
 
namespace std
{
template<typename _CharT, typename _Traits>
streamsize
__copy_streambufs(basic_ios<_CharT, _Traits>& _ios,
basic_streambuf<_CharT, _Traits>* __sbin,
basic_streambuf<_CharT, _Traits>* __sbout);
// 27.5.2 Template class basic_streambuf<_CharT, _Traits>
template<typename _CharT, typename _Traits>
class basic_streambuf
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
 
// Non-standard Types:
typedef ctype<char_type> __ctype_type;
typedef basic_streambuf<char_type, traits_type> __streambuf_type;
friend class basic_ios<char_type, traits_type>;
friend class basic_istream<char_type, traits_type>;
friend class basic_ostream<char_type, traits_type>;
friend class istreambuf_iterator<char_type, traits_type>;
friend class ostreambuf_iterator<char_type, traits_type>;
 
friend streamsize
__copy_streambufs<>(basic_ios<char_type, traits_type>& __ios,
__streambuf_type* __sbin,__streambuf_type* __sbout);
protected:
 
// Pointer to the beginning of internally-allocated
// space. Filebuf manually allocates/deallocates this, whereas
// stringstreams attempt to use the built-in intelligence of the
// string class. If you are managing memory, set this. If not,
// leave it NULL.
char_type* _M_buf;
 
// Actual size of allocated internal buffer, in bytes.
int_type _M_buf_size;
 
// Optimal or preferred size of internal buffer, in bytes.
int_type _M_buf_size_opt;
 
// True iff _M_in_* and _M_out_* buffers should always point to
// the same place. True for fstreams, false for sstreams.
bool _M_buf_unified;
 
// This is based on _IO_FILE, just reordered to be more
// consistent, and is intended to be the most minimal abstraction
// for an internal buffer.
// get == input == read
// put == output == write
char_type* _M_in_beg; // Start of get area.
char_type* _M_in_cur; // Current read area.
char_type* _M_in_end; // End of get area.
char_type* _M_out_beg; // Start of put area.
char_type* _M_out_cur; // Current put area.
char_type* _M_out_end; // End of put area.
 
// Place to stash in || out || in | out settings for current streambuf.
ios_base::openmode _M_mode;
 
// Current locale setting.
locale _M_buf_locale;
 
// True iff locale is initialized.
bool _M_buf_locale_init;
 
// Necessary bits for putback buffer management. Only used in
// the basic_filebuf class, as necessary for the standard
// requirements. The only basic_streambuf member function that
// needs access to these data members is in_avail...
// NB: pbacks of over one character are not currently supported.
int_type _M_pback_size;
char_type* _M_pback;
char_type* _M_pback_cur_save;
char_type* _M_pback_end_save;
bool _M_pback_init;
 
// Initializes pback buffers, and moves normal buffers to safety.
// Assumptions:
// _M_in_cur has already been moved back
void
_M_pback_create()
{
if (!_M_pback_init)
{
int_type __dist = _M_in_end - _M_in_cur;
int_type __len = min(_M_pback_size, __dist);
traits_type::copy(_M_pback, _M_in_cur, __len);
_M_pback_cur_save = _M_in_cur;
_M_pback_end_save = _M_in_end;
this->setg(_M_pback, _M_pback, _M_pback + __len);
_M_pback_init = true;
}
}
 
// Deactivates pback buffer contents, and restores normal buffer.
// Assumptions:
// The pback buffer has only moved forward.
void
_M_pback_destroy()
{
if (_M_pback_init)
{
// Length _M_in_cur moved in the pback buffer.
int_type __off_cur = _M_in_cur - _M_pback;
// For in | out buffers, the end can be pushed back...
int_type __off_end = 0;
int_type __pback_len = _M_in_end - _M_pback;
int_type __save_len = _M_pback_end_save - _M_buf;
if (__pback_len > __save_len)
__off_end = __pback_len - __save_len;
 
this->setg(_M_buf, _M_pback_cur_save + __off_cur,
_M_pback_end_save + __off_end);
_M_pback_cur_save = NULL;
_M_pback_end_save = NULL;
_M_pback_init = false;
}
}
 
// Correctly sets the _M_in_cur pointer, and bumps the
// _M_out_cur pointer as well if necessary.
void
_M_in_cur_move(off_type __n) // argument needs to be +-
{
bool __testout = _M_out_cur;
_M_in_cur += __n;
if (__testout && _M_buf_unified)
_M_out_cur += __n;
}
 
// Correctly sets the _M_out_cur pointer, and bumps the
// appropriate _M_*_end pointers as well. Necessary for the
// un-tied stringbufs, in in|out mode.
// Invariant:
// __n + _M_out_[cur, end] <= _M_buf + _M_buf_size
// Assuming all _M_*_[beg, cur, end] pointers are operating on
// the same range:
// _M_buf <= _M_*_ <= _M_buf + _M_buf_size
void
_M_out_cur_move(off_type __n) // argument needs to be +-
{
bool __testin = _M_in_cur;
 
_M_out_cur += __n;
if (__testin && _M_buf_unified)
_M_in_cur += __n;
if (_M_out_cur > _M_out_end)
{
_M_out_end = _M_out_cur;
// NB: in | out buffers drag the _M_in_end pointer along...
if (__testin)
_M_in_end += __n;
}
}
 
// Return the size of the output buffer. This depends on the
// buffer in use: allocated buffers have a stored size in
// _M_buf_size and setbuf() buffers don't.
off_type
_M_out_buf_size()
{
off_type __ret = 0;
if (_M_out_cur)
{
// Using allocated buffer.
if (_M_out_beg == _M_buf)
__ret = _M_out_beg + _M_buf_size - _M_out_cur;
// Using non-allocated buffer.
else
__ret = _M_out_end - _M_out_cur;
}
return __ret;
}
 
// These three functions are used to clarify internal buffer
// maintenance. After an overflow, or after a seekoff call that
// started at beg or end, or possibly when the stream becomes
// unbuffered, and a myrid other obscure corner cases, the
// internal buffer does not truly reflect the contents of the
// external buffer. At this point, for whatever reason, it is in
// an indeterminate state.
void
_M_set_indeterminate(void)
{
if (_M_mode & ios_base::in)
this->setg(_M_buf, _M_buf, _M_buf);
if (_M_mode & ios_base::out)
this->setp(_M_buf, _M_buf);
}
 
void
_M_set_determinate(off_type __off)
{
bool __testin = _M_mode & ios_base::in;
bool __testout = _M_mode & ios_base::out;
if (__testin)
this->setg(_M_buf, _M_buf, _M_buf + __off);
if (__testout)
this->setp(_M_buf, _M_buf + __off);
}
 
bool
_M_is_indeterminate(void)
{
bool __ret = false;
// Don't return true if unbuffered.
if (_M_buf)
{
if (_M_mode & ios_base::in)
__ret = _M_in_beg == _M_in_cur && _M_in_cur == _M_in_end;
if (_M_mode & ios_base::out)
__ret = _M_out_beg == _M_out_cur && _M_out_cur == _M_out_end;
}
return __ret;
}
 
public:
virtual
~basic_streambuf()
{
_M_buf_unified = false;
_M_buf_size = 0;
_M_buf_size_opt = 0;
_M_mode = ios_base::openmode(0);
_M_buf_locale_init = false;
}
 
// Locales:
locale
pubimbue(const locale &__loc)
{
locale __tmp(this->getloc());
this->imbue(__loc);
return __tmp;
}
 
locale
getloc() const
{
if (_M_buf_locale_init)
return _M_buf_locale;
else
return locale();
}
 
// Buffer and positioning:
__streambuf_type*
pubsetbuf(char_type* __s, streamsize __n)
{ return this->setbuf(__s, __n); }
 
pos_type
pubseekoff(off_type __off, ios_base::seekdir __way,
ios_base::openmode __mode = ios_base::in | ios_base::out)
{ return this->seekoff(__off, __way, __mode); }
 
pos_type
pubseekpos(pos_type __sp,
ios_base::openmode __mode = ios_base::in | ios_base::out)
{ return this->seekpos(__sp, __mode); }
 
int
pubsync() { return this->sync(); }
 
// Get and put areas:
// Get area:
streamsize
in_avail()
{
streamsize __ret;
if (_M_in_cur && _M_in_cur < _M_in_end)
{
if (_M_pback_init)
{
int_type __save_len = _M_pback_end_save - _M_pback_cur_save;
int_type __pback_len = _M_in_cur - _M_pback;
__ret = __save_len - __pback_len;
}
else
__ret = this->egptr() - this->gptr();
}
else
__ret = this->showmanyc();
return __ret;
}
 
int_type
snextc()
{
int_type __eof = traits_type::eof();
return (this->sbumpc() == __eof ? __eof : this->sgetc());
}
 
int_type
sbumpc();
 
int_type
sgetc()
{
int_type __ret;
if (_M_in_cur && _M_in_cur < _M_in_end)
__ret = traits_type::to_int_type(*(this->gptr()));
else
__ret = this->underflow();
return __ret;
}
 
streamsize
sgetn(char_type* __s, streamsize __n)
{ return this->xsgetn(__s, __n); }
 
// Putback:
int_type
sputbackc(char_type __c);
 
int_type
sungetc();
 
// Put area:
int_type
sputc(char_type __c);
 
streamsize
sputn(const char_type* __s, streamsize __n)
{ return this->xsputn(__s, __n); }
 
protected:
basic_streambuf()
: _M_buf(NULL), _M_buf_size(0),
_M_buf_size_opt(static_cast<int_type>(BUFSIZ)), _M_buf_unified(false),
_M_in_beg(0), _M_in_cur(0), _M_in_end(0), _M_out_beg(0), _M_out_cur(0),
_M_out_end(0), _M_mode(ios_base::openmode(0)), _M_buf_locale(locale()),
_M_buf_locale_init(false), _M_pback_size(1), _M_pback(NULL),
_M_pback_cur_save(NULL), _M_pback_end_save(NULL), _M_pback_init(false)
{ }
 
// Get area:
char_type*
eback() const { return _M_in_beg; }
 
char_type*
gptr() const { return _M_in_cur; }
 
char_type*
egptr() const { return _M_in_end; }
 
void
gbump(int __n) { _M_in_cur += __n; }
 
void
setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
{
_M_in_beg = __gbeg;
_M_in_cur = __gnext;
_M_in_end = __gend;
if (!(_M_mode & ios_base::in) && __gbeg && __gnext && __gend)
_M_mode = _M_mode | ios_base::in;
}
 
// Put area:
char_type*
pbase() const { return _M_out_beg; }
 
char_type*
pptr() const { return _M_out_cur; }
 
char_type*
epptr() const { return _M_out_end; }
 
void
pbump(int __n) { _M_out_cur += __n; }
 
void
setp(char_type* __pbeg, char_type* __pend)
{
_M_out_beg = _M_out_cur = __pbeg;
_M_out_end = __pend;
if (!(_M_mode & ios_base::out) && __pbeg && __pend)
_M_mode = _M_mode | ios_base::out;
}
 
// Virtual functions:
// Locales:
virtual void
imbue(const locale& __loc)
{
_M_buf_locale_init = true;
if (_M_buf_locale != __loc)
_M_buf_locale = __loc;
}
 
// Buffer management and positioning:
virtual basic_streambuf<char_type,_Traits>*
setbuf(char_type*, streamsize)
{ return this; }
virtual pos_type
seekoff(off_type, ios_base::seekdir,
ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out)
{ return pos_type(off_type(-1)); }
 
virtual pos_type
seekpos(pos_type,
ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out)
{ return pos_type(off_type(-1)); }
 
virtual int
sync() { return 0; }
 
// Get area:
virtual streamsize
showmanyc() { return 0; }
 
virtual streamsize
xsgetn(char_type* __s, streamsize __n);
 
virtual int_type
underflow()
{ return traits_type::eof(); }
 
virtual int_type
uflow()
{
int_type __ret = traits_type::eof();
bool __testeof = this->underflow() == __ret;
bool __testpending = _M_in_cur && _M_in_cur < _M_in_end;
if (!__testeof && __testpending)
{
__ret = traits_type::to_int_type(*_M_in_cur);
++_M_in_cur;
if (_M_buf_unified && _M_mode & ios_base::out)
++_M_out_cur;
}
return __ret;
}
 
// Putback:
virtual int_type
pbackfail(int_type /* __c */ = traits_type::eof())
{ return traits_type::eof(); }
 
// Put area:
virtual streamsize
xsputn(const char_type* __s, streamsize __n);
 
virtual int_type
overflow(int_type /* __c */ = traits_type::eof())
{ return traits_type::eof(); }
 
#ifdef _GLIBCPP_DEPRECATED
public:
void
stossc()
{
if (_M_in_cur < _M_in_end)
++_M_in_cur;
else
this->uflow();
}
#endif
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
private:
basic_streambuf(const __streambuf_type&);
 
__streambuf_type&
operator=(const __streambuf_type&);
#endif
};
 
} // namespace std
 
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
#include <bits/streambuf.tcc>
#endif
#endif
 
#endif /* _CPP_STREAMBUF */
 
/contrib/media/updf/include/bits/std_string.h
0,0 → 1,54
// Components for manipulating sequences of characters -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 21 Strings library
//
 
#ifndef _CPP_STRING
#define _CPP_STRING 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
#include <bits/stringfwd.h>
#include <bits/char_traits.h>
#include <bits/std_iterator.h>
#include <bits/std_memory.h> // For allocator.
#include <bits/type_traits.h>
#include <bits/std_iosfwd.h> // For operators >>, <<, and getline decls.
#include <bits/basic_string.h>
 
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# include <bits/std_algorithm.h> // for find_if
# include <bits/basic_string.tcc>
#endif
 
#endif /* _CPP_STRING */
 
/contrib/media/updf/include/bits/std_utility.h
0,0 → 1,39
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_UTILITY
#define _CPP_UTILITY 1
 
#pragma GCC system_header
#include <bits/c++config.h>
#include <bits/stl_relops.h>
#include <bits/stl_pair.h>
 
#endif /* _CPP_UTILITY */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/std_valarray.h
0,0 → 1,737
// The template and inlines for the -*- C++ -*- valarray class.
 
// Copyright (C) 1997-1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
 
#ifndef _CPP_VALARRAY
#define _CPP_VALARRAY 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
#include <bits/std_cstddef.h>
#include <bits/std_cmath.h>
#include <bits/std_cstdlib.h>
#include <bits/std_numeric.h>
#include <bits/std_functional.h>
#include <bits/std_algorithm.h>
 
namespace std
{
template<class _Clos, typename _Tp> class _Expr;
 
template<typename _Tp1, typename _Tp2> class _ValArray;
 
template<template<class> class _Oper,
template<class, class> class _Meta, class _Dom> struct _UnClos;
 
template<template<class> class _Oper,
template<class, class> class _Meta1,
template<class, class> class _Meta2,
class _Dom1, class _Dom2> class _BinClos;
 
template<template<class, class> class _Meta, class _Dom> class _SClos;
 
template<template<class, class> class _Meta, class _Dom> class _GClos;
template<template<class, class> class _Meta, class _Dom> class _IClos;
template<template<class, class> class _Meta, class _Dom> class _ValFunClos;
 
template<template<class, class> class _Meta, class _Dom> class _RefFunClos;
 
template<class _Tp> struct _Unary_plus;
template<class _Tp> struct _Bitwise_and;
template<class _Tp> struct _Bitwise_or;
template<class _Tp> struct _Bitwise_xor;
template<class _Tp> struct _Bitwise_not;
template<class _Tp> struct _Shift_left;
template<class _Tp> struct _Shift_right;
template<class _Tp> class valarray; // An array of type _Tp
class slice; // BLAS-like slice out of an array
template<class _Tp> class slice_array;
class gslice; // generalized slice out of an array
template<class _Tp> class gslice_array;
template<class _Tp> class mask_array; // masked array
template<class _Tp> class indirect_array; // indirected array
 
} // namespace std
 
#include <bits/valarray_array.h>
#include <bits/valarray_meta.h>
namespace std
{
template<class _Tp> class valarray
{
public:
typedef _Tp value_type;
 
// _lib.valarray.cons_ construct/destroy:
valarray();
explicit valarray(size_t);
valarray(const _Tp&, size_t);
valarray(const _Tp* __restrict__, size_t);
valarray(const valarray&);
valarray(const slice_array<_Tp>&);
valarray(const gslice_array<_Tp>&);
valarray(const mask_array<_Tp>&);
valarray(const indirect_array<_Tp>&);
template<class _Dom>
valarray(const _Expr<_Dom,_Tp>& __e);
~valarray();
 
// _lib.valarray.assign_ assignment:
valarray<_Tp>& operator=(const valarray<_Tp>&);
valarray<_Tp>& operator=(const _Tp&);
valarray<_Tp>& operator=(const slice_array<_Tp>&);
valarray<_Tp>& operator=(const gslice_array<_Tp>&);
valarray<_Tp>& operator=(const mask_array<_Tp>&);
valarray<_Tp>& operator=(const indirect_array<_Tp>&);
 
template<class _Dom> valarray<_Tp>&
operator= (const _Expr<_Dom,_Tp>&);
 
// _lib.valarray.access_ element access:
// XXX: LWG to be resolved.
const _Tp& operator[](size_t) const;
_Tp& operator[](size_t);
// _lib.valarray.sub_ subset operations:
_Expr<_SClos<_ValArray,_Tp>, _Tp> operator[](slice) const;
slice_array<_Tp> operator[](slice);
_Expr<_GClos<_ValArray,_Tp>, _Tp> operator[](const gslice&) const;
gslice_array<_Tp> operator[](const gslice&);
valarray<_Tp> operator[](const valarray<bool>&) const;
mask_array<_Tp> operator[](const valarray<bool>&);
_Expr<_IClos<_ValArray, _Tp>, _Tp>
operator[](const valarray<size_t>&) const;
indirect_array<_Tp> operator[](const valarray<size_t>&);
 
// _lib.valarray.unary_ unary operators:
_Expr<_UnClos<_Unary_plus,_ValArray,_Tp>,_Tp> operator+ () const;
_Expr<_UnClos<negate,_ValArray,_Tp>,_Tp> operator- () const;
_Expr<_UnClos<_Bitwise_not,_ValArray,_Tp>,_Tp> operator~ () const;
_Expr<_UnClos<logical_not,_ValArray,_Tp>,bool> operator! () const;
// _lib.valarray.cassign_ computed assignment:
valarray<_Tp>& operator*= (const _Tp&);
valarray<_Tp>& operator/= (const _Tp&);
valarray<_Tp>& operator%= (const _Tp&);
valarray<_Tp>& operator+= (const _Tp&);
valarray<_Tp>& operator-= (const _Tp&);
valarray<_Tp>& operator^= (const _Tp&);
valarray<_Tp>& operator&= (const _Tp&);
valarray<_Tp>& operator|= (const _Tp&);
valarray<_Tp>& operator<<=(const _Tp&);
valarray<_Tp>& operator>>=(const _Tp&);
valarray<_Tp>& operator*= (const valarray<_Tp>&);
valarray<_Tp>& operator/= (const valarray<_Tp>&);
valarray<_Tp>& operator%= (const valarray<_Tp>&);
valarray<_Tp>& operator+= (const valarray<_Tp>&);
valarray<_Tp>& operator-= (const valarray<_Tp>&);
valarray<_Tp>& operator^= (const valarray<_Tp>&);
valarray<_Tp>& operator|= (const valarray<_Tp>&);
valarray<_Tp>& operator&= (const valarray<_Tp>&);
valarray<_Tp>& operator<<=(const valarray<_Tp>&);
valarray<_Tp>& operator>>=(const valarray<_Tp>&);
 
template<class _Dom>
valarray<_Tp>& operator*= (const _Expr<_Dom,_Tp>&);
template<class _Dom>
valarray<_Tp>& operator/= (const _Expr<_Dom,_Tp>&);
template<class _Dom>
valarray<_Tp>& operator%= (const _Expr<_Dom,_Tp>&);
template<class _Dom>
valarray<_Tp>& operator+= (const _Expr<_Dom,_Tp>&);
template<class _Dom>
valarray<_Tp>& operator-= (const _Expr<_Dom,_Tp>&);
template<class _Dom>
valarray<_Tp>& operator^= (const _Expr<_Dom,_Tp>&);
template<class _Dom>
valarray<_Tp>& operator|= (const _Expr<_Dom,_Tp>&);
template<class _Dom>
valarray<_Tp>& operator&= (const _Expr<_Dom,_Tp>&);
template<class _Dom>
valarray<_Tp>& operator<<=(const _Expr<_Dom,_Tp>&);
template<class _Dom>
valarray<_Tp>& operator>>=(const _Expr<_Dom,_Tp>&);
 
// _lib.valarray.members_ member functions:
size_t size() const;
_Tp sum() const;
_Tp min() const;
_Tp max() const;
 
// // FIXME: Extension
// _Tp product () const;
 
valarray<_Tp> shift (int) const;
valarray<_Tp> cshift(int) const;
_Expr<_ValFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(_Tp)) const;
_Expr<_RefFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(const _Tp&)) const;
void resize(size_t __size, _Tp __c = _Tp());
 
private:
size_t _M_size;
_Tp* __restrict__ _M_data;
 
friend class _Array<_Tp>;
};
 
 
template<typename _Tp> struct _Unary_plus : unary_function<_Tp,_Tp> {
_Tp operator() (const _Tp& __t) const { return __t; }
};
 
template<typename _Tp> struct _Bitwise_and : binary_function<_Tp,_Tp,_Tp> {
_Tp operator() (_Tp __x, _Tp __y) const { return __x & __y; }
};
 
template<typename _Tp> struct _Bitwise_or : binary_function<_Tp,_Tp,_Tp> {
_Tp operator() (_Tp __x, _Tp __y) const { return __x | __y; }
};
 
template<typename _Tp> struct _Bitwise_xor : binary_function<_Tp,_Tp,_Tp> {
_Tp operator() (_Tp __x, _Tp __y) const { return __x ^ __y; }
};
template<typename _Tp> struct _Bitwise_not : unary_function<_Tp,_Tp> {
_Tp operator() (_Tp __t) const { return ~__t; }
};
 
template<typename _Tp> struct _Shift_left : unary_function<_Tp,_Tp> {
_Tp operator() (_Tp __x, _Tp __y) const { return __x << __y; }
};
 
template<typename _Tp> struct _Shift_right : unary_function<_Tp,_Tp> {
_Tp operator() (_Tp __x, _Tp __y) const { return __x >> __y; }
};
 
template<typename _Tp>
inline const _Tp&
valarray<_Tp>::operator[] (size_t __i) const
{ return _M_data[__i]; }
 
template<typename _Tp>
inline _Tp&
valarray<_Tp>::operator[] (size_t __i)
{ return _M_data[__i]; }
 
} // std::
#include <bits/slice.h>
#include <bits/slice_array.h>
#include <bits/gslice.h>
#include <bits/gslice_array.h>
#include <bits/mask_array.h>
#include <bits/indirect_array.h>
 
namespace std
{
template<typename _Tp>
inline valarray<_Tp>::valarray () : _M_size (0), _M_data (0) {}
 
template<typename _Tp>
inline valarray<_Tp>::valarray (size_t __n)
: _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
{ __valarray_default_construct(_M_data, _M_data + __n); }
 
template<typename _Tp>
inline valarray<_Tp>::valarray (const _Tp& __t, size_t __n)
: _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
{ __valarray_fill_construct (_M_data, _M_data + __n, __t); }
 
template<typename _Tp>
inline valarray<_Tp>::valarray (const _Tp* __restrict__ __p, size_t __n)
: _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
{ __valarray_copy_construct (__p, __p + __n, _M_data); }
 
template<typename _Tp>
inline valarray<_Tp>::valarray (const valarray<_Tp>& __v)
: _M_size(__v._M_size), _M_data(__valarray_get_storage<_Tp>(__v._M_size))
{ __valarray_copy_construct (__v._M_data, __v._M_data + _M_size, _M_data); }
 
template<typename _Tp>
inline valarray<_Tp>::valarray (const slice_array<_Tp>& __sa)
: _M_size(__sa._M_sz), _M_data(__valarray_get_storage<_Tp>(__sa._M_sz))
{
__valarray_copy
(__sa._M_array, __sa._M_sz, __sa._M_stride, _Array<_Tp>(_M_data));
}
 
template<typename _Tp>
inline valarray<_Tp>::valarray (const gslice_array<_Tp>& __ga)
: _M_size(__ga._M_index.size()),
_M_data(__valarray_get_storage<_Tp>(_M_size))
{
__valarray_copy
(__ga._M_array, _Array<size_t>(__ga._M_index),
_Array<_Tp>(_M_data), _M_size);
}
 
template<typename _Tp>
inline valarray<_Tp>::valarray (const mask_array<_Tp>& __ma)
: _M_size(__ma._M_sz), _M_data(__valarray_get_storage<_Tp>(__ma._M_sz))
{
__valarray_copy
(__ma._M_array, __ma._M_mask, _Array<_Tp>(_M_data), _M_size);
}
 
template<typename _Tp>
inline valarray<_Tp>::valarray (const indirect_array<_Tp>& __ia)
: _M_size(__ia._M_sz), _M_data(__valarray_get_storage<_Tp>(__ia._M_sz))
{
__valarray_copy
(__ia._M_array, __ia._M_index, _Array<_Tp>(_M_data), _M_size);
}
 
template<typename _Tp> template<class _Dom>
inline valarray<_Tp>::valarray (const _Expr<_Dom, _Tp>& __e)
: _M_size(__e.size ()), _M_data(__valarray_get_storage<_Tp>(_M_size))
{ __valarray_copy (__e, _M_size, _Array<_Tp>(_M_data)); }
 
template<typename _Tp>
inline valarray<_Tp>::~valarray ()
{
__valarray_destroy_elements(_M_data, _M_data + _M_size);
__valarray_release_memory(_M_data);
}
 
template<typename _Tp>
inline valarray<_Tp>&
valarray<_Tp>::operator= (const valarray<_Tp>& __v)
{
__valarray_copy(__v._M_data, _M_size, _M_data);
return *this;
}
 
template<typename _Tp>
inline valarray<_Tp>&
valarray<_Tp>::operator= (const _Tp& __t)
{
__valarray_fill (_M_data, _M_size, __t);
return *this;
}
 
template<typename _Tp>
inline valarray<_Tp>&
valarray<_Tp>::operator= (const slice_array<_Tp>& __sa)
{
__valarray_copy (__sa._M_array, __sa._M_sz,
__sa._M_stride, _Array<_Tp>(_M_data));
return *this;
}
 
template<typename _Tp>
inline valarray<_Tp>&
valarray<_Tp>::operator= (const gslice_array<_Tp>& __ga)
{
__valarray_copy (__ga._M_array, _Array<size_t>(__ga._M_index),
_Array<_Tp>(_M_data), _M_size);
return *this;
}
 
template<typename _Tp>
inline valarray<_Tp>&
valarray<_Tp>::operator= (const mask_array<_Tp>& __ma)
{
__valarray_copy (__ma._M_array, __ma._M_mask,
_Array<_Tp>(_M_data), _M_size);
return *this;
}
 
template<typename _Tp>
inline valarray<_Tp>&
valarray<_Tp>::operator= (const indirect_array<_Tp>& __ia)
{
__valarray_copy (__ia._M_array, __ia._M_index,
_Array<_Tp>(_M_data), _M_size);
return *this;
}
 
template<typename _Tp> template<class _Dom>
inline valarray<_Tp>&
valarray<_Tp>::operator= (const _Expr<_Dom, _Tp>& __e)
{
__valarray_copy (__e, _M_size, _Array<_Tp>(_M_data));
return *this;
}
 
template<typename _Tp>
inline _Expr<_SClos<_ValArray,_Tp>, _Tp>
valarray<_Tp>::operator[] (slice __s) const
{
typedef _SClos<_ValArray,_Tp> _Closure;
return _Expr<_Closure, _Tp> (_Closure (_Array<_Tp>(_M_data), __s));
}
 
template<typename _Tp>
inline slice_array<_Tp>
valarray<_Tp>::operator[] (slice __s)
{
return slice_array<_Tp> (_Array<_Tp>(_M_data), __s);
}
 
template<typename _Tp>
inline _Expr<_GClos<_ValArray,_Tp>, _Tp>
valarray<_Tp>::operator[] (const gslice& __gs) const
{
typedef _GClos<_ValArray,_Tp> _Closure;
return _Expr<_Closure, _Tp>
(_Closure (_Array<_Tp>(_M_data), __gs._M_index->_M_index));
}
 
template<typename _Tp>
inline gslice_array<_Tp>
valarray<_Tp>::operator[] (const gslice& __gs)
{
return gslice_array<_Tp>
(_Array<_Tp>(_M_data), __gs._M_index->_M_index);
}
 
template<typename _Tp>
inline valarray<_Tp>
valarray<_Tp>::operator[] (const valarray<bool>& __m) const
{
size_t __s (0);
size_t __e (__m.size ());
for (size_t __i=0; __i<__e; ++__i)
if (__m[__i]) ++__s;
return valarray<_Tp> (mask_array<_Tp> (_Array<_Tp>(_M_data), __s,
_Array<bool> (__m)));
}
 
template<typename _Tp>
inline mask_array<_Tp>
valarray<_Tp>::operator[] (const valarray<bool>& __m)
{
size_t __s (0);
size_t __e (__m.size ());
for (size_t __i=0; __i<__e; ++__i)
if (__m[__i]) ++__s;
return mask_array<_Tp> (_Array<_Tp>(_M_data), __s, _Array<bool> (__m));
}
 
template<typename _Tp>
inline _Expr<_IClos<_ValArray,_Tp>, _Tp>
valarray<_Tp>::operator[] (const valarray<size_t>& __i) const
{
typedef _IClos<_ValArray,_Tp> _Closure;
return _Expr<_Closure, _Tp> (_Closure (*this, __i));
}
 
template<typename _Tp>
inline indirect_array<_Tp>
valarray<_Tp>::operator[] (const valarray<size_t>& __i)
{
return indirect_array<_Tp> (_Array<_Tp>(_M_data), __i.size(),
_Array<size_t> (__i));
}
 
template<class _Tp>
inline size_t valarray<_Tp>::size () const { return _M_size; }
 
template<class _Tp>
inline _Tp
valarray<_Tp>::sum () const
{
return __valarray_sum(_M_data, _M_data + _M_size);
}
 
// template<typename _Tp>
// inline _Tp
// valarray<_Tp>::product () const
// {
// return __valarray_product(_M_data, _M_data + _M_size);
// }
 
template <class _Tp>
inline valarray<_Tp>
valarray<_Tp>::shift(int __n) const
{
_Tp* const __a = static_cast<_Tp*>
(__builtin_alloca(sizeof(_Tp) * _M_size));
if (__n == 0) // no shift
__valarray_copy_construct(_M_data, _M_data + _M_size, __a);
else if (__n > 0) // __n > 0: shift left
{
if (size_t(__n) > _M_size)
__valarray_default_construct(__a, __a + __n);
else
{
__valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a);
__valarray_default_construct(__a+_M_size-__n, __a + _M_size);
}
}
else // __n < 0: shift right
{
__valarray_copy_construct (_M_data, _M_data+_M_size+__n, __a-__n);
__valarray_default_construct(__a, __a - __n);
}
return valarray<_Tp> (__a, _M_size);
}
 
template <class _Tp>
inline valarray<_Tp>
valarray<_Tp>::cshift (int __n) const
{
_Tp* const __a = static_cast<_Tp*>
(__builtin_alloca (sizeof(_Tp) * _M_size));
if (__n == 0) // no cshift
__valarray_copy_construct(_M_data, _M_data + _M_size, __a);
else if (__n > 0) // cshift left
{
__valarray_copy_construct(_M_data, _M_data+__n, __a+_M_size-__n);
__valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a);
}
else // cshift right
{
__valarray_copy_construct
(_M_data + _M_size+__n, _M_data + _M_size, __a);
__valarray_copy_construct
(_M_data, _M_data + _M_size+__n, __a - __n);
}
return valarray<_Tp>(__a, _M_size);
}
 
template <class _Tp>
inline void
valarray<_Tp>::resize (size_t __n, _Tp __c)
{
// This complication is so to make valarray<valarray<T> > work
// even though it is not required by the standard. Nobody should
// be saying valarray<valarray<T> > anyway. See the specs.
__valarray_destroy_elements(_M_data, _M_data + _M_size);
if (_M_size != __n)
{
__valarray_release_memory(_M_data);
_M_size = __n;
_M_data = __valarray_get_storage<_Tp>(__n);
}
__valarray_fill_construct(_M_data, _M_data + __n, __c);
}
template<typename _Tp>
inline _Tp
valarray<_Tp>::min() const
{
return *min_element (_M_data, _M_data+_M_size);
}
 
template<typename _Tp>
inline _Tp
valarray<_Tp>::max() const
{
return *max_element (_M_data, _M_data+_M_size);
}
template<class _Tp>
inline _Expr<_ValFunClos<_ValArray,_Tp>,_Tp>
valarray<_Tp>::apply (_Tp func (_Tp)) const
{
typedef _ValFunClos<_ValArray,_Tp> _Closure;
return _Expr<_Closure,_Tp> (_Closure (*this, func));
}
 
template<class _Tp>
inline _Expr<_RefFunClos<_ValArray,_Tp>,_Tp>
valarray<_Tp>::apply (_Tp func (const _Tp &)) const
{
typedef _RefFunClos<_ValArray,_Tp> _Closure;
return _Expr<_Closure,_Tp> (_Closure (*this, func));
}
 
#define _DEFINE_VALARRAY_UNARY_OPERATOR(_Op, _Name) \
template<typename _Tp> \
inline _Expr<_UnClos<_Name,_ValArray,_Tp>, _Tp> \
valarray<_Tp>::operator _Op() const \
{ \
typedef _UnClos<_Name,_ValArray,_Tp> _Closure; \
return _Expr<_Closure, _Tp> (_Closure (*this)); \
}
 
_DEFINE_VALARRAY_UNARY_OPERATOR(+, _Unary_plus)
_DEFINE_VALARRAY_UNARY_OPERATOR(-, negate)
_DEFINE_VALARRAY_UNARY_OPERATOR(~, _Bitwise_not)
 
#undef _DEFINE_VALARRAY_UNARY_OPERATOR
template<typename _Tp>
inline _Expr<_UnClos<logical_not,_ValArray,_Tp>, bool>
valarray<_Tp>::operator!() const
{
typedef _UnClos<logical_not,_ValArray,_Tp> _Closure;
return _Expr<_Closure, bool> (_Closure (*this));
}
 
#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name) \
template<class _Tp> \
inline valarray<_Tp> & \
valarray<_Tp>::operator _Op##= (const _Tp &__t) \
{ \
_Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, __t); \
return *this; \
} \
\
template<class _Tp> \
inline valarray<_Tp> & \
valarray<_Tp>::operator _Op##= (const valarray<_Tp> &__v) \
{ \
_Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, \
_Array<_Tp>(__v._M_data)); \
return *this; \
}
 
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(+, plus)
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(-, minus)
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(*, multiplies)
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(/, divides)
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(%, modulus)
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(^, xor)
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(&, and)
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(|, or)
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(<<, shift_left)
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, shift_right)
 
#undef _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT
 
 
} // std::
 
namespace std
{
 
#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \
template<class _Tp> template<class _Dom> \
inline valarray<_Tp> & \
valarray<_Tp>::operator _Op##= (const _Expr<_Dom,_Tp> &__e) \
{ \
_Array_augmented_##_Name (_Array<_Tp>(_M_data), __e, _M_size); \
return *this; \
}
 
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(+, plus)
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(-, minus)
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(*, multiplies)
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(/, divides)
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(%, modulus)
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(^, xor)
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(&, and)
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(|, or)
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(<<, shift_left)
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, shift_right)
 
#undef _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT
 
#define _DEFINE_BINARY_OPERATOR(_Op, _Name) \
template<typename _Tp> \
inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>, _Tp> \
operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
{ \
typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \
return _Expr<_Closure, _Tp> (_Closure (__v, __w)); \
} \
\
template<typename _Tp> \
inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,_Tp> \
operator _Op (const valarray<_Tp> &__v, const _Tp &__t) \
{ \
typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \
return _Expr<_Closure, _Tp> (_Closure (__v, __t)); \
} \
\
template<typename _Tp> \
inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,_Tp> \
operator _Op (const _Tp &__t, const valarray<_Tp> &__v) \
{ \
typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \
return _Expr<_Closure, _Tp> (_Closure (__t, __v)); \
}
 
_DEFINE_BINARY_OPERATOR(+, plus)
_DEFINE_BINARY_OPERATOR(-, minus)
_DEFINE_BINARY_OPERATOR(*, multiplies)
_DEFINE_BINARY_OPERATOR(/, divides)
_DEFINE_BINARY_OPERATOR(%, modulus)
_DEFINE_BINARY_OPERATOR(^, _Bitwise_xor)
_DEFINE_BINARY_OPERATOR(&, _Bitwise_and)
_DEFINE_BINARY_OPERATOR(|, _Bitwise_or)
_DEFINE_BINARY_OPERATOR(<<, _Shift_left)
_DEFINE_BINARY_OPERATOR(>>, _Shift_right)
 
#undef _DEFINE_BINARY_OPERATOR
 
#define _DEFINE_LOGICAL_OPERATOR(_Op, _Name) \
template<typename _Tp> \
inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>,bool> \
operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
{ \
typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \
return _Expr<_Closure, bool> (_Closure (__v, __w)); \
} \
\
template<class _Tp> \
inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,bool> \
operator _Op (const valarray<_Tp> &__v, const _Tp &__t) \
{ \
typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \
return _Expr<_Closure, bool> (_Closure (__v, __t)); \
} \
\
template<class _Tp> \
inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,bool> \
operator _Op (const _Tp &__t, const valarray<_Tp> &__v) \
{ \
typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \
return _Expr<_Closure, bool> (_Closure (__t, __v)); \
}
 
_DEFINE_LOGICAL_OPERATOR(&&, logical_and)
_DEFINE_LOGICAL_OPERATOR(||, logical_or)
_DEFINE_LOGICAL_OPERATOR(==, equal_to)
_DEFINE_LOGICAL_OPERATOR(!=, not_equal_to)
_DEFINE_LOGICAL_OPERATOR(<, less)
_DEFINE_LOGICAL_OPERATOR(>, greater)
_DEFINE_LOGICAL_OPERATOR(<=, less_equal)
_DEFINE_LOGICAL_OPERATOR(>=, greater_equal)
 
#undef _DEFINE_LOGICAL_OPERATOR
 
} // namespace std
 
#endif // _CPP_VALARRAY
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/std_vector.h
0,0 → 1,44
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_VECTOR
#define _CPP_VECTOR 1
 
#pragma GCC system_header
 
#include <bits/functexcept.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_vector.h>
#include <bits/stl_bvector.h>
 
#endif /* _CPP_VECTOR */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stdio.h
0,0 → 1,16
#ifndef __BITS_STDIO_H
#define __BITS_STDIO_H
 
struct file_stream_ops {
int (* s_putc)(struct __FILE *,int);
int (* s_getc)(struct __FILE *,int *);
int (* s_read)(struct __FILE *,void *,int);
int (* s_write)(struct __FILE *,void *,int);
int (* s_seek)(struct __FILE *,int,int);
int (* s_flush)(struct __FILE *);
};
 
#define STM_OP(x,n) \
(x)->std_ops->s_##n
 
#endif
/contrib/media/updf/include/bits/stl_algo.h
0,0 → 1,3643
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_ALGO_H
#define __SGI_STL_INTERNAL_ALGO_H
 
#include <bits/stl_heap.h>
 
// See concept_check.h for the __glibcpp_*_requires macros.
 
namespace std
{
 
// __median (an extension, not present in the C++ standard).
 
template <class _Tp>
inline const _Tp& __median(const _Tp& __a, const _Tp& __b, const _Tp& __c)
{
// concept requirements
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
if (__a < __b)
if (__b < __c)
return __b;
else if (__a < __c)
return __c;
else
return __a;
else if (__a < __c)
return __a;
else if (__b < __c)
return __c;
else
return __b;
}
 
template <class _Tp, class _Compare>
inline const _Tp&
__median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_BinaryFunctionConcept<_Compare, bool, _Tp, _Tp>);
if (__comp(__a, __b))
if (__comp(__b, __c))
return __b;
else if (__comp(__a, __c))
return __c;
else
return __a;
else if (__comp(__a, __c))
return __a;
else if (__comp(__b, __c))
return __c;
else
return __b;
}
 
// for_each. Apply a function to every element of a range.
template <class _InputIter, class _Function>
_Function for_each(_InputIter __first, _InputIter __last, _Function __f)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
for ( ; __first != __last; ++__first)
__f(*__first);
return __f;
}
 
// find and find_if.
 
template <class _InputIter, class _Tp>
inline _InputIter find(_InputIter __first, _InputIter __last,
const _Tp& __val,
input_iterator_tag)
{
while (__first != __last && !(*__first == __val))
++__first;
return __first;
}
 
template <class _InputIter, class _Predicate>
inline _InputIter find_if(_InputIter __first, _InputIter __last,
_Predicate __pred,
input_iterator_tag)
{
while (__first != __last && !__pred(*__first))
++__first;
return __first;
}
 
template <class _RandomAccessIter, class _Tp>
_RandomAccessIter find(_RandomAccessIter __first, _RandomAccessIter __last,
const _Tp& __val,
random_access_iterator_tag)
{
typename iterator_traits<_RandomAccessIter>::difference_type __trip_count
= (__last - __first) >> 2;
 
for ( ; __trip_count > 0 ; --__trip_count) {
if (*__first == __val) return __first;
++__first;
 
if (*__first == __val) return __first;
++__first;
 
if (*__first == __val) return __first;
++__first;
 
if (*__first == __val) return __first;
++__first;
}
 
switch(__last - __first) {
case 3:
if (*__first == __val) return __first;
++__first;
case 2:
if (*__first == __val) return __first;
++__first;
case 1:
if (*__first == __val) return __first;
++__first;
case 0:
default:
return __last;
}
}
 
template <class _RandomAccessIter, class _Predicate>
_RandomAccessIter find_if(_RandomAccessIter __first, _RandomAccessIter __last,
_Predicate __pred,
random_access_iterator_tag)
{
typename iterator_traits<_RandomAccessIter>::difference_type __trip_count
= (__last - __first) >> 2;
 
for ( ; __trip_count > 0 ; --__trip_count) {
if (__pred(*__first)) return __first;
++__first;
 
if (__pred(*__first)) return __first;
++__first;
 
if (__pred(*__first)) return __first;
++__first;
 
if (__pred(*__first)) return __first;
++__first;
}
 
switch(__last - __first) {
case 3:
if (__pred(*__first)) return __first;
++__first;
case 2:
if (__pred(*__first)) return __first;
++__first;
case 1:
if (__pred(*__first)) return __first;
++__first;
case 0:
default:
return __last;
}
}
 
template <class _InputIter, class _Tp>
inline _InputIter find(_InputIter __first, _InputIter __last,
const _Tp& __val)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIter>::value_type, _Tp>);
return find(__first, __last, __val, __iterator_category(__first));
}
 
template <class _InputIter, class _Predicate>
inline _InputIter find_if(_InputIter __first, _InputIter __last,
_Predicate __pred)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIter>::value_type>);
return find_if(__first, __last, __pred, __iterator_category(__first));
}
 
// adjacent_find.
 
template <class _ForwardIter>
_ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_EqualityComparableConcept<
typename iterator_traits<_ForwardIter>::value_type>);
if (__first == __last)
return __last;
_ForwardIter __next = __first;
while(++__next != __last) {
if (*__first == *__next)
return __first;
__first = __next;
}
return __last;
}
 
template <class _ForwardIter, class _BinaryPredicate>
_ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last,
_BinaryPredicate __binary_pred)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
typename iterator_traits<_ForwardIter>::value_type,
typename iterator_traits<_ForwardIter>::value_type>);
if (__first == __last)
return __last;
_ForwardIter __next = __first;
while(++__next != __last) {
if (__binary_pred(*__first, *__next))
return __first;
__first = __next;
}
return __last;
}
 
// count and count_if. There are two version of each, one whose return type
// type is void and one (present only if we have partial specialization)
// whose return type is iterator_traits<_InputIter>::difference_type. The
// C++ standard only has the latter version, but the former, which was present
// in the HP STL, is retained for backward compatibility.
 
template <class _InputIter, class _Tp, class _Size>
void count(_InputIter __first, _InputIter __last, const _Tp& __value,
_Size& __n)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_EqualityComparableConcept<
typename iterator_traits<_InputIter>::value_type >);
__glibcpp_function_requires(_EqualityComparableConcept<_Tp>);
for ( ; __first != __last; ++__first)
if (*__first == __value)
++__n;
}
 
template <class _InputIter, class _Predicate, class _Size>
void count_if(_InputIter __first, _InputIter __last, _Predicate __pred,
_Size& __n)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIter>::value_type>);
for ( ; __first != __last; ++__first)
if (__pred(*__first))
++__n;
}
 
template <class _InputIter, class _Tp>
typename iterator_traits<_InputIter>::difference_type
count(_InputIter __first, _InputIter __last, const _Tp& __value)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_EqualityComparableConcept<
typename iterator_traits<_InputIter>::value_type >);
__glibcpp_function_requires(_EqualityComparableConcept<_Tp>);
typename iterator_traits<_InputIter>::difference_type __n = 0;
for ( ; __first != __last; ++__first)
if (*__first == __value)
++__n;
return __n;
}
 
template <class _InputIter, class _Predicate>
typename iterator_traits<_InputIter>::difference_type
count_if(_InputIter __first, _InputIter __last, _Predicate __pred)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIter>::value_type>);
typename iterator_traits<_InputIter>::difference_type __n = 0;
for ( ; __first != __last; ++__first)
if (__pred(*__first))
++__n;
return __n;
}
 
 
// search.
 
template <class _ForwardIter1, class _ForwardIter2>
_ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2, _ForwardIter2 __last2)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>);
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>);
__glibcpp_function_requires(_EqualOpConcept<
typename iterator_traits<_ForwardIter1>::value_type,
typename iterator_traits<_ForwardIter2>::value_type>);
 
// Test for empty ranges
if (__first1 == __last1 || __first2 == __last2)
return __first1;
 
// Test for a pattern of length 1.
_ForwardIter2 __tmp(__first2);
++__tmp;
if (__tmp == __last2)
return find(__first1, __last1, *__first2);
 
// General case.
 
_ForwardIter2 __p1, __p;
 
__p1 = __first2; ++__p1;
 
_ForwardIter1 __current = __first1;
 
while (__first1 != __last1) {
__first1 = find(__first1, __last1, *__first2);
if (__first1 == __last1)
return __last1;
 
__p = __p1;
__current = __first1;
if (++__current == __last1)
return __last1;
 
while (*__current == *__p) {
if (++__p == __last2)
return __first1;
if (++__current == __last1)
return __last1;
}
 
++__first1;
}
return __first1;
}
 
template <class _ForwardIter1, class _ForwardIter2, class _BinaryPred>
_ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2, _ForwardIter2 __last2,
_BinaryPred __predicate)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>);
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>);
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPred,
typename iterator_traits<_ForwardIter1>::value_type,
typename iterator_traits<_ForwardIter2>::value_type>);
 
// Test for empty ranges
if (__first1 == __last1 || __first2 == __last2)
return __first1;
 
// Test for a pattern of length 1.
_ForwardIter2 __tmp(__first2);
++__tmp;
if (__tmp == __last2) {
while (__first1 != __last1 && !__predicate(*__first1, *__first2))
++__first1;
return __first1;
}
 
// General case.
 
_ForwardIter2 __p1, __p;
 
__p1 = __first2; ++__p1;
 
_ForwardIter1 __current = __first1;
 
while (__first1 != __last1) {
while (__first1 != __last1) {
if (__predicate(*__first1, *__first2))
break;
++__first1;
}
while (__first1 != __last1 && !__predicate(*__first1, *__first2))
++__first1;
if (__first1 == __last1)
return __last1;
 
__p = __p1;
__current = __first1;
if (++__current == __last1) return __last1;
 
while (__predicate(*__current, *__p)) {
if (++__p == __last2)
return __first1;
if (++__current == __last1)
return __last1;
}
 
++__first1;
}
return __first1;
}
 
// search_n. Search for __count consecutive copies of __val.
 
template <class _ForwardIter, class _Integer, class _Tp>
_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
_Integer __count, const _Tp& __val)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_EqualityComparableConcept<
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_EqualityComparableConcept<_Tp>);
 
if (__count <= 0)
return __first;
else {
__first = find(__first, __last, __val);
while (__first != __last) {
_Integer __n = __count - 1;
_ForwardIter __i = __first;
++__i;
while (__i != __last && __n != 0 && *__i == __val) {
++__i;
--__n;
}
if (__n == 0)
return __first;
else
__first = find(__i, __last, __val);
}
return __last;
}
}
 
template <class _ForwardIter, class _Integer, class _Tp, class _BinaryPred>
_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
_Integer __count, const _Tp& __val,
_BinaryPred __binary_pred)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPred,
typename iterator_traits<_ForwardIter>::value_type, _Tp>);
 
if (__count <= 0)
return __first;
else {
while (__first != __last) {
if (__binary_pred(*__first, __val))
break;
++__first;
}
while (__first != __last) {
_Integer __n = __count - 1;
_ForwardIter __i = __first;
++__i;
while (__i != __last && __n != 0 && __binary_pred(*__i, __val)) {
++__i;
--__n;
}
if (__n == 0)
return __first;
else {
while (__i != __last) {
if (__binary_pred(*__i, __val))
break;
++__i;
}
__first = __i;
}
}
return __last;
}
}
 
// swap_ranges
 
template <class _ForwardIter1, class _ForwardIter2>
_ForwardIter2 swap_ranges(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter1>);
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter2>);
__glibcpp_function_requires(_ConvertibleConcept<
typename iterator_traits<_ForwardIter1>::value_type,
typename iterator_traits<_ForwardIter2>::value_type>);
__glibcpp_function_requires(_ConvertibleConcept<
typename iterator_traits<_ForwardIter2>::value_type,
typename iterator_traits<_ForwardIter1>::value_type>);
 
for ( ; __first1 != __last1; ++__first1, ++__first2)
iter_swap(__first1, __first2);
return __first2;
}
 
// transform
 
template <class _InputIter, class _OutputIter, class _UnaryOperation>
_OutputIter transform(_InputIter __first, _InputIter __last,
_OutputIter __result, _UnaryOperation __unary_op)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
/* XXX
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
// should be "the type returned by _UnaryOperation"
typename iterator_traits<_InputIter>::value_type>);
*/
 
for ( ; __first != __last; ++__first, ++__result)
*__result = __unary_op(*__first);
return __result;
}
 
template <class _InputIter1, class _InputIter2, class _OutputIter,
class _BinaryOperation>
_OutputIter transform(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _OutputIter __result,
_BinaryOperation __binary_op)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
/* XXX
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
// should be "the type returned by _BinaryOperation"
typename iterator_traits<_InputIter1>::value_type>);
*/
 
for ( ; __first1 != __last1; ++__first1, ++__first2, ++__result)
*__result = __binary_op(*__first1, *__first2);
return __result;
}
 
// replace, replace_if, replace_copy, replace_copy_if
 
template <class _ForwardIter, class _Tp>
void replace(_ForwardIter __first, _ForwardIter __last,
const _Tp& __old_value, const _Tp& __new_value)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_EqualOpConcept<
typename iterator_traits<_ForwardIter>::value_type, _Tp>);
__glibcpp_function_requires(_ConvertibleConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
 
for ( ; __first != __last; ++__first)
if (*__first == __old_value)
*__first = __new_value;
}
 
template <class _ForwardIter, class _Predicate, class _Tp>
void replace_if(_ForwardIter __first, _ForwardIter __last,
_Predicate __pred, const _Tp& __new_value)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_ConvertibleConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_ForwardIter>::value_type>);
 
for ( ; __first != __last; ++__first)
if (__pred(*__first))
*__first = __new_value;
}
 
template <class _InputIter, class _OutputIter, class _Tp>
_OutputIter replace_copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
const _Tp& __old_value, const _Tp& __new_value)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter>::value_type>);
__glibcpp_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIter>::value_type, _Tp>);
 
for ( ; __first != __last; ++__first, ++__result)
*__result = *__first == __old_value ? __new_value : *__first;
return __result;
}
 
template <class _InputIter, class _OutputIter, class _Predicate, class _Tp>
_OutputIter replace_copy_if(_InputIter __first, _InputIter __last,
_OutputIter __result,
_Predicate __pred, const _Tp& __new_value)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter>::value_type>);
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIter>::value_type>);
 
for ( ; __first != __last; ++__first, ++__result)
*__result = __pred(*__first) ? __new_value : *__first;
return __result;
}
 
// generate and generate_n
 
template <class _ForwardIter, class _Generator>
void generate(_ForwardIter __first, _ForwardIter __last, _Generator __gen)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_GeneratorConcept<_Generator,
typename iterator_traits<_ForwardIter>::value_type>);
 
for ( ; __first != __last; ++__first)
*__first = __gen();
}
 
template <class _OutputIter, class _Size, class _Generator>
_OutputIter generate_n(_OutputIter __first, _Size __n, _Generator __gen)
{
/*
// XXX concept requirements
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
"the return type of _Generator" ?? >);
*/
 
for ( ; __n > 0; --__n, ++__first)
*__first = __gen();
return __first;
}
 
// remove, remove_if, remove_copy, remove_copy_if
 
template <class _InputIter, class _OutputIter, class _Tp>
_OutputIter remove_copy(_InputIter __first, _InputIter __last,
_OutputIter __result, const _Tp& __value)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter>::value_type>);
__glibcpp_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIter>::value_type, _Tp>);
 
for ( ; __first != __last; ++__first)
if (!(*__first == __value)) {
*__result = *__first;
++__result;
}
return __result;
}
 
template <class _InputIter, class _OutputIter, class _Predicate>
_OutputIter remove_copy_if(_InputIter __first, _InputIter __last,
_OutputIter __result, _Predicate __pred)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter>::value_type>);
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIter>::value_type>);
 
for ( ; __first != __last; ++__first)
if (!__pred(*__first)) {
*__result = *__first;
++__result;
}
return __result;
}
 
template <class _ForwardIter, class _Tp>
_ForwardIter remove(_ForwardIter __first, _ForwardIter __last,
const _Tp& __value)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_ConvertibleConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_EqualOpConcept<
typename iterator_traits<_ForwardIter>::value_type, _Tp>);
 
__first = find(__first, __last, __value);
_ForwardIter __i = __first;
return __first == __last ? __first
: remove_copy(++__i, __last, __first, __value);
}
 
template <class _ForwardIter, class _Predicate>
_ForwardIter remove_if(_ForwardIter __first, _ForwardIter __last,
_Predicate __pred)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_ForwardIter>::value_type>);
 
__first = find_if(__first, __last, __pred);
_ForwardIter __i = __first;
return __first == __last ? __first
: remove_copy_if(++__i, __last, __first, __pred);
}
 
// unique and unique_copy
 
template <class _InputIter, class _OutputIter, class _Tp>
_OutputIter __unique_copy(_InputIter __first, _InputIter __last,
_OutputIter __result, _Tp*)
{
// concept requirements -- taken care of in dispatching function
_Tp __value = *__first;
*__result = __value;
while (++__first != __last)
if (!(__value == *__first)) {
__value = *__first;
*++__result = __value;
}
return ++__result;
}
 
template <class _InputIter, class _OutputIter>
inline _OutputIter __unique_copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
output_iterator_tag)
{
// concept requirements -- taken care of in dispatching function
return __unique_copy(__first, __last, __result, __value_type(__first));
}
 
template <class _InputIter, class _ForwardIter>
_ForwardIter __unique_copy(_InputIter __first, _InputIter __last,
_ForwardIter __result, forward_iterator_tag)
{
// concept requirements -- taken care of in dispatching function
*__result = *__first;
while (++__first != __last)
if (!(*__result == *__first))
*++__result = *__first;
return ++__result;
}
 
template <class _InputIter, class _OutputIter>
inline _OutputIter unique_copy(_InputIter __first, _InputIter __last,
_OutputIter __result)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter>::value_type>);
__glibcpp_function_requires(_EqualityComparableConcept<
typename iterator_traits<_InputIter>::value_type>);
 
if (__first == __last) return __result;
return __unique_copy(__first, __last, __result,
__iterator_category(__result));
}
 
template <class _InputIter, class _OutputIter, class _BinaryPredicate,
class _Tp>
_OutputIter __unique_copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
_BinaryPredicate __binary_pred, _Tp*)
{
// concept requirements -- iterators already checked
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, _Tp, _Tp>);
 
_Tp __value = *__first;
*__result = __value;
while (++__first != __last)
if (!__binary_pred(__value, *__first)) {
__value = *__first;
*++__result = __value;
}
return ++__result;
}
 
template <class _InputIter, class _OutputIter, class _BinaryPredicate>
inline _OutputIter __unique_copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
_BinaryPredicate __binary_pred,
output_iterator_tag)
{
// concept requirements -- taken care of in dispatching function
return __unique_copy(__first, __last, __result, __binary_pred,
__value_type(__first));
}
 
template <class _InputIter, class _ForwardIter, class _BinaryPredicate>
_ForwardIter __unique_copy(_InputIter __first, _InputIter __last,
_ForwardIter __result,
_BinaryPredicate __binary_pred,
forward_iterator_tag)
{
// concept requirements -- iterators already checked
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
typename iterator_traits<_ForwardIter>::value_type,
typename iterator_traits<_InputIter>::value_type>);
 
*__result = *__first;
while (++__first != __last)
if (!__binary_pred(*__result, *__first)) *++__result = *__first;
return ++__result;
}
 
template <class _InputIter, class _OutputIter, class _BinaryPredicate>
inline _OutputIter unique_copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
_BinaryPredicate __binary_pred)
{
// concept requirements -- predicates checked later
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter>::value_type>);
 
if (__first == __last) return __result;
return __unique_copy(__first, __last, __result, __binary_pred,
__iterator_category(__result));
}
 
template <class _ForwardIter>
_ForwardIter unique(_ForwardIter __first, _ForwardIter __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_EqualityComparableConcept<
typename iterator_traits<_ForwardIter>::value_type>);
 
__first = adjacent_find(__first, __last);
return unique_copy(__first, __last, __first);
}
 
template <class _ForwardIter, class _BinaryPredicate>
_ForwardIter unique(_ForwardIter __first, _ForwardIter __last,
_BinaryPredicate __binary_pred)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
typename iterator_traits<_ForwardIter>::value_type,
typename iterator_traits<_ForwardIter>::value_type>);
 
__first = adjacent_find(__first, __last, __binary_pred);
return unique_copy(__first, __last, __first, __binary_pred);
}
 
// reverse and reverse_copy, and their auxiliary functions
 
template <class _BidirectionalIter>
void __reverse(_BidirectionalIter __first, _BidirectionalIter __last,
bidirectional_iterator_tag) {
while (true)
if (__first == __last || __first == --__last)
return;
else
iter_swap(__first++, __last);
}
 
template <class _RandomAccessIter>
void __reverse(_RandomAccessIter __first, _RandomAccessIter __last,
random_access_iterator_tag) {
while (__first < __last)
iter_swap(__first++, --__last);
}
 
template <class _BidirectionalIter>
inline void reverse(_BidirectionalIter __first, _BidirectionalIter __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
_BidirectionalIter>);
__reverse(__first, __last, __iterator_category(__first));
}
 
template <class _BidirectionalIter, class _OutputIter>
_OutputIter reverse_copy(_BidirectionalIter __first,
_BidirectionalIter __last,
_OutputIter __result)
{
// concept requirements
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_BidirectionalIter>::value_type>);
 
while (__first != __last) {
--__last;
*__result = *__last;
++__result;
}
return __result;
}
 
// rotate and rotate_copy, and their auxiliary functions
 
template <class _EuclideanRingElement>
_EuclideanRingElement __gcd(_EuclideanRingElement __m,
_EuclideanRingElement __n)
{
while (__n != 0) {
_EuclideanRingElement __t = __m % __n;
__m = __n;
__n = __t;
}
return __m;
}
 
template <class _ForwardIter, class _Distance>
_ForwardIter __rotate(_ForwardIter __first,
_ForwardIter __middle,
_ForwardIter __last,
_Distance*,
forward_iterator_tag)
{
if (__first == __middle)
return __last;
if (__last == __middle)
return __first;
 
_ForwardIter __first2 = __middle;
do {
swap(*__first++, *__first2++);
if (__first == __middle)
__middle = __first2;
} while (__first2 != __last);
 
_ForwardIter __new_middle = __first;
 
__first2 = __middle;
 
while (__first2 != __last) {
swap (*__first++, *__first2++);
if (__first == __middle)
__middle = __first2;
else if (__first2 == __last)
__first2 = __middle;
}
 
return __new_middle;
}
 
 
template <class _BidirectionalIter, class _Distance>
_BidirectionalIter __rotate(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last,
_Distance*,
bidirectional_iterator_tag)
{
// concept requirements
__glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
_BidirectionalIter>);
 
if (__first == __middle)
return __last;
if (__last == __middle)
return __first;
 
__reverse(__first, __middle, bidirectional_iterator_tag());
__reverse(__middle, __last, bidirectional_iterator_tag());
 
while (__first != __middle && __middle != __last)
swap (*__first++, *--__last);
 
if (__first == __middle) {
__reverse(__middle, __last, bidirectional_iterator_tag());
return __last;
}
else {
__reverse(__first, __middle, bidirectional_iterator_tag());
return __first;
}
}
 
template <class _RandomAccessIter, class _Distance, class _Tp>
_RandomAccessIter __rotate(_RandomAccessIter __first,
_RandomAccessIter __middle,
_RandomAccessIter __last,
_Distance *, _Tp *)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
 
_Distance __n = __last - __first;
_Distance __k = __middle - __first;
_Distance __l = __n - __k;
_RandomAccessIter __result = __first + (__last - __middle);
 
if (__k == 0)
return __last;
 
else if (__k == __l) {
swap_ranges(__first, __middle, __middle);
return __result;
}
 
_Distance __d = __gcd(__n, __k);
 
for (_Distance __i = 0; __i < __d; __i++) {
_Tp __tmp = *__first;
_RandomAccessIter __p = __first;
 
if (__k < __l) {
for (_Distance __j = 0; __j < __l/__d; __j++) {
if (__p > __first + __l) {
*__p = *(__p - __l);
__p -= __l;
}
 
*__p = *(__p + __k);
__p += __k;
}
}
 
else {
for (_Distance __j = 0; __j < __k/__d - 1; __j ++) {
if (__p < __last - __k) {
*__p = *(__p + __k);
__p += __k;
}
 
*__p = * (__p - __l);
__p -= __l;
}
}
 
*__p = __tmp;
++__first;
}
 
return __result;
}
 
template <class _ForwardIter>
inline _ForwardIter rotate(_ForwardIter __first, _ForwardIter __middle,
_ForwardIter __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
 
return __rotate(__first, __middle, __last,
__distance_type(__first),
__iterator_category(__first));
}
 
template <class _ForwardIter, class _OutputIter>
_OutputIter rotate_copy(_ForwardIter __first, _ForwardIter __middle,
_ForwardIter __last, _OutputIter __result)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_ForwardIter>::value_type>);
 
return copy(__first, __middle, copy(__middle, __last, __result));
}
 
// Return a random number in the range [0, __n). This function encapsulates
// whether we're using rand (part of the standard C library) or lrand48
// (not standard, but a much better choice whenever it's available).
template <class _Distance>
inline _Distance __random_number(_Distance __n) {
#ifdef _GLIBCPP_HAVE_DRAND48
return lrand48() % __n;
#else
return rand() % __n;
#endif
}
 
// random_shuffle
 
template <class _RandomAccessIter>
inline void random_shuffle(_RandomAccessIter __first,
_RandomAccessIter __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
 
if (__first == __last) return;
for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
iter_swap(__i, __first + __random_number((__i - __first) + 1));
}
 
template <class _RandomAccessIter, class _RandomNumberGenerator>
void random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last,
_RandomNumberGenerator& __rand)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
 
if (__first == __last) return;
for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
iter_swap(__i, __first + __rand((__i - __first) + 1));
}
 
// random_sample and random_sample_n (extensions, not part of the standard).
 
template <class _ForwardIter, class _OutputIter, class _Distance>
_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last,
_OutputIter __out, const _Distance __n)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_ForwardIter>::value_type>);
 
_Distance __remaining = 0;
distance(__first, __last, __remaining);
_Distance __m = min(__n, __remaining);
 
while (__m > 0) {
if (__random_number(__remaining) < __m) {
*__out = *__first;
++__out;
--__m;
}
 
--__remaining;
++__first;
}
return __out;
}
 
template <class _ForwardIter, class _OutputIter, class _Distance,
class _RandomNumberGenerator>
_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last,
_OutputIter __out, const _Distance __n,
_RandomNumberGenerator& __rand)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_UnaryFunctionConcept<
_RandomNumberGenerator, _Distance, _Distance>);
 
_Distance __remaining = 0;
distance(__first, __last, __remaining);
_Distance __m = min(__n, __remaining);
 
while (__m > 0) {
if (__rand(__remaining) < __m) {
*__out = *__first;
++__out;
--__m;
}
 
--__remaining;
++__first;
}
return __out;
}
 
template <class _InputIter, class _RandomAccessIter, class _Distance>
_RandomAccessIter __random_sample(_InputIter __first, _InputIter __last,
_RandomAccessIter __out,
const _Distance __n)
{
_Distance __m = 0;
_Distance __t = __n;
for ( ; __first != __last && __m < __n; ++__m, ++__first)
__out[__m] = *__first;
 
while (__first != __last) {
++__t;
_Distance __M = __random_number(__t);
if (__M < __n)
__out[__M] = *__first;
++__first;
}
 
return __out + __m;
}
 
template <class _InputIter, class _RandomAccessIter,
class _RandomNumberGenerator, class _Distance>
_RandomAccessIter __random_sample(_InputIter __first, _InputIter __last,
_RandomAccessIter __out,
_RandomNumberGenerator& __rand,
const _Distance __n)
{
// concept requirements
__glibcpp_function_requires(_UnaryFunctionConcept<
_RandomNumberGenerator, _Distance, _Distance>);
 
_Distance __m = 0;
_Distance __t = __n;
for ( ; __first != __last && __m < __n; ++__m, ++__first)
__out[__m] = *__first;
 
while (__first != __last) {
++__t;
_Distance __M = __rand(__t);
if (__M < __n)
__out[__M] = *__first;
++__first;
}
 
return __out + __m;
}
 
template <class _InputIter, class _RandomAccessIter>
inline _RandomAccessIter
random_sample(_InputIter __first, _InputIter __last,
_RandomAccessIter __out_first, _RandomAccessIter __out_last)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
 
return __random_sample(__first, __last,
__out_first, __out_last - __out_first);
}
 
 
template <class _InputIter, class _RandomAccessIter,
class _RandomNumberGenerator>
inline _RandomAccessIter
random_sample(_InputIter __first, _InputIter __last,
_RandomAccessIter __out_first, _RandomAccessIter __out_last,
_RandomNumberGenerator& __rand)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
 
return __random_sample(__first, __last,
__out_first, __rand,
__out_last - __out_first);
}
 
// partition, stable_partition, and their auxiliary functions
 
template <class _ForwardIter, class _Predicate>
_ForwardIter __partition(_ForwardIter __first,
_ForwardIter __last,
_Predicate __pred,
forward_iterator_tag)
{
if (__first == __last) return __first;
 
while (__pred(*__first))
if (++__first == __last) return __first;
 
_ForwardIter __next = __first;
 
while (++__next != __last)
if (__pred(*__next)) {
swap(*__first, *__next);
++__first;
}
 
return __first;
}
 
template <class _BidirectionalIter, class _Predicate>
_BidirectionalIter __partition(_BidirectionalIter __first,
_BidirectionalIter __last,
_Predicate __pred,
bidirectional_iterator_tag)
{
while (true) {
while (true)
if (__first == __last)
return __first;
else if (__pred(*__first))
++__first;
else
break;
--__last;
while (true)
if (__first == __last)
return __first;
else if (!__pred(*__last))
--__last;
else
break;
iter_swap(__first, __last);
++__first;
}
}
 
template <class _ForwardIter, class _Predicate>
inline _ForwardIter partition(_ForwardIter __first,
_ForwardIter __last,
_Predicate __pred)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_ForwardIter>::value_type>);
 
return __partition(__first, __last, __pred, __iterator_category(__first));
}
 
 
template <class _ForwardIter, class _Predicate, class _Distance>
_ForwardIter __inplace_stable_partition(_ForwardIter __first,
_ForwardIter __last,
_Predicate __pred, _Distance __len)
{
if (__len == 1)
return __pred(*__first) ? __last : __first;
_ForwardIter __middle = __first;
advance(__middle, __len / 2);
return rotate(__inplace_stable_partition(__first, __middle, __pred,
__len / 2),
__middle,
__inplace_stable_partition(__middle, __last, __pred,
__len - __len / 2));
}
 
template <class _ForwardIter, class _Pointer, class _Predicate,
class _Distance>
_ForwardIter __stable_partition_adaptive(_ForwardIter __first,
_ForwardIter __last,
_Predicate __pred, _Distance __len,
_Pointer __buffer,
_Distance __buffer_size)
{
if (__len <= __buffer_size) {
_ForwardIter __result1 = __first;
_Pointer __result2 = __buffer;
for ( ; __first != __last ; ++__first)
if (__pred(*__first)) {
*__result1 = *__first;
++__result1;
}
else {
*__result2 = *__first;
++__result2;
}
copy(__buffer, __result2, __result1);
return __result1;
}
else {
_ForwardIter __middle = __first;
advance(__middle, __len / 2);
return rotate(__stable_partition_adaptive(
__first, __middle, __pred,
__len / 2, __buffer, __buffer_size),
__middle,
__stable_partition_adaptive(
__middle, __last, __pred,
__len - __len / 2, __buffer, __buffer_size));
}
}
 
template <class _ForwardIter, class _Predicate, class _Tp, class _Distance>
inline _ForwardIter
__stable_partition_aux(_ForwardIter __first, _ForwardIter __last,
_Predicate __pred, _Tp*, _Distance*)
{
_Temporary_buffer<_ForwardIter, _Tp> __buf(__first, __last);
if (__buf.size() > 0)
return __stable_partition_adaptive(__first, __last, __pred,
_Distance(__buf.requested_size()),
__buf.begin(), __buf.size());
else
return __inplace_stable_partition(__first, __last, __pred,
_Distance(__buf.requested_size()));
}
 
template <class _ForwardIter, class _Predicate>
inline _ForwardIter stable_partition(_ForwardIter __first,
_ForwardIter __last,
_Predicate __pred)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_ForwardIter>::value_type>);
 
if (__first == __last)
return __first;
else
return __stable_partition_aux(__first, __last, __pred,
__value_type(__first),
__distance_type(__first));
}
 
template <class _RandomAccessIter, class _Tp>
_RandomAccessIter __unguarded_partition(_RandomAccessIter __first,
_RandomAccessIter __last,
_Tp __pivot)
{
while (true) {
while (*__first < __pivot)
++__first;
--__last;
while (__pivot < *__last)
--__last;
if (!(__first < __last))
return __first;
iter_swap(__first, __last);
++__first;
}
}
 
template <class _RandomAccessIter, class _Tp, class _Compare>
_RandomAccessIter __unguarded_partition(_RandomAccessIter __first,
_RandomAccessIter __last,
_Tp __pivot, _Compare __comp)
{
while (true) {
while (__comp(*__first, __pivot))
++__first;
--__last;
while (__comp(__pivot, *__last))
--__last;
if (!(__first < __last))
return __first;
iter_swap(__first, __last);
++__first;
}
}
 
const int __stl_threshold = 16;
 
// sort() and its auxiliary functions.
 
template <class _RandomAccessIter, class _Tp>
void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val)
{
_RandomAccessIter __next = __last;
--__next;
while (__val < *__next) {
*__last = *__next;
__last = __next;
--__next;
}
*__last = __val;
}
 
template <class _RandomAccessIter, class _Tp, class _Compare>
void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val,
_Compare __comp)
{
_RandomAccessIter __next = __last;
--__next;
while (__comp(__val, *__next)) {
*__last = *__next;
__last = __next;
--__next;
}
*__last = __val;
}
 
template <class _RandomAccessIter, class _Tp>
inline void __linear_insert(_RandomAccessIter __first,
_RandomAccessIter __last, _Tp*)
{
_Tp __val = *__last;
if (__val < *__first) {
copy_backward(__first, __last, __last + 1);
*__first = __val;
}
else
__unguarded_linear_insert(__last, __val);
}
 
template <class _RandomAccessIter, class _Tp, class _Compare>
inline void __linear_insert(_RandomAccessIter __first,
_RandomAccessIter __last, _Tp*, _Compare __comp)
{
_Tp __val = *__last;
if (__comp(__val, *__first)) {
copy_backward(__first, __last, __last + 1);
*__first = __val;
}
else
__unguarded_linear_insert(__last, __val, __comp);
}
 
template <class _RandomAccessIter>
void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last)
{
if (__first == __last) return;
for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
__linear_insert(__first, __i, __value_type(__first));
}
 
template <class _RandomAccessIter, class _Compare>
void __insertion_sort(_RandomAccessIter __first,
_RandomAccessIter __last, _Compare __comp)
{
if (__first == __last) return;
for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
__linear_insert(__first, __i, __value_type(__first), __comp);
}
 
template <class _RandomAccessIter, class _Tp>
void __unguarded_insertion_sort_aux(_RandomAccessIter __first,
_RandomAccessIter __last, _Tp*)
{
for (_RandomAccessIter __i = __first; __i != __last; ++__i)
__unguarded_linear_insert(__i, _Tp(*__i));
}
 
template <class _RandomAccessIter>
inline void __unguarded_insertion_sort(_RandomAccessIter __first,
_RandomAccessIter __last) {
__unguarded_insertion_sort_aux(__first, __last, __value_type(__first));
}
 
template <class _RandomAccessIter, class _Tp, class _Compare>
void __unguarded_insertion_sort_aux(_RandomAccessIter __first,
_RandomAccessIter __last,
_Tp*, _Compare __comp)
{
for (_RandomAccessIter __i = __first; __i != __last; ++__i)
__unguarded_linear_insert(__i, _Tp(*__i), __comp);
}
 
template <class _RandomAccessIter, class _Compare>
inline void __unguarded_insertion_sort(_RandomAccessIter __first,
_RandomAccessIter __last,
_Compare __comp)
{
__unguarded_insertion_sort_aux(__first, __last, __value_type(__first),
__comp);
}
 
template <class _RandomAccessIter>
void __final_insertion_sort(_RandomAccessIter __first,
_RandomAccessIter __last)
{
if (__last - __first > __stl_threshold) {
__insertion_sort(__first, __first + __stl_threshold);
__unguarded_insertion_sort(__first + __stl_threshold, __last);
}
else
__insertion_sort(__first, __last);
}
 
template <class _RandomAccessIter, class _Compare>
void __final_insertion_sort(_RandomAccessIter __first,
_RandomAccessIter __last, _Compare __comp)
{
if (__last - __first > __stl_threshold) {
__insertion_sort(__first, __first + __stl_threshold, __comp);
__unguarded_insertion_sort(__first + __stl_threshold, __last, __comp);
}
else
__insertion_sort(__first, __last, __comp);
}
 
template <class _Size>
inline _Size __lg(_Size __n)
{
_Size __k;
for (__k = 0; __n != 1; __n >>= 1) ++__k;
return __k;
}
 
template <class _RandomAccessIter, class _Tp, class _Size>
void __introsort_loop(_RandomAccessIter __first,
_RandomAccessIter __last, _Tp*,
_Size __depth_limit)
{
while (__last - __first > __stl_threshold) {
if (__depth_limit == 0) {
partial_sort(__first, __last, __last);
return;
}
--__depth_limit;
_RandomAccessIter __cut =
__unguarded_partition(__first, __last,
_Tp(__median(*__first,
*(__first + (__last - __first)/2),
*(__last - 1))));
__introsort_loop(__cut, __last, (_Tp*) 0, __depth_limit);
__last = __cut;
}
}
 
template <class _RandomAccessIter, class _Tp, class _Size, class _Compare>
void __introsort_loop(_RandomAccessIter __first,
_RandomAccessIter __last, _Tp*,
_Size __depth_limit, _Compare __comp)
{
while (__last - __first > __stl_threshold) {
if (__depth_limit == 0) {
partial_sort(__first, __last, __last, __comp);
return;
}
--__depth_limit;
_RandomAccessIter __cut =
__unguarded_partition(__first, __last,
_Tp(__median(*__first,
*(__first + (__last - __first)/2),
*(__last - 1), __comp)),
__comp);
__introsort_loop(__cut, __last, (_Tp*) 0, __depth_limit, __comp);
__last = __cut;
}
}
 
template <class _RandomAccessIter>
inline void sort(_RandomAccessIter __first, _RandomAccessIter __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIter>::value_type>);
 
if (__first != __last) {
__introsort_loop(__first, __last,
__value_type(__first),
__lg(__last - __first) * 2);
__final_insertion_sort(__first, __last);
}
}
 
template <class _RandomAccessIter, class _Compare>
inline void sort(_RandomAccessIter __first, _RandomAccessIter __last,
_Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_RandomAccessIter>::value_type,
typename iterator_traits<_RandomAccessIter>::value_type>);
 
if (__first != __last) {
__introsort_loop(__first, __last,
__value_type(__first),
__lg(__last - __first) * 2,
__comp);
__final_insertion_sort(__first, __last, __comp);
}
}
 
// stable_sort() and its auxiliary functions.
 
template <class _RandomAccessIter>
void __inplace_stable_sort(_RandomAccessIter __first,
_RandomAccessIter __last)
{
if (__last - __first < 15) {
__insertion_sort(__first, __last);
return;
}
_RandomAccessIter __middle = __first + (__last - __first) / 2;
__inplace_stable_sort(__first, __middle);
__inplace_stable_sort(__middle, __last);
__merge_without_buffer(__first, __middle, __last,
__middle - __first,
__last - __middle);
}
 
template <class _RandomAccessIter, class _Compare>
void __inplace_stable_sort(_RandomAccessIter __first,
_RandomAccessIter __last, _Compare __comp)
{
if (__last - __first < 15) {
__insertion_sort(__first, __last, __comp);
return;
}
_RandomAccessIter __middle = __first + (__last - __first) / 2;
__inplace_stable_sort(__first, __middle, __comp);
__inplace_stable_sort(__middle, __last, __comp);
__merge_without_buffer(__first, __middle, __last,
__middle - __first,
__last - __middle,
__comp);
}
 
template <class _RandomAccessIter1, class _RandomAccessIter2,
class _Distance>
void __merge_sort_loop(_RandomAccessIter1 __first,
_RandomAccessIter1 __last,
_RandomAccessIter2 __result, _Distance __step_size)
{
_Distance __two_step = 2 * __step_size;
 
while (__last - __first >= __two_step) {
__result = merge(__first, __first + __step_size,
__first + __step_size, __first + __two_step,
__result);
__first += __two_step;
}
 
__step_size = min(_Distance(__last - __first), __step_size);
merge(__first, __first + __step_size, __first + __step_size, __last,
__result);
}
 
template <class _RandomAccessIter1, class _RandomAccessIter2,
class _Distance, class _Compare>
void __merge_sort_loop(_RandomAccessIter1 __first,
_RandomAccessIter1 __last,
_RandomAccessIter2 __result, _Distance __step_size,
_Compare __comp)
{
_Distance __two_step = 2 * __step_size;
 
while (__last - __first >= __two_step) {
__result = merge(__first, __first + __step_size,
__first + __step_size, __first + __two_step,
__result,
__comp);
__first += __two_step;
}
__step_size = min(_Distance(__last - __first), __step_size);
 
merge(__first, __first + __step_size,
__first + __step_size, __last,
__result,
__comp);
}
 
const int __stl_chunk_size = 7;
template <class _RandomAccessIter, class _Distance>
void __chunk_insertion_sort(_RandomAccessIter __first,
_RandomAccessIter __last, _Distance __chunk_size)
{
while (__last - __first >= __chunk_size) {
__insertion_sort(__first, __first + __chunk_size);
__first += __chunk_size;
}
__insertion_sort(__first, __last);
}
 
template <class _RandomAccessIter, class _Distance, class _Compare>
void __chunk_insertion_sort(_RandomAccessIter __first,
_RandomAccessIter __last,
_Distance __chunk_size, _Compare __comp)
{
while (__last - __first >= __chunk_size) {
__insertion_sort(__first, __first + __chunk_size, __comp);
__first += __chunk_size;
}
__insertion_sort(__first, __last, __comp);
}
 
template <class _RandomAccessIter, class _Pointer, class _Distance>
void __merge_sort_with_buffer(_RandomAccessIter __first,
_RandomAccessIter __last,
_Pointer __buffer, _Distance*)
{
_Distance __len = __last - __first;
_Pointer __buffer_last = __buffer + __len;
 
_Distance __step_size = __stl_chunk_size;
__chunk_insertion_sort(__first, __last, __step_size);
 
while (__step_size < __len) {
__merge_sort_loop(__first, __last, __buffer, __step_size);
__step_size *= 2;
__merge_sort_loop(__buffer, __buffer_last, __first, __step_size);
__step_size *= 2;
}
}
 
template <class _RandomAccessIter, class _Pointer, class _Distance,
class _Compare>
void __merge_sort_with_buffer(_RandomAccessIter __first,
_RandomAccessIter __last, _Pointer __buffer,
_Distance*, _Compare __comp)
{
_Distance __len = __last - __first;
_Pointer __buffer_last = __buffer + __len;
 
_Distance __step_size = __stl_chunk_size;
__chunk_insertion_sort(__first, __last, __step_size, __comp);
 
while (__step_size < __len) {
__merge_sort_loop(__first, __last, __buffer, __step_size, __comp);
__step_size *= 2;
__merge_sort_loop(__buffer, __buffer_last, __first, __step_size, __comp);
__step_size *= 2;
}
}
 
template <class _RandomAccessIter, class _Pointer, class _Distance>
void __stable_sort_adaptive(_RandomAccessIter __first,
_RandomAccessIter __last, _Pointer __buffer,
_Distance __buffer_size)
{
_Distance __len = (__last - __first + 1) / 2;
_RandomAccessIter __middle = __first + __len;
if (__len > __buffer_size) {
__stable_sort_adaptive(__first, __middle, __buffer, __buffer_size);
__stable_sort_adaptive(__middle, __last, __buffer, __buffer_size);
}
else {
__merge_sort_with_buffer(__first, __middle, __buffer, (_Distance*)0);
__merge_sort_with_buffer(__middle, __last, __buffer, (_Distance*)0);
}
__merge_adaptive(__first, __middle, __last, _Distance(__middle - __first),
_Distance(__last - __middle), __buffer, __buffer_size);
}
 
template <class _RandomAccessIter, class _Pointer, class _Distance,
class _Compare>
void __stable_sort_adaptive(_RandomAccessIter __first,
_RandomAccessIter __last, _Pointer __buffer,
_Distance __buffer_size, _Compare __comp)
{
_Distance __len = (__last - __first + 1) / 2;
_RandomAccessIter __middle = __first + __len;
if (__len > __buffer_size) {
__stable_sort_adaptive(__first, __middle, __buffer, __buffer_size,
__comp);
__stable_sort_adaptive(__middle, __last, __buffer, __buffer_size,
__comp);
}
else {
__merge_sort_with_buffer(__first, __middle, __buffer, (_Distance*)0,
__comp);
__merge_sort_with_buffer(__middle, __last, __buffer, (_Distance*)0,
__comp);
}
__merge_adaptive(__first, __middle, __last, _Distance(__middle - __first),
_Distance(__last - __middle), __buffer, __buffer_size,
__comp);
}
 
template <class _RandomAccessIter, class _Tp, class _Distance>
inline void __stable_sort_aux(_RandomAccessIter __first,
_RandomAccessIter __last, _Tp*, _Distance*)
{
_Temporary_buffer<_RandomAccessIter, _Tp> buf(__first, __last);
if (buf.begin() == 0)
__inplace_stable_sort(__first, __last);
else
__stable_sort_adaptive(__first, __last, buf.begin(),
_Distance(buf.size()));
}
 
template <class _RandomAccessIter, class _Tp, class _Distance, class _Compare>
inline void __stable_sort_aux(_RandomAccessIter __first,
_RandomAccessIter __last, _Tp*, _Distance*,
_Compare __comp)
{
_Temporary_buffer<_RandomAccessIter, _Tp> buf(__first, __last);
if (buf.begin() == 0)
__inplace_stable_sort(__first, __last, __comp);
else
__stable_sort_adaptive(__first, __last, buf.begin(),
_Distance(buf.size()),
__comp);
}
 
template <class _RandomAccessIter>
inline void stable_sort(_RandomAccessIter __first,
_RandomAccessIter __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIter>::value_type>);
 
__stable_sort_aux(__first, __last,
__value_type(__first),
__distance_type(__first));
}
 
template <class _RandomAccessIter, class _Compare>
inline void stable_sort(_RandomAccessIter __first,
_RandomAccessIter __last, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_RandomAccessIter>::value_type,
typename iterator_traits<_RandomAccessIter>::value_type>);
 
__stable_sort_aux(__first, __last,
__value_type(__first),
__distance_type(__first),
__comp);
}
 
// partial_sort, partial_sort_copy, and auxiliary functions.
 
template <class _RandomAccessIter, class _Tp>
void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle,
_RandomAccessIter __last, _Tp*)
{
make_heap(__first, __middle);
for (_RandomAccessIter __i = __middle; __i < __last; ++__i)
if (*__i < *__first)
__pop_heap(__first, __middle, __i, _Tp(*__i),
__distance_type(__first));
sort_heap(__first, __middle);
}
 
template <class _RandomAccessIter>
inline void partial_sort(_RandomAccessIter __first,
_RandomAccessIter __middle,
_RandomAccessIter __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIter>::value_type>);
 
__partial_sort(__first, __middle, __last, __value_type(__first));
}
 
template <class _RandomAccessIter, class _Tp, class _Compare>
void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle,
_RandomAccessIter __last, _Tp*, _Compare __comp)
{
make_heap(__first, __middle, __comp);
for (_RandomAccessIter __i = __middle; __i < __last; ++__i)
if (__comp(*__i, *__first))
__pop_heap(__first, __middle, __i, _Tp(*__i), __comp,
__distance_type(__first));
sort_heap(__first, __middle, __comp);
}
 
template <class _RandomAccessIter, class _Compare>
inline void partial_sort(_RandomAccessIter __first,
_RandomAccessIter __middle,
_RandomAccessIter __last, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_RandomAccessIter>::value_type,
typename iterator_traits<_RandomAccessIter>::value_type>);
 
__partial_sort(__first, __middle, __last, __value_type(__first), __comp);
}
 
template <class _InputIter, class _RandomAccessIter, class _Distance,
class _Tp>
_RandomAccessIter __partial_sort_copy(_InputIter __first,
_InputIter __last,
_RandomAccessIter __result_first,
_RandomAccessIter __result_last,
_Distance*, _Tp*)
{
if (__result_first == __result_last) return __result_last;
_RandomAccessIter __result_real_last = __result_first;
while(__first != __last && __result_real_last != __result_last) {
*__result_real_last = *__first;
++__result_real_last;
++__first;
}
make_heap(__result_first, __result_real_last);
while (__first != __last) {
if (*__first < *__result_first)
__adjust_heap(__result_first, _Distance(0),
_Distance(__result_real_last - __result_first),
_Tp(*__first));
++__first;
}
sort_heap(__result_first, __result_real_last);
return __result_real_last;
}
 
template <class _InputIter, class _RandomAccessIter>
inline _RandomAccessIter
partial_sort_copy(_InputIter __first, _InputIter __last,
_RandomAccessIter __result_first,
_RandomAccessIter __result_last)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_ConvertibleConcept<
typename iterator_traits<_InputIter>::value_type,
typename iterator_traits<_RandomAccessIter>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIter>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIter>::value_type>);
 
return __partial_sort_copy(__first, __last, __result_first, __result_last,
__distance_type(__result_first),
__value_type(__first));
}
 
template <class _InputIter, class _RandomAccessIter, class _Compare,
class _Distance, class _Tp>
_RandomAccessIter __partial_sort_copy(_InputIter __first,
_InputIter __last,
_RandomAccessIter __result_first,
_RandomAccessIter __result_last,
_Compare __comp, _Distance*, _Tp*)
{
if (__result_first == __result_last) return __result_last;
_RandomAccessIter __result_real_last = __result_first;
while(__first != __last && __result_real_last != __result_last) {
*__result_real_last = *__first;
++__result_real_last;
++__first;
}
make_heap(__result_first, __result_real_last, __comp);
while (__first != __last) {
if (__comp(*__first, *__result_first))
__adjust_heap(__result_first, _Distance(0),
_Distance(__result_real_last - __result_first),
_Tp(*__first),
__comp);
++__first;
}
sort_heap(__result_first, __result_real_last, __comp);
return __result_real_last;
}
 
template <class _InputIter, class _RandomAccessIter, class _Compare>
inline _RandomAccessIter
partial_sort_copy(_InputIter __first, _InputIter __last,
_RandomAccessIter __result_first,
_RandomAccessIter __result_last, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
__glibcpp_function_requires(_ConvertibleConcept<
typename iterator_traits<_InputIter>::value_type,
typename iterator_traits<_RandomAccessIter>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_RandomAccessIter>::value_type,
typename iterator_traits<_RandomAccessIter>::value_type>);
 
return __partial_sort_copy(__first, __last, __result_first, __result_last,
__comp,
__distance_type(__result_first),
__value_type(__first));
}
 
// nth_element() and its auxiliary functions.
 
template <class _RandomAccessIter, class _Tp>
void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
_RandomAccessIter __last, _Tp*)
{
while (__last - __first > 3) {
_RandomAccessIter __cut =
__unguarded_partition(__first, __last,
_Tp(__median(*__first,
*(__first + (__last - __first)/2),
*(__last - 1))));
if (__cut <= __nth)
__first = __cut;
else
__last = __cut;
}
__insertion_sort(__first, __last);
}
 
template <class _RandomAccessIter>
inline void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
_RandomAccessIter __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIter>::value_type>);
 
__nth_element(__first, __nth, __last, __value_type(__first));
}
 
template <class _RandomAccessIter, class _Tp, class _Compare>
void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
_RandomAccessIter __last, _Tp*, _Compare __comp)
{
while (__last - __first > 3) {
_RandomAccessIter __cut =
__unguarded_partition(__first, __last,
_Tp(__median(*__first,
*(__first + (__last - __first)/2),
*(__last - 1),
__comp)),
__comp);
if (__cut <= __nth)
__first = __cut;
else
__last = __cut;
}
__insertion_sort(__first, __last, __comp);
}
 
template <class _RandomAccessIter, class _Compare>
inline void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
_RandomAccessIter __last, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_RandomAccessIter>::value_type,
typename iterator_traits<_RandomAccessIter>::value_type>);
 
__nth_element(__first, __nth, __last, __value_type(__first), __comp);
}
 
 
// Binary search (lower_bound, upper_bound, equal_range, binary_search).
 
template <class _ForwardIter, class _Tp, class _Distance>
_ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last,
const _Tp& __val, _Distance*)
{
_Distance __len = 0;
distance(__first, __last, __len);
_Distance __half;
_ForwardIter __middle;
 
while (__len > 0) {
__half = __len >> 1;
__middle = __first;
advance(__middle, __half);
if (*__middle < __val) {
__first = __middle;
++__first;
__len = __len - __half - 1;
}
else
__len = __half;
}
return __first;
}
 
template <class _ForwardIter, class _Tp>
inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last,
const _Tp& __val)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_SameTypeConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
 
return __lower_bound(__first, __last, __val,
__distance_type(__first));
}
 
template <class _ForwardIter, class _Tp, class _Compare, class _Distance>
_ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last,
const _Tp& __val, _Compare __comp, _Distance*)
{
_Distance __len = 0;
distance(__first, __last, __len);
_Distance __half;
_ForwardIter __middle;
 
while (__len > 0) {
__half = __len >> 1;
__middle = __first;
advance(__middle, __half);
if (__comp(*__middle, __val)) {
__first = __middle;
++__first;
__len = __len - __half - 1;
}
else
__len = __half;
}
return __first;
}
 
template <class _ForwardIter, class _Tp, class _Compare>
inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last,
const _Tp& __val, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_SameTypeConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>);
 
return __lower_bound(__first, __last, __val, __comp,
__distance_type(__first));
}
 
template <class _ForwardIter, class _Tp, class _Distance>
_ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last,
const _Tp& __val, _Distance*)
{
_Distance __len = 0;
distance(__first, __last, __len);
_Distance __half;
_ForwardIter __middle;
 
while (__len > 0) {
__half = __len >> 1;
__middle = __first;
advance(__middle, __half);
if (__val < *__middle)
__len = __half;
else {
__first = __middle;
++__first;
__len = __len - __half - 1;
}
}
return __first;
}
 
template <class _ForwardIter, class _Tp>
inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last,
const _Tp& __val)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_SameTypeConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
 
return __upper_bound(__first, __last, __val,
__distance_type(__first));
}
 
template <class _ForwardIter, class _Tp, class _Compare, class _Distance>
_ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last,
const _Tp& __val, _Compare __comp, _Distance*)
{
_Distance __len = 0;
distance(__first, __last, __len);
_Distance __half;
_ForwardIter __middle;
 
while (__len > 0) {
__half = __len >> 1;
__middle = __first;
advance(__middle, __half);
if (__comp(__val, *__middle))
__len = __half;
else {
__first = __middle;
++__first;
__len = __len - __half - 1;
}
}
return __first;
}
 
template <class _ForwardIter, class _Tp, class _Compare>
inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last,
const _Tp& __val, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_SameTypeConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>);
 
return __upper_bound(__first, __last, __val, __comp,
__distance_type(__first));
}
 
template <class _ForwardIter, class _Tp, class _Distance>
pair<_ForwardIter, _ForwardIter>
__equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
_Distance*)
{
_Distance __len = 0;
distance(__first, __last, __len);
_Distance __half;
_ForwardIter __middle, __left, __right;
 
while (__len > 0) {
__half = __len >> 1;
__middle = __first;
advance(__middle, __half);
if (*__middle < __val) {
__first = __middle;
++__first;
__len = __len - __half - 1;
}
else if (__val < *__middle)
__len = __half;
else {
__left = lower_bound(__first, __middle, __val);
advance(__first, __len);
__right = upper_bound(++__middle, __first, __val);
return pair<_ForwardIter, _ForwardIter>(__left, __right);
}
}
return pair<_ForwardIter, _ForwardIter>(__first, __first);
}
 
template <class _ForwardIter, class _Tp>
inline pair<_ForwardIter, _ForwardIter>
equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_SameTypeConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
 
return __equal_range(__first, __last, __val,
__distance_type(__first));
}
 
template <class _ForwardIter, class _Tp, class _Compare, class _Distance>
pair<_ForwardIter, _ForwardIter>
__equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
_Compare __comp, _Distance*)
{
_Distance __len = 0;
distance(__first, __last, __len);
_Distance __half;
_ForwardIter __middle, __left, __right;
 
while (__len > 0) {
__half = __len >> 1;
__middle = __first;
advance(__middle, __half);
if (__comp(*__middle, __val)) {
__first = __middle;
++__first;
__len = __len - __half - 1;
}
else if (__comp(__val, *__middle))
__len = __half;
else {
__left = lower_bound(__first, __middle, __val, __comp);
advance(__first, __len);
__right = upper_bound(++__middle, __first, __val, __comp);
return pair<_ForwardIter, _ForwardIter>(__left, __right);
}
}
return pair<_ForwardIter, _ForwardIter>(__first, __first);
}
 
template <class _ForwardIter, class _Tp, class _Compare>
inline pair<_ForwardIter, _ForwardIter>
equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
_Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_SameTypeConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>);
 
return __equal_range(__first, __last, __val, __comp,
__distance_type(__first));
}
 
template <class _ForwardIter, class _Tp>
bool binary_search(_ForwardIter __first, _ForwardIter __last,
const _Tp& __val)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_SameTypeConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
 
_ForwardIter __i = lower_bound(__first, __last, __val);
return __i != __last && !(__val < *__i);
}
 
template <class _ForwardIter, class _Tp, class _Compare>
bool binary_search(_ForwardIter __first, _ForwardIter __last,
const _Tp& __val,
_Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_SameTypeConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>);
 
_ForwardIter __i = lower_bound(__first, __last, __val, __comp);
return __i != __last && !__comp(__val, *__i);
}
 
// merge, with and without an explicitly supplied comparison function.
 
template <class _InputIter1, class _InputIter2, class _OutputIter>
_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_OutputIter __result)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIter1>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2) {
if (*__first2 < *__first1) {
*__result = *__first2;
++__first2;
}
else {
*__result = *__first1;
++__first1;
}
++__result;
}
return copy(__first2, __last2, copy(__first1, __last1, __result));
}
 
template <class _InputIter1, class _InputIter2, class _OutputIter,
class _Compare>
_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_OutputIter __result, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2) {
if (__comp(*__first2, *__first1)) {
*__result = *__first2;
++__first2;
}
else {
*__result = *__first1;
++__first1;
}
++__result;
}
return copy(__first2, __last2, copy(__first1, __last1, __result));
}
 
// inplace_merge and its auxiliary functions.
 
template <class _BidirectionalIter, class _Distance>
void __merge_without_buffer(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last,
_Distance __len1, _Distance __len2)
{
if (__len1 == 0 || __len2 == 0)
return;
if (__len1 + __len2 == 2) {
if (*__middle < *__first)
iter_swap(__first, __middle);
return;
}
_BidirectionalIter __first_cut = __first;
_BidirectionalIter __second_cut = __middle;
_Distance __len11 = 0;
_Distance __len22 = 0;
if (__len1 > __len2) {
__len11 = __len1 / 2;
advance(__first_cut, __len11);
__second_cut = lower_bound(__middle, __last, *__first_cut);
distance(__middle, __second_cut, __len22);
}
else {
__len22 = __len2 / 2;
advance(__second_cut, __len22);
__first_cut = upper_bound(__first, __middle, *__second_cut);
distance(__first, __first_cut, __len11);
}
_BidirectionalIter __new_middle
= rotate(__first_cut, __middle, __second_cut);
__merge_without_buffer(__first, __first_cut, __new_middle,
__len11, __len22);
__merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11,
__len2 - __len22);
}
 
template <class _BidirectionalIter, class _Distance, class _Compare>
void __merge_without_buffer(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last,
_Distance __len1, _Distance __len2,
_Compare __comp)
{
if (__len1 == 0 || __len2 == 0)
return;
if (__len1 + __len2 == 2) {
if (__comp(*__middle, *__first))
iter_swap(__first, __middle);
return;
}
_BidirectionalIter __first_cut = __first;
_BidirectionalIter __second_cut = __middle;
_Distance __len11 = 0;
_Distance __len22 = 0;
if (__len1 > __len2) {
__len11 = __len1 / 2;
advance(__first_cut, __len11);
__second_cut = lower_bound(__middle, __last, *__first_cut, __comp);
distance(__middle, __second_cut, __len22);
}
else {
__len22 = __len2 / 2;
advance(__second_cut, __len22);
__first_cut = upper_bound(__first, __middle, *__second_cut, __comp);
distance(__first, __first_cut, __len11);
}
_BidirectionalIter __new_middle
= rotate(__first_cut, __middle, __second_cut);
__merge_without_buffer(__first, __first_cut, __new_middle, __len11, __len22,
__comp);
__merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11,
__len2 - __len22, __comp);
}
 
template <class _BidirectionalIter1, class _BidirectionalIter2,
class _Distance>
_BidirectionalIter1 __rotate_adaptive(_BidirectionalIter1 __first,
_BidirectionalIter1 __middle,
_BidirectionalIter1 __last,
_Distance __len1, _Distance __len2,
_BidirectionalIter2 __buffer,
_Distance __buffer_size)
{
_BidirectionalIter2 __buffer_end;
if (__len1 > __len2 && __len2 <= __buffer_size) {
__buffer_end = copy(__middle, __last, __buffer);
copy_backward(__first, __middle, __last);
return copy(__buffer, __buffer_end, __first);
}
else if (__len1 <= __buffer_size) {
__buffer_end = copy(__first, __middle, __buffer);
copy(__middle, __last, __first);
return copy_backward(__buffer, __buffer_end, __last);
}
else
return rotate(__first, __middle, __last);
}
 
template <class _BidirectionalIter1, class _BidirectionalIter2,
class _BidirectionalIter3>
_BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1,
_BidirectionalIter1 __last1,
_BidirectionalIter2 __first2,
_BidirectionalIter2 __last2,
_BidirectionalIter3 __result)
{
if (__first1 == __last1)
return copy_backward(__first2, __last2, __result);
if (__first2 == __last2)
return copy_backward(__first1, __last1, __result);
--__last1;
--__last2;
while (true) {
if (*__last2 < *__last1) {
*--__result = *__last1;
if (__first1 == __last1)
return copy_backward(__first2, ++__last2, __result);
--__last1;
}
else {
*--__result = *__last2;
if (__first2 == __last2)
return copy_backward(__first1, ++__last1, __result);
--__last2;
}
}
}
 
template <class _BidirectionalIter1, class _BidirectionalIter2,
class _BidirectionalIter3, class _Compare>
_BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1,
_BidirectionalIter1 __last1,
_BidirectionalIter2 __first2,
_BidirectionalIter2 __last2,
_BidirectionalIter3 __result,
_Compare __comp)
{
if (__first1 == __last1)
return copy_backward(__first2, __last2, __result);
if (__first2 == __last2)
return copy_backward(__first1, __last1, __result);
--__last1;
--__last2;
while (true) {
if (__comp(*__last2, *__last1)) {
*--__result = *__last1;
if (__first1 == __last1)
return copy_backward(__first2, ++__last2, __result);
--__last1;
}
else {
*--__result = *__last2;
if (__first2 == __last2)
return copy_backward(__first1, ++__last1, __result);
--__last2;
}
}
}
 
template <class _BidirectionalIter, class _Distance, class _Pointer>
void __merge_adaptive(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last,
_Distance __len1, _Distance __len2,
_Pointer __buffer, _Distance __buffer_size)
{
if (__len1 <= __len2 && __len1 <= __buffer_size) {
_Pointer __buffer_end = copy(__first, __middle, __buffer);
merge(__buffer, __buffer_end, __middle, __last, __first);
}
else if (__len2 <= __buffer_size) {
_Pointer __buffer_end = copy(__middle, __last, __buffer);
__merge_backward(__first, __middle, __buffer, __buffer_end, __last);
}
else {
_BidirectionalIter __first_cut = __first;
_BidirectionalIter __second_cut = __middle;
_Distance __len11 = 0;
_Distance __len22 = 0;
if (__len1 > __len2) {
__len11 = __len1 / 2;
advance(__first_cut, __len11);
__second_cut = lower_bound(__middle, __last, *__first_cut);
distance(__middle, __second_cut, __len22);
}
else {
__len22 = __len2 / 2;
advance(__second_cut, __len22);
__first_cut = upper_bound(__first, __middle, *__second_cut);
distance(__first, __first_cut, __len11);
}
_BidirectionalIter __new_middle =
__rotate_adaptive(__first_cut, __middle, __second_cut, __len1 - __len11,
__len22, __buffer, __buffer_size);
__merge_adaptive(__first, __first_cut, __new_middle, __len11,
__len22, __buffer, __buffer_size);
__merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11,
__len2 - __len22, __buffer, __buffer_size);
}
}
 
template <class _BidirectionalIter, class _Distance, class _Pointer,
class _Compare>
void __merge_adaptive(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last,
_Distance __len1, _Distance __len2,
_Pointer __buffer, _Distance __buffer_size,
_Compare __comp)
{
if (__len1 <= __len2 && __len1 <= __buffer_size) {
_Pointer __buffer_end = copy(__first, __middle, __buffer);
merge(__buffer, __buffer_end, __middle, __last, __first, __comp);
}
else if (__len2 <= __buffer_size) {
_Pointer __buffer_end = copy(__middle, __last, __buffer);
__merge_backward(__first, __middle, __buffer, __buffer_end, __last,
__comp);
}
else {
_BidirectionalIter __first_cut = __first;
_BidirectionalIter __second_cut = __middle;
_Distance __len11 = 0;
_Distance __len22 = 0;
if (__len1 > __len2) {
__len11 = __len1 / 2;
advance(__first_cut, __len11);
__second_cut = lower_bound(__middle, __last, *__first_cut, __comp);
distance(__middle, __second_cut, __len22);
}
else {
__len22 = __len2 / 2;
advance(__second_cut, __len22);
__first_cut = upper_bound(__first, __middle, *__second_cut, __comp);
distance(__first, __first_cut, __len11);
}
_BidirectionalIter __new_middle =
__rotate_adaptive(__first_cut, __middle, __second_cut, __len1 - __len11,
__len22, __buffer, __buffer_size);
__merge_adaptive(__first, __first_cut, __new_middle, __len11,
__len22, __buffer, __buffer_size, __comp);
__merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11,
__len2 - __len22, __buffer, __buffer_size, __comp);
}
}
 
template <class _BidirectionalIter, class _Tp, class _Distance>
inline void __inplace_merge_aux(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last, _Tp*, _Distance*)
{
_Distance __len1 = 0;
distance(__first, __middle, __len1);
_Distance __len2 = 0;
distance(__middle, __last, __len2);
 
_Temporary_buffer<_BidirectionalIter, _Tp> __buf(__first, __last);
if (__buf.begin() == 0)
__merge_without_buffer(__first, __middle, __last, __len1, __len2);
else
__merge_adaptive(__first, __middle, __last, __len1, __len2,
__buf.begin(), _Distance(__buf.size()));
}
 
template <class _BidirectionalIter, class _Tp,
class _Distance, class _Compare>
inline void __inplace_merge_aux(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last, _Tp*, _Distance*,
_Compare __comp)
{
_Distance __len1 = 0;
distance(__first, __middle, __len1);
_Distance __len2 = 0;
distance(__middle, __last, __len2);
 
_Temporary_buffer<_BidirectionalIter, _Tp> __buf(__first, __last);
if (__buf.begin() == 0)
__merge_without_buffer(__first, __middle, __last, __len1, __len2, __comp);
else
__merge_adaptive(__first, __middle, __last, __len1, __len2,
__buf.begin(), _Distance(__buf.size()),
__comp);
}
 
template <class _BidirectionalIter>
inline void inplace_merge(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
_BidirectionalIter>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_BidirectionalIter>::value_type>);
 
if (__first == __middle || __middle == __last)
return;
__inplace_merge_aux(__first, __middle, __last,
__value_type(__first), __distance_type(__first));
}
 
template <class _BidirectionalIter, class _Compare>
inline void inplace_merge(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
_BidirectionalIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_BidirectionalIter>::value_type,
typename iterator_traits<_BidirectionalIter>::value_type>);
 
if (__first == __middle || __middle == __last)
return;
__inplace_merge_aux(__first, __middle, __last,
__value_type(__first), __distance_type(__first),
__comp);
}
 
// Set algorithms: includes, set_union, set_intersection, set_difference,
// set_symmetric_difference. All of these algorithms have the precondition
// that their input ranges are sorted and the postcondition that their output
// ranges are sorted.
 
template <class _InputIter1, class _InputIter2>
bool includes(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIter1>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2)
if (*__first2 < *__first1)
return false;
else if(*__first1 < *__first2)
++__first1;
else
++__first1, ++__first2;
 
return __first2 == __last2;
}
 
template <class _InputIter1, class _InputIter2, class _Compare>
bool includes(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first2, *__first1))
return false;
else if(__comp(*__first1, *__first2))
++__first1;
else
++__first1, ++__first2;
 
return __first2 == __last2;
}
 
template <class _InputIter1, class _InputIter2, class _OutputIter>
_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_OutputIter __result)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIter1>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2) {
if (*__first1 < *__first2) {
*__result = *__first1;
++__first1;
}
else if (*__first2 < *__first1) {
*__result = *__first2;
++__first2;
}
else {
*__result = *__first1;
++__first1;
++__first2;
}
++__result;
}
return copy(__first2, __last2, copy(__first1, __last1, __result));
}
 
template <class _InputIter1, class _InputIter2, class _OutputIter,
class _Compare>
_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_OutputIter __result, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2) {
if (__comp(*__first1, *__first2)) {
*__result = *__first1;
++__first1;
}
else if (__comp(*__first2, *__first1)) {
*__result = *__first2;
++__first2;
}
else {
*__result = *__first1;
++__first1;
++__first2;
}
++__result;
}
return copy(__first2, __last2, copy(__first1, __last1, __result));
}
 
template <class _InputIter1, class _InputIter2, class _OutputIter>
_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_OutputIter __result)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIter1>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2)
++__first1;
else if (*__first2 < *__first1)
++__first2;
else {
*__result = *__first1;
++__first1;
++__first2;
++__result;
}
return __result;
}
 
template <class _InputIter1, class _InputIter2, class _OutputIter,
class _Compare>
_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_OutputIter __result, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2))
++__first1;
else if (__comp(*__first2, *__first1))
++__first2;
else {
*__result = *__first1;
++__first1;
++__first2;
++__result;
}
return __result;
}
 
template <class _InputIter1, class _InputIter2, class _OutputIter>
_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_OutputIter __result)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIter1>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2) {
*__result = *__first1;
++__first1;
++__result;
}
else if (*__first2 < *__first1)
++__first2;
else {
++__first1;
++__first2;
}
return copy(__first1, __last1, __result);
}
 
template <class _InputIter1, class _InputIter2, class _OutputIter,
class _Compare>
_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_OutputIter __result, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2)) {
*__result = *__first1;
++__first1;
++__result;
}
else if (__comp(*__first2, *__first1))
++__first2;
else {
++__first1;
++__first2;
}
return copy(__first1, __last1, __result);
}
 
template <class _InputIter1, class _InputIter2, class _OutputIter>
_OutputIter
set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_OutputIter __result)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIter1>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2) {
*__result = *__first1;
++__first1;
++__result;
}
else if (*__first2 < *__first1) {
*__result = *__first2;
++__first2;
++__result;
}
else {
++__first1;
++__first2;
}
return copy(__first2, __last2, copy(__first1, __last1, __result));
}
 
template <class _InputIter1, class _InputIter2, class _OutputIter,
class _Compare>
_OutputIter
set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_OutputIter __result,
_Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_SameTypeConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
 
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2)) {
*__result = *__first1;
++__first1;
++__result;
}
else if (__comp(*__first2, *__first1)) {
*__result = *__first2;
++__first2;
++__result;
}
else {
++__first1;
++__first2;
}
return copy(__first2, __last2, copy(__first1, __last1, __result));
}
 
// min_element and max_element, with and without an explicitly supplied
// comparison function.
 
template <class _ForwardIter>
_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_ForwardIter>::value_type>);
 
if (__first == __last) return __first;
_ForwardIter __result = __first;
while (++__first != __last)
if (*__result < *__first)
__result = __first;
return __result;
}
 
template <class _ForwardIter, class _Compare>
_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last,
_Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_ForwardIter>::value_type,
typename iterator_traits<_ForwardIter>::value_type>);
 
if (__first == __last) return __first;
_ForwardIter __result = __first;
while (++__first != __last)
if (__comp(*__result, *__first)) __result = __first;
return __result;
}
 
template <class _ForwardIter>
_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_ForwardIter>::value_type>);
 
if (__first == __last) return __first;
_ForwardIter __result = __first;
while (++__first != __last)
if (*__first < *__result)
__result = __first;
return __result;
}
 
template <class _ForwardIter, class _Compare>
_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last,
_Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_ForwardIter>::value_type,
typename iterator_traits<_ForwardIter>::value_type>);
 
if (__first == __last) return __first;
_ForwardIter __result = __first;
while (++__first != __last)
if (__comp(*__first, *__result))
__result = __first;
return __result;
}
 
// next_permutation and prev_permutation, with and without an explicitly
// supplied comparison function.
 
template <class _BidirectionalIter>
bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last)
{
// concept requirements
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_BidirectionalIter>::value_type>);
 
if (__first == __last)
return false;
_BidirectionalIter __i = __first;
++__i;
if (__i == __last)
return false;
__i = __last;
--__i;
 
for(;;) {
_BidirectionalIter __ii = __i;
--__i;
if (*__i < *__ii) {
_BidirectionalIter __j = __last;
while (!(*__i < *--__j))
{}
iter_swap(__i, __j);
reverse(__ii, __last);
return true;
}
if (__i == __first) {
reverse(__first, __last);
return false;
}
}
}
 
template <class _BidirectionalIter, class _Compare>
bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
_Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_BidirectionalIter>::value_type,
typename iterator_traits<_BidirectionalIter>::value_type>);
 
if (__first == __last)
return false;
_BidirectionalIter __i = __first;
++__i;
if (__i == __last)
return false;
__i = __last;
--__i;
 
for(;;) {
_BidirectionalIter __ii = __i;
--__i;
if (__comp(*__i, *__ii)) {
_BidirectionalIter __j = __last;
while (!__comp(*__i, *--__j))
{}
iter_swap(__i, __j);
reverse(__ii, __last);
return true;
}
if (__i == __first) {
reverse(__first, __last);
return false;
}
}
}
 
template <class _BidirectionalIter>
bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last)
{
// concept requirements
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_BidirectionalIter>::value_type>);
 
if (__first == __last)
return false;
_BidirectionalIter __i = __first;
++__i;
if (__i == __last)
return false;
__i = __last;
--__i;
 
for(;;) {
_BidirectionalIter __ii = __i;
--__i;
if (*__ii < *__i) {
_BidirectionalIter __j = __last;
while (!(*--__j < *__i))
{}
iter_swap(__i, __j);
reverse(__ii, __last);
return true;
}
if (__i == __first) {
reverse(__first, __last);
return false;
}
}
}
 
template <class _BidirectionalIter, class _Compare>
bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
_Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_BidirectionalIter>::value_type,
typename iterator_traits<_BidirectionalIter>::value_type>);
 
if (__first == __last)
return false;
_BidirectionalIter __i = __first;
++__i;
if (__i == __last)
return false;
__i = __last;
--__i;
 
for(;;) {
_BidirectionalIter __ii = __i;
--__i;
if (__comp(*__ii, *__i)) {
_BidirectionalIter __j = __last;
while (!__comp(*--__j, *__i))
{}
iter_swap(__i, __j);
reverse(__ii, __last);
return true;
}
if (__i == __first) {
reverse(__first, __last);
return false;
}
}
}
 
// find_first_of, with and without an explicitly supplied comparison function.
 
template <class _InputIter, class _ForwardIter>
_InputIter find_first_of(_InputIter __first1, _InputIter __last1,
_ForwardIter __first2, _ForwardIter __last2)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIter>::value_type,
typename iterator_traits<_ForwardIter>::value_type>);
 
for ( ; __first1 != __last1; ++__first1)
for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter)
if (*__first1 == *__iter)
return __first1;
return __last1;
}
 
template <class _InputIter, class _ForwardIter, class _BinaryPredicate>
_InputIter find_first_of(_InputIter __first1, _InputIter __last1,
_ForwardIter __first2, _ForwardIter __last2,
_BinaryPredicate __comp)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIter>::value_type,
typename iterator_traits<_ForwardIter>::value_type>);
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
typename iterator_traits<_InputIter>::value_type,
typename iterator_traits<_ForwardIter>::value_type>);
 
for ( ; __first1 != __last1; ++__first1)
for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter)
if (__comp(*__first1, *__iter))
return __first1;
return __last1;
}
 
 
// find_end, with and without an explicitly supplied comparison function.
// Search [first2, last2) as a subsequence in [first1, last1), and return
// the *last* possible match. Note that find_end for bidirectional iterators
// is much faster than for forward iterators.
 
// find_end for forward iterators.
template <class _ForwardIter1, class _ForwardIter2>
_ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2, _ForwardIter2 __last2,
forward_iterator_tag, forward_iterator_tag)
{
if (__first2 == __last2)
return __last1;
else {
_ForwardIter1 __result = __last1;
while (1) {
_ForwardIter1 __new_result
= search(__first1, __last1, __first2, __last2);
if (__new_result == __last1)
return __result;
else {
__result = __new_result;
__first1 = __new_result;
++__first1;
}
}
}
}
 
template <class _ForwardIter1, class _ForwardIter2,
class _BinaryPredicate>
_ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2, _ForwardIter2 __last2,
forward_iterator_tag, forward_iterator_tag,
_BinaryPredicate __comp)
{
if (__first2 == __last2)
return __last1;
else {
_ForwardIter1 __result = __last1;
while (1) {
_ForwardIter1 __new_result
= search(__first1, __last1, __first2, __last2, __comp);
if (__new_result == __last1)
return __result;
else {
__result = __new_result;
__first1 = __new_result;
++__first1;
}
}
}
}
 
// find_end for bidirectional iterators. Requires partial specialization.
template <class _BidirectionalIter1, class _BidirectionalIter2>
_BidirectionalIter1
__find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
_BidirectionalIter2 __first2, _BidirectionalIter2 __last2,
bidirectional_iterator_tag, bidirectional_iterator_tag)
{
// concept requirements
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter1>);
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter2>);
 
typedef reverse_iterator<_BidirectionalIter1> _RevIter1;
typedef reverse_iterator<_BidirectionalIter2> _RevIter2;
 
_RevIter1 __rlast1(__first1);
_RevIter2 __rlast2(__first2);
_RevIter1 __rresult = search(_RevIter1(__last1), __rlast1,
_RevIter2(__last2), __rlast2);
 
if (__rresult == __rlast1)
return __last1;
else {
_BidirectionalIter1 __result = __rresult.base();
advance(__result, -distance(__first2, __last2));
return __result;
}
}
 
template <class _BidirectionalIter1, class _BidirectionalIter2,
class _BinaryPredicate>
_BidirectionalIter1
__find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
_BidirectionalIter2 __first2, _BidirectionalIter2 __last2,
bidirectional_iterator_tag, bidirectional_iterator_tag,
_BinaryPredicate __comp)
{
// concept requirements
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter1>);
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter2>);
 
typedef reverse_iterator<_BidirectionalIter1> _RevIter1;
typedef reverse_iterator<_BidirectionalIter2> _RevIter2;
 
_RevIter1 __rlast1(__first1);
_RevIter2 __rlast2(__first2);
_RevIter1 __rresult = search(_RevIter1(__last1), __rlast1,
_RevIter2(__last2), __rlast2,
__comp);
 
if (__rresult == __rlast1)
return __last1;
else {
_BidirectionalIter1 __result = __rresult.base();
advance(__result, -distance(__first2, __last2));
return __result;
}
}
 
// Dispatching functions for find_end.
 
template <class _ForwardIter1, class _ForwardIter2>
inline _ForwardIter1
find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2, _ForwardIter2 __last2)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>);
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>);
__glibcpp_function_requires(_EqualOpConcept<
typename iterator_traits<_ForwardIter1>::value_type,
typename iterator_traits<_ForwardIter2>::value_type>);
 
return __find_end(__first1, __last1, __first2, __last2,
__iterator_category(__first1),
__iterator_category(__first2));
}
 
template <class _ForwardIter1, class _ForwardIter2,
class _BinaryPredicate>
inline _ForwardIter1
find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2, _ForwardIter2 __last2,
_BinaryPredicate __comp)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>);
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>);
__glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
typename iterator_traits<_ForwardIter1>::value_type,
typename iterator_traits<_ForwardIter2>::value_type>);
 
return __find_end(__first1, __last1, __first2, __last2,
__iterator_category(__first1),
__iterator_category(__first2),
__comp);
}
 
// is_heap, a predicate testing whether or not a range is
// a heap. This function is an extension, not part of the C++
// standard.
 
template <class _RandomAccessIter, class _Distance>
bool __is_heap(_RandomAccessIter __first, _Distance __n)
{
_Distance __parent = 0;
for (_Distance __child = 1; __child < __n; ++__child) {
if (__first[__parent] < __first[__child])
return false;
if ((__child & 1) == 0)
++__parent;
}
return true;
}
 
template <class _RandomAccessIter, class _Distance, class _StrictWeakOrdering>
bool __is_heap(_RandomAccessIter __first, _StrictWeakOrdering __comp,
_Distance __n)
{
_Distance __parent = 0;
for (_Distance __child = 1; __child < __n; ++__child) {
if (__comp(__first[__parent], __first[__child]))
return false;
if ((__child & 1) == 0)
++__parent;
}
return true;
}
 
template <class _RandomAccessIter>
inline bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last)
{
// concept requirements
__glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIter>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIter>::value_type>);
 
return __is_heap(__first, __last - __first);
}
 
 
template <class _RandomAccessIter, class _StrictWeakOrdering>
inline bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last,
_StrictWeakOrdering __comp)
{
// concept requirements
__glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
typename iterator_traits<_RandomAccessIter>::value_type,
typename iterator_traits<_RandomAccessIter>::value_type>);
 
return __is_heap(__first, __comp, __last - __first);
}
 
// is_sorted, a predicated testing whether a range is sorted in
// nondescending order. This is an extension, not part of the C++
// standard.
 
template <class _ForwardIter>
bool is_sorted(_ForwardIter __first, _ForwardIter __last)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_ForwardIter>::value_type>);
 
if (__first == __last)
return true;
 
_ForwardIter __next = __first;
for (++__next; __next != __last; __first = __next, ++__next) {
if (*__next < *__first)
return false;
}
 
return true;
}
 
template <class _ForwardIter, class _StrictWeakOrdering>
bool is_sorted(_ForwardIter __first, _ForwardIter __last,
_StrictWeakOrdering __comp)
{
// concept requirements
__glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
typename iterator_traits<_ForwardIter>::value_type,
typename iterator_traits<_ForwardIter>::value_type>);
 
if (__first == __last)
return true;
 
_ForwardIter __next = __first;
for (++__next; __next != __last; __first = __next, ++__next) {
if (__comp(*__next, *__first))
return false;
}
 
return true;
}
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_ALGO_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_algobase.h
0,0 → 1,706
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996-1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
 
#ifndef __SGI_STL_INTERNAL_ALGOBASE_H
#define __SGI_STL_INTERNAL_ALGOBASE_H
 
#include <bits/c++config.h>
#ifndef __SGI_STL_INTERNAL_PAIR_H
#include <bits/stl_pair.h>
#endif
#ifndef _CPP_BITS_TYPE_TRAITS_H
#include <bits/type_traits.h>
#endif
#include <bits/std_cstring.h>
#include <bits/std_climits.h>
#include <bits/std_cstdlib.h>
#include <bits/std_cstddef.h>
#include <new>
 
#include <bits/std_iosfwd.h>
#include <bits/stl_iterator_base_types.h>
#include <bits/stl_iterator_base_funcs.h>
#include <bits/stl_iterator.h>
#include <bits/concept_check.h>
 
namespace std
{
 
// swap and iter_swap
 
template <class _ForwardIter1, class _ForwardIter2, class _Tp>
inline void __iter_swap(_ForwardIter1 __a, _ForwardIter2 __b, _Tp*)
{
_Tp __tmp = *__a;
*__a = *__b;
*__b = __tmp;
}
 
template <class _ForwardIter1, class _ForwardIter2>
inline void iter_swap(_ForwardIter1 __a, _ForwardIter2 __b)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter1>);
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter2>);
__glibcpp_function_requires(_ConvertibleConcept<
typename iterator_traits<_ForwardIter1>::value_type,
typename iterator_traits<_ForwardIter2>::value_type>);
__glibcpp_function_requires(_ConvertibleConcept<
typename iterator_traits<_ForwardIter2>::value_type,
typename iterator_traits<_ForwardIter1>::value_type>);
 
__iter_swap(__a, __b, __value_type(__a));
}
 
template <class _Tp>
inline void swap(_Tp& __a, _Tp& __b)
{
// concept requirements
__glibcpp_function_requires(_SGIAssignableConcept<_Tp>);
 
_Tp __tmp = __a;
__a = __b;
__b = __tmp;
}
 
//--------------------------------------------------
// min and max
 
#undef min
#undef max
 
template <class _Tp>
inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
// concept requirements
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
//return __b < __a ? __b : __a;
if (__b < __a) return __b; return __a;
}
 
template <class _Tp>
inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
// concept requirements
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
//return __a < __b ? __b : __a;
if (__a < __b) return __b; return __a;
}
 
template <class _Tp, class _Compare>
inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) {
//return __comp(__b, __a) ? __b : __a;
if (__comp(__b, __a)) return __b; return __a;
}
 
template <class _Tp, class _Compare>
inline const _Tp& max(const _Tp& __a, const _Tp& __b, _Compare __comp) {
//return __comp(__a, __b) ? __b : __a;
if (__comp(__a, __b)) return __b; return __a;
}
 
//--------------------------------------------------
// copy
 
// All of these auxiliary functions serve two purposes. (1) Replace
// calls to copy with memmove whenever possible. (Memmove, not memcpy,
// because the input and output ranges are permitted to overlap.)
// (2) If we're using random access iterators, then write the loop as
// a for loop with an explicit count.
 
template <class _InputIter, class _OutputIter, class _Distance>
inline _OutputIter __copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
input_iterator_tag, _Distance*)
{
for ( ; __first != __last; ++__result, ++__first)
*__result = *__first;
return __result;
}
 
template <class _RandomAccessIter, class _OutputIter, class _Distance>
inline _OutputIter
__copy(_RandomAccessIter __first, _RandomAccessIter __last,
_OutputIter __result, random_access_iterator_tag, _Distance*)
{
for (_Distance __n = __last - __first; __n > 0; --__n) {
*__result = *__first;
++__first;
++__result;
}
return __result;
}
 
template <class _Tp>
inline _Tp*
__copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result)
{
memmove(__result, __first, sizeof(_Tp) * (__last - __first));
return __result + (__last - __first);
}
 
 
template <class _InputIter, class _OutputIter>
inline _OutputIter __copy_aux2(_InputIter __first, _InputIter __last,
_OutputIter __result, __false_type)
{
return __copy(__first, __last, __result,
__iterator_category(__first),
__distance_type(__first));
}
 
template <class _InputIter, class _OutputIter>
inline _OutputIter __copy_aux2(_InputIter __first, _InputIter __last,
_OutputIter __result, __true_type)
{
return __copy(__first, __last, __result,
__iterator_category(__first),
__distance_type(__first));
}
 
template <class _Tp>
inline _Tp* __copy_aux2(_Tp* __first, _Tp* __last, _Tp* __result,
__true_type)
{
return __copy_trivial(__first, __last, __result);
}
 
template <class _Tp>
inline _Tp* __copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result,
__true_type)
{
return __copy_trivial(__first, __last, __result);
}
 
 
template <class _InputIter, class _OutputIter, class _Tp>
inline _OutputIter __copy_aux(_InputIter __first, _InputIter __last,
_OutputIter __result, _Tp*)
{
typedef typename __type_traits<_Tp>::has_trivial_assignment_operator
_Trivial;
return __copy_aux2(__first, __last, __result, _Trivial());
}
 
template<typename _InputIter, typename _OutputIter>
inline _OutputIter __copy_ni2(_InputIter __first, _InputIter __last,
_OutputIter __result, __true_type)
{
return _OutputIter(__copy_aux(__first, __last, __result.base(),
__value_type(__first)));
}
 
template<typename _InputIter, typename _OutputIter>
inline _OutputIter __copy_ni2(_InputIter __first, _InputIter __last,
_OutputIter __result, __false_type)
{
return __copy_aux(__first, __last, __result, __value_type(__first));
}
 
template<typename _InputIter, typename _OutputIter>
inline _OutputIter __copy_ni1(_InputIter __first, _InputIter __last,
_OutputIter __result, __true_type)
{
typedef typename _Is_normal_iterator<_OutputIter>::_Normal __Normal;
return __copy_ni2(__first.base(), __last.base(), __result, __Normal());
}
 
template<typename _InputIter, typename _OutputIter>
inline _OutputIter __copy_ni1(_InputIter __first, _InputIter __last,
_OutputIter __result, __false_type)
{
typedef typename _Is_normal_iterator<_OutputIter>::_Normal __Normal;
return __copy_ni2(__first, __last, __result, __Normal());
}
 
template <class _InputIter, class _OutputIter>
inline _OutputIter copy(_InputIter __first, _InputIter __last,
_OutputIter __result)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter>::value_type>);
 
typedef typename _Is_normal_iterator<_InputIter>::_Normal __Normal;
return __copy_ni1(__first, __last, __result, __Normal());
}
 
//--------------------------------------------------
// copy_backward
 
template <class _BidirectionalIter1, class _BidirectionalIter2,
class _Distance>
inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1 __first,
_BidirectionalIter1 __last,
_BidirectionalIter2 __result,
bidirectional_iterator_tag,
_Distance*)
{
while (__first != __last)
*--__result = *--__last;
return __result;
}
 
template <class _RandomAccessIter, class _BidirectionalIter, class _Distance>
inline _BidirectionalIter __copy_backward(_RandomAccessIter __first,
_RandomAccessIter __last,
_BidirectionalIter __result,
random_access_iterator_tag,
_Distance*)
{
for (_Distance __n = __last - __first; __n > 0; --__n)
*--__result = *--__last;
return __result;
}
 
 
// This dispatch class is a workaround for compilers that do not
// have partial ordering of function templates. All we're doing is
// creating a specialization so that we can turn a call to copy_backward
// into a memmove whenever possible.
 
template <class _BidirectionalIter1, class _BidirectionalIter2,
class _BoolType>
struct __copy_backward_dispatch
{
typedef typename iterator_traits<_BidirectionalIter1>::iterator_category
_Cat;
typedef typename iterator_traits<_BidirectionalIter1>::difference_type
_Distance;
 
static _BidirectionalIter2 copy(_BidirectionalIter1 __first,
_BidirectionalIter1 __last,
_BidirectionalIter2 __result) {
return __copy_backward(__first, __last, __result, _Cat(), (_Distance*) 0);
}
};
 
template <class _Tp>
struct __copy_backward_dispatch<_Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
const ptrdiff_t _Num = __last - __first;
memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
return __result - _Num;
}
};
 
template <class _Tp>
struct __copy_backward_dispatch<const _Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
return __copy_backward_dispatch<_Tp*, _Tp*, __true_type>
::copy(__first, __last, __result);
}
};
 
template <class _BI1, class _BI2>
inline _BI2 __copy_backward_aux(_BI1 __first, _BI1 __last, _BI2 __result) {
typedef typename __type_traits<typename iterator_traits<_BI2>::value_type>
::has_trivial_assignment_operator
_Trivial;
return __copy_backward_dispatch<_BI1, _BI2, _Trivial>
::copy(__first, __last, __result);
}
 
template <typename _BI1, typename _BI2>
inline _BI2 __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last,
_BI2 __result, __true_type) {
return _BI2(__copy_backward_aux(__first, __last, __result.base()));
}
 
template <typename _BI1, typename _BI2>
inline _BI2 __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last,
_BI2 __result, __false_type){
return __copy_backward_aux(__first, __last, __result);
}
 
template <typename _BI1, typename _BI2>
inline _BI2 __copy_backward_input_normal_iterator(_BI1 __first, _BI1 __last,
_BI2 __result, __true_type) {
typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal;
return __copy_backward_output_normal_iterator(__first.base(), __last.base(),
__result, __Normal());
}
 
template <typename _BI1, typename _BI2>
inline _BI2 __copy_backward_input_normal_iterator(_BI1 __first, _BI1 __last,
_BI2 __result, __false_type) {
typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal;
return __copy_backward_output_normal_iterator(__first, __last, __result,
__Normal());
}
 
template <typename _BI1, typename _BI2>
inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
{
// concept requirements
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BI1>);
__glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>);
__glibcpp_function_requires(_ConvertibleConcept<
typename iterator_traits<_BI1>::value_type,
typename iterator_traits<_BI2>::value_type>);
 
typedef typename _Is_normal_iterator<_BI1>::_Normal __Normal;
return __copy_backward_input_normal_iterator(__first, __last, __result,
__Normal());
}
 
//--------------------------------------------------
// copy_n (not part of the C++ standard)
 
template <class _InputIter, class _Size, class _OutputIter>
pair<_InputIter, _OutputIter> __copy_n(_InputIter __first, _Size __count,
_OutputIter __result,
input_iterator_tag) {
for ( ; __count > 0; --__count) {
*__result = *__first;
++__first;
++__result;
}
return pair<_InputIter, _OutputIter>(__first, __result);
}
 
template <class _RAIter, class _Size, class _OutputIter>
inline pair<_RAIter, _OutputIter>
__copy_n(_RAIter __first, _Size __count,
_OutputIter __result,
random_access_iterator_tag) {
_RAIter __last = __first + __count;
return pair<_RAIter, _OutputIter>(__last, copy(__first, __last, __result));
}
 
template <class _InputIter, class _Size, class _OutputIter>
inline pair<_InputIter, _OutputIter>
__copy_n(_InputIter __first, _Size __count, _OutputIter __result) {
return __copy_n(__first, __count, __result,
__iterator_category(__first));
}
 
template <class _InputIter, class _Size, class _OutputIter>
inline pair<_InputIter, _OutputIter>
copy_n(_InputIter __first, _Size __count, _OutputIter __result)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
typename iterator_traits<_InputIter>::value_type>);
 
return __copy_n(__first, __count, __result);
}
 
//--------------------------------------------------
// fill and fill_n
 
 
template <class _ForwardIter, class _Tp>
void fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __value)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
 
for ( ; __first != __last; ++__first)
*__first = __value;
}
 
template <class _OutputIter, class _Size, class _Tp>
_OutputIter fill_n(_OutputIter __first, _Size __n, const _Tp& __value)
{
// concept requirements
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,_Tp>);
 
for ( ; __n > 0; --__n, ++__first)
*__first = __value;
return __first;
}
 
// Specialization: for one-byte types we can use memset.
 
inline void fill(unsigned char* __first, unsigned char* __last,
const unsigned char& __c)
{
unsigned char __tmp = __c;
memset(__first, __tmp, __last - __first);
}
 
inline void fill(signed char* __first, signed char* __last,
const signed char& __c)
{
signed char __tmp = __c;
memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
}
 
inline void fill(char* __first, char* __last, const char& __c)
{
char __tmp = __c;
memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
}
 
template <class _Size>
inline unsigned char* fill_n(unsigned char* __first, _Size __n,
const unsigned char& __c)
{
fill(__first, __first + __n, __c);
return __first + __n;
}
 
template <class _Size>
inline signed char* fill_n(char* __first, _Size __n,
const signed char& __c)
{
fill(__first, __first + __n, __c);
return __first + __n;
}
 
template <class _Size>
inline char* fill_n(char* __first, _Size __n, const char& __c)
{
fill(__first, __first + __n, __c);
return __first + __n;
}
 
 
//--------------------------------------------------
// equal and mismatch
 
template <class _InputIter1, class _InputIter2>
pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1,
_InputIter1 __last1,
_InputIter2 __first2)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_EqualityComparableConcept<
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_EqualityComparableConcept<
typename iterator_traits<_InputIter2>::value_type>);
 
while (__first1 != __last1 && *__first1 == *__first2) {
++__first1;
++__first2;
}
return pair<_InputIter1, _InputIter2>(__first1, __first2);
}
 
template <class _InputIter1, class _InputIter2, class _BinaryPredicate>
pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1,
_InputIter1 __last1,
_InputIter2 __first2,
_BinaryPredicate __binary_pred)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
 
while (__first1 != __last1 && __binary_pred(*__first1, *__first2)) {
++__first1;
++__first2;
}
return pair<_InputIter1, _InputIter2>(__first1, __first2);
}
 
template <class _InputIter1, class _InputIter2>
inline bool equal(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIter1>::value_type,
typename iterator_traits<_InputIter2>::value_type>);
 
for ( ; __first1 != __last1; ++__first1, ++__first2)
if (!(*__first1 == *__first2))
return false;
return true;
}
 
template <class _InputIter1, class _InputIter2, class _BinaryPredicate>
inline bool equal(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _BinaryPredicate __binary_pred)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
 
for ( ; __first1 != __last1; ++__first1, ++__first2)
if (!__binary_pred(*__first1, *__first2))
return false;
return true;
}
 
//--------------------------------------------------
// lexicographical_compare and lexicographical_compare_3way.
// (the latter is not part of the C++ standard.)
 
template <class _InputIter1, class _InputIter2>
bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIter2>::value_type>);
 
for ( ; __first1 != __last1 && __first2 != __last2
; ++__first1, ++__first2) {
if (*__first1 < *__first2)
return true;
if (*__first2 < *__first1)
return false;
}
return __first1 == __last1 && __first2 != __last2;
}
 
template <class _InputIter1, class _InputIter2, class _Compare>
bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
 
for ( ; __first1 != __last1 && __first2 != __last2
; ++__first1, ++__first2) {
if (__comp(*__first1, *__first2))
return true;
if (__comp(*__first2, *__first1))
return false;
}
return __first1 == __last1 && __first2 != __last2;
}
 
inline bool
lexicographical_compare(const unsigned char* __first1,
const unsigned char* __last1,
const unsigned char* __first2,
const unsigned char* __last2)
{
const size_t __len1 = __last1 - __first1;
const size_t __len2 = __last2 - __first2;
const int __result = memcmp(__first1, __first2, min(__len1, __len2));
return __result != 0 ? __result < 0 : __len1 < __len2;
}
 
inline bool lexicographical_compare(const char* __first1, const char* __last1,
const char* __first2, const char* __last2)
{
#if CHAR_MAX == SCHAR_MAX
return lexicographical_compare((const signed char*) __first1,
(const signed char*) __last1,
(const signed char*) __first2,
(const signed char*) __last2);
#else /* CHAR_MAX == SCHAR_MAX */
return lexicographical_compare((const unsigned char*) __first1,
(const unsigned char*) __last1,
(const unsigned char*) __first2,
(const unsigned char*) __last2);
#endif /* CHAR_MAX == SCHAR_MAX */
}
 
template <class _InputIter1, class _InputIter2>
int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2)
{
while (__first1 != __last1 && __first2 != __last2) {
if (*__first1 < *__first2)
return -1;
if (*__first2 < *__first1)
return 1;
++__first1;
++__first2;
}
if (__first2 == __last2) {
return !(__first1 == __last1);
}
else {
return -1;
}
}
 
inline int
__lexicographical_compare_3way(const unsigned char* __first1,
const unsigned char* __last1,
const unsigned char* __first2,
const unsigned char* __last2)
{
const ptrdiff_t __len1 = __last1 - __first1;
const ptrdiff_t __len2 = __last2 - __first2;
const int __result = memcmp(__first1, __first2, min(__len1, __len2));
return __result != 0 ? __result
: (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1));
}
 
inline int
__lexicographical_compare_3way(const char* __first1, const char* __last1,
const char* __first2, const char* __last2)
{
#if CHAR_MAX == SCHAR_MAX
return __lexicographical_compare_3way(
(const signed char*) __first1,
(const signed char*) __last1,
(const signed char*) __first2,
(const signed char*) __last2);
#else
return __lexicographical_compare_3way((const unsigned char*) __first1,
(const unsigned char*) __last1,
(const unsigned char*) __first2,
(const unsigned char*) __last2);
#endif
}
 
template <class _InputIter1, class _InputIter2>
int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIter1>::value_type>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIter2>::value_type>);
 
return __lexicographical_compare_3way(__first1, __last1, __first2, __last2);
}
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_ALGOBASE_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_alloc.h
0,0 → 1,822
/*
* Copyright (c) 1996-1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_ALLOC_H
#define __SGI_STL_INTERNAL_ALLOC_H
 
// This implements some standard node allocators. These are
// NOT the same as the allocators in the C++ draft standard or in
// in the original STL. They do not encapsulate different pointer
// types; indeed we assume that there is only one pointer type.
// The allocation primitives are intended to allocate individual objects,
// not larger arenas as with the original STL allocators.
 
#include <bits/functexcept.h> // for __throw_bad_alloc
#include <bits/std_cstddef.h>
#include <bits/std_cstdlib.h>
#include <bits/std_cstring.h>
#include <bits/std_cassert.h>
#ifndef __RESTRICT
# define __RESTRICT
#endif
 
#ifdef __STL_THREADS
# include <bits/stl_threads.h>
# define __NODE_ALLOCATOR_THREADS true
# ifdef __STL_SGI_THREADS
// We test whether threads are in use before locking.
// Perhaps this should be moved into stl_threads.h, but that
// probably makes it harder to avoid the procedure call when
// it isn't needed.
extern "C" {
extern int __us_rsthread_malloc;
}
// The above is copied from malloc.h. Including <malloc.h>
// would be cleaner but fails with certain levels of standard
// conformance.
# define __NODE_ALLOCATOR_LOCK if (threads && __us_rsthread_malloc) \
{ _S_node_allocator_lock._M_acquire_lock(); }
# define __NODE_ALLOCATOR_UNLOCK if (threads && __us_rsthread_malloc) \
{ _S_node_allocator_lock._M_release_lock(); }
# else /* !__STL_SGI_THREADS */
# define __NODE_ALLOCATOR_LOCK \
{ if (threads) _S_node_allocator_lock._M_acquire_lock(); }
# define __NODE_ALLOCATOR_UNLOCK \
{ if (threads) _S_node_allocator_lock._M_release_lock(); }
# endif
#else
// Thread-unsafe
# define __NODE_ALLOCATOR_LOCK
# define __NODE_ALLOCATOR_UNLOCK
# define __NODE_ALLOCATOR_THREADS false
#endif
 
namespace std
{
 
// Malloc-based allocator. Typically slower than default alloc below.
// Typically thread-safe and more storage efficient.
template <int __inst>
class __malloc_alloc_template {
 
private:
 
static void* _S_oom_malloc(size_t);
static void* _S_oom_realloc(void*, size_t);
static void (* __malloc_alloc_oom_handler)();
 
public:
 
static void* allocate(size_t __n)
{
void* __result = malloc(__n);
if (0 == __result) __result = _S_oom_malloc(__n);
return __result;
}
 
static void deallocate(void* __p, size_t /* __n */)
{
free(__p);
}
 
static void* reallocate(void* __p, size_t /* old_sz */, size_t __new_sz)
{
void* __result = realloc(__p, __new_sz);
if (0 == __result) __result = _S_oom_realloc(__p, __new_sz);
return __result;
}
 
static void (* __set_malloc_handler(void (*__f)()))()
{
void (* __old)() = __malloc_alloc_oom_handler;
__malloc_alloc_oom_handler = __f;
return(__old);
}
 
};
 
// malloc_alloc out-of-memory handling
 
template <int __inst>
void (* __malloc_alloc_template<__inst>::__malloc_alloc_oom_handler)() = 0;
 
template <int __inst>
void*
__malloc_alloc_template<__inst>::_S_oom_malloc(size_t __n)
{
void (* __my_malloc_handler)();
void* __result;
 
for (;;) {
__my_malloc_handler = __malloc_alloc_oom_handler;
if (0 == __my_malloc_handler) { std::__throw_bad_alloc(); }
(*__my_malloc_handler)();
__result = malloc(__n);
if (__result) return(__result);
}
}
 
template <int __inst>
void* __malloc_alloc_template<__inst>::_S_oom_realloc(void* __p, size_t __n)
{
void (* __my_malloc_handler)();
void* __result;
 
for (;;) {
__my_malloc_handler = __malloc_alloc_oom_handler;
if (0 == __my_malloc_handler) { std::__throw_bad_alloc(); }
(*__my_malloc_handler)();
__result = realloc(__p, __n);
if (__result) return(__result);
}
}
 
typedef __malloc_alloc_template<0> malloc_alloc;
 
template<class _Tp, class _Alloc>
class simple_alloc {
 
public:
static _Tp* allocate(size_t __n)
{ return 0 == __n ? 0 : (_Tp*) _Alloc::allocate(__n * sizeof (_Tp)); }
static _Tp* allocate(void)
{ return (_Tp*) _Alloc::allocate(sizeof (_Tp)); }
static void deallocate(_Tp* __p, size_t __n)
{ if (0 != __n) _Alloc::deallocate(__p, __n * sizeof (_Tp)); }
static void deallocate(_Tp* __p)
{ _Alloc::deallocate(__p, sizeof (_Tp)); }
};
 
// Allocator adaptor to check size arguments for debugging.
// Reports errors using assert. Checking can be disabled with
// NDEBUG, but it's far better to just use the underlying allocator
// instead when no checking is desired.
// There is some evidence that this can confuse Purify.
template <class _Alloc>
class debug_alloc {
 
private:
 
enum {_S_extra = 8}; // Size of space used to store size. Note
// that this must be large enough to preserve
// alignment.
 
public:
 
static void* allocate(size_t __n)
{
char* __result = (char*)_Alloc::allocate(__n + (int) _S_extra);
*(size_t*)__result = __n;
return __result + (int) _S_extra;
}
 
static void deallocate(void* __p, size_t __n)
{
char* __real_p = (char*)__p - (int) _S_extra;
assert(*(size_t*)__real_p == __n);
_Alloc::deallocate(__real_p, __n + (int) _S_extra);
}
 
static void* reallocate(void* __p, size_t __old_sz, size_t __new_sz)
{
char* __real_p = (char*)__p - (int) _S_extra;
assert(*(size_t*)__real_p == __old_sz);
char* __result = (char*)
_Alloc::reallocate(__real_p, __old_sz + (int) _S_extra,
__new_sz + (int) _S_extra);
*(size_t*)__result = __new_sz;
return __result + (int) _S_extra;
}
 
};
 
 
# ifdef __USE_MALLOC
 
typedef malloc_alloc alloc;
typedef malloc_alloc single_client_alloc;
 
# else
 
 
// Default node allocator.
// With a reasonable compiler, this should be roughly as fast as the
// original STL class-specific allocators, but with less fragmentation.
// Default_alloc_template parameters are experimental and MAY
// DISAPPEAR in the future. Clients should just use alloc for now.
//
// Important implementation properties:
// 1. If the client request an object of size > _MAX_BYTES, the resulting
// object will be obtained directly from malloc.
// 2. In all other cases, we allocate an object of size exactly
// _S_round_up(requested_size). Thus the client has enough size
// information that we can return the object to the proper free list
// without permanently losing part of the object.
//
 
// The first template parameter specifies whether more than one thread
// may use this allocator. It is safe to allocate an object from
// one instance of a default_alloc and deallocate it with another
// one. This effectively transfers its ownership to the second one.
// This may have undesirable effects on reference locality.
// The second parameter is unreferenced and serves only to allow the
// creation of multiple default_alloc instances.
// Node that containers built on different allocator instances have
// different types, limiting the utility of this approach.
 
template <bool threads, int inst>
class __default_alloc_template {
 
private:
// Really we should use static const int x = N
// instead of enum { x = N }, but few compilers accept the former.
enum {_ALIGN = 8};
enum {_MAX_BYTES = 128};
enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
static size_t
_S_round_up(size_t __bytes)
{ return (((__bytes) + (size_t) _ALIGN-1) & ~((size_t) _ALIGN - 1)); }
 
union _Obj {
union _Obj* _M_free_list_link;
char _M_client_data[1]; /* The client sees this. */
};
 
static _Obj* __STL_VOLATILE _S_free_list[];
// Specifying a size results in duplicate def for 4.1
static size_t _S_freelist_index(size_t __bytes) {
return (((__bytes) + (size_t)_ALIGN-1)/(size_t)_ALIGN - 1);
}
 
// Returns an object of size __n, and optionally adds to size __n free list.
static void* _S_refill(size_t __n);
// Allocates a chunk for nobjs of size size. nobjs may be reduced
// if it is inconvenient to allocate the requested number.
static char* _S_chunk_alloc(size_t __size, int& __nobjs);
 
// Chunk allocation state.
static char* _S_start_free;
static char* _S_end_free;
static size_t _S_heap_size;
 
# ifdef __STL_THREADS
static _STL_mutex_lock _S_node_allocator_lock;
# endif
 
// It would be nice to use _STL_auto_lock here. But we
// don't need the NULL check. And we do need a test whether
// threads have actually been started.
class _Lock;
friend class _Lock;
class _Lock {
public:
_Lock() { __NODE_ALLOCATOR_LOCK; }
~_Lock() { __NODE_ALLOCATOR_UNLOCK; }
};
 
public:
 
/* __n must be > 0 */
static void* allocate(size_t __n)
{
void* __ret = 0;
 
if (__n > (size_t) _MAX_BYTES) {
__ret = malloc_alloc::allocate(__n);
}
else {
_Obj* __STL_VOLATILE* __my_free_list
= _S_free_list + _S_freelist_index(__n);
// Acquire the lock here with a constructor call.
// This ensures that it is released in exit or during stack
// unwinding.
# ifndef _NOTHREADS
/*REFERENCED*/
_Lock __lock_instance;
# endif
_Obj* __RESTRICT __result = *__my_free_list;
if (__result == 0)
__ret = _S_refill(_S_round_up(__n));
else {
*__my_free_list = __result -> _M_free_list_link;
__ret = __result;
}
}
 
return __ret;
};
 
/* __p may not be 0 */
static void deallocate(void* __p, size_t __n)
{
if (__n > (size_t) _MAX_BYTES)
malloc_alloc::deallocate(__p, __n);
else {
_Obj* __STL_VOLATILE* __my_free_list
= _S_free_list + _S_freelist_index(__n);
_Obj* __q = (_Obj*)__p;
 
// acquire lock
# ifndef _NOTHREADS
/*REFERENCED*/
_Lock __lock_instance;
# endif /* _NOTHREADS */
__q -> _M_free_list_link = *__my_free_list;
*__my_free_list = __q;
// lock is released here
}
}
 
static void* reallocate(void* __p, size_t __old_sz, size_t __new_sz);
 
} ;
 
typedef __default_alloc_template<__NODE_ALLOCATOR_THREADS, 0> alloc;
typedef __default_alloc_template<false, 0> single_client_alloc;
 
template <bool __threads, int __inst>
inline bool operator==(const __default_alloc_template<__threads, __inst>&,
const __default_alloc_template<__threads, __inst>&)
{
return true;
}
 
template <bool __threads, int __inst>
inline bool operator!=(const __default_alloc_template<__threads, __inst>&,
const __default_alloc_template<__threads, __inst>&)
{
return false;
}
 
 
 
/* We allocate memory in large chunks in order to avoid fragmenting */
/* the malloc heap too much. */
/* We assume that size is properly aligned. */
/* We hold the allocation lock. */
template <bool __threads, int __inst>
char*
__default_alloc_template<__threads, __inst>::_S_chunk_alloc(size_t __size,
int& __nobjs)
{
char* __result;
size_t __total_bytes = __size * __nobjs;
size_t __bytes_left = _S_end_free - _S_start_free;
 
if (__bytes_left >= __total_bytes) {
__result = _S_start_free;
_S_start_free += __total_bytes;
return(__result);
} else if (__bytes_left >= __size) {
__nobjs = (int)(__bytes_left/__size);
__total_bytes = __size * __nobjs;
__result = _S_start_free;
_S_start_free += __total_bytes;
return(__result);
} else {
size_t __bytes_to_get =
2 * __total_bytes + _S_round_up(_S_heap_size >> 4);
// Try to make use of the left-over piece.
if (__bytes_left > 0) {
_Obj* __STL_VOLATILE* __my_free_list =
_S_free_list + _S_freelist_index(__bytes_left);
 
((_Obj*)_S_start_free) -> _M_free_list_link = *__my_free_list;
*__my_free_list = (_Obj*)_S_start_free;
}
_S_start_free = (char*)malloc(__bytes_to_get);
if (0 == _S_start_free) {
size_t __i;
_Obj* __STL_VOLATILE* __my_free_list;
_Obj* __p;
// Try to make do with what we have. That can't
// hurt. We do not try smaller requests, since that tends
// to result in disaster on multi-process machines.
for (__i = __size;
__i <= (size_t) _MAX_BYTES;
__i += (size_t) _ALIGN) {
__my_free_list = _S_free_list + _S_freelist_index(__i);
__p = *__my_free_list;
if (0 != __p) {
*__my_free_list = __p -> _M_free_list_link;
_S_start_free = (char*)__p;
_S_end_free = _S_start_free + __i;
return(_S_chunk_alloc(__size, __nobjs));
// Any leftover piece will eventually make it to the
// right free list.
}
}
_S_end_free = 0; // In case of exception.
_S_start_free = (char*)malloc_alloc::allocate(__bytes_to_get);
// This should either throw an
// exception or remedy the situation. Thus we assume it
// succeeded.
}
_S_heap_size += __bytes_to_get;
_S_end_free = _S_start_free + __bytes_to_get;
return(_S_chunk_alloc(__size, __nobjs));
}
}
 
 
/* Returns an object of size __n, and optionally adds to size __n free list.*/
/* We assume that __n is properly aligned. */
/* We hold the allocation lock. */
template <bool __threads, int __inst>
void*
__default_alloc_template<__threads, __inst>::_S_refill(size_t __n)
{
int __nobjs = 20;
char* __chunk = _S_chunk_alloc(__n, __nobjs);
_Obj* __STL_VOLATILE* __my_free_list;
_Obj* __result;
_Obj* __current_obj;
_Obj* __next_obj;
int __i;
 
if (1 == __nobjs) return(__chunk);
__my_free_list = _S_free_list + _S_freelist_index(__n);
 
/* Build free list in chunk */
__result = (_Obj*)__chunk;
*__my_free_list = __next_obj = (_Obj*)(__chunk + __n);
for (__i = 1; ; __i++) {
__current_obj = __next_obj;
__next_obj = (_Obj*)((char*)__next_obj + __n);
if (__nobjs - 1 == __i) {
__current_obj -> _M_free_list_link = 0;
break;
} else {
__current_obj -> _M_free_list_link = __next_obj;
}
}
return(__result);
}
 
template <bool threads, int inst>
void*
__default_alloc_template<threads, inst>::reallocate(void* __p,
size_t __old_sz,
size_t __new_sz)
{
void* __result;
size_t __copy_sz;
 
if (__old_sz > (size_t) _MAX_BYTES && __new_sz > (size_t) _MAX_BYTES) {
return(realloc(__p, __new_sz));
}
if (_S_round_up(__old_sz) == _S_round_up(__new_sz)) return(__p);
__result = allocate(__new_sz);
__copy_sz = __new_sz > __old_sz? __old_sz : __new_sz;
memcpy(__result, __p, __copy_sz);
deallocate(__p, __old_sz);
return(__result);
}
 
#ifdef __STL_THREADS
template <bool __threads, int __inst>
_STL_mutex_lock
__default_alloc_template<__threads, __inst>::_S_node_allocator_lock
__STL_MUTEX_INITIALIZER;
#endif
 
 
template <bool __threads, int __inst>
char* __default_alloc_template<__threads, __inst>::_S_start_free = 0;
 
template <bool __threads, int __inst>
char* __default_alloc_template<__threads, __inst>::_S_end_free = 0;
 
template <bool __threads, int __inst>
size_t __default_alloc_template<__threads, __inst>::_S_heap_size = 0;
 
template <bool __threads, int __inst>
typename __default_alloc_template<__threads, __inst>::_Obj* __STL_VOLATILE
__default_alloc_template<__threads, __inst> ::_S_free_list[
__default_alloc_template<__threads, __inst>::_NFREELISTS
] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
// The 16 zeros are necessary to make version 4.1 of the SunPro
// compiler happy. Otherwise it appears to allocate too little
// space for the array.
 
#endif /* ! __USE_MALLOC */
 
// This implements allocators as specified in the C++ standard.
//
// Note that standard-conforming allocators use many language features
// that are not yet widely implemented. In particular, they rely on
// member templates, partial specialization, partial ordering of function
// templates, the typename keyword, and the use of the template keyword
// to refer to a template member of a dependent type.
 
template <class _Tp>
class allocator {
typedef alloc _Alloc; // The underlying allocator.
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef _Tp value_type;
 
template <class _Tp1> struct rebind {
typedef allocator<_Tp1> other;
};
 
allocator() __STL_NOTHROW {}
allocator(const allocator&) __STL_NOTHROW {}
template <class _Tp1> allocator(const allocator<_Tp1>&) __STL_NOTHROW {}
~allocator() __STL_NOTHROW {}
 
pointer address(reference __x) const { return &__x; }
const_pointer address(const_reference __x) const { return &__x; }
 
// __n is permitted to be 0. The C++ standard says nothing about what
// the return value is when __n == 0.
_Tp* allocate(size_type __n, const void* = 0) {
return __n != 0 ? static_cast<_Tp*>(_Alloc::allocate(__n * sizeof(_Tp)))
: 0;
}
 
// __p is not permitted to be a null pointer.
void deallocate(pointer __p, size_type __n)
{ _Alloc::deallocate(__p, __n * sizeof(_Tp)); }
 
size_type max_size() const __STL_NOTHROW
{ return size_t(-1) / sizeof(_Tp); }
 
void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
void destroy(pointer __p) { __p->~_Tp(); }
};
 
template<>
class allocator<void> {
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
 
template <class _Tp1> struct rebind {
typedef allocator<_Tp1> other;
};
};
 
 
template <class _T1, class _T2>
inline bool operator==(const allocator<_T1>&, const allocator<_T2>&)
{
return true;
}
 
template <class _T1, class _T2>
inline bool operator!=(const allocator<_T1>&, const allocator<_T2>&)
{
return false;
}
 
// Allocator adaptor to turn an SGI-style allocator (e.g. alloc, malloc_alloc)
// into a standard-conforming allocator. Note that this adaptor does
// *not* assume that all objects of the underlying alloc class are
// identical, nor does it assume that all of the underlying alloc's
// member functions are static member functions. Note, also, that
// __allocator<_Tp, alloc> is essentially the same thing as allocator<_Tp>.
 
template <class _Tp, class _Alloc>
struct __allocator {
_Alloc __underlying_alloc;
 
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef _Tp value_type;
 
template <class _Tp1> struct rebind {
typedef __allocator<_Tp1, _Alloc> other;
};
 
__allocator() __STL_NOTHROW {}
__allocator(const __allocator& __a) __STL_NOTHROW
: __underlying_alloc(__a.__underlying_alloc) {}
template <class _Tp1>
__allocator(const __allocator<_Tp1, _Alloc>& __a) __STL_NOTHROW
: __underlying_alloc(__a.__underlying_alloc) {}
~__allocator() __STL_NOTHROW {}
 
pointer address(reference __x) const { return &__x; }
const_pointer address(const_reference __x) const { return &__x; }
 
// __n is permitted to be 0.
_Tp* allocate(size_type __n, const void* = 0) {
return __n != 0
? static_cast<_Tp*>(__underlying_alloc.allocate(__n * sizeof(_Tp)))
: 0;
}
 
// __p is not permitted to be a null pointer.
void deallocate(pointer __p, size_type __n)
{ __underlying_alloc.deallocate(__p, __n * sizeof(_Tp)); }
 
size_type max_size() const __STL_NOTHROW
{ return size_t(-1) / sizeof(_Tp); }
 
void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
void destroy(pointer __p) { __p->~_Tp(); }
};
 
template <class _Alloc>
class __allocator<void, _Alloc> {
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
 
template <class _Tp1> struct rebind {
typedef __allocator<_Tp1, _Alloc> other;
};
};
 
template <class _Tp, class _Alloc>
inline bool operator==(const __allocator<_Tp, _Alloc>& __a1,
const __allocator<_Tp, _Alloc>& __a2)
{
return __a1.__underlying_alloc == __a2.__underlying_alloc;
}
 
template <class _Tp, class _Alloc>
inline bool operator!=(const __allocator<_Tp, _Alloc>& __a1,
const __allocator<_Tp, _Alloc>& __a2)
{
return __a1.__underlying_alloc != __a2.__underlying_alloc;
}
 
// Comparison operators for all of the predifined SGI-style allocators.
// This ensures that __allocator<malloc_alloc> (for example) will
// work correctly.
 
template <int inst>
inline bool operator==(const __malloc_alloc_template<inst>&,
const __malloc_alloc_template<inst>&)
{
return true;
}
 
template <int __inst>
inline bool operator!=(const __malloc_alloc_template<__inst>&,
const __malloc_alloc_template<__inst>&)
{
return false;
}
 
template <class _Alloc>
inline bool operator==(const debug_alloc<_Alloc>&,
const debug_alloc<_Alloc>&) {
return true;
}
 
template <class _Alloc>
inline bool operator!=(const debug_alloc<_Alloc>&,
const debug_alloc<_Alloc>&) {
return false;
}
 
// Another allocator adaptor: _Alloc_traits. This serves two
// purposes. First, make it possible to write containers that can use
// either SGI-style allocators or standard-conforming allocator.
// Second, provide a mechanism so that containers can query whether or
// not the allocator has distinct instances. If not, the container
// can avoid wasting a word of memory to store an empty object.
 
// This adaptor uses partial specialization. The general case of
// _Alloc_traits<_Tp, _Alloc> assumes that _Alloc is a
// standard-conforming allocator, possibly with non-equal instances
// and non-static members. (It still behaves correctly even if _Alloc
// has static member and if all instances are equal. Refinements
// affect performance, not correctness.)
 
// There are always two members: allocator_type, which is a standard-
// conforming allocator type for allocating objects of type _Tp, and
// _S_instanceless, a static const member of type bool. If
// _S_instanceless is true, this means that there is no difference
// between any two instances of type allocator_type. Furthermore, if
// _S_instanceless is true, then _Alloc_traits has one additional
// member: _Alloc_type. This type encapsulates allocation and
// deallocation of objects of type _Tp through a static interface; it
// has two member functions, whose signatures are
// static _Tp* allocate(size_t)
// static void deallocate(_Tp*, size_t)
 
// The fully general version.
 
template <class _Tp, class _Allocator>
struct _Alloc_traits
{
static const bool _S_instanceless = false;
typedef typename _Allocator::template rebind<_Tp>::other allocator_type;
};
 
template <class _Tp, class _Allocator>
const bool _Alloc_traits<_Tp, _Allocator>::_S_instanceless;
 
// The version for the default allocator.
 
template <class _Tp, class _Tp1>
struct _Alloc_traits<_Tp, allocator<_Tp1> >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, alloc> _Alloc_type;
typedef allocator<_Tp> allocator_type;
};
 
// Versions for the predefined SGI-style allocators.
 
template <class _Tp, int __inst>
struct _Alloc_traits<_Tp, __malloc_alloc_template<__inst> >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, __malloc_alloc_template<__inst> > _Alloc_type;
typedef __allocator<_Tp, __malloc_alloc_template<__inst> > allocator_type;
};
 
#ifndef __USE_MALLOC
template <class _Tp, bool __threads, int __inst>
struct _Alloc_traits<_Tp, __default_alloc_template<__threads, __inst> >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, __default_alloc_template<__threads, __inst> >
_Alloc_type;
typedef __allocator<_Tp, __default_alloc_template<__threads, __inst> >
allocator_type;
};
#endif
 
template <class _Tp, class _Alloc>
struct _Alloc_traits<_Tp, debug_alloc<_Alloc> >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, debug_alloc<_Alloc> > _Alloc_type;
typedef __allocator<_Tp, debug_alloc<_Alloc> > allocator_type;
};
 
// Versions for the __allocator adaptor used with the predefined
// SGI-style allocators.
 
template <class _Tp, class _Tp1, int __inst>
struct _Alloc_traits<_Tp,
__allocator<_Tp1, __malloc_alloc_template<__inst> > >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, __malloc_alloc_template<__inst> > _Alloc_type;
typedef __allocator<_Tp, __malloc_alloc_template<__inst> > allocator_type;
};
 
#ifndef __USE_MALLOC
template <class _Tp, class _Tp1, bool __thr, int __inst>
struct _Alloc_traits<_Tp,
__allocator<_Tp1,
__default_alloc_template<__thr, __inst> > >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, __default_alloc_template<__thr,__inst> >
_Alloc_type;
typedef __allocator<_Tp, __default_alloc_template<__thr,__inst> >
allocator_type;
};
#endif
 
template <class _Tp, class _Tp1, class _Alloc>
struct _Alloc_traits<_Tp, __allocator<_Tp1, debug_alloc<_Alloc> > >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, debug_alloc<_Alloc> > _Alloc_type;
typedef __allocator<_Tp, debug_alloc<_Alloc> > allocator_type;
};
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_ALLOC_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_bvector.h
0,0 → 1,698
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996-1999
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_BVECTOR_H
#define __SGI_STL_INTERNAL_BVECTOR_H
 
namespace std
{
 
static const int __WORD_BIT = int(CHAR_BIT*sizeof(unsigned int));
 
struct _Bit_reference {
unsigned int* _M_p;
unsigned int _M_mask;
_Bit_reference(unsigned int* __x, unsigned int __y)
: _M_p(__x), _M_mask(__y) {}
 
public:
_Bit_reference() : _M_p(0), _M_mask(0) {}
operator bool() const { return !(!(*_M_p & _M_mask)); }
_Bit_reference& operator=(bool __x)
{
if (__x) *_M_p |= _M_mask;
else *_M_p &= ~_M_mask;
return *this;
}
_Bit_reference& operator=(const _Bit_reference& __x)
{ return *this = bool(__x); }
bool operator==(const _Bit_reference& __x) const
{ return bool(*this) == bool(__x); }
bool operator<(const _Bit_reference& __x) const {
return !bool(*this) && bool(__x);
}
void flip() { *_M_p ^= _M_mask; }
};
 
inline void swap(_Bit_reference __x, _Bit_reference __y)
{
bool __tmp = __x;
__x = __y;
__y = __tmp;
}
 
struct _Bit_iterator_base : public random_access_iterator<bool, ptrdiff_t>
{
unsigned int* _M_p;
unsigned int _M_offset;
 
_Bit_iterator_base(unsigned int* __x, unsigned int __y)
: _M_p(__x), _M_offset(__y) {}
 
void _M_bump_up() {
if (_M_offset++ == __WORD_BIT - 1) {
_M_offset = 0;
++_M_p;
}
}
void _M_bump_down() {
if (_M_offset-- == 0) {
_M_offset = __WORD_BIT - 1;
--_M_p;
}
}
 
void _M_incr(ptrdiff_t __i) {
difference_type __n = __i + _M_offset;
_M_p += __n / __WORD_BIT;
__n = __n % __WORD_BIT;
if (__n < 0) {
_M_offset = (unsigned int) __n + __WORD_BIT;
--_M_p;
} else
_M_offset = (unsigned int) __n;
}
 
bool operator==(const _Bit_iterator_base& __i) const {
return _M_p == __i._M_p && _M_offset == __i._M_offset;
}
bool operator<(const _Bit_iterator_base& __i) const {
return _M_p < __i._M_p || (_M_p == __i._M_p && _M_offset < __i._M_offset);
}
bool operator!=(const _Bit_iterator_base& __i) const {
return !(*this == __i);
}
bool operator>(const _Bit_iterator_base& __i) const {
return __i < *this;
}
bool operator<=(const _Bit_iterator_base& __i) const {
return !(__i < *this);
}
bool operator>=(const _Bit_iterator_base& __i) const {
return !(*this < __i);
}
};
 
inline ptrdiff_t
operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) {
return __WORD_BIT * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset;
}
 
 
struct _Bit_iterator : public _Bit_iterator_base
{
typedef _Bit_reference reference;
typedef _Bit_reference* pointer;
typedef _Bit_iterator iterator;
 
_Bit_iterator() : _Bit_iterator_base(0, 0) {}
_Bit_iterator(unsigned int* __x, unsigned int __y)
: _Bit_iterator_base(__x, __y) {}
 
reference operator*() const { return reference(_M_p, 1U << _M_offset); }
iterator& operator++() {
_M_bump_up();
return *this;
}
iterator operator++(int) {
iterator __tmp = *this;
_M_bump_up();
return __tmp;
}
iterator& operator--() {
_M_bump_down();
return *this;
}
iterator operator--(int) {
iterator __tmp = *this;
_M_bump_down();
return __tmp;
}
iterator& operator+=(difference_type __i) {
_M_incr(__i);
return *this;
}
iterator& operator-=(difference_type __i) {
*this += -__i;
return *this;
}
iterator operator+(difference_type __i) const {
iterator __tmp = *this;
return __tmp += __i;
}
iterator operator-(difference_type __i) const {
iterator __tmp = *this;
return __tmp -= __i;
}
 
reference operator[](difference_type __i) { return *(*this + __i); }
};
 
inline _Bit_iterator
operator+(ptrdiff_t __n, const _Bit_iterator& __x) { return __x + __n; }
 
 
struct _Bit_const_iterator : public _Bit_iterator_base
{
typedef bool reference;
typedef bool const_reference;
typedef const bool* pointer;
typedef _Bit_const_iterator const_iterator;
 
_Bit_const_iterator() : _Bit_iterator_base(0, 0) {}
_Bit_const_iterator(unsigned int* __x, unsigned int __y)
: _Bit_iterator_base(__x, __y) {}
_Bit_const_iterator(const _Bit_iterator& __x)
: _Bit_iterator_base(__x._M_p, __x._M_offset) {}
 
const_reference operator*() const {
return _Bit_reference(_M_p, 1U << _M_offset);
}
const_iterator& operator++() {
_M_bump_up();
return *this;
}
const_iterator operator++(int) {
const_iterator __tmp = *this;
_M_bump_up();
return __tmp;
}
const_iterator& operator--() {
_M_bump_down();
return *this;
}
const_iterator operator--(int) {
const_iterator __tmp = *this;
_M_bump_down();
return __tmp;
}
const_iterator& operator+=(difference_type __i) {
_M_incr(__i);
return *this;
}
const_iterator& operator-=(difference_type __i) {
*this += -__i;
return *this;
}
const_iterator operator+(difference_type __i) const {
const_iterator __tmp = *this;
return __tmp += __i;
}
const_iterator operator-(difference_type __i) const {
const_iterator __tmp = *this;
return __tmp -= __i;
}
const_reference operator[](difference_type __i) {
return *(*this + __i);
}
};
 
inline _Bit_const_iterator
operator+(ptrdiff_t __n, const _Bit_const_iterator& __x) { return __x + __n; }
 
 
// Bit-vector base class, which encapsulates the difference between
// old SGI-style allocators and standard-conforming allocators.
 
// Base class for ordinary allocators.
template <class _Allocator, bool __is_static>
class _Bvector_alloc_base {
public:
typedef typename _Alloc_traits<bool, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return _M_data_allocator; }
 
_Bvector_alloc_base(const allocator_type& __a)
: _M_data_allocator(__a), _M_start(), _M_finish(), _M_end_of_storage(0) {}
 
protected:
unsigned int* _M_bit_alloc(size_t __n)
{ return _M_data_allocator.allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
void _M_deallocate() {
if (_M_start._M_p)
_M_data_allocator.deallocate(_M_start._M_p,
_M_end_of_storage - _M_start._M_p);
}
 
typename _Alloc_traits<unsigned int, _Allocator>::allocator_type
_M_data_allocator;
_Bit_iterator _M_start;
_Bit_iterator _M_finish;
unsigned int* _M_end_of_storage;
};
 
// Specialization for instanceless allocators.
template <class _Allocator>
class _Bvector_alloc_base<_Allocator, true> {
public:
typedef typename _Alloc_traits<bool, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
 
_Bvector_alloc_base(const allocator_type&)
: _M_start(), _M_finish(), _M_end_of_storage(0) {}
 
protected:
typedef typename _Alloc_traits<unsigned int, _Allocator>::_Alloc_type
_Alloc_type;
unsigned int* _M_bit_alloc(size_t __n)
{ return _Alloc_type::allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
void _M_deallocate() {
if (_M_start._M_p)
_Alloc_type::deallocate(_M_start._M_p,
_M_end_of_storage - _M_start._M_p);
}
 
_Bit_iterator _M_start;
_Bit_iterator _M_finish;
unsigned int* _M_end_of_storage;
};
 
template <class _Alloc>
class _Bvector_base
: public _Bvector_alloc_base<_Alloc,
_Alloc_traits<bool, _Alloc>::_S_instanceless>
{
typedef _Bvector_alloc_base<_Alloc,
_Alloc_traits<bool, _Alloc>::_S_instanceless>
_Base;
public:
typedef typename _Base::allocator_type allocator_type;
 
_Bvector_base(const allocator_type& __a) : _Base(__a) {}
~_Bvector_base() { _Base::_M_deallocate(); }
};
 
} // namespace std
 
// Declare a partial specialization of vector<T, Alloc>.
#include <bits/stl_vector.h>
namespace std
{
 
template <typename _Alloc>
class vector<bool, _Alloc> : public _Bvector_base<_Alloc>
{
public:
typedef bool value_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Bit_reference reference;
typedef bool const_reference;
typedef _Bit_reference* pointer;
typedef const bool* const_pointer;
typedef _Bit_iterator iterator;
typedef _Bit_const_iterator const_iterator;
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
typedef typename _Bvector_base<_Alloc>::allocator_type allocator_type;
allocator_type get_allocator() const {
return _Bvector_base<_Alloc>::get_allocator();
}
protected:
using _Bvector_base<_Alloc>::_M_bit_alloc;
using _Bvector_base<_Alloc>::_M_deallocate;
using _Bvector_base<_Alloc>::_M_start;
using _Bvector_base<_Alloc>::_M_finish;
using _Bvector_base<_Alloc>::_M_end_of_storage;
protected:
void _M_initialize(size_type __n) {
unsigned int* __q = _M_bit_alloc(__n);
_M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
_M_finish = _M_start + difference_type(__n);
}
void _M_insert_aux(iterator __position, bool __x) {
if (_M_finish._M_p != _M_end_of_storage) {
copy_backward(__position, _M_finish, _M_finish + 1);
*__position = __x;
++_M_finish;
}
else {
size_type __len = size() ? 2 * size() : __WORD_BIT;
unsigned int* __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
*__i++ = __x;
_M_finish = copy(__position, end(), __i);
_M_deallocate();
_M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
}
}
template <class _InputIterator>
void _M_initialize_range(_InputIterator __first, _InputIterator __last,
input_iterator_tag) {
_M_start = iterator();
_M_finish = iterator();
_M_end_of_storage = 0;
for ( ; __first != __last; ++__first)
push_back(*__first);
}
template <class _ForwardIterator>
void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
size_type __n = 0;
distance(__first, __last, __n);
_M_initialize(__n);
copy(__first, __last, _M_start);
}
template <class _InputIterator>
void _M_insert_range(iterator __pos,
_InputIterator __first, _InputIterator __last,
input_iterator_tag) {
for ( ; __first != __last; ++__first) {
__pos = insert(__pos, *__first);
++__pos;
}
}
template <class _ForwardIterator>
void _M_insert_range(iterator __position,
_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
if (__first != __last) {
size_type __n = 0;
distance(__first, __last, __n);
if (capacity() - size() >= __n) {
copy_backward(__position, end(), _M_finish + difference_type(__n));
copy(__first, __last, __position);
_M_finish += difference_type(__n);
}
else {
size_type __len = size() + max(size(), __n);
unsigned int* __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
__i = copy(__first, __last, __i);
_M_finish = copy(__position, end(), __i);
_M_deallocate();
_M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
}
}
}
public:
iterator begin() { return _M_start; }
const_iterator begin() const { return _M_start; }
iterator end() { return _M_finish; }
const_iterator end() const { return _M_finish; }
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const {
return const_reverse_iterator(end());
}
reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const {
return const_reverse_iterator(begin());
}
size_type size() const { return size_type(end() - begin()); }
size_type max_size() const { return size_type(-1); }
size_type capacity() const {
return size_type(const_iterator(_M_end_of_storage, 0) - begin());
}
bool empty() const { return begin() == end(); }
reference operator[](size_type __n)
{ return *(begin() + difference_type(__n)); }
const_reference operator[](size_type __n) const
{ return *(begin() + difference_type(__n)); }
void _M_range_check(size_type __n) const {
if (__n >= this->size())
__throw_range_error("vector<bool>");
}
reference at(size_type __n)
{ _M_range_check(__n); return (*this)[__n]; }
const_reference at(size_type __n) const
{ _M_range_check(__n); return (*this)[__n]; }
explicit vector(const allocator_type& __a = allocator_type())
: _Bvector_base<_Alloc>(__a) {}
vector(size_type __n, bool __value,
const allocator_type& __a = allocator_type())
: _Bvector_base<_Alloc>(__a)
{
_M_initialize(__n);
fill(_M_start._M_p, _M_end_of_storage, __value ? ~0 : 0);
}
explicit vector(size_type __n)
: _Bvector_base<_Alloc>(allocator_type())
{
_M_initialize(__n);
fill(_M_start._M_p, _M_end_of_storage, 0);
}
vector(const vector& __x) : _Bvector_base<_Alloc>(__x.get_allocator()) {
_M_initialize(__x.size());
copy(__x.begin(), __x.end(), _M_start);
}
// Check whether it's an integral type. If so, it's not an iterator.
template <class _Integer>
void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) {
_M_initialize(__n);
fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
}
template <class _InputIterator>
void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
__false_type) {
_M_initialize_range(__first, __last, __iterator_category(__first));
}
template <class _InputIterator>
vector(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type())
: _Bvector_base<_Alloc>(__a)
{
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_initialize_dispatch(__first, __last, _Integral());
}
~vector() { }
vector& operator=(const vector& __x) {
if (&__x == this) return *this;
if (__x.size() > capacity()) {
_M_deallocate();
_M_initialize(__x.size());
}
copy(__x.begin(), __x.end(), begin());
_M_finish = begin() + difference_type(__x.size());
return *this;
}
// assign(), a generalized assignment member function. Two
// versions: one that takes a count, and one that takes a range.
// The range version is a member template, so we dispatch on whether
// or not the type is an integer.
void _M_fill_assign(size_t __n, bool __x) {
if (__n > size()) {
fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
insert(end(), __n - size(), __x);
}
else {
erase(begin() + __n, end());
fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
}
}
void assign(size_t __n, bool __x) { _M_fill_assign(__n, __x); }
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
template <class _Integer>
void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ _M_fill_assign((size_t) __n, (bool) __val); }
template <class _InputIter>
void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type)
{ _M_assign_aux(__first, __last, __iterator_category(__first)); }
template <class _InputIterator>
void _M_assign_aux(_InputIterator __first, _InputIterator __last,
input_iterator_tag) {
iterator __cur = begin();
for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
*__cur = *__first;
if (__first == __last)
erase(__cur, end());
else
insert(end(), __first, __last);
}
template <class _ForwardIterator>
void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
size_type __len = 0;
distance(__first, __last, __len);
if (__len < size())
erase(copy(__first, __last, begin()), end());
else {
_ForwardIterator __mid = __first;
advance(__mid, size());
copy(__first, __mid, begin());
insert(end(), __mid, __last);
}
}
void reserve(size_type __n) {
if (capacity() < __n) {
unsigned int* __q = _M_bit_alloc(__n);
_M_finish = copy(begin(), end(), iterator(__q, 0));
_M_deallocate();
_M_start = iterator(__q, 0);
_M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT;
}
}
reference front() { return *begin(); }
const_reference front() const { return *begin(); }
reference back() { return *(end() - 1); }
const_reference back() const { return *(end() - 1); }
void push_back(bool __x) {
if (_M_finish._M_p != _M_end_of_storage)
*_M_finish++ = __x;
else
_M_insert_aux(end(), __x);
}
void swap(vector<bool, _Alloc>& __x) {
std::swap(_M_start, __x._M_start);
std::swap(_M_finish, __x._M_finish);
std::swap(_M_end_of_storage, __x._M_end_of_storage);
}
iterator insert(iterator __position, bool __x = bool()) {
difference_type __n = __position - begin();
if (_M_finish._M_p != _M_end_of_storage && __position == end())
*_M_finish++ = __x;
else
_M_insert_aux(__position, __x);
return begin() + __n;
}
// Check whether it's an integral type. If so, it's not an iterator.
template <class _Integer>
void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
__true_type) {
_M_fill_insert(__pos, __n, __x);
}
template <class _InputIterator>
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type) {
_M_insert_range(__pos, __first, __last, __iterator_category(__first));
}
template <class _InputIterator>
void insert(iterator __position,
_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral());
}
void _M_fill_insert(iterator __position, size_type __n, bool __x) {
if (__n == 0) return;
if (capacity() - size() >= __n) {
copy_backward(__position, end(), _M_finish + difference_type(__n));
fill(__position, __position + difference_type(__n), __x);
_M_finish += difference_type(__n);
}
else {
size_type __len = size() + max(size(), __n);
unsigned int* __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
fill_n(__i, __n, __x);
_M_finish = copy(__position, end(), __i + difference_type(__n));
_M_deallocate();
_M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
}
}
void insert(iterator __position, size_type __n, bool __x) {
_M_fill_insert(__position, __n, __x);
}
void pop_back() { --_M_finish; }
iterator erase(iterator __position) {
if (__position + 1 != end())
copy(__position + 1, end(), __position);
--_M_finish;
return __position;
}
iterator erase(iterator __first, iterator __last) {
_M_finish = copy(__last, end(), __first);
return __first;
}
void resize(size_type __new_size, bool __x = bool()) {
if (__new_size < size())
erase(begin() + difference_type(__new_size), end());
else
insert(end(), __new_size - size(), __x);
}
void flip() {
for (unsigned int* __p = _M_start._M_p; __p != _M_end_of_storage; ++__p)
*__p = ~*__p;
}
void clear() { erase(begin(), end()); }
};
 
// This typedef is non-standard. It is provided for backward compatibility.
typedef vector<bool, alloc> bit_vector;
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_BVECTOR_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_config.h
0,0 → 1,573
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Copyright (c) 1997
* Silicon Graphics
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
#ifndef __STL_CONFIG_H
# define __STL_CONFIG_H
 
// Flags:
// * __STL_NO_BOOL: defined if the compiler doesn't have bool as a builtin
// type.
// * __STL_HAS_WCHAR_T: defined if the compier has wchar_t as a builtin type.
// * __STL_NO_DRAND48: defined if the compiler doesn't have the drand48
// function.
// * __STL_STATIC_TEMPLATE_MEMBER_BUG: defined if the compiler can't handle
// static members of template classes.
// * __STL_STATIC_CONST_INIT_BUG: defined if the compiler can't handle a
// constant-initializer in the declaration of a static const data member
// of integer type. (See section 9.4.2, paragraph 4, of the C++ standard.)
// * __STL_CLASS_PARTIAL_SPECIALIZATION: defined if the compiler supports
// partial specialization of template classes.
// * __STL_PARTIAL_SPECIALIZATION_SYNTAX: defined if the compiler
// supports partial specialization syntax for full specialization of
// class templates. (Even if it doesn't actually support partial
// specialization itself.)
// * __STL_FUNCTION_TMPL_PARTIAL_ORDER: defined if the compiler supports
// partial ordering of function templates. (a.k.a partial specialization
// of function templates.)
// * __STL_MEMBER_TEMPLATES: defined if the compiler supports template
// member functions of classes.
// * __STL_MEMBER_TEMPLATE_CLASSES: defined if the compiler supports
// nested classes that are member templates of other classes.
// * __STL_TEMPLATE_FRIENDS: defined if the compiler supports templatized
// friend declarations.
// * __STL_EXPLICIT_FUNCTION_TMPL_ARGS: defined if the compiler
// supports calling a function template by providing its template
// arguments explicitly.
// * __STL_LIMITED_DEFAULT_TEMPLATES: defined if the compiler is unable
// to handle default template parameters that depend on previous template
// parameters.
// * __STL_NON_TYPE_TMPL_PARAM_BUG: defined if the compiler has trouble with
// function template argument deduction for non-type template parameters.
// * __SGI_STL_NO_ARROW_OPERATOR: defined if the compiler is unable
// to support the -> operator for iterators.
// * __STL_DEFAULT_CONSTRUCTOR_BUG: defined if T() does not work properly
// when T is a builtin type.
// * __STL_USE_EXCEPTIONS: defined if the compiler (in the current compilation
// mode) supports exceptions.
// * __STL_USE_NAMESPACES: defined if the compiler has the necessary
// support for namespaces.
// * __STL_NO_EXCEPTION_HEADER: defined if the compiler does not have a
// standard-conforming header <exception>.
// * __STL_NO_BAD_ALLOC: defined if the compiler does not have a <new>
// header, or if <new> does not contain a bad_alloc class. If a bad_alloc
// class exists, it is assumed to be in namespace std.
// * __STL_SGI_THREADS: defined if this is being compiled for an SGI IRIX
// system in multithreaded mode, using native SGI threads instead of
// pthreads.
// * __STL_WIN32THREADS: defined if this is being compiled on a WIN32
// compiler in multithreaded mode.
// * __STL_PTHREADS: defined if we should use portable pthreads
// synchronization.
// * __STL_UITHREADS: defined if we should use UI / solaris / UnixWare threads
// synchronization. UIthreads are similar to pthreads, but are based
// on an earlier version of the Posix threads standard.
// * __STL_LONG_LONG if the compiler has long long and unsigned long long
// types. (They're not in the C++ standard, but they are included
// in the C99 standard.)
// * __STL_THREADS is defined if thread safety is needed.
// * __STL_VOLATILE is defined to be "volatile" if threads are being
// used, and the empty string otherwise.
// * __STL_USE_CONCEPT_CHECKS enables some extra compile-time error
// checking to make sure that user-defined template arguments satisfy
// all of the appropriate requirements. This may result in more
// comprehensible error messages. It incurs no runtime overhead. This
// feature requires member templates and partial specialization.
// * __STL_NO_USING_CLAUSE_IN_CLASS: The compiler does not handle "using"
// clauses inside of class definitions.
// * __STL_NO_FRIEND_TEMPLATE_CLASS: The compiler does not handle friend
// declaractions where the friend is a template class.
// * __STL_NO_FUNCTION_PTR_IN_CLASS_TEMPLATE: The compiler does not
// support the use of a function pointer type as the argument
// for a template.
// * __STL_MEMBER_TEMPLATE_KEYWORD: standard C++ requires the template
// keyword in a few new places (14.2.4). This flag is set for
// compilers that support (and require) this usage.
 
 
// User-settable macros that control compilation:
// * __STL_USE_SGI_ALLOCATORS: if defined, then the STL will use older
// SGI-style allocators, instead of standard-conforming allocators,
// even if the compiler supports all of the language features needed
// for standard-conforming allocators.
// * __STL_NO_NAMESPACES: if defined, don't put the library in namespace
// std, even if the compiler supports namespaces.
// * __STL_NO_RELOPS_NAMESPACE: if defined, don't put the relational
// operator templates (>, <=. >=, !=) in namespace std::rel_ops, even
// if the compiler supports namespaces and partial ordering of
// function templates.
// * __STL_ASSERTIONS: if defined, then enable runtime checking through the
// __stl_assert macro.
// * _PTHREADS: if defined, use Posix threads for multithreading support.
// * _UITHREADS:if defined, use SCO/Solaris/UI threads for multithreading
// support
// * _NOTHREADS: if defined, don't use any multithreading support.
// * _STL_NO_CONCEPT_CHECKS: if defined, disables the error checking that
// we get from __STL_USE_CONCEPT_CHECKS.
// * __STL_USE_NEW_IOSTREAMS: if defined, then the STL will use new,
// standard-conforming iostreams (e.g. the <iosfwd> header). If not
// defined, the STL will use old cfront-style iostreams (e.g. the
// <iostream.h> header).
 
// Other macros defined by this file:
 
// * bool, true, and false, if __STL_NO_BOOL is defined.
// * typename, as a null macro if it's not already a keyword.
// * explicit, as a null macro if it's not already a keyword.
// * namespace-related macros (__STD, __STL_BEGIN_NAMESPACE, etc.)
// * exception-related macros (__STL_TRY, __STL_UNWIND, etc.)
// * __stl_assert, either as a test or as a null macro, depending on
// whether or not __STL_ASSERTIONS is defined.
 
# if defined(_PTHREADS) && !defined(_NOTHREADS)
# define __STL_PTHREADS
# endif
 
# if defined(_UITHREADS) && !defined(_PTHREADS) && !defined(_NOTHREADS)
# define __STL_UITHREADS
# endif
 
# if defined(__sgi) && !defined(__GNUC__)
# include <standards.h>
# if !defined(_BOOL)
# define __STL_NO_BOOL
# endif
# if defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32
# define __STL_STATIC_CONST_INIT_BUG
# endif
# if defined(_WCHAR_T_IS_KEYWORD)
# define __STL_HAS_WCHAR_T
# endif
# if !defined(_TYPENAME_IS_KEYWORD)
# define __STL_NEED_TYPENAME
# endif
# ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES
# define __STL_CLASS_PARTIAL_SPECIALIZATION
# endif
# if (_COMPILER_VERSION >= 730) && defined(_MIPS_SIM) && _MIPS_SIM != _ABIO32
# define __STL_FUNCTION_TMPL_PARTIAL_ORDER
# endif
# ifdef _MEMBER_TEMPLATES
# define __STL_MEMBER_TEMPLATES
# define __STL_TEMPLATE_FRIENDS
# define __STL_MEMBER_TEMPLATE_CLASSES
# endif
# if defined(_MEMBER_TEMPLATE_KEYWORD)
# define __STL_MEMBER_TEMPLATE_KEYWORD
# endif
# if defined(_STANDARD_C_PLUS_PLUS)
# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
# endif
# if (_COMPILER_VERSION >= 730) && defined(_MIPS_SIM) && _MIPS_SIM != _ABIO32
# define __STL_MEMBER_TEMPLATE_KEYWORD
# endif
# if COMPILER_VERSION < 720 || (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32)
# define __STL_DEFAULT_CONSTRUCTOR_BUG
# endif
# if !defined(_EXPLICIT_IS_KEYWORD)
# define __STL_NEED_EXPLICIT
# endif
# ifdef __EXCEPTIONS
# define __STL_USE_EXCEPTIONS
# endif
# if (_COMPILER_VERSION >= 721) && defined(_NAMESPACES)
# define __STL_HAS_NAMESPACES
# endif
# if (_COMPILER_VERSION < 721) || \
!defined(__STL_HAS_NAMESPACES) || defined(__STL_NO_NAMESPACES)
# define __STL_NO_EXCEPTION_HEADER
# endif
# if _COMPILER_VERSION < 730 || !defined(_STANDARD_C_PLUS_PLUS) || \
!defined(_NAMESPACES)
# define __STL_NO_BAD_ALLOC
# endif
# if !defined(_NOTHREADS) && !defined(__STL_PTHREADS)
# define __STL_SGI_THREADS
# endif
# if defined(_LONGLONG) && defined(_SGIAPI) && _SGIAPI
# define __STL_LONG_LONG
# endif
# if _COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS)
# define __STL_USE_NEW_IOSTREAMS
# endif
# if _COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS)
# define __STL_CAN_THROW_RANGE_ERRORS
# endif
# if _COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS)
# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
# endif
# endif
 
 
/*
* Jochen Schlick '1999 - added new #defines (__STL)_UITHREADS (for
* providing SCO / Solaris / UI thread support)
* - added the necessary defines for the SCO UDK 7
* compiler (and its template friend behavior)
* - all UDK7 specific STL changes are based on the
* macro __USLC__ being defined
*/
// SCO UDK 7 compiler (UnixWare 7x, OSR 5, UnixWare 2x)
# if defined(__USLC__)
# define __STL_HAS_WCHAR_T
# define __STL_CLASS_PARTIAL_SPECIALIZATION
# define __STL_PARTIAL_SPECIALIZATION_SYNTAX
# define __STL_FUNCTION_TMPL_PARTIAL_ORDER
# define __STL_MEMBER_TEMPLATES
# define __STL_MEMBER_TEMPLATE_CLASSES
# define __STL_USE_EXCEPTIONS
# define __STL_HAS_NAMESPACES
# define __STL_USE_NAMESPACES
# define __STL_LONG_LONG
# if defined(_REENTRANT)
# define _UITHREADS /* if UnixWare < 7.0.1 */
# define __STL_UITHREADS
// use the following defines instead of the UI threads defines when
// you want to use POSIX threads
//# define _PTHREADS /* only if UnixWare >=7.0.1 */
//# define __STL_PTHREADS
# endif
# endif
 
 
 
# ifdef __GNUC__
# define __STL_HAS_WCHAR_T
# define __STL_MEMBER_TEMPLATES
# define __STL_MEMBER_TEMPLATE_CLASSES
# define __STL_TEMPLATE_FRIENDS
# define __STL_CLASS_PARTIAL_SPECIALIZATION
# define __STL_PARTIAL_SPECIALIZATION_SYNTAX
# define __STL_FUNCTION_TMPL_PARTIAL_ORDER
# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
# define __STL_HAS_NAMESPACES
# define __STL_USE_NAMESPACES
# ifdef __EXCEPTIONS
# define __STL_USE_EXCEPTIONS
# endif
# define __STL_THROW_RANGE_ERRORS
# define __STL_CAN_THROW_RANGE_ERRORS
# define __STL_USE_STD_ALLOCATORS
# define __USE_MALLOC // As the "underlying allocator"
//# define __STL_USE_NEW_IOSTREAMS //990209 bkoz--use standard .h includes.
# ifdef _REENTRANT
# define __STL_THREADS
# endif
# ifdef _PTHREADS
# define __STL_PTHREADS
# endif
# ifndef __STRICT_ANSI__
# define __STL_LONG_LONG
# endif
# if (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95)
# define __STL_NO_FUNCTION_PTR_IN_CLASS_TEMPLATE
# endif
# endif
 
# if defined(__SUNPRO_CC)
# define __STL_NO_BOOL
# define __STL_NEED_TYPENAME
# define __STL_NEED_EXPLICIT
# define __STL_USE_EXCEPTIONS
# ifdef _REENTRANT
# define __STL_PTHREADS
# endif
# define __SGI_STL_NO_ARROW_OPERATOR
# define __STL_PARTIAL_SPECIALIZATION_SYNTAX
# define __STL_NO_EXCEPTION_HEADER
# define __STL_NO_BAD_ALLOC
# endif
 
# if defined(__COMO__)
# define __STL_MEMBER_TEMPLATES
# define __STL_MEMBER_TEMPLATE_CLASSES
# define __STL_TEMPLATE_FRIENDS
# define __STL_CLASS_PARTIAL_SPECIALIZATION
# define __STL_USE_EXCEPTIONS
# define __STL_HAS_NAMESPACES
# endif
 
// Intel compiler, which uses the EDG front end.
# if defined(__ICL)
# define __STL_LONG_LONG
# define __STL_MEMBER_TEMPLATES
# define __STL_MEMBER_TEMPLATE_CLASSES
# define __STL_TEMPLATE_FRIENDS
# define __STL_FUNCTION_TMPL_PARTIAL_ORDER
# define __STL_CLASS_PARTIAL_SPECIALIZATION
# define __STL_NO_DRAND48
# define __STL_HAS_NAMESPACES
# define __STL_USE_EXCEPTIONS
# define __STL_MEMBER_TEMPLATE_KEYWORD
# ifdef _CPPUNWIND
# define __STL_USE_EXCEPTIONS
# endif
# ifdef _MT
# define __STL_WIN32THREADS
# endif
# endif
 
// Mingw32, GCC compiler using the Microsoft C runtime
# if defined(__MINGW32__)
# define __STL_NO_DRAND48
# ifdef _MT
# define __STL_WIN32THREADS
# endif
# endif
 
// Cygwin32, GCC compiler on MS Windows
# if defined(__CYGWIN__)
# define __STL_NO_DRAND48
# endif
 
 
 
// Microsoft compiler.
# if defined(_MSC_VER) && !defined(__ICL) && !defined(__MWERKS__)
# define __STL_NO_DRAND48
# define __STL_STATIC_CONST_INIT_BUG
# define __STL_NEED_TYPENAME
# define __STL_NO_USING_CLAUSE_IN_CLASS
# define __STL_NO_FRIEND_TEMPLATE_CLASS
# if _MSC_VER < 1100 /* 1000 is version 4.0, 1100 is 5.0, 1200 is 6.0. */
# define __STL_NEED_EXPLICIT
# define __STL_NO_BOOL
# define __STL_NO_BAD_ALLOC
# endif
# if _MSC_VER > 1000
# include <yvals.h>
# define __STL_DONT_USE_BOOL_TYPEDEF
# endif
# define __STL_NON_TYPE_TMPL_PARAM_BUG
# define __SGI_STL_NO_ARROW_OPERATOR
# define __STL_DEFAULT_CONSTRUCTOR_BUG
# ifdef _CPPUNWIND
# define __STL_USE_EXCEPTIONS
# endif
# ifdef _MT
# define __STL_WIN32THREADS
# endif
# if _MSC_VER >= 1200
# define __STL_PARTIAL_SPECIALIZATION_SYNTAX
# define __STL_HAS_NAMESPACES
# define __STL_CAN_THROW_RANGE_ERRORS
# define NOMINMAX
# undef min
# undef max
// disable warning 'initializers put in unrecognized initialization area'
# pragma warning ( disable : 4075 )
// disable warning 'empty controlled statement found'
# pragma warning ( disable : 4390 )
// disable warning 'debug symbol greater than 255 chars'
# pragma warning ( disable : 4786 )
# endif
# if _MSC_VER < 1100
# define __STL_NO_EXCEPTION_HEADER
# define __STL_NO_BAD_ALLOC
# endif
// Because of a Microsoft front end bug, we must not provide a
// namespace qualifier when declaring a friend function.
# define __STD_QUALIFIER
# endif
 
# if defined(__BORLANDC__)
# define __STL_NO_BAD_ALLOC
# define __STL_NO_DRAND48
# define __STL_DEFAULT_CONSTRUCTOR_BUG
# if __BORLANDC__ >= 0x540 /* C++ Builder 4.0 */
# define __STL_CLASS_PARTIAL_SPECIALIZATION
# define __STL_FUNCTION_TMPL_PARTIAL_ORDER
# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
# define __STL_MEMBER_TEMPLATES
# define __STL_TEMPLATE_FRIENDS
# else
# define __STL_NEED_TYPENAME
# define __STL_LIMITED_DEFAULT_TEMPLATES
# define __SGI_STL_NO_ARROW_OPERATOR
# define __STL_NON_TYPE_TMPL_PARAM_BUG
# endif
# ifdef _CPPUNWIND
# define __STL_USE_EXCEPTIONS
# endif
# ifdef __MT__
# define __STL_WIN32THREADS
# endif
# endif
 
# if defined(__STL_NO_BOOL) && !defined(__STL_DONT_USE_BOOL_TYPEDEF)
typedef int bool;
# define true 1
# define false 0
# endif
 
# ifdef __STL_NEED_TYPENAME
# define typename
# endif
 
# ifdef __STL_LIMITED_DEFAULT_TEMPLATES
# define __STL_DEPENDENT_DEFAULT_TMPL(_Tp)
# else
# define __STL_DEPENDENT_DEFAULT_TMPL(_Tp) = _Tp
# endif
 
# ifdef __STL_MEMBER_TEMPLATE_KEYWORD
# define __STL_TEMPLATE template
# else
# define __STL_TEMPLATE
# endif
 
# ifdef __STL_NEED_EXPLICIT
# define explicit
# endif
 
# ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS
# define __STL_NULL_TMPL_ARGS <>
# else
# define __STL_NULL_TMPL_ARGS
# endif
 
# if defined(__STL_CLASS_PARTIAL_SPECIALIZATION) \
|| defined (__STL_PARTIAL_SPECIALIZATION_SYNTAX)
# define __STL_TEMPLATE_NULL template<>
# else
# define __STL_TEMPLATE_NULL
# endif
 
// Use standard-conforming allocators if we have the necessary language
// features. __STL_USE_SGI_ALLOCATORS is a hook so that users can
// disable new-style allocators, and continue to use the same kind of
// allocators as before, without having to edit library headers.
# if defined(__STL_CLASS_PARTIAL_SPECIALIZATION) && \
defined(__STL_MEMBER_TEMPLATES) && \
defined(__STL_MEMBER_TEMPLATE_CLASSES) && \
!defined(__STL_NO_BOOL) && \
!defined(__STL_NON_TYPE_TMPL_PARAM_BUG) && \
!defined(__STL_LIMITED_DEFAULT_TEMPLATES) && \
!defined(__STL_USE_SGI_ALLOCATORS)
# define __STL_USE_STD_ALLOCATORS
# endif
 
# ifndef __STL_DEFAULT_ALLOCATOR
# ifdef __STL_USE_STD_ALLOCATORS
# define __STL_DEFAULT_ALLOCATOR(T) allocator< T >
# else
# define __STL_DEFAULT_ALLOCATOR(T) alloc
# endif
# endif
 
// __STL_NO_NAMESPACES is a hook so that users can disable namespaces
// without having to edit library headers. __STL_NO_RELOPS_NAMESPACE is
// a hook so that users can disable the std::rel_ops namespace, keeping
// the relational operator template in namespace std, without having to
// edit library headers.
# if defined(__STL_HAS_NAMESPACES) && !defined(__STL_NO_NAMESPACES)
# define __STL_USE_NAMESPACES
# define __STD std
# define __STL_BEGIN_NAMESPACE namespace std {
# define __STL_END_NAMESPACE }
# if defined(__STL_FUNCTION_TMPL_PARTIAL_ORDER) && \
!defined(__STL_NO_RELOPS_NAMESPACE)
# define __STL_USE_NAMESPACE_FOR_RELOPS
# define __STL_BEGIN_RELOPS_NAMESPACE namespace std { namespace rel_ops {
# define __STL_END_RELOPS_NAMESPACE } }
# define __STD_RELOPS std::rel_ops
# else /* Use std::rel_ops namespace */
# define __STL_USE_NAMESPACE_FOR_RELOPS
# define __STL_BEGIN_RELOPS_NAMESPACE namespace std {
# define __STL_END_RELOPS_NAMESPACE }
# define __STD_RELOPS std
# endif /* Use std::rel_ops namespace */
# else
# define __STD
# define __STL_BEGIN_NAMESPACE
# define __STL_END_NAMESPACE
# undef __STL_USE_NAMESPACE_FOR_RELOPS
# define __STL_BEGIN_RELOPS_NAMESPACE
# define __STL_END_RELOPS_NAMESPACE
# define __STD_RELOPS
# undef __STL_USE_NAMESPACES
# endif
 
// Some versions of the EDG front end sometimes require an explicit
// namespace spec where they shouldn't. This macro facilitates that.
// If the bug becomes irrelevant, then all uses of __STD_QUALIFIER
// should be removed. The 7.3 beta SGI compiler has this bug, but the
// MR version is not expected to have it.
 
# if defined(__STL_USE_NAMESPACES) && !defined(__STD_QUALIFIER)
# define __STD_QUALIFIER std::
# else
# define __STD_QUALIFIER
# endif
 
# ifdef __STL_USE_EXCEPTIONS
# define __STL_TRY try
# define __STL_CATCH_ALL catch(...)
# define __STL_THROW(x) throw x
# define __STL_RETHROW throw
# define __STL_NOTHROW throw()
# define __STL_UNWIND(action) catch(...) { action; throw; }
# else
# define __STL_TRY
# define __STL_CATCH_ALL if (false)
# define __STL_THROW(x)
# define __STL_RETHROW
# define __STL_NOTHROW
# define __STL_UNWIND(action)
# endif
 
#ifdef __STL_ASSERTIONS
# include <stdio.h>
# define __stl_assert(expr) \
if (!(expr)) { fprintf(stderr, "%s:%d STL assertion failure: %s\n", \
__FILE__, __LINE__, # expr); abort(); }
#else
# define __stl_assert(expr)
#endif
 
#if defined(__STL_WIN32THREADS) || defined(__STL_SGI_THREADS) \
|| defined(__STL_PTHREADS) || defined(__STL_UITHREADS)
# define __STL_THREADS
# define __STL_VOLATILE volatile
#else
# define __STL_VOLATILE
#endif
 
// Because concept-checks do not presently work correctly, they
// are disabled.
#if 0
#if defined(__STL_CLASS_PARTIAL_SPECIALIZATION) \
&& defined(__STL_MEMBER_TEMPLATES) \
&& !defined(_STL_NO_CONCEPT_CHECKS)
# define __STL_USE_CONCEPT_CHECKS
#endif
#endif
 
#endif /* __STL_CONFIG_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_construct.h
0,0 → 1,123
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef _CPP_BITS_STL_CONSTRUCT_H
#define _CPP_BITS_STL_CONSTRUCT_H 1
 
#include <new>
 
namespace std
{
 
// construct and destroy. These functions are not part of the C++ standard,
// and are provided for backward compatibility with the HP STL. We also
// provide internal names _Construct and _Destroy that can be used within
// the library, so that standard-conforming pieces don't have to rely on
// non-standard extensions.
 
// Internal names
 
template <class _T1, class _T2>
inline void _Construct(_T1* __p, const _T2& __value) {
new ((void*) __p) _T1(__value);
}
template <class _T1>
inline void _Construct(_T1* __p) {
new ((void*) __p) _T1();
}
 
template <class _Tp>
inline void _Destroy(_Tp* __pointer) {
__pointer->~_Tp();
}
template <class _ForwardIterator>
void
__destroy_aux(_ForwardIterator __first, _ForwardIterator __last, __false_type)
{
for ( ; __first != __last; ++__first)
destroy(&*__first);
}
 
template <class _ForwardIterator>
inline void __destroy_aux(_ForwardIterator, _ForwardIterator, __true_type) {}
 
template <class _ForwardIterator, class _Tp>
inline void
__destroy(_ForwardIterator __first, _ForwardIterator __last, _Tp*)
{
typedef typename __type_traits<_Tp>::has_trivial_destructor
_Trivial_destructor;
__destroy_aux(__first, __last, _Trivial_destructor());
}
 
template <class _ForwardIterator>
inline void _Destroy(_ForwardIterator __first, _ForwardIterator __last) {
__destroy(__first, __last, __value_type(__first));
}
 
inline void _Destroy(char*, char*) {}
inline void _Destroy(int*, int*) {}
inline void _Destroy(long*, long*) {}
inline void _Destroy(float*, float*) {}
inline void _Destroy(double*, double*) {}
inline void _Destroy(wchar_t*, wchar_t*) {}
 
// --------------------------------------------------
// Old names from the HP STL.
 
template <class _T1, class _T2>
inline void construct(_T1* __p, const _T2& __value) {
_Construct(__p, __value);
}
 
template <class _T1>
inline void construct(_T1* __p) {
_Construct(__p);
}
 
template <class _Tp>
inline void destroy(_Tp* __pointer) {
_Destroy(__pointer);
}
 
template <class _ForwardIterator>
inline void destroy(_ForwardIterator __first, _ForwardIterator __last) {
_Destroy(__first, __last);
}
 
} // namespace std
 
#endif /* _CPP_BITS_STL_CONSTRUCT_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_deque.h
0,0 → 1,1322
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#include <bits/concept_check.h>
#include <bits/stl_iterator_base_types.h>
#include <bits/stl_iterator_base_funcs.h>
 
#ifndef __SGI_STL_INTERNAL_DEQUE_H
#define __SGI_STL_INTERNAL_DEQUE_H
 
/* Class invariants:
* For any nonsingular iterator i:
* i.node is the address of an element in the map array. The
* contents of i.node is a pointer to the beginning of a node.
* i.first == *(i.node)
* i.last == i.first + node_size
* i.cur is a pointer in the range [i.first, i.last). NOTE:
* the implication of this is that i.cur is always a dereferenceable
* pointer, even if i is a past-the-end iterator.
* Start and Finish are always nonsingular iterators. NOTE: this means
* that an empty deque must have one node, and that a deque
* with N elements, where N is the buffer size, must have two nodes.
* For every node other than start.node and finish.node, every element
* in the node is an initialized object. If start.node == finish.node,
* then [start.cur, finish.cur) are initialized objects, and
* the elements outside that range are uninitialized storage. Otherwise,
* [start.cur, start.last) and [finish.first, finish.cur) are initialized
* objects, and [start.first, start.cur) and [finish.cur, finish.last)
* are uninitialized storage.
* [map, map + map_size) is a valid, non-empty range.
* [start.node, finish.node] is a valid range contained within
* [map, map + map_size).
* A pointer in the range [map, map + map_size) points to an allocated node
* if and only if the pointer is in the range [start.node, finish.node].
*/
 
 
/*
* In previous versions of deque, there was an extra template
* parameter so users could control the node size. This extension
* turns out to violate the C++ standard (it can be detected using
* template template parameters), and it has been removed.
*/
 
namespace std
{
 
// Note: this function is simply a kludge to work around several compilers'
// bugs in handling constant expressions.
inline size_t __deque_buf_size(size_t __size) {
return __size < 512 ? size_t(512 / __size) : size_t(1);
}
 
template <class _Tp, class _Ref, class _Ptr>
struct _Deque_iterator {
typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator;
typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
static size_t _S_buffer_size() { return __deque_buf_size(sizeof(_Tp)); }
 
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Ptr pointer;
typedef _Ref reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp** _Map_pointer;
 
typedef _Deque_iterator _Self;
 
_Tp* _M_cur;
_Tp* _M_first;
_Tp* _M_last;
_Map_pointer _M_node;
 
_Deque_iterator(_Tp* __x, _Map_pointer __y)
: _M_cur(__x), _M_first(*__y),
_M_last(*__y + _S_buffer_size()), _M_node(__y) {}
_Deque_iterator() : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {}
_Deque_iterator(const iterator& __x)
: _M_cur(__x._M_cur), _M_first(__x._M_first),
_M_last(__x._M_last), _M_node(__x._M_node) {}
 
reference operator*() const { return *_M_cur; }
pointer operator->() const { return _M_cur; }
 
difference_type operator-(const _Self& __x) const {
return difference_type(_S_buffer_size()) * (_M_node - __x._M_node - 1) +
(_M_cur - _M_first) + (__x._M_last - __x._M_cur);
}
 
_Self& operator++() {
++_M_cur;
if (_M_cur == _M_last) {
_M_set_node(_M_node + 1);
_M_cur = _M_first;
}
return *this;
}
_Self operator++(int) {
_Self __tmp = *this;
++*this;
return __tmp;
}
 
_Self& operator--() {
if (_M_cur == _M_first) {
_M_set_node(_M_node - 1);
_M_cur = _M_last;
}
--_M_cur;
return *this;
}
_Self operator--(int) {
_Self __tmp = *this;
--*this;
return __tmp;
}
 
_Self& operator+=(difference_type __n)
{
difference_type __offset = __n + (_M_cur - _M_first);
if (__offset >= 0 && __offset < difference_type(_S_buffer_size()))
_M_cur += __n;
else {
difference_type __node_offset =
__offset > 0 ? __offset / difference_type(_S_buffer_size())
: -difference_type((-__offset - 1) / _S_buffer_size()) - 1;
_M_set_node(_M_node + __node_offset);
_M_cur = _M_first +
(__offset - __node_offset * difference_type(_S_buffer_size()));
}
return *this;
}
 
_Self operator+(difference_type __n) const
{
_Self __tmp = *this;
return __tmp += __n;
}
 
_Self& operator-=(difference_type __n) { return *this += -__n; }
_Self operator-(difference_type __n) const {
_Self __tmp = *this;
return __tmp -= __n;
}
 
reference operator[](difference_type __n) const { return *(*this + __n); }
 
bool operator==(const _Self& __x) const { return _M_cur == __x._M_cur; }
bool operator!=(const _Self& __x) const { return !(*this == __x); }
bool operator<(const _Self& __x) const {
return (_M_node == __x._M_node) ?
(_M_cur < __x._M_cur) : (_M_node < __x._M_node);
}
bool operator>(const _Self& __x) const { return __x < *this; }
bool operator<=(const _Self& __x) const { return !(__x < *this); }
bool operator>=(const _Self& __x) const { return !(*this < __x); }
 
void _M_set_node(_Map_pointer __new_node) {
_M_node = __new_node;
_M_first = *__new_node;
_M_last = _M_first + difference_type(_S_buffer_size());
}
};
 
template <class _Tp, class _Ref, class _Ptr>
inline _Deque_iterator<_Tp, _Ref, _Ptr>
operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x)
{
return __x + __n;
}
 
 
// Deque base class. It has two purposes. First, its constructor
// and destructor allocate (but don't initialize) storage. This makes
// exception safety easier. Second, the base class encapsulates all of
// the differences between SGI-style allocators and standard-conforming
// allocators.
 
// Base class for ordinary allocators.
template <class _Tp, class _Alloc, bool __is_static>
class _Deque_alloc_base {
public:
typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type;
allocator_type get_allocator() const { return _M_node_allocator; }
 
_Deque_alloc_base(const allocator_type& __a)
: _M_node_allocator(__a), _M_map_allocator(__a),
_M_map(0), _M_map_size(0)
{}
protected:
typedef typename _Alloc_traits<_Tp*, _Alloc>::allocator_type
_Map_allocator_type;
 
allocator_type _M_node_allocator;
_Map_allocator_type _M_map_allocator;
 
_Tp* _M_allocate_node() {
return _M_node_allocator.allocate(__deque_buf_size(sizeof(_Tp)));
}
void _M_deallocate_node(_Tp* __p) {
_M_node_allocator.deallocate(__p, __deque_buf_size(sizeof(_Tp)));
}
_Tp** _M_allocate_map(size_t __n)
{ return _M_map_allocator.allocate(__n); }
void _M_deallocate_map(_Tp** __p, size_t __n)
{ _M_map_allocator.deallocate(__p, __n); }
 
_Tp** _M_map;
size_t _M_map_size;
};
 
// Specialization for instanceless allocators.
template <class _Tp, class _Alloc>
class _Deque_alloc_base<_Tp, _Alloc, true>
{
public:
typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
 
_Deque_alloc_base(const allocator_type&) : _M_map(0), _M_map_size(0) {}
protected:
typedef typename _Alloc_traits<_Tp, _Alloc>::_Alloc_type _Node_alloc_type;
typedef typename _Alloc_traits<_Tp*, _Alloc>::_Alloc_type _Map_alloc_type;
 
_Tp* _M_allocate_node() {
return _Node_alloc_type::allocate(__deque_buf_size(sizeof(_Tp)));
}
void _M_deallocate_node(_Tp* __p) {
_Node_alloc_type::deallocate(__p, __deque_buf_size(sizeof(_Tp)));
}
_Tp** _M_allocate_map(size_t __n)
{ return _Map_alloc_type::allocate(__n); }
void _M_deallocate_map(_Tp** __p, size_t __n)
{ _Map_alloc_type::deallocate(__p, __n); }
 
_Tp** _M_map;
size_t _M_map_size;
};
 
template <class _Tp, class _Alloc>
class _Deque_base
: public _Deque_alloc_base<_Tp,_Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
{
public:
typedef _Deque_alloc_base<_Tp,_Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
_Base;
typedef typename _Base::allocator_type allocator_type;
typedef _Deque_iterator<_Tp,_Tp&,_Tp*> iterator;
typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
 
_Deque_base(const allocator_type& __a, size_t __num_elements)
: _Base(__a), _M_start(), _M_finish()
{ _M_initialize_map(__num_elements); }
_Deque_base(const allocator_type& __a)
: _Base(__a), _M_start(), _M_finish() {}
~_Deque_base();
 
protected:
void _M_initialize_map(size_t);
void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish);
enum { _S_initial_map_size = 8 };
 
protected:
iterator _M_start;
iterator _M_finish;
};
 
// Non-inline member functions from _Deque_base.
 
template <class _Tp, class _Alloc>
_Deque_base<_Tp,_Alloc>::~_Deque_base() {
if (_M_map) {
_M_destroy_nodes(_M_start._M_node, _M_finish._M_node + 1);
_M_deallocate_map(_M_map, _M_map_size);
}
}
 
template <class _Tp, class _Alloc>
void
_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t __num_elements)
{
size_t __num_nodes =
__num_elements / __deque_buf_size(sizeof(_Tp)) + 1;
 
_M_map_size = max((size_t) _S_initial_map_size, __num_nodes + 2);
_M_map = _M_allocate_map(_M_map_size);
 
_Tp** __nstart = _M_map + (_M_map_size - __num_nodes) / 2;
_Tp** __nfinish = __nstart + __num_nodes;
__STL_TRY {
_M_create_nodes(__nstart, __nfinish);
}
__STL_UNWIND((_M_deallocate_map(_M_map, _M_map_size),
_M_map = 0, _M_map_size = 0));
_M_start._M_set_node(__nstart);
_M_finish._M_set_node(__nfinish - 1);
_M_start._M_cur = _M_start._M_first;
_M_finish._M_cur = _M_finish._M_first +
__num_elements % __deque_buf_size(sizeof(_Tp));
}
 
template <class _Tp, class _Alloc>
void _Deque_base<_Tp,_Alloc>::_M_create_nodes(_Tp** __nstart, _Tp** __nfinish)
{
_Tp** __cur;
__STL_TRY {
for (__cur = __nstart; __cur < __nfinish; ++__cur)
*__cur = _M_allocate_node();
}
__STL_UNWIND(_M_destroy_nodes(__nstart, __cur));
}
 
template <class _Tp, class _Alloc>
void
_Deque_base<_Tp,_Alloc>::_M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish)
{
for (_Tp** __n = __nstart; __n < __nfinish; ++__n)
_M_deallocate_node(*__n);
}
 
template <class _Tp, class _Alloc = allocator<_Tp> >
class deque : protected _Deque_base<_Tp, _Alloc> {
 
// concept requirements
__glibcpp_class_requires(_Tp, _SGIAssignableConcept);
 
typedef _Deque_base<_Tp, _Alloc> _Base;
public: // Basic types
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
 
typedef typename _Base::allocator_type allocator_type;
allocator_type get_allocator() const { return _Base::get_allocator(); }
 
public: // Iterators
typedef typename _Base::iterator iterator;
typedef typename _Base::const_iterator const_iterator;
 
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
 
protected: // Internal typedefs
typedef pointer* _Map_pointer;
static size_t _S_buffer_size() { return __deque_buf_size(sizeof(_Tp)); }
 
protected:
using _Base::_M_initialize_map;
using _Base::_M_create_nodes;
using _Base::_M_destroy_nodes;
using _Base::_M_allocate_node;
using _Base::_M_deallocate_node;
using _Base::_M_allocate_map;
using _Base::_M_deallocate_map;
 
using _Base::_M_map;
using _Base::_M_map_size;
using _Base::_M_start;
using _Base::_M_finish;
 
public: // Basic accessors
iterator begin() { return _M_start; }
iterator end() { return _M_finish; }
const_iterator begin() const { return _M_start; }
const_iterator end() const { return _M_finish; }
 
reverse_iterator rbegin() { return reverse_iterator(_M_finish); }
reverse_iterator rend() { return reverse_iterator(_M_start); }
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(_M_finish); }
const_reverse_iterator rend() const
{ return const_reverse_iterator(_M_start); }
 
reference operator[](size_type __n)
{ return _M_start[difference_type(__n)]; }
const_reference operator[](size_type __n) const
{ return _M_start[difference_type(__n)]; }
 
void _M_range_check(size_type __n) const {
if (__n >= this->size())
__throw_range_error("deque");
}
 
reference at(size_type __n)
{ _M_range_check(__n); return (*this)[__n]; }
const_reference at(size_type __n) const
{ _M_range_check(__n); return (*this)[__n]; }
 
reference front() { return *_M_start; }
reference back() {
iterator __tmp = _M_finish;
--__tmp;
return *__tmp;
}
const_reference front() const { return *_M_start; }
const_reference back() const {
const_iterator __tmp = _M_finish;
--__tmp;
return *__tmp;
}
 
size_type size() const { return _M_finish - _M_start; }
size_type max_size() const { return size_type(-1); }
bool empty() const { return _M_finish == _M_start; }
 
public: // Constructor, destructor.
explicit deque(const allocator_type& __a = allocator_type())
: _Base(__a, 0) {}
deque(const deque& __x) : _Base(__x.get_allocator(), __x.size())
{ uninitialized_copy(__x.begin(), __x.end(), _M_start); }
deque(size_type __n, const value_type& __value,
const allocator_type& __a = allocator_type()) : _Base(__a, __n)
{ _M_fill_initialize(__value); }
explicit deque(size_type __n) : _Base(allocator_type(), __n)
{ _M_fill_initialize(value_type()); }
 
// Check whether it's an integral type. If so, it's not an iterator.
template <class _InputIterator>
deque(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type()) : _Base(__a) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_initialize_dispatch(__first, __last, _Integral());
}
 
template <class _Integer>
void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) {
_M_initialize_map(__n);
_M_fill_initialize(__x);
}
 
template <class _InputIter>
void _M_initialize_dispatch(_InputIter __first, _InputIter __last,
__false_type) {
_M_range_initialize(__first, __last, __iterator_category(__first));
}
 
~deque() { destroy(_M_start, _M_finish); }
 
deque& operator= (const deque& __x) {
const size_type __len = size();
if (&__x != this) {
if (__len >= __x.size())
erase(copy(__x.begin(), __x.end(), _M_start), _M_finish);
else {
const_iterator __mid = __x.begin() + difference_type(__len);
copy(__x.begin(), __mid, _M_start);
insert(_M_finish, __mid, __x.end());
}
}
return *this;
}
 
void swap(deque& __x) {
std::swap(_M_start, __x._M_start);
std::swap(_M_finish, __x._M_finish);
std::swap(_M_map, __x._M_map);
std::swap(_M_map_size, __x._M_map_size);
}
 
public:
// assign(), a generalized assignment member function. Two
// versions: one that takes a count, and one that takes a range.
// The range version is a member template, so we dispatch on whether
// or not the type is an integer.
 
void _M_fill_assign(size_type __n, const _Tp& __val) {
if (__n > size()) {
fill(begin(), end(), __val);
insert(end(), __n - size(), __val);
}
else {
erase(begin() + __n, end());
fill(begin(), end(), __val);
}
}
 
void assign(size_type __n, const _Tp& __val) {
_M_fill_assign(__n, __val);
}
 
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
 
private: // helper functions for assign()
 
template <class _Integer>
void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ _M_fill_assign((size_type) __n, (_Tp) __val); }
 
template <class _InputIterator>
void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type) {
_M_assign_aux(__first, __last, __iterator_category(__first));
}
 
template <class _InputIterator>
void _M_assign_aux(_InputIterator __first, _InputIterator __last,
input_iterator_tag);
 
template <class _ForwardIterator>
void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
size_type __len = 0;
distance(__first, __last, __len);
if (__len > size()) {
_ForwardIterator __mid = __first;
advance(__mid, size());
copy(__first, __mid, begin());
insert(end(), __mid, __last);
}
else
erase(copy(__first, __last, begin()), end());
}
 
public: // push_* and pop_*
void push_back(const value_type& __t) {
if (_M_finish._M_cur != _M_finish._M_last - 1) {
construct(_M_finish._M_cur, __t);
++_M_finish._M_cur;
}
else
_M_push_back_aux(__t);
}
 
void push_back() {
if (_M_finish._M_cur != _M_finish._M_last - 1) {
construct(_M_finish._M_cur);
++_M_finish._M_cur;
}
else
_M_push_back_aux();
}
 
void push_front(const value_type& __t) {
if (_M_start._M_cur != _M_start._M_first) {
construct(_M_start._M_cur - 1, __t);
--_M_start._M_cur;
}
else
_M_push_front_aux(__t);
}
 
void push_front() {
if (_M_start._M_cur != _M_start._M_first) {
construct(_M_start._M_cur - 1);
--_M_start._M_cur;
}
else
_M_push_front_aux();
}
 
 
void pop_back() {
if (_M_finish._M_cur != _M_finish._M_first) {
--_M_finish._M_cur;
destroy(_M_finish._M_cur);
}
else
_M_pop_back_aux();
}
 
void pop_front() {
if (_M_start._M_cur != _M_start._M_last - 1) {
destroy(_M_start._M_cur);
++_M_start._M_cur;
}
else
_M_pop_front_aux();
}
 
public: // Insert
 
iterator insert(iterator position, const value_type& __x) {
if (position._M_cur == _M_start._M_cur) {
push_front(__x);
return _M_start;
}
else if (position._M_cur == _M_finish._M_cur) {
push_back(__x);
iterator __tmp = _M_finish;
--__tmp;
return __tmp;
}
else {
return _M_insert_aux(position, __x);
}
}
 
iterator insert(iterator __position)
{ return insert(__position, value_type()); }
 
void insert(iterator __pos, size_type __n, const value_type& __x)
{ _M_fill_insert(__pos, __n, __x); }
 
void _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
 
// Check whether it's an integral type. If so, it's not an iterator.
template <class _InputIterator>
void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_insert_dispatch(__pos, __first, __last, _Integral());
}
 
template <class _Integer>
void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
__true_type) {
_M_fill_insert(__pos, (size_type) __n, (value_type) __x);
}
 
template <class _InputIterator>
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type) {
insert(__pos, __first, __last, __iterator_category(__first));
}
 
void resize(size_type __new_size, const value_type& __x) {
const size_type __len = size();
if (__new_size < __len)
erase(_M_start + __new_size, _M_finish);
else
insert(_M_finish, __new_size - __len, __x);
}
 
void resize(size_type new_size) { resize(new_size, value_type()); }
 
public: // Erase
iterator erase(iterator __pos) {
iterator __next = __pos;
++__next;
size_type __index = __pos - _M_start;
if (__index < (size() >> 1)) {
copy_backward(_M_start, __pos, __next);
pop_front();
}
else {
copy(__next, _M_finish, __pos);
pop_back();
}
return _M_start + __index;
}
 
iterator erase(iterator __first, iterator __last);
void clear();
 
protected: // Internal construction/destruction
 
void _M_fill_initialize(const value_type& __value);
 
template <class _InputIterator>
void _M_range_initialize(_InputIterator __first, _InputIterator __last,
input_iterator_tag);
 
template <class _ForwardIterator>
void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
 
protected: // Internal push_* and pop_*
 
void _M_push_back_aux(const value_type&);
void _M_push_back_aux();
void _M_push_front_aux(const value_type&);
void _M_push_front_aux();
void _M_pop_back_aux();
void _M_pop_front_aux();
 
protected: // Internal insert functions
 
template <class _InputIterator>
void insert(iterator __pos, _InputIterator __first, _InputIterator __last,
input_iterator_tag);
 
template <class _ForwardIterator>
void insert(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
 
iterator _M_insert_aux(iterator __pos, const value_type& __x);
iterator _M_insert_aux(iterator __pos);
void _M_insert_aux(iterator __pos, size_type __n, const value_type& __x);
 
template <class _ForwardIterator>
void _M_insert_aux(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
size_type __n);
 
iterator _M_reserve_elements_at_front(size_type __n) {
size_type __vacancies = _M_start._M_cur - _M_start._M_first;
if (__n > __vacancies)
_M_new_elements_at_front(__n - __vacancies);
return _M_start - difference_type(__n);
}
 
iterator _M_reserve_elements_at_back(size_type __n) {
size_type __vacancies = (_M_finish._M_last - _M_finish._M_cur) - 1;
if (__n > __vacancies)
_M_new_elements_at_back(__n - __vacancies);
return _M_finish + difference_type(__n);
}
 
void _M_new_elements_at_front(size_type __new_elements);
void _M_new_elements_at_back(size_type __new_elements);
 
protected: // Allocation of _M_map and nodes
 
// Makes sure the _M_map has space for new nodes. Does not actually
// add the nodes. Can invalidate _M_map pointers. (And consequently,
// deque iterators.)
 
void _M_reserve_map_at_back (size_type __nodes_to_add = 1) {
if (__nodes_to_add + 1 > _M_map_size - (_M_finish._M_node - _M_map))
_M_reallocate_map(__nodes_to_add, false);
}
 
void _M_reserve_map_at_front (size_type __nodes_to_add = 1) {
if (__nodes_to_add > size_type(_M_start._M_node - _M_map))
_M_reallocate_map(__nodes_to_add, true);
}
 
void _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front);
};
 
// Non-inline member functions
 
template <class _Tp, class _Alloc>
template <class _InputIter>
void deque<_Tp, _Alloc>
::_M_assign_aux(_InputIter __first, _InputIter __last, input_iterator_tag)
{
iterator __cur = begin();
for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
*__cur = *__first;
if (__first == __last)
erase(__cur, end());
else
insert(end(), __first, __last);
}
 
template <class _Tp, class _Alloc>
void deque<_Tp, _Alloc>::_M_fill_insert(iterator __pos,
size_type __n, const value_type& __x)
{
if (__pos._M_cur == _M_start._M_cur) {
iterator __new_start = _M_reserve_elements_at_front(__n);
__STL_TRY {
uninitialized_fill(__new_start, _M_start, __x);
_M_start = __new_start;
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
}
else if (__pos._M_cur == _M_finish._M_cur) {
iterator __new_finish = _M_reserve_elements_at_back(__n);
__STL_TRY {
uninitialized_fill(_M_finish, __new_finish, __x);
_M_finish = __new_finish;
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
__new_finish._M_node + 1));
}
else
_M_insert_aux(__pos, __n, __x);
}
 
template <class _Tp, class _Alloc>
typename deque<_Tp,_Alloc>::iterator
deque<_Tp,_Alloc>::erase(iterator __first, iterator __last)
{
if (__first == _M_start && __last == _M_finish) {
clear();
return _M_finish;
}
else {
difference_type __n = __last - __first;
difference_type __elems_before = __first - _M_start;
if (static_cast<size_type>(__elems_before) < (size() - __n) / 2) {
copy_backward(_M_start, __first, __last);
iterator __new_start = _M_start + __n;
destroy(_M_start, __new_start);
_M_destroy_nodes(__new_start._M_node, _M_start._M_node);
_M_start = __new_start;
}
else {
copy(__last, _M_finish, __first);
iterator __new_finish = _M_finish - __n;
destroy(__new_finish, _M_finish);
_M_destroy_nodes(__new_finish._M_node + 1, _M_finish._M_node + 1);
_M_finish = __new_finish;
}
return _M_start + __elems_before;
}
}
 
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::clear()
{
for (_Map_pointer __node = _M_start._M_node + 1;
__node < _M_finish._M_node;
++__node) {
destroy(*__node, *__node + _S_buffer_size());
_M_deallocate_node(*__node);
}
 
if (_M_start._M_node != _M_finish._M_node) {
destroy(_M_start._M_cur, _M_start._M_last);
destroy(_M_finish._M_first, _M_finish._M_cur);
_M_deallocate_node(_M_finish._M_first);
}
else
destroy(_M_start._M_cur, _M_finish._M_cur);
 
_M_finish = _M_start;
}
 
// Precondition: _M_start and _M_finish have already been initialized,
// but none of the deque's elements have yet been constructed.
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_fill_initialize(const value_type& __value) {
_Map_pointer __cur;
__STL_TRY {
for (__cur = _M_start._M_node; __cur < _M_finish._M_node; ++__cur)
uninitialized_fill(*__cur, *__cur + _S_buffer_size(), __value);
uninitialized_fill(_M_finish._M_first, _M_finish._M_cur, __value);
}
__STL_UNWIND(destroy(_M_start, iterator(*__cur, __cur)));
}
 
template <class _Tp, class _Alloc> template <class _InputIterator>
void deque<_Tp,_Alloc>::_M_range_initialize(_InputIterator __first,
_InputIterator __last,
input_iterator_tag)
{
_M_initialize_map(0);
__STL_TRY {
for ( ; __first != __last; ++__first)
push_back(*__first);
}
__STL_UNWIND(clear());
}
 
template <class _Tp, class _Alloc> template <class _ForwardIterator>
void deque<_Tp,_Alloc>::_M_range_initialize(_ForwardIterator __first,
_ForwardIterator __last,
forward_iterator_tag)
{
size_type __n = 0;
distance(__first, __last, __n);
_M_initialize_map(__n);
 
_Map_pointer __cur_node;
__STL_TRY {
for (__cur_node = _M_start._M_node;
__cur_node < _M_finish._M_node;
++__cur_node) {
_ForwardIterator __mid = __first;
advance(__mid, _S_buffer_size());
uninitialized_copy(__first, __mid, *__cur_node);
__first = __mid;
}
uninitialized_copy(__first, __last, _M_finish._M_first);
}
__STL_UNWIND(destroy(_M_start, iterator(*__cur_node, __cur_node)));
}
 
// Called only if _M_finish._M_cur == _M_finish._M_last - 1.
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_push_back_aux(const value_type& __t)
{
value_type __t_copy = __t;
_M_reserve_map_at_back();
*(_M_finish._M_node + 1) = _M_allocate_node();
__STL_TRY {
construct(_M_finish._M_cur, __t_copy);
_M_finish._M_set_node(_M_finish._M_node + 1);
_M_finish._M_cur = _M_finish._M_first;
}
__STL_UNWIND(_M_deallocate_node(*(_M_finish._M_node + 1)));
}
 
// Called only if _M_finish._M_cur == _M_finish._M_last - 1.
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_push_back_aux()
{
_M_reserve_map_at_back();
*(_M_finish._M_node + 1) = _M_allocate_node();
__STL_TRY {
construct(_M_finish._M_cur);
_M_finish._M_set_node(_M_finish._M_node + 1);
_M_finish._M_cur = _M_finish._M_first;
}
__STL_UNWIND(_M_deallocate_node(*(_M_finish._M_node + 1)));
}
 
// Called only if _M_start._M_cur == _M_start._M_first.
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_push_front_aux(const value_type& __t)
{
value_type __t_copy = __t;
_M_reserve_map_at_front();
*(_M_start._M_node - 1) = _M_allocate_node();
__STL_TRY {
_M_start._M_set_node(_M_start._M_node - 1);
_M_start._M_cur = _M_start._M_last - 1;
construct(_M_start._M_cur, __t_copy);
}
__STL_UNWIND((++_M_start, _M_deallocate_node(*(_M_start._M_node - 1))));
}
 
// Called only if _M_start._M_cur == _M_start._M_first.
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_push_front_aux()
{
_M_reserve_map_at_front();
*(_M_start._M_node - 1) = _M_allocate_node();
__STL_TRY {
_M_start._M_set_node(_M_start._M_node - 1);
_M_start._M_cur = _M_start._M_last - 1;
construct(_M_start._M_cur);
}
__STL_UNWIND((++_M_start, _M_deallocate_node(*(_M_start._M_node - 1))));
}
 
// Called only if _M_finish._M_cur == _M_finish._M_first.
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_pop_back_aux()
{
_M_deallocate_node(_M_finish._M_first);
_M_finish._M_set_node(_M_finish._M_node - 1);
_M_finish._M_cur = _M_finish._M_last - 1;
destroy(_M_finish._M_cur);
}
 
// Called only if _M_start._M_cur == _M_start._M_last - 1. Note that
// if the deque has at least one element (a precondition for this member
// function), and if _M_start._M_cur == _M_start._M_last, then the deque
// must have at least two nodes.
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_pop_front_aux()
{
destroy(_M_start._M_cur);
_M_deallocate_node(_M_start._M_first);
_M_start._M_set_node(_M_start._M_node + 1);
_M_start._M_cur = _M_start._M_first;
}
 
template <class _Tp, class _Alloc> template <class _InputIterator>
void deque<_Tp,_Alloc>::insert(iterator __pos,
_InputIterator __first, _InputIterator __last,
input_iterator_tag)
{
copy(__first, __last, inserter(*this, __pos));
}
 
template <class _Tp, class _Alloc> template <class _ForwardIterator>
void
deque<_Tp,_Alloc>::insert(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
size_type __n = 0;
distance(__first, __last, __n);
if (__pos._M_cur == _M_start._M_cur) {
iterator __new_start = _M_reserve_elements_at_front(__n);
__STL_TRY {
uninitialized_copy(__first, __last, __new_start);
_M_start = __new_start;
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
}
else if (__pos._M_cur == _M_finish._M_cur) {
iterator __new_finish = _M_reserve_elements_at_back(__n);
__STL_TRY {
uninitialized_copy(__first, __last, _M_finish);
_M_finish = __new_finish;
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
__new_finish._M_node + 1));
}
else
_M_insert_aux(__pos, __first, __last, __n);
}
 
template <class _Tp, class _Alloc>
typename deque<_Tp, _Alloc>::iterator
deque<_Tp,_Alloc>::_M_insert_aux(iterator __pos, const value_type& __x)
{
difference_type __index = __pos - _M_start;
value_type __x_copy = __x;
if (static_cast<size_type>(__index) < size() / 2) {
push_front(front());
iterator __front1 = _M_start;
++__front1;
iterator __front2 = __front1;
++__front2;
__pos = _M_start + __index;
iterator __pos1 = __pos;
++__pos1;
copy(__front2, __pos1, __front1);
}
else {
push_back(back());
iterator __back1 = _M_finish;
--__back1;
iterator __back2 = __back1;
--__back2;
__pos = _M_start + __index;
copy_backward(__pos, __back2, __back1);
}
*__pos = __x_copy;
return __pos;
}
 
template <class _Tp, class _Alloc>
typename deque<_Tp,_Alloc>::iterator
deque<_Tp,_Alloc>::_M_insert_aux(iterator __pos)
{
difference_type __index = __pos - _M_start;
if (static_cast<size_type>(__index) < size() / 2) {
push_front(front());
iterator __front1 = _M_start;
++__front1;
iterator __front2 = __front1;
++__front2;
__pos = _M_start + __index;
iterator __pos1 = __pos;
++__pos1;
copy(__front2, __pos1, __front1);
}
else {
push_back(back());
iterator __back1 = _M_finish;
--__back1;
iterator __back2 = __back1;
--__back2;
__pos = _M_start + __index;
copy_backward(__pos, __back2, __back1);
}
*__pos = value_type();
return __pos;
}
 
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_insert_aux(iterator __pos,
size_type __n,
const value_type& __x)
{
const difference_type __elems_before = __pos - _M_start;
size_type __length = this->size();
value_type __x_copy = __x;
if (__elems_before < difference_type(__length / 2)) {
iterator __new_start = _M_reserve_elements_at_front(__n);
iterator __old_start = _M_start;
__pos = _M_start + __elems_before;
__STL_TRY {
if (__elems_before >= difference_type(__n)) {
iterator __start_n = _M_start + difference_type(__n);
uninitialized_copy(_M_start, __start_n, __new_start);
_M_start = __new_start;
copy(__start_n, __pos, __old_start);
fill(__pos - difference_type(__n), __pos, __x_copy);
}
else {
__uninitialized_copy_fill(_M_start, __pos, __new_start,
_M_start, __x_copy);
_M_start = __new_start;
fill(__old_start, __pos, __x_copy);
}
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
}
else {
iterator __new_finish = _M_reserve_elements_at_back(__n);
iterator __old_finish = _M_finish;
const difference_type __elems_after =
difference_type(__length) - __elems_before;
__pos = _M_finish - __elems_after;
__STL_TRY {
if (__elems_after > difference_type(__n)) {
iterator __finish_n = _M_finish - difference_type(__n);
uninitialized_copy(__finish_n, _M_finish, _M_finish);
_M_finish = __new_finish;
copy_backward(__pos, __finish_n, __old_finish);
fill(__pos, __pos + difference_type(__n), __x_copy);
}
else {
__uninitialized_fill_copy(_M_finish, __pos + difference_type(__n),
__x_copy, __pos, _M_finish);
_M_finish = __new_finish;
fill(__pos, __old_finish, __x_copy);
}
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
__new_finish._M_node + 1));
}
}
 
template <class _Tp, class _Alloc> template <class _ForwardIterator>
void deque<_Tp,_Alloc>::_M_insert_aux(iterator __pos,
_ForwardIterator __first,
_ForwardIterator __last,
size_type __n)
{
const difference_type __elemsbefore = __pos - _M_start;
size_type __length = size();
if (static_cast<size_type>(__elemsbefore) < __length / 2) {
iterator __new_start = _M_reserve_elements_at_front(__n);
iterator __old_start = _M_start;
__pos = _M_start + __elemsbefore;
__STL_TRY {
if (__elemsbefore >= difference_type(__n)) {
iterator __start_n = _M_start + difference_type(__n);
uninitialized_copy(_M_start, __start_n, __new_start);
_M_start = __new_start;
copy(__start_n, __pos, __old_start);
copy(__first, __last, __pos - difference_type(__n));
}
else {
_ForwardIterator __mid = __first;
advance(__mid, difference_type(__n) - __elemsbefore);
__uninitialized_copy_copy(_M_start, __pos, __first, __mid,
__new_start);
_M_start = __new_start;
copy(__mid, __last, __old_start);
}
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
}
else {
iterator __new_finish = _M_reserve_elements_at_back(__n);
iterator __old_finish = _M_finish;
const difference_type __elemsafter =
difference_type(__length) - __elemsbefore;
__pos = _M_finish - __elemsafter;
__STL_TRY {
if (__elemsafter > difference_type(__n)) {
iterator __finish_n = _M_finish - difference_type(__n);
uninitialized_copy(__finish_n, _M_finish, _M_finish);
_M_finish = __new_finish;
copy_backward(__pos, __finish_n, __old_finish);
copy(__first, __last, __pos);
}
else {
_ForwardIterator __mid = __first;
advance(__mid, __elemsafter);
__uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish);
_M_finish = __new_finish;
copy(__first, __mid, __pos);
}
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
__new_finish._M_node + 1));
}
}
 
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_new_elements_at_front(size_type __new_elems)
{
size_type __new_nodes
= (__new_elems + _S_buffer_size() - 1) / _S_buffer_size();
_M_reserve_map_at_front(__new_nodes);
size_type __i;
__STL_TRY {
for (__i = 1; __i <= __new_nodes; ++__i)
*(_M_start._M_node - __i) = _M_allocate_node();
}
# ifdef __STL_USE_EXCEPTIONS
catch(...) {
for (size_type __j = 1; __j < __i; ++__j)
_M_deallocate_node(*(_M_start._M_node - __j));
throw;
}
# endif /* __STL_USE_EXCEPTIONS */
}
 
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_new_elements_at_back(size_type __new_elems)
{
size_type __new_nodes
= (__new_elems + _S_buffer_size() - 1) / _S_buffer_size();
_M_reserve_map_at_back(__new_nodes);
size_type __i;
__STL_TRY {
for (__i = 1; __i <= __new_nodes; ++__i)
*(_M_finish._M_node + __i) = _M_allocate_node();
}
# ifdef __STL_USE_EXCEPTIONS
catch(...) {
for (size_type __j = 1; __j < __i; ++__j)
_M_deallocate_node(*(_M_finish._M_node + __j));
throw;
}
# endif /* __STL_USE_EXCEPTIONS */
}
 
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_reallocate_map(size_type __nodes_to_add,
bool __add_at_front)
{
size_type __old_num_nodes = _M_finish._M_node - _M_start._M_node + 1;
size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
 
_Map_pointer __new_nstart;
if (_M_map_size > 2 * __new_num_nodes) {
__new_nstart = _M_map + (_M_map_size - __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0);
if (__new_nstart < _M_start._M_node)
copy(_M_start._M_node, _M_finish._M_node + 1, __new_nstart);
else
copy_backward(_M_start._M_node, _M_finish._M_node + 1,
__new_nstart + __old_num_nodes);
}
else {
size_type __new_map_size =
_M_map_size + max(_M_map_size, __nodes_to_add) + 2;
 
_Map_pointer __new_map = _M_allocate_map(__new_map_size);
__new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0);
copy(_M_start._M_node, _M_finish._M_node + 1, __new_nstart);
_M_deallocate_map(_M_map, _M_map_size);
 
_M_map = __new_map;
_M_map_size = __new_map_size;
}
 
_M_start._M_set_node(__new_nstart);
_M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
}
 
 
// Nonmember functions.
 
template <class _Tp, class _Alloc>
inline bool operator==(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y) {
return __x.size() == __y.size() &&
equal(__x.begin(), __x.end(), __y.begin());
}
 
template <class _Tp, class _Alloc>
inline bool operator<(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y) {
return lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end());
}
 
template <class _Tp, class _Alloc>
inline bool operator!=(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y) {
return !(__x == __y);
}
 
template <class _Tp, class _Alloc>
inline bool operator>(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y) {
return __y < __x;
}
 
template <class _Tp, class _Alloc>
inline bool operator<=(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y) {
return !(__y < __x);
}
template <class _Tp, class _Alloc>
inline bool operator>=(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y) {
return !(__x < __y);
}
 
template <class _Tp, class _Alloc>
inline void swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y) {
__x.swap(__y);
}
 
} // namespace std
#endif /* __SGI_STL_INTERNAL_DEQUE_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_function.h
0,0 → 1,744
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996-1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_FUNCTION_H
#define __SGI_STL_INTERNAL_FUNCTION_H
 
namespace std
{
 
template <class _Arg, class _Result>
struct unary_function {
typedef _Arg argument_type;
typedef _Result result_type;
};
 
template <class _Arg1, class _Arg2, class _Result>
struct binary_function {
typedef _Arg1 first_argument_type;
typedef _Arg2 second_argument_type;
typedef _Result result_type;
};
 
template <class _Tp>
struct plus : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; }
};
 
template <class _Tp>
struct minus : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x - __y; }
};
 
template <class _Tp>
struct multiplies : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x * __y; }
};
 
template <class _Tp>
struct divides : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x / __y; }
};
 
// identity_element (not part of the C++ standard).
 
template <class _Tp> inline _Tp identity_element(plus<_Tp>) {
return _Tp(0);
}
template <class _Tp> inline _Tp identity_element(multiplies<_Tp>) {
return _Tp(1);
}
 
template <class _Tp>
struct modulus : public binary_function<_Tp,_Tp,_Tp>
{
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x % __y; }
};
 
template <class _Tp>
struct negate : public unary_function<_Tp,_Tp>
{
_Tp operator()(const _Tp& __x) const { return -__x; }
};
 
template <class _Tp>
struct equal_to : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x == __y; }
};
 
template <class _Tp>
struct not_equal_to : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x != __y; }
};
 
template <class _Tp>
struct greater : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x > __y; }
};
 
template <class _Tp>
struct less : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; }
};
 
template <class _Tp>
struct greater_equal : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x >= __y; }
};
 
template <class _Tp>
struct less_equal : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x <= __y; }
};
 
template <class _Tp>
struct logical_and : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x && __y; }
};
 
template <class _Tp>
struct logical_or : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x || __y; }
};
 
template <class _Tp>
struct logical_not : public unary_function<_Tp,bool>
{
bool operator()(const _Tp& __x) const { return !__x; }
};
 
template <class _Predicate>
class unary_negate
: public unary_function<typename _Predicate::argument_type, bool> {
protected:
_Predicate _M_pred;
public:
explicit unary_negate(const _Predicate& __x) : _M_pred(__x) {}
bool operator()(const typename _Predicate::argument_type& __x) const {
return !_M_pred(__x);
}
};
 
template <class _Predicate>
inline unary_negate<_Predicate>
not1(const _Predicate& __pred)
{
return unary_negate<_Predicate>(__pred);
}
 
template <class _Predicate>
class binary_negate
: public binary_function<typename _Predicate::first_argument_type,
typename _Predicate::second_argument_type,
bool> {
protected:
_Predicate _M_pred;
public:
explicit binary_negate(const _Predicate& __x) : _M_pred(__x) {}
bool operator()(const typename _Predicate::first_argument_type& __x,
const typename _Predicate::second_argument_type& __y) const
{
return !_M_pred(__x, __y);
}
};
 
template <class _Predicate>
inline binary_negate<_Predicate>
not2(const _Predicate& __pred)
{
return binary_negate<_Predicate>(__pred);
}
 
template <class _Operation>
class binder1st
: public unary_function<typename _Operation::second_argument_type,
typename _Operation::result_type> {
protected:
_Operation op;
typename _Operation::first_argument_type value;
public:
binder1st(const _Operation& __x,
const typename _Operation::first_argument_type& __y)
: op(__x), value(__y) {}
typename _Operation::result_type
operator()(const typename _Operation::second_argument_type& __x) const {
return op(value, __x);
}
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 109. Missing binders for non-const sequence elements
typename _Operation::result_type
operator()(typename _Operation::second_argument_type& __x) const {
return op(value, __x);
}
#endif
};
 
template <class _Operation, class _Tp>
inline binder1st<_Operation>
bind1st(const _Operation& __fn, const _Tp& __x)
{
typedef typename _Operation::first_argument_type _Arg1_type;
return binder1st<_Operation>(__fn, _Arg1_type(__x));
}
 
template <class _Operation>
class binder2nd
: public unary_function<typename _Operation::first_argument_type,
typename _Operation::result_type> {
protected:
_Operation op;
typename _Operation::second_argument_type value;
public:
binder2nd(const _Operation& __x,
const typename _Operation::second_argument_type& __y)
: op(__x), value(__y) {}
typename _Operation::result_type
operator()(const typename _Operation::first_argument_type& __x) const {
return op(__x, value);
}
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 109. Missing binders for non-const sequence elements
typename _Operation::result_type
operator()(typename _Operation::first_argument_type& __x) const {
return op(__x, value);
}
#endif
};
 
template <class _Operation, class _Tp>
inline binder2nd<_Operation>
bind2nd(const _Operation& __fn, const _Tp& __x)
{
typedef typename _Operation::second_argument_type _Arg2_type;
return binder2nd<_Operation>(__fn, _Arg2_type(__x));
}
 
// unary_compose and binary_compose (extensions, not part of the standard).
 
template <class _Operation1, class _Operation2>
class unary_compose
: public unary_function<typename _Operation2::argument_type,
typename _Operation1::result_type>
{
protected:
_Operation1 _M_fn1;
_Operation2 _M_fn2;
public:
unary_compose(const _Operation1& __x, const _Operation2& __y)
: _M_fn1(__x), _M_fn2(__y) {}
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
return _M_fn1(_M_fn2(__x));
}
};
 
template <class _Operation1, class _Operation2>
inline unary_compose<_Operation1,_Operation2>
compose1(const _Operation1& __fn1, const _Operation2& __fn2)
{
return unary_compose<_Operation1,_Operation2>(__fn1, __fn2);
}
 
template <class _Operation1, class _Operation2, class _Operation3>
class binary_compose
: public unary_function<typename _Operation2::argument_type,
typename _Operation1::result_type> {
protected:
_Operation1 _M_fn1;
_Operation2 _M_fn2;
_Operation3 _M_fn3;
public:
binary_compose(const _Operation1& __x, const _Operation2& __y,
const _Operation3& __z)
: _M_fn1(__x), _M_fn2(__y), _M_fn3(__z) { }
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
return _M_fn1(_M_fn2(__x), _M_fn3(__x));
}
};
 
template <class _Operation1, class _Operation2, class _Operation3>
inline binary_compose<_Operation1, _Operation2, _Operation3>
compose2(const _Operation1& __fn1, const _Operation2& __fn2,
const _Operation3& __fn3)
{
return binary_compose<_Operation1,_Operation2,_Operation3>
(__fn1, __fn2, __fn3);
}
 
template <class _Arg, class _Result>
class pointer_to_unary_function : public unary_function<_Arg, _Result> {
protected:
_Result (*_M_ptr)(_Arg);
public:
pointer_to_unary_function() {}
explicit pointer_to_unary_function(_Result (*__x)(_Arg)) : _M_ptr(__x) {}
_Result operator()(_Arg __x) const { return _M_ptr(__x); }
};
 
template <class _Arg, class _Result>
inline pointer_to_unary_function<_Arg, _Result> ptr_fun(_Result (*__x)(_Arg))
{
return pointer_to_unary_function<_Arg, _Result>(__x);
}
 
template <class _Arg1, class _Arg2, class _Result>
class pointer_to_binary_function :
public binary_function<_Arg1,_Arg2,_Result> {
protected:
_Result (*_M_ptr)(_Arg1, _Arg2);
public:
pointer_to_binary_function() {}
explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
: _M_ptr(__x) {}
_Result operator()(_Arg1 __x, _Arg2 __y) const {
return _M_ptr(__x, __y);
}
};
 
template <class _Arg1, class _Arg2, class _Result>
inline pointer_to_binary_function<_Arg1,_Arg2,_Result>
ptr_fun(_Result (*__x)(_Arg1, _Arg2)) {
return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__x);
}
 
// identity is an extensions: it is not part of the standard.
template <class _Tp>
struct _Identity : public unary_function<_Tp,_Tp> {
_Tp& operator()(_Tp& __x) const { return __x; }
const _Tp& operator()(const _Tp& __x) const { return __x; }
};
 
template <class _Tp> struct identity : public _Identity<_Tp> {};
 
// select1st and select2nd are extensions: they are not part of the standard.
template <class _Pair>
struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> {
typename _Pair::first_type& operator()(_Pair& __x) const {
return __x.first;
}
const typename _Pair::first_type& operator()(const _Pair& __x) const {
return __x.first;
}
};
 
template <class _Pair>
struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type>
{
typename _Pair::second_type& operator()(_Pair& __x) const {
return __x.second;
}
const typename _Pair::second_type& operator()(const _Pair& __x) const {
return __x.second;
}
};
 
template <class _Pair> struct select1st : public _Select1st<_Pair> {};
template <class _Pair> struct select2nd : public _Select2nd<_Pair> {};
 
// project1st and project2nd are extensions: they are not part of the standard
template <class _Arg1, class _Arg2>
struct _Project1st : public binary_function<_Arg1, _Arg2, _Arg1> {
_Arg1 operator()(const _Arg1& __x, const _Arg2&) const { return __x; }
};
 
template <class _Arg1, class _Arg2>
struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2> {
_Arg2 operator()(const _Arg1&, const _Arg2& __y) const { return __y; }
};
 
template <class _Arg1, class _Arg2>
struct project1st : public _Project1st<_Arg1, _Arg2> {};
 
template <class _Arg1, class _Arg2>
struct project2nd : public _Project2nd<_Arg1, _Arg2> {};
 
// constant_void_fun, constant_unary_fun, and constant_binary_fun are
// extensions: they are not part of the standard. (The same, of course,
// is true of the helper functions constant0, constant1, and constant2.)
 
template <class _Result>
struct _Constant_void_fun {
typedef _Result result_type;
result_type _M_val;
 
_Constant_void_fun(const result_type& __v) : _M_val(__v) {}
const result_type& operator()() const { return _M_val; }
};
 
template <class _Result, class _Argument>
struct _Constant_unary_fun {
typedef _Argument argument_type;
typedef _Result result_type;
result_type _M_val;
 
_Constant_unary_fun(const result_type& __v) : _M_val(__v) {}
const result_type& operator()(const _Argument&) const { return _M_val; }
};
 
template <class _Result, class _Arg1, class _Arg2>
struct _Constant_binary_fun {
typedef _Arg1 first_argument_type;
typedef _Arg2 second_argument_type;
typedef _Result result_type;
_Result _M_val;
 
_Constant_binary_fun(const _Result& __v) : _M_val(__v) {}
const result_type& operator()(const _Arg1&, const _Arg2&) const {
return _M_val;
}
};
 
template <class _Result>
struct constant_void_fun : public _Constant_void_fun<_Result> {
constant_void_fun(const _Result& __v) : _Constant_void_fun<_Result>(__v) {}
};
 
 
template <class _Result,
class _Argument = _Result>
struct constant_unary_fun : public _Constant_unary_fun<_Result, _Argument>
{
constant_unary_fun(const _Result& __v)
: _Constant_unary_fun<_Result, _Argument>(__v) {}
};
 
 
template <class _Result,
class _Arg1 = _Result,
class _Arg2 = _Arg1>
struct constant_binary_fun
: public _Constant_binary_fun<_Result, _Arg1, _Arg2>
{
constant_binary_fun(const _Result& __v)
: _Constant_binary_fun<_Result, _Arg1, _Arg2>(__v) {}
};
 
template <class _Result>
inline constant_void_fun<_Result> constant0(const _Result& __val)
{
return constant_void_fun<_Result>(__val);
}
 
template <class _Result>
inline constant_unary_fun<_Result,_Result> constant1(const _Result& __val)
{
return constant_unary_fun<_Result,_Result>(__val);
}
 
template <class _Result>
inline constant_binary_fun<_Result,_Result,_Result>
constant2(const _Result& __val)
{
return constant_binary_fun<_Result,_Result,_Result>(__val);
}
 
// subtractive_rng is an extension: it is not part of the standard.
// Note: this code assumes that int is 32 bits.
class subtractive_rng : public unary_function<unsigned int, unsigned int> {
private:
unsigned int _M_table[55];
size_t _M_index1;
size_t _M_index2;
public:
unsigned int operator()(unsigned int __limit) {
_M_index1 = (_M_index1 + 1) % 55;
_M_index2 = (_M_index2 + 1) % 55;
_M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2];
return _M_table[_M_index1] % __limit;
}
 
void _M_initialize(unsigned int __seed)
{
unsigned int __k = 1;
_M_table[54] = __seed;
size_t __i;
for (__i = 0; __i < 54; __i++) {
size_t __ii = (21 * (__i + 1) % 55) - 1;
_M_table[__ii] = __k;
__k = __seed - __k;
__seed = _M_table[__ii];
}
for (int __loop = 0; __loop < 4; __loop++) {
for (__i = 0; __i < 55; __i++)
_M_table[__i] = _M_table[__i] - _M_table[(1 + __i + 30) % 55];
}
_M_index1 = 0;
_M_index2 = 31;
}
 
subtractive_rng(unsigned int __seed) { _M_initialize(__seed); }
subtractive_rng() { _M_initialize(161803398u); }
};
 
 
// Adaptor function objects: pointers to member functions.
 
// There are a total of 16 = 2^4 function objects in this family.
// (1) Member functions taking no arguments vs member functions taking
// one argument.
// (2) Call through pointer vs call through reference.
// (3) Member function with void return type vs member function with
// non-void return type.
// (4) Const vs non-const member function.
 
// Note that choice (3) is nothing more than a workaround: according
// to the draft, compilers should handle void and non-void the same way.
// This feature is not yet widely implemented, though. You can only use
// member functions returning void if your compiler supports partial
// specialization.
 
// All of this complexity is in the function objects themselves. You can
// ignore it by using the helper function mem_fun and mem_fun_ref,
// which create whichever type of adaptor is appropriate.
// (mem_fun1 and mem_fun1_ref are no longer part of the C++ standard,
// but they are provided for backward compatibility.)
 
 
template <class _Ret, class _Tp>
class mem_fun_t : public unary_function<_Tp*,_Ret> {
public:
explicit mem_fun_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) {}
_Ret operator()(_Tp* __p) const { return (__p->*_M_f)(); }
private:
_Ret (_Tp::*_M_f)();
};
 
template <class _Ret, class _Tp>
class const_mem_fun_t : public unary_function<const _Tp*,_Ret> {
public:
explicit const_mem_fun_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) {}
_Ret operator()(const _Tp* __p) const { return (__p->*_M_f)(); }
private:
_Ret (_Tp::*_M_f)() const;
};
 
 
template <class _Ret, class _Tp>
class mem_fun_ref_t : public unary_function<_Tp,_Ret> {
public:
explicit mem_fun_ref_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) {}
_Ret operator()(_Tp& __r) const { return (__r.*_M_f)(); }
private:
_Ret (_Tp::*_M_f)();
};
 
template <class _Ret, class _Tp>
class const_mem_fun_ref_t : public unary_function<_Tp,_Ret> {
public:
explicit const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) {}
_Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); }
private:
_Ret (_Tp::*_M_f)() const;
};
 
template <class _Ret, class _Tp, class _Arg>
class mem_fun1_t : public binary_function<_Tp*,_Arg,_Ret> {
public:
explicit mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
_Ret operator()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg);
};
 
template <class _Ret, class _Tp, class _Arg>
class const_mem_fun1_t : public binary_function<const _Tp*,_Arg,_Ret> {
public:
explicit const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
_Ret operator()(const _Tp* __p, _Arg __x) const
{ return (__p->*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg) const;
};
 
template <class _Ret, class _Tp, class _Arg>
class mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
public:
explicit mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
_Ret operator()(_Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg);
};
 
template <class _Ret, class _Tp, class _Arg>
class const_mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
public:
explicit const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
_Ret operator()(const _Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg) const;
};
 
template <class _Tp>
class mem_fun_t<void, _Tp> : public unary_function<_Tp*,void> {
public:
explicit mem_fun_t(void (_Tp::*__pf)()) : _M_f(__pf) {}
void operator()(_Tp* __p) const { (__p->*_M_f)(); }
private:
void (_Tp::*_M_f)();
};
 
template <class _Tp>
class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*,void> {
public:
explicit const_mem_fun_t(void (_Tp::*__pf)() const) : _M_f(__pf) {}
void operator()(const _Tp* __p) const { (__p->*_M_f)(); }
private:
void (_Tp::*_M_f)() const;
};
 
template <class _Tp>
class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
public:
explicit mem_fun_ref_t(void (_Tp::*__pf)()) : _M_f(__pf) {}
void operator()(_Tp& __r) const { (__r.*_M_f)(); }
private:
void (_Tp::*_M_f)();
};
 
template <class _Tp>
class const_mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
public:
explicit const_mem_fun_ref_t(void (_Tp::*__pf)() const) : _M_f(__pf) {}
void operator()(const _Tp& __r) const { (__r.*_M_f)(); }
private:
void (_Tp::*_M_f)() const;
};
 
template <class _Tp, class _Arg>
class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*,_Arg,void> {
public:
explicit mem_fun1_t(void (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
void operator()(_Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
private:
void (_Tp::*_M_f)(_Arg);
};
 
template <class _Tp, class _Arg>
class const_mem_fun1_t<void, _Tp, _Arg>
: public binary_function<const _Tp*,_Arg,void> {
public:
explicit const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
void operator()(const _Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
private:
void (_Tp::*_M_f)(_Arg) const;
};
 
template <class _Tp, class _Arg>
class mem_fun1_ref_t<void, _Tp, _Arg>
: public binary_function<_Tp,_Arg,void> {
public:
explicit mem_fun1_ref_t(void (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
void operator()(_Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
private:
void (_Tp::*_M_f)(_Arg);
};
 
template <class _Tp, class _Arg>
class const_mem_fun1_ref_t<void, _Tp, _Arg>
: public binary_function<_Tp,_Arg,void> {
public:
explicit const_mem_fun1_ref_t(void (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
void operator()(const _Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
private:
void (_Tp::*_M_f)(_Arg) const;
};
 
 
// Mem_fun adaptor helper functions. There are only two:
// mem_fun and mem_fun_ref. (mem_fun1 and mem_fun1_ref
// are provided for backward compatibility, but they are no longer
// part of the C++ standard.)
 
template <class _Ret, class _Tp>
inline mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)())
{ return mem_fun_t<_Ret,_Tp>(__f); }
 
template <class _Ret, class _Tp>
inline const_mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)() const)
{ return const_mem_fun_t<_Ret,_Tp>(__f); }
 
template <class _Ret, class _Tp>
inline mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)())
{ return mem_fun_ref_t<_Ret,_Tp>(__f); }
 
template <class _Ret, class _Tp>
inline const_mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)() const)
{ return const_mem_fun_ref_t<_Ret,_Tp>(__f); }
 
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
 
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
 
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
 
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
 
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
 
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
 
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun1_ref(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
 
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_FUNCTION_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_heap.h
0,0 → 1,314
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef _CPP_BITS_STL_HEAP_H
#define _CPP_BITS_STL_HEAP_H 1
 
namespace std
{
 
// Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap.
 
template <class _RandomAccessIterator, class _Distance, class _Tp>
void
__push_heap(_RandomAccessIterator __first,
_Distance __holeIndex, _Distance __topIndex, _Tp __value)
{
_Distance __parent = (__holeIndex - 1) / 2;
while (__holeIndex > __topIndex && *(__first + __parent) < __value) {
*(__first + __holeIndex) = *(__first + __parent);
__holeIndex = __parent;
__parent = (__holeIndex - 1) / 2;
}
*(__first + __holeIndex) = __value;
}
 
template <class _RandomAccessIterator, class _Distance, class _Tp>
inline void
__push_heap_aux(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Distance*, _Tp*)
{
__push_heap(__first, _Distance((__last - __first) - 1), _Distance(0),
_Tp(*(__last - 1)));
}
 
template <class _RandomAccessIterator>
inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIterator>::value_type>);
 
__push_heap_aux(__first, __last,
__distance_type(__first), __value_type(__first));
}
 
template <class _RandomAccessIterator, class _Distance, class _Tp,
class _Compare>
void
__push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
_Distance __topIndex, _Tp __value, _Compare __comp)
{
_Distance __parent = (__holeIndex - 1) / 2;
while (__holeIndex > __topIndex && __comp(*(__first + __parent), __value)) {
*(__first + __holeIndex) = *(__first + __parent);
__holeIndex = __parent;
__parent = (__holeIndex - 1) / 2;
}
*(__first + __holeIndex) = __value;
}
 
template <class _RandomAccessIterator, class _Compare,
class _Distance, class _Tp>
inline void
__push_heap_aux(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp,
_Distance*, _Tp*)
{
__push_heap(__first, _Distance((__last - __first) - 1), _Distance(0),
_Tp(*(__last - 1)), __comp);
}
 
template <class _RandomAccessIterator, class _Compare>
inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
 
__push_heap_aux(__first, __last, __comp,
__distance_type(__first), __value_type(__first));
}
 
template <class _RandomAccessIterator, class _Distance, class _Tp>
void
__adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
_Distance __len, _Tp __value)
{
_Distance __topIndex = __holeIndex;
_Distance __secondChild = 2 * __holeIndex + 2;
while (__secondChild < __len) {
if (*(__first + __secondChild) < *(__first + (__secondChild - 1)))
__secondChild--;
*(__first + __holeIndex) = *(__first + __secondChild);
__holeIndex = __secondChild;
__secondChild = 2 * (__secondChild + 1);
}
if (__secondChild == __len) {
*(__first + __holeIndex) = *(__first + (__secondChild - 1));
__holeIndex = __secondChild - 1;
}
__push_heap(__first, __holeIndex, __topIndex, __value);
}
 
template <class _RandomAccessIterator, class _Tp, class _Distance>
inline void
__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_RandomAccessIterator __result, _Tp __value, _Distance*)
{
*__result = *__first;
__adjust_heap(__first, _Distance(0), _Distance(__last - __first), __value);
}
 
template <class _RandomAccessIterator, class _Tp>
inline void
__pop_heap_aux(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Tp*)
{
__pop_heap(__first, __last - 1, __last - 1,
_Tp(*(__last - 1)), __distance_type(__first));
}
 
template <class _RandomAccessIterator>
inline void pop_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIterator>::value_type>);
 
__pop_heap_aux(__first, __last, __value_type(__first));
}
 
template <class _RandomAccessIterator, class _Distance,
class _Tp, class _Compare>
void
__adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
_Distance __len, _Tp __value, _Compare __comp)
{
_Distance __topIndex = __holeIndex;
_Distance __secondChild = 2 * __holeIndex + 2;
while (__secondChild < __len) {
if (__comp(*(__first + __secondChild), *(__first + (__secondChild - 1))))
__secondChild--;
*(__first + __holeIndex) = *(__first + __secondChild);
__holeIndex = __secondChild;
__secondChild = 2 * (__secondChild + 1);
}
if (__secondChild == __len) {
*(__first + __holeIndex) = *(__first + (__secondChild - 1));
__holeIndex = __secondChild - 1;
}
__push_heap(__first, __holeIndex, __topIndex, __value, __comp);
}
 
template <class _RandomAccessIterator, class _Tp, class _Compare,
class _Distance>
inline void
__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_RandomAccessIterator __result, _Tp __value, _Compare __comp,
_Distance*)
{
*__result = *__first;
__adjust_heap(__first, _Distance(0), _Distance(__last - __first),
__value, __comp);
}
 
template <class _RandomAccessIterator, class _Tp, class _Compare>
inline void
__pop_heap_aux(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Tp*, _Compare __comp)
{
__pop_heap(__first, __last - 1, __last - 1, _Tp(*(__last - 1)), __comp,
__distance_type(__first));
}
 
template <class _RandomAccessIterator, class _Compare>
inline void
pop_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
 
__pop_heap_aux(__first, __last, __value_type(__first), __comp);
}
 
template <class _RandomAccessIterator, class _Tp, class _Distance>
void
__make_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Tp*, _Distance*)
{
if (__last - __first < 2) return;
_Distance __len = __last - __first;
_Distance __parent = (__len - 2)/2;
while (true) {
__adjust_heap(__first, __parent, __len, _Tp(*(__first + __parent)));
if (__parent == 0) return;
__parent--;
}
}
 
template <class _RandomAccessIterator>
inline void
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIterator>::value_type>);
 
__make_heap(__first, __last,
__value_type(__first), __distance_type(__first));
}
 
template <class _RandomAccessIterator, class _Compare,
class _Tp, class _Distance>
void
__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp, _Tp*, _Distance*)
{
if (__last - __first < 2) return;
_Distance __len = __last - __first;
_Distance __parent = (__len - 2)/2;
while (true) {
__adjust_heap(__first, __parent, __len, _Tp(*(__first + __parent)),
__comp);
if (__parent == 0) return;
__parent--;
}
}
 
template <class _RandomAccessIterator, class _Compare>
inline void
make_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
 
__make_heap(__first, __last, __comp,
__value_type(__first), __distance_type(__first));
}
 
template <class _RandomAccessIterator>
void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
__glibcpp_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIterator>::value_type>);
 
while (__last - __first > 1)
pop_heap(__first, __last--);
}
 
template <class _RandomAccessIterator, class _Compare>
void
sort_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
// concept requirements
__glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
 
while (__last - __first > 1)
pop_heap(__first, __last--, __comp);
}
 
} // namespace std
 
#endif /* _CPP_BITS_STL_HEAP_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_iterator.h
0,0 → 1,548
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996-1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_ITERATOR_H
#define __SGI_STL_INTERNAL_ITERATOR_H
 
namespace std
{
 
template <class _Container>
class back_insert_iterator {
protected:
_Container* container;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
 
explicit back_insert_iterator(_Container& __x) : container(&__x) {}
back_insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->push_back(__value);
return *this;
}
back_insert_iterator<_Container>& operator*() { return *this; }
back_insert_iterator<_Container>& operator++() { return *this; }
back_insert_iterator<_Container>& operator++(int) { return *this; }
};
 
template <class _Container>
inline back_insert_iterator<_Container> back_inserter(_Container& __x) {
return back_insert_iterator<_Container>(__x);
}
 
template <class _Container>
class front_insert_iterator {
protected:
_Container* container;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
 
explicit front_insert_iterator(_Container& __x) : container(&__x) {}
front_insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->push_front(__value);
return *this;
}
front_insert_iterator<_Container>& operator*() { return *this; }
front_insert_iterator<_Container>& operator++() { return *this; }
front_insert_iterator<_Container>& operator++(int) { return *this; }
};
 
template <class _Container>
inline front_insert_iterator<_Container> front_inserter(_Container& __x) {
return front_insert_iterator<_Container>(__x);
}
 
template <class _Container>
class insert_iterator {
protected:
_Container* container;
typename _Container::iterator iter;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
 
insert_iterator(_Container& __x, typename _Container::iterator __i)
: container(&__x), iter(__i) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
iter = container->insert(iter, __value);
++iter;
return *this;
}
insert_iterator<_Container>& operator*() { return *this; }
insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; }
};
 
template <class _Container, class _Iterator>
inline
insert_iterator<_Container> inserter(_Container& __x, _Iterator __i)
{
typedef typename _Container::iterator __iter;
return insert_iterator<_Container>(__x, __iter(__i));
}
 
template <class _BidirectionalIterator, class _Tp, class _Reference = _Tp&,
class _Distance = ptrdiff_t>
class reverse_bidirectional_iterator {
typedef reverse_bidirectional_iterator<_BidirectionalIterator, _Tp,
_Reference, _Distance> _Self;
protected:
_BidirectionalIterator current;
public:
typedef bidirectional_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Reference reference;
 
reverse_bidirectional_iterator() {}
explicit reverse_bidirectional_iterator(_BidirectionalIterator __x)
: current(__x) {}
_BidirectionalIterator base() const { return current; }
_Reference operator*() const {
_BidirectionalIterator __tmp = current;
return *--__tmp;
}
pointer operator->() const { return &(operator*()); }
_Self& operator++() {
--current;
return *this;
}
_Self operator++(int) {
_Self __tmp = *this;
--current;
return __tmp;
}
_Self& operator--() {
++current;
return *this;
}
_Self operator--(int) {
_Self __tmp = *this;
++current;
return __tmp;
}
};
 
template <class _BiIter, class _Tp, class _Ref, class _Distance>
inline bool operator==(
const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __x,
const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __y)
{
return __x.base() == __y.base();
}
 
template <class _BiIter, class _Tp, class _Ref, class _Distance>
inline bool operator!=(
const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __x,
const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __y)
{
return !(__x == __y);
}
 
 
// This is the new version of reverse_iterator, as defined in the
// draft C++ standard. It relies on the iterator_traits template,
// which in turn relies on partial specialization. The class
// reverse_bidirectional_iterator is no longer part of the draft
// standard, but it is retained for backward compatibility.
 
template <class _Iterator>
class reverse_iterator
{
protected:
_Iterator current;
public:
typedef typename iterator_traits<_Iterator>::iterator_category
iterator_category;
typedef typename iterator_traits<_Iterator>::value_type
value_type;
typedef typename iterator_traits<_Iterator>::difference_type
difference_type;
typedef typename iterator_traits<_Iterator>::pointer
pointer;
typedef typename iterator_traits<_Iterator>::reference
reference;
 
typedef _Iterator iterator_type;
typedef reverse_iterator<_Iterator> _Self;
 
public:
reverse_iterator() {}
explicit reverse_iterator(iterator_type __x) : current(__x) {}
 
reverse_iterator(const _Self& __x) : current(__x.current) {}
template <class _Iter>
reverse_iterator(const reverse_iterator<_Iter>& __x)
: current(__x.base()) {}
iterator_type base() const { return current; }
reference operator*() const {
_Iterator __tmp = current;
return *--__tmp;
}
pointer operator->() const { return &(operator*()); }
 
_Self& operator++() {
--current;
return *this;
}
_Self operator++(int) {
_Self __tmp = *this;
--current;
return __tmp;
}
_Self& operator--() {
++current;
return *this;
}
_Self operator--(int) {
_Self __tmp = *this;
++current;
return __tmp;
}
 
_Self operator+(difference_type __n) const {
return _Self(current - __n);
}
_Self& operator+=(difference_type __n) {
current -= __n;
return *this;
}
_Self operator-(difference_type __n) const {
return _Self(current + __n);
}
_Self& operator-=(difference_type __n) {
current += __n;
return *this;
}
reference operator[](difference_type __n) const { return *(*this + __n); }
};
template <class _Iterator>
inline bool operator==(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) {
return __x.base() == __y.base();
}
 
template <class _Iterator>
inline bool operator<(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) {
return __y.base() < __x.base();
}
 
template <class _Iterator>
inline bool operator!=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) {
return !(__x == __y);
}
 
template <class _Iterator>
inline bool operator>(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) {
return __y < __x;
}
 
template <class _Iterator>
inline bool operator<=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) {
return !(__y < __x);
}
 
template <class _Iterator>
inline bool operator>=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) {
return !(__x < __y);
}
 
template <class _Iterator>
inline typename reverse_iterator<_Iterator>::difference_type
operator-(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) {
return __y.base() - __x.base();
}
 
template <class _Iterator>
inline reverse_iterator<_Iterator>
operator+(typename reverse_iterator<_Iterator>::difference_type __n,
const reverse_iterator<_Iterator>& __x) {
return reverse_iterator<_Iterator>(__x.base() - __n);
}
 
 
template <class _Tp,
class _CharT = char, class _Traits = char_traits<_CharT>,
class _Dist = ptrdiff_t>
class istream_iterator {
public:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef basic_istream<_CharT, _Traits> istream_type;
 
typedef input_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Dist difference_type;
typedef const _Tp* pointer;
typedef const _Tp& reference;
 
istream_iterator() : _M_stream(0), _M_ok(false) {}
istream_iterator(istream_type& __s) : _M_stream(&__s) { _M_read(); }
 
reference operator*() const { return _M_value; }
pointer operator->() const { return &(operator*()); }
 
istream_iterator& operator++() {
_M_read();
return *this;
}
istream_iterator operator++(int) {
istream_iterator __tmp = *this;
_M_read();
return __tmp;
}
 
bool _M_equal(const istream_iterator& __x) const
{ return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); }
 
private:
istream_type* _M_stream;
_Tp _M_value;
bool _M_ok;
 
void _M_read() {
_M_ok = (_M_stream && *_M_stream) ? true : false;
if (_M_ok) {
*_M_stream >> _M_value;
_M_ok = *_M_stream ? true : false;
}
}
};
 
template <class _Tp, class _CharT, class _Traits, class _Dist>
inline bool
operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) {
return __x._M_equal(__y);
}
 
template <class _Tp, class _CharT, class _Traits, class _Dist>
inline bool
operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) {
return !__x._M_equal(__y);
}
 
 
template <class _Tp,
class _CharT = char, class _Traits = char_traits<_CharT> >
class ostream_iterator {
public:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef basic_ostream<_CharT, _Traits> ostream_type;
 
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
 
ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {}
ostream_iterator(ostream_type& __s, const _CharT* __c)
: _M_stream(&__s), _M_string(__c) {}
ostream_iterator<_Tp>& operator=(const _Tp& __value) {
*_M_stream << __value;
if (_M_string) *_M_stream << _M_string;
return *this;
}
ostream_iterator<_Tp>& operator*() { return *this; }
ostream_iterator<_Tp>& operator++() { return *this; }
ostream_iterator<_Tp>& operator++(int) { return *this; }
private:
ostream_type* _M_stream;
const _CharT* _M_string;
};
 
 
// This iterator adapter is 'normal' in the sense that it does not
// change the semantics of any of the operators of its itererator
// parameter. Its primary purpose is to convert an iterator that is
// not a class, e.g. a pointer, into an iterator that is a class.
// The _Container parameter exists solely so that different containers
// using this template can instantiate different types, even if the
// _Iterator parameter is the same.
template<typename _Iterator, typename _Container>
class __normal_iterator
: public iterator<iterator_traits<_Iterator>::iterator_category,
iterator_traits<_Iterator>::value_type,
iterator_traits<_Iterator>::difference_type,
iterator_traits<_Iterator>::pointer,
iterator_traits<_Iterator>::reference>
{
 
protected:
_Iterator _M_current;
 
public:
typedef __normal_iterator<_Iterator, _Container> normal_iterator_type;
typedef iterator_traits<_Iterator> __traits_type;
typedef typename __traits_type::iterator_category iterator_category;
typedef typename __traits_type::value_type value_type;
typedef typename __traits_type::difference_type difference_type;
typedef typename __traits_type::pointer pointer;
typedef typename __traits_type::reference reference;
 
__normal_iterator() : _M_current(_Iterator()) { }
 
explicit __normal_iterator(const _Iterator& __i) : _M_current(__i) { }
 
// Allow iterator to const_iterator conversion
template<typename _Iter>
inline __normal_iterator(const __normal_iterator<_Iter, _Container>& __i)
: _M_current(__i.base()) { }
 
// Forward iterator requirements
reference
operator*() const { return *_M_current; }
 
pointer
operator->() const { return _M_current; }
 
normal_iterator_type&
operator++() { ++_M_current; return *this; }
 
normal_iterator_type
operator++(int) { return __normal_iterator(_M_current++); }
 
// Bidirectional iterator requirements
normal_iterator_type&
operator--() { --_M_current; return *this; }
 
normal_iterator_type
operator--(int) { return __normal_iterator(_M_current--); }
 
// Random access iterator requirements
reference
operator[](const difference_type& __n) const
{ return _M_current[__n]; }
 
normal_iterator_type&
operator+=(const difference_type& __n)
{ _M_current += __n; return *this; }
 
normal_iterator_type
operator+(const difference_type& __n) const
{ return __normal_iterator(_M_current + __n); }
 
normal_iterator_type&
operator-=(const difference_type& __n)
{ _M_current -= __n; return *this; }
 
normal_iterator_type
operator-(const difference_type& __n) const
{ return __normal_iterator(_M_current - __n); }
 
difference_type
operator-(const normal_iterator_type& __i) const
{ return _M_current - __i._M_current; }
 
const _Iterator&
base() const { return _M_current; }
};
 
// forward iterator requirements
 
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __lhs.base() == __rhs.base(); }
 
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return !(__lhs == __rhs); }
 
// random access iterator requirements
 
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __lhs.base() < __rhs.base(); }
 
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __rhs < __lhs; }
 
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return !(__rhs < __lhs); }
 
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return !(__lhs < __rhs); }
 
template<typename _Iterator, typename _Container>
inline __normal_iterator<_Iterator, _Container>
operator+(__normal_iterator<_Iterator, _Container>::difference_type __n,
const __normal_iterator<_Iterator, _Container>& __i)
{ return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_ITERATOR_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_iterator_base.h
0,0 → 1,367
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996-1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_H
#define __SGI_STL_INTERNAL_ITERATOR_BASE_H
 
// This file contains all of the general iterator-related utilities.
// The internal file stl_iterator.h contains predefined iterators,
// such as front_insert_iterator and istream_iterator.
 
#include <bits/concept_checks.h>
 
__STL_BEGIN_NAMESPACE
 
struct input_iterator_tag {};
struct output_iterator_tag {};
struct forward_iterator_tag : public input_iterator_tag {};
struct bidirectional_iterator_tag : public forward_iterator_tag {};
struct random_access_iterator_tag : public bidirectional_iterator_tag {};
 
// The base classes input_iterator, output_iterator, forward_iterator,
// bidirectional_iterator, and random_access_iterator are not part of
// the C++ standard. (They have been replaced by struct iterator.)
// They are included for backward compatibility with the HP STL.
 
template <class _Tp, class _Distance> struct input_iterator {
typedef input_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
 
struct output_iterator {
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
};
 
template <class _Tp, class _Distance> struct forward_iterator {
typedef forward_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
 
 
template <class _Tp, class _Distance> struct bidirectional_iterator {
typedef bidirectional_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
 
template <class _Tp, class _Distance> struct random_access_iterator {
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
 
#ifdef __STL_USE_NAMESPACES
template <class _Category, class _Tp, class _Distance = ptrdiff_t,
class _Pointer = _Tp*, class _Reference = _Tp&>
struct iterator {
typedef _Category iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Pointer pointer;
typedef _Reference reference;
};
#endif /* __STL_USE_NAMESPACES */
 
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
 
template <class _Iterator>
struct iterator_traits {
typedef typename _Iterator::iterator_category iterator_category;
typedef typename _Iterator::value_type value_type;
typedef typename _Iterator::difference_type difference_type;
typedef typename _Iterator::pointer pointer;
typedef typename _Iterator::reference reference;
};
 
template <class _Tp>
struct iterator_traits<_Tp*> {
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
 
template <class _Tp>
struct iterator_traits<const _Tp*> {
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef ptrdiff_t difference_type;
typedef const _Tp* pointer;
typedef const _Tp& reference;
};
 
// The overloaded functions iterator_category, distance_type, and
// value_type are not part of the C++ standard. (They have been
// replaced by struct iterator_traits.) They are included for
// backward compatibility with the HP STL.
 
// We introduce internal names for these functions.
 
template <class _Iter>
inline typename iterator_traits<_Iter>::iterator_category
__iterator_category(const _Iter&)
{
typedef typename iterator_traits<_Iter>::iterator_category _Category;
return _Category();
}
 
template <class _Iter>
inline typename iterator_traits<_Iter>::difference_type*
__distance_type(const _Iter&)
{
return static_cast<typename iterator_traits<_Iter>::difference_type*>(0);
}
 
template <class _Iter>
inline typename iterator_traits<_Iter>::value_type*
__value_type(const _Iter&)
{
return static_cast<typename iterator_traits<_Iter>::value_type*>(0);
}
 
template <class _Iter>
inline typename iterator_traits<_Iter>::iterator_category
iterator_category(const _Iter& __i) { return __iterator_category(__i); }
 
 
template <class _Iter>
inline typename iterator_traits<_Iter>::difference_type*
distance_type(const _Iter& __i) { return __distance_type(__i); }
 
template <class _Iter>
inline typename iterator_traits<_Iter>::value_type*
value_type(const _Iter& __i) { return __value_type(__i); }
 
#define __ITERATOR_CATEGORY(__i) __iterator_category(__i)
#define __DISTANCE_TYPE(__i) __distance_type(__i)
#define __VALUE_TYPE(__i) __value_type(__i)
 
#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
 
template <class _Tp, class _Distance>
inline input_iterator_tag
iterator_category(const input_iterator<_Tp, _Distance>&)
{ return input_iterator_tag(); }
 
inline output_iterator_tag iterator_category(const output_iterator&)
{ return output_iterator_tag(); }
 
template <class _Tp, class _Distance>
inline forward_iterator_tag
iterator_category(const forward_iterator<_Tp, _Distance>&)
{ return forward_iterator_tag(); }
 
template <class _Tp, class _Distance>
inline bidirectional_iterator_tag
iterator_category(const bidirectional_iterator<_Tp, _Distance>&)
{ return bidirectional_iterator_tag(); }
 
template <class _Tp, class _Distance>
inline random_access_iterator_tag
iterator_category(const random_access_iterator<_Tp, _Distance>&)
{ return random_access_iterator_tag(); }
 
template <class _Tp>
inline random_access_iterator_tag iterator_category(const _Tp*)
{ return random_access_iterator_tag(); }
 
template <class _Tp, class _Distance>
inline _Tp* value_type(const input_iterator<_Tp, _Distance>&)
{ return (_Tp*)(0); }
 
template <class _Tp, class _Distance>
inline _Tp* value_type(const forward_iterator<_Tp, _Distance>&)
{ return (_Tp*)(0); }
 
template <class _Tp, class _Distance>
inline _Tp* value_type(const bidirectional_iterator<_Tp, _Distance>&)
{ return (_Tp*)(0); }
 
template <class _Tp, class _Distance>
inline _Tp* value_type(const random_access_iterator<_Tp, _Distance>&)
{ return (_Tp*)(0); }
 
template <class _Tp>
inline _Tp* value_type(const _Tp*) { return (_Tp*)(0); }
 
template <class _Tp, class _Distance>
inline _Distance* distance_type(const input_iterator<_Tp, _Distance>&)
{
return (_Distance*)(0);
}
 
template <class _Tp, class _Distance>
inline _Distance* distance_type(const forward_iterator<_Tp, _Distance>&)
{
return (_Distance*)(0);
}
 
template <class _Tp, class _Distance>
inline _Distance*
distance_type(const bidirectional_iterator<_Tp, _Distance>&)
{
return (_Distance*)(0);
}
 
template <class _Tp, class _Distance>
inline _Distance*
distance_type(const random_access_iterator<_Tp, _Distance>&)
{
return (_Distance*)(0);
}
 
template <class _Tp>
inline ptrdiff_t* distance_type(const _Tp*) { return (ptrdiff_t*)(0); }
 
// Without partial specialization we can't use iterator_traits, so
// we must keep the old iterator query functions around.
 
#define __ITERATOR_CATEGORY(__i) iterator_category(__i)
#define __DISTANCE_TYPE(__i) distance_type(__i)
#define __VALUE_TYPE(__i) value_type(__i)
 
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
 
template <class _InputIterator, class _Distance>
inline void __distance(_InputIterator __first, _InputIterator __last,
_Distance& __n, input_iterator_tag)
{
while (__first != __last) { ++__first; ++__n; }
}
 
template <class _RandomAccessIterator, class _Distance>
inline void __distance(_RandomAccessIterator __first,
_RandomAccessIterator __last,
_Distance& __n, random_access_iterator_tag)
{
__STL_REQUIRES(_RandomAccessIterator, _RandomAccessIterator);
__n += __last - __first;
}
 
template <class _InputIterator, class _Distance>
inline void distance(_InputIterator __first,
_InputIterator __last, _Distance& __n)
{
__STL_REQUIRES(_InputIterator, _InputIterator);
__distance(__first, __last, __n, iterator_category(__first));
}
 
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
 
template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
__distance(_InputIterator __first, _InputIterator __last, input_iterator_tag)
{
typename iterator_traits<_InputIterator>::difference_type __n = 0;
while (__first != __last) {
++__first; ++__n;
}
return __n;
}
 
template <class _RandomAccessIterator>
inline typename iterator_traits<_RandomAccessIterator>::difference_type
__distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
random_access_iterator_tag) {
__STL_REQUIRES(_RandomAccessIterator, _RandomAccessIterator);
return __last - __first;
}
 
template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
distance(_InputIterator __first, _InputIterator __last) {
typedef typename iterator_traits<_InputIterator>::iterator_category
_Category;
__STL_REQUIRES(_InputIterator, _InputIterator);
return __distance(__first, __last, _Category());
}
 
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
 
template <class _InputIter, class _Distance>
inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag) {
while (__n--) ++__i;
}
 
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1183
#endif
 
template <class _BidirectionalIterator, class _Distance>
inline void __advance(_BidirectionalIterator& __i, _Distance __n,
bidirectional_iterator_tag) {
__STL_REQUIRES(_BidirectionalIterator, _BidirectionalIterator);
if (__n >= 0)
while (__n--) ++__i;
else
while (__n++) --__i;
}
 
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1183
#endif
 
template <class _RandomAccessIterator, class _Distance>
inline void __advance(_RandomAccessIterator& __i, _Distance __n,
random_access_iterator_tag) {
__STL_REQUIRES(_RandomAccessIterator, _RandomAccessIterator);
__i += __n;
}
 
template <class _InputIterator, class _Distance>
inline void advance(_InputIterator& __i, _Distance __n) {
__STL_REQUIRES(_InputIterator, _InputIterator);
__advance(__i, __n, iterator_category(__i));
}
 
__STL_END_NAMESPACE
 
#endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_H */
 
 
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_iterator_base_funcs.h
0,0 → 1,152
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996-1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H
#define __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H
 
// This file contains all of the general iterator-related utility
// functions, such as distance() and advance().
// The internal file stl_iterator.h contains predefined iterators,
// such as front_insert_iterator and istream_iterator.
 
#pragma GCC system_header
#include <bits/concept_check.h>
 
namespace std
{
 
// There are two signatures for distance. In addition to the one taking
// two iterators and returning a result, there is another taking two
// iterators and a reference-to-result variable, and returning nothing.
// The latter seems to be an SGI extension. -- pedwards
template <class _InputIterator, class _Distance>
inline void __distance(_InputIterator __first, _InputIterator __last,
_Distance& __n, input_iterator_tag)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
while (__first != __last) { ++__first; ++__n; }
}
 
template <class _RandomAccessIterator, class _Distance>
inline void __distance(_RandomAccessIterator __first,
_RandomAccessIterator __last,
_Distance& __n, random_access_iterator_tag)
{
// concept requirements
__glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>);
__n += __last - __first;
}
 
template <class _InputIterator, class _Distance>
inline void distance(_InputIterator __first,
_InputIterator __last, _Distance& __n)
{
// concept requirements -- taken care of in __distance
__distance(__first, __last, __n, iterator_category(__first));
}
 
template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
__distance(_InputIterator __first, _InputIterator __last, input_iterator_tag)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
typename iterator_traits<_InputIterator>::difference_type __n = 0;
while (__first != __last) {
++__first; ++__n;
}
return __n;
}
 
template <class _RandomAccessIterator>
inline typename iterator_traits<_RandomAccessIterator>::difference_type
__distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
random_access_iterator_tag)
{
// concept requirements
__glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>);
return __last - __first;
}
 
template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
distance(_InputIterator __first, _InputIterator __last)
{
// concept requirements -- taken care of in __distance
typedef typename iterator_traits<_InputIterator>::iterator_category
_Category;
return __distance(__first, __last, _Category());
}
 
template <class _InputIter, class _Distance>
inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
while (__n--) ++__i;
}
 
template <class _BidirectionalIterator, class _Distance>
inline void __advance(_BidirectionalIterator& __i, _Distance __n,
bidirectional_iterator_tag)
{
// concept requirements
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIterator>);
if (__n > 0)
while (__n--) ++__i;
else
while (__n++) --__i;
}
 
template <class _RandomAccessIterator, class _Distance>
inline void __advance(_RandomAccessIterator& __i, _Distance __n,
random_access_iterator_tag)
{
// concept requirements
__glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>);
__i += __n;
}
 
template <class _InputIterator, class _Distance>
inline void advance(_InputIterator& __i, _Distance __n)
{
// concept requirements -- taken care of in __advance
__advance(__i, __n, iterator_category(__i));
}
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H */
 
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_iterator_base_types.h
0,0 → 1,182
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996-1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H
#define __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H
 
// This file contains all of the general iterator-related utility
// types, such as iterator_traits and struct iterator.
// The internal file stl_iterator.h contains predefined iterators,
// such as front_insert_iterator and istream_iterator.
 
#pragma GCC system_header
 
namespace std
{
 
struct input_iterator_tag {};
struct output_iterator_tag {};
struct forward_iterator_tag : public input_iterator_tag {};
struct bidirectional_iterator_tag : public forward_iterator_tag {};
struct random_access_iterator_tag : public bidirectional_iterator_tag {};
 
// The base classes input_iterator, output_iterator, forward_iterator,
// bidirectional_iterator, and random_access_iterator are not part of
// the C++ standard. (They have been replaced by struct iterator.)
// They are included for backward compatibility with the HP STL.
 
template <class _Tp, class _Distance> struct input_iterator {
typedef input_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
 
struct output_iterator {
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
};
 
template <class _Tp, class _Distance> struct forward_iterator {
typedef forward_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
 
 
template <class _Tp, class _Distance> struct bidirectional_iterator {
typedef bidirectional_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
 
template <class _Tp, class _Distance> struct random_access_iterator {
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
 
template <class _Category, class _Tp, class _Distance = ptrdiff_t,
class _Pointer = _Tp*, class _Reference = _Tp&>
struct iterator {
typedef _Category iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Pointer pointer;
typedef _Reference reference;
};
 
template <class _Iterator>
struct iterator_traits {
typedef typename _Iterator::iterator_category iterator_category;
typedef typename _Iterator::value_type value_type;
typedef typename _Iterator::difference_type difference_type;
typedef typename _Iterator::pointer pointer;
typedef typename _Iterator::reference reference;
};
 
template <class _Tp>
struct iterator_traits<_Tp*> {
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
 
template <class _Tp>
struct iterator_traits<const _Tp*> {
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef ptrdiff_t difference_type;
typedef const _Tp* pointer;
typedef const _Tp& reference;
};
 
// The overloaded functions iterator_category, distance_type, and
// value_type are not part of the C++ standard. (They have been
// replaced by struct iterator_traits.) They are included for
// backward compatibility with the HP STL.
 
// We introduce internal names for these functions.
 
template <class _Iter>
inline typename iterator_traits<_Iter>::iterator_category
__iterator_category(const _Iter&)
{
typedef typename iterator_traits<_Iter>::iterator_category _Category;
return _Category();
}
 
template <class _Iter>
inline typename iterator_traits<_Iter>::difference_type*
__distance_type(const _Iter&)
{
return static_cast<typename iterator_traits<_Iter>::difference_type*>(0);
}
 
template <class _Iter>
inline typename iterator_traits<_Iter>::value_type*
__value_type(const _Iter&)
{
return static_cast<typename iterator_traits<_Iter>::value_type*>(0);
}
 
template <class _Iter>
inline typename iterator_traits<_Iter>::iterator_category
iterator_category(const _Iter& __i) { return __iterator_category(__i); }
 
 
template <class _Iter>
inline typename iterator_traits<_Iter>::difference_type*
distance_type(const _Iter& __i) { return __distance_type(__i); }
 
template <class _Iter>
inline typename iterator_traits<_Iter>::value_type*
value_type(const _Iter& __i) { return __value_type(__i); }
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H */
 
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_list.h
0,0 → 1,745
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_LIST_H
#define __SGI_STL_INTERNAL_LIST_H
 
#include <bits/concept_check.h>
 
namespace std
{
 
struct _List_node_base {
_List_node_base* _M_next;
_List_node_base* _M_prev;
};
 
template <class _Tp>
struct _List_node : public _List_node_base {
_Tp _M_data;
};
 
struct _List_iterator_base {
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef bidirectional_iterator_tag iterator_category;
 
_List_node_base* _M_node;
 
_List_iterator_base(_List_node_base* __x) : _M_node(__x) {}
_List_iterator_base() {}
 
void _M_incr() { _M_node = _M_node->_M_next; }
void _M_decr() { _M_node = _M_node->_M_prev; }
 
bool operator==(const _List_iterator_base& __x) const {
return _M_node == __x._M_node;
}
bool operator!=(const _List_iterator_base& __x) const {
return _M_node != __x._M_node;
}
};
 
template<class _Tp, class _Ref, class _Ptr>
struct _List_iterator : public _List_iterator_base {
typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator;
typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
typedef _List_iterator<_Tp,_Ref,_Ptr> _Self;
 
typedef _Tp value_type;
typedef _Ptr pointer;
typedef _Ref reference;
typedef _List_node<_Tp> _Node;
 
_List_iterator(_Node* __x) : _List_iterator_base(__x) {}
_List_iterator() {}
_List_iterator(const iterator& __x) : _List_iterator_base(__x._M_node) {}
 
reference operator*() const { return ((_Node*) _M_node)->_M_data; }
pointer operator->() const { return &(operator*()); }
 
_Self& operator++() {
this->_M_incr();
return *this;
}
_Self operator++(int) {
_Self __tmp = *this;
this->_M_incr();
return __tmp;
}
_Self& operator--() {
this->_M_decr();
return *this;
}
_Self operator--(int) {
_Self __tmp = *this;
this->_M_decr();
return __tmp;
}
};
 
 
// Base class that encapsulates details of allocators. Three cases:
// an ordinary standard-conforming allocator, a standard-conforming
// allocator with no non-static data, and an SGI-style allocator.
// This complexity is necessary only because we're worrying about backward
// compatibility and because we want to avoid wasting storage on an
// allocator instance if it isn't necessary.
 
 
// Base for general standard-conforming allocators.
template <class _Tp, class _Allocator, bool _IsStatic>
class _List_alloc_base {
public:
typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return _Node_allocator; }
 
_List_alloc_base(const allocator_type& __a) : _Node_allocator(__a) {}
 
protected:
_List_node<_Tp>* _M_get_node()
{ return _Node_allocator.allocate(1); }
void _M_put_node(_List_node<_Tp>* __p)
{ _Node_allocator.deallocate(__p, 1); }
 
protected:
typename _Alloc_traits<_List_node<_Tp>, _Allocator>::allocator_type
_Node_allocator;
_List_node<_Tp>* _M_node;
};
 
// Specialization for instanceless allocators.
 
template <class _Tp, class _Allocator>
class _List_alloc_base<_Tp, _Allocator, true> {
public:
typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
 
_List_alloc_base(const allocator_type&) {}
 
protected:
typedef typename _Alloc_traits<_List_node<_Tp>, _Allocator>::_Alloc_type
_Alloc_type;
_List_node<_Tp>* _M_get_node() { return _Alloc_type::allocate(1); }
void _M_put_node(_List_node<_Tp>* __p) { _Alloc_type::deallocate(__p, 1); }
 
protected:
_List_node<_Tp>* _M_node;
};
 
template <class _Tp, class _Alloc>
class _List_base
: public _List_alloc_base<_Tp, _Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
{
public:
typedef _List_alloc_base<_Tp, _Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
_Base;
typedef typename _Base::allocator_type allocator_type;
 
_List_base(const allocator_type& __a) : _Base(__a) {
_M_node = _M_get_node();
_M_node->_M_next = _M_node;
_M_node->_M_prev = _M_node;
}
~_List_base() {
clear();
_M_put_node(_M_node);
}
 
void clear();
};
 
 
template <class _Tp, class _Alloc>
void
_List_base<_Tp,_Alloc>::clear()
{
_List_node<_Tp>* __cur = (_List_node<_Tp>*) _M_node->_M_next;
while (__cur != _M_node) {
_List_node<_Tp>* __tmp = __cur;
__cur = (_List_node<_Tp>*) __cur->_M_next;
_Destroy(&__tmp->_M_data);
_M_put_node(__tmp);
}
_M_node->_M_next = _M_node;
_M_node->_M_prev = _M_node;
}
 
template <class _Tp, class _Alloc = allocator<_Tp> >
class list : protected _List_base<_Tp, _Alloc>
{
// concept requirements
__glibcpp_class_requires(_Tp, _SGIAssignableConcept);
 
typedef _List_base<_Tp, _Alloc> _Base;
protected:
typedef void* _Void_pointer;
 
public:
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef _List_node<_Tp> _Node;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
 
typedef typename _Base::allocator_type allocator_type;
allocator_type get_allocator() const { return _Base::get_allocator(); }
 
public:
typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator;
typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
 
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
 
protected:
using _Base::_M_node;
using _Base::_M_put_node;
using _Base::_M_get_node;
 
protected:
_Node* _M_create_node(const _Tp& __x)
{
_Node* __p = _M_get_node();
__STL_TRY {
_Construct(&__p->_M_data, __x);
}
__STL_UNWIND(_M_put_node(__p));
return __p;
}
 
_Node* _M_create_node()
{
_Node* __p = _M_get_node();
__STL_TRY {
_Construct(&__p->_M_data);
}
__STL_UNWIND(_M_put_node(__p));
return __p;
}
 
public:
explicit list(const allocator_type& __a = allocator_type()) : _Base(__a) {}
 
iterator begin() { return (_Node*)(_M_node->_M_next); }
const_iterator begin() const { return (_Node*)(_M_node->_M_next); }
 
iterator end() { return _M_node; }
const_iterator end() const { return _M_node; }
 
reverse_iterator rbegin()
{ return reverse_iterator(end()); }
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(end()); }
 
reverse_iterator rend()
{ return reverse_iterator(begin()); }
const_reverse_iterator rend() const
{ return const_reverse_iterator(begin()); }
 
bool empty() const { return _M_node->_M_next == _M_node; }
size_type size() const {
size_type __result = 0;
distance(begin(), end(), __result);
return __result;
}
size_type max_size() const { return size_type(-1); }
 
reference front() { return *begin(); }
const_reference front() const { return *begin(); }
reference back() { return *(--end()); }
const_reference back() const { return *(--end()); }
 
void swap(list<_Tp, _Alloc>& __x) { std::swap(_M_node, __x._M_node); }
 
iterator insert(iterator __position, const _Tp& __x) {
_Node* __tmp = _M_create_node(__x);
__tmp->_M_next = __position._M_node;
__tmp->_M_prev = __position._M_node->_M_prev;
__position._M_node->_M_prev->_M_next = __tmp;
__position._M_node->_M_prev = __tmp;
return __tmp;
}
iterator insert(iterator __position) { return insert(__position, _Tp()); }
 
// Check whether it's an integral type. If so, it's not an iterator.
template<class _Integer>
void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
__true_type) {
_M_fill_insert(__pos, (size_type) __n, (_Tp) __x);
}
 
template <class _InputIterator>
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type);
 
template <class _InputIterator>
void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_insert_dispatch(__pos, __first, __last, _Integral());
}
 
void insert(iterator __pos, size_type __n, const _Tp& __x)
{ _M_fill_insert(__pos, __n, __x); }
void _M_fill_insert(iterator __pos, size_type __n, const _Tp& __x);
 
void push_front(const _Tp& __x) { insert(begin(), __x); }
void push_front() {insert(begin());}
void push_back(const _Tp& __x) { insert(end(), __x); }
void push_back() {insert(end());}
 
iterator erase(iterator __position) {
_List_node_base* __next_node = __position._M_node->_M_next;
_List_node_base* __prev_node = __position._M_node->_M_prev;
_Node* __n = (_Node*) __position._M_node;
__prev_node->_M_next = __next_node;
__next_node->_M_prev = __prev_node;
_Destroy(&__n->_M_data);
_M_put_node(__n);
return iterator((_Node*) __next_node);
}
iterator erase(iterator __first, iterator __last);
void clear() { _Base::clear(); }
 
void resize(size_type __new_size, const _Tp& __x);
void resize(size_type __new_size) { this->resize(__new_size, _Tp()); }
 
void pop_front() { erase(begin()); }
void pop_back() {
iterator __tmp = end();
erase(--__tmp);
}
list(size_type __n, const _Tp& __value,
const allocator_type& __a = allocator_type())
: _Base(__a)
{ insert(begin(), __n, __value); }
explicit list(size_type __n)
: _Base(allocator_type())
{ insert(begin(), __n, _Tp()); }
 
// We don't need any dispatching tricks here, because insert does all of
// that anyway.
template <class _InputIterator>
list(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type())
: _Base(__a)
{ insert(begin(), __first, __last); }
 
list(const list<_Tp, _Alloc>& __x) : _Base(__x.get_allocator())
{ insert(begin(), __x.begin(), __x.end()); }
 
~list() { }
 
list<_Tp, _Alloc>& operator=(const list<_Tp, _Alloc>& __x);
 
public:
// assign(), a generalized assignment member function. Two
// versions: one that takes a count, and one that takes a range.
// The range version is a member template, so we dispatch on whether
// or not the type is an integer.
 
void assign(size_type __n, const _Tp& __val) { _M_fill_assign(__n, __val); }
 
void _M_fill_assign(size_type __n, const _Tp& __val);
 
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
 
template <class _Integer>
void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ _M_fill_assign((size_type) __n, (_Tp) __val); }
 
template <class _InputIterator>
void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type);
 
protected:
void transfer(iterator __position, iterator __first, iterator __last) {
if (__position != __last) {
// Remove [first, last) from its old position.
__last._M_node->_M_prev->_M_next = __position._M_node;
__first._M_node->_M_prev->_M_next = __last._M_node;
__position._M_node->_M_prev->_M_next = __first._M_node;
 
// Splice [first, last) into its new position.
_List_node_base* __tmp = __position._M_node->_M_prev;
__position._M_node->_M_prev = __last._M_node->_M_prev;
__last._M_node->_M_prev = __first._M_node->_M_prev;
__first._M_node->_M_prev = __tmp;
}
}
 
public:
void splice(iterator __position, list& __x) {
if (!__x.empty())
this->transfer(__position, __x.begin(), __x.end());
}
void splice(iterator __position, list&, iterator __i) {
iterator __j = __i;
++__j;
if (__position == __i || __position == __j) return;
this->transfer(__position, __i, __j);
}
void splice(iterator __position, list&, iterator __first, iterator __last) {
if (__first != __last)
this->transfer(__position, __first, __last);
}
void remove(const _Tp& __value);
void unique();
void merge(list& __x);
void reverse();
void sort();
 
template <class _Predicate> void remove_if(_Predicate);
template <class _BinaryPredicate> void unique(_BinaryPredicate);
template <class _StrictWeakOrdering> void merge(list&, _StrictWeakOrdering);
template <class _StrictWeakOrdering> void sort(_StrictWeakOrdering);
};
 
template <class _Tp, class _Alloc>
inline bool
operator==(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
{
typedef typename list<_Tp,_Alloc>::const_iterator const_iterator;
const_iterator __end1 = __x.end();
const_iterator __end2 = __y.end();
 
const_iterator __i1 = __x.begin();
const_iterator __i2 = __y.begin();
while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2) {
++__i1;
++__i2;
}
return __i1 == __end1 && __i2 == __end2;
}
 
template <class _Tp, class _Alloc>
inline bool operator<(const list<_Tp,_Alloc>& __x,
const list<_Tp,_Alloc>& __y)
{
return lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end());
}
 
template <class _Tp, class _Alloc>
inline bool operator!=(const list<_Tp,_Alloc>& __x,
const list<_Tp,_Alloc>& __y) {
return !(__x == __y);
}
 
template <class _Tp, class _Alloc>
inline bool operator>(const list<_Tp,_Alloc>& __x,
const list<_Tp,_Alloc>& __y) {
return __y < __x;
}
 
template <class _Tp, class _Alloc>
inline bool operator<=(const list<_Tp,_Alloc>& __x,
const list<_Tp,_Alloc>& __y) {
return !(__y < __x);
}
 
template <class _Tp, class _Alloc>
inline bool operator>=(const list<_Tp,_Alloc>& __x,
const list<_Tp,_Alloc>& __y) {
return !(__x < __y);
}
 
template <class _Tp, class _Alloc>
inline void
swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
{
__x.swap(__y);
}
 
template <class _Tp, class _Alloc> template <class _InputIter>
void
list<_Tp, _Alloc>::_M_insert_dispatch(iterator __position,
_InputIter __first, _InputIter __last,
__false_type)
{
for ( ; __first != __last; ++__first)
insert(__position, *__first);
}
 
template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::_M_fill_insert(iterator __position,
size_type __n, const _Tp& __x)
{
for ( ; __n > 0; --__n)
insert(__position, __x);
}
 
template <class _Tp, class _Alloc>
typename list<_Tp,_Alloc>::iterator list<_Tp, _Alloc>::erase(iterator __first,
iterator __last)
{
while (__first != __last)
erase(__first++);
return __last;
}
 
template <class _Tp, class _Alloc>
void list<_Tp, _Alloc>::resize(size_type __new_size, const _Tp& __x)
{
iterator __i = begin();
size_type __len = 0;
for ( ; __i != end() && __len < __new_size; ++__i, ++__len)
;
if (__len == __new_size)
erase(__i, end());
else // __i == end()
insert(end(), __new_size - __len, __x);
}
 
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>& list<_Tp, _Alloc>::operator=(const list<_Tp, _Alloc>& __x)
{
if (this != &__x) {
iterator __first1 = begin();
iterator __last1 = end();
const_iterator __first2 = __x.begin();
const_iterator __last2 = __x.end();
while (__first1 != __last1 && __first2 != __last2)
*__first1++ = *__first2++;
if (__first2 == __last2)
erase(__first1, __last1);
else
insert(__last1, __first2, __last2);
}
return *this;
}
 
template <class _Tp, class _Alloc>
void list<_Tp, _Alloc>::_M_fill_assign(size_type __n, const _Tp& __val) {
iterator __i = begin();
for ( ; __i != end() && __n > 0; ++__i, --__n)
*__i = __val;
if (__n > 0)
insert(end(), __n, __val);
else
erase(__i, end());
}
 
template <class _Tp, class _Alloc> template <class _InputIter>
void
list<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first2, _InputIter __last2,
__false_type)
{
iterator __first1 = begin();
iterator __last1 = end();
for ( ; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
*__first1 = *__first2;
if (__first2 == __last2)
erase(__first1, __last1);
else
insert(__last1, __first2, __last2);
}
 
template <class _Tp, class _Alloc>
void list<_Tp, _Alloc>::remove(const _Tp& __value)
{
iterator __first = begin();
iterator __last = end();
while (__first != __last) {
iterator __next = __first;
++__next;
if (*__first == __value) erase(__first);
__first = __next;
}
}
 
template <class _Tp, class _Alloc>
void list<_Tp, _Alloc>::unique()
{
iterator __first = begin();
iterator __last = end();
if (__first == __last) return;
iterator __next = __first;
while (++__next != __last) {
if (*__first == *__next)
erase(__next);
else
__first = __next;
__next = __first;
}
}
 
template <class _Tp, class _Alloc>
void list<_Tp, _Alloc>::merge(list<_Tp, _Alloc>& __x)
{
iterator __first1 = begin();
iterator __last1 = end();
iterator __first2 = __x.begin();
iterator __last2 = __x.end();
while (__first1 != __last1 && __first2 != __last2)
if (*__first2 < *__first1) {
iterator __next = __first2;
transfer(__first1, __first2, ++__next);
__first2 = __next;
}
else
++__first1;
if (__first2 != __last2) transfer(__last1, __first2, __last2);
}
 
inline void __List_base_reverse(_List_node_base* __p)
{
_List_node_base* __tmp = __p;
do {
std::swap(__tmp->_M_next, __tmp->_M_prev);
__tmp = __tmp->_M_prev; // Old next node is now prev.
} while (__tmp != __p);
}
 
template <class _Tp, class _Alloc>
inline void list<_Tp, _Alloc>::reverse()
{
__List_base_reverse(this->_M_node);
}
 
template <class _Tp, class _Alloc>
void list<_Tp, _Alloc>::sort()
{
// Do nothing if the list has length 0 or 1.
if (_M_node->_M_next != _M_node && _M_node->_M_next->_M_next != _M_node) {
list<_Tp, _Alloc> __carry;
list<_Tp, _Alloc> __counter[64];
int __fill = 0;
while (!empty()) {
__carry.splice(__carry.begin(), *this, begin());
int __i = 0;
while(__i < __fill && !__counter[__i].empty()) {
__counter[__i].merge(__carry);
__carry.swap(__counter[__i++]);
}
__carry.swap(__counter[__i]);
if (__i == __fill) ++__fill;
}
 
for (int __i = 1; __i < __fill; ++__i)
__counter[__i].merge(__counter[__i-1]);
swap(__counter[__fill-1]);
}
}
 
template <class _Tp, class _Alloc> template <class _Predicate>
void list<_Tp, _Alloc>::remove_if(_Predicate __pred)
{
iterator __first = begin();
iterator __last = end();
while (__first != __last) {
iterator __next = __first;
++__next;
if (__pred(*__first)) erase(__first);
__first = __next;
}
}
 
template <class _Tp, class _Alloc> template <class _BinaryPredicate>
void list<_Tp, _Alloc>::unique(_BinaryPredicate __binary_pred)
{
iterator __first = begin();
iterator __last = end();
if (__first == __last) return;
iterator __next = __first;
while (++__next != __last) {
if (__binary_pred(*__first, *__next))
erase(__next);
else
__first = __next;
__next = __first;
}
}
 
template <class _Tp, class _Alloc> template <class _StrictWeakOrdering>
void list<_Tp, _Alloc>::merge(list<_Tp, _Alloc>& __x,
_StrictWeakOrdering __comp)
{
iterator __first1 = begin();
iterator __last1 = end();
iterator __first2 = __x.begin();
iterator __last2 = __x.end();
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first2, *__first1)) {
iterator __next = __first2;
transfer(__first1, __first2, ++__next);
__first2 = __next;
}
else
++__first1;
if (__first2 != __last2) transfer(__last1, __first2, __last2);
}
 
template <class _Tp, class _Alloc> template <class _StrictWeakOrdering>
void list<_Tp, _Alloc>::sort(_StrictWeakOrdering __comp)
{
// Do nothing if the list has length 0 or 1.
if (_M_node->_M_next != _M_node && _M_node->_M_next->_M_next != _M_node) {
list<_Tp, _Alloc> __carry;
list<_Tp, _Alloc> __counter[64];
int __fill = 0;
while (!empty()) {
__carry.splice(__carry.begin(), *this, begin());
int __i = 0;
while(__i < __fill && !__counter[__i].empty()) {
__counter[__i].merge(__carry, __comp);
__carry.swap(__counter[__i++]);
}
__carry.swap(__counter[__i]);
if (__i == __fill) ++__fill;
}
 
for (int __i = 1; __i < __fill; ++__i)
__counter[__i].merge(__counter[__i-1], __comp);
swap(__counter[__fill-1]);
}
}
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_LIST_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_map.h
0,0 → 1,231
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef _CPP_BITS_STL_MAP_H
#define _CPP_BITS_STL_MAP_H 1
 
#include <bits/concept_check.h>
 
namespace std
{
 
template <class _Key, class _Tp, class _Compare = less<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
class map
{
// concept requirements
__glibcpp_class_requires(_Tp, _SGIAssignableConcept);
__glibcpp_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept);
 
public:
// typedefs:
typedef _Key key_type;
typedef _Tp data_type;
typedef _Tp mapped_type;
typedef pair<const _Key, _Tp> value_type;
typedef _Compare key_compare;
class value_compare
: public binary_function<value_type, value_type, bool> {
friend class map<_Key,_Tp,_Compare,_Alloc>;
protected :
_Compare comp;
value_compare(_Compare __c) : comp(__c) {}
public:
bool operator()(const value_type& __x, const value_type& __y) const {
return comp(__x.first, __y.first);
}
};
 
private:
typedef _Rb_tree<key_type, value_type,
_Select1st<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing map
public:
typedef typename _Rep_type::pointer pointer;
typedef typename _Rep_type::const_pointer const_pointer;
typedef typename _Rep_type::reference reference;
typedef typename _Rep_type::const_reference const_reference;
typedef typename _Rep_type::iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::reverse_iterator reverse_iterator;
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
typedef typename _Rep_type::size_type size_type;
typedef typename _Rep_type::difference_type difference_type;
typedef typename _Rep_type::allocator_type allocator_type;
 
// allocation/deallocation
 
map() : _M_t(_Compare(), allocator_type()) {}
explicit map(const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) {}
 
template <class _InputIterator>
map(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_unique(__first, __last); }
 
template <class _InputIterator>
map(_InputIterator __first, _InputIterator __last, const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
map(const map<_Key,_Tp,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
 
map<_Key,_Tp,_Compare,_Alloc>&
operator=(const map<_Key, _Tp, _Compare, _Alloc>& __x)
{
_M_t = __x._M_t;
return *this;
}
 
// accessors:
 
key_compare key_comp() const { return _M_t.key_comp(); }
value_compare value_comp() const { return value_compare(_M_t.key_comp()); }
allocator_type get_allocator() const { return _M_t.get_allocator(); }
 
iterator begin() { return _M_t.begin(); }
const_iterator begin() const { return _M_t.begin(); }
iterator end() { return _M_t.end(); }
const_iterator end() const { return _M_t.end(); }
reverse_iterator rbegin() { return _M_t.rbegin(); }
const_reverse_iterator rbegin() const { return _M_t.rbegin(); }
reverse_iterator rend() { return _M_t.rend(); }
const_reverse_iterator rend() const { return _M_t.rend(); }
bool empty() const { return _M_t.empty(); }
size_type size() const { return _M_t.size(); }
size_type max_size() const { return _M_t.max_size(); }
_Tp& operator[](const key_type& __k) {
iterator __i = lower_bound(__k);
// __i->first is greater than or equivalent to __k.
if (__i == end() || key_comp()(__k, (*__i).first))
__i = insert(__i, value_type(__k, _Tp()));
return (*__i).second;
}
void swap(map<_Key,_Tp,_Compare,_Alloc>& __x) { _M_t.swap(__x._M_t); }
 
// insert/erase
 
pair<iterator,bool> insert(const value_type& __x)
{ return _M_t.insert_unique(__x); }
iterator insert(iterator position, const value_type& __x)
{ return _M_t.insert_unique(position, __x); }
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_unique(__first, __last);
}
 
void erase(iterator __position) { _M_t.erase(__position); }
size_type erase(const key_type& __x) { return _M_t.erase(__x); }
void erase(iterator __first, iterator __last)
{ _M_t.erase(__first, __last); }
void clear() { _M_t.clear(); }
 
// map operations:
 
iterator find(const key_type& __x) { return _M_t.find(__x); }
const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
size_type count(const key_type& __x) const {
return _M_t.find(__x) == _M_t.end() ? 0 : 1;
}
iterator lower_bound(const key_type& __x) {return _M_t.lower_bound(__x); }
const_iterator lower_bound(const key_type& __x) const {
return _M_t.lower_bound(__x);
}
iterator upper_bound(const key_type& __x) {return _M_t.upper_bound(__x); }
const_iterator upper_bound(const key_type& __x) const {
return _M_t.upper_bound(__x);
}
pair<iterator,iterator> equal_range(const key_type& __x) {
return _M_t.equal_range(__x);
}
pair<const_iterator,const_iterator> equal_range(const key_type& __x) const {
return _M_t.equal_range(__x);
}
 
template <class _K1, class _T1, class _C1, class _A1>
friend bool operator== (const map<_K1, _T1, _C1, _A1>&,
const map<_K1, _T1, _C1, _A1>&);
template <class _K1, class _T1, class _C1, class _A1>
friend bool operator< (const map<_K1, _T1, _C1, _A1>&,
const map<_K1, _T1, _C1, _A1>&);
};
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator==(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y) {
return __x._M_t == __y._M_t;
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator<(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y) {
return __x._M_t < __y._M_t;
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator!=(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y) {
return !(__x == __y);
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator>(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y) {
return __y < __x;
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator<=(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y) {
return !(__y < __x);
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator>=(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y) {
return !(__x < __y);
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline void swap(map<_Key,_Tp,_Compare,_Alloc>& __x,
map<_Key,_Tp,_Compare,_Alloc>& __y) {
__x.swap(__y);
}
 
} // namespace std
 
#endif /* _CPP_BITS_STL_MAP_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_multimap.h
0,0 → 1,235
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_MULTIMAP_H
#define __SGI_STL_INTERNAL_MULTIMAP_H
 
#include <bits/concept_check.h>
 
namespace std
{
 
// Forward declaration of operators < and ==, needed for friend declaration.
 
template <class _Key, class _Tp,
class _Compare = less<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
class multimap;
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator==(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y);
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y);
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
class multimap
{
// concept requirements
__glibcpp_class_requires(_Tp, _SGIAssignableConcept);
__glibcpp_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept);
 
public:
 
// typedefs:
 
typedef _Key key_type;
typedef _Tp data_type;
typedef _Tp mapped_type;
typedef pair<const _Key, _Tp> value_type;
typedef _Compare key_compare;
 
class value_compare : public binary_function<value_type, value_type, bool> {
friend class multimap<_Key,_Tp,_Compare,_Alloc>;
protected:
_Compare comp;
value_compare(_Compare __c) : comp(__c) {}
public:
bool operator()(const value_type& __x, const value_type& __y) const {
return comp(__x.first, __y.first);
}
};
 
private:
typedef _Rb_tree<key_type, value_type,
_Select1st<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing multimap
public:
typedef typename _Rep_type::pointer pointer;
typedef typename _Rep_type::const_pointer const_pointer;
typedef typename _Rep_type::reference reference;
typedef typename _Rep_type::const_reference const_reference;
typedef typename _Rep_type::iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::reverse_iterator reverse_iterator;
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
typedef typename _Rep_type::size_type size_type;
typedef typename _Rep_type::difference_type difference_type;
typedef typename _Rep_type::allocator_type allocator_type;
 
// allocation/deallocation
 
multimap() : _M_t(_Compare(), allocator_type()) { }
explicit multimap(const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { }
 
template <class _InputIterator>
multimap(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_equal(__first, __last); }
 
template <class _InputIterator>
multimap(_InputIterator __first, _InputIterator __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
multimap(const multimap<_Key,_Tp,_Compare,_Alloc>& __x) : _M_t(__x._M_t) { }
 
multimap<_Key,_Tp,_Compare,_Alloc>&
operator=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x) {
_M_t = __x._M_t;
return *this;
}
 
// accessors:
 
key_compare key_comp() const { return _M_t.key_comp(); }
value_compare value_comp() const { return value_compare(_M_t.key_comp()); }
allocator_type get_allocator() const { return _M_t.get_allocator(); }
 
iterator begin() { return _M_t.begin(); }
const_iterator begin() const { return _M_t.begin(); }
iterator end() { return _M_t.end(); }
const_iterator end() const { return _M_t.end(); }
reverse_iterator rbegin() { return _M_t.rbegin(); }
const_reverse_iterator rbegin() const { return _M_t.rbegin(); }
reverse_iterator rend() { return _M_t.rend(); }
const_reverse_iterator rend() const { return _M_t.rend(); }
bool empty() const { return _M_t.empty(); }
size_type size() const { return _M_t.size(); }
size_type max_size() const { return _M_t.max_size(); }
void swap(multimap<_Key,_Tp,_Compare,_Alloc>& __x) { _M_t.swap(__x._M_t); }
 
// insert/erase
 
iterator insert(const value_type& __x) { return _M_t.insert_equal(__x); }
iterator insert(iterator __position, const value_type& __x) {
return _M_t.insert_equal(__position, __x);
}
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_equal(__first, __last);
}
void erase(iterator __position) { _M_t.erase(__position); }
size_type erase(const key_type& __x) { return _M_t.erase(__x); }
void erase(iterator __first, iterator __last)
{ _M_t.erase(__first, __last); }
void clear() { _M_t.clear(); }
 
// multimap operations:
 
iterator find(const key_type& __x) { return _M_t.find(__x); }
const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
size_type count(const key_type& __x) const { return _M_t.count(__x); }
iterator lower_bound(const key_type& __x) {return _M_t.lower_bound(__x); }
const_iterator lower_bound(const key_type& __x) const {
return _M_t.lower_bound(__x);
}
iterator upper_bound(const key_type& __x) {return _M_t.upper_bound(__x); }
const_iterator upper_bound(const key_type& __x) const {
return _M_t.upper_bound(__x);
}
pair<iterator,iterator> equal_range(const key_type& __x) {
return _M_t.equal_range(__x);
}
pair<const_iterator,const_iterator> equal_range(const key_type& __x) const {
return _M_t.equal_range(__x);
}
 
template <class _K1, class _T1, class _C1, class _A1>
friend bool operator== (const multimap<_K1, _T1, _C1, _A1>&,
const multimap<_K1, _T1, _C1, _A1>&);
template <class _K1, class _T1, class _C1, class _A1>
friend bool operator< (const multimap<_K1, _T1, _C1, _A1>&,
const multimap<_K1, _T1, _C1, _A1>&);
};
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator==(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
return __x._M_t == __y._M_t;
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
return __x._M_t < __y._M_t;
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator!=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
return !(__x == __y);
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator>(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
return __y < __x;
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator<=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
return !(__y < __x);
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator>=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
return !(__x < __y);
}
 
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline void swap(multimap<_Key,_Tp,_Compare,_Alloc>& __x,
multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
__x.swap(__y);
}
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_MULTIMAP_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_multiset.h
0,0 → 1,247
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_MULTISET_H
#define __SGI_STL_INTERNAL_MULTISET_H
 
#include <bits/concept_check.h>
 
namespace std
{
 
// Forward declaration of operators < and ==, needed for friend declaration.
 
template <class _Key, class _Compare = less<_Key>,
class _Alloc = allocator<_Key> >
class multiset;
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator==(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y);
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator<(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y);
 
template <class _Key, class _Compare, class _Alloc>
class multiset
{
// concept requirements
__glibcpp_class_requires(_Key, _SGIAssignableConcept);
__glibcpp_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept);
 
public:
 
// typedefs:
 
typedef _Key key_type;
typedef _Key value_type;
typedef _Compare key_compare;
typedef _Compare value_compare;
private:
typedef _Rb_tree<key_type, value_type,
_Identity<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing multiset
public:
typedef typename _Rep_type::const_pointer pointer;
typedef typename _Rep_type::const_pointer const_pointer;
typedef typename _Rep_type::const_reference reference;
typedef typename _Rep_type::const_reference const_reference;
typedef typename _Rep_type::const_iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
typedef typename _Rep_type::size_type size_type;
typedef typename _Rep_type::difference_type difference_type;
typedef typename _Rep_type::allocator_type allocator_type;
 
// allocation/deallocation
 
multiset() : _M_t(_Compare(), allocator_type()) {}
explicit multiset(const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) {}
 
template <class _InputIterator>
multiset(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_equal(__first, __last); }
 
template <class _InputIterator>
multiset(_InputIterator __first, _InputIterator __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
 
multiset(const multiset<_Key,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
 
multiset<_Key,_Compare,_Alloc>&
operator=(const multiset<_Key,_Compare,_Alloc>& __x) {
_M_t = __x._M_t;
return *this;
}
 
// accessors:
 
key_compare key_comp() const { return _M_t.key_comp(); }
value_compare value_comp() const { return _M_t.key_comp(); }
allocator_type get_allocator() const { return _M_t.get_allocator(); }
 
iterator begin() const { return _M_t.begin(); }
iterator end() const { return _M_t.end(); }
reverse_iterator rbegin() const { return _M_t.rbegin(); }
reverse_iterator rend() const { return _M_t.rend(); }
bool empty() const { return _M_t.empty(); }
size_type size() const { return _M_t.size(); }
size_type max_size() const { return _M_t.max_size(); }
void swap(multiset<_Key,_Compare,_Alloc>& __x) { _M_t.swap(__x._M_t); }
 
// insert/erase
iterator insert(const value_type& __x) {
return _M_t.insert_equal(__x);
}
iterator insert(iterator __position, const value_type& __x) {
typedef typename _Rep_type::iterator _Rep_iterator;
return _M_t.insert_equal((_Rep_iterator&)__position, __x);
}
 
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_equal(__first, __last);
}
void erase(iterator __position) {
typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__position);
}
size_type erase(const key_type& __x) {
return _M_t.erase(__x);
}
void erase(iterator __first, iterator __last) {
typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last);
}
void clear() { _M_t.clear(); }
 
// multiset operations:
 
size_type count(const key_type& __x) const { return _M_t.count(__x); }
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//214. set::find() missing const overload
iterator find(const key_type& __x) { return _M_t.find(__x); }
const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
iterator lower_bound(const key_type& __x) {
return _M_t.lower_bound(__x);
}
const_iterator lower_bound(const key_type& __x) const {
return _M_t.lower_bound(__x);
}
iterator upper_bound(const key_type& __x) {
return _M_t.upper_bound(__x);
}
const_iterator upper_bound(const key_type& __x) const {
return _M_t.upper_bound(__x);
}
pair<iterator,iterator> equal_range(const key_type& __x) {
return _M_t.equal_range(__x);
}
pair<const_iterator,const_iterator> equal_range(const key_type& __x) const {
return _M_t.equal_range(__x);
}
#else
iterator find(const key_type& __x) const { return _M_t.find(__x); }
iterator lower_bound(const key_type& __x) const {
return _M_t.lower_bound(__x);
}
iterator upper_bound(const key_type& __x) const {
return _M_t.upper_bound(__x);
}
pair<iterator,iterator> equal_range(const key_type& __x) const {
return _M_t.equal_range(__x);
}
#endif
 
template <class _K1, class _C1, class _A1>
friend bool operator== (const multiset<_K1,_C1,_A1>&,
const multiset<_K1,_C1,_A1>&);
template <class _K1, class _C1, class _A1>
friend bool operator< (const multiset<_K1,_C1,_A1>&,
const multiset<_K1,_C1,_A1>&);
};
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator==(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) {
return __x._M_t == __y._M_t;
}
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator<(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) {
return __x._M_t < __y._M_t;
}
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator!=(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) {
return !(__x == __y);
}
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator>(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) {
return __y < __x;
}
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator<=(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) {
return !(__y < __x);
}
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator>=(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) {
return !(__x < __y);
}
 
template <class _Key, class _Compare, class _Alloc>
inline void swap(multiset<_Key,_Compare,_Alloc>& __x,
multiset<_Key,_Compare,_Alloc>& __y) {
__x.swap(__y);
}
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_MULTISET_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_numeric.h
0,0 → 1,279
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
 
#ifndef _CPP_BITS_STL_NUMERIC_H
#define _CPP_BITS_STL_NUMERIC_H 1
 
namespace std
{
 
template <class _InputIterator, class _Tp>
_Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
 
for ( ; __first != __last; ++__first)
__init = __init + *__first;
return __init;
}
 
template <class _InputIterator, class _Tp, class _BinaryOperation>
_Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
_BinaryOperation __binary_op)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
 
for ( ; __first != __last; ++__first)
__init = __binary_op(__init, *__first);
return __init;
}
 
template <class _InputIterator1, class _InputIterator2, class _Tp>
_Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _Tp __init)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>);
 
for ( ; __first1 != __last1; ++__first1, ++__first2)
__init = __init + (*__first1 * *__first2);
return __init;
}
 
template <class _InputIterator1, class _InputIterator2, class _Tp,
class _BinaryOperation1, class _BinaryOperation2>
_Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _Tp __init,
_BinaryOperation1 __binary_op1,
_BinaryOperation2 __binary_op2)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>);
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>);
 
for ( ; __first1 != __last1; ++__first1, ++__first2)
__init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
return __init;
}
 
template <class _InputIterator, class _OutputIterator, class _Tp>
_OutputIterator
__partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _Tp*)
{
_Tp __value = *__first;
while (++__first != __last) {
__value = __value + *__first;
*++__result = __value;
}
return ++__result;
}
 
template <class _InputIterator, class _OutputIterator>
_OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_InputIterator>::value_type>);
 
if (__first == __last) return __result;
*__result = *__first;
return __partial_sum(__first, __last, __result, __value_type(__first));
}
 
template <class _InputIterator, class _OutputIterator, class _Tp,
class _BinaryOperation>
_OutputIterator
__partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _Tp*, _BinaryOperation __binary_op)
{
_Tp __value = *__first;
while (++__first != __last) {
__value = __binary_op(__value, *__first);
*++__result = __value;
}
return ++__result;
}
 
template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
_OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOperation __binary_op)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_InputIterator>::value_type>);
 
if (__first == __last) return __result;
*__result = *__first;
return __partial_sum(__first, __last, __result, __value_type(__first),
__binary_op);
}
 
template <class _InputIterator, class _OutputIterator, class _Tp>
_OutputIterator
__adjacent_difference(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _Tp*)
{
_Tp __value = *__first;
while (++__first != __last) {
_Tp __tmp = *__first;
*++__result = __tmp - __value;
__value = __tmp;
}
return ++__result;
}
 
template <class _InputIterator, class _OutputIterator>
_OutputIterator
adjacent_difference(_InputIterator __first,
_InputIterator __last, _OutputIterator __result)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_InputIterator>::value_type>);
 
if (__first == __last) return __result;
*__result = *__first;
return __adjacent_difference(__first, __last, __result,
__value_type(__first));
}
 
template <class _InputIterator, class _OutputIterator, class _Tp,
class _BinaryOperation>
_OutputIterator
__adjacent_difference(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _Tp*,
_BinaryOperation __binary_op) {
_Tp __value = *__first;
while (++__first != __last) {
_Tp __tmp = *__first;
*++__result = __binary_op(__tmp, __value);
__value = __tmp;
}
return ++__result;
}
 
template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
_OutputIterator
adjacent_difference(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOperation __binary_op)
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_InputIterator>::value_type>);
 
if (__first == __last) return __result;
*__result = *__first;
return __adjacent_difference(__first, __last, __result,
__value_type(__first),
__binary_op);
}
 
// Returns __x ** __n, where __n >= 0. _Note that "multiplication"
// is required to be associative, but not necessarily commutative.
 
template <class _Tp, class _Integer, class _MonoidOperation>
_Tp __power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
{
if (__n == 0)
return identity_element(__monoid_op);
else {
while ((__n & 1) == 0) {
__n >>= 1;
__x = __monoid_op(__x, __x);
}
 
_Tp __result = __x;
__n >>= 1;
while (__n != 0) {
__x = __monoid_op(__x, __x);
if ((__n & 1) != 0)
__result = __monoid_op(__result, __x);
__n >>= 1;
}
return __result;
}
}
 
template <class _Tp, class _Integer>
inline _Tp __power(_Tp __x, _Integer __n)
{
return __power(__x, __n, multiplies<_Tp>());
}
 
// Alias for the internal name __power. Note that power is an extension,
// not part of the C++ standard.
 
template <class _Tp, class _Integer, class _MonoidOperation>
inline _Tp power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
{
return __power(__x, __n, __monoid_op);
}
 
template <class _Tp, class _Integer>
inline _Tp power(_Tp __x, _Integer __n)
{
return __power(__x, __n);
}
 
// iota is not part of the C++ standard. It is an extension.
 
template <class _ForwardIter, class _Tp>
void
iota(_ForwardIter __first, _ForwardIter __last, _Tp __value)
{
// concept requirements
__glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
__glibcpp_function_requires(_ConvertibleConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
 
while (__first != __last)
*__first++ = __value++;
}
 
} // namespace std
 
#endif /* _CPP_BITS_STL_NUMERIC_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_pair.h
0,0 → 1,106
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_PAIR_H
#define __SGI_STL_INTERNAL_PAIR_H
 
namespace std
{
 
template <class _T1, class _T2>
struct pair {
typedef _T1 first_type;
typedef _T2 second_type;
 
_T1 first;
_T2 second;
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//265. std::pair::pair() effects overly restrictive
pair() : first(), second() {}
#else
pair() : first(_T1()), second(_T2()) {}
#endif
pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {}
 
template <class _U1, class _U2>
pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
};
 
template <class _T1, class _T2>
inline bool operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{
return __x.first == __y.first && __x.second == __y.second;
}
 
template <class _T1, class _T2>
inline bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{
return __x.first < __y.first ||
(!(__y.first < __x.first) && __x.second < __y.second);
}
 
template <class _T1, class _T2>
inline bool operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
return !(__x == __y);
}
 
template <class _T1, class _T2>
inline bool operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
return __y < __x;
}
 
template <class _T1, class _T2>
inline bool operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
return !(__y < __x);
}
 
template <class _T1, class _T2>
inline bool operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
return !(__x < __y);
}
 
template <class _T1, class _T2>
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//181. make_pair() unintended behavior
inline pair<_T1, _T2> make_pair(_T1 __x, _T2 __y)
#else
inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y)
#endif
{
return pair<_T1, _T2>(__x, __y);
}
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_PAIR_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_pthread_alloc.h
0,0 → 1,26
/*
* Copyright (c) 1996-1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BITS_STL_PTHREAD_ALLOC_H
#define _CPP_BITS_STL_PTHREAD_ALLOC_H 1
 
#include <bits/pthread_allocimpl.h>
 
using std::_Pthread_alloc_template;
using std::pthread_alloc;
 
#endif /* _CPP_BITS_STL_PTHREAD_ALLOC_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_queue.h
0,0 → 1,198
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_QUEUE_H
#define __SGI_STL_INTERNAL_QUEUE_H
 
#include <bits/concept_check.h>
 
namespace std
{
 
// Forward declarations of operators < and ==, needed for friend declaration.
 
template <class _Tp,
class _Sequence = deque<_Tp> >
class queue;
 
template <class _Tp, class _Seq>
inline bool operator==(const queue<_Tp, _Seq>&, const queue<_Tp, _Seq>&);
 
template <class _Tp, class _Seq>
inline bool operator<(const queue<_Tp, _Seq>&, const queue<_Tp, _Seq>&);
 
 
template <class _Tp, class _Sequence>
class queue
{
// concept requirements
__glibcpp_class_requires(_Tp, _SGIAssignableConcept);
__glibcpp_class_requires(_Sequence, _FrontInsertionSequenceConcept);
__glibcpp_class_requires(_Sequence, _BackInsertionSequenceConcept);
typedef typename _Sequence::value_type _Sequence_value_type;
__glibcpp_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept);
 
template <class _Tp1, class _Seq1>
friend bool operator== (const queue<_Tp1, _Seq1>&,
const queue<_Tp1, _Seq1>&);
template <class _Tp1, class _Seq1>
friend bool operator< (const queue<_Tp1, _Seq1>&,
const queue<_Tp1, _Seq1>&);
public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type;
 
typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference;
protected:
_Sequence c;
public:
explicit queue(const _Sequence& __c = _Sequence()) : c(__c) {}
 
bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
reference front() { return c.front(); }
const_reference front() const { return c.front(); }
reference back() { return c.back(); }
const_reference back() const { return c.back(); }
void push(const value_type& __x) { c.push_back(__x); }
void pop() { c.pop_front(); }
};
 
template <class _Tp, class _Sequence>
bool
operator==(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return __x.c == __y.c;
}
 
template <class _Tp, class _Sequence>
bool
operator<(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return __x.c < __y.c;
}
 
template <class _Tp, class _Sequence>
bool
operator!=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return !(__x == __y);
}
 
template <class _Tp, class _Sequence>
bool
operator>(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return __y < __x;
}
 
template <class _Tp, class _Sequence>
bool
operator<=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return !(__y < __x);
}
 
template <class _Tp, class _Sequence>
bool
operator>=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return !(__x < __y);
}
 
template <class _Tp,
class _Sequence = vector<_Tp>,
class _Compare = less<typename _Sequence::value_type> >
class priority_queue
{
// concept requirements
__glibcpp_class_requires(_Tp, _SGIAssignableConcept);
__glibcpp_class_requires(_Sequence, _SequenceConcept);
__glibcpp_class_requires(_Sequence, _RandomAccessContainerConcept);
typedef typename _Sequence::value_type _Sequence_value_type;
__glibcpp_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept);
__glibcpp_class_requires4(_Compare, bool, _Tp, _Tp, _BinaryFunctionConcept);
 
public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type;
 
typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference;
protected:
_Sequence c;
_Compare comp;
public:
explicit priority_queue(const _Compare& __x = _Compare(),
const _Sequence& __s = _Sequence())
: c(__s), comp(__x)
{ make_heap(c.begin(), c.end(), comp); }
 
template <class _InputIterator>
priority_queue(_InputIterator __first, _InputIterator __last,
const _Compare& __x = _Compare(),
const _Sequence& __s = _Sequence())
: c(__s), comp(__x)
{
c.insert(c.end(), __first, __last);
make_heap(c.begin(), c.end(), comp);
}
 
bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
const_reference top() const { return c.front(); }
void push(const value_type& __x) {
__STL_TRY {
c.push_back(__x);
push_heap(c.begin(), c.end(), comp);
}
__STL_UNWIND(c.clear());
}
void pop() {
__STL_TRY {
pop_heap(c.begin(), c.end(), comp);
c.pop_back();
}
__STL_UNWIND(c.clear());
}
};
 
// no equality is provided
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_QUEUE_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_raw_storage_iter.h
0,0 → 1,72
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H
#define _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H 1
 
namespace std
{
 
template <class _ForwardIterator, class _Tp>
class raw_storage_iterator {
protected:
_ForwardIterator _M_iter;
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
 
explicit raw_storage_iterator(_ForwardIterator __x) : _M_iter(__x) {}
raw_storage_iterator& operator*() { return *this; }
raw_storage_iterator& operator=(const _Tp& __element) {
construct(&*_M_iter, __element);
return *this;
}
raw_storage_iterator<_ForwardIterator, _Tp>& operator++() {
++_M_iter;
return *this;
}
raw_storage_iterator<_ForwardIterator, _Tp> operator++(int) {
raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
++_M_iter;
return __tmp;
}
};
 
 
} // namespace std
 
#endif /* _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_relops.h
0,0 → 1,76
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Copyright (c) 1996,1997
* Silicon Graphics
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
/**** libstdc++-v3 note: Inclusion of this file has been removed from
* all of the other STL headers for safety reasons, except std_utility.h.
* For more information, see the thread of about twenty messages starting
* with <URL:http://gcc.gnu.org/ml/libstdc++/2001-01/msg00223.html>, or the
* FAQ at <URL:http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#4_4>.
*
* Short summary: the rel_ops operators cannot be made to play nice.
* Don't use them.
*/
 
#ifndef _CPP_BITS_STL_RELOPS_H
#define _CPP_BITS_STL_RELOPS_H 1
 
namespace std
{
namespace rel_ops
{
 
template <class _Tp>
inline bool operator!=(const _Tp& __x, const _Tp& __y) {
return !(__x == __y);
}
 
template <class _Tp>
inline bool operator>(const _Tp& __x, const _Tp& __y) {
return __y < __x;
}
 
template <class _Tp>
inline bool operator<=(const _Tp& __x, const _Tp& __y) {
return !(__y < __x);
}
 
template <class _Tp>
inline bool operator>=(const _Tp& __x, const _Tp& __y) {
return !(__x < __y);
}
 
} // namespace rel_ops
} // namespace std
 
#endif /* _CPP_BITS_STL_RELOPS_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_set.h
0,0 → 1,244
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_SET_H
#define __SGI_STL_INTERNAL_SET_H
 
#include <bits/concept_check.h>
 
namespace std
{
 
// Forward declarations of operators < and ==, needed for friend declaration.
 
template <class _Key, class _Compare = less<_Key>,
class _Alloc = allocator<_Key> >
class set;
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator==(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y);
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator<(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y);
 
 
template <class _Key, class _Compare, class _Alloc>
class set
{
// concept requirements
__glibcpp_class_requires(_Key, _SGIAssignableConcept);
__glibcpp_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept);
 
public:
// typedefs:
typedef _Key key_type;
typedef _Key value_type;
typedef _Compare key_compare;
typedef _Compare value_compare;
private:
typedef _Rb_tree<key_type, value_type,
_Identity<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing set
public:
typedef typename _Rep_type::const_pointer pointer;
typedef typename _Rep_type::const_pointer const_pointer;
typedef typename _Rep_type::const_reference reference;
typedef typename _Rep_type::const_reference const_reference;
typedef typename _Rep_type::const_iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
typedef typename _Rep_type::size_type size_type;
typedef typename _Rep_type::difference_type difference_type;
typedef typename _Rep_type::allocator_type allocator_type;
 
// allocation/deallocation
 
set() : _M_t(_Compare(), allocator_type()) {}
explicit set(const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) {}
 
template <class _InputIterator>
set(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_unique(__first, __last); }
 
template <class _InputIterator>
set(_InputIterator __first, _InputIterator __last, const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
 
set(const set<_Key,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
set<_Key,_Compare,_Alloc>& operator=(const set<_Key, _Compare, _Alloc>& __x)
{
_M_t = __x._M_t;
return *this;
}
 
// accessors:
 
key_compare key_comp() const { return _M_t.key_comp(); }
value_compare value_comp() const { return _M_t.key_comp(); }
allocator_type get_allocator() const { return _M_t.get_allocator(); }
 
iterator begin() const { return _M_t.begin(); }
iterator end() const { return _M_t.end(); }
reverse_iterator rbegin() const { return _M_t.rbegin(); }
reverse_iterator rend() const { return _M_t.rend(); }
bool empty() const { return _M_t.empty(); }
size_type size() const { return _M_t.size(); }
size_type max_size() const { return _M_t.max_size(); }
void swap(set<_Key,_Compare,_Alloc>& __x) { _M_t.swap(__x._M_t); }
 
// insert/erase
pair<iterator,bool> insert(const value_type& __x) {
pair<typename _Rep_type::iterator, bool> __p = _M_t.insert_unique(__x);
return pair<iterator, bool>(__p.first, __p.second);
}
iterator insert(iterator __position, const value_type& __x) {
typedef typename _Rep_type::iterator _Rep_iterator;
return _M_t.insert_unique((_Rep_iterator&)__position, __x);
}
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_unique(__first, __last);
}
void erase(iterator __position) {
typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__position);
}
size_type erase(const key_type& __x) {
return _M_t.erase(__x);
}
void erase(iterator __first, iterator __last) {
typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last);
}
void clear() { _M_t.clear(); }
 
// set operations:
 
size_type count(const key_type& __x) const {
return _M_t.find(__x) == _M_t.end() ? 0 : 1;
}
 
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//214. set::find() missing const overload
iterator find(const key_type& __x) { return _M_t.find(__x); }
const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
iterator lower_bound(const key_type& __x) {
return _M_t.lower_bound(__x);
}
const_iterator lower_bound(const key_type& __x) const {
return _M_t.lower_bound(__x);
}
iterator upper_bound(const key_type& __x) {
return _M_t.upper_bound(__x);
}
const_iterator upper_bound(const key_type& __x) const {
return _M_t.upper_bound(__x);
}
pair<iterator,iterator> equal_range(const key_type& __x) {
return _M_t.equal_range(__x);
}
pair<const_iterator,const_iterator> equal_range(const key_type& __x) const {
return _M_t.equal_range(__x);
}
#else
iterator find(const key_type& __x) const { return _M_t.find(__x); }
iterator lower_bound(const key_type& __x) const {
return _M_t.lower_bound(__x);
}
iterator upper_bound(const key_type& __x) const {
return _M_t.upper_bound(__x);
}
pair<iterator,iterator> equal_range(const key_type& __x) const {
return _M_t.equal_range(__x);
}
#endif
 
template <class _K1, class _C1, class _A1>
friend bool operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
template <class _K1, class _C1, class _A1>
friend bool operator< (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
};
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator==(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return __x._M_t == __y._M_t;
}
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator<(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return __x._M_t < __y._M_t;
}
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator!=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return !(__x == __y);
}
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator>(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return __y < __x;
}
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator<=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return !(__y < __x);
}
 
template <class _Key, class _Compare, class _Alloc>
inline bool operator>=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return !(__x < __y);
}
 
template <class _Key, class _Compare, class _Alloc>
inline void swap(set<_Key,_Compare,_Alloc>& __x,
set<_Key,_Compare,_Alloc>& __y) {
__x.swap(__y);
}
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_SET_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_stack.h
0,0 → 1,130
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_STACK_H
#define __SGI_STL_INTERNAL_STACK_H
 
#include <bits/concept_check.h>
 
namespace std
{
 
// Forward declarations of operators == and <, needed for friend declaration.
 
template <class _Tp,
class _Sequence = deque<_Tp> >
class stack;
 
template <class _Tp, class _Seq>
bool operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y);
 
template <class _Tp, class _Seq>
bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y);
 
 
template <class _Tp, class _Sequence>
class stack
{
// concept requirements
__glibcpp_class_requires(_Tp, _SGIAssignableConcept);
__glibcpp_class_requires(_Sequence, _BackInsertionSequenceConcept);
typedef typename _Sequence::value_type _Sequence_value_type;
__glibcpp_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept);
 
template <class _Tp1, class _Seq1>
friend bool operator== (const stack<_Tp1, _Seq1>&,
const stack<_Tp1, _Seq1>&);
template <class _Tp1, class _Seq1>
friend bool operator< (const stack<_Tp1, _Seq1>&,
const stack<_Tp1, _Seq1>&);
public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type;
 
typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference;
protected:
_Sequence c;
public:
stack() : c() {}
explicit stack(const _Sequence& __s) : c(__s) {}
 
bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
reference top() { return c.back(); }
const_reference top() const { return c.back(); }
void push(const value_type& __x) { c.push_back(__x); }
void pop() { c.pop_back(); }
};
 
template <class _Tp, class _Seq>
bool operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{
return __x.c == __y.c;
}
 
template <class _Tp, class _Seq>
bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{
return __x.c < __y.c;
}
 
template <class _Tp, class _Seq>
bool operator!=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{
return !(__x == __y);
}
 
template <class _Tp, class _Seq>
bool operator>(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{
return __y < __x;
}
 
template <class _Tp, class _Seq>
bool operator<=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{
return !(__y < __x);
}
 
template <class _Tp, class _Seq>
bool operator>=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{
return !(__x < __y);
}
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_STACK_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_tempbuf.h
0,0 → 1,152
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_TEMPBUF_H
#define __SGI_STL_INTERNAL_TEMPBUF_H
 
namespace std
{
 
template <class _Tp>
pair<_Tp*, ptrdiff_t>
__get_temporary_buffer(ptrdiff_t __len, _Tp*)
{
if (__len > ptrdiff_t(INT_MAX / sizeof(_Tp)))
__len = INT_MAX / sizeof(_Tp);
 
while (__len > 0) {
_Tp* __tmp = (_Tp*) malloc((size_t)__len * sizeof(_Tp));
if (__tmp != 0)
return pair<_Tp*, ptrdiff_t>(__tmp, __len);
__len /= 2;
}
 
return pair<_Tp*, ptrdiff_t>((_Tp*)0, 0);
}
 
template <class _Tp>
inline pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __len) {
return __get_temporary_buffer(__len, (_Tp*) 0);
}
 
// This overload is not required by the standard; it is an extension.
// It is supported for backward compatibility with the HP STL, and
// because not all compilers support the language feature (explicit
// function template arguments) that is required for the standard
// version of get_temporary_buffer.
template <class _Tp>
inline pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __len, _Tp*) {
return __get_temporary_buffer(__len, (_Tp*) 0);
}
 
template <class _Tp>
void return_temporary_buffer(_Tp* __p) {
free(__p);
}
 
template <class _ForwardIterator, class _Tp>
class _Temporary_buffer {
private:
ptrdiff_t _M_original_len;
ptrdiff_t _M_len;
_Tp* _M_buffer;
 
void _M_allocate_buffer() {
_M_original_len = _M_len;
_M_buffer = 0;
 
if (_M_len > (ptrdiff_t)(INT_MAX / sizeof(_Tp)))
_M_len = INT_MAX / sizeof(_Tp);
 
while (_M_len > 0) {
_M_buffer = (_Tp*) malloc(_M_len * sizeof(_Tp));
if (_M_buffer)
break;
_M_len /= 2;
}
}
 
void _M_initialize_buffer(const _Tp&, __true_type) {}
void _M_initialize_buffer(const _Tp& val, __false_type) {
uninitialized_fill_n(_M_buffer, _M_len, val);
}
 
public:
ptrdiff_t size() const { return _M_len; }
ptrdiff_t requested_size() const { return _M_original_len; }
_Tp* begin() { return _M_buffer; }
_Tp* end() { return _M_buffer + _M_len; }
 
_Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) {
// Workaround for a __type_traits bug in the pre-7.3 compiler.
typedef typename __type_traits<_Tp>::has_trivial_default_constructor
_Trivial;
 
__STL_TRY {
_M_len = 0;
distance(__first, __last, _M_len);
_M_allocate_buffer();
if (_M_len > 0)
_M_initialize_buffer(*__first, _Trivial());
}
__STL_UNWIND(free(_M_buffer); _M_buffer = 0; _M_len = 0);
}
~_Temporary_buffer() {
destroy(_M_buffer, _M_buffer + _M_len);
free(_M_buffer);
}
 
private:
// Disable copy constructor and assignment operator.
_Temporary_buffer(const _Temporary_buffer&) {}
void operator=(const _Temporary_buffer&) {}
};
 
// Class temporary_buffer is not part of the standard. It is an extension.
 
template <class _ForwardIterator,
class _Tp
= typename iterator_traits<_ForwardIterator>::value_type
>
struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
{
temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
: _Temporary_buffer<_ForwardIterator, _Tp>(__first, __last) {}
~temporary_buffer() {}
};
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_TEMPBUF_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_threads.h
0,0 → 1,512
/*
* Copyright (c) 1997-1999
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
// WARNING: This is an internal header file, included by other C++
// standard library headers. You should not attempt to use this header
// file directly.
// Stl_config.h should be included before this file.
 
#ifndef __SGI_STL_INTERNAL_THREADS_H
#define __SGI_STL_INTERNAL_THREADS_H
 
// Supported threading models are native SGI, pthreads, uithreads
// (similar to pthreads, but based on an earlier draft of the Posix
// threads standard), and Win32 threads. Uithread support by Jochen
// Schlick, 1999.
 
// GCC extension begin
// In order to present a stable threading configuration, in all cases,
// gcc looks for it's own abstraction layer before all others. All
// modifications to this file are marked to allow easier importation of
// STL upgrades.
#if defined(__STL_GTHREADS)
#include "bits/gthr.h"
#else
// GCC extension end
#if defined(__STL_SGI_THREADS)
#include <mutex.h>
#include <time.h>
#elif defined(__STL_PTHREADS)
#include <pthread.h>
#elif defined(__STL_UITHREADS)
#include <thread.h>
#include <synch.h>
#elif defined(__STL_WIN32THREADS)
#include <windows.h>
#endif
// GCC extension begin
#endif
// GCC extension end
 
namespace std
{
 
// Class _Refcount_Base provides a type, _RC_t, a data member,
// _M_ref_count, and member functions _M_incr and _M_decr, which perform
// atomic preincrement/predecrement. The constructor initializes
// _M_ref_count.
 
// Hack for SGI o32 compilers.
#if defined(__STL_SGI_THREADS) && !defined(__add_and_fetch) && \
(__mips < 3 || !(defined (_ABIN32) || defined(_ABI64)))
# define __add_and_fetch(__l,__v) add_then_test((unsigned long*)__l,__v)
# define __test_and_set(__l,__v) test_and_set(__l,__v)
#endif /* o32 */
 
struct _Refcount_Base
{
// The type _RC_t
# ifdef __STL_WIN32THREADS
typedef long _RC_t;
# else
typedef size_t _RC_t;
#endif
// The data member _M_ref_count
volatile _RC_t _M_ref_count;
 
// Constructor
// GCC extension begin
#ifdef __STL_GTHREADS
__gthread_mutex_t _M_ref_count_lock;
_Refcount_Base(_RC_t __n) : _M_ref_count(__n)
{
#ifdef __GTHREAD_MUTEX_INIT
__gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
_M_ref_count_lock = __tmp;
#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
__GTHREAD_MUTEX_INIT_FUNCTION (&_M_ref_count_lock);
#else
#error __GTHREAD_MUTEX_INIT or __GTHREAD_MUTEX_INIT_FUNCTION should be defined by gthr.h abstraction layer, report problem to libstdc++@gcc.gnu.org.
#endif
}
#else
// GCC extension end
# ifdef __STL_PTHREADS
pthread_mutex_t _M_ref_count_lock;
_Refcount_Base(_RC_t __n) : _M_ref_count(__n)
{ pthread_mutex_init(&_M_ref_count_lock, 0); }
# elif defined(__STL_UITHREADS)
mutex_t _M_ref_count_lock;
_Refcount_Base(_RC_t __n) : _M_ref_count(__n)
{ mutex_init(&_M_ref_count_lock, USYNC_THREAD, 0); }
# else
_Refcount_Base(_RC_t __n) : _M_ref_count(__n) {}
# endif
// GCC extension begin
#endif
// GCC extension end
 
// GCC extension begin
#ifdef __STL_GTHREADS
void _M_incr() {
__gthread_mutex_lock(&_M_ref_count_lock);
++_M_ref_count;
__gthread_mutex_unlock(&_M_ref_count_lock);
}
_RC_t _M_decr() {
__gthread_mutex_lock(&_M_ref_count_lock);
volatile _RC_t __tmp = --_M_ref_count;
__gthread_mutex_unlock(&_M_ref_count_lock);
return __tmp;
}
#else
// GCC extension end
// _M_incr and _M_decr
# ifdef __STL_SGI_THREADS
void _M_incr() { __add_and_fetch(&_M_ref_count, 1); }
_RC_t _M_decr() { return __add_and_fetch(&_M_ref_count, (size_t) -1); }
# elif defined (__STL_WIN32THREADS)
void _M_incr() { InterlockedIncrement((_RC_t*)&_M_ref_count); }
_RC_t _M_decr() { return InterlockedDecrement((_RC_t*)&_M_ref_count); }
# elif defined(__STL_PTHREADS)
void _M_incr() {
pthread_mutex_lock(&_M_ref_count_lock);
++_M_ref_count;
pthread_mutex_unlock(&_M_ref_count_lock);
}
_RC_t _M_decr() {
pthread_mutex_lock(&_M_ref_count_lock);
volatile _RC_t __tmp = --_M_ref_count;
pthread_mutex_unlock(&_M_ref_count_lock);
return __tmp;
}
# elif defined(__STL_UITHREADS)
void _M_incr() {
mutex_lock(&_M_ref_count_lock);
++_M_ref_count;
mutex_unlock(&_M_ref_count_lock);
}
_RC_t _M_decr() {
mutex_lock(&_M_ref_count_lock);
/*volatile*/ _RC_t __tmp = --_M_ref_count;
mutex_unlock(&_M_ref_count_lock);
return __tmp;
}
# else /* No threads */
void _M_incr() { ++_M_ref_count; }
_RC_t _M_decr() { return --_M_ref_count; }
# endif
// GCC extension begin
#endif
// GCC extension end
};
 
// Atomic swap on unsigned long
// This is guaranteed to behave as though it were atomic only if all
// possibly concurrent updates use _Atomic_swap.
// In some cases the operation is emulated with a lock.
// GCC extension begin
#ifdef __STL_GTHREADS
// We don't provide an _Atomic_swap in this configuration. This only
// affects the use of ext/rope with threads. Someone could add this
// later, if required. You can start by cloning the __STL_PTHREADS
// path while making the obvious changes. Later it could be optimized
// to use the atomicity.h abstraction layer from libstdc++-v3.
#else
// GCC extension end
# ifdef __STL_SGI_THREADS
inline unsigned long _Atomic_swap(unsigned long * __p, unsigned long __q) {
# if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64))
return test_and_set(__p, __q);
# else
return __test_and_set(__p, (unsigned long)__q);
# endif
}
# elif defined(__STL_WIN32THREADS)
inline unsigned long _Atomic_swap(unsigned long * __p, unsigned long __q) {
return (unsigned long) InterlockedExchange((LPLONG)__p, (LONG)__q);
}
# elif defined(__STL_PTHREADS)
// We use a template here only to get a unique initialized instance.
template<int __dummy>
struct _Swap_lock_struct {
static pthread_mutex_t _S_swap_lock;
};
 
template<int __dummy>
pthread_mutex_t
_Swap_lock_struct<__dummy>::_S_swap_lock = PTHREAD_MUTEX_INITIALIZER;
 
// This should be portable, but performance is expected
// to be quite awful. This really needs platform specific
// code.
inline unsigned long _Atomic_swap(unsigned long * __p, unsigned long __q) {
pthread_mutex_lock(&_Swap_lock_struct<0>::_S_swap_lock);
unsigned long __result = *__p;
*__p = __q;
pthread_mutex_unlock(&_Swap_lock_struct<0>::_S_swap_lock);
return __result;
}
# elif defined(__STL_UITHREADS)
// We use a template here only to get a unique initialized instance.
template<int __dummy>
struct _Swap_lock_struct {
static mutex_t _S_swap_lock;
};
 
template<int __dummy>
mutex_t
_Swap_lock_struct<__dummy>::_S_swap_lock = DEFAULTMUTEX;
 
// This should be portable, but performance is expected
// to be quite awful. This really needs platform specific
// code.
inline unsigned long _Atomic_swap(unsigned long * __p, unsigned long __q) {
mutex_lock(&_Swap_lock_struct<0>::_S_swap_lock);
unsigned long __result = *__p;
*__p = __q;
mutex_unlock(&_Swap_lock_struct<0>::_S_swap_lock);
return __result;
}
# elif defined (__STL_SOLARIS_THREADS)
// any better solutions ?
// We use a template here only to get a unique initialized instance.
template<int __dummy>
struct _Swap_lock_struct {
static mutex_t _S_swap_lock;
};
 
# if ( __STL_STATIC_TEMPLATE_DATA > 0 )
template<int __dummy>
mutex_t
_Swap_lock_struct<__dummy>::_S_swap_lock = DEFAULTMUTEX;
# else
__DECLARE_INSTANCE(mutex_t, _Swap_lock_struct<__dummy>::_S_swap_lock,
=DEFAULTMUTEX);
# endif /* ( __STL_STATIC_TEMPLATE_DATA > 0 ) */
 
// This should be portable, but performance is expected
// to be quite awful. This really needs platform specific
// code.
inline unsigned long _Atomic_swap(unsigned long * __p, unsigned long __q) {
mutex_lock(&_Swap_lock_struct<0>::_S_swap_lock);
unsigned long __result = *__p;
*__p = __q;
mutex_unlock(&_Swap_lock_struct<0>::_S_swap_lock);
return __result;
}
# else
static inline unsigned long _Atomic_swap(unsigned long * __p, unsigned long __q) {
unsigned long __result = *__p;
*__p = __q;
return __result;
}
# endif
// GCC extension begin
#endif
// GCC extension end
 
// Locking class. Note that this class *does not have a constructor*.
// It must be initialized either statically, with __STL_MUTEX_INITIALIZER,
// or dynamically, by explicitly calling the _M_initialize member function.
// (This is similar to the ways that a pthreads mutex can be initialized.)
// There are explicit member functions for acquiring and releasing the lock.
 
// There is no constructor because static initialization is essential for
// some uses, and only a class aggregate (see section 8.5.1 of the C++
// standard) can be initialized that way. That means we must have no
// constructors, no base classes, no virtual functions, and no private or
// protected members.
 
// Helper struct. This is a workaround for various compilers that don't
// handle static variables in inline functions properly.
template <int __inst>
struct _STL_mutex_spin {
enum { __low_max = 30, __high_max = 1000 };
// Low if we suspect uniprocessor, high for multiprocessor.
 
static unsigned __max;
static unsigned __last;
};
 
template <int __inst>
unsigned _STL_mutex_spin<__inst>::__max = _STL_mutex_spin<__inst>::__low_max;
 
template <int __inst>
unsigned _STL_mutex_spin<__inst>::__last = 0;
 
// GCC extension begin
#if defined(__STL_GTHREADS)
#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
extern __gthread_mutex_t _GLIBCPP_mutex;
extern __gthread_mutex_t *_GLIBCPP_mutex_address;
extern __gthread_once_t _GLIBCPP_once;
extern void _GLIBCPP_mutex_init (void);
extern void _GLIBCPP_mutex_address_init (void);
#endif
#endif
// GCC extension end
 
struct _STL_mutex_lock
{
// GCC extension begin
#if defined(__STL_GTHREADS)
// The class must be statically initialized with __STL_MUTEX_INITIALIZER.
#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
volatile int _M_init_flag;
__gthread_once_t _M_once;
#endif
__gthread_mutex_t _M_lock;
void _M_initialize() {
#ifdef __GTHREAD_MUTEX_INIT
// There should be no code in this path given the usage rules above.
#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
if (_M_init_flag) return;
if (__gthread_once (&_GLIBCPP_once, _GLIBCPP_mutex_init) != 0
&& __gthread_active_p ())
abort ();
__gthread_mutex_lock (&_GLIBCPP_mutex);
if (!_M_init_flag) {
// Even though we have a global lock, we use __gthread_once to be
// absolutely certain the _M_lock mutex is only initialized once on
// multiprocessor systems.
_GLIBCPP_mutex_address = &_M_lock;
if (__gthread_once (&_M_once, _GLIBCPP_mutex_address_init) != 0
&& __gthread_active_p ())
abort ();
_M_init_flag = 1;
}
__gthread_mutex_unlock (&_GLIBCPP_mutex);
#endif
}
void _M_acquire_lock() {
#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
if (!_M_init_flag) _M_initialize();
#endif
__gthread_mutex_lock(&_M_lock);
}
void _M_release_lock() {
#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
if (!_M_init_flag) _M_initialize();
#endif
__gthread_mutex_unlock(&_M_lock);
}
#else
// GCC extension end
#if defined(__STL_SGI_THREADS) || defined(__STL_WIN32THREADS)
// It should be relatively easy to get this to work on any modern Unix.
volatile unsigned long _M_lock;
void _M_initialize() { _M_lock = 0; }
static void _S_nsec_sleep(int __log_nsec) {
# ifdef __STL_SGI_THREADS
struct timespec __ts;
/* Max sleep is 2**27nsec ~ 60msec */
__ts.tv_sec = 0;
__ts.tv_nsec = 1L << __log_nsec;
nanosleep(&__ts, 0);
# elif defined(__STL_WIN32THREADS)
if (__log_nsec <= 20) {
Sleep(0);
} else {
Sleep(1 << (__log_nsec - 20));
}
# else
# error unimplemented
# endif
}
void _M_acquire_lock() {
volatile unsigned long* __lock = &this->_M_lock;
 
if (!_Atomic_swap((unsigned long*)__lock, 1)) {
return;
}
unsigned __my_spin_max = _STL_mutex_spin<0>::__max;
unsigned __my_last_spins = _STL_mutex_spin<0>::__last;
volatile unsigned __junk = 17; // Value doesn't matter.
unsigned __i;
for (__i = 0; __i < __my_spin_max; __i++) {
if (__i < __my_last_spins/2 || *__lock) {
__junk *= __junk; __junk *= __junk;
__junk *= __junk; __junk *= __junk;
continue;
}
if (!_Atomic_swap((unsigned long*)__lock, 1)) {
// got it!
// Spinning worked. Thus we're probably not being scheduled
// against the other process with which we were contending.
// Thus it makes sense to spin longer the next time.
_STL_mutex_spin<0>::__last = __i;
_STL_mutex_spin<0>::__max = _STL_mutex_spin<0>::__high_max;
return;
}
}
// We are probably being scheduled against the other process. Sleep.
_STL_mutex_spin<0>::__max = _STL_mutex_spin<0>::__low_max;
for (__i = 0 ;; ++__i) {
int __log_nsec = __i + 6;
 
if (__log_nsec > 27) __log_nsec = 27;
if (!_Atomic_swap((unsigned long *)__lock, 1)) {
return;
}
_S_nsec_sleep(__log_nsec);
}
}
void _M_release_lock() {
volatile unsigned long* __lock = &_M_lock;
# if defined(__STL_SGI_THREADS) && defined(__GNUC__) && __mips >= 3
asm("sync");
*__lock = 0;
# elif defined(__STL_SGI_THREADS) && __mips >= 3 \
&& (defined (_ABIN32) || defined(_ABI64))
__lock_release(__lock);
# else
*__lock = 0;
// This is not sufficient on many multiprocessors, since
// writes to protected variables and the lock may be reordered.
# endif
}
 
// We no longer use win32 critical sections.
// They appear to be slower in the contention-free case,
// and they appear difficult to initialize without introducing a race.
 
#elif defined(__STL_PTHREADS)
pthread_mutex_t _M_lock;
void _M_initialize() { pthread_mutex_init(&_M_lock, NULL); }
void _M_acquire_lock() { pthread_mutex_lock(&_M_lock); }
void _M_release_lock() { pthread_mutex_unlock(&_M_lock); }
#elif defined(__STL_UITHREADS)
mutex_t _M_lock;
void _M_initialize() { mutex_init(&_M_lock, USYNC_THREAD, 0); }
void _M_acquire_lock() { mutex_lock(&_M_lock); }
void _M_release_lock() { mutex_unlock(&_M_lock); }
#else /* No threads */
void _M_initialize() {}
void _M_acquire_lock() {}
void _M_release_lock() {}
#endif
// GCC extension begin
#endif
// GCC extension end
};
 
// GCC extension begin
#if defined(__STL_GTHREADS)
#ifdef __GTHREAD_MUTEX_INIT
#define __STL_MUTEX_INITIALIZER = { __GTHREAD_MUTEX_INIT }
#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
#ifdef __GTHREAD_MUTEX_INIT_DEFAULT
#define __STL_MUTEX_INITIALIZER \
= { 0, __GTHREAD_ONCE_INIT, __GTHREAD_MUTEX_INIT_DEFAULT }
#else
#define __STL_MUTEX_INITIALIZER = { 0, __GTHREAD_ONCE_INIT }
#endif
#endif
#else
// GCC extension end
#ifdef __STL_PTHREADS
// Pthreads locks must be statically initialized to something other than
// the default value of zero.
# define __STL_MUTEX_INITIALIZER = { PTHREAD_MUTEX_INITIALIZER }
#elif defined(__STL_UITHREADS)
// UIthreads locks must be statically initialized to something other than
// the default value of zero.
# define __STL_MUTEX_INITIALIZER = { DEFAULTMUTEX }
#elif defined(__STL_SGI_THREADS) || defined(__STL_WIN32THREADS)
# define __STL_MUTEX_INITIALIZER = { 0 }
#else
# define __STL_MUTEX_INITIALIZER
#endif
// GCC extension begin
#endif
// GCC extension end
 
 
// A locking class that uses _STL_mutex_lock. The constructor takes a
// reference to an _STL_mutex_lock, and acquires a lock. The
// destructor releases the lock. It's not clear that this is exactly
// the right functionality. It will probably change in the future.
 
struct _STL_auto_lock
{
_STL_mutex_lock& _M_lock;
_STL_auto_lock(_STL_mutex_lock& __lock) : _M_lock(__lock)
{ _M_lock._M_acquire_lock(); }
~_STL_auto_lock() { _M_lock._M_release_lock(); }
 
private:
void operator=(const _STL_auto_lock&);
_STL_auto_lock(const _STL_auto_lock&);
};
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_THREADS_H */
 
// Local Variables:
// mode:C++
// End:
 
/contrib/media/updf/include/bits/stl_tree.h
0,0 → 1,1277
/*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_TREE_H
#define __SGI_STL_INTERNAL_TREE_H
 
/*
 
Red-black tree class, designed for use in implementing STL
associative containers (set, multiset, map, and multimap). The
insertion and deletion algorithms are based on those in Cormen,
Leiserson, and Rivest, Introduction to Algorithms (MIT Press, 1990),
except that
 
(1) the header cell is maintained with links not only to the root
but also to the leftmost node of the tree, to enable constant time
begin(), and to the rightmost node of the tree, to enable linear time
performance when used with the generic set algorithms (set_union,
etc.);
 
(2) when a node being deleted has two children its successor node is
relinked into its place, rather than copied, so that the only
iterators invalidated are those referring to the deleted node.
 
*/
 
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_function.h>
 
namespace std
{
 
typedef bool _Rb_tree_Color_type;
const _Rb_tree_Color_type _S_rb_tree_red = false;
const _Rb_tree_Color_type _S_rb_tree_black = true;
 
struct _Rb_tree_node_base
{
typedef _Rb_tree_Color_type _Color_type;
typedef _Rb_tree_node_base* _Base_ptr;
 
_Color_type _M_color;
_Base_ptr _M_parent;
_Base_ptr _M_left;
_Base_ptr _M_right;
 
static _Base_ptr _S_minimum(_Base_ptr __x)
{
while (__x->_M_left != 0) __x = __x->_M_left;
return __x;
}
 
static _Base_ptr _S_maximum(_Base_ptr __x)
{
while (__x->_M_right != 0) __x = __x->_M_right;
return __x;
}
};
 
template <class _Value>
struct _Rb_tree_node : public _Rb_tree_node_base
{
typedef _Rb_tree_node<_Value>* _Link_type;
_Value _M_value_field;
};
 
 
struct _Rb_tree_base_iterator
{
typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
typedef bidirectional_iterator_tag iterator_category;
typedef ptrdiff_t difference_type;
_Base_ptr _M_node;
 
void _M_increment()
{
if (_M_node->_M_right != 0) {
_M_node = _M_node->_M_right;
while (_M_node->_M_left != 0)
_M_node = _M_node->_M_left;
}
else {
_Base_ptr __y = _M_node->_M_parent;
while (_M_node == __y->_M_right) {
_M_node = __y;
__y = __y->_M_parent;
}
if (_M_node->_M_right != __y)
_M_node = __y;
}
}
 
void _M_decrement()
{
if (_M_node->_M_color == _S_rb_tree_red &&
_M_node->_M_parent->_M_parent == _M_node)
_M_node = _M_node->_M_right;
else if (_M_node->_M_left != 0) {
_Base_ptr __y = _M_node->_M_left;
while (__y->_M_right != 0)
__y = __y->_M_right;
_M_node = __y;
}
else {
_Base_ptr __y = _M_node->_M_parent;
while (_M_node == __y->_M_left) {
_M_node = __y;
__y = __y->_M_parent;
}
_M_node = __y;
}
}
};
 
template <class _Value, class _Ref, class _Ptr>
struct _Rb_tree_iterator : public _Rb_tree_base_iterator
{
typedef _Value value_type;
typedef _Ref reference;
typedef _Ptr pointer;
typedef _Rb_tree_iterator<_Value, _Value&, _Value*>
iterator;
typedef _Rb_tree_iterator<_Value, const _Value&, const _Value*>
const_iterator;
typedef _Rb_tree_iterator<_Value, _Ref, _Ptr>
_Self;
typedef _Rb_tree_node<_Value>* _Link_type;
 
_Rb_tree_iterator() {}
_Rb_tree_iterator(_Link_type __x) { _M_node = __x; }
_Rb_tree_iterator(const iterator& __it) { _M_node = __it._M_node; }
 
reference operator*() const { return _Link_type(_M_node)->_M_value_field; }
pointer operator->() const { return &(operator*()); }
 
_Self& operator++() { _M_increment(); return *this; }
_Self operator++(int) {
_Self __tmp = *this;
_M_increment();
return __tmp;
}
_Self& operator--() { _M_decrement(); return *this; }
_Self operator--(int) {
_Self __tmp = *this;
_M_decrement();
return __tmp;
}
};
 
template <class _Value, class _Ref, class _Ptr>
inline bool operator==(const _Rb_tree_iterator<_Value, _Ref, _Ptr>& __x,
const _Rb_tree_iterator<_Value, _Ref, _Ptr>& __y) {
return __x._M_node == __y._M_node;
}
 
template <class _Value>
inline bool operator==(const _Rb_tree_iterator<_Value, const _Value&, const _Value*>& __x,
const _Rb_tree_iterator<_Value, _Value&, _Value*>& __y) {
return __x._M_node == __y._M_node;
}
 
template <class _Value>
inline bool operator==(const _Rb_tree_iterator<_Value, _Value&, _Value*>& __x,
const _Rb_tree_iterator<_Value, const _Value&, const _Value*>& __y) {
return __x._M_node == __y._M_node;
}
 
template <class _Value, class _Ref, class _Ptr>
inline bool operator!=(const _Rb_tree_iterator<_Value, _Ref, _Ptr>& __x,
const _Rb_tree_iterator<_Value, _Ref, _Ptr>& __y) {
return __x._M_node != __y._M_node;
}
 
template <class _Value>
inline bool operator!=(const _Rb_tree_iterator<_Value, const _Value&, const _Value*>& __x,
const _Rb_tree_iterator<_Value, _Value&, _Value*>& __y) {
return __x._M_node != __y._M_node;
}
 
template <class _Value>
inline bool operator!=(const _Rb_tree_iterator<_Value, _Value&, _Value*>& __x,
const _Rb_tree_iterator<_Value, const _Value&, const _Value*>& __y) {
return __x._M_node != __y._M_node;
}
 
inline void
_Rb_tree_rotate_left(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
{
_Rb_tree_node_base* __y = __x->_M_right;
__x->_M_right = __y->_M_left;
if (__y->_M_left !=0)
__y->_M_left->_M_parent = __x;
__y->_M_parent = __x->_M_parent;
 
if (__x == __root)
__root = __y;
else if (__x == __x->_M_parent->_M_left)
__x->_M_parent->_M_left = __y;
else
__x->_M_parent->_M_right = __y;
__y->_M_left = __x;
__x->_M_parent = __y;
}
 
inline void
_Rb_tree_rotate_right(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
{
_Rb_tree_node_base* __y = __x->_M_left;
__x->_M_left = __y->_M_right;
if (__y->_M_right != 0)
__y->_M_right->_M_parent = __x;
__y->_M_parent = __x->_M_parent;
 
if (__x == __root)
__root = __y;
else if (__x == __x->_M_parent->_M_right)
__x->_M_parent->_M_right = __y;
else
__x->_M_parent->_M_left = __y;
__y->_M_right = __x;
__x->_M_parent = __y;
}
 
inline void
_Rb_tree_rebalance(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
{
__x->_M_color = _S_rb_tree_red;
while (__x != __root && __x->_M_parent->_M_color == _S_rb_tree_red) {
if (__x->_M_parent == __x->_M_parent->_M_parent->_M_left) {
_Rb_tree_node_base* __y = __x->_M_parent->_M_parent->_M_right;
if (__y && __y->_M_color == _S_rb_tree_red) {
__x->_M_parent->_M_color = _S_rb_tree_black;
__y->_M_color = _S_rb_tree_black;
__x->_M_parent->_M_parent->_M_color = _S_rb_tree_red;
__x = __x->_M_parent->_M_parent;
}
else {
if (__x == __x->_M_parent->_M_right) {
__x = __x->_M_parent;
_Rb_tree_rotate_left(__x, __root);
}
__x->_M_parent->_M_color = _S_rb_tree_black;
__x->_M_parent->_M_parent->_M_color = _S_rb_tree_red;
_Rb_tree_rotate_right(__x->_M_parent->_M_parent, __root);
}
}
else {
_Rb_tree_node_base* __y = __x->_M_parent->_M_parent->_M_left;
if (__y && __y->_M_color == _S_rb_tree_red) {
__x->_M_parent->_M_color = _S_rb_tree_black;
__y->_M_color = _S_rb_tree_black;
__x->_M_parent->_M_parent->_M_color = _S_rb_tree_red;
__x = __x->_M_parent->_M_parent;
}
else {
if (__x == __x->_M_parent->_M_left) {
__x = __x->_M_parent;
_Rb_tree_rotate_right(__x, __root);
}
__x->_M_parent->_M_color = _S_rb_tree_black;
__x->_M_parent->_M_parent->_M_color = _S_rb_tree_red;
_Rb_tree_rotate_left(__x->_M_parent->_M_parent, __root);
}
}
}
__root->_M_color = _S_rb_tree_black;
}
 
inline _Rb_tree_node_base*
_Rb_tree_rebalance_for_erase(_Rb_tree_node_base* __z,
_Rb_tree_node_base*& __root,
_Rb_tree_node_base*& __leftmost,
_Rb_tree_node_base*& __rightmost)
{
_Rb_tree_node_base* __y = __z;
_Rb_tree_node_base* __x = 0;
_Rb_tree_node_base* __x_parent = 0;
if (__y->_M_left == 0) // __z has at most one non-null child. y == z.
__x = __y->_M_right; // __x might be null.
else
if (__y->_M_right == 0) // __z has exactly one non-null child. y == z.
__x = __y->_M_left; // __x is not null.
else { // __z has two non-null children. Set __y to
__y = __y->_M_right; // __z's successor. __x might be null.
while (__y->_M_left != 0)
__y = __y->_M_left;
__x = __y->_M_right;
}
if (__y != __z) { // relink y in place of z. y is z's successor
__z->_M_left->_M_parent = __y;
__y->_M_left = __z->_M_left;
if (__y != __z->_M_right) {
__x_parent = __y->_M_parent;
if (__x) __x->_M_parent = __y->_M_parent;
__y->_M_parent->_M_left = __x; // __y must be a child of _M_left
__y->_M_right = __z->_M_right;
__z->_M_right->_M_parent = __y;
}
else
__x_parent = __y;
if (__root == __z)
__root = __y;
else if (__z->_M_parent->_M_left == __z)
__z->_M_parent->_M_left = __y;
else
__z->_M_parent->_M_right = __y;
__y->_M_parent = __z->_M_parent;
std::swap(__y->_M_color, __z->_M_color);
__y = __z;
// __y now points to node to be actually deleted
}
else { // __y == __z
__x_parent = __y->_M_parent;
if (__x) __x->_M_parent = __y->_M_parent;
if (__root == __z)
__root = __x;
else
if (__z->_M_parent->_M_left == __z)
__z->_M_parent->_M_left = __x;
else
__z->_M_parent->_M_right = __x;
if (__leftmost == __z)
if (__z->_M_right == 0) // __z->_M_left must be null also
__leftmost = __z->_M_parent;
// makes __leftmost == _M_header if __z == __root
else
__leftmost = _Rb_tree_node_base::_S_minimum(__x);
if (__rightmost == __z)
if (__z->_M_left == 0) // __z->_M_right must be null also
__rightmost = __z->_M_parent;
// makes __rightmost == _M_header if __z == __root
else // __x == __z->_M_left
__rightmost = _Rb_tree_node_base::_S_maximum(__x);
}
if (__y->_M_color != _S_rb_tree_red) {
while (__x != __root && (__x == 0 || __x->_M_color == _S_rb_tree_black))
if (__x == __x_parent->_M_left) {
_Rb_tree_node_base* __w = __x_parent->_M_right;
if (__w->_M_color == _S_rb_tree_red) {
__w->_M_color = _S_rb_tree_black;
__x_parent->_M_color = _S_rb_tree_red;
_Rb_tree_rotate_left(__x_parent, __root);
__w = __x_parent->_M_right;
}
if ((__w->_M_left == 0 ||
__w->_M_left->_M_color == _S_rb_tree_black) &&
(__w->_M_right == 0 ||
__w->_M_right->_M_color == _S_rb_tree_black)) {
__w->_M_color = _S_rb_tree_red;
__x = __x_parent;
__x_parent = __x_parent->_M_parent;
} else {
if (__w->_M_right == 0 ||
__w->_M_right->_M_color == _S_rb_tree_black) {
if (__w->_M_left) __w->_M_left->_M_color = _S_rb_tree_black;
__w->_M_color = _S_rb_tree_red;
_Rb_tree_rotate_right(__w, __root);
__w = __x_parent->_M_right;
}
__w->_M_color = __x_parent->_M_color;
__x_parent->_M_color = _S_rb_tree_black;
if (__w->_M_right) __w->_M_right->_M_color = _S_rb_tree_black;
_Rb_tree_rotate_left(__x_parent, __root);
break;
}
} else { // same as above, with _M_right <-> _M_left.
_Rb_tree_node_base* __w = __x_parent->_M_left;
if (__w->_M_color == _S_rb_tree_red) {
__w->_M_color = _S_rb_tree_black;
__x_parent->_M_color = _S_rb_tree_red;
_Rb_tree_rotate_right(__x_parent, __root);
__w = __x_parent->_M_left;
}
if ((__w->_M_right == 0 ||
__w->_M_right->_M_color == _S_rb_tree_black) &&
(__w->_M_left == 0 ||
__w->_M_left->_M_color == _S_rb_tree_black)) {
__w->_M_color = _S_rb_tree_red;
__x = __x_parent;
__x_parent = __x_parent->_M_parent;
} else {
if (__w->_M_left == 0 ||
__w->_M_left->_M_color == _S_rb_tree_black) {
if (__w->_M_right) __w->_M_right->_M_color = _S_rb_tree_black;
__w->_M_color = _S_rb_tree_red;
_Rb_tree_rotate_left(__w, __root);
__w = __x_parent->_M_left;
}
__w->_M_color = __x_parent->_M_color;
__x_parent->_M_color = _S_rb_tree_black;
if (__w->_M_left) __w->_M_left->_M_color = _S_rb_tree_black;
_Rb_tree_rotate_right(__x_parent, __root);
break;
}
}
if (__x) __x->_M_color = _S_rb_tree_black;
}
return __y;
}
 
// Base class to encapsulate the differences between old SGI-style
// allocators and standard-conforming allocators. In order to avoid
// having an empty base class, we arbitrarily move one of rb_tree's
// data members into the base class.
 
// _Base for general standard-conforming allocators.
template <class _Tp, class _Alloc, bool _S_instanceless>
class _Rb_tree_alloc_base {
public:
typedef typename _Alloc_traits<_Tp, _Alloc>::allocator_type allocator_type;
allocator_type get_allocator() const { return _M_node_allocator; }
 
_Rb_tree_alloc_base(const allocator_type& __a)
: _M_node_allocator(__a), _M_header(0) {}
 
protected:
typename _Alloc_traits<_Rb_tree_node<_Tp>, _Alloc>::allocator_type
_M_node_allocator;
_Rb_tree_node<_Tp>* _M_header;
 
_Rb_tree_node<_Tp>* _M_get_node()
{ return _M_node_allocator.allocate(1); }
void _M_put_node(_Rb_tree_node<_Tp>* __p)
{ _M_node_allocator.deallocate(__p, 1); }
};
 
// Specialization for instanceless allocators.
template <class _Tp, class _Alloc>
class _Rb_tree_alloc_base<_Tp, _Alloc, true> {
public:
typedef typename _Alloc_traits<_Tp, _Alloc>::allocator_type allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
 
_Rb_tree_alloc_base(const allocator_type&) : _M_header(0) {}
 
protected:
_Rb_tree_node<_Tp>* _M_header;
 
typedef typename _Alloc_traits<_Rb_tree_node<_Tp>, _Alloc>::_Alloc_type
_Alloc_type;
 
_Rb_tree_node<_Tp>* _M_get_node()
{ return _Alloc_type::allocate(1); }
void _M_put_node(_Rb_tree_node<_Tp>* __p)
{ _Alloc_type::deallocate(__p, 1); }
};
 
template <class _Tp, class _Alloc>
struct _Rb_tree_base
: public _Rb_tree_alloc_base<_Tp, _Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
{
typedef _Rb_tree_alloc_base<_Tp, _Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
_Base;
typedef typename _Base::allocator_type allocator_type;
 
_Rb_tree_base(const allocator_type& __a)
: _Base(__a) { _M_header = _M_get_node(); }
~_Rb_tree_base() { _M_put_node(_M_header); }
 
};
 
 
template <class _Key, class _Value, class _KeyOfValue, class _Compare,
class _Alloc = allocator<_Value> >
class _Rb_tree : protected _Rb_tree_base<_Value, _Alloc> {
typedef _Rb_tree_base<_Value, _Alloc> _Base;
protected:
typedef _Rb_tree_node_base* _Base_ptr;
typedef _Rb_tree_node<_Value> _Rb_tree_node;
typedef _Rb_tree_Color_type _Color_type;
public:
typedef _Key key_type;
typedef _Value value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef _Rb_tree_node* _Link_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
 
typedef typename _Base::allocator_type allocator_type;
allocator_type get_allocator() const { return _Base::get_allocator(); }
 
protected:
using _Base::_M_get_node;
using _Base::_M_put_node;
using _Base::_M_header;
 
protected:
 
_Link_type _M_create_node(const value_type& __x)
{
_Link_type __tmp = _M_get_node();
__STL_TRY {
construct(&__tmp->_M_value_field, __x);
}
__STL_UNWIND(_M_put_node(__tmp));
return __tmp;
}
 
_Link_type _M_clone_node(_Link_type __x)
{
_Link_type __tmp = _M_create_node(__x->_M_value_field);
__tmp->_M_color = __x->_M_color;
__tmp->_M_left = 0;
__tmp->_M_right = 0;
return __tmp;
}
 
void destroy_node(_Link_type __p)
{
destroy(&__p->_M_value_field);
_M_put_node(__p);
}
 
protected:
size_type _M_node_count; // keeps track of size of tree
_Compare _M_key_compare;
 
_Link_type& _M_root() const
{ return (_Link_type&) _M_header->_M_parent; }
_Link_type& _M_leftmost() const
{ return (_Link_type&) _M_header->_M_left; }
_Link_type& _M_rightmost() const
{ return (_Link_type&) _M_header->_M_right; }
 
static _Link_type& _S_left(_Link_type __x)
{ return (_Link_type&)(__x->_M_left); }
static _Link_type& _S_right(_Link_type __x)
{ return (_Link_type&)(__x->_M_right); }
static _Link_type& _S_parent(_Link_type __x)
{ return (_Link_type&)(__x->_M_parent); }
static reference _S_value(_Link_type __x)
{ return __x->_M_value_field; }
static const _Key& _S_key(_Link_type __x)
{ return _KeyOfValue()(_S_value(__x)); }
static _Color_type& _S_color(_Link_type __x)
{ return (_Color_type&)(__x->_M_color); }
 
static _Link_type& _S_left(_Base_ptr __x)
{ return (_Link_type&)(__x->_M_left); }
static _Link_type& _S_right(_Base_ptr __x)
{ return (_Link_type&)(__x->_M_right); }
static _Link_type& _S_parent(_Base_ptr __x)
{ return (_Link_type&)(__x->_M_parent); }
static reference _S_value(_Base_ptr __x)
{ return ((_Link_type)__x)->_M_value_field; }
static const _Key& _S_key(_Base_ptr __x)
{ return _KeyOfValue()(_S_value(_Link_type(__x)));}
static _Color_type& _S_color(_Base_ptr __x)
{ return (_Color_type&)(_Link_type(__x)->_M_color); }
 
static _Link_type _S_minimum(_Link_type __x)
{ return (_Link_type) _Rb_tree_node_base::_S_minimum(__x); }
 
static _Link_type _S_maximum(_Link_type __x)
{ return (_Link_type) _Rb_tree_node_base::_S_maximum(__x); }
 
public:
typedef _Rb_tree_iterator<value_type, reference, pointer> iterator;
typedef _Rb_tree_iterator<value_type, const_reference, const_pointer>
const_iterator;
 
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
 
private:
iterator _M_insert(_Base_ptr __x, _Base_ptr __y, const value_type& __v);
_Link_type _M_copy(_Link_type __x, _Link_type __p);
void _M_erase(_Link_type __x);
 
public:
// allocation/deallocation
_Rb_tree()
: _Base(allocator_type()), _M_node_count(0), _M_key_compare()
{ _M_empty_initialize(); }
 
_Rb_tree(const _Compare& __comp)
: _Base(allocator_type()), _M_node_count(0), _M_key_compare(__comp)
{ _M_empty_initialize(); }
 
_Rb_tree(const _Compare& __comp, const allocator_type& __a)
: _Base(__a), _M_node_count(0), _M_key_compare(__comp)
{ _M_empty_initialize(); }
 
_Rb_tree(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x)
: _Base(__x.get_allocator()),
_M_node_count(0), _M_key_compare(__x._M_key_compare)
{
if (__x._M_root() == 0)
_M_empty_initialize();
else {
_S_color(_M_header) = _S_rb_tree_red;
_M_root() = _M_copy(__x._M_root(), _M_header);
_M_leftmost() = _S_minimum(_M_root());
_M_rightmost() = _S_maximum(_M_root());
}
_M_node_count = __x._M_node_count;
}
~_Rb_tree() { clear(); }
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>&
operator=(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x);
 
private:
void _M_empty_initialize() {
_S_color(_M_header) = _S_rb_tree_red; // used to distinguish header from
// __root, in iterator.operator++
_M_root() = 0;
_M_leftmost() = _M_header;
_M_rightmost() = _M_header;
}
 
public:
// accessors:
_Compare key_comp() const { return _M_key_compare; }
iterator begin() { return _M_leftmost(); }
const_iterator begin() const { return _M_leftmost(); }
iterator end() { return _M_header; }
const_iterator end() const { return _M_header; }
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const {
return const_reverse_iterator(end());
}
reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const {
return const_reverse_iterator(begin());
}
bool empty() const { return _M_node_count == 0; }
size_type size() const { return _M_node_count; }
size_type max_size() const { return size_type(-1); }
 
void swap(_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __t) {
std::swap(_M_header, __t._M_header);
std::swap(_M_node_count, __t._M_node_count);
std::swap(_M_key_compare, __t._M_key_compare);
}
public:
// insert/erase
pair<iterator,bool> insert_unique(const value_type& __x);
iterator insert_equal(const value_type& __x);
 
iterator insert_unique(iterator __position, const value_type& __x);
iterator insert_equal(iterator __position, const value_type& __x);
 
template <class _InputIterator>
void insert_unique(_InputIterator __first, _InputIterator __last);
template <class _InputIterator>
void insert_equal(_InputIterator __first, _InputIterator __last);
 
void erase(iterator __position);
size_type erase(const key_type& __x);
void erase(iterator __first, iterator __last);
void erase(const key_type* __first, const key_type* __last);
void clear() {
if (_M_node_count != 0) {
_M_erase(_M_root());
_M_leftmost() = _M_header;
_M_root() = 0;
_M_rightmost() = _M_header;
_M_node_count = 0;
}
}
 
public:
// set operations:
iterator find(const key_type& __x);
const_iterator find(const key_type& __x) const;
size_type count(const key_type& __x) const;
iterator lower_bound(const key_type& __x);
const_iterator lower_bound(const key_type& __x) const;
iterator upper_bound(const key_type& __x);
const_iterator upper_bound(const key_type& __x) const;
pair<iterator,iterator> equal_range(const key_type& __x);
pair<const_iterator, const_iterator> equal_range(const key_type& __x) const;
 
public:
// Debugging.
bool __rb_verify() const;
};
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
inline bool
operator==(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __y)
{
return __x.size() == __y.size() &&
equal(__x.begin(), __x.end(), __y.begin());
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
inline bool
operator<(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __y)
{
return lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end());
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
inline bool
operator!=(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __y) {
return !(__x == __y);
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
inline bool
operator>(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __y) {
return __y < __x;
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
inline bool
operator<=(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __y) {
return !(__y < __x);
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
inline bool
operator>=(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __y) {
return !(__x < __y);
}
 
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
inline void
swap(_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __y)
{
__x.swap(__y);
}
 
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>&
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::operator=(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x)
{
if (this != &__x) {
// Note that _Key may be a constant type.
clear();
_M_node_count = 0;
_M_key_compare = __x._M_key_compare;
if (__x._M_root() == 0) {
_M_root() = 0;
_M_leftmost() = _M_header;
_M_rightmost() = _M_header;
}
else {
_M_root() = _M_copy(__x._M_root(), _M_header);
_M_leftmost() = _S_minimum(_M_root());
_M_rightmost() = _S_maximum(_M_root());
_M_node_count = __x._M_node_count;
}
}
return *this;
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::_M_insert(_Base_ptr __x_, _Base_ptr __y_, const _Value& __v)
{
_Link_type __x = (_Link_type) __x_;
_Link_type __y = (_Link_type) __y_;
_Link_type __z;
 
if (__y == _M_header || __x != 0 ||
_M_key_compare(_KeyOfValue()(__v), _S_key(__y))) {
__z = _M_create_node(__v);
_S_left(__y) = __z; // also makes _M_leftmost() = __z
// when __y == _M_header
if (__y == _M_header) {
_M_root() = __z;
_M_rightmost() = __z;
}
else if (__y == _M_leftmost())
_M_leftmost() = __z; // maintain _M_leftmost() pointing to min node
}
else {
__z = _M_create_node(__v);
_S_right(__y) = __z;
if (__y == _M_rightmost())
_M_rightmost() = __z; // maintain _M_rightmost() pointing to max node
}
_S_parent(__z) = __y;
_S_left(__z) = 0;
_S_right(__z) = 0;
_Rb_tree_rebalance(__z, _M_header->_M_parent);
++_M_node_count;
return iterator(__z);
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::insert_equal(const _Value& __v)
{
_Link_type __y = _M_header;
_Link_type __x = _M_root();
while (__x != 0) {
__y = __x;
__x = _M_key_compare(_KeyOfValue()(__v), _S_key(__x)) ?
_S_left(__x) : _S_right(__x);
}
return _M_insert(__x, __y, __v);
}
 
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
pair<typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator,
bool>
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::insert_unique(const _Value& __v)
{
_Link_type __y = _M_header;
_Link_type __x = _M_root();
bool __comp = true;
while (__x != 0) {
__y = __x;
__comp = _M_key_compare(_KeyOfValue()(__v), _S_key(__x));
__x = __comp ? _S_left(__x) : _S_right(__x);
}
iterator __j = iterator(__y);
if (__comp)
if (__j == begin())
return pair<iterator,bool>(_M_insert(__x, __y, __v), true);
else
--__j;
if (_M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v)))
return pair<iterator,bool>(_M_insert(__x, __y, __v), true);
return pair<iterator,bool>(__j, false);
}
 
 
template <class _Key, class _Val, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>
::insert_unique(iterator __position, const _Val& __v)
{
if (__position._M_node == _M_header->_M_left) { // begin()
if (size() > 0 &&
_M_key_compare(_S_key(__position._M_node), _KeyOfValue()(__v)))
return _M_insert(__position._M_node, __position._M_node, __v);
// first argument just needs to be non-null
else
return insert_unique(__v).first;
} else if (__position._M_node == _M_header) { // end()
if (_M_key_compare(_S_key(_M_rightmost()), _KeyOfValue()(__v)))
return _M_insert(0, _M_rightmost(), __v);
else
return insert_unique(__v).first;
} else {
iterator __before = __position;
--__before;
if (_M_key_compare(_S_key(__before._M_node), _KeyOfValue()(__v))
&& _M_key_compare(_KeyOfValue()(__v), _S_key(__position._M_node))) {
if (_S_right(__before._M_node) == 0)
return _M_insert(0, __before._M_node, __v);
else
return _M_insert(__position._M_node, __position._M_node, __v);
// first argument just needs to be non-null
} else
return insert_unique(__v).first;
}
}
 
template <class _Key, class _Val, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>
::insert_equal(iterator __position, const _Val& __v)
{
if (__position._M_node == _M_header->_M_left) { // begin()
if (size() > 0 &&
!_M_key_compare(_S_key(__position._M_node), _KeyOfValue()(__v)))
return _M_insert(__position._M_node, __position._M_node, __v);
// first argument just needs to be non-null
else
return insert_equal(__v);
} else if (__position._M_node == _M_header) {// end()
if (!_M_key_compare(_KeyOfValue()(__v), _S_key(_M_rightmost())))
return _M_insert(0, _M_rightmost(), __v);
else
return insert_equal(__v);
} else {
iterator __before = __position;
--__before;
if (!_M_key_compare(_KeyOfValue()(__v), _S_key(__before._M_node))
&& !_M_key_compare(_S_key(__position._M_node), _KeyOfValue()(__v))) {
if (_S_right(__before._M_node) == 0)
return _M_insert(0, __before._M_node, __v);
else
return _M_insert(__position._M_node, __position._M_node, __v);
// first argument just needs to be non-null
} else
return insert_equal(__v);
}
}
 
template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
template<class _II>
void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
::insert_equal(_II __first, _II __last)
{
for ( ; __first != __last; ++__first)
insert_equal(*__first);
}
 
template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
template<class _II>
void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
::insert_unique(_II __first, _II __last) {
for ( ; __first != __last; ++__first)
insert_unique(*__first);
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
inline void _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::erase(iterator __position)
{
_Link_type __y =
(_Link_type) _Rb_tree_rebalance_for_erase(__position._M_node,
_M_header->_M_parent,
_M_header->_M_left,
_M_header->_M_right);
destroy_node(__y);
--_M_node_count;
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::size_type
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::erase(const _Key& __x)
{
pair<iterator,iterator> __p = equal_range(__x);
size_type __n = 0;
distance(__p.first, __p.second, __n);
erase(__p.first, __p.second);
return __n;
}
 
template <class _Key, class _Val, class _KoV, class _Compare, class _Alloc>
typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type
_Rb_tree<_Key,_Val,_KoV,_Compare,_Alloc>
::_M_copy(_Link_type __x, _Link_type __p)
{
// structural copy. __x and __p must be non-null.
_Link_type __top = _M_clone_node(__x);
__top->_M_parent = __p;
__STL_TRY {
if (__x->_M_right)
__top->_M_right = _M_copy(_S_right(__x), __top);
__p = __top;
__x = _S_left(__x);
 
while (__x != 0) {
_Link_type __y = _M_clone_node(__x);
__p->_M_left = __y;
__y->_M_parent = __p;
if (__x->_M_right)
__y->_M_right = _M_copy(_S_right(__x), __y);
__p = __y;
__x = _S_left(__x);
}
}
__STL_UNWIND(_M_erase(__top));
 
return __top;
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
void _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::_M_erase(_Link_type __x)
{
// erase without rebalancing
while (__x != 0) {
_M_erase(_S_right(__x));
_Link_type __y = _S_left(__x);
destroy_node(__x);
__x = __y;
}
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
void _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::erase(iterator __first, iterator __last)
{
if (__first == begin() && __last == end())
clear();
else
while (__first != __last) erase(__first++);
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
void _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::erase(const _Key* __first, const _Key* __last)
{
while (__first != __last) erase(*__first++);
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::find(const _Key& __k)
{
_Link_type __y = _M_header; // Last node which is not less than __k.
_Link_type __x = _M_root(); // Current node.
 
while (__x != 0)
if (!_M_key_compare(_S_key(__x), __k))
__y = __x, __x = _S_left(__x);
else
__x = _S_right(__x);
 
iterator __j = iterator(__y);
return (__j == end() || _M_key_compare(__k, _S_key(__j._M_node))) ?
end() : __j;
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::const_iterator
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::find(const _Key& __k) const
{
_Link_type __y = _M_header; /* Last node which is not less than __k. */
_Link_type __x = _M_root(); /* Current node. */
 
while (__x != 0) {
if (!_M_key_compare(_S_key(__x), __k))
__y = __x, __x = _S_left(__x);
else
__x = _S_right(__x);
}
const_iterator __j = const_iterator(__y);
return (__j == end() || _M_key_compare(__k, _S_key(__j._M_node))) ?
end() : __j;
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::size_type
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::count(const _Key& __k) const
{
pair<const_iterator, const_iterator> __p = equal_range(__k);
size_type __n = 0;
distance(__p.first, __p.second, __n);
return __n;
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::lower_bound(const _Key& __k)
{
_Link_type __y = _M_header; /* Last node which is not less than __k. */
_Link_type __x = _M_root(); /* Current node. */
 
while (__x != 0)
if (!_M_key_compare(_S_key(__x), __k))
__y = __x, __x = _S_left(__x);
else
__x = _S_right(__x);
 
return iterator(__y);
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::const_iterator
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::lower_bound(const _Key& __k) const
{
_Link_type __y = _M_header; /* Last node which is not less than __k. */
_Link_type __x = _M_root(); /* Current node. */
 
while (__x != 0)
if (!_M_key_compare(_S_key(__x), __k))
__y = __x, __x = _S_left(__x);
else
__x = _S_right(__x);
 
return const_iterator(__y);
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::upper_bound(const _Key& __k)
{
_Link_type __y = _M_header; /* Last node which is greater than __k. */
_Link_type __x = _M_root(); /* Current node. */
 
while (__x != 0)
if (_M_key_compare(__k, _S_key(__x)))
__y = __x, __x = _S_left(__x);
else
__x = _S_right(__x);
 
return iterator(__y);
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::const_iterator
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::upper_bound(const _Key& __k) const
{
_Link_type __y = _M_header; /* Last node which is greater than __k. */
_Link_type __x = _M_root(); /* Current node. */
 
while (__x != 0)
if (_M_key_compare(__k, _S_key(__x)))
__y = __x, __x = _S_left(__x);
else
__x = _S_right(__x);
 
return const_iterator(__y);
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
inline
pair<typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator,
typename _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::iterator>
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
::equal_range(const _Key& __k)
{
return pair<iterator, iterator>(lower_bound(__k), upper_bound(__k));
}
 
template <class _Key, class _Value, class _KoV, class _Compare, class _Alloc>
inline
pair<typename _Rb_tree<_Key, _Value, _KoV, _Compare, _Alloc>::const_iterator,
typename _Rb_tree<_Key, _Value, _KoV, _Compare, _Alloc>::const_iterator>
_Rb_tree<_Key, _Value, _KoV, _Compare, _Alloc>
::equal_range(const _Key& __k) const
{
return pair<const_iterator,const_iterator>(lower_bound(__k),
upper_bound(__k));
}
 
inline int
__black_count(_Rb_tree_node_base* __node, _Rb_tree_node_base* __root)
{
if (__node == 0)
return 0;
int __sum = 0;
do {
if (__node->_M_color == _S_rb_tree_black)
++__sum;
if (__node == __root)
break;
__node = __node->_M_parent;
} while (1);
return __sum;
}
 
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
bool _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const
{
if (_M_node_count == 0 || begin() == end())
return _M_node_count == 0 && begin() == end() &&
_M_header->_M_left == _M_header && _M_header->_M_right == _M_header;
int __len = __black_count(_M_leftmost(), _M_root());
for (const_iterator __it = begin(); __it != end(); ++__it) {
_Link_type __x = (_Link_type) __it._M_node;
_Link_type __L = _S_left(__x);
_Link_type __R = _S_right(__x);
 
if (__x->_M_color == _S_rb_tree_red)
if ((__L && __L->_M_color == _S_rb_tree_red) ||
(__R && __R->_M_color == _S_rb_tree_red))
return false;
 
if (__L && _M_key_compare(_S_key(__x), _S_key(__L)))
return false;
if (__R && _M_key_compare(_S_key(__R), _S_key(__x)))
return false;
 
if (!__L && !__R && __black_count(__x, _M_root()) != __len)
return false;
}
 
if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root()))
return false;
if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root()))
return false;
 
return true;
}
 
// Class rb_tree is not part of the C++ standard. It is provided for
// compatibility with the HP STL.
 
template <class _Key, class _Value, class _KeyOfValue, class _Compare,
class _Alloc = allocator<_Value> >
struct rb_tree : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc>
{
typedef _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc> _Base;
typedef typename _Base::allocator_type allocator_type;
 
rb_tree(const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
: _Base(__comp, __a) {}
~rb_tree() {}
};
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_TREE_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_uninitialized.h
0,0 → 1,282
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef _CPP_BITS_STL_UNINITIALIZED_H
#define _CPP_BITS_STL_UNINITIALIZED_H 1
 
#include <bits/std_cstring.h>
 
namespace std
{
 
// uninitialized_copy
 
// Valid if copy construction is equivalent to assignment, and if the
// destructor is trivial.
template <class _InputIter, class _ForwardIter>
inline _ForwardIter
__uninitialized_copy_aux(_InputIter __first, _InputIter __last,
_ForwardIter __result,
__true_type)
{
return copy(__first, __last, __result);
}
 
template <class _InputIter, class _ForwardIter>
_ForwardIter
__uninitialized_copy_aux(_InputIter __first, _InputIter __last,
_ForwardIter __result,
__false_type)
{
_ForwardIter __cur = __result;
__STL_TRY {
for ( ; __first != __last; ++__first, ++__cur)
_Construct(&*__cur, *__first);
return __cur;
}
__STL_UNWIND(_Destroy(__result, __cur));
}
 
 
template <class _InputIter, class _ForwardIter, class _Tp>
inline _ForwardIter
__uninitialized_copy(_InputIter __first, _InputIter __last,
_ForwardIter __result, _Tp*)
{
typedef typename __type_traits<_Tp>::is_POD_type _Is_POD;
return __uninitialized_copy_aux(__first, __last, __result, _Is_POD());
}
 
template <class _InputIter, class _ForwardIter>
inline _ForwardIter
uninitialized_copy(_InputIter __first, _InputIter __last,
_ForwardIter __result)
{
return __uninitialized_copy(__first, __last, __result,
__value_type(__result));
}
 
inline char* uninitialized_copy(const char* __first, const char* __last,
char* __result) {
memmove(__result, __first, __last - __first);
return __result + (__last - __first);
}
 
inline wchar_t*
uninitialized_copy(const wchar_t* __first, const wchar_t* __last,
wchar_t* __result)
{
memmove(__result, __first, sizeof(wchar_t) * (__last - __first));
return __result + (__last - __first);
}
 
// uninitialized_copy_n (not part of the C++ standard)
 
template <class _InputIter, class _Size, class _ForwardIter>
pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result,
input_iterator_tag)
{
_ForwardIter __cur = __result;
__STL_TRY {
for ( ; __count > 0 ; --__count, ++__first, ++__cur)
_Construct(&*__cur, *__first);
return pair<_InputIter, _ForwardIter>(__first, __cur);
}
__STL_UNWIND(_Destroy(__result, __cur));
}
 
template <class _RandomAccessIter, class _Size, class _ForwardIter>
inline pair<_RandomAccessIter, _ForwardIter>
__uninitialized_copy_n(_RandomAccessIter __first, _Size __count,
_ForwardIter __result,
random_access_iterator_tag) {
_RandomAccessIter __last = __first + __count;
return pair<_RandomAccessIter, _ForwardIter>(
__last,
uninitialized_copy(__first, __last, __result));
}
 
template <class _InputIter, class _Size, class _ForwardIter>
inline pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) {
return __uninitialized_copy_n(__first, __count, __result,
__iterator_category(__first));
}
 
template <class _InputIter, class _Size, class _ForwardIter>
inline pair<_InputIter, _ForwardIter>
uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) {
return __uninitialized_copy_n(__first, __count, __result,
__iterator_category(__first));
}
 
// Valid if copy construction is equivalent to assignment, and if the
// destructor is trivial.
template <class _ForwardIter, class _Tp>
inline void
__uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last,
const _Tp& __x, __true_type)
{
fill(__first, __last, __x);
}
 
template <class _ForwardIter, class _Tp>
void
__uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last,
const _Tp& __x, __false_type)
{
_ForwardIter __cur = __first;
__STL_TRY {
for ( ; __cur != __last; ++__cur)
_Construct(&*__cur, __x);
}
__STL_UNWIND(_Destroy(__first, __cur));
}
 
template <class _ForwardIter, class _Tp, class _Tp1>
inline void __uninitialized_fill(_ForwardIter __first,
_ForwardIter __last, const _Tp& __x, _Tp1*)
{
typedef typename __type_traits<_Tp1>::is_POD_type _Is_POD;
__uninitialized_fill_aux(__first, __last, __x, _Is_POD());
}
 
template <class _ForwardIter, class _Tp>
inline void uninitialized_fill(_ForwardIter __first,
_ForwardIter __last,
const _Tp& __x)
{
__uninitialized_fill(__first, __last, __x, __value_type(__first));
}
 
// Valid if copy construction is equivalent to assignment, and if the
// destructor is trivial.
template <class _ForwardIter, class _Size, class _Tp>
inline _ForwardIter
__uninitialized_fill_n_aux(_ForwardIter __first, _Size __n,
const _Tp& __x, __true_type)
{
return fill_n(__first, __n, __x);
}
 
template <class _ForwardIter, class _Size, class _Tp>
_ForwardIter
__uninitialized_fill_n_aux(_ForwardIter __first, _Size __n,
const _Tp& __x, __false_type)
{
_ForwardIter __cur = __first;
__STL_TRY {
for ( ; __n > 0; --__n, ++__cur)
_Construct(&*__cur, __x);
return __cur;
}
__STL_UNWIND(_Destroy(__first, __cur));
}
 
template <class _ForwardIter, class _Size, class _Tp, class _Tp1>
inline _ForwardIter
__uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x, _Tp1*)
{
typedef typename __type_traits<_Tp1>::is_POD_type _Is_POD;
return __uninitialized_fill_n_aux(__first, __n, __x, _Is_POD());
}
 
template <class _ForwardIter, class _Size, class _Tp>
inline _ForwardIter
uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x)
{
return __uninitialized_fill_n(__first, __n, __x, __value_type(__first));
}
 
// Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill,
// __uninitialized_fill_copy.
 
// __uninitialized_copy_copy
// Copies [first1, last1) into [result, result + (last1 - first1)), and
// copies [first2, last2) into
// [result, result + (last1 - first1) + (last2 - first2)).
 
template <class _InputIter1, class _InputIter2, class _ForwardIter>
inline _ForwardIter
__uninitialized_copy_copy(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_ForwardIter __result)
{
_ForwardIter __mid = uninitialized_copy(__first1, __last1, __result);
__STL_TRY {
return uninitialized_copy(__first2, __last2, __mid);
}
__STL_UNWIND(_Destroy(__result, __mid));
}
 
// __uninitialized_fill_copy
// Fills [result, mid) with x, and copies [first, last) into
// [mid, mid + (last - first)).
template <class _ForwardIter, class _Tp, class _InputIter>
inline _ForwardIter
__uninitialized_fill_copy(_ForwardIter __result, _ForwardIter __mid,
const _Tp& __x,
_InputIter __first, _InputIter __last)
{
uninitialized_fill(__result, __mid, __x);
__STL_TRY {
return uninitialized_copy(__first, __last, __mid);
}
__STL_UNWIND(_Destroy(__result, __mid));
}
 
// __uninitialized_copy_fill
// Copies [first1, last1) into [first2, first2 + (last1 - first1)), and
// fills [first2 + (last1 - first1), last2) with x.
template <class _InputIter, class _ForwardIter, class _Tp>
inline void
__uninitialized_copy_fill(_InputIter __first1, _InputIter __last1,
_ForwardIter __first2, _ForwardIter __last2,
const _Tp& __x)
{
_ForwardIter __mid2 = uninitialized_copy(__first1, __last1, __first2);
__STL_TRY {
uninitialized_fill(__mid2, __last2, __x);
}
__STL_UNWIND(_Destroy(__first2, __mid2));
}
 
} // namespace std
 
#endif /* _CPP_BITS_STL_UNINITIALIZED_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/stl_vector.h
0,0 → 1,727
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_VECTOR_H
#define __SGI_STL_INTERNAL_VECTOR_H
 
#include <bits/stl_iterator_base_funcs.h>
#include <bits/functexcept.h>
#include <bits/concept_check.h>
 
namespace std
{
 
// The vector base class serves two purposes. First, its constructor
// and destructor allocate (but don't initialize) storage. This makes
// exception safety easier. Second, the base class encapsulates all of
// the differences between SGI-style allocators and standard-conforming
// allocators.
 
// Base class for ordinary allocators.
template <class _Tp, class _Allocator, bool _IsStatic>
class _Vector_alloc_base {
public:
typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return _M_data_allocator; }
 
_Vector_alloc_base(const allocator_type& __a)
: _M_data_allocator(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
{}
protected:
allocator_type _M_data_allocator;
_Tp* _M_start;
_Tp* _M_finish;
_Tp* _M_end_of_storage;
 
_Tp* _M_allocate(size_t __n)
{ return _M_data_allocator.allocate(__n); }
void _M_deallocate(_Tp* __p, size_t __n)
{ if (__p) _M_data_allocator.deallocate(__p, __n); }
};
 
// Specialization for allocators that have the property that we don't
// actually have to store an allocator object.
template <class _Tp, class _Allocator>
class _Vector_alloc_base<_Tp, _Allocator, true> {
public:
typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
 
_Vector_alloc_base(const allocator_type&)
: _M_start(0), _M_finish(0), _M_end_of_storage(0)
{}
protected:
_Tp* _M_start;
_Tp* _M_finish;
_Tp* _M_end_of_storage;
 
typedef typename _Alloc_traits<_Tp, _Allocator>::_Alloc_type _Alloc_type;
_Tp* _M_allocate(size_t __n)
{ return _Alloc_type::allocate(__n); }
void _M_deallocate(_Tp* __p, size_t __n)
{ _Alloc_type::deallocate(__p, __n);}
};
 
template <class _Tp, class _Alloc>
struct _Vector_base
: public _Vector_alloc_base<_Tp, _Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
{
typedef _Vector_alloc_base<_Tp, _Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
_Base;
typedef typename _Base::allocator_type allocator_type;
 
_Vector_base(const allocator_type& __a) : _Base(__a) {}
_Vector_base(size_t __n, const allocator_type& __a) : _Base(__a) {
_M_start = _M_allocate(__n);
_M_finish = _M_start;
_M_end_of_storage = _M_start + __n;
}
 
~_Vector_base() { _M_deallocate(_M_start, _M_end_of_storage - _M_start); }
};
 
 
template <class _Tp, class _Alloc = allocator<_Tp> >
class vector : protected _Vector_base<_Tp, _Alloc>
{
// concept requirements
__glibcpp_class_requires(_Tp, _SGIAssignableConcept);
 
private:
typedef _Vector_base<_Tp, _Alloc> _Base;
typedef vector<_Tp, _Alloc> vector_type;
public:
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef __normal_iterator<pointer, vector_type> iterator;
typedef __normal_iterator<const_pointer, vector_type> const_iterator;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
 
typedef typename _Base::allocator_type allocator_type;
allocator_type get_allocator() const { return _Base::get_allocator(); }
 
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
 
protected:
using _Base::_M_allocate;
using _Base::_M_deallocate;
using _Base::_M_start;
using _Base::_M_finish;
using _Base::_M_end_of_storage;
 
protected:
void _M_insert_aux(iterator __position, const _Tp& __x);
void _M_insert_aux(iterator __position);
 
public:
iterator begin() { return iterator (_M_start); }
const_iterator begin() const
{ return const_iterator (_M_start); }
iterator end() { return iterator (_M_finish); }
const_iterator end() const { return const_iterator (_M_finish); }
 
reverse_iterator rbegin()
{ return reverse_iterator(end()); }
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(end()); }
reverse_iterator rend()
{ return reverse_iterator(begin()); }
const_reverse_iterator rend() const
{ return const_reverse_iterator(begin()); }
 
size_type size() const
{ return size_type(end() - begin()); }
size_type max_size() const
{ return size_type(-1) / sizeof(_Tp); }
size_type capacity() const
{ return size_type(const_iterator(_M_end_of_storage) - begin()); }
bool empty() const
{ return begin() == end(); }
 
reference operator[](size_type __n) { return *(begin() + __n); }
const_reference operator[](size_type __n) const { return *(begin() + __n); }
 
void _M_range_check(size_type __n) const {
if (__n >= this->size())
__throw_out_of_range("vector");
}
 
reference at(size_type __n)
{ _M_range_check(__n); return (*this)[__n]; }
const_reference at(size_type __n) const
{ _M_range_check(__n); return (*this)[__n]; }
 
explicit vector(const allocator_type& __a = allocator_type())
: _Base(__a) {}
 
vector(size_type __n, const _Tp& __value,
const allocator_type& __a = allocator_type())
: _Base(__n, __a)
{ _M_finish = uninitialized_fill_n(_M_start, __n, __value); }
 
explicit vector(size_type __n)
: _Base(__n, allocator_type())
{ _M_finish = uninitialized_fill_n(_M_start, __n, _Tp()); }
 
vector(const vector<_Tp, _Alloc>& __x)
: _Base(__x.size(), __x.get_allocator())
{ _M_finish = uninitialized_copy(__x.begin(), __x.end(), _M_start); }
 
// Check whether it's an integral type. If so, it's not an iterator.
template <class _InputIterator>
vector(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type()) : _Base(__a) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_initialize_aux(__first, __last, _Integral());
}
 
template <class _Integer>
void _M_initialize_aux(_Integer __n, _Integer __value, __true_type) {
_M_start = _M_allocate(__n);
_M_end_of_storage = _M_start + __n;
_M_finish = uninitialized_fill_n(_M_start, __n, __value);
}
 
template <class _InputIterator>
void _M_initialize_aux(_InputIterator __first, _InputIterator __last,
__false_type) {
_M_range_initialize(__first, __last, __iterator_category(__first));
}
 
~vector() { destroy(_M_start, _M_finish); }
 
vector<_Tp, _Alloc>& operator=(const vector<_Tp, _Alloc>& __x);
void reserve(size_type __n) {
if (capacity() < __n) {
const size_type __old_size = size();
pointer __tmp = _M_allocate_and_copy(__n, _M_start, _M_finish);
destroy(_M_start, _M_finish);
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __tmp;
_M_finish = __tmp + __old_size;
_M_end_of_storage = _M_start + __n;
}
}
 
// assign(), a generalized assignment member function. Two
// versions: one that takes a count, and one that takes a range.
// The range version is a member template, so we dispatch on whether
// or not the type is an integer.
 
void assign(size_type __n, const _Tp& __val) { _M_fill_assign(__n, __val); }
void _M_fill_assign(size_type __n, const _Tp& __val);
 
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
 
template <class _Integer>
void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ _M_fill_assign((size_type) __n, (_Tp) __val); }
 
template <class _InputIter>
void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type)
{ _M_assign_aux(__first, __last, __iterator_category(__first)); }
 
template <class _InputIterator>
void _M_assign_aux(_InputIterator __first, _InputIterator __last,
input_iterator_tag);
 
template <class _ForwardIterator>
void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
 
reference front() { return *begin(); }
const_reference front() const { return *begin(); }
reference back() { return *(end() - 1); }
const_reference back() const { return *(end() - 1); }
 
void push_back(const _Tp& __x) {
if (_M_finish != _M_end_of_storage) {
construct(_M_finish, __x);
++_M_finish;
}
else
_M_insert_aux(end(), __x);
}
void push_back() {
if (_M_finish != _M_end_of_storage) {
construct(_M_finish);
++_M_finish;
}
else
_M_insert_aux(end());
}
void swap(vector<_Tp, _Alloc>& __x) {
std::swap(_M_start, __x._M_start);
std::swap(_M_finish, __x._M_finish);
std::swap(_M_end_of_storage, __x._M_end_of_storage);
}
 
iterator insert(iterator __position, const _Tp& __x) {
size_type __n = __position - begin();
if (_M_finish != _M_end_of_storage && __position == end()) {
construct(_M_finish, __x);
++_M_finish;
}
else
_M_insert_aux(iterator(__position), __x);
return begin() + __n;
}
iterator insert(iterator __position) {
size_type __n = __position - begin();
if (_M_finish != _M_end_of_storage && __position == end()) {
construct(_M_finish);
++_M_finish;
}
else
_M_insert_aux(iterator(__position));
return begin() + __n;
}
// Check whether it's an integral type. If so, it's not an iterator.
template <class _InputIterator>
void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_insert_dispatch(__pos, __first, __last, _Integral());
}
 
template <class _Integer>
void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
__true_type)
{ _M_fill_insert(__pos, (size_type) __n, (_Tp) __val); }
 
template <class _InputIterator>
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type) {
_M_range_insert(__pos, __first, __last, __iterator_category(__first));
}
 
void insert (iterator __pos, size_type __n, const _Tp& __x)
{ _M_fill_insert(__pos, __n, __x); }
 
void _M_fill_insert (iterator __pos, size_type __n, const _Tp& __x);
 
void pop_back() {
--_M_finish;
destroy(_M_finish);
}
iterator erase(iterator __position) {
if (__position + 1 != end())
copy(__position + 1, end(), __position);
--_M_finish;
destroy(_M_finish);
return __position;
}
iterator erase(iterator __first, iterator __last) {
iterator __i(copy(__last, end(), __first));
destroy(__i, end());
_M_finish = _M_finish - (__last - __first);
return __first;
}
 
void resize(size_type __new_size, const _Tp& __x) {
if (__new_size < size())
erase(begin() + __new_size, end());
else
insert(end(), __new_size - size(), __x);
}
void resize(size_type __new_size) { resize(__new_size, _Tp()); }
void clear() { erase(begin(), end()); }
 
protected:
 
template <class _ForwardIterator>
pointer _M_allocate_and_copy(size_type __n, _ForwardIterator __first,
_ForwardIterator __last)
{
pointer __result = _M_allocate(__n);
__STL_TRY {
uninitialized_copy(__first, __last, __result);
return __result;
}
__STL_UNWIND(_M_deallocate(__result, __n));
}
 
template <class _InputIterator>
void _M_range_initialize(_InputIterator __first,
_InputIterator __last, input_iterator_tag)
{
for ( ; __first != __last; ++__first)
push_back(*__first);
}
 
// This function is only called by the constructor.
template <class _ForwardIterator>
void _M_range_initialize(_ForwardIterator __first,
_ForwardIterator __last, forward_iterator_tag)
{
size_type __n = 0;
distance(__first, __last, __n);
_M_start = _M_allocate(__n);
_M_end_of_storage = _M_start + __n;
_M_finish = uninitialized_copy(__first, __last, _M_start);
}
 
template <class _InputIterator>
void _M_range_insert(iterator __pos,
_InputIterator __first, _InputIterator __last,
input_iterator_tag);
 
template <class _ForwardIterator>
void _M_range_insert(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
};
 
template <class _Tp, class _Alloc>
inline bool
operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
{
return __x.size() == __y.size() &&
equal(__x.begin(), __x.end(), __y.begin());
}
 
template <class _Tp, class _Alloc>
inline bool
operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
{
return lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end());
}
 
template <class _Tp, class _Alloc>
inline void swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
{
__x.swap(__y);
}
 
template <class _Tp, class _Alloc>
inline bool
operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) {
return !(__x == __y);
}
 
template <class _Tp, class _Alloc>
inline bool
operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) {
return __y < __x;
}
 
template <class _Tp, class _Alloc>
inline bool
operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) {
return !(__y < __x);
}
 
template <class _Tp, class _Alloc>
inline bool
operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) {
return !(__x < __y);
}
 
template <class _Tp, class _Alloc>
vector<_Tp,_Alloc>&
vector<_Tp,_Alloc>::operator=(const vector<_Tp, _Alloc>& __x)
{
if (&__x != this) {
const size_type __xlen = __x.size();
if (__xlen > capacity()) {
pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(), __x.end());
destroy(_M_start, _M_finish);
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __tmp;
_M_end_of_storage = _M_start + __xlen;
}
else if (size() >= __xlen) {
iterator __i(copy(__x.begin(), __x.end(), begin()));
destroy(__i, end());
}
else {
copy(__x.begin(), __x.begin() + size(), _M_start);
uninitialized_copy(__x.begin() + size(), __x.end(), _M_finish);
}
_M_finish = _M_start + __xlen;
}
return *this;
}
 
template <class _Tp, class _Alloc>
void vector<_Tp, _Alloc>::_M_fill_assign(size_t __n, const value_type& __val)
{
if (__n > capacity()) {
vector<_Tp, _Alloc> __tmp(__n, __val, get_allocator());
__tmp.swap(*this);
}
else if (__n > size()) {
fill(begin(), end(), __val);
_M_finish = uninitialized_fill_n(_M_finish, __n - size(), __val);
}
else
erase(fill_n(begin(), __n, __val), end());
}
 
template <class _Tp, class _Alloc> template <class _InputIter>
void vector<_Tp, _Alloc>::_M_assign_aux(_InputIter __first, _InputIter __last,
input_iterator_tag) {
iterator __cur(begin());
for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
*__cur = *__first;
if (__first == __last)
erase(__cur, end());
else
insert(end(), __first, __last);
}
 
template <class _Tp, class _Alloc> template <class _ForwardIter>
void
vector<_Tp, _Alloc>::_M_assign_aux(_ForwardIter __first, _ForwardIter __last,
forward_iterator_tag) {
size_type __len = 0;
distance(__first, __last, __len);
 
if (__len > capacity()) {
pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
destroy(_M_start, _M_finish);
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __tmp;
_M_end_of_storage = _M_finish = _M_start + __len;
}
else if (size() >= __len) {
iterator __new_finish(copy(__first, __last, _M_start));
destroy(__new_finish, end());
_M_finish = __new_finish.base();
}
else {
_ForwardIter __mid = __first;
advance(__mid, size());
copy(__first, __mid, _M_start);
_M_finish = uninitialized_copy(__mid, __last, _M_finish);
}
}
 
template <class _Tp, class _Alloc>
void
vector<_Tp, _Alloc>::_M_insert_aux(iterator __position, const _Tp& __x)
{
if (_M_finish != _M_end_of_storage) {
construct(_M_finish, *(_M_finish - 1));
++_M_finish;
_Tp __x_copy = __x;
copy_backward(__position, iterator(_M_finish - 2), iterator(_M_finish- 1));
*__position = __x_copy;
}
else {
const size_type __old_size = size();
const size_type __len = __old_size != 0 ? 2 * __old_size : 1;
iterator __new_start(_M_allocate(__len));
iterator __new_finish(__new_start);
__STL_TRY {
__new_finish = uninitialized_copy(iterator(_M_start), __position,
__new_start);
construct(__new_finish.base(), __x);
++__new_finish;
__new_finish = uninitialized_copy(__position, iterator(_M_finish),
__new_finish);
}
__STL_UNWIND((destroy(__new_start,__new_finish),
_M_deallocate(__new_start.base(),__len)));
destroy(begin(), end());
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __new_start.base();
_M_finish = __new_finish.base();
_M_end_of_storage = __new_start.base() + __len;
}
}
 
template <class _Tp, class _Alloc>
void
vector<_Tp, _Alloc>::_M_insert_aux(iterator __position)
{
if (_M_finish != _M_end_of_storage) {
construct(_M_finish, *(_M_finish - 1));
++_M_finish;
copy_backward(__position, iterator(_M_finish - 2),
iterator(_M_finish - 1));
*__position = _Tp();
}
else {
const size_type __old_size = size();
const size_type __len = __old_size != 0 ? 2 * __old_size : 1;
pointer __new_start = _M_allocate(__len);
pointer __new_finish = __new_start;
__STL_TRY {
__new_finish = uninitialized_copy(iterator(_M_start), __position,
__new_start);
construct(__new_finish);
++__new_finish;
__new_finish = uninitialized_copy(__position, iterator(_M_finish),
__new_finish);
}
__STL_UNWIND((destroy(__new_start,__new_finish),
_M_deallocate(__new_start,__len)));
destroy(begin(), end());
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __new_start;
_M_finish = __new_finish;
_M_end_of_storage = __new_start + __len;
}
}
 
template <class _Tp, class _Alloc>
void vector<_Tp, _Alloc>::_M_fill_insert(iterator __position, size_type __n,
const _Tp& __x)
{
if (__n != 0) {
if (size_type(_M_end_of_storage - _M_finish) >= __n) {
_Tp __x_copy = __x;
const size_type __elems_after = end() - __position;
iterator __old_finish(_M_finish);
if (__elems_after > __n) {
uninitialized_copy(_M_finish - __n, _M_finish, _M_finish);
_M_finish += __n;
copy_backward(__position, __old_finish - __n, __old_finish);
fill(__position, __position + __n, __x_copy);
}
else {
uninitialized_fill_n(_M_finish, __n - __elems_after, __x_copy);
_M_finish += __n - __elems_after;
uninitialized_copy(__position, __old_finish, _M_finish);
_M_finish += __elems_after;
fill(__position, __old_finish, __x_copy);
}
}
else {
const size_type __old_size = size();
const size_type __len = __old_size + max(__old_size, __n);
iterator __new_start(_M_allocate(__len));
iterator __new_finish(__new_start);
__STL_TRY {
__new_finish = uninitialized_copy(begin(), __position, __new_start);
__new_finish = uninitialized_fill_n(__new_finish, __n, __x);
__new_finish
= uninitialized_copy(__position, end(), __new_finish);
}
__STL_UNWIND((destroy(__new_start,__new_finish),
_M_deallocate(__new_start.base(),__len)));
destroy(_M_start, _M_finish);
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __new_start.base();
_M_finish = __new_finish.base();
_M_end_of_storage = __new_start.base() + __len;
}
}
}
 
template <class _Tp, class _Alloc> template <class _InputIterator>
void
vector<_Tp, _Alloc>::_M_range_insert(iterator __pos,
_InputIterator __first,
_InputIterator __last,
input_iterator_tag)
{
for ( ; __first != __last; ++__first) {
__pos = insert(__pos, *__first);
++__pos;
}
}
 
template <class _Tp, class _Alloc> template <class _ForwardIterator>
void
vector<_Tp, _Alloc>::_M_range_insert(iterator __position,
_ForwardIterator __first,
_ForwardIterator __last,
forward_iterator_tag)
{
if (__first != __last) {
size_type __n = 0;
distance(__first, __last, __n);
if (size_type(_M_end_of_storage - _M_finish) >= __n) {
const size_type __elems_after = end() - __position;
iterator __old_finish(_M_finish);
if (__elems_after > __n) {
uninitialized_copy(_M_finish - __n, _M_finish, _M_finish);
_M_finish += __n;
copy_backward(__position, __old_finish - __n, __old_finish);
copy(__first, __last, __position);
}
else {
_ForwardIterator __mid = __first;
advance(__mid, __elems_after);
uninitialized_copy(__mid, __last, _M_finish);
_M_finish += __n - __elems_after;
uninitialized_copy(__position, __old_finish, _M_finish);
_M_finish += __elems_after;
copy(__first, __mid, __position);
}
}
else {
const size_type __old_size = size();
const size_type __len = __old_size + max(__old_size, __n);
iterator __new_start(_M_allocate(__len));
iterator __new_finish(__new_start);
__STL_TRY {
__new_finish = uninitialized_copy(iterator(_M_start),
__position, __new_start);
__new_finish = uninitialized_copy(__first, __last, __new_finish);
__new_finish
= uninitialized_copy(__position, iterator(_M_finish), __new_finish);
}
__STL_UNWIND((destroy(__new_start,__new_finish),
_M_deallocate(__new_start.base(),__len)));
destroy(_M_start, _M_finish);
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __new_start.base();
_M_finish = __new_finish.base();
_M_end_of_storage = __new_start.base() + __len;
}
}
}
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_VECTOR_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/streambuf.tcc
0,0 → 1,230
// Stream buffer classes -*- C++ -*-
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.5 Stream buffers
//
 
#ifndef _CPP_BITS_STREAMBUF_TCC
#define _CPP_BITS_STREAMBUF_TCC 1
 
namespace std {
 
template<typename _CharT, typename _Traits>
basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::
sbumpc()
{
int_type __ret;
if (_M_in_cur && _M_in_cur < _M_in_end)
{
char_type __c = *gptr();
_M_in_cur_move(1);
__ret = traits_type::to_int_type(__c);
}
else
__ret = this->uflow();
return __ret;
}
 
template<typename _CharT, typename _Traits>
basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::
sputbackc(char_type __c)
{
int_type __ret;
bool __testpos = _M_in_cur && _M_in_beg < _M_in_cur;
bool __testne = _M_in_cur && !traits_type::eq(__c, this->gptr()[-1]);
if (!__testpos || __testne)
__ret = pbackfail(traits_type::to_int_type(__c));
else
{
_M_in_cur_move(-1);
__ret = traits_type::to_int_type(*this->gptr());
}
return __ret;
}
template<typename _CharT, typename _Traits>
basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::
sungetc()
{
int_type __ret;
if (_M_in_cur && _M_in_beg < _M_in_cur)
{
_M_in_cur_move(-1);
__ret = traits_type::to_int_type(*_M_in_cur);
}
else
__ret = this->pbackfail();
return __ret;
}
 
// Don't test against _M_buf + _M_buf_size, because _M_buf reflects
// allocated space, and on certain (rare but entirely legal)
// situations, there will be no allocated space yet the internal
// buffers will still be valid. (This happens if setp is used to set
// the internal buffer to say some externally-allocated sequence.)
template<typename _CharT, typename _Traits>
basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::
sputc(char_type __c)
{
int_type __ret;
if (_M_out_buf_size())
{
*_M_out_cur = __c;
_M_out_cur_move(1);
__ret = traits_type::to_int_type(__c);
}
else
__ret = this->overflow(traits_type::to_int_type(__c));
return __ret;
}
 
template<typename _CharT, typename _Traits>
streamsize
basic_streambuf<_CharT, _Traits>::
xsgetn(char_type* __s, streamsize __n)
{
streamsize __ret = 0;
while (__ret < __n)
{
size_t __buf_len = _M_in_end - _M_in_cur;
if (__buf_len > 0)
{
size_t __remaining = __n - __ret;
size_t __len = min(__buf_len, __remaining);
traits_type::copy(__s, _M_in_cur, __len);
__ret += __len;
__s += __len;
_M_in_cur_move(__len);
}
if (__ret < __n)
{
int_type __c = this->uflow();
if (__c != traits_type::eof())
{
traits_type::assign(*__s++, traits_type::to_char_type(__c));
++__ret;
}
else
break;
}
}
return __ret;
}
 
// Don't test against _M_buf + _M_buf_size, because _M_buf reflects
// allocated space, and on certain (rare but entirely legal)
// situations, there will be no allocated space yet the internal
// buffers will still be valid. (This happens if setp is used to set
// the internal buffer to say some externally-allocated sequence.)
template<typename _CharT, typename _Traits>
streamsize
basic_streambuf<_CharT, _Traits>::
xsputn(const char_type* __s, streamsize __n)
{
streamsize __ret = 0;
while (__ret < __n)
{
off_type __buf_len = _M_out_buf_size();
if (__buf_len > 0)
{
off_type __remaining = __n - __ret;
off_type __len = min(__buf_len, __remaining);
traits_type::copy(_M_out_cur, __s, __len);
__ret += __len;
__s += __len;
_M_out_cur_move(__len);
}
 
if (__ret < __n)
{
int_type __c = this->overflow(traits_type::to_int_type(*__s));
if (__c != traits_type::eof())
{
++__ret;
++__s;
}
else
break;
}
}
return __ret;
}
 
// Conceivably, this could be used to implement buffer-to-buffer
// copies, if this was ever desired in an un-ambiguous way by the
// standard. If so, then checks for __ios being zero would be
// necessary.
template<typename _CharT, typename _Traits>
streamsize
__copy_streambufs(basic_ios<_CharT, _Traits>& __ios,
basic_streambuf<_CharT, _Traits>* __sbin,
basic_streambuf<_CharT, _Traits>* __sbout)
{
typedef typename _Traits::int_type int_type;
 
streamsize __ret = 0;
streamsize __bufsize = __sbin->in_avail();
streamsize __xtrct;
bool __testput = __sbout->_M_mode & ios_base::out;
try {
while (__testput && __bufsize != -1)
{
__xtrct = __sbout->sputn(__sbin->gptr(), __bufsize);
__ret += __xtrct;
__sbin->_M_in_cur_move(__xtrct);
if (__xtrct == __bufsize)
{
int_type __c = __sbin->sgetc();
if (__c == _Traits::eof())
{
__ios.setstate(ios_base::eofbit);
break;
}
__bufsize = __sbin->in_avail();
}
else
break;
}
}
catch(exception& __fail) {
if ((__ios.exceptions() & ios_base::failbit) != 0)
__throw_exception_again;
}
return __ret;
}
} // namespace std
 
#endif // _CPP_BITS_STREAMBUF_TCC
 
/contrib/media/updf/include/bits/stringfwd.h
0,0 → 1,68
// String support -*- C++ -*-
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 21 Strings library
//
 
#ifndef _CPP_BITS_STRINGFWD_H
#define _CPP_BITS_STRINGFWD_H 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
 
namespace std
{
template<class _CharT>
struct char_traits;
template<> class char_traits<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template<> class char_traits<wchar_t>;
#endif
 
template<typename _Alloc>
class allocator;
 
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_string;
 
typedef basic_string<char> string;
#ifdef _GLIBCPP_USE_WCHAR_T
typedef basic_string<wchar_t> wstring;
#endif
} // namespace std
 
#endif // _CPP_BITS_STRINGFWD_H
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/type_traits.h
0,0 → 1,314
/*
*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef _CPP_BITS_TYPE_TRAITS_H
#define _CPP_BITS_TYPE_TRAITS_H 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
 
/*
This header file provides a framework for allowing compile time dispatch
based on type attributes. This is useful when writing template code.
For example, when making a copy of an array of an unknown type, it helps
to know if the type has a trivial copy constructor or not, to help decide
if a memcpy can be used.
 
The class template __type_traits provides a series of typedefs each of
which is either __true_type or __false_type. The argument to
__type_traits can be any type. The typedefs within this template will
attain their correct values by one of these means:
1. The general instantiation contain conservative values which work
for all types.
2. Specializations may be declared to make distinctions between types.
3. Some compilers (such as the Silicon Graphics N32 and N64 compilers)
will automatically provide the appropriate specializations for all
types.
 
EXAMPLE:
 
//Copy an array of elements which have non-trivial copy constructors
template <class _Tp> void
copy(_Tp* __source,_Tp* __destination,int __n,__false_type);
//Copy an array of elements which have trivial copy constructors. Use memcpy.
template <class _Tp> void
copy(_Tp* __source,_Tp* __destination,int __n,__true_type);
 
//Copy an array of any type by using the most efficient copy mechanism
template <class _Tp> inline void copy(_Tp* __source,_Tp* __destination,int __n) {
copy(__source,__destination,__n,
typename __type_traits<_Tp>::has_trivial_copy_constructor());
}
*/
 
 
template <bool _Truth> struct _Bool {};
typedef _Bool<true> __true_type;
typedef _Bool<false> __false_type;
 
template <class _Tp>
struct __type_traits {
typedef __true_type this_dummy_member_must_be_first;
/* Do not remove this member. It informs a compiler which
automatically specializes __type_traits that this
__type_traits template is special. It just makes sure that
things work if an implementation is using a template
called __type_traits for something unrelated. */
 
/* The following restrictions should be observed for the sake of
compilers which automatically produce type specific specializations
of this class:
- You may reorder the members below if you wish
- You may remove any of the members below if you wish
- You must not rename members without making the corresponding
name change in the compiler
- Members you add will be treated like regular members unless
you add the appropriate support in the compiler. */
 
typedef __false_type has_trivial_default_constructor;
typedef __false_type has_trivial_copy_constructor;
typedef __false_type has_trivial_assignment_operator;
typedef __false_type has_trivial_destructor;
typedef __false_type is_POD_type;
};
 
 
// Provide some specializations.
 
template<> struct __type_traits<bool> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<char> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<signed char> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<unsigned char> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<wchar_t> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<short> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<unsigned short> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<int> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<unsigned int> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<unsigned long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
#ifdef _GLIBCPP_USE_LONG_LONG
 
template<> struct __type_traits<long long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<unsigned long long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
#endif /* _GLIBCPP_USE_LONG_LONG */
 
template<> struct __type_traits<float> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<double> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template<> struct __type_traits<long double> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
template <class _Tp>
struct __type_traits<_Tp*> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
 
 
// The following could be written in terms of numeric_limits.
// We're doing it separately to reduce the number of dependencies.
 
template <class _Tp> struct _Is_integer {
typedef __false_type _Integral;
};
 
template<> struct _Is_integer<bool> {
typedef __true_type _Integral;
};
 
template<> struct _Is_integer<char> {
typedef __true_type _Integral;
};
 
template<> struct _Is_integer<signed char> {
typedef __true_type _Integral;
};
 
template<> struct _Is_integer<unsigned char> {
typedef __true_type _Integral;
};
 
template<> struct _Is_integer<wchar_t> {
typedef __true_type _Integral;
};
 
template<> struct _Is_integer<short> {
typedef __true_type _Integral;
};
 
template<> struct _Is_integer<unsigned short> {
typedef __true_type _Integral;
};
 
template<> struct _Is_integer<int> {
typedef __true_type _Integral;
};
 
template<> struct _Is_integer<unsigned int> {
typedef __true_type _Integral;
};
 
template<> struct _Is_integer<long> {
typedef __true_type _Integral;
};
 
template<> struct _Is_integer<unsigned long> {
typedef __true_type _Integral;
};
 
#ifdef _GLIBCPP_USE_LONG_LONG
 
template<> struct _Is_integer<long long> {
typedef __true_type _Integral;
};
 
template<> struct _Is_integer<unsigned long long> {
typedef __true_type _Integral;
};
 
#endif /* _GLIBCPP_USE_LONG_LONG */
 
template<typename _Tp> struct _Is_normal_iterator {
typedef __false_type _Normal;
};
 
// Forward declaration hack, should really include this from somewhere.
namespace std {
template<typename _Iterator, typename _Container> class __normal_iterator;
};
 
template<typename _Iterator, typename _Container>
struct _Is_normal_iterator< std::__normal_iterator<_Iterator, _Container> > {
typedef __true_type _Normal;
};
 
#endif /* _CPP_BITS_TYPE_TRAITS_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/bits/valarray_array.h
0,0 → 1,577
// The template and inlines for the -*- C++ -*- internal _Array helper class.
 
// Copyright (C) 1997-2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
 
#ifndef _CPP_BITS_ARRAY_H
#define _CPP_BITS_ARRAY_H 1
 
#pragma GCC system_header
 
#include <bits/c++config.h>
#include <bits/cpp_type_traits.h>
#include <bits/std_cstdlib.h>
#include <bits/std_cstring.h>
#include <new>
 
namespace std
{
//
// Helper functions on raw pointers
//
// We get memory by the old fashion way
inline void*
__valarray_get_memory(size_t __n)
{ return operator new(__n); }
template<typename _Tp>
inline _Tp*__restrict__
__valarray_get_storage(size_t __n)
{
return static_cast<_Tp*__restrict__>
(__valarray_get_memory(__n * sizeof(_Tp)));
}
 
// Return memory to the system
inline void
__valarray_release_memory(void* __p)
{ operator delete(__p); }
 
// Turn a raw-memory into an array of _Tp filled with _Tp()
// This is required in 'valarray<T> v(n);'
template<typename _Tp, bool>
struct _Array_default_ctor
{
// Please note that this isn't exception safe. But
// valarrays aren't required to be exception safe.
inline static void
_S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
{ while (__b != __e) new(__b++) _Tp(); }
};
 
template<typename _Tp>
struct _Array_default_ctor<_Tp, true>
{
// For fundamental types, it suffices to say 'memset()'
inline static void
_S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
{ memset(__b, 0, (__e - __b)*sizeof(_Tp)); }
};
 
template<typename _Tp>
inline void
__valarray_default_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
{
_Array_default_ctor<_Tp, __is_fundamental<_Tp>::_M_type>::
_S_do_it(__b, __e);
}
// Turn a raw-memory into an array of _Tp filled with __t
// This is the required in valarray<T> v(n, t). Also
// used in valarray<>::resize().
template<typename _Tp, bool>
struct _Array_init_ctor
{
// Please note that this isn't exception safe. But
// valarrays aren't required to be exception safe.
inline static void
_S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e, const _Tp __t)
{ while (__b != __e) new(__b++) _Tp(__t); }
};
 
template<typename _Tp>
struct _Array_init_ctor<_Tp, true>
{
inline static void
_S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e, const _Tp __t)
{ while (__b != __e) *__b++ = __t; }
};
 
template<typename _Tp>
inline void
__valarray_fill_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e,
const _Tp __t)
{
_Array_init_ctor<_Tp, __is_fundamental<_Tp>::_M_type>::
_S_do_it(__b, __e, __t);
}
 
//
// copy-construct raw array [__o, *) from plain array [__b, __e)
// We can't just say 'memcpy()'
//
template<typename _Tp, bool>
struct _Array_copy_ctor
{
// Please note that this isn't exception safe. But
// valarrays aren't required to be exception safe.
inline static void
_S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
_Tp* __restrict__ __o)
{ while (__b != __e) new(__o++) _Tp(*__b++); }
};
 
template<typename _Tp>
struct _Array_copy_ctor<_Tp, true>
{
inline static void
_S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
_Tp* __restrict__ __o)
{ memcpy(__o, __b, (__e - __b)*sizeof(_Tp)); }
};
 
template<typename _Tp>
inline void
__valarray_copy_construct(const _Tp* __restrict__ __b,
const _Tp* __restrict__ __e,
_Tp* __restrict__ __o)
{
_Array_copy_ctor<_Tp, __is_fundamental<_Tp>::_M_type>::
_S_do_it(__b, __e, __o);
}
 
// copy-construct raw array [__o, *) from strided array __a[<__n : __s>]
template<typename _Tp>
inline void
__valarray_copy_construct (const _Tp* __restrict__ __a, size_t __n,
size_t __s, _Tp* __restrict__ __o)
{
if (__is_fundamental<_Tp>::_M_type)
while (__n--) { *__o++ = *__a; __a += __s; }
else
while (__n--) { new(__o++) _Tp(*__a); __a += __s; }
}
 
// copy-construct raw array [__o, *) from indexed array __a[__i[<__n>]]
template<typename _Tp>
inline void
__valarray_copy_construct (const _Tp* __restrict__ __a,
const size_t* __restrict__ __i,
_Tp* __restrict__ __o, size_t __n)
{
if (__is_fundamental<_Tp>::_M_type)
while (__n--) *__o++ = __a[*__i++];
else
while (__n--) new (__o++) _Tp(__a[*__i++]);
}
 
// Do the necessary cleanup when we're done with arrays.
template<typename _Tp>
inline void
__valarray_destroy_elements(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
{
if (!__is_fundamental<_Tp>::_M_type)
while (__b != __e) { __b->~_Tp(); ++__b; }
}
// fill plain array __a[<__n>] with __t
template<typename _Tp>
void
__valarray_fill (_Tp* __restrict__ __a, size_t __n, const _Tp& __t)
{ while (__n--) *__a++ = __t; }
// fill strided array __a[<__n-1 : __s>] with __t
template<typename _Tp>
inline void
__valarray_fill (_Tp* __restrict__ __a, size_t __n,
size_t __s, const _Tp& __t)
{ for (size_t __i=0; __i<__n; ++__i, __a+=__s) *__a = __t; }
 
// fill indir ect array __a[__i[<__n>]] with __i
template<typename _Tp>
inline void
__valarray_fill(_Tp* __restrict__ __a, const size_t* __restrict__ __i,
size_t __n, const _Tp& __t)
{ for (size_t __j=0; __j<__n; ++__j, ++__i) __a[*__i] = __t; }
// copy plain array __a[<__n>] in __b[<__n>]
// For non-fundamental types, it is wrong to say 'memcpy()'
template<typename _Tp, bool>
struct _Array_copier
{
inline static void
_S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
{ while (__n--) *__b++ = *__a++; }
};
 
template<typename _Tp>
struct _Array_copier<_Tp, true>
{
inline static void
_S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
{ memcpy (__b, __a, __n * sizeof (_Tp)); }
};
 
template<typename _Tp>
inline void
__valarray_copy (const _Tp* __restrict__ __a, size_t __n,
_Tp* __restrict__ __b)
{
_Array_copier<_Tp, __is_fundamental<_Tp>::_M_type>::
_S_do_it(__a, __n, __b);
}
 
// copy strided array __a[<__n : __s>] in plain __b[<__n>]
template<typename _Tp>
inline void
__valarray_copy (const _Tp* __restrict__ __a, size_t __n, size_t __s,
_Tp* __restrict__ __b)
{ for (size_t __i=0; __i<__n; ++__i, ++__b, __a += __s) *__b = *__a; }
 
// copy plain __a[<__n>] in strided __b[<__n : __s>]
template<typename _Tp>
inline void
__valarray_copy (const _Tp* __restrict__ __a, _Tp* __restrict__ __b,
size_t __n, size_t __s)
{ for (size_t __i=0; __i<__n; ++__i, ++__a, __b+=__s) *__b = *__a; }
// copy indexed __a[__i[<__n>]] in plain __b[<__n>]
template<typename _Tp>
inline void
__valarray_copy (const _Tp* __restrict__ __a,
const size_t* __restrict__ __i,
_Tp* __restrict__ __b, size_t __n)
{ for (size_t __j=0; __j<__n; ++__j, ++__b, ++__i) *__b = __a[*__i]; }
 
// copy plain __a[<__n>] in indexed __b[__i[<__n>]]
template<typename _Tp>
inline void
__valarray_copy (const _Tp* __restrict__ __a, size_t __n,
_Tp* __restrict__ __b, const size_t* __restrict__ __i)
{ for (size_t __j=0; __j<__n; ++__j, ++__a, ++__i) __b[*__i] = *__a; }
 
 
//
// Compute the sum of elements in range [__f, __l)
// This is a naive algorithm. It suffers from cancelling.
// In the future try to specialize
// for _Tp = float, double, long double using a more accurate
// algorithm.
//
template<typename _Tp>
inline _Tp
__valarray_sum(const _Tp* __restrict__ __f, const _Tp* __restrict__ __l)
{
_Tp __r = _Tp();
while (__f != __l) __r += *__f++;
return __r;
}
 
// Compute the product of all elements in range [__f, __l)
template<typename _Tp>
inline _Tp
__valarray_product(const _Tp* __restrict__ __f,
const _Tp* __restrict__ __l)
{
_Tp __r = _Tp(1);
while (__f != __l) __r = __r * *__f++;
return __r;
}
 
// Compute the min/max of an array-expression
template<typename _Ta>
inline typename _Ta::value_type
__valarray_min(const _Ta& __a)
{
size_t __s = __a.size();
typedef typename _Ta::value_type _Value_type;
_Value_type __r = __s == 0 ? _Value_type() : __a[0];
for (size_t __i = 1; __i < __s; ++__i)
{
_Value_type __t = __a[__i];
if (__t < __r)
__r = __t;
}
return __r;
}
template<typename _Ta>
inline typename _Ta::value_type
__valarray_max(const _Ta& __a)
{
size_t __s = __a.size();
typedef typename _Ta::value_type _Value_type;
_Value_type __r = __s == 0 ? _Value_type() : __a[0];
for (size_t __i = 1; __i < __s; ++__i)
{
_Value_type __t = __a[__i];
if (__t > __r)
__r = __t;
}
return __r;
}
//
// Helper class _Array, first layer of valarray abstraction.
// All operations on valarray should be forwarded to this class
// whenever possible. -- gdr
//
template<typename _Tp>
struct _Array
{
explicit _Array (size_t);
explicit _Array (_Tp* const __restrict__);
explicit _Array (const valarray<_Tp>&);
_Array (const _Tp* __restrict__, size_t);
_Tp* begin () const;
_Tp* const __restrict__ _M_data;
};
template<typename _Tp>
inline void
__valarray_fill (_Array<_Tp> __a, size_t __n, const _Tp& __t)
{ __valarray_fill (__a._M_data, __n, __t); }
template<typename _Tp>
inline void
__valarray_fill (_Array<_Tp> __a, size_t __n, size_t __s, const _Tp& __t)
{ __valarray_fill (__a._M_data, __n, __s, __t); }
template<typename _Tp>
inline void
__valarray_fill (_Array<_Tp> __a, _Array<size_t> __i,
size_t __n, const _Tp& __t)
{ __valarray_fill (__a._M_data, __i._M_data, __n, __t); }
 
template<typename _Tp>
inline void
__valarray_copy (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b)
{ __valarray_copy (__a._M_data, __n, __b._M_data); }
template<typename _Tp>
inline void
__valarray_copy (_Array<_Tp> __a, size_t __n, size_t __s, _Array<_Tp> __b)
{ __valarray_copy(__a._M_data, __n, __s, __b._M_data); }
template<typename _Tp>
inline void
__valarray_copy (_Array<_Tp> __a, _Array<_Tp> __b, size_t __n, size_t __s)
{ __valarray_copy (__a._M_data, __b._M_data, __n, __s); }
template<typename _Tp>
inline void
__valarray_copy (_Array<_Tp> __a, _Array<size_t> __i,
_Array<_Tp> __b, size_t __n)
{ __valarray_copy (__a._M_data, __i._M_data, __b._M_data, __n); }
template<typename _Tp>
inline void
__valarray_copy (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
_Array<size_t> __i)
{ __valarray_copy (__a._M_data, __n, __b._M_data, __i._M_data); }
 
template<typename _Tp>
inline
_Array<_Tp>::_Array (size_t __n)
: _M_data(__valarray_get_storage<_Tp>(__n))
{ __valarray_default_construct(_M_data, _M_data + __n); }
 
template<typename _Tp>
inline
_Array<_Tp>::_Array (_Tp* const __restrict__ __p) : _M_data (__p) {}
template<typename _Tp>
inline _Array<_Tp>::_Array (const valarray<_Tp>& __v)
: _M_data (__v._M_data) {}
template<typename _Tp>
inline
_Array<_Tp>::_Array (const _Tp* __restrict__ __b, size_t __s)
: _M_data(__valarray_get_storage<_Tp>(__s))
{ __valarray_copy_construct(__b, __s, _M_data); }
 
template<typename _Tp>
inline _Tp*
_Array<_Tp>::begin () const
{ return _M_data; }
 
#define _DEFINE_ARRAY_FUNCTION(_Op, _Name) \
template<typename _Tp> \
inline void \
_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, const _Tp& __t) \
{ \
for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p) \
*__p _Op##= __t; \
} \
\
template<typename _Tp> \
inline void \
_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b) \
{ \
_Tp* __p = __a._M_data; \
for (_Tp* __q=__b._M_data; __q<__b._M_data+__n; ++__p, ++__q) \
*__p _Op##= *__q; \
} \
\
template<typename _Tp, class _Dom> \
void \
_Array_augmented_##_Name (_Array<_Tp> __a, \
const _Expr<_Dom,_Tp>& __e, size_t __n) \
{ \
_Tp* __p (__a._M_data); \
for (size_t __i=0; __i<__n; ++__i, ++__p) *__p _Op##= __e[__i]; \
} \
\
template<typename _Tp> \
inline void \
_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, size_t __s, \
_Array<_Tp> __b) \
{ \
_Tp* __q (__b._M_data); \
for (_Tp* __p=__a._M_data; __p<__a._M_data+__s*__n; __p+=__s, ++__q) \
*__p _Op##= *__q; \
} \
\
template<typename _Tp> \
inline void \
_Array_augmented_##_Name (_Array<_Tp> __a, _Array<_Tp> __b, \
size_t __n, size_t __s) \
{ \
_Tp* __q (__b._M_data); \
for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p, __q+=__s) \
*__p _Op##= *__q; \
} \
\
template<typename _Tp, class _Dom> \
void \
_Array_augmented_##_Name (_Array<_Tp> __a, size_t __s, \
const _Expr<_Dom,_Tp>& __e, size_t __n) \
{ \
_Tp* __p (__a._M_data); \
for (size_t __i=0; __i<__n; ++__i, __p+=__s) *__p _Op##= __e[__i]; \
} \
\
template<typename _Tp> \
inline void \
_Array_augmented_##_Name (_Array<_Tp> __a, _Array<size_t> __i, \
_Array<_Tp> __b, size_t __n) \
{ \
_Tp* __q (__b._M_data); \
for (size_t* __j=__i._M_data; __j<__i._M_data+__n; ++__j, ++__q) \
__a._M_data[*__j] _Op##= *__q; \
} \
\
template<typename _Tp> \
inline void \
_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, \
_Array<_Tp> __b, _Array<size_t> __i) \
{ \
_Tp* __p (__a._M_data); \
for (size_t* __j=__i._M_data; __j<__i._M_data+__n; ++__j, ++__p) \
*__p _Op##= __b._M_data[*__j]; \
} \
\
template<typename _Tp, class _Dom> \
void \
_Array_augmented_##_Name (_Array<_Tp> __a, _Array<size_t> __i, \
const _Expr<_Dom, _Tp>& __e, size_t __n) \
{ \
size_t* __j (__i._M_data); \
for (size_t __k=0; __k<__n; ++__k, ++__j) \
__a._M_data[*__j] _Op##= __e[__k]; \
} \
\
template<typename _Tp> \
void \
_Array_augmented_##_Name (_Array<_Tp> __a, _Array<bool> __m, \
_Array<_Tp> __b, size_t __n) \
{ \
bool* ok (__m._M_data); \
_Tp* __p (__a._M_data); \
for (_Tp* __q=__b._M_data; __q<__b._M_data+__n; ++__q, ++ok, ++__p) { \
while (! *ok) { \
++ok; \
++__p; \
} \
*__p _Op##= *__q; \
} \
} \
\
template<typename _Tp> \
void \
_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, \
_Array<_Tp> __b, _Array<bool> __m) \
{ \
bool* ok (__m._M_data); \
_Tp* __q (__b._M_data); \
for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p, ++ok, ++__q) { \
while (! *ok) { \
++ok; \
++__q; \
} \
*__p _Op##= *__q; \
} \
} \
\
template<typename _Tp, class _Dom> \
void \
_Array_augmented_##_Name (_Array<_Tp> __a, _Array<bool> __m, \
const _Expr<_Dom, _Tp>& __e, size_t __n) \
{ \
bool* ok(__m._M_data); \
_Tp* __p (__a._M_data); \
for (size_t __i=0; __i<__n; ++__i, ++ok, ++__p) { \
while (! *ok) { \
++ok; \
++__p; \
} \
*__p _Op##= __e[__i]; \
} \
}
 
_DEFINE_ARRAY_FUNCTION(+, plus)
_DEFINE_ARRAY_FUNCTION(-, minus)
_DEFINE_ARRAY_FUNCTION(*, multiplies)
_DEFINE_ARRAY_FUNCTION(/, divides)
_DEFINE_ARRAY_FUNCTION(%, modulus)
_DEFINE_ARRAY_FUNCTION(^, xor)
_DEFINE_ARRAY_FUNCTION(|, or)
_DEFINE_ARRAY_FUNCTION(&, and)
_DEFINE_ARRAY_FUNCTION(<<, shift_left)
_DEFINE_ARRAY_FUNCTION(>>, shift_right)
 
#undef _DEFINE_VALARRAY_FUNCTION
 
} // std::
 
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
# include <bits/valarray_array.tcc>
#endif
#endif /* _CPP_BITS_ARRAY_H */
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/valarray_array.tcc
0,0 → 1,161
// The template and inlines for the -*- C++ -*- internal _Array helper class.
 
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
 
#ifndef _CPP_BITS_VALARRAY_ARRAY_TCC
#define _CPP_BITS_VALARRAY_ARRAY_TCC 1
 
namespace std
{
 
export template<typename _Tp>
void
__valarray_fill (_Array<_Tp> __a, size_t __n, _Array<bool> __m, const _Tp& __t)
{
_Tp* __p = __a._M_data;
bool* __ok (__m._M_data);
for (size_t __i=0; __i<__n; ++__i, ++__ok, ++__p) {
while (! *__ok) {
++__ok;
++__p;
}
*__p = __t;
}
}
 
export template<typename _Tp>
void
__valarray_copy (_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b, size_t __n)
{
_Tp* __p (__a._M_data);
bool* __ok (__m._M_data);
for (_Tp* __q=__b._M_data; __q<__b._M_data+__n; ++__q, ++__ok, ++__p) {
while (! *__ok) {
++__ok;
++__p;
}
*__q = *__p;
}
}
 
export template<typename _Tp>
void
__valarray_copy (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b, _Array<bool> __m)
{
_Tp* __q (__b._M_data);
bool* __ok (__m._M_data);
for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p, ++__ok, ++__q) {
while (! *__ok) {
++__ok;
++__q;
}
*__q = *__p;
}
}
 
export template<typename _Tp, class _Dom>
void
__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a)
{
_Tp* __p (__a._M_data);
for (size_t __i=0; __i<__n; ++__i, ++__p) *__p = __e[__i];
}
 
export template<typename _Tp, class _Dom>
void
__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n,
_Array<_Tp> __a, size_t __s)
{
_Tp* __p (__a._M_data);
for (size_t __i=0; __i<__n; ++__i, __p+=__s) *__p = __e[__i];
}
 
export template<typename _Tp, class _Dom>
void
__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n,
_Array<_Tp> __a, _Array<size_t> __i)
{
size_t* __j (__i._M_data);
for (size_t __k=0; __k<__n; ++__k, ++__j) __a._M_data[*__j] = __e[__k];
}
 
export template<typename _Tp, class _Dom>
void
__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n,
_Array<_Tp> __a, _Array<bool> __m)
{
bool* __ok (__m._M_data);
_Tp* __p (__a._M_data);
for (size_t __i=0; __i<__n; ++__i, ++__ok, ++__p) {
while (! *__ok) {
++__ok;
++__p;
}
*__p = __e[__i];
}
}
 
 
export template<typename _Tp, class _Dom>
void
__valarray_copy_construct (const _Expr<_Dom, _Tp>& __e, size_t __n,
_Array<_Tp> __a)
{
_Tp* __p (__a._M_data);
for (size_t __i=0; __i<__n; ++__i, ++__p) new (__p) _Tp(__e[__i]);
}
 
 
export template<typename _Tp>
void
__valarray_copy_construct (_Array<_Tp> __a, _Array<bool> __m,
_Array<_Tp> __b, size_t __n)
{
_Tp* __p (__a._M_data);
bool* __ok (__m._M_data);
for (_Tp* __q=__b._M_data; __q<__b._M_data+__n; ++__q, ++__ok, ++__p) {
while (! *__ok) {
++__ok;
++__p;
}
new (__q) _Tp(*__p);
}
}
 
 
 
 
} // std::
 
#endif /* _CPP_BITS_VALARRAY_ARRAY_TCC */
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/valarray_meta.h
0,0 → 1,1070
// The template and inlines for the -*- C++ -*- internal _Meta class.
 
// Copyright (C) 1997-1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
 
#ifndef _CPP_VALARRAY_META_H
#define _CPP_VALARRAY_META_H 1
 
#pragma GCC system_header
 
namespace std
{
 
//
// Implementing a loosened valarray return value is tricky.
// First we need to meet 26.3.1/3: we should not add more than
// two levels of template nesting. Therefore we resort to template
// template to "flatten" loosened return value types.
// At some point we use partial specialization to remove one level
// template nesting due to _Expr<>
//
 
// This class is NOT defined. It doesn't need to.
template<typename _Tp1, typename _Tp2> class _Constant;
 
//
// Unary function application closure.
//
template<class _Dom> class _UnFunBase {
public:
typedef typename _Dom::value_type value_type;
typedef value_type _Vt;
_UnFunBase (const _Dom& __e, _Vt __f(_Vt))
: _M_expr(__e), _M_func(__f) {}
_Vt operator[] (size_t __i) const { return _M_func(_M_expr[__i]); }
size_t size () const { return _M_expr.size(); }
private:
const _Dom& _M_expr;
_Vt (*_M_func)(_Vt);
};
 
template<template<class, class> class _Meta, class _Dom>
class _UnFunClos;
template<class _Dom>
struct _UnFunClos<_Expr,_Dom> : _UnFunBase<_Dom> {
typedef _UnFunBase<_Dom> _Base;
typedef typename _Base::value_type value_type;
_UnFunClos (const _Dom& __e, value_type __f(value_type))
: _Base (__e, __f) {}
};
template<typename _Tp>
struct _UnFunClos<_ValArray,_Tp> : _UnFunBase<valarray<_Tp> > {
typedef _UnFunBase<valarray<_Tp> > _Base;
typedef typename _Base::value_type value_type;
_UnFunClos (const valarray<_Tp>& __v, _Tp __f(_Tp))
: _Base (__v, __f) {}
};
 
//
// Binary function application closure.
//
template<template<class, class> class _Meta1,
template<class, class> class Meta2,
class _Dom1, class _Dom2> class _BinFunClos;
template<class _Dom1, class _Dom2> class _BinFunBase {
public:
typedef typename _Dom1::value_type value_type;
typedef value_type _Vt;
 
_BinFunBase (const _Dom1& __e1, const _Dom2& __e2,
_Vt __f (_Vt, _Vt))
: _M_expr1 (__e1), _M_expr2 (__e2), _M_func (__f) {}
 
value_type operator[] (size_t __i) const
{ return _M_func (_M_expr1[__i], _M_expr2[__i]); }
size_t size () const { return _M_expr1.size (); }
 
private:
const _Dom1& _M_expr1;
const _Dom2& _M_expr2;
_Vt (*_M_func)(_Vt, _Vt);
};
 
template<class _Dom> class _BinFunBase1 {
public:
typedef typename _Dom::value_type value_type ;
typedef value_type _Vt;
 
_BinFunBase1 (const _Vt& __c, const _Dom& __e, _Vt __f(_Vt, _Vt))
: _M_expr1 (__c), _M_expr2 (__e), _M_func (__f) {}
 
value_type operator[] (size_t __i) const
{ return _M_func (_M_expr1, _M_expr2[__i]); }
size_t size () const { return _M_expr2.size (); }
 
private:
const _Vt& _M_expr1;
const _Dom& _M_expr2;
_Vt (*_M_func)(_Vt, _Vt);
};
 
template<class _Dom> class _BinFunBase2 {
public:
typedef typename _Dom::value_type value_type;
typedef value_type _Vt;
 
_BinFunBase2 (const _Dom& __e, const _Vt& __c, _Vt __f(_Vt, _Vt))
: _M_expr1 (__e), _M_expr2 (__c), _M_func (__f) {}
 
value_type operator[] (size_t __i) const
{ return _M_func (_M_expr1[__i], _M_expr2); }
size_t size () const { return _M_expr1.size (); }
 
private:
const _Dom& _M_expr1;
const _Vt& _M_expr2;
_Vt (*_M_func)(_Vt, _Vt);
};
 
template<class _Dom1, class _Dom2>
struct _BinFunClos<_Expr,_Expr,_Dom1,_Dom2> : _BinFunBase<_Dom1,_Dom2> {
typedef _BinFunBase<_Dom1,_Dom2> _Base;
typedef typename _Base::value_type value_type;
typedef value_type _Tp;
 
_BinFunClos (const _Dom1& __e1, const _Dom2& __e2,
_Tp __f(_Tp, _Tp))
: _Base (__e1, __e2, __f) {}
};
 
template<typename _Tp>
struct _BinFunClos<_ValArray,_ValArray,_Tp,_Tp>
: _BinFunBase<valarray<_Tp>, valarray<_Tp> > {
typedef _BinFunBase<valarray<_Tp>, valarray<_Tp> > _Base;
typedef _Tp value_type;
 
_BinFunClos (const valarray<_Tp>& __v, const valarray<_Tp>& __w,
_Tp __f(_Tp, _Tp))
: _Base (__v, __w, __f) {}
};
template<class _Dom>
struct _BinFunClos<_Expr,_ValArray,_Dom,typename _Dom::value_type>
: _BinFunBase<_Dom,valarray<typename _Dom::value_type> > {
typedef typename _Dom::value_type _Tp;
typedef _BinFunBase<_Dom,valarray<_Tp> > _Base;
typedef _Tp value_type;
 
_BinFunClos (const _Dom& __e, const valarray<_Tp>& __v,
_Tp __f(_Tp, _Tp))
: _Base (__e, __v, __f) {}
};
 
template<class _Dom>
struct _BinFunClos<_ValArray,_Expr,typename _Dom::value_type,_Dom>
: _BinFunBase<valarray<typename _Dom::value_type>,_Dom> {
typedef typename _Dom::value_type _Tp;
typedef _BinFunBase<_Dom,valarray<_Tp> > _Base;
typedef _Tp value_type;
 
_BinFunClos (const valarray<_Tp>& __v, const _Dom& __e,
_Tp __f(_Tp, _Tp))
: _Base (__v, __e, __f) {}
};
 
template<class _Dom>
struct _BinFunClos<_Expr,_Constant,_Dom,typename _Dom::value_type>
: _BinFunBase2<_Dom> {
typedef typename _Dom::value_type _Tp;
typedef _Tp value_type;
typedef _BinFunBase2<_Dom> _Base;
 
_BinFunClos (const _Dom& __e, const _Tp& __t, _Tp __f (_Tp, _Tp))
: _Base (__e, __t, __f) {}
};
 
template<class _Dom>
struct _BinFunClos<_Constant,_Expr,_Dom,typename _Dom::value_type>
: _BinFunBase1<_Dom> {
typedef typename _Dom::value_type _Tp;
typedef _Tp value_type;
typedef _BinFunBase1<_Dom> _Base;
 
_BinFunClos (const _Tp& __t, const _Dom& __e, _Tp __f (_Tp, _Tp))
: _Base (__t, __e, __f) {}
};
 
template<typename _Tp>
struct _BinFunClos<_ValArray,_Constant,_Tp,_Tp>
: _BinFunBase2<valarray<_Tp> > {
typedef _BinFunBase2<valarray<_Tp> > _Base;
typedef _Tp value_type;
 
_BinFunClos (const valarray<_Tp>& __v, const _Tp& __t,
_Tp __f(_Tp, _Tp))
: _Base (__v, __t, __f) {}
};
 
template<typename _Tp>
struct _BinFunClos<_Constant,_ValArray,_Tp,_Tp>
: _BinFunBase1<valarray<_Tp> > {
typedef _BinFunBase1<valarray<_Tp> > _Base;
typedef _Tp value_type;
 
_BinFunClos (const _Tp& __t, const valarray<_Tp>& __v,
_Tp __f (_Tp, _Tp))
: _Base (__t, __v, __f) {}
};
 
//
// Apply function taking a value/const reference closure
//
 
template<typename _Dom, typename _Arg> class _FunBase {
public:
typedef typename _Dom::value_type value_type;
 
_FunBase (const _Dom& __e, value_type __f(_Arg))
: _M_expr (__e), _M_func (__f) {}
 
value_type operator[] (size_t __i) const
{ return _M_func (_M_expr[__i]); }
size_t size() const { return _M_expr.size ();}
 
private:
const _Dom& _M_expr;
value_type (*_M_func)(_Arg);
};
 
template<class _Dom>
struct _ValFunClos<_Expr,_Dom>
: _FunBase<_Dom, typename _Dom::value_type> {
typedef _FunBase<_Dom, typename _Dom::value_type> _Base;
typedef typename _Base::value_type value_type;
typedef value_type _Tp;
_ValFunClos (const _Dom& __e, _Tp __f (_Tp)) : _Base (__e, __f) {}
};
 
template<typename _Tp>
struct _ValFunClos<_ValArray,_Tp>
: _FunBase<valarray<_Tp>, _Tp> {
typedef _FunBase<valarray<_Tp>, _Tp> _Base;
typedef _Tp value_type;
 
_ValFunClos (const valarray<_Tp>& __v, _Tp __f(_Tp))
: _Base (__v, __f) {}
};
 
template<class _Dom>
struct _RefFunClos<_Expr,_Dom> :
_FunBase<_Dom, const typename _Dom::value_type&> {
typedef _FunBase<_Dom, const typename _Dom::value_type&> _Base;
typedef typename _Base::value_type value_type;
typedef value_type _Tp;
 
_RefFunClos (const _Dom& __e, _Tp __f (const _Tp&))
: _Base (__e, __f) {}
};
 
template<typename _Tp>
struct _RefFunClos<_ValArray,_Tp>
: _FunBase<valarray<_Tp>, const _Tp&> {
typedef _FunBase<valarray<_Tp>, const _Tp&> _Base;
typedef _Tp value_type;
_RefFunClos (const valarray<_Tp>& __v, _Tp __f(const _Tp&))
: _Base (__v, __f) {}
};
//
// Unary expression closure.
//
 
template<template<class> class _Oper, typename _Arg>
class _UnBase {
public:
typedef _Oper<typename _Arg::value_type> _Op;
typedef typename _Op::result_type value_type;
 
_UnBase (const _Arg& __e) : _M_expr(__e) {}
value_type operator[] (size_t) const;
size_t size () const { return _M_expr.size (); }
 
private:
const _Arg& _M_expr;
};
 
template<template<class> class _Oper, typename _Arg>
inline typename _UnBase<_Oper, _Arg>::value_type
_UnBase<_Oper, _Arg>::operator[] (size_t __i) const
{ return _Op() (_M_expr[__i]); }
template<template<class> class _Oper, class _Dom>
struct _UnClos<_Oper, _Expr, _Dom> : _UnBase<_Oper, _Dom> {
typedef _Dom _Arg;
typedef _UnBase<_Oper, _Dom> _Base;
typedef typename _Base::value_type value_type;
_UnClos (const _Arg& __e) : _Base(__e) {}
};
 
template<template<class> class _Oper, typename _Tp>
struct _UnClos<_Oper, _ValArray, _Tp> : _UnBase<_Oper, valarray<_Tp> > {
typedef valarray<_Tp> _Arg;
typedef _UnBase<_Oper, valarray<_Tp> > _Base;
typedef typename _Base::value_type value_type;
 
_UnClos (const _Arg& __e) : _Base(__e) {}
};
 
 
//
// Binary expression closure.
//
 
template<template<class> class _Oper,
typename _FirstArg, typename _SecondArg>
class _BinBase {
public:
typedef _Oper<typename _FirstArg::value_type> _Op;
typedef typename _Op::result_type value_type;
 
_BinBase (const _FirstArg& __e1, const _SecondArg& __e2)
: _M_expr1 (__e1), _M_expr2 (__e2) {}
value_type operator[] (size_t) const;
size_t size () const { return _M_expr1.size (); }
private:
const _FirstArg& _M_expr1;
const _SecondArg& _M_expr2;
};
 
template<template<class> class _Oper,
typename _FirstArg, typename _SecondArg>
inline typename _BinBase<_Oper,_FirstArg,_SecondArg>::value_type
_BinBase<_Oper,_FirstArg,_SecondArg>::operator[] (size_t __i) const
{ return _Op() (_M_expr1[__i], _M_expr2[__i]); }
 
 
template<template<class> class _Oper, class _Clos>
class _BinBase2 {
public:
typedef typename _Clos::value_type _Vt;
typedef _Oper<_Vt> _Op;
typedef typename _Op::result_type value_type;
 
_BinBase2 (const _Clos& __e, const _Vt& __t)
: _M_expr1 (__e), _M_expr2 (__t) {}
value_type operator[] (size_t) const;
size_t size () const { return _M_expr1.size (); }
 
private:
const _Clos& _M_expr1;
const _Vt& _M_expr2;
};
 
template<template<class> class _Oper, class _Clos>
inline typename _BinBase2<_Oper,_Clos>::value_type
_BinBase2<_Oper,_Clos>::operator[] (size_t __i) const
{ return _Op() (_M_expr1[__i], _M_expr2); }
 
 
template<template<class> class _Oper, class _Clos>
class _BinBase1 {
public:
typedef typename _Clos::value_type _Vt;
typedef _Oper<_Vt> _Op;
typedef typename _Op::result_type value_type;
 
_BinBase1 (const _Vt& __t, const _Clos& __e)
: _M_expr1 (__t), _M_expr2 (__e) {}
value_type operator[] (size_t) const;
size_t size () const { return _M_expr2.size (); }
 
private:
const _Vt& _M_expr1;
const _Clos& _M_expr2;
};
 
template<template<class> class _Oper, class _Clos>
inline typename
_BinBase1<_Oper,_Clos>::value_type
_BinBase1<_Oper,_Clos>:: operator[] (size_t __i) const
{ return _Op() (_M_expr1, _M_expr2[__i]); }
 
template<template<class> class _Oper, class _Dom1, class _Dom2>
struct _BinClos<_Oper, _Expr, _Expr, _Dom1, _Dom2>
: _BinBase<_Oper,_Dom1,_Dom2> {
typedef _BinBase<_Oper,_Dom1,_Dom2> _Base;
typedef typename _Base::value_type value_type;
_BinClos(const _Dom1& __e1, const _Dom2& __e2) : _Base(__e1, __e2) {}
};
 
template<template<class> class _Oper, typename _Tp>
struct _BinClos<_Oper,_ValArray,_ValArray,_Tp,_Tp>
: _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> > {
typedef _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> > _Base;
typedef _Tp value_type;
 
_BinClos (const valarray<_Tp>& __v, const valarray<_Tp>& __w)
: _Base (__v, __w) {}
};
 
template<template<class> class _Oper, class _Dom>
struct _BinClos<_Oper,_Expr,_ValArray,_Dom,typename _Dom::value_type>
: _BinBase<_Oper,_Dom,valarray<typename _Dom::value_type> > {
typedef typename _Dom::value_type _Tp;
typedef _BinBase<_Oper,_Dom,valarray<_Tp> > _Base;
typedef typename _Base::value_type value_type;
 
_BinClos(const _Dom& __e1, const valarray<_Tp>& __e2)
: _Base (__e1, __e2) {}
};
 
template<template<class> class _Oper, class _Dom>
struct _BinClos<_Oper,_ValArray,_Expr,typename _Dom::value_type,_Dom>
: _BinBase<_Oper,valarray<typename _Dom::value_type>,_Dom> {
typedef typename _Dom::value_type _Tp;
typedef _BinBase<_Oper,valarray<_Tp>,_Dom> _Base;
typedef typename _Base::value_type value_type;
 
_BinClos (const valarray<_Tp>& __e1, const _Dom& __e2)
: _Base (__e1, __e2) {}
};
 
template<template<class> class _Oper, class _Dom>
struct _BinClos<_Oper,_Expr,_Constant,_Dom,typename _Dom::value_type>
: _BinBase2<_Oper,_Dom> {
typedef typename _Dom::value_type _Tp;
typedef _BinBase2<_Oper,_Dom> _Base;
typedef typename _Base::value_type value_type;
 
_BinClos (const _Dom& __e1, const _Tp& __e2) : _Base (__e1, __e2) {}
};
 
template<template<class> class _Oper, class _Dom>
struct _BinClos<_Oper,_Constant,_Expr,typename _Dom::value_type,_Dom>
: _BinBase1<_Oper,_Dom> {
typedef typename _Dom::value_type _Tp;
typedef _BinBase1<_Oper,_Dom> _Base;
typedef typename _Base::value_type value_type;
 
_BinClos (const _Tp& __e1, const _Dom& __e2) : _Base (__e1, __e2) {}
};
template<template<class> class _Oper, typename _Tp>
struct _BinClos<_Oper,_ValArray,_Constant,_Tp,_Tp>
: _BinBase2<_Oper,valarray<_Tp> > {
typedef _BinBase2<_Oper,valarray<_Tp> > _Base;
typedef typename _Base::value_type value_type;
 
_BinClos (const valarray<_Tp>& __v, const _Tp& __t)
: _Base (__v, __t) {}
};
 
template<template<class> class _Oper, typename _Tp>
struct _BinClos<_Oper,_Constant,_ValArray,_Tp,_Tp>
: _BinBase1<_Oper,valarray<_Tp> > {
typedef _BinBase1<_Oper,valarray<_Tp> > _Base;
typedef typename _Base::value_type value_type;
 
_BinClos (const _Tp& __t, const valarray<_Tp>& __v)
: _Base (__t, __v) {}
};
 
//
// slice_array closure.
//
template<typename _Dom> class _SBase {
public:
typedef typename _Dom::value_type value_type;
 
_SBase (const _Dom& __e, const slice& __s)
: _M_expr (__e), _M_slice (__s) {}
value_type operator[] (size_t __i) const
{ return _M_expr[_M_slice.start () + __i * _M_slice.stride ()]; }
size_t size() const { return _M_slice.size (); }
 
private:
const _Dom& _M_expr;
const slice& _M_slice;
};
 
template<typename _Tp> class _SBase<_Array<_Tp> > {
public:
typedef _Tp value_type;
 
_SBase (_Array<_Tp> __a, const slice& __s)
: _M_array (__a._M_data+__s.start()), _M_size (__s.size()),
_M_stride (__s.stride()) {}
value_type operator[] (size_t __i) const
{ return _M_array._M_data[__i * _M_stride]; }
size_t size() const { return _M_size; }
 
private:
const _Array<_Tp> _M_array;
const size_t _M_size;
const size_t _M_stride;
};
 
template<class _Dom> struct _SClos<_Expr,_Dom> : _SBase<_Dom> {
typedef _SBase<_Dom> _Base;
typedef typename _Base::value_type value_type;
_SClos (const _Dom& __e, const slice& __s) : _Base (__e, __s) {}
};
 
template<typename _Tp>
struct _SClos<_ValArray,_Tp> : _SBase<_Array<_Tp> > {
typedef _SBase<_Array<_Tp> > _Base;
typedef _Tp value_type;
 
_SClos (_Array<_Tp> __a, const slice& __s) : _Base (__a, __s) {}
};
 
//
// gslice_array closure.
//
template<class _Dom> class _GBase {
public:
typedef typename _Dom::value_type value_type;
_GBase (const _Dom& __e, const valarray<size_t>& __i)
: _M_expr (__e), _M_index(__i) {}
value_type operator[] (size_t __i) const
{ return _M_expr[_M_index[__i]]; }
size_t size () const { return _M_index.size(); }
private:
const _Dom& _M_expr;
const valarray<size_t>& _M_index;
};
template<typename _Tp> class _GBase<_Array<_Tp> > {
public:
typedef _Tp value_type;
_GBase (_Array<_Tp> __a, const valarray<size_t>& __i)
: _M_array (__a), _M_index(__i) {}
value_type operator[] (size_t __i) const
{ return _M_array._M_data[_M_index[__i]]; }
size_t size () const { return _M_index.size(); }
private:
const _Array<_Tp> _M_array;
const valarray<size_t>& _M_index;
};
 
template<class _Dom> struct _GClos<_Expr,_Dom> : _GBase<_Dom> {
typedef _GBase<_Dom> _Base;
typedef typename _Base::value_type value_type;
 
_GClos (const _Dom& __e, const valarray<size_t>& __i)
: _Base (__e, __i) {}
};
 
template<typename _Tp>
struct _GClos<_ValArray,_Tp> : _GBase<_Array<_Tp> > {
typedef _GBase<_Array<_Tp> > _Base;
typedef typename _Base::value_type value_type;
 
_GClos (_Array<_Tp> __a, const valarray<size_t>& __i)
: _Base (__a, __i) {}
};
 
//
// indirect_array closure
//
 
template<class _Dom> class _IBase {
public:
typedef typename _Dom::value_type value_type;
 
_IBase (const _Dom& __e, const valarray<size_t>& __i)
: _M_expr (__e), _M_index (__i) {}
value_type operator[] (size_t __i) const
{ return _M_expr[_M_index[__i]]; }
size_t size() const { return _M_index.size(); }
private:
const _Dom& _M_expr;
const valarray<size_t>& _M_index;
};
 
template<class _Dom> struct _IClos<_Expr,_Dom> : _IBase<_Dom> {
typedef _IBase<_Dom> _Base;
typedef typename _Base::value_type value_type;
 
_IClos (const _Dom& __e, const valarray<size_t>& __i)
: _Base (__e, __i) {}
};
 
template<typename _Tp>
struct _IClos<_ValArray,_Tp> : _IBase<valarray<_Tp> > {
typedef _IBase<valarray<_Tp> > _Base;
typedef _Tp value_type;
 
_IClos (const valarray<_Tp>& __a, const valarray<size_t>& __i)
: _Base (__a, __i) {}
};
 
//
// class _Expr
//
template<class _Clos, typename _Tp> class _Expr {
public:
typedef _Tp value_type;
_Expr (const _Clos&);
const _Clos& operator() () const;
value_type operator[] (size_t) const;
valarray<value_type> operator[] (slice) const;
valarray<value_type> operator[] (const gslice&) const;
valarray<value_type> operator[] (const valarray<bool>&) const;
valarray<value_type> operator[] (const valarray<size_t>&) const;
_Expr<_UnClos<_Unary_plus,_Expr,_Clos>, value_type>
operator+ () const;
 
_Expr<_UnClos<negate,_Expr,_Clos>, value_type>
operator- () const;
 
_Expr<_UnClos<_Bitwise_not,_Expr,_Clos>, value_type>
operator~ () const;
 
_Expr<_UnClos<logical_not,_Expr,_Clos>, bool>
operator! () const;
 
size_t size () const;
value_type sum () const;
valarray<value_type> shift (int) const;
valarray<value_type> cshift (int) const;
 
value_type min() const;
value_type max() const;
 
valarray<value_type> apply(value_type (*) (const value_type&)) const;
valarray<value_type> apply(value_type (*) (value_type)) const;
private:
const _Clos _M_closure;
};
template<class _Clos, typename _Tp>
inline
_Expr<_Clos,_Tp>::_Expr (const _Clos& __c) : _M_closure(__c) {}
template<class _Clos, typename _Tp>
inline const _Clos&
_Expr<_Clos,_Tp>::operator() () const
{ return _M_closure; }
 
template<class _Clos, typename _Tp>
inline _Tp
_Expr<_Clos,_Tp>::operator[] (size_t __i) const
{ return _M_closure[__i]; }
 
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos,_Tp>::operator[] (slice __s) const
{ return _M_closure[__s]; }
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos,_Tp>::operator[] (const gslice& __gs) const
{ return _M_closure[__gs]; }
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos,_Tp>::operator[] (const valarray<bool>& __m) const
{ return _M_closure[__m]; }
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos,_Tp>::operator[] (const valarray<size_t>& __i) const
{ return _M_closure[__i]; }
template<class _Clos, typename _Tp>
inline size_t
_Expr<_Clos,_Tp>::size () const { return _M_closure.size (); }
 
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos, _Tp>::shift(int __n) const
{ return valarray<_Tp>(_M_closure).shift(__n); }
 
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos, _Tp>::cshift(int __n) const
{ return valarray<_Tp>(_M_closure).cshift(__n); }
 
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos, _Tp>::apply(_Tp __f(const _Tp&)) const
{ return valarray<_Tp>(_M_closure).apply(__f); }
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos, _Tp>::apply(_Tp __f(_Tp)) const
{ return valarray<_Tp>(_M_closure).apply(__f); }
 
// XXX: replace this with a more robust summation algorithm.
template<class _Clos, typename _Tp>
inline _Tp
_Expr<_Clos,_Tp>::sum () const
{
size_t __n = _M_closure.size();
if (__n == 0) return _Tp();
else {
_Tp __s = _M_closure[--__n];
while (__n != 0) __s += _M_closure[--__n];
return __s;
}
}
 
template<class _Clos, typename _Tp>
inline _Tp
_Expr<_Clos, _Tp>::min() const
{ return __valarray_min(_M_closure); }
 
template<class _Clos, typename _Tp>
inline _Tp
_Expr<_Clos, _Tp>::max() const
{ return __valarray_max(_M_closure); }
template<class _Dom, typename _Tp>
inline _Expr<_UnClos<logical_not,_Expr,_Dom>, bool>
_Expr<_Dom,_Tp>::operator! () const
{
typedef _UnClos<logical_not,_Expr,_Dom> _Closure;
return _Expr<_Closure,_Tp> (_Closure(this->_M_closure));
}
 
#define _DEFINE_EXPR_UNARY_OPERATOR(_Op, _Name) \
template<class _Dom, typename _Tp> \
inline _Expr<_UnClos<_Name,_Expr,_Dom>,_Tp> \
_Expr<_Dom,_Tp>::operator _Op () const \
{ \
typedef _UnClos<_Name,_Expr,_Dom> _Closure; \
return _Expr<_Closure,_Tp> (_Closure (this->_M_closure)); \
}
 
_DEFINE_EXPR_UNARY_OPERATOR(+, _Unary_plus)
_DEFINE_EXPR_UNARY_OPERATOR(-, negate)
_DEFINE_EXPR_UNARY_OPERATOR(~, _Bitwise_not)
 
#undef _DEFINE_EXPR_UNARY_OPERATOR
 
 
#define _DEFINE_EXPR_BINARY_OPERATOR(_Op, _Name) \
template<class _Dom1, class _Dom2> \
inline _Expr<_BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2>, \
typename _Name<typename _Dom1::value_type>::result_type> \
operator _Op (const _Expr<_Dom1,typename _Dom1::value_type>& __v, \
const _Expr<_Dom2,typename _Dom2::value_type>& __w) \
{ \
typedef typename _Dom1::value_type _Arg; \
typedef typename _Name<_Arg>::result_type _Value; \
typedef _BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2> _Closure; \
return _Expr<_Closure,_Value> (_Closure (__v (), __w ())); \
} \
\
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Expr,_Constant,_Dom,typename _Dom::value_type>, \
typename _Name<typename _Dom::value_type>::result_type> \
operator _Op (const _Expr<_Dom,typename _Dom::value_type>& __v, \
const typename _Dom::value_type& __t) \
{ \
typedef typename _Dom::value_type _Arg; \
typedef typename _Name<_Arg>::result_type _Value; \
typedef _BinClos<_Name,_Expr,_Constant,_Dom,_Arg> _Closure; \
return _Expr<_Closure,_Value> (_Closure (__v (), __t)); \
} \
\
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Constant,_Expr,typename _Dom::value_type,_Dom>, \
typename _Name<typename _Dom::value_type>::result_type> \
operator _Op (const typename _Dom::value_type& __t, \
const _Expr<_Dom,typename _Dom::value_type>& __v) \
{ \
typedef typename _Dom::value_type _Arg; \
typedef typename _Name<_Arg>::result_type _Value; \
typedef _BinClos<_Name,_Constant,_Expr,_Arg,_Dom> _Closure; \
return _Expr<_Closure,_Value> (_Closure (__t, __v ())); \
} \
\
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Expr,_ValArray,_Dom,typename _Dom::value_type>, \
typename _Name<typename _Dom::value_type>::result_type> \
operator _Op (const _Expr<_Dom,typename _Dom::value_type>& __e, \
const valarray<typename _Dom::value_type>& __v) \
{ \
typedef typename _Dom::value_type _Arg; \
typedef typename _Name<_Arg>::result_type _Value; \
typedef _BinClos<_Name,_Expr,_ValArray,_Dom,_Arg> _Closure; \
return _Expr<_Closure,_Value> (_Closure (__e (), __v)); \
} \
\
template<class _Dom> \
inline _Expr<_BinClos<_Name,_ValArray,_Expr,typename _Dom::value_type,_Dom>, \
typename _Name<typename _Dom::value_type>::result_type> \
operator _Op (const valarray<typename _Dom::value_type>& __v, \
const _Expr<_Dom,typename _Dom::value_type>& __e) \
{ \
typedef typename _Dom::value_type _Tp; \
typedef typename _Name<_Tp>::result_type _Value; \
typedef _BinClos<_Name,_ValArray,_Expr,_Tp,_Dom> _Closure; \
return _Expr<_Closure,_Value> (_Closure (__v, __e ())); \
}
 
_DEFINE_EXPR_BINARY_OPERATOR(+, plus)
_DEFINE_EXPR_BINARY_OPERATOR(-, minus)
_DEFINE_EXPR_BINARY_OPERATOR(*, multiplies)
_DEFINE_EXPR_BINARY_OPERATOR(/, divides)
_DEFINE_EXPR_BINARY_OPERATOR(%, modulus)
_DEFINE_EXPR_BINARY_OPERATOR(^, _Bitwise_xor)
_DEFINE_EXPR_BINARY_OPERATOR(&, _Bitwise_and)
_DEFINE_EXPR_BINARY_OPERATOR(|, _Bitwise_or)
_DEFINE_EXPR_BINARY_OPERATOR(<<, _Shift_left)
_DEFINE_EXPR_BINARY_OPERATOR(>>, _Shift_right)
 
#undef _DEFINE_EXPR_BINARY_OPERATOR
#define _DEFINE_EXPR_RELATIONAL_OPERATOR(_Op, _Name) \
template<class _Dom1, class _Dom2> \
inline _Expr<_BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2>, bool> \
operator _Op (const _Expr<_Dom1,typename _Dom1::value_type>& __v, \
const _Expr<_Dom2,typename _Dom2::value_type>& __w) \
{ \
typedef typename _Dom1::value_type _Arg; \
typedef _BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2> _Closure; \
return _Expr<_Closure,bool> (_Closure (__v (), __w ())); \
} \
\
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Expr,_Constant,_Dom,typename _Dom::value_type>, \
bool> \
operator _Op (const _Expr<_Dom,typename _Dom::value_type>& __v, \
const typename _Dom::value_type& __t) \
{ \
typedef typename _Dom::value_type _Arg; \
typedef _BinClos<_Name,_Expr,_Constant,_Dom,_Arg> _Closure; \
return _Expr<_Closure,bool> (_Closure (__v (), __t)); \
} \
\
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Constant,_Expr,typename _Dom::value_type,_Dom>, \
bool> \
operator _Op (const typename _Dom::value_type& __t, \
const _Expr<_Dom,typename _Dom::value_type>& __v) \
{ \
typedef typename _Dom::value_type _Arg; \
typedef _BinClos<_Name,_Constant,_Expr,_Arg,_Dom> _Closure; \
return _Expr<_Closure,bool> (_Closure (__t, __v ())); \
} \
\
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Expr,_ValArray,_Dom,typename _Dom::value_type>, \
bool> \
operator _Op (const _Expr<_Dom,typename _Dom::value_type>& __e, \
const valarray<typename _Dom::value_type>& __v) \
{ \
typedef typename _Dom::value_type _Tp; \
typedef _BinClos<_Name,_Expr,_ValArray,_Dom,_Tp> _Closure; \
return _Expr<_Closure,bool> (_Closure (__e (), __v)); \
} \
\
template<class _Dom> \
inline _Expr<_BinClos<_Name,_ValArray,_Expr,typename _Dom::value_type,_Dom>, \
bool> \
operator _Op (const valarray<typename _Dom::value_type>& __v, \
const _Expr<_Dom,typename _Dom::value_type>& __e) \
{ \
typedef typename _Dom::value_type _Tp; \
typedef _BinClos<_Name,_ValArray,_Expr,_Tp,_Dom> _Closure; \
return _Expr<_Closure,bool> (_Closure (__v, __e ())); \
}
 
_DEFINE_EXPR_RELATIONAL_OPERATOR(&&, logical_and)
_DEFINE_EXPR_RELATIONAL_OPERATOR(||, logical_or)
_DEFINE_EXPR_RELATIONAL_OPERATOR(==, equal_to)
_DEFINE_EXPR_RELATIONAL_OPERATOR(!=, not_equal_to)
_DEFINE_EXPR_RELATIONAL_OPERATOR(<, less)
_DEFINE_EXPR_RELATIONAL_OPERATOR(>, greater)
_DEFINE_EXPR_RELATIONAL_OPERATOR(<=, less_equal)
_DEFINE_EXPR_RELATIONAL_OPERATOR(>=, greater_equal)
 
#undef _DEFINE_EXPR_RELATIONAL_OPERATOR
 
 
 
#define _DEFINE_EXPR_UNARY_FUNCTION(_Name) \
template<class _Dom> \
inline _Expr<_UnFunClos<_Expr,_Dom>,typename _Dom::value_type> \
_Name(const _Expr<_Dom,typename _Dom::value_type>& __e) \
{ \
typedef typename _Dom::value_type _Tp; \
typedef _UnFunClos<_Expr,_Dom> _Closure; \
return _Expr<_Closure,_Tp>(_Closure(__e(), (_Tp(*)(_Tp))(&_Name))); \
} \
\
template<typename _Tp> \
inline _Expr<_UnFunClos<_ValArray,_Tp>,_Tp> \
_Name(const valarray<_Tp>& __v) \
{ \
typedef _UnFunClos<_ValArray,_Tp> _Closure; \
return _Expr<_Closure,_Tp> (_Closure (__v, (_Tp(*)(_Tp))(&_Name))); \
}
 
 
_DEFINE_EXPR_UNARY_FUNCTION(abs)
_DEFINE_EXPR_UNARY_FUNCTION(cos)
_DEFINE_EXPR_UNARY_FUNCTION(acos)
_DEFINE_EXPR_UNARY_FUNCTION(cosh)
_DEFINE_EXPR_UNARY_FUNCTION(sin)
_DEFINE_EXPR_UNARY_FUNCTION(asin)
_DEFINE_EXPR_UNARY_FUNCTION(sinh)
_DEFINE_EXPR_UNARY_FUNCTION(tan)
_DEFINE_EXPR_UNARY_FUNCTION(tanh)
_DEFINE_EXPR_UNARY_FUNCTION(atan)
_DEFINE_EXPR_UNARY_FUNCTION(exp)
_DEFINE_EXPR_UNARY_FUNCTION(log)
_DEFINE_EXPR_UNARY_FUNCTION(log10)
_DEFINE_EXPR_UNARY_FUNCTION(sqrt)
 
#undef _DEFINE_EXPR_UNARY_FUNCTION
 
 
#define _DEFINE_EXPR_BINARY_FUNCTION(_Name) \
template<class _Dom1, class _Dom2> \
inline _Expr<_BinFunClos<_Expr,_Expr,_Dom1,_Dom2>,typename _Dom1::value_type>\
_Name (const _Expr<_Dom1,typename _Dom1::value_type>& __e1, \
const _Expr<_Dom2,typename _Dom2::value_type>& __e2) \
{ \
typedef typename _Dom1::value_type _Tp; \
typedef _BinFunClos<_Expr,_Expr,_Dom1,_Dom2> _Closure; \
return _Expr<_Closure,_Tp> \
(_Closure (__e1 (), __e2 (), (_Tp(*)(_Tp, _Tp))(&_Name))); \
} \
\
template<class _Dom> \
inline _Expr<_BinFunClos<_Expr,_ValArray,_Dom,typename _Dom::value_type>, \
typename _Dom::value_type> \
_Name (const _Expr<_Dom,typename _Dom::value_type>& __e, \
const valarray<typename _Dom::value_type>& __v) \
{ \
typedef typename _Dom::value_type _Tp; \
typedef _BinFunClos<_Expr,_ValArray,_Dom,_Tp> _Closure; \
return _Expr<_Closure,_Tp> \
(_Closure (__e (), __v, (_Tp(*)(_Tp, _Tp))(&_Name))); \
} \
\
template<class _Dom> \
inline _Expr<_BinFunClos<_ValArray,_Expr,typename _Dom::value_type,_Dom>, \
typename _Dom::value_type> \
_Name (const valarray<typename _Dom::valarray>& __v, \
const _Expr<_Dom,typename _Dom::value_type>& __e) \
{ \
typedef typename _Dom::value_type _Tp; \
typedef _BinFunClos<_ValArray,_Expr,_Tp,_Dom> _Closure; \
return _Expr<_Closure,_Tp> \
(_Closure (__v, __e (), (_Tp(*)(_Tp, _Tp))(&_Name))); \
} \
\
template<class _Dom> \
inline _Expr<_BinFunClos<_Expr,_Constant,_Dom,typename _Dom::value_type>, \
typename _Dom::value_type> \
_Name (const _Expr<_Dom, typename _Dom::value_type>& __e, \
const typename _Dom::value_type& __t) \
{ \
typedef typename _Dom::value_type _Tp; \
typedef _BinFunClos<_Expr,_Constant,_Dom,_Tp> _Closure; \
return _Expr<_Closure,_Tp> \
(_Closure (__e (), __t, (_Tp(*)(_Tp, _Tp))(&_Name))); \
} \
\
template<class _Dom> \
inline _Expr<_BinFunClos<_Constant,_Expr,typename _Dom::value_type,_Dom>, \
typename _Dom::value_type> \
_Name (const typename _Dom::value_type& __t, \
const _Expr<_Dom,typename _Dom::value_type>& __e) \
{ \
typedef typename _Dom::value_type _Tp; \
typedef _BinFunClos<_Constant,_Expr,_Tp,_Dom> _Closure; \
return _Expr<_Closure,_Tp> \
(_Closure (__t, __e (), (_Tp(*)(_Tp, _Tp))(&_Name))); \
} \
\
template<typename _Tp> \
inline _Expr<_BinFunClos<_ValArray,_ValArray,_Tp,_Tp>, _Tp> \
_Name (const valarray<_Tp>& __v, const valarray<_Tp>& __w) \
{ \
typedef _BinFunClos<_ValArray,_ValArray,_Tp,_Tp> _Closure; \
return _Expr<_Closure,_Tp> \
(_Closure (__v, __w, (_Tp(*)(_Tp,_Tp))(&_Name))); \
} \
\
template<typename _Tp> \
inline _Expr<_BinFunClos<_ValArray,_Constant,_Tp,_Tp>,_Tp> \
_Name (const valarray<_Tp>& __v, const _Tp& __t) \
{ \
typedef _BinFunClos<_ValArray,_Constant,_Tp,_Tp> _Closure; \
return _Expr<_Closure,_Tp> \
(_Closure (__v, __t, (_Tp(*)(_Tp,_Tp))(&_Name))); \
} \
\
template<typename _Tp> \
inline _Expr<_BinFunClos<_Constant,_ValArray,_Tp,_Tp>,_Tp> \
_Name (const _Tp& __t, const valarray<_Tp>& __v) \
{ \
typedef _BinFunClos<_Constant,_ValArray,_Tp,_Tp> _Closure; \
return _Expr<_Closure,_Tp> \
(_Closure (__t, __v, (_Tp(*)(_Tp,_Tp))(&_Name))); \
}
 
_DEFINE_EXPR_BINARY_FUNCTION(atan2)
_DEFINE_EXPR_BINARY_FUNCTION(pow)
 
#undef _DEFINE_EXPR_BINARY_FUNCTION
 
} // std::
 
 
#endif /* _CPP_VALARRAY_META_H */
 
// Local Variables:
// mode:c++
// End:
/contrib/media/updf/include/bits/wchar.h
0,0 → 1,26
/* wchar_t type related definitions.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
 
The GNU C 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.1 of the License, or (at your option) any later version.
 
The GNU C 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 the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
 
#ifndef _BITS_WCHAR_H
#define _BITS_WCHAR_H 1
 
#define __WCHAR_MIN (-2147483647l - 1l)
#define __WCHAR_MAX (2147483647l)
 
#endif /* bits/wchar.h */
/contrib/media/updf/include/bits/wordsize.h
0,0 → 1,19
/* Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
 
The GNU C 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.1 of the License, or (at your option) any later version.
 
The GNU C 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 the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
 
#define __WORDSIZE 32
/contrib/media/updf/include/bitset
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BITSET
#include <bits/std_bitset.h>
#endif
/contrib/media/updf/include/c/bits/std_cassert.h
0,0 → 1,39
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 19.2 Assertions
//
 
// Note: This is not a conforming implementation.
 
// No include guards on this header...
 
#pragma GCC system_header
#include <assert.h>
/contrib/media/updf/include/c/bits/std_cctype.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: <ccytpe>
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CCTYPE
#define _CPP_CCTYPE 1
 
#pragma GCC system_header
#include <ctype.h>
 
#endif
/contrib/media/updf/include/c/bits/std_cerrno.h
0,0 → 1,42
// The -*- C++ -*- error number header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 19.3 Error numbers
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CERRNO
#define _CPP_CERRNO 1
 
#pragma GCC system_header
#include <errno.h>
 
#endif
/contrib/media/updf/include/c/bits/std_cfloat.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CFLOAT
#define _CPP_CFLOAT 1
 
#pragma GCC system_header
#include <float.h>
 
#endif
/contrib/media/updf/include/c/bits/std_climits.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CLIMITS
#define _CPP_CLIMITS 1
 
#pragma GCC system_header
#include <limits.h>
 
#endif
/contrib/media/updf/include/c/bits/std_clocale.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CLOCALE
#define _CPP_CLOCALE 1
 
#pragma GCC system_header
#include <locale.h>
 
#endif
/contrib/media/updf/include/c/bits/std_cmath.h
0,0 → 1,42
// -*- C++ -*- C math library.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 26.5 C library
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CMATH
#define _CPP_CMATH 1
#pragma GCC system_header
#include <math.h>
 
#endif
/contrib/media/updf/include/c/bits/std_csetjmp.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CSETJMP
#define _CPP_CSETJMP 1
 
#pragma GCC system_header
#include <setjmp.h>
 
#endif
/contrib/media/updf/include/c/bits/std_csignal.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CSIGNAL
#define _CPP_CSIGNAL 1
 
#pragma GCC system_header
#include <signal.h>
 
#endif
/contrib/media/updf/include/c/bits/std_cstdarg.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CSTDARG
#define _CPP_CSTDARG 1
 
#pragma GCC system_header
#include <stdarg.h>
 
#endif
/contrib/media/updf/include/c/bits/std_cstddef.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.1 Types
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CSTDDEF
#define _CPP_CSTDDEF 1
 
#pragma GCC system_header
#include <stddef.h>
 
#endif
/contrib/media/updf/include/c/bits/std_cstdio.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.8.2 C Library files
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CSTDIO
#define _CPP_CSTDIO 1
 
#pragma GCC system_header
#include <stdio.h>
 
#endif
/contrib/media/updf/include/c/bits/std_cstdlib.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CSTDLIB
#define _CPP_CSTDLIB 1
 
#pragma GCC system_header
#include <stdlib.h>
 
#endif
/contrib/media/updf/include/c/bits/std_cstring.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CSTRING
#define _CPP_CSTRING 1
 
#pragma GCC system_header
#include <string.h>
 
#endif
/contrib/media/updf/include/c/bits/std_ctime.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.5 Date and time
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CTIME
#define _CPP_CTIME 1
 
#pragma GCC system_header
#include <time.h>
 
#endif
/contrib/media/updf/include/c/bits/std_cwchar.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: ???
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CWCHAR
#define _CPP_CWCHAR 1
 
#pragma GCC system_header
#include <wchar.h>
 
#endif
/contrib/media/updf/include/c/bits/std_cwctype.h
0,0 → 1,42
// -*- C++ -*- forwarding header.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: <cwctype>
//
 
// Note: This is not a conforming implementation.
 
#ifndef _CPP_CWCTYPE
#define _CPP_CWCTYPE 1
 
#pragma GCC system_header
#include <wctype.h>
 
#endif
/contrib/media/updf/include/c_shadow/assert.h
0,0 → 1,55
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_ASSERT_H_
# define _INCLUDED_CPP_ASSERT_H_ 1
 
#ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _ASSERT_NEED_C_LEGACY_
#endif
 
#include <cassert>
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
 
#ifdef _ASSERT_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _ASSERT_NEED_C_LEGACY_
#endif /* _ASSERT_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_ASSERT_H_ */
 
/contrib/media/updf/include/c_shadow/bits/std_cassert.h
0,0 → 1,61
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 19.2 Assertions
//
 
// NB: This is assumed to be a conforming implementation.
 
// ISO/IEC 9899:1999 (E), section 7.2
// assert.h
// ..defines the assert macro...
 
// ISO 14882
// 17.4.1.2 Headers
// ... declarations and definitions (except for macros) are within
// namespace scope of the namepace std...
 
 
//#ifndef _CPP_CASSERT
//#define _CPP_CASSERT 1
 
//namespace _C_legacy {
extern "C" {
//# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <assert.h>
}
//} // namespace _C_legacy
 
//#undef _IN_C_LEGACY_
 
//#endif
 
 
/contrib/media/updf/include/c_shadow/bits/std_cctype.h
0,0 → 1,145
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// ISO C++ 14882: 22
//
 
#ifndef _CPP_CCTYPE
#define _CPP_CCTYPE 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <ctype.h>
}
 
inline int
_CPP_isalnum_capture(int c) { return isalnum(c); }
 
inline int
_CPP_isalpha_capture(int c) { return isalpha(c); }
 
inline int
_CPP_iscntrl_capture(int c) { return iscntrl(c); }
 
inline int
_CPP_isdigit_capture(int c) { return isdigit(c); }
 
inline int
_CPP_isgraph_capture(int c) { return isgraph(c); }
 
inline int
_CPP_islower_capture(int c) { return islower(c); }
 
inline int
_CPP_isprint_capture(int c) { return isprint(c); }
 
inline int
_CPP_ispunct_capture(int c) { return ispunct(c); }
 
inline int
_CPP_isspace_capture(int c) { return isspace(c); }
 
inline int
_CPP_isupper_capture(int c) { return isupper(c); }
 
inline int
_CPP_isxdigit_capture(int c) { return isxdigit(c); }
 
inline int
_CPP_tolower_capture(int c) { return tolower(c); }
 
inline int
_CPP_toupper_capture(int c) { return toupper(c); }
} // namespace _C_legacy
 
# undef isalnum
# undef isalpha
# undef iscntrl
# undef isdigit
# undef isgraph
# undef islower
# undef isprint
# undef ispunct
# undef isspace
# undef isupper
# undef isxdigit
 
# undef tolower
# undef toupper
 
namespace std {
inline int
isalnum(int __c) { return _C_legacy::_CPP_isalnum_capture(__c); }
 
inline int
isalpha(int __c) { return _C_legacy::_CPP_isalpha_capture(__c); }
 
inline int
iscntrl(int __c) { return _C_legacy::_CPP_iscntrl_capture(__c); }
 
inline int
isdigit(int __c) { return _C_legacy::_CPP_isdigit_capture(__c); }
 
inline int
isgraph(int __c) { return _C_legacy::_CPP_isgraph_capture(__c); }
 
inline int
islower(int __c) { return _C_legacy::_CPP_islower_capture(__c); }
 
inline int
isprint(int __c) { return _C_legacy::_CPP_isprint_capture(__c); }
 
inline int
ispunct(int __c) { return _C_legacy::_CPP_ispunct_capture(__c); }
 
inline int
isspace(int __c) { return _C_legacy::_CPP_isspace_capture(__c); }
 
inline int
isupper(int __c) { return _C_legacy::_CPP_isupper_capture(__c); }
 
inline int
isxdigit(int __c) { return _C_legacy::_CPP_isxdigit_capture(__c); }
 
inline int
tolower(int __c) { return _C_legacy::_CPP_tolower_capture(__c); }
 
inline int
toupper(int __c) { return _C_legacy::_CPP_toupper_capture(__c); }
} // namespace std
# undef _IN_C_LEGACY_
 
#endif
 
 
 
 
/contrib/media/updf/include/c_shadow/bits/std_cerrno.h
0,0 → 1,48
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// ISO C++ 14882: 19.3 Error numbers
//
 
#ifndef _CPP_CERRNO
#define _CPP_CERRNO 1
 
//namespace _C_legacy {
extern "C" {
//# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <errno.h>
}
//} // namespace _C_legacy::
 
//# undef _IN_C_LEGACY_
 
#endif
 
 
/contrib/media/updf/include/c_shadow/bits/std_cfloat.h
0,0 → 1,54
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
 
#ifndef _CPP_CFLOAT
#define _CPP_CFLOAT 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <float.h>
}
} // namespace _C_legacy
 
# undef _IN_C_LEGACY_
 
#endif
 
 
 
 
 
 
 
/contrib/media/updf/include/c_shadow/bits/std_climits.h
0,0 → 1,57
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
 
#ifndef _CPP_CLIMITS
#define _CPP_CLIMITS 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <limits.h>
}
} // namespace _C_legacy
 
# undef _IN_C_LEGACY_
 
#endif
 
 
 
 
 
 
 
 
 
 
/contrib/media/updf/include/c_shadow/bits/std_clocale.h
0,0 → 1,70
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
 
#ifndef _CPP_CLOCALE
#define _CPP_CLOCALE 1
 
# include <bits/std_cstddef.h>
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <locale.h>
}
 
typedef lconv _CPP_lconv_capture;
} // namespace _C_legacy
 
# undef lconv
# undef setlocale
# undef localeconv
 
namespace std {
// Adopt C names into std::
struct lconv : _C_legacy::_CPP_lconv_capture { };
 
using _C_legacy::setlocale;
 
inline lconv*
localeconv() { return reinterpret_cast<lconv*>(_C_legacy::localeconv()); }
} // namespace std
 
# undef _IN_C_LEGACY_
 
#endif
 
 
 
 
 
/contrib/media/updf/include/c_shadow/bits/std_cmath.h
0,0 → 1,833
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 26.5 C library
//
 
#ifndef _CPP_CMATH
#define _CPP_CMATH 1
 
# include <bits/c++config.h>
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <math.h>
}
 
#if _GLIBCPP_HAVE_ACOSF
inline float
_CPP_acos_capture(float __x) { return acosf(__x); }
#else
inline float
_CPP_acos_capture(float __x) { return acos(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_ASINF
inline float
_CPP_asin_capture(float __x) { return asinf(__x); }
#else
inline float
_CPP_asin_capture(float __x) { return asin(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_ATANF
inline float
_CPP_atan_capture(float __x) { return atanf(__x); }
#else
inline float
_CPP_atan_capture(float __x) { return atan(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_ATAN2F
inline float
_CPP_atan2_capture(float __y, float __x) { return atan2f(__y, __x); }
#else
inline float
_CPP_atan2_capture(float __y, float __x)
{ return atan2(static_cast<double>(__y), static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_CEILF
inline float
_CPP_ceil_capture(float __x) { return ceilf(__x); }
#else
inline float
_CPP_ceil_capture(float __x) { return ceil(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE___BUILTIN_COSF
inline float
_CPP_cos_capture(float __x) { return __builtin_cosf(__x); }
#elif _GLIBCPP_HAVE_COSF
inline float
_CPP_cos_capture(float __x) { return cosf(__x); }
#else
inline float
_CPP_cos_capture(float __x) { return cos(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_COSHF
inline float
_CPP_cosh_capture(float __x) { return coshf(__x); }
#else
inline float
_CPP_cosh_capture(float __x) { return cosh(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_EXPF
inline float
_CPP_exp_capture(float __x) { return expf(__x); }
#else
inline float
_CPP_exp_capture(float __x) { return exp(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE___BUILTIN_FABSF
inline float
_CPP_fabs_capture(float __x) { return __builtin_fabsf(__x); }
#elif _GLIBCPP_HAVE_FABSF
inline float
_CPP_fabs_capture(float __x) { return fabsf(__x); }
#else
inline float
_CPP_fabs_capture(float __x) { return fabs(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_FLOORF
inline float
_CPP_floor_capture(float __x) { return floorf(__x); }
#else
inline float
_CPP_floor_capture(float __x) { return floor(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_FMODFF
inline float
_CPP_fmod_capture(float __x, float __y) { return fmodf(__x, __y); }
#else
inline float
_CPP_fmod_capture(float __x, float __y)
{ return fmod(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
 
#if _GLIBCPP_HAVE_FREXPF
inline float
_CPP_frexp_capture(float __x, int* __exp) { return frexpf(__x, __exp); }
#else
inline float
_CPP_frexp_capture(float __x, int* __exp) { return frexp(__x, __exp); }
#endif
 
#if _GLIBCPP_HAVE_LDEXPF
inline float
_CPP_ldexp_capture(float __x, int __exp) { return ldexpf(__x, __exp); }
#else
inline float
_CPP_ldexp_capture(float __x, int __exp)
{ return ldexp(static_cast<double>(__x), __exp); }
#endif
 
#if _GLIBCPP_HAVE_LOGF
inline float
_CPP_log_capture(float __x) { return logf(__x); }
#else
inline float
_CPP_log_capture(float __x) { return log(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_LOG10F
inline float
_CPP_log10_capture(float __x) { return log10f(__x); }
#else
inline float
_CPP_log10_capture(float __x) { return log10(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_MODFF
inline float
_CPP_modf_capture(float __x, float* __iptr) { return modff(__x, __iptr); }
#else
inline float
_CPP_modf_capture(float __x, float* __iptr)
{
double __tmp;
double __res = _C_legacy::modf(static_cast<double>(__x), &__tmp);
*__iptr = static_cast<float> (__tmp);
return __res;
}
#endif
#if _GLIBCPP_HAVE_POWF
inline float
_CPP_pow_capture(float __x, float __y) { return powf(__x, __y); }
#else
inline float
_CPP_pow_capture(float __x, float __y)
{ return pow(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
 
float pow(float, int);
 
#if _GLIBCPP_HAVE___BUILTIN_SINF
inline float
_CPP_sin_capture(float __x) { return __builtin_sinf(__x); }
#elif _GLIBCPP_HAVE_SINF
inline float
_CPP_sin_capture(float __x) { return sinf(__x); }
#else
inline float
_CPP_sin_capture(float __x) { return sin(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_SINHF
inline float
_CPP_sinh_capture(float __x) { return sinhf(__x); }
#else
inline float
_CPP_sinh_capture(float __x) { return sinh(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE___BUILTIN_SQRTF
inline float
_CPP_sqrt_capture(float __x) { return __builtin_sqrtf(__x); }
#elif _GLIBCPP_HAVE_SQRTF
inline float
_CPP_sqrt_capture(float __x) { return sqrtf(__x); }
#else
inline float
_CPP_sqrt_capture(float __x) { return sqrt(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_TANF
inline float
_CPP_tan_capture(float __x) { return tanf(__x); }
#else
inline float
_CPP_tan_capture(float __x) { return tan(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_TANHF
inline float
_CPP_tanh_capture(float __x) { return tanhf(__x); }
#else
inline float
_CPP_tanh_capture(float __x) { return tanh(static_cast<double>(__x)); }
#endif
 
 
inline double
_CPP_acos_capture(double __x) { return acos(__x); }
 
inline double
_CPP_asin_capture(double __x) { return asin(__x); }
 
inline double
_CPP_atan_capture(double __x) { return atan(__x); }
 
inline double
_CPP_atan2_capture(double __y, double __x) { return atan2(__y, __x); }
 
inline double
_CPP_ceil_capture(double __x) { return ceil(__x); }
 
#if _GLIBCPP_HAVE___BUILTIN_COS
inline double
_CPP_cos_capture(double __x) { return __builtin_cos(__x); }
#else
inline double
_CPP_cos_capture(double __x) { return cos(__x); }
#endif
 
inline double
_CPP_cosh_capture(double __x) { return cosh(__x); }
 
inline double
_CPP_exp_capture(double __x) { return exp(__x); }
 
#if _GLIBCPP_HAVE___BUILTIN_FABS
inline double
_CPP_fabs_capture(double __x) { return __builtin_fabs(__x); }
#else
inline double
_CPP_fabs_capture(double __x) { return fabs(__x); }
#endif
 
inline double
_CPP_floor_capture(double __x) { return floor(__x); }
 
inline double
_CPP_fmod_capture(double __x, double __y) { return fmod(__x, __y); }
 
inline double
_CPP_frexp_capture(double __x, int* __exp) { return frexp(__x, __exp); }
 
inline double
_CPP_ldexp_capture(double __x, int __exp) { return ldexp(__x, __exp); }
 
inline double
_CPP_log_capture(double __x) { return log(__x); }
 
inline double
_CPP_log10_capture(double __x) { return log10(__x); }
 
inline double
_CPP_modf_capture(double __x, double* __iptr) { return modf(__x, __iptr); }
 
inline double
_CPP_pow_capture(double __x, double __y) { return pow(__x, __y); }
 
#if _GLIBCPP_HAVE___BUILTIN_SIN
inline double
_CPP_sin_capture(double __x) { return __builtin_sin(__x); }
#else
inline double
_CPP_sin_capture(double __x) { return sin(__x); }
#endif
 
inline double
_CPP_sinh_capture(double __x) { return sinh(__x); }
 
#if _GLIBCPP_HAVE___BUILTIN_SQRT
inline double
_CPP_sqrt_capture(double __x) { return __builtin_fsqrt(__x); }
#else
inline double
_CPP_sqrt_capture(double __x) { return sqrt(__x); }
#endif
 
inline double
_CPP_tan_capture(double __x) { return tan(__x); }
 
inline double
_CPP_tanh_capture(double __x) { return tanh(__x); }
 
#if _GLIBCPP_HAVE_ACOSL
inline long double
_CPP_acos_capture(long double __x) { return acosl(__x); }
#else
inline long double
_CPP_acos_capture(long double __x) { return acos(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_ASINL
inline long double
_CPP_asin_capture(long double __x) { return asinl(__x); }
#else
inline long double
_CPP_asin_capture(long double __x) { return asin(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_ATANL
inline long double
_CPP_atan_capture(long double __x) { return atanl(__x); }
#else
inline long double
_CPP_atan_capture(long double __x) { return atan(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_ATAN2L
inline long double
_CPP_atan2_capture(long double __y, long double __x)
{ return atan2l(__y, __x); }
#else
inline long double
_CPP_atan2_capture(long double __y, long double __x)
{ return atan2(static_cast<double>(__y), static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_CEILL
inline long double
_CPP_ceil_capture(long double __x) { return ceill(__x); }
#else
inline long double
_CPP_ceil_capture(long double __x) { return ceil(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE___BUILTIN_COSL
inline long double
_CPP_cos_capture(long double __x) { return __builtin_cosl(__x); }
#elif _GLIBCPP_HAVE_COSL
inline long double
_CPP_cos_capture(long double __x) { return cosl(__x); }
#else
inline long double
_CPP_cos_capture(long double __x) { return cos(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_COSHL
inline long double
_CPP_cosh_capture(long double __x) { return coshl(__x); }
#else
inline long double
_CPP_cosh_capture(long double __x) { return cosh(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_EXPL
inline long double
_CPP_exp_capture(long double __x) { return expl(__x); }
#else
inline long double
_CPP_exp_capture(long double __x) { return exp(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE___BUILTIN_FABSL
inline long double
_CPP_fabs_capture(long double __x) { return __builtin_fabsl(__x); }
#elif _GLIBCPP_HAVE_FABSL
inline long double
_CPP_fabs_capture(long double __x) { return fabsl(__x); }
#else
inline long double
_CPP_fabs_capture(long double __x) { return fabs(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_FLOORL
inline long double
_CPP_floor_capture(long double __x) { return floorl(__x); }
#else
inline long double
_CPP_floor_capture(long double __x)
{ return floor(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_FMODL
inline long double
_CPP_fmod_capture(long double __x, long double __y)
{ return fmodl(__x, __y); }
#else
inline long double
_CPP_fmod_capture(long double __x, long double __y)
{ return fmod(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
 
#if _GLIBCPP_HAVE_FREXPL
inline long double
_CPP_frexp_capture(long double __x, int* __exp)
{ return frexpl(__x, __exp); }
#else
inline long double
_CPP_frexp_capture(long double __x, int* __exp)
{ return frexp(static_cast<double>(__x), __exp); }
#endif
 
#if _GLIBCPP_HAVE_LDEXPL
inline long double
_CPP_ldexp_capture(long double __x, int __exp) { return ldexpl(__x, __exp); }
#else
inline long double
_CPP_ldexp_capture(long double __x, int __exp)
{ return ldexp(static_cast<double>(__x), __exp); }
#endif
 
#if _GLIBCPP_HAVE_LOGL
inline long double
_CPP_log_capture(long double __x) { return logl(__x); }
#else
inline long double
_CPP_log_capture(long double __x) { return log(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_LOG10L
inline long double
_CPP_log10_capture(long double __x) { return log10l(__x); }
#else
inline long double
_CPP_log10_capture(long double __x)
{ return log10(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_MODFL
inline long double
_CPP_modf_capture(long double __x, long double* __iptr)
{ return modfl(__x, __iptr); }
#else
inline long double
_CPP_modf_capture(long double __x, long double* __iptr)
{
double __tmp;
double __res = _C_legacy::modf(static_cast<double>(__x), &__tmp);
*__iptr = static_cast<long double> (__tmp);
return __res;
}
#endif
 
#if _GLIBCPP_HAVE_POWL
inline long double
_CPP_pow_capture(long double __x, long double __y) { return powl(__x, __y); }
#else
inline long double
_CPP_pow_capture(long double __x, long double __y)
{ return pow(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
 
#if _GLIBCPP_HAVE___BUILTIN_SINL
inline long double
_CPP_sin_capture(long double __x) { return __builtin_sinl(__x); }
#elif _GLIBCPP_HAVE_SINL
inline long double
_CPP_sin_capture(long double __x) { return sinl(__x); }
#else
inline long double
_CPP_sin_capture(long double __x) { return sin(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_SINHL
inline long double
_CPP_sinh_capture(long double __x) { return sinhl(__x); }
#else
inline long double
_CPP_sinh_capture(long double __x) { return sinh(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE___BUILTIN_SQRTL
inline long double
_CPP_sqrt_capture(long double __x) { return __builtin_sqrtl(__x); }
#elif _GLIBCPP_HAVE_SQRTL
inline long double
_CPP_sqrt_capture(long double __x) { return sqrtl(__x); }
#else
inline long double
_CPP_sqrt_capture(long double __x) { return sqrt(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_TANL
inline long double
_CPP_tan_capture(long double __x) { return tanl(__x); }
#else
inline long double
_CPP_tan_capture(long double __x) { return tan(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_TANHL
inline long double
_CPP_tanh_capture(long double __x) { return tanhl(__x); }
#else
inline long double
_CPP_tanh_capture(long double __x) { return tanh(static_cast<double>(__x)); }
#endif
} // namespace _C_legacy
 
# undef abs
# undef acos
# undef asin
# undef atan
# undef atan2
# undef ceil
# undef cos
# undef cosh
# undef exp
# undef fabs
# undef floor
# undef fmod
# undef frexp
# undef ldexp
# undef log
# undef log10
# undef modf
# undef pow
# undef sin
# undef sinh
# undef sqrt
# undef tan
# undef tanh
 
namespace std {
inline float
abs(float __x) { return _C_legacy::_CPP_fabs_capture(__x); }
 
inline float
acos(float __x) { return _C_legacy::_CPP_acos_capture(__x); }
 
inline float
asin(float __x) { return _C_legacy::_CPP_asin_capture(__x); }
 
inline float
atan(float __x) { return _C_legacy::_CPP_atan_capture(__x); }
 
inline float
atan2(float __y, float __x)
{ return _C_legacy::_CPP_atan2_capture(__y, __x); }
 
inline float
ceil(float __x) { return _C_legacy::_CPP_ceil_capture(__x); }
 
inline float
cos(float __x) { return _C_legacy::_CPP_cos_capture(__x); }
 
inline float
cosh(float __x) { return _C_legacy::_CPP_cosh_capture(__x); }
 
inline float
exp(float __x) { return _C_legacy::_CPP_exp_capture(__x); }
 
inline float
fabs(float __x) { return _C_legacy::_CPP_fabs_capture(__x); }
 
inline float
floor(float __x) { return _C_legacy::_CPP_floor_capture(__x); }
 
inline float
fmod(float __x, float __y)
{ return _C_legacy::_CPP_fmod_capture(__x, __y); }
 
inline float
frexp(float __x, int* __exp)
{ return _C_legacy::_CPP_frexp_capture(__x, __exp); }
 
inline float
ldexp(float __x, int __exp)
{ return _C_legacy::_CPP_ldexp_capture(__x, __exp); }
 
inline float
log(float __x) { return _C_legacy::_CPP_log_capture(__x); }
 
inline float
log10(float __x) { return _C_legacy::_CPP_log10_capture(__x); }
 
inline float
modf(float __x, float* __iptr)
{ return _C_legacy::_CPP_modf_capture(__x, __iptr); }
 
inline float
pow(float __x, float __y) { return _C_legacy::_CPP_pow_capture(__x, __y); }
 
float
pow(float, int);
 
inline float
sin(float __x) { return _C_legacy::_CPP_sin_capture(__x); }
 
inline float
sinh(float __x) { return _C_legacy::_CPP_sinh_capture(__x); }
 
inline float
sqrt(float __x) { return _C_legacy::_CPP_sqrt_capture(__x); }
 
inline float
tan(float __x) { return _C_legacy::_CPP_tan_capture(__x); }
 
inline float
tanh(float __x) { return _C_legacy::_CPP_tanh_capture(__x); }
 
inline double
abs(double __x) { return _C_legacy::_CPP_fabs_capture(__x); }
 
inline double
acos(double __x) { return _C_legacy::_CPP_acos_capture(__x); }
 
inline double
asin(double __x) { return _C_legacy::_CPP_asin_capture(__x); }
 
inline double
atan(double __x) { return _C_legacy::_CPP_atan_capture(__x); }
 
inline double
atan2(double __y, double __x)
{ return _C_legacy::_CPP_atan2_capture(__y, __x); }
 
inline double
ceil(double __x) { return _C_legacy::_CPP_ceil_capture(__x); }
 
inline double
cos(double __x) { return _C_legacy::_CPP_cos_capture(__x); }
 
inline double
cosh(double __x) { return _C_legacy::_CPP_cosh_capture(__x); }
 
inline double
exp(double __x) { return _C_legacy::_CPP_exp_capture(__x); }
 
inline double
fabs(double __x) { return _C_legacy::_CPP_fabs_capture(__x); }
 
inline double
floor(double __x) { return _C_legacy::_CPP_floor_capture(__x); }
 
inline double
fmod(double __x, double __y)
{ return _C_legacy::_CPP_fmod_capture(__x, __y); }
 
inline double
frexp(double __x, int* __exp)
{ return _C_legacy::_CPP_frexp_capture(__x, __exp); }
 
inline double
ldexp(double __x, int __exp)
{ return _C_legacy::_CPP_ldexp_capture(__x, __exp); }
 
inline double
log(double __x) { return _C_legacy::_CPP_log_capture(__x); }
 
inline double
log10(double __x) { return _C_legacy::_CPP_log10_capture(__x); }
 
inline double
modf(double __x, double* __iptr)
{ return _C_legacy::_CPP_modf_capture(__x, __iptr); }
 
inline double
pow(double __x, double __y)
{ return _C_legacy::_CPP_pow_capture(__x, __y); }
 
double
pow(double, int);
 
inline double
sin(double __x) { return _C_legacy::_CPP_sin_capture(__x); }
 
inline double
sinh(double __x) { return _C_legacy::_CPP_sinh_capture(__x); }
 
inline double
sqrt(double __x) { return _C_legacy::_CPP_sqrt_capture(__x); }
 
inline double
tan(double __x) { return _C_legacy::_CPP_tan_capture(__x); }
 
inline double
tanh(double __x) { return _C_legacy::_CPP_tanh_capture(__x); }
 
inline long double
abs(long double __x) { return _C_legacy::_CPP_fabs_capture(__x); }
 
inline long double
acos(long double __x) { return _C_legacy::_CPP_acos_capture(__x); }
 
inline long double
asin(long double __x) { return _C_legacy::_CPP_asin_capture(__x); }
 
inline long double
atan(long double __x) { return _C_legacy::_CPP_atan_capture(__x); }
 
inline long double
atan2(long double __y, long double __x)
{ return _C_legacy::_CPP_atan2_capture(__y, __x); }
 
inline long double
ceil(long double __x) { return _C_legacy::_CPP_ceil_capture(__x); }
 
inline long double
cos(long double __x) { return _C_legacy::_CPP_cos_capture(__x); }
 
inline long double
cosh(long double __x) { return _C_legacy::_CPP_cosh_capture(__x); }
 
inline long double
exp(long double __x) { return _C_legacy::_CPP_exp_capture(__x); }
 
inline long double
fabs(long double __x) { return _C_legacy::_CPP_fabs_capture(__x); }
 
inline long double
floor(long double __x) { return _C_legacy::_CPP_floor_capture(__x); }
 
inline long double
fmod(long double __x, long double __y)
{ return _C_legacy::_CPP_fmod_capture(__x, __y); }
 
inline long double
frexp(long double __x, int* __exp)
{ return _C_legacy::_CPP_frexp_capture(__x, __exp); }
 
inline long double
ldexp(long double __x, int __exp)
{ return _C_legacy::_CPP_ldexp_capture(__x, __exp); }
 
inline long double
log(long double __x) { return _C_legacy::_CPP_log_capture(__x); }
 
inline long double
log10(long double __x) { return _C_legacy::_CPP_log10_capture(__x); }
 
inline long double
modf(long double __x, long double* __iptr)
{ return _C_legacy::_CPP_modf_capture(__x, __iptr); }
 
inline long double
pow(long double __x, long double __y)
{ return _C_legacy::_CPP_pow_capture(__x, __y); }
 
long double
pow(long double, int);
 
inline long double
sin(long double __x) { return _C_legacy::_CPP_sin_capture(__x); }
 
inline long double
sinh(long double __x) { return _C_legacy::_CPP_sinh_capture(__x); }
 
inline long double
sqrt(long double __x) { return _C_legacy::_CPP_sqrt_capture(__x); }
 
inline long double
tan(long double __x) { return _C_legacy::_CPP_tan_capture(__x); }
 
inline long double
tanh(long double __x) { return _C_legacy::_CPP_tanh_capture(__x); }
 
} // namespace std
 
# undef _IN_C_LEGACY_
 
#endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/contrib/media/updf/include/c_shadow/bits/std_csetjmp.h
0,0 → 1,63
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
#ifndef _CPP_CSETJMP
#define _CPP_CSETJMP 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <setjmp.h>
}
inline int
_CPP_setjmp_capture(jmp_buf __jb) { return setjmp(__jb); }
} // namespace _C_legacy
 
# undef jmp_buf
# undef setjmp
# define setjmp(__jb) _C_legacy::_CPP_setjmp_capture(__jb)
# undef longjmp
 
namespace std {
// Adopt C names into std::
using _C_legacy::jmp_buf;
using _C_legacy::longjmp;
} // namespace std
# undef _IN_C_LEGACY_
 
#endif
 
 
 
/contrib/media/updf/include/c_shadow/bits/std_csignal.h
0,0 → 1,67
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
#ifndef _CPP_CSIGNAL
#define _CPP_CSIGNAL 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
// XXX
# undef __need_sig_atomic_t
# undef __need_sigset_t
 
# pragma GCC system_header
# include_next <signal.h>
}
} // namespace _C_legacy
 
# undef sig_atomic_t
# undef raise
# undef signal
 
namespace std {
// Adopt C names into std::
using _C_legacy::sig_atomic_t;
using _C_legacy::raise;
using _C_legacy::signal;
} // namespace std
# undef _IN_C_LEGACY_
 
#endif
 
 
 
 
 
/contrib/media/updf/include/c_shadow/bits/std_cstdarg.h
0,0 → 1,54
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
#ifndef _CPP_CSTDARG
#define _CPP_CSTDARG 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <stdarg.h>
}
} // namespace _C_legacy
 
# undef va_list
 
namespace std {
using _C_legacy::va_list;
} // namespace std
 
# undef _IN_C_LEGACY_
 
#endif
 
/contrib/media/updf/include/c_shadow/bits/std_cstddef.h
0,0 → 1,59
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.1 Types
//
 
#ifndef _CPP_CSTDDEF
#define _CPP_CSTDDEF 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
// XXX
# define __need_size_t
# define __need_ptrdiff_t
# define __need_NULL
# include_next <stddef.h>
}
} // namespace _C_legacy
 
# undef ptrdiff_t
# undef size_t
 
namespace std {
using _C_legacy::ptrdiff_t;
using _C_legacy::size_t;
} // namespace std
# undef _IN_C_LEGACY_
 
#endif
/contrib/media/updf/include/c_shadow/bits/std_cstdio.h
0,0 → 1,283
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.8.2 C Library files
//
 
#ifndef _CPP_CSTDIO
#define _CPP_CSTDIO 1
 
# include <bits/std_cstddef.h>
# include <bits/std_cstdarg.h>
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef __need_FILE
# pragma GCC system_header
# include_next <stdio.h>
}
 
typedef FILE _CPP_FILE_capture;
typedef fpos_t _CPP_fpos_t_capture;
 
inline FILE*
_CPP_stderr_capture() { return stderr; }
 
inline FILE*
_CPP_stdin_capture() { return stdin; }
 
inline FILE*
_CPP_stdout_capture() { return stdout; }
 
inline int
_CPP_getc_capture(FILE* __f) { return getc(__f); }
 
inline int
_CPP_getchar_capture() { return getchar(); }
 
inline int
_CPP_putc_capture(int __c, FILE* __f) { return putc(__c, __f); }
inline int
_CPP_putchar_capture(int __c) { return putchar(__c); }
inline int
_CPP_feof_capture(FILE* __f) { return feof(__f); }
 
} // namespace _C_legacy
 
# undef FILE
# undef fpos_t
 
# undef remove
# undef rename
# undef tmpfile
# undef tmpnam
# undef fclose
# undef fflush
# undef fopen
# undef freopen
# undef setbuf
# undef setvbuf
# undef fprintf
# undef fscanf
# undef printf
# undef scanf
# undef sprintf
# undef sscanf
# undef vfprintf
# undef vprintf
# undef vsprintf
# undef fgetc
# undef fgets
# undef fputc
# undef fputs
# undef getc
# undef getchar
# undef gets
# undef putc
# undef putchar
# undef puts
# undef ungetc
# undef fread
# undef fwrite
# undef fgetpos
# undef fseek
# undef fsetpos
# undef ftell
# undef rewind
# undef clearerr
# undef feof
# undef ferror
# undef perror
# undef stderr
# define stderr std::_CPP_stderr()
# undef stdin
# define stdin std::_CPP_stdin()
# undef stdout
# define stdout std::_CPP_stdout()
 
namespace std {
struct FILE : _C_legacy::_CPP_FILE_capture { };
struct fpos_t { _C_legacy::_CPP_fpos_t_capture _M_dummy; };
 
using _C_legacy::remove;
using _C_legacy::rename;
using _C_legacy::tmpnam;
using _C_legacy::printf;
using _C_legacy::scanf;
using _C_legacy::sprintf;
using _C_legacy::sscanf;
using _C_legacy::gets;
using _C_legacy::perror;
 
inline FILE*
_CPP_stderr()
{ return reinterpret_cast<FILE*>(_C_legacy::_CPP_stderr_capture() ); }
 
inline FILE*
_CPP_stdin()
{ return reinterpret_cast<FILE*>(_C_legacy::_CPP_stdin_capture() ); }
 
inline FILE*
_CPP_stdout()
{ return reinterpret_cast<FILE*>(_C_legacy::_CPP_stdout_capture() ); }
 
inline FILE*
tmpfile() { return reinterpret_cast<FILE*>(_C_legacy::tmpfile()); }
 
inline int
fclose(FILE* __f) { return _C_legacy::fclose(__f); }
 
inline int
fflush(FILE* __f) { return _C_legacy::fflush(__f); }
 
inline FILE*
fopen(char const* __name, char const* __mode)
{ return reinterpret_cast<FILE*>(_C_legacy::fopen(__name,__mode)); }
 
inline FILE*
freopen(char const* __name, char const* __mode, FILE* __f)
{ return reinterpret_cast<FILE*>(_C_legacy::freopen(__name,__mode,__f)); }
 
inline void
setbuf(FILE* __f, char* __buf)
{ return _C_legacy::setbuf(__f, __buf); }
 
inline int
setvbuf(FILE* __f, char* __buf, int __mode, size_t __size)
{ return _C_legacy::setvbuf(__f, __buf, __mode, __size); }
 
inline int
fprintf(FILE* __f, char const* __fmt, ...)
{
va_list __v;
va_start(__v,__fmt);
int __i = _C_legacy::vfprintf(__f, __fmt, __v);
va_end(__v);
return __i;
}
 
inline int
fscanf(FILE* __f, char const* __fmt, ...)
{
va_list __v;
va_start(__v,__fmt);
int __i = _C_legacy::vfscanf(__f, __fmt, __v);
va_end(__v);
return __i;
}
 
inline int
vfprintf(FILE* __f, char const* __fmt, va_list __v)
{ return _C_legacy::vfprintf(__f, __fmt, __v); }
 
inline int
vprintf(char const* __fmt, va_list __v)
{ return _C_legacy::vprintf(__fmt, __v); }
 
inline int
vsprintf(char* __buf, char const* __fmt, va_list __v)
{ return _C_legacy::vsprintf(__buf, __fmt, __v); }
 
inline int
fgetc(FILE* __f) { return _C_legacy::fgetc(__f); }
 
inline char*
fgets(char* __buf, int __n, FILE* __f)
{ return _C_legacy::fgets(__buf, __n, __f); }
 
inline int
fputc(int __c, FILE* __f) { return _C_legacy::fputc(__c, __f); }
 
inline int
fputs(char const* __s, FILE* __f)
{ return _C_legacy::fputs(__s, __f); }
 
inline int
getc(FILE* __f) { return _C_legacy::_CPP_getc_capture(__f); }
 
inline int
getchar() { return _C_legacy::_CPP_getchar_capture(); }
 
inline int
putc(int __c, FILE* __f)
{ return _C_legacy::_CPP_putc_capture(__c, __f); }
 
inline int
putchar(int __c) { return _C_legacy::_CPP_putchar_capture(__c); }
 
using _C_legacy::puts;
 
inline int
ungetc(int __c, FILE* __f) { return _C_legacy::ungetc(__c, __f); }
 
inline size_t
fread(void* __p, size_t __z, size_t __n, FILE* __f)
{ return _C_legacy::fread(__p,__z,__n,__f); }
 
inline size_t
fwrite(void const* __p, size_t __z, size_t __n, FILE* __f)
{ return _C_legacy::fwrite(__p,__z,__n,__f); }
 
inline int
fgetpos(FILE* __f, fpos_t* __pos)
{ return _C_legacy::fgetpos(__f,&__pos->_M_dummy); }
 
inline int
fseek(FILE* __f, long __off, int __how)
{ return _C_legacy::fseek(__f,__off,__how); }
 
inline int
fsetpos(FILE* __f, fpos_t const* __pos)
{ return _C_legacy::fsetpos(__f,&__pos->_M_dummy); }
 
inline long
ftell(FILE* __f) { return _C_legacy::ftell(__f); }
 
inline void
rewind(FILE* __f) { return _C_legacy::rewind(__f); }
 
inline void
clearerr(FILE* __f) { return _C_legacy::clearerr(__f); }
 
inline int
feof(FILE* __f) { return _C_legacy::_CPP_feof_capture(__f); }
 
inline int
ferror(FILE* __f) { return _C_legacy::ferror(__f); }
} // namespace std
 
# undef _IN_C_LEGACY_
 
#endif
 
/contrib/media/updf/include/c_shadow/bits/std_cstdlib.h
0,0 → 1,197
// -*- C++ -*- header wrapper
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
// Function decls in this header are overloaded on the
// extern "C"-ness of arguments. This is a rich ground
// for compiler bugs.
 
#ifndef _CPP_CSTDLIB
#define _CPP_CSTDLIB 1
 
# include <bits/c++config.h>
# include <bits/std_cstddef.h>
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <stdlib.h>
typedef int (*_C_cmp_fun_ptr)(const void*, const void*); // C fn ptr
}
 
typedef div_t _CPP_div_t_capture;
typedef ldiv_t _CPP_ldiv_t_capture;
 
# if _GLIBCPP_HAVE_LLDIV_T
typedef lldiv_t _CPP_lldiv_t_capture;
# endif
} // namespace _C_legacy
 
# undef wchar_t
# undef div_t
# undef ldiv_t
 
# undef atof
# undef atoi
# undef atol
# undef strtod
# undef strtol
# undef strtoul
#ifdef _GLIBCPP_HAVE_STRTOLD
# undef strtold
#endif
# undef rand
# undef srand
# undef calloc
# undef free
# undef malloc
# undef realloc
# undef abort
# undef atexit
# undef exit
# undef getenv
# undef system
# undef bsearch
# undef qsort
# undef abs
# undef div
# undef labs
# undef ldiv
#ifdef _GLIBCPP_USE_LONG_LONG
# undef llabs
# undef lldiv
#endif
# undef mblen
# undef mbtowc
# undef wctomb
# undef mbstowcs
# undef wcstombs
 
namespace std {
struct div_t : _C_legacy::_CPP_div_t_capture { };
struct ldiv_t : _C_legacy::_CPP_ldiv_t_capture { };
 
#ifdef _GLIBCPP_USE_LONG_LONG
# ifdef _GLIBCPP_HAVE_LLDIV_T
struct lldiv_t : _C_legacy::_CPP_lldiv_t_capture { };
# else
struct lldiv_t
{
long long quot;
long long rem;
};
# endif
#endif
 
using _C_legacy::atof;
using _C_legacy::atoi;
using _C_legacy::atol;
using _C_legacy::strtod;
using _C_legacy::strtol;
using _C_legacy::strtoul;
using _C_legacy::rand;
using _C_legacy::srand;
using _C_legacy::calloc;
using _C_legacy::free;
using _C_legacy::malloc;
using _C_legacy::realloc;
 
// using _C_legacy::abort;
using _C_legacy::atexit;
// using _C_legacy::exit;
using _C_legacy::bsearch;
using _C_legacy::qsort;
 
using _C_legacy::getenv;
using _C_legacy::system;
using _C_legacy::mbtowc;
using _C_legacy::wctomb;
using _C_legacy::mbstowcs;
using _C_legacy::wcstombs;
 
using _C_legacy::strtof;
 
#ifdef _GLIBCPP_USE_LONG_LONG
using _C_legacy::strtoll;
using _C_legacy::strtoull;
#endif
 
#ifdef _GLIBCPP_HAVE_STRTOLD
using _C_legacy::strtold;
#endif
 
using _C_legacy::mblen;
 
inline int
abs(int __x) { return __x >= 0 ? __x : -__x; }
 
inline div_t
div(int __n, int __d)
{ div_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
 
inline long
labs(long __x) { return __x >= 0 ? __x : -__x; }
 
inline long
abs(long __x) { return __x >= 0 ? __x : -__x; }
 
inline ldiv_t
ldiv(long __n, long __d)
{ ldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
 
inline ldiv_t
div(long __n, long __d)
{ ldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
 
#ifdef _GLIBCPP_USE_LONG_LONG
inline long long
llabs(long long __x) { return __x >= 0 ? __x : -__x; }
 
inline long long
abs(long long __x) { return __x >= 0 ? __x : -__x; }
 
inline lldiv_t
lldiv(long long __n, long long __d)
{ lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
 
inline lldiv_t
div(long long __n, long long __d)
{ lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
#endif
} // namespace std
# undef _IN_C_LEGACY_
 
#endif
 
 
/contrib/media/updf/include/c_shadow/bits/std_cstring.h
0,0 → 1,279
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
#ifndef _CPP_CSTRING
#define _CPP_CSTRING 1
 
# if defined __GLIBC__ && __GLIBC__ >= 2
// We must not see the optimized string functions GNU libc defines.
# define __NO_STRING_INLINES
# endif
 
# include <bits/std_cstddef.h>
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <string.h>
}
 
// We do inline captures of most of these in case they
// have been optimized with macros.
inline void*
_CPP_memcpy_capture(void* __s1, void const* __s2, size_t __n)
{ return memcpy(__s1, __s2, __n); }
 
inline void*
_CPP_memmove_capture(void* __s1, void const* __s2, size_t __n)
{ return memmove(__s1, __s2, __n); }
 
inline void*
_CPP_strcpy_capture(char* __s1, char const* __s2)
{ return strcpy(__s1, __s2); }
 
inline char*
_CPP_strncpy_capture(char* __s1, char const* __s2, size_t __n)
{ return strncpy(__s1, __s2, __n); }
 
inline char*
_CPP_strcat_capture(char* __s1, char const* __s2)
{ return strcat(__s1, __s2); }
 
inline char*
_CPP_strncat_capture(char* __s1, char const* __s2, size_t __n)
{ return strncat(__s1, __s2, __n); }
 
inline int
_CPP_memcmp_capture(void const* __s1, void const* __s2, size_t __n)
{ return memcmp(__s1, __s2, __n); }
 
inline int
_CPP_strcmp_capture(char const* __s1, char const* __s2)
{ return strcmp(__s1, __s2); }
 
inline int
_CPP_strcoll_capture(char const* __s1, char const* __s2)
{ return strcoll(__s1, __s2); }
 
inline int
_CPP_strncmp_capture(char const* __s1, char const* __s2, size_t __n)
{ return strncmp(__s1, __s2, __n); }
 
inline size_t
_CPP_strxfrm_capture(char* __b, char const* __s, size_t __n)
{ return strxfrm(__b, __s, __n); }
 
inline void*
_CPP_memchr_capture(void const* __s1, int __c, size_t __n)
{ return memchr(__s1, __c, __n); }
 
inline char*
_CPP_strchr_capture(char const* __s1, int __c)
{ return strchr(__s1, __c); }
 
inline size_t
_CPP_strcspn_capture(char const* __s1, char const* __s2)
{ return strcspn(__s1, __s2); }
 
inline char*
_CPP_strpbrk_capture(char const* __s1, char const* __s2)
{ return strpbrk(__s1, __s2); }
 
inline char*
_CPP_strrchr_capture(char const* __s1, int __c)
{ return strrchr(__s1, __c); }
 
inline size_t
_CPP_strspn_capture(char const* __s1, char const* __s2)
{ return strspn(__s1, __s2); }
 
inline char*
_CPP_strstr_capture(char const* __s1, char const* __s2)
{ return strstr(__s1, __s2); }
 
inline char*
_CPP_strtok_capture(char* __s1, char const* __s2)
{ return strtok(__s1, __s2); }
 
inline void*
_CPP_memset_capture(void* __s, int __c, size_t __n)
{ return memset(__s, __c, __n); }
 
// inline char*
// _CPP_strerror_capture(int __num)
// { return strerror(__num); }
 
inline size_t
_CPP_strlen_capture(char const* __s)
{ return strlen(__s); }
} // namespace _C_legacy
 
# undef memcpy
# undef memmove
# undef strcpy
# undef strncpy
# undef strcat
# undef strncat
# undef memcmp
# undef strcmp
# undef strcoll
# undef strncmp
# undef strxfrm
# undef memchr
# undef strchr
# undef strcspn
# undef strpbrk
# undef strrchr
# undef strspn
# undef strstr
# undef strtok
# undef memset
# undef strerror
# undef strlen
 
namespace std {
// Redefine most of these inline. Note that the
// C++ definition differs from C in some cases.
inline void*
memcpy(void* __s1, void const* __s2, size_t __n)
{ return _C_legacy::_CPP_memcpy_capture(__s1, __s2, __n); }
 
inline void*
memmove(void* __s1, void const* __s2, size_t __n)
{ return _C_legacy::_CPP_memmove_capture(__s1, __s2, __n); }
 
inline void*
strcpy(char* __s1, char const* __s2)
{ return _C_legacy::_CPP_strcpy_capture(__s1, __s2); }
 
inline char*
strncpy(char* __s1, char const* __s2, size_t __n)
{ return _C_legacy::_CPP_strncpy_capture(__s1, __s2, __n); }
 
inline char*
strcat(char* __s1, char const* __s2)
{ return _C_legacy::_CPP_strcat_capture(__s1, __s2); }
 
inline char*
strncat(char* __s1, char const* __s2, size_t __n)
{ return _C_legacy::_CPP_strncat_capture(__s1, __s2, __n); }
 
inline int
memcmp(void const* __s1, void const* __s2, size_t __n)
{ return _C_legacy::_CPP_memcmp_capture(__s1, __s2, __n); }
 
inline int
strcmp(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strcmp_capture(__s1, __s2); }
 
inline int
strcoll(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strcoll_capture(__s1, __s2); }
 
inline int
strncmp(char const* __s1, char const* __s2, size_t __n)
{ return _C_legacy::_CPP_strncmp_capture(__s1, __s2, __n); }
 
inline size_t
strxfrm(char* __b, char const* __s, size_t __n)
{ return _C_legacy::_CPP_strxfrm_capture(__b, __s, __n); }
 
inline void
const* memchr(void const* __s1, int __c, size_t __n)
{ return _C_legacy::_CPP_memchr_capture(__s1, __c, __n); }
 
inline void*
memchr(void* __s1, int __c, size_t __n)
{ return _C_legacy::_CPP_memchr_capture(__s1, __c, __n); }
 
inline char const*
strchr(char const* __s1, int __c)
{ return _C_legacy::_CPP_strchr_capture(__s1, __c); }
 
inline char*
strchr(char* __s1, int __c)
{ return _C_legacy::_CPP_strchr_capture(__s1, __c); }
 
inline size_t
strcspn(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strcspn_capture(__s1, __s2); }
 
inline char const*
strpbrk(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strpbrk_capture(__s1, __s2); }
 
inline char*
strpbrk(char* __s1, char const* __s2)
{ return _C_legacy::_CPP_strpbrk_capture(__s1, __s2); }
 
inline char const*
strrchr(char const* __s1, int __c)
{ return _C_legacy::_CPP_strrchr_capture(__s1, __c); }
 
inline char*
strrchr(char* __s1, int __c)
{ return _C_legacy::_CPP_strrchr_capture(__s1, __c); }
 
inline size_t
strspn(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strspn_capture(__s1, __s2); }
 
inline char const*
strstr(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strstr_capture(__s1, __s2); }
 
inline char*
strstr(char* __s1, char const* __s2)
{ return _C_legacy::_CPP_strstr_capture(__s1, __s2); }
 
inline char*
strtok(char* __s1, char const* __s2)
{ return _C_legacy::_CPP_strtok_capture(__s1, __s2); }
 
inline void*
memset(void* __s, int __c, size_t __n)
{ return _C_legacy::_CPP_memset_capture(__s, __c, __n); }
 
using _C_legacy::strerror;
 
inline size_t
strlen(char const* __s)
{ return _C_legacy::_CPP_strlen_capture(__s); }
 
} // namespace std
 
# undef _IN_C_LEGACY_
 
#endif
 
/contrib/media/updf/include/c_shadow/bits/std_ctime.h
0,0 → 1,107
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.5 Date and time
//
 
#ifndef _CPP_CTIME
#define _CPP_CTIME 1
 
# include <bits/std_cstddef.h>
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
 
// XXX
// glibc 2.1.x time.h is on crack
# undef __need_time_t
# undef __need_clock_t
# undef __need_timespec
 
# include_next <time.h>
}
 
typedef clock_t _CPP_clock_t_capture;
typedef time_t _CPP_time_t_capture;
typedef tm _CPP_tm_capture;
 
} // namespace _C_legacy
 
# undef clock_t
# undef time_t
# undef tm
# undef clock
# undef difftime
# undef mktime
# undef time
# undef asctime
# undef ctime
# undef gmtime
# undef localtime
# undef strftime
 
namespace std {
 
// Adopt C names into std::
typedef _C_legacy::_CPP_clock_t_capture clock_t;
typedef _C_legacy::_CPP_time_t_capture time_t;
struct tm : _C_legacy::_CPP_tm_capture { };
 
using _C_legacy::clock;
using _C_legacy::difftime;
using _C_legacy::mktime;
using _C_legacy::time;
using _C_legacy::ctime;
 
inline char*
asctime(const tm* __t)
{ return _C_legacy::asctime(static_cast<_C_legacy::_CPP_tm_capture const*>(__t)); }
 
inline tm*
gmtime(time_t const* __tp)
{ return reinterpret_cast<tm*>(_C_legacy::gmtime(__tp)); }
 
inline tm*
localtime(const time_t* __tp)
{ return reinterpret_cast<tm*>(_C_legacy::localtime(__tp)); }
inline size_t
strftime(char* __buf, size_t __maxsz, char const* __fmt, tm const* __tp)
{ return _C_legacy::strftime(__buf, __maxsz, __fmt,
static_cast<_C_legacy::_CPP_tm_capture const*>(__tp)); }
 
} // namespace std
# undef _IN_C_LEGACY_
 
#endif
 
/contrib/media/updf/include/c_shadow/bits/std_cwchar.h
0,0 → 1,275
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 21
 
#ifndef _CPP_CWCHAR
# define _CPP_CWCHAR 1
# include <bits/std_cstdio.h>
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <wchar.h>
}
 
#if 0
// XXX
inline int
fwprintf(FILE* __stream, const wchar_t* __format, ...);
 
inline int
fwscanf(FILE* __stream, const wchar_t* __format, ...);
 
inline int
vfwprintf(FILE* __stream, const wchar_t* __format, va_list __arg);
 
inline int
vfwscanf(FILE* __stream, const wchar_t* __format, va_list __arg);
 
inline wint_t
_CPP_fgetwc_capture(FILE* __stream)
{ return fgetwc(__stream); }
 
inline wchar_t*
_CPP_fgetws_capture(wchar_t* __s, int __n, FILE* __stream)
{ return fgetws(__s, __n, __stream); }
 
inline wint_t
_CPP_fputwc_capture(wchar_t __c, FILE* __stream)
{ return fputwc(__c, __stream); }
 
inline int
_CPP_fputws_capture(const wchar_t* __s, FILE* __stream)
{ return fputws(__s, __stream); }
 
inline int
_CPP_fwide_capture(FILE* __stream, int __mode)
{ return fwide(__stream, __mode); }
 
inline wint_t
_CPP_fgetwc_capture(FILE* __stream)
{ return fgetwc(__stream); }
 
inline wint_t
_CPP_putwc_capture(wchar_t __c, FILE* __stream)
{ return putwc(__c, __stream); }
inline wint_t
_CPP_ungetwc_capture(wint_t __c, FILE* __stream)
{ return ungetwc(__c, __stream); }
#endif
} // namespace _C_legacy
 
# undef wchar_t
# undef wint_t
# undef mbstate_t
 
# undef fwprintf
# undef fwscanf
# undef swprintf
# undef swscanf
# undef vfwprintf
# undef vfwscanf
# undef vswprintf
# undef vswscanf
# undef vwprintf
# undef vwscanf
# undef wprintf
# undef wscanf
# undef fgetwc
# undef fgetws
# undef fputwc
# undef fputws
# undef fwide
# undef getwc
# undef getwchar
# undef putwc
# undef putwchar
# undef ungetwc
# undef wcstod
# undef wcstof
# undef wcstold
# undef wcstol
# undef wcstoll
# undef wcstoul
# undef wcstoull
# undef wcscpy
# undef wcsncpy
# undef wcscat
# undef wcsncat
# undef wcsmp
# undef wcscoll
# undef wcsncmp
# undef wcsxfrm
# undef wcschr
# undef wcscspn
# undef wcslen
# undef wcspbrk
# undef wcsrchr
# undef wcsspn
# undef wcsstr
# undef wcstok
# undef wmemchr
# undef wmemcmp
# undef wmemcpy
# undef wmemmove
# undef wmemset
# undef wcsftime
# undef btowc
# undef wctob
# undef mbsinit
# undef mbrlen
# undef mbrtowc
# undef wcrtomb
# undef mbsrtowcs
# undef wcsrtombs
 
namespace std {
 
using _C_legacy::wint_t;
using _C_legacy::mbstate_t;
 
#if 0
using _C_legacy::swprintf;
using _C_legacy::swscanf;
using _C_legacy::vswprintf;
using _C_legacy::vswscanf;
using _C_legacy::vwprintf;
using _C_legacy::vwscanf;
using _C_legacy::wprintf;
using _C_legacy::wscanf;
using _C_legacy::getwchar;
using _C_legacy::putwchar;
#endif
 
using _C_legacy::wcstod;
using _C_legacy::wcstof;
using _C_legacy::wcstold;
using _C_legacy::wcstol;
using _C_legacy::wcstoll;
using _C_legacy::wcstoul;
using _C_legacy::wcstoull;
using _C_legacy::wcscpy;
using _C_legacy::wcsncpy;
using _C_legacy::wcscat;
using _C_legacy::wcsncat;
 
#if 0
using _C_legacy::wcsmp;
#endif
 
using _C_legacy::wcscoll;
using _C_legacy::wcsncmp;
using _C_legacy::wcsxfrm;
using _C_legacy::wcschr;
using _C_legacy::wcscspn;
using _C_legacy::wcslen;
using _C_legacy::wcspbrk;
using _C_legacy::wcsrchr;
using _C_legacy::wcsspn;
using _C_legacy::wcsstr;
using _C_legacy::wcstok;
using _C_legacy::wmemchr;
using _C_legacy::wmemcmp;
using _C_legacy::wmemcpy;
using _C_legacy::wmemmove;
using _C_legacy::wmemset;
 
#if 0
using _C_legacy::wcsftime;
#endif
 
using _C_legacy::btowc;
using _C_legacy::wctob;
using _C_legacy::mbsinit;
using _C_legacy::mbrlen;
using _C_legacy::mbrtowc;
using _C_legacy::wcrtomb;
using _C_legacy::mbsrtowcs;
using _C_legacy::wcsrtombs;
 
#if 0
// XXX
inline int
fwprintf(FILE* __stream, const wchar_t* __format, ...);
 
inline int
fwscanf(FILE* __stream, const wchar_t* __format, ...);
 
inline int
vfwprintf(FILE* __stream, const wchar_t* __format, va_list __arg);
 
inline int
vfwscanf(FILE* __stream, const wchar_t* __format, va_list __arg);
 
inline wint_t
fgetwc(FILE* __stream)
{ return _C_legacy::_CPP_fgetwc_capture(__stream); }
 
inline wchar_t*
fgetws(wchar_t* __s, int __n, FILE* __stream)
{ return _C_legacy::_CPP_fgetws_capture(__s, __n, __stream); }
 
inline wint_t
fputwc(wchar_t __c, FILE* __stream)
{ return _C_legacy::_CPP_fputwc_capture(__c, __stream); }
 
inline int
fputws(const wchar_t* __s, FILE* __stream)
{ return _C_legacy::_CPP_fputws_capture(__s, __stream); }
 
inline int
fwide(FILE* __stream, int __mode)
{ return _C_legacy::_CPP_fwide_capture(__stream, __mode); }
 
inline wint_t
getwc(FILE* __stream)
{ return _C_legacy::_CPP_getwc_capture(__stream); }
 
inline wint_t
putwc(wchar_t __c, FILE* __stream)
{ return _C_legacy::_CPP_putwc_capture(__c, __stream); }
inline wint_t
ungetwc(wint_t __c, FILE* __stream)
{ return _C_legacy::_CPP_ungetwc_capture(__c, __stream); }
#endif
}
 
# undef _IN_C_LEGACY_
 
#endif
 
 
 
 
 
/contrib/media/updf/include/c_shadow/bits/std_cwctype.h
0,0 → 1,129
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882:
//
 
#ifndef _CPP_CWCTYPE
#define _CPP_CWCTYPE 1
 
# include <bits/std_cwchar.h>
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <wctype.h>
}
} // namespace _C_legacy
 
 
# undef wctype_t
# undef wctrans_t
# undef iswalpha
# undef iswupper
# undef iswlower
# undef iswdigit
# undef iswxdigit
# undef iswalnum
# undef iswspace
# undef iswpunct
# undef iswprint
# undef iswgraph
# undef iswcntrl
# undef iswctype
# undef towctrans
# undef towlower
# undef towupper
# undef wctrans
# undef wctype
 
namespace std {
using _C_legacy::wctype_t;
using _C_legacy::wctrans_t;
 
inline int
iswalpha(wint_t __wc) { return _C_legacy::iswalpha(__wc); }
 
inline int
iswupper(wint_t __wc) { return _C_legacy::iswupper(__wc); }
 
inline int
iswlower(wint_t __wc) { return _C_legacy::iswlower(__wc); }
 
inline int
iswdigit(wint_t __wc) { return _C_legacy::iswdigit(__wc); }
 
inline int
iswxdigit(wint_t __wc) { return _C_legacy::iswxdigit(__wc); }
 
inline int
iswalnum(wint_t __wc) { return _C_legacy::iswalnum(__wc); }
 
inline int
iswspace(wint_t __wc) { return _C_legacy::iswspace(__wc); }
 
inline int
iswpunct(wint_t __wc) { return _C_legacy::iswpunct(__wc); }
 
inline int
iswprint(wint_t __wc) { return _C_legacy::iswprint(__wc); }
 
inline int
iswgraph(wint_t __wc) { return _C_legacy::iswgraph(__wc); }
 
inline int
iswcntrl(wint_t __wc) { return _C_legacy::iswcntrl(__wc); }
 
inline int
towlower(wint_t __wc) { return _C_legacy::towlower(__wc); }
 
inline int
towupper(wint_t __wc) { return _C_legacy::towupper(__wc); }
 
inline int
iswctype(wint_t __wc, wctype_t __desc)
{ return _C_legacy::iswctype(__wc, __desc); }
 
inline wint_t
towctrans(wint_t __wc, wctrans_t __desc)
{ return _C_legacy::towctrans (__wc, __desc); }
inline wctrans_t
wctrans(const char *__property) { return _C_legacy::wctrans(__property); }
 
inline wctype_t
wctype(char const* __property) { return _C_legacy::wctype(__property); }
} // namespace std
 
# undef _IN_C_LEGACY_
 
#endif
 
/contrib/media/updf/include/c_shadow/bits/wrap_fcntl.h
0,0 → 1,92
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 26.5 C library extensions
//
 
#ifndef _CPP_FCNTL
#define _CPP_FCNTL 1
 
# include <bits/c++config.h>
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
// XXX
# undef SEEK_SET
# undef SEEK_CUR
# undef SEEK_END
 
# include_next <fcntl.h>
}
} // namespace _C_legacy
 
# undef SEEK_SET
# undef SEEK_CUR
# undef SEEK_END
 
// NB: Don't bring elements from this non-standard header into namespace std.
 
# undef _IN_C_LEGACY_
 
#endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/contrib/media/updf/include/c_shadow/bits/wrap_features.h
0,0 → 1,51
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.5 Extensions
//
 
#ifndef _CPP_WRAP_FEATURES_H
#define _CPP_WRAP_FEATURES_H 1
 
#include <bits/c++config.h>
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <features.h>
}
} // namespace _C_legacy
 
// NB: Don't bring elements from this non-standard header into namespace std.
 
# undef _IN_C_LEGACY_
 
#endif
/contrib/media/updf/include/c_shadow/bits/wrap_iconv.h
0,0 → 1,51
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.5 Extensions
//
 
#ifndef _CPP_WRAP_ICONV_H
#define _CPP_WRAP_ICONV_H 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <iconv.h>
}
} // namespace _C_legacy
 
// NB: Don't bring elements from this non-standard header into namespace std.
 
# undef _IN_C_LEGACY_
 
#endif
 
 
/contrib/media/updf/include/c_shadow/bits/wrap_iolibio.h
0,0 → 1,50
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.5 Extensions
//
 
#ifndef _CPP_WRAP_IOLIBIO_H
#define _CPP_WRAP_IOLIBIO_H 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <iolibio.h>
}
} // namespace _C_legacy
 
// NB: Don't bring elements from this non-standard header into namespace std.
 
# undef _IN_C_LEGACY_
 
#endif
 
/contrib/media/updf/include/c_shadow/bits/wrap_langinfo.h
0,0 → 1,49
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.5 Extensions
//
 
#ifndef _CPP_WRAP_LANGINFO_H
#define _CPP_WRAP_LANGINFO_H 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <langinfo.h>
}
} // namespace _C_legacy
 
# undef _IN_C_LEGACY_
 
#endif
 
 
/contrib/media/updf/include/c_shadow/bits/wrap_libio.h
0,0 → 1,50
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.5 Extensions
//
 
#ifndef _CPP_WRAP_LIBIO_H
#define _CPP_WRAP_LIBIO_H 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <libio.h>
}
} // namespace _C_legacy
 
// NB: Don't bring elements from this non-standard header into namespace std.
 
# undef _IN_C_LEGACY_
 
#endif
 
/contrib/media/updf/include/c_shadow/bits/wrap_libioP.h
0,0 → 1,50
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.5 Extensions
//
 
#ifndef _CPP_WRAP_LIBIOP_H
#define _CPP_WRAP_LIBIOP_H 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <libioP.h>
}
} // namespace _C_legacy
 
// NB: Don't bring elements from this non-standard header into namespace std.
 
# undef _IN_C_LEGACY_
 
#endif
 
/contrib/media/updf/include/c_shadow/bits/wrap_pthread.h
0,0 → 1,81
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 26.5 C library extensions
//
 
#ifndef _CPP_WRAP_PTHREAD_H
#define _CPP_WRAP_PTHREAD_H 1
 
# include <bits/c++config.h>
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <pthread.h>
}
} // namespace _C_legacy
 
# undef _IN_C_LEGACY_
 
#endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/contrib/media/updf/include/c_shadow/bits/wrap_unistd.h
0,0 → 1,47
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 26.5 C library extensions
//
 
#ifndef _CPP_WRAP_UNISTD_H
#define _CPP_WRAP_UNISTD_H 1
 
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <unistd.h>
}
} // namespace _C_legacy
 
# undef _IN_C_LEGACY_
 
#endif
/contrib/media/updf/include/c_shadow/ctype.h
0,0 → 1,67
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_CTYPE_H_
# define _INCLUDED_CPP_CTYPE_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _CTYPE_NEED_C_LEGACY_
# endif
 
# include <cctype>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::isalnum;
using std::isalpha;
using std::iscntrl;
using std::isdigit;
using std::isgraph;
using std::islower;
using std::isprint;
using std::ispunct;
using std::isspace;
using std::isupper;
using std::isxdigit;
using std::tolower;
using std::toupper;
 
# ifdef _CTYPE_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _CTYPE_NEED_C_LEGACY_
# endif /* _CTYPE_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_CTYPE_H_ */
/contrib/media/updf/include/c_shadow/errno.h
0,0 → 1,56
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_ERRNO_H_
# define _INCLUDED_CPP_ERRNO_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _ERRNO_NEED_C_LEGACY_
# endif
 
# include <cerrno>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
// using std::errno;
 
# ifdef _ERRNO_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _ERRNO_NEED_C_LEGACY_
# endif /* _ERRNO_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_ERRNO_H_ */
 
/contrib/media/updf/include/c_shadow/fcntl.h
0,0 → 1,63
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_FCNTL_H_
# define _INCLUDED_CPP_FCNTL_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _FCNTL_NEED_C_LEGACY_
# endif
 
# include <bits/wrap_fcntl.h>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using _C_legacy::flock;
 
using _C_legacy::creat;
using _C_legacy::open;
using _C_legacy::fcntl;
 
# ifdef _FCNTL_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _FCNTL_NEED_C_LEGACY_
# endif /* _FCNTL_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_FCNTL_H_ */
 
 
 
 
/contrib/media/updf/include/c_shadow/features.h
0,0 → 1,58
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_FEATURES_H_
# define _INCLUDED_CPP_FEATURES_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _FEATURES_NEED_C_LEGACY_
# endif
 
# include <bits/wrap_features.h>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
 
# ifdef _FEATURES_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _FEATURES_NEED_C_LEGACY_
# endif /* _FEATURES_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_FEATURES_H_ */
 
 
 
 
/contrib/media/updf/include/c_shadow/float.h
0,0 → 1,54
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_FLOAT_H_
# define _INCLUDED_CPP_FLOAT_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _FLOAT_NEED_C_LEGACY_
# endif
 
# include <cfloat>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
 
# ifdef _FLOAT_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _FLOAT_NEED_C_LEGACY_
# endif /* _FLOAT_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_FLOAT_H_ */
/contrib/media/updf/include/c_shadow/iconv.h
0,0 → 1,66
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_ICONV_H_
# define _INCLUDED_CPP_ICONV_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _ICONV_NEED_C_LEGACY_
# endif
 
# include <bits/wrap_iconv.h>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
 
// NB: Cannot use typedefs here to inject the names as the "C" headers
// often include typedefs that include the keyword 'struct'
using _C_legacy::iconv_t;
 
using _C_legacy::iconv_open;
using _C_legacy::iconv;
using _C_legacy::iconv_close;
 
# ifdef _ICONV_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _ICONV_NEED_C_LEGACY_
# endif /* _ICONV_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_ICONV_H_ */
 
 
 
 
/contrib/media/updf/include/c_shadow/iolibio.h
0,0 → 1,58
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_IOLIBIO_H_
# define _INCLUDED_CPP_IOLIBIO_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _IOLIBIO_NEED_C_LEGACY_
# endif
 
# include <bits/wrap_iolibio.h>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
 
# ifdef _IOLIBIO_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _IOLIBIO_NEED_C_LEGACY_
# endif /* _IOLIBIO_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_IOLIBIO_H_ */
 
 
 
 
/contrib/media/updf/include/c_shadow/langinfo.h
0,0 → 1,55
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_LANGINFO_H_
# define _INCLUDED_CPP_LANGINFO_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _LANGINFO_NEED_C_LEGACY_
# endif
 
# include <bits/wrap_langinfo.h>
 
# ifdef _LANGINFO_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _LANGINFO_NEED_C_LEGACY_
# endif /* _LANGINFO_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_LANGINFO_H_ */
 
 
 
 
/contrib/media/updf/include/c_shadow/libio.h
0,0 → 1,81
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_LIBIO_H_
# define _INCLUDED_CPP_LIBIO_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _LIBIO_NEED_C_LEGACY_
# endif
 
# include <bits/wrap_libio.h>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
 
// NB: Cannot use typedefs here to inject the names as the "C" headers
// often include typedefs that include the keyword 'struct'
using _C_legacy::_IO_pos_t;
using _C_legacy::_IO_fpos_t;
using _C_legacy::_IO_fpos64_t;
using _C_legacy::_IO_size_t;
using _C_legacy::_IO_ssize_t;
using _C_legacy::_IO_off_t;
using _C_legacy::_IO_off64_t;
using _C_legacy::_IO_pid_t;
using _C_legacy::_IO_uid_t;
using _C_legacy::_IO_iconv_t;
using _C_legacy::_IO_va_list;
using _C_legacy::_IO_wint_t;
using _C_legacy::_IO_lock_t;
 
using _C_legacy::_IO_marker;
using _C_legacy::_IO_codecvt;
using _C_legacy::_IO_wide_data;
using _C_legacy::_IO_FILE;
using _C_legacy::_IO_cookie_io_functions_t;
using _C_legacy::_IO_cookie_file;
 
# ifdef _LIBIO_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _LIBIO_NEED_C_LEGACY_
# endif /* _LIBIO_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_LIBIO_H_ */
 
 
 
 
/contrib/media/updf/include/c_shadow/libioP.h
0,0 → 1,64
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_LIBIOP_H_
# define _INCLUDED_CPP_LIBIOP_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _LIBIOP_NEED_C_LEGACY_
# endif
 
# include <bits/wrap_libioP.h>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using _C_legacy::_IO_jump_t;
using _C_legacy::_IO_FILE_plus;
using _C_legacy::_IO_cookie_file;
 
using _C_legacy::_IO_file_jumps;
using _C_legacy::_IO_wfile_jumps;
 
# ifdef _LIBIOP_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _LIBIOP_NEED_C_LEGACY_
# endif /* _LIBIOP_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_LIBIOP_H_ */
 
 
 
 
/contrib/media/updf/include/c_shadow/limits.h
0,0 → 1,54
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_LIMITS_H_
# define _INCLUDED_CPP_LIMITS_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _LIMITS_NEED_C_LEGACY_
# endif
 
# include <climits>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
 
# ifdef _LIMITS_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _LIMITS_NEED_C_LEGACY_
# endif /* _LIMITS_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_LIMITS_H_ */
/contrib/media/updf/include/c_shadow/locale.h
0,0 → 1,57
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_LOCALE_H_
# define _INCLUDED_CPP_LOCALE_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _LOCALE_NEED_C_LEGACY_
#endif
 
# include <clocale>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::lconv;
using std::setlocale;
using std::localeconv;
 
# ifdef _LOCALE_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _LOCALE_NEED_C_LEGACY_
# endif /* _LOCALE_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_LOCALE_H_ */
/contrib/media/updf/include/c_shadow/math.h
0,0 → 1,131
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_MATH_H_
# define _INCLUDED_CPP_MATH_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _MATH_NEED_C_LEGACY_
# endif
 
# include <cmath>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::abs;
using std::acos;
using std::asin;
using std::atan;
using std::atan2;
using std::cos;
using std::sin;
using std::tan;
using std::cosh;
using std::sinh;
using std::tanh;
using std::exp;
using std::frexp;
using std::ldexp;
using std::log;
using std::log10;
using std::modf;
using std::pow;
using std::sqrt;
using std::ceil;
using std::fabs;
using std::floor;
using std::fmod;
 
// From ISO/IEC 9899:1999
using std::absf;
using std::acosf;
using std::asinf;
using std::atanf;
using std::atan2f;
using std::cosf;
using std::sinf;
using std::tanf;
using std::coshf;
using std::sinhf;
using std::tanhf;
using std::expf;
using std::frexpf;
using std::ldexpf;
using std::logf;
using std::log10f;
using std::modff;
using std::powf;
using std::sqrtf;
using std::ceilf;
using std::fabsf;
using std::floorf;
using std::fmodf;
 
// From ISO/IEC 9899:1999
using std::absl;
using std::acosl;
using std::asinl;
using std::atanl;
using std::atan2l;
using std::cosl;
using std::sinl;
using std::tanl;
using std::coshl;
using std::sinhl;
using std::tanhl;
using std::expl;
using std::frexpl;
using std::ldexpl;
using std::logl;
using std::log10l;
using std::modfl;
using std::powl;
using std::sqrtl;
using std::ceill;
using std::fabsl;
using std::floorl;
using std::fmodl;
 
# ifdef _MATH_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _MATH_NEED_C_LEGACY_
# endif /* _MATH_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_MATH_H_ */
 
 
 
 
/contrib/media/updf/include/c_shadow/pthread.h
0,0 → 1,86
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_PTHREAD_H_
# define _INCLUDED_CPP_PTHREAD_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _PTHREAD_NEED_C_LEGACY_
# endif
 
# include <bits/wrap_pthread.h>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using _C_legacy::__sched_param;
 
using _C_legacy::pthread_attr_t;
using _C_legacy::pthread_cond_t;
using _C_legacy::pthread_condattr_t;
using _C_legacy::pthread_key_t;
using _C_legacy::pthread_mutex_t;
using _C_legacy::pthread_mutexattr_t;
using _C_legacy::pthread_once_t;
using _C_legacy::pthread_rwlock_t;
using _C_legacy::pthread_rwlockattr_t;
using _C_legacy::pthread_t;
 
using _C_legacy::pthread_mutex_init;
using _C_legacy::pthread_mutex_destroy;
using _C_legacy::pthread_mutex_lock;
using _C_legacy::pthread_mutex_trylock;
using _C_legacy::pthread_mutex_unlock;
using _C_legacy::pthread_mutexattr_init;
using _C_legacy::pthread_mutexattr_destroy;
using _C_legacy::pthread_mutexattr_settype;
using _C_legacy::pthread_mutexattr_gettype;
using _C_legacy::pthread_key_create;
using _C_legacy::pthread_key_delete;
using _C_legacy::pthread_setspecific;
using _C_legacy::pthread_getspecific;
using _C_legacy::pthread_once;
using _C_legacy::pthread_atfork;
 
# ifdef _PTHREAD_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _PTHREAD_NEED_C_LEGACY_
# endif /* _PTHREAD_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_PTHREAD_H_ */
 
 
 
 
/contrib/media/updf/include/c_shadow/setjmp.h
0,0 → 1,56
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_SETJMP_H_
# define _INCLUDED_CPP_SETJMP_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _SETJMP_NEED_C_LEGACY_
# endif
 
# include <csetjmp>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::jmp_buf;
using std::longjmp;
 
# ifdef _SETJMP_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _SETJMP_NEED_C_LEGACY_
# endif /* _SETJMP_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_SETJMP_H_ */
/contrib/media/updf/include/c_shadow/signal.h
0,0 → 1,58
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_SIGNAL_H_
# define _INCLUDED_CPP_SIGNAL_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _SIGNAL_NEED_C_LEGACY_
# endif
 
# include <csignal>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::sig_atomic_t;
 
using std::raise;
using std::signal;
 
# ifdef _SIGNAL_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _SIGNAL_NEED_C_LEGACY_
# endif /* _SIGNAL_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_SIGNAL_H_ */
/contrib/media/updf/include/c_shadow/stdarg.h
0,0 → 1,55
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_STDARG_H_
# define _INCLUDED_CPP_STDARG_H_ 1
 
#ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _STDARG_NEED_C_LEGACY_
# endif
 
# include <cstdarg>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::va_list;
 
# ifdef _STDARG_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _STDARG_NEED_C_LEGACY_
# endif /* _STDARG_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_STDARG_H_ */
/contrib/media/updf/include/c_shadow/stddef.h
0,0 → 1,60
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_STDDEF_H_
# define _INCLUDED_CPP_STDDEF_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _STDDEF_NEED_C_LEGACY_
# endif
 
# include <cstddef>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::ptrdiff_t;
using std::size_t;
 
# ifdef _STDDEF_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _STDDEF_NEED_C_LEGACY_
# endif /* _STDDEF_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_STDDEF_H_ */
 
 
 
 
/contrib/media/updf/include/c_shadow/stdio.h
0,0 → 1,97
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _INCLUDED_CPP_STDIO_H_
# define _INCLUDED_CPP_STDIO_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _STDIO_NEED_C_LEGACY_
# endif
 
# include <cstdio>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::FILE;
using std::fpos_t;
 
using std::remove;
using std::rename;
using std::tmpfile;
using std::tmpnam;
using std::fclose;
using std::fflush;
using std::fopen;
using std::freopen;
using std::setbuf;
using std::setvbuf;
using std::fprintf;
using std::fscanf;
using std::printf;
using std::scanf;
using std::sprintf;
using std::sscanf;
using std::vfprintf;
using std::vprintf;
using std::vsprintf;
using std::fgetc;
using std::fgets;
using std::fputc;
using std::fputs;
using std::getc;
using std::getchar;
using std::gets;
using std::putc;
using std::putchar;
using std::puts;
using std::ungetc;
using std::fread;
using std::fwrite;
using std::fgetpos;
using std::fseek;
using std::fsetpos;
using std::ftell;
using std::rewind;
using std::clearerr;
using std::feof;
using std::ferror;
using std::perror;
 
# ifdef _STDIO_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _STDIO_NEED_C_LEGACY_
# endif /* _STDIO_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_STDIO_H_ */
/contrib/media/updf/include/c_shadow/stdlib.h
0,0 → 1,101
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_STDLIB_H_
# define _INCLUDED_CPP_STDLIB_H_ 1
 
# include <bits/c++config.h>
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _STDLIB_NEED_C_LEGACY_
# endif
 
# include <cstdlib>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::div_t;
using std::ldiv_t;
#ifdef _GLIBCPP_USE_LONG_LONG
using std::lldiv_t;
#endif
 
// using std::abort;
using std::abs;
using std::atexit;
using std::atof;
using std::atoi;
using std::atol;
using std::bsearch;
using std::calloc;
using std::div;
// using std::exit;
using std::free;
using std::getenv;
using std::labs;
using std::ldiv;
using std::malloc;
using std::mblen;
using std::mbstowcs;
using std::mbtowc;
using std::qsort;
using std::rand;
using std::realloc;
using std::srand;
using std::strtod;
using std::strtol;
using std::strtoul;
using std::system;
using std::wcstombs;
using std::wctomb;
 
using std::strtof;
 
#ifdef _GLIBCPP_USE_LONG_LONG
using std::strtoll;
using std::strtoull;
#endif
 
#ifdef _GLIBCPP_HAVE_STRTOLD
using std::strtold;
#endif
 
# ifdef _STDLIB_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _STDLIB_NEED_C_LEGACY_
# endif /* _STDLIB_NEED_C__LEGACY_ */
#endif /* _INCLUDED_CPP_STDLIB_H_ */
/contrib/media/updf/include/c_shadow/string.h
0,0 → 1,76
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_STRING_H_
# define _INCLUDED_CPP_STRING_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _STRING_NEED_C_LEGACY_
# endif
 
# include <cstring>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::memcpy;
using std::memmove;
using std::strcpy;
using std::strncpy;
using std::strcat;
using std::strncat;
using std::memcmp;
using std::strcmp;
using std::strcoll;
using std::strncmp;
using std::strxfrm;
using std::memchr;
using std::strchr;
using std::strcspn;
using std::strpbrk;
using std::strrchr;
using std::strspn;
using std::strstr;
using std::strtok;
using std::memset;
using std::strerror;
using std::strlen;
 
# ifdef _STRING_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _STRING_NEED_C_LEGACY_
# endif /* _STRING_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_STRING_H_ */
/contrib/media/updf/include/c_shadow/sys/cdefs.h
0,0 → 1,49
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _CPP_SYS_CDEFS_H
# define _CPP_SYS_CDEFS_H 1
 
# pragma GCC system_header
# include_next <sys/cdefs.h>
 
// glibc-2 hackery. Other systems likely require other hacks.
#undef __BEGIN_DECLS
#define __BEGIN_DECLS
#undef __END_DECLS
#define __END_DECLS
 
#endif /* _CPP_SYS_CDEFS_H_ */
 
 
 
 
 
 
/contrib/media/updf/include/c_shadow/time.h
0,0 → 1,67
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_TIME_H_
# define _INCLUDED_CPP_TIME_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _TIME_NEED_C_LEGACY_
# endif
 
# include <ctime>
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::clock_t;
using std::time_t;
using std::tm;
 
using std::clock;
using std::difftime;
using std::mktime;
using std::time;
using std::asctime;
using std::ctime;
using std::gmtime;
using std::localtime;
using std::strftime;
 
# ifdef _TIME_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _TIME_NEED_C_LEGACY_
# endif /* _TIME_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_TIME_H_ */
/contrib/media/updf/include/c_shadow/unistd.h
0,0 → 1,101
// -*- C++ -*- header wrapper.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_UNISTD_H_
# define _INCLUDED_CPP_UNISTD_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _TIME_NEED_C_LEGACY_
# endif
 
# include <bits/wrap_unistd.h>
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
#ifdef __gid_t_defined
using _C_legacy::gid_t;
#endif
#ifdef __uid_t_defined
using _C_legacy::uid_t;
#endif
#ifdef __off_t_defined
using _C_legacy::off_t;
#endif
#ifdef __off64_t_defined
using _C_legacy::off64_t;
#endif
#ifdef __useconds_t_defined
using _C_legacy::useconds_t;
#endif
#ifdef __pid_t_defined
using _C_legacy::pid_t;
#endif
using _C_legacy::intptr_t;
#ifdef __socklen_t_defined
using _C_legacy::socklen_t;
#endif
 
using _C_legacy::access;
using _C_legacy::euidaccess;
using _C_legacy::lseek;
using _C_legacy::close;
using _C_legacy::read;
using _C_legacy::write;
using _C_legacy::pread;
using _C_legacy::pwrite;
using _C_legacy::pipe;
using _C_legacy::alarm;
using _C_legacy::sleep;
using _C_legacy::ualarm;
using _C_legacy::usleep;
using _C_legacy::pause;
using _C_legacy::chown;
using _C_legacy::fchown;
using _C_legacy::lchown;
using _C_legacy::chdir;
using _C_legacy::fchdir;
using _C_legacy::getcwd;
using _C_legacy::get_current_dir_name;
using _C_legacy::getwd;
using _C_legacy::dup;
using _C_legacy::dup2;
 
# ifdef _TIME_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _TIME_NEED_C_LEGACY_
# endif /* _TIME_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_UNISTD_H_ */
/contrib/media/updf/include/c_shadow/wchar.h
0,0 → 1,131
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_WCHAR_H_
# define _INCLUDED_CPP_WCHAR_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_ /* sub-included by a C header */
# define _WCHAR_NEED_C_LEGACY_
# endif
 
# include <cwchar>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::wchar_t;
using std::wint_t;
using std::mbstate_t;
 
#if 0
using std::fwprintf;
using std::fwscanf;
using std::swprintf;
using std::swscanf;
using std::vfwprintf;
using std::vfwscanf;
using std::vswprintf;
using std::vswscanf;
using std::vwprintf;
using std::vwscanf;
using std::wprintf;
using std::wscanf;
using std::fgetwc;
using std::fgetws;
using std::fputwc;
using std::fputws;
using std::fwide;
using std::getwc;
using std::getwchar;
using std::putwc;
using std::putwchar;
using std::ungetwc;
#endif
 
using std::wcstod;
using std::wcstof;
using std::wcstold;
using std::wcstol;
using std::wcstoll;
using std::wcstoul;
using std::wcstoull;
using std::wcscpy;
using std::wcsncpy;
using std::wcscat;
using std::wcsncat;
 
#if 0
using std::wcsmp;
#endif
 
using std::wcscoll;
using std::wcsncmp;
using std::wcsxfrm;
using std::wcschr;
using std::wcscspn;
using std::wcslen;
using std::wcspbrk;
using std::wcsrchr;
using std::wcsspn;
using std::wcsstr;
using std::wcstok;
using std::wmemchr;
using std::wmemcmp;
using std::wmemcpy;
using std::wmemmove;
using std::wmemset;
 
#if 0
using std::wcsftime;
#endif
 
using std::btowc;
using std::wctob;
using std::mbsinit;
using std::mbrlen;
using std::mbrtowc;
using std::wcrtomb;
using std::mbsrtowcs;
using std::wcsrtombs;
 
# ifdef _WCHAR_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _WCHAR_NEED_C_LEGACY_
# endif /* _WCHAR_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_WCHAR_H_ */
 
 
 
/contrib/media/updf/include/c_shadow/wctype.h
0,0 → 1,74
// -*- C++ -*- header wrapper.
 
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
 
#ifndef _INCLUDED_CPP_CWCTYPE_H_
# define _INCLUDED_CPP_CWCTYPE_H_ 1
 
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy"
} // close extern "C"
} // close namespace _C_legacy::
# undef _IN_C_LEGACY_
# define _CWCHAR_NEED_C_LEGACY_
# endif
 
# include <cwctype>
 
// Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version.
using std::wint_t;
using std::wctype_t;
using std::wctrans_t;
using std::iswalpha;
using std::iswupper;
using std::iswlower;
using std::iswdigit;
using std::iswxdigit;
using std::iswalnum;
using std::iswspace;
using std::iswpunct;
using std::iswprint;
using std::iswgraph;
using std::iswcntrl;
using std::iswctype;
using std::towctrans;
using std::towlower;
using std::towupper;
using std::wctrans;
using std::wctype;
 
# ifdef _CWCHAR_NEED_C_LEGACY_
// dive back into the "swamp"
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# undef _CWCHAR_NEED_C_LEGACY_
# endif /* _CWCHAR_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_CWCTYPE_H_ */
/contrib/media/updf/include/c_std/bits/cmath.tcc
0,0 → 1,54
// -*- C++ -*- C math library.
 
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// This file was written by Gabriel Dos Reis <gdr@codesourcery.com>
 
#ifndef _CPP_BITS_CMATH_TCC
#define _CPP_BITS_CMATH_TCC 1
 
namespace std
{
export template<typename _Tp>
_Tp
__cmath_power(_Tp __x, unsigned int __n)
{
_Tp __y = __n % 2 ? __x : 1;
 
while (__n >>= 1)
{
__x = __x * __x;
if (__n % 2)
__y = __y * __x;
}
 
return __y;
}
}
 
#endif
/contrib/media/updf/include/c_std/bits/std_cassert.h
0,0 → 1,47
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 19.2 Assertions
//
 
// No include guards on this header...
 
#pragma GCC system_header
#include_next <assert.h>
 
 
 
 
 
 
 
 
 
 
/contrib/media/updf/include/c_std/bits/std_cctype.h
0,0 → 1,72
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: <ccytpe>
//
 
#ifndef _CPP_CCTYPE
#define _CPP_CCTYPE 1
 
#pragma GCC system_header
#include_next <ctype.h>
 
// Get rid of those macros defined in <ctype.h> in lieu of real functions.
#undef isalnum
#undef isalpha
#undef iscntrl
#undef isdigit
#undef isgraph
#undef islower
#undef isprint
#undef ispunct
#undef isspace
#undef isupper
#undef isxdigit
#undef tolower
#undef toupper
 
namespace std
{
using ::isalnum;
using ::isalpha;
using ::iscntrl;
using ::isdigit;
using ::isgraph;
using ::islower;
using ::isprint;
using ::ispunct;
using ::isspace;
using ::isupper;
using ::isxdigit;
using ::tolower;
using ::toupper;
}
 
#endif
/contrib/media/updf/include/c_std/bits/std_cerrno.h
0,0 → 1,45
// The -*- C++ -*- error number header.
 
// Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 19.3 Error numbers
//
 
#ifndef _CPP_CERRNO
#define _CPP_CERRNO 1
 
#pragma GCC system_header
#include_next <errno.h>
 
// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
#ifndef errno
#define errno errno
#endif
 
#endif
/contrib/media/updf/include/c_std/bits/std_cfloat.h
0,0 → 1,40
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
 
#ifndef _CPP_CFLOAT
#define _CPP_CFLOAT 1
 
#pragma GCC system_header
#include_next <float.h>
 
#endif
/contrib/media/updf/include/c_std/bits/std_climits.h
0,0 → 1,40
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
 
#ifndef _CPP_CLIMITS
#define _CPP_CLIMITS 1
 
#pragma GCC system_header
#include_next <limits.h>
 
#endif
/contrib/media/updf/include/c_std/bits/std_clocale.h
0,0 → 1,51
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
 
#ifndef _CPP_CLOCALE
#define _CPP_CLOCALE 1
 
#pragma GCC system_header
#include_next <locale.h>
 
// Get rid of those macros defined in <locale.h> in lieu of real functions.
#undef setlocale
#undef localeconv
 
namespace std
{
using ::lconv;
using ::setlocale;
using ::localeconv;
}
 
#endif
/contrib/media/updf/include/c_std/bits/std_cmath.h
0,0 → 1,656
// -*- C++ -*- C math library.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 26.5 C library
//
 
#ifndef _CPP_CMATH
#define _CPP_CMATH 1
 
#include <bits/c++config.h>
 
#pragma GCC system_header
#include_next <math.h>
 
// Get rid of those macros defined in <math.h> in lieu of real functions.
#undef abs
#undef div
#undef acos
#undef asin
#undef atan
#undef atan2
#undef ceil
#undef cos
#undef cosh
#undef exp
#undef fabs
#undef floor
#undef fmod
#undef frexp
#undef ldexp
#undef log
#undef log10
#undef modf
#undef pow
#undef sin
#undef sinh
#undef sqrt
#undef tan
#undef tanh
 
namespace std
{
// Forward declaration of a helper function. This really should be
// an `exported' forward declaration.
template<typename _Tp> _Tp __cmath_power(_Tp, unsigned int);
 
template<typename _Tp>
inline _Tp
__cmath_abs(_Tp __x)
{
return __x < _Tp() ? -__x : __x;
}
 
inline float
abs(float __x)
{ return __builtin_fabsf(__x); }
 
inline double
abs(double __x)
{ return __builtin_fabs(__x); }
 
inline long double
abs(long double __x)
{ return __builtin_fabsl(__x); }
 
#if _GLIBCPP_HAVE_ACOSF
inline float
acos(float __x) { return ::acosf(__x); }
#else
inline float
acos(float __x) { return ::acos(static_cast<double>(__x)); }
#endif
 
using ::acos;
#if _GLIBCPP_HAVE_ACOSL
inline long double
acos(long double __x) { return ::acosl(__x); }
#else
inline long double
acos(long double __x) { return ::acos(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_ASINF
inline float
asin(float __x) { return ::asinf(__x); }
#else
inline float
asin(float __x) { return ::asin(static_cast<double>(__x)); }
#endif
 
using ::asin;
 
#if _GLIBCPP_HAVE_ASINL
inline long double
asin(long double __x) { return ::asinl(__x); }
#else
inline long double
asin(long double __x) { return ::asin(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_ATANF
inline float
atan(float __x) { return ::atanf(__x); }
#else
inline float
atan(float __x) { return ::atan(static_cast<double>(__x)); }
#endif
 
using ::atan;
 
#if _GLIBCPP_HAVE_ATANL
inline long double
atan(long double __x) { return ::atanl(__x); }
#else
inline long double
atan(long double __x) { return ::atan(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_ATAN2F
inline float
atan2(float __y, float __x) { return ::atan2f(__y, __x); }
#else
inline float
atan2(float __y, float __x)
{ return ::atan2(static_cast<double>(__y), static_cast<double>(__x)); }
#endif
 
using ::atan2;
 
#if _GLIBCPP_HAVE_ATAN2L
inline long double
atan2(long double __y, long double __x) { return ::atan2l(__y, __x); }
#else
inline long double
atan2(long double __y, long double __x)
{ return ::atan2(static_cast<double>(__y), static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_CEILF
inline float
ceil(float __x) { return ::ceilf(__x); }
#else
inline float
ceil(float __x) { return ::ceil(static_cast<double>(__x)); }
#endif
 
using ::ceil;
 
#if _GLIBCPP_HAVE_CEILL
inline long double
ceil(long double __x) { return ::ceill(__x); }
#else
inline long double
ceil(long double __x) { return ::ceil(static_cast<double>(__x)); }
#endif
 
inline float
cos(float __x)
{ return __builtin_cosf(__x); }
 
using ::cos;
 
inline long double
cos(long double __x)
{ return __builtin_cosl(__x); }
 
#if _GLIBCPP_HAVE_COSHF
inline float
cosh(float __x) { return ::coshf(__x); }
#else
inline float
cosh(float __x) { return ::cosh(static_cast<double>(__x)); }
#endif
 
using ::cosh;
 
#if _GLIBCPP_HAVE_COSHL
inline long double
cosh(long double __x) { return ::coshl(__x); }
#else
inline long double
cosh(long double __x) { return ::cosh(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_EXPF
inline float
exp(float __x) { return ::expf(__x); }
#else
inline float
exp(float __x) { return ::exp(static_cast<double>(__x)); }
#endif
 
using ::exp;
 
#if _GLIBCPP_HAVE_EXPL
inline long double
exp(long double __x) { return ::expl(__x); }
#else
inline long double
exp(long double __x) { return ::exp(static_cast<double>(__x)); }
#endif
 
inline float
fabs(float __x)
{ return __builtin_fabsf(__x); }
 
using ::fabs;
 
inline long double
fabs(long double __x)
{ return __builtin_fabsl(__x); }
 
#if _GLIBCPP_HAVE_FLOORF
inline float
floor(float __x) { return ::floorf(__x); }
#else
inline float
floor(float __x) { return ::floor(static_cast<double>(__x)); }
#endif
 
using ::floor;
 
#if _GLIBCPP_HAVE_FLOORL
inline long double
floor(long double __x) { return ::floorl(__x); }
#else
inline long double
floor(long double __x) { return ::floor(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_FMODF
inline float
fmod(float __x, float __y) { return ::fmodf(__x, __y); }
#else
inline float
fmod(float __x, float __y)
{ return ::fmod(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
 
using ::fmod;
 
#if _GLIBCPP_HAVE_FMODL
inline long double
fmod(long double __x, long double __y) { return ::fmodl(__x, __y); }
#else
inline long double
fmod(long double __x, long double __y)
{ return ::fmod(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
 
#if _GLIBCPP_HAVE_FREXPF
inline float
frexp(float __x, int* __exp) { return ::frexpf(__x, __exp); }
#else
inline float
frexp(float __x, int* __exp) { return ::frexp(__x, __exp); }
#endif
 
using ::frexp;
 
#if _GLIBCPP_HAVE_FREXPL
inline long double
frexp(long double __x, int* __exp) { return ::frexpl(__x, __exp); }
#else
inline long double
frexp(long double __x, int* __exp)
{ return ::frexp(static_cast<double>(__x), __exp); }
#endif
 
#if _GLIBCPP_HAVE_LDEXPF
inline float
ldexp(float __x, int __exp) { return ::ldexpf(__x, __exp); }
#else
inline float
ldexp(float __x, int __exp)
{ return ::ldexp(static_cast<double>(__x), __exp); }
#endif
 
using ::ldexp;
 
#if _GLIBCPP_HAVE_LDEXPL
inline long double
ldexp(long double __x, int __exp) { return ::ldexpl(__x, __exp); }
#else
inline long double
ldexp(long double __x, int __exp)
{ return ::ldexp(static_cast<double>(__x), __exp); }
#endif
 
#if _GLIBCPP_HAVE_LOGF
inline float
log(float __x) { return ::logf(__x); }
#else
inline float log(float __x)
{ return ::log(static_cast<double>(__x)); }
#endif
 
using ::log;
 
#if _GLIBCPP_HAVE_LOGL
inline long double
log(long double __x) { return ::logl(__x); }
#else
inline long double
log(long double __x) { return ::log(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_LOG10F
inline float
log10(float __x) { return ::log10f(__x); }
#else
inline float
log10(float __x) { return ::log10(static_cast<double>(__x)); }
#endif
 
using ::log10;
 
#if _GLIBCPP_HAVE_LOG10L
inline long double
log10(long double __x) { return ::log10l(__x); }
#else
inline long double
log10(long double __x) { return ::log10(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_MODFF
inline float
modf(float __x, float* __iptr) { return ::modff(__x, __iptr); }
#else
inline float
modf(float __x, float* __iptr)
{
double __tmp;
double __res = ::modf(static_cast<double>(__x), &__tmp);
*__iptr = static_cast<float>(__tmp);
return __res;
}
#endif
 
using ::modf;
 
#if _GLIBCPP_HAVE_MODFL
inline long double
modf(long double __x, long double* __iptr) { return ::modfl(__x, __iptr); }
#else
inline long double
modf(long double __x, long double* __iptr)
{
double __tmp;
double __res = ::modf(static_cast<double>(__x), &__tmp);
* __iptr = static_cast<long double>(__tmp);
return __res;
}
#endif
 
template<typename _Tp>
inline _Tp
__pow_helper(_Tp __x, int __n)
{
return __n < 0
? _Tp(1)/__cmath_power(__x, -__n)
: __cmath_power(__x, __n);
}
#if _GLIBCPP_HAVE_POWF
inline float
pow(float __x, float __y) { return ::powf(__x, __y); }
#else
inline float
pow(float __x, float __y)
{ return ::pow(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
 
using ::pow;
 
#if _GLIBCPP_HAVE_POWL
inline long double
pow(long double __x, long double __y) { return ::powl(__x, __y); }
#else
inline long double
pow(long double __x, long double __y)
{ return ::pow(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
 
inline float
pow(float __x, int __n)
{ return __pow_helper(__x, __n); }
 
inline double
pow(double __x, int __i)
{ return __pow_helper(__x, __i); }
 
inline long double
pow(long double __x, int __n)
{ return __pow_helper(__x, __n); }
 
inline float
sin(float __x)
{ return __builtin_sinf(__x); }
 
using ::sin;
 
inline long double
sin(long double __x)
{ return __builtin_sinl(__x); }
 
#if _GLIBCPP_HAVE_SINHF
inline float
sinh(float __x) { return ::sinhf(__x); }
#else
inline float
sinh(float __x) { return ::sinh(static_cast<double>(__x)); }
#endif
 
using ::sinh;
 
#if _GLIBCPP_HAVE_SINHL
inline long double
sinh(long double __x) { return ::sinhl(__x); }
#else
inline long double
sinh(long double __x) { return ::sinh(static_cast<double>(__x)); }
#endif
 
inline float
sqrt(float __x)
{ return __builtin_sqrtf(__x); }
 
using ::sqrt;
 
inline long double
sqrt(long double __x)
{ return __builtin_sqrtl(__x); }
 
#if _GLIBCPP_HAVE_TANF
inline float
tan(float __x) { return ::tanf(__x); }
#else
inline float
tan(float __x) { return ::tan(static_cast<double>(__x)); }
#endif
 
using ::tan;
 
#if _GLIBCPP_HAVE_TANL
inline long double
tan(long double __x) { return ::tanl(__x); }
#else
inline long double
tan(long double __x) { return ::tan(static_cast<double>(__x)); }
#endif
 
#if _GLIBCPP_HAVE_TANHF
inline float
tanh(float __x) { return ::tanhf(__x); }
#else
inline float
tanh(float __x) { return ::tanh(static_cast<double>(__x)); }
#endif
 
using ::tanh;
 
#if _GLIBCPP_HAVE_TANHL
inline long double
tanh(long double __x) { return ::tanhl(__x); }
#else
inline long double
tanh(long double __x) { return ::tanh(static_cast<double>(__x)); }
#endif
}
 
 
#if _GLIBCPP_USE_C99
// These are possible macros imported from C99-land. For strict
// conformance, remove possible C99-injected names from the global
// namespace, and sequester them in the __gnu_cxx extension namespace.
namespace __gnu_cxx
{
template<typename _Tp>
int
__capture_fpclassify(_Tp __f) { return fpclassify(__f); }
 
template<typename _Tp>
int
__capture_isfinite(_Tp __f) { return isfinite(__f); }
 
template<typename _Tp>
int
__capture_isinf(_Tp __f) { return isinf(__f); }
 
template<typename _Tp>
int
__capture_isnan(_Tp __f) { return isnan(__f); }
 
template<typename _Tp>
int
__capture_isnormal(_Tp __f) { return isnormal(__f); }
 
template<typename _Tp>
int
__capture_signbit(_Tp __f) { return signbit(__f); }
 
template<typename _Tp>
int
__capture_isgreater(_Tp __f1, _Tp __f2)
{ return isgreater(__f1, __f2); }
 
template<typename _Tp>
int
__capture_isgreaterequal(_Tp __f1, _Tp __f2)
{ return isgreaterequal(__f1, __f2); }
 
template<typename _Tp>
int
__capture_isless(_Tp __f1, _Tp __f2) { return isless(__f1, __f2); }
 
template<typename _Tp>
int
__capture_islessequal(_Tp __f1, _Tp __f2)
{ return islessequal(__f1, __f2); }
 
template<typename _Tp>
int
__capture_islessgreater(_Tp __f1, _Tp __f2)
{ return islessgreater(__f1, __f2); }
 
template<typename _Tp>
int
__capture_isunordered(_Tp __f1, _Tp __f2)
{ return isunordered(__f1, __f2); }
}
#endif
 
#undef fpclassify
#undef isfinite
#undef isinf
#undef isnan
#undef isnormal
#undef signbit
#undef isgreater
#undef isgreaterequal
#undef isless
#undef islessequal
#undef islessgreater
#undef isunordered
 
#if _GLIBCPP_USE_C99
namespace __gnu_cxx
{
template<typename _Tp>
int
fpclassify(_Tp __f) { return __capture_fpclassify(__f); }
 
template<typename _Tp>
int
isfinite(_Tp __f) { return __capture_isfinite(__f); }
 
template<typename _Tp>
int
isinf(_Tp __f) { return __capture_isinf(__f); }
 
template<typename _Tp>
int
isnan(_Tp __f) { return __capture_isnan(__f); }
 
template<typename _Tp>
int
isnormal(_Tp __f) { return __capture_isnormal(__f); }
 
template<typename _Tp>
int
signbit(_Tp __f) { return __capture_signbit(__f); }
 
template<typename _Tp>
int
isgreater(_Tp __f1, _Tp __f2) { return __capture_isgreater(__f1, __f2); }
 
template<typename _Tp>
int
isgreaterequal(_Tp __f1, _Tp __f2)
{ return __capture_isgreaterequal(__f1, __f2); }
 
template<typename _Tp>
int
isless(_Tp __f1, _Tp __f2) { return __capture_isless(__f1, __f2); }
 
template<typename _Tp>
int
islessequal(_Tp __f1, _Tp __f2)
{ return __capture_islessequal(__f1, __f2); }
 
template<typename _Tp>
int
islessgreater(_Tp __f1, _Tp __f2)
{ return __capture_islessgreater(__f1, __f2); }
 
template<typename _Tp>
int
isunordered(_Tp __f1, _Tp __f2)
{ return __capture_isunordered(__f1, __f2); }
}
 
namespace std
{
using __gnu_cxx::fpclassify;
using __gnu_cxx::isfinite;
using __gnu_cxx::isinf;
using __gnu_cxx::isnan;
using __gnu_cxx::isnormal;
using __gnu_cxx::signbit;
using __gnu_cxx::isgreater;
using __gnu_cxx::isgreaterequal;
using __gnu_cxx::isless;
using __gnu_cxx::islessequal;
using __gnu_cxx::islessgreater;
using __gnu_cxx::isunordered;
}
#endif
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
# include <bits/cmath.tcc>
#endif
 
#endif
 
 
 
/contrib/media/updf/include/c_std/bits/std_csetjmp.h
0,0 → 1,54
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
#ifndef _CPP_CSETJMP
#define _CPP_CSETJMP 1
 
#pragma GCC system_header
#include_next <setjmp.h>
 
// Get rid of those macros defined in <setjmp.h> in lieu of real functions.
#undef longjmp
 
// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
#ifndef setjmp
#define setjmp(env) setjmp (env)
#endif
 
namespace std
{
using ::jmp_buf;
using ::longjmp;
}
 
#endif
/contrib/media/updf/include/c_std/bits/std_csignal.h
0,0 → 1,50
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
#ifndef _CPP_CSIGNAL
#define _CPP_CSIGNAL 1
 
#pragma GCC system_header
#include_next <signal.h>
 
// Get rid of those macros defined in <signal.h> in lieu of real functions.
#undef raise
 
namespace std
{
using ::sig_atomic_t;
using ::signal;
using ::raise;
}
 
#endif
/contrib/media/updf/include/c_std/bits/std_cstdarg.h
0,0 → 1,50
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
#ifndef _CPP_CSTDARG
#define _CPP_CSTDARG 1
 
#pragma GCC system_header
#include_next <stdarg.h>
 
// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
#ifndef va_end
#define va_end(ap) va_end (ap)
#endif
 
namespace std
{
using ::va_list;
}
 
#endif
/contrib/media/updf/include/c_std/bits/std_cstddef.h
0,0 → 1,46
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 18.1 Types
//
 
#ifndef _CPP_CSTDDEF
#define _CPP_CSTDDEF 1
 
#pragma GCC system_header
#include_next <stddef.h>
 
namespace std
{
using ::ptrdiff_t;
using ::size_t;
}
 
#endif
/contrib/media/updf/include/c_std/bits/std_cstdio.h
0,0 → 1,161
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 27.8.2 C Library files
//
 
#ifndef _CPP_CSTDIO
#define _CPP_CSTDIO 1
 
#include <bits/c++config.h>
#include <bits/std_cstddef.h>
 
#pragma GCC system_header
#include_next <stdio.h>
 
// Get rid of those macros defined in <stdio.h> in lieu of real functions.
#undef clearerr
#undef fclose
#undef feof
#undef ferror
#undef fflush
#undef fgetc
#undef fgetpos
#undef fgets
#undef fopen
#undef fprintf
#undef fputc
#undef fputs
#undef fread
#undef freopen
#undef fscanf
#undef fseek
#undef fsetpos
#undef ftell
#undef fwrite
#undef getc
#undef getchar
#undef gets
#undef perror
#undef printf
#undef putc
#undef putchar
#undef puts
#undef remove
#undef rename
#undef rewind
#undef scanf
#undef setbuf
#undef setvbuf
#undef sprintf
#undef sscanf
#undef tmpfile
#undef tmpnam
#undef ungetc
#undef vfprintf
#undef vprintf
#undef vsprintf
 
namespace std
{
using ::FILE;
using ::fpos_t;
 
using ::clearerr;
using ::fclose;
using ::feof;
using ::ferror;
using ::fflush;
using ::fgetc;
using ::fgetpos;
using ::fgets;
using ::fopen;
using ::fprintf;
using ::fputc;
using ::fputs;
using ::fread;
using ::freopen;
using ::fscanf;
using ::fseek;
using ::fsetpos;
using ::ftell;
using ::fwrite;
using ::getc;
using ::getchar;
using ::gets;
using ::perror;
using ::printf;
using ::putc;
using ::putchar;
using ::puts;
using ::remove;
using ::rename;
using ::rewind;
using ::scanf;
using ::setbuf;
using ::setvbuf;
using ::sprintf;
using ::sscanf;
using ::tmpfile;
using ::tmpnam;
using ::ungetc;
using ::vfprintf;
using ::vprintf;
using ::vsprintf;
}
 
#if _GLIBCPP_USE_C99
 
#undef snprintf
#undef vfscanf
#undef vscanf
#undef vsnprintf
#undef vsscanf
 
namespace __gnu_cxx
{
using ::snprintf;
using ::vfscanf;
using ::vscanf;
using ::vsnprintf;
using ::vsscanf;
}
 
namespace std
{
using __gnu_cxx::snprintf;
using __gnu_cxx::vfscanf;
using __gnu_cxx::vscanf;
using __gnu_cxx::vsnprintf;
using __gnu_cxx::vsscanf;
}
#endif
 
#endif
/contrib/media/updf/include/c_std/bits/std_cstdlib.h
0,0 → 1,167
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
#ifndef _CPP_CSTDLIB
#define _CPP_CSTDLIB 1
 
#include <bits/c++config.h>
#include <bits/std_cstddef.h>
 
#pragma GCC system_header
#include_next <stdlib.h>
 
// Get rid of those macros defined in <stdlib.h> in lieu of real functions.
#undef abort
#undef abs
#undef atexit
#undef atof
#undef atoi
#undef atol
#undef bsearch
#undef calloc
#undef div
#undef exit
#undef free
#undef getenv
#undef labs
#undef ldiv
#undef malloc
#undef mblen
#undef mbstowcs
#undef mbtowc
#undef qsort
#undef rand
#undef realloc
#undef srand
#undef strtod
#undef strtol
#undef strtoul
#undef system
#undef wcstombs
#undef wctomb
 
namespace std
{
using ::div_t;
using ::ldiv_t;
 
using ::abort;
using ::abs;
using ::atexit;
using ::atof;
using ::atoi;
using ::atol;
using ::bsearch;
using ::calloc;
using ::div;
using ::exit;
using ::free;
using ::getenv;
using ::labs;
using ::ldiv;
using ::malloc;
using ::mblen;
using ::mbstowcs;
using ::mbtowc;
using ::qsort;
using ::rand;
using ::realloc;
using ::srand;
using ::strtod;
using ::strtol;
using ::strtoul;
using ::system;
using ::wcstombs;
using ::wctomb;
 
inline long
abs(long __i) { return labs(__i); }
 
inline ldiv_t
div(long __i, long __j) { return ldiv(__i, __j); }
}
 
#if _GLIBCPP_USE_C99
 
#undef _Exit
#undef llabs
#undef lldiv
#undef atoll
#undef strtoll
#undef strtoull
#undef strtof
#undef strtold
 
namespace __gnu_cxx
{
using ::lldiv_t;
using ::_Exit;
 
inline long long
abs(long long __x) { return __x >= 0 ? __x : -__x; }
 
inline long long
llabs(long long __x) { return __x >= 0 ? __x : -__x; }
 
inline lldiv_t
div(long long __n, long long __d)
{ lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
 
inline lldiv_t
lldiv(long long __n, long long __d)
{ lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
 
using ::atoll;
using ::strtof;
using ::strtoll;
using ::strtoull;
using ::strtold;
}
 
namespace std
{
using __gnu_cxx::lldiv_t;
using __gnu_cxx::_Exit;
using __gnu_cxx::abs;
using __gnu_cxx::llabs;
using __gnu_cxx::div;
using __gnu_cxx::lldiv;
using __gnu_cxx::atoll;
using __gnu_cxx::strtof;
using __gnu_cxx::strtoll;
using __gnu_cxx::strtoull;
using __gnu_cxx::strtold;
}
#endif
 
#endif
/contrib/media/updf/include/c_std/bits/std_cstring.h
0,0 → 1,117
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.4.6 C library
//
 
#ifndef _CPP_CSTRING
#define _CPP_CSTRING 1
 
#include <bits/std_cstddef.h>
 
#pragma GCC system_header
#include_next <string.h>
 
// Get rid of those macros defined in <string.h> in lieu of real functions.
#undef memcpy
#undef memmove
#undef strcpy
#undef strncpy
#undef strcat
#undef strncat
#undef memcmp
#undef strcmp
#undef strcoll
#undef strncmp
#undef strxfrm
#undef memchr
#undef strchr
#undef strcspn
#undef strpbrk
#undef strrchr
#undef strspn
#undef strstr
#undef strtok
#undef memset
#undef strerror
#undef strlen
 
namespace std
{
using ::memcpy;
using ::memmove;
using ::strcpy;
using ::strncpy;
using ::strcat;
using ::strncat;
using ::memcmp;
using ::strcmp;
using ::strcoll;
using ::strncmp;
using ::strxfrm;
using ::strcspn;
using ::strspn;
using ::strtok;
using ::memset;
using ::strerror;
using ::strlen;
 
using ::memchr;
 
inline void*
memchr(void* __p, int __c, size_t __n)
{ return memchr(const_cast<const void*>(__p), __c, __n); }
 
using ::strchr;
 
inline char*
strchr(char* __s1, int __n)
{ return __builtin_strchr(const_cast<const char*>(__s1), __n); }
 
using ::strpbrk;
 
inline char*
strpbrk(char* __s1, const char* __s2)
{ return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
 
using ::strrchr;
 
inline char*
strrchr(char* __s1, int __n)
{ return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
 
using ::strstr;
 
inline char*
strstr(char* __s1, const char* __s2)
{ return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
}
 
#endif
/contrib/media/updf/include/c_std/bits/std_ctime.h
0,0 → 1,70
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: 20.5 Date and time
//
 
#ifndef _CPP_CTIME
#define _CPP_CTIME 1
 
#include <bits/std_cstddef.h>
 
#pragma GCC system_header
#include_next <time.h>
 
// Get rid of those macros defined in <time.h> in lieu of real functions.
#undef clock
#undef difftime
#undef mktime
#undef time
#undef asctime
#undef ctime
#undef gmtime
#undef localtime
#undef strftime
 
namespace std
{
using ::clock_t;
using ::time_t;
using ::tm;
 
using ::clock;
using ::difftime;
using ::mktime;
using ::time;
using ::asctime;
using ::ctime;
using ::gmtime;
using ::localtime;
using ::strftime;
}
 
#endif
/contrib/media/updf/include/c_std/bits/std_cwchar.h
0,0 → 1,231
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: ???
//
 
#ifndef _CPP_CWCHAR
#define _CPP_CWCHAR 1
 
#include <bits/c++config.h>
#include <bits/std_cstddef.h>
 
#if _GLIBCPP_HAVE_WCHAR_H
#pragma GCC system_header
#include_next <wchar.h>
#endif
 
// Need to do a bit of trickery here with mbstate_t as char_traits
// assumes it is in wchar.h, regardless of wchar_t specializations.
#ifndef _GLIBCPP_HAVE_MBSTATE_T
extern "C"
{
typedef struct
{
int __fill[6];
} mbstate_t;
}
#endif
 
namespace std
{
using ::mbstate_t;
}
 
// Get rid of those macros defined in <wchar.h> in lieu of real functions.
#undef btowc
#undef fgetwc
#undef fgetws
#undef fputwc
#undef fputws
#undef fwide
#undef fwprintf
#undef fwscanf
#undef getwc
#undef getwchar
#undef mbrlen
#undef mbrtowc
#undef mbsinit
#undef mbsrtowcs
#undef putwc
#undef putwchar
#undef swprintf
#undef swscanf
#undef ungetwc
#undef vfwprintf
#undef vfwscanf
#undef vswprintf
#undef vswscanf
#undef vwprintf
#undef vwscanf
#undef wcrtomb
#undef wcscat
#undef wcschr
#undef wcscmp
#undef wcscoll
#undef wcscpy
#undef wcscspn
#undef wcsftime
#undef wcslen
#undef wcsncat
#undef wcsncmp
#undef wcsncpy
#undef wcspbrk
#undef wcsrchr
#undef wcsrtombs
#undef wcsspn
#undef wcsstr
#undef wcstod
#undef wcstof
#undef wcstok
#undef wcstol
#undef wcstoul
#undef wcsxfrm
#undef wctob
#undef wmemchr
#undef wmemcmp
#undef wmemcpy
#undef wmemmove
#undef wmemset
#undef wprintf
#undef wscanf
 
#if _GLIBCPP_USE_WCHAR_T
namespace std
{
using ::wint_t;
 
using ::btowc;
using ::fgetwc;
using ::fgetws;
using ::fputwc;
using ::fputws;
using ::fwide;
using ::fwprintf;
using ::fwscanf;
using ::getwc;
using ::getwchar;
using ::mbrlen;
using ::mbrtowc;
using ::mbsinit;
using ::mbsrtowcs;
using ::putwc;
using ::putwchar;
using ::swprintf;
using ::swscanf;
using ::ungetwc;
using ::vfwprintf;
using ::vfwscanf;
using ::vswprintf;
using ::vswscanf;
using ::vwprintf;
using ::vwscanf;
using ::wcrtomb;
using ::wcscat;
using ::wcscmp;
using ::wcscoll;
using ::wcscpy;
using ::wcscspn;
using ::wcsftime;
using ::wcslen;
using ::wcsncat;
using ::wcsncmp;
using ::wcsncpy;
using ::wcsrtombs;
using ::wcsspn;
using ::wcstod;
using ::wcstof;
using ::wcstok;
using ::wcstol;
using ::wcstoul;
using ::wcsxfrm;
using ::wctob;
using ::wmemcmp;
using ::wmemcpy;
using ::wmemmove;
using ::wmemset;
using ::wprintf;
using ::wscanf;
 
using ::wcschr;
 
inline wchar_t*
wcschr(wchar_t* __p, wchar_t __c)
{ return wcschr(const_cast<const wchar_t*>(__p), __c); }
 
using ::wcspbrk;
 
inline wchar_t*
wcspbrk(wchar_t* __s1, wchar_t* __s2)
{ return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
 
using ::wcsrchr;
 
inline wchar_t*
wcsrchr(wchar_t* __p, wchar_t __c)
{ return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
 
using ::wcsstr;
 
inline wchar_t*
wcsstr(wchar_t* __s1, wchar_t* __s2)
{ return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
 
using ::wmemchr;
 
inline wchar_t*
wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
{ return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
}
 
#if _GLIBCPP_USE_C99
 
#undef wcstold
#undef wcstoll
#undef wcstoull
 
namespace __gnu_cxx
{
using ::wcstold;
using ::wcstoll;
using ::wcstoull;
}
 
namespace std
{
using __gnu_cxx::wcstold;
using __gnu_cxx::wcstoll;
using __gnu_cxx::wcstoull;
}
#endif
 
#endif //_GLIBCPP_USE_WCHAR_T
 
#endif
/contrib/media/updf/include/c_std/bits/std_cwctype.h
0,0 → 1,87
// -*- C++ -*- forwarding header.
 
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
//
// ISO C++ 14882: <cwctype>
//
 
#ifndef _CPP_CWCTYPE
#define _CPP_CWCTYPE 1
 
#pragma GCC system_header
#include_next <wctype.h>
 
// Get rid of those macros defined in <wctype.h> in lieu of real functions.
#undef iswalnum
#undef iswalpha
#undef iswblank
#undef iswcntrl
#undef iswdigit
#undef iswgraph
#undef iswlower
#undef iswprint
#undef iswprint
#undef iswpunct
#undef iswspace
#undef iswupper
#undef iswxdigit
#undef iswctype
#undef towlower
#undef towupper
#undef towctrans
#undef wctrans
 
namespace std
{
using ::wint_t; // cwchar
 
using ::wctype_t;
using ::wctrans_t;
 
using ::iswalnum;
using ::iswalpha;
using ::iswblank;
using ::iswcntrl;
using ::iswdigit;
using ::iswgraph;
using ::iswlower;
using ::iswprint;
using ::iswprint;
using ::iswpunct;
using ::iswspace;
using ::iswupper;
using ::iswxdigit;
using ::iswctype;
using ::towlower;
using ::towupper;
using ::towctrans;
using ::wctrans;
}
 
#endif
/contrib/media/updf/include/cassert
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// This one should not have include guards.
#include <bits/std_cassert.h>
 
/contrib/media/updf/include/cctype
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CCTYPE
#include <bits/std_cctype.h>
#endif
/contrib/media/updf/include/cerrno
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CERRNO
#include <bits/std_cerrno.h>
#endif
/contrib/media/updf/include/cfloat
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CFLOAT
#include <bits/std_cfloat.h>
#endif
/contrib/media/updf/include/choices.h
0,0 → 1,28
/** \file choices.h switches that control debugging in source code.
* Uncomment the defines below to allow a specific type of compilation
*/
 
#ifndef __choices_h__
#define __choices_h__
 
/** Turn on YACAS_DEBUG if you want to see run-time statistics
* after typing Exit()
*/
//#define YACAS_DEBUG
 
/** Turn on USE_ASSERT to find programming errors through the asserts
* placed in various places of the application.
*/
//#define USE_ASSERT
 
/** Turn on NO_EXCEPTIONS if you want to disable run-time checking
* while executing commands.
*/
//#define NO_EXCEPTIONS
 
/** Enable long reference counts. This makes EVERY object 2 bytes
larger, so use only if needed.
*/
//#define USE_LONG_REF_COUNTS
 
#endif
/contrib/media/updf/include/cio.h
0,0 → 1,86
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __CIO_H
#define __CIO_H
/**
@file cio.h
@brief Implementation of a byte input-output process (CIO)
 
The functions in CIO.C have for goal to realize a byte input / output process.
*/
 
/** @defgroup CIO CIO - byte input-output stream */
/*@{*/
 
/** @name Exported functions (see also openjpeg.h) */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Number of bytes left before the end of the stream
@param cio CIO handle
@return Returns the number of bytes before the end of the stream
*/
int cio_numbytesleft(opj_cio_t *cio);
/**
Get pointer to the current position in the stream
@param cio CIO handle
@return Returns a pointer to the current position
*/
unsigned char *cio_getbp(opj_cio_t *cio);
/**
Write some bytes
@param cio CIO handle
@param v Value to write
@param n Number of bytes to write
@return Returns the number of bytes written or 0 if an error occured
*/
unsigned int cio_write(opj_cio_t *cio, unsigned int v, int n);
/**
Read some bytes
@param cio CIO handle
@param n Number of bytes to read
@return Returns the value of the n bytes read
*/
unsigned int cio_read(opj_cio_t *cio, int n);
/**
Skip some bytes
@param cio CIO handle
@param n Number of bytes to skip
*/
void cio_skip(opj_cio_t *cio, int n);
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __CIO_H */
 
/contrib/media/updf/include/ciso646
0,0 → 1,28
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/contrib/media/updf/include/climits
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CLIMITS
#include <bits/std_climits.h>
#endif
/contrib/media/updf/include/clocale
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CLOCALE
#include <bits/std_clocale.h>
#endif
/contrib/media/updf/include/cmath
--- coff.h (nonexistent)
+++ coff.h (revision 4680)
@@ -0,0 +1,339 @@
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+#ifndef __dj_include_coff_h_
+#define __dj_include_coff_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef __dj_ENFORCE_ANSI_FREESTANDING
+
+#ifndef __STRICT_ANSI__
+
+#ifndef _POSIX_SOURCE
+
+/*** coff information for Intel 386/486. */
+
+/********************** FILE HEADER **********************/
+
+struct external_filehdr {
+ unsigned short f_magic; /* magic number */
+ unsigned short f_nscns; /* number of sections */
+ unsigned long f_timdat; /* time & date stamp */
+ unsigned long f_symptr; /* file pointer to symtab */
+ unsigned long f_nsyms; /* number of symtab entries */
+ unsigned short f_opthdr; /* sizeof(optional hdr) */
+ unsigned short f_flags; /* flags */
+};
+
+
+/* Bits for f_flags:
+ * F_RELFLG relocation info stripped from file
+ * F_EXEC file is executable (no unresolved external references)
+ * F_LNNO line numbers stripped from file
+ * F_LSYMS local symbols stripped from file
+ * F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax)
+ */
+
+#define F_RELFLG (0x0001)
+#define F_EXEC (0x0002)
+#define F_LNNO (0x0004)
+#define F_LSYMS (0x0008)
+
+
+
+#define I386MAGIC 0x14c
+#define I386AIXMAGIC 0x175
+#define I386BADMAG(x) (((x).f_magic!=I386MAGIC) && (x).f_magic!=I386AIXMAGIC)
+
+
+#define FILHDR struct external_filehdr
+#define FILHSZ sizeof(FILHDR)
+
+
+/********************** AOUT "OPTIONAL HEADER" **********************/
+
+
+typedef struct
+{
+ unsigned short magic; /* type of file */
+ unsigned short vstamp; /* version stamp */
+ unsigned long tsize; /* text size in bytes, padded to FW bdry*/
+ unsigned long dsize; /* initialized data " " */
+ unsigned long bsize; /* uninitialized data " " */
+ unsigned long entry; /* entry pt. */
+ unsigned long text_start; /* base of text used for this file */
+ unsigned long data_start; /* base of data used for this file */
+}
+AOUTHDR;
+
+
+typedef struct gnu_aout {
+ unsigned long info;
+ unsigned long tsize;
+ unsigned long dsize;
+ unsigned long bsize;
+ unsigned long symsize;
+ unsigned long entry;
+ unsigned long txrel;
+ unsigned long dtrel;
+ } GNU_AOUT;
+
+#define AOUTSZ (sizeof(AOUTHDR))
+
+#define OMAGIC 0404 /* object files, eg as output */
+#define ZMAGIC 0413 /* demand load format, eg normal ld output */
+#define STMAGIC 0401 /* target shlib */
+#define SHMAGIC 0443 /* host shlib */
+
+
+/********************** SECTION HEADER **********************/
+
+
+struct external_scnhdr {
+ char s_name[8]; /* section name */
+ unsigned long s_paddr; /* physical address, aliased s_nlib */
+ unsigned long s_vaddr; /* virtual address */
+ unsigned long s_size; /* section size */
+ unsigned long s_scnptr; /* file ptr to raw data for section */
+ unsigned long s_relptr; /* file ptr to relocation */
+ unsigned long s_lnnoptr; /* file ptr to line numbers */
+ unsigned short s_nreloc; /* number of relocation entries */
+ unsigned short s_nlnno; /* number of line number entries*/
+ unsigned long s_flags; /* flags */
+};
+
+#define SCNHDR struct external_scnhdr
+#define SCNHSZ sizeof(SCNHDR)
+
+/*
+ * names of "special" sections
+ */
+#define _TEXT ".text"
+#define _DATA ".data"
+#define _BSS ".bss"
+#define _COMMENT ".comment"
+#define _LIB ".lib"
+
+/*
+ * s_flags "type"
+ */
+#define STYP_TEXT (0x0020) /* section contains text only */
+#define STYP_DATA (0x0040) /* section contains data only */
+#define STYP_BSS (0x0080) /* section contains bss only */
+
+/********************** LINE NUMBERS **********************/
+
+/* 1 line number entry for every "breakpointable" source line in a section.
+ * Line numbers are grouped on a per function basis; first entry in a function
+ * grouping will have l_lnno = 0 and in place of physical address will be the
+ * symbol table index of the function name.
+ */
+struct external_lineno {
+ union {
+ unsigned long l_symndx __attribute__((packed)); /* function name symbol index, iff l_lnno == 0 */
+ unsigned long l_paddr __attribute__((packed)); /* (physical) address of line number */
+ } l_addr;
+ unsigned short l_lnno; /* line number */
+};
+
+
+#define LINENO struct external_lineno
+#define LINESZ sizeof(LINENO)
+
+
+/********************** SYMBOLS **********************/
+
+#define E_SYMNMLEN 8 /* # characters in a symbol name */
+#define E_FILNMLEN 14 /* # characters in a file name */
+#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
+
+struct external_syment
+{
+ union {
+ char e_name[E_SYMNMLEN];
+ struct {
+ unsigned long e_zeroes __attribute__((packed));
+ unsigned long e_offset __attribute__((packed));
+ } e;
+ } e;
+ unsigned long e_value __attribute__((packed));
+ short e_scnum;
+ unsigned short e_type;
+ unsigned char e_sclass;
+ unsigned char e_numaux;
+};
+
+#define N_BTMASK (0xf)
+#define N_TMASK (0x30)
+#define N_BTSHFT (4)
+#define N_TSHIFT (2)
+
+union external_auxent {
+ struct {
+ unsigned long x_tagndx __attribute__((packed)); /* str, un, or enum tag indx */
+ union {
+ struct {
+ unsigned short x_lnno; /* declaration line number */
+ unsigned short x_size; /* str/union/array size */
+ } x_lnsz;
+ unsigned long x_fsize __attribute__((packed)); /* size of function */
+ } x_misc;
+ union {
+ struct { /* if ISFCN, tag, or .bb */
+ unsigned long x_lnnoptr __attribute__((packed)); /* ptr to fcn line # */
+ unsigned long x_endndx __attribute__((packed)); /* entry ndx past block end */
+ } x_fcn;
+ struct { /* if ISARY, up to 4 dimen. */
+ unsigned short x_dimen[E_DIMNUM];
+ } x_ary;
+ } x_fcnary;
+ unsigned short x_tvndx; /* tv index */
+ } x_sym;
+
+ union {
+ char x_fname[E_FILNMLEN];
+ struct {
+ unsigned long x_zeroes __attribute__((packed));
+ unsigned long x_offset __attribute__((packed));
+ } x_n;
+ } x_file;
+
+ struct {
+ unsigned long x_scnlen __attribute__((packed)); /* section length */
+ unsigned short x_nreloc; /* # relocation entries */
+ unsigned short x_nlinno; /* # line numbers */
+ } x_scn;
+
+ struct {
+ unsigned long x_tvfill __attribute__((packed)); /* tv fill value */
+ unsigned short x_tvlen; /* length of .tv */
+ unsigned short x_tvran[2]; /* tv range */
+ } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
+
+
+};
+
+#define SYMENT struct external_syment
+#define SYMESZ sizeof(SYMENT)
+#define AUXENT union external_auxent
+#define AUXESZ sizeof(AUXENT)
+
+
+# define _ETEXT "etext"
+
+
+/* Relocatable symbols have number of the section in which they are defined,
+ or one of the following: */
+
+#define N_UNDEF ((short)0) /* undefined symbol */
+#define N_ABS ((short)-1) /* value of symbol is absolute */
+#define N_DEBUG ((short)-2) /* debugging symbol -- value is meaningless */
+#define N_TV ((short)-3) /* indicates symbol needs preload transfer vector */
+#define P_TV ((short)-4) /* indicates symbol needs postload transfer vector*/
+
+/*
+ * Type of a symbol, in low N bits of the word
+ */
+#define T_NULL 0
+#define T_VOID 1 /* function argument (only used by compiler) */
+#define T_CHAR 2 /* character */
+#define T_SHORT 3 /* short integer */
+#define T_INT 4 /* integer */
+#define T_LONG 5 /* long integer */
+#define T_FLOAT 6 /* floating point */
+#define T_DOUBLE 7 /* double word */
+#define T_STRUCT 8 /* structure */
+#define T_UNION 9 /* union */
+#define T_ENUM 10 /* enumeration */
+#define T_MOE 11 /* member of enumeration*/
+#define T_UCHAR 12 /* unsigned character */
+#define T_USHORT 13 /* unsigned short */
+#define T_UINT 14 /* unsigned integer */
+#define T_ULONG 15 /* unsigned long */
+#define T_LNGDBL 16 /* long double */
+
+/*
+ * derived types, in n_type
+*/
+#define DT_NON (0) /* no derived type */
+#define DT_PTR (1) /* pointer */
+#define DT_FCN (2) /* function */
+#define DT_ARY (3) /* array */
+
+#define BTYPE(x) ((x) & N_BTMASK)
+
+#define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
+#define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
+#define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
+#define ISTAG(x) ((x)==C_STRTAG||(x)==C_UNTAG||(x)==C_ENTAG)
+#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
+
+/********************** STORAGE CLASSES **********************/
+
+/* This used to be defined as -1, but now n_sclass is unsigned. */
+#define C_EFCN 0xff /* physical end of function */
+#define C_NULL 0
+#define C_AUTO 1 /* automatic variable */
+#define C_EXT 2 /* external symbol */
+#define C_STAT 3 /* static */
+#define C_REG 4 /* register variable */
+#define C_EXTDEF 5 /* external definition */
+#define C_LABEL 6 /* label */
+#define C_ULABEL 7 /* undefined label */
+#define C_MOS 8 /* member of structure */
+#define C_ARG 9 /* function argument */
+#define C_STRTAG 10 /* structure tag */
+#define C_MOU 11 /* member of union */
+#define C_UNTAG 12 /* union tag */
+#define C_TPDEF 13 /* type definition */
+#define C_USTATIC 14 /* undefined static */
+#define C_ENTAG 15 /* enumeration tag */
+#define C_MOE 16 /* member of enumeration */
+#define C_REGPARM 17 /* register parameter */
+#define C_FIELD 18 /* bit field */
+#define C_AUTOARG 19 /* auto argument */
+#define C_LASTENT 20 /* dummy entry (end of block) */
+#define C_BLOCK 100 /* ".bb" or ".eb" */
+#define C_FCN 101 /* ".bf" or ".ef" */
+#define C_EOS 102 /* end of structure */
+#define C_FILE 103 /* file name */
+#define C_LINE 104 /* line # reformatted as symbol table entry */
+#define C_ALIAS 105 /* duplicate tag */
+#define C_HIDDEN 106 /* ext symbol in dmert public lib */
+
+/********************** RELOCATION DIRECTIVES **********************/
+
+
+
+struct external_reloc {
+ unsigned long r_vaddr __attribute__((packed));
+ unsigned long r_symndx __attribute__((packed));
+ unsigned short r_type;
+};
+
+
+#define RELOC struct external_reloc
+#define RELSZ sizeof(RELOC)
+
+#define RELOC_REL32 20 /* 32-bit PC-relative address */
+#define RELOC_ADDR32 6 /* 32-bit absolute address */
+
+#define DEFAULT_DATA_SECTION_ALIGNMENT 4
+#define DEFAULT_BSS_SECTION_ALIGNMENT 4
+#define DEFAULT_TEXT_SECTION_ALIGNMENT 4
+/* For new sections we havn't heard of before */
+#define DEFAULT_SECTION_ALIGNMENT 4
+
+#endif /* !_POSIX_SOURCE */
+#endif /* !__STRICT_ANSI__ */
+#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
+
+#ifndef __dj_ENFORCE_FUNCTION_CALLS
+#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !__dj_include_coff_h_ */
/contrib/media/updf/include/commandline.h
0,0 → 1,112
 
/** \file commandline.h
* Implementation of a platform-independent command line with history.
*
* The class CCommandLine has two roles:
* 1) It has an outside interface, ReadLine(), that yields to the
* system until the user is finished entering an expression at
* the command line. The result can be found in iLine.
* 2) It defines a mini-API needed to implement the command line.
* For each platform Yacas is meant to run on there should be a
* CCommandLine-derived class if this functionality is to be used.
*
*/
 
#ifndef __commandline_h__
#define __commandline_h__
 
#include "lispstring.h"
#include "yacasbase.h"
 
enum ESpecialChars
{
eDelete = 0x1000,
eBackSpace,
eLeft,
eRight,
eUp,
eDown,
eHome,
eEnd,
eEnter,
eTab,
eEscape
};
 
/**
* Implementation of a platform-independent command line with history.
*
* The class CCommandLine has two roles:
* 1) It has an outside interface, ReadLine(), that yields to the
* system until the user is finished entering an expression at
* the command line. The result can be found in iLine.
* 2) It defines a mini-API needed to implement the command line.
* For each platform Yacas is meant to run on there should be a
* CCommandLine-derived class if this functionality is to be used.
*
* The derived class is responsible for filling the history list,
* and for externalizing the history list to disk when the system
* shuts down.
*/
 
/// \class CConsoleHistory, implement history list the user can browse through.
class CConsoleHistory
{
public:
CConsoleHistory() : iHistory(),history(0) {}
void ResetHistoryPosition();
void AddLine(LispString& aString);
void Append(LispString * aString);
LispInt ArrowUp(LispString& aString,LispInt &aCursorPos);
LispInt ArrowDown(LispString& aString,LispInt &aCursorPos);
LispInt Complete(LispString& aString,LispInt &aCursorPos);
LispInt NrLines();
LispString * GetLine(LispInt aLine);
protected:
CDeletingArrayGrower<LispString *, ArrOpsDeletingPtr<LispString> > iHistory;
LispInt history;
};
 
class CCommandLine : public YacasBase
{
public:
CCommandLine() : iFullLineDirty(LispFalse),iHistoryUnchanged(0),iLine(),iSubLine(),iHistoryList() {};
virtual ~CCommandLine();
/// Call this function if the user needs to enter an expression.
virtual void ReadLine(LispChar * prompt);
public: //platform stuff
/** return a key press, which is either an ascii value, or one
* of the values specified in ESpecialChars
*/
virtual LispInt GetKey() = 0;
/// Go to the next line on the console (carriage return/line feed).
virtual void NewLine() = 0;
/** Show the current line (in iSubLine), with the required prompt,
* and the cursor position at cursor (starting from the prompt).
*/
virtual void ShowLine(LispChar * prompt,
LispInt promptlen,LispInt cursor) = 0;
/// Pause for a short while. Used when matching brackets.
virtual void Pause() = 0;
 
/// Maximum number of history lines to be saved (-1 is all)
virtual void MaxHistoryLinesSaved(LispInt aNrLines);
 
protected:
virtual void ReadLineSub(LispChar * prompt);
private:
void GetHistory(LispInt aLine);
void ShowOpen(LispChar * prompt,LispInt promptlen,
LispChar aOpen, LispChar aClose, LispInt aCurPos);
protected:
LispInt iFullLineDirty;
LispInt iHistoryUnchanged;
 
public:
LispString iLine;
LispString iSubLine;
 
CConsoleHistory iHistoryList;
};
 
#endif
/contrib/media/updf/include/complex
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_COMPLEX
#include <bits/std_complex.h>
#endif
/contrib/media/updf/include/compressedfiles.h
0,0 → 1,51
 
#ifndef __compressedfiles_h__
#define __compressedfiles_h__
 
#include "lisptype.h"
#include "lispassert.h"
 
class CompressedFiles
{
public:
CompressedFiles(unsigned char * aBuffer, LispInt aFullSize, LispInt aCompressed);
~CompressedFiles();
LispInt FindFile(LispChar * aName);
LispChar * Name(LispInt aIndex);
LispChar * Contents(LispInt aIndex);
inline LispInt NrFiles() const {return iNrFiles;}
void Sizes(LispInt& aOriginalSize, LispInt& aCompressedSize, LispInt aIndex);
inline LispInt IsValid() const {return iIsValid;}
protected:
LispInt GetInt(unsigned char*&indptr);
 
private:
// copy constructor not implemented yet, so an assert is in order
CompressedFiles(const CompressedFiles& aOther)
: iFullBuffer(NULL),iCompressed(0),iFullSize(0),iIndex(NULL),iNrFiles(0),iIndexSize(0),iIsValid(LispFalse)
{
LISPASSERT(0);
}
inline CompressedFiles& operator=(const CompressedFiles& aOther)
{
iFullBuffer = NULL;
iCompressed = 0;
iFullSize = 0;
iIndex = NULL;
iNrFiles = 0;
iIndexSize = 0;
iIsValid = LispFalse;
LISPASSERT(0);
return *this;
}
private:
unsigned char * iFullBuffer;
LispInt iCompressed;
LispInt iFullSize;
unsigned char * *iIndex;
LispInt iNrFiles;
LispInt iIndexSize;
LispInt iIsValid;
};
 
#endif // __compressedfiles_h__
/contrib/media/updf/include/config.h
0,0 → 1,87
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
 
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
 
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
 
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1
 
/* Define to 1 if you have the `z' library (-lz). */
#define HAVE_LIBZ 1
 
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
 
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
 
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
 
/* Define to 1 if you have the `pow' function. */
/* #undef HAVE_POW */
 
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
 
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
 
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
 
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
 
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
 
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
 
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
 
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
 
/* Name of package */
#define PACKAGE "libpng"
 
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "png-mng-implement@lists.sourceforge.net"
 
/* Define to the full name of this package. */
#define PACKAGE_NAME "libpng"
 
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libpng 1.5.1"
 
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libpng"
 
/* Define to the home page for this package. */
#define PACKAGE_URL ""
 
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.5.1"
 
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
 
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
 
/* Version number of package */
#define VERSION "1.5.1"
 
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
 
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/contrib/media/updf/include/configure
0,0 → 1,16740
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for jbig2dec 0.11.
#
# Report bugs to <jbig2-dev@ghostscript.com>.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
 
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in
*posix*) set -o posix ;;
esac
 
fi
 
 
 
 
# PATH needs CR
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
 
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
 
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
 
# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
fi
 
 
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
 
# Find who we are. Look in the path if we contain no directory separator.
case $0 in
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
 
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
{ (exit 1); exit 1; }
fi
 
# Work around bugs in pre-3.0 UWIN ksh.
for as_var in ENV MAIL MAILPATH
do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
done
PS1='$ '
PS2='> '
PS4='+ '
 
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
 
# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
 
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
 
 
# Name of the executable.
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
 
# CDPATH.
$as_unset CDPATH
 
 
if test "x$CONFIG_SHELL" = x; then
if (eval ":") 2>/dev/null; then
as_have_required=yes
else
as_have_required=no
fi
 
if test $as_have_required = yes && (eval ":
(as_func_return () {
(exit \$1)
}
as_func_success () {
as_func_return 0
}
as_func_failure () {
as_func_return 1
}
as_func_ret_success () {
return 0
}
as_func_ret_failure () {
return 1
}
 
exitcode=0
if as_func_success; then
:
else
exitcode=1
echo as_func_success failed.
fi
 
if as_func_failure; then
exitcode=1
echo as_func_failure succeeded.
fi
 
if as_func_ret_success; then
:
else
exitcode=1
echo as_func_ret_success failed.
fi
 
if as_func_ret_failure; then
exitcode=1
echo as_func_ret_failure succeeded.
fi
 
if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
:
else
exitcode=1
echo positional parameters were not saved.
fi
 
test \$exitcode = 0) || { (exit 1); exit 1; }
 
(
as_lineno_1=\$LINENO
as_lineno_2=\$LINENO
test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
") 2> /dev/null; then
:
else
as_candidate_shells=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
case $as_dir in
/*)
for as_base in sh bash ksh sh5; do
as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
done;;
esac
done
IFS=$as_save_IFS
 
 
for as_shell in $as_candidate_shells $SHELL; do
# Try only shells that exist, to save several forks.
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
{ ("$as_shell") 2> /dev/null <<\_ASEOF
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in
*posix*) set -o posix ;;
esac
 
fi
 
 
:
_ASEOF
}; then
CONFIG_SHELL=$as_shell
as_have_required=yes
if { "$as_shell" 2> /dev/null <<\_ASEOF
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in
*posix*) set -o posix ;;
esac
 
fi
 
 
:
(as_func_return () {
(exit $1)
}
as_func_success () {
as_func_return 0
}
as_func_failure () {
as_func_return 1
}
as_func_ret_success () {
return 0
}
as_func_ret_failure () {
return 1
}
 
exitcode=0
if as_func_success; then
:
else
exitcode=1
echo as_func_success failed.
fi
 
if as_func_failure; then
exitcode=1
echo as_func_failure succeeded.
fi
 
if as_func_ret_success; then
:
else
exitcode=1
echo as_func_ret_success failed.
fi
 
if as_func_ret_failure; then
exitcode=1
echo as_func_ret_failure succeeded.
fi
 
if ( set x; as_func_ret_success y && test x = "$1" ); then
:
else
exitcode=1
echo positional parameters were not saved.
fi
 
test $exitcode = 0) || { (exit 1); exit 1; }
 
(
as_lineno_1=$LINENO
as_lineno_2=$LINENO
test "x$as_lineno_1" != "x$as_lineno_2" &&
test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
 
_ASEOF
}; then
break
fi
 
fi
 
done
 
if test "x$CONFIG_SHELL" != x; then
for as_var in BASH_ENV ENV
do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
done
export CONFIG_SHELL
exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
fi
 
 
if test $as_have_required = no; then
echo This script requires a shell more modern than all the
echo shells that I found on your system. Please install a
echo modern shell, or manually run the script under such a
echo shell if you do have one.
{ (exit 1); exit 1; }
fi
 
 
fi
 
fi
 
 
 
(eval "as_func_return () {
(exit \$1)
}
as_func_success () {
as_func_return 0
}
as_func_failure () {
as_func_return 1
}
as_func_ret_success () {
return 0
}
as_func_ret_failure () {
return 1
}
 
exitcode=0
if as_func_success; then
:
else
exitcode=1
echo as_func_success failed.
fi
 
if as_func_failure; then
exitcode=1
echo as_func_failure succeeded.
fi
 
if as_func_ret_success; then
:
else
exitcode=1
echo as_func_ret_success failed.
fi
 
if as_func_ret_failure; then
exitcode=1
echo as_func_ret_failure succeeded.
fi
 
if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
:
else
exitcode=1
echo positional parameters were not saved.
fi
 
test \$exitcode = 0") || {
echo No shell found that supports shell functions.
echo Please tell bug-autoconf@gnu.org about your system,
echo including any error possibly output before this message.
echo This can help us improve future autoconf versions.
echo Configuration will now proceed without shell functions.
}
 
 
 
as_lineno_1=$LINENO
as_lineno_2=$LINENO
test "x$as_lineno_1" != "x$as_lineno_2" &&
test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
# line-number line after each line using $LINENO; the second 'sed'
# does the real work. The second script uses 'N' to pair each
# line-number line with the line containing $LINENO, and appends
# trailing '-' during substitution so that $LINENO is not a special
# case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
# scripts with optimization help from Paolo Bonzini. Blame Lee
# E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
 
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
 
 
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
 
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in
-n*)
case `echo 'x\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
*) ECHO_C='\c';;
esac;;
*)
ECHO_N='-n';;
esac
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
 
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -p'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
else
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
 
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
 
if test -x / >/dev/null 2>&1; then
as_test_x='test -x'
else
if ls -dL / >/dev/null 2>&1; then
as_ls_L_option=L
else
as_ls_L_option=
fi
as_test_x='
eval sh -c '\''
if test -d "$1"; then
test -d "$1/.";
else
case $1 in
-*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
fi
as_executable_p=$as_test_x
 
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
 
 
# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}
 
case X$lt_ECHO in
X*--fallback-echo)
# Remove one level of quotation (which was required for Make).
ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
;;
esac
 
ECHO=${lt_ECHO-echo}
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X$1" = X--fallback-echo; then
# Avoid inline document here, it may be left over
:
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
# Yippee, $ECHO works!
:
else
# Restart under the correct shell.
exec $SHELL "$0" --no-reexec ${1+"$@"}
fi
 
if test "X$1" = X--fallback-echo; then
# used as fallback echo
shift
cat <<_LT_EOF
$*
_LT_EOF
exit 0
fi
 
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
if test -z "$lt_ECHO"; then
if test "X${echo_test_string+set}" != Xset; then
# find a string as large as possible, as long as the shell can cope with it
for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
# expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
{ test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
then
break
fi
done
fi
 
if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
:
else
# The Solaris, AIX, and Digital Unix default echo programs unquote
# backslashes. This makes it impossible to quote backslashes using
# echo "$something" | sed 's/\\/\\\\/g'
#
# So, first we look for a working echo in the user's PATH.
 
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for dir in $PATH /usr/ucb; do
IFS="$lt_save_ifs"
if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
ECHO="$dir/echo"
break
fi
done
IFS="$lt_save_ifs"
 
if test "X$ECHO" = Xecho; then
# We didn't find a better echo, so look for alternatives.
if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
# This shell has a builtin print -r that does the trick.
ECHO='print -r'
elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
test "X$CONFIG_SHELL" != X/bin/ksh; then
# If we have ksh, try running configure again with it.
ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
export ORIGINAL_CONFIG_SHELL
CONFIG_SHELL=/bin/ksh
export CONFIG_SHELL
exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
else
# Try using printf.
ECHO='printf %s\n'
if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
# Cool, printf works
:
elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
test "X$echo_testing_string" = 'X\t' &&
echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
export CONFIG_SHELL
SHELL="$CONFIG_SHELL"
export SHELL
ECHO="$CONFIG_SHELL $0 --fallback-echo"
elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
test "X$echo_testing_string" = 'X\t' &&
echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
ECHO="$CONFIG_SHELL $0 --fallback-echo"
else
# maybe with a smaller string...
prev=:
 
for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
then
break
fi
prev="$cmd"
done
 
if test "$prev" != 'sed 50q "$0"'; then
echo_test_string=`eval $prev`
export echo_test_string
exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
else
# Oops. We lost completely, so just stick with echo.
ECHO=echo
fi
fi
fi
fi
fi
fi
 
# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
lt_ECHO=$ECHO
if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
fi
 
 
 
 
exec 7<&0 </dev/null 6>&1
 
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
 
# Identity of this package.
PACKAGE_NAME='jbig2dec'
PACKAGE_TARNAME='jbig2dec'
PACKAGE_VERSION='0.11'
PACKAGE_STRING='jbig2dec 0.11'
PACKAGE_BUGREPORT='jbig2-dev@ghostscript.com'
 
ac_unique_file="jbig2dec.c"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
#ifdef HAVE_STRING_H
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"
 
ac_subst_vars='LTLIBOBJS
JBIG2_STDINT_H
JBIG2_INT8_T
JBIG2_INT16_T
JBIG2_INT32_T
LIBOBJS
CPP
OTOOL64
OTOOL
LIPO
NMEDIT
DSYMUTIL
lt_ECHO
RANLIB
AR
OBJDUMP
LN_S
NM
ac_ct_DUMPBIN
DUMPBIN
LD
FGREP
EGREP
GREP
SED
host_os
host_vendor
host_cpu
host
build_os
build_vendor
build_cpu
build
LIBTOOL
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
am__quote
am__include
DEPDIR
OBJEXT
EXEEXT
ac_ct_CC
CPPFLAGS
LDFLAGS
CFLAGS
CC
JBIG2DEC_LT_AGE
JBIG2DEC_LT_REVISION
JBIG2DEC_LT_CURRENT
am__leading_dot
SET_MAKE
AWK
INSTALL_STRIP_PROGRAM
STRIP
install_sh
AMTAR
MAKEINFO
AUTOHEADER
AUTOMAKE
AUTOCONF
ACLOCAL
VERSION
PACKAGE
CYGPATH_W
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
localstatedir
sharedstatedir
sysconfdir
datadir
datarootdir
libexecdir
sbindir
bindir
program_transform_name
prefix
exec_prefix
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_dependency_tracking
enable_shared
enable_static
with_pic
enable_fast_install
with_gnu_ld
enable_libtool_lock
with_libpng
'
ac_precious_vars='build_alias
host_alias
target_alias
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CPP'
 
 
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE
 
# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'
 
ac_prev=
ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval $ac_prev=\$ac_option
ac_prev=
continue
fi
 
case $ac_option in
*=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
*) ac_optarg=yes ;;
esac
 
# Accept the important Cygnus configure options, so we can diagnose typos.
 
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
 
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir=$ac_optarg ;;
 
-build | --build | --buil | --bui | --bu)
ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build_alias=$ac_optarg ;;
 
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file=$ac_optarg ;;
 
--config-cache | -C)
cache_file=config.cache ;;
 
-datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
 
-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
| --dataroo | --dataro | --datar)
ac_prev=datarootdir ;;
-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
datarootdir=$ac_optarg ;;
 
-disable-* | --disable-*)
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
{ $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
{ (exit 1); exit 1; }; }
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=no ;;
 
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
-docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
docdir=$ac_optarg ;;
 
-dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
ac_prev=dvidir ;;
-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
dvidir=$ac_optarg ;;
 
-enable-* | --enable-*)
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
{ $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
{ (exit 1); exit 1; }; }
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=\$ac_optarg ;;
 
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
 
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
 
-help | --help | --hel | --he | -h)
ac_init_help=long ;;
-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
ac_init_help=recursive ;;
-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
ac_init_help=short ;;
 
-host | --host | --hos | --ho)
ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
 
-htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
ac_prev=htmldir ;;
-htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
| --ht=*)
htmldir=$ac_optarg ;;
 
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir=$ac_optarg ;;
 
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir=$ac_optarg ;;
 
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir=$ac_optarg ;;
 
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
 
-localedir | --localedir | --localedi | --localed | --locale)
ac_prev=localedir ;;
-localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
localedir=$ac_optarg ;;
 
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
 
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir=$ac_optarg ;;
 
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
 
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c | -n)
no_create=yes ;;
 
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
 
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir=$ac_optarg ;;
 
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=$ac_optarg ;;
 
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix=$ac_optarg ;;
 
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix=$ac_optarg ;;
 
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
 
-pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
ac_prev=pdfdir ;;
-pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
pdfdir=$ac_optarg ;;
 
-psdir | --psdir | --psdi | --psd | --ps)
ac_prev=psdir ;;
-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
psdir=$ac_optarg ;;
 
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
 
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir=$ac_optarg ;;
 
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir=$ac_optarg ;;
 
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site=$ac_optarg ;;
 
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=$ac_optarg ;;
 
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir=$ac_optarg ;;
 
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target_alias=$ac_optarg ;;
 
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
 
-version | --version | --versio | --versi | --vers | -V)
ac_init_version=: ;;
 
-with-* | --with-*)
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
{ $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
{ (exit 1); exit 1; }; }
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=\$ac_optarg ;;
 
-without-* | --without-*)
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
{ $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
{ (exit 1); exit 1; }; }
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=no ;;
 
--x)
# Obsolete; use --with-x.
with_x=yes ;;
 
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes=$ac_optarg ;;
 
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
 
-*) { $as_echo "$as_me: error: unrecognized option: $ac_option
Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; }
;;
 
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
{ $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
{ (exit 1); exit 1; }; }
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
 
*)
# FIXME: should be removed in autoconf 3.0.
$as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
$as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
: ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
 
esac
done
 
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
{ $as_echo "$as_me: error: missing argument to $ac_option" >&2
{ (exit 1); exit 1; }; }
fi
 
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
{ (exit 1); exit 1; }; } ;;
*) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
 
# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
case $ac_val in
*/ )
ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
eval $ac_var=\$ac_val;;
esac
# Be sure to have absolute directory names.
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
{ $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
{ (exit 1); exit 1; }; }
done
 
# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias
 
# FIXME: To remove some day.
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
$as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used." >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
fi
 
ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-
 
test "$silent" = yes && exec 6>/dev/null
 
 
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
{ $as_echo "$as_me: error: working directory cannot be determined" >&2
{ (exit 1); exit 1; }; }
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
{ $as_echo "$as_me: error: pwd does not report name of working directory" >&2
{ (exit 1); exit 1; }; }
 
 
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
ac_confdir=`$as_dirname -- "$as_myself" ||
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
{ $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
{ (exit 1); exit 1; }; }
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
{ (exit 1); exit 1; }; }
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
eval ac_env_${ac_var}_set=\${${ac_var}+set}
eval ac_env_${ac_var}_value=\$${ac_var}
eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
eval ac_cv_env_${ac_var}_value=\$${ac_var}
done
 
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures jbig2dec 0.11 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
 
Defaults for the options are specified in brackets.
 
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print \`checking...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
 
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
 
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.
 
For better control, use the options below.
 
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/jbig2dec]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
_ACEOF
 
cat <<\_ACEOF
 
Program names:
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
 
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of jbig2dec 0.11:";;
esac
cat <<\_ACEOF
 
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking Speeds up one-time builds
--enable-dependency-tracking Do not reject slow dependency extractors
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
 
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-pic try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-libpng=prefix include support for png output (if libpng is
available)
 
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
 
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
 
Report bugs to <jbig2-dev@ghostscript.com>.
_ACEOF
ac_status=$?
fi
 
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
test -d "$ac_dir" ||
{ cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
continue
ac_builddir=.
 
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
 
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
cd "$ac_dir" || { ac_status=$?; continue; }
# Check for guested configure.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
elif test -f "$ac_srcdir/configure"; then
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
 
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
jbig2dec configure 0.11
generated by GNU Autoconf 2.63
 
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by jbig2dec $as_me 0.11, which was
generated by GNU Autoconf 2.63. Invocation command line was
 
$ $0 $@
 
_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##
 
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
 
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
 
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
 
_ASUNAME
 
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
$as_echo "PATH: $as_dir"
done
IFS=$as_save_IFS
 
} >&5
 
cat >&5 <<_ACEOF
 
 
## ----------- ##
## Core tests. ##
## ----------- ##
 
_ACEOF
 
 
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
for ac_arg
do
case $ac_arg in
-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
2)
ac_configure_args1="$ac_configure_args1 '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
case $ac_arg in
*=* | --config-cache | -C | -disable-* | --disable-* \
| -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
| -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
| -with-* | --with-* | -without-* | --without-* | --x)
case "$ac_configure_args0 " in
"$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
esac
;;
-* ) ac_must_keep_next=true ;;
esac
fi
ac_configure_args="$ac_configure_args '$ac_arg'"
;;
esac
done
done
$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
 
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
echo
 
cat <<\_ASBOX
## ---------------- ##
## Cache variables. ##
## ---------------- ##
_ASBOX
echo
# The following way of writing the cache mishandles newlines in values,
(
for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) $as_unset $ac_var ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
sed -n \
"s/'\''/'\''\\\\'\'''\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
;; #(
*)
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
)
echo
 
cat <<\_ASBOX
## ----------------- ##
## Output variables. ##
## ----------------- ##
_ASBOX
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
 
if test -n "$ac_subst_files"; then
cat <<\_ASBOX
## ------------------- ##
## File substitutions. ##
## ------------------- ##
_ASBOX
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
 
if test -s confdefs.h; then
cat <<\_ASBOX
## ----------- ##
## confdefs.h. ##
## ----------- ##
_ASBOX
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
$as_echo "$as_me: caught signal $ac_signal"
$as_echo "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
done
ac_signal=0
 
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
 
# Predefined preprocessor variables.
 
cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF
 
 
cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF
 
 
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF
 
 
cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF
 
 
cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF
 
 
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
ac_site_file1=$CONFIG_SITE
elif test "x$prefix" != xNONE; then
ac_site_file1=$prefix/share/config.site
ac_site_file2=$prefix/etc/config.site
else
ac_site_file1=$ac_default_prefix/share/config.site
ac_site_file2=$ac_default_prefix/etc/config.site
fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
test "x$ac_site_file" = xNONE && continue
if test -r "$ac_site_file"; then
{ $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
 
if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special
# files actually), so we avoid doing that.
if test -f "$cache_file"; then
{ $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
{ $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
$as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
 
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val=\$ac_cv_env_${ac_var}_value
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
{ $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
# differences in whitespace do not lead to failure.
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
{ $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
{ $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
{ $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5
$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
{ $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5
$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
*) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
{ { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
{ (exit 1); exit 1; }; }
fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
 
 
am__api_version="1.7"
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f "$ac_dir/install.sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
elif test -f "$ac_dir/shtool"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
{ { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
{ (exit 1); exit 1; }; }
fi
 
# These three variables are undocumented and unsupported,
# and are intended to be withdrawn in a future Autoconf release.
# They can cause serious problems if a builder's source tree is in a directory
# whose full name contains unusual characters.
ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
 
 
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
$as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
# Account for people who put trailing slashes in PATH elements.
case $as_dir/ in
./ | .// | /cC/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# Don't use installbsd from OSF since it installs stuff as root
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
rm -rf conftest.one conftest.two conftest.dir
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
break 3
fi
fi
fi
done
done
;;
esac
 
done
IFS=$as_save_IFS
 
rm -rf conftest.one conftest.two conftest.dir
 
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
# value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
$as_echo "$INSTALL" >&6; }
 
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
$as_echo_n "checking whether build environment is sane... " >&6; }
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$*" != "X $srcdir/configure conftest.file" \
&& test "$*" != "X conftest.file $srcdir/configure"; then
 
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
{ { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
alias in your environment" >&5
$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
alias in your environment" >&2;}
{ (exit 1); exit 1; }; }
fi
 
test "$2" = conftest.file
)
then
# Ok.
:
else
{ { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
Check your system clock" >&5
$as_echo "$as_me: error: newly created file is older than distributed files!
Check your system clock" >&2;}
{ (exit 1); exit 1; }; }
fi
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
test "$program_prefix" != NONE &&
program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
program_transform_name="s&\$&$program_suffix&;$program_transform_name"
# Double any \ or $.
# By default was `s,x,x', remove it if useless.
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
 
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
 
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
{ $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
fi
 
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_AWK+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AWK="$ac_prog"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
{ $as_echo "$as_me:$LINENO: result: $AWK" >&5
$as_echo "$AWK" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
test -n "$AWK" && break
done
 
{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
$as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
*@@@%%%=?*=@@@%%%*)
eval ac_cv_prog_make_${ac_make}_set=yes;;
*)
eval ac_cv_prog_make_${ac_make}_set=no;;
esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
SET_MAKE=
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
 
rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
 
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
{ { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
{ (exit 1); exit 1; }; }
fi
 
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
 
 
# Define the identity of the package.
PACKAGE='jbig2dec'
VERSION='0.11'
 
 
cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
_ACEOF
 
 
cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
_ACEOF
 
# Some tools Automake needs.
 
ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
 
 
AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
 
 
AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
 
 
AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 
AMTAR=${AMTAR-"${am_missing_run}tar"}
 
install_sh=${install_sh-"$am_aux_dir/install-sh"}
 
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_STRIP+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
{ $as_echo "$as_me:$LINENO: result: $STRIP" >&5
$as_echo "$STRIP" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
$as_echo "$ac_ct_STRIP" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
if test "x$ac_ct_STRIP" = x; then
STRIP=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
fi
else
STRIP="$ac_cv_prog_STRIP"
fi
 
fi
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
 
 
 
ac_config_headers="$ac_config_headers config.h"
 
 
 
JBIG2DEC_LT_CURRENT=0
 
JBIG2DEC_LT_REVISION=0
 
JBIG2DEC_LT_AGE=0
 
 
# Checks for programs.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:$LINENO: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
else
CC="$ac_cv_prog_CC"
fi
 
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:$LINENO: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
if test $# != 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:$LINENO: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
for ac_prog in cl.exe
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:$LINENO: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
for ac_prog in cl.exe
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
test -n "$ac_ct_CC" && break
done
 
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
fi
 
fi
 
 
test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
See \`config.log' for more details." >&5
$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }; }
 
# Provide some information about the compiler.
$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
{ (ac_try="$ac_compiler --version >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compiler --version >&5") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
{ (ac_try="$ac_compiler -v >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compiler -v >&5") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
{ (ac_try="$ac_compiler -V >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compiler -V >&5") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
 
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
 
;
return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
$as_echo_n "checking for C compiler default output file name... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
 
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
* ) ac_rmfiles="$ac_rmfiles $ac_file";;
esac
done
rm -f $ac_rmfiles
 
if { (ac_try="$ac_link_default"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
# so that the user can short-circuit this test for compilers unknown to
# Autoconf.
for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
# We set ac_cv_exeext here because the later test for it is not
# safe: cross compilers may not add the suffix if given an `-o'
# argument, so we may need to know it at that point already.
# Even if this section looks crufty: it has the advantage of
# actually working.
break;;
* )
break;;
esac
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
 
else
ac_file=''
fi
 
{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
if test -z "$ac_file"; then
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
See \`config.log' for more details." >&5
$as_echo "$as_me: error: C compiler cannot create executables
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }; }
fi
 
ac_exeext=$ac_cv_exeext
 
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
$as_echo_n "checking whether the C compiler works... " >&6; }
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
if { ac_try='./$ac_file'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&5
$as_echo "$as_me: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }; }
fi
fi
fi
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
 
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
$as_echo_n "checking whether we are cross compiling... " >&6; }
{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }
 
{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
$as_echo_n "checking for suffix of executables... " >&6; }
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
# `rm'.
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
esac
done
else
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." >&5
$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }; }
fi
 
rm -f conftest$ac_cv_exeext
{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; }
 
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
if test "${ac_cv_objext+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
 
;
return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
See \`config.log' for more details." >&5
$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }; }
fi
 
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
if test "${ac_cv_c_compiler_gnu+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
#ifndef __GNUC__
choke me
#endif
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_compiler_gnu=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_compiler_gnu=no
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if test "${ac_cv_prog_cc_g+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_prog_cc_g=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
CFLAGS=""
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_prog_cc_g=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-g"
fi
else
if test "$GCC" = yes; then
CFLAGS="-O2"
else
CFLAGS=
fi
fi
{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if test "${ac_cv_prog_cc_c89+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
 
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not '\xHH' hex character constants.
These don't provoke an error unfortunately, instead are silently treated
as 'x'. The following induces an error, until -std is added to get
proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
array size at least. It's necessary to write '\x00'==0 to get something
that's true only with -std. */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
inside strings and character constants. */
#define FOO(x) 'x'
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
 
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
;
return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_prog_cc_c89=$ac_arg
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -f core conftest.err conftest.$ac_objext
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
 
fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
x)
{ $as_echo "$as_me:$LINENO: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
xno)
{ $as_echo "$as_me:$LINENO: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
 
 
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
DEPDIR="${am__leading_dot}deps"
 
ac_config_commands="$ac_config_commands depfiles"
 
 
am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote="\""
_am_result=BSD
fi
fi
 
 
{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
$as_echo "$_am_result" >&6; }
rm -f confinc confmf
 
# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then
enableval=$enable_dependency_tracking;
fi
 
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
 
 
if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE=
AMDEP_FALSE='#'
else
AMDEP_TRUE='#'
AMDEP_FALSE=
fi
 
 
 
 
depcc="$CC" am_compiler_list=
 
{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
 
am_cv_CC_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
fi
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
: > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
case $depmode in
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# (even with -Werror). So we grep stderr for any message
# that says an option was ignored.
if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
am_cv_CC_dependencies_compiler_type=$depmode
break
fi
fi
done
 
cd ..
rm -rf conftest.dir
else
am_cv_CC_dependencies_compiler_type=none
fi
 
fi
{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
 
 
if
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
am__fastdepCC_TRUE=
am__fastdepCC_FALSE='#'
else
am__fastdepCC_TRUE='#'
am__fastdepCC_FALSE=
fi
 
 
if test "x$CC" != xcc; then
{ $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
else
{ $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
fi
set dummy $CC; ac_cc=`$as_echo "$2" |
sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
 
;
return 0;
}
_ACEOF
# Make sure it works both with $CC and with simple cc.
# We do the test twice because some compilers refuse to overwrite an
# existing .o file with -o, though they will create one.
ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
rm -f conftest2.*
if { (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
test -f conftest2.$ac_objext && { (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); };
then
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
if test "x$CC" != xcc; then
# Test first that cc exists at all.
if { ac_try='cc -c conftest.$ac_ext >&5'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
rm -f conftest2.*
if { (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
test -f conftest2.$ac_objext && { (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); };
then
# cc works too.
:
else
# cc exists but doesn't like -o.
eval ac_cv_prog_cc_${ac_cc}_c_o=no
fi
fi
fi
else
eval ac_cv_prog_cc_${ac_cc}_c_o=no
fi
rm -f core conftest*
 
fi
if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
 
cat >>confdefs.h <<\_ACEOF
#define NO_MINUS_C_MINUS_O 1
_ACEOF
 
fi
 
# FIXME: we rely on the cache variable name because
# there is no other way.
set dummy $CC
ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__CC in this case,
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
fi
 
case `pwd` in
*\ * | *\ *)
{ $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
esac
 
 
 
macro_version='2.2.6b'
macro_revision='1.3017'
 
 
 
 
 
 
 
 
 
 
 
 
 
ltmain="$ac_aux_dir/ltmain.sh"
 
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
{ { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
{ (exit 1); exit 1; }; }
 
{ $as_echo "$as_me:$LINENO: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
if test "${ac_cv_build+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
{ { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
{ (exit 1); exit 1; }; }
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
{ { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
{ (exit 1); exit 1; }; }
 
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
$as_echo "$as_me: error: invalid value of canonical build" >&2;}
{ (exit 1); exit 1; }; };;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_build
shift
build_cpu=$1
build_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
build_os=$*
IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
{ $as_echo "$as_me:$LINENO: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
if test "${ac_cv_host+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
{ { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
{ (exit 1); exit 1; }; }
fi
 
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
$as_echo "$as_me: error: invalid value of canonical host" >&2;}
{ (exit 1); exit 1; }; };;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_host
shift
host_cpu=$1
host_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
host_os=$*
IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
if test "${ac_cv_path_SED+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
for ac_i in 1 2 3 4 5 6 7; do
ac_script="$ac_script$as_nl$ac_script"
done
echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
$as_unset ac_script || ac_script=
if test -z "$SED"; then
ac_path_SED_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
{ test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
*GNU*)
ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo '' >> "conftest.nl"
"$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
ac_count=`expr $ac_count + 1`
if test $ac_count -gt ${ac_path_SED_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_SED="$ac_path_SED"
ac_path_SED_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
 
$ac_path_SED_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_SED"; then
{ { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
{ (exit 1); exit 1; }; }
fi
else
ac_cv_path_SED=$SED
fi
 
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
$as_echo "$ac_cv_path_SED" >&6; }
SED="$ac_cv_path_SED"
rm -f conftest.sed
 
test -z "$SED" && SED=sed
Xsed="$SED -e 1s/^X//"
 
 
 
 
 
 
 
 
 
 
 
{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if test "${ac_cv_path_GREP+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -z "$GREP"; then
ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
{ test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo 'GREP' >> "conftest.nl"
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
ac_count=`expr $ac_count + 1`
if test $ac_count -gt ${ac_path_GREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP="$ac_path_GREP"
ac_path_GREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
 
$ac_path_GREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_GREP"; then
{ { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
{ (exit 1); exit 1; }; }
fi
else
ac_cv_path_GREP=$GREP
fi
 
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
$as_echo "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
 
 
{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
if test "${ac_cv_path_EGREP+set}" = set; then
$as_echo_n "(cached) " >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
if test -z "$EGREP"; then
ac_path_EGREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in egrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
{ test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo 'EGREP' >> "conftest.nl"
"$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
ac_count=`expr $ac_count + 1`
if test $ac_count -gt ${ac_path_EGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_EGREP="$ac_path_EGREP"
ac_path_EGREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
 
$ac_path_EGREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_EGREP"; then
{ { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
{ (exit 1); exit 1; }; }
fi
else
ac_cv_path_EGREP=$EGREP
fi
 
fi
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
$as_echo "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
 
 
{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5
$as_echo_n "checking for fgrep... " >&6; }
if test "${ac_cv_path_FGREP+set}" = set; then
$as_echo_n "(cached) " >&6
else
if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
then ac_cv_path_FGREP="$GREP -F"
else
if test -z "$FGREP"; then
ac_path_FGREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in fgrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
{ test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
# Check for GNU ac_path_FGREP and select it if it is found.
# Check for GNU $ac_path_FGREP
case `"$ac_path_FGREP" --version 2>&1` in
*GNU*)
ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo 'FGREP' >> "conftest.nl"
"$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
ac_count=`expr $ac_count + 1`
if test $ac_count -gt ${ac_path_FGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_FGREP="$ac_path_FGREP"
ac_path_FGREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
 
$ac_path_FGREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_FGREP"; then
{ { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
{ (exit 1); exit 1; }; }
fi
else
ac_cv_path_FGREP=$FGREP
fi
 
fi
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
$as_echo "$ac_cv_path_FGREP" >&6; }
FGREP="$ac_cv_path_FGREP"
 
 
test -z "$GREP" && GREP=grep
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
# Check whether --with-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
else
with_gnu_ld=no
fi
 
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
{ $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
$as_echo_n "checking for ld used by $CC... " >&6; }
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[\\/]* | ?:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
# Canonicalize the pathname of ld
ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
{ $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
$as_echo_n "checking for GNU ld... " >&6; }
else
{ $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
$as_echo_n "checking for non-GNU ld... " >&6; }
fi
if test "${lt_cv_path_LD+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -z "$LD"; then
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break
;;
*)
test "$with_gnu_ld" != yes && break
;;
esac
fi
done
IFS="$lt_save_ifs"
else
lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi
 
LD="$lt_cv_path_LD"
if test -n "$LD"; then
{ $as_echo "$as_me:$LINENO: result: $LD" >&5
$as_echo "$LD" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
{ (exit 1); exit 1; }; }
{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
if test "${lt_cv_prog_gnu_ld+set}" = set; then
$as_echo_n "(cached) " >&6
else
# I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
lt_cv_prog_gnu_ld=yes
;;
*)
lt_cv_prog_gnu_ld=no
;;
esac
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
$as_echo "$lt_cv_prog_gnu_ld" >&6; }
with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
 
 
 
 
 
 
 
{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5
$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
if test "${lt_cv_path_NM+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$NM"; then
# Let the user override the test.
lt_cv_path_NM="$NM"
else
lt_nm_to_check="${ac_tool_prefix}nm"
if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
lt_nm_to_check="$lt_nm_to_check nm"
fi
for lt_tmp_nm in $lt_nm_to_check; do
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
tmp_nm="$ac_dir/$lt_tmp_nm"
if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
*/dev/null* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break
;;
*)
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break
;;
*)
lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
;;
esac
;;
esac
fi
done
IFS="$lt_save_ifs"
done
: ${lt_cv_path_NM=no}
fi
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
$as_echo "$lt_cv_path_NM" >&6; }
if test "$lt_cv_path_NM" != "no"; then
NM="$lt_cv_path_NM"
else
# Didn't find any BSD compatible name lister, look for dumpbin.
if test -n "$ac_tool_prefix"; then
for ac_prog in "dumpbin -symbols" "link -dump -symbols"
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_DUMPBIN+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$DUMPBIN"; then
ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
DUMPBIN=$ac_cv_prog_DUMPBIN
if test -n "$DUMPBIN"; then
{ $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5
$as_echo "$DUMPBIN" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
test -n "$DUMPBIN" && break
done
fi
if test -z "$DUMPBIN"; then
ac_ct_DUMPBIN=$DUMPBIN
for ac_prog in "dumpbin -symbols" "link -dump -symbols"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_DUMPBIN"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
if test -n "$ac_ct_DUMPBIN"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5
$as_echo "$ac_ct_DUMPBIN" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
test -n "$ac_ct_DUMPBIN" && break
done
 
if test "x$ac_ct_DUMPBIN" = x; then
DUMPBIN=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DUMPBIN=$ac_ct_DUMPBIN
fi
fi
 
 
if test "$DUMPBIN" != ":"; then
NM="$DUMPBIN"
fi
fi
test -z "$NM" && NM=nm
 
 
 
 
 
 
{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5
$as_echo_n "checking the name lister ($NM) interface... " >&6; }
if test "${lt_cv_nm_interface+set}" = set; then
$as_echo_n "(cached) " >&6
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:4404: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
(eval echo "\"\$as_me:4407: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
(eval echo "\"\$as_me:4410: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
fi
rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5
$as_echo "$lt_cv_nm_interface" >&6; }
 
{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
$as_echo_n "checking whether ln -s works... " >&6; }
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; then
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
$as_echo "no, using $LN_S" >&6; }
fi
 
# find the maximum length of command line arguments
{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
$as_echo_n "checking the maximum length of command line arguments... " >&6; }
if test "${lt_cv_sys_max_cmd_len+set}" = set; then
$as_echo_n "(cached) " >&6
else
i=0
teststring="ABCD"
 
case $build_os in
msdosdjgpp*)
# On DJGPP, this test can blow up pretty badly due to problems in libc
# (any single argument exceeding 2000 bytes causes a buffer overrun
# during glob expansion). Even if it were fixed, the result of this
# check would be larger than it should be.
lt_cv_sys_max_cmd_len=12288; # 12K is about right
;;
 
gnu*)
# Under GNU Hurd, this test is not required because there is
# no limit to the length of command line arguments.
# Libtool will interpret -1 as no limit whatsoever
lt_cv_sys_max_cmd_len=-1;
;;
 
cygwin* | mingw* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
# you end up with a "frozen" computer, even though with patience
# the test eventually succeeds (with a max line length of 256k).
# Instead, let's just punt: use the minimum linelength reported by
# all of the supported platforms: 8192 (on NT/2K/XP).
lt_cv_sys_max_cmd_len=8192;
;;
 
amigaos*)
# On AmigaOS with pdksh, this test takes hours, literally.
# So we just punt and use a minimum line length of 8192.
lt_cv_sys_max_cmd_len=8192;
;;
 
netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
elif test -x /usr/sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
else
lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
fi
# And add a safety zone
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
;;
 
interix*)
# We know the value 262144 and hardcode it with a safety zone (like BSD)
lt_cv_sys_max_cmd_len=196608
;;
 
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
# nice to cause kernel panics so lets avoid the loop below.
# First set a reasonable default.
lt_cv_sys_max_cmd_len=16384
#
if test -x /sbin/sysconfig; then
case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
*1*) lt_cv_sys_max_cmd_len=-1 ;;
esac
fi
;;
sco3.2v5*)
lt_cv_sys_max_cmd_len=102400
;;
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
if test -n "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
# Make teststring a little bigger before we do anything with it.
# a 1K string should be a reasonable start.
for i in 1 2 3 4 5 6 7 8 ; do
teststring=$teststring$teststring
done
SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
= "XX$teststring$teststring"; } >/dev/null 2>&1 &&
test $i != 17 # 1/2 MB should be enough
do
i=`expr $i + 1`
teststring=$teststring$teststring
done
# Only check the string length outside the loop.
lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
teststring=
# Add a significant safety factor because C++ compilers can tack on
# massive amounts of additional arguments before passing them to the
# linker. It appears as though 1/2 is a usable value.
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
fi
;;
esac
 
fi
 
if test -n $lt_cv_sys_max_cmd_len ; then
{ $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: none" >&5
$as_echo "none" >&6; }
fi
max_cmd_len=$lt_cv_sys_max_cmd_len
 
 
 
 
 
 
: ${CP="cp -f"}
: ${MV="mv -f"}
: ${RM="rm -f"}
 
{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5
$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
# Try some XSI features
xsi_shell=no
( _lt_dummy="a/b/c"
test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
= c,a/b,, \
&& eval 'test $(( 1 + 1 )) -eq 2 \
&& test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
&& xsi_shell=yes
{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5
$as_echo "$xsi_shell" >&6; }
 
 
{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5
$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
lt_shell_append=no
( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
>/dev/null 2>&1 \
&& lt_shell_append=yes
{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5
$as_echo "$lt_shell_append" >&6; }
 
 
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
lt_unset=unset
else
lt_unset=false
fi
 
 
 
 
 
# test EBCDIC or ASCII
case `echo X|tr X '\101'` in
A) # ASCII based system
# \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
lt_SP2NL='tr \040 \012'
lt_NL2SP='tr \015\012 \040\040'
;;
*) # EBCDIC based system
lt_SP2NL='tr \100 \n'
lt_NL2SP='tr \r\n \100\100'
;;
esac
 
 
 
 
 
 
 
 
 
{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
$as_echo_n "checking for $LD option to reload object files... " >&6; }
if test "${lt_cv_ld_reload_flag+set}" = set; then
$as_echo_n "(cached) " >&6
else
lt_cv_ld_reload_flag='-r'
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
$as_echo "$lt_cv_ld_reload_flag" >&6; }
reload_flag=$lt_cv_ld_reload_flag
case $reload_flag in
"" | " "*) ;;
*) reload_flag=" $reload_flag" ;;
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
darwin*)
if test "$GCC" = yes; then
reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
else
reload_cmds='$LD$reload_flag -o $output$reload_objs'
fi
;;
esac
 
 
 
 
 
 
 
 
 
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ac_tool_prefix}objdump; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_OBJDUMP+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$OBJDUMP"; then
ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
OBJDUMP=$ac_cv_prog_OBJDUMP
if test -n "$OBJDUMP"; then
{ $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5
$as_echo "$OBJDUMP" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$ac_cv_prog_OBJDUMP"; then
ac_ct_OBJDUMP=$OBJDUMP
# Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OBJDUMP"; then
ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
if test -n "$ac_ct_OBJDUMP"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
$as_echo "$ac_ct_OBJDUMP" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
if test "x$ac_ct_OBJDUMP" = x; then
OBJDUMP="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OBJDUMP=$ac_ct_OBJDUMP
fi
else
OBJDUMP="$ac_cv_prog_OBJDUMP"
fi
 
test -z "$OBJDUMP" && OBJDUMP=objdump
 
 
 
 
 
 
 
 
 
{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
$as_echo_n "checking how to recognize dependent libraries... " >&6; }
if test "${lt_cv_deplibs_check_method+set}" = set; then
$as_echo_n "(cached) " >&6
else
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_deplibs_check_method='unknown'
# Need to set the preceding variable on all platforms that support
# interlibrary dependencies.
# 'none' -- dependencies not supported.
# `unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
# which responds to the $file_magic_cmd with a given extended regex.
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.
 
case $host_os in
aix[4-9]*)
lt_cv_deplibs_check_method=pass_all
;;
 
beos*)
lt_cv_deplibs_check_method=pass_all
;;
 
bsdi[45]*)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
 
cygwin*)
# func_win32_libid is a shell function defined in ltmain.sh
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_file_magic_cmd='func_win32_libid'
;;
 
mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
if ( file / ) >/dev/null 2>&1; then
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_file_magic_cmd='func_win32_libid'
else
lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
 
cegcc)
# use the weaker test based on 'objdump'. See mingw*.
lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
 
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
 
freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
else
lt_cv_deplibs_check_method=pass_all
fi
;;
 
gnu*)
lt_cv_deplibs_check_method=pass_all
;;
 
hpux10.20* | hpux11*)
lt_cv_file_magic_cmd=/usr/bin/file
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
;;
hppa*64*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
;;
*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
esac
;;
 
interix[3-9]*)
# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
;;
 
irix5* | irix6* | nonstopux*)
case $LD in
*-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;;
esac
lt_cv_deplibs_check_method=pass_all
;;
 
# This must be Linux ELF.
linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
 
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
fi
;;
 
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
 
*nto* | *qnx*)
lt_cv_deplibs_check_method=pass_all
;;
 
openbsd*)
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
fi
;;
 
osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
 
rdos*)
lt_cv_deplibs_check_method=pass_all
;;
 
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
 
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
lt_cv_deplibs_check_method=pass_all
;;
 
sysv4 | sysv4.3*)
case $host_vendor in
motorola)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
;;
ncr)
lt_cv_deplibs_check_method=pass_all
;;
sequent)
lt_cv_file_magic_cmd='/bin/file'
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
;;
sni)
lt_cv_file_magic_cmd='/bin/file'
lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
lt_cv_file_magic_test_file=/lib/libc.so
;;
siemens)
lt_cv_deplibs_check_method=pass_all
;;
pc)
lt_cv_deplibs_check_method=pass_all
;;
esac
;;
 
tpf*)
lt_cv_deplibs_check_method=pass_all
;;
esac
 
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
$as_echo "$lt_cv_deplibs_check_method" >&6; }
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
 
 
 
 
 
 
 
 
 
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_AR+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$AR"; then
ac_cv_prog_AR="$AR" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AR="${ac_tool_prefix}ar"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
AR=$ac_cv_prog_AR
if test -n "$AR"; then
{ $as_echo "$as_me:$LINENO: result: $AR" >&5
$as_echo "$AR" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$ac_cv_prog_AR"; then
ac_ct_AR=$AR
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_AR"; then
ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_AR="ar"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_AR=$ac_cv_prog_ac_ct_AR
if test -n "$ac_ct_AR"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
$as_echo "$ac_ct_AR" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
if test "x$ac_ct_AR" = x; then
AR="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
AR=$ac_ct_AR
fi
else
AR="$ac_cv_prog_AR"
fi
 
test -z "$AR" && AR=ar
test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
 
 
 
 
 
 
 
 
 
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_STRIP+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
{ $as_echo "$as_me:$LINENO: result: $STRIP" >&5
$as_echo "$STRIP" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
$as_echo "$ac_ct_STRIP" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
if test "x$ac_ct_STRIP" = x; then
STRIP=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
fi
else
STRIP="$ac_cv_prog_STRIP"
fi
 
test -z "$STRIP" && STRIP=:
 
 
 
 
 
 
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_RANLIB+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
{ $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
$as_echo "$RANLIB" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_RANLIB"; then
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
$as_echo "$ac_ct_RANLIB" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
if test "x$ac_ct_RANLIB" = x; then
RANLIB=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
RANLIB=$ac_ct_RANLIB
fi
else
RANLIB="$ac_cv_prog_RANLIB"
fi
 
test -z "$RANLIB" && RANLIB=:
 
 
 
 
 
 
# Determine commands to create old-style static archives.
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
 
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
;;
*)
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
;;
esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
 
# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
# Allow CC to be a program name with arguments.
compiler=$CC
 
 
# Check for command to grab the raw symbol name followed by C symbol from nm.
{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
$as_echo_n "(cached) " >&6
else
 
# These are sane defaults that work on at least a few old systems.
# [They come from Ultrix. What could be older than Ultrix?!! ;)]
 
# Character class describing NM global symbol codes.
symcode='[BCDEGRST]'
 
# Regexp to match symbols that can be accessed directly from C.
sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
 
# Define system-specific variables.
case $host_os in
aix*)
symcode='[BCDT]'
;;
cygwin* | mingw* | pw32* | cegcc*)
symcode='[ABCDGISTW]'
;;
hpux*)
if test "$host_cpu" = ia64; then
symcode='[ABCDEGRST]'
fi
;;
irix* | nonstopux*)
symcode='[BCDEGRST]'
;;
osf*)
symcode='[BCDEGQRST]'
;;
solaris*)
symcode='[BDRT]'
;;
sco3.2v5*)
symcode='[DT]'
;;
sysv4.2uw2*)
symcode='[DT]'
;;
sysv5* | sco5v6* | unixware* | OpenUNIX*)
symcode='[ABDT]'
;;
sysv4)
symcode='[DFNSTU]'
;;
esac
 
# If we're using GNU nm, then use its standard symbol codes.
case `$NM -V 2>&1` in
*GNU* | *'with BFD'*)
symcode='[ABCDGIRSTW]' ;;
esac
 
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
# Transform an extracted symbol line into symbol name and symbol address
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
 
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
mingw*)
opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
 
# Try without a prefix underscore, then with it.
for ac_symprfx in "" "_"; do
 
# Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
symxfrm="\\1 $ac_symprfx\\2 \\2"
 
# Write the raw and C identifiers.
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function
# and D for any global variable.
# Also find C++ and __fastcall symbols from MSVC++,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\
" {last_section=section; section=\$ 3};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
" \$ 0!~/External *\|/{next};"\
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
" {if(hide[section]) next};"\
" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
" s[1]~/^[@?]/{print s[1], s[1]; next};"\
" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx"
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
 
# Check to see that the pipe works correctly.
pipe_works=no
 
rm -f conftest*
cat > conftest.$ac_ext <<_LT_EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
void nm_test_func(void);
void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func();return(0);}
_LT_EOF
 
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
# Now try to grab the symbols.
nlist=conftest.nm
if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
(eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
else
rm -f "$nlist"T
fi
 
# Make sure that we snagged all the symbols we need.
if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
#ifdef __cplusplus
extern "C" {
#endif
 
_LT_EOF
# Now generate the symbol file.
eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
 
cat <<_LT_EOF >> conftest.$ac_ext
 
/* The mapping between symbol names and symbols. */
const struct {
const char *name;
void *address;
}
lt__PROGRAM__LTX_preloaded_symbols[] =
{
{ "@PROGRAM@", (void *) 0 },
_LT_EOF
$SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
cat <<\_LT_EOF >> conftest.$ac_ext
{0, (void *) 0}
};
 
/* This works around a problem in FreeBSD linker */
#ifdef FREEBSD_WORKAROUND
static const void *lt_preloaded_setup() {
return lt__PROGRAM__LTX_preloaded_symbols;
}
#endif
 
#ifdef __cplusplus
}
#endif
_LT_EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
lt_save_LIBS="$LIBS"
lt_save_CFLAGS="$CFLAGS"
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
LIBS="$lt_save_LIBS"
CFLAGS="$lt_save_CFLAGS"
else
echo "cannot find nm_test_func in $nlist" >&5
fi
else
echo "cannot find nm_test_var in $nlist" >&5
fi
else
echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
fi
else
echo "$progname: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -rf conftest* conftst*
 
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
break
else
lt_cv_sys_global_symbol_pipe=
fi
done
 
fi
 
if test -z "$lt_cv_sys_global_symbol_pipe"; then
lt_cv_sys_global_symbol_to_cdecl=
fi
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
{ $as_echo "$as_me:$LINENO: result: failed" >&5
$as_echo "failed" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: ok" >&5
$as_echo "ok" >&6; }
fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
# Check whether --enable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then
enableval=$enable_libtool_lock;
fi
 
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
case `/usr/bin/file conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE="32"
;;
*ELF-64*)
HPUX_IA64_MODE="64"
;;
esac
fi
rm -rf conftest*
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 5616 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
if test "$lt_cv_prog_gnu_ld" = yes; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
;;
*N32*)
LD="${LD-ld} -melf32bmipn32"
;;
*64-bit*)
LD="${LD-ld} -melf64bmip"
;;
esac
else
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
*N32*)
LD="${LD-ld} -n32"
;;
*64-bit*)
LD="${LD-ld} -64"
;;
esac
fi
fi
rm -rf conftest*
;;
 
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
case `/usr/bin/file conftest.o` in
*32-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
LD="${LD-ld} -m elf_s390"
;;
sparc64-*linux*)
LD="${LD-ld} -m elf32_sparc"
;;
esac
;;
*64-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
ppc*-*linux*|powerpc*-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
LD="${LD-ld} -m elf64_s390"
;;
sparc*-*linux*)
LD="${LD-ld} -m elf64_sparc"
;;
esac
;;
esac
fi
rm -rf conftest*
;;
 
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
{ $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
if test "${lt_cv_cc_needs_belf+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
lt_cv_cc_needs_belf=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
lt_cv_cc_needs_belf=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
$as_echo "$lt_cv_cc_needs_belf" >&6; }
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
fi
;;
sparc*-*solaris*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
case `/usr/bin/file conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*) LD="${LD-ld} -m elf64_sparc" ;;
*)
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
LD="${LD-ld} -64"
fi
;;
esac
;;
esac
fi
rm -rf conftest*
;;
esac
 
need_locks="$enable_libtool_lock"
 
 
case $host_os in
rhapsody* | darwin*)
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$DSYMUTIL"; then
ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
DSYMUTIL=$ac_cv_prog_DSYMUTIL
if test -n "$DSYMUTIL"; then
{ $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
$as_echo "$DSYMUTIL" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$ac_cv_prog_DSYMUTIL"; then
ac_ct_DSYMUTIL=$DSYMUTIL
# Extract the first word of "dsymutil", so it can be a program name with args.
set dummy dsymutil; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_DSYMUTIL"; then
ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
if test -n "$ac_ct_DSYMUTIL"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
$as_echo "$ac_ct_DSYMUTIL" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
if test "x$ac_ct_DSYMUTIL" = x; then
DSYMUTIL=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DSYMUTIL=$ac_ct_DSYMUTIL
fi
else
DSYMUTIL="$ac_cv_prog_DSYMUTIL"
fi
 
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
set dummy ${ac_tool_prefix}nmedit; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_NMEDIT+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$NMEDIT"; then
ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
NMEDIT=$ac_cv_prog_NMEDIT
if test -n "$NMEDIT"; then
{ $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5
$as_echo "$NMEDIT" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$ac_cv_prog_NMEDIT"; then
ac_ct_NMEDIT=$NMEDIT
# Extract the first word of "nmedit", so it can be a program name with args.
set dummy nmedit; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_NMEDIT"; then
ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_NMEDIT="nmedit"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
if test -n "$ac_ct_NMEDIT"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
$as_echo "$ac_ct_NMEDIT" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
if test "x$ac_ct_NMEDIT" = x; then
NMEDIT=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
NMEDIT=$ac_ct_NMEDIT
fi
else
NMEDIT="$ac_cv_prog_NMEDIT"
fi
 
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
set dummy ${ac_tool_prefix}lipo; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_LIPO+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$LIPO"; then
ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
LIPO=$ac_cv_prog_LIPO
if test -n "$LIPO"; then
{ $as_echo "$as_me:$LINENO: result: $LIPO" >&5
$as_echo "$LIPO" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$ac_cv_prog_LIPO"; then
ac_ct_LIPO=$LIPO
# Extract the first word of "lipo", so it can be a program name with args.
set dummy lipo; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_LIPO"; then
ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_LIPO="lipo"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
if test -n "$ac_ct_LIPO"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5
$as_echo "$ac_ct_LIPO" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
if test "x$ac_ct_LIPO" = x; then
LIPO=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
LIPO=$ac_ct_LIPO
fi
else
LIPO="$ac_cv_prog_LIPO"
fi
 
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
set dummy ${ac_tool_prefix}otool; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_OTOOL+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$OTOOL"; then
ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
OTOOL=$ac_cv_prog_OTOOL
if test -n "$OTOOL"; then
{ $as_echo "$as_me:$LINENO: result: $OTOOL" >&5
$as_echo "$OTOOL" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$ac_cv_prog_OTOOL"; then
ac_ct_OTOOL=$OTOOL
# Extract the first word of "otool", so it can be a program name with args.
set dummy otool; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OTOOL"; then
ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_OTOOL="otool"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
if test -n "$ac_ct_OTOOL"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5
$as_echo "$ac_ct_OTOOL" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
if test "x$ac_ct_OTOOL" = x; then
OTOOL=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OTOOL=$ac_ct_OTOOL
fi
else
OTOOL="$ac_cv_prog_OTOOL"
fi
 
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
set dummy ${ac_tool_prefix}otool64; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_OTOOL64+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$OTOOL64"; then
ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
OTOOL64=$ac_cv_prog_OTOOL64
if test -n "$OTOOL64"; then
{ $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5
$as_echo "$OTOOL64" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
fi
if test -z "$ac_cv_prog_OTOOL64"; then
ac_ct_OTOOL64=$OTOOL64
# Extract the first word of "otool64", so it can be a program name with args.
set dummy otool64; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OTOOL64"; then
ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_OTOOL64="otool64"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
 
fi
fi
ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
if test -n "$ac_ct_OTOOL64"; then
{ $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5
$as_echo "$ac_ct_OTOOL64" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
if test "x$ac_ct_OTOOL64" = x; then
OTOOL64=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OTOOL64=$ac_ct_OTOOL64
fi
else
OTOOL64="$ac_cv_prog_OTOOL64"
fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{ $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
$as_echo_n "checking for -single_module linker flag... " >&6; }
if test "${lt_cv_apple_cc_single_mod+set}" = set; then
$as_echo_n "(cached) " >&6
else
lt_cv_apple_cc_single_mod=no
if test -z "${LT_MULTI_MODULE}"; then
# By default we will add the -single_module flag. You can override
# by either setting the environment variable LT_MULTI_MODULE
# non-empty at configure time, or by adding -multi_module to the
# link flags.
rm -rf libconftest.dylib*
echo "int foo(void){return 1;}" > conftest.c
echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c" >&5
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
_lt_result=$?
if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&5
fi
rm -rf libconftest.dylib*
rm -f conftest.*
fi
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
{ $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
$as_echo_n "(cached) " >&6
else
lt_cv_ld_exported_symbols_list=no
save_LDFLAGS=$LDFLAGS
echo "_main" > conftest.sym
LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
lt_cv_ld_exported_symbols_list=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
lt_cv_ld_exported_symbols_list=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS="$save_LDFLAGS"
 
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
case $host_os in
rhapsody* | darwin1.[012])
_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
darwin*) # darwin 5.x on
# if running on 10.5 or later, the deployment target defaults
# to the OS version, if on x86, and 10.4, the deployment
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[91]*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10.[012]*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10.*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
if test "$lt_cv_apple_cc_single_mod" = "yes"; then
_lt_dar_single_mod='$single_module'
fi
if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
_lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
else
_lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
fi
if test "$DSYMUTIL" != ":"; then
_lt_dsymutil='~$DSYMUTIL $lib || :'
else
_lt_dsymutil=
fi
;;
esac
 
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if test "${ac_cv_prog_CPP+set}" = set; then
$as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
do
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
Syntax error
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
# Broken: fails on valid input.
continue
fi
 
rm -f conftest.err conftest.$ac_ext
 
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
# Broken: success on invalid input.
continue
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
# Passes both tests.
ac_preproc_ok=:
break
fi
 
rm -f conftest.err conftest.$ac_ext
 
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
break
fi
 
done
ac_cv_prog_CPP=$CPP
 
fi
CPP=$ac_cv_prog_CPP
else
ac_cv_prog_CPP=$CPP
fi
{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
$as_echo "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
Syntax error
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
# Broken: fails on valid input.
continue
fi
 
rm -f conftest.err conftest.$ac_ext
 
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
# Broken: success on invalid input.
continue
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
# Passes both tests.
ac_preproc_ok=:
break
fi
 
rm -f conftest.err conftest.$ac_ext
 
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
:
else
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details." >&5
$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }; }
fi
 
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if test "${ac_cv_header_stdc+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
 
int
main ()
{
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_header_stdc=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_header_stdc=no
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <string.h>
 
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "memchr" >/dev/null 2>&1; then
:
else
ac_cv_header_stdc=no
fi
rm -f conftest*
 
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 <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdlib.h>
 
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "free" >/dev/null 2>&1; then
:
else
ac_cv_header_stdc=no
fi
rm -f conftest*
 
fi
 
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
:
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ctype.h>
#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
(('a' <= (c) && (c) <= 'i') \
|| ('j' <= (c) && (c) <= 'r') \
|| ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
 
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
int i;
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
return 2;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
( exit $ac_status )
ac_cv_header_stdc=no
fi
rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
 
 
fi
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
 
cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
_ACEOF
 
fi
 
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
 
 
 
 
 
 
 
 
 
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
inttypes.h stdint.h unistd.h
do
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
 
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
eval "$as_ac_Header=yes"
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
eval "$as_ac_Header=no"
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
ac_res=`eval 'as_val=${'$as_ac_Header'}
$as_echo "$as_val"'`
{ $as_echo "$as_me:$LINENO: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
as_val=`eval 'as_val=${'$as_ac_Header'}
$as_echo "$as_val"'`
if test "x$as_val" = x""yes; then
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
 
fi
 
done
 
 
 
for ac_header in dlfcn.h
do
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
 
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
eval "$as_ac_Header=yes"
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
eval "$as_ac_Header=no"
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
ac_res=`eval 'as_val=${'$as_ac_Header'}
$as_echo "$as_val"'`
{ $as_echo "$as_me:$LINENO: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
as_val=`eval 'as_val=${'$as_ac_Header'}
$as_echo "$as_val"'`
if test "x$as_val" = x""yes; then
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
 
fi
 
done
 
 
 
# Set options
 
 
 
enable_dlopen=no
 
 
enable_win32_dll=no
 
 
# Check whether --enable-shared was given.
if test "${enable_shared+set}" = set; then
enableval=$enable_shared; p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac
else
enable_shared=yes
fi
 
 
 
 
 
 
 
 
 
# Check whether --enable-static was given.
if test "${enable_static+set}" = set; then
enableval=$enable_static; p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac
else
enable_static=yes
fi
 
 
 
 
 
 
 
 
 
 
# Check whether --with-pic was given.
if test "${with_pic+set}" = set; then
withval=$with_pic; pic_mode="$withval"
else
pic_mode=default
fi
 
 
test -z "$pic_mode" && pic_mode=default
 
 
 
 
 
 
 
# Check whether --enable-fast-install was given.
if test "${enable_fast_install+set}" = set; then
enableval=$enable_fast_install; p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac
else
enable_fast_install=yes
fi
 
 
 
 
 
 
 
 
 
 
 
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ltmain"
 
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test -z "$LN_S" && LN_S="ln -s"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
 
{ $as_echo "$as_me:$LINENO: checking for objdir" >&5
$as_echo_n "checking for objdir... " >&6; }
if test "${lt_cv_objdir+set}" = set; then
$as_echo_n "(cached) " >&6
else
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
lt_cv_objdir=.libs
else
# MS-DOS does not allow filenames that begin with a dot.
lt_cv_objdir=_libs
fi
rmdir .libs 2>/dev/null
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
$as_echo "$lt_cv_objdir" >&6; }
objdir=$lt_cv_objdir
 
 
 
 
 
cat >>confdefs.h <<_ACEOF
#define LT_OBJDIR "$lt_cv_objdir/"
_ACEOF
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
case $host_os in
aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
;;
esac
 
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
 
# Same as above, but do not quote variable references.
double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
 
# Sed substitution to delay expansion of an escaped single quote.
delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
 
# Sed substitution to avoid accidental globbing in evaled expressions
no_glob_subst='s/\*/\\\*/g'
 
# Global variables:
ofile=libtool
can_build_shared=yes
 
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
 
with_gnu_ld="$lt_cv_prog_gnu_ld"
 
old_CC="$CC"
old_CFLAGS="$CFLAGS"
 
# Set sane defaults for various variables
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
test -z "$LD" && LD=ld
test -z "$ac_objext" && ac_objext=o
 
for cc_temp in $compiler""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
 
# Only perform the check for file, if the check method requires it
test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
{ $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
$as_echo_n "(cached) " >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
*)
lt_save_MAGIC_CMD="$MAGIC_CMD"
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
for ac_dir in $ac_dummy; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/${ac_tool_prefix}file; then
lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then
:
else
cat <<_LT_EOF 1>&2
 
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such. This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem. Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
 
_LT_EOF
fi ;;
esac
fi
break
fi
done
IFS="$lt_save_ifs"
MAGIC_CMD="$lt_save_MAGIC_CMD"
;;
esac
fi
 
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
{ $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
 
 
 
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
{ $as_echo "$as_me:$LINENO: checking for file" >&5
$as_echo_n "checking for file... " >&6; }
if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
$as_echo_n "(cached) " >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
*)
lt_save_MAGIC_CMD="$MAGIC_CMD"
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
for ac_dir in $ac_dummy; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/file; then
lt_cv_path_MAGIC_CMD="$ac_dir/file"
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then
:
else
cat <<_LT_EOF 1>&2
 
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such. This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem. Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
 
_LT_EOF
fi ;;
esac
fi
break
fi
done
IFS="$lt_save_ifs"
MAGIC_CMD="$lt_save_MAGIC_CMD"
;;
esac
fi
 
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
{ $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
 
else
MAGIC_CMD=:
fi
fi
 
fi
;;
esac
 
# Use C for the default configuration in the libtool script
 
lt_save_CC="$CC"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
# Source file extension for C test sources.
ac_ext=c
 
# Object file extension for compiled C test sources.
objext=o
objext=$objext
 
# Code to be used in simple compile tests
lt_simple_compile_test_code="int some_variable = 0;"
 
# Code to be used in simple link tests
lt_simple_link_test_code='int main(){return(0);}'
 
 
 
 
 
 
 
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
 
# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
# Allow CC to be a program name with arguments.
compiler=$CC
 
# Save the default compiler, since it gets overwritten when the other
# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
compiler_DEFAULT=$CC
 
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$RM conftest*
 
ac_outfile=conftest.$ac_objext
echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$RM -r conftest*
 
 
if test -n "$compiler"; then
 
lt_prog_compiler_no_builtin_flag=
 
if test "$GCC" = yes; then
lt_prog_compiler_no_builtin_flag=' -fno-builtin'
 
{ $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
# The option is referenced via a variable to avoid confusing sed.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7469: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7473: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_rtti_exceptions=yes
fi
fi
$RM conftest*
 
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
else
:
fi
 
fi
 
 
 
 
 
 
lt_prog_compiler_wl=
lt_prog_compiler_pic=
lt_prog_compiler_static=
 
{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 
if test "$GCC" = yes; then
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_static='-static'
 
case $host_os in
aix*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
lt_prog_compiler_static='-Bstatic'
fi
;;
 
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
lt_prog_compiler_pic='-fPIC'
;;
m68k)
# FIXME: we need at least 68020 code to build shared libraries, but
# adding the `-m68020' flag to GCC prevents building anything better,
# like `-m68040'.
lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
;;
esac
;;
 
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
 
mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
# (--disable-auto-import) libraries
lt_prog_compiler_pic='-DDLL_EXPORT'
;;
 
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
lt_prog_compiler_pic='-fno-common'
;;
 
hpux*)
# PIC is the default for 64-bit PA HP-UX, but not for 32-bit
# PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
# sets the default TLS model and affects inlining.
case $host_cpu in
hppa*64*)
# +Z the default
;;
*)
lt_prog_compiler_pic='-fPIC'
;;
esac
;;
 
interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
 
msdosdjgpp*)
# Just because we use GCC doesn't mean we suddenly get shared libraries
# on systems that don't support them.
lt_prog_compiler_can_build_shared=no
enable_shared=no
;;
 
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
lt_prog_compiler_pic='-fPIC -shared'
;;
 
sysv4*MP*)
if test -d /usr/nec; then
lt_prog_compiler_pic=-Kconform_pic
fi
;;
 
*)
lt_prog_compiler_pic='-fPIC'
;;
esac
else
# PORTME Check for flag to pass linker flags through the system compiler.
case $host_os in
aix*)
lt_prog_compiler_wl='-Wl,'
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
lt_prog_compiler_static='-Bstatic'
else
lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
fi
;;
 
mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
;;
 
hpux9* | hpux10* | hpux11*)
lt_prog_compiler_wl='-Wl,'
# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
# not for PA HP-UX.
case $host_cpu in
hppa*64*|ia64*)
# +Z the default
;;
*)
lt_prog_compiler_pic='+Z'
;;
esac
# Is there a better lt_prog_compiler_static that works with the bundled CC?
lt_prog_compiler_static='${wl}-a ${wl}archive'
;;
 
irix5* | irix6* | nonstopux*)
lt_prog_compiler_wl='-Wl,'
# PIC (with -KPIC) is the default.
lt_prog_compiler_static='-non_shared'
;;
 
linux* | k*bsd*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fPIC'
lt_prog_compiler_static='-static'
;;
# Lahey Fortran 8.1.
lf95*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='--shared'
lt_prog_compiler_static='--static'
;;
pgcc* | pgf77* | pgf90* | pgf95*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fpic'
lt_prog_compiler_static='-Bstatic'
;;
ccc*)
lt_prog_compiler_wl='-Wl,'
# All Alpha code is PIC.
lt_prog_compiler_static='-non_shared'
;;
xl*)
# IBM XL C 8.0/Fortran 10.1 on PPC
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-qpic'
lt_prog_compiler_static='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
# Sun C 5.9
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl='-Wl,'
;;
*Sun\ F*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl=''
;;
esac
;;
esac
;;
 
newsos6)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
;;
 
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
lt_prog_compiler_pic='-fPIC -shared'
;;
 
osf3* | osf4* | osf5*)
lt_prog_compiler_wl='-Wl,'
# All OSF/1 code is PIC.
lt_prog_compiler_static='-non_shared'
;;
 
rdos*)
lt_prog_compiler_static='-non_shared'
;;
 
solaris*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
case $cc_basename in
f77* | f90* | f95*)
lt_prog_compiler_wl='-Qoption ld ';;
*)
lt_prog_compiler_wl='-Wl,';;
esac
;;
 
sunos4*)
lt_prog_compiler_wl='-Qoption ld '
lt_prog_compiler_pic='-PIC'
lt_prog_compiler_static='-Bstatic'
;;
 
sysv4 | sysv4.2uw2* | sysv4.3*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
;;
 
sysv4*MP*)
if test -d /usr/nec ;then
lt_prog_compiler_pic='-Kconform_pic'
lt_prog_compiler_static='-Bstatic'
fi
;;
 
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
;;
 
unicos*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_can_build_shared=no
;;
 
uts4*)
lt_prog_compiler_pic='-pic'
lt_prog_compiler_static='-Bstatic'
;;
 
*)
lt_prog_compiler_can_build_shared=no
;;
esac
fi
 
case $host_os in
# For platforms which do not support PIC, -DPIC is meaningless:
*djgpp*)
lt_prog_compiler_pic=
;;
*)
lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
;;
esac
{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
$as_echo "$lt_prog_compiler_pic" >&6; }
 
 
 
 
 
 
#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic"; then
{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_pic_works=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
# The option is referenced via a variable to avoid confusing sed.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7808: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7812: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_pic_works=yes
fi
fi
$RM conftest*
 
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
case $lt_prog_compiler_pic in
"" | " "*) ;;
*) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
esac
else
lt_prog_compiler_pic=
lt_prog_compiler_can_build_shared=no
fi
 
fi
 
 
 
 
 
 
#
# Check to make sure the static flag actually works.
#
wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
if test "${lt_cv_prog_compiler_static_works+set}" = set; then
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_static_works=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s conftest.err; then
# Append any errors to the config.log.
cat conftest.err 1>&5
$ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_static_works=yes
fi
else
lt_cv_prog_compiler_static_works=yes
fi
fi
$RM -r conftest*
LDFLAGS="$save_LDFLAGS"
 
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
if test x"$lt_cv_prog_compiler_static_works" = xyes; then
:
else
lt_prog_compiler_static=
fi
 
 
 
 
 
 
 
{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
if test "${lt_cv_prog_compiler_c_o+set}" = set; then
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_c_o=no
$RM -r conftest 2>/dev/null
mkdir conftest
cd conftest
mkdir out
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7913: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7917: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o=yes
fi
fi
chmod u+w . 2>&5
$RM conftest*
# SGI C++ compiler will create directory out/ii_files/ for
# template instantiation
test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
$RM out/* && rmdir out
cd ..
$RM -r conftest
$RM conftest*
 
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
 
 
 
 
 
{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
if test "${lt_cv_prog_compiler_c_o+set}" = set; then
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_c_o=no
$RM -r conftest 2>/dev/null
mkdir conftest
cd conftest
mkdir out
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7968: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7972: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o=yes
fi
fi
chmod u+w . 2>&5
$RM conftest*
# SGI C++ compiler will create directory out/ii_files/ for
# template instantiation
test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
$RM out/* && rmdir out
cd ..
$RM -r conftest
$RM conftest*
 
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
 
 
 
hard_links="nottested"
if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
# do not overwrite the value of need_locks provided by the user
{ $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
$as_echo_n "checking if we can lock with hard links... " >&6; }
hard_links=yes
$RM conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
{ $as_echo "$as_me:$LINENO: result: $hard_links" >&5
$as_echo "$hard_links" >&6; }
if test "$hard_links" = no; then
{ $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
need_locks=warn
fi
else
need_locks=no
fi
 
 
 
 
 
 
{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
 
runpath_var=
allow_undefined_flag=
always_export_symbols=no
archive_cmds=
archive_expsym_cmds=
compiler_needs_object=no
enable_shared_with_static_runtimes=no
export_dynamic_flag_spec=
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
hardcode_automatic=no
hardcode_direct=no
hardcode_direct_absolute=no
hardcode_libdir_flag_spec=
hardcode_libdir_flag_spec_ld=
hardcode_libdir_separator=
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
inherit_rpath=no
link_all_deplibs=unknown
module_cmds=
module_expsym_cmds=
old_archive_from_new_cmds=
old_archive_from_expsyms_cmds=
thread_safe_flag_spec=
whole_archive_flag_spec=
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
include_expsyms=
# exclude_expsyms can be an extended regexp of symbols to exclude
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
# Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
 
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
 
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# If archive_cmds runs LD, not CC, wlarc should be empty
wlarc='${wl}'
 
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
export_dynamic_flag_spec='${wl}--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
whole_archive_flag_spec=
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
*\ 2.11.*) ;; # other 2.11 versions
*) supports_anon_versioning=yes ;;
esac
 
# See if GNU ld supports shared libraries.
case $host_os in
aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
cat <<_LT_EOF 1>&2
 
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
*** to be unable to reliably create shared libraries on AIX.
*** Therefore, libtool is disabling shared libraries support. If you
*** really care for shared libraries, you may want to modify your PATH
*** so that a non-GNU linker is found, and then restart.
 
_LT_EOF
fi
;;
 
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds=''
;;
m68k)
archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
 
beos*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
allow_undefined_flag=unsupported
# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
else
ld_shlibs=no
fi
;;
 
cygwin* | mingw* | pw32* | cegcc*)
# _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
 
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
cp $export_symbols $output_objdir/$soname.def;
else
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
ld_shlibs=no
fi
;;
 
interix[3-9]*)
hardcode_direct=no
hardcode_shlibpath_var=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
export_dynamic_flag_spec='${wl}-E'
# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
# Instead, shared libraries are loaded at an image base (0x10000000 by
# default) and relocated if they conflict, which is a slow very memory
# consuming and fragmenting process. To avoid this, we pick a random,
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
 
gnu* | linux* | tpf* | k*bsd*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
esac
fi
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
&& test "$tmp_diet" = no
then
tmp_addflag=
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
tmp_addflag=' -i_dynamic -nofor_main' ;;
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
lf95*) # Lahey Fortran 8.1
whole_archive_flag_spec=
tmp_sharedflag='--shared' ;;
xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
compiler_needs_object=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
tmp_sharedflag='-G' ;;
esac
archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
if test "x$supports_anon_versioning" = xyes; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
 
case $cc_basename in
xlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
hardcode_libdir_flag_spec=
hardcode_libdir_flag_spec_ld='-rpath $libdir'
archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
;;
esac
else
ld_shlibs=no
fi
;;
 
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
 
solaris*)
if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
cat <<_LT_EOF 1>&2
 
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.9.1 or newer. Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
 
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
;;
 
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
cat <<_LT_EOF 1>&2
 
*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
*** reliably create shared libraries on SCO systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
 
_LT_EOF
;;
*)
# For security reasons, it is highly recommended that you always
# use absolute paths for naming shared libraries, and exclude the
# DT_RUNPATH tag from executables and libraries. But doing so
# requires that you compile everything twice, which is a pain.
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
;;
esac
;;
 
sunos4*)
archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
wlarc=
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
 
*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
;;
esac
 
if test "$ld_shlibs" = no; then
runpath_var=
hardcode_libdir_flag_spec=
export_dynamic_flag_spec=
whole_archive_flag_spec=
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
case $host_os in
aix3*)
allow_undefined_flag=unsupported
always_export_symbols=yes
archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
 
aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
exp_sym_flag='-Bexport'
no_entry_flag=""
else
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
 
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
 
exp_sym_flag='-bexport'
no_entry_flag='-bnoentry'
fi
 
# When large executables or shared objects are built, AIX ld can
# have problems creating the table of contents. If linking a library
# or program results in "error TOC overflow" add -mminimal-toc to
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
archive_cmds=''
hardcode_direct=yes
hardcode_direct_absolute=yes
hardcode_libdir_separator=':'
link_all_deplibs=yes
file_list_spec='${wl}-f,'
 
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
hardcode_direct=unsupported
# It fails to find uninstalled libraries when the uninstalled
# path is not listed in the libpath. Setting hardcode_minus_L
# to unsupported forces relinking
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
else
# not using gcc
if test "$host_cpu" = ia64; then
# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
fi
fi
fi
 
export_dynamic_flag_spec='${wl}-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
always_export_symbols=yes
if test "$aix_use_runtimelinking" = yes; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='-berok'
# Determine the default libpath from the value encoded in an
# empty executable.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
 
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
/^0/ {
s/^0 *\(.*\)$/\1/
p
}
}'
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag="-z nodefs"
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an
# empty executable.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
 
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
/^0/ {
s/^0 *\(.*\)$/\1/
p
}
}'
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
no_undefined_flag=' ${wl}-bernotok'
allow_undefined_flag=' ${wl}-berok'
# Exported symbols can be pulled into shared objects from archives
whole_archive_flag_spec='$convenience'
archive_cmds_need_lc=yes
# This is similar to how AIX traditionally builds its shared libraries.
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
 
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds=''
;;
m68k)
archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
 
bsdi[45]*)
export_dynamic_flag_spec=-rdynamic
;;
 
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=".dll"
# FIXME: Setting linknames here is a bad hack.
archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL.
old_archive_from_new_cmds='true'
# FIXME: Should let the user specify the lib program.
old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path='`cygpath -w "$srcfile"`'
enable_shared_with_static_runtimes=yes
;;
 
darwin* | rhapsody*)
 
 
archive_cmds_need_lc=no
hardcode_direct=no
hardcode_automatic=yes
hardcode_shlibpath_var=unsupported
whole_archive_flag_spec=''
link_all_deplibs=yes
allow_undefined_flag="$_lt_dar_allow_undefined"
case $cc_basename in
ifort*) _lt_dar_can_shared=yes ;;
*) _lt_dar_can_shared=$GCC ;;
esac
if test "$_lt_dar_can_shared" = "yes"; then
output_verbose_link_cmd=echo
archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
 
else
ld_shlibs=no
fi
 
;;
 
dgux*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_shlibpath_var=no
;;
 
freebsd1*)
ld_shlibs=no
;;
 
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
# extra space).
freebsd2.2*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
 
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
freebsd2*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_minus_L=yes
hardcode_shlibpath_var=no
;;
 
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly*)
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
 
hpux9*)
if test "$GCC" = yes; then
archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
 
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
export_dynamic_flag_spec='${wl}-E'
;;
 
hpux10*)
if test "$GCC" = yes -a "$with_gnu_ld" = no; then
archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_flag_spec_ld='+b $libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
hardcode_direct_absolute=yes
export_dynamic_flag_spec='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
 
hpux11*)
if test "$GCC" = yes -a "$with_gnu_ld" = no; then
case $host_cpu in
hppa*64*)
archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
hppa*64*)
archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
fi
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
 
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
hardcode_shlibpath_var=no
;;
*)
hardcode_direct=yes
hardcode_direct_absolute=yes
export_dynamic_flag_spec='${wl}-E'
 
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
 
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
cat >conftest.$ac_ext <<_ACEOF
int foo(void) {}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
 
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS="$save_LDFLAGS"
else
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
fi
archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
inherit_rpath=yes
link_all_deplibs=yes
;;
 
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
fi
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
 
newsos6)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_shlibpath_var=no
;;
 
*nto* | *qnx*)
;;
 
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
hardcode_shlibpath_var=no
hardcode_direct_absolute=yes
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
export_dynamic_flag_spec='${wl}-E'
else
case $host_os in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
else
ld_shlibs=no
fi
;;
 
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
allow_undefined_flag=unsupported
archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
;;
 
osf3*)
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
fi
archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
 
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
allow_undefined_flag=' -expect_unresolved \*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
 
# Both c and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
archive_cmds_need_lc='no'
hardcode_libdir_separator=:
;;
 
solaris*)
no_undefined_flag=' -z defs'
if test "$GCC" = yes; then
wlarc='${wl}'
archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
wlarc=''
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
;;
*)
wlarc='${wl}'
archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
;;
esac
fi
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
# The compiler driver will combine and reorder linker options,
# but understands `-z linker_flag'. GCC discards it without `$wl',
# but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
if test "$GCC" = yes; then
whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
else
whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
fi
;;
esac
link_all_deplibs=yes
;;
 
sunos4*)
if test "x$host_vendor" = xsequent; then
# Use $CC to link under sequent, because it throws in some extra .o
# files that make .init and .fini sections work.
archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
fi
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
hardcode_shlibpath_var=no
;;
 
sysv4)
case $host_vendor in
sni)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes # is this really true???
;;
siemens)
## LD is ld it makes a PLAMLIB
## CC just makes a GrossModule.
archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
reload_cmds='$CC -r -o $output$reload_objs'
hardcode_direct=no
;;
motorola)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
runpath_var='LD_RUN_PATH'
hardcode_shlibpath_var=no
;;
 
sysv4.3*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_shlibpath_var=no
export_dynamic_flag_spec='-Bexport'
;;
 
sysv4*MP*)
if test -d /usr/nec; then
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_shlibpath_var=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
ld_shlibs=yes
fi
;;
 
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag='${wl}-z,text'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
runpath_var='LD_RUN_PATH'
 
if test "$GCC" = yes; then
archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
 
sysv5* | sco3.2v5* | sco5v6*)
# Note: We can NOT use -z defs as we might desire, because we do not
# link with -lc, and that would cause any symbols used from libc to
# always be unresolved, which means just about no library would
# ever link correctly. If we're not using GNU ld we use -z text
# though, which does catch some bad symbols but isn't as heavy-handed
# as -z defs.
no_undefined_flag='${wl}-z,text'
allow_undefined_flag='${wl}-z,nodefs'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
hardcode_libdir_flag_spec='${wl}-R,$libdir'
hardcode_libdir_separator=':'
link_all_deplibs=yes
export_dynamic_flag_spec='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
 
if test "$GCC" = yes; then
archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
 
uts4*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_shlibpath_var=no
;;
 
*)
ld_shlibs=no
;;
esac
 
if test x$host_vendor = xsni; then
case $host in
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
export_dynamic_flag_spec='${wl}-Blargedynsym'
;;
esac
fi
fi
 
{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5
$as_echo "$ld_shlibs" >&6; }
test "$ld_shlibs" = no && can_build_shared=no
 
with_gnu_ld=$with_gnu_ld
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#
# Do we need to explicitly link libc?
#
case "x$archive_cmds_need_lc" in
x|xyes)
# Assume -lc should be added
archive_cmds_need_lc=yes
 
if test "$enable_shared" = yes && test "$GCC" = yes; then
case $archive_cmds in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
;;
'$CC '*)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
{ $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
$RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } 2>conftest.err; then
soname=conftest
lib=conftest
libobjs=conftest.$ac_objext
deplibs=
wl=$lt_prog_compiler_wl
pic_flag=$lt_prog_compiler_pic
compiler_flags=-v
linker_flags=-v
verstring=
output_objdir=.
libname=conftest
lt_save_allow_undefined_flag=$allow_undefined_flag
allow_undefined_flag=
if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
(eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
then
archive_cmds_need_lc=no
else
archive_cmds_need_lc=yes
fi
allow_undefined_flag=$lt_save_allow_undefined_flag
else
cat conftest.err 1>&5
fi
$RM conftest*
{ $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
$as_echo "$archive_cmds_need_lc" >&6; }
;;
esac
fi
;;
esac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
$as_echo_n "checking dynamic linker characteristics... " >&6; }
 
if test "$GCC" = yes; then
case $host_os in
darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
*) lt_awk_arg="/^libraries:/" ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
else
lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
lt_tmp_lt_search_path_spec=
lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
for lt_sys_path in $lt_search_path_spec; do
if test -d "$lt_sys_path/$lt_multi_os_dir"; then
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
else
test -d "$lt_sys_path" && \
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
fi
done
lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
BEGIN {RS=" "; FS="/|\n";} {
lt_foo="";
lt_count=0;
for (lt_i = NF; lt_i > 0; lt_i--) {
if ($lt_i != "" && $lt_i != ".") {
if ($lt_i == "..") {
lt_count++;
} else {
if (lt_count == 0) {
lt_foo="/" $lt_i lt_foo;
} else {
lt_count--;
}
}
}
}
if (lt_foo != "") { lt_freq[lt_foo]++; }
if (lt_freq[lt_foo] == 1) { print lt_foo; }
}'`
sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi
library_names_spec=
libname_spec='lib$name'
soname_spec=
shrext_cmds=".so"
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
finish_eval=
shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
need_lib_prefix=unknown
hardcode_into_libs=no
 
# when you set need_version to no, make sure it does not cause -set_version
# flags to be left without arguments
need_version=unknown
 
case $host_os in
aix3*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
shlibpath_var=LIBPATH
 
# AIX 3 has no versioning support, so we append a major version to the name.
soname_spec='${libname}${release}${shared_ext}$major'
;;
 
aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
if test "$host_cpu" = ia64; then
# AIX 5 supports IA64
library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
else
# With GCC up to 2.95.x, collect2 would create an import file
# for dependence libraries. The import file would start with
# the line `#! .'. This would cause the generated library to
# depend on `.', always an invalid library. This was fixed in
# development snapshots of GCC prior to 3.0.
case $host_os in
aix4 | aix4.[01] | aix4.[01].*)
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
echo ' yes '
echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
:
else
can_build_shared=no
fi
;;
esac
# AIX (on Power*) has no versioning support, so currently we can not hardcode correct
# soname into executable. Probably we can add versioning support to
# collect2, so additional links can be useful in future.
if test "$aix_use_runtimelinking" = yes; then
# If using run time linking (on AIX 4.2 or later) use lib<name>.so
# instead of lib<name>.a to let people know that these are not
# typical AIX shared libraries.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
else
# We preserve .a as extension for shared libraries through AIX4.2
# and later when we are not doing run time linking.
library_names_spec='${libname}${release}.a $libname.a'
soname_spec='${libname}${release}${shared_ext}$major'
fi
shlibpath_var=LIBPATH
fi
;;
 
amigaos*)
case $host_cpu in
powerpc)
# Since July 2007 AmigaOS4 officially supports .so libraries.
# When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
;;
m68k)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
;;
esac
;;
 
beos*)
library_names_spec='${libname}${shared_ext}'
dynamic_linker="$host_os ld.so"
shlibpath_var=LIBRARY_PATH
;;
 
bsdi[45]*)
version_type=linux
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
# the default ld.so.conf also contains /usr/contrib/lib and
# /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
# libtool to hard-code these into programs
;;
 
cygwin* | mingw* | pw32* | cegcc*)
version_type=windows
shrext_cmds=".dll"
need_version=no
need_lib_prefix=no
 
case $GCC,$host_os in
yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname~
chmod a+x \$dldir/$dlname~
if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
fi'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
shlibpath_overrides_runpath=yes
 
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
;;
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
# It is most probably a Windows format PATH printed by
# mingw gcc, but we are running on Cygwin. Gcc prints its search
# path with ; separators, and with drive letters. We can handle the
# drive letters (cygwin fileutils understands them), so leave them,
# especially as we might pass files found there to a mingw objdump,
# which wouldn't understand a cygwinified path. Ahh.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
else
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
;;
esac
;;
 
*)
library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
;;
esac
dynamic_linker='Win32 ld.exe'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
 
darwin* | rhapsody*)
dynamic_linker="$host_os dyld"
version_type=darwin
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
 
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
 
dgux*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
;;
 
freebsd1*)
dynamic_linker=no
;;
 
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
objformat=`/usr/bin/objformat`
else
case $host_os in
freebsd[123]*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
need_version=no
need_lib_prefix=no
;;
freebsd-*)
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
need_version=yes
;;
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
freebsd2*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[01]* | freebsdelf3.[01]*)
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
*) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
esac
;;
 
gnu*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
hardcode_into_libs=yes
;;
 
hpux9* | hpux10* | hpux11*)
# Give a soname corresponding to the major version so that dld.sl refuses to
# link against other versions.
version_type=sunos
need_lib_prefix=no
need_version=no
case $host_cpu in
ia64*)
shrext_cmds='.so'
hardcode_into_libs=yes
dynamic_linker="$host_os dld.so"
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
if test "X$HPUX_IA64_MODE" = X32; then
sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
else
sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
fi
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
hppa*64*)
shrext_cmds='.sl'
hardcode_into_libs=yes
dynamic_linker="$host_os dld.sl"
shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
*)
shrext_cmds='.sl'
dynamic_linker="$host_os dld.sl"
shlibpath_var=SHLIB_PATH
shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
;;
esac
# HP-UX runs *really* slowly unless shared libraries are mode 555.
postinstall_cmds='chmod 555 $lib'
;;
 
interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
 
irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
*)
if test "$lt_cv_prog_gnu_ld" = yes; then
version_type=linux
else
version_type=irix
fi ;;
esac
need_lib_prefix=no
need_version=no
soname_spec='${libname}${release}${shared_ext}$major'
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
case $host_os in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in # libtool.m4 will add one of these switches to LD
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
libsuff= shlibsuff= libmagic=32-bit;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
libsuff=32 shlibsuff=N32 libmagic=N32;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
libsuff=64 shlibsuff=64 libmagic=64-bit;;
*) libsuff= shlibsuff= libmagic=never-match;;
esac
;;
esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
shlibpath_overrides_runpath=no
sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
hardcode_into_libs=yes
;;
 
# No shared lib support for Linux oldld, aout, or coff.
linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
 
# This must be Linux ELF.
linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
# Some binutils ld are patched to set DT_RUNPATH
save_LDFLAGS=$LDFLAGS
save_libdir=$libdir
eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
shlibpath_overrides_runpath=yes
fi
 
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
libdir=$save_libdir
 
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
hardcode_into_libs=yes
 
# Add ABI-specific directories to the system library path.
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
 
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
fi
 
# We used to test for /lib/ld.so.1 and disable shared libraries on
# powerpc, because MkLinux only supported shared libraries with the
# GNU dynamic linker. Since this was broken with cross compilers,
# most powerpc-linux boxes support dynamic linking these days and
# people can always --disable-shared, the test was removed, and we
# assume the GNU/Linux dynamic linker is in use.
dynamic_linker='GNU/Linux ld.so'
;;
 
netbsd*)
version_type=sunos
need_lib_prefix=no
need_version=no
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
else
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
dynamic_linker='NetBSD ld.elf_so'
fi
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
 
newsos6)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
;;
 
*nto* | *qnx*)
version_type=qnx
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='ldqnx.so'
;;
 
openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec="/usr/lib"
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
openbsd3.3 | openbsd3.3.*) need_version=yes ;;
*) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
openbsd2.[89] | openbsd2.[89].*)
shlibpath_overrides_runpath=no
;;
*)
shlibpath_overrides_runpath=yes
;;
esac
else
shlibpath_overrides_runpath=yes
fi
;;
 
os2*)
libname_spec='$name'
shrext_cmds=".dll"
need_lib_prefix=no
library_names_spec='$libname${shared_ext} $libname.a'
dynamic_linker='OS/2 ld.exe'
shlibpath_var=LIBPATH
;;
 
osf3* | osf4* | osf5*)
version_type=osf
need_lib_prefix=no
need_version=no
soname_spec='${libname}${release}${shared_ext}$major'
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
 
rdos*)
dynamic_linker=no
;;
 
solaris*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
# ldd complains unless libraries are executable
postinstall_cmds='chmod +x $lib'
;;
 
sunos4*)
version_type=sunos
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
if test "$with_gnu_ld" = yes; then
need_lib_prefix=no
fi
need_version=yes
;;
 
sysv4 | sysv4.3*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
case $host_vendor in
sni)
shlibpath_overrides_runpath=no
need_lib_prefix=no
runpath_var=LD_RUN_PATH
;;
siemens)
need_lib_prefix=no
;;
motorola)
need_lib_prefix=no
need_version=no
shlibpath_overrides_runpath=no
sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
;;
esac
;;
 
sysv4*MP*)
if test -d /usr/nec ;then
version_type=linux
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
soname_spec='$libname${shared_ext}.$major'
shlibpath_var=LD_LIBRARY_PATH
fi
;;
 
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
version_type=freebsd-elf
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
if test "$with_gnu_ld" = yes; then
sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
else
sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
case $host_os in
sco3.2v5*)
sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
;;
esac
fi
sys_lib_dlsearch_path_spec='/usr/lib'
;;
 
tpf*)
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
 
uts4*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
;;
 
*)
dynamic_linker=no
;;
esac
{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
$as_echo "$dynamic_linker" >&6; }
test "$dynamic_linker" = no && can_build_shared=no
 
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
 
if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
fi
if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
hardcode_action=
if test -n "$hardcode_libdir_flag_spec" ||
test -n "$runpath_var" ||
test "X$hardcode_automatic" = "Xyes" ; then
 
# We can hardcode non-existent directories.
if test "$hardcode_direct" != no &&
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
test "$hardcode_minus_L" != no; then
# Linking always hardcodes the temporary library directory.
hardcode_action=relink
else
# We can link without hardcoding, and we can hardcode nonexisting dirs.
hardcode_action=immediate
fi
else
# We cannot hardcode anything, or else we can only hardcode existing
# directories.
hardcode_action=unsupported
fi
{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
$as_echo "$hardcode_action" >&6; }
 
if test "$hardcode_action" = relink ||
test "$inherit_rpath" = yes; then
# Fast installation is not supported
enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
test "$enable_shared" = no; then
# Fast installation is not necessary
enable_fast_install=needless
fi
 
 
 
 
 
 
if test "x$enable_dlopen" != xyes; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
else
lt_cv_dlopen=no
lt_cv_dlopen_libs=
 
case $host_os in
beos*)
lt_cv_dlopen="load_add_on"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
;;
 
mingw* | pw32* | cegcc*)
lt_cv_dlopen="LoadLibrary"
lt_cv_dlopen_libs=
;;
 
cygwin*)
lt_cv_dlopen="dlopen"
lt_cv_dlopen_libs=
;;
 
darwin*)
# if libdl is installed we need to link against it
{ $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen ();
int
main ()
{
return dlopen ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_lib_dl_dlopen=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_lib_dl_dlopen=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
 
lt_cv_dlopen="dyld"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
 
fi
 
;;
 
*)
{ $as_echo "$as_me:$LINENO: checking for shl_load" >&5
$as_echo_n "checking for shl_load... " >&6; }
if test "${ac_cv_func_shl_load+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define shl_load innocuous_shl_load
 
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
 
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
 
#undef shl_load
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char shl_load ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_shl_load || defined __stub___shl_load
choke me
#endif
 
int
main ()
{
return shl_load ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_func_shl_load=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_func_shl_load=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
$as_echo "$ac_cv_func_shl_load" >&6; }
if test "x$ac_cv_func_shl_load" = x""yes; then
lt_cv_dlopen="shl_load"
else
{ $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
$as_echo_n "checking for shl_load in -ldld... " >&6; }
if test "${ac_cv_lib_dld_shl_load+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char shl_load ();
int
main ()
{
return shl_load ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_lib_dld_shl_load=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_lib_dld_shl_load=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
else
{ $as_echo "$as_me:$LINENO: checking for dlopen" >&5
$as_echo_n "checking for dlopen... " >&6; }
if test "${ac_cv_func_dlopen+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define dlopen innocuous_dlopen
 
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
 
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
 
#undef dlopen
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_dlopen || defined __stub___dlopen
choke me
#endif
 
int
main ()
{
return dlopen ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_func_dlopen=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_func_dlopen=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
$as_echo "$ac_cv_func_dlopen" >&6; }
if test "x$ac_cv_func_dlopen" = x""yes; then
lt_cv_dlopen="dlopen"
else
{ $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen ();
int
main ()
{
return dlopen ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_lib_dl_dlopen=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_lib_dl_dlopen=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
{ $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
$as_echo_n "checking for dlopen in -lsvld... " >&6; }
if test "${ac_cv_lib_svld_dlopen+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen ();
int
main ()
{
return dlopen ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_lib_svld_dlopen=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_lib_svld_dlopen=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
else
{ $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
$as_echo_n "checking for dld_link in -ldld... " >&6; }
if test "${ac_cv_lib_dld_dld_link+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dld_link ();
int
main ()
{
return dld_link ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_lib_dld_dld_link=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_lib_dld_dld_link=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
fi
 
 
fi
 
 
fi
 
 
fi
 
 
fi
 
 
fi
 
;;
esac
 
if test "x$lt_cv_dlopen" != xno; then
enable_dlopen=yes
else
enable_dlopen=no
fi
 
case $lt_cv_dlopen in
dlopen)
save_CPPFLAGS="$CPPFLAGS"
test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
save_LDFLAGS="$LDFLAGS"
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
save_LIBS="$LIBS"
LIBS="$lt_cv_dlopen_libs $LIBS"
 
{ $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
$as_echo_n "checking whether a program can dlopen itself... " >&6; }
if test "${lt_cv_dlopen_self+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10771 "configure"
#include "confdefs.h"
 
#if HAVE_DLFCN_H
#include <dlfcn.h>
#endif
 
#include <stdio.h>
 
#ifdef RTLD_GLOBAL
# define LT_DLGLOBAL RTLD_GLOBAL
#else
# ifdef DL_GLOBAL
# define LT_DLGLOBAL DL_GLOBAL
# else
# define LT_DLGLOBAL 0
# endif
#endif
 
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
# ifdef RTLD_LAZY
# define LT_DLLAZY_OR_NOW RTLD_LAZY
# else
# ifdef DL_LAZY
# define LT_DLLAZY_OR_NOW DL_LAZY
# else
# ifdef RTLD_NOW
# define LT_DLLAZY_OR_NOW RTLD_NOW
# else
# ifdef DL_NOW
# define LT_DLLAZY_OR_NOW DL_NOW
# else
# define LT_DLLAZY_OR_NOW 0
# endif
# endif
# endif
# endif
#endif
 
void fnord() { int i=42;}
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
 
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
/* dlclose (self); */
}
else
puts (dlerror ());
 
return status;
}
_LT_EOF
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
esac
else :
# compilation failed
lt_cv_dlopen_self=no
fi
fi
rm -fr conftest*
 
 
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
$as_echo "$lt_cv_dlopen_self" >&6; }
 
if test "x$lt_cv_dlopen_self" = xyes; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
{ $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
if test "${lt_cv_dlopen_self_static+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self_static=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10867 "configure"
#include "confdefs.h"
 
#if HAVE_DLFCN_H
#include <dlfcn.h>
#endif
 
#include <stdio.h>
 
#ifdef RTLD_GLOBAL
# define LT_DLGLOBAL RTLD_GLOBAL
#else
# ifdef DL_GLOBAL
# define LT_DLGLOBAL DL_GLOBAL
# else
# define LT_DLGLOBAL 0
# endif
#endif
 
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
# ifdef RTLD_LAZY
# define LT_DLLAZY_OR_NOW RTLD_LAZY
# else
# ifdef DL_LAZY
# define LT_DLLAZY_OR_NOW DL_LAZY
# else
# ifdef RTLD_NOW
# define LT_DLLAZY_OR_NOW RTLD_NOW
# else
# ifdef DL_NOW
# define LT_DLLAZY_OR_NOW DL_NOW
# else
# define LT_DLLAZY_OR_NOW 0
# endif
# endif
# endif
# endif
#endif
 
void fnord() { int i=42;}
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
 
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
/* dlclose (self); */
}
else
puts (dlerror ());
 
return status;
}
_LT_EOF
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
esac
else :
# compilation failed
lt_cv_dlopen_self_static=no
fi
fi
rm -fr conftest*
 
 
fi
{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
$as_echo "$lt_cv_dlopen_self_static" >&6; }
fi
 
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
;;
esac
 
case $lt_cv_dlopen_self in
yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
*) enable_dlopen_self=unknown ;;
esac
 
case $lt_cv_dlopen_self_static in
yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
*) enable_dlopen_self_static=unknown ;;
esac
fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
striplib=
old_striplib=
{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
$as_echo_n "checking whether stripping libraries is possible... " >&6; }
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
else
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
if test -n "$STRIP" ; then
striplib="$STRIP -x"
old_striplib="$STRIP -S"
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
;;
*)
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
;;
esac
fi
 
 
 
 
 
 
 
 
 
 
 
 
# Report which library types will actually be built
{ $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
$as_echo_n "checking if libtool supports shared libraries... " >&6; }
{ $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
$as_echo "$can_build_shared" >&6; }
 
{ $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
$as_echo_n "checking whether to build shared libraries... " >&6; }
test "$can_build_shared" = "no" && enable_shared=no
 
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
 
aix[4-9]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
;;
esac
{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
$as_echo "$enable_shared" >&6; }
 
{ $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
$as_echo_n "checking whether to build static libraries... " >&6; }
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
{ $as_echo "$as_me:$LINENO: result: $enable_static" >&5
$as_echo "$enable_static" >&6; }
 
 
 
 
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
CC="$lt_save_CC"
 
 
 
 
 
 
 
 
 
 
 
 
 
ac_config_commands="$ac_config_commands libtool"
 
 
 
 
# Only expand once:
 
 
 
# platform specific compiler flags
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -Wall"
fi
 
# Checks for libraries.
 
# Check whether --with-libpng was given.
if test "${with_libpng+set}" = set; then
withval=$with_libpng; ac_cv_want_libpng="$withval"
else
ac_cv_want_libpng="yes"
fi
 
save_cflags="$CFLAGS"
save_ldflags="$LDFLAGS"
have_libpng="no"
if test "x$ac_cv_want_libpng" != "xno"; then
if test "x$ac_cv_want_libpng" != "xyes"; then
CFLAGS="$CFLAGS -I$ac_cv_want_libpng/include"
LDFLAGS="$LDFLAGS -L$ac_cv_want_libpng/lib"
fi
{ $as_echo "$as_me:$LINENO: checking for library containing pow" >&5
$as_echo_n "checking for library containing pow... " >&6; }
if test "${ac_cv_search_pow+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char pow ();
int
main ()
{
return pow ();
;
return 0;
}
_ACEOF
for ac_lib in '' m; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_search_pow=$ac_res
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext
if test "${ac_cv_search_pow+set}" = set; then
break
fi
done
if test "${ac_cv_search_pow+set}" = set; then
:
else
ac_cv_search_pow=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_pow" >&5
$as_echo "$ac_cv_search_pow" >&6; }
ac_res=$ac_cv_search_pow
if test "$ac_res" != no; then
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
fi
 
{ $as_echo "$as_me:$LINENO: checking for png_check_sig in -lpng" >&5
$as_echo_n "checking for png_check_sig in -lpng... " >&6; }
if test "${ac_cv_lib_png_png_check_sig+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpng $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char png_check_sig ();
int
main ()
{
return png_check_sig ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_lib_png_png_check_sig=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_lib_png_png_check_sig=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_check_sig" >&5
$as_echo "$ac_cv_lib_png_png_check_sig" >&6; }
if test "x$ac_cv_lib_png_png_check_sig" = x""yes; then
 
{ $as_echo "$as_me:$LINENO: checking for deflate in -lz" >&5
$as_echo_n "checking for deflate in -lz... " >&6; }
if test "${ac_cv_lib_z_deflate+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char deflate ();
int
main ()
{
return deflate ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_lib_z_deflate=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_lib_z_deflate=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5
$as_echo "$ac_cv_lib_z_deflate" >&6; }
if test "x$ac_cv_lib_z_deflate" = x""yes; then
 
 
cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBPNG 1
_ACEOF
 
LIBS="-lpng -lz $LIBS"
case " $LIBOBJS " in
*" jbig2_image_png.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS jbig2_image_png.$ac_objext"
;;
esac
 
have_libpng="yes"
 
fi
 
 
fi
 
fi
if test "x$have_libpng" != "xyes"; then
CFLAGS="$save_cflags"
LDFLAGS="$save_ldflags"
fi
 
# Checks for header files.
{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if test "${ac_cv_header_stdc+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
 
int
main ()
{
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_header_stdc=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_header_stdc=no
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <string.h>
 
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "memchr" >/dev/null 2>&1; then
:
else
ac_cv_header_stdc=no
fi
rm -f conftest*
 
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 <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdlib.h>
 
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "free" >/dev/null 2>&1; then
:
else
ac_cv_header_stdc=no
fi
rm -f conftest*
 
fi
 
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
:
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ctype.h>
#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
(('a' <= (c) && (c) <= 'i') \
|| ('j' <= (c) && (c) <= 'r') \
|| ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
 
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
int i;
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
return 2;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
( exit $ac_status )
ac_cv_header_stdc=no
fi
rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
 
 
fi
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
 
cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
_ACEOF
 
fi
 
 
 
 
 
for ac_header in libintl.h stddef.h unistd.h strings.h
do
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
$as_echo_n "(cached) " >&6
fi
ac_res=`eval 'as_val=${'$as_ac_Header'}
$as_echo "$as_val"'`
{ $as_echo "$as_me:$LINENO: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
$as_echo_n "checking $ac_header usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_header_compiler=no
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
$as_echo "$ac_header_compiler" >&6; }
 
# Is the header present?
{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
$as_echo_n "checking $ac_header presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_header_preproc=no
fi
 
rm -f conftest.err conftest.$ac_ext
{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }
 
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ---------------------------------------- ##
## Report this to jbig2-dev@ghostscript.com ##
## ---------------------------------------- ##
_ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
$as_echo_n "checking for $ac_header... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
$as_echo_n "(cached) " >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
ac_res=`eval 'as_val=${'$as_ac_Header'}
$as_echo "$as_val"'`
{ $as_echo "$as_me:$LINENO: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
 
fi
as_val=`eval 'as_val=${'$as_ac_Header'}
$as_echo "$as_val"'`
if test "x$as_val" = x""yes; then
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
 
fi
 
done
 
 
 
stdint_types_in="no_replacement_found"
stdint_types_discovered="yes"
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:$LINENO: checking size of char" >&5
$as_echo_n "checking size of char... " >&6; }
if test "${ac_cv_sizeof_char+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then
# Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (char))) >= 0)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_lo=0 ac_mid=0
while :; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (char))) <= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=$ac_mid; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo=`expr $ac_mid + 1`
if test $ac_lo -le $ac_mid; then
ac_lo= ac_hi=
break
fi
ac_mid=`expr 2 '*' $ac_mid + 1`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (char))) < 0)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=-1 ac_mid=-1
while :; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (char))) >= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_lo=$ac_mid; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_hi=`expr '(' $ac_mid ')' - 1`
if test $ac_mid -le $ac_hi; then
ac_lo= ac_hi=
break
fi
ac_mid=`expr 2 '*' $ac_mid`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo= ac_hi=
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (char))) <= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=$ac_mid
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo=`expr '(' $ac_mid ')' + 1`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_char=$ac_lo;;
'') if test "$ac_cv_type_char" = yes; then
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (char)
See \`config.log' for more details." >&5
$as_echo "$as_me: error: cannot compute sizeof (char)
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }; }
else
ac_cv_sizeof_char=0
fi ;;
esac
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
static long int longval () { return (long int) (sizeof (char)); }
static unsigned long int ulongval () { return (long int) (sizeof (char)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
 
FILE *f = fopen ("conftest.val", "w");
if (! f)
return 1;
if (((long int) (sizeof (char))) < 0)
{
long int i = longval ();
if (i != ((long int) (sizeof (char))))
return 1;
fprintf (f, "%ld", i);
}
else
{
unsigned long int i = ulongval ();
if (i != ((long int) (sizeof (char))))
return 1;
fprintf (f, "%lu", i);
}
/* Do not output a trailing newline, as this causes \r\n confusion
on some platforms. */
return ferror (f) || fclose (f) != 0;
 
;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_sizeof_char=`cat conftest.val`
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
( exit $ac_status )
if test "$ac_cv_type_char" = yes; then
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (char)
See \`config.log' for more details." >&5
$as_echo "$as_me: error: cannot compute sizeof (char)
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }; }
else
ac_cv_sizeof_char=0
fi
fi
rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.val
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
$as_echo "$ac_cv_sizeof_char" >&6; }
 
 
 
cat >>confdefs.h <<_ACEOF
#define SIZEOF_CHAR $ac_cv_sizeof_char
_ACEOF
 
 
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:$LINENO: checking size of short" >&5
$as_echo_n "checking size of short... " >&6; }
if test "${ac_cv_sizeof_short+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then
# Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 0)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_lo=0 ac_mid=0
while :; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=$ac_mid; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo=`expr $ac_mid + 1`
if test $ac_lo -le $ac_mid; then
ac_lo= ac_hi=
break
fi
ac_mid=`expr 2 '*' $ac_mid + 1`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 0)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=-1 ac_mid=-1
while :; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_lo=$ac_mid; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_hi=`expr '(' $ac_mid ')' - 1`
if test $ac_mid -le $ac_hi; then
ac_lo= ac_hi=
break
fi
ac_mid=`expr 2 '*' $ac_mid`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo= ac_hi=
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=$ac_mid
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo=`expr '(' $ac_mid ')' + 1`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_short=$ac_lo;;
'') if test "$ac_cv_type_short" = yes; then
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
See \`config.log' for more details." >&5
$as_echo "$as_me: error: cannot compute sizeof (short)
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }; }
else
ac_cv_sizeof_short=0
fi ;;
esac
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
static long int longval () { return (long int) (sizeof (short)); }
static unsigned long int ulongval () { return (long int) (sizeof (short)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
 
FILE *f = fopen ("conftest.val", "w");
if (! f)
return 1;
if (((long int) (sizeof (short))) < 0)
{
long int i = longval ();
if (i != ((long int) (sizeof (short))))
return 1;
fprintf (f, "%ld", i);
}
else
{
unsigned long int i = ulongval ();
if (i != ((long int) (sizeof (short))))
return 1;
fprintf (f, "%lu", i);
}
/* Do not output a trailing newline, as this causes \r\n confusion
on some platforms. */
return ferror (f) || fclose (f) != 0;
 
;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_sizeof_short=`cat conftest.val`
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
( exit $ac_status )
if test "$ac_cv_type_short" = yes; then
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
See \`config.log' for more details." >&5
$as_echo "$as_me: error: cannot compute sizeof (short)
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }; }
else
ac_cv_sizeof_short=0
fi
fi
rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.val
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
$as_echo "$ac_cv_sizeof_short" >&6; }
 
 
 
cat >>confdefs.h <<_ACEOF
#define SIZEOF_SHORT $ac_cv_sizeof_short
_ACEOF
 
 
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:$LINENO: checking size of int" >&5
$as_echo_n "checking size of int... " >&6; }
if test "${ac_cv_sizeof_int+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then
# Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_lo=0 ac_mid=0
while :; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=$ac_mid; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo=`expr $ac_mid + 1`
if test $ac_lo -le $ac_mid; then
ac_lo= ac_hi=
break
fi
ac_mid=`expr 2 '*' $ac_mid + 1`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=-1 ac_mid=-1
while :; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_lo=$ac_mid; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_hi=`expr '(' $ac_mid ')' - 1`
if test $ac_mid -le $ac_hi; then
ac_lo= ac_hi=
break
fi
ac_mid=`expr 2 '*' $ac_mid`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo= ac_hi=
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=$ac_mid
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo=`expr '(' $ac_mid ')' + 1`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_int=$ac_lo;;
'') if test "$ac_cv_type_int" = yes; then
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
See \`config.log' for more details." >&5
$as_echo "$as_me: error: cannot compute sizeof (int)
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }; }
else
ac_cv_sizeof_int=0
fi ;;
esac
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
static long int longval () { return (long int) (sizeof (int)); }
static unsigned long int ulongval () { return (long int) (sizeof (int)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
 
FILE *f = fopen ("conftest.val", "w");
if (! f)
return 1;
if (((long int) (sizeof (int))) < 0)
{
long int i = longval ();
if (i != ((long int) (sizeof (int))))
return 1;
fprintf (f, "%ld", i);
}
else
{
unsigned long int i = ulongval ();
if (i != ((long int) (sizeof (int))))
return 1;
fprintf (f, "%lu", i);
}
/* Do not output a trailing newline, as this causes \r\n confusion
on some platforms. */
return ferror (f) || fclose (f) != 0;
 
;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_sizeof_int=`cat conftest.val`
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
( exit $ac_status )
if test "$ac_cv_type_int" = yes; then
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
See \`config.log' for more details." >&5
$as_echo "$as_me: error: cannot compute sizeof (int)
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }; }
else
ac_cv_sizeof_int=0
fi
fi
rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.val
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
$as_echo "$ac_cv_sizeof_int" >&6; }
 
 
 
cat >>confdefs.h <<_ACEOF
#define SIZEOF_INT $ac_cv_sizeof_int
_ACEOF
 
 
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:$LINENO: checking size of long" >&5
$as_echo_n "checking size of long... " >&6; }
if test "${ac_cv_sizeof_long+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then
# Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_lo=0 ac_mid=0
while :; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=$ac_mid; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo=`expr $ac_mid + 1`
if test $ac_lo -le $ac_mid; then
ac_lo= ac_hi=
break
fi
ac_mid=`expr 2 '*' $ac_mid + 1`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=-1 ac_mid=-1
while :; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_lo=$ac_mid; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_hi=`expr '(' $ac_mid ')' - 1`
if test $ac_mid -le $ac_hi; then
ac_lo= ac_hi=
break
fi
ac_mid=`expr 2 '*' $ac_mid`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo= ac_hi=
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)];
test_array [0] = 0
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_hi=$ac_mid
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_lo=`expr '(' $ac_mid ')' + 1`
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long=$ac_lo;;
'') if test "$ac_cv_type_long" = yes; then
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
See \`config.log' for more details." >&5
$as_echo "$as_me: error: cannot compute sizeof (long)
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }; }
else
ac_cv_sizeof_long=0
fi ;;
esac
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
static long int longval () { return (long int) (sizeof (long)); }
static unsigned long int ulongval () { return (long int) (sizeof (long)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
 
FILE *f = fopen ("conftest.val", "w");
if (! f)
return 1;
if (((long int) (sizeof (long))) < 0)
{
long int i = longval ();
if (i != ((long int) (sizeof (long))))
return 1;
fprintf (f, "%ld", i);
}
else
{
unsigned long int i = ulongval ();
if (i != ((long int) (sizeof (long))))
return 1;
fprintf (f, "%lu", i);
}
/* Do not output a trailing newline, as this causes \r\n confusion
on some platforms. */
return ferror (f) || fclose (f) != 0;
 
;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_sizeof_long=`cat conftest.val`
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
( exit $ac_status )
if test "$ac_cv_type_long" = yes; then
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
See \`config.log' for more details." >&5
$as_echo "$as_me: error: cannot compute sizeof (long)
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }; }
else
ac_cv_sizeof_long=0
fi
fi
rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.val
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
$as_echo "$ac_cv_sizeof_long" >&6; }
 
 
 
cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG $ac_cv_sizeof_long
_ACEOF
 
 
case 1 in
$ac_cv_sizeof_char) int8_type="char";;
*) stdint_types_discovered="no"
esac
case 2 in
$ac_cv_sizeof_short) int16_type="short";;
$ac_cv_sizeof_char) int16_type="char";;
$ac_cv_sizeof_int) int16_type="char";;
*) stdint_types_discovered="no";;
esac
case 4 in
$ac_cv_sizeof_int) int32_type="int";;
$ac_cv_sizeof_long) int32_type="long";;
$ac_cv_sizeof_short) int32_type="short";;
*) stdint_types_discovered="no";;
esac
if test "${ac_cv_header_stdint_h+set}" = set; then
{ $as_echo "$as_me:$LINENO: checking for stdint.h" >&5
$as_echo_n "checking for stdint.h... " >&6; }
if test "${ac_cv_header_stdint_h+set}" = set; then
$as_echo_n "(cached) " >&6
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5
$as_echo "$ac_cv_header_stdint_h" >&6; }
else
# Is the header compilable?
{ $as_echo "$as_me:$LINENO: checking stdint.h usability" >&5
$as_echo_n "checking stdint.h usability... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <stdint.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_header_compiler=no
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
$as_echo "$ac_header_compiler" >&6; }
 
# Is the header present?
{ $as_echo "$as_me:$LINENO: checking stdint.h presence" >&5
$as_echo_n "checking stdint.h presence... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdint.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then
ac_header_preproc=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_header_preproc=no
fi
 
rm -f conftest.err conftest.$ac_ext
{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }
 
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ $as_echo "$as_me:$LINENO: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&5
$as_echo "$as_me: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: stdint.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ $as_echo "$as_me:$LINENO: WARNING: stdint.h: present but cannot be compiled" >&5
$as_echo "$as_me: WARNING: stdint.h: present but cannot be compiled" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: stdint.h: check for missing prerequisite headers?" >&5
$as_echo "$as_me: WARNING: stdint.h: check for missing prerequisite headers?" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: stdint.h: see the Autoconf documentation" >&5
$as_echo "$as_me: WARNING: stdint.h: see the Autoconf documentation" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: stdint.h: section \"Present But Cannot Be Compiled\"" >&5
$as_echo "$as_me: WARNING: stdint.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the preprocessor's result" >&5
$as_echo "$as_me: WARNING: stdint.h: proceeding with the preprocessor's result" >&2;}
{ $as_echo "$as_me:$LINENO: WARNING: stdint.h: in the future, the compiler will take precedence" >&5
$as_echo "$as_me: WARNING: stdint.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ---------------------------------------- ##
## Report this to jbig2-dev@ghostscript.com ##
## ---------------------------------------- ##
_ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
{ $as_echo "$as_me:$LINENO: checking for stdint.h" >&5
$as_echo_n "checking for stdint.h... " >&6; }
if test "${ac_cv_header_stdint_h+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_header_stdint_h=$ac_header_preproc
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5
$as_echo "$ac_cv_header_stdint_h" >&6; }
 
fi
 
 
if test "x$ac_cv_header_stdint_h" != "xyes"; then
for include in sys/types.h inttypes.h sys/inttypes.h sys/int_types.h ; do
{ $as_echo "$as_me:$LINENO: checking for uint32_t in $include" >&5
$as_echo_n "checking for uint32_t in $include... " >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$include>
int
main ()
{
uint32_t canary;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
 
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
stdint_types_in="$include"
break;
 
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
 
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
if test "x$stdint_types_in" != "xno_replacement_found"; then
{ $as_echo "$as_me:$LINENO: result: Adding $stdint_types_in to config header for stdint types" >&5
$as_echo "Adding $stdint_types_in to config header for stdint types" >&6; }
 
cat >>confdefs.h <<\_ACEOF
#define JBIG2_REPLACE_STDINT_H /**/
_ACEOF
 
elif test "x$stdint_types_discovered" = "xno"; then
{ { $as_echo "$as_me:$LINENO: error:
Unable to find suitable definitions of the stdint.h types (uint32_t and friends)
You will have to define these yourself in a separate header.
See config_win32.h for an example.
" >&5
$as_echo "$as_me: error:
Unable to find suitable definitions of the stdint.h types (uint32_t and friends)
You will have to define these yourself in a separate header.
See config_win32.h for an example.
" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
JBIG2_INT32_T=$int32_type
 
JBIG2_INT16_T=$int16_type
 
JBIG2_INT8_T=$int8_type
 
JBIG2_STDINT_H=$stdint_types_in
 
 
# Checks for typedefs, structures, and compiler characteristics.
{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
if test "${ac_cv_c_const+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
 
int
main ()
{
/* FIXME: Include the comments suggested by Paul. */
#ifndef __cplusplus
/* Ultrix mips cc rejects this. */
typedef int charset[2];
const charset cs;
/* SunOS 4.1.1 cc rejects this. */
char const *const *pcpcc;
char **ppc;
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
/* AIX XL C 1.02.0.0 rejects this.
It does not let you subtract one const X* pointer from another in
an arm of an if-expression whose if-part is not a constant
expression */
const char *g = "string";
pcpcc = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++pcpcc;
ppc = (char**) pcpcc;
pcpcc = (char const *const *) ppc;
{ /* SCO 3.2v4 cc rejects this. */
char *t;
char const *s = 0 ? (char *) 0 : (char const *) 0;
 
*t++ = 0;
if (s) return 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
int x[] = {25, 17};
const int *foo = &x[0];
++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
typedef const int *iptr;
iptr p = 0;
++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
struct s { int j; const int *ap[3]; };
struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
if (!foo) return 0;
}
return !cs[0] && !zero.x;
#endif
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_const=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_c_const=no
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
$as_echo "$ac_cv_c_const" >&6; }
if test $ac_cv_c_const = no; then
 
cat >>confdefs.h <<\_ACEOF
#define const /**/
_ACEOF
 
fi
 
{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
$as_echo_n "checking for size_t... " >&6; }
if test "${ac_cv_type_size_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_type_size_t=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof (size_t))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof ((size_t)))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_type_size_t=yes
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
$as_echo "$ac_cv_type_size_t" >&6; }
if test "x$ac_cv_type_size_t" = x""yes; then
:
else
 
cat >>confdefs.h <<_ACEOF
#define size_t unsigned int
_ACEOF
 
fi
 
 
{ $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
if test "${ac_cv_c_bigendian+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_c_bigendian=unknown
# See if we're dealing with a universal compiler.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifndef __APPLE_CC__
not a universal capable compiler
#endif
typedef int dummy;
 
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
 
# Check for potential -arch flags. It is not universal unless
# there are some -arch flags. Note that *ppc* also matches
# ppc64. This check is also rather less than ideal.
case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #(
*-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
esac
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_c_bigendian = unknown; then
# See if sys/param.h defines the BYTE_ORDER macro.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/param.h>
 
int
main ()
{
#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
&& defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
&& LITTLE_ENDIAN)
bogus endian macros
#endif
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
# It does; now see whether it defined to BIG_ENDIAN or not.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/param.h>
 
int
main ()
{
#if BYTE_ORDER != BIG_ENDIAN
not big endian
#endif
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_bigendian=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_c_bigendian=no
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $ac_cv_c_bigendian = unknown; then
# See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <limits.h>
 
int
main ()
{
#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
bogus endian macros
#endif
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
# It does; now see whether it defined to _BIG_ENDIAN or not.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <limits.h>
 
int
main ()
{
#ifndef _BIG_ENDIAN
not big endian
#endif
 
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_bigendian=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_c_bigendian=no
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $ac_cv_c_bigendian = unknown; then
# Compile a test program.
if test "$cross_compiling" = yes; then
# Try to guess by grepping values from an object file.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
short int ascii_mm[] =
{ 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
short int ascii_ii[] =
{ 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
int use_ascii (int i) {
return ascii_mm[i] + ascii_ii[i];
}
short int ebcdic_ii[] =
{ 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
short int ebcdic_mm[] =
{ 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
int use_ebcdic (int i) {
return ebcdic_mm[i] + ebcdic_ii[i];
}
extern int foo;
 
int
main ()
{
return use_ascii (foo) == use_ebcdic (foo);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
ac_cv_c_bigendian=yes
fi
if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
if test "$ac_cv_c_bigendian" = unknown; then
ac_cv_c_bigendian=no
else
# finding both strings is unlikely to happen, but who knows?
ac_cv_c_bigendian=unknown
fi
fi
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
 
fi
 
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
 
/* Are we little or big endian? From Harbison&Steele. */
union
{
long int l;
char c[sizeof (long int)];
} u;
u.l = 1;
return u.c[sizeof (long int) - 1] == 1;
 
;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_bigendian=no
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
( exit $ac_status )
ac_cv_c_bigendian=yes
fi
rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
 
 
fi
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
$as_echo "$ac_cv_c_bigendian" >&6; }
case $ac_cv_c_bigendian in #(
yes)
cat >>confdefs.h <<\_ACEOF
#define WORDS_BIGENDIAN 1
_ACEOF
;; #(
no)
;; #(
universal)
 
cat >>confdefs.h <<\_ACEOF
#define AC_APPLE_UNIVERSAL_BUILD 1
_ACEOF
 
;; #(
*)
{ { $as_echo "$as_me:$LINENO: error: unknown endianness
presetting ac_cv_c_bigendian=no (or yes) will help" >&5
$as_echo "$as_me: error: unknown endianness
presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
{ (exit 1); exit 1; }; } ;;
esac
 
 
# Checks for library functions.
{ $as_echo "$as_me:$LINENO: checking for working memcmp" >&5
$as_echo_n "checking for working memcmp... " >&6; }
if test "${ac_cv_func_memcmp_working+set}" = set; then
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_memcmp_working=no
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
 
/* Some versions of memcmp are not 8-bit clean. */
char c0 = '\100', c1 = '\200', c2 = '\201';
if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
return 1;
 
/* The Next x86 OpenStep bug shows up only when comparing 16 bytes
or more and with at least one buffer not starting on a 4-byte boundary.
William Lewis provided this test program. */
{
char foo[21];
char bar[21];
int i;
for (i = 0; i < 4; i++)
{
char *a = foo + i;
char *b = bar + i;
strcpy (a, "--------01111111");
strcpy (b, "--------10000000");
if (memcmp (a, b, 16) >= 0)
return 1;
}
return 0;
}
 
;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_memcmp_working=yes
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
( exit $ac_status )
ac_cv_func_memcmp_working=no
fi
rm -rf conftest.dSYM
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
 
 
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
$as_echo "$ac_cv_func_memcmp_working" >&6; }
test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
*" memcmp.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
;;
esac
 
 
 
for ac_func in snprintf
do
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define $ac_func innocuous_$ac_func
 
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
 
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
 
#undef $ac_func
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_$ac_func || defined __stub___$ac_func
choke me
#endif
 
int
main ()
{
return $ac_func ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
eval "$as_ac_var=yes"
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
eval "$as_ac_var=no"
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
ac_res=`eval 'as_val=${'$as_ac_var'}
$as_echo "$as_val"'`
{ $as_echo "$as_me:$LINENO: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
as_val=`eval 'as_val=${'$as_ac_var'}
$as_echo "$as_val"'`
if test "x$as_val" = x""yes; then
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
 
else
case " $LIBOBJS " in
*" $ac_func.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
;;
esac
 
fi
done
 
 
 
 
 
for ac_func in memset strdup
do
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
$as_echo_n "checking for $ac_func... " >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define $ac_func innocuous_$ac_func
 
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
 
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
 
#undef $ac_func
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_$ac_func || defined __stub___$ac_func
choke me
#endif
 
int
main ()
{
return $ac_func ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
eval "$as_ac_var=yes"
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
eval "$as_ac_var=no"
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
ac_res=`eval 'as_val=${'$as_ac_var'}
$as_echo "$as_val"'`
{ $as_echo "$as_me:$LINENO: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
as_val=`eval 'as_val=${'$as_ac_var'}
$as_echo "$as_val"'`
if test "x$as_val" = x""yes; then
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
 
fi
done
 
 
{ $as_echo "$as_me:$LINENO: checking for getopt_long" >&5
$as_echo_n "checking for getopt_long... " >&6; }
if test "${ac_cv_func_getopt_long+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define getopt_long to an innocuous variant, in case <limits.h> declares getopt_long.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define getopt_long innocuous_getopt_long
 
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char getopt_long (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
 
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
 
#undef getopt_long
 
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char getopt_long ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_getopt_long || defined __stub___getopt_long
choke me
#endif
 
int
main ()
{
return getopt_long ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_func_getopt_long=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_func_getopt_long=no
fi
 
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getopt_long" >&5
$as_echo "$ac_cv_func_getopt_long" >&6; }
if test "x$ac_cv_func_getopt_long" = x""yes; then
 
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETOPT_LONG /**/
_ACEOF
 
else
 
case " $LIBOBJS " in
*" getopt.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS getopt.$ac_objext"
;;
esac
 
case " $LIBOBJS " in
*" getopt1.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS getopt1.$ac_objext"
;;
esac
 
 
fi
 
 
# generate output
ac_config_files="$ac_config_files Makefile config_types.h"
 
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems. If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.
 
_ACEOF
 
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) $as_unset $ac_var ;;
esac ;;
esac
done
 
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
) |
sed '
/^ac_cv_env_/b end
t clear
:clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
test "x$cache_file" != "x/dev/null" &&
{ $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
cat confcache >$cache_file
else
{ $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
 
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
DEFS=-DHAVE_CONFIG_H
 
ac_libobjs=
ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
 
LTLIBOBJS=$ac_ltlibobjs
 
 
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
{ { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
{ { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
 
 
: ${CONFIG_STATUS=./config.status}
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
 
debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
_ACEOF
 
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
 
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in
*posix*) set -o posix ;;
esac
 
fi
 
 
 
 
# PATH needs CR
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
 
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
 
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
 
# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
fi
 
 
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
 
# Find who we are. Look in the path if we contain no directory separator.
case $0 in
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
 
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
{ (exit 1); exit 1; }
fi
 
# Work around bugs in pre-3.0 UWIN ksh.
for as_var in ENV MAIL MAILPATH
do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
done
PS1='$ '
PS2='> '
PS4='+ '
 
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
 
# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
 
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
 
 
# Name of the executable.
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
 
# CDPATH.
$as_unset CDPATH
 
 
 
as_lineno_1=$LINENO
as_lineno_2=$LINENO
test "x$as_lineno_1" != "x$as_lineno_2" &&
test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
# line-number line after each line using $LINENO; the second 'sed'
# does the real work. The second script uses 'N' to pair each
# line-number line with the line containing $LINENO, and appends
# trailing '-' during substitution so that $LINENO is not a special
# case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
# scripts with optimization help from Paolo Bonzini. Blame Lee
# E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
 
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
 
 
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
 
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in
-n*)
case `echo 'x\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
*) ECHO_C='\c';;
esac;;
*)
ECHO_N='-n';;
esac
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
 
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -p'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
else
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
 
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
 
if test -x / >/dev/null 2>&1; then
as_test_x='test -x'
else
if ls -dL / >/dev/null 2>&1; then
as_ls_L_option=L
else
as_ls_L_option=
fi
as_test_x='
eval sh -c '\''
if test -d "$1"; then
test -d "$1/.";
else
case $1 in
-*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
fi
as_executable_p=$as_test_x
 
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
exec 6>&1
 
# Save the log message, to keep $[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by jbig2dec $as_me 0.11, which was
generated by GNU Autoconf 2.63. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
 
on `(hostname || uname -n) 2>/dev/null | sed 1q`
"
 
_ACEOF
 
case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac
 
case $ac_config_headers in *"
"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
esac
 
 
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
config_commands="$ac_config_commands"
 
_ACEOF
 
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
current configuration.
 
Usage: $0 [OPTION]... [FILE]...
 
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
instantiate the configuration file FILE
--header=FILE[:TEMPLATE]
instantiate the configuration header FILE
 
Configuration files:
$config_files
 
Configuration headers:
$config_headers
 
Configuration commands:
$config_commands
 
Report bugs to <bug-autoconf@gnu.org>."
 
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
jbig2dec config.status 0.11
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
Copyright (C) 2008 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
 
ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
AWK='$AWK'
test -n "\$AWK" || AWK=awk
_ACEOF
 
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
esac
 
case $ac_option in
# Handling of the options.
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
$as_echo "$ac_cs_version"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
ac_need_defaults=false;;
--header | --heade | --head | --hea )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
{ $as_echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; };;
--help | --hel | -h )
$as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
 
# This is an error.
-*) { $as_echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; } ;;
 
*) ac_config_targets="$ac_config_targets $1"
ac_need_defaults=false ;;
 
esac
shift
done
 
ac_configure_extra_args=
 
if $ac_cs_silent; then
exec 6>/dev/null
ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
 
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
fi
 
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
$as_echo "$ac_log"
} >&5
 
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
 
 
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
sed_quote_subst='$sed_quote_subst'
double_quote_subst='$double_quote_subst'
delay_variable_subst='$delay_variable_subst'
macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
 
LTCC='$LTCC'
LTCFLAGS='$LTCFLAGS'
compiler='$compiler_DEFAULT'
 
# Quote evaled strings.
for var in SED \
GREP \
EGREP \
FGREP \
LD \
NM \
LN_S \
lt_SP2NL \
lt_NL2SP \
reload_flag \
OBJDUMP \
deplibs_check_method \
file_magic_cmd \
AR \
AR_FLAGS \
STRIP \
RANLIB \
CC \
CFLAGS \
compiler \
lt_cv_sys_global_symbol_pipe \
lt_cv_sys_global_symbol_to_cdecl \
lt_cv_sys_global_symbol_to_c_name_address \
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
SHELL \
ECHO \
lt_prog_compiler_no_builtin_flag \
lt_prog_compiler_wl \
lt_prog_compiler_pic \
lt_prog_compiler_static \
lt_cv_prog_compiler_c_o \
need_locks \
DSYMUTIL \
NMEDIT \
LIPO \
OTOOL \
OTOOL64 \
shrext_cmds \
export_dynamic_flag_spec \
whole_archive_flag_spec \
compiler_needs_object \
with_gnu_ld \
allow_undefined_flag \
no_undefined_flag \
hardcode_libdir_flag_spec \
hardcode_libdir_flag_spec_ld \
hardcode_libdir_separator \
fix_srcfile_path \
exclude_expsyms \
include_expsyms \
file_list_spec \
variables_saved_for_relink \
libname_spec \
library_names_spec \
soname_spec \
finish_eval \
old_striplib \
striplib; do
case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
*[\\\\\\\`\\"\\\$]*)
eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
;;
esac
done
 
# Double-quote double-evaled strings.
for var in reload_cmds \
old_postinstall_cmds \
old_postuninstall_cmds \
old_archive_cmds \
extract_expsyms_cmds \
old_archive_from_new_cmds \
old_archive_from_expsyms_cmds \
archive_cmds \
archive_expsym_cmds \
module_cmds \
module_expsym_cmds \
export_symbols_cmds \
prelink_cmds \
postinstall_cmds \
postuninstall_cmds \
finish_cmds \
sys_lib_search_path_spec \
sys_lib_dlsearch_path_spec; do
case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
*[\\\\\\\`\\"\\\$]*)
eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
;;
esac
done
 
# Fix-up fallback echo if it was mangled by the above quoting rules.
case \$lt_ECHO in
*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
;;
esac
 
ac_aux_dir='$ac_aux_dir'
xsi_shell='$xsi_shell'
lt_shell_append='$lt_shell_append'
 
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes INIT.
if test -n "\${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
 
 
PACKAGE='$PACKAGE'
VERSION='$VERSION'
TIMESTAMP='$TIMESTAMP'
RM='$RM'
ofile='$ofile'
 
 
 
 
_ACEOF
 
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"config_types.h") CONFIG_FILES="$CONFIG_FILES config_types.h" ;;
 
*) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
done
 
 
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi
 
# Have a temporary directory for convenience. Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
tmp=
trap 'exit_status=$?
{ test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
' 0
trap '{ (exit 1); exit 1; }' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
 
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} ||
{
$as_echo "$as_me: cannot create a temporary directory in ." >&2
{ (exit 1); exit 1; }
}
 
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
 
 
+'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+ { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_t"; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+ { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ ac_file_inputs="$ac_file_inputs '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+ } >"$tmp/config.h" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$tmp/config.h" "$ac_file" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ "$ac_file" | "$ac_file":* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for "$ac_file"" >`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir=$dirpart/$fdir
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that does not interpret backslashes.
+ECHO=$lt_ECHO
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ case $xsi_shell in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=${1%%=*}
+ func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=${#1}
+}
+
+_LT_EOF
+ ;;
+ *) # Bourne compatible functions.
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+ esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1+=\$2"
+}
+_LT_EOF
+ ;;
+ *)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+ ;;
+ esac
+
+
+ sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+ ;;
+
+ esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/conio.h
0,0 → 1,112
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_conio_h_
#define __dj_include_conio_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
 
extern int directvideo; /* ignored by gppconio */
extern int _wscroll;
 
#define _NOCURSOR 0
#define _SOLIDCURSOR 1
#define _NORMALCURSOR 2
 
struct text_info {
unsigned char winleft;
unsigned char wintop;
unsigned char winright;
unsigned char winbottom;
unsigned char attribute;
unsigned char normattr;
unsigned char currmode;
unsigned char screenheight;
unsigned char screenwidth;
unsigned char curx;
unsigned char cury;
};
 
enum text_modes { LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7, C4350=64 };
 
enum COLORS {
/* dark colors */
BLACK,
BLUE,
GREEN,
CYAN,
RED,
MAGENTA,
BROWN,
LIGHTGRAY,
/* light colors */
DARKGRAY, /* "light black" */
LIGHTBLUE,
LIGHTGREEN,
LIGHTCYAN,
LIGHTRED,
LIGHTMAGENTA,
YELLOW,
WHITE
};
 
#define BLINK 0x80 /* blink bit */
 
void blinkvideo(void);
char * cgets(char *_str);
void clreol(void);
void clrscr(void);
int _conio_kbhit(void); /* checks for ungetch char */
int cprintf(const char *_format, ...) __attribute__((format(printf,1,2)));
int cputs(const char *_str);
int cscanf(const char *_format, ...) __attribute__((format(scanf,1,2)));
void delline(void);
int getch(void);
int getche(void);
int gettext(int _left, int _top, int _right, int _bottom, void *_destin);
void gettextinfo(struct text_info *_r);
void gotoxy(int _x, int _y);
void gppconio_init(void);
void highvideo(void);
void insline(void);
void intensevideo(void);
void lowvideo(void);
int movetext(int _left, int _top, int _right, int _bottom, int _destleft, int _desttop);
void normvideo(void);
int putch(int _c);
int puttext(int _left, int _top, int _right, int _bottom, void *_source);
void _setcursortype(int _type);
void _set_screen_lines(int _nlines);
void textattr(int _attr);
void textbackground(int _color);
void textcolor(int _color);
void textmode(int _mode);
int ungetch(int);
int wherex(void);
int wherey(void);
void window(int _left, int _top, int _right, int _bottom);
 
#define kbhit _conio_kbhit /* Who ever includes gppconio.h probably
also wants _conio_kbhit and not kbhit
from libc */
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_conio_h_ */
/contrib/media/updf/include/console.c
0,0 → 1,144
#include<menuet/os.h>
 
 
///===========================
 
#define CON_COLOR_BLUE 1
#define CON_COLOR_GREEN 2
#define CON_COLOR_RED 4
#define CON_COLOR_BRIGHT 8
/* öâåò ôîíà */
#define CON_BGR_BLUE 0x10
#define CON_BGR_GREEN 0x20
#define CON_BGR_RED 0x40
#define CON_BGR_BRIGHT 0x80
 
///===========================
#define _stdcall __attribute__((stdcall))
#define __stdcall __attribute__((stdcall))
#define _cdecl __attribute__((cdecl))
#define __cdecl __attribute__((cdecl))
 
 
 
 
 
void (* _stdcall con_init)(unsigned w_w, unsigned w_h, unsigned s_w, unsigned s_h, const char* t);
void (* _cdecl printf)(const char* format,...);
void (* _stdcall _exit2)(char bCloseWindow);
void (* __stdcall gets)(char* str, int n);
int (* __stdcall getch)(void);
int (* __stdcall con_get_font_height)(void);
int (* __stdcall con_set_cursor_height)(int new_height);
unsigned (*__stdcall con_get_flags)(void);
unsigned (*__stdcall con_set_flags)(unsigned new_flags);
void (*__stdcall con_cls)(void);
 
typedef struct
{
unsigned p00 __attribute__((packed));
unsigned p04 __attribute__((packed));
unsigned p08 __attribute__((packed));
unsigned p12 __attribute__((packed));
unsigned p16 __attribute__((packed));
char p20 __attribute__((packed));
char *p21 __attribute__((packed));
} kol_struct70 __attribute__((packed));
 
typedef struct
{
char *name __attribute__((packed));
void *data __attribute__((packed));
} kol_struct_import __attribute__((packed));
 
///===========================
 
void kol_exit()
{
asm ("int $0x40"::"a"(-1));
}
 
int kol_file_70(kol_struct70 *k)
{
asm ("int $0x40"::"a"(70), "b"(k));
}
 
 
 
void* kol_cofflib_procload (kol_struct_import *imp, char *name)
{
int i;
for (i=0;;i++)
if ( NULL == ((imp+i) -> name))
break;
else
if ( 0 == strcmp(name, (imp+i)->name) )
return (imp+i)->data;
return NULL;
}
 
 
 
 
void CONSOLE_INIT(char title[])
{
kol_struct_import *imp;
 
__menuet__debug_out ("console init");
imp = __kolibri__cofflib_load("/sys/lib/console.obj");
if (imp == NULL)
{__menuet__debug_out ("imp NULL"); kol_exit();}
 
con_init = ( _stdcall void (*)(unsigned, unsigned, unsigned, unsigned, const char*))
kol_cofflib_procload (imp, "con_init");
if (con_init == NULL)
{__menuet__debug_out ("con init failed"); kol_exit();}
 
printf = ( _cdecl void (*)(const char*,...))
kol_cofflib_procload (imp, "con_printf");
if (printf == NULL)
kol_exit();
 
_exit2 = ( _stdcall void (*)(char))
kol_cofflib_procload (imp, "con_exit");
if (_exit2 == NULL)
kol_exit();
 
gets = ( _stdcall void (*)(char*, int))
kol_cofflib_procload (imp, "con_gets");
if (gets == NULL)
kol_exit();
 
getch = ( _stdcall int (*)(void))
kol_cofflib_procload (imp, "con_getch2");
if (getch == NULL)
kol_exit();
 
con_get_font_height = ( _stdcall int (*)(void))
kol_cofflib_procload (imp, "con_get_font_height");
if (con_get_font_height == NULL)
kol_exit();
 
con_set_cursor_height = ( _stdcall int (*)(int))
kol_cofflib_procload (imp, "con_set_cursor_height");
if (con_set_cursor_height == NULL)
kol_exit();
 
con_get_flags = ( _stdcall unsigned (*)(void))
kol_cofflib_procload (imp, "con_get_flags");
if (con_get_flags == NULL)
kol_exit();
 
con_set_flags = ( _stdcall unsigned (*)(unsigned))
kol_cofflib_procload (imp, "con_set_flags");
if (con_set_flags == NULL)
kol_exit();
 
con_cls = ( _stdcall void (*)(void))
kol_cofflib_procload (imp, "con_cls");
if (con_cls == NULL)
kol_exit();
 
__menuet__debug_out ("success");
con_init(-1, -1, -1, -1, title);
}
/contrib/media/updf/include/core_yacasmain.h
0,0 → 1,8
CORE_KERNEL_FUNCTION("Exit",LispExit,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsExitRequested",LispExitRequested,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("HistorySize",LispHistorySize,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("StaSiz",LispStackSize,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsPromptShown",LispIsPromptShown,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("ReadCmdLineString",LispReadCmdLineString,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("GetTime",LispTime,1,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("FileSize",LispFileSize,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
/contrib/media/updf/include/corefunctions.h
0,0 → 1,251
//
// declare the core functions that have special syntax
//
 
OPERATOR(bodied,KMaxPrecedence,While)
OPERATOR(bodied,KMaxPrecedence,Rule)
OPERATOR(bodied,KMaxPrecedence,MacroRule)
OPERATOR(bodied,KMaxPrecedence,RulePattern)
OPERATOR(bodied,KMaxPrecedence,MacroRulePattern)
OPERATOR(bodied,KMaxPrecedence,FromFile)
OPERATOR(bodied,KMaxPrecedence,FromString)
OPERATOR(bodied,KMaxPrecedence,ToFile)
OPERATOR(bodied,KMaxPrecedence,ToString)
OPERATOR(bodied,KMaxPrecedence,ToStdout)
OPERATOR(bodied,KMaxPrecedence,TraceRule)
OPERATOR(bodied,KMaxPrecedence,Subst)
OPERATOR(bodied,KMaxPrecedence,LocalSymbols)
OPERATOR(bodied,KMaxPrecedence,BackQuote)
OPERATOR(prefix,0,`)
OPERATOR(prefix,0,@)
OPERATOR(prefix,0,_)
OPERATOR(infix,0,_)
 
 
//
// Evaluation direction.
//
CORE_KERNEL_FUNCTION("Hold",LispQuote,1,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Eval",LispEval,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
 
//
// Input/output functions
//
CORE_KERNEL_FUNCTION("Write",LispWrite,1,YacasEvaluator::Function | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION("WriteString",LispWriteString,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("FullForm",LispFullForm,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DefaultDirectory",LispDefaultDirectory,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("FromFile",LispFromFile,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("FromString",LispFromString,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Read",LispRead,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("ReadToken",LispReadToken,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("ToFile",LispToFile,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("ToString",LispToString,1,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("ToStdout",LispToStdout,1,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Load",LispLoad,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
 
//
// Variable setting/clearing
//
CORE_KERNEL_FUNCTION("Set",LispSetVar,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MacroSet",LispMacroSetVar,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
// MacroClear is the same as Clear, but with its arguments evaluated first
CORE_KERNEL_FUNCTION("Clear",LispClearVar,1,YacasEvaluator::Macro | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION("MacroClear",LispClearVar,1,YacasEvaluator::Function | YacasEvaluator::Variable)
 
CORE_KERNEL_FUNCTION("Local",LispNewLocal,1,YacasEvaluator::Macro | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION("MacroLocal",LispNewLocal,1,YacasEvaluator::Function | YacasEvaluator::Variable)
 
//
// List and compound object manipulation
//
CORE_KERNEL_FUNCTION("Head",LispHead,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathNth",LispNth,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Tail",LispTail,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DestructiveReverse",LispDestructiveReverse,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Length",LispLength,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("List",LispList,1,YacasEvaluator::Macro | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION("UnList",LispUnList,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Listify",LispListify,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Concat",LispConcatenate,1,YacasEvaluator::Function | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION("ConcatStrings",LispConcatenateStrings,1,YacasEvaluator::Function | YacasEvaluator::Variable)
 
CORE_KERNEL_FUNCTION("Delete",LispDelete,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DestructiveDelete",LispDestructiveDelete,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Insert",LispInsert,3,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DestructiveInsert",LispDestructiveInsert,3,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Replace",LispReplace,3,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DestructiveReplace",LispDestructiveReplace,3,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Atom",LispAtomize,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("String",LispStringify,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("CharString",LispCharString,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("FlatCopy",LispFlatCopy,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
 
//???CORE_KERNEL_FUNCTION("",LispNoCacheConcatenateStrings)
 
//
// Program control flow
//
CORE_KERNEL_FUNCTION("Prog",LispProgBody,1,YacasEvaluator::Macro | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION("While",LispWhile,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("If",LispIf,2,YacasEvaluator::Macro | YacasEvaluator::Variable)
//
// Error handling
//
CORE_KERNEL_FUNCTION("Check",LispCheck,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("TrapError",LispTrapError,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("GetCoreError",LispGetCoreError,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
 
//
// User function definition
//
CORE_KERNEL_FUNCTION("Prefix",LispPreFix,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Infix",LispInFix,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Postfix",LispPostFix,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Bodied",LispBodied,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("RuleBase",LispRuleBase,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MacroRuleBase",LispMacroRuleBase,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("RuleBaseListed",LispRuleBaseListed,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MacroRuleBaseListed",LispMacroRuleBaseListed,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DefMacroRuleBase",LispDefMacroRuleBase,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DefMacroRuleBaseListed",LispDefMacroRuleBaseListed,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("HoldArg",LispHoldArg,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Rule",LispNewRule,5,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MacroRule",LispMacroNewRule,5,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("UnFence",LispUnFence,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Retract",LispRetract,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
//
// Predicates
//
CORE_KERNEL_FUNCTION("MathNot",LispNot,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION_ALIAS("Not",LispNot,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathAnd",LispLazyAnd,1,YacasEvaluator::Macro | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION_ALIAS("And",LispLazyAnd,1,YacasEvaluator::Macro | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION("MathOr",LispLazyOr,1,YacasEvaluator::Macro | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION_ALIAS("Or",LispLazyOr,1,YacasEvaluator::Macro | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION("Equals",LispEquals,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION_ALIAS("=",LispEquals,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("LessThan",LispLessThan,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("GreaterThan",LispGreaterThan,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsFunction",LispIsFunction,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsAtom",LispIsAtom,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsNumber",LispIsNumber,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsInteger",LispIsInteger,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsList",LispIsList,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsString",LispIsString,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsBound",LispIsBound,1,YacasEvaluator::Macro | YacasEvaluator::Fixed)
//
// Math functions (REQUIRING number inputs);.
//
CORE_KERNEL_FUNCTION("MathMultiply",LispMultiply,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathAdd",LispAdd,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathSubtract",LispSubtract,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathDivide",LispDivide,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Builtin'Precision'Set",YacasBuiltinPrecisionSet,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathGetExactBits",LispGetExactBits,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathSetExactBits",LispSetExactBits,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathBitCount",LispBitCount,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathSign",LispMathSign,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathIsSmall",LispMathIsSmall,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathNegate",LispMathNegate,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathFloor",LispFloor,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathCeil",LispCeil,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathAbs",LispAbs,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathMod",LispMod,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathDiv",LispDiv,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("BitsToDigits",LispBitsToDigits,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DigitsToBits",LispDigitsToBits,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathGcd",LispGcd,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("SystemCall",LispSystemCall,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("FastArcSin",LispFastArcSin,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("FastLog",LispFastLog,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("FastPower",LispFastPower,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("ShiftLeft",LispShiftLeft,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("ShiftRight",LispShiftRight,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("FromBase",LispFromBase,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("ToBase",LispToBase,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MaxEvalDepth",LispMaxEvalDepth,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DefLoad",LispDefLoad,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Use",LispUse,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("RightAssociative",LispRightAssociative,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("LeftPrecedence",LispLeftPrecedence,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("RightPrecedence",LispRightPrecedence,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsBodied",LispIsBodied,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsInfix",LispIsInFix,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsPrefix",LispIsPreFix,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("IsPostfix",LispIsPostFix,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("OpPrecedence",LispGetPrecedence,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("OpLeftPrecedence",LispGetLeftPrecedence,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("OpRightPrecedence",LispGetRightPrecedence,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Builtin'Precision'Get",YacasBuiltinPrecisionGet,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("BitAnd",LispBitAnd,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("BitOr",LispBitOr,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("BitXor",LispBitXor,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Secure",LispSecure,1,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("FindFile",LispFindFile,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("FindFunction",LispFindFunction,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
// Generic object support
CORE_KERNEL_FUNCTION("IsGeneric",LispIsGeneric,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("GenericTypeName",LispGenericTypeName,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Array'Create",GenArrayCreate,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Array'Size",GenArraySize,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Array'Get",GenArrayGet,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Array'Set",GenArraySet,3,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("CustomEval",LispCustomEval,4,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("CustomEval'Expression",LispCustomEvalExpression,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("CustomEval'Result",LispCustomEvalResult,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("CustomEval'Locals",LispCustomEvalLocals,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("CustomEval'Stop",LispCustomEvalStop,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
 
CORE_KERNEL_FUNCTION("TraceRule",LispTraceRule,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("TraceStack",LispTraceStack,1,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("LispRead",LispReadLisp,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("LispReadListed",LispReadLispListed,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Type",LispType,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("StringMid'Get",YacasStringMidGet,3,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("StringMid'Set",YacasStringMidSet,3,YacasEvaluator::Function | YacasEvaluator::Fixed)
// Pattern matching
CORE_KERNEL_FUNCTION("Pattern'Create",GenPatternCreate,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Pattern'Matches",GenPatternMatches,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("RuleBaseDefined",LispRuleBaseDefined,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DefLoadFunction",LispDefLoadFunction,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("RuleBaseArgList",LispRuleBaseArgList,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("RulePattern",LispNewRulePattern,5,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MacroRulePattern",LispMacroNewRulePattern,5,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Subst",LispSubst,3,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("LocalSymbols",LispLocalSymbols,1,YacasEvaluator::Macro | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION("FastIsPrime",LispFastIsPrime,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("MathFac",LispFac,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("ApplyPure",LispApplyPure,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("PrettyReader'Set",YacasPrettyReaderSet,1,YacasEvaluator::Function | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION("PrettyReader'Get",YacasPrettyReaderGet,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("PrettyPrinter'Set",YacasPrettyPrinterSet,1,YacasEvaluator::Function | YacasEvaluator::Variable)
CORE_KERNEL_FUNCTION("PrettyPrinter'Get",YacasPrettyPrinterGet,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("GarbageCollect",LispGarbageCollect,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("SetGlobalLazyVariable",LispSetGlobalLazyVariable,2,YacasEvaluator::Macro | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("PatchLoad",LispPatchLoad,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("PatchString",LispPatchString,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("ExtraInfo'Set",YacasExtraInfoSet,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("ExtraInfo'Get",YacasExtraInfoGet,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DefaultTokenizer",LispDefaultTokenizer,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("CommonLispTokenizer",LispCommonLispTokenizer,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("XmlTokenizer",LispXmlTokenizer,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("XmlExplodeTag",LispExplodeTag,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("Builtin'Assoc",YacasBuiltinAssoc,2,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("CurrentFile",LispCurrentFile,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("CurrentLine",LispCurrentLine,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("`",LispBackQuote,1,YacasEvaluator::Macro | YacasEvaluator::Fixed)
 
//
// Debugging functions
//
CORE_KERNEL_FUNCTION("MathDebugInfo",LispDumpBigNumberDebugInfo,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("InDebugMode",LispInDebugMode,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DebugFile",LispDebugFile,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
CORE_KERNEL_FUNCTION("DebugLine",LispDebugLine,1,YacasEvaluator::Function | YacasEvaluator::Fixed)
 
//
// Information functions
//
CORE_KERNEL_FUNCTION("Version",LispVersion,0,YacasEvaluator::Function | YacasEvaluator::Fixed)
 
/contrib/media/updf/include/crc32.h
0,0 → 1,8
 
long crc32val;
 
void UpdateCRC(unsigned char *s,
register int len);
 
/* update running CRC calculation with contents of a buffer */
 
/contrib/media/updf/include/crt0.h
0,0 → 1,191
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_crt0_h_
#define __dj_include_crt0_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/*****************************************************************************\
* crt0.h - specific to go32 v2.0 applications, controls command line
* argument creation.
\*****************************************************************************/
 
/*****************************************************************************\
* If the application wishes to provide a wildcard expansion function,
* it should define a __crt0_glob_function function. It should return
* a list of the expanded values, or 0 if no expansion will occur.
* The startup code will free the returned pointer if it is nonzero.
*
* If no expander function is provided, wildcards will be expanded in
* the POSIX.1 style. To disable expansion, provide a __crt0_glob_function
* that always returns 0.
*
* Applications that do not rely on environment variables can provide an
* alternate version of __crt0_load_environment_file that does nothing.
*
* Applications that do not rely on arguments passed to main() can
* provide an alternate version of __crt0_setup_arguments() that does
* nothing.
\*****************************************************************************/
 
extern char *__dos_argv0;
extern int __crt0_argc;
extern char **__crt0_argv;
 
void __crt0_load_environment_file(char *_app_name);
void __crt0_setup_arguments(void);
char **__crt0_glob_function(char *_arg);
 
/*****************************************************************************\
*
* To set any of these startup flags, add the following declaration to
* *your* source code:
*
* int _crt0_startup_flags = _CRT0_FLAG_* | _CRT0_FLAG_*;
*
* The default is all flags off.
*
\*****************************************************************************/
 
extern int _crt0_startup_flags;
 
/* If set, argv[0] is left in whatever case it was. If not set, all
** characters are mapped to lower case. Note that if the argv0 field in
** the stubinfo structure is present, the case of that part of argv0 is not
** affected.
*/
#define _CRT0_FLAG_PRESERVE_UPPER_CASE 0x0001
 
/* If set, reverse slashes (dos-style) are preserved in argv[0]. If not
** set, all reverse slashes are replaced with unix-style slashes.
*/
#define _CRT0_FLAG_USE_DOS_SLASHES 0x0002
 
/* If set, the .EXE suffix is removed from the file name component of
** argv[0]. If not set, the suffix remains.
*/
#define _CRT0_FLAG_DROP_EXE_SUFFIX 0x0004
 
/* If set, the drive specifier (ex: `C:') is removed from the beginning of
** argv[0] (if present). If not set, the drive specifier remains.
*/
#define _CRT0_FLAG_DROP_DRIVE_SPECIFIER 0x0008
 
/* If set, response files (ex: @gcc.rf) are not expanded. If not set, the
** contents of the response files are used to create arguments. Note that
** if the file does not exist, that argument remains unexpanded.
*/
#define _CRT0_FLAG_DISALLOW_RESPONSE_FILES 0x0010
 
/* If set, fill sbrk()'d memory with a constant value. If not, memory
** gets whatever happens to have been in there, which breaks some
** applications.
*/
#define _CRT0_FLAG_FILL_SBRK_MEMORY 0x0020
 
/* If set, fill memory (above) with 0xdeadbeef, else fill with zero.
** This is especially useful for debugging uninitialized memory problems.
*/
#define _CRT0_FLAG_FILL_DEADBEEF 0x0040
 
/* If set, set DS limit to 4GB which allows use of near pointers to DOS
** (and other) memory. WARNING, disables memory protection and bad pointers
** may crash the machine or wipe out your data.
*/
#define _CRT0_FLAG_NEARPTR 0x0080
 
/* If set, disable NULL pointer protection (if it can be controlled at all).
*/
#define _CRT0_FLAG_NULLOK 0x0100
 
/* If set, enabled capture of NMI in exception code. This may cause problems
** with laptops and "green" boxes which use it to wake up. Default is to
** leave NMIs alone and pass through to real mode code. You decide.
*/
#define _CRT0_FLAG_NMI_SIGNAL 0x0200
 
/* If set, disable usage of long file name functions even on systems
** (such as Win95) which support them. This might be needed to work
** around program assumptions on file name format on programs written
** specifically for DOS.
*/
#define _CRT0_FLAG_NO_LFN 0x0400
 
/* If set, chooses an sbrk() algorithm. If your code requires one type
** or the other, set the value (since the default may change). The non-move
** sbrk makes sure the base of CS/DS/SS does not change. Each new sbrk()
** allocation is put in a different DPMI memory block. This works best with
** DOS programs which would like to use near pointers or hardware interrupts.
** The unix sbrk resizes a single memory block, so programs making assumptions
** about unix-like sbrk behavior may run better with this choice.
*/
#define _CRT0_FLAG_NONMOVE_SBRK 0x0000 /* Default */
#define _CRT0_FLAG_UNIX_SBRK 0x0800
 
/* If set, locks all memory as it is allocated. This effectively disables
** virtual memory, and may be useful if using extensive hardware interrupt
** codes in a relatively small image size. The memory is locked after it
** is sbrk()ed, so the locking may fail. This bit may be set or cleared
** during execution. When sbrk() uses multiple memory zones, it can be
** difficult to lock all memory since the memory block size and location is
** impossible to determine.
*/
 
#define _CRT0_FLAG_LOCK_MEMORY 0x1000
 
/* If set, disables all filename letter-case conversion in functions that
** traverse directories (except findfirst/findnext which always return the
** filenames exactly as found in the directory entry). When reset, all
** filenames on 8+3 MSDOS filesystems and DOS-style 8+3 filenames on LFN
** systems are converted to lower-case by functions such as `readdir',
** `getcwd', `_fixpath' and `srchpath'. Note that when this flag is set,
** ALL filenames on MSDOS systems will appear in upper-case, which is
** both ugly and will break many Unix-born programs. Use only if you know
** exactly what you are doing!
*/
 
#define _CRT0_FLAG_PRESERVE_FILENAME_CASE 0x2000
 
/* If set, the quote characters ', ", and \ will be retained in argv[]
** elements when processing command lines passed via `system'. This is
** used by `redir', and should only be needed if you want to get the
** original command line exactly as it was passed by the caller.
*/
 
#define _CRT0_FLAG_KEEP_QUOTES 0x4000
 
/*****************************************************************************\
* Access to the memory handles used by the non-move sbrk algorithm.
* The handle is the SI:DI DPMI handle; the address is the offset relative
* to the application's address space. Address will be zero unused slots > 1.
\*****************************************************************************/
 
typedef struct {
long handle;
unsigned address;
} __djgpp_sbrk_handle;
 
extern __djgpp_sbrk_handle __djgpp_memory_handle_list[256];
__djgpp_sbrk_handle *__djgpp_memory_handle(unsigned address);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_crt0_h_ */
/contrib/media/updf/include/csetjmp
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSETJMP
#include <bits/std_csetjmp.h>
#endif
/contrib/media/updf/include/csignal
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSIGNAL
#include <bits/std_csignal.h>
#endif
/contrib/media/updf/include/cstdarg
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSTDARG
#include <bits/std_cstdarg.h>
#endif
/contrib/media/updf/include/cstddef
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSTDDEF
#include <bits/std_cstddef.h>
#endif
/contrib/media/updf/include/cstdio
0,0 → 1,18
#ifndef _CSTDIO_INCLUDED
#define _CSTDIO_INCLUDED
#include <stdio.h>
class ios
{
public:
enum open_mode { in = 0x01,
out = 0x02,
ate = 0x04,
app = 0x08,
trunc = 0x10,
nocreate = 0x20,
noreplace = 0x40,
binary = 0x80 };
enum seek_dir { beg=0, cur=1, end=2 };
 
};
#endif
/contrib/media/updf/include/cstdlib
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSTDLIB
#include <bits/std_cstdlib.h>
#endif
/contrib/media/updf/include/cstring
--- ctime (nonexistent)
+++ ctime (revision 4680)
@@ -0,0 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, 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 General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _CPP_CTIME
+#include <bits/std_ctime.h>
+#endif
/contrib/media/updf/include/ctype.h
0,0 → 1,48
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_ctype_h_
#define __dj_include_ctype_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
int isalnum(int c);
int isalpha(int c);
int iscntrl(int c);
int isdigit(int c);
int isgraph(int c);
int islower(int c);
int isprint(int c);
int ispunct(int c);
int isspace(int c);
int isupper(int c);
int isxdigit(int c);
int tolower(int c);
int toupper(int c);
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#include <inlines/ctype.ha>
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
int isascii(int c);
int toascii(int c);
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#include <inlines/ctype.hd>
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_ctype_h_ */
/contrib/media/updf/include/curses.h
0,0 → 1,946
/*
***************************************************************************
* This file comprises part of PDCurses. PDCurses is Public Domain software.
* You may use this code for whatever purposes you desire. This software
* is provided AS IS with NO WARRANTY whatsoever.
* Should this software be used in another application, an acknowledgement
* that PDCurses code is used would be appreciated, but is not mandatory.
*
* Any changes which you make to this software which may improve or enhance
* it, should be forwarded to the current maintainer for the benefit of
* other users.
*
* The only restriction placed on this code is that no distribution of
* modified PDCurses code be made under the PDCurses name, by anyone
* other than the current maintainer.
*
* See the file maintain.er for details of the current maintainer.
***************************************************************************
*/
/*
$Id$
*/
/*
*----------------------------------------------------------------------
* PDCurses
*----------------------------------------------------------------------
* MH
* 950126 2.2 Added more System V R4 functions
*
* Added beta Xwindows port
*
* Changed chtype to long
*
* Incorporated panels library
*
* Support for more and newer versions of compilers
*
* MH
* 930531 2.1 Added support for djgpp
*
* Added beta Unix version
*
* Added OS/2 DLL support.
*
* Changed behaviour of overlay(), overwrite() and typeahead()
*
* 921120 2.0 Changed #if to #ifdef/#if defined to make it
* easier to add new platforms/compilers.
*
* Added System V colour support.
*
* Added OS/2 port.
*-------
* Frotz
* 911221 2.0 pre-beta Changed back from short to int. (int is the
* correct size for the default platform. Short
* might be too short on some platforms. This
* is more portable. I, also, made this mistake.)
*
* Many functions are now macros. If you want
* the real thing, #undef the macro. (X/Open
* requirement.)
*
* Merged many sources into current release.
*
* Added many X/Open routines (not quite all yet).
*
* Added internal documentation to all routines.
*
* Added a HISTORY file to the environment.
*
* Added a CONTRIB file to the environment.
*-------
* bl 900114 1.4 Window origin mod in overlay() and overwrite(), on
* public (and very reasonable) request. Swapped
* #define'd values of OK and ERR; OK now 1, and
* ERR is 0/NULL. Conforms better to UNIX
* versions. borderchars[] removed from WINDOW
* struct since the border() functions were
* redefined. Use of short wherever possible.
* Portability improvements, mispelled name of
* [w]setscrreg().
*
* 881005 1.3 All modules lint-checked with MSC '-W3' and
* turbo'C' '-w -w-pro' switches. Support for
* border(), wborder() functions.
*
* 881002 1.2 Rcsid[] string in all modules, for maintenance.
*
* 880306 1.1 'Raw' output routines, revision info in curses.h.
*
* 870515 1.0 Initial Release.
*
*----------------------------------------------------------------------
*/
 
#ifndef __PDCURSES__
#define __PDCURSES__ 1
 
/*man-start*********************************************************************
 
All defines are "defined" here. All compiler and environment
specific definitions are defined into generic class defines.
These defines are to be given values so that the code can
rely on #if, rather than a complicated set of #if defined() or
#ifdefs...
 
PDCurses definitions list: (Only define those needed)
 
REGISTERWINDOWS True for auto window update registery.
FAST_VIDEO True if display is memory mapped, or
we can utilize the fast video update routines.
DOS True if compiling for DOS.
OS2 True if compiling for OS/2.
FLEXOS True if compiling for Flexos.
HC True if using a Metaware compiler.
TC True if using a Borland compiler.
MSC True if using a Microsoft compiler.
ANSI True if the compiler supports ANSI C and
(full or mixed) prototypes.
CPLUSPLUS True if the compiler supports C++.
 
PDCurses portable platform definitions list:
 
PDCurses Enables access to PDCurses-only routines.
XOPEN Always true.
SYSV True if you are compiling for SYSV portability.
BSD True if you are compiling for BSD portability.
INTERNAL Enables access to internal PDCurses routines.
PDCURSES_WCLR Makes behaviour of wclrtoeol() and wclrtoeof()
unique to PDCurses. By default Unix behavior is set.
See notes in wclrtoeol() and wclrtoeof().
**man-end**********************************************************************/
 
#define PDCURSES 1 /* PDCurses-only routines */
#define XOPEN 1 /* X/Open Curses routines */
#define SYSV 1 /* System V Curses routines */
#define BSD 1 /* BSD Curses routines */
#define INTERNAL 1 /* PDCurses Internal routines */
 
 
#ifdef __MENUET_CURSES__
 
#undef DOS
#undef LINUX
#undef UNIX
#define MENUETOS 1
#define ANSI 1
#define CURSES__32BIT__
#ifdef _cplusplus
#define CPLUSPLUS 1
#endif
#define NO_VSSCANF 1
#endif
 
/*---------------------------------------------------------------------*/
#include <stdio.h> /* Required by X/Open usage below */
/*----------------------------------------------------------------------
*
* PDCurses Manifest Constants
*
*/
#ifndef FALSE /* booleans */
# define FALSE 0
#endif
#ifndef TRUE /* booleans */
# define TRUE !FALSE
#endif
#ifndef NULL
# define NULL ((void*)0) /* Null pointer */
#endif
#ifndef ERR
# define ERR 0 /* general error flag */
#endif
#ifndef OK
# define OK 1 /* general OK flag */
#endif
 
 
 
 
/*----------------------------------------------------------------------
*
* PDCurses Type Declarations
*
*/
typedef unsigned char bool; /* PDCurses Boolean type */
typedef unsigned short chtype; /* 8-bit attr + 8-bit char */
 
 
 
/*----------------------------------------------------------------------
*
* PDCurses Structure Definitions:
*
*/
typedef struct _win /* definition of a window. */
{
int _cury; /* current pseudo-cursor */
int _curx;
int _maxy; /* max window coordinates */
int _maxx;
int _pmaxy; /* max physical size */
int _pmaxx;
int _begy; /* origin on screen */
int _begx;
int _lastpy; /* last y coordinate of upper left pad display area */
int _lastpx; /* last x coordinate of upper left pad display area */
int _lastsy1; /* last upper y coordinate of screen window for pad */
int _lastsx1; /* last upper x coordinate of screen window for pad */
int _lastsy2; /* last lower y coordinate of screen window for pad */
int _lastsx2; /* last lower x coordinate of screen window for pad */
int _flags; /* window properties */
chtype _attrs; /* standard A_STANDOUT attributes and colors */
chtype _bkgd; /* wrs(4/6/93) background, normally blank */
int _tabsize; /* tab character size */
bool _clear; /* causes clear at next refresh */
bool _leave; /* leaves cursor as it happens */
bool _scroll; /* allows window scrolling */
bool _nodelay; /* input character wait flag */
bool _immed; /* immediate update flag */
bool _use_keypad; /* flags keypad key mode active */
bool _use_idl; /* True if Ins/Del line can be used*/
bool _use_idc; /* True if Ins/Del character can be used*/
chtype**_y; /* pointer to line pointer array */
int* _firstch; /* first changed character in line */
int* _lastch; /* last changed character in line */
int _tmarg; /* top of scrolling region */
int _bmarg; /* bottom of scrolling region */
char* _title; /* window title */
char _title_ofs; /* window title offset from left */
chtype _title_attr; /* window title attributes */
chtype _blank; /* window's blank character */
int _parx, _pary; /* coords relative to parent (0,0) */
struct _win* _parent; /* subwin's pointer to parent win */
} WINDOW;
 
 
 
/*----------------------------------------------------------------------
*
* Private structures that are necessary for correct
* macro construction.
*
*/
 
#ifdef REGISTERWINDOWS
typedef struct _ref /* Refresh Window Structure */
{
WINDOW* win;
struct _ref* next;
struct _ref* tail;
} ACTIVE;
 
typedef struct _wins
{
WINDOW* w; /* pointer to a visible window */
struct _wins* next; /* Next visible window pointer */
struct _wins* prev; /* Next visible window pointer */
struct _wins* tail; /* Last visible window pointer */
/* Only head window (stdscr) has */
/* a valid tail pointer. */
} WINDS;
#endif
 
 
 
 
typedef struct
{
bool alive; /* TRUE if already opened. */
bool autocr; /* if lf -> crlf */
bool cbreak; /* if terminal unbuffered */
bool echo; /* if terminal echo */
bool raw_inp; /* raw input mode (v. cooked input) */
bool raw_out; /* raw output mode (7 v. 8 bits) */
bool refrbrk; /* if premature refresh brk allowed */
bool orgcbr; /* original MSDOS ^-BREAK setting */
bool visible_cursor; /* TRUE if cursor is visible */
bool audible; /* FALSE if the bell is visual */
bool full_redraw; /* TRUE for bad performance */
bool direct_video; /* Allow Direct Screen Memory writes*/
bool mono; /* TRUE if current screen is mono. */
bool sizeable; /* TRUE if adapter is resizeable. */
bool bogus_adapter; /* TRUE if adapter has insane values*/
bool shell; /* TRUE if reset_prog_mode() needs */
/* to be called. */
chtype blank; /* Background character */
chtype orig_attr; /* Original screen attributes */
int cursrow; /* position of physical cursor */
int curscol; /* position of physical cursor */
int cursor; /* Current Cursor definition */
int visibility; /* Visibility of cursor */
int video_page; /* Current PC video page */
int orig_emulation; /* Original cursor emulation value */
int orig_cursor; /* Original cursor size */
int font; /* default font size */
int orig_font; /* Original font size */
int lines; /* New value for LINES */
int cols; /* New value for COLS */
int emalloc; /* 0x0C0C if initscr() is to reset */
/* this value to TRUE; */
/* TRUE only if emalloc()/ecalloc() */
/* are is to be used; */
/* FALSE if malloc()/calloc() are */
/* to be used. */
int tahead; /* Type-ahead value */
int adapter; /* Screen type */
#ifdef UNIX
int adapter; /* Screen type */
int number_keys; /* number of function keys */
char *key_seq[200]; /* key sequence ptr for function keys */
int key_num[200]; /* key numbers for function keys */
#endif
 
} SCREEN;
 
 
 
 
 
/* external variables */
extern int LINES; /* terminal height */
extern int COLS; /* terminal width */
extern WINDOW* stdscr; /* the default screen window */
extern SCREEN _cursvar; /* curses variables */
 
#if defined (INTERNAL) | defined (CURSES_LIBRARY)
extern WINDOW* curscr; /* the current screen image */
extern int _default_lines; /* For presetting maximum lines */
#endif
 
#ifdef REGISTERWINDOWS
extern ACTIVE* CurWins; /* Currently Visible Windows */
#endif
 
 
 
 
/*man-start*********************************************************************
 
PDCurses Text Attributes:
 
To include colour in PDCurses, a number of things had to be sacrificed
from the strict Unix and System V support.
The main problem is fitting all character attributes and colour into
an unsigned char (all 8 bits!). On System V, chtype is a long on
PDCurses it is a short int.
 
The following is the structure of a win->_attrs chtype:
 
-------------------------------------------------
|15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
-------------------------------------------------
colour number | attrs | character eg 'a'
 
the high order char is an index into an array of physical colours
(defined in INITPAIR.c). 32 (5 bits) foreground/background colour
combinations combined with 8 (3 bits) attribute modifiers are
available.
 
The available attribute enhancers are bold, reverse and blink.
All other Unix attributes have no effect as attributes. This
limitation may be overcome in future releases by expanding chtype
to a long.
 
**man-end**********************************************************************/
 
/* Video attribute definitions. */
#define A_NORMAL (chtype)0x0000 /* SysV */
#define A_ALTCHARSET (chtype)0x0000 /* X/Open */
#define A_BLINK (chtype)0x0400 /* X/Open */
#define A_BLANK (chtype)0x0000 /* X/Open */
#define A_BOLD (chtype)0x0100 /* X/Open */
#define A_DIM (chtype)0x0000 /* X/Open */
#define A_PROTECT (chtype)0x0000 /* X/Open */
#define A_REVERSE (chtype)0x0200 /* X/Open */
#define A_STANDOUT ((chtype)(A_REVERSE | A_BOLD)) /* X/Open */
#define A_UNDERLINE (chtype)0x0000 /* X/Open */
#define A_COLOR (chtype)0xF800 /*System V */
#define A_CHARTEXT (chtype)(0xFF) /* X/Open */
#define A_ATTRIBUTES (chtype)(~A_CHARTEXT) /* X/Open */
 
#define CHR_MSK A_CHARTEXT /* Obsolete */
#define ATR_MSK A_ATTRIBUTES /* Obsolete */
#define ATR_NRM A_NORMAL /* Obsolete */
 
#define ACS_ULCORNER (chtype)0xda /* SysV */
#define ACS_LLCORNER (chtype)0xc0 /* SysV */
#define ACS_URCORNER (chtype)0xbf /* SysV */
#define ACS_LRCORNER (chtype)0xd9 /* SysV */
#define ACS_RTEE (chtype)0xb4 /* SysV */
#define ACS_LTEE (chtype)0xc3 /* SysV */
#define ACS_BTEE (chtype)0xc1 /* SysV */
#define ACS_TTEE (chtype)0xc2 /* SysV */
#define ACS_HLINE (chtype)0xc4 /* SysV */
#define ACS_VLINE (chtype)0xb3 /* SysV */
#define ACS_PLUS (chtype)0xc5 /* SysV */
#define ACS_S1 (chtype)0x2d /* SysV */
#define ACS_S9 (chtype)0x5f /* SysV */
#define ACS_DIAMOND (chtype)0xc5 /* SysV */
#define ACS_CKBOARD (chtype)0xb2 /* SysV */
#define ACS_DEGREE (chtype)0xf8 /* SysV */
#define ACS_PLMINUS (chtype)0xf1 /* SysV */
#define ACS_BULLET (chtype)0xf9 /* SysV */
#define ACS_LARROW (chtype)0x3c /* SysV */
#define ACS_RARROW (chtype)0x3e /* SysV */
#define ACS_DARROW (chtype)0x76 /* SysV */
#define ACS_UARROW (chtype)0x5e /* SysV */
#define ACS_BOARD (chtype)0x23 /* SysV */
#define ACS_LANTERN (chtype)0x23 /* SysV */
#define ACS_BLOCK (chtype)0x23 /* SysV */
 
# define COLOR_BLACK 0
# define COLOR_BLUE 1
# define COLOR_GREEN 2
# define COLOR_CYAN 3
# define COLOR_RED 4
# define COLOR_MAGENTA 5
# define COLOR_YELLOW 6
# define COLOR_WHITE 7
 
#define COLOR_PAIR(n) (((n) << 11) & A_ATTRIBUTES)
#define PAIR_NUMBER(n) (((n) & A_COLOR) >> 11)
 
extern int COLORS,COLOR_PAIRS;
/*----------------------------------------------------------------------
*
* Function and Keypad Key Definitions.
* Many are just for compatibility.
*
*/
#define KEY_MIN 0x101 /* Minimum curses key value */
#define KEY_BREAK 0x101 /* Not on PC KBD */
#define KEY_DOWN 0x102 /* Down arrow key */
#define KEY_UP 0x103 /* Up arrow key */
#define KEY_LEFT 0x104 /* Left arrow key */
#define KEY_RIGHT 0x105 /* Right arrow key */
#define KEY_HOME 0x106 /* home key */
#define KEY_BACKSPACE 0x107 /* not on pc */
#define KEY_F0 0x108 /* function keys. space for */
#define KEY_F(n) (KEY_F0+(n))/* 64 keys are reserved. */
#define KEY_DL 0x148 /* not on pc */
#define KEY_IL 0x149 /* insert line */
#define KEY_DC 0x14a /* delete character */
#define KEY_IC 0x14b /* insert char or enter ins mode */
#define KEY_EIC 0x14c /* exit insert char mode */
#define KEY_CLEAR 0x14d /* clear screen */
#define KEY_EOS 0x14e /* clear to end of screen */
#define KEY_EOL 0x14f /* clear to end of line */
#define KEY_SF 0x150 /* scroll 1 line forward */
#define KEY_SR 0x151 /* scroll 1 line back (reverse) */
#define KEY_NPAGE 0x152 /* next page */
#define KEY_PPAGE 0x153 /* previous page */
#define KEY_STAB 0x154 /* set tab */
#define KEY_CTAB 0x155 /* clear tab */
#define KEY_CATAB 0x156 /* clear all tabs */
#define KEY_ENTER 0x157 /* enter or send (unreliable) */
#define KEY_SRESET 0x158 /* soft/reset (partial/unreliable)*/
#define KEY_RESET 0x159 /* reset/hard reset (unreliable) */
#define KEY_PRINT 0x15a /* print/copy */
#define KEY_LL 0x15b /* home down/bottom (lower left) */
#define KEY_ABORT 0x15c /* abort/terminate key (any) */
#define KEY_SHELP 0x15d /* short help */
#define KEY_LHELP 0x15e /* long help */
#define KEY_BTAB 0x15f /* Back tab key */
#define KEY_BEG 0x160 /* beg(inning) key */
#define KEY_CANCEL 0x161 /* cancel key */
#define KEY_CLOSE 0x162 /* close key */
#define KEY_COMMAND 0x163 /* cmd (command) key */
#define KEY_COPY 0x164 /* copy key */
#define KEY_CREATE 0x165 /* create key */
#define KEY_END 0x166 /* end key */
#define KEY_EXIT 0x167 /* exit key */
#define KEY_FIND 0x168 /* find key */
#define KEY_HELP 0x169 /* help key */
#define KEY_MARK 0x16a /* mark key */
#define KEY_MESSAGE 0x16b /* message key */
#define KEY_MOVE 0x16c /* move key */
#define KEY_NEXT 0x16d /* next object key */
#define KEY_OPEN 0x16e /* open key */
#define KEY_OPTIONS 0x16f /* options key */
#define KEY_PREVIOUS 0x170 /* previous object key */
#define KEY_REDO 0x171 /* redo key */
#define KEY_REFERENCE 0x172 /* ref(erence) key */
#define KEY_REFRESH 0x173 /* refresh key */
#define KEY_REPLACE 0x174 /* replace key */
#define KEY_RESTART 0x175 /* restart key */
#define KEY_RESUME 0x176 /* resume key */
#define KEY_SAVE 0x177 /* save key */
#define KEY_SBEG 0x178 /* shifted beginning key */
#define KEY_SCANCEL 0x179 /* shifted cancel key */
#define KEY_SCOMMAND 0x17a /* shifted command key */
#define KEY_SCOPY 0x17b /* shifted copy key */
#define KEY_SCREATE 0x17c /* shifted create key */
#define KEY_SDC 0x17d /* shifted delete char key */
#define KEY_SDL 0x17e /* shifted delete line key */
#define KEY_SELECT 0x17f /* select key */
#define KEY_SEND 0x180 /* shifted end key */
#define KEY_SEOL 0x181 /* shifted clear line key */
#define KEY_SEXIT 0x182 /* shifted exit key */
#define KEY_SFIND 0x183 /* shifted find key */
#define KEY_SHOME 0x184 /* shifted home key */
#define KEY_SIC 0x185 /* shifted input key */
#define KEY_SLEFT 0x187 /* shifted left arrow key */
#define KEY_SMESSAGE 0x188 /* shifted message key */
#define KEY_SMOVE 0x189 /* shifted move key */
#define KEY_SNEXT 0x18a /* shifted next key */
#define KEY_SOPTIONS 0x18b /* shifted options key */
#define KEY_SPREVIOUS 0x18c /* shifted prev key */
#define KEY_SPRINT 0x18d /* shifted print key */
#define KEY_SREDO 0x18e /* shifted redo key */
#define KEY_SREPLACE 0x18f /* shifted replace key */
#define KEY_SRIGHT 0x190 /* shifted right arrow */
#define KEY_SRSUME 0x191 /* shifted resume key */
#define KEY_SSAVE 0x192 /* shifted save key */
#define KEY_SSUSPEND 0x193 /* shifted suspend key */
#define KEY_SUNDO 0x194 /* shifted undo key */
#define KEY_SUSPEND 0x195 /* suspend key */
#define KEY_UNDO 0x196 /* undo key */
 
/* PDCurses specific key definitions */
 
#define ALT_0 0x197 /* Alt-0 PC only */
#define ALT_1 0x198 /* Alt-1 PC only */
#define ALT_2 0x199 /* Alt-2 PC only */
#define ALT_3 0x19a /* Alt-3 PC only */
#define ALT_4 0x19b /* Alt-4 PC only */
#define ALT_5 0x19c /* Alt-5 PC only */
#define ALT_6 0x19d /* Alt-6 PC only */
#define ALT_7 0x19e /* Alt-7 PC only */
#define ALT_8 0x19f /* Alt-8 PC only */
#define ALT_9 0x1a0 /* Alt-9 PC only */
#define ALT_A 0x1a1 /* Alt-A PC only */
#define ALT_B 0x1a2 /* Alt-B PC only */
#define ALT_C 0x1a3 /* Alt-C PC only */
#define ALT_D 0x1a4 /* Alt-D PC only */
#define ALT_E 0x1a5 /* Alt-E PC only */
#define ALT_F 0x1a6 /* Alt-F PC only */
#define ALT_G 0x1a7 /* Alt-G PC only */
#define ALT_H 0x1a8 /* Alt-H PC only */
#define ALT_I 0x1a9 /* Alt-I PC only */
#define ALT_J 0x1aa /* Alt-J PC only */
#define ALT_K 0x1ab /* Alt-K PC only */
#define ALT_L 0x1ac /* Alt-L PC only */
#define ALT_M 0x1ad /* Alt-M PC only */
#define ALT_N 0x1ae /* Alt-N PC only */
#define ALT_O 0x1af /* Alt-O PC only */
#define ALT_P 0x1b0 /* Alt-P PC only */
#define ALT_Q 0x1b1 /* Alt-Q PC only */
#define ALT_R 0x1b2 /* Alt-R PC only */
#define ALT_S 0x1b3 /* Alt-S PC only */
#define ALT_T 0x1b4 /* Alt-T PC only */
#define ALT_U 0x1b5 /* Alt-U PC only */
#define ALT_V 0x1b6 /* Alt-V PC only */
#define ALT_W 0x1b7 /* Alt-W PC only */
#define ALT_X 0x1b8 /* Alt-X PC only */
#define ALT_Y 0x1b9 /* Alt-Y PC only */
#define ALT_Z 0x1ba /* Alt-Z PC only */
#define CTL_LEFT 0x1bb /* Control-Left-Arrow PC only */
#define CTL_RIGHT 0x1bc /* Control-Right-Arrow PC only */
#define CTL_PGUP 0x1bd /* Control-PgUp PC only */
#define CTL_PGDN 0x1be /* Control-PgDn PC only */
#define CTL_HOME 0x1bf /* Control-Home PC only */
#define CTL_END 0x1c0 /* Control-End PC only */
#define KEY_BACKTAB 0x1c1 /* Back-tab PC only */
 
#define KEY_A1 0x1c2 /* upper left on Virtual keypad */
#define KEY_A2 0x1c3 /* upper middle on Virt. keypad */
#define KEY_A3 0x1c4 /* upper right on Vir. keypad */
#define KEY_B1 0x1c5 /* middle left on Virt. keypad */
#define KEY_B2 0x1c6 /* center on Virt. keypad */
#define KEY_B3 0x1c7 /* middle right on Vir. keypad */
#define KEY_C1 0x1c8 /* lower left on Virt. keypad */
#define KEY_C2 0x1c9 /* lower middle on Virt. keypad */
#define KEY_C3 0x1ca /* lower right on Vir. keypad */
#define PADSLASH 0x1cb /* slash on keypad */
#define PADENTER 0x1cc /* enter on keypad */
#define CTL_PADENTER 0x1cd /* ctl-enter on keypad */
#define ALT_PADENTER 0x1ce /* alt-enter on keypad */
#define SHF_PADSTOP 0x1cf /* shift-stop on keypad */
#define PADSTAR 0x1d0 /* star on keypad */
#define PADMINUS 0x1d1 /* minus on keypad */
#define PADPLUS 0x1d2 /* plus on keypad */
#define CTL_PADSTOP 0x1d3 /* ctl-stop on keypad */
#define CTL_PADCENTER 0x1d4 /* ctl-enter on keypad */
#define CTL_PADPLUS 0x1d5 /* ctl-plus on keypad */
#define CTL_PADMINUS 0x1d6 /* ctl-minus on keypad */
#define CTL_PADSLASH 0x1d7 /* ctl-slash on keypad */
#define CTL_PADSTAR 0x1d8 /* ctl-star on keypad */
#define ALT_PADPLUS 0x1d9 /* alt-plus on keypad */
#define ALT_PADMINUS 0x1da /* alt-minus on keypad */
#define ALT_PADSLASH 0x1db /* alt-slash on keypad */
#define ALT_PADSTAR 0x1dc /* alt-star on keypad */
#define CTL_INS 0x1dd /* ctl-insert */
#define ALT_DEL 0x1de /* alt-delete */
#define ALT_INS 0x1df /* alt-insert */
#define CTL_UP 0x1e0 /* ctl-up arrow */
#define CTL_DOWN 0x1e1 /* ctl-down arrow */
#define CTL_TAB 0x1e2 /* ctl-tab */
#define ALT_TAB 0x1e3 /* alt-tab */
#define ALT_MINUS 0x1e4 /* alt-minus */
#define ALT_EQUAL 0x1e5 /* alt-equal */
#define ALT_HOME 0x1e6 /* alt-home */
#define ALT_PGUP 0x1e7 /* alt-pgup */
#define ALT_PGDN 0x1e8 /* alt-pgdn */
#define ALT_END 0x1e9 /* alt-end */
#define ALT_UP 0x1ea /* alt-up arrow */
#define ALT_DOWN 0x1eb /* alt-down arrow */
#define ALT_RIGHT 0x1ec /* alt-right arrow */
#define ALT_LEFT 0x1ed /* alt-left arrow */
#define ALT_ENTER 0x1ee /* alt-enter */
#define ALT_ESC 0x1ef /* alt-escape */
#define ALT_BQUOTE 0x1f0 /* alt-back quote */
#define ALT_LBRACKET 0x1f1 /* alt-left bracket */
#define ALT_RBRACKET 0x1f2 /* alt-right bracket */
#define ALT_SEMICOLON 0x1f3 /* alt-semi-colon */
#define ALT_FQUOTE 0x1f4 /* alt-forward quote */
#define ALT_COMMA 0x1f5 /* alt-comma */
#define ALT_STOP 0x1f6 /* alt-stop */
#define ALT_FSLASH 0x1f7 /* alt-forward slash */
#define ALT_BKSP 0x1f8 /* alt-backspace */
#define CTL_BKSP 0x1f9 /* ctl-backspace */
#define CTL_PAD0 0x1fa /* ctl-keypad 0 */
#define CTL_PAD1 0x1fb /* ctl-keypad 1 */
#define CTL_PAD2 0x1fc /* ctl-keypad 2 */
#define CTL_PAD3 0x1fd /* ctl-keypad 3 */
#define CTL_PAD4 0x1fe /* ctl-keypad 4 */
#define CTL_PAD5 0x1ff /* ctl-keypad 5 */
#define CTL_PAD6 0x200 /* ctl-keypad 6 */
#define CTL_PAD7 0x201 /* ctl-keypad 7 */
#define CTL_PAD8 0x202 /* ctl-keypad 8 */
#define CTL_PAD9 0x203 /* ctl-keypad 9 */
#define CTL_DEL 0x204 /* clt-delete */
#define ALT_BSLASH 0x205 /* alt-back slash */
#define CTL_ENTER 0x206 /* ctl-enter */
#define KEY_MOUSE 0x207 /* "mouse" key */
#define KEY_MAX KEY_MOUSE /* Maximum curses key */
 
 
/*----------------------------------------------------------------------
* PDCurses function declarations
*/
#ifdef ANSI
# ifdef CPLUSPLUS
extern "C" {
# endif
int addchnstr( chtype *, int );
int baudrate( void );
int beep( void );
int border( chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype );
char breakchar( void );
int can_change_color ( void );
int clearok( WINDOW*, bool );
int color_content( int, short*, short*, short* );
int copywin( WINDOW*, WINDOW*, int, int, int, int, int, int, int );
int curs_set( int );
int cursoff( void );
int curson( void );
int def_prog_mode( void );
int def_shell_mode( void );
int delay_output( int );
int delwin( WINDOW* );
WINDOW* derwin( WINDOW*, int, int, int, int );
int doupdate( void );
WINDOW* dupwin( WINDOW* );
int endwin( void );
char erasechar( void );
int fixterm( void );
int flash( void );
int flushinp( void );
int gettmode( void );
bool has_colors( void );
int hline( chtype, int );
int inchnstr( chtype *, int );
int init_color( short, short, short, short );
int init_pair( short, short, short );
WINDOW* initscr( void );
int intrflush( WINDOW*, bool );
int is_linetouched(WINDOW *,int);
int is_wintouched(WINDOW *);
char* keyname( int );
char killchar( void );
char* longname( void );
int meta( WINDOW*, bool );
int mvaddrawch( int, int, chtype );
int mvaddrawstr( int, int, char* );
int mvcur( int, int, int, int );
int mvderwin( WINDOW*, int, int );
int mvinsrawch( int, int, chtype );
int mvprintw( int, int, char*,... );
int mvscanw( int, int, char*,... );
int mvwin( WINDOW*, int, int );
int mvwinsrawch( WINDOW*, int, int, chtype );
int mvwprintw( WINDOW*, int, int, char*,... );
int mvwscanw( WINDOW*, int, int, char*,... );
WINDOW* newpad( int, int );
SCREEN* newterm( char*, FILE*, FILE* );
WINDOW* newwin( int, int, int, int );
int noraw( void );
int overlay( WINDOW*, WINDOW* );
int overwrite( WINDOW*, WINDOW* );
int pair_content( int, short*, short* );
int pnoutrefresh( WINDOW*, int, int, int, int, int, int );
int prefresh( WINDOW*, int, int, int, int, int, int );
int printw( char*,... );
int raw( void );
int refresh( void );
int reset_prog_mode( void );
int reset_shell_mode( void );
int resetterm( void );
int resetty( void );
int saveoldterm( void );
int saveterm( void );
int savetty( void );
int scanw( char*,... );
int scroll( WINDOW* );
SCREEN* set_term( SCREEN* );
int start_color( void );
WINDOW* subpad( WINDOW*, int, int, int, int );
WINDOW* subwin( WINDOW*, int, int, int, int );
int tabsize( int );
chtype termattrs( void );
char* termname( void );
int touchline( WINDOW*, int ,int );
int touchwin( WINDOW* );
int typeahead( int );
char* unctrl( chtype );
int vline( chtype, int );
int waddchnstr( WINDOW*, chtype*, int );
int waddnstr( WINDOW*, char*, int );
int waddrawstr( WINDOW*, char* );
int waddstr( WINDOW*, char* );
int wattroff( WINDOW*, chtype );
int wattron( WINDOW*, chtype );
int wattrset( WINDOW*, chtype );
int wbkgd(WINDOW*, chtype);
void wbkgdset(WINDOW*, chtype);
int wborder( WINDOW*, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype );
int wclear( WINDOW* );
int wclrtobot( WINDOW* );
int wclrtoeol( WINDOW* );
int wdelch( WINDOW* );
int wdeleteln( WINDOW* );
int werase( WINDOW* );
int wgetch( WINDOW* );
int wgetnstr( WINDOW*, char*, int );
int wgetstr( WINDOW*, char* );
int whline( WINDOW*, chtype, int );
int winchnstr( WINDOW*, chtype*, int );
int winnstr( WINDOW*, char*, int );
int winsch( WINDOW*, chtype );
int winsdelln( WINDOW*, int );
int winsertln( WINDOW* );
int winsnstr( WINDOW*, char*, int );
int wmove( WINDOW*, int, int );
int wnoutrefresh( WINDOW* );
char wordchar( void );
int wprintw( WINDOW*, char*,... );
int wredrawln( WINDOW*, int ,int );
int wrefresh( WINDOW* );
int wscanw( WINDOW*, char*,... );
int wscrl( WINDOW*, int );
int wsetscrreg( WINDOW*, int, int );
int wtabsize( WINDOW*, int );
int wtouchln(WINDOW *, int, int, int);
int ungetch( int );
int wvline( WINDOW*, chtype, int );
 
#ifdef PDCURSES
int raw_output( bool );
int resize_screen( int );
WINDOW* resize_window( WINDOW*, int, int );
int win_print( WINDOW*, int );
#endif
 
/*
* Keep the compiler happy with our macros below...
*/
int PDC_chadd( WINDOW*, chtype, bool, bool );
int PDC_chins( WINDOW*, chtype, bool );
 
# ifdef CPLUSPLUS
}
# endif
#endif
 
 
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
 
/*
* Functions defined as macros
*/
 
#define addch( c ) waddch( stdscr, c )
#define addchstr( c ) addchnstr( c, -1 )
#define addstr(str) waddstr( stdscr, str )
#define addnstr(str, n) waddnstr( stdscr, str, n )
#define attroff(attr) wattroff( stdscr, attr )
#define attron(attr) wattron( stdscr, attr )
#define attrset(attr) wattrset( stdscr, attr )
#define bkgd(c) wbkgd(stdscr,c)
#define bkgdset(c) wbkgdset(stdscr,c)
#define border(ls,rs,ts,bs,tl,tr,bl,br) wborder(stdscr,ls,rs,ts,bs,tl,tr,bl,br)
#define box( w, v, h ) wborder( w, v, v, h, h, 0, 0, 0, 0 )
#define clear() (clearok( stdscr, TRUE )==ERR?ERR:wclear( stdscr ))
#define clrtobot() wclrtobot( stdscr )
#define clrtoeol() wclrtoeol( stdscr )
#define delch() wdelch( stdscr )
#define deleteln() wdeleteln( stdscr )
#define derwin(w,nl,nc,by,bx) subwin((w),(nl),(nc),(by+(w)->_begy),(bx+(w)->_begx))
#define echochar(c) (addch((chtype)c)==ERR?ERR:refresh())
#define erase() werase( stdscr )
#define getbegx(w) (w)->_begx
#define getbegy(w) (w)->_begy
#define getbegyx(w,y,x) ( y = (w)->_begy, x = (w)->_begx )
#define getch() wgetch(stdscr)
#define getmaxx(w) (w)->_maxx
#define getmaxy(w) (w)->_maxy
#define getmaxyx(w,y,x) ( y = (w)->_maxy, x = (w)->_maxx )
#define getparx(w) (w)->_parx
#define getpary(w) (w)->_pary
#define getparyx(w,y,x) ( y = (w)->_pary, x = (w)->_parx )
#define getstr(str) wgetstr( stdscr, str )
#define getyx(w,y,x) ( y = (w)->_cury, x = (w)->_curx )
#define has_colors() ((_cursvar.mono) ? FALSE : TRUE)
#define idcok(w,flag) OK
#define idlok(w,flag) OK
#define inch() (stdscr->_y[stdscr->_cury][stdscr->_curx])
#define inchstr( c ) inchnstr( c, stdscr->_maxx-stdscr->_curx )
#define innstr(str,n) winnstr(stdscr,(str),(n))
#define insch( c ) winsch( stdscr, c )
#define insdelln(n) winsdelln(stdscr,n)
#define insertln() winsertln( stdscr )
#define insnstr(s,n) winsnstr(stdscr,s,n)
#define insstr(s) winsnstr(stdscr,s,(-1))
#define instr(str) winnstr(stdscr,(str),stdscr->_maxx)
#define isendwin() ((_cursvar.alive) ? FALSE : TRUE)
#define keypad(w,flag) (w->_use_keypad = flag)
#define leaveok(w,flag) (w->_leave = flag)
#define move(y,x) wmove( stdscr, y, x )
#define mvaddch(y,x,c) (move( y, x )==ERR?ERR:addch( c ))
#define mvaddchstr(y,x,c) (move( y, x )==ERR?ERR:addchnstr( c, -1 ))
#define mvaddchnstr(y,x,c,n) (move( y, x )==ERR?ERR:addchnstr( c, n ))
#define mvaddstr(y,x,str) (move( y, x )==ERR?ERR:addstr( str ))
#define mvdelch(y,x) (move( y, x )==ERR?ERR:wdelch( stdscr ))
#define mvgetch(y,x) (move( y, x )==ERR?ERR:wgetch(stdscr))
#define mvgetstr(y,x,str) (move( y, x )==ERR?ERR:wgetstr( stdscr, str ))
#define mvinch(y,x) (move( y, x )==ERR?ERR:(stdscr->_y[y][x]))
#define mvinchstr(y,x,c) (move( y, x )==ERR?ERR:inchnstr( c, stdscr->_maxx-stdscr->_curx ))
#define mvinchnstr(y,x,c,n) (move( y, x )==ERR?ERR:inchnstr( c, n ))
#define mvinsch(y,x,c) (move( y, x )==ERR?ERR:winsch( stdscr, c ))
#define mvinsnstr(y,x,s,n) (move( y, x )==ERR?ERR:winsnstr(stdscr,s,n))
#define mvinsstr(y,x,s) (move( y, x )==ERR?ERR:winsnstr(stdscr,s,(-1)))
#define mvinstr(y,x,str) (move( y, x )==ERR?ERR:winnstr(stdscr,(str),stdscr->_maxx))
#define mvinnstr(y,x,str,n) (move( y, x )==ERR?ERR:winnstr(stdscr,(str),(n)))
#define mvwaddch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:waddch( w, c ))
#define mvwaddchstr(w,y,x,c) (wmove( w, y, x )==ERR?ERR:waddchnstr( w, c, -1 ))
#define mvwaddchnstr(w,y,x,c,n) (wmove( w, y, x )==ERR?ERR:waddchnstr( w, c, n ))
#define mvwaddrawch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:waddrawch( w, c ))
#define mvwaddrawstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:waddrawstr( w, str ))
#define mvwaddstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:waddstr( w, str ))
#define mvwdelch(w,y,x) (wmove( w, y, x )==ERR?ERR:wdelch( w ))
#define mvwgetch(w,y,x) (wmove( w, y, x )==ERR?ERR:wgetch( w ))
#define mvwgetstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:wgetstr( w, str ))
#define mvwinch(w,y,x) (wmove( w, y, x )==ERR?ERR:((w)->_y[y][x]))
#define mvwinchstr(w,y,x,c) (wmove( w, y, x )==ERR?ERR:winchnstr( w, c, (w)->_maxx-(w)->_curx ))
#define mvwinchnstr(w,y,x,c,n) (wmove( w, y, x )==ERR?ERR:winchnstr( w, c, n ))
#define mvwinsch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:winsch( w, c ))
#define mvwinstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:winnstr(w,str,(w)->_maxx))
#define mvwinnstr(w,y,x,str,n) (wmove( w, y, x )==ERR?ERR:winnstr(w,str,n))
#define mvwinsnstr(w,y,x,s,n) (wmove( w, y, x )==ERR?ERR:winsnstr(w,s,n))
#define mvwinsstr(w,y,x,s) (wmove( w, y, x )==ERR?ERR:winsnstr(w,s,(-1)))
#define napms(ms) delay_output(ms)
#define nl() (_cursvar.autocr = TRUE)
#define nonl() (_cursvar.autocr = FALSE)
#define notimeout(w,flag) (OK)
#define pechochar(w,c) (waddch(w,(chtype)c)==ERR?ERR:prefresh(w))
#define redrawwin(w) wredrawln((w),0,(win)->_maxy)
#define refrbrk(flag) (_cursvar.refrbrk = flag)
#define refresh() wrefresh( stdscr )
#define scrl(n) wscrl(stdscr,n)
#define scroll(w) wscrl((w),1)
#define scrollok(w,flag) ((w)->_scroll = flag)
#define setscrreg(top, bot) wsetscrreg( stdscr, top, bot )
#define standend() wattrset(stdscr, A_NORMAL)
#define standout() wattrset(stdscr, A_STANDOUT)
#define touchline(w,y,n) wtouchln((w),(y),(n),TRUE)
#define touchwin(w) wtouchln((w),0,(w)->_maxy,TRUE)
#define traceoff() {trace_on = FALSE;}
#define traceon() {trace_on = TRUE;}
#define untouchwin(w) wtouchln((w),0,((w)->_maxy),FALSE)
#define waddch(w, c) PDC_chadd( w, (chtype)c, (bool)!(_cursvar.raw_out), TRUE )
#define waddchstr(w, c) (waddchnstr( w, c, -1 ) )
#define wclear(w) ( werase( w )==ERR?ERR:((w)->_clear = TRUE))
#define wechochar(w,c) (waddch(w,(chtype)c)==ERR?ERR:wrefresh(w))
#define winch(w) ((w)->_y[(w)->_cury][(w)->_curx])
#define winchstr(w, c) (winchnstr( w, c, (w)->_maxx-(w)->_curx ) )
#define winsstr(w,str) winsnstr((w),(str),(-1))
#define winstr(w,str) winnstr((w),str,(w)->_maxx)
#define wstandend(w) wattrset(w, A_NORMAL)
#define wstandout(w) wattrset(w, A_STANDOUT)
 
#ifndef UNIX
#define cbreak() (_cursvar.cbreak = TRUE)
#define nocbreak() (_cursvar.cbreak = FALSE)
#define crmode() (_cursvar.cbreak = TRUE)
#define nocrmode() (_cursvar.cbreak = FALSE)
#define echo() (_cursvar.echo = TRUE)
#define noecho() (_cursvar.echo = FALSE)
#define nodelay(w,flag) (w->_nodelay = flag)
#endif
 
#ifdef PDCURSES
#define addrawch( c ) waddrawch( stdscr, c )
#define addrawstr(str) waddrawstr( stdscr, str )
#define insrawch( c ) winsrawch( stdscr, c )
#define waddrawch(w, c) PDC_chadd( w, (chtype)c, FALSE, TRUE )
#define winsrawch(w, c) PDC_chins( w, (chtype)c, FALSE )
 
/*
* FYI: Need to document these functions...
*/
#define title(s,a) wtitle( stdscr, s, (chtype)a )
#define titleofs(ofs) wtitleofs( stdscr, ofs )
#define wtitle(w,s,a) (w->_title = s, w->_title_attr = (chtype)a)
#define wtitleofs(w,ofs) (w->_title_ofs = ofs)
#endif
 
/*
* Load up curspriv.h. This should be in the same place as
* stdlib.h. We allow anyone who defines CURSES_LIBRARY to have
* access to our internal routines. This provides quick
* PC applications at the expense of portability.
*/
#if defined (CURSES_LIBRARY) | defined( INTERNAL)
# include <curspriv.h>
# include <stdlib.h>
#endif
 
#endif /* __PDCURSES__ */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/cursos2.h
0,0 → 1,324
/*
***************************************************************************
* This file comprises part of PDCurses. PDCurses is Public Domain software.
* You may use this code for whatever purposes you desire. This software
* is provided AS IS with NO WARRANTY whatsoever.
* Should this software be used in another application, an acknowledgement
* that PDCurses code is used would be appreciated, but is not mandatory.
*
* Any changes which you make to this software which may improve or enhance
* it, should be forwarded to the current maintainer for the benefit of
* other users.
*
* The only restriction placed on this code is that no distribution of
* modified PDCurses code be made under the PDCurses name, by anyone
* other than the current maintainer.
*
* See the file maintain.er for details of the current maintainer.
***************************************************************************
*/
/*
$Id$
*/
#ifndef CURSOS2_INCL
#define CURSOS2_INCL 1
 
#ifdef CURSES__32BIT__
 
#if (NOVIO)
#define KbdSetStatus Kbd32SetStatus
#define KbdGetStatus Kbd32GetStatus
#define KbdCharIn Kbd32CharIn
#define KbdPeek Kbd32Peek
#define KbdFlushBuffer Kbd32FlushBuffer
 
#define VioGetMode Vio32GetMode
#define VioSetMode Vio32SetMode
#define VioGetCurPos Vio32GetCurPos
#define VioSetCurPos Vio32SetCurPos
#define VioGetCurType Vio32GetCurType
#define VioSetCurType Vio32SetCurType
#define VioScrollDn Vio32ScrollDn
#define VioScrollUp Vio32ScrollUp
#define VioGetConfig Vio32GetConfig
#define VioWrtTTY Vio32WrtTTY
#define VioReadCellStr Vio32ReadCellStr
#define VioWrtCellStr Vio32WrtCellStr
#define VioWrtNAttr Vio32WrtNAttr
#endif /* NOVIO */
 
#define FARKeyword
 
#define CURS_INCL_VIO_KBD
 
 
#ifdef __EMX__
# ifndef USE_OS2_H
# ifdef EMXVIDEO /* Define to use emx dos compatible video */
# include <stdlib.h>
# include <sys/video.h>
# ifdef USE_OS2_H
# undef USE_OS2_H /* And we can use the extra compile speed... */
# endif
# else
# define USE_OS2_H
# endif
# endif
# define APIENTRY
#else
# define APIRET ULONG
#endif
 
#else
 
 
# define FARKeyword far
# define APIRET USHORT
 
#ifdef USE_OS2_H
# define INCL_VIO
# define INCL_KBD
#else
# define CURS_INCL_VIO_KBD
#endif
 
 
#endif /* __32BIT__ */
 
#ifndef EMXVIDEO
 
/* if USE_OS2_H is defined then use the os2.h that comes with your compiler ...*/
 
#ifdef USE_OS2_H
# include <os2.h>
#else
 
/* ... otherwise use these definitions */
 
# include <os2def.h>
 
#endif
 
#ifdef CURS_INCL_VIO_KBD
 
typedef SHANDLE HKBD;
typedef HKBD FARKeyword * PHKBD;
 
 
typedef SHANDLE HVIO;
typedef HVIO FARKeyword * PHVIO;
 
 
 
typedef struct _KBDINFO {
USHORT cb;
USHORT fsMask;
USHORT chTurnAround;
USHORT fsInterim;
USHORT fsState;
}KBDINFO;
typedef KBDINFO FARKeyword *PKBDINFO;
 
 
USHORT APIENTRY KbdSetStatus(
PKBDINFO pkbdinfo,
HKBD hkbd );
 
 
USHORT APIENTRY KbdGetStatus(
PKBDINFO pkbdinfo,
HKBD hdbd );
 
 
typedef struct _KBDKEYINFO {
UCHAR chChar; /* ASCII character code */
UCHAR chScan; /* Scan Code */
UCHAR fbStatus;
UCHAR bNlsShift;
USHORT fsState;
ULONG time;
}KBDKEYINFO;
typedef KBDKEYINFO FARKeyword *PKBDKEYINFO;
 
#define IO_WAIT 0
#define IO_NOWAIT 1
 
USHORT APIENTRY KbdCharIn(
PKBDKEYINFO pkbci,
USHORT fWait, /* IO_WAIT, IO_NOWAIT */
HKBD hkbd);
 
USHORT APIENTRY KbdPeek(
PKBDKEYINFO pkbci,
HKBD hkbd );
 
USHORT APIENTRY KbdFlushBuffer(
HKBD hkbd);
 
 
typedef struct _VIOMODEINFO {
USHORT cb;
UCHAR fbType;
UCHAR color;
USHORT col; /* number of text columns */
USHORT row; /* number of text rows */
USHORT hres; /* horizontal resolution */
USHORT vres; /* vertical resolution */
UCHAR fmt_ID;
UCHAR attrib; /* number of attributes */
ULONG buf_addr;
ULONG buf_length;
ULONG full_length;
ULONG partial_length;
PCH ext_data_addr;
} VIOMODEINFO;
typedef VIOMODEINFO FARKeyword *PVIOMODEINFO;
 
 
USHORT APIENTRY VioGetMode(
PVIOMODEINFO pvioModeInfo,
HVIO hvio);
 
 
USHORT APIENTRY VioSetMode(
PVIOMODEINFO pvioModeInfo,
HVIO hvio);
 
 
USHORT APIENTRY VioGetCurPos(
PUSHORT pusRow,
PUSHORT pusColumn,
HVIO hvio );
 
 
USHORT APIENTRY VioSetCurPos(
USHORT usRow,
USHORT usColumn,
HVIO hvio);
 
typedef struct _VIOCURSORINFO {
USHORT yStart;
USHORT cEnd;
USHORT cx;
USHORT attr; /* -1=hidden cursor, any other=normal cursor */
} VIOCURSORINFO;
typedef VIOCURSORINFO FARKeyword *PVIOCURSORINFO;
 
 
USHORT APIENTRY VioGetCurType(
PVIOCURSORINFO pvioCursorInfo,
HVIO hvio );
 
 
USHORT APIENTRY VioSetCurType(
PVIOCURSORINFO pvioCursorInfo,
HVIO hvio );
 
USHORT APIENTRY VioScrollDn(
USHORT usTopRow,
USHORT usLeftCol,
USHORT usBotRow,
USHORT usRightCol,
USHORT cbLines,
PBYTE pCell,
HVIO hvio );
 
 
 
USHORT APIENTRY VioScrollUp(
USHORT usTopRow,
USHORT usLeftCol,
USHORT usBotRow,
USHORT usRightCol,
USHORT cbLines,
PBYTE pCell,
HVIO hvio );
 
 
/* VIOCONFIGINFO.adapter constants */
 
#define DISPLAY_MONOCHROME 0x0000
#define DISPLAY_CGA 0x0001
#define DISPLAY_EGA 0x0002
#define DISPLAY_VGA 0x0003
#define DISPLAY_8514A 0x0007
 
/* VIOCONFIGINFO.display constants */
 
#define MONITOR_MONOCHROME 0x0000
#define MONITOR_COLOR 0x0001
#define MONITOR_ENHANCED 0x0002
#define MONITOR_8503 0x0003
#define MONITOR_851X_COLOR 0x0004
#define MONITOR_8514 0x0009
 
typedef struct _VIOCONFIGINFO {
USHORT cb;
USHORT adapter;
USHORT display;
ULONG cbMemory;
USHORT Configuration;
USHORT VDHVersion;
USHORT Flags;
ULONG HWBufferSize;
ULONG FullSaveSize;
ULONG PartSaveSize;
USHORT EMAdaptersOFF;
USHORT EMDisplaysOFF;
} VIOCONFIGINFO;
typedef VIOCONFIGINFO FARKeyword *PVIOCONFIGINFO;
 
 
USHORT APIENTRY VioGetConfig(
USHORT usConfigId, /* Reserved (must be 0) */
PVIOCONFIGINFO pvioin,
HVIO hvio );
 
USHORT APIENTRY VioWrtTTY(
PCH pch,
USHORT cb,
HVIO hvio );
 
USHORT APIENTRY VioReadCellStr(
PCH pchCellStr,
PUSHORT pcb,
USHORT usRow,
USHORT usColumn,
HVIO hvio );
 
USHORT APIENTRY VioWrtCellStr(
PCH pchCellStr,
USHORT cb,
USHORT usRow,
USHORT usColumn,
HVIO hvio );
 
USHORT APIENTRY VioWrtNAttr(
PBYTE pAttr,
USHORT cb,
USHORT usRow,
USHORT usColumn,
HVIO hvio );
 
 
USHORT APIENTRY VioWrtNCell(
PBYTE pCell,
USHORT cb,
USHORT usRow,
USHORT usColumn,
HVIO hvio );
 
#endif
 
#endif
 
 
#ifndef KEYBOARD_ASCII_MODE
#define KEYBOARD_ASCII_MODE 0x0008
#endif
 
#ifndef KEYBOARD_BINARY_MODE
#define KEYBOARD_BINARY_MODE 0x0004
#endif
 
#endif /* !EMXVIDEO */
/contrib/media/updf/include/curspriv.h
0,0 → 1,320
/*
***************************************************************************
* This file comprises part of PDCurses. PDCurses is Public Domain software.
* You may use this code for whatever purposes you desire. This software
* is provided AS IS with NO WARRANTY whatsoever.
* Should this software be used in another application, an acknowledgement
* that PDCurses code is used would be appreciated, but is not mandatory.
*
* Any changes which you make to this software which may improve or enhance
* it, should be forwarded to the current maintainer for the benefit of
* other users.
*
* The only restriction placed on this code is that no distribution of
* modified PDCurses code be made under the PDCurses name, by anyone
* other than the current maintainer.
*
* See the file maintain.er for details of the current maintainer.
***************************************************************************
*/
/*
$Id$
*/
/*
*
* CURSPRIV.H
*
* Header file for definitions and declarations for the
* PDCurses package. These definitions should not be generally
* accessible to programmers, but are provided if the applications
* programmer decides to make the decision in favor of speed on a
* PC over portability.
*
* Revision History:
* Frotz 1.5Beta 900714 Added many levels of compiler support.
* Added mixed prototypes for all "internal" routines.
* Removed all assembly language. Added EGA/VGA
* support. Converted all #ifdef to #if in all
* modules except CURSES.H and CURSPRIV.H.
* Always include ASSERT.H. Added support for an
* external malloc(), calloc() and free().
* Added support for FAST_VIDEO (direct-memory writes).
* Added various memory model support (for FAST_VIDEO).
* Added much of the December 1988 X/Open Curses
* specification.
* bl 1.3 881005 All modules lint-checked with MSC '-W3' and turbo'C'
* '-w -w-pro' switches.
* bl 1.2 881002 Support (by #ifdef UCMASM) for uppercase-only
* assembly routine names. If UCMASM if defined,
* all assembler names are #defined as upper case.
* Not needed if you do "MASM /MX. Also missing
* declaration of cursesscroll(). Fixes thanks to
* N.D. Pentcheff
* bl 1.1 880306 Add _chadd() for raw output routines.
* bl 1.0 870515 Release.
*
*/
 
#ifndef __CURSES_INTERNALS__
#define __CURSES_INTERNALS__
 
/* Always include... */
#include <assert.h>
 
 
 
/*----------------------------------------------------------------------
* MEMORY MODEL SUPPORT:
*
* MODELS
* TINY cs,ds,ss all in 1 segment (not enough memory!)
* SMALL cs:1 segment, ds:1 segment
* MEDIUM cs:many segments ds:1 segment
* COMPACT cs:1 segment, ds:many segments
* LARGE cs:many segments ds:many segments
* HUGE cs:many segments ds:segments > 64K
*/
#ifdef __TINY__
# define SMALL 1
#endif
#ifdef __SMALL__
# define SMALL 1
#endif
#ifdef __MEDIUM__
# define MEDIUM 1
#endif
#ifdef __COMPACT__
# define COMPACT 1
#endif
#ifdef __LARGE__
# define LARGE 1
#endif
#ifdef __HUGE__
# define HUGE 1
#endif
 
 
/*----------------------------------------------------------------------
* OPERATING SYSTEM SUPPORT:
*
* DOS The one we all know and love:-}
* OS/2 The new kid on the block.
* FLEXOS A Real-time, protected-mode OS from
* Digital Research, Inc.
* (AKA, the 4680 from IBM...)
*/
 
/*----------------------------------------*/
 
 
/*----------------------------------------------------------------------
* MALLOC DEBUGGING SUPPORT:
*
* Set EMALLOC and EMALLOC_MAGIC in order to use your private
* versions of malloc(), calloc(), and free(). This can help,
* but not solve, your malloc problems when debugging...
*
*/
#ifndef INTERNAL
# define EMALLOC 0 /* Disable External Malloc */
#else
# define EMALLOC 0 /* Enable/Disable External Malloc */
# define EMALLOC_MAGIC 0x0C0C /* Our magic indicator that we should */
/* use our external malloc rather than */
/* the runtime's malloc. */
#endif
 
 
/*----------------------------------------------------------------------*/
/* window properties */
#define _SUBWIN 0x01 /* window is a subwindow */
#define _ENDLINE 0x02 /* last winline is last screen line */
#define _FULLWIN 0x04 /* window fills screen */
#define _SCROLLWIN 0x08 /* window lwr rgt is screen lwr rgt */
#define _PAD 0x10 /* X/Open Pad. */
#define _SUBPAD 0x20 /* X/Open subpad. */
 
 
 
 
/*----------------------------------------------------------------------*/
/* Miscellaneous */
#define _INBUFSIZ 512 /* size of terminal input buffer */
#define _NO_CHANGE -1 /* flags line edge unchanged */
 
 
 
 
/* @@@ THESE SHOULD BE INDIVIDUAL FUNCTIONS, NOT MACROS! */
#define _BCHAR 0x03 /* Break char (^C) */
#define _ECHAR 0x08 /* Erase char (^H) */
#define _DWCHAR 0x17 /* Delete Word char (^W) */
#define _DLCHAR 0x15 /* Delete Line char (^U) */
#define _GOCHAR 0x11 /* ^Q character */
#define _PRINTCHAR 0x10 /* ^P character */
#define _STOPCHAR 0x13 /* ^S character */
#define NUNGETCH 20 /* max # chars to ungetch() */
 
 
 
 
/* Setmode stuff */
struct cttyset
{
bool been_set;
SCREEN saved;
};
 
extern struct cttyset c_sh_tty; /* tty modes for shell_mode */
extern struct cttyset c_pr_tty; /* tty modes for prog_mode */
extern struct cttyset c_save_tty;
extern struct cttyset c_save_trm;
 
/* Printscan stuff */
extern char c_printscanbuf[]; /* buffer used during I/O */
 
/* tracing flag */
extern bool trace_on;
 
/* Strget stuff */
extern char* c_strbeg;
 
/* doupdate stuff */
extern WINDOW* twin; /* used by many routines */
 
/* Monitor (terminal) type information */
#define _NONE 0x00
#define _MDA 0x01
#define _CGA 0x02
#define _EGACOLOR 0x04
#define _EGAMONO 0x05
#define _VGACOLOR 0x07
#define _VGAMONO 0x08
#define _MCGACOLOR 0x0a
#define _MCGAMONO 0x0b
#define _FLEXOS 0x20 /* A Flexos console */
#define _MDS_GENIUS 0x30
#define _UNIX_COLOR 0x40
#define _UNIX_MONO 0x41
 
/* Text-mode font size information */
#define _FONT8 8
#define _FONT14 14
#define _FONT15 15 /* GENIUS */
#define _FONT16 16
 
 
/*----------------------------------------------------------------------
* ANSI C prototypes. Be sure that your compiler conditional
* compilation definitions above define ANSI to be non-zero
* if you compiler supports prototypes.
*/
#ifdef ANSI
# ifdef CPLUSPLUS
extern "C" {
# endif
int PDC_backchar( WINDOW*, char*, int* );
bool PDC_breakout( void );
int PDC_chadd( WINDOW*, chtype, bool, bool );
bool PDC_check_bios_key( void );
int PDC_chg_attr( WINDOW*, chtype, int, int, int, int );
int PDC_chins( WINDOW*, chtype, bool );
int PDC_clr_scrn( WINDOW* );
int PDC_clr_update( WINDOW* );
int PDC_copy_win( WINDOW *,WINDOW *,int,int,int,int,int,int,int,int,bool );
int PDC_cursor_off( void );
int PDC_cursor_on( void );
int PDC_fix_cursor( int );
int PDC_gattr( void );
int PDC_get_bios_key( void );
int PDC_get_columns( void );
bool PDC_get_ctrl_break( void );
int PDC_get_cur_col( void );
int PDC_get_cur_row( void );
int PDC_get_cursor_pos( int*, int* );
int PDC_get_cursor_mode( void );
int PDC_get_font( void );
int PDC_get_rows( void );
int PDC_gotoxy( int, int );
int PDC_init_atrtab(void);
WINDOW* PDC_makenew( int, int, int, int );
int PDC_newline( WINDOW*, int );
int PDC_print( int, int, int );
int PDC_putc( chtype, chtype );
int PDC_putchar( chtype );
int PDC_putctty( chtype, chtype );
int PDC_rawgetch( void );
int PDC_sanity_check( int );
int PDC_scr_close( void );
int PDC_scr_open( SCREEN*, bool );
int PDC_scroll( int, int, int, int, int, chtype );
int PDC_set_80x25( void );
int PDC_set_ctrl_break( bool );
int PDC_set_cursor_mode( int, int );
int PDC_set_font( int );
int PDC_set_rows( int );
int PDC_split_plane( WINDOW*, char*, char*, int, int, int, int );
int PDC_sysgetch( void );
bool PDC_transform_line( int );
void PDC_usleep( long );
int PDC_validchar( int );
 
#if defined( OS2 ) && !defined( EMXVIDEO )
VIOCONFIGINFO PDC_query_adapter_type( void );
VIOMODEINFO PDC_get_scrn_mode( void );
int PDC_set_scrn_mode( VIOMODEINFO );
bool PDC_scrn_modes_equal (VIOMODEINFO, VIOMODEINFO);
#else
int PDC_query_adapter_type( void );
int PDC_get_scrn_mode( void );
int PDC_set_scrn_mode( int );
bool PDC_scrn_modes_equal (int, int);
#endif
 
#ifdef FLEXOS
int PDC_flexos_8bitmode( void );
int PDC_flexos_16bitmode( void );
char* PDC_flexos_gname( void );
#endif
 
#ifdef UNIX
int PDC_kbhit(void);
int PDC_setup_keys(void);
#endif
 
#if defined (XCURSES)
int XCurses_redraw_curscr(void);
int XCurses_display_cursor(int,int ,chtype ,int ,int ,chtype );
int XCurses_rawgetch(void);
bool XCurses_kbhit(void);
int XCurses_instruct(int);
int XCurses_transform_line(long *, int , int , int );
int Xinitscr(void);
int Xendwin(void);
#endif
 
#ifdef PDCDEBUG
void PDC_debug( char*,... );
#endif
 
#ifdef REGISTERWINDOWS
bool PDC_inswin( WINDOW*, WINDOW* );
int PDC_addtail( WINDOW* );
int PDC_addwin( WINDOW*, WINDOW* );
int PDC_rmwin( WINDOW* );
WINDS* PDC_findwin( WINDOW* );
#endif
# ifdef CPLUSPLUS
}
# endif
#endif
 
#define PDC_COLOR_PAIRS 64
#define PDC_OFFSET 8
#define MAX_ATRTAB 272
#define chtype_attr(ch) ((atrtab[((ch >> 8) & 0xFF)] << 8) & A_ATTRIBUTES)
 
#include<menuet/os.h>
#include<menuet/textcon.h>
 
#endif /* __CURSES_INTERNALS__*/
/contrib/media/updf/include/cwchar
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CWCHAR
#include <bits/std_cwchar.h>
#endif
/contrib/media/updf/include/cwctype
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CWCTYPE
#include <bits/std_cwctype.h>
#endif
/contrib/media/updf/include/debug/dbgcom.h
0,0 → 1,83
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_debug_dbgcom_h_
#define __dj_include_debug_dbgcom_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <setjmp.h>
#include <debug/tss.h>
 
typedef struct {
unsigned long app_base; /* linear base address of application */
unsigned long dr[8]; /* debug registers, set when a_tss runs */
} ExternalDebuggerInfo;
 
extern ExternalDebuggerInfo edi;
 
/* structure of FPU state */
/* 14 bytes for FPU env */
/* plus 8*10 bytes from the FPU stack */
/* r[8] is the array as defined in intel docs */
/* st0 is r[top] */
 
#define NPX_TOP_MASK 0x3800
#define NPX_TOP_SHIFT 11
 
typedef struct {
unsigned short sig0;
unsigned short sig1;
unsigned short sig2;
unsigned short sig3;
unsigned short exponent:15;
unsigned short sign:1;
} NPXREG;
 
typedef struct {
unsigned long control;
unsigned long status;
unsigned long tag;
unsigned long eip;
unsigned long cs;
unsigned long dataptr;
unsigned long datasel;
NPXREG reg[8];
long double st[8];
char st_valid[8];
long double mmx[8];
char in_mmx_mode;
char top;
} NPX;
 
extern NPX npx;
 
void save_npx (void); /* Save the FPU of the debugged program */
void load_npx (void); /* Restore the FPU of the debugged program */
 
void run_child(void);
int read_child(unsigned child_addr, void *buf, unsigned len);
int write_child(unsigned child_addr, void *buf, unsigned len);
void edi_init(jmp_buf start_state);
void cleanup_client(void);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_debug_dbgcom_h_ */
/contrib/media/updf/include/debug/redir.h
0,0 → 1,55
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_debug_redir_h_
#define __dj_include_debug_redir_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* How many handles do we track.
WARNING: if you change this, you need to recompile dbgredir.c !!! */
#define DBG_HANDLES 3
 
/* Describe a single redirected handle.
Actually only inf_handle and our_handle are currently used (and
even they could share the same slot), but I'm keeping the rest,
mostly because they might be useful for applications. */
struct dbg_redirect {
int inf_handle;
int our_handle;
char *file_name;
int mode;
off_t filepos;
};
 
/* cmdline_parse_args processes command lines into the following structure: */
typedef struct _cmdline {
char *command; /* command line with redirection removed */
int redirected; /* 1 if handles redirected for child */
struct dbg_redirect **redirection;/* info about redirected handles */
} cmdline_t;
 
extern void redir_cmdline_delete (cmdline_t *);
extern int redir_cmdline_parse (const char *, cmdline_t *);
extern int redir_to_child (cmdline_t *);
extern int redir_to_debugger (cmdline_t *);
extern int redir_debug_init (cmdline_t *);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_debug_dbgcom_h_ */
/contrib/media/updf/include/debug/stab.h
0,0 → 1,76
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_debug_stab_h_
#define __dj_include_debug_stab_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* This is file STAB.H */
/*
** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
**
** This file is distributed under the terms listed in the document
** "copying.dj", available from DJ Delorie at the address above.
** A copy of "copying.dj" should accompany this file; if not, a copy
** should be available from where this file was obtained. This file
** may not be distributed without a verbatim copy of "copying.dj".
**
** This file is distributed WITHOUT ANY WARRANTY; without even the implied
** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
 
#if !defined (N_UNDF)
#define N_UNDF 0
#endif
#if !defined (N_ABS)
#define N_ABS 2
#endif
#if !defined (N_TEXT)
#define N_TEXT 4
#endif
#if !defined (N_DATA)
#define N_DATA 6
#endif
#if !defined (N_BSS)
#define N_BSS 8
#endif
#if !defined (N_FN)
#define N_FN 15
#endif
 
#if !defined (N_EXT)
#define N_EXT 1
#endif
#if !defined (N_TYPE)
#define N_TYPE 0x1e
#endif
#if !defined (N_STAB)
#define N_STAB 0xe0
#endif
 
#if !defined (N_SO)
#define N_SO 0x64
#endif
#if !defined (N_SLINE)
#define N_SLINE 0x44
#endif
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_debug_stab_h_ */
/contrib/media/updf/include/debug/syms.h
0,0 → 1,65
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_debug_syms_h_
#define __dj_include_debug_syms_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* This is file SYMS.H */
/*
** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
**
** This file is distributed under the terms listed in the document
** "copying.dj", available from DJ Delorie at the address above.
** A copy of "copying.dj" should accompany this file; if not, a copy
** should be available from where this file was obtained. This file
** may not be distributed without a verbatim copy of "copying.dj".
**
** This file is distributed WITHOUT ANY WARRANTY; without even the implied
** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
 
#ifndef _SYMS_H_
#define _SYMS_H_
 
void syms_init(char *fname);
void syms_list(int byval);
unsigned long syms_name2val(const char *name);
char *syms_val2name(unsigned long val, unsigned long *delta);
char *syms_val2line(unsigned long val, int *lineret, int exact);
char *syms_module(int no);
unsigned long syms_line2val(char *filename, int lnum);
void syms_listwild(char *pattern,
void (*handler)(unsigned long addr, char type_c, char *name, char *name2, int lnum));
 
extern int undefined_symbol;
extern int syms_printwhy;
 
#define N_INDR 0x0a
#define N_SETA 0x14 /* Absolute set element symbol */
#define N_SETT 0x16 /* Text set element symbol */
#define N_SETD 0x18 /* Data set element symbol */
#define N_SETB 0x1A /* Bss set element symbol */
#define N_SETV 0x1C /* Pointer to set vector in data area. */
 
#endif
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_debug_syms_h_ */
/contrib/media/updf/include/debug/tss.h
0,0 → 1,72
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_debug_tss_h_
#define __dj_include_debug_tss_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
typedef struct TSS {
unsigned short tss_back_link;
unsigned short res0;
unsigned long tss_esp0;
unsigned short tss_ss0;
unsigned short res1;
unsigned long tss_esp1;
unsigned short tss_ss1;
unsigned short res2;
unsigned long tss_esp2;
unsigned short tss_ss2;
unsigned short res3;
unsigned long tss_cr3;
 
unsigned long tss_eip;
unsigned long tss_eflags;
unsigned long tss_eax;
unsigned long tss_ecx;
unsigned long tss_edx;
unsigned long tss_ebx;
unsigned long tss_esp;
unsigned long tss_ebp;
unsigned long tss_esi;
unsigned long tss_edi;
unsigned short tss_es;
unsigned short res4;
unsigned short tss_cs;
unsigned short res5;
unsigned short tss_ss;
unsigned short res6;
unsigned short tss_ds;
unsigned short res7;
unsigned short tss_fs;
unsigned short res8;
unsigned short tss_gs;
unsigned short res9;
unsigned short tss_ldt;
unsigned short res10;
unsigned short tss_trap;
unsigned char tss_iomap;
unsigned char tss_irqn;
unsigned long tss_error;
} TSS;
 
extern TSS a_tss;
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_debug_tss_h_ */
/contrib/media/updf/include/debug/v2load.h
0,0 → 1,48
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_debug_v2load_h_
#define __dj_include_debug_v2load_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <setjmp.h>
 
typedef struct {
unsigned first_addr;
unsigned last_addr;
} AREAS;
 
typedef enum {
A_text,
A_data,
A_bss,
A_arena,
A_stack
} AREA_TYPES;
 
#define areas _v2load_areas
#define MAX_AREA 5
 
extern AREAS areas[MAX_AREA];
 
int v2loadimage(const char *program, const char *cmdline, jmp_buf load_state);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_debug_v2load_h_ */
/contrib/media/updf/include/debug/wild.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_debug_wild_h_
#define __dj_include_debug_wild_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
int wild(char *pattern, char *string);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_debug_wild_h_ */
/contrib/media/updf/include/debugmem.h
0,0 → 1,23
 
 
#ifndef __debugmem_h__
#define __debugmem_h__
 
 
#ifdef YACAS_DEBUG
 
#ifdef NO_GLOBALS
#error "Memory heap checking only possible with global variables!"
#endif
 
void* YacasMallocPrivate(unsigned long size, const char* aFile, int aLine);
void* YacasReAllocPrivate(void* orig, unsigned long size, const char* aFile, int aLine);
void YacasFreePrivate(void* aOrig);
void CheckPtr(void * anAllocatedPtr, const char* file, int line);
void CheckAllPtrs(int final = 0);
#endif
 
#endif
 
 
 
/contrib/media/updf/include/deffile.h
0,0 → 1,47
/** \file deffile.h deffiles, which speed up loading.
* This module adds support for loading files which specify
* which script file to look for when trying to use a specific
* function.
*/
 
#ifndef __deffile_h__
#define __deffile_h__
 
#include "yacasbase.h"
#include "lisphash.h"
 
/** LispDefFile represents one file that can be loaded just-in-time.
*/
class LispDefFile : public YacasBase
{
public:
LispDefFile(LispString * aFile);
LispDefFile(const LispDefFile& aOther);
~LispDefFile();
void SetLoaded();
inline LispBoolean IsLoaded();
inline LispString * FileName();
 
LispStringSmartPtr iFileName;
LispBoolean iIsLoaded;
};
 
/** LispDefFiles maintains an array of files that can be defloaded.
* When the user invokes a DefLoad on a file, an entry is added to the
* array of deffiles in the LispEnvironment class. When the function
* is called, and there is no body of rules defined for this function,
* the engine looks up the correct file to load from this associated
* has class.
*/
class LispEnvironment;
class LispDefFiles : public LispAssociatedHash<LispDefFile>
{
public:
LispDefFile* File(LispString * aFileName);
};
 
void LoadDefFile(LispEnvironment& aEnvironment, LispString * aFileName);
 
#include "deffile.inl"
 
#endif
/contrib/media/updf/include/defines.h
0,0 → 1,57
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)defines.h 8.1 (Berkeley) 6/6/93
*/
 
#define settimer(x) clocks.x = clocks.system++
 
#if !defined(TN3270)
 
#define SetIn3270()
 
#endif /* !defined(TN3270) */
 
#define NETADD(c) { *netoring.supply = c; ring_supplied(&netoring, 1); }
#define NET2ADD(c1,c2) { NETADD(c1); NETADD(c2); }
#define NETBYTES() (ring_full_count(&netoring))
#define NETROOM() (ring_empty_count(&netoring))
 
#define TTYADD(c) if (!(SYNCHing||flushout)) { \
*ttyoring.supply = c; \
ring_supplied(&ttyoring, 1); \
}
#define TTYBYTES() (ring_full_count(&ttyoring))
#define TTYROOM() (ring_empty_count(&ttyoring))
 
/* Various modes */
#define MODE_LOCAL_CHARS(m) ((m)&(MODE_EDIT|MODE_TRAPSIG))
#define MODE_LOCAL_ECHO(m) ((m)&MODE_ECHO)
#define MODE_COMMAND_LINE(m) ((m)==-1)
 
#define CONTROL(x) ((x)&0x1f) /* CTRL(x) is not portable */
/contrib/media/updf/include/deque
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_DEQUE
#include <bits/std_deque.h>
#endif
/contrib/media/updf/include/dir.h
0,0 → 1,92
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_dir_h_
#define __dj_include_dir_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* ffblk is also enhanced for LFNs; the dos 21 byte reserved area is used to
hold the extra information. Fields marked LFN are only valid if the magic
is set to LFN32 */
 
/* This is for g++ 2.7.2 and below */
#pragma pack(push,1)
struct ffblk {
char lfn_magic[6]; /* LFN */
short lfn_handle; /* LFN */
unsigned short lfn_ctime; /* LFN */
unsigned short lfn_cdate; /* LFN */
unsigned short lfn_atime; /* LFN */
unsigned short lfn_adate; /* LFN */
char _ff_reserved[5];
unsigned char ff_attrib;
unsigned short ff_ftime;
unsigned short ff_fdate;
unsigned long ff_fsize;
char ff_name[260];
};
 
struct ffblklfn {
unsigned long fd_attrib;
unsigned long long fd_ctime;
unsigned long long fd_atime;
unsigned long long fd_mtime;
unsigned long fd_sizehi;
unsigned long fd_size;
unsigned long long fd_reserved;
char fd_longname[260];
char fd_name[14];
};
 
#pragma pack(pop)
 
#define FA_RDONLY 1
#define FA_HIDDEN 2
#define FA_SYSTEM 4
#define FA_LABEL 8
#define FA_DIREC 16
#define FA_ARCH 32
 
/* for fnmerge/fnsplit */
#define MAXPATH 260
#define MAXDRIVE 3
#define MAXDIR 256
#define MAXFILE 256
#define MAXEXT 255
 
#define WILDCARDS 0x01
#define EXTENSION 0x02
#define FILENAME 0x04
#define DIRECTORY 0x08
#define DRIVE 0x10
 
int __file_tree_walk(const char *_dir, int (*_fn)(const char *_path, const struct ffblk *_ff));
int findfirst(const char *_pathname, struct ffblk *_ffblk, int _attrib);
int findnext(struct ffblk *_ffblk);
void fnmerge (char *_path, const char *_drive, const char *_dir, const char *_name, const char *_ext);
int fnsplit (const char *_path, char *_drive, char *_dir, char *_name, char *_ext);
int getdisk(void);
char * searchpath(const char *_program);
int setdisk(int _drive);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_dir.h_ */
/contrib/media/updf/include/direct.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_direct_h_
#define __dj_include_direct_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <dirent.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_direct_h_ */
/contrib/media/updf/include/dirent.h
0,0 → 1,62
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_dirent_h_
#define __dj_include_dirent_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
/* Definition of DIR requires many other headers; not included here to
avoid namespace pollution. */
//typedef struct __dj_DIR DIR;
#include <menuet/os.h>
 
struct dirent {
char d_namlen;
char d_name[256];
};
 
typedef struct
{
struct systree_info2 fileinfo;
struct dirent entry;
__u8 bdfeheader[0x20];
struct bdfe_item bdfebase;
__u8 bdfename[264];
} DIR;
 
int closedir(DIR *dirp);
DIR * opendir(const char *_dirname);
struct dirent * readdir(DIR *_dirp);
//void rewinddir(DIR *_dirp);
 
#ifndef _POSIX_SOURCE
 
extern int __opendir_flags; /* default is zero, used only by opendir */
#define __OPENDIR_PRESERVE_CASE 0001
#define __OPENDIR_FIND_HIDDEN 0002 /* ignored; on by default */
#define __OPENDIR_FIND_LABEL 0004
#define __OPENDIR_NO_HIDDEN 0x08 /* NOT 0002 for back-compatibility */
 
void seekdir(DIR *_dir, long _loc);
long telldir(DIR *_dir);
void __set_need_fake_dot_dotdot(DIR *_dir);
void _lfn_find_close(int _handle);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_dirent_h_ */
/contrib/media/updf/include/dos.h
0,0 → 1,275
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_dos_h_
#define __dj_include_dos_h_
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <pc.h>
 
int _detect_80387(void);
 
struct DWORDREGS {
unsigned long edi;
unsigned long esi;
unsigned long ebp;
unsigned long cflag;
unsigned long ebx;
unsigned long edx;
unsigned long ecx;
unsigned long eax;
unsigned short eflags;
};
 
struct DWORDREGS_W {
unsigned long di;
unsigned long si;
unsigned long bp;
unsigned long cflag;
unsigned long bx;
unsigned long dx;
unsigned long cx;
unsigned long ax;
unsigned short flags;
};
 
struct WORDREGS {
unsigned short di, _upper_di;
unsigned short si, _upper_si;
unsigned short bp, _upper_bp;
unsigned short cflag, _upper_cflag;
unsigned short bx, _upper_bx;
unsigned short dx, _upper_dx;
unsigned short cx, _upper_cx;
unsigned short ax, _upper_ax;
unsigned short flags;
};
 
struct BYTEREGS {
unsigned short di, _upper_di;
unsigned short si, _upper_si;
unsigned short bp, _upper_bp;
unsigned long cflag;
unsigned char bl;
unsigned char bh;
unsigned short _upper_bx;
unsigned char dl;
unsigned char dh;
unsigned short _upper_dx;
unsigned char cl;
unsigned char ch;
unsigned short _upper_cx;
unsigned char al;
unsigned char ah;
unsigned short _upper_ax;
unsigned short flags;
};
 
union REGS { /* Compatible with DPMI structure, except cflag */
struct DWORDREGS d;
#ifdef _NAIVE_DOS_REGS
struct WORDREGS x;
#else
#ifdef _BORLAND_DOS_REGS
struct DWORDREGS x;
#else
struct DWORDREGS_W x;
#endif
#endif
struct WORDREGS w;
struct BYTEREGS h;
};
 
struct SREGS {
unsigned short es;
unsigned short ds;
unsigned short fs;
unsigned short gs;
unsigned short cs;
unsigned short ss;
};
 
struct ftime {
unsigned ft_tsec:5; /* 0-29, double to get real seconds */
unsigned ft_min:6; /* 0-59 */
unsigned ft_hour:5; /* 0-23 */
unsigned ft_day:5; /* 1-31 */
unsigned ft_month:4; /* 1-12 */
unsigned ft_year:7; /* since 1980 */
};
 
struct date {
short da_year;
char da_day;
char da_mon;
};
 
struct time {
unsigned char ti_min;
unsigned char ti_hour;
unsigned char ti_hund;
unsigned char ti_sec;
};
 
struct dfree {
unsigned df_avail;
unsigned df_total;
unsigned df_bsec;
unsigned df_sclus;
};
 
#ifdef __cplusplus
extern "C" {
#endif
 
extern unsigned short _osmajor, _osminor;
extern const char * _os_flavor;
extern int _doserrno;
 
unsigned short _get_dos_version(int);
 
 
int int86(int ivec, union REGS *in, union REGS *out);
int int86x(int ivec, union REGS *in, union REGS *out, struct SREGS *seg);
int intdos(union REGS *in, union REGS *out);
int intdosx(union REGS *in, union REGS *out, struct SREGS *seg);
int bdos(int func, unsigned dx, unsigned al);
int bdosptr(int func, void *dx, unsigned al);
 
#define bdosptr(a, b, c) bdos(a, (unsigned)(b), c)
#define intdos(a, b) int86(0x21, a, b)
#define intdosx(a, b, c) int86x(0x21, a, b, c)
 
int getftime(int handle, struct ftime *ftimep);
int setftime(int handle, struct ftime *ftimep);
 
int getcbrk(void);
int setcbrk(int new_value);
 
void getdate(struct date *);
/* void gettime(struct time *); */
void setdate(struct date *);
void settime(struct time *);
 
void getdfree(unsigned char drive, struct dfree *ptr);
 
void delay(unsigned msec);
/* int _get_default_drive(void);
void _fixpath(const char *, char *); */
 
 
/*
* For compatibility with other DOS C compilers.
*/
 
#define _A_NORMAL 0x00 /* Normal file - No read/write restrictions */
#define _A_RDONLY 0x01 /* Read only file */
#define _A_HIDDEN 0x02 /* Hidden file */
#define _A_SYSTEM 0x04 /* System file */
#define _A_VOLID 0x08 /* Volume ID file */
#define _A_SUBDIR 0x10 /* Subdirectory */
#define _A_ARCH 0x20 /* Archive file */
 
#define _enable enable
#define _disable disable
 
struct _dosdate_t {
unsigned char day; /* 1-31 */
unsigned char month; /* 1-12 */
unsigned short year; /* 1980-2099 */
unsigned char dayofweek; /* 0-6, 0=Sunday */
};
#define dosdate_t _dosdate_t
 
struct _dostime_t {
unsigned char hour; /* 0-23 */
unsigned char minute; /* 0-59 */
unsigned char second; /* 0-59 */
unsigned char hsecond; /* 0-99 */
};
#define dostime_t _dostime_t
 
#pragma pack(push,1)
struct _find_t {
char reserved[21];
unsigned char attrib;
unsigned short wr_time;
unsigned short wr_date;
unsigned long size;
char name[256];
};
#pragma pack(pop)
#define find_t _find_t
 
struct _diskfree_t {
unsigned short total_clusters;
unsigned short avail_clusters;
unsigned short sectors_per_cluster;
unsigned short bytes_per_sector;
};
#define diskfree_t _diskfree_t
 
struct _DOSERROR {
int exterror;
#ifdef __cplusplus
char errclass;
#else
char class;
#endif
char action;
char locus;
};
#define DOSERROR _DOSERROR
 
unsigned int _dos_creat(const char *_filename, unsigned int _attr, int *_handle);
unsigned int _dos_creatnew(const char *_filename, unsigned int _attr, int *_handle);
unsigned int _dos_open(const char *_filename, unsigned int _mode, int *_handle);
unsigned int _dos_write(int _handle, const void *_buffer, unsigned int _count, unsigned int *_result);
unsigned int _dos_read(int _handle, void *_buffer, unsigned int _count, unsigned int *_result);
unsigned int _dos_close(int _handle);
unsigned int _dos_commit(int _handle);
 
unsigned int _dos_findfirst(char *_name, unsigned int _attr, struct _find_t *_result);
unsigned int _dos_findnext(struct _find_t *_result);
 
void _dos_getdate(struct _dosdate_t *_date);
unsigned int _dos_setdate(struct _dosdate_t *_date);
void _dos_gettime(struct _dostime_t *_time);
unsigned int _dos_settime(struct _dostime_t *_time);
 
unsigned int _dos_getftime(int _handle, unsigned int *_p_date, unsigned int *_p_time);
unsigned int _dos_setftime(int _handle, unsigned int _date, unsigned int _time);
unsigned int _dos_getfileattr(const char *_filename, unsigned int *_p_attr);
unsigned int _dos_setfileattr(const char *_filename, unsigned int _attr);
 
void _dos_getdrive(unsigned int *_p_drive);
void _dos_setdrive(unsigned int _drive, unsigned int *_p_drives);
unsigned int _dos_getdiskfree(unsigned int _drive, struct _diskfree_t *_diskspace);
 
int _dosexterr(struct _DOSERROR *_p_error);
#define dosexterr(_ep) _dosexterr(_ep)
 
#define int386(_i, _ir, _or) int86(_i, _ir, _or)
#define int386x(_i, _ir, _or, _sr) int86x(_i, _ir, _or, _sr)
 
#ifdef __cplusplus
}
#endif
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifndef _USE_LFN
#define _USE_LFN (1)
#endif
 
#endif /* !__dj_include_dos_h_ */
/contrib/media/updf/include/dwt.h
0,0 → 1,113
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __DWT_H
#define __DWT_H
/**
@file dwt.h
@brief Implementation of a discrete wavelet transform (DWT)
 
The functions in DWT.C have for goal to realize forward and inverse discret wavelet
transform with filter 5-3 (reversible) and filter 9-7 (irreversible). The functions in
DWT.C are used by some function in TCD.C.
*/
 
/** @defgroup DWT DWT - Implementation of a discrete wavelet transform */
/*@{*/
 
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Forward 5-3 wavelet tranform in 2-D.
Apply a reversible DWT transform to a component of an image.
@param tilec Tile component information (current tile)
*/
void dwt_encode(opj_tcd_tilecomp_t * tilec);
/**
Inverse 5-3 wavelet tranform in 2-D.
Apply a reversible inverse DWT transform to a component of an image.
@param tilec Tile component information (current tile)
@param numres Number of resolution levels to decode
*/
void dwt_decode(opj_tcd_tilecomp_t* tilec, int numres);
/**
Get the gain of a subband for the reversible 5-3 DWT.
@param orient Number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH)
@return Returns 0 if orient = 0, returns 1 if orient = 1 or 2, returns 2 otherwise
*/
int dwt_getgain(int orient);
/**
Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT.
@param level Level of the wavelet function
@param orient Band of the wavelet function
@return Returns the norm of the wavelet function
*/
double dwt_getnorm(int level, int orient);
/**
Forward 9-7 wavelet transform in 2-D.
Apply an irreversible DWT transform to a component of an image.
@param tilec Tile component information (current tile)
*/
void dwt_encode_real(opj_tcd_tilecomp_t * tilec);
/**
Inverse 9-7 wavelet transform in 2-D.
Apply an irreversible inverse DWT transform to a component of an image.
@param tilec Tile component information (current tile)
@param numres Number of resolution levels to decode
*/
void dwt_decode_real(opj_tcd_tilecomp_t* tilec, int numres);
/**
Get the gain of a subband for the irreversible 9-7 DWT.
@param orient Number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH)
@return Returns the gain of the 9-7 wavelet transform
*/
int dwt_getgain_real(int orient);
/**
Get the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT
@param level Level of the wavelet function
@param orient Band of the wavelet function
@return Returns the norm of the 9-7 wavelet
*/
double dwt_getnorm_real(int level, int orient);
/**
Explicit calculation of the Quantization Stepsizes
@param tccp Tile-component coding parameters
@param prec Precint analyzed
*/
void dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, int prec);
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __DWT_H */
/contrib/media/updf/include/efmt.h
0,0 → 1,85
#ifndef __EFMT_H
#define __EFMT_H
 
#ifndef __PACKED__
#define __PACKED__ __attribute__((packed))
#endif
 
typedef struct
{
unsigned long magic __PACKED__;
unsigned char bitness __PACKED__;
unsigned char endian __PACKED__;
unsigned char elf_ver_1 __PACKED__;
unsigned char res[9] __PACKED__;
unsigned short file_type __PACKED__;
unsigned short machine __PACKED__;
unsigned long elf_ver_2 __PACKED__;
unsigned long entry_pt __PACKED__;
unsigned long phtab_offset __PACKED__;
unsigned long shtab_offset __PACKED__;
unsigned long flags __PACKED__;
unsigned short file_hdr_size __PACKED__;
unsigned short phtab_ent_size __PACKED__;
unsigned short num_phtab_ents __PACKED__;
unsigned short shtab_ent_size __PACKED__;
unsigned short num_sects __PACKED__;
unsigned short shstrtab_index __PACKED__;
} elf_file_t;
 
typedef struct
{
unsigned long sect_name __PACKED__;
unsigned long type __PACKED__;
unsigned long flags __PACKED__;
unsigned long virt_adr __PACKED__;
unsigned long offset __PACKED__;
unsigned long size __PACKED__;
unsigned long link __PACKED__;
unsigned long info __PACKED__;
unsigned long align __PACKED__;
unsigned long ent_size __PACKED__;
} elf_sect_t;
 
typedef struct
{
unsigned long adr __PACKED__;
unsigned char type __PACKED__;
unsigned long symtab_index:24 __PACKED__;
unsigned long addend __PACKED__;
} elf_reloc_t;
 
typedef struct
{
unsigned long name __PACKED__;
unsigned long value __PACKED__;
unsigned long size __PACKED__;
unsigned type:4 __PACKED__;
unsigned binding:4 __PACKED__;
unsigned char zero __PACKED__;
unsigned short section __PACKED__;
} elf_sym_t;
 
typedef struct
{
unsigned char * file, * sects,*bss,*symtab;
char * strtab;
unsigned long bss_sect_num,entry;
} exe_file_t;
 
int get_elf_section_name(exe_file_t * f,unsigned short sect_num,char * namebuf);
int get_elf_section_addr(exe_file_t * f,unsigned short sect_num,unsigned long * adr);
int get_elf_symbol_addr(exe_file_t * f,unsigned long i,
unsigned long * sym_val,unsigned short sect_num,
int (* lookup_fn)(char * symname,unsigned long * val));
int do_elf_relocation(exe_file_t * f,elf_reloc_t * reloc,
unsigned short sect_num,unsigned long symtab_sect_num,
int (* sym_lookup_fn)(char * symname,unsigned long * val),int ignore_ext);
int get_elf_section_index(exe_file_t * f,char * sect_name,unsigned long * i);
int elf_load_from_mem(exe_file_t * f);
int relocate_elf_file(exe_file_t * f,
int (* sym_lookup_fn)(char * symname,unsigned long * val),int ignore_ext);
int get_elf_symbol_value(exe_file_t * f,char * symname,unsigned long * symval);
 
 
#endif
/contrib/media/updf/include/elf.h
0,0 → 1,2105
/* This file defines standard ELF types, structures, and macros.
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
 
The GNU C 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.1 of the License, or (at your option) any later version.
 
The GNU C 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 the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
 
#ifndef _ELF_H
#define _ELF_H 1
 
#include <features.h>
 
 
/* Standard ELF types. */
 
#include <stdint.h>
 
/* Type for a 16-bit quantity. */
typedef uint16_t Elf32_Half;
typedef uint16_t Elf64_Half;
 
/* Types for signed and unsigned 32-bit quantities. */
typedef uint32_t Elf32_Word;
typedef int32_t Elf32_Sword;
typedef uint32_t Elf64_Word;
typedef int32_t Elf64_Sword;
 
/* Types for signed and unsigned 64-bit quantities. */
typedef uint64_t Elf32_Xword;
typedef int64_t Elf32_Sxword;
typedef uint64_t Elf64_Xword;
typedef int64_t Elf64_Sxword;
 
/* Type of addresses. */
typedef uint32_t Elf32_Addr;
typedef uint64_t Elf64_Addr;
 
/* Type of file offsets. */
typedef uint32_t Elf32_Off;
typedef uint64_t Elf64_Off;
 
/* Type for section indices, which are 16-bit quantities. */
typedef uint16_t Elf32_Section;
typedef uint16_t Elf64_Section;
 
/* Type for version symbol information. */
typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;
 
 
/* The ELF file header. This appears at the start of every ELF file. */
 
#define EI_NIDENT (16)
 
typedef struct
{
unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */
Elf32_Half e_type; /* Object file type */
Elf32_Half e_machine; /* Architecture */
Elf32_Word e_version; /* Object file version */
Elf32_Addr e_entry; /* Entry point virtual address */
Elf32_Off e_phoff; /* Program header table file offset */
Elf32_Off e_shoff; /* Section header table file offset */
Elf32_Word e_flags; /* Processor-specific flags */
Elf32_Half e_ehsize; /* ELF header size in bytes */
Elf32_Half e_phentsize; /* Program header table entry size */
Elf32_Half e_phnum; /* Program header table entry count */
Elf32_Half e_shentsize; /* Section header table entry size */
Elf32_Half e_shnum; /* Section header table entry count */
Elf32_Half e_shstrndx; /* Section header string table index */
} Elf32_Ehdr;
 
typedef struct
{
unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */
Elf64_Half e_type; /* Object file type */
Elf64_Half e_machine; /* Architecture */
Elf64_Word e_version; /* Object file version */
Elf64_Addr e_entry; /* Entry point virtual address */
Elf64_Off e_phoff; /* Program header table file offset */
Elf64_Off e_shoff; /* Section header table file offset */
Elf64_Word e_flags; /* Processor-specific flags */
Elf64_Half e_ehsize; /* ELF header size in bytes */
Elf64_Half e_phentsize; /* Program header table entry size */
Elf64_Half e_phnum; /* Program header table entry count */
Elf64_Half e_shentsize; /* Section header table entry size */
Elf64_Half e_shnum; /* Section header table entry count */
Elf64_Half e_shstrndx; /* Section header string table index */
} Elf64_Ehdr;
 
/* Fields in the e_ident array. The EI_* macros are indices into the
array. The macros under each EI_* macro are the values the byte
may have. */
 
#define EI_MAG0 0 /* File identification byte 0 index */
#define ELFMAG0 0x7f /* Magic number byte 0 */
 
#define EI_MAG1 1 /* File identification byte 1 index */
#define ELFMAG1 'E' /* Magic number byte 1 */
 
#define EI_MAG2 2 /* File identification byte 2 index */
#define ELFMAG2 'L' /* Magic number byte 2 */
 
#define EI_MAG3 3 /* File identification byte 3 index */
#define ELFMAG3 'F' /* Magic number byte 3 */
 
/* Conglomeration of the identification bytes, for easy testing as a word. */
#define ELFMAG "\177ELF"
#define SELFMAG 4
 
#define EI_CLASS 4 /* File class byte index */
#define ELFCLASSNONE 0 /* Invalid class */
#define ELFCLASS32 1 /* 32-bit objects */
#define ELFCLASS64 2 /* 64-bit objects */
#define ELFCLASSNUM 3
 
#define EI_DATA 5 /* Data encoding byte index */
#define ELFDATANONE 0 /* Invalid data encoding */
#define ELFDATA2LSB 1 /* 2's complement, little endian */
#define ELFDATA2MSB 2 /* 2's complement, big endian */
#define ELFDATANUM 3
 
#define EI_VERSION 6 /* File version byte index */
/* Value must be EV_CURRENT */
 
#define EI_OSABI 7 /* OS ABI identification */
#define ELFOSABI_SYSV 0 /* UNIX System V ABI */
#define ELFOSABI_HPUX 1 /* HP-UX */
#define ELFOSABI_ARM 97 /* ARM */
#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
 
#define EI_ABIVERSION 8 /* ABI version */
 
#define EI_PAD 9 /* Byte index of padding bytes */
 
/* Legal values for e_type (object file type). */
 
#define ET_NONE 0 /* No file type */
#define ET_REL 1 /* Relocatable file */
#define ET_EXEC 2 /* Executable file */
#define ET_DYN 3 /* Shared object file */
#define ET_CORE 4 /* Core file */
#define ET_NUM 5 /* Number of defined types */
#define ET_LOOS 0xfe00 /* OS-specific range start */
#define ET_HIOS 0xfeff /* OS-specific range end */
#define ET_LOPROC 0xff00 /* Processor-specific range start */
#define ET_HIPROC 0xffff /* Processor-specific range end */
 
/* Legal values for e_machine (architecture). */
 
#define EM_NONE 0 /* No machine */
#define EM_M32 1 /* AT&T WE 32100 */
#define EM_SPARC 2 /* SUN SPARC */
#define EM_386 3 /* Intel 80386 */
#define EM_68K 4 /* Motorola m68k family */
#define EM_88K 5 /* Motorola m88k family */
#define EM_860 7 /* Intel 80860 */
#define EM_MIPS 8 /* MIPS R3000 big-endian */
#define EM_S370 9 /* IBM System/370 */
#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
 
#define EM_PARISC 15 /* HPPA */
#define EM_VPP500 17 /* Fujitsu VPP500 */
#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
#define EM_960 19 /* Intel 80960 */
#define EM_PPC 20 /* PowerPC */
#define EM_PPC64 21 /* PowerPC 64-bit */
#define EM_S390 22 /* IBM S390 */
 
#define EM_V800 36 /* NEC V800 series */
#define EM_FR20 37 /* Fujitsu FR20 */
#define EM_RH32 38 /* TRW RH-32 */
#define EM_RCE 39 /* Motorola RCE */
#define EM_ARM 40 /* ARM */
#define EM_FAKE_ALPHA 41 /* Digital Alpha */
#define EM_SH 42 /* Hitachi SH */
#define EM_SPARCV9 43 /* SPARC v9 64-bit */
#define EM_TRICORE 44 /* Siemens Tricore */
#define EM_ARC 45 /* Argonaut RISC Core */
#define EM_H8_300 46 /* Hitachi H8/300 */
#define EM_H8_300H 47 /* Hitachi H8/300H */
#define EM_H8S 48 /* Hitachi H8S */
#define EM_H8_500 49 /* Hitachi H8/500 */
#define EM_IA_64 50 /* Intel Merced */
#define EM_MIPS_X 51 /* Stanford MIPS-X */
#define EM_COLDFIRE 52 /* Motorola Coldfire */
#define EM_68HC12 53 /* Motorola M68HC12 */
#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/
#define EM_PCP 55 /* Siemens PCP */
#define EM_NCPU 56 /* Sony nCPU embeeded RISC */
#define EM_NDR1 57 /* Denso NDR1 microprocessor */
#define EM_STARCORE 58 /* Motorola Start*Core processor */
#define EM_ME16 59 /* Toyota ME16 processor */
#define EM_ST100 60 /* STMicroelectronic ST100 processor */
#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
#define EM_X86_64 62 /* AMD x86-64 architecture */
#define EM_PDSP 63 /* Sony DSP Processor */
 
#define EM_FX66 66 /* Siemens FX66 microcontroller */
#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */
#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */
#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */
#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */
#define EM_SVX 73 /* Silicon Graphics SVx */
#define EM_AT19 74 /* STMicroelectronics ST19 8 bit mc */
#define EM_VAX 75 /* Digital VAX */
#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */
#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */
#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */
#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */
#define EM_HUANY 81 /* Harvard University machine-independent object files */
#define EM_PRISM 82 /* SiTera Prism */
#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */
#define EM_FR30 84 /* Fujitsu FR30 */
#define EM_D10V 85 /* Mitsubishi D10V */
#define EM_D30V 86 /* Mitsubishi D30V */
#define EM_V850 87 /* NEC v850 */
#define EM_M32R 88 /* Mitsubishi M32R */
#define EM_MN10300 89 /* Matsushita MN10300 */
#define EM_MN10200 90 /* Matsushita MN10200 */
#define EM_PJ 91 /* picoJava */
#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
#define EM_NUM 95
 
/* If it is necessary to assign new unofficial EM_* values, please
pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
chances of collision with official or non-GNU unofficial values. */
 
#define EM_ALPHA 0x9026
 
/* Legal values for e_version (version). */
 
#define EV_NONE 0 /* Invalid ELF version */
#define EV_CURRENT 1 /* Current version */
#define EV_NUM 2
 
/* Section header. */
 
typedef struct
{
Elf32_Word sh_name; /* Section name (string tbl index) */
Elf32_Word sh_type; /* Section type */
Elf32_Word sh_flags; /* Section flags */
Elf32_Addr sh_addr; /* Section virtual addr at execution */
Elf32_Off sh_offset; /* Section file offset */
Elf32_Word sh_size; /* Section size in bytes */
Elf32_Word sh_link; /* Link to another section */
Elf32_Word sh_info; /* Additional section information */
Elf32_Word sh_addralign; /* Section alignment */
Elf32_Word sh_entsize; /* Entry size if section holds table */
} Elf32_Shdr;
 
typedef struct
{
Elf64_Word sh_name; /* Section name (string tbl index) */
Elf64_Word sh_type; /* Section type */
Elf64_Xword sh_flags; /* Section flags */
Elf64_Addr sh_addr; /* Section virtual addr at execution */
Elf64_Off sh_offset; /* Section file offset */
Elf64_Xword sh_size; /* Section size in bytes */
Elf64_Word sh_link; /* Link to another section */
Elf64_Word sh_info; /* Additional section information */
Elf64_Xword sh_addralign; /* Section alignment */
Elf64_Xword sh_entsize; /* Entry size if section holds table */
} Elf64_Shdr;
 
/* Special section indices. */
 
#define SHN_UNDEF 0 /* Undefined section */
#define SHN_LORESERVE 0xff00 /* Start of reserved indices */
#define SHN_LOPROC 0xff00 /* Start of processor-specific */
#define SHN_HIPROC 0xff1f /* End of processor-specific */
#define SHN_LOOS 0xff20 /* Start of OS-specific */
#define SHN_HIOS 0xff3f /* End of OS-specific */
#define SHN_ABS 0xfff1 /* Associated symbol is absolute */
#define SHN_COMMON 0xfff2 /* Associated symbol is common */
#define SHN_XINDEX 0xffff /* Index is in extra table. */
#define SHN_HIRESERVE 0xffff /* End of reserved indices */
 
/* Legal values for sh_type (section type). */
 
#define SHT_NULL 0 /* Section header table entry unused */
#define SHT_PROGBITS 1 /* Program data */
#define SHT_SYMTAB 2 /* Symbol table */
#define SHT_STRTAB 3 /* String table */
#define SHT_RELA 4 /* Relocation entries with addends */
#define SHT_HASH 5 /* Symbol hash table */
#define SHT_DYNAMIC 6 /* Dynamic linking information */
#define SHT_NOTE 7 /* Notes */
#define SHT_NOBITS 8 /* Program space with no data (bss) */
#define SHT_REL 9 /* Relocation entries, no addends */
#define SHT_SHLIB 10 /* Reserved */
#define SHT_DYNSYM 11 /* Dynamic linker symbol table */
#define SHT_INIT_ARRAY 14 /* Array of constructors */
#define SHT_FINI_ARRAY 15 /* Array of destructors */
#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
#define SHT_GROUP 17 /* Section group */
#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */
#define SHT_NUM 19 /* Number of defined types. */
#define SHT_LOOS 0x60000000 /* Start OS-specific */
#define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */
#define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */
#define SHT_LOSUNW 0x6ffffffa /* Sun-specific low bound. */
#define SHT_SUNW_move 0x6ffffffa
#define SHT_SUNW_COMDAT 0x6ffffffb
#define SHT_SUNW_syminfo 0x6ffffffc
#define SHT_GNU_verdef 0x6ffffffd /* Version definition section. */
#define SHT_GNU_verneed 0x6ffffffe /* Version needs section. */
#define SHT_GNU_versym 0x6fffffff /* Version symbol table. */
#define SHT_HISUNW 0x6fffffff /* Sun-specific high bound. */
#define SHT_HIOS 0x6fffffff /* End OS-specific type */
#define SHT_LOPROC 0x70000000 /* Start of processor-specific */
#define SHT_HIPROC 0x7fffffff /* End of processor-specific */
#define SHT_LOUSER 0x80000000 /* Start of application-specific */
#define SHT_HIUSER 0x8fffffff /* End of application-specific */
 
/* Legal values for sh_flags (section flags). */
 
#define SHF_WRITE (1 << 0) /* Writable */
#define SHF_ALLOC (1 << 1) /* Occupies memory during execution */
#define SHF_EXECINSTR (1 << 2) /* Executable */
#define SHF_MERGE (1 << 4) /* Might be merged */
#define SHF_STRINGS (1 << 5) /* Contains nul-terminated strings */
#define SHF_INFO_LINK (1 << 6) /* `sh_info' contains SHT index */
#define SHF_LINK_ORDER (1 << 7) /* Preserve order after combining */
#define SHF_OS_NONCONFORMING (1 << 8) /* Non-standard OS specific handling
required */
#define SHF_MASKOS 0x0ff00000 /* OS-specific. */
#define SHF_MASKPROC 0xf0000000 /* Processor-specific */
 
/* Section group handling. */
#define GRP_COMDAT 0x1 /* Mark group as COMDAT. */
 
/* Symbol table entry. */
 
typedef struct
{
Elf32_Word st_name; /* Symbol name (string tbl index) */
Elf32_Addr st_value; /* Symbol value */
Elf32_Word st_size; /* Symbol size */
unsigned char st_info; /* Symbol type and binding */
unsigned char st_other; /* Symbol visibility */
Elf32_Section st_shndx; /* Section index */
} Elf32_Sym;
 
typedef struct
{
Elf64_Word st_name; /* Symbol name (string tbl index) */
unsigned char st_info; /* Symbol type and binding */
unsigned char st_other; /* Symbol visibility */
Elf64_Section st_shndx; /* Section index */
Elf64_Addr st_value; /* Symbol value */
Elf64_Xword st_size; /* Symbol size */
} Elf64_Sym;
 
/* The syminfo section if available contains additional information about
every dynamic symbol. */
 
typedef struct
{
Elf32_Half si_boundto; /* Direct bindings, symbol bound to */
Elf32_Half si_flags; /* Per symbol flags */
} Elf32_Syminfo;
 
typedef struct
{
Elf64_Half si_boundto; /* Direct bindings, symbol bound to */
Elf64_Half si_flags; /* Per symbol flags */
} Elf64_Syminfo;
 
/* Possible values for si_boundto. */
#define SYMINFO_BT_SELF 0xffff /* Symbol bound to self */
#define SYMINFO_BT_PARENT 0xfffe /* Symbol bound to parent */
#define SYMINFO_BT_LOWRESERVE 0xff00 /* Beginning of reserved entries */
 
/* Possible bitmasks for si_flags. */
#define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */
#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */
#define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */
#define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy
loaded */
/* Syminfo version values. */
#define SYMINFO_NONE 0
#define SYMINFO_CURRENT 1
#define SYMINFO_NUM 2
 
 
/* Special section index. */
 
#define SHN_UNDEF 0 /* No section, undefined symbol. */
 
/* How to extract and insert information held in the st_info field. */
 
#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
#define ELF32_ST_TYPE(val) ((val) & 0xf)
#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
 
/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */
#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
 
/* Legal values for ST_BIND subfield of st_info (symbol binding). */
 
#define STB_LOCAL 0 /* Local symbol */
#define STB_GLOBAL 1 /* Global symbol */
#define STB_WEAK 2 /* Weak symbol */
#define STB_NUM 3 /* Number of defined types. */
#define STB_LOOS 10 /* Start of OS-specific */
#define STB_HIOS 12 /* End of OS-specific */
#define STB_LOPROC 13 /* Start of processor-specific */
#define STB_HIPROC 15 /* End of processor-specific */
 
/* Legal values for ST_TYPE subfield of st_info (symbol type). */
 
#define STT_NOTYPE 0 /* Symbol type is unspecified */
#define STT_OBJECT 1 /* Symbol is a data object */
#define STT_FUNC 2 /* Symbol is a code object */
#define STT_SECTION 3 /* Symbol associated with a section */
#define STT_FILE 4 /* Symbol's name is file name */
#define STT_COMMON 5 /* Symbol is a common data object */
#define STT_NUM 6 /* Number of defined types. */
#define STT_LOOS 10 /* Start of OS-specific */
#define STT_HIOS 12 /* End of OS-specific */
#define STT_LOPROC 13 /* Start of processor-specific */
#define STT_HIPROC 15 /* End of processor-specific */
 
 
/* Symbol table indices are found in the hash buckets and chain table
of a symbol hash table section. This special index value indicates
the end of a chain, meaning no further symbols are found in that bucket. */
 
#define STN_UNDEF 0 /* End of a chain. */
 
 
/* How to extract and insert information held in the st_other field. */
 
#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
 
/* For ELF64 the definitions are the same. */
#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
 
/* Symbol visibility specification encoded in the st_other field. */
#define STV_DEFAULT 0 /* Default symbol visibility rules */
#define STV_INTERNAL 1 /* Processor specific hidden class */
#define STV_HIDDEN 2 /* Sym unavailable in other modules */
#define STV_PROTECTED 3 /* Not preemptible, not exported */
 
 
/* Relocation table entry without addend (in section of type SHT_REL). */
 
typedef struct
{
Elf32_Addr r_offset; /* Address */
Elf32_Word r_info; /* Relocation type and symbol index */
} Elf32_Rel;
 
/* I have seen two different definitions of the Elf64_Rel and
Elf64_Rela structures, so we'll leave them out until Novell (or
whoever) gets their act together. */
/* The following, at least, is used on Sparc v9, MIPS, and Alpha. */
 
typedef struct
{
Elf64_Addr r_offset; /* Address */
Elf64_Xword r_info; /* Relocation type and symbol index */
} Elf64_Rel;
 
/* Relocation table entry with addend (in section of type SHT_RELA). */
 
typedef struct
{
Elf32_Addr r_offset; /* Address */
Elf32_Word r_info; /* Relocation type and symbol index */
Elf32_Sword r_addend; /* Addend */
} Elf32_Rela;
 
typedef struct
{
Elf64_Addr r_offset; /* Address */
Elf64_Xword r_info; /* Relocation type and symbol index */
Elf64_Sxword r_addend; /* Addend */
} Elf64_Rela;
 
/* How to extract and insert information held in the r_info field. */
 
#define ELF32_R_SYM(val) ((val) >> 8)
#define ELF32_R_TYPE(val) ((val) & 0xff)
#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
 
#define ELF64_R_SYM(i) ((i) >> 32)
#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
 
/* Program segment header. */
 
typedef struct
{
Elf32_Word p_type; /* Segment type */
Elf32_Off p_offset; /* Segment file offset */
Elf32_Addr p_vaddr; /* Segment virtual address */
Elf32_Addr p_paddr; /* Segment physical address */
Elf32_Word p_filesz; /* Segment size in file */
Elf32_Word p_memsz; /* Segment size in memory */
Elf32_Word p_flags; /* Segment flags */
Elf32_Word p_align; /* Segment alignment */
} Elf32_Phdr;
 
typedef struct
{
Elf64_Word p_type; /* Segment type */
Elf64_Word p_flags; /* Segment flags */
Elf64_Off p_offset; /* Segment file offset */
Elf64_Addr p_vaddr; /* Segment virtual address */
Elf64_Addr p_paddr; /* Segment physical address */
Elf64_Xword p_filesz; /* Segment size in file */
Elf64_Xword p_memsz; /* Segment size in memory */
Elf64_Xword p_align; /* Segment alignment */
} Elf64_Phdr;
 
/* Legal values for p_type (segment type). */
 
#define PT_NULL 0 /* Program header table entry unused */
#define PT_LOAD 1 /* Loadable program segment */
#define PT_DYNAMIC 2 /* Dynamic linking information */
#define PT_INTERP 3 /* Program interpreter */
#define PT_NOTE 4 /* Auxiliary information */
#define PT_SHLIB 5 /* Reserved */
#define PT_PHDR 6 /* Entry for header table itself */
#define PT_NUM 7 /* Number of defined types */
#define PT_LOOS 0x60000000 /* Start of OS-specific */
#define PT_HIOS 0x6fffffff /* End of OS-specific */
#define PT_LOPROC 0x70000000 /* Start of processor-specific */
#define PT_HIPROC 0x7fffffff /* End of processor-specific */
 
/* Legal values for p_flags (segment flags). */
 
#define PF_X (1 << 0) /* Segment is executable */
#define PF_W (1 << 1) /* Segment is writable */
#define PF_R (1 << 2) /* Segment is readable */
#define PF_MASKOS 0x0ff00000 /* OS-specific */
#define PF_MASKPROC 0xf0000000 /* Processor-specific */
 
/* Legal values for note segment descriptor types for core files. */
 
#define NT_PRSTATUS 1 /* Contains copy of prstatus struct */
#define NT_FPREGSET 2 /* Contains copy of fpregset struct */
#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */
#define NT_PRXREG 4 /* Contains copy of prxregset struct */
#define NT_PLATFORM 5 /* String from sysinfo(SI_PLATFORM) */
#define NT_AUXV 6 /* Contains copy of auxv array */
#define NT_GWINDOWS 7 /* Contains copy of gwindows struct */
#define NT_PSTATUS 10 /* Contains copy of pstatus struct */
#define NT_PSINFO 13 /* Contains copy of psinfo struct */
#define NT_PRCRED 14 /* Contains copy of prcred struct */
#define NT_UTSNAME 15 /* Contains copy of utsname struct */
#define NT_LWPSTATUS 16 /* Contains copy of lwpstatus struct */
#define NT_LWPSINFO 17 /* Contains copy of lwpinfo struct */
#define NT_PRFPXREG 20 /* Contains copy of fprxregset struct*/
 
/* Legal values for the note segment descriptor types for object files. */
 
#define NT_VERSION 1 /* Contains a version string. */
 
 
/* Dynamic section entry. */
 
typedef struct
{
Elf32_Sword d_tag; /* Dynamic entry type */
union
{
Elf32_Word d_val; /* Integer value */
Elf32_Addr d_ptr; /* Address value */
} d_un;
} Elf32_Dyn;
 
typedef struct
{
Elf64_Sxword d_tag; /* Dynamic entry type */
union
{
Elf64_Xword d_val; /* Integer value */
Elf64_Addr d_ptr; /* Address value */
} d_un;
} Elf64_Dyn;
 
/* Legal values for d_tag (dynamic entry type). */
 
#define DT_NULL 0 /* Marks end of dynamic section */
#define DT_NEEDED 1 /* Name of needed library */
#define DT_PLTRELSZ 2 /* Size in bytes of PLT relocs */
#define DT_PLTGOT 3 /* Processor defined value */
#define DT_HASH 4 /* Address of symbol hash table */
#define DT_STRTAB 5 /* Address of string table */
#define DT_SYMTAB 6 /* Address of symbol table */
#define DT_RELA 7 /* Address of Rela relocs */
#define DT_RELASZ 8 /* Total size of Rela relocs */
#define DT_RELAENT 9 /* Size of one Rela reloc */
#define DT_STRSZ 10 /* Size of string table */
#define DT_SYMENT 11 /* Size of one symbol table entry */
#define DT_INIT 12 /* Address of init function */
#define DT_FINI 13 /* Address of termination function */
#define DT_SONAME 14 /* Name of shared object */
#define DT_RPATH 15 /* Library search path (deprecated) */
#define DT_SYMBOLIC 16 /* Start symbol search here */
#define DT_REL 17 /* Address of Rel relocs */
#define DT_RELSZ 18 /* Total size of Rel relocs */
#define DT_RELENT 19 /* Size of one Rel reloc */
#define DT_PLTREL 20 /* Type of reloc in PLT */
#define DT_DEBUG 21 /* For debugging; unspecified */
#define DT_TEXTREL 22 /* Reloc might modify .text */
#define DT_JMPREL 23 /* Address of PLT relocs */
#define DT_BIND_NOW 24 /* Process relocations of object */
#define DT_INIT_ARRAY 25 /* Array with addresses of init fct */
#define DT_FINI_ARRAY 26 /* Array with addresses of fini fct */
#define DT_INIT_ARRAYSZ 27 /* Size in bytes of DT_INIT_ARRAY */
#define DT_FINI_ARRAYSZ 28 /* Size in bytes of DT_FINI_ARRAY */
#define DT_RUNPATH 29 /* Library search path */
#define DT_FLAGS 30 /* Flags for the object being loaded */
#define DT_ENCODING 32 /* Start of encoded range */
#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/
#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */
#define DT_NUM 34 /* Number used */
#define DT_LOOS 0x60000000 /* Start of OS-specific */
#define DT_HIOS 0x6fffffff /* End of OS-specific */
#define DT_LOPROC 0x70000000 /* Start of processor-specific */
#define DT_HIPROC 0x7fffffff /* End of processor-specific */
#define DT_PROCNUM DT_MIPS_NUM /* Most used by any processor */
 
/* DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the
Dyn.d_un.d_val field of the Elf*_Dyn structure. This follows Sun's
approach. */
#define DT_VALRNGLO 0x6ffffd00
#define DT_GNU_PRELINKED 0x6ffffdf5 /* Prelinking timestamp */
#define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* Size of conflict section */
#define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* Size of library list */
#define DT_CHECKSUM 0x6ffffdf8
#define DT_PLTPADSZ 0x6ffffdf9
#define DT_MOVEENT 0x6ffffdfa
#define DT_MOVESZ 0x6ffffdfb
#define DT_FEATURE_1 0x6ffffdfc /* Feature selection (DTF_*). */
#define DT_POSFLAG_1 0x6ffffdfd /* Flags for DT_* entries, effecting
the following DT_* entry. */
#define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */
#define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */
#define DT_VALRNGHI 0x6ffffdff
#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */
#define DT_VALNUM 12
 
/* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
 
If any adjustment is made to the ELF object after it has been
built these entries will need to be adjusted. */
#define DT_ADDRRNGLO 0x6ffffe00
#define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */
#define DT_GNU_LIBLIST 0x6ffffef9 /* Library list */
#define DT_CONFIG 0x6ffffefa /* Configuration information. */
#define DT_DEPAUDIT 0x6ffffefb /* Dependency auditing. */
#define DT_AUDIT 0x6ffffefc /* Object auditing. */
#define DT_PLTPAD 0x6ffffefd /* PLT padding. */
#define DT_MOVETAB 0x6ffffefe /* Move table. */
#define DT_SYMINFO 0x6ffffeff /* Syminfo table. */
#define DT_ADDRRNGHI 0x6ffffeff
#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) /* Reverse order! */
#define DT_ADDRNUM 10
 
/* The versioning entry types. The next are defined as part of the
GNU extension. */
#define DT_VERSYM 0x6ffffff0
 
#define DT_RELACOUNT 0x6ffffff9
#define DT_RELCOUNT 0x6ffffffa
 
/* These were chosen by Sun. */
#define DT_FLAGS_1 0x6ffffffb /* State flags, see DF_1_* below. */
#define DT_VERDEF 0x6ffffffc /* Address of version definition
table */
#define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */
#define DT_VERNEED 0x6ffffffe /* Address of table with needed
versions */
#define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */
#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */
#define DT_VERSIONTAGNUM 16
 
/* Sun added these machine-independent extensions in the "processor-specific"
range. Be compatible. */
#define DT_AUXILIARY 0x7ffffffd /* Shared object to load before self */
#define DT_FILTER 0x7fffffff /* Shared object to get values from */
#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
#define DT_EXTRANUM 3
 
/* Values of `d_un.d_val' in the DT_FLAGS entry. */
#define DF_ORIGIN 0x00000001 /* Object may use DF_ORIGIN */
#define DF_SYMBOLIC 0x00000002 /* Symbol resolutions starts here */
#define DF_TEXTREL 0x00000004 /* Object contains text relocations */
#define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */
 
/* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1
entry in the dynamic section. */
#define DF_1_NOW 0x00000001 /* Set RTLD_NOW for this object. */
#define DF_1_GLOBAL 0x00000002 /* Set RTLD_GLOBAL for this object. */
#define DF_1_GROUP 0x00000004 /* Set RTLD_GROUP for this object. */
#define DF_1_NODELETE 0x00000008 /* Set RTLD_NODELETE for this object.*/
#define DF_1_LOADFLTR 0x00000010 /* Trigger filtee loading at runtime.*/
#define DF_1_INITFIRST 0x00000020 /* Set RTLD_INITFIRST for this object*/
#define DF_1_NOOPEN 0x00000040 /* Set RTLD_NOOPEN for this object. */
#define DF_1_ORIGIN 0x00000080 /* $ORIGIN must be handled. */
#define DF_1_DIRECT 0x00000100 /* Direct binding enabled. */
#define DF_1_TRANS 0x00000200
#define DF_1_INTERPOSE 0x00000400 /* Object is used to interpose. */
#define DF_1_NODEFLIB 0x00000800 /* Ignore default lib search path. */
#define DF_1_NODUMP 0x00001000 /* Object can't be dldump'ed. */
#define DF_1_CONFALT 0x00002000 /* Configuration alternative created.*/
#define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */
#define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */
#define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. */
 
/* Flags for the feature selection in DT_FEATURE_1. */
#define DTF_1_PARINIT 0x00000001
#define DTF_1_CONFEXP 0x00000002
 
/* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. */
#define DF_P1_LAZYLOAD 0x00000001 /* Lazyload following object. */
#define DF_P1_GROUPPERM 0x00000002 /* Symbols from next object are not
generally available. */
 
/* Version definition sections. */
 
typedef struct
{
Elf32_Half vd_version; /* Version revision */
Elf32_Half vd_flags; /* Version information */
Elf32_Half vd_ndx; /* Version Index */
Elf32_Half vd_cnt; /* Number of associated aux entries */
Elf32_Word vd_hash; /* Version name hash value */
Elf32_Word vd_aux; /* Offset in bytes to verdaux array */
Elf32_Word vd_next; /* Offset in bytes to next verdef
entry */
} Elf32_Verdef;
 
typedef struct
{
Elf64_Half vd_version; /* Version revision */
Elf64_Half vd_flags; /* Version information */
Elf64_Half vd_ndx; /* Version Index */
Elf64_Half vd_cnt; /* Number of associated aux entries */
Elf64_Word vd_hash; /* Version name hash value */
Elf64_Word vd_aux; /* Offset in bytes to verdaux array */
Elf64_Word vd_next; /* Offset in bytes to next verdef
entry */
} Elf64_Verdef;
 
 
/* Legal values for vd_version (version revision). */
#define VER_DEF_NONE 0 /* No version */
#define VER_DEF_CURRENT 1 /* Current version */
#define VER_DEF_NUM 2 /* Given version number */
 
/* Legal values for vd_flags (version information flags). */
#define VER_FLG_BASE 0x1 /* Version definition of file itself */
#define VER_FLG_WEAK 0x2 /* Weak version identifier */
 
/* Versym symbol index values. */
#define VER_NDX_LOCAL 0 /* Symbol is local. */
#define VER_NDX_GLOBAL 1 /* Symbol is global. */
#define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */
#define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */
 
/* Auxialiary version information. */
 
typedef struct
{
Elf32_Word vda_name; /* Version or dependency names */
Elf32_Word vda_next; /* Offset in bytes to next verdaux
entry */
} Elf32_Verdaux;
 
typedef struct
{
Elf64_Word vda_name; /* Version or dependency names */
Elf64_Word vda_next; /* Offset in bytes to next verdaux
entry */
} Elf64_Verdaux;
 
 
/* Version dependency section. */
 
typedef struct
{
Elf32_Half vn_version; /* Version of structure */
Elf32_Half vn_cnt; /* Number of associated aux entries */
Elf32_Word vn_file; /* Offset of filename for this
dependency */
Elf32_Word vn_aux; /* Offset in bytes to vernaux array */
Elf32_Word vn_next; /* Offset in bytes to next verneed
entry */
} Elf32_Verneed;
 
typedef struct
{
Elf64_Half vn_version; /* Version of structure */
Elf64_Half vn_cnt; /* Number of associated aux entries */
Elf64_Word vn_file; /* Offset of filename for this
dependency */
Elf64_Word vn_aux; /* Offset in bytes to vernaux array */
Elf64_Word vn_next; /* Offset in bytes to next verneed
entry */
} Elf64_Verneed;
 
 
/* Legal values for vn_version (version revision). */
#define VER_NEED_NONE 0 /* No version */
#define VER_NEED_CURRENT 1 /* Current version */
#define VER_NEED_NUM 2 /* Given version number */
 
/* Auxiliary needed version information. */
 
typedef struct
{
Elf32_Word vna_hash; /* Hash value of dependency name */
Elf32_Half vna_flags; /* Dependency specific information */
Elf32_Half vna_other; /* Unused */
Elf32_Word vna_name; /* Dependency name string offset */
Elf32_Word vna_next; /* Offset in bytes to next vernaux
entry */
} Elf32_Vernaux;
 
typedef struct
{
Elf64_Word vna_hash; /* Hash value of dependency name */
Elf64_Half vna_flags; /* Dependency specific information */
Elf64_Half vna_other; /* Unused */
Elf64_Word vna_name; /* Dependency name string offset */
Elf64_Word vna_next; /* Offset in bytes to next vernaux
entry */
} Elf64_Vernaux;
 
 
/* Legal values for vna_flags. */
#define VER_FLG_WEAK 0x2 /* Weak version identifier */
 
 
/* Auxiliary vector. */
 
/* This vector is normally only used by the program interpreter. The
usual definition in an ABI supplement uses the name auxv_t. The
vector is not usually defined in a standard <elf.h> file, but it
can't hurt. We rename it to avoid conflicts. The sizes of these
types are an arrangement between the exec server and the program
interpreter, so we don't fully specify them here. */
 
typedef struct
{
int a_type; /* Entry type */
union
{
long int a_val; /* Integer value */
void *a_ptr; /* Pointer value */
void (*a_fcn) (void); /* Function pointer value */
} a_un;
} Elf32_auxv_t;
 
typedef struct
{
long int a_type; /* Entry type */
union
{
long int a_val; /* Integer value */
void *a_ptr; /* Pointer value */
void (*a_fcn) (void); /* Function pointer value */
} a_un;
} Elf64_auxv_t;
 
/* Legal values for a_type (entry type). */
 
#define AT_NULL 0 /* End of vector */
#define AT_IGNORE 1 /* Entry should be ignored */
#define AT_EXECFD 2 /* File descriptor of program */
#define AT_PHDR 3 /* Program headers for program */
#define AT_PHENT 4 /* Size of program header entry */
#define AT_PHNUM 5 /* Number of program headers */
#define AT_PAGESZ 6 /* System page size */
#define AT_BASE 7 /* Base address of interpreter */
#define AT_FLAGS 8 /* Flags */
#define AT_ENTRY 9 /* Entry point of program */
#define AT_NOTELF 10 /* Program is not ELF */
#define AT_UID 11 /* Real uid */
#define AT_EUID 12 /* Effective uid */
#define AT_GID 13 /* Real gid */
#define AT_EGID 14 /* Effective gid */
#define AT_CLKTCK 17 /* Frequency of times() */
 
/* Some more special a_type values describing the hardware. */
#define AT_PLATFORM 15 /* String identifying platform. */
#define AT_HWCAP 16 /* Machine dependent hints about
processor capabilities. */
 
/* This entry gives some information about the FPU initialization
performed by the kernel. */
#define AT_FPUCW 18 /* Used FPU control word. */
 
/* Cache block sizes. */
#define AT_DCACHEBSIZE 19 /* Data cache block size. */
#define AT_ICACHEBSIZE 20 /* Instruction cache block size. */
#define AT_UCACHEBSIZE 21 /* Unified cache block size. */
 
/* A special ignored value for PPC, used by the kernel to control the
interpretation of the AUXV. Must be > 16. */
#define AT_IGNOREPPC 22 /* Entry should be ignored */
 
 
/* Note section contents. Each entry in the note section begins with
a header of a fixed form. */
 
typedef struct
{
Elf32_Word n_namesz; /* Length of the note's name. */
Elf32_Word n_descsz; /* Length of the note's descriptor. */
Elf32_Word n_type; /* Type of the note. */
} Elf32_Nhdr;
 
typedef struct
{
Elf64_Word n_namesz; /* Length of the note's name. */
Elf64_Word n_descsz; /* Length of the note's descriptor. */
Elf64_Word n_type; /* Type of the note. */
} Elf64_Nhdr;
 
/* Known names of notes. */
 
/* Solaris entries in the note section have this name. */
#define ELF_NOTE_SOLARIS "SUNW Solaris"
 
/* Note entries for GNU systems have this name. */
#define ELF_NOTE_GNU "GNU"
 
 
/* Defined types of notes for Solaris. */
 
/* Value of descriptor (one word) is desired pagesize for the binary. */
#define ELF_NOTE_PAGESIZE_HINT 1
 
 
/* Defined note types for GNU systems. */
 
/* ABI information. The descriptor consists of words:
word 0: OS descriptor
word 1: major version of the ABI
word 2: minor version of the ABI
word 3: subminor version of the ABI
*/
#define ELF_NOTE_ABI 1
 
/* Known OSes. These value can appear in word 0 of an ELF_NOTE_ABI
note section entry. */
#define ELF_NOTE_OS_LINUX 0
#define ELF_NOTE_OS_GNU 1
#define ELF_NOTE_OS_SOLARIS2 2
 
 
/* Move records. */
typedef struct
{
Elf32_Xword m_value; /* Symbol value. */
Elf32_Word m_info; /* Size and index. */
Elf32_Word m_poffset; /* Symbol offset. */
Elf32_Half m_repeat; /* Repeat count. */
Elf32_Half m_stride; /* Stride info. */
} Elf32_Move;
 
typedef struct
{
Elf64_Xword m_value; /* Symbol value. */
Elf64_Xword m_info; /* Size and index. */
Elf64_Xword m_poffset; /* Symbol offset. */
Elf64_Half m_repeat; /* Repeat count. */
Elf64_Half m_stride; /* Stride info. */
} Elf64_Move;
 
/* Macro to construct move records. */
#define ELF32_M_SYM(info) ((info) >> 8)
#define ELF32_M_SIZE(info) ((unsigned char) (info))
#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
 
#define ELF64_M_SYM(info) ELF32_M_SYM (info)
#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
 
 
/* Motorola 68k specific definitions. */
 
/* Values for Elf32_Ehdr.e_flags. */
#define EF_CPU32 0x00810000
 
/* m68k relocs. */
 
#define R_68K_NONE 0 /* No reloc */
#define R_68K_32 1 /* Direct 32 bit */
#define R_68K_16 2 /* Direct 16 bit */
#define R_68K_8 3 /* Direct 8 bit */
#define R_68K_PC32 4 /* PC relative 32 bit */
#define R_68K_PC16 5 /* PC relative 16 bit */
#define R_68K_PC8 6 /* PC relative 8 bit */
#define R_68K_GOT32 7 /* 32 bit PC relative GOT entry */
#define R_68K_GOT16 8 /* 16 bit PC relative GOT entry */
#define R_68K_GOT8 9 /* 8 bit PC relative GOT entry */
#define R_68K_GOT32O 10 /* 32 bit GOT offset */
#define R_68K_GOT16O 11 /* 16 bit GOT offset */
#define R_68K_GOT8O 12 /* 8 bit GOT offset */
#define R_68K_PLT32 13 /* 32 bit PC relative PLT address */
#define R_68K_PLT16 14 /* 16 bit PC relative PLT address */
#define R_68K_PLT8 15 /* 8 bit PC relative PLT address */
#define R_68K_PLT32O 16 /* 32 bit PLT offset */
#define R_68K_PLT16O 17 /* 16 bit PLT offset */
#define R_68K_PLT8O 18 /* 8 bit PLT offset */
#define R_68K_COPY 19 /* Copy symbol at runtime */
#define R_68K_GLOB_DAT 20 /* Create GOT entry */
#define R_68K_JMP_SLOT 21 /* Create PLT entry */
#define R_68K_RELATIVE 22 /* Adjust by program base */
/* Keep this the last entry. */
#define R_68K_NUM 23
 
/* Intel 80386 specific definitions. */
 
/* i386 relocs. */
 
#define R_386_NONE 0 /* No reloc */
#define R_386_32 1 /* Direct 32 bit */
#define R_386_PC32 2 /* PC relative 32 bit */
#define R_386_GOT32 3 /* 32 bit GOT entry */
#define R_386_PLT32 4 /* 32 bit PLT address */
#define R_386_COPY 5 /* Copy symbol at runtime */
#define R_386_GLOB_DAT 6 /* Create GOT entry */
#define R_386_JMP_SLOT 7 /* Create PLT entry */
#define R_386_RELATIVE 8 /* Adjust by program base */
#define R_386_GOTOFF 9 /* 32 bit offset to GOT */
#define R_386_GOTPC 10 /* 32 bit PC relative offset to GOT */
/* Keep this the last entry. */
#define R_386_NUM 11
 
/* SUN SPARC specific definitions. */
 
/* Legal values for ST_TYPE subfield of st_info (symbol type). */
 
#define STT_REGISTER 13 /* Global register reserved to app. */
 
/* Values for Elf64_Ehdr.e_flags. */
 
#define EF_SPARCV9_MM 3
#define EF_SPARCV9_TSO 0
#define EF_SPARCV9_PSO 1
#define EF_SPARCV9_RMO 2
#define EF_SPARC_LEDATA 0x800000 /* little endian data */
#define EF_SPARC_EXT_MASK 0xFFFF00
#define EF_SPARC_32PLUS 0x000100 /* generic V8+ features */
#define EF_SPARC_SUN_US1 0x000200 /* Sun UltraSPARC1 extensions */
#define EF_SPARC_HAL_R1 0x000400 /* HAL R1 extensions */
#define EF_SPARC_SUN_US3 0x000800 /* Sun UltraSPARCIII extensions */
 
/* SPARC relocs. */
 
#define R_SPARC_NONE 0 /* No reloc */
#define R_SPARC_8 1 /* Direct 8 bit */
#define R_SPARC_16 2 /* Direct 16 bit */
#define R_SPARC_32 3 /* Direct 32 bit */
#define R_SPARC_DISP8 4 /* PC relative 8 bit */
#define R_SPARC_DISP16 5 /* PC relative 16 bit */
#define R_SPARC_DISP32 6 /* PC relative 32 bit */
#define R_SPARC_WDISP30 7 /* PC relative 30 bit shifted */
#define R_SPARC_WDISP22 8 /* PC relative 22 bit shifted */
#define R_SPARC_HI22 9 /* High 22 bit */
#define R_SPARC_22 10 /* Direct 22 bit */
#define R_SPARC_13 11 /* Direct 13 bit */
#define R_SPARC_LO10 12 /* Truncated 10 bit */
#define R_SPARC_GOT10 13 /* Truncated 10 bit GOT entry */
#define R_SPARC_GOT13 14 /* 13 bit GOT entry */
#define R_SPARC_GOT22 15 /* 22 bit GOT entry shifted */
#define R_SPARC_PC10 16 /* PC relative 10 bit truncated */
#define R_SPARC_PC22 17 /* PC relative 22 bit shifted */
#define R_SPARC_WPLT30 18 /* 30 bit PC relative PLT address */
#define R_SPARC_COPY 19 /* Copy symbol at runtime */
#define R_SPARC_GLOB_DAT 20 /* Create GOT entry */
#define R_SPARC_JMP_SLOT 21 /* Create PLT entry */
#define R_SPARC_RELATIVE 22 /* Adjust by program base */
#define R_SPARC_UA32 23 /* Direct 32 bit unaligned */
 
/* Additional Sparc64 relocs. */
 
#define R_SPARC_PLT32 24 /* Direct 32 bit ref to PLT entry */
#define R_SPARC_HIPLT22 25 /* High 22 bit PLT entry */
#define R_SPARC_LOPLT10 26 /* Truncated 10 bit PLT entry */
#define R_SPARC_PCPLT32 27 /* PC rel 32 bit ref to PLT entry */
#define R_SPARC_PCPLT22 28 /* PC rel high 22 bit PLT entry */
#define R_SPARC_PCPLT10 29 /* PC rel trunc 10 bit PLT entry */
#define R_SPARC_10 30 /* Direct 10 bit */
#define R_SPARC_11 31 /* Direct 11 bit */
#define R_SPARC_64 32 /* Direct 64 bit */
#define R_SPARC_OLO10 33 /* 10bit with secondary 13bit addend */
#define R_SPARC_HH22 34 /* Top 22 bits of direct 64 bit */
#define R_SPARC_HM10 35 /* High middle 10 bits of ... */
#define R_SPARC_LM22 36 /* Low middle 22 bits of ... */
#define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */
#define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */
#define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */
#define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */
#define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */
#define R_SPARC_7 43 /* Direct 7 bit */
#define R_SPARC_5 44 /* Direct 5 bit */
#define R_SPARC_6 45 /* Direct 6 bit */
#define R_SPARC_DISP64 46 /* PC relative 64 bit */
#define R_SPARC_PLT64 47 /* Direct 64 bit ref to PLT entry */
#define R_SPARC_HIX22 48 /* High 22 bit complemented */
#define R_SPARC_LOX10 49 /* Truncated 11 bit complemented */
#define R_SPARC_H44 50 /* Direct high 12 of 44 bit */
#define R_SPARC_M44 51 /* Direct mid 22 of 44 bit */
#define R_SPARC_L44 52 /* Direct low 10 of 44 bit */
#define R_SPARC_REGISTER 53 /* Global register usage */
#define R_SPARC_UA64 54 /* Direct 64 bit unaligned */
#define R_SPARC_UA16 55 /* Direct 16 bit unaligned */
/* Keep this the last entry. */
#define R_SPARC_NUM 56
 
/* For Sparc64, legal values for d_tag of Elf64_Dyn. */
 
#define DT_SPARC_REGISTER 0x70000001
#define DT_SPARC_NUM 2
 
/* Bits present in AT_HWCAP, primarily for Sparc32. */
 
#define HWCAP_SPARC_FLUSH 1 /* The cpu supports flush insn. */
#define HWCAP_SPARC_STBAR 2
#define HWCAP_SPARC_SWAP 4
#define HWCAP_SPARC_MULDIV 8
#define HWCAP_SPARC_V9 16 /* The cpu is v9, so v8plus is ok. */
#define HWCAP_SPARC_ULTRA3 32
 
/* MIPS R3000 specific definitions. */
 
/* Legal values for e_flags field of Elf32_Ehdr. */
 
#define EF_MIPS_NOREORDER 1 /* A .noreorder directive was used */
#define EF_MIPS_PIC 2 /* Contains PIC code */
#define EF_MIPS_CPIC 4 /* Uses PIC calling sequence */
#define EF_MIPS_XGOT 8
#define EF_MIPS_64BIT_WHIRL 16
#define EF_MIPS_ABI2 32
#define EF_MIPS_ABI_ON32 64
#define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level */
 
/* Legal values for MIPS architecture level. */
 
#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */
#define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */
#define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */
#define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */
#define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */
#define EF_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */
#define EF_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */
 
/* The following are non-official names and should not be used. */
 
#define E_MIPS_ARCH_1 0x00000000 /* -mips1 code. */
#define E_MIPS_ARCH_2 0x10000000 /* -mips2 code. */
#define E_MIPS_ARCH_3 0x20000000 /* -mips3 code. */
#define E_MIPS_ARCH_4 0x30000000 /* -mips4 code. */
#define E_MIPS_ARCH_5 0x40000000 /* -mips5 code. */
#define E_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */
#define E_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */
 
/* Special section indices. */
 
#define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols */
#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */
#define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */
#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */
#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */
 
/* Legal values for sh_type field of Elf32_Shdr. */
 
#define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link */
#define SHT_MIPS_MSYM 0x70000001
#define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols */
#define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes */
#define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */
#define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging information*/
#define SHT_MIPS_REGINFO 0x70000006 /* Register usage information */
#define SHT_MIPS_PACKAGE 0x70000007
#define SHT_MIPS_PACKSYM 0x70000008
#define SHT_MIPS_RELD 0x70000009
#define SHT_MIPS_IFACE 0x7000000b
#define SHT_MIPS_CONTENT 0x7000000c
#define SHT_MIPS_OPTIONS 0x7000000d /* Miscellaneous options. */
#define SHT_MIPS_SHDR 0x70000010
#define SHT_MIPS_FDESC 0x70000011
#define SHT_MIPS_EXTSYM 0x70000012
#define SHT_MIPS_DENSE 0x70000013
#define SHT_MIPS_PDESC 0x70000014
#define SHT_MIPS_LOCSYM 0x70000015
#define SHT_MIPS_AUXSYM 0x70000016
#define SHT_MIPS_OPTSYM 0x70000017
#define SHT_MIPS_LOCSTR 0x70000018
#define SHT_MIPS_LINE 0x70000019
#define SHT_MIPS_RFDESC 0x7000001a
#define SHT_MIPS_DELTASYM 0x7000001b
#define SHT_MIPS_DELTAINST 0x7000001c
#define SHT_MIPS_DELTACLASS 0x7000001d
#define SHT_MIPS_DWARF 0x7000001e /* DWARF debugging information. */
#define SHT_MIPS_DELTADECL 0x7000001f
#define SHT_MIPS_SYMBOL_LIB 0x70000020
#define SHT_MIPS_EVENTS 0x70000021 /* Event section. */
#define SHT_MIPS_TRANSLATE 0x70000022
#define SHT_MIPS_PIXIE 0x70000023
#define SHT_MIPS_XLATE 0x70000024
#define SHT_MIPS_XLATE_DEBUG 0x70000025
#define SHT_MIPS_WHIRL 0x70000026
#define SHT_MIPS_EH_REGION 0x70000027
#define SHT_MIPS_XLATE_OLD 0x70000028
#define SHT_MIPS_PDR_EXCEPTION 0x70000029
 
/* Legal values for sh_flags field of Elf32_Shdr. */
 
#define SHF_MIPS_GPREL 0x10000000 /* Must be part of global data area */
#define SHF_MIPS_MERGE 0x20000000
#define SHF_MIPS_ADDR 0x40000000
#define SHF_MIPS_STRINGS 0x80000000
#define SHF_MIPS_NOSTRIP 0x08000000
#define SHF_MIPS_LOCAL 0x04000000
#define SHF_MIPS_NAMES 0x02000000
#define SHF_MIPS_NODUPE 0x01000000
 
 
/* Symbol tables. */
 
/* MIPS specific values for `st_other'. */
#define STO_MIPS_DEFAULT 0x0
#define STO_MIPS_INTERNAL 0x1
#define STO_MIPS_HIDDEN 0x2
#define STO_MIPS_PROTECTED 0x3
#define STO_MIPS_SC_ALIGN_UNUSED 0xff
 
/* MIPS specific values for `st_info'. */
#define STB_MIPS_SPLIT_COMMON 13
 
/* Entries found in sections of type SHT_MIPS_GPTAB. */
 
typedef union
{
struct
{
Elf32_Word gt_current_g_value; /* -G value used for compilation */
Elf32_Word gt_unused; /* Not used */
} gt_header; /* First entry in section */
struct
{
Elf32_Word gt_g_value; /* If this value were used for -G */
Elf32_Word gt_bytes; /* This many bytes would be used */
} gt_entry; /* Subsequent entries in section */
} Elf32_gptab;
 
/* Entry found in sections of type SHT_MIPS_REGINFO. */
 
typedef struct
{
Elf32_Word ri_gprmask; /* General registers used */
Elf32_Word ri_cprmask[4]; /* Coprocessor registers used */
Elf32_Sword ri_gp_value; /* $gp register value */
} Elf32_RegInfo;
 
/* Entries found in sections of type SHT_MIPS_OPTIONS. */
 
typedef struct
{
unsigned char kind; /* Determines interpretation of the
variable part of descriptor. */
unsigned char size; /* Size of descriptor, including header. */
Elf32_Section section; /* Section header index of section affected,
0 for global options. */
Elf32_Word info; /* Kind-specific information. */
} Elf_Options;
 
/* Values for `kind' field in Elf_Options. */
 
#define ODK_NULL 0 /* Undefined. */
#define ODK_REGINFO 1 /* Register usage information. */
#define ODK_EXCEPTIONS 2 /* Exception processing options. */
#define ODK_PAD 3 /* Section padding options. */
#define ODK_HWPATCH 4 /* Hardware workarounds performed */
#define ODK_FILL 5 /* record the fill value used by the linker. */
#define ODK_TAGS 6 /* reserve space for desktop tools to write. */
#define ODK_HWAND 7 /* HW workarounds. 'AND' bits when merging. */
#define ODK_HWOR 8 /* HW workarounds. 'OR' bits when merging. */
 
/* Values for `info' in Elf_Options for ODK_EXCEPTIONS entries. */
 
#define OEX_FPU_MIN 0x1f /* FPE's which MUST be enabled. */
#define OEX_FPU_MAX 0x1f00 /* FPE's which MAY be enabled. */
#define OEX_PAGE0 0x10000 /* page zero must be mapped. */
#define OEX_SMM 0x20000 /* Force sequential memory mode? */
#define OEX_FPDBUG 0x40000 /* Force floating point debug mode? */
#define OEX_PRECISEFP OEX_FPDBUG
#define OEX_DISMISS 0x80000 /* Dismiss invalid address faults? */
 
#define OEX_FPU_INVAL 0x10
#define OEX_FPU_DIV0 0x08
#define OEX_FPU_OFLO 0x04
#define OEX_FPU_UFLO 0x02
#define OEX_FPU_INEX 0x01
 
/* Masks for `info' in Elf_Options for an ODK_HWPATCH entry. */
 
#define OHW_R4KEOP 0x1 /* R4000 end-of-page patch. */
#define OHW_R8KPFETCH 0x2 /* may need R8000 prefetch patch. */
#define OHW_R5KEOP 0x4 /* R5000 end-of-page patch. */
#define OHW_R5KCVTL 0x8 /* R5000 cvt.[ds].l bug. clean=1. */
 
#define OPAD_PREFIX 0x1
#define OPAD_POSTFIX 0x2
#define OPAD_SYMBOL 0x4
 
/* Entry found in `.options' section. */
 
typedef struct
{
Elf32_Word hwp_flags1; /* Extra flags. */
Elf32_Word hwp_flags2; /* Extra flags. */
} Elf_Options_Hw;
 
/* Masks for `info' in ElfOptions for ODK_HWAND and ODK_HWOR entries. */
 
#define OHWA0_R4KEOP_CHECKED 0x00000001
#define OHWA1_R4KEOP_CLEAN 0x00000002
 
/* MIPS relocs. */
 
#define R_MIPS_NONE 0 /* No reloc */
#define R_MIPS_16 1 /* Direct 16 bit */
#define R_MIPS_32 2 /* Direct 32 bit */
#define R_MIPS_REL32 3 /* PC relative 32 bit */
#define R_MIPS_26 4 /* Direct 26 bit shifted */
#define R_MIPS_HI16 5 /* High 16 bit */
#define R_MIPS_LO16 6 /* Low 16 bit */
#define R_MIPS_GPREL16 7 /* GP relative 16 bit */
#define R_MIPS_LITERAL 8 /* 16 bit literal entry */
#define R_MIPS_GOT16 9 /* 16 bit GOT entry */
#define R_MIPS_PC16 10 /* PC relative 16 bit */
#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */
#define R_MIPS_GPREL32 12 /* GP relative 32 bit */
 
#define R_MIPS_SHIFT5 16
#define R_MIPS_SHIFT6 17
#define R_MIPS_64 18
#define R_MIPS_GOT_DISP 19
#define R_MIPS_GOT_PAGE 20
#define R_MIPS_GOT_OFST 21
#define R_MIPS_GOT_HI16 22
#define R_MIPS_GOT_LO16 23
#define R_MIPS_SUB 24
#define R_MIPS_INSERT_A 25
#define R_MIPS_INSERT_B 26
#define R_MIPS_DELETE 27
#define R_MIPS_HIGHER 28
#define R_MIPS_HIGHEST 29
#define R_MIPS_CALL_HI16 30
#define R_MIPS_CALL_LO16 31
#define R_MIPS_SCN_DISP 32
#define R_MIPS_REL16 33
#define R_MIPS_ADD_IMMEDIATE 34
#define R_MIPS_PJUMP 35
#define R_MIPS_RELGOT 36
#define R_MIPS_JALR 37
/* Keep this the last entry. */
#define R_MIPS_NUM 38
 
/* Legal values for p_type field of Elf32_Phdr. */
 
#define PT_MIPS_REGINFO 0x70000000 /* Register usage information */
#define PT_MIPS_RTPROC 0x70000001 /* Runtime procedure table. */
#define PT_MIPS_OPTIONS 0x70000002
 
/* Special program header types. */
 
#define PF_MIPS_LOCAL 0x10000000
 
/* Legal values for d_tag field of Elf32_Dyn. */
 
#define DT_MIPS_RLD_VERSION 0x70000001 /* Runtime linker interface version */
#define DT_MIPS_TIME_STAMP 0x70000002 /* Timestamp */
#define DT_MIPS_ICHECKSUM 0x70000003 /* Checksum */
#define DT_MIPS_IVERSION 0x70000004 /* Version string (string tbl index) */
#define DT_MIPS_FLAGS 0x70000005 /* Flags */
#define DT_MIPS_BASE_ADDRESS 0x70000006 /* Base address */
#define DT_MIPS_MSYM 0x70000007
#define DT_MIPS_CONFLICT 0x70000008 /* Address of CONFLICT section */
#define DT_MIPS_LIBLIST 0x70000009 /* Address of LIBLIST section */
#define DT_MIPS_LOCAL_GOTNO 0x7000000a /* Number of local GOT entries */
#define DT_MIPS_CONFLICTNO 0x7000000b /* Number of CONFLICT entries */
#define DT_MIPS_LIBLISTNO 0x70000010 /* Number of LIBLIST entries */
#define DT_MIPS_SYMTABNO 0x70000011 /* Number of DYNSYM entries */
#define DT_MIPS_UNREFEXTNO 0x70000012 /* First external DYNSYM */
#define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in DYNSYM */
#define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */
#define DT_MIPS_RLD_MAP 0x70000016 /* Address of run time loader map. */
#define DT_MIPS_DELTA_CLASS 0x70000017 /* Delta C++ class definition. */
#define DT_MIPS_DELTA_CLASS_NO 0x70000018 /* Number of entries in
DT_MIPS_DELTA_CLASS. */
#define DT_MIPS_DELTA_INSTANCE 0x70000019 /* Delta C++ class instances. */
#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a /* Number of entries in
DT_MIPS_DELTA_INSTANCE. */
#define DT_MIPS_DELTA_RELOC 0x7000001b /* Delta relocations. */
#define DT_MIPS_DELTA_RELOC_NO 0x7000001c /* Number of entries in
DT_MIPS_DELTA_RELOC. */
#define DT_MIPS_DELTA_SYM 0x7000001d /* Delta symbols that Delta
relocations refer to. */
#define DT_MIPS_DELTA_SYM_NO 0x7000001e /* Number of entries in
DT_MIPS_DELTA_SYM. */
#define DT_MIPS_DELTA_CLASSSYM 0x70000020 /* Delta symbols that hold the
class declaration. */
#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 /* Number of entries in
DT_MIPS_DELTA_CLASSSYM. */
#define DT_MIPS_CXX_FLAGS 0x70000022 /* Flags indicating for C++ flavor. */
#define DT_MIPS_PIXIE_INIT 0x70000023
#define DT_MIPS_SYMBOL_LIB 0x70000024
#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
#define DT_MIPS_LOCAL_GOTIDX 0x70000026
#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
#define DT_MIPS_OPTIONS 0x70000029 /* Address of .options. */
#define DT_MIPS_INTERFACE 0x7000002a /* Address of .interface. */
#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
#define DT_MIPS_INTERFACE_SIZE 0x7000002c /* Size of the .interface section. */
#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d /* Address of rld_text_rsolve
function stored in GOT. */
#define DT_MIPS_PERF_SUFFIX 0x7000002e /* Default suffix of dso to be added
by rld on dlopen() calls. */
#define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */
#define DT_MIPS_GP_VALUE 0x70000030 /* GP value for aux GOTs. */
#define DT_MIPS_AUX_DYNAMIC 0x70000031 /* Address of aux .dynamic. */
#define DT_MIPS_NUM 0x32
 
/* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */
 
#define RHF_NONE 0 /* No flags */
#define RHF_QUICKSTART (1 << 0) /* Use quickstart */
#define RHF_NOTPOT (1 << 1) /* Hash size not power of 2 */
#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2) /* Ignore LD_LIBRARY_PATH */
#define RHF_NO_MOVE (1 << 3)
#define RHF_SGI_ONLY (1 << 4)
#define RHF_GUARANTEE_INIT (1 << 5)
#define RHF_DELTA_C_PLUS_PLUS (1 << 6)
#define RHF_GUARANTEE_START_INIT (1 << 7)
#define RHF_PIXIE (1 << 8)
#define RHF_DEFAULT_DELAY_LOAD (1 << 9)
#define RHF_REQUICKSTART (1 << 10)
#define RHF_REQUICKSTARTED (1 << 11)
#define RHF_CORD (1 << 12)
#define RHF_NO_UNRES_UNDEF (1 << 13)
#define RHF_RLD_ORDER_SAFE (1 << 14)
 
/* Entries found in sections of type SHT_MIPS_LIBLIST. */
 
typedef struct
{
Elf32_Word l_name; /* Name (string table index) */
Elf32_Word l_time_stamp; /* Timestamp */
Elf32_Word l_checksum; /* Checksum */
Elf32_Word l_version; /* Interface version */
Elf32_Word l_flags; /* Flags */
} Elf32_Lib;
 
typedef struct
{
Elf64_Word l_name; /* Name (string table index) */
Elf64_Word l_time_stamp; /* Timestamp */
Elf64_Word l_checksum; /* Checksum */
Elf64_Word l_version; /* Interface version */
Elf64_Word l_flags; /* Flags */
} Elf64_Lib;
 
 
/* Legal values for l_flags. */
 
#define LL_NONE 0
#define LL_EXACT_MATCH (1 << 0) /* Require exact match */
#define LL_IGNORE_INT_VER (1 << 1) /* Ignore interface version */
#define LL_REQUIRE_MINOR (1 << 2)
#define LL_EXPORTS (1 << 3)
#define LL_DELAY_LOAD (1 << 4)
#define LL_DELTA (1 << 5)
 
/* Entries found in sections of type SHT_MIPS_CONFLICT. */
 
typedef Elf32_Addr Elf32_Conflict;
 
 
/* HPPA specific definitions. */
 
/* Legal values for e_flags field of Elf32_Ehdr. */
 
#define EF_PARISC_TRAPNIL 0x00010000 /* Trap nil pointer dereference. */
#define EF_PARISC_EXT 0x00020000 /* Program uses arch. extensions. */
#define EF_PARISC_LSB 0x00040000 /* Program expects little endian. */
#define EF_PARISC_WIDE 0x00080000 /* Program expects wide mode. */
#define EF_PARISC_NO_KABP 0x00100000 /* No kernel assisted branch
prediction. */
#define EF_PARISC_LAZYSWAP 0x00400000 /* Allow lazy swapping. */
#define EF_PARISC_ARCH 0x0000ffff /* Architecture version. */
 
/* Defined values for `e_flags & EF_PARISC_ARCH' are: */
 
#define EFA_PARISC_1_0 0x020b /* PA-RISC 1.0 big-endian. */
#define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */
#define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */
 
/* Additional section indeces. */
 
#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared
symbols in ANSI C. */
#define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */
 
/* Legal values for sh_type field of Elf32_Shdr. */
 
#define SHT_PARISC_EXT 0x70000000 /* Contains product specific ext. */
#define SHT_PARISC_UNWIND 0x70000001 /* Unwind information. */
#define SHT_PARISC_DOC 0x70000002 /* Debug info for optimized code. */
 
/* Legal values for sh_flags field of Elf32_Shdr. */
 
#define SHF_PARISC_SHORT 0x20000000 /* Section with short addressing. */
#define SHF_PARISC_HUGE 0x40000000 /* Section far from gp. */
#define SHF_PARISC_SBP 0x80000000 /* Static branch prediction code. */
 
/* Legal values for ST_TYPE subfield of st_info (symbol type). */
 
#define STT_PARISC_MILLICODE 13 /* Millicode function entry point. */
 
#define STT_HP_OPAQUE (STT_LOOS + 0x1)
#define STT_HP_STUB (STT_LOOS + 0x2)
 
/* HPPA relocs. */
 
#define R_PARISC_NONE 0 /* No reloc. */
#define R_PARISC_DIR32 1 /* Direct 32-bit reference. */
#define R_PARISC_DIR21L 2 /* Left 21 bits of eff. address. */
#define R_PARISC_DIR17R 3 /* Right 17 bits of eff. address. */
#define R_PARISC_DIR17F 4 /* 17 bits of eff. address. */
#define R_PARISC_DIR14R 6 /* Right 14 bits of eff. address. */
#define R_PARISC_PCREL32 9 /* 32-bit rel. address. */
#define R_PARISC_PCREL21L 10 /* Left 21 bits of rel. address. */
#define R_PARISC_PCREL17R 11 /* Right 17 bits of rel. address. */
#define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */
#define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */
#define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */
#define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */
#define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */
#define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */
#define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */
#define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */
#define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */
#define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */
#define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */
#define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */
#define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */
#define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */
#define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */
#define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */
#define R_PARISC_FPTR64 64 /* 64 bits function address. */
#define R_PARISC_PLABEL32 65 /* 32 bits function address. */
#define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */
#define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */
#define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */
#define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */
#define R_PARISC_PCREL16F 77 /* 16 bits PC-rel. address. */
#define R_PARISC_PCREL16WF 78 /* 16 bits PC-rel. address. */
#define R_PARISC_PCREL16DF 79 /* 16 bits PC-rel. address. */
#define R_PARISC_DIR64 80 /* 64 bits of eff. address. */
#define R_PARISC_DIR14WR 83 /* 14 bits of eff. address. */
#define R_PARISC_DIR14DR 84 /* 14 bits of eff. address. */
#define R_PARISC_DIR16F 85 /* 16 bits of eff. address. */
#define R_PARISC_DIR16WF 86 /* 16 bits of eff. address. */
#define R_PARISC_DIR16DF 87 /* 16 bits of eff. address. */
#define R_PARISC_GPREL64 88 /* 64 bits of GP-rel. address. */
#define R_PARISC_GPREL14WR 91 /* GP-rel. address, right 14 bits. */
#define R_PARISC_GPREL14DR 92 /* GP-rel. address, right 14 bits. */
#define R_PARISC_GPREL16F 93 /* 16 bits GP-rel. address. */
#define R_PARISC_GPREL16WF 94 /* 16 bits GP-rel. address. */
#define R_PARISC_GPREL16DF 95 /* 16 bits GP-rel. address. */
#define R_PARISC_LTOFF64 96 /* 64 bits LT-rel. address. */
#define R_PARISC_LTOFF14WR 99 /* LT-rel. address, right 14 bits. */
#define R_PARISC_LTOFF14DR 100 /* LT-rel. address, right 14 bits. */
#define R_PARISC_LTOFF16F 101 /* 16 bits LT-rel. address. */
#define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */
#define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */
#define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */
#define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */
#define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */
#define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */
#define R_PARISC_PLTOFF16F 117 /* 16 bits LT-rel. address. */
#define R_PARISC_PLTOFF16WF 118 /* 16 bits PLT-rel. address. */
#define R_PARISC_PLTOFF16DF 119 /* 16 bits PLT-rel. address. */
#define R_PARISC_LTOFF_FPTR64 120 /* 64 bits LT-rel. function ptr. */
#define R_PARISC_LTOFF_FPTR14WR 123 /* LT-rel. fct. ptr., right 14 bits. */
#define R_PARISC_LTOFF_FPTR14DR 124 /* LT-rel. fct. ptr., right 14 bits. */
#define R_PARISC_LTOFF_FPTR16F 125 /* 16 bits LT-rel. function ptr. */
#define R_PARISC_LTOFF_FPTR16WF 126 /* 16 bits LT-rel. function ptr. */
#define R_PARISC_LTOFF_FPTR16DF 127 /* 16 bits LT-rel. function ptr. */
#define R_PARISC_LORESERVE 128
#define R_PARISC_COPY 128 /* Copy relocation. */
#define R_PARISC_IPLT 129 /* Dynamic reloc, imported PLT */
#define R_PARISC_EPLT 130 /* Dynamic reloc, exported PLT */
#define R_PARISC_TPREL32 153 /* 32 bits TP-rel. address. */
#define R_PARISC_TPREL21L 154 /* TP-rel. address, left 21 bits. */
#define R_PARISC_TPREL14R 158 /* TP-rel. address, right 14 bits. */
#define R_PARISC_LTOFF_TP21L 162 /* LT-TP-rel. address, left 21 bits. */
#define R_PARISC_LTOFF_TP14R 166 /* LT-TP-rel. address, right 14 bits.*/
#define R_PARISC_LTOFF_TP14F 167 /* 14 bits LT-TP-rel. address. */
#define R_PARISC_TPREL64 216 /* 64 bits TP-rel. address. */
#define R_PARISC_TPREL14WR 219 /* TP-rel. address, right 14 bits. */
#define R_PARISC_TPREL14DR 220 /* TP-rel. address, right 14 bits. */
#define R_PARISC_TPREL16F 221 /* 16 bits TP-rel. address. */
#define R_PARISC_TPREL16WF 222 /* 16 bits TP-rel. address. */
#define R_PARISC_TPREL16DF 223 /* 16 bits TP-rel. address. */
#define R_PARISC_LTOFF_TP64 224 /* 64 bits LT-TP-rel. address. */
#define R_PARISC_LTOFF_TP14WR 227 /* LT-TP-rel. address, right 14 bits.*/
#define R_PARISC_LTOFF_TP14DR 228 /* LT-TP-rel. address, right 14 bits.*/
#define R_PARISC_LTOFF_TP16F 229 /* 16 bits LT-TP-rel. address. */
#define R_PARISC_LTOFF_TP16WF 230 /* 16 bits LT-TP-rel. address. */
#define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */
#define R_PARISC_HIRESERVE 255
 
/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */
 
#define PT_HP_TLS (PT_LOOS + 0x0)
#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
#define PT_HP_PARALLEL (PT_LOOS + 0x10)
#define PT_HP_FASTBIND (PT_LOOS + 0x11)
#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
#define PT_HP_STACK (PT_LOOS + 0x14)
 
#define PT_PARISC_ARCHEXT 0x70000000
#define PT_PARISC_UNWIND 0x70000001
 
/* Legal values for p_flags field of Elf32_Phdr/Elf64_Phdr. */
 
#define PF_PARISC_SBP 0x08000000
 
#define PF_HP_PAGE_SIZE 0x00100000
#define PF_HP_FAR_SHARED 0x00200000
#define PF_HP_NEAR_SHARED 0x00400000
#define PF_HP_CODE 0x01000000
#define PF_HP_MODIFY 0x02000000
#define PF_HP_LAZYSWAP 0x04000000
#define PF_HP_SBP 0x08000000
 
 
/* Alpha specific definitions. */
 
/* Legal values for e_flags field of Elf64_Ehdr. */
 
#define EF_ALPHA_32BIT 1 /* All addresses must be < 2GB. */
#define EF_ALPHA_CANRELAX 2 /* Relocations for relaxing exist. */
 
/* Legal values for sh_type field of Elf64_Shdr. */
 
/* These two are primerily concerned with ECOFF debugging info. */
#define SHT_ALPHA_DEBUG 0x70000001
#define SHT_ALPHA_REGINFO 0x70000002
 
/* Legal values for sh_flags field of Elf64_Shdr. */
 
#define SHF_ALPHA_GPREL 0x10000000
 
/* Legal values for st_other field of Elf64_Sym. */
#define STO_ALPHA_NOPV 0x80 /* No PV required. */
#define STO_ALPHA_STD_GPLOAD 0x88 /* PV only used for initial ldgp. */
 
/* Alpha relocs. */
 
#define R_ALPHA_NONE 0 /* No reloc */
#define R_ALPHA_REFLONG 1 /* Direct 32 bit */
#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */
#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */
#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */
#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */
#define R_ALPHA_GPDISP 6 /* Add displacement to GP */
#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */
#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */
#define R_ALPHA_SREL16 9 /* PC relative 16 bit */
#define R_ALPHA_SREL32 10 /* PC relative 32 bit */
#define R_ALPHA_SREL64 11 /* PC relative 64 bit */
#define R_ALPHA_OP_PUSH 12 /* OP stack push */
#define R_ALPHA_OP_STORE 13 /* OP stack pop and store */
#define R_ALPHA_OP_PSUB 14 /* OP stack subtract */
#define R_ALPHA_OP_PRSHIFT 15 /* OP stack right shift */
#define R_ALPHA_GPVALUE 16
#define R_ALPHA_GPRELHIGH 17
#define R_ALPHA_GPRELLOW 18
#define R_ALPHA_IMMED_GP_16 19
#define R_ALPHA_IMMED_GP_HI32 20
#define R_ALPHA_IMMED_SCN_HI32 21
#define R_ALPHA_IMMED_BR_HI32 22
#define R_ALPHA_IMMED_LO32 23
#define R_ALPHA_COPY 24 /* Copy symbol at runtime */
#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */
#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */
#define R_ALPHA_RELATIVE 27 /* Adjust by program base */
/* Keep this the last entry. */
#define R_ALPHA_NUM 28
 
 
/* PowerPC specific declarations */
 
/* Values for Elf32/64_Ehdr.e_flags. */
#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */
 
/* Cygnus local bits below */
#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/
#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib
flag */
 
/* PowerPC relocations defined by the ABIs */
#define R_PPC_NONE 0
#define R_PPC_ADDR32 1 /* 32bit absolute address */
#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */
#define R_PPC_ADDR16 3 /* 16bit absolute address */
#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */
#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */
#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */
#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */
#define R_PPC_ADDR14_BRTAKEN 8
#define R_PPC_ADDR14_BRNTAKEN 9
#define R_PPC_REL24 10 /* PC relative 26 bit */
#define R_PPC_REL14 11 /* PC relative 16 bit */
#define R_PPC_REL14_BRTAKEN 12
#define R_PPC_REL14_BRNTAKEN 13
#define R_PPC_GOT16 14
#define R_PPC_GOT16_LO 15
#define R_PPC_GOT16_HI 16
#define R_PPC_GOT16_HA 17
#define R_PPC_PLTREL24 18
#define R_PPC_COPY 19
#define R_PPC_GLOB_DAT 20
#define R_PPC_JMP_SLOT 21
#define R_PPC_RELATIVE 22
#define R_PPC_LOCAL24PC 23
#define R_PPC_UADDR32 24
#define R_PPC_UADDR16 25
#define R_PPC_REL32 26
#define R_PPC_PLT32 27
#define R_PPC_PLTREL32 28
#define R_PPC_PLT16_LO 29
#define R_PPC_PLT16_HI 30
#define R_PPC_PLT16_HA 31
#define R_PPC_SDAREL16 32
#define R_PPC_SECTOFF 33
#define R_PPC_SECTOFF_LO 34
#define R_PPC_SECTOFF_HI 35
#define R_PPC_SECTOFF_HA 36
/* Keep this the last entry. */
#define R_PPC_NUM 37
 
/* The remaining relocs are from the Embedded ELF ABI, and are not
in the SVR4 ELF ABI. */
#define R_PPC_EMB_NADDR32 101
#define R_PPC_EMB_NADDR16 102
#define R_PPC_EMB_NADDR16_LO 103
#define R_PPC_EMB_NADDR16_HI 104
#define R_PPC_EMB_NADDR16_HA 105
#define R_PPC_EMB_SDAI16 106
#define R_PPC_EMB_SDA2I16 107
#define R_PPC_EMB_SDA2REL 108
#define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */
#define R_PPC_EMB_MRKREF 110
#define R_PPC_EMB_RELSEC16 111
#define R_PPC_EMB_RELST_LO 112
#define R_PPC_EMB_RELST_HI 113
#define R_PPC_EMB_RELST_HA 114
#define R_PPC_EMB_BIT_FLD 115
#define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */
 
/* Diab tool relocations. */
#define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */
#define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */
#define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */
#define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */
#define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */
#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */
 
/* This is a phony reloc to handle any old fashioned TOC16 references
that may still be in object files. */
#define R_PPC_TOC16 255
 
 
/* ARM specific declarations */
 
/* Processor specific flags for the ELF header e_flags field. */
#define EF_ARM_RELEXEC 0x01
#define EF_ARM_HASENTRY 0x02
#define EF_ARM_INTERWORK 0x04
#define EF_ARM_APCS_26 0x08
#define EF_ARM_APCS_FLOAT 0x10
#define EF_ARM_PIC 0x20
#define EF_ARM_ALIGN8 0x40 /* 8-bit structure alignment is in use */
#define EF_ARM_NEW_ABI 0x80
#define EF_ARM_OLD_ABI 0x100
 
/* Other constants defined in the ARM ELF spec. version B-01. */
/* NB. These conflict with values defined above. */
#define EF_ARM_SYMSARESORTED 0x04
#define EF_ARM_DYNSYMSUSESEGIDX 0x08
#define EF_ARM_MAPSYMSFIRST 0x10
#define EF_ARM_EABIMASK 0XFF000000
 
#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
#define EF_ARM_EABI_UNKNOWN 0x00000000
#define EF_ARM_EABI_VER1 0x01000000
#define EF_ARM_EABI_VER2 0x02000000
 
/* Additional symbol types for Thumb */
#define STT_ARM_TFUNC 0xd
 
/* ARM-specific values for sh_flags */
#define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */
#define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined
in the input to a link step */
 
/* ARM-specific program header flags */
#define PF_ARM_SB 0x10000000 /* Segment contains the location
addressed by the static base */
 
/* ARM relocs. */
#define R_ARM_NONE 0 /* No reloc */
#define R_ARM_PC24 1 /* PC relative 26 bit branch */
#define R_ARM_ABS32 2 /* Direct 32 bit */
#define R_ARM_REL32 3 /* PC relative 32 bit */
#define R_ARM_PC13 4
#define R_ARM_ABS16 5 /* Direct 16 bit */
#define R_ARM_ABS12 6 /* Direct 12 bit */
#define R_ARM_THM_ABS5 7
#define R_ARM_ABS8 8 /* Direct 8 bit */
#define R_ARM_SBREL32 9
#define R_ARM_THM_PC22 10
#define R_ARM_THM_PC8 11
#define R_ARM_AMP_VCALL9 12
#define R_ARM_SWI24 13
#define R_ARM_THM_SWI8 14
#define R_ARM_XPC25 15
#define R_ARM_THM_XPC22 16
#define R_ARM_COPY 20 /* Copy symbol at runtime */
#define R_ARM_GLOB_DAT 21 /* Create GOT entry */
#define R_ARM_JUMP_SLOT 22 /* Create PLT entry */
#define R_ARM_RELATIVE 23 /* Adjust by program base */
#define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */
#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */
#define R_ARM_GOT32 26 /* 32 bit GOT entry */
#define R_ARM_PLT32 27 /* 32 bit PLT address */
#define R_ARM_ALU_PCREL_7_0 32
#define R_ARM_ALU_PCREL_15_8 33
#define R_ARM_ALU_PCREL_23_15 34
#define R_ARM_LDR_SBREL_11_0 35
#define R_ARM_ALU_SBREL_19_12 36
#define R_ARM_ALU_SBREL_27_20 37
#define R_ARM_GNU_VTENTRY 100
#define R_ARM_GNU_VTINHERIT 101
#define R_ARM_THM_PC11 102 /* thumb unconditional branch */
#define R_ARM_THM_PC9 103 /* thumb conditional branch */
#define R_ARM_RXPC25 249
#define R_ARM_RSBREL32 250
#define R_ARM_THM_RPC22 251
#define R_ARM_RREL32 252
#define R_ARM_RABS22 253
#define R_ARM_RPC24 254
#define R_ARM_RBASE 255
/* Keep this the last entry. */
#define R_ARM_NUM 256
 
/* IA-64 specific declarations. */
 
/* Processor specific flags for the Ehdr e_flags field. */
#define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */
#define EF_IA_64_ABI64 0x00000010 /* 64-bit ABI */
#define EF_IA_64_ARCH 0xff000000 /* arch. version mask */
 
/* Processor specific values for the Phdr p_type field. */
#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */
#define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */
 
/* Processor specific flags for the Phdr p_flags field. */
#define PF_IA_64_NORECOV 0x80000000 /* spec insns w/o recovery */
 
/* Processor specific values for the Shdr sh_type field. */
#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */
#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */
 
/* Processor specific flags for the Shdr sh_flags field. */
#define SHF_IA_64_SHORT 0x10000000 /* section near gp */
#define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */
 
/* Processor specific values for the Dyn d_tag field. */
#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0)
#define DT_IA_64_NUM 1
 
/* IA-64 relocations. */
#define R_IA64_NONE 0x00 /* none */
#define R_IA64_IMM14 0x21 /* symbol + addend, add imm14 */
#define R_IA64_IMM22 0x22 /* symbol + addend, add imm22 */
#define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */
#define R_IA64_DIR32MSB 0x24 /* symbol + addend, data4 MSB */
#define R_IA64_DIR32LSB 0x25 /* symbol + addend, data4 LSB */
#define R_IA64_DIR64MSB 0x26 /* symbol + addend, data8 MSB */
#define R_IA64_DIR64LSB 0x27 /* symbol + addend, data8 LSB */
#define R_IA64_GPREL22 0x2a /* @gprel(sym + add), add imm22 */
#define R_IA64_GPREL64I 0x2b /* @gprel(sym + add), mov imm64 */
#define R_IA64_GPREL32MSB 0x2c /* @gprel(sym + add), data4 MSB */
#define R_IA64_GPREL32LSB 0x2d /* @gprel(sym + add), data4 LSB */
#define R_IA64_GPREL64MSB 0x2e /* @gprel(sym + add), data8 MSB */
#define R_IA64_GPREL64LSB 0x2f /* @gprel(sym + add), data8 LSB */
#define R_IA64_LTOFF22 0x32 /* @ltoff(sym + add), add imm22 */
#define R_IA64_LTOFF64I 0x33 /* @ltoff(sym + add), mov imm64 */
#define R_IA64_PLTOFF22 0x3a /* @pltoff(sym + add), add imm22 */
#define R_IA64_PLTOFF64I 0x3b /* @pltoff(sym + add), mov imm64 */
#define R_IA64_PLTOFF64MSB 0x3e /* @pltoff(sym + add), data8 MSB */
#define R_IA64_PLTOFF64LSB 0x3f /* @pltoff(sym + add), data8 LSB */
#define R_IA64_FPTR64I 0x43 /* @fptr(sym + add), mov imm64 */
#define R_IA64_FPTR32MSB 0x44 /* @fptr(sym + add), data4 MSB */
#define R_IA64_FPTR32LSB 0x45 /* @fptr(sym + add), data4 LSB */
#define R_IA64_FPTR64MSB 0x46 /* @fptr(sym + add), data8 MSB */
#define R_IA64_FPTR64LSB 0x47 /* @fptr(sym + add), data8 LSB */
#define R_IA64_PCREL60B 0x48 /* @pcrel(sym + add), brl */
#define R_IA64_PCREL21B 0x49 /* @pcrel(sym + add), ptb, call */
#define R_IA64_PCREL21M 0x4a /* @pcrel(sym + add), chk.s */
#define R_IA64_PCREL21F 0x4b /* @pcrel(sym + add), fchkf */
#define R_IA64_PCREL32MSB 0x4c /* @pcrel(sym + add), data4 MSB */
#define R_IA64_PCREL32LSB 0x4d /* @pcrel(sym + add), data4 LSB */
#define R_IA64_PCREL64MSB 0x4e /* @pcrel(sym + add), data8 MSB */
#define R_IA64_PCREL64LSB 0x4f /* @pcrel(sym + add), data8 LSB */
#define R_IA64_LTOFF_FPTR22 0x52 /* @ltoff(@fptr(s+a)), imm22 */
#define R_IA64_LTOFF_FPTR64I 0x53 /* @ltoff(@fptr(s+a)), imm64 */
#define R_IA64_LTOFF_FPTR32MSB 0x54 /* @ltoff(@fptr(s+a)), data4 MSB */
#define R_IA64_LTOFF_FPTR32LSB 0x55 /* @ltoff(@fptr(s+a)), data4 LSB */
#define R_IA64_LTOFF_FPTR64MSB 0x56 /* @ltoff(@fptr(s+a)), data8 MSB */
#define R_IA64_LTOFF_FPTR64LSB 0x57 /* @ltoff(@fptr(s+a)), data8 LSB */
#define R_IA64_SEGREL32MSB 0x5c /* @segrel(sym + add), data4 MSB */
#define R_IA64_SEGREL32LSB 0x5d /* @segrel(sym + add), data4 LSB */
#define R_IA64_SEGREL64MSB 0x5e /* @segrel(sym + add), data8 MSB */
#define R_IA64_SEGREL64LSB 0x5f /* @segrel(sym + add), data8 LSB */
#define R_IA64_SECREL32MSB 0x64 /* @secrel(sym + add), data4 MSB */
#define R_IA64_SECREL32LSB 0x65 /* @secrel(sym + add), data4 LSB */
#define R_IA64_SECREL64MSB 0x66 /* @secrel(sym + add), data8 MSB */
#define R_IA64_SECREL64LSB 0x67 /* @secrel(sym + add), data8 LSB */
#define R_IA64_REL32MSB 0x6c /* data 4 + REL */
#define R_IA64_REL32LSB 0x6d /* data 4 + REL */
#define R_IA64_REL64MSB 0x6e /* data 8 + REL */
#define R_IA64_REL64LSB 0x6f /* data 8 + REL */
#define R_IA64_LTV32MSB 0x74 /* symbol + addend, data4 MSB */
#define R_IA64_LTV32LSB 0x75 /* symbol + addend, data4 LSB */
#define R_IA64_LTV64MSB 0x76 /* symbol + addend, data8 MSB */
#define R_IA64_LTV64LSB 0x77 /* symbol + addend, data8 LSB */
#define R_IA64_PCREL21BI 0x79 /* @pcrel(sym + add), 21bit inst */
#define R_IA64_PCREL22 0x7a /* @pcrel(sym + add), 22bit inst */
#define R_IA64_PCREL64I 0x7b /* @pcrel(sym + add), 64bit inst */
#define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */
#define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */
#define R_IA64_COPY 0x84 /* copy relocation */
#define R_IA64_SUB 0x85 /* Addend and symbol difference */
#define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */
#define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */
#define R_IA64_TPREL14 0x91 /* @tprel(sym + add), imm14 */
#define R_IA64_TPREL22 0x92 /* @tprel(sym + add), imm22 */
#define R_IA64_TPREL64I 0x93 /* @tprel(sym + add), imm64 */
#define R_IA64_TPREL64MSB 0x96 /* @tprel(sym + add), data8 MSB */
#define R_IA64_TPREL64LSB 0x97 /* @tprel(sym + add), data8 LSB */
#define R_IA64_LTOFF_TPREL22 0x9a /* @ltoff(@tprel(s+a)), imm2 */
#define R_IA64_DTPMOD64MSB 0xa6 /* @dtpmod(sym + add), data8 MSB */
#define R_IA64_DTPMOD64LSB 0xa7 /* @dtpmod(sym + add), data8 LSB */
#define R_IA64_LTOFF_DTPMOD22 0xaa /* @ltoff(@dtpmod(sym + add)), imm22 */
#define R_IA64_DTPREL14 0xb1 /* @dtprel(sym + add), imm14 */
#define R_IA64_DTPREL22 0xb2 /* @dtprel(sym + add), imm22 */
#define R_IA64_DTPREL64I 0xb3 /* @dtprel(sym + add), imm64 */
#define R_IA64_DTPREL32MSB 0xb4 /* @dtprel(sym + add), data4 MSB */
#define R_IA64_DTPREL32LSB 0xb5 /* @dtprel(sym + add), data4 LSB */
#define R_IA64_DTPREL64MSB 0xb6 /* @dtprel(sym + add), data8 MSB */
#define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */
#define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */
 
/* SH specific declarations */
 
/* SH relocs. */
#define R_SH_NONE 0
#define R_SH_DIR32 1
#define R_SH_REL32 2
#define R_SH_DIR8WPN 3
#define R_SH_IND12W 4
#define R_SH_DIR8WPL 5
#define R_SH_DIR8WPZ 6
#define R_SH_DIR8BP 7
#define R_SH_DIR8W 8
#define R_SH_DIR8L 9
#define R_SH_SWITCH16 25
#define R_SH_SWITCH32 26
#define R_SH_USES 27
#define R_SH_COUNT 28
#define R_SH_ALIGN 29
#define R_SH_CODE 30
#define R_SH_DATA 31
#define R_SH_LABEL 32
#define R_SH_SWITCH8 33
#define R_SH_GNU_VTINHERIT 34
#define R_SH_GNU_VTENTRY 35
#define R_SH_GOT32 160
#define R_SH_PLT32 161
#define R_SH_COPY 162
#define R_SH_GLOB_DAT 163
#define R_SH_JMP_SLOT 164
#define R_SH_RELATIVE 165
#define R_SH_GOTOFF 166
#define R_SH_GOTPC 167
/* Keep this the last entry. */
#define R_SH_NUM 256
 
/* Additional s390 relocs */
 
#define R_390_NONE 0 /* No reloc. */
#define R_390_8 1 /* Direct 8 bit. */
#define R_390_12 2 /* Direct 12 bit. */
#define R_390_16 3 /* Direct 16 bit. */
#define R_390_32 4 /* Direct 32 bit. */
#define R_390_PC32 5 /* PC relative 32 bit. */
#define R_390_GOT12 6 /* 12 bit GOT offset. */
#define R_390_GOT32 7 /* 32 bit GOT offset. */
#define R_390_PLT32 8 /* 32 bit PC relative PLT address. */
#define R_390_COPY 9 /* Copy symbol at runtime. */
#define R_390_GLOB_DAT 10 /* Create GOT entry. */
#define R_390_JMP_SLOT 11 /* Create PLT entry. */
#define R_390_RELATIVE 12 /* Adjust by program base. */
#define R_390_GOTOFF 13 /* 32 bit offset to GOT. */
#define R_390_GOTPC 14 /* 32 bit PC relative offset to GOT. */
#define R_390_GOT16 15 /* 16 bit GOT offset. */
#define R_390_PC16 16 /* PC relative 16 bit. */
#define R_390_PC16DBL 17 /* PC relative 16 bit shifted by 1. */
#define R_390_PLT16DBL 18 /* 16 bit PC rel. PLT shifted by 1. */
#define R_390_PC32DBL 19 /* PC relative 32 bit shifted by 1. */
#define R_390_PLT32DBL 20 /* 32 bit PC rel. PLT shifted by 1. */
#define R_390_GOTPCDBL 21 /* 32 bit PC rel. GOT shifted by 1. */
#define R_390_64 22 /* Direct 64 bit. */
#define R_390_PC64 23 /* PC relative 64 bit. */
#define R_390_GOT64 24 /* 64 bit GOT offset. */
#define R_390_PLT64 25 /* 64 bit PC relative PLT address. */
#define R_390_GOTENT 26 /* 32 bit PC rel. to GOT entry >> 1. */
 
/* Keep this the last entry. */
#define R_390_NUM 19
 
/* CRIS relocations. */
#define R_CRIS_NONE 0
#define R_CRIS_8 1
#define R_CRIS_16 2
#define R_CRIS_32 3
#define R_CRIS_8_PCREL 4
#define R_CRIS_16_PCREL 5
#define R_CRIS_32_PCREL 6
#define R_CRIS_GNU_VTINHERIT 7
#define R_CRIS_GNU_VTENTRY 8
#define R_CRIS_COPY 9
#define R_CRIS_GLOB_DAT 10
#define R_CRIS_JUMP_SLOT 11
#define R_CRIS_RELATIVE 12
#define R_CRIS_16_GOT 13
#define R_CRIS_32_GOT 14
#define R_CRIS_16_GOTPLT 15
#define R_CRIS_32_GOTPLT 16
#define R_CRIS_32_GOTREL 17
#define R_CRIS_32_PLT_GOTREL 18
#define R_CRIS_32_PLT_PCREL 19
 
#define R_CRIS_NUM 20
 
#endif /* elf.h */
/contrib/media/updf/include/emu_layer/fs.h
0,0 → 1,54
#ifndef __EMULAYER_FS_H
#define __EMULAYER_FS_H
 
#include<sys/stat.h>
#include<fcntl.h>
 
#define MAX_EMUFS_HANDLES 64
 
typedef struct __emu_FILE emu_FILE;
 
typedef struct {
int (* read)(emu_FILE * filp,unsigned long size,char * buf);
int (* write)(emu_FILE * filp,unsigned long size,char * buf);
int (* seek)(emu_FILE * filp,int offset,int whence);
int (* open)(emu_FILE * filp);
int (* close)(emu_FILE * filp);
int (* stat)(emu_FILE * filp,struct stat * statp);
int (* sync)(emu_FILE * filp);
} emu_FILE_operations_t;
 
struct __emu_FILE
{
int f_handle;
char * f_path;
unsigned long f_pos;
unsigned long f_size;
int f_flags;
int f_mode;
emu_FILE_operations_t * f_op;
void * f_priv;
};
 
struct __emu_VMOUNT
{
char * mpnt;
int (* preopen_file)(emu_FILE * filp);
struct __emu_VMOUNT * m_next;
};
 
void init_emufs(void);
struct __emu_VMOUNT * EMU_find_best_mount(char * fpath);
extern emu_FILE * EMU_file_table[MAX_EMUFS_HANDLES];
emu_FILE * EMU_get_empty_filp(char * forpath);
void EMU_put_filp(int h);
int EMU_open(const char * fname,int mode);
int EMU_close(int handle);
int EMU_read(int handle,char * buf,int count);
int EMU_write(int handle,char * buf,int count);
int EMU_lseek(int handle,int off,int whence);
int EMU_fstat(int handle, struct stat *statbuf);
int EMU_filelength(int fp);
int EMU_flush(int fp);
 
#endif
/contrib/media/updf/include/emu_layer/layer.h
0,0 → 1,0
void init_emu_layer(void);
/contrib/media/updf/include/endian.h
0,0 → 1,29
#ifndef _ENDIAN_H
#define _ENDIAN_H 1
 
#include <features.h>
 
#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN 4321
#define __PDP_ENDIAN 3412
 
#include <bits/endian.h>
 
#ifndef __FLOAT_WORD_ORDER
#define __FLOAT_WORD_ORDER __BYTE_ORDER
#endif
 
#ifdef __USE_BSD
#define LITTLE_ENDIAN __LITTLE_ENDIAN
#define BIG_ENDIAN __BIG_ENDIAN
#define PDP_ENDIAN __PDP_ENDIAN
#define BYTE_ORDER __BYTE_ORDER
#endif
 
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define __LONG_LONG_PAIR(HI, LO) LO, HI
#elif __BYTE_ORDER == __BIG_ENDIAN
#define __LONG_LONG_PAIR(HI, LO) HI, LO
#endif
 
#endif
/contrib/media/updf/include/errno.h
0,0 → 1,78
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_errno_h_
#define __dj_include_errno_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include<dos.h>
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#define EDOM 1
#define ERANGE 2
 
extern int errno;
#ifndef __STRICT_ANSI__
//#define ENOTSUP 45
#define E2BIG 3
#define EACCES 4
#define EAGAIN 5
#define EBADF 6
#define EBUSY 7
#define ECHILD 8
#define EDEADLK 9
#define EEXIST 10
#define EFAULT 11
#define EFBIG 12
#define EINTR 13
#define EINVAL 14
#define EIO 15
#define EISDIR 16
#define EMFILE 17
#define EMLINK 18
#define ENAMETOOLONG 19
#define ENFILE 20
#define ENODEV 21
#define ENOENT 22
#define ENOEXEC 23
#define ENOLCK 24
#define ENOMEM 25
#define ENOSPC 26
#define ENOSYS 27
#define ENOTDIR 28
#define ENOTEMPTY 29
#define ENOTTY 30
#define ENXIO 31
#define EPERM 32
#define EPIPE 33
#define EROFS 34
#define ESPIPE 35
#define ESRCH 36
#define EXDEV 37
 
#ifndef _POSIX_SOURCE
 
#define ENMFILE 38
 
extern char * sys_errlist[];
extern int sys_nerr;
extern const char * __sys_errlist[];
extern int __sys_nerr;
extern int _doserrno;
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_errno_h_ */
/contrib/media/updf/include/errors.h
0,0 → 1,33
 
#ifndef __errors_h__
#define __errors_h__
 
void CheckArgType(LispInt aArgNr, LispPtr& aArguments, LispEnvironment& aEnvironment, LispInt aError);
#define CHK_ARG(_pred,_argnr) {if (!(_pred)) CheckArgType(_argnr,aArguments, aEnvironment,KLispErrInvalidArg);}
#define CHK_ARG_CORE(_pred,_argnr) {if (!(_pred)) CheckArgType(_argnr,ARGUMENT(0),aEnvironment,KLispErrInvalidArg);}
#define CHK_ISLIST(_pred,_argnr) {if (!InternalIsList(_pred)) CheckArgType(_argnr,aArguments, aEnvironment,KLispErrNotList);}
#define CHK_ISLIST_CORE(_pred,_argnr) {if (!InternalIsList(_pred)) CheckArgType(_argnr,ARGUMENT(0),aEnvironment,KLispErrNotList);}
#define CHK_ISSTRING(_pred,_argnr) {if (!InternalIsString((_pred)->String())) CheckArgType(_argnr,aArguments, aEnvironment,KLispErrNotString);}
#define CHK_ISSTRING_CORE(_pred,_argnr) {if (!InternalIsString((_pred)->String())) CheckArgType(_argnr,ARGUMENT(0),aEnvironment,KLispErrNotString);}
 
void CheckNrArgs(LispInt n, LispPtr& aArguments, LispEnvironment& aEnvironment);
#define TESTARGS(_n) CheckNrArgs(_n,aArguments,aEnvironment)
 
void CheckFuncGeneric(LispInt aError,LispPtr& aArguments,LispEnvironment& aEnvironment);
void CheckFuncGeneric(LispInt aError,LispEnvironment& aEnvironment);
#define CHK(_pred,_err) {if (!(_pred)) CheckFuncGeneric(_err,aArguments, aEnvironment);}
#define CHK_CORE(_pred,_err) {if (!(_pred)) CheckFuncGeneric(_err,ARGUMENT(0),aEnvironment);}
#define CHK2(_pred,_err) {if (!(_pred)) CheckFuncGeneric(_err,aEnvironment);}
 
char *GenericErrorBuf(); // called (only) from errors.cpp and LispEnvironment::ErrorString()
void RaiseError(char* str,...);
 
/*
#define TESTARGS(_n) \
{ \
LispInt nrArguments = InternalListLength(aArguments); \
Check(nrArguments == _n,KLispErrWrongNumberOfArgs); \
}
*/
 
#endif
/contrib/media/updf/include/eti.h
0,0 → 1,52
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************
* Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1995,1997 *
****************************************************************************/
 
#ifndef _ETI_ERRNO_H_
#define _ETI_ERRNO_H_
 
#define E_OK (0)
#define E_SYSTEM_ERROR (-1)
#define E_BAD_ARGUMENT (-2)
#define E_POSTED (-3)
#define E_CONNECTED (-4)
#define E_BAD_STATE (-5)
#define E_NO_ROOM (-6)
#define E_NOT_POSTED (-7)
#define E_UNKNOWN_COMMAND (-8)
#define E_NO_MATCH (-9)
#define E_NOT_SELECTABLE (-10)
#define E_NOT_CONNECTED (-11)
#define E_REQUEST_DENIED (-12)
#define E_INVALID_FIELD (-13)
#define E_CURRENT (-14)
 
#endif
/contrib/media/updf/include/evalfunc.h
0,0 → 1,18
 
#ifndef __evalfuncbase_h__
#define __evalfuncbase_h__
 
#include "yacasbase.h"
 
// class EvalFuncBase defines the interface to 'something that can
// evaluate'
class LispEnvironment;
class EvalFuncBase : public YacasBase
{
public:
virtual void Evaluate(LispPtr& aResult,LispEnvironment& aEnvironment,
LispPtr& aArguments)=0;
virtual ~EvalFuncBase() {}
};
 
#endif
/contrib/media/updf/include/event.h
0,0 → 1,58
/*
* Copyright (c) 2005, Hervé Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __EVENT_H
#define __EVENT_H
/**
@file event.h
@brief Implementation of a event callback system
 
The functions in EVENT.C have for goal to send output messages (errors, warnings, debug) to the user.
*/
 
#define EVT_ERROR 1 /**< Error event type */
#define EVT_WARNING 2 /**< Warning event type */
#define EVT_INFO 4 /**< Debug event type */
 
/** @defgroup EVENT EVENT - Implementation of a event callback system */
/*@{*/
 
/** @name Exported functions (see also openjpeg.h) */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Write formatted data to a string and send the string to a user callback.
@param cinfo Codec context info
@param event_type Event type or callback to use to send the message
@param fmt Format-control string (plus optionnal arguments)
@return Returns true if successful, returns false otherwise
*/
bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...);
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __EVENT_H */
/contrib/media/updf/include/exception
0,0 → 1,67
// Exception Handling support header for -*- C++ -*-
 
// Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation
//
// This file is part of GNU CC.
//
// GNU CC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// GNU CC 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with GNU CC; see the file COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef __EXCEPTION__
#define __EXCEPTION__
 
extern "C++" {
 
namespace std
{
class exception
{
public:
exception() throw() { }
virtual ~exception() throw();
virtual const char* what() const throw();
};
 
class bad_exception : public exception
{
public:
bad_exception() throw() { }
virtual ~bad_exception() throw();
};
 
typedef void (*terminate_handler) ();
typedef void (*unexpected_handler) ();
 
terminate_handler set_terminate(terminate_handler) throw();
void terminate() __attribute__ ((__noreturn__));
 
unexpected_handler set_unexpected(unexpected_handler) throw();
void unexpected() __attribute__ ((__noreturn__));
 
bool uncaught_exception() throw();
} // namespace std
 
} // extern "C++"
 
#endif
/contrib/media/updf/include/ext/bvector
0,0 → 1,46
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef __SGI_STL_BVECTOR_H
#define __SGI_STL_BVECTOR_H
 
 
#include <bits/std_vector.h>
#include <ext/stl_bvector.h>
 
#ifdef __STL_USE_NAMESPACES
 
using __STD::bit_vector;
 
#endif /* __STL_USE_NAMESPACES */
 
#endif /* __SGI_STL_BVECTOR_H */
 
// Local Variables:
// mode:C++
// End:
 
 
/contrib/media/updf/include/ext/hash_map
0,0 → 1,407
/*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_HASH_MAP_H
#define __SGI_STL_INTERNAL_HASH_MAP_H
 
#include <ext/stl_hashtable.h>
#include <bits/concept_check.h>
 
namespace std
{
 
// Forward declaration of equality operator; needed for friend declaration.
 
template <class _Key, class _Tp,
class _HashFcn = hash<_Key>,
class _EqualKey = equal_to<_Key>,
class _Alloc = allocator<_Tp> >
class hash_map;
 
template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
inline bool operator==(const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&,
const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&);
 
template <class _Key, class _Tp, class _HashFcn, class _EqualKey,
class _Alloc>
class hash_map
{
private:
typedef hashtable<pair<const _Key,_Tp>,_Key,_HashFcn,
_Select1st<pair<const _Key,_Tp> >,_EqualKey,_Alloc> _Ht;
_Ht _M_ht;
 
public:
typedef typename _Ht::key_type key_type;
typedef _Tp data_type;
typedef _Tp mapped_type;
typedef typename _Ht::value_type value_type;
typedef typename _Ht::hasher hasher;
typedef typename _Ht::key_equal key_equal;
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
typedef typename _Ht::pointer pointer;
typedef typename _Ht::const_pointer const_pointer;
typedef typename _Ht::reference reference;
typedef typename _Ht::const_reference const_reference;
 
typedef typename _Ht::iterator iterator;
typedef typename _Ht::const_iterator const_iterator;
 
typedef typename _Ht::allocator_type allocator_type;
 
hasher hash_funct() const { return _M_ht.hash_funct(); }
key_equal key_eq() const { return _M_ht.key_eq(); }
allocator_type get_allocator() const { return _M_ht.get_allocator(); }
 
public:
hash_map() : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
explicit hash_map(size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
hash_map(size_type __n, const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type()) {}
hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
 
template <class _InputIterator>
hash_map(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
 
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(hash_map& __hs) { _M_ht.swap(__hs._M_ht); }
 
template <class _K1, class _T1, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_map<_K1, _T1, _HF, _EqK, _Al>&,
const hash_map<_K1, _T1, _HF, _EqK, _Al>&);
 
iterator begin() { return _M_ht.begin(); }
iterator end() { return _M_ht.end(); }
const_iterator begin() const { return _M_ht.begin(); }
const_iterator end() const { return _M_ht.end(); }
 
public:
pair<iterator,bool> insert(const value_type& __obj)
{ return _M_ht.insert_unique(__obj); }
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
pair<iterator,bool> insert_noresize(const value_type& __obj)
{ return _M_ht.insert_unique_noresize(__obj); }
 
iterator find(const key_type& __key) { return _M_ht.find(__key); }
const_iterator find(const key_type& __key) const
{ return _M_ht.find(__key); }
 
_Tp& operator[](const key_type& __key) {
return _M_ht.find_or_insert(value_type(__key, _Tp())).second;
}
 
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key)
{ return _M_ht.equal_range(__key); }
pair<const_iterator, const_iterator>
equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
 
size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
void erase(iterator __it) { _M_ht.erase(__it); }
void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
void clear() { _M_ht.clear(); }
 
void resize(size_type __hint) { _M_ht.resize(__hint); }
size_type bucket_count() const { return _M_ht.bucket_count(); }
size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
size_type elems_in_bucket(size_type __n) const
{ return _M_ht.elems_in_bucket(__n); }
};
 
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline bool
operator==(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
return __hm1._M_ht == __hm2._M_ht;
}
 
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline bool
operator!=(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2) {
return !(__hm1 == __hm2);
}
 
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline void
swap(hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
__hm1.swap(__hm2);
}
 
// Forward declaration of equality operator; needed for friend declaration.
 
template <class _Key, class _Tp,
class _HashFcn = hash<_Key>,
class _EqualKey = equal_to<_Key>,
class _Alloc = allocator<_Tp> >
class hash_multimap;
 
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
inline bool
operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2);
 
template <class _Key, class _Tp, class _HashFcn, class _EqualKey, class _Alloc>
class hash_multimap
{
// concept requirements
__glibcpp_class_requires(_Key, _SGIAssignableConcept);
__glibcpp_class_requires(_Tp, _SGIAssignableConcept);
__glibcpp_class_requires3(_HashFcn, size_t, _Key, _UnaryFunctionConcept);
__glibcpp_class_requires3(_EqualKey, _Key, _Key, _BinaryPredicateConcept);
 
private:
typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFcn,
_Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc>
_Ht;
_Ht _M_ht;
 
public:
typedef typename _Ht::key_type key_type;
typedef _Tp data_type;
typedef _Tp mapped_type;
typedef typename _Ht::value_type value_type;
typedef typename _Ht::hasher hasher;
typedef typename _Ht::key_equal key_equal;
 
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
typedef typename _Ht::pointer pointer;
typedef typename _Ht::const_pointer const_pointer;
typedef typename _Ht::reference reference;
typedef typename _Ht::const_reference const_reference;
 
typedef typename _Ht::iterator iterator;
typedef typename _Ht::const_iterator const_iterator;
 
typedef typename _Ht::allocator_type allocator_type;
 
hasher hash_funct() const { return _M_ht.hash_funct(); }
key_equal key_eq() const { return _M_ht.key_eq(); }
allocator_type get_allocator() const { return _M_ht.get_allocator(); }
 
public:
hash_multimap() : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
explicit hash_multimap(size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
hash_multimap(size_type __n, const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type()) {}
hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
 
template <class _InputIterator>
hash_multimap(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
 
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(hash_multimap& __hs) { _M_ht.swap(__hs._M_ht); }
 
template <class _K1, class _T1, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&,
const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&);
 
iterator begin() { return _M_ht.begin(); }
iterator end() { return _M_ht.end(); }
const_iterator begin() const { return _M_ht.begin(); }
const_iterator end() const { return _M_ht.end(); }
 
public:
iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
iterator insert_noresize(const value_type& __obj)
{ return _M_ht.insert_equal_noresize(__obj); }
 
iterator find(const key_type& __key) { return _M_ht.find(__key); }
const_iterator find(const key_type& __key) const
{ return _M_ht.find(__key); }
 
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key)
{ return _M_ht.equal_range(__key); }
pair<const_iterator, const_iterator>
equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
 
size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
void erase(iterator __it) { _M_ht.erase(__it); }
void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
void clear() { _M_ht.clear(); }
 
public:
void resize(size_type __hint) { _M_ht.resize(__hint); }
size_type bucket_count() const { return _M_ht.bucket_count(); }
size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
size_type elems_in_bucket(size_type __n) const
{ return _M_ht.elems_in_bucket(__n); }
};
 
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
inline bool
operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2)
{
return __hm1._M_ht == __hm2._M_ht;
}
 
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
inline bool
operator!=(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2) {
return !(__hm1 == __hm2);
}
 
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline void
swap(hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
__hm1.swap(__hm2);
}
 
 
// Specialization of insert_iterator so that it will work for hash_map
// and hash_multimap.
 
template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
class insert_iterator<hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
protected:
typedef hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container;
_Container* container;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
 
insert_iterator(_Container& __x) : container(&__x) {}
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
insert_iterator<_Container>& operator*() { return *this; }
insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; }
};
 
template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
class insert_iterator<hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
protected:
typedef hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container;
_Container* container;
typename _Container::iterator iter;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
 
insert_iterator(_Container& __x) : container(&__x) {}
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
insert_iterator<_Container>& operator*() { return *this; }
insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; }
};
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_HASH_MAP_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/ext/hash_set
0,0 → 1,396
/*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_HASH_SET_H
#define __SGI_STL_INTERNAL_HASH_SET_H
 
#include <ext/stl_hashtable.h>
#include <bits/concept_check.h>
 
namespace std
{
 
// Forward declaration of equality operator; needed for friend declaration.
 
template <class _Value,
class _HashFcn = hash<_Value>,
class _EqualKey = equal_to<_Value>,
class _Alloc = allocator<_Value> >
class hash_set;
 
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2);
 
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class hash_set
{
// concept requirements
__glibcpp_class_requires(_Value, _SGIAssignableConcept);
__glibcpp_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept);
__glibcpp_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept);
 
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
_EqualKey, _Alloc> _Ht;
_Ht _M_ht;
 
public:
typedef typename _Ht::key_type key_type;
typedef typename _Ht::value_type value_type;
typedef typename _Ht::hasher hasher;
typedef typename _Ht::key_equal key_equal;
 
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
typedef typename _Ht::const_pointer pointer;
typedef typename _Ht::const_pointer const_pointer;
typedef typename _Ht::const_reference reference;
typedef typename _Ht::const_reference const_reference;
 
typedef typename _Ht::const_iterator iterator;
typedef typename _Ht::const_iterator const_iterator;
 
typedef typename _Ht::allocator_type allocator_type;
 
hasher hash_funct() const { return _M_ht.hash_funct(); }
key_equal key_eq() const { return _M_ht.key_eq(); }
allocator_type get_allocator() const { return _M_ht.get_allocator(); }
 
public:
hash_set()
: _M_ht(100, hasher(), key_equal(), allocator_type()) {}
explicit hash_set(size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
hash_set(size_type __n, const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type()) {}
hash_set(size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
 
template <class _InputIterator>
hash_set(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_set(_InputIterator __f, _InputIterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
 
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(hash_set& __hs) { _M_ht.swap(__hs._M_ht); }
 
template <class _Val, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_set<_Val, _HF, _EqK, _Al>&,
const hash_set<_Val, _HF, _EqK, _Al>&);
 
iterator begin() const { return _M_ht.begin(); }
iterator end() const { return _M_ht.end(); }
 
public:
pair<iterator, bool> insert(const value_type& __obj)
{
pair<typename _Ht::iterator, bool> __p = _M_ht.insert_unique(__obj);
return pair<iterator,bool>(__p.first, __p.second);
}
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
pair<iterator, bool> insert_noresize(const value_type& __obj)
{
pair<typename _Ht::iterator, bool> __p =
_M_ht.insert_unique_noresize(__obj);
return pair<iterator, bool>(__p.first, __p.second);
}
 
iterator find(const key_type& __key) const { return _M_ht.find(__key); }
 
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
 
size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
void erase(iterator __it) { _M_ht.erase(__it); }
void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
void clear() { _M_ht.clear(); }
 
public:
void resize(size_type __hint) { _M_ht.resize(__hint); }
size_type bucket_count() const { return _M_ht.bucket_count(); }
size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
size_type elems_in_bucket(size_type __n) const
{ return _M_ht.elems_in_bucket(__n); }
};
 
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
return __hs1._M_ht == __hs2._M_ht;
}
 
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator!=(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2) {
return !(__hs1 == __hs2);
}
 
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline void
swap(hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
__hs1.swap(__hs2);
}
 
 
template <class _Value,
class _HashFcn = hash<_Value>,
class _EqualKey = equal_to<_Value>,
class _Alloc = allocator<_Value> >
class hash_multiset;
 
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2);
 
 
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class hash_multiset
{
// concept requirements
__glibcpp_class_requires(_Value, _SGIAssignableConcept);
__glibcpp_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept);
__glibcpp_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept);
 
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
_EqualKey, _Alloc> _Ht;
_Ht _M_ht;
 
public:
typedef typename _Ht::key_type key_type;
typedef typename _Ht::value_type value_type;
typedef typename _Ht::hasher hasher;
typedef typename _Ht::key_equal key_equal;
 
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
typedef typename _Ht::const_pointer pointer;
typedef typename _Ht::const_pointer const_pointer;
typedef typename _Ht::const_reference reference;
typedef typename _Ht::const_reference const_reference;
 
typedef typename _Ht::const_iterator iterator;
typedef typename _Ht::const_iterator const_iterator;
 
typedef typename _Ht::allocator_type allocator_type;
 
hasher hash_funct() const { return _M_ht.hash_funct(); }
key_equal key_eq() const { return _M_ht.key_eq(); }
allocator_type get_allocator() const { return _M_ht.get_allocator(); }
 
public:
hash_multiset()
: _M_ht(100, hasher(), key_equal(), allocator_type()) {}
explicit hash_multiset(size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
hash_multiset(size_type __n, const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type()) {}
hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
 
template <class _InputIterator>
hash_multiset(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
 
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(hash_multiset& hs) { _M_ht.swap(hs._M_ht); }
 
template <class _Val, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_multiset<_Val, _HF, _EqK, _Al>&,
const hash_multiset<_Val, _HF, _EqK, _Al>&);
 
iterator begin() const { return _M_ht.begin(); }
iterator end() const { return _M_ht.end(); }
 
public:
iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
iterator insert_noresize(const value_type& __obj)
{ return _M_ht.insert_equal_noresize(__obj); }
 
iterator find(const key_type& __key) const { return _M_ht.find(__key); }
 
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
 
size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
void erase(iterator __it) { _M_ht.erase(__it); }
void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
void clear() { _M_ht.clear(); }
 
public:
void resize(size_type __hint) { _M_ht.resize(__hint); }
size_type bucket_count() const { return _M_ht.bucket_count(); }
size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
size_type elems_in_bucket(size_type __n) const
{ return _M_ht.elems_in_bucket(__n); }
};
 
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
return __hs1._M_ht == __hs2._M_ht;
}
 
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator!=(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) {
return !(__hs1 == __hs2);
}
 
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline void
swap(hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) {
__hs1.swap(__hs2);
}
 
// Specialization of insert_iterator so that it will work for hash_set
// and hash_multiset.
 
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class insert_iterator<hash_set<_Value, _HashFcn, _EqualKey, _Alloc> > {
protected:
typedef hash_set<_Value, _HashFcn, _EqualKey, _Alloc> _Container;
_Container* container;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
 
insert_iterator(_Container& __x) : container(&__x) {}
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
insert_iterator<_Container>& operator*() { return *this; }
insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; }
};
 
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class insert_iterator<hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> > {
protected:
typedef hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> _Container;
_Container* container;
typename _Container::iterator iter;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
 
insert_iterator(_Container& __x) : container(&__x) {}
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
insert_iterator<_Container>& operator*() { return *this; }
insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; }
};
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_HASH_SET_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/ext/rope
0,0 → 1,32
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
#ifndef __SGI_STL_ROPE
#define __SGI_STL_ROPE
 
#include <bits/stl_algobase.h>
#include <bits/stl_tempbuf.h>
#include <bits/stl_algo.h>
#include <bits/stl_function.h>
#include <bits/stl_numeric.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <ext/stl_hash_fun.h>
#include <ext/stl_rope.h>
 
#endif /* __SGI_STL_ROPE */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/ext/ropeimpl.h
0,0 → 1,1509
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#include <bits/std_cstdio.h>
#include <bits/std_iostream.h>
 
#ifdef __STL_USE_EXCEPTIONS
# include <bits/std_stdexcept.h>
#endif
 
namespace std
{
 
// Set buf_start, buf_end, and buf_ptr appropriately, filling tmp_buf
// if necessary. Assumes _M_path_end[leaf_index] and leaf_pos are correct.
// Results in a valid buf_ptr if the iterator can be legitimately
// dereferenced.
template <class _CharT, class _Alloc>
void _Rope_iterator_base<_CharT,_Alloc>::_S_setbuf(
_Rope_iterator_base<_CharT,_Alloc>& __x)
{
const _RopeRep* __leaf = __x._M_path_end[__x._M_leaf_index];
size_t __leaf_pos = __x._M_leaf_pos;
size_t __pos = __x._M_current_pos;
 
switch(__leaf->_M_tag) {
case _RopeRep::_S_leaf:
__x._M_buf_start =
((_Rope_RopeLeaf<_CharT,_Alloc>*)__leaf)->_M_data;
__x._M_buf_ptr = __x._M_buf_start + (__pos - __leaf_pos);
__x._M_buf_end = __x._M_buf_start + __leaf->_M_size;
break;
case _RopeRep::_S_function:
case _RopeRep::_S_substringfn:
{
size_t __len = _S_iterator_buf_len;
size_t __buf_start_pos = __leaf_pos;
size_t __leaf_end = __leaf_pos + __leaf->_M_size;
char_producer<_CharT>* __fn =
((_Rope_RopeFunction<_CharT,_Alloc>*)__leaf)->_M_fn;
 
if (__buf_start_pos + __len <= __pos) {
__buf_start_pos = __pos - __len/4;
if (__buf_start_pos + __len > __leaf_end) {
__buf_start_pos = __leaf_end - __len;
}
}
if (__buf_start_pos + __len > __leaf_end) {
__len = __leaf_end - __buf_start_pos;
}
(*__fn)(__buf_start_pos - __leaf_pos, __len, __x._M_tmp_buf);
__x._M_buf_ptr = __x._M_tmp_buf + (__pos - __buf_start_pos);
__x._M_buf_start = __x._M_tmp_buf;
__x._M_buf_end = __x._M_tmp_buf + __len;
}
break;
default:
__stl_assert(0);
}
}
 
// Set path and buffer inside a rope iterator. We assume that
// pos and root are already set.
template <class _CharT, class _Alloc>
void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache
(_Rope_iterator_base<_CharT,_Alloc>& __x)
{
const _RopeRep* __path[_RopeRep::_S_max_rope_depth+1];
const _RopeRep* __curr_rope;
int __curr_depth = -1; /* index into path */
size_t __curr_start_pos = 0;
size_t __pos = __x._M_current_pos;
unsigned char __dirns = 0; // Bit vector marking right turns in the path
 
__stl_assert(__pos <= __x._M_root->_M_size);
if (__pos >= __x._M_root->_M_size) {
__x._M_buf_ptr = 0;
return;
}
__curr_rope = __x._M_root;
if (0 != __curr_rope->_M_c_string) {
/* Treat the root as a leaf. */
__x._M_buf_start = __curr_rope->_M_c_string;
__x._M_buf_end = __curr_rope->_M_c_string + __curr_rope->_M_size;
__x._M_buf_ptr = __curr_rope->_M_c_string + __pos;
__x._M_path_end[0] = __curr_rope;
__x._M_leaf_index = 0;
__x._M_leaf_pos = 0;
return;
}
for(;;) {
++__curr_depth;
__stl_assert(__curr_depth <= _RopeRep::_S_max_rope_depth);
__path[__curr_depth] = __curr_rope;
switch(__curr_rope->_M_tag) {
case _RopeRep::_S_leaf:
case _RopeRep::_S_function:
case _RopeRep::_S_substringfn:
__x._M_leaf_pos = __curr_start_pos;
goto done;
case _RopeRep::_S_concat:
{
_Rope_RopeConcatenation<_CharT,_Alloc>* __c =
(_Rope_RopeConcatenation<_CharT,_Alloc>*)__curr_rope;
_RopeRep* __left = __c->_M_left;
size_t __left_len = __left->_M_size;
__dirns <<= 1;
if (__pos >= __curr_start_pos + __left_len) {
__dirns |= 1;
__curr_rope = __c->_M_right;
__curr_start_pos += __left_len;
} else {
__curr_rope = __left;
}
}
break;
}
}
done:
// Copy last section of path into _M_path_end.
{
int __i = -1;
int __j = __curr_depth + 1 - _S_path_cache_len;
 
if (__j < 0) __j = 0;
while (__j <= __curr_depth) {
__x._M_path_end[++__i] = __path[__j++];
}
__x._M_leaf_index = __i;
}
__x._M_path_directions = __dirns;
_S_setbuf(__x);
}
 
// Specialized version of the above. Assumes that
// the path cache is valid for the previous position.
template <class _CharT, class _Alloc>
void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache_for_incr
(_Rope_iterator_base<_CharT,_Alloc>& __x)
{
int __current_index = __x._M_leaf_index;
const _RopeRep* __current_node = __x._M_path_end[__current_index];
size_t __len = __current_node->_M_size;
size_t __node_start_pos = __x._M_leaf_pos;
unsigned char __dirns = __x._M_path_directions;
_Rope_RopeConcatenation<_CharT,_Alloc>* __c;
 
__stl_assert(__x._M_current_pos <= __x._M_root->_M_size);
if (__x._M_current_pos - __node_start_pos < __len) {
/* More stuff in this leaf, we just didn't cache it. */
_S_setbuf(__x);
return;
}
__stl_assert(__node_start_pos + __len == __x._M_current_pos);
// node_start_pos is starting position of last_node.
while (--__current_index >= 0) {
if (!(__dirns & 1) /* Path turned left */)
break;
__current_node = __x._M_path_end[__current_index];
__c = (_Rope_RopeConcatenation<_CharT,_Alloc>*)__current_node;
// Otherwise we were in the right child. Thus we should pop
// the concatenation node.
__node_start_pos -= __c->_M_left->_M_size;
__dirns >>= 1;
}
if (__current_index < 0) {
// We underflowed the cache. Punt.
_S_setcache(__x);
return;
}
__current_node = __x._M_path_end[__current_index];
__c = (_Rope_RopeConcatenation<_CharT,_Alloc>*)__current_node;
// current_node is a concatenation node. We are positioned on the first
// character in its right child.
// node_start_pos is starting position of current_node.
__node_start_pos += __c->_M_left->_M_size;
__current_node = __c->_M_right;
__x._M_path_end[++__current_index] = __current_node;
__dirns |= 1;
while (_RopeRep::_S_concat == __current_node->_M_tag) {
++__current_index;
if (_S_path_cache_len == __current_index) {
int __i;
for (__i = 0; __i < _S_path_cache_len-1; __i++) {
__x._M_path_end[__i] = __x._M_path_end[__i+1];
}
--__current_index;
}
__current_node =
((_Rope_RopeConcatenation<_CharT,_Alloc>*)__current_node)->_M_left;
__x._M_path_end[__current_index] = __current_node;
__dirns <<= 1;
// node_start_pos is unchanged.
}
__x._M_leaf_index = __current_index;
__x._M_leaf_pos = __node_start_pos;
__x._M_path_directions = __dirns;
_S_setbuf(__x);
}
 
template <class _CharT, class _Alloc>
void _Rope_iterator_base<_CharT,_Alloc>::_M_incr(size_t __n) {
_M_current_pos += __n;
if (0 != _M_buf_ptr) {
size_t __chars_left = _M_buf_end - _M_buf_ptr;
if (__chars_left > __n) {
_M_buf_ptr += __n;
} else if (__chars_left == __n) {
_M_buf_ptr += __n;
_S_setcache_for_incr(*this);
} else {
_M_buf_ptr = 0;
}
}
}
 
template <class _CharT, class _Alloc>
void _Rope_iterator_base<_CharT,_Alloc>::_M_decr(size_t __n) {
if (0 != _M_buf_ptr) {
size_t __chars_left = _M_buf_ptr - _M_buf_start;
if (__chars_left >= __n) {
_M_buf_ptr -= __n;
} else {
_M_buf_ptr = 0;
}
}
_M_current_pos -= __n;
}
 
template <class _CharT, class _Alloc>
void _Rope_iterator<_CharT,_Alloc>::_M_check() {
if (_M_root_rope->_M_tree_ptr != _M_root) {
// _Rope was modified. Get things fixed up.
_RopeRep::_S_unref(_M_root);
_M_root = _M_root_rope->_M_tree_ptr;
_RopeRep::_S_ref(_M_root);
_M_buf_ptr = 0;
}
}
 
template <class _CharT, class _Alloc>
inline
_Rope_const_iterator<_CharT, _Alloc>::_Rope_const_iterator(
const _Rope_iterator<_CharT,_Alloc>& __x)
: _Rope_iterator_base<_CharT,_Alloc>(__x)
{ }
 
template <class _CharT, class _Alloc>
inline _Rope_iterator<_CharT,_Alloc>::_Rope_iterator(
rope<_CharT,_Alloc>& __r, size_t __pos)
: _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos),
_M_root_rope(&__r)
{
_RopeRep::_S_ref(_M_root);
}
 
template <class _CharT, class _Alloc>
inline size_t
rope<_CharT,_Alloc>::_S_char_ptr_len(const _CharT* __s)
{
const _CharT* __p = __s;
 
while (!_S_is0(*__p)) { ++__p; }
return (__p - __s);
}
 
 
#ifndef __GC
 
template <class _CharT, class _Alloc>
inline void _Rope_RopeRep<_CharT,_Alloc>::_M_free_c_string()
{
_CharT* __cstr = _M_c_string;
if (0 != __cstr) {
size_t __size = _M_size + 1;
destroy(__cstr, __cstr + __size);
_Data_deallocate(__cstr, __size);
}
}
 
 
template <class _CharT, class _Alloc>
inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string(_CharT* __s,
size_t __n,
allocator_type __a)
{
if (!_S_is_basic_char_type((_CharT*)0)) {
destroy(__s, __s + __n);
}
// This has to be a static member, so this gets a bit messy
__a.deallocate(
__s, _Rope_RopeLeaf<_CharT,_Alloc>::_S_rounded_up_size(__n));
}
 
 
// There are several reasons for not doing this with virtual destructors
// and a class specific delete operator:
// - A class specific delete operator can't easily get access to
// allocator instances if we need them.
// - Any virtual function would need a 4 or byte vtable pointer;
// this only requires a one byte tag per object.
template <class _CharT, class _Alloc>
void _Rope_RopeRep<_CharT,_Alloc>::_M_free_tree()
{
switch(_M_tag) {
case _S_leaf:
{
_Rope_RopeLeaf<_CharT,_Alloc>* __l
= (_Rope_RopeLeaf<_CharT,_Alloc>*)this;
__l->_Rope_RopeLeaf<_CharT,_Alloc>::~_Rope_RopeLeaf();
_L_deallocate(__l, 1);
break;
}
case _S_concat:
{
_Rope_RopeConcatenation<_CharT,_Alloc>* __c
= (_Rope_RopeConcatenation<_CharT,_Alloc>*)this;
__c->_Rope_RopeConcatenation<_CharT,_Alloc>::
~_Rope_RopeConcatenation();
_C_deallocate(__c, 1);
break;
}
case _S_function:
{
_Rope_RopeFunction<_CharT,_Alloc>* __f
= (_Rope_RopeFunction<_CharT,_Alloc>*)this;
__f->_Rope_RopeFunction<_CharT,_Alloc>::~_Rope_RopeFunction();
_F_deallocate(__f, 1);
break;
}
case _S_substringfn:
{
_Rope_RopeSubstring<_CharT,_Alloc>* __ss =
(_Rope_RopeSubstring<_CharT,_Alloc>*)this;
__ss->_Rope_RopeSubstring<_CharT,_Alloc>::
~_Rope_RopeSubstring();
_S_deallocate(__ss, 1);
break;
}
}
}
#else
 
template <class _CharT, class _Alloc>
inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string
(const _CharT*, size_t, allocator_type)
{}
 
#endif
 
 
// Concatenate a C string onto a leaf rope by copying the rope data.
// Used for short ropes.
template <class _CharT, class _Alloc>
rope<_CharT,_Alloc>::_RopeLeaf*
rope<_CharT,_Alloc>::_S_leaf_concat_char_iter
(_RopeLeaf* __r, const _CharT* __iter, size_t __len)
{
size_t __old_len = __r->_M_size;
_CharT* __new_data = (_CharT*)
_Data_allocate(_S_rounded_up_size(__old_len + __len));
_RopeLeaf* __result;
uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
uninitialized_copy_n(__iter, __len, __new_data + __old_len);
_S_cond_store_eos(__new_data[__old_len + __len]);
__STL_TRY {
__result = _S_new_RopeLeaf(__new_data, __old_len + __len,
__r->get_allocator());
}
__STL_UNWIND(_RopeRep::__STL_FREE_STRING(__new_data, __old_len + __len,
__r->get_allocator()));
return __result;
}
 
#ifndef __GC
// As above, but it's OK to clobber original if refcount is 1
template <class _CharT, class _Alloc>
rope<_CharT,_Alloc>::_RopeLeaf*
rope<_CharT,_Alloc>::_S_destr_leaf_concat_char_iter
(_RopeLeaf* __r, const _CharT* __iter, size_t __len)
{
__stl_assert(__r->_M_ref_count >= 1);
if (__r->_M_ref_count > 1)
return _S_leaf_concat_char_iter(__r, __iter, __len);
size_t __old_len = __r->_M_size;
if (_S_allocated_capacity(__old_len) >= __old_len + __len) {
// The space has been partially initialized for the standard
// character types. But that doesn't matter for those types.
uninitialized_copy_n(__iter, __len, __r->_M_data + __old_len);
if (_S_is_basic_char_type((_CharT*)0)) {
_S_cond_store_eos(__r->_M_data[__old_len + __len]);
__stl_assert(__r->_M_c_string == __r->_M_data);
} else if (__r->_M_c_string != __r->_M_data && 0 != __r->_M_c_string) {
__r->_M_free_c_string();
__r->_M_c_string = 0;
}
__r->_M_size = __old_len + __len;
__stl_assert(__r->_M_ref_count == 1);
__r->_M_ref_count = 2;
return __r;
} else {
_RopeLeaf* __result = _S_leaf_concat_char_iter(__r, __iter, __len);
__stl_assert(__result->_M_ref_count == 1);
return __result;
}
}
#endif
 
// Assumes left and right are not 0.
// Does not increment (nor decrement on exception) child reference counts.
// Result has ref count 1.
template <class _CharT, class _Alloc>
rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::_S_tree_concat (_RopeRep* __left, _RopeRep* __right)
{
_RopeConcatenation* __result =
_S_new_RopeConcatenation(__left, __right, __left->get_allocator());
size_t __depth = __result->_M_depth;
__stl_assert(__left->get_allocator() == __right->get_allocator());
if (__depth > 20 && (__result->_M_size < 1000 ||
__depth > _RopeRep::_S_max_rope_depth)) {
_RopeRep* __balanced;
__STL_TRY {
__balanced = _S_balance(__result);
# ifndef __GC
if (__result != __balanced) {
__stl_assert(1 == __result->_M_ref_count
&& 1 == __balanced->_M_ref_count);
}
# endif
__result->_M_unref_nonnil();
}
__STL_UNWIND((_C_deallocate(__result,1)));
// In case of exception, we need to deallocate
// otherwise dangling result node. But caller
// still owns its children. Thus unref is
// inappropriate.
return __balanced;
} else {
return __result;
}
}
 
template <class _CharT, class _Alloc>
rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
(_RopeRep* __r, const _CharT*__s, size_t __slen)
{
_RopeRep* __result;
if (0 == __slen) {
_S_ref(__r);
return __r;
}
if (0 == __r)
return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
__r->get_allocator());
if (_RopeRep::_S_leaf == __r->_M_tag &&
__r->_M_size + __slen <= _S_copy_max) {
__result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
# ifndef __GC
__stl_assert(1 == __result->_M_ref_count);
# endif
return __result;
}
if (_RopeRep::_S_concat == __r->_M_tag
&& _RopeRep::_S_leaf == ((_RopeConcatenation*)__r)->_M_right->_M_tag) {
_RopeLeaf* __right =
(_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right);
if (__right->_M_size + __slen <= _S_copy_max) {
_RopeRep* __left = ((_RopeConcatenation*)__r)->_M_left;
_RopeRep* __nright =
_S_leaf_concat_char_iter((_RopeLeaf*)__right, __s, __slen);
__left->_M_ref_nonnil();
__STL_TRY {
__result = _S_tree_concat(__left, __nright);
}
__STL_UNWIND(_S_unref(__left); _S_unref(__nright));
# ifndef __GC
__stl_assert(1 == __result->_M_ref_count);
# endif
return __result;
}
}
_RopeRep* __nright =
__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->get_allocator());
__STL_TRY {
__r->_M_ref_nonnil();
__result = _S_tree_concat(__r, __nright);
}
__STL_UNWIND(_S_unref(__r); _S_unref(__nright));
# ifndef __GC
__stl_assert(1 == __result->_M_ref_count);
# endif
return __result;
}
 
#ifndef __GC
template <class _CharT, class _Alloc>
rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
_RopeRep* __r, const _CharT* __s, size_t __slen)
{
_RopeRep* __result;
if (0 == __r)
return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
__r->get_allocator());
size_t __count = __r->_M_ref_count;
size_t __orig_size = __r->_M_size;
__stl_assert(__count >= 1);
if (__count > 1) return _S_concat_char_iter(__r, __s, __slen);
if (0 == __slen) {
__r->_M_ref_count = 2; // One more than before
return __r;
}
if (__orig_size + __slen <= _S_copy_max &&
_RopeRep::_S_leaf == __r->_M_tag) {
__result = _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
return __result;
}
if (_RopeRep::_S_concat == __r->_M_tag) {
_RopeLeaf* __right = (_RopeLeaf*)(((_RopeConcatenation*)__r)->_M_right);
if (_RopeRep::_S_leaf == __right->_M_tag
&& __right->_M_size + __slen <= _S_copy_max) {
_RopeRep* __new_right =
_S_destr_leaf_concat_char_iter(__right, __s, __slen);
if (__right == __new_right) {
__stl_assert(__new_right->_M_ref_count == 2);
__new_right->_M_ref_count = 1;
} else {
__stl_assert(__new_right->_M_ref_count >= 1);
__right->_M_unref_nonnil();
}
__stl_assert(__r->_M_ref_count == 1);
__r->_M_ref_count = 2; // One more than before.
((_RopeConcatenation*)__r)->_M_right = __new_right;
__r->_M_size = __orig_size + __slen;
if (0 != __r->_M_c_string) {
__r->_M_free_c_string();
__r->_M_c_string = 0;
}
return __r;
}
}
_RopeRep* __right =
__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->get_allocator());
__r->_M_ref_nonnil();
__STL_TRY {
__result = _S_tree_concat(__r, __right);
}
__STL_UNWIND(_S_unref(__r); _S_unref(__right))
__stl_assert(1 == __result->_M_ref_count);
return __result;
}
#endif /* !__GC */
 
template <class _CharT, class _Alloc>
rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
{
if (0 == __left) {
_S_ref(__right);
return __right;
}
if (0 == __right) {
__left->_M_ref_nonnil();
return __left;
}
if (_RopeRep::_S_leaf == __right->_M_tag) {
if (_RopeRep::_S_leaf == __left->_M_tag) {
if (__right->_M_size + __left->_M_size <= _S_copy_max) {
return _S_leaf_concat_char_iter((_RopeLeaf*)__left,
((_RopeLeaf*)__right)->_M_data,
__right->_M_size);
}
} else if (_RopeRep::_S_concat == __left->_M_tag
&& _RopeRep::_S_leaf ==
((_RopeConcatenation*)__left)->_M_right->_M_tag) {
_RopeLeaf* __leftright =
(_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right);
if (__leftright->_M_size + __right->_M_size <= _S_copy_max) {
_RopeRep* __leftleft = ((_RopeConcatenation*)__left)->_M_left;
_RopeRep* __rest = _S_leaf_concat_char_iter(__leftright,
((_RopeLeaf*)__right)->_M_data,
__right->_M_size);
__leftleft->_M_ref_nonnil();
__STL_TRY {
return(_S_tree_concat(__leftleft, __rest));
}
__STL_UNWIND(_S_unref(__leftleft); _S_unref(__rest))
}
}
}
__left->_M_ref_nonnil();
__right->_M_ref_nonnil();
__STL_TRY {
return(_S_tree_concat(__left, __right));
}
__STL_UNWIND(_S_unref(__left); _S_unref(__right));
}
 
template <class _CharT, class _Alloc>
rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::_S_substring(_RopeRep* __base,
size_t __start, size_t __endp1)
{
if (0 == __base) return 0;
size_t __len = __base->_M_size;
size_t __adj_endp1;
const size_t __lazy_threshold = 128;
if (__endp1 >= __len) {
if (0 == __start) {
__base->_M_ref_nonnil();
return __base;
} else {
__adj_endp1 = __len;
}
} else {
__adj_endp1 = __endp1;
}
switch(__base->_M_tag) {
case _RopeRep::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__base;
_RopeRep* __left = __c->_M_left;
_RopeRep* __right = __c->_M_right;
size_t __left_len = __left->_M_size;
_RopeRep* __result;
 
if (__adj_endp1 <= __left_len) {
return _S_substring(__left, __start, __endp1);
} else if (__start >= __left_len) {
return _S_substring(__right, __start - __left_len,
__adj_endp1 - __left_len);
}
_Self_destruct_ptr __left_result(
_S_substring(__left, __start, __left_len));
_Self_destruct_ptr __right_result(
_S_substring(__right, 0, __endp1 - __left_len));
__result = _S_concat(__left_result, __right_result);
# ifndef __GC
__stl_assert(1 == __result->_M_ref_count);
# endif
return __result;
}
case _RopeRep::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__base;
_RopeLeaf* __result;
size_t __result_len;
if (__start >= __adj_endp1) return 0;
__result_len = __adj_endp1 - __start;
if (__result_len > __lazy_threshold) goto lazy;
# ifdef __GC
const _CharT* __section = __l->_M_data + __start;
__result = _S_new_RopeLeaf(__section, __result_len,
__base->get_allocator());
__result->_M_c_string = 0; // Not eos terminated.
# else
// We should sometimes create substring node instead.
__result = __STL_ROPE_FROM_UNOWNED_CHAR_PTR(
__l->_M_data + __start, __result_len,
__base->get_allocator());
# endif
return __result;
}
case _RopeRep::_S_substringfn:
// Avoid introducing multiple layers of substring nodes.
{
_RopeSubstring* __old = (_RopeSubstring*)__base;
size_t __result_len;
if (__start >= __adj_endp1) return 0;
__result_len = __adj_endp1 - __start;
if (__result_len > __lazy_threshold) {
_RopeSubstring* __result =
_S_new_RopeSubstring(__old->_M_base,
__start + __old->_M_start,
__adj_endp1 - __start,
__base->get_allocator());
return __result;
 
} // *** else fall through: ***
}
case _RopeRep::_S_function:
{
_RopeFunction* __f = (_RopeFunction*)__base;
_CharT* __section;
size_t __result_len;
if (__start >= __adj_endp1) return 0;
__result_len = __adj_endp1 - __start;
 
if (__result_len > __lazy_threshold) goto lazy;
__section = (_CharT*)
_Data_allocate(_S_rounded_up_size(__result_len));
__STL_TRY {
(*(__f->_M_fn))(__start, __result_len, __section);
}
__STL_UNWIND(_RopeRep::__STL_FREE_STRING(
__section, __result_len, __base->get_allocator()));
_S_cond_store_eos(__section[__result_len]);
return _S_new_RopeLeaf(__section, __result_len,
__base->get_allocator());
}
}
/*NOTREACHED*/
__stl_assert(false);
lazy:
{
// Create substring node.
return _S_new_RopeSubstring(__base, __start, __adj_endp1 - __start,
__base->get_allocator());
}
}
 
template<class _CharT>
class _Rope_flatten_char_consumer : public _Rope_char_consumer<_CharT> {
private:
_CharT* _M_buf_ptr;
public:
 
_Rope_flatten_char_consumer(_CharT* __buffer) {
_M_buf_ptr = __buffer;
};
~_Rope_flatten_char_consumer() {}
bool operator() (const _CharT* __leaf, size_t __n) {
uninitialized_copy_n(__leaf, __n, _M_buf_ptr);
_M_buf_ptr += __n;
return true;
}
};
template<class _CharT>
class _Rope_find_char_char_consumer : public _Rope_char_consumer<_CharT> {
private:
_CharT _M_pattern;
public:
size_t _M_count; // Number of nonmatching characters
_Rope_find_char_char_consumer(_CharT __p)
: _M_pattern(__p), _M_count(0) {}
~_Rope_find_char_char_consumer() {}
bool operator() (const _CharT* __leaf, size_t __n) {
size_t __i;
for (__i = 0; __i < __n; __i++) {
if (__leaf[__i] == _M_pattern) {
_M_count += __i; return false;
}
}
_M_count += __n; return true;
}
};
template<class _CharT, class _Traits>
// Here _CharT is both the stream and rope character type.
class _Rope_insert_char_consumer : public _Rope_char_consumer<_CharT> {
private:
typedef basic_ostream<_CharT,_Traits> _Insert_ostream;
_Insert_ostream& _M_o;
public:
_Rope_insert_char_consumer(_Insert_ostream& __writer)
: _M_o(__writer) {};
~_Rope_insert_char_consumer() { };
// Caller is presumed to own the ostream
bool operator() (const _CharT* __leaf, size_t __n);
// Returns true to continue traversal.
};
template<class _CharT, class _Traits>
bool _Rope_insert_char_consumer<_CharT, _Traits>::operator()
(const _CharT* __leaf, size_t __n)
{
size_t __i;
// We assume that formatting is set up correctly for each element.
for (__i = 0; __i < __n; __i++) _M_o.put(__leaf[__i]);
return true;
}
 
template <class _CharT, class _Alloc>
bool rope<_CharT, _Alloc>::_S_apply_to_pieces(
_Rope_char_consumer<_CharT>& __c,
const _RopeRep* __r,
size_t __begin, size_t __end)
{
if (0 == __r) return true;
switch(__r->_M_tag) {
case _RopeRep::_S_concat:
{
_RopeConcatenation* __conc = (_RopeConcatenation*)__r;
_RopeRep* __left = __conc->_M_left;
size_t __left_len = __left->_M_size;
if (__begin < __left_len) {
size_t __left_end = min(__left_len, __end);
if (!_S_apply_to_pieces(__c, __left, __begin, __left_end))
return false;
}
if (__end > __left_len) {
_RopeRep* __right = __conc->_M_right;
size_t __right_start = max(__left_len, __begin);
if (!_S_apply_to_pieces(__c, __right,
__right_start - __left_len,
__end - __left_len)) {
return false;
}
}
}
return true;
case _RopeRep::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return __c(__l->_M_data + __begin, __end - __begin);
}
case _RopeRep::_S_function:
case _RopeRep::_S_substringfn:
{
_RopeFunction* __f = (_RopeFunction*)__r;
size_t __len = __end - __begin;
bool __result;
_CharT* __buffer =
(_CharT*)alloc::allocate(__len * sizeof(_CharT));
__STL_TRY {
(*(__f->_M_fn))(__begin, __len, __buffer);
__result = __c(__buffer, __len);
alloc::deallocate(__buffer, __len * sizeof(_CharT));
}
__STL_UNWIND((alloc::deallocate(__buffer,
__len * sizeof(_CharT))))
return __result;
}
default:
__stl_assert(false);
/*NOTREACHED*/
return false;
}
}
 
template<class _CharT, class _Traits>
inline void _Rope_fill(basic_ostream<_CharT, _Traits>& __o, size_t __n)
{
char __f = __o.fill();
size_t __i;
 
for (__i = 0; __i < __n; __i++) __o.put(__f);
}
 
template <class _CharT> inline bool _Rope_is_simple(_CharT*) { return false; }
inline bool _Rope_is_simple(char*) { return true; }
inline bool _Rope_is_simple(wchar_t*) { return true; }
 
template<class _CharT, class _Traits, class _Alloc>
basic_ostream<_CharT, _Traits>& operator<< (basic_ostream<_CharT, _Traits>& __o,
const rope<_CharT, _Alloc>& __r)
{
size_t __w = __o.width();
bool __left = bool(__o.flags() & ios::left);
size_t __pad_len;
size_t __rope_len = __r.size();
_Rope_insert_char_consumer<_CharT, _Traits> __c(__o);
bool __is_simple = _Rope_is_simple((_CharT*)0);
if (__rope_len < __w) {
__pad_len = __w - __rope_len;
} else {
__pad_len = 0;
}
if (!__is_simple) __o.width(__w/__rope_len);
__STL_TRY {
if (__is_simple && !__left && __pad_len > 0) {
_Rope_fill(__o, __pad_len);
}
__r.apply_to_pieces(0, __r.size(), __c);
if (__is_simple && __left && __pad_len > 0) {
_Rope_fill(__o, __pad_len);
}
if (!__is_simple)
__o.width(__w);
}
__STL_UNWIND(if (!__is_simple) __o.width(__w))
return __o;
}
 
template <class _CharT, class _Alloc>
_CharT*
rope<_CharT,_Alloc>::_S_flatten(_RopeRep* __r,
size_t __start, size_t __len,
_CharT* __buffer)
{
_Rope_flatten_char_consumer<_CharT> __c(__buffer);
_S_apply_to_pieces(__c, __r, __start, __start + __len);
return(__buffer + __len);
}
 
template <class _CharT, class _Alloc>
size_t
rope<_CharT,_Alloc>::find(_CharT __pattern, size_t __start) const
{
_Rope_find_char_char_consumer<_CharT> __c(__pattern);
_S_apply_to_pieces(__c, _M_tree_ptr, __start, size());
size_type __result_pos = __start + __c._M_count;
# ifndef __STL_OLD_ROPE_SEMANTICS
if (__result_pos == size()) __result_pos = npos;
# endif
return __result_pos;
}
 
template <class _CharT, class _Alloc>
_CharT*
rope<_CharT,_Alloc>::_S_flatten(_RopeRep* __r, _CharT* __buffer)
{
if (0 == __r) return __buffer;
switch(__r->_M_tag) {
case _RopeRep::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
_RopeRep* __right = __c->_M_right;
_CharT* __rest = _S_flatten(__left, __buffer);
return _S_flatten(__right, __rest);
}
case _RopeRep::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return copy_n(__l->_M_data, __l->_M_size, __buffer).second;
}
case _RopeRep::_S_function:
case _RopeRep::_S_substringfn:
// We dont yet do anything with substring nodes.
// This needs to be fixed before ropefiles will work well.
{
_RopeFunction* __f = (_RopeFunction*)__r;
(*(__f->_M_fn))(0, __f->_M_size, __buffer);
return __buffer + __f->_M_size;
}
default:
__stl_assert(false);
/*NOTREACHED*/
return 0;
}
}
 
 
// This needs work for _CharT != char
template <class _CharT, class _Alloc>
void
rope<_CharT,_Alloc>::_S_dump(_RopeRep* __r, int __indent)
{
for (int __i = 0; __i < __indent; __i++) putchar(' ');
if (0 == __r) {
printf("NULL\n"); return;
}
if (_RopeRep::_S_concat == __r->_M_tag) {
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
_RopeRep* __right = __c->_M_right;
 
# ifdef __GC
printf("Concatenation %p (depth = %d, len = %ld, %s balanced)\n",
__r, __r->_M_depth, __r->_M_size, __r->_M_is_balanced? "" : "not");
# else
printf("Concatenation %p (rc = %ld, depth = %d, "
"len = %ld, %s balanced)\n",
__r, __r->_M_ref_count, __r->_M_depth, __r->_M_size,
__r->_M_is_balanced? "" : "not");
# endif
_S_dump(__left, __indent + 2);
_S_dump(__right, __indent + 2);
return;
} else {
char* __kind;
 
switch (__r->_M_tag) {
case _RopeRep::_S_leaf:
__kind = "Leaf";
break;
case _RopeRep::_S_function:
__kind = "Function";
break;
case _RopeRep::_S_substringfn:
__kind = "Function representing substring";
break;
default:
__kind = "(corrupted kind field!)";
}
# ifdef __GC
printf("%s %p (depth = %d, len = %ld) ",
__kind, __r, __r->_M_depth, __r->_M_size);
# else
printf("%s %p (rc = %ld, depth = %d, len = %ld) ",
__kind, __r, __r->_M_ref_count, __r->_M_depth, __r->_M_size);
# endif
if (_S_is_one_byte_char_type((_CharT*)0)) {
const int __max_len = 40;
_Self_destruct_ptr __prefix(_S_substring(__r, 0, __max_len));
_CharT __buffer[__max_len + 1];
bool __too_big = __r->_M_size > __prefix->_M_size;
 
_S_flatten(__prefix, __buffer);
__buffer[__prefix->_M_size] = _S_eos((_CharT*)0);
printf("%s%s\n",
(char*)__buffer, __too_big? "...\n" : "\n");
} else {
printf("\n");
}
}
}
 
template <class _CharT, class _Alloc>
const unsigned long
rope<_CharT,_Alloc>::_S_min_len[
_Rope_RopeRep<_CharT,_Alloc>::_S_max_rope_depth + 1] = {
/* 0 */1, /* 1 */2, /* 2 */3, /* 3 */5, /* 4 */8, /* 5 */13, /* 6 */21,
/* 7 */34, /* 8 */55, /* 9 */89, /* 10 */144, /* 11 */233, /* 12 */377,
/* 13 */610, /* 14 */987, /* 15 */1597, /* 16 */2584, /* 17 */4181,
/* 18 */6765, /* 19 */10946, /* 20 */17711, /* 21 */28657, /* 22 */46368,
/* 23 */75025, /* 24 */121393, /* 25 */196418, /* 26 */317811,
/* 27 */514229, /* 28 */832040, /* 29 */1346269, /* 30 */2178309,
/* 31 */3524578, /* 32 */5702887, /* 33 */9227465, /* 34 */14930352,
/* 35 */24157817, /* 36 */39088169, /* 37 */63245986, /* 38 */102334155,
/* 39 */165580141, /* 40 */267914296, /* 41 */433494437,
/* 42 */701408733, /* 43 */1134903170, /* 44 */1836311903,
/* 45 */2971215073u };
// These are Fibonacci numbers < 2**32.
 
template <class _CharT, class _Alloc>
rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::_S_balance(_RopeRep* __r)
{
_RopeRep* __forest[_RopeRep::_S_max_rope_depth + 1];
_RopeRep* __result = 0;
int __i;
// Invariant:
// The concatenation of forest in descending order is equal to __r.
// __forest[__i]._M_size >= _S_min_len[__i]
// __forest[__i]._M_depth = __i
// References from forest are included in refcount.
 
for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
__forest[__i] = 0;
__STL_TRY {
_S_add_to_forest(__r, __forest);
for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
if (0 != __forest[__i]) {
# ifndef __GC
_Self_destruct_ptr __old(__result);
# endif
__result = _S_concat(__forest[__i], __result);
__forest[__i]->_M_unref_nonnil();
# if !defined(__GC) && defined(__STL_USE_EXCEPTIONS)
__forest[__i] = 0;
# endif
}
}
__STL_UNWIND(for(__i = 0; __i <= _RopeRep::_S_max_rope_depth; __i++)
_S_unref(__forest[__i]))
if (__result->_M_depth > _RopeRep::_S_max_rope_depth) {
# ifdef __STL_USE_EXCEPTIONS
__STL_THROW(length_error("rope too long"));
# else
abort();
# endif
}
return(__result);
}
 
 
template <class _CharT, class _Alloc>
void
rope<_CharT,_Alloc>::_S_add_to_forest(_RopeRep* __r, _RopeRep** __forest)
{
if (__r->_M_is_balanced) {
_S_add_leaf_to_forest(__r, __forest);
return;
}
__stl_assert(__r->_M_tag == _RopeRep::_S_concat);
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
 
_S_add_to_forest(__c->_M_left, __forest);
_S_add_to_forest(__c->_M_right, __forest);
}
}
 
 
template <class _CharT, class _Alloc>
void
rope<_CharT,_Alloc>::_S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest)
{
_RopeRep* __insertee; // included in refcount
_RopeRep* __too_tiny = 0; // included in refcount
int __i; // forest[0..__i-1] is empty
size_t __s = __r->_M_size;
 
for (__i = 0; __s >= _S_min_len[__i+1]/* not this bucket */; ++__i) {
if (0 != __forest[__i]) {
# ifndef __GC
_Self_destruct_ptr __old(__too_tiny);
# endif
__too_tiny = _S_concat_and_set_balanced(__forest[__i], __too_tiny);
__forest[__i]->_M_unref_nonnil();
__forest[__i] = 0;
}
}
{
# ifndef __GC
_Self_destruct_ptr __old(__too_tiny);
# endif
__insertee = _S_concat_and_set_balanced(__too_tiny, __r);
}
// Too_tiny dead, and no longer included in refcount.
// Insertee is live and included.
__stl_assert(_S_is_almost_balanced(__insertee));
__stl_assert(__insertee->_M_depth <= __r->_M_depth + 1);
for (;; ++__i) {
if (0 != __forest[__i]) {
# ifndef __GC
_Self_destruct_ptr __old(__insertee);
# endif
__insertee = _S_concat_and_set_balanced(__forest[__i], __insertee);
__forest[__i]->_M_unref_nonnil();
__forest[__i] = 0;
__stl_assert(_S_is_almost_balanced(__insertee));
}
__stl_assert(_S_min_len[__i] <= __insertee->_M_size);
__stl_assert(__forest[__i] == 0);
if (__i == _RopeRep::_S_max_rope_depth ||
__insertee->_M_size < _S_min_len[__i+1]) {
__forest[__i] = __insertee;
// refcount is OK since __insertee is now dead.
return;
}
}
}
 
template <class _CharT, class _Alloc>
_CharT
rope<_CharT,_Alloc>::_S_fetch(_RopeRep* __r, size_type __i)
{
__GC_CONST _CharT* __cstr = __r->_M_c_string;
 
__stl_assert(__i < __r->_M_size);
if (0 != __cstr) return __cstr[__i];
for(;;) {
switch(__r->_M_tag) {
case _RopeRep::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
size_t __left_len = __left->_M_size;
 
if (__i >= __left_len) {
__i -= __left_len;
__r = __c->_M_right;
} else {
__r = __left;
}
}
break;
case _RopeRep::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return __l->_M_data[__i];
}
case _RopeRep::_S_function:
case _RopeRep::_S_substringfn:
{
_RopeFunction* __f = (_RopeFunction*)__r;
_CharT __result;
 
(*(__f->_M_fn))(__i, 1, &__result);
return __result;
}
}
}
}
 
# ifndef __GC
// Return a uniquely referenced character slot for the given
// position, or 0 if that's not possible.
template <class _CharT, class _Alloc>
_CharT*
rope<_CharT,_Alloc>::_S_fetch_ptr(_RopeRep* __r, size_type __i)
{
_RopeRep* __clrstack[_RopeRep::_S_max_rope_depth];
size_t __csptr = 0;
 
for(;;) {
if (__r->_M_ref_count > 1) return 0;
switch(__r->_M_tag) {
case _RopeRep::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
size_t __left_len = __left->_M_size;
 
if (__c->_M_c_string != 0) __clrstack[__csptr++] = __c;
if (__i >= __left_len) {
__i -= __left_len;
__r = __c->_M_right;
} else {
__r = __left;
}
}
break;
case _RopeRep::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
if (__l->_M_c_string != __l->_M_data && __l->_M_c_string != 0)
__clrstack[__csptr++] = __l;
while (__csptr > 0) {
-- __csptr;
_RopeRep* __d = __clrstack[__csptr];
__d->_M_free_c_string();
__d->_M_c_string = 0;
}
return __l->_M_data + __i;
}
case _RopeRep::_S_function:
case _RopeRep::_S_substringfn:
return 0;
}
}
}
# endif /* __GC */
 
// The following could be implemented trivially using
// lexicographical_compare_3way.
// We do a little more work to avoid dealing with rope iterators for
// flat strings.
template <class _CharT, class _Alloc>
int
rope<_CharT,_Alloc>::_S_compare (const _RopeRep* __left,
const _RopeRep* __right)
{
size_t __left_len;
size_t __right_len;
 
if (0 == __right) return 0 != __left;
if (0 == __left) return -1;
__left_len = __left->_M_size;
__right_len = __right->_M_size;
if (_RopeRep::_S_leaf == __left->_M_tag) {
_RopeLeaf* __l = (_RopeLeaf*) __left;
if (_RopeRep::_S_leaf == __right->_M_tag) {
_RopeLeaf* __r = (_RopeLeaf*) __right;
return lexicographical_compare_3way(
__l->_M_data, __l->_M_data + __left_len,
__r->_M_data, __r->_M_data + __right_len);
} else {
const_iterator __rstart(__right, 0);
const_iterator __rend(__right, __right_len);
return lexicographical_compare_3way(
__l->_M_data, __l->_M_data + __left_len,
__rstart, __rend);
}
} else {
const_iterator __lstart(__left, 0);
const_iterator __lend(__left, __left_len);
if (_RopeRep::_S_leaf == __right->_M_tag) {
_RopeLeaf* __r = (_RopeLeaf*) __right;
return lexicographical_compare_3way(
__lstart, __lend,
__r->_M_data, __r->_M_data + __right_len);
} else {
const_iterator __rstart(__right, 0);
const_iterator __rend(__right, __right_len);
return lexicographical_compare_3way(
__lstart, __lend,
__rstart, __rend);
}
}
}
 
// Assignment to reference proxies.
template <class _CharT, class _Alloc>
_Rope_char_ref_proxy<_CharT, _Alloc>&
_Rope_char_ref_proxy<_CharT, _Alloc>::operator= (_CharT __c) {
_RopeRep* __old = _M_root->_M_tree_ptr;
# ifndef __GC
// First check for the case in which everything is uniquely
// referenced. In that case we can do this destructively.
_CharT* __ptr = _My_rope::_S_fetch_ptr(__old, _M_pos);
if (0 != __ptr) {
*__ptr = __c;
return *this;
}
# endif
_Self_destruct_ptr __left(
_My_rope::_S_substring(__old, 0, _M_pos));
_Self_destruct_ptr __right(
_My_rope::_S_substring(__old, _M_pos+1, __old->_M_size));
_Self_destruct_ptr __result_left(
_My_rope::_S_destr_concat_char_iter(__left, &__c, 1));
 
# ifndef __GC
__stl_assert(__left == __result_left || 1 == __result_left->_M_ref_count);
# endif
_RopeRep* __result =
_My_rope::_S_concat(__result_left, __right);
# ifndef __GC
__stl_assert(1 <= __result->_M_ref_count);
_RopeRep::_S_unref(__old);
# endif
_M_root->_M_tree_ptr = __result;
return *this;
}
 
template <class _CharT, class _Alloc>
inline _Rope_char_ref_proxy<_CharT, _Alloc>::operator _CharT () const
{
if (_M_current_valid) {
return _M_current;
} else {
return _My_rope::_S_fetch(_M_root->_M_tree_ptr, _M_pos);
}
}
template <class _CharT, class _Alloc>
_Rope_char_ptr_proxy<_CharT, _Alloc>
_Rope_char_ref_proxy<_CharT, _Alloc>::operator& () const {
return _Rope_char_ptr_proxy<_CharT, _Alloc>(*this);
}
 
template <class _CharT, class _Alloc>
rope<_CharT, _Alloc>::rope(size_t __n, _CharT __c,
const allocator_type& __a)
: _Base(__a)
{
rope<_CharT,_Alloc> __result;
const size_t __exponentiate_threshold = 32;
size_t __exponent;
size_t __rest;
_CharT* __rest_buffer;
_RopeRep* __remainder;
rope<_CharT,_Alloc> __remainder_rope;
 
if (0 == __n)
return;
__exponent = __n / __exponentiate_threshold;
__rest = __n % __exponentiate_threshold;
if (0 == __rest) {
__remainder = 0;
} else {
__rest_buffer = _Data_allocate(_S_rounded_up_size(__rest));
uninitialized_fill_n(__rest_buffer, __rest, __c);
_S_cond_store_eos(__rest_buffer[__rest]);
__STL_TRY {
__remainder = _S_new_RopeLeaf(__rest_buffer, __rest, __a);
}
__STL_UNWIND(_RopeRep::__STL_FREE_STRING(__rest_buffer, __rest, __a))
}
__remainder_rope._M_tree_ptr = __remainder;
if (__exponent != 0) {
_CharT* __base_buffer =
_Data_allocate(_S_rounded_up_size(__exponentiate_threshold));
_RopeLeaf* __base_leaf;
rope __base_rope;
uninitialized_fill_n(__base_buffer, __exponentiate_threshold, __c);
_S_cond_store_eos(__base_buffer[__exponentiate_threshold]);
__STL_TRY {
__base_leaf = _S_new_RopeLeaf(__base_buffer,
__exponentiate_threshold, __a);
}
__STL_UNWIND(_RopeRep::__STL_FREE_STRING(__base_buffer,
__exponentiate_threshold, __a))
__base_rope._M_tree_ptr = __base_leaf;
if (1 == __exponent) {
__result = __base_rope;
# ifndef __GC
__stl_assert(2 == __result._M_tree_ptr->_M_ref_count);
// One each for base_rope and __result
# endif
} else {
__result = power(__base_rope, __exponent,
_Rope_Concat_fn<_CharT,_Alloc>());
}
if (0 != __remainder) {
__result += __remainder_rope;
}
} else {
__result = __remainder_rope;
}
_M_tree_ptr = __result._M_tree_ptr;
_M_tree_ptr->_M_ref_nonnil();
}
 
template<class _CharT, class _Alloc>
_CharT rope<_CharT,_Alloc>::_S_empty_c_str[1];
 
template<class _CharT, class _Alloc>
const _CharT* rope<_CharT,_Alloc>::c_str() const {
if (0 == _M_tree_ptr) {
_S_empty_c_str[0] = _S_eos((_CharT*)0); // Possibly redundant,
// but probably fast.
return _S_empty_c_str;
}
__GC_CONST _CharT* __old_c_string = _M_tree_ptr->_M_c_string;
if (0 != __old_c_string) return(__old_c_string);
size_t __s = size();
_CharT* __result = _Data_allocate(__s + 1);
_S_flatten(_M_tree_ptr, __result);
__result[__s] = _S_eos((_CharT*)0);
# ifdef __GC
_M_tree_ptr->_M_c_string = __result;
# else
if ((__old_c_string = (__GC_CONST _CharT*)
_Atomic_swap((unsigned long *)(&(_M_tree_ptr->_M_c_string)),
(unsigned long)__result)) != 0) {
// It must have been added in the interim. Hence it had to have been
// separately allocated. Deallocate the old copy, since we just
// replaced it.
destroy(__old_c_string, __old_c_string + __s + 1);
_Data_deallocate(__old_c_string, __s + 1);
}
# endif
return(__result);
}
 
template<class _CharT, class _Alloc>
const _CharT* rope<_CharT,_Alloc>::replace_with_c_str() {
if (0 == _M_tree_ptr) {
_S_empty_c_str[0] = _S_eos((_CharT*)0);
return _S_empty_c_str;
}
__GC_CONST _CharT* __old_c_string = _M_tree_ptr->_M_c_string;
if (_RopeRep::_S_leaf == _M_tree_ptr->_M_tag && 0 != __old_c_string) {
return(__old_c_string);
}
size_t __s = size();
_CharT* __result = _Data_allocate(_S_rounded_up_size(__s));
_S_flatten(_M_tree_ptr, __result);
__result[__s] = _S_eos((_CharT*)0);
_M_tree_ptr->_M_unref_nonnil();
_M_tree_ptr = _S_new_RopeLeaf(__result, __s, get_allocator());
return(__result);
}
 
// Algorithm specializations. More should be added.
 
template<class _Rope_iterator> // was templated on CharT and Alloc
void // VC++ workaround
_Rope_rotate(_Rope_iterator __first,
_Rope_iterator __middle,
_Rope_iterator __last)
{
typedef typename _Rope_iterator::value_type _CharT;
typedef typename _Rope_iterator::_allocator_type _Alloc;
__stl_assert(__first.container() == __middle.container()
&& __middle.container() == __last.container());
rope<_CharT,_Alloc>& __r(__first.container());
rope<_CharT,_Alloc> __prefix = __r.substr(0, __first.index());
rope<_CharT,_Alloc> __suffix =
__r.substr(__last.index(), __r.size() - __last.index());
rope<_CharT,_Alloc> __part1 =
__r.substr(__middle.index(), __last.index() - __middle.index());
rope<_CharT,_Alloc> __part2 =
__r.substr(__first.index(), __middle.index() - __first.index());
__r = __prefix;
__r += __part1;
__r += __part2;
__r += __suffix;
}
 
#if !defined(__GNUC__)
// Appears to confuse g++
inline void rotate(_Rope_iterator<char,__STL_DEFAULT_ALLOCATOR(char)> __first,
_Rope_iterator<char,__STL_DEFAULT_ALLOCATOR(char)> __middle,
_Rope_iterator<char,__STL_DEFAULT_ALLOCATOR(char)> __last) {
_Rope_rotate(__first, __middle, __last);
}
#endif
 
# if 0
// Probably not useful for several reasons:
// - for SGIs 7.1 compiler and probably some others,
// this forces lots of rope<wchar_t, ...> instantiations, creating a
// code bloat and compile time problem. (Fixed in 7.2.)
// - wchar_t is 4 bytes wide on most UNIX platforms, making it unattractive
// for unicode strings. Unsigned short may be a better character
// type.
inline void rotate(
_Rope_iterator<wchar_t,__STL_DEFAULT_ALLOCATOR(char)> __first,
_Rope_iterator<wchar_t,__STL_DEFAULT_ALLOCATOR(char)> __middle,
_Rope_iterator<wchar_t,__STL_DEFAULT_ALLOCATOR(char)> __last) {
_Rope_rotate(__first, __middle, __last);
}
# endif
 
} // namespace std
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/ext/slist
0,0 → 1,903
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_SLIST_H
#define __SGI_STL_INTERNAL_SLIST_H
 
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/concept_check.h>
 
namespace std
{
 
struct _Slist_node_base
{
_Slist_node_base* _M_next;
};
 
inline _Slist_node_base*
__slist_make_link(_Slist_node_base* __prev_node,
_Slist_node_base* __new_node)
{
__new_node->_M_next = __prev_node->_M_next;
__prev_node->_M_next = __new_node;
return __new_node;
}
 
inline _Slist_node_base*
__slist_previous(_Slist_node_base* __head,
const _Slist_node_base* __node)
{
while (__head && __head->_M_next != __node)
__head = __head->_M_next;
return __head;
}
 
inline const _Slist_node_base*
__slist_previous(const _Slist_node_base* __head,
const _Slist_node_base* __node)
{
while (__head && __head->_M_next != __node)
__head = __head->_M_next;
return __head;
}
 
inline void __slist_splice_after(_Slist_node_base* __pos,
_Slist_node_base* __before_first,
_Slist_node_base* __before_last)
{
if (__pos != __before_first && __pos != __before_last) {
_Slist_node_base* __first = __before_first->_M_next;
_Slist_node_base* __after = __pos->_M_next;
__before_first->_M_next = __before_last->_M_next;
__pos->_M_next = __first;
__before_last->_M_next = __after;
}
}
 
inline void
__slist_splice_after(_Slist_node_base* __pos, _Slist_node_base* __head)
{
_Slist_node_base* __before_last = __slist_previous(__head, 0);
if (__before_last != __head) {
_Slist_node_base* __after = __pos->_M_next;
__pos->_M_next = __head->_M_next;
__head->_M_next = 0;
__before_last->_M_next = __after;
}
}
 
inline _Slist_node_base* __slist_reverse(_Slist_node_base* __node)
{
_Slist_node_base* __result = __node;
__node = __node->_M_next;
__result->_M_next = 0;
while(__node) {
_Slist_node_base* __next = __node->_M_next;
__node->_M_next = __result;
__result = __node;
__node = __next;
}
return __result;
}
 
inline size_t __slist_size(_Slist_node_base* __node)
{
size_t __result = 0;
for ( ; __node != 0; __node = __node->_M_next)
++__result;
return __result;
}
 
template <class _Tp>
struct _Slist_node : public _Slist_node_base
{
_Tp _M_data;
};
 
struct _Slist_iterator_base
{
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef forward_iterator_tag iterator_category;
 
_Slist_node_base* _M_node;
 
_Slist_iterator_base(_Slist_node_base* __x) : _M_node(__x) {}
void _M_incr() { _M_node = _M_node->_M_next; }
 
bool operator==(const _Slist_iterator_base& __x) const {
return _M_node == __x._M_node;
}
bool operator!=(const _Slist_iterator_base& __x) const {
return _M_node != __x._M_node;
}
};
 
template <class _Tp, class _Ref, class _Ptr>
struct _Slist_iterator : public _Slist_iterator_base
{
typedef _Slist_iterator<_Tp, _Tp&, _Tp*> iterator;
typedef _Slist_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
typedef _Slist_iterator<_Tp, _Ref, _Ptr> _Self;
 
typedef _Tp value_type;
typedef _Ptr pointer;
typedef _Ref reference;
typedef _Slist_node<_Tp> _Node;
 
_Slist_iterator(_Node* __x) : _Slist_iterator_base(__x) {}
_Slist_iterator() : _Slist_iterator_base(0) {}
_Slist_iterator(const iterator& __x) : _Slist_iterator_base(__x._M_node) {}
 
reference operator*() const { return ((_Node*) _M_node)->_M_data; }
pointer operator->() const { return &(operator*()); }
 
_Self& operator++()
{
_M_incr();
return *this;
}
_Self operator++(int)
{
_Self __tmp = *this;
_M_incr();
return __tmp;
}
};
 
 
// Base class that encapsulates details of allocators. Three cases:
// an ordinary standard-conforming allocator, a standard-conforming
// allocator with no non-static data, and an SGI-style allocator.
// This complexity is necessary only because we're worrying about backward
// compatibility and because we want to avoid wasting storage on an
// allocator instance if it isn't necessary.
 
// Base for general standard-conforming allocators.
template <class _Tp, class _Allocator, bool _IsStatic>
class _Slist_alloc_base {
public:
typedef typename _Alloc_traits<_Tp,_Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return _M_node_allocator; }
 
_Slist_alloc_base(const allocator_type& __a) : _M_node_allocator(__a) {}
 
protected:
_Slist_node<_Tp>* _M_get_node()
{ return _M_node_allocator.allocate(1); }
void _M_put_node(_Slist_node<_Tp>* __p)
{ _M_node_allocator.deallocate(__p, 1); }
 
protected:
typename _Alloc_traits<_Slist_node<_Tp>,_Allocator>::allocator_type
_M_node_allocator;
_Slist_node_base _M_head;
};
 
// Specialization for instanceless allocators.
template <class _Tp, class _Allocator>
class _Slist_alloc_base<_Tp,_Allocator, true> {
public:
typedef typename _Alloc_traits<_Tp,_Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
 
_Slist_alloc_base(const allocator_type&) {}
 
protected:
typedef typename _Alloc_traits<_Slist_node<_Tp>, _Allocator>::_Alloc_type
_Alloc_type;
_Slist_node<_Tp>* _M_get_node() { return _Alloc_type::allocate(1); }
void _M_put_node(_Slist_node<_Tp>* __p) { _Alloc_type::deallocate(__p, 1); }
 
protected:
_Slist_node_base _M_head;
};
 
 
template <class _Tp, class _Alloc>
struct _Slist_base
: public _Slist_alloc_base<_Tp, _Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
{
typedef _Slist_alloc_base<_Tp, _Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
_Base;
typedef typename _Base::allocator_type allocator_type;
 
_Slist_base(const allocator_type& __a)
: _Base(__a) { this->_M_head._M_next = 0; }
~_Slist_base() { _M_erase_after(&this->_M_head, 0); }
 
protected:
 
_Slist_node_base* _M_erase_after(_Slist_node_base* __pos)
{
_Slist_node<_Tp>* __next = (_Slist_node<_Tp>*) (__pos->_M_next);
_Slist_node_base* __next_next = __next->_M_next;
__pos->_M_next = __next_next;
destroy(&__next->_M_data);
_M_put_node(__next);
return __next_next;
}
_Slist_node_base* _M_erase_after(_Slist_node_base*, _Slist_node_base*);
};
 
template <class _Tp, class _Alloc>
_Slist_node_base*
_Slist_base<_Tp,_Alloc>::_M_erase_after(_Slist_node_base* __before_first,
_Slist_node_base* __last_node) {
_Slist_node<_Tp>* __cur = (_Slist_node<_Tp>*) (__before_first->_M_next);
while (__cur != __last_node) {
_Slist_node<_Tp>* __tmp = __cur;
__cur = (_Slist_node<_Tp>*) __cur->_M_next;
destroy(&__tmp->_M_data);
_M_put_node(__tmp);
}
__before_first->_M_next = __last_node;
return __last_node;
}
 
template <class _Tp, class _Alloc = allocator<_Tp> >
class slist : private _Slist_base<_Tp,_Alloc>
{
// concept requirements
__glibcpp_class_requires(_Tp, _SGIAssignableConcept);
 
private:
typedef _Slist_base<_Tp,_Alloc> _Base;
public:
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
 
typedef _Slist_iterator<_Tp, _Tp&, _Tp*> iterator;
typedef _Slist_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
 
typedef typename _Base::allocator_type allocator_type;
allocator_type get_allocator() const { return _Base::get_allocator(); }
 
private:
typedef _Slist_node<_Tp> _Node;
typedef _Slist_node_base _Node_base;
typedef _Slist_iterator_base _Iterator_base;
 
_Node* _M_create_node(const value_type& __x) {
_Node* __node = this->_M_get_node();
__STL_TRY {
construct(&__node->_M_data, __x);
__node->_M_next = 0;
}
__STL_UNWIND(this->_M_put_node(__node));
return __node;
}
_Node* _M_create_node() {
_Node* __node = this->_M_get_node();
__STL_TRY {
construct(&__node->_M_data);
__node->_M_next = 0;
}
__STL_UNWIND(this->_M_put_node(__node));
return __node;
}
 
public:
explicit slist(const allocator_type& __a = allocator_type()) : _Base(__a) {}
 
slist(size_type __n, const value_type& __x,
const allocator_type& __a = allocator_type()) : _Base(__a)
{ _M_insert_after_fill(&this->_M_head, __n, __x); }
 
explicit slist(size_type __n) : _Base(allocator_type())
{ _M_insert_after_fill(&this->_M_head, __n, value_type()); }
 
// We don't need any dispatching tricks here, because _M_insert_after_range
// already does them.
template <class _InputIterator>
slist(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type()) : _Base(__a)
{ _M_insert_after_range(&this->_M_head, __first, __last); }
 
slist(const slist& __x) : _Base(__x.get_allocator())
{ _M_insert_after_range(&this->_M_head, __x.begin(), __x.end()); }
 
slist& operator= (const slist& __x);
 
~slist() {}
 
public:
// assign(), a generalized assignment member function. Two
// versions: one that takes a count, and one that takes a range.
// The range version is a member template, so we dispatch on whether
// or not the type is an integer.
 
void assign(size_type __n, const _Tp& __val)
{ _M_fill_assign(__n, __val); }
 
void _M_fill_assign(size_type __n, const _Tp& __val);
 
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
 
template <class _Integer>
void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ _M_fill_assign((size_type) __n, (_Tp) __val); }
 
template <class _InputIterator>
void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type);
 
public:
 
iterator begin() { return iterator((_Node*)this->_M_head._M_next); }
const_iterator begin() const
{ return const_iterator((_Node*)this->_M_head._M_next);}
 
iterator end() { return iterator(0); }
const_iterator end() const { return const_iterator(0); }
 
// Experimental new feature: before_begin() returns a
// non-dereferenceable iterator that, when incremented, yields
// begin(). This iterator may be used as the argument to
// insert_after, erase_after, etc. Note that even for an empty
// slist, before_begin() is not the same iterator as end(). It
// is always necessary to increment before_begin() at least once to
// obtain end().
iterator before_begin() { return iterator((_Node*) &this->_M_head); }
const_iterator before_begin() const
{ return const_iterator((_Node*) &this->_M_head); }
 
size_type size() const { return __slist_size(this->_M_head._M_next); }
size_type max_size() const { return size_type(-1); }
 
bool empty() const { return this->_M_head._M_next == 0; }
 
void swap(slist& __x)
{ std::swap(this->_M_head._M_next, __x._M_head._M_next); }
 
public:
 
reference front() { return ((_Node*) this->_M_head._M_next)->_M_data; }
const_reference front() const
{ return ((_Node*) this->_M_head._M_next)->_M_data; }
void push_front(const value_type& __x) {
__slist_make_link(&this->_M_head, _M_create_node(__x));
}
void push_front() { __slist_make_link(&this->_M_head, _M_create_node()); }
void pop_front() {
_Node* __node = (_Node*) this->_M_head._M_next;
this->_M_head._M_next = __node->_M_next;
destroy(&__node->_M_data);
this->_M_put_node(__node);
}
 
iterator previous(const_iterator __pos) {
return iterator((_Node*) __slist_previous(&this->_M_head, __pos._M_node));
}
const_iterator previous(const_iterator __pos) const {
return const_iterator((_Node*) __slist_previous(&this->_M_head,
__pos._M_node));
}
 
private:
_Node* _M_insert_after(_Node_base* __pos, const value_type& __x) {
return (_Node*) (__slist_make_link(__pos, _M_create_node(__x)));
}
 
_Node* _M_insert_after(_Node_base* __pos) {
return (_Node*) (__slist_make_link(__pos, _M_create_node()));
}
 
void _M_insert_after_fill(_Node_base* __pos,
size_type __n, const value_type& __x) {
for (size_type __i = 0; __i < __n; ++__i)
__pos = __slist_make_link(__pos, _M_create_node(__x));
}
 
// Check whether it's an integral type. If so, it's not an iterator.
template <class _InIter>
void _M_insert_after_range(_Node_base* __pos,
_InIter __first, _InIter __last) {
typedef typename _Is_integer<_InIter>::_Integral _Integral;
_M_insert_after_range(__pos, __first, __last, _Integral());
}
 
template <class _Integer>
void _M_insert_after_range(_Node_base* __pos, _Integer __n, _Integer __x,
__true_type) {
_M_insert_after_fill(__pos, __n, __x);
}
 
template <class _InIter>
void _M_insert_after_range(_Node_base* __pos,
_InIter __first, _InIter __last,
__false_type) {
while (__first != __last) {
__pos = __slist_make_link(__pos, _M_create_node(*__first));
++__first;
}
}
 
public:
 
iterator insert_after(iterator __pos, const value_type& __x) {
return iterator(_M_insert_after(__pos._M_node, __x));
}
 
iterator insert_after(iterator __pos) {
return insert_after(__pos, value_type());
}
 
void insert_after(iterator __pos, size_type __n, const value_type& __x) {
_M_insert_after_fill(__pos._M_node, __n, __x);
}
 
// We don't need any dispatching tricks here, because _M_insert_after_range
// already does them.
template <class _InIter>
void insert_after(iterator __pos, _InIter __first, _InIter __last) {
_M_insert_after_range(__pos._M_node, __first, __last);
}
 
iterator insert(iterator __pos, const value_type& __x) {
return iterator(_M_insert_after(__slist_previous(&this->_M_head,
__pos._M_node),
__x));
}
 
iterator insert(iterator __pos) {
return iterator(_M_insert_after(__slist_previous(&this->_M_head,
__pos._M_node),
value_type()));
}
 
void insert(iterator __pos, size_type __n, const value_type& __x) {
_M_insert_after_fill(__slist_previous(&this->_M_head, __pos._M_node),
__n, __x);
}
// We don't need any dispatching tricks here, because _M_insert_after_range
// already does them.
template <class _InIter>
void insert(iterator __pos, _InIter __first, _InIter __last) {
_M_insert_after_range(__slist_previous(&this->_M_head, __pos._M_node),
__first, __last);
}
 
public:
iterator erase_after(iterator __pos) {
return iterator((_Node*) this->_M_erase_after(__pos._M_node));
}
iterator erase_after(iterator __before_first, iterator __last) {
return iterator((_Node*) this->_M_erase_after(__before_first._M_node,
__last._M_node));
}
 
iterator erase(iterator __pos) {
return (_Node*) this->_M_erase_after(__slist_previous(&this->_M_head,
__pos._M_node));
}
iterator erase(iterator __first, iterator __last) {
return (_Node*) this->_M_erase_after(
__slist_previous(&this->_M_head, __first._M_node), __last._M_node);
}
 
void resize(size_type new_size, const _Tp& __x);
void resize(size_type new_size) { resize(new_size, _Tp()); }
void clear() { this->_M_erase_after(&this->_M_head, 0); }
 
public:
// Moves the range [__before_first + 1, __before_last + 1) to *this,
// inserting it immediately after __pos. This is constant time.
void splice_after(iterator __pos,
iterator __before_first, iterator __before_last)
{
if (__before_first != __before_last)
__slist_splice_after(__pos._M_node, __before_first._M_node,
__before_last._M_node);
}
 
// Moves the element that follows __prev to *this, inserting it immediately
// after __pos. This is constant time.
void splice_after(iterator __pos, iterator __prev)
{
__slist_splice_after(__pos._M_node,
__prev._M_node, __prev._M_node->_M_next);
}
 
 
// Removes all of the elements from the list __x to *this, inserting
// them immediately after __pos. __x must not be *this. Complexity:
// linear in __x.size().
void splice_after(iterator __pos, slist& __x)
{
__slist_splice_after(__pos._M_node, &__x._M_head);
}
 
// Linear in distance(begin(), __pos), and linear in __x.size().
void splice(iterator __pos, slist& __x) {
if (__x._M_head._M_next)
__slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node),
&__x._M_head, __slist_previous(&__x._M_head, 0));
}
 
// Linear in distance(begin(), __pos), and in distance(__x.begin(), __i).
void splice(iterator __pos, slist& __x, iterator __i) {
__slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node),
__slist_previous(&__x._M_head, __i._M_node),
__i._M_node);
}
 
// Linear in distance(begin(), __pos), in distance(__x.begin(), __first),
// and in distance(__first, __last).
void splice(iterator __pos, slist& __x, iterator __first, iterator __last)
{
if (__first != __last)
__slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node),
__slist_previous(&__x._M_head, __first._M_node),
__slist_previous(__first._M_node, __last._M_node));
}
 
public:
void reverse() {
if (this->_M_head._M_next)
this->_M_head._M_next = __slist_reverse(this->_M_head._M_next);
}
 
void remove(const _Tp& __val);
void unique();
void merge(slist& __x);
void sort();
 
template <class _Predicate>
void remove_if(_Predicate __pred);
 
template <class _BinaryPredicate>
void unique(_BinaryPredicate __pred);
 
template <class _StrictWeakOrdering>
void merge(slist&, _StrictWeakOrdering);
 
template <class _StrictWeakOrdering>
void sort(_StrictWeakOrdering __comp);
};
 
template <class _Tp, class _Alloc>
slist<_Tp,_Alloc>& slist<_Tp,_Alloc>::operator=(const slist<_Tp,_Alloc>& __x)
{
if (&__x != this) {
_Node_base* __p1 = &this->_M_head;
_Node* __n1 = (_Node*) this->_M_head._M_next;
const _Node* __n2 = (const _Node*) __x._M_head._M_next;
while (__n1 && __n2) {
__n1->_M_data = __n2->_M_data;
__p1 = __n1;
__n1 = (_Node*) __n1->_M_next;
__n2 = (const _Node*) __n2->_M_next;
}
if (__n2 == 0)
this->_M_erase_after(__p1, 0);
else
_M_insert_after_range(__p1, const_iterator((_Node*)__n2),
const_iterator(0));
}
return *this;
}
 
template <class _Tp, class _Alloc>
void slist<_Tp, _Alloc>::_M_fill_assign(size_type __n, const _Tp& __val) {
_Node_base* __prev = &this->_M_head;
_Node* __node = (_Node*) this->_M_head._M_next;
for ( ; __node != 0 && __n > 0 ; --__n) {
__node->_M_data = __val;
__prev = __node;
__node = (_Node*) __node->_M_next;
}
if (__n > 0)
_M_insert_after_fill(__prev, __n, __val);
else
this->_M_erase_after(__prev, 0);
}
 
template <class _Tp, class _Alloc> template <class _InputIter>
void
slist<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first, _InputIter __last,
__false_type)
{
_Node_base* __prev = &this->_M_head;
_Node* __node = (_Node*) this->_M_head._M_next;
while (__node != 0 && __first != __last) {
__node->_M_data = *__first;
__prev = __node;
__node = (_Node*) __node->_M_next;
++__first;
}
if (__first != __last)
_M_insert_after_range(__prev, __first, __last);
else
this->_M_erase_after(__prev, 0);
}
 
template <class _Tp, class _Alloc>
inline bool
operator==(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2)
{
typedef typename slist<_Tp,_Alloc>::const_iterator const_iterator;
const_iterator __end1 = _SL1.end();
const_iterator __end2 = _SL2.end();
 
const_iterator __i1 = _SL1.begin();
const_iterator __i2 = _SL2.begin();
while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2) {
++__i1;
++__i2;
}
return __i1 == __end1 && __i2 == __end2;
}
 
 
template <class _Tp, class _Alloc>
inline bool
operator<(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2)
{
return lexicographical_compare(_SL1.begin(), _SL1.end(),
_SL2.begin(), _SL2.end());
}
 
template <class _Tp, class _Alloc>
inline bool
operator!=(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) {
return !(_SL1 == _SL2);
}
 
template <class _Tp, class _Alloc>
inline bool
operator>(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) {
return _SL2 < _SL1;
}
 
template <class _Tp, class _Alloc>
inline bool
operator<=(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) {
return !(_SL2 < _SL1);
}
 
template <class _Tp, class _Alloc>
inline bool
operator>=(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) {
return !(_SL1 < _SL2);
}
 
template <class _Tp, class _Alloc>
inline void swap(slist<_Tp,_Alloc>& __x, slist<_Tp,_Alloc>& __y) {
__x.swap(__y);
}
 
 
template <class _Tp, class _Alloc>
void slist<_Tp,_Alloc>::resize(size_type __len, const _Tp& __x)
{
_Node_base* __cur = &this->_M_head;
while (__cur->_M_next != 0 && __len > 0) {
--__len;
__cur = __cur->_M_next;
}
if (__cur->_M_next)
this->_M_erase_after(__cur, 0);
else
_M_insert_after_fill(__cur, __len, __x);
}
 
template <class _Tp, class _Alloc>
void slist<_Tp,_Alloc>::remove(const _Tp& __val)
{
_Node_base* __cur = &this->_M_head;
while (__cur && __cur->_M_next) {
if (((_Node*) __cur->_M_next)->_M_data == __val)
this->_M_erase_after(__cur);
else
__cur = __cur->_M_next;
}
}
 
template <class _Tp, class _Alloc>
void slist<_Tp,_Alloc>::unique()
{
_Node_base* __cur = this->_M_head._M_next;
if (__cur) {
while (__cur->_M_next) {
if (((_Node*)__cur)->_M_data ==
((_Node*)(__cur->_M_next))->_M_data)
this->_M_erase_after(__cur);
else
__cur = __cur->_M_next;
}
}
}
 
template <class _Tp, class _Alloc>
void slist<_Tp,_Alloc>::merge(slist<_Tp,_Alloc>& __x)
{
_Node_base* __n1 = &this->_M_head;
while (__n1->_M_next && __x._M_head._M_next) {
if (((_Node*) __x._M_head._M_next)->_M_data <
((_Node*) __n1->_M_next)->_M_data)
__slist_splice_after(__n1, &__x._M_head, __x._M_head._M_next);
__n1 = __n1->_M_next;
}
if (__x._M_head._M_next) {
__n1->_M_next = __x._M_head._M_next;
__x._M_head._M_next = 0;
}
}
 
template <class _Tp, class _Alloc>
void slist<_Tp,_Alloc>::sort()
{
if (this->_M_head._M_next && this->_M_head._M_next->_M_next) {
slist __carry;
slist __counter[64];
int __fill = 0;
while (!empty()) {
__slist_splice_after(&__carry._M_head,
&this->_M_head, this->_M_head._M_next);
int __i = 0;
while (__i < __fill && !__counter[__i].empty()) {
__counter[__i].merge(__carry);
__carry.swap(__counter[__i]);
++__i;
}
__carry.swap(__counter[__i]);
if (__i == __fill)
++__fill;
}
 
for (int __i = 1; __i < __fill; ++__i)
__counter[__i].merge(__counter[__i-1]);
this->swap(__counter[__fill-1]);
}
}
 
template <class _Tp, class _Alloc>
template <class _Predicate>
void slist<_Tp,_Alloc>::remove_if(_Predicate __pred)
{
_Node_base* __cur = &this->_M_head;
while (__cur->_M_next) {
if (__pred(((_Node*) __cur->_M_next)->_M_data))
this->_M_erase_after(__cur);
else
__cur = __cur->_M_next;
}
}
 
template <class _Tp, class _Alloc> template <class _BinaryPredicate>
void slist<_Tp,_Alloc>::unique(_BinaryPredicate __pred)
{
_Node* __cur = (_Node*) this->_M_head._M_next;
if (__cur) {
while (__cur->_M_next) {
if (__pred(((_Node*)__cur)->_M_data,
((_Node*)(__cur->_M_next))->_M_data))
this->_M_erase_after(__cur);
else
__cur = (_Node*) __cur->_M_next;
}
}
}
 
template <class _Tp, class _Alloc> template <class _StrictWeakOrdering>
void slist<_Tp,_Alloc>::merge(slist<_Tp,_Alloc>& __x,
_StrictWeakOrdering __comp)
{
_Node_base* __n1 = &this->_M_head;
while (__n1->_M_next && __x._M_head._M_next) {
if (__comp(((_Node*) __x._M_head._M_next)->_M_data,
((_Node*) __n1->_M_next)->_M_data))
__slist_splice_after(__n1, &__x._M_head, __x._M_head._M_next);
__n1 = __n1->_M_next;
}
if (__x._M_head._M_next) {
__n1->_M_next = __x._M_head._M_next;
__x._M_head._M_next = 0;
}
}
 
template <class _Tp, class _Alloc> template <class _StrictWeakOrdering>
void slist<_Tp,_Alloc>::sort(_StrictWeakOrdering __comp)
{
if (this->_M_head._M_next && this->_M_head._M_next->_M_next) {
slist __carry;
slist __counter[64];
int __fill = 0;
while (!empty()) {
__slist_splice_after(&__carry._M_head,
&this->_M_head, this->_M_head._M_next);
int __i = 0;
while (__i < __fill && !__counter[__i].empty()) {
__counter[__i].merge(__carry, __comp);
__carry.swap(__counter[__i]);
++__i;
}
__carry.swap(__counter[__i]);
if (__i == __fill)
++__fill;
}
 
for (int __i = 1; __i < __fill; ++__i)
__counter[__i].merge(__counter[__i-1], __comp);
this->swap(__counter[__fill-1]);
}
}
 
// Specialization of insert_iterator so that insertions will be constant
// time rather than linear time.
 
template <class _Tp, class _Alloc>
class insert_iterator<slist<_Tp, _Alloc> > {
protected:
typedef slist<_Tp, _Alloc> _Container;
_Container* container;
typename _Container::iterator iter;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
 
insert_iterator(_Container& __x, typename _Container::iterator __i)
: container(&__x) {
if (__i == __x.begin())
iter = __x.before_begin();
else
iter = __x.previous(__i);
}
 
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
iter = container->insert_after(iter, __value);
return *this;
}
insert_iterator<_Container>& operator*() { return *this; }
insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; }
};
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_SLIST_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/ext/stl_bvector.h
0,0 → 1,896
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996-1999
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_BVECTOR_H
#define __SGI_STL_INTERNAL_BVECTOR_H
 
__STL_BEGIN_NAMESPACE
 
static const int __WORD_BIT = int(CHAR_BIT*sizeof(unsigned int));
 
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#pragma set woff 1375
#endif
 
struct _Bit_reference {
unsigned int* _M_p;
unsigned int _M_mask;
_Bit_reference(unsigned int* __x, unsigned int __y)
: _M_p(__x), _M_mask(__y) {}
 
public:
_Bit_reference() : _M_p(0), _M_mask(0) {}
operator bool() const { return !(!(*_M_p & _M_mask)); }
_Bit_reference& operator=(bool __x)
{
if (__x) *_M_p |= _M_mask;
else *_M_p &= ~_M_mask;
return *this;
}
_Bit_reference& operator=(const _Bit_reference& __x)
{ return *this = bool(__x); }
bool operator==(const _Bit_reference& __x) const
{ return bool(*this) == bool(__x); }
bool operator<(const _Bit_reference& __x) const {
return !bool(*this) && bool(__x);
}
void flip() { *_M_p ^= _M_mask; }
};
 
inline void swap(_Bit_reference __x, _Bit_reference __y)
{
bool __tmp = __x;
__x = __y;
__y = __tmp;
}
 
struct _Bit_iterator_base : public random_access_iterator<bool, ptrdiff_t>
{
unsigned int* _M_p;
unsigned int _M_offset;
 
_Bit_iterator_base(unsigned int* __x, unsigned int __y)
: _M_p(__x), _M_offset(__y) {}
 
void _M_bump_up() {
if (_M_offset++ == __WORD_BIT - 1) {
_M_offset = 0;
++_M_p;
}
}
void _M_bump_down() {
if (_M_offset-- == 0) {
_M_offset = __WORD_BIT - 1;
--_M_p;
}
}
 
void _M_incr(ptrdiff_t __i) {
difference_type __n = __i + _M_offset;
_M_p += __n / __WORD_BIT;
__n = __n % __WORD_BIT;
if (__n < 0) {
_M_offset = (unsigned int) __n + __WORD_BIT;
--_M_p;
} else
_M_offset = (unsigned int) __n;
}
 
bool operator==(const _Bit_iterator_base& __i) const {
return _M_p == __i._M_p && _M_offset == __i._M_offset;
}
bool operator<(const _Bit_iterator_base& __i) const {
return _M_p < __i._M_p || (_M_p == __i._M_p && _M_offset < __i._M_offset);
}
bool operator!=(const _Bit_iterator_base& __i) const {
return !(*this == __i);
}
bool operator>(const _Bit_iterator_base& __i) const {
return __i < *this;
}
bool operator<=(const _Bit_iterator_base& __i) const {
return !(__i < *this);
}
bool operator>=(const _Bit_iterator_base& __i) const {
return !(*this < __i);
}
};
 
inline ptrdiff_t
operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) {
return __WORD_BIT * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset;
}
 
 
struct _Bit_iterator : public _Bit_iterator_base
{
typedef _Bit_reference reference;
typedef _Bit_reference* pointer;
typedef _Bit_iterator iterator;
 
_Bit_iterator() : _Bit_iterator_base(0, 0) {}
_Bit_iterator(unsigned int* __x, unsigned int __y)
: _Bit_iterator_base(__x, __y) {}
 
reference operator*() const { return reference(_M_p, 1U << _M_offset); }
iterator& operator++() {
_M_bump_up();
return *this;
}
iterator operator++(int) {
iterator __tmp = *this;
_M_bump_up();
return __tmp;
}
iterator& operator--() {
_M_bump_down();
return *this;
}
iterator operator--(int) {
iterator __tmp = *this;
_M_bump_down();
return __tmp;
}
iterator& operator+=(difference_type __i) {
_M_incr(__i);
return *this;
}
iterator& operator-=(difference_type __i) {
*this += -__i;
return *this;
}
iterator operator+(difference_type __i) const {
iterator __tmp = *this;
return __tmp += __i;
}
iterator operator-(difference_type __i) const {
iterator __tmp = *this;
return __tmp -= __i;
}
 
reference operator[](difference_type __i) { return *(*this + __i); }
};
 
inline _Bit_iterator
operator+(ptrdiff_t __n, const _Bit_iterator& __x) { return __x + __n; }
 
 
struct _Bit_const_iterator : public _Bit_iterator_base
{
typedef bool reference;
typedef bool const_reference;
typedef const bool* pointer;
typedef _Bit_const_iterator const_iterator;
 
_Bit_const_iterator() : _Bit_iterator_base(0, 0) {}
_Bit_const_iterator(unsigned int* __x, unsigned int __y)
: _Bit_iterator_base(__x, __y) {}
_Bit_const_iterator(const _Bit_iterator& __x)
: _Bit_iterator_base(__x._M_p, __x._M_offset) {}
 
const_reference operator*() const {
return _Bit_reference(_M_p, 1U << _M_offset);
}
const_iterator& operator++() {
_M_bump_up();
return *this;
}
const_iterator operator++(int) {
const_iterator __tmp = *this;
_M_bump_up();
return __tmp;
}
const_iterator& operator--() {
_M_bump_down();
return *this;
}
const_iterator operator--(int) {
const_iterator __tmp = *this;
_M_bump_down();
return __tmp;
}
const_iterator& operator+=(difference_type __i) {
_M_incr(__i);
return *this;
}
const_iterator& operator-=(difference_type __i) {
*this += -__i;
return *this;
}
const_iterator operator+(difference_type __i) const {
const_iterator __tmp = *this;
return __tmp += __i;
}
const_iterator operator-(difference_type __i) const {
const_iterator __tmp = *this;
return __tmp -= __i;
}
const_reference operator[](difference_type __i) {
return *(*this + __i);
}
};
 
inline _Bit_const_iterator
operator+(ptrdiff_t __n, const _Bit_const_iterator& __x) { return __x + __n; }
 
 
// Bit-vector base class, which encapsulates the difference between
// old SGI-style allocators and standard-conforming allocators.
 
#ifdef __STL_USE_STD_ALLOCATORS
 
// Base class for ordinary allocators.
template <class _Allocator, bool __is_static>
class _Bvector_alloc_base {
public:
typedef typename _Alloc_traits<bool, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return _M_data_allocator; }
 
_Bvector_alloc_base(const allocator_type& __a)
: _M_data_allocator(__a), _M_start(), _M_finish(), _M_end_of_storage(0) {}
 
protected:
unsigned int* _M_bit_alloc(size_t __n)
{ return _M_data_allocator.allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
void _M_deallocate() {
if (_M_start._M_p)
_M_data_allocator.deallocate(_M_start._M_p,
_M_end_of_storage - _M_start._M_p);
}
 
typename _Alloc_traits<unsigned int, _Allocator>::allocator_type
_M_data_allocator;
_Bit_iterator _M_start;
_Bit_iterator _M_finish;
unsigned int* _M_end_of_storage;
};
 
// Specialization for instanceless allocators.
template <class _Allocator>
class _Bvector_alloc_base<_Allocator, true> {
public:
typedef typename _Alloc_traits<bool, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
 
_Bvector_alloc_base(const allocator_type&)
: _M_start(), _M_finish(), _M_end_of_storage(0) {}
 
protected:
typedef typename _Alloc_traits<unsigned int, _Allocator>::_Alloc_type
_Alloc_type;
unsigned int* _M_bit_alloc(size_t __n)
{ return _Alloc_type::allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
void _M_deallocate() {
if (_M_start._M_p)
_Alloc_type::deallocate(_M_start._M_p,
_M_end_of_storage - _M_start._M_p);
}
 
_Bit_iterator _M_start;
_Bit_iterator _M_finish;
unsigned int* _M_end_of_storage;
};
 
template <class _Alloc>
class _Bvector_base
: public _Bvector_alloc_base<_Alloc,
_Alloc_traits<bool, _Alloc>::_S_instanceless>
{
typedef _Bvector_alloc_base<_Alloc,
_Alloc_traits<bool, _Alloc>::_S_instanceless>
_Base;
public:
typedef typename _Base::allocator_type allocator_type;
 
_Bvector_base(const allocator_type& __a) : _Base(__a) {}
~_Bvector_base() { _Base::_M_deallocate(); }
};
 
#else /* __STL_USE_STD_ALLOCATORS */
 
template <class _Alloc>
class _Bvector_base
{
public:
typedef _Alloc allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
 
_Bvector_base(const allocator_type&)
: _M_start(), _M_finish(), _M_end_of_storage(0) {}
~_Bvector_base() { _M_deallocate(); }
 
protected:
typedef simple_alloc<unsigned int, _Alloc> _Alloc_type;
unsigned int* _M_bit_alloc(size_t __n)
{ return _Alloc_type::allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
void _M_deallocate() {
if (_M_start._M_p)
_Alloc_type::deallocate(_M_start._M_p,
_M_end_of_storage - _M_start._M_p);
}
 
_Bit_iterator _M_start;
_Bit_iterator _M_finish;
unsigned int* _M_end_of_storage;
};
 
#endif /* __STL_USE_STD_ALLOCATORS */
 
// The next few lines are confusing. What we're doing is declaring a
// partial specialization of vector<T, Alloc> if we have the necessary
// compiler support. Otherwise, we define a class bit_vector which uses
// the default allocator.
 
#if defined(__STL_CLASS_PARTIAL_SPECIALIZATION) && !defined(__STL_NO_BOOL)
# define __SGI_STL_VECBOOL_TEMPLATE
# define __BVECTOR vector<bool, _Alloc>
# define __VECTOR vector
# define __BVECTOR_BASE _Bvector_base<_Alloc>
# define __BVECTOR_TMPL_LIST template <class _Alloc>
__STL_END_NAMESPACE
# include <bits/stl_vector.h>
__STL_BEGIN_NAMESPACE
#else /* __STL_CLASS_PARTIAL_SPECIALIZATION && !__STL_NO_BOOL */
# undef __SGI_STL_VECBOOL_TEMPLATE
# define __BVECTOR bit_vector
# define __VECTOR bit_vector
# define __BVECTOR_BASE _Bvector_base<__STL_DEFAULT_ALLOCATOR(bool) >
# define __BVECTOR_TMPL_LIST
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION && !__STL_NO_BOOL */
 
 
__BVECTOR_TMPL_LIST
class __BVECTOR : public __BVECTOR_BASE
{
public:
typedef bool value_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Bit_reference reference;
typedef bool const_reference;
typedef _Bit_reference* pointer;
typedef const bool* const_pointer;
 
typedef _Bit_iterator iterator;
typedef _Bit_const_iterator const_iterator;
 
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
typedef reverse_iterator<const_iterator, value_type, const_reference,
difference_type> const_reverse_iterator;
typedef reverse_iterator<iterator, value_type, reference, difference_type>
reverse_iterator;
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
 
typedef typename __BVECTOR_BASE::allocator_type allocator_type;
allocator_type get_allocator() const {
return __BVECTOR_BASE::get_allocator();
}
 
protected:
#ifdef __STL_USE_NAMESPACES
using __BVECTOR_BASE::_M_bit_alloc;
using __BVECTOR_BASE::_M_deallocate;
using __BVECTOR_BASE::_M_start;
using __BVECTOR_BASE::_M_finish;
using __BVECTOR_BASE::_M_end_of_storage;
#endif /* __STL_USE_NAMESPACES */
 
protected:
void _M_initialize(size_type __n) {
unsigned int* __q = _M_bit_alloc(__n);
_M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
_M_finish = _M_start + difference_type(__n);
}
void _M_insert_aux(iterator __position, bool __x) {
if (_M_finish._M_p != _M_end_of_storage) {
copy_backward(__position, _M_finish, _M_finish + 1);
*__position = __x;
++_M_finish;
}
else {
size_type __len = size() ? 2 * size() : __WORD_BIT;
unsigned int* __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
*__i++ = __x;
_M_finish = copy(__position, end(), __i);
_M_deallocate();
_M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
}
}
 
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void _M_initialize_range(_InputIterator __first, _InputIterator __last,
input_iterator_tag) {
_M_start = iterator();
_M_finish = iterator();
_M_end_of_storage = 0;
for ( ; __first != __last; ++__first)
push_back(*__first);
}
 
template <class _ForwardIterator>
void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
size_type __n = 0;
distance(__first, __last, __n);
_M_initialize(__n);
copy(__first, __last, _M_start);
}
 
template <class _InputIterator>
void _M_insert_range(iterator __pos,
_InputIterator __first, _InputIterator __last,
input_iterator_tag) {
for ( ; __first != __last; ++__first) {
__pos = insert(__pos, *__first);
++__pos;
}
}
 
template <class _ForwardIterator>
void _M_insert_range(iterator __position,
_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
if (__first != __last) {
size_type __n = 0;
distance(__first, __last, __n);
if (capacity() - size() >= __n) {
copy_backward(__position, end(), _M_finish + difference_type(__n));
copy(__first, __last, __position);
_M_finish += difference_type(__n);
}
else {
size_type __len = size() + max(size(), __n);
unsigned int* __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
__i = copy(__first, __last, __i);
_M_finish = copy(__position, end(), __i);
_M_deallocate();
_M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
}
}
}
 
#endif /* __STL_MEMBER_TEMPLATES */
 
public:
iterator begin() { return _M_start; }
const_iterator begin() const { return _M_start; }
iterator end() { return _M_finish; }
const_iterator end() const { return _M_finish; }
 
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const {
return const_reverse_iterator(end());
}
reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const {
return const_reverse_iterator(begin());
}
 
size_type size() const { return size_type(end() - begin()); }
size_type max_size() const { return size_type(-1); }
size_type capacity() const {
return size_type(const_iterator(_M_end_of_storage, 0) - begin());
}
bool empty() const { return begin() == end(); }
 
reference operator[](size_type __n)
{ return *(begin() + difference_type(__n)); }
const_reference operator[](size_type __n) const
{ return *(begin() + difference_type(__n)); }
 
#ifdef __STL_THROW_RANGE_ERRORS
void _M_range_check(size_type __n) const {
if (__n >= this->size())
__throw_range_error("vector<bool>");
}
 
reference at(size_type __n)
{ _M_range_check(__n); return (*this)[__n]; }
const_reference at(size_type __n) const
{ _M_range_check(__n); return (*this)[__n]; }
#endif /* __STL_THROW_RANGE_ERRORS */
 
explicit __VECTOR(const allocator_type& __a = allocator_type())
: __BVECTOR_BASE(__a) {}
 
__VECTOR(size_type __n, bool __value,
const allocator_type& __a = allocator_type())
: __BVECTOR_BASE(__a)
{
_M_initialize(__n);
fill(_M_start._M_p, _M_end_of_storage, __value ? ~0 : 0);
}
 
explicit __VECTOR(size_type __n)
: __BVECTOR_BASE(allocator_type())
{
_M_initialize(__n);
fill(_M_start._M_p, _M_end_of_storage, 0);
}
 
__VECTOR(const __VECTOR& __x) : __BVECTOR_BASE(__x.get_allocator()) {
_M_initialize(__x.size());
copy(__x.begin(), __x.end(), _M_start);
}
 
#ifdef __STL_MEMBER_TEMPLATES
 
// Check whether it's an integral type. If so, it's not an iterator.
 
template <class _Integer>
void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) {
_M_initialize(__n);
fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
}
 
template <class _InputIterator>
void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
__false_type) {
_M_initialize_range(__first, __last, __ITERATOR_CATEGORY(__first));
}
 
template <class _InputIterator>
__VECTOR(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type())
: __BVECTOR_BASE(__a)
{
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_initialize_dispatch(__first, __last, _Integral());
}
#else /* __STL_MEMBER_TEMPLATES */
 
__VECTOR(const_iterator __first, const_iterator __last,
const allocator_type& __a = allocator_type())
: __BVECTOR_BASE(__a)
{
size_type __n = 0;
distance(__first, __last, __n);
_M_initialize(__n);
copy(__first, __last, _M_start);
}
__VECTOR(const bool* __first, const bool* __last,
const allocator_type& __a = allocator_type())
: __BVECTOR_BASE(__a)
{
size_type __n = 0;
distance(__first, __last, __n);
_M_initialize(__n);
copy(__first, __last, _M_start);
}
 
#endif /* __STL_MEMBER_TEMPLATES */
 
~__VECTOR() { }
 
__VECTOR& operator=(const __VECTOR& __x) {
if (&__x == this) return *this;
if (__x.size() > capacity()) {
_M_deallocate();
_M_initialize(__x.size());
}
copy(__x.begin(), __x.end(), begin());
_M_finish = begin() + difference_type(__x.size());
return *this;
}
 
// assign(), a generalized assignment member function. Two
// versions: one that takes a count, and one that takes a range.
// The range version is a member template, so we dispatch on whether
// or not the type is an integer.
 
void _M_fill_assign(size_t __n, bool __x) {
if (__n > size()) {
fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
insert(end(), __n - size(), __x);
}
else {
erase(begin() + __n, end());
fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
}
}
 
void assign(size_t __n, bool __x) { _M_fill_assign(__n, __x); }
 
#ifdef __STL_MEMBER_TEMPLATES
 
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
 
template <class _Integer>
void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ _M_fill_assign((size_t) __n, (bool) __val); }
 
template <class _InputIter>
void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type)
{ _M_assign_aux(__first, __last, __ITERATOR_CATEGORY(__first)); }
 
template <class _InputIterator>
void _M_assign_aux(_InputIterator __first, _InputIterator __last,
input_iterator_tag) {
iterator __cur = begin();
for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
*__cur = *__first;
if (__first == __last)
erase(__cur, end());
else
insert(end(), __first, __last);
}
 
template <class _ForwardIterator>
void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
size_type __len = 0;
distance(__first, __last, __len);
if (__len < size())
erase(copy(__first, __last, begin()), end());
else {
_ForwardIterator __mid = __first;
advance(__mid, size());
copy(__first, __mid, begin());
insert(end(), __mid, __last);
}
}
 
#endif /* __STL_MEMBER_TEMPLATES */
 
void reserve(size_type __n) {
if (capacity() < __n) {
unsigned int* __q = _M_bit_alloc(__n);
_M_finish = copy(begin(), end(), iterator(__q, 0));
_M_deallocate();
_M_start = iterator(__q, 0);
_M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT;
}
}
 
reference front() { return *begin(); }
const_reference front() const { return *begin(); }
reference back() { return *(end() - 1); }
const_reference back() const { return *(end() - 1); }
void push_back(bool __x) {
if (_M_finish._M_p != _M_end_of_storage)
*_M_finish++ = __x;
else
_M_insert_aux(end(), __x);
}
void swap(__BVECTOR& __x) {
__STD::swap(_M_start, __x._M_start);
__STD::swap(_M_finish, __x._M_finish);
__STD::swap(_M_end_of_storage, __x._M_end_of_storage);
}
iterator insert(iterator __position, bool __x = bool()) {
difference_type __n = __position - begin();
if (_M_finish._M_p != _M_end_of_storage && __position == end())
*_M_finish++ = __x;
else
_M_insert_aux(__position, __x);
return begin() + __n;
}
 
#ifdef __STL_MEMBER_TEMPLATES
// Check whether it's an integral type. If so, it's not an iterator.
 
template <class _Integer>
void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
__true_type) {
_M_fill_insert(__pos, __n, __x);
}
 
template <class _InputIterator>
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type) {
_M_insert_range(__pos, __first, __last, __ITERATOR_CATEGORY(__first));
}
 
template <class _InputIterator>
void insert(iterator __position,
_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral());
}
 
#else /* __STL_MEMBER_TEMPLATES */
void insert(iterator __position,
const_iterator __first, const_iterator __last) {
if (__first == __last) return;
size_type __n = 0;
distance(__first, __last, __n);
if (capacity() - size() >= __n) {
copy_backward(__position, end(), _M_finish + __n);
copy(__first, __last, __position);
_M_finish += __n;
}
else {
size_type __len = size() + max(size(), __n);
unsigned int* __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
__i = copy(__first, __last, __i);
_M_finish = copy(__position, end(), __i);
_M_deallocate();
_M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
}
}
 
void insert(iterator __position, const bool* __first, const bool* __last) {
if (__first == __last) return;
size_type __n = 0;
distance(__first, __last, __n);
if (capacity() - size() >= __n) {
copy_backward(__position, end(), _M_finish + __n);
copy(__first, __last, __position);
_M_finish += __n;
}
else {
size_type __len = size() + max(size(), __n);
unsigned int* __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
__i = copy(__first, __last, __i);
_M_finish = copy(__position, end(), __i);
_M_deallocate();
_M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
}
}
#endif /* __STL_MEMBER_TEMPLATES */
 
void _M_fill_insert(iterator __position, size_type __n, bool __x) {
if (__n == 0) return;
if (capacity() - size() >= __n) {
copy_backward(__position, end(), _M_finish + difference_type(__n));
fill(__position, __position + difference_type(__n), __x);
_M_finish += difference_type(__n);
}
else {
size_type __len = size() + max(size(), __n);
unsigned int* __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
fill_n(__i, __n, __x);
_M_finish = copy(__position, end(), __i + difference_type(__n));
_M_deallocate();
_M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
}
}
 
void insert(iterator __position, size_type __n, bool __x) {
_M_fill_insert(__position, __n, __x);
}
 
void pop_back() { --_M_finish; }
iterator erase(iterator __position) {
if (__position + 1 != end())
copy(__position + 1, end(), __position);
--_M_finish;
return __position;
}
iterator erase(iterator __first, iterator __last) {
_M_finish = copy(__last, end(), __first);
return __first;
}
void resize(size_type __new_size, bool __x = bool()) {
if (__new_size < size())
erase(begin() + difference_type(__new_size), end());
else
insert(end(), __new_size - size(), __x);
}
void flip() {
for (unsigned int* __p = _M_start._M_p; __p != _M_end_of_storage; ++__p)
*__p = ~*__p;
}
 
void clear() { erase(begin(), end()); }
};
 
#ifdef __SGI_STL_VECBOOL_TEMPLATE
 
// This typedef is non-standard. It is provided for backward compatibility.
typedef vector<bool, alloc> bit_vector;
 
#else /* __SGI_STL_VECBOOL_TEMPLATE */
 
inline void swap(bit_vector& __x, bit_vector& __y) {
__x.swap(__y);
}
 
inline bool
operator==(const bit_vector& __x, const bit_vector& __y)
{
return (__x.size() == __y.size() &&
equal(__x.begin(), __x.end(), __y.begin()));
}
 
inline bool
operator!=(const bit_vector& __x, const bit_vector& __y)
{
return !(__x == __y);
}
 
inline bool
operator<(const bit_vector& __x, const bit_vector& __y)
{
return lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end());
}
 
inline bool operator>(const bit_vector& __x, const bit_vector& __y)
{
return __y < __x;
}
 
inline bool operator<=(const bit_vector& __x, const bit_vector& __y)
{
return !(__y < __x);
}
 
inline bool operator>=(const bit_vector& __x, const bit_vector& __y)
{
return !(__x < __y);
}
 
#endif /* __SGI_STL_VECBOOL_TEMPLATE */
 
#undef __SGI_STL_VECBOOL_TEMPLATE
#undef __BVECTOR
#undef __VECTOR
#undef __BVECTOR_BASE
#undef __BVECTOR_TMPL_LIST
 
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1174
#pragma reset woff 1375
#endif
 
__STL_END_NAMESPACE
 
#endif /* __SGI_STL_INTERNAL_BVECTOR_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/ext/stl_hash_fun.h
0,0 → 1,94
/*
* Copyright (c) 1996-1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef _CPP_BITS_STL_HASH_FUN_H
#define _CPP_BITS_STL_HASH_FUN_H 1
 
#include <bits/std_cstddef.h>
 
namespace std
{
 
template <class _Key> struct hash { };
 
inline size_t __stl_hash_string(const char* __s)
{
unsigned long __h = 0;
for ( ; *__s; ++__s)
__h = 5*__h + *__s;
return size_t(__h);
}
 
template<> struct hash<char*>
{
size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
};
 
template<> struct hash<const char*>
{
size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
};
 
template<> struct hash<char> {
size_t operator()(char __x) const { return __x; }
};
template<> struct hash<unsigned char> {
size_t operator()(unsigned char __x) const { return __x; }
};
template<> struct hash<signed char> {
size_t operator()(unsigned char __x) const { return __x; }
};
template<> struct hash<short> {
size_t operator()(short __x) const { return __x; }
};
template<> struct hash<unsigned short> {
size_t operator()(unsigned short __x) const { return __x; }
};
template<> struct hash<int> {
size_t operator()(int __x) const { return __x; }
};
template<> struct hash<unsigned int> {
size_t operator()(unsigned int __x) const { return __x; }
};
template<> struct hash<long> {
size_t operator()(long __x) const { return __x; }
};
template<> struct hash<unsigned long> {
size_t operator()(unsigned long __x) const { return __x; }
};
 
} // namespace std
 
#endif /* _CPP_BITS_STL_HASH_FUN_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/ext/stl_hashtable.h
0,0 → 1,937
/*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
#ifndef __SGI_STL_INTERNAL_HASHTABLE_H
#define __SGI_STL_INTERNAL_HASHTABLE_H
 
// Hashtable class, used to implement the hashed associative containers
// hash_set, hash_map, hash_multiset, and hash_multimap.
 
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_tempbuf.h>
#include <bits/stl_algo.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_function.h>
#include <bits/stl_vector.h>
#include <ext/stl_hash_fun.h>
 
namespace std
{
 
template <class _Val>
struct _Hashtable_node
{
_Hashtable_node* _M_next;
_Val _M_val;
};
 
template <class _Val, class _Key, class _HashFcn,
class _ExtractKey, class _EqualKey, class _Alloc = alloc>
class hashtable;
 
template <class _Val, class _Key, class _HashFcn,
class _ExtractKey, class _EqualKey, class _Alloc>
struct _Hashtable_iterator;
 
template <class _Val, class _Key, class _HashFcn,
class _ExtractKey, class _EqualKey, class _Alloc>
struct _Hashtable_const_iterator;
 
template <class _Val, class _Key, class _HashFcn,
class _ExtractKey, class _EqualKey, class _Alloc>
struct _Hashtable_iterator {
typedef hashtable<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>
_Hashtable;
typedef _Hashtable_iterator<_Val, _Key, _HashFcn,
_ExtractKey, _EqualKey, _Alloc>
iterator;
typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
_ExtractKey, _EqualKey, _Alloc>
const_iterator;
typedef _Hashtable_node<_Val> _Node;
 
typedef forward_iterator_tag iterator_category;
typedef _Val value_type;
typedef ptrdiff_t difference_type;
typedef size_t size_type;
typedef _Val& reference;
typedef _Val* pointer;
 
_Node* _M_cur;
_Hashtable* _M_ht;
 
_Hashtable_iterator(_Node* __n, _Hashtable* __tab)
: _M_cur(__n), _M_ht(__tab) {}
_Hashtable_iterator() {}
reference operator*() const { return _M_cur->_M_val; }
pointer operator->() const { return &(operator*()); }
iterator& operator++();
iterator operator++(int);
bool operator==(const iterator& __it) const
{ return _M_cur == __it._M_cur; }
bool operator!=(const iterator& __it) const
{ return _M_cur != __it._M_cur; }
};
 
 
template <class _Val, class _Key, class _HashFcn,
class _ExtractKey, class _EqualKey, class _Alloc>
struct _Hashtable_const_iterator {
typedef hashtable<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>
_Hashtable;
typedef _Hashtable_iterator<_Val,_Key,_HashFcn,
_ExtractKey,_EqualKey,_Alloc>
iterator;
typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
_ExtractKey, _EqualKey, _Alloc>
const_iterator;
typedef _Hashtable_node<_Val> _Node;
 
typedef forward_iterator_tag iterator_category;
typedef _Val value_type;
typedef ptrdiff_t difference_type;
typedef size_t size_type;
typedef const _Val& reference;
typedef const _Val* pointer;
 
const _Node* _M_cur;
const _Hashtable* _M_ht;
 
_Hashtable_const_iterator(const _Node* __n, const _Hashtable* __tab)
: _M_cur(__n), _M_ht(__tab) {}
_Hashtable_const_iterator() {}
_Hashtable_const_iterator(const iterator& __it)
: _M_cur(__it._M_cur), _M_ht(__it._M_ht) {}
reference operator*() const { return _M_cur->_M_val; }
pointer operator->() const { return &(operator*()); }
const_iterator& operator++();
const_iterator operator++(int);
bool operator==(const const_iterator& __it) const
{ return _M_cur == __it._M_cur; }
bool operator!=(const const_iterator& __it) const
{ return _M_cur != __it._M_cur; }
};
 
// Note: assumes long is at least 32 bits.
enum { __stl_num_primes = 28 };
 
static const unsigned long __stl_prime_list[__stl_num_primes] =
{
53ul, 97ul, 193ul, 389ul, 769ul,
1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul,
50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
1610612741ul, 3221225473ul, 4294967291ul
};
 
inline unsigned long __stl_next_prime(unsigned long __n)
{
const unsigned long* __first = __stl_prime_list;
const unsigned long* __last = __stl_prime_list + (int)__stl_num_primes;
const unsigned long* pos = lower_bound(__first, __last, __n);
return pos == __last ? *(__last - 1) : *pos;
}
 
// Forward declaration of operator==.
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
class hashtable;
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2);
 
 
// Hashtables handle allocators a bit differently than other containers
// do. If we're using standard-conforming allocators, then a hashtable
// unconditionally has a member variable to hold its allocator, even if
// it so happens that all instances of the allocator type are identical.
// This is because, for hashtables, this extra storage is negligible.
// Additionally, a base class wouldn't serve any other purposes; it
// wouldn't, for example, simplify the exception-handling code.
 
template <class _Val, class _Key, class _HashFcn,
class _ExtractKey, class _EqualKey, class _Alloc>
class hashtable {
public:
typedef _Key key_type;
typedef _Val value_type;
typedef _HashFcn hasher;
typedef _EqualKey key_equal;
 
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
 
hasher hash_funct() const { return _M_hash; }
key_equal key_eq() const { return _M_equals; }
 
private:
typedef _Hashtable_node<_Val> _Node;
 
public:
typedef typename _Alloc_traits<_Val,_Alloc>::allocator_type allocator_type;
allocator_type get_allocator() const { return _M_node_allocator; }
private:
typename _Alloc_traits<_Node, _Alloc>::allocator_type _M_node_allocator;
_Node* _M_get_node() { return _M_node_allocator.allocate(1); }
void _M_put_node(_Node* __p) { _M_node_allocator.deallocate(__p, 1); }
 
private:
hasher _M_hash;
key_equal _M_equals;
_ExtractKey _M_get_key;
vector<_Node*,_Alloc> _M_buckets;
size_type _M_num_elements;
 
public:
typedef _Hashtable_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>
iterator;
typedef _Hashtable_const_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,
_Alloc>
const_iterator;
 
friend struct
_Hashtable_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>;
friend struct
_Hashtable_const_iterator<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>;
 
public:
hashtable(size_type __n,
const _HashFcn& __hf,
const _EqualKey& __eql,
const _ExtractKey& __ext,
const allocator_type& __a = allocator_type())
: _M_node_allocator(__a),
_M_hash(__hf),
_M_equals(__eql),
_M_get_key(__ext),
_M_buckets(__a),
_M_num_elements(0)
{
_M_initialize_buckets(__n);
}
 
hashtable(size_type __n,
const _HashFcn& __hf,
const _EqualKey& __eql,
const allocator_type& __a = allocator_type())
: _M_node_allocator(__a),
_M_hash(__hf),
_M_equals(__eql),
_M_get_key(_ExtractKey()),
_M_buckets(__a),
_M_num_elements(0)
{
_M_initialize_buckets(__n);
}
 
hashtable(const hashtable& __ht)
: _M_node_allocator(__ht.get_allocator()),
_M_hash(__ht._M_hash),
_M_equals(__ht._M_equals),
_M_get_key(__ht._M_get_key),
_M_buckets(__ht.get_allocator()),
_M_num_elements(0)
{
_M_copy_from(__ht);
}
 
hashtable& operator= (const hashtable& __ht)
{
if (&__ht != this) {
clear();
_M_hash = __ht._M_hash;
_M_equals = __ht._M_equals;
_M_get_key = __ht._M_get_key;
_M_copy_from(__ht);
}
return *this;
}
 
~hashtable() { clear(); }
 
size_type size() const { return _M_num_elements; }
size_type max_size() const { return size_type(-1); }
bool empty() const { return size() == 0; }
 
void swap(hashtable& __ht)
{
std::swap(_M_hash, __ht._M_hash);
std::swap(_M_equals, __ht._M_equals);
std::swap(_M_get_key, __ht._M_get_key);
_M_buckets.swap(__ht._M_buckets);
std::swap(_M_num_elements, __ht._M_num_elements);
}
 
iterator begin()
{
for (size_type __n = 0; __n < _M_buckets.size(); ++__n)
if (_M_buckets[__n])
return iterator(_M_buckets[__n], this);
return end();
}
 
iterator end() { return iterator(0, this); }
 
const_iterator begin() const
{
for (size_type __n = 0; __n < _M_buckets.size(); ++__n)
if (_M_buckets[__n])
return const_iterator(_M_buckets[__n], this);
return end();
}
 
const_iterator end() const { return const_iterator(0, this); }
 
template <class _Vl, class _Ky, class _HF, class _Ex, class _Eq, class _Al>
friend bool operator== (const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&,
const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&);
public:
 
size_type bucket_count() const { return _M_buckets.size(); }
 
size_type max_bucket_count() const
{ return __stl_prime_list[(int)__stl_num_primes - 1]; }
 
size_type elems_in_bucket(size_type __bucket) const
{
size_type __result = 0;
for (_Node* __cur = _M_buckets[__bucket]; __cur; __cur = __cur->_M_next)
__result += 1;
return __result;
}
 
pair<iterator, bool> insert_unique(const value_type& __obj)
{
resize(_M_num_elements + 1);
return insert_unique_noresize(__obj);
}
 
iterator insert_equal(const value_type& __obj)
{
resize(_M_num_elements + 1);
return insert_equal_noresize(__obj);
}
 
pair<iterator, bool> insert_unique_noresize(const value_type& __obj);
iterator insert_equal_noresize(const value_type& __obj);
template <class _InputIterator>
void insert_unique(_InputIterator __f, _InputIterator __l)
{
insert_unique(__f, __l, __iterator_category(__f));
}
 
template <class _InputIterator>
void insert_equal(_InputIterator __f, _InputIterator __l)
{
insert_equal(__f, __l, __iterator_category(__f));
}
 
template <class _InputIterator>
void insert_unique(_InputIterator __f, _InputIterator __l,
input_iterator_tag)
{
for ( ; __f != __l; ++__f)
insert_unique(*__f);
}
 
template <class _InputIterator>
void insert_equal(_InputIterator __f, _InputIterator __l,
input_iterator_tag)
{
for ( ; __f != __l; ++__f)
insert_equal(*__f);
}
 
template <class _ForwardIterator>
void insert_unique(_ForwardIterator __f, _ForwardIterator __l,
forward_iterator_tag)
{
size_type __n = 0;
distance(__f, __l, __n);
resize(_M_num_elements + __n);
for ( ; __n > 0; --__n, ++__f)
insert_unique_noresize(*__f);
}
 
template <class _ForwardIterator>
void insert_equal(_ForwardIterator __f, _ForwardIterator __l,
forward_iterator_tag)
{
size_type __n = 0;
distance(__f, __l, __n);
resize(_M_num_elements + __n);
for ( ; __n > 0; --__n, ++__f)
insert_equal_noresize(*__f);
}
 
reference find_or_insert(const value_type& __obj);
 
iterator find(const key_type& __key)
{
size_type __n = _M_bkt_num_key(__key);
_Node* __first;
for ( __first = _M_buckets[__n];
__first && !_M_equals(_M_get_key(__first->_M_val), __key);
__first = __first->_M_next)
{}
return iterator(__first, this);
}
 
const_iterator find(const key_type& __key) const
{
size_type __n = _M_bkt_num_key(__key);
const _Node* __first;
for ( __first = _M_buckets[__n];
__first && !_M_equals(_M_get_key(__first->_M_val), __key);
__first = __first->_M_next)
{}
return const_iterator(__first, this);
}
 
size_type count(const key_type& __key) const
{
const size_type __n = _M_bkt_num_key(__key);
size_type __result = 0;
 
for (const _Node* __cur = _M_buckets[__n]; __cur; __cur = __cur->_M_next)
if (_M_equals(_M_get_key(__cur->_M_val), __key))
++__result;
return __result;
}
 
pair<iterator, iterator>
equal_range(const key_type& __key);
 
pair<const_iterator, const_iterator>
equal_range(const key_type& __key) const;
 
size_type erase(const key_type& __key);
void erase(const iterator& __it);
void erase(iterator __first, iterator __last);
 
void erase(const const_iterator& __it);
void erase(const_iterator __first, const_iterator __last);
 
void resize(size_type __num_elements_hint);
void clear();
 
private:
size_type _M_next_size(size_type __n) const
{ return __stl_next_prime(__n); }
 
void _M_initialize_buckets(size_type __n)
{
const size_type __n_buckets = _M_next_size(__n);
_M_buckets.reserve(__n_buckets);
_M_buckets.insert(_M_buckets.end(), __n_buckets, (_Node*) 0);
_M_num_elements = 0;
}
 
size_type _M_bkt_num_key(const key_type& __key) const
{
return _M_bkt_num_key(__key, _M_buckets.size());
}
 
size_type _M_bkt_num(const value_type& __obj) const
{
return _M_bkt_num_key(_M_get_key(__obj));
}
 
size_type _M_bkt_num_key(const key_type& __key, size_t __n) const
{
return _M_hash(__key) % __n;
}
 
size_type _M_bkt_num(const value_type& __obj, size_t __n) const
{
return _M_bkt_num_key(_M_get_key(__obj), __n);
}
 
_Node* _M_new_node(const value_type& __obj)
{
_Node* __n = _M_get_node();
__n->_M_next = 0;
__STL_TRY {
construct(&__n->_M_val, __obj);
return __n;
}
__STL_UNWIND(_M_put_node(__n));
}
void _M_delete_node(_Node* __n)
{
destroy(&__n->_M_val);
_M_put_node(__n);
}
 
void _M_erase_bucket(const size_type __n, _Node* __first, _Node* __last);
void _M_erase_bucket(const size_type __n, _Node* __last);
 
void _M_copy_from(const hashtable& __ht);
 
};
 
template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
class _All>
_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&
_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++()
{
const _Node* __old = _M_cur;
_M_cur = _M_cur->_M_next;
if (!_M_cur) {
size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val);
while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size())
_M_cur = _M_ht->_M_buckets[__bucket];
}
return *this;
}
 
template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
class _All>
inline _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>
_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++(int)
{
iterator __tmp = *this;
++*this;
return __tmp;
}
 
template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
class _All>
_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&
_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++()
{
const _Node* __old = _M_cur;
_M_cur = _M_cur->_M_next;
if (!_M_cur) {
size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val);
while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size())
_M_cur = _M_ht->_M_buckets[__bucket];
}
return *this;
}
 
template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
class _All>
inline _Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>
_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++(int)
{
const_iterator __tmp = *this;
++*this;
return __tmp;
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2)
{
typedef typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::_Node _Node;
if (__ht1._M_buckets.size() != __ht2._M_buckets.size())
return false;
for (size_t __n = 0; __n < __ht1._M_buckets.size(); ++__n) {
_Node* __cur1 = __ht1._M_buckets[__n];
_Node* __cur2 = __ht2._M_buckets[__n];
for ( ; __cur1 && __cur2 && __cur1->_M_val == __cur2->_M_val;
__cur1 = __cur1->_M_next, __cur2 = __cur2->_M_next)
{}
if (__cur1 || __cur2)
return false;
}
return true;
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
inline bool operator!=(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2) {
return !(__ht1 == __ht2);
}
 
template <class _Val, class _Key, class _HF, class _Extract, class _EqKey,
class _All>
inline void swap(hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht1,
hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht2) {
__ht1.swap(__ht2);
}
 
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator, bool>
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::insert_unique_noresize(const value_type& __obj)
{
const size_type __n = _M_bkt_num(__obj);
_Node* __first = _M_buckets[__n];
 
for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
return pair<iterator, bool>(iterator(__cur, this), false);
 
_Node* __tmp = _M_new_node(__obj);
__tmp->_M_next = __first;
_M_buckets[__n] = __tmp;
++_M_num_elements;
return pair<iterator, bool>(iterator(__tmp, this), true);
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::insert_equal_noresize(const value_type& __obj)
{
const size_type __n = _M_bkt_num(__obj);
_Node* __first = _M_buckets[__n];
 
for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj))) {
_Node* __tmp = _M_new_node(__obj);
__tmp->_M_next = __cur->_M_next;
__cur->_M_next = __tmp;
++_M_num_elements;
return iterator(__tmp, this);
}
 
_Node* __tmp = _M_new_node(__obj);
__tmp->_M_next = __first;
_M_buckets[__n] = __tmp;
++_M_num_elements;
return iterator(__tmp, this);
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::reference
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::find_or_insert(const value_type& __obj)
{
resize(_M_num_elements + 1);
 
size_type __n = _M_bkt_num(__obj);
_Node* __first = _M_buckets[__n];
 
for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
return __cur->_M_val;
 
_Node* __tmp = _M_new_node(__obj);
__tmp->_M_next = __first;
_M_buckets[__n] = __tmp;
++_M_num_elements;
return __tmp->_M_val;
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator,
typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator>
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::equal_range(const key_type& __key)
{
typedef pair<iterator, iterator> _Pii;
const size_type __n = _M_bkt_num_key(__key);
 
for (_Node* __first = _M_buckets[__n]; __first; __first = __first->_M_next)
if (_M_equals(_M_get_key(__first->_M_val), __key)) {
for (_Node* __cur = __first->_M_next; __cur; __cur = __cur->_M_next)
if (!_M_equals(_M_get_key(__cur->_M_val), __key))
return _Pii(iterator(__first, this), iterator(__cur, this));
for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
if (_M_buckets[__m])
return _Pii(iterator(__first, this),
iterator(_M_buckets[__m], this));
return _Pii(iterator(__first, this), end());
}
return _Pii(end(), end());
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator,
typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator>
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::equal_range(const key_type& __key) const
{
typedef pair<const_iterator, const_iterator> _Pii;
const size_type __n = _M_bkt_num_key(__key);
 
for (const _Node* __first = _M_buckets[__n] ;
__first;
__first = __first->_M_next) {
if (_M_equals(_M_get_key(__first->_M_val), __key)) {
for (const _Node* __cur = __first->_M_next;
__cur;
__cur = __cur->_M_next)
if (!_M_equals(_M_get_key(__cur->_M_val), __key))
return _Pii(const_iterator(__first, this),
const_iterator(__cur, this));
for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
if (_M_buckets[__m])
return _Pii(const_iterator(__first, this),
const_iterator(_M_buckets[__m], this));
return _Pii(const_iterator(__first, this), end());
}
}
return _Pii(end(), end());
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::size_type
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const key_type& __key)
{
const size_type __n = _M_bkt_num_key(__key);
_Node* __first = _M_buckets[__n];
size_type __erased = 0;
 
if (__first) {
_Node* __cur = __first;
_Node* __next = __cur->_M_next;
while (__next) {
if (_M_equals(_M_get_key(__next->_M_val), __key)) {
__cur->_M_next = __next->_M_next;
_M_delete_node(__next);
__next = __cur->_M_next;
++__erased;
--_M_num_elements;
}
else {
__cur = __next;
__next = __cur->_M_next;
}
}
if (_M_equals(_M_get_key(__first->_M_val), __key)) {
_M_buckets[__n] = __first->_M_next;
_M_delete_node(__first);
++__erased;
--_M_num_elements;
}
}
return __erased;
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const iterator& __it)
{
_Node* __p = __it._M_cur;
if (__p) {
const size_type __n = _M_bkt_num(__p->_M_val);
_Node* __cur = _M_buckets[__n];
 
if (__cur == __p) {
_M_buckets[__n] = __cur->_M_next;
_M_delete_node(__cur);
--_M_num_elements;
}
else {
_Node* __next = __cur->_M_next;
while (__next) {
if (__next == __p) {
__cur->_M_next = __next->_M_next;
_M_delete_node(__next);
--_M_num_elements;
break;
}
else {
__cur = __next;
__next = __cur->_M_next;
}
}
}
}
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::erase(iterator __first, iterator __last)
{
size_type __f_bucket = __first._M_cur ?
_M_bkt_num(__first._M_cur->_M_val) : _M_buckets.size();
size_type __l_bucket = __last._M_cur ?
_M_bkt_num(__last._M_cur->_M_val) : _M_buckets.size();
 
if (__first._M_cur == __last._M_cur)
return;
else if (__f_bucket == __l_bucket)
_M_erase_bucket(__f_bucket, __first._M_cur, __last._M_cur);
else {
_M_erase_bucket(__f_bucket, __first._M_cur, 0);
for (size_type __n = __f_bucket + 1; __n < __l_bucket; ++__n)
_M_erase_bucket(__n, 0);
if (__l_bucket != _M_buckets.size())
_M_erase_bucket(__l_bucket, __last._M_cur);
}
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
inline void
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const_iterator __first,
const_iterator __last)
{
erase(iterator(const_cast<_Node*>(__first._M_cur),
const_cast<hashtable*>(__first._M_ht)),
iterator(const_cast<_Node*>(__last._M_cur),
const_cast<hashtable*>(__last._M_ht)));
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
inline void
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const const_iterator& __it)
{
erase(iterator(const_cast<_Node*>(__it._M_cur),
const_cast<hashtable*>(__it._M_ht)));
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::resize(size_type __num_elements_hint)
{
const size_type __old_n = _M_buckets.size();
if (__num_elements_hint > __old_n) {
const size_type __n = _M_next_size(__num_elements_hint);
if (__n > __old_n) {
vector<_Node*, _All> __tmp(__n, (_Node*)(0),
_M_buckets.get_allocator());
__STL_TRY {
for (size_type __bucket = 0; __bucket < __old_n; ++__bucket) {
_Node* __first = _M_buckets[__bucket];
while (__first) {
size_type __new_bucket = _M_bkt_num(__first->_M_val, __n);
_M_buckets[__bucket] = __first->_M_next;
__first->_M_next = __tmp[__new_bucket];
__tmp[__new_bucket] = __first;
__first = _M_buckets[__bucket];
}
}
_M_buckets.swap(__tmp);
}
# ifdef __STL_USE_EXCEPTIONS
catch(...) {
for (size_type __bucket = 0; __bucket < __tmp.size(); ++__bucket) {
while (__tmp[__bucket]) {
_Node* __next = __tmp[__bucket]->_M_next;
_M_delete_node(__tmp[__bucket]);
__tmp[__bucket] = __next;
}
}
throw;
}
# endif /* __STL_USE_EXCEPTIONS */
}
}
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::_M_erase_bucket(const size_type __n, _Node* __first, _Node* __last)
{
_Node* __cur = _M_buckets[__n];
if (__cur == __first)
_M_erase_bucket(__n, __last);
else {
_Node* __next;
for (__next = __cur->_M_next;
__next != __first;
__cur = __next, __next = __cur->_M_next)
;
while (__next != __last) {
__cur->_M_next = __next->_M_next;
_M_delete_node(__next);
__next = __cur->_M_next;
--_M_num_elements;
}
}
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::_M_erase_bucket(const size_type __n, _Node* __last)
{
_Node* __cur = _M_buckets[__n];
while (__cur != __last) {
_Node* __next = __cur->_M_next;
_M_delete_node(__cur);
__cur = __next;
_M_buckets[__n] = __cur;
--_M_num_elements;
}
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::clear()
{
for (size_type __i = 0; __i < _M_buckets.size(); ++__i) {
_Node* __cur = _M_buckets[__i];
while (__cur != 0) {
_Node* __next = __cur->_M_next;
_M_delete_node(__cur);
__cur = __next;
}
_M_buckets[__i] = 0;
}
_M_num_elements = 0;
}
 
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::_M_copy_from(const hashtable& __ht)
{
_M_buckets.clear();
_M_buckets.reserve(__ht._M_buckets.size());
_M_buckets.insert(_M_buckets.end(), __ht._M_buckets.size(), (_Node*) 0);
__STL_TRY {
for (size_type __i = 0; __i < __ht._M_buckets.size(); ++__i) {
const _Node* __cur = __ht._M_buckets[__i];
if (__cur) {
_Node* __local_copy = _M_new_node(__cur->_M_val);
_M_buckets[__i] = __local_copy;
 
for (_Node* __next = __cur->_M_next;
__next;
__cur = __next, __next = __cur->_M_next) {
__local_copy->_M_next = _M_new_node(__next->_M_val);
__local_copy = __local_copy->_M_next;
}
}
}
_M_num_elements = __ht._M_num_elements;
}
__STL_UNWIND(clear());
}
 
} // namespace std
 
#endif /* __SGI_STL_INTERNAL_HASHTABLE_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/ext/stl_rope.h
0,0 → 1,2459
/*
* Copyright (c) 1997-1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
 
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
 
// rope<_CharT,_Alloc> is a sequence of _CharT.
// Ropes appear to be mutable, but update operations
// really copy enough of the data structure to leave the original
// valid. Thus ropes can be logically copied by just copying
// a pointer value.
 
#ifndef __SGI_STL_INTERNAL_ROPE_H
# define __SGI_STL_INTERNAL_ROPE_H
 
# ifdef __GC
# define __GC_CONST const
# else
# include <bits/stl_threads.h>
# define __GC_CONST // constant except for deallocation
# endif
# ifdef __STL_SGI_THREADS
# include <mutex.h>
# endif
 
namespace std
{
 
// The _S_eos function is used for those functions that
// convert to/from C-like strings to detect the end of the string.
 
// The end-of-C-string character.
// This is what the draft standard says it should be.
template <class _CharT>
inline _CharT _S_eos(_CharT*) { return _CharT(); }
 
// Test for basic character types.
// For basic character types leaves having a trailing eos.
template <class _CharT>
inline bool _S_is_basic_char_type(_CharT*) { return false; }
template <class _CharT>
inline bool _S_is_one_byte_char_type(_CharT*) { return false; }
 
inline bool _S_is_basic_char_type(char*) { return true; }
inline bool _S_is_one_byte_char_type(char*) { return true; }
inline bool _S_is_basic_char_type(wchar_t*) { return true; }
 
// Store an eos iff _CharT is a basic character type.
// Do not reference _S_eos if it isn't.
template <class _CharT>
inline void _S_cond_store_eos(_CharT&) {}
 
inline void _S_cond_store_eos(char& __c) { __c = 0; }
inline void _S_cond_store_eos(wchar_t& __c) { __c = 0; }
 
// char_producers are logically functions that generate a section of
// a string. These can be convereted to ropes. The resulting rope
// invokes the char_producer on demand. This allows, for example,
// files to be viewed as ropes without reading the entire file.
template <class _CharT>
class char_producer {
public:
virtual ~char_producer() {};
virtual void operator()(size_t __start_pos, size_t __len,
_CharT* __buffer) = 0;
// Buffer should really be an arbitrary output iterator.
// That way we could flatten directly into an ostream, etc.
// This is thoroughly impossible, since iterator types don't
// have runtime descriptions.
};
 
// Sequence buffers:
//
// Sequence must provide an append operation that appends an
// array to the sequence. Sequence buffers are useful only if
// appending an entire array is cheaper than appending element by element.
// This is true for many string representations.
// This should perhaps inherit from ostream<sequence::value_type>
// and be implemented correspondingly, so that they can be used
// for formatted. For the sake of portability, we don't do this yet.
//
// For now, sequence buffers behave as output iterators. But they also
// behave a little like basic_ostringstream<sequence::value_type> and a
// little like containers.
 
template<class _Sequence, size_t _Buf_sz = 100>
class sequence_buffer : public output_iterator {
public:
typedef typename _Sequence::value_type value_type;
protected:
_Sequence* _M_prefix;
value_type _M_buffer[_Buf_sz];
size_t _M_buf_count;
public:
void flush() {
_M_prefix->append(_M_buffer, _M_buffer + _M_buf_count);
_M_buf_count = 0;
}
~sequence_buffer() { flush(); }
sequence_buffer() : _M_prefix(0), _M_buf_count(0) {}
sequence_buffer(const sequence_buffer& __x) {
_M_prefix = __x._M_prefix;
_M_buf_count = __x._M_buf_count;
copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
}
sequence_buffer(sequence_buffer& __x) {
__x.flush();
_M_prefix = __x._M_prefix;
_M_buf_count = 0;
}
sequence_buffer(_Sequence& __s) : _M_prefix(&__s), _M_buf_count(0) {}
sequence_buffer& operator= (sequence_buffer& __x) {
__x.flush();
_M_prefix = __x._M_prefix;
_M_buf_count = 0;
return *this;
}
sequence_buffer& operator= (const sequence_buffer& __x) {
_M_prefix = __x._M_prefix;
_M_buf_count = __x._M_buf_count;
copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
return *this;
}
void push_back(value_type __x)
{
if (_M_buf_count < _Buf_sz) {
_M_buffer[_M_buf_count] = __x;
++_M_buf_count;
} else {
flush();
_M_buffer[0] = __x;
_M_buf_count = 1;
}
}
void append(value_type* __s, size_t __len)
{
if (__len + _M_buf_count <= _Buf_sz) {
size_t __i = _M_buf_count;
size_t __j = 0;
for (; __j < __len; __i++, __j++) {
_M_buffer[__i] = __s[__j];
}
_M_buf_count += __len;
} else if (0 == _M_buf_count) {
_M_prefix->append(__s, __s + __len);
} else {
flush();
append(__s, __len);
}
}
sequence_buffer& write(value_type* __s, size_t __len)
{
append(__s, __len);
return *this;
}
sequence_buffer& put(value_type __x)
{
push_back(__x);
return *this;
}
sequence_buffer& operator=(const value_type& __rhs)
{
push_back(__rhs);
return *this;
}
sequence_buffer& operator*() { return *this; }
sequence_buffer& operator++() { return *this; }
sequence_buffer& operator++(int) { return *this; }
};
 
// The following should be treated as private, at least for now.
template<class _CharT>
class _Rope_char_consumer {
public:
// If we had member templates, these should not be virtual.
// For now we need to use run-time parametrization where
// compile-time would do. Hence this should all be private
// for now.
// The symmetry with char_producer is accidental and temporary.
virtual ~_Rope_char_consumer() {};
virtual bool operator()(const _CharT* __buffer, size_t __len) = 0;
};
 
// First a lot of forward declarations. The standard seems to require
// much stricter "declaration before use" than many of the implementations
// that preceded it.
template<class _CharT, class _Alloc=allocator<_CharT> > class rope;
template<class _CharT, class _Alloc> struct _Rope_RopeConcatenation;
template<class _CharT, class _Alloc> struct _Rope_RopeLeaf;
template<class _CharT, class _Alloc> struct _Rope_RopeFunction;
template<class _CharT, class _Alloc> struct _Rope_RopeSubstring;
template<class _CharT, class _Alloc> class _Rope_iterator;
template<class _CharT, class _Alloc> class _Rope_const_iterator;
template<class _CharT, class _Alloc> class _Rope_char_ref_proxy;
template<class _CharT, class _Alloc> class _Rope_char_ptr_proxy;
 
template<class _CharT, class _Alloc>
bool operator== (const _Rope_char_ptr_proxy<_CharT,_Alloc>& __x,
const _Rope_char_ptr_proxy<_CharT,_Alloc>& __y);
 
template<class _CharT, class _Alloc>
_Rope_const_iterator<_CharT,_Alloc> operator-
(const _Rope_const_iterator<_CharT,_Alloc>& __x,
ptrdiff_t __n);
 
template<class _CharT, class _Alloc>
_Rope_const_iterator<_CharT,_Alloc> operator+
(const _Rope_const_iterator<_CharT,_Alloc>& __x,
ptrdiff_t __n);
 
template<class _CharT, class _Alloc>
_Rope_const_iterator<_CharT,_Alloc> operator+
(ptrdiff_t __n,
const _Rope_const_iterator<_CharT,_Alloc>& __x);
 
template<class _CharT, class _Alloc>
bool operator==
(const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y);
 
template<class _CharT, class _Alloc>
bool operator<
(const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y);
 
template<class _CharT, class _Alloc>
ptrdiff_t operator-
(const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y);
 
template<class _CharT, class _Alloc>
_Rope_iterator<_CharT,_Alloc> operator-
(const _Rope_iterator<_CharT,_Alloc>& __x,
ptrdiff_t __n);
 
template<class _CharT, class _Alloc>
_Rope_iterator<_CharT,_Alloc> operator+
(const _Rope_iterator<_CharT,_Alloc>& __x,
ptrdiff_t __n);
 
template<class _CharT, class _Alloc>
_Rope_iterator<_CharT,_Alloc> operator+
(ptrdiff_t __n,
const _Rope_iterator<_CharT,_Alloc>& __x);
 
template<class _CharT, class _Alloc>
bool operator==
(const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y);
 
template<class _CharT, class _Alloc>
bool operator<
(const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y);
 
template<class _CharT, class _Alloc>
ptrdiff_t operator-
(const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y);
 
template<class _CharT, class _Alloc>
rope<_CharT,_Alloc> operator+ (const rope<_CharT,_Alloc>& __left,
const rope<_CharT,_Alloc>& __right);
template<class _CharT, class _Alloc>
rope<_CharT,_Alloc> operator+ (const rope<_CharT,_Alloc>& __left,
const _CharT* __right);
template<class _CharT, class _Alloc>
rope<_CharT,_Alloc> operator+ (const rope<_CharT,_Alloc>& __left,
_CharT __right);
// Some helpers, so we can use power on ropes.
// See below for why this isn't local to the implementation.
 
// This uses a nonstandard refcount convention.
// The result has refcount 0.
template<class _CharT, class _Alloc>
struct _Rope_Concat_fn
: public binary_function<rope<_CharT,_Alloc>, rope<_CharT,_Alloc>,
rope<_CharT,_Alloc> > {
rope<_CharT,_Alloc> operator() (const rope<_CharT,_Alloc>& __x,
const rope<_CharT,_Alloc>& __y) {
return __x + __y;
}
};
 
template <class _CharT, class _Alloc>
inline
rope<_CharT,_Alloc>
identity_element(_Rope_Concat_fn<_CharT, _Alloc>)
{
return rope<_CharT,_Alloc>();
}
 
 
//
// What follows should really be local to rope. Unfortunately,
// that doesn't work, since it makes it impossible to define generic
// equality on rope iterators. According to the draft standard, the
// template parameters for such an equality operator cannot be inferred
// from the occurence of a member class as a parameter.
// (SGI compilers in fact allow this, but the __result wouldn't be
// portable.)
// Similarly, some of the static member functions are member functions
// only to avoid polluting the global namespace, and to circumvent
// restrictions on type inference for template functions.
//
 
//
// The internal data structure for representing a rope. This is
// private to the implementation. A rope is really just a pointer
// to one of these.
//
// A few basic functions for manipulating this data structure
// are members of _RopeRep. Most of the more complex algorithms
// are implemented as rope members.
//
// Some of the static member functions of _RopeRep have identically
// named functions in rope that simply invoke the _RopeRep versions.
//
// A macro to introduce various allocation and deallocation functions
// These need to be defined differently depending on whether or not
// we are using standard conforming allocators, and whether the allocator
// instances have real state. Thus this macro is invoked repeatedly
// with different definitions of __ROPE_DEFINE_ALLOC.
// __ROPE_DEFINE_ALLOC(type,name) defines
// type * name_allocate(size_t) and
// void name_deallocate(tipe *, size_t)
// Both functions may or may not be static.
 
#define __ROPE_DEFINE_ALLOCS(__a) \
__ROPE_DEFINE_ALLOC(_CharT,_Data) /* character data */ \
typedef _Rope_RopeConcatenation<_CharT,__a> __C; \
__ROPE_DEFINE_ALLOC(__C,_C) \
typedef _Rope_RopeLeaf<_CharT,__a> __L; \
__ROPE_DEFINE_ALLOC(__L,_L) \
typedef _Rope_RopeFunction<_CharT,__a> __F; \
__ROPE_DEFINE_ALLOC(__F,_F) \
typedef _Rope_RopeSubstring<_CharT,__a> __S; \
__ROPE_DEFINE_ALLOC(__S,_S)
 
// Internal rope nodes potentially store a copy of the allocator
// instance used to allocate them. This is mostly redundant.
// But the alternative would be to pass allocator instances around
// in some form to nearly all internal functions, since any pointer
// assignment may result in a zero reference count and thus require
// deallocation.
// The _Rope_rep_base class encapsulates
// the differences between SGI-style allocators and standard-conforming
// allocators.
 
#define __STATIC_IF_SGI_ALLOC /* not static */
 
// Base class for ordinary allocators.
template <class _CharT, class _Allocator, bool _IsStatic>
class _Rope_rep_alloc_base {
public:
typedef typename _Alloc_traits<_CharT,_Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return _M_data_allocator; }
_Rope_rep_alloc_base(size_t __size, const allocator_type& __a)
: _M_size(__size), _M_data_allocator(__a) {}
size_t _M_size; // This is here only to avoid wasting space
// for an otherwise empty base class.
 
protected:
allocator_type _M_data_allocator;
 
# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
typedef typename \
_Alloc_traits<_Tp,_Allocator>::allocator_type __name##Allocator; \
/*static*/ _Tp * __name##_allocate(size_t __n) \
{ return __name##Allocator(_M_data_allocator).allocate(__n); } \
void __name##_deallocate(_Tp* __p, size_t __n) \
{ __name##Allocator(_M_data_allocator).deallocate(__p, __n); }
__ROPE_DEFINE_ALLOCS(_Allocator);
# undef __ROPE_DEFINE_ALLOC
};
 
// Specialization for allocators that have the property that we don't
// actually have to store an allocator object.
template <class _CharT, class _Allocator>
class _Rope_rep_alloc_base<_CharT,_Allocator,true> {
public:
typedef typename _Alloc_traits<_CharT,_Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
_Rope_rep_alloc_base(size_t __size, const allocator_type&)
: _M_size(__size) {}
size_t _M_size;
protected:
 
# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
typedef typename \
_Alloc_traits<_Tp,_Allocator>::_Alloc_type __name##Alloc; \
typedef typename \
_Alloc_traits<_Tp,_Allocator>::allocator_type __name##Allocator; \
static _Tp* __name##_allocate(size_t __n) \
{ return __name##Alloc::allocate(__n); } \
void __name##_deallocate(_Tp *__p, size_t __n) \
{ __name##Alloc::deallocate(__p, __n); }
__ROPE_DEFINE_ALLOCS(_Allocator);
# undef __ROPE_DEFINE_ALLOC
};
 
template <class _CharT, class _Alloc>
struct _Rope_rep_base
: public _Rope_rep_alloc_base<_CharT,_Alloc,
_Alloc_traits<_CharT,_Alloc>::_S_instanceless>
{
typedef _Rope_rep_alloc_base<_CharT,_Alloc,
_Alloc_traits<_CharT,_Alloc>::_S_instanceless>
_Base;
typedef typename _Base::allocator_type allocator_type;
_Rope_rep_base(size_t __size, const allocator_type& __a)
: _Base(__size, __a) {}
};
 
 
template<class _CharT, class _Alloc>
struct _Rope_RopeRep : public _Rope_rep_base<_CharT,_Alloc>
# ifndef __GC
, _Refcount_Base
# endif
{
public:
enum { _S_max_rope_depth = 45 };
enum _Tag {_S_leaf, _S_concat, _S_substringfn, _S_function};
_Tag _M_tag:8;
bool _M_is_balanced:8;
unsigned char _M_depth;
__GC_CONST _CharT* _M_c_string;
/* Flattened version of string, if needed. */
/* typically 0. */
/* If it's not 0, then the memory is owned */
/* by this node. */
/* In the case of a leaf, this may point to */
/* the same memory as the data field. */
typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type
allocator_type;
_Rope_RopeRep(_Tag __t, int __d, bool __b, size_t __size,
allocator_type __a)
: _Rope_rep_base<_CharT,_Alloc>(__size, __a),
# ifndef __GC
_Refcount_Base(1),
# endif
_M_tag(__t), _M_is_balanced(__b), _M_depth(__d), _M_c_string(0)
{ }
# ifdef __GC
void _M_incr () {}
# endif
static void _S_free_string(__GC_CONST _CharT*, size_t __len,
allocator_type __a);
# define __STL_FREE_STRING(__s, __l, __a) _S_free_string(__s, __l, __a);
// Deallocate data section of a leaf.
// This shouldn't be a member function.
// But its hard to do anything else at the
// moment, because it's templatized w.r.t.
// an allocator.
// Does nothing if __GC is defined.
# ifndef __GC
void _M_free_c_string();
void _M_free_tree();
// Deallocate t. Assumes t is not 0.
void _M_unref_nonnil()
{
if (0 == _M_decr()) _M_free_tree();
}
void _M_ref_nonnil()
{
_M_incr();
}
static void _S_unref(_Rope_RopeRep* __t)
{
if (0 != __t) {
__t->_M_unref_nonnil();
}
}
static void _S_ref(_Rope_RopeRep* __t)
{
if (0 != __t) __t->_M_incr();
}
static void _S_free_if_unref(_Rope_RopeRep* __t)
{
if (0 != __t && 0 == __t->_M_ref_count) __t->_M_free_tree();
}
# else /* __GC */
void _M_unref_nonnil() {}
void _M_ref_nonnil() {}
static void _S_unref(_Rope_RopeRep*) {}
static void _S_ref(_Rope_RopeRep*) {}
static void _S_free_if_unref(_Rope_RopeRep*) {}
# endif
 
};
 
template<class _CharT, class _Alloc>
struct _Rope_RopeLeaf : public _Rope_RopeRep<_CharT,_Alloc> {
public:
// Apparently needed by VC++
// The data fields of leaves are allocated with some
// extra space, to accomodate future growth and for basic
// character types, to hold a trailing eos character.
enum { _S_alloc_granularity = 8 };
static size_t _S_rounded_up_size(size_t __n) {
size_t __size_with_eos;
if (_S_is_basic_char_type((_CharT*)0)) {
__size_with_eos = __n + 1;
} else {
__size_with_eos = __n;
}
# ifdef __GC
return __size_with_eos;
# else
// Allow slop for in-place expansion.
return (__size_with_eos + _S_alloc_granularity-1)
&~ (_S_alloc_granularity-1);
# endif
}
__GC_CONST _CharT* _M_data; /* Not necessarily 0 terminated. */
/* The allocated size is */
/* _S_rounded_up_size(size), except */
/* in the GC case, in which it */
/* doesn't matter. */
typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type
allocator_type;
_Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size, allocator_type __a)
: _Rope_RopeRep<_CharT,_Alloc>(_S_leaf, 0, true, __size, __a),
_M_data(__d)
{
__stl_assert(__size > 0);
if (_S_is_basic_char_type((_CharT *)0)) {
// already eos terminated.
_M_c_string = __d;
}
}
// The constructor assumes that d has been allocated with
// the proper allocator and the properly padded size.
// In contrast, the destructor deallocates the data:
# ifndef __GC
~_Rope_RopeLeaf() {
if (_M_data != _M_c_string) {
_M_free_c_string();
}
__STL_FREE_STRING(_M_data, _M_size, get_allocator());
}
# endif
};
 
template<class _CharT, class _Alloc>
struct _Rope_RopeConcatenation : public _Rope_RopeRep<_CharT,_Alloc> {
public:
_Rope_RopeRep<_CharT,_Alloc>* _M_left;
_Rope_RopeRep<_CharT,_Alloc>* _M_right;
typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type
allocator_type;
_Rope_RopeConcatenation(_Rope_RopeRep<_CharT,_Alloc>* __l,
_Rope_RopeRep<_CharT,_Alloc>* __r,
allocator_type __a)
 
: _Rope_RopeRep<_CharT,_Alloc>(_S_concat,
max(__l->_M_depth, __r->_M_depth) + 1,
false,
__l->_M_size + __r->_M_size, __a),
_M_left(__l), _M_right(__r)
{}
# ifndef __GC
~_Rope_RopeConcatenation() {
_M_free_c_string();
_M_left->_M_unref_nonnil();
_M_right->_M_unref_nonnil();
}
# endif
};
 
template<class _CharT, class _Alloc>
struct _Rope_RopeFunction : public _Rope_RopeRep<_CharT,_Alloc> {
public:
char_producer<_CharT>* _M_fn;
# ifndef __GC
bool _M_delete_when_done; // Char_producer is owned by the
// rope and should be explicitly
// deleted when the rope becomes
// inaccessible.
# else
// In the GC case, we either register the rope for
// finalization, or not. Thus the field is unnecessary;
// the information is stored in the collector data structures.
// We do need a finalization procedure to be invoked by the
// collector.
static void _S_fn_finalization_proc(void * __tree, void *) {
delete ((_Rope_RopeFunction *)__tree) -> _M_fn;
}
# endif
typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type
allocator_type;
_Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size,
bool __d, allocator_type __a)
: _Rope_RopeRep<_CharT,_Alloc>(_S_function, 0, true, __size, __a)
, _M_fn(__f)
# ifndef __GC
, _M_delete_when_done(__d)
# endif
{
__stl_assert(__size > 0);
# ifdef __GC
if (__d) {
GC_REGISTER_FINALIZER(
this, _Rope_RopeFunction::_S_fn_finalization_proc, 0, 0, 0);
}
# endif
}
# ifndef __GC
~_Rope_RopeFunction() {
_M_free_c_string();
if (_M_delete_when_done) {
delete _M_fn;
}
}
# endif
};
// Substring results are usually represented using just
// concatenation nodes. But in the case of very long flat ropes
// or ropes with a functional representation that isn't practical.
// In that case, we represent the __result as a special case of
// RopeFunction, whose char_producer points back to the rope itself.
// In all cases except repeated substring operations and
// deallocation, we treat the __result as a RopeFunction.
template<class _CharT, class _Alloc>
struct _Rope_RopeSubstring : public _Rope_RopeFunction<_CharT,_Alloc>,
public char_producer<_CharT> {
public:
// XXX this whole class should be rewritten.
_Rope_RopeRep<_CharT,_Alloc>* _M_base; // not 0
size_t _M_start;
virtual void operator()(size_t __start_pos, size_t __req_len,
_CharT* __buffer) {
switch(_M_base->_M_tag) {
case _S_function:
case _S_substringfn:
{
char_producer<_CharT>* __fn =
((_Rope_RopeFunction<_CharT,_Alloc>*)_M_base)->_M_fn;
__stl_assert(__start_pos + __req_len <= _M_size);
__stl_assert(_M_start + _M_size <= _M_base->_M_size);
(*__fn)(__start_pos + _M_start, __req_len, __buffer);
}
break;
case _S_leaf:
{
__GC_CONST _CharT* __s =
((_Rope_RopeLeaf<_CharT,_Alloc>*)_M_base)->_M_data;
uninitialized_copy_n(__s + __start_pos + _M_start, __req_len,
__buffer);
}
break;
default:
__stl_assert(false);
}
}
typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type
allocator_type;
_Rope_RopeSubstring(_Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s,
size_t __l, allocator_type __a)
: _Rope_RopeFunction<_CharT,_Alloc>(this, __l, false, __a),
char_producer<_CharT>(),
_M_base(__b),
_M_start(__s)
{
__stl_assert(__l > 0);
__stl_assert(__s + __l <= __b->_M_size);
# ifndef __GC
_M_base->_M_ref_nonnil();
# endif
_M_tag = _S_substringfn;
}
virtual ~_Rope_RopeSubstring()
{
# ifndef __GC
_M_base->_M_unref_nonnil();
// _M_free_c_string(); -- done by parent class
# endif
}
};
 
 
// Self-destructing pointers to Rope_rep.
// These are not conventional smart pointers. Their
// only purpose in life is to ensure that unref is called
// on the pointer either at normal exit or if an exception
// is raised. It is the caller's responsibility to
// adjust reference counts when these pointers are initialized
// or assigned to. (This convention significantly reduces
// the number of potentially expensive reference count
// updates.)
#ifndef __GC
template<class _CharT, class _Alloc>
struct _Rope_self_destruct_ptr {
_Rope_RopeRep<_CharT,_Alloc>* _M_ptr;
~_Rope_self_destruct_ptr()
{ _Rope_RopeRep<_CharT,_Alloc>::_S_unref(_M_ptr); }
# ifdef __STL_USE_EXCEPTIONS
_Rope_self_destruct_ptr() : _M_ptr(0) {};
# else
_Rope_self_destruct_ptr() {};
# endif
_Rope_self_destruct_ptr(_Rope_RopeRep<_CharT,_Alloc>* __p) : _M_ptr(__p) {}
_Rope_RopeRep<_CharT,_Alloc>& operator*() { return *_M_ptr; }
_Rope_RopeRep<_CharT,_Alloc>* operator->() { return _M_ptr; }
operator _Rope_RopeRep<_CharT,_Alloc>*() { return _M_ptr; }
_Rope_self_destruct_ptr& operator= (_Rope_RopeRep<_CharT,_Alloc>* __x)
{ _M_ptr = __x; return *this; }
};
#endif
 
// Dereferencing a nonconst iterator has to return something
// that behaves almost like a reference. It's not possible to
// return an actual reference since assignment requires extra
// work. And we would get into the same problems as with the
// CD2 version of basic_string.
template<class _CharT, class _Alloc>
class _Rope_char_ref_proxy {
friend class rope<_CharT,_Alloc>;
friend class _Rope_iterator<_CharT,_Alloc>;
friend class _Rope_char_ptr_proxy<_CharT,_Alloc>;
# ifdef __GC
typedef _Rope_RopeRep<_CharT,_Alloc>* _Self_destruct_ptr;
# else
typedef _Rope_self_destruct_ptr<_CharT,_Alloc> _Self_destruct_ptr;
# endif
typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep;
typedef rope<_CharT,_Alloc> _My_rope;
size_t _M_pos;
_CharT _M_current;
bool _M_current_valid;
_My_rope* _M_root; // The whole rope.
public:
_Rope_char_ref_proxy(_My_rope* __r, size_t __p)
: _M_pos(__p), _M_current_valid(false), _M_root(__r) {}
_Rope_char_ref_proxy(const _Rope_char_ref_proxy& __x)
: _M_pos(__x._M_pos), _M_current_valid(false), _M_root(__x._M_root) {}
// Don't preserve cache if the reference can outlive the
// expression. We claim that's not possible without calling
// a copy constructor or generating reference to a proxy
// reference. We declare the latter to have undefined semantics.
_Rope_char_ref_proxy(_My_rope* __r, size_t __p, _CharT __c)
: _M_pos(__p), _M_current(__c), _M_current_valid(true), _M_root(__r) {}
inline operator _CharT () const;
_Rope_char_ref_proxy& operator= (_CharT __c);
_Rope_char_ptr_proxy<_CharT,_Alloc> operator& () const;
_Rope_char_ref_proxy& operator= (const _Rope_char_ref_proxy& __c) {
return operator=((_CharT)__c);
}
};
 
template<class _CharT, class __Alloc>
inline void swap(_Rope_char_ref_proxy <_CharT, __Alloc > __a,
_Rope_char_ref_proxy <_CharT, __Alloc > __b) {
_CharT __tmp = __a;
__a = __b;
__b = __tmp;
}
 
template<class _CharT, class _Alloc>
class _Rope_char_ptr_proxy {
// XXX this class should be rewritten.
friend class _Rope_char_ref_proxy<_CharT,_Alloc>;
size_t _M_pos;
rope<_CharT,_Alloc>* _M_root; // The whole rope.
public:
_Rope_char_ptr_proxy(const _Rope_char_ref_proxy<_CharT,_Alloc>& __x)
: _M_pos(__x._M_pos), _M_root(__x._M_root) {}
_Rope_char_ptr_proxy(const _Rope_char_ptr_proxy& __x)
: _M_pos(__x._M_pos), _M_root(__x._M_root) {}
_Rope_char_ptr_proxy() {}
_Rope_char_ptr_proxy(_CharT* __x) : _M_root(0), _M_pos(0) {
__stl_assert(0 == __x);
}
_Rope_char_ptr_proxy&
operator= (const _Rope_char_ptr_proxy& __x) {
_M_pos = __x._M_pos;
_M_root = __x._M_root;
return *this;
}
template<class _CharT2, class _Alloc2>
friend bool operator== (const _Rope_char_ptr_proxy<_CharT2,_Alloc2>& __x,
const _Rope_char_ptr_proxy<_CharT2,_Alloc2>& __y);
_Rope_char_ref_proxy<_CharT,_Alloc> operator*() const {
return _Rope_char_ref_proxy<_CharT,_Alloc>(_M_root, _M_pos);
}
};
 
 
// Rope iterators:
// Unlike in the C version, we cache only part of the stack
// for rope iterators, since they must be efficiently copyable.
// When we run out of cache, we have to reconstruct the iterator
// value.
// Pointers from iterators are not included in reference counts.
// Iterators are assumed to be thread private. Ropes can
// be shared.
 
template<class _CharT, class _Alloc>
class _Rope_iterator_base
: public random_access_iterator<_CharT, ptrdiff_t> {
friend class rope<_CharT,_Alloc>;
public:
typedef _Alloc _allocator_type; // used in _Rope_rotate, VC++ workaround
typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep;
// Borland doesnt want this to be protected.
protected:
enum { _S_path_cache_len = 4 }; // Must be <= 9.
enum { _S_iterator_buf_len = 15 };
size_t _M_current_pos;
_RopeRep* _M_root; // The whole rope.
size_t _M_leaf_pos; // Starting position for current leaf
__GC_CONST _CharT* _M_buf_start;
// Buffer possibly
// containing current char.
__GC_CONST _CharT* _M_buf_ptr;
// Pointer to current char in buffer.
// != 0 ==> buffer valid.
__GC_CONST _CharT* _M_buf_end;
// One past __last valid char in buffer.
// What follows is the path cache. We go out of our
// way to make this compact.
// Path_end contains the bottom section of the path from
// the root to the current leaf.
const _RopeRep* _M_path_end[_S_path_cache_len];
int _M_leaf_index; // Last valid __pos in path_end;
// _M_path_end[0] ... _M_path_end[leaf_index-1]
// point to concatenation nodes.
unsigned char _M_path_directions;
// (path_directions >> __i) & 1 is 1
// iff we got from _M_path_end[leaf_index - __i - 1]
// to _M_path_end[leaf_index - __i] by going to the
// __right. Assumes path_cache_len <= 9.
_CharT _M_tmp_buf[_S_iterator_buf_len];
// Short buffer for surrounding chars.
// This is useful primarily for
// RopeFunctions. We put the buffer
// here to avoid locking in the
// multithreaded case.
// The cached path is generally assumed to be valid
// only if the buffer is valid.
static void _S_setbuf(_Rope_iterator_base& __x);
// Set buffer contents given
// path cache.
static void _S_setcache(_Rope_iterator_base& __x);
// Set buffer contents and
// path cache.
static void _S_setcache_for_incr(_Rope_iterator_base& __x);
// As above, but assumes path
// cache is valid for previous posn.
_Rope_iterator_base() {}
_Rope_iterator_base(_RopeRep* __root, size_t __pos)
: _M_current_pos(__pos), _M_root(__root), _M_buf_ptr(0) {}
void _M_incr(size_t __n);
void _M_decr(size_t __n);
public:
size_t index() const { return _M_current_pos; }
_Rope_iterator_base(const _Rope_iterator_base& __x) {
if (0 != __x._M_buf_ptr) {
*this = __x;
} else {
_M_current_pos = __x._M_current_pos;
_M_root = __x._M_root;
_M_buf_ptr = 0;
}
}
};
 
template<class _CharT, class _Alloc> class _Rope_iterator;
 
template<class _CharT, class _Alloc>
class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
friend class rope<_CharT,_Alloc>;
protected:
typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep;
// The one from the base class may not be directly visible.
_Rope_const_iterator(const _RopeRep* __root, size_t __pos):
_Rope_iterator_base<_CharT,_Alloc>(
const_cast<_RopeRep*>(__root), __pos)
// Only nonconst iterators modify root ref count
{}
public:
typedef _CharT reference; // Really a value. Returning a reference
// Would be a mess, since it would have
// to be included in refcount.
typedef const _CharT* pointer;
 
public:
_Rope_const_iterator() {};
_Rope_const_iterator(const _Rope_const_iterator& __x) :
_Rope_iterator_base<_CharT,_Alloc>(__x) { }
_Rope_const_iterator(const _Rope_iterator<_CharT,_Alloc>& __x);
_Rope_const_iterator(const rope<_CharT,_Alloc>& __r, size_t __pos) :
_Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos) {}
_Rope_const_iterator& operator= (const _Rope_const_iterator& __x) {
if (0 != __x._M_buf_ptr) {
*(static_cast<_Rope_iterator_base<_CharT,_Alloc>*>(this)) = __x;
} else {
_M_current_pos = __x._M_current_pos;
_M_root = __x._M_root;
_M_buf_ptr = 0;
}
return(*this);
}
reference operator*() {
if (0 == _M_buf_ptr) _S_setcache(*this);
return *_M_buf_ptr;
}
_Rope_const_iterator& operator++() {
__GC_CONST _CharT* __next;
if (0 != _M_buf_ptr && (__next = _M_buf_ptr + 1) < _M_buf_end) {
_M_buf_ptr = __next;
++_M_current_pos;
} else {
_M_incr(1);
}
return *this;
}
_Rope_const_iterator& operator+=(ptrdiff_t __n) {
if (__n >= 0) {
_M_incr(__n);
} else {
_M_decr(-__n);
}
return *this;
}
_Rope_const_iterator& operator--() {
_M_decr(1);
return *this;
}
_Rope_const_iterator& operator-=(ptrdiff_t __n) {
if (__n >= 0) {
_M_decr(__n);
} else {
_M_incr(-__n);
}
return *this;
}
_Rope_const_iterator operator++(int) {
size_t __old_pos = _M_current_pos;
_M_incr(1);
return _Rope_const_iterator<_CharT,_Alloc>(_M_root, __old_pos);
// This makes a subsequent dereference expensive.
// Perhaps we should instead copy the iterator
// if it has a valid cache?
}
_Rope_const_iterator operator--(int) {
size_t __old_pos = _M_current_pos;
_M_decr(1);
return _Rope_const_iterator<_CharT,_Alloc>(_M_root, __old_pos);
}
template<class _CharT2, class _Alloc2>
friend _Rope_const_iterator<_CharT2,_Alloc2> operator-
(const _Rope_const_iterator<_CharT2,_Alloc2>& __x,
ptrdiff_t __n);
template<class _CharT2, class _Alloc2>
friend _Rope_const_iterator<_CharT2,_Alloc2> operator+
(const _Rope_const_iterator<_CharT2,_Alloc2>& __x,
ptrdiff_t __n);
template<class _CharT2, class _Alloc2>
friend _Rope_const_iterator<_CharT2,_Alloc2> operator+
(ptrdiff_t __n,
const _Rope_const_iterator<_CharT2,_Alloc2>& __x);
reference operator[](size_t __n) {
return rope<_CharT,_Alloc>::_S_fetch(_M_root, _M_current_pos + __n);
}
 
template<class _CharT2, class _Alloc2>
friend bool operator==
(const _Rope_const_iterator<_CharT2,_Alloc2>& __x,
const _Rope_const_iterator<_CharT2,_Alloc2>& __y);
template<class _CharT2, class _Alloc2>
friend bool operator<
(const _Rope_const_iterator<_CharT2,_Alloc2>& __x,
const _Rope_const_iterator<_CharT2,_Alloc2>& __y);
template<class _CharT2, class _Alloc2>
friend ptrdiff_t operator-
(const _Rope_const_iterator<_CharT2,_Alloc2>& __x,
const _Rope_const_iterator<_CharT2,_Alloc2>& __y);
};
 
template<class _CharT, class _Alloc>
class _Rope_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
friend class rope<_CharT,_Alloc>;
protected:
rope<_CharT,_Alloc>* _M_root_rope;
// root is treated as a cached version of this,
// and is used to detect changes to the underlying
// rope.
// Root is included in the reference count.
// This is necessary so that we can detect changes reliably.
// Unfortunately, it requires careful bookkeeping for the
// nonGC case.
_Rope_iterator(rope<_CharT,_Alloc>* __r, size_t __pos)
: _Rope_iterator_base<_CharT,_Alloc>(__r->_M_tree_ptr, __pos),
_M_root_rope(__r)
{ _RopeRep::_S_ref(_M_root); if (!(__r -> empty()))_S_setcache(*this); }
 
void _M_check();
public:
typedef _Rope_char_ref_proxy<_CharT,_Alloc> reference;
typedef _Rope_char_ref_proxy<_CharT,_Alloc>* pointer;
 
public:
rope<_CharT,_Alloc>& container() { return *_M_root_rope; }
_Rope_iterator() {
_M_root = 0; // Needed for reference counting.
};
_Rope_iterator(const _Rope_iterator& __x) :
_Rope_iterator_base<_CharT,_Alloc>(__x) {
_M_root_rope = __x._M_root_rope;
_RopeRep::_S_ref(_M_root);
}
_Rope_iterator(rope<_CharT,_Alloc>& __r, size_t __pos);
~_Rope_iterator() {
_RopeRep::_S_unref(_M_root);
}
_Rope_iterator& operator= (const _Rope_iterator& __x) {
_RopeRep* __old = _M_root;
 
_RopeRep::_S_ref(__x._M_root);
if (0 != __x._M_buf_ptr) {
_M_root_rope = __x._M_root_rope;
*(static_cast<_Rope_iterator_base<_CharT,_Alloc>*>(this)) = __x;
} else {
_M_current_pos = __x._M_current_pos;
_M_root = __x._M_root;
_M_root_rope = __x._M_root_rope;
_M_buf_ptr = 0;
}
_RopeRep::_S_unref(__old);
return(*this);
}
reference operator*() {
_M_check();
if (0 == _M_buf_ptr) {
return _Rope_char_ref_proxy<_CharT,_Alloc>(
_M_root_rope, _M_current_pos);
} else {
return _Rope_char_ref_proxy<_CharT,_Alloc>(
_M_root_rope, _M_current_pos, *_M_buf_ptr);
}
}
_Rope_iterator& operator++() {
_M_incr(1);
return *this;
}
_Rope_iterator& operator+=(ptrdiff_t __n) {
if (__n >= 0) {
_M_incr(__n);
} else {
_M_decr(-__n);
}
return *this;
}
_Rope_iterator& operator--() {
_M_decr(1);
return *this;
}
_Rope_iterator& operator-=(ptrdiff_t __n) {
if (__n >= 0) {
_M_decr(__n);
} else {
_M_incr(-__n);
}
return *this;
}
_Rope_iterator operator++(int) {
size_t __old_pos = _M_current_pos;
_M_incr(1);
return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
}
_Rope_iterator operator--(int) {
size_t __old_pos = _M_current_pos;
_M_decr(1);
return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
}
reference operator[](ptrdiff_t __n) {
return _Rope_char_ref_proxy<_CharT,_Alloc>(
_M_root_rope, _M_current_pos + __n);
}
 
template<class _CharT2, class _Alloc2>
friend bool operator==
(const _Rope_iterator<_CharT2,_Alloc2>& __x,
const _Rope_iterator<_CharT2,_Alloc2>& __y);
template<class _CharT2, class _Alloc2>
friend bool operator<
(const _Rope_iterator<_CharT2,_Alloc2>& __x,
const _Rope_iterator<_CharT2,_Alloc2>& __y);
template<class _CharT2, class _Alloc2>
friend ptrdiff_t operator-
(const _Rope_iterator<_CharT2,_Alloc2>& __x,
const _Rope_iterator<_CharT2,_Alloc2>& __y);
template<class _CharT2, class _Alloc2>
friend _Rope_iterator<_CharT2,_Alloc2> operator-
(const _Rope_iterator<_CharT2,_Alloc2>& __x,
ptrdiff_t __n);
template<class _CharT2, class _Alloc2>
friend _Rope_iterator<_CharT2,_Alloc2> operator+
(const _Rope_iterator<_CharT2,_Alloc2>& __x,
ptrdiff_t __n);
template<class _CharT2, class _Alloc2>
friend _Rope_iterator<_CharT2,_Alloc2> operator+
(ptrdiff_t __n,
const _Rope_iterator<_CharT2,_Alloc2>& __x);
};
 
// The rope base class encapsulates
// the differences between SGI-style allocators and standard-conforming
// allocators.
 
// Base class for ordinary allocators.
template <class _CharT, class _Allocator, bool _IsStatic>
class _Rope_alloc_base {
public:
typedef _Rope_RopeRep<_CharT,_Allocator> _RopeRep;
typedef typename _Alloc_traits<_CharT,_Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return _M_data_allocator; }
_Rope_alloc_base(_RopeRep *__t, const allocator_type& __a)
: _M_tree_ptr(__t), _M_data_allocator(__a) {}
_Rope_alloc_base(const allocator_type& __a)
: _M_data_allocator(__a) {}
protected:
// The only data members of a rope:
allocator_type _M_data_allocator;
_RopeRep* _M_tree_ptr;
 
# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
typedef typename \
_Alloc_traits<_Tp,_Allocator>::allocator_type __name##Allocator; \
_Tp* __name##_allocate(size_t __n) const \
{ return __name##Allocator(_M_data_allocator).allocate(__n); } \
void __name##_deallocate(_Tp *__p, size_t __n) const \
{ __name##Allocator(_M_data_allocator).deallocate(__p, __n); }
__ROPE_DEFINE_ALLOCS(_Allocator)
# undef __ROPE_DEFINE_ALLOC
};
 
// Specialization for allocators that have the property that we don't
// actually have to store an allocator object.
template <class _CharT, class _Allocator>
class _Rope_alloc_base<_CharT,_Allocator,true> {
public:
typedef _Rope_RopeRep<_CharT,_Allocator> _RopeRep;
typedef typename _Alloc_traits<_CharT,_Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
_Rope_alloc_base(_RopeRep *__t, const allocator_type&)
: _M_tree_ptr(__t) {}
_Rope_alloc_base(const allocator_type&) {}
protected:
// The only data member of a rope:
_RopeRep *_M_tree_ptr;
 
# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
typedef typename \
_Alloc_traits<_Tp,_Allocator>::_Alloc_type __name##Alloc; \
typedef typename \
_Alloc_traits<_Tp,_Allocator>::allocator_type __name##Allocator; \
static _Tp* __name##_allocate(size_t __n) \
{ return __name##Alloc::allocate(__n); } \
static void __name##_deallocate(_Tp *__p, size_t __n) \
{ __name##Alloc::deallocate(__p, __n); }
__ROPE_DEFINE_ALLOCS(_Allocator)
# undef __ROPE_DEFINE_ALLOC
};
 
template <class _CharT, class _Alloc>
struct _Rope_base
: public _Rope_alloc_base<_CharT,_Alloc,
_Alloc_traits<_CharT,_Alloc>::_S_instanceless>
{
typedef _Rope_alloc_base<_CharT,_Alloc,
_Alloc_traits<_CharT,_Alloc>::_S_instanceless>
_Base;
typedef typename _Base::allocator_type allocator_type;
typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep;
// The one in _Base may not be visible due to template rules.
_Rope_base(_RopeRep* __t, const allocator_type& __a) : _Base(__t, __a) {}
_Rope_base(const allocator_type& __a) : _Base(__a) {}
};
 
 
template <class _CharT, class _Alloc>
class rope : public _Rope_base<_CharT,_Alloc> {
public:
typedef _CharT value_type;
typedef ptrdiff_t difference_type;
typedef size_t size_type;
typedef _CharT const_reference;
typedef const _CharT* const_pointer;
typedef _Rope_iterator<_CharT,_Alloc> iterator;
typedef _Rope_const_iterator<_CharT,_Alloc> const_iterator;
typedef _Rope_char_ref_proxy<_CharT,_Alloc> reference;
typedef _Rope_char_ptr_proxy<_CharT,_Alloc> pointer;
 
friend class _Rope_iterator<_CharT,_Alloc>;
friend class _Rope_const_iterator<_CharT,_Alloc>;
friend struct _Rope_RopeRep<_CharT,_Alloc>;
friend class _Rope_iterator_base<_CharT,_Alloc>;
friend class _Rope_char_ptr_proxy<_CharT,_Alloc>;
friend class _Rope_char_ref_proxy<_CharT,_Alloc>;
friend struct _Rope_RopeSubstring<_CharT,_Alloc>;
 
protected:
typedef _Rope_base<_CharT,_Alloc> _Base;
typedef typename _Base::allocator_type allocator_type;
using _Base::_M_tree_ptr;
typedef __GC_CONST _CharT* _Cstrptr;
 
static _CharT _S_empty_c_str[1];
 
static bool _S_is0(_CharT __c) { return __c == _S_eos((_CharT*)0); }
enum { _S_copy_max = 23 };
// For strings shorter than _S_copy_max, we copy to
// concatenate.
 
typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep;
typedef _Rope_RopeConcatenation<_CharT,_Alloc> _RopeConcatenation;
typedef _Rope_RopeLeaf<_CharT,_Alloc> _RopeLeaf;
typedef _Rope_RopeFunction<_CharT,_Alloc> _RopeFunction;
typedef _Rope_RopeSubstring<_CharT,_Alloc> _RopeSubstring;
 
// Retrieve a character at the indicated position.
static _CharT _S_fetch(_RopeRep* __r, size_type __pos);
 
# ifndef __GC
// Obtain a pointer to the character at the indicated position.
// The pointer can be used to change the character.
// If such a pointer cannot be produced, as is frequently the
// case, 0 is returned instead.
// (Returns nonzero only if all nodes in the path have a refcount
// of 1.)
static _CharT* _S_fetch_ptr(_RopeRep* __r, size_type __pos);
# endif
 
static bool _S_apply_to_pieces(
// should be template parameter
_Rope_char_consumer<_CharT>& __c,
const _RopeRep* __r,
size_t __begin, size_t __end);
// begin and end are assumed to be in range.
 
# ifndef __GC
static void _S_unref(_RopeRep* __t)
{
_RopeRep::_S_unref(__t);
}
static void _S_ref(_RopeRep* __t)
{
_RopeRep::_S_ref(__t);
}
# else /* __GC */
static void _S_unref(_RopeRep*) {}
static void _S_ref(_RopeRep*) {}
# endif
 
 
# ifdef __GC
typedef _Rope_RopeRep<_CharT,_Alloc>* _Self_destruct_ptr;
# else
typedef _Rope_self_destruct_ptr<_CharT,_Alloc> _Self_destruct_ptr;
# endif
 
// _Result is counted in refcount.
static _RopeRep* _S_substring(_RopeRep* __base,
size_t __start, size_t __endp1);
 
static _RopeRep* _S_concat_char_iter(_RopeRep* __r,
const _CharT* __iter, size_t __slen);
// Concatenate rope and char ptr, copying __s.
// Should really take an arbitrary iterator.
// Result is counted in refcount.
static _RopeRep* _S_destr_concat_char_iter(_RopeRep* __r,
const _CharT* __iter, size_t __slen)
// As above, but one reference to __r is about to be
// destroyed. Thus the pieces may be recycled if all
// relevent reference counts are 1.
# ifdef __GC
// We can't really do anything since refcounts are unavailable.
{ return _S_concat_char_iter(__r, __iter, __slen); }
# else
;
# endif
 
static _RopeRep* _S_concat(_RopeRep* __left, _RopeRep* __right);
// General concatenation on _RopeRep. _Result
// has refcount of 1. Adjusts argument refcounts.
 
public:
void apply_to_pieces( size_t __begin, size_t __end,
_Rope_char_consumer<_CharT>& __c) const {
_S_apply_to_pieces(__c, _M_tree_ptr, __begin, __end);
}
 
 
protected:
 
static size_t _S_rounded_up_size(size_t __n) {
return _RopeLeaf::_S_rounded_up_size(__n);
}
 
static size_t _S_allocated_capacity(size_t __n) {
if (_S_is_basic_char_type((_CharT*)0)) {
return _S_rounded_up_size(__n) - 1;
} else {
return _S_rounded_up_size(__n);
}
}
// Allocate and construct a RopeLeaf using the supplied allocator
// Takes ownership of s instead of copying.
static _RopeLeaf* _S_new_RopeLeaf(__GC_CONST _CharT *__s,
size_t __size, allocator_type __a)
{
_RopeLeaf* __space = _LAllocator(__a).allocate(1);
return new(__space) _RopeLeaf(__s, __size, __a);
}
 
static _RopeConcatenation* _S_new_RopeConcatenation(
_RopeRep* __left, _RopeRep* __right,
allocator_type __a)
{
_RopeConcatenation* __space = _CAllocator(__a).allocate(1);
return new(__space) _RopeConcatenation(__left, __right, __a);
}
 
static _RopeFunction* _S_new_RopeFunction(char_producer<_CharT>* __f,
size_t __size, bool __d, allocator_type __a)
{
_RopeFunction* __space = _FAllocator(__a).allocate(1);
return new(__space) _RopeFunction(__f, __size, __d, __a);
}
 
static _RopeSubstring* _S_new_RopeSubstring(
_Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s,
size_t __l, allocator_type __a)
{
_RopeSubstring* __space = _SAllocator(__a).allocate(1);
return new(__space) _RopeSubstring(__b, __s, __l, __a);
}
 
static
_RopeLeaf* _S_RopeLeaf_from_unowned_char_ptr(const _CharT *__s,
size_t __size, allocator_type __a)
# define __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __size, __a) \
_S_RopeLeaf_from_unowned_char_ptr(__s, __size, __a)
{
if (0 == __size) return 0;
_CharT* __buf = __a.allocate(_S_rounded_up_size(__size));
 
uninitialized_copy_n(__s, __size, __buf);
_S_cond_store_eos(__buf[__size]);
__STL_TRY {
return _S_new_RopeLeaf(__buf, __size, __a);
}
__STL_UNWIND(_RopeRep::__STL_FREE_STRING(__buf, __size, __a))
}
 
// Concatenation of nonempty strings.
// Always builds a concatenation node.
// Rebalances if the result is too deep.
// Result has refcount 1.
// Does not increment left and right ref counts even though
// they are referenced.
static _RopeRep*
_S_tree_concat(_RopeRep* __left, _RopeRep* __right);
 
// Concatenation helper functions
static _RopeLeaf*
_S_leaf_concat_char_iter(_RopeLeaf* __r,
const _CharT* __iter, size_t __slen);
// Concatenate by copying leaf.
// should take an arbitrary iterator
// result has refcount 1.
# ifndef __GC
static _RopeLeaf* _S_destr_leaf_concat_char_iter
(_RopeLeaf* __r, const _CharT* __iter, size_t __slen);
// A version that potentially clobbers __r if __r->_M_ref_count == 1.
# endif
 
private:
 
static size_t _S_char_ptr_len(const _CharT* __s);
// slightly generalized strlen
 
rope(_RopeRep* __t, const allocator_type& __a = allocator_type())
: _Base(__t,__a) { }
 
 
// Copy __r to the _CharT buffer.
// Returns __buffer + __r->_M_size.
// Assumes that buffer is uninitialized.
static _CharT* _S_flatten(_RopeRep* __r, _CharT* __buffer);
 
// Again, with explicit starting position and length.
// Assumes that buffer is uninitialized.
static _CharT* _S_flatten(_RopeRep* __r,
size_t __start, size_t __len,
_CharT* __buffer);
 
static const unsigned long
_S_min_len[_RopeRep::_S_max_rope_depth + 1];
 
static bool _S_is_balanced(_RopeRep* __r)
{ return (__r->_M_size >= _S_min_len[__r->_M_depth]); }
 
static bool _S_is_almost_balanced(_RopeRep* __r)
{ return (__r->_M_depth == 0 ||
__r->_M_size >= _S_min_len[__r->_M_depth - 1]); }
 
static bool _S_is_roughly_balanced(_RopeRep* __r)
{ return (__r->_M_depth <= 1 ||
__r->_M_size >= _S_min_len[__r->_M_depth - 2]); }
 
// Assumes the result is not empty.
static _RopeRep* _S_concat_and_set_balanced(_RopeRep* __left,
_RopeRep* __right)
{
_RopeRep* __result = _S_concat(__left, __right);
if (_S_is_balanced(__result)) __result->_M_is_balanced = true;
return __result;
}
 
// The basic rebalancing operation. Logically copies the
// rope. The result has refcount of 1. The client will
// usually decrement the reference count of __r.
// The result is within height 2 of balanced by the above
// definition.
static _RopeRep* _S_balance(_RopeRep* __r);
 
// Add all unbalanced subtrees to the forest of balanceed trees.
// Used only by balance.
static void _S_add_to_forest(_RopeRep*__r, _RopeRep** __forest);
// Add __r to forest, assuming __r is already balanced.
static void _S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest);
 
// Print to stdout, exposing structure
static void _S_dump(_RopeRep* __r, int __indent = 0);
 
// Return -1, 0, or 1 if __x < __y, __x == __y, or __x > __y resp.
static int _S_compare(const _RopeRep* __x, const _RopeRep* __y);
 
public:
bool empty() const { return 0 == _M_tree_ptr; }
 
// Comparison member function. This is public only for those
// clients that need a ternary comparison. Others
// should use the comparison operators below.
int compare(const rope& __y) const {
return _S_compare(_M_tree_ptr, __y._M_tree_ptr);
}
 
rope(const _CharT* __s, const allocator_type& __a = allocator_type())
: _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, _S_char_ptr_len(__s),
__a),__a)
{ }
 
rope(const _CharT* __s, size_t __len,
const allocator_type& __a = allocator_type())
: _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __len, __a), __a)
{ }
 
// Should perhaps be templatized with respect to the iterator type
// and use Sequence_buffer. (It should perhaps use sequence_buffer
// even now.)
rope(const _CharT *__s, const _CharT *__e,
const allocator_type& __a = allocator_type())
: _Base(__STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __e - __s, __a), __a)
{ }
 
rope(const const_iterator& __s, const const_iterator& __e,
const allocator_type& __a = allocator_type())
: _Base(_S_substring(__s._M_root, __s._M_current_pos,
__e._M_current_pos), __a)
{ }
 
rope(const iterator& __s, const iterator& __e,
const allocator_type& __a = allocator_type())
: _Base(_S_substring(__s._M_root, __s._M_current_pos,
__e._M_current_pos), __a)
{ }
 
rope(_CharT __c, const allocator_type& __a = allocator_type())
: _Base(__a)
{
_CharT* __buf = _Data_allocate(_S_rounded_up_size(1));
 
construct(__buf, __c);
__STL_TRY {
_M_tree_ptr = _S_new_RopeLeaf(__buf, 1, __a);
}
__STL_UNWIND(_RopeRep::__STL_FREE_STRING(__buf, 1, __a))
}
 
rope(size_t __n, _CharT __c,
const allocator_type& __a = allocator_type());
 
rope(const allocator_type& __a = allocator_type())
: _Base(0, __a) {}
 
// Construct a rope from a function that can compute its members
rope(char_producer<_CharT> *__fn, size_t __len, bool __delete_fn,
const allocator_type& __a = allocator_type())
: _Base(__a)
{
_M_tree_ptr = (0 == __len) ?
0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a);
}
 
rope(const rope& __x, const allocator_type& __a = allocator_type())
: _Base(__x._M_tree_ptr, __a)
{
_S_ref(_M_tree_ptr);
}
 
~rope()
{
_S_unref(_M_tree_ptr);
}
 
rope& operator=(const rope& __x)
{
_RopeRep* __old = _M_tree_ptr;
__stl_assert(get_allocator() == __x.get_allocator());
_M_tree_ptr = __x._M_tree_ptr;
_S_ref(_M_tree_ptr);
_S_unref(__old);
return(*this);
}
 
void clear()
{
_S_unref(_M_tree_ptr);
_M_tree_ptr = 0;
}
 
void push_back(_CharT __x)
{
_RopeRep* __old = _M_tree_ptr;
_M_tree_ptr = _S_destr_concat_char_iter(_M_tree_ptr, &__x, 1);
_S_unref(__old);
}
 
void pop_back()
{
_RopeRep* __old = _M_tree_ptr;
_M_tree_ptr =
_S_substring(_M_tree_ptr, 0, _M_tree_ptr->_M_size - 1);
_S_unref(__old);
}
 
_CharT back() const
{
return _S_fetch(_M_tree_ptr, _M_tree_ptr->_M_size - 1);
}
 
void push_front(_CharT __x)
{
_RopeRep* __old = _M_tree_ptr;
_RopeRep* __left =
__STL_ROPE_FROM_UNOWNED_CHAR_PTR(&__x, 1, get_allocator());
__STL_TRY {
_M_tree_ptr = _S_concat(__left, _M_tree_ptr);
_S_unref(__old);
_S_unref(__left);
}
__STL_UNWIND(_S_unref(__left))
}
 
void pop_front()
{
_RopeRep* __old = _M_tree_ptr;
_M_tree_ptr = _S_substring(_M_tree_ptr, 1, _M_tree_ptr->_M_size);
_S_unref(__old);
}
 
_CharT front() const
{
return _S_fetch(_M_tree_ptr, 0);
}
 
void balance()
{
_RopeRep* __old = _M_tree_ptr;
_M_tree_ptr = _S_balance(_M_tree_ptr);
_S_unref(__old);
}
 
void copy(_CharT* __buffer) const {
destroy(__buffer, __buffer + size());
_S_flatten(_M_tree_ptr, __buffer);
}
 
// This is the copy function from the standard, but
// with the arguments reordered to make it consistent with the
// rest of the interface.
// Note that this guaranteed not to compile if the draft standard
// order is assumed.
size_type copy(size_type __pos, size_type __n, _CharT* __buffer) const
{
size_t __size = size();
size_t __len = (__pos + __n > __size? __size - __pos : __n);
 
destroy(__buffer, __buffer + __len);
_S_flatten(_M_tree_ptr, __pos, __len, __buffer);
return __len;
}
 
// Print to stdout, exposing structure. May be useful for
// performance debugging.
void dump() {
_S_dump(_M_tree_ptr);
}
 
// Convert to 0 terminated string in new allocated memory.
// Embedded 0s in the input do not terminate the copy.
const _CharT* c_str() const;
 
// As above, but lso use the flattened representation as the
// the new rope representation.
const _CharT* replace_with_c_str();
 
// Reclaim memory for the c_str generated flattened string.
// Intentionally undocumented, since it's hard to say when this
// is safe for multiple threads.
void delete_c_str () {
if (0 == _M_tree_ptr) return;
if (_RopeRep::_S_leaf == _M_tree_ptr->_M_tag &&
((_RopeLeaf*)_M_tree_ptr)->_M_data ==
_M_tree_ptr->_M_c_string) {
// Representation shared
return;
}
# ifndef __GC
_M_tree_ptr->_M_free_c_string();
# endif
_M_tree_ptr->_M_c_string = 0;
}
 
_CharT operator[] (size_type __pos) const {
return _S_fetch(_M_tree_ptr, __pos);
}
 
_CharT at(size_type __pos) const {
// if (__pos >= size()) throw out_of_range; // XXX
return (*this)[__pos];
}
 
const_iterator begin() const {
return(const_iterator(_M_tree_ptr, 0));
}
 
// An easy way to get a const iterator from a non-const container.
const_iterator const_begin() const {
return(const_iterator(_M_tree_ptr, 0));
}
 
const_iterator end() const {
return(const_iterator(_M_tree_ptr, size()));
}
 
const_iterator const_end() const {
return(const_iterator(_M_tree_ptr, size()));
}
 
size_type size() const {
return(0 == _M_tree_ptr? 0 : _M_tree_ptr->_M_size);
}
 
size_type length() const {
return size();
}
 
size_type max_size() const {
return _S_min_len[_RopeRep::_S_max_rope_depth-1] - 1;
// Guarantees that the result can be sufficirntly
// balanced. Longer ropes will probably still work,
// but it's harder to make guarantees.
}
 
typedef reverse_iterator<const_iterator> const_reverse_iterator;
 
const_reverse_iterator rbegin() const {
return const_reverse_iterator(end());
}
 
const_reverse_iterator const_rbegin() const {
return const_reverse_iterator(end());
}
 
const_reverse_iterator rend() const {
return const_reverse_iterator(begin());
}
 
const_reverse_iterator const_rend() const {
return const_reverse_iterator(begin());
}
 
template<class _CharT2, class _Alloc2>
friend rope<_CharT2,_Alloc2>
operator+ (const rope<_CharT2,_Alloc2>& __left,
const rope<_CharT2,_Alloc2>& __right);
template<class _CharT2, class _Alloc2>
friend rope<_CharT2,_Alloc2>
operator+ (const rope<_CharT2,_Alloc2>& __left,
const _CharT2* __right);
template<class _CharT2, class _Alloc2>
friend rope<_CharT2,_Alloc2>
operator+ (const rope<_CharT2,_Alloc2>& __left, _CharT2 __right);
// The symmetric cases are intentionally omitted, since they're presumed
// to be less common, and we don't handle them as well.
 
// The following should really be templatized.
// The first argument should be an input iterator or
// forward iterator with value_type _CharT.
rope& append(const _CharT* __iter, size_t __n) {
_RopeRep* __result =
_S_destr_concat_char_iter(_M_tree_ptr, __iter, __n);
_S_unref(_M_tree_ptr);
_M_tree_ptr = __result;
return *this;
}
 
rope& append(const _CharT* __c_string) {
size_t __len = _S_char_ptr_len(__c_string);
append(__c_string, __len);
return(*this);
}
 
rope& append(const _CharT* __s, const _CharT* __e) {
_RopeRep* __result =
_S_destr_concat_char_iter(_M_tree_ptr, __s, __e - __s);
_S_unref(_M_tree_ptr);
_M_tree_ptr = __result;
return *this;
}
 
rope& append(const_iterator __s, const_iterator __e) {
__stl_assert(__s._M_root == __e._M_root);
__stl_assert(get_allocator() == __s._M_root->get_allocator());
_Self_destruct_ptr __appendee(_S_substring(
__s._M_root, __s._M_current_pos, __e._M_current_pos));
_RopeRep* __result =
_S_concat(_M_tree_ptr, (_RopeRep*)__appendee);
_S_unref(_M_tree_ptr);
_M_tree_ptr = __result;
return *this;
}
 
rope& append(_CharT __c) {
_RopeRep* __result =
_S_destr_concat_char_iter(_M_tree_ptr, &__c, 1);
_S_unref(_M_tree_ptr);
_M_tree_ptr = __result;
return *this;
}
 
rope& append() { return append(_CharT()); } // XXX why?
 
rope& append(const rope& __y) {
__stl_assert(__y.get_allocator() == get_allocator());
_RopeRep* __result = _S_concat(_M_tree_ptr, __y._M_tree_ptr);
_S_unref(_M_tree_ptr);
_M_tree_ptr = __result;
return *this;
}
 
rope& append(size_t __n, _CharT __c) {
rope<_CharT,_Alloc> __last(__n, __c);
return append(__last);
}
 
void swap(rope& __b) {
__stl_assert(get_allocator() == __b.get_allocator());
_RopeRep* __tmp = _M_tree_ptr;
_M_tree_ptr = __b._M_tree_ptr;
__b._M_tree_ptr = __tmp;
}
 
 
protected:
// Result is included in refcount.
static _RopeRep* replace(_RopeRep* __old, size_t __pos1,
size_t __pos2, _RopeRep* __r) {
if (0 == __old) { _S_ref(__r); return __r; }
_Self_destruct_ptr __left(
_S_substring(__old, 0, __pos1));
_Self_destruct_ptr __right(
_S_substring(__old, __pos2, __old->_M_size));
_RopeRep* __result;
 
__stl_assert(__old->get_allocator() == __r->get_allocator());
if (0 == __r) {
__result = _S_concat(__left, __right);
} else {
_Self_destruct_ptr __left_result(_S_concat(__left, __r));
__result = _S_concat(__left_result, __right);
}
return __result;
}
 
public:
void insert(size_t __p, const rope& __r) {
_RopeRep* __result =
replace(_M_tree_ptr, __p, __p, __r._M_tree_ptr);
__stl_assert(get_allocator() == __r.get_allocator());
_S_unref(_M_tree_ptr);
_M_tree_ptr = __result;
}
 
void insert(size_t __p, size_t __n, _CharT __c) {
rope<_CharT,_Alloc> __r(__n,__c);
insert(__p, __r);
}
 
void insert(size_t __p, const _CharT* __i, size_t __n) {
_Self_destruct_ptr __left(_S_substring(_M_tree_ptr, 0, __p));
_Self_destruct_ptr __right(_S_substring(_M_tree_ptr, __p, size()));
_Self_destruct_ptr __left_result(
_S_concat_char_iter(__left, __i, __n));
// _S_ destr_concat_char_iter should be safe here.
// But as it stands it's probably not a win, since __left
// is likely to have additional references.
_RopeRep* __result = _S_concat(__left_result, __right);
_S_unref(_M_tree_ptr);
_M_tree_ptr = __result;
}
 
void insert(size_t __p, const _CharT* __c_string) {
insert(__p, __c_string, _S_char_ptr_len(__c_string));
}
 
void insert(size_t __p, _CharT __c) {
insert(__p, &__c, 1);
}
 
void insert(size_t __p) {
_CharT __c = _CharT();
insert(__p, &__c, 1);
}
 
void insert(size_t __p, const _CharT* __i, const _CharT* __j) {
rope __r(__i, __j);
insert(__p, __r);
}
 
void insert(size_t __p, const const_iterator& __i,
const const_iterator& __j) {
rope __r(__i, __j);
insert(__p, __r);
}
 
void insert(size_t __p, const iterator& __i,
const iterator& __j) {
rope __r(__i, __j);
insert(__p, __r);
}
 
// (position, length) versions of replace operations:
 
void replace(size_t __p, size_t __n, const rope& __r) {
_RopeRep* __result =
replace(_M_tree_ptr, __p, __p + __n, __r._M_tree_ptr);
_S_unref(_M_tree_ptr);
_M_tree_ptr = __result;
}
 
void replace(size_t __p, size_t __n,
const _CharT* __i, size_t __i_len) {
rope __r(__i, __i_len);
replace(__p, __n, __r);
}
 
void replace(size_t __p, size_t __n, _CharT __c) {
rope __r(__c);
replace(__p, __n, __r);
}
 
void replace(size_t __p, size_t __n, const _CharT* __c_string) {
rope __r(__c_string);
replace(__p, __n, __r);
}
 
void replace(size_t __p, size_t __n,
const _CharT* __i, const _CharT* __j) {
rope __r(__i, __j);
replace(__p, __n, __r);
}
 
void replace(size_t __p, size_t __n,
const const_iterator& __i, const const_iterator& __j) {
rope __r(__i, __j);
replace(__p, __n, __r);
}
 
void replace(size_t __p, size_t __n,
const iterator& __i, const iterator& __j) {
rope __r(__i, __j);
replace(__p, __n, __r);
}
 
// Single character variants:
void replace(size_t __p, _CharT __c) {
iterator __i(this, __p);
*__i = __c;
}
 
void replace(size_t __p, const rope& __r) {
replace(__p, 1, __r);
}
 
void replace(size_t __p, const _CharT* __i, size_t __i_len) {
replace(__p, 1, __i, __i_len);
}
 
void replace(size_t __p, const _CharT* __c_string) {
replace(__p, 1, __c_string);
}
 
void replace(size_t __p, const _CharT* __i, const _CharT* __j) {
replace(__p, 1, __i, __j);
}
 
void replace(size_t __p, const const_iterator& __i,
const const_iterator& __j) {
replace(__p, 1, __i, __j);
}
 
void replace(size_t __p, const iterator& __i,
const iterator& __j) {
replace(__p, 1, __i, __j);
}
 
// Erase, (position, size) variant.
void erase(size_t __p, size_t __n) {
_RopeRep* __result = replace(_M_tree_ptr, __p, __p + __n, 0);
_S_unref(_M_tree_ptr);
_M_tree_ptr = __result;
}
 
// Erase, single character
void erase(size_t __p) {
erase(__p, __p + 1);
}
 
// Insert, iterator variants.
iterator insert(const iterator& __p, const rope& __r)
{ insert(__p.index(), __r); return __p; }
iterator insert(const iterator& __p, size_t __n, _CharT __c)
{ insert(__p.index(), __n, __c); return __p; }
iterator insert(const iterator& __p, _CharT __c)
{ insert(__p.index(), __c); return __p; }
iterator insert(const iterator& __p )
{ insert(__p.index()); return __p; }
iterator insert(const iterator& __p, const _CharT* c_string)
{ insert(__p.index(), c_string); return __p; }
iterator insert(const iterator& __p, const _CharT* __i, size_t __n)
{ insert(__p.index(), __i, __n); return __p; }
iterator insert(const iterator& __p, const _CharT* __i,
const _CharT* __j)
{ insert(__p.index(), __i, __j); return __p; }
iterator insert(const iterator& __p,
const const_iterator& __i, const const_iterator& __j)
{ insert(__p.index(), __i, __j); return __p; }
iterator insert(const iterator& __p,
const iterator& __i, const iterator& __j)
{ insert(__p.index(), __i, __j); return __p; }
 
// Replace, range variants.
void replace(const iterator& __p, const iterator& __q,
const rope& __r)
{ replace(__p.index(), __q.index() - __p.index(), __r); }
void replace(const iterator& __p, const iterator& __q, _CharT __c)
{ replace(__p.index(), __q.index() - __p.index(), __c); }
void replace(const iterator& __p, const iterator& __q,
const _CharT* __c_string)
{ replace(__p.index(), __q.index() - __p.index(), __c_string); }
void replace(const iterator& __p, const iterator& __q,
const _CharT* __i, size_t __n)
{ replace(__p.index(), __q.index() - __p.index(), __i, __n); }
void replace(const iterator& __p, const iterator& __q,
const _CharT* __i, const _CharT* __j)
{ replace(__p.index(), __q.index() - __p.index(), __i, __j); }
void replace(const iterator& __p, const iterator& __q,
const const_iterator& __i, const const_iterator& __j)
{ replace(__p.index(), __q.index() - __p.index(), __i, __j); }
void replace(const iterator& __p, const iterator& __q,
const iterator& __i, const iterator& __j)
{ replace(__p.index(), __q.index() - __p.index(), __i, __j); }
 
// Replace, iterator variants.
void replace(const iterator& __p, const rope& __r)
{ replace(__p.index(), __r); }
void replace(const iterator& __p, _CharT __c)
{ replace(__p.index(), __c); }
void replace(const iterator& __p, const _CharT* __c_string)
{ replace(__p.index(), __c_string); }
void replace(const iterator& __p, const _CharT* __i, size_t __n)
{ replace(__p.index(), __i, __n); }
void replace(const iterator& __p, const _CharT* __i, const _CharT* __j)
{ replace(__p.index(), __i, __j); }
void replace(const iterator& __p, const_iterator __i,
const_iterator __j)
{ replace(__p.index(), __i, __j); }
void replace(const iterator& __p, iterator __i, iterator __j)
{ replace(__p.index(), __i, __j); }
 
// Iterator and range variants of erase
iterator erase(const iterator& __p, const iterator& __q) {
size_t __p_index = __p.index();
erase(__p_index, __q.index() - __p_index);
return iterator(this, __p_index);
}
iterator erase(const iterator& __p) {
size_t __p_index = __p.index();
erase(__p_index, 1);
return iterator(this, __p_index);
}
 
rope substr(size_t __start, size_t __len = 1) const {
return rope<_CharT,_Alloc>(
_S_substring(_M_tree_ptr, __start, __start + __len));
}
 
rope substr(iterator __start, iterator __end) const {
return rope<_CharT,_Alloc>(
_S_substring(_M_tree_ptr, __start.index(), __end.index()));
}
rope substr(iterator __start) const {
size_t __pos = __start.index();
return rope<_CharT,_Alloc>(
_S_substring(_M_tree_ptr, __pos, __pos + 1));
}
rope substr(const_iterator __start, const_iterator __end) const {
// This might eventually take advantage of the cache in the
// iterator.
return rope<_CharT,_Alloc>(
_S_substring(_M_tree_ptr, __start.index(), __end.index()));
}
 
rope<_CharT,_Alloc> substr(const_iterator __start) {
size_t __pos = __start.index();
return rope<_CharT,_Alloc>(
_S_substring(_M_tree_ptr, __pos, __pos + 1));
}
 
static const size_type npos;
 
size_type find(_CharT __c, size_type __pos = 0) const;
size_type find(const _CharT* __s, size_type __pos = 0) const {
size_type __result_pos;
const_iterator __result = search(const_begin() + __pos, const_end(),
__s, __s + _S_char_ptr_len(__s));
__result_pos = __result.index();
# ifndef __STL_OLD_ROPE_SEMANTICS
if (__result_pos == size()) __result_pos = npos;
# endif
return __result_pos;
}
 
iterator mutable_begin() {
return(iterator(this, 0));
}
 
iterator mutable_end() {
return(iterator(this, size()));
}
 
typedef reverse_iterator<iterator> reverse_iterator;
 
reverse_iterator mutable_rbegin() {
return reverse_iterator(mutable_end());
}
 
reverse_iterator mutable_rend() {
return reverse_iterator(mutable_begin());
}
 
reference mutable_reference_at(size_type __pos) {
return reference(this, __pos);
}
 
# ifdef __STD_STUFF
reference operator[] (size_type __pos) {
return _char_ref_proxy(this, __pos);
}
 
reference at(size_type __pos) {
// if (__pos >= size()) throw out_of_range; // XXX
return (*this)[__pos];
}
 
void resize(size_type __n, _CharT __c) {}
void resize(size_type __n) {}
void reserve(size_type __res_arg = 0) {}
size_type capacity() const {
return max_size();
}
 
// Stuff below this line is dangerous because it's error prone.
// I would really like to get rid of it.
// copy function with funny arg ordering.
size_type copy(_CharT* __buffer, size_type __n,
size_type __pos = 0) const {
return copy(__pos, __n, __buffer);
}
 
iterator end() { return mutable_end(); }
 
iterator begin() { return mutable_begin(); }
 
reverse_iterator rend() { return mutable_rend(); }
 
reverse_iterator rbegin() { return mutable_rbegin(); }
 
# else
 
const_iterator end() { return const_end(); }
 
const_iterator begin() { return const_begin(); }
 
const_reverse_iterator rend() { return const_rend(); }
const_reverse_iterator rbegin() { return const_rbegin(); }
 
# endif
};
 
template <class _CharT, class _Alloc>
const rope<_CharT, _Alloc>::size_type rope<_CharT, _Alloc>::npos =
(size_type)(-1);
 
template <class _CharT, class _Alloc>
inline bool operator== (const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y) {
return (__x._M_current_pos == __y._M_current_pos &&
__x._M_root == __y._M_root);
}
 
template <class _CharT, class _Alloc>
inline bool operator< (const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y) {
return (__x._M_current_pos < __y._M_current_pos);
}
 
template <class _CharT, class _Alloc>
inline bool operator!= (const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y) {
return !(__x == __y);
}
 
template <class _CharT, class _Alloc>
inline bool operator> (const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y) {
return __y < __x;
}
 
template <class _CharT, class _Alloc>
inline bool operator<= (const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y) {
return !(__y < __x);
}
 
template <class _CharT, class _Alloc>
inline bool operator>= (const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y) {
return !(__x < __y);
}
 
template <class _CharT, class _Alloc>
inline ptrdiff_t operator-(const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y) {
return (ptrdiff_t)__x._M_current_pos - (ptrdiff_t)__y._M_current_pos;
}
 
template <class _CharT, class _Alloc>
inline _Rope_const_iterator<_CharT,_Alloc>
operator-(const _Rope_const_iterator<_CharT,_Alloc>& __x, ptrdiff_t __n) {
return _Rope_const_iterator<_CharT,_Alloc>(
__x._M_root, __x._M_current_pos - __n);
}
 
template <class _CharT, class _Alloc>
inline _Rope_const_iterator<_CharT,_Alloc>
operator+(const _Rope_const_iterator<_CharT,_Alloc>& __x, ptrdiff_t __n) {
return _Rope_const_iterator<_CharT,_Alloc>(
__x._M_root, __x._M_current_pos + __n);
}
 
template <class _CharT, class _Alloc>
inline _Rope_const_iterator<_CharT,_Alloc>
operator+(ptrdiff_t __n, const _Rope_const_iterator<_CharT,_Alloc>& __x) {
return _Rope_const_iterator<_CharT,_Alloc>(
__x._M_root, __x._M_current_pos + __n);
}
 
template <class _CharT, class _Alloc>
inline bool operator== (const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y) {
return (__x._M_current_pos == __y._M_current_pos &&
__x._M_root_rope == __y._M_root_rope);
}
 
template <class _CharT, class _Alloc>
inline bool operator< (const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y) {
return (__x._M_current_pos < __y._M_current_pos);
}
 
template <class _CharT, class _Alloc>
inline bool operator!= (const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y) {
return !(__x == __y);
}
 
template <class _CharT, class _Alloc>
inline bool operator> (const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y) {
return __y < __x;
}
 
template <class _CharT, class _Alloc>
inline bool operator<= (const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y) {
return !(__y < __x);
}
 
template <class _CharT, class _Alloc>
inline bool operator>= (const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y) {
return !(__x < __y);
}
 
template <class _CharT, class _Alloc>
inline ptrdiff_t operator-(const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y) {
return (ptrdiff_t)__x._M_current_pos - (ptrdiff_t)__y._M_current_pos;
}
 
template <class _CharT, class _Alloc>
inline _Rope_iterator<_CharT,_Alloc>
operator-(const _Rope_iterator<_CharT,_Alloc>& __x,
ptrdiff_t __n) {
return _Rope_iterator<_CharT,_Alloc>(
__x._M_root_rope, __x._M_current_pos - __n);
}
 
template <class _CharT, class _Alloc>
inline _Rope_iterator<_CharT,_Alloc>
operator+(const _Rope_iterator<_CharT,_Alloc>& __x,
ptrdiff_t __n) {
return _Rope_iterator<_CharT,_Alloc>(
__x._M_root_rope, __x._M_current_pos + __n);
}
 
template <class _CharT, class _Alloc>
inline _Rope_iterator<_CharT,_Alloc>
operator+(ptrdiff_t __n, const _Rope_iterator<_CharT,_Alloc>& __x) {
return _Rope_iterator<_CharT,_Alloc>(
__x._M_root_rope, __x._M_current_pos + __n);
}
 
template <class _CharT, class _Alloc>
inline
rope<_CharT,_Alloc>
operator+ (const rope<_CharT,_Alloc>& __left,
const rope<_CharT,_Alloc>& __right)
{
__stl_assert(__left.get_allocator() == __right.get_allocator());
return rope<_CharT,_Alloc>(
rope<_CharT,_Alloc>::_S_concat(__left._M_tree_ptr, __right._M_tree_ptr));
// Inlining this should make it possible to keep __left and
// __right in registers.
}
 
template <class _CharT, class _Alloc>
inline
rope<_CharT,_Alloc>&
operator+= (rope<_CharT,_Alloc>& __left,
const rope<_CharT,_Alloc>& __right)
{
__left.append(__right);
return __left;
}
 
template <class _CharT, class _Alloc>
inline
rope<_CharT,_Alloc>
operator+ (const rope<_CharT,_Alloc>& __left,
const _CharT* __right) {
size_t __rlen = rope<_CharT,_Alloc>::_S_char_ptr_len(__right);
return rope<_CharT,_Alloc>(
rope<_CharT,_Alloc>::_S_concat_char_iter(
__left._M_tree_ptr, __right, __rlen));
}
 
template <class _CharT, class _Alloc>
inline
rope<_CharT,_Alloc>&
operator+= (rope<_CharT,_Alloc>& __left,
const _CharT* __right) {
__left.append(__right);
return __left;
}
 
template <class _CharT, class _Alloc>
inline
rope<_CharT,_Alloc>
operator+ (const rope<_CharT,_Alloc>& __left, _CharT __right) {
return rope<_CharT,_Alloc>(
rope<_CharT,_Alloc>::_S_concat_char_iter(
__left._M_tree_ptr, &__right, 1));
}
 
template <class _CharT, class _Alloc>
inline
rope<_CharT,_Alloc>&
operator+= (rope<_CharT,_Alloc>& __left, _CharT __right) {
__left.append(__right);
return __left;
}
 
template <class _CharT, class _Alloc>
bool
operator< (const rope<_CharT,_Alloc>& __left,
const rope<_CharT,_Alloc>& __right) {
return __left.compare(__right) < 0;
}
template <class _CharT, class _Alloc>
bool
operator== (const rope<_CharT,_Alloc>& __left,
const rope<_CharT,_Alloc>& __right) {
return __left.compare(__right) == 0;
}
 
template <class _CharT, class _Alloc>
inline bool operator== (const _Rope_char_ptr_proxy<_CharT,_Alloc>& __x,
const _Rope_char_ptr_proxy<_CharT,_Alloc>& __y) {
return (__x._M_pos == __y._M_pos && __x._M_root == __y._M_root);
}
 
template <class _CharT, class _Alloc>
inline bool
operator!= (const rope<_CharT,_Alloc>& __x, const rope<_CharT,_Alloc>& __y) {
return !(__x == __y);
}
 
template <class _CharT, class _Alloc>
inline bool
operator> (const rope<_CharT,_Alloc>& __x, const rope<_CharT,_Alloc>& __y) {
return __y < __x;
}
 
template <class _CharT, class _Alloc>
inline bool
operator<= (const rope<_CharT,_Alloc>& __x, const rope<_CharT,_Alloc>& __y) {
return !(__y < __x);
}
 
template <class _CharT, class _Alloc>
inline bool
operator>= (const rope<_CharT,_Alloc>& __x, const rope<_CharT,_Alloc>& __y) {
return !(__x < __y);
}
 
template <class _CharT, class _Alloc>
inline bool operator!= (const _Rope_char_ptr_proxy<_CharT,_Alloc>& __x,
const _Rope_char_ptr_proxy<_CharT,_Alloc>& __y) {
return !(__x == __y);
}
 
template<class _CharT, class _Traits, class _Alloc>
basic_ostream<_CharT, _Traits>& operator<<
(basic_ostream<_CharT, _Traits>& __o,
const rope<_CharT, _Alloc>& __r);
 
typedef rope<char> crope;
typedef rope<wchar_t> wrope;
 
inline crope::reference __mutable_reference_at(crope& __c, size_t __i)
{
return __c.mutable_reference_at(__i);
}
 
inline wrope::reference __mutable_reference_at(wrope& __c, size_t __i)
{
return __c.mutable_reference_at(__i);
}
 
template <class _CharT, class _Alloc>
inline void swap(rope<_CharT,_Alloc>& __x, rope<_CharT,_Alloc>& __y) {
__x.swap(__y);
}
 
// Hash functions should probably be revisited later:
template<> struct hash<crope>
{
size_t operator()(const crope& __str) const
{
size_t __size = __str.size();
 
if (0 == __size) return 0;
return 13*__str[0] + 5*__str[__size - 1] + __size;
}
};
 
 
template<> struct hash<wrope>
{
size_t operator()(const wrope& __str) const
{
size_t __size = __str.size();
 
if (0 == __size) return 0;
return 13*__str[0] + 5*__str[__size - 1] + __size;
}
};
 
} // namespace std
 
# include <ext/ropeimpl.h>
 
# endif /* __SGI_STL_INTERNAL_ROPE_H */
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/ext/tree
0,0 → 1,23
 
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
 
#ifndef _CPP_EXT_TREE
#define _CPP_EXT_TREE 1
#include <bits/stl_tree.h>
#endif
 
// Local Variables:
// mode:C++
// End:
/contrib/media/updf/include/extern.h
0,0 → 1,148
/*-
* Copyright (c) 1994, 2000 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)extern.h 8.3 (Berkeley) 10/9/94
*/
 
struct timeval;
struct fd_set;
 
void abort_remote __P((FILE *));
void abortpt __P(());
void abortrecv __P(());
void abortsend __P(());
void account __P((int, char **));
int another __P((int *, char ***, char *));
void blkfree __P((char **));
void cd __P((int, char **));
void cdup __P((int, char **));
void changetype __P((int, int));
void cmdabort __P(());
void cmdscanner __P((int));
int command __P((const char *fmt, ...));
int confirm __P((char *, char *));
FILE *dataconn __P((char *));
void delete __P((int, char **));
void disconnect __P((int, char **));
void do_chmod __P((int, char **));
void do_umask __P((int, char **));
void domacro __P((int, char **));
char *domap __P((char *));
void doproxy __P((int, char **));
char *dotrans __P((char *));
void fatal __P((char *));
void get __P((int, char **));
struct cmd *getcmd __P((char *));
int getit __P((int, char **, int, char *));
int getreply __P((int));
char *globulize __P((char *));
char *gunique __P((char *));
void help __P((int, char **));
char *hookup __P((char *, int));
void site_idle __P((int, char **));
int initconn __P((void));
void intr __P(());
void lcd __P((int, char **));
int login __P((char *));
void lostpeer __P(());
void ls __P((int, char **));
void mabort __P((int));
void macdef __P((int, char **));
void makeargv __P((void));
void makedir __P((int, char **));
void mdelete __P((int, char **));
void mget __P((int, char **));
void mls __P((int, char **));
void modtime __P((int, char **));
void mput __P((int, char **));
char *onoff __P((int));
void newer __P((int, char **));
void proxabort __P(());
void proxtrans __P((char *, char *, char *));
void psabort __P(());
void pswitch __P((int));
void ptransfer __P((char *, long, struct timeval *, struct timeval *));
void put __P((int, char **));
void pwd __P((int, char **));
void quit __P((int, char **));
void quote __P((int, char **));
void quote1 __P((char *, int, char **));
void recvrequest __P((char *, char *, char *, char *, int));
void reget __P((int, char **));
char *remglob __P((char **, int));
void removedir __P((int, char **));
void renamefile __P((int, char **));
void reset __P((int, char **));
void restart __P((int, char **));
void rmthelp __P((int, char **));
void rmtstatus __P((int, char **));
int ruserpass __P((char *, char **, char **, char **));
void sendrequest __P((char *, char *, char *, int));
void setascii __P((int, char **));
void setbell __P((int, char **));
void setbinary __P((int, char **));
void setcase __P((int, char **));
void setcr __P((int, char **));
void setdebug __P((int, char **));
void setform __P((int, char **));
void setftmode __P((int, char **));
void setglob __P((int, char **));
void sethash __P((int, char **));
void setnmap __P((int, char **));
void setntrans __P((int, char **));
void setpassive __P((int, char **));
void setpeer __P((int, char **));
void setport __P((int, char **));
void setprompt __P((int, char **));
void setrunique __P((int, char **));
void setstruct __P((int, char **));
void setsunique __P((int, char **));
void settenex __P((int, char **));
void settrace __P((int, char **));
void settype __P((int, char **));
void setverbose __P((int, char **));
void shell __P((int, char **));
void site __P((int, char **));
void sizecmd __P((int, char **));
char *slurpstring __P((void));
void status __P((int, char **));
void syst __P((int, char **));
void tvsub __P((struct timeval *, struct timeval *, struct timeval *));
void user __P((int, char **));
 
extern jmp_buf abortprox;
extern int abrtflag;
extern struct cmd cmdtab[];
extern FILE *cout;
extern int data;
extern char *home;
extern jmp_buf jabort;
extern int proxy;
extern char reply_string[];
extern off_t restart_point;
extern int NCMDS;
/contrib/media/updf/include/externs.h
0,0 → 1,489
/*
* Copyright (c) 1988, 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)externs.h 8.3 (Berkeley) 5/30/95
*/
 
#ifndef BSD
# define BSD 43
#endif
 
#ifdef HAVE_TERMIOS_H
#define USE_TERMIO
#else /* !HAVE_TERMIOS_H */
#ifdef HAVE_TERMIO_H
#define USE_TERMIO
#define SYSV_TERMIO
#endif
#endif /* HAVE_TERMIOS_H */
 
/*
* ucb stdio.h defines BSD as something wierd
*/
#if defined(sun) && defined(__svr4__)
#define BSD 43
#endif
 
#ifndef USE_TERMIO
# if BSD > 43 || defined(SYSV_TERMIO)
# define USE_TERMIO
# endif
#endif
 
#include <stdio.h>
#include <setjmp.h>
#if defined(CRAY) && !defined(NO_BSD_SETJMP)
#include <bsdsetjmp.h>
#endif
#include <sys/ioctl.h>
#ifdef HAVE_SYS_FILIO_H
#include <sys/filio.h>
#endif
#ifdef CRAY
# include <errno.h>
#endif /* CRAY */
#ifdef USE_TERMIO
# ifndef VINTR
# ifdef SYSV_TERMIO
# include <termio.h>
# else
# include <termios.h>
# endif
# endif
#endif
#if defined(NO_CC_T) || !defined(USE_TERMIO)
# if !defined(USE_TERMIO)
typedef char cc_t;
# else
typedef unsigned char cc_t;
# endif
#endif
 
#if defined (USE_TERMIO) && !defined (SYSV_TERMIO)
# define termio termios
#endif
 
#ifndef NO_STRING_H
#include <string.h>
#else
#include <strings.h>
#endif
 
#ifndef _POSIX_VDISABLE
# ifdef sun
# include <sys/param.h> /* pick up VDISABLE definition, maybe */
# endif
# ifdef VDISABLE
# define _POSIX_VDISABLE VDISABLE
# else
# define _POSIX_VDISABLE ((cc_t)'\377')
# endif
#endif
 
#define SUBBUFSIZE 256
 
#ifndef CRAY
# ifndef errno
extern int errno; /* outside this world */
# endif
#endif /* !CRAY */
 
#ifndef __P
# ifdef __STDC__
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
 
extern int
autologin, /* Autologin enabled */
skiprc, /* Don't process the ~/.telnetrc file */
eight, /* use eight bit mode (binary in and/or out */
flushout, /* flush output */
connected, /* Are we connected to the other side? */
globalmode, /* Mode tty should be in */
In3270, /* Are we in 3270 mode? */
telnetport, /* Are we connected to the telnet port? */
localflow, /* Flow control handled locally */
restartany, /* If flow control, restart output on any character */
localchars, /* we recognize interrupt/quit */
donelclchars, /* the user has set "localchars" */
showoptions,
net, /* Network file descriptor */
tin, /* Terminal input file descriptor */
tout, /* Terminal output file descriptor */
crlf, /* Should '\r' be mapped to <CR><LF> (or <CR><NUL>)? */
autoflush, /* flush output when interrupting? */
autosynch, /* send interrupt characters with SYNCH? */
SYNCHing, /* Is the stream in telnet SYNCH mode? */
donebinarytoggle, /* the user has put us in binary */
dontlecho, /* do we suppress local echoing right now? */
crmod,
netdata, /* Print out network data flow */
prettydump, /* Print "netdata" output in user readable format */
#if defined(TN3270)
cursesdata, /* Print out curses data flow */
apitrace, /* Trace API transactions */
#endif /* defined(TN3270) */
termdata, /* Print out terminal data flow */
debug; /* Debug level */
 
extern cc_t escape; /* Escape to command mode */
extern cc_t rlogin; /* Rlogin mode escape character */
#ifdef KLUDGELINEMODE
extern cc_t echoc; /* Toggle local echoing */
#endif
 
extern char
*prompt; /* Prompt for command. */
 
extern char
doopt[],
dont[],
will[],
wont[],
options[], /* All the little options */
*hostname; /* Who are we connected to? */
#ifdef ENCRYPTION
extern void (*encrypt_output) P((unsigned char *, int));
extern int (*decrypt_input) P((int));
#endif /* ENCRYPTION */
 
/*
* We keep track of each side of the option negotiation.
*/
 
#define MY_STATE_WILL 0x01
#define MY_WANT_STATE_WILL 0x02
#define MY_STATE_DO 0x04
#define MY_WANT_STATE_DO 0x08
 
/*
* Macros to check the current state of things
*/
 
#define my_state_is_do(opt) (options[opt]&MY_STATE_DO)
#define my_state_is_will(opt) (options[opt]&MY_STATE_WILL)
#define my_want_state_is_do(opt) (options[opt]&MY_WANT_STATE_DO)
#define my_want_state_is_will(opt) (options[opt]&MY_WANT_STATE_WILL)
 
#define my_state_is_dont(opt) (!my_state_is_do(opt))
#define my_state_is_wont(opt) (!my_state_is_will(opt))
#define my_want_state_is_dont(opt) (!my_want_state_is_do(opt))
#define my_want_state_is_wont(opt) (!my_want_state_is_will(opt))
 
#define set_my_state_do(opt) {options[opt] |= MY_STATE_DO;}
#define set_my_state_will(opt) {options[opt] |= MY_STATE_WILL;}
#define set_my_want_state_do(opt) {options[opt] |= MY_WANT_STATE_DO;}
#define set_my_want_state_will(opt) {options[opt] |= MY_WANT_STATE_WILL;}
 
#define set_my_state_dont(opt) {options[opt] &= ~MY_STATE_DO;}
#define set_my_state_wont(opt) {options[opt] &= ~MY_STATE_WILL;}
#define set_my_want_state_dont(opt) {options[opt] &= ~MY_WANT_STATE_DO;}
#define set_my_want_state_wont(opt) {options[opt] &= ~MY_WANT_STATE_WILL;}
 
/*
* Make everything symetrical
*/
 
#define HIS_STATE_WILL MY_STATE_DO
#define HIS_WANT_STATE_WILL MY_WANT_STATE_DO
#define HIS_STATE_DO MY_STATE_WILL
#define HIS_WANT_STATE_DO MY_WANT_STATE_WILL
 
#define his_state_is_do my_state_is_will
#define his_state_is_will my_state_is_do
#define his_want_state_is_do my_want_state_is_will
#define his_want_state_is_will my_want_state_is_do
 
#define his_state_is_dont my_state_is_wont
#define his_state_is_wont my_state_is_dont
#define his_want_state_is_dont my_want_state_is_wont
#define his_want_state_is_wont my_want_state_is_dont
 
#define set_his_state_do set_my_state_will
#define set_his_state_will set_my_state_do
#define set_his_want_state_do set_my_want_state_will
#define set_his_want_state_will set_my_want_state_do
 
#define set_his_state_dont set_my_state_wont
#define set_his_state_wont set_my_state_dont
#define set_his_want_state_dont set_my_want_state_wont
#define set_his_want_state_wont set_my_want_state_dont
 
 
extern FILE
*NetTrace; /* Where debugging output goes */
extern unsigned char
NetTraceFile[]; /* Name of file where debugging output goes */
extern void
SetNetTrace __P((char *)); /* Function to change where debugging goes */
 
extern jmp_buf
peerdied,
toplevel; /* For error conditions. */
 
extern void
command __P((int, char *, int)),
Dump __P((char, unsigned char *, int)),
init_3270 __P((void)),
printoption __P((char *, int, int)),
printsub __P((char, unsigned char *, int)),
sendnaws __P((void)),
setconnmode __P((int)),
setcommandmode __P((void)),
setneturg __P((void)),
sys_telnet_init __P((void)),
telnet __P((char *)),
tel_enter_binary __P((int)),
TerminalFlushOutput __P((void)),
TerminalNewMode __P((int)),
TerminalRestoreState __P((void)),
TerminalSaveState __P((void)),
tninit __P((void)),
upcase __P((char *)),
willoption __P((int)),
wontoption __P((int));
 
extern void
send_do __P((int, int)),
send_dont __P((int, int)),
send_will __P((int, int)),
send_wont __P((int, int));
 
extern void
lm_will __P((unsigned char *, int)),
lm_wont __P((unsigned char *, int)),
lm_do __P((unsigned char *, int)),
lm_dont __P((unsigned char *, int)),
lm_mode __P((unsigned char *, int, int));
 
extern void
slc_init __P((void)),
slcstate __P((void)),
slc_mode_export __P((void)),
slc_mode_import __P((int)),
slc_import __P((int)),
slc_export __P((void)),
slc __P((unsigned char *, int)),
slc_check __P((void)),
slc_start_reply __P((void)),
slc_add_reply __P((unsigned char, unsigned char, cc_t)),
slc_end_reply __P((void));
extern int
slc_update __P((void));
 
extern void
env_opt __P((unsigned char *, int)),
env_opt_start __P((void)),
env_opt_start_info __P((void)),
env_opt_add __P((unsigned char *)),
env_opt_end __P((int));
 
extern unsigned char
*env_default __P((int, int)),
*env_getvalue __P((unsigned char *));
 
extern int
get_status __P((void)),
dosynch __P((void));
 
extern cc_t
*tcval __P((int));
 
#ifndef USE_TERMIO
 
extern struct tchars ntc;
extern struct ltchars nltc;
extern struct sgttyb nttyb;
 
# define termEofChar ntc.t_eofc
# define termEraseChar nttyb.sg_erase
# define termFlushChar nltc.t_flushc
# define termIntChar ntc.t_intrc
# define termKillChar nttyb.sg_kill
# define termLiteralNextChar nltc.t_lnextc
# define termQuitChar ntc.t_quitc
# define termSuspChar nltc.t_suspc
# define termRprntChar nltc.t_rprntc
# define termWerasChar nltc.t_werasc
# define termStartChar ntc.t_startc
# define termStopChar ntc.t_stopc
# define termForw1Char ntc.t_brkc
extern cc_t termForw2Char;
extern cc_t termAytChar;
 
# define termEofCharp (cc_t *)&ntc.t_eofc
# define termEraseCharp (cc_t *)&nttyb.sg_erase
# define termFlushCharp (cc_t *)&nltc.t_flushc
# define termIntCharp (cc_t *)&ntc.t_intrc
# define termKillCharp (cc_t *)&nttyb.sg_kill
# define termLiteralNextCharp (cc_t *)&nltc.t_lnextc
# define termQuitCharp (cc_t *)&ntc.t_quitc
# define termSuspCharp (cc_t *)&nltc.t_suspc
# define termRprntCharp (cc_t *)&nltc.t_rprntc
# define termWerasCharp (cc_t *)&nltc.t_werasc
# define termStartCharp (cc_t *)&ntc.t_startc
# define termStopCharp (cc_t *)&ntc.t_stopc
# define termForw1Charp (cc_t *)&ntc.t_brkc
# define termForw2Charp (cc_t *)&termForw2Char
# define termAytCharp (cc_t *)&termAytChar
 
# else
 
extern struct termio new_tc;
 
# define termEofChar new_tc.c_cc[VEOF]
# define termEraseChar new_tc.c_cc[VERASE]
# define termIntChar new_tc.c_cc[VINTR]
# define termKillChar new_tc.c_cc[VKILL]
# define termQuitChar new_tc.c_cc[VQUIT]
 
# ifndef VSUSP
extern cc_t termSuspChar;
# else
# define termSuspChar new_tc.c_cc[VSUSP]
# endif
# if defined(VFLUSHO) && !defined(VDISCARD)
# define VDISCARD VFLUSHO
# endif
# ifndef VDISCARD
extern cc_t termFlushChar;
# else
# define termFlushChar new_tc.c_cc[VDISCARD]
# endif
# ifndef VWERASE
extern cc_t termWerasChar;
# else
# define termWerasChar new_tc.c_cc[VWERASE]
# endif
# ifndef VREPRINT
extern cc_t termRprntChar;
# else
# define termRprntChar new_tc.c_cc[VREPRINT]
# endif
# ifndef VLNEXT
extern cc_t termLiteralNextChar;
# else
# define termLiteralNextChar new_tc.c_cc[VLNEXT]
# endif
# ifndef VSTART
extern cc_t termStartChar;
# else
# define termStartChar new_tc.c_cc[VSTART]
# endif
# ifndef VSTOP
extern cc_t termStopChar;
# else
# define termStopChar new_tc.c_cc[VSTOP]
# endif
# ifndef VEOL
extern cc_t termForw1Char;
# else
# define termForw1Char new_tc.c_cc[VEOL]
# endif
# ifndef VEOL2
extern cc_t termForw2Char;
# else
# define termForw2Char new_tc.c_cc[VEOL]
# endif
# ifndef VSTATUS
extern cc_t termAytChar;
#else
# define termAytChar new_tc.c_cc[VSTATUS]
#endif
 
# if !defined(CRAY) || defined(__STDC__)
# define termEofCharp &termEofChar
# define termEraseCharp &termEraseChar
# define termIntCharp &termIntChar
# define termKillCharp &termKillChar
# define termQuitCharp &termQuitChar
# define termSuspCharp &termSuspChar
# define termFlushCharp &termFlushChar
# define termWerasCharp &termWerasChar
# define termRprntCharp &termRprntChar
# define termLiteralNextCharp &termLiteralNextChar
# define termStartCharp &termStartChar
# define termStopCharp &termStopChar
# define termForw1Charp &termForw1Char
# define termForw2Charp &termForw2Char
# define termAytCharp &termAytChar
# else
/* Work around a compiler bug */
# define termEofCharp 0
# define termEraseCharp 0
# define termIntCharp 0
# define termKillCharp 0
# define termQuitCharp 0
# define termSuspCharp 0
# define termFlushCharp 0
# define termWerasCharp 0
# define termRprntCharp 0
# define termLiteralNextCharp 0
# define termStartCharp 0
# define termStopCharp 0
# define termForw1Charp 0
# define termForw2Charp 0
# define termAytCharp 0
# endif
#endif
 
 
/* Ring buffer structures which are shared */
 
extern Ring
netoring,
netiring,
ttyoring,
ttyiring;
 
/* Tn3270 section */
#if defined(TN3270)
 
extern int
HaveInput, /* Whether an asynchronous I/O indication came in */
noasynchtty, /* Don't do signals on I/O (SIGURG, SIGIO) */
noasynchnet, /* Don't do signals on I/O (SIGURG, SIGIO) */
sigiocount, /* Count of SIGIO receptions */
shell_active; /* Subshell is active */
 
extern char
*Ibackp, /* Oldest byte of 3270 data */
Ibuf[], /* 3270 buffer */
*Ifrontp, /* Where next 3270 byte goes */
tline[],
*transcom; /* Transparent command */
 
extern int
settranscom __P((int, char**));
 
extern void
inputAvailable __P((int));
#endif /* defined(TN3270) */
/contrib/media/updf/include/fcntl.h
0,0 → 1,120
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_fcntl_h_
#define __dj_include_fcntl_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#define FD_CLOEXEC 0x0001
 
#define F_DUPFD 1
#define F_GETFD 2
#define F_GETFL 3
#define F_GETLK 4
#define F_SETFD 5
#define F_SETFL 6
#define F_SETLK 7
#define F_SETLKW 8
 
#define F_UNLCK 0
#define F_RDLCK 1
#define F_WRLCK 2
 
#define O_RDONLY 0x0000
#define O_WRONLY 0x0001
#define O_RDWR 0x0002
#define O_ACCMODE 0x0003
 
#define O_BINARY 0x0004 /* must fit in char, reserved by dos */
#define O_TEXT 0x0008 /* must fit in char, reserved by dos */
#define O_NOINHERIT 0x0080 /* DOS-specific */
 
#define O_CREAT 0x0100 /* second byte, away from DOS bits */
#define O_EXCL 0x0200
#define O_NOCTTY 0x0400
#define O_TRUNC 0x0800
#define O_APPEND 0x1000
#define O_NONBLOCK 0x2000
 
#include <sys/types.h>
 
struct flock {
off_t l_len;
pid_t l_pid;
off_t l_start;
short l_type;
short l_whence;
};
 
extern int _fmode; /* O_TEXT or O_BINARY */
 
int open(const char *_path, int _oflag, ...);
int creat(const char *_path, mode_t _mode);
int fcntl(int _fildes, int _cmd, ...);
 
#define SH_COMPAT 0x0000
#define SH_DENYRW 0x0010
#define SH_DENYWR 0x0020
#define SH_DENYRD 0x0030
#define SH_DENYNO 0x0040
 
#define _SH_COMPAT SH_COMPAT
#define _SH_DENYRW SH_DENYRW
#define _SH_DENYWR SH_DENYWR
#define _SH_DENYRD SH_DENYRD
#define _SH_DENYNO SH_DENYNO
 
extern int __djgpp_share_flags;
 
#define S_IREAD S_IRUSR
#define S_IWRITE S_IWUSR
#define S_IEXEC S_IXUSR
 
/*
* For compatibility with other DOS C compilers.
*/
 
#define _O_RDONLY O_RDONLY
#define _O_WRONLY O_WRONLY
#define _O_RDWR O_RDWR
#define _O_APPEND O_APPEND
#define _O_CREAT O_CREAT
#define _O_TRUNC O_TRUNC
#define _O_EXCL O_EXCL
#define _O_TEXT O_TEXT
#define _O_BINARY O_BINARY
#define _O_NOINHERIT O_NOINHERIT
 
/*
* Support for advanced filesystems (Windows 9x VFAT, NTFS, LFN etc.)
*/
 
#define _FILESYS_UNKNOWN 0x80000000U
#define _FILESYS_CASE_SENSITIVE 0x0001
#define _FILESYS_CASE_PRESERVED 0x0002
#define _FILESYS_UNICODE 0x0004
#define _FILESYS_LFN_SUPPORTED 0x4000
#define _FILESYS_VOL_COMPRESSED 0x8000
 
unsigned _get_volume_info (const char *_path, int *_max_file_len, int *_max_path_len, char *_filesystype);
char _use_lfn (const char *_path);
char *_lfn_gen_short_fname (const char *_long_fname, char *_short_fname);
 
#define _LFN_CTIME 1
#define _LFN_ATIME 2
 
unsigned _lfn_get_ftime (int _handle, int _which);
 
char _preserve_fncase (void);
 
#ifndef _USE_LFN
#define _USE_LFN _use_lfn(0) /* assume it's the same on ALL drives */
#endif
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_fcntl_h_ */
/contrib/media/updf/include/fdset.h
0,0 → 1,45
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)fdset.h 8.1 (Berkeley) 6/6/93
*/
 
/*
* The following is defined just in case someone should want to run
* this telnet on a 4.2 system.
*
*/
 
#ifndef FD_SETSIZE
 
#define FD_SET(n, p) ((p)->fds_bits[0] |= (1<<(n)))
#define FD_CLR(n, p) ((p)->fds_bits[0] &= ~(1<<(n)))
#define FD_ISSET(n, p) ((p)->fds_bits[0] & (1<<(n)))
#define FD_ZERO(p) ((p)->fds_bits[0] = 0)
 
#endif
/contrib/media/updf/include/features.h
0,0 → 1,191
#ifndef _FEATURES_H
#define _FEATURES_H 1
 
#undef __USE_ISOC99
#undef __USE_POSIX
#undef __USE_POSIX2
#undef __USE_POSIX199309
#undef __USE_POSIX199506
#undef __USE_XOPEN
#undef __USE_XOPEN_EXTENDED
#undef __USE_UNIX98
#undef __USE_XOPEN2K
#undef __USE_LARGEFILE
#undef __USE_LARGEFILE64
#undef __USE_FILE_OFFSET64
#undef __USE_BSD
#undef __USE_SVID
#undef __USE_MISC
#undef __USE_GNU
#undef __USE_REENTRANT
#undef __FAVOR_BSD
#undef __KERNEL_STRICT_NAMES
 
#ifndef _LOOSE_KERNEL_NAMES
#define __KERNEL_STRICT_NAMES
#endif
 
#define __USE_ANSI 1
 
#if defined _BSD_SOURCE && \
!(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \
defined _GNU_SOURCE || defined _SVID_SOURCE)
# define __FAVOR_BSD 1
#endif
 
#ifdef _GNU_SOURCE
# undef _ISOC99_SOURCE
# define _ISOC99_SOURCE 1
# undef _POSIX_SOURCE
# define _POSIX_SOURCE 1
# undef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 199506L
# undef _XOPEN_SOURCE
# define _XOPEN_SOURCE 600
# undef _XOPEN_SOURCE_EXTENDED
# define _XOPEN_SOURCE_EXTENDED 1
# undef _LARGEFILE64_SOURCE
# define _LARGEFILE64_SOURCE 1
# undef _BSD_SOURCE
# define _BSD_SOURCE 1
# undef _SVID_SOURCE
# define _SVID_SOURCE 1
#endif
 
#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
!defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
!defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
!defined _BSD_SOURCE && !defined _SVID_SOURCE)
# define _BSD_SOURCE 1
# define _SVID_SOURCE 1
#endif
 
#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
# define __USE_ISOC99 1
#endif
 
#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \
!defined _POSIX_C_SOURCE)
# define _POSIX_SOURCE 1
# if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500
# define _POSIX_C_SOURCE 2
# else
# define _POSIX_C_SOURCE 199506L
# endif
#endif
 
#if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE
# define __USE_POSIX 1
#endif
 
#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE
# define __USE_POSIX2 1
#endif
 
#if (_POSIX_C_SOURCE - 0) >= 199309L
# define __USE_POSIX199309 1
#endif
 
#if (_POSIX_C_SOURCE - 0) >= 199506L
# define __USE_POSIX199506 1
#endif
 
#ifdef _XOPEN_SOURCE
# define __USE_XOPEN 1
# if (_XOPEN_SOURCE - 0) >= 500
# define __USE_XOPEN_EXTENDED 1
# define __USE_UNIX98 1
# undef _LARGEFILE_SOURCE
# define _LARGEFILE_SOURCE 1
# if (_XOPEN_SOURCE - 0) >= 600
# define __USE_XOPEN2K 1
# undef __USE_ISOC99
# define __USE_ISOC99 1
# endif
# else
# ifdef _XOPEN_SOURCE_EXTENDED
# define __USE_XOPEN_EXTENDED 1
# endif
# endif
#endif
 
#ifdef _LARGEFILE_SOURCE
# define __USE_LARGEFILE 1
#endif
 
#ifdef _LARGEFILE64_SOURCE
# define __USE_LARGEFILE64 1
#endif
 
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
# define __USE_FILE_OFFSET64 1
#endif
 
#if defined _BSD_SOURCE || defined _SVID_SOURCE
# define __USE_MISC 1
#endif
 
#ifdef _BSD_SOURCE
# define __USE_BSD 1
#endif
 
#ifdef _SVID_SOURCE
# define __USE_SVID 1
#endif
 
#ifdef _GNU_SOURCE
# define __USE_GNU 1
#endif
 
#if defined _REENTRANT || defined _THREAD_SAFE
# define __USE_REENTRANT 1
#endif
 
#define __STDC_IEC_559__ 1
#define __STDC_IEC_559_COMPLEX__ 1
 
#define __STDC_ISO_10646__ 200009L
 
#undef __GNU_LIBRARY__
#define __GNU_LIBRARY__ 6
 
#define __GLIBC__ 2
#define __GLIBC_MINOR__ 2
 
#if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#else
# define __GNUC_PREREQ(maj, min) 0
#endif
 
#define __GLIBC_PREREQ(maj, min) \
((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
 
# if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
# define __USE_LARGEFILE 1
# define __USE_LARGEFILE64 1
# endif
 
#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
&& !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
# define __USE_EXTERN_INLINES 1
#endif
 
/* This is here only because every header file already includes this one. */
#ifndef _LIBC
/* Get the definitions of all the appropriate `__stub_FUNCTION' symbols.
<gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub
which will always return failure (and set errno to ENOSYS).
 
We avoid including <gnu/stubs.h> when compiling the C library itself to
avoid a dependency loop. stubs.h depends on every object file. If
this #include were done for the library source code, then every object
file would depend on stubs.h. */
 
# include <gnu/stubs.h>
#endif
 
#endif /* features.h */
/contrib/media/updf/include/file.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_file_h_
#define __dj_include_file_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <sys/file.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_file_h_ */
/contrib/media/updf/include/filescanner.h
0,0 → 1,89
 
#ifndef __filescanner_h__
#define __filescanner_h__
 
#ifdef WIN32
#include <io.h>
#include <direct.h>
#define DIRSEP "\\"
#endif
 
#include <sys/stat.h>
 
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_DIRENT_H
#define _GCC_BUILD_
#include <dirent.h>
#define DIRSEP "/"
#endif //HAVE_DIRENT_H
 
#include <string.h>
#include "lispassert.h"
 
class CFileNode
{
public:
inline CFileNode() : iIsDir(0),iName(""),iDir("") {};
inline void Set(int aIsDir,char* aName)
{
iIsDir = aIsDir;
iName = aName;
strcpy(iFullName,iDir);
if (strlen(iDir))
strcat(iFullName,DIRSEP);
strcat(iFullName,aName);
}
inline int IsDirectory() {return iIsDir;};
inline char* FullName() {return iFullName;};
inline void SetRoot(char* aDir) {iDir=aDir;};
private:
int iIsDir;
char *iName;
char iFullName[500];
char* iDir;
};
 
class CFileScanner
{
public:
CFileScanner();
~CFileScanner();
CFileNode* First(char* base,char* dir);
CFileNode* Next();
private:
CFileScanner(const CFileScanner& aFileScanner)
: iCurNode()
#ifdef _GCC_BUILD_
,dp(NULL),entry(NULL),statbuf()
#endif
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
CFileScanner& operator=(const CFileScanner& aFileScanner)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
private:
CFileNode iCurNode;
 
char fulldir[500];
 
#ifdef _GCC_BUILD_
DIR *dp;
struct dirent* entry;
struct stat statbuf;
#endif
 
#ifdef WIN32
long handle;
struct _finddata_t info;
int first;
#endif
};
 
#endif // __scanfiles_h__
/contrib/media/updf/include/fix.h
0,0 → 1,64
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __FIX_H
#define __FIX_H
 
#if defined(_MSC_VER) || defined(__BORLANDC__)
#define int64 __int64
#else
#define int64 long long
#endif
 
/**
@file fix.h
@brief Implementation of operations of specific multiplication (FIX)
 
The functions in FIX.H have for goal to realize specific multiplication.
*/
 
/** @defgroup FIX FIX - Implementation of operations of specific multiplication */
/*@{*/
 
/**
Multiply two fixed-precision rational numbers.
@param a
@param b
@return Returns a * b
*/
static INLINE int fix_mul(int a, int b) {
int64 temp = (int64) a * (int64) b ;
temp += temp & 4096;
return (int) (temp >> 13) ;
}
 
/*@}*/
 
#endif /* __FIX_H */
/contrib/media/updf/include/float.h
0,0 → 1,116
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_float_h_
#define __dj_include_float_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
extern float __dj_float_epsilon;
extern float __dj_float_max;
extern float __dj_float_min;
 
#define FLT_DIG 6
#define FLT_EPSILON __dj_float_epsilon
#define FLT_MANT_DIG 24
#define FLT_MAX __dj_float_max
#define FLT_MAX_10_EXP 38
#define FLT_MAX_EXP 128
#define FLT_MIN __dj_float_min
#define FLT_MIN_10_EXP (-37)
#define FLT_MIN_EXP (-125)
#define FLT_RADIX 2
#define FLT_ROUNDS 1
 
extern double __dj_double_epsilon;
extern double __dj_double_max;
extern double __dj_double_min;
 
#define DBL_DIG 15
#define DBL_EPSILON __dj_double_epsilon
#define DBL_MANT_DIG 53
#define DBL_MAX __dj_double_max
#define DBL_MAX_10_EXP 308
#define DBL_MAX_EXP 1024
#define DBL_MIN __dj_double_min
#define DBL_MIN_10_EXP (-307)
#define DBL_MIN_EXP (-1021)
 
extern long double __dj_long_double_epsilon;
extern long double __dj_long_double_max;
extern long double __dj_long_double_min;
 
#define LDBL_DIG 18
#define LDBL_EPSILON __dj_long_double_epsilon
#define LDBL_MANT_DIG 64
#define LDBL_MAX __dj_long_double_max
#define LDBL_MAX_10_EXP 4932
#define LDBL_MAX_EXP 16384
#define LDBL_MIN __dj_long_double_min
#define LDBL_MIN_10_EXP (-4931)
#define LDBL_MIN_EXP (-16381)
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* These indicate the results of the last operation */
#define SW_INVALID 0x0001 /* Invalid operation */
#define SW_DENORMAL 0x0002 /* Denormalized operand */
#define SW_ZERODIVIDE 0x0004 /* Division by zero */
#define SW_OVERFLOW 0x0008 /* Overflow */
#define SW_UNDERFLOW 0x0010 /* Underflow (computational) */
#define SW_INEXACT 0x0020 /* Precision (computational) */
#define SW_STACKFAULT 0x0040 /* Stack Fault (over/under flow) */
#define SW_ERRORSUMMARY 0x0080 /* Error summary */
#define SW_COND 0x4700 /* Condition Code */
#define SW_C0 0x0100 /* Condition 0 bit */
#define SW_C1 0x0200 /* Condition 1 bit (also 0=stack underflow, 1=stack overflow) */
#define SW_C2 0x0400 /* Condition 2 bit */
#define SW_C3 0x4000 /* Condition 3 bit */
#define SW_TOP 0x3800 /* Top of stack */
#define SW_TOP_SHIFT 11 /* Shift to move TOS to LSB */
#define SW_BUSY 0x8000 /* FPU busy */
 
#define MCW_EM 0x003f /* Exception masks (0=fault, 1=handle) */
#define EM_INVALID 0x0001 /* Invalid operation */
#define EM_DENORMAL 0x0002 /* Denormalized operand */
#define EM_ZERODIVIDE 0x0004 /* Division by zero */
#define EM_OVERFLOW 0x0008 /* Overflow */
#define EM_UNDERFLOW 0x0010 /* Underflow */
#define EM_INEXACT 0x0020 /* Precision */
 
#define MCW_PC 0x0300 /* precision control */
#define PC_24 0x0000 /* 24 bits (single precision) */
#define PC_53 0x0200 /* 53 bits (double precision) */
#define PC_64 0x0300 /* 64 bits (extended precision) */
 
#define MCW_RC 0x0c00 /* Rounding control */
#define RC_NEAR 0x0000 /* Round to nearest or even */
#define RC_DOWN 0x0400 /* Round towards -Inf */
#define RC_UP 0x0800 /* Round towards +Inf */
#define RC_CHOP 0x0c00 /* Truncate towards zero */
 
#define MCW_IC 0x1000 /* obsolete; i486 is always affine */
#define IC_AFFINE 0x1000 /* -Inf < +Inf */
#define IC_PROJECTIVE 0x0000 /* -Inf == +Inf */
 
unsigned int _clear87(void);
unsigned int _control87(unsigned int newcw, unsigned int mask);
void _fpreset(void);
unsigned int _status87(void);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_float_h_ */
/contrib/media/updf/include/floatingpoint.h
0,0 → 1,0
/* empty file to please silly code in iolib.c and opcode.c */
/contrib/media/updf/include/fnmatch.h
0,0 → 1,40
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_fnmatch_h_
#define __dj_include_fnmatch_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#define FNM_NOESCAPE 0x01
#define FNM_PATHNAME 0x02
#define FNM_PERIOD 0x04
 
#define FNM_NOMATCH 1
#define FNM_ERROR 2
 
int fnmatch(const char *_pattern, const char *_string, int _flags);
 
#ifndef _POSIX_SOURCE
 
#define FNM_NOCASE 0x08
#define FNM_CASEFOLD FNM_NOCASE /* compatibility with GNU fnmatch */
#define FNM_IGNORECASE FNM_NOCASE /* compatibility with Solaris */
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_fnmatch_h_ */
/contrib/media/updf/include/form.h
0,0 → 1,388
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************
* Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1995,1997 *
****************************************************************************/
 
#ifndef FORM_H
#define FORM_H
 
#include <curses.h>
#include <eti.h>
 
#ifdef __cplusplus
extern "C" {
#endif
 
typedef int Form_Options;
typedef int Field_Options;
 
/**********
* _PAGE *
**********/
 
typedef struct {
short pmin; /* index of first field on page */
short pmax; /* index of last field on page */
short smin; /* index of top leftmost field on page */
short smax; /* index of bottom rightmost field on page */
} _PAGE;
 
/**********
* FIELD *
**********/
 
typedef struct fieldnode {
unsigned short status; /* flags */
short rows; /* size in rows */
short cols; /* size in cols */
short frow; /* first row */
short fcol; /* first col */
int drows; /* dynamic rows */
int dcols; /* dynamic cols */
int maxgrow; /* maximum field growth */
int nrow; /* offscreen rows */
short nbuf; /* additional buffers */
short just; /* justification */
short page; /* page on form */
short index; /* into form -> field */
int pad; /* pad character */
chtype fore; /* foreground attribute */
chtype back; /* background attribute */
Field_Options opts; /* options */
struct fieldnode * snext; /* sorted order pointer */
struct fieldnode * sprev; /* sorted order pointer */
struct fieldnode * link; /* linked field chain */
struct formnode * form; /* containing form */
struct typenode * type; /* field type */
void * arg; /* argument for type */
char * buf; /* field buffers */
void * usrptr; /* user pointer */
} FIELD;
 
/**************
* FIELDTYPE *
**************/
 
typedef struct typenode {
unsigned short status; /* flags */
long ref; /* reference count */
struct typenode * left; /* ptr to operand for | */
struct typenode * right; /* ptr to operand for | */
 
void* (*makearg)(va_list *); /* make fieldtype arg */
void* (*copyarg)(const void *); /* copy fieldtype arg */
void (*freearg)(void *); /* free fieldtype arg */
 
bool (*fcheck)(FIELD *,const void *); /* field validation */
bool (*ccheck)(int,const void *); /* character validation */
 
bool (*next)(FIELD *,const void *); /* enumerate next value */
bool (*prev)(FIELD *,const void *); /* enumerate prev value */
 
} FIELDTYPE;
 
/*********
* FORM *
*********/
 
typedef struct formnode {
unsigned short status; /* flags */
short rows; /* size in rows */
short cols; /* size in cols */
int currow; /* current row in field window*/
int curcol; /* current col in field window*/
int toprow; /* in scrollable field window */
int begincol; /* in horiz. scrollable field */
short maxfield; /* number of fields */
short maxpage; /* number of pages */
short curpage; /* index into page */
Form_Options opts; /* options */
WINDOW * win; /* window */
WINDOW * sub; /* subwindow */
WINDOW * w; /* window for current field */
FIELD ** field; /* field [maxfield] */
FIELD * current; /* current field */
_PAGE * page; /* page [maxpage] */
void * usrptr; /* user pointer */
 
void (*forminit)(struct formnode *);
void (*formterm)(struct formnode *);
void (*fieldinit)(struct formnode *);
void (*fieldterm)(struct formnode *);
 
} FORM;
 
typedef void (*Form_Hook)(FORM *);
 
/***************************
* miscellaneous #defines *
***************************/
 
/* field justification */
#define NO_JUSTIFICATION (0)
#define JUSTIFY_LEFT (1)
#define JUSTIFY_CENTER (2)
#define JUSTIFY_RIGHT (3)
 
/* field options */
#define O_VISIBLE (0x0001)
#define O_ACTIVE (0x0002)
#define O_PUBLIC (0x0004)
#define O_EDIT (0x0008)
#define O_WRAP (0x0010)
#define O_BLANK (0x0020)
#define O_AUTOSKIP (0x0040)
#define O_NULLOK (0x0080)
#define O_PASSOK (0x0100)
#define O_STATIC (0x0200)
 
/* form options */
#define O_NL_OVERLOAD (0x0001)
#define O_BS_OVERLOAD (0x0002)
 
/* form driver commands */
#define REQ_NEXT_PAGE (KEY_MAX + 1) /* move to next page */
#define REQ_PREV_PAGE (KEY_MAX + 2) /* move to previous page */
#define REQ_FIRST_PAGE (KEY_MAX + 3) /* move to first page */
#define REQ_LAST_PAGE (KEY_MAX + 4) /* move to last page */
 
#define REQ_NEXT_FIELD (KEY_MAX + 5) /* move to next field */
#define REQ_PREV_FIELD (KEY_MAX + 6) /* move to previous field */
#define REQ_FIRST_FIELD (KEY_MAX + 7) /* move to first field */
#define REQ_LAST_FIELD (KEY_MAX + 8) /* move to last field */
#define REQ_SNEXT_FIELD (KEY_MAX + 9) /* move to sorted next field */
#define REQ_SPREV_FIELD (KEY_MAX + 10) /* move to sorted prev field */
#define REQ_SFIRST_FIELD (KEY_MAX + 11) /* move to sorted first field */
#define REQ_SLAST_FIELD (KEY_MAX + 12) /* move to sorted last field */
#define REQ_LEFT_FIELD (KEY_MAX + 13) /* move to left to field */
#define REQ_RIGHT_FIELD (KEY_MAX + 14) /* move to right to field */
#define REQ_UP_FIELD (KEY_MAX + 15) /* move to up to field */
#define REQ_DOWN_FIELD (KEY_MAX + 16) /* move to down to field */
 
#define REQ_NEXT_CHAR (KEY_MAX + 17) /* move to next char in field */
#define REQ_PREV_CHAR (KEY_MAX + 18) /* move to prev char in field */
#define REQ_NEXT_LINE (KEY_MAX + 19) /* move to next line in field */
#define REQ_PREV_LINE (KEY_MAX + 20) /* move to prev line in field */
#define REQ_NEXT_WORD (KEY_MAX + 21) /* move to next word in field */
#define REQ_PREV_WORD (KEY_MAX + 22) /* move to prev word in field */
#define REQ_BEG_FIELD (KEY_MAX + 23) /* move to first char in field */
#define REQ_END_FIELD (KEY_MAX + 24) /* move after last char in fld */
#define REQ_BEG_LINE (KEY_MAX + 25) /* move to beginning of line */
#define REQ_END_LINE (KEY_MAX + 26) /* move after last char in line */
#define REQ_LEFT_CHAR (KEY_MAX + 27) /* move left in field */
#define REQ_RIGHT_CHAR (KEY_MAX + 28) /* move right in field */
#define REQ_UP_CHAR (KEY_MAX + 29) /* move up in field */
#define REQ_DOWN_CHAR (KEY_MAX + 30) /* move down in field */
 
#define REQ_NEW_LINE (KEY_MAX + 31) /* insert/overlay new line */
#define REQ_INS_CHAR (KEY_MAX + 32) /* insert blank char at cursor */
#define REQ_INS_LINE (KEY_MAX + 33) /* insert blank line at cursor */
#define REQ_DEL_CHAR (KEY_MAX + 34) /* delete char at cursor */
#define REQ_DEL_PREV (KEY_MAX + 35) /* delete char before cursor */
#define REQ_DEL_LINE (KEY_MAX + 36) /* delete line at cursor */
#define REQ_DEL_WORD (KEY_MAX + 37) /* delete line at cursor */
#define REQ_CLR_EOL (KEY_MAX + 38) /* clear to end of line */
#define REQ_CLR_EOF (KEY_MAX + 39) /* clear to end of field */
#define REQ_CLR_FIELD (KEY_MAX + 40) /* clear entire field */
#define REQ_OVL_MODE (KEY_MAX + 41) /* begin overlay mode */
#define REQ_INS_MODE (KEY_MAX + 42) /* begin insert mode */
#define REQ_SCR_FLINE (KEY_MAX + 43) /* scroll field forward a line */
#define REQ_SCR_BLINE (KEY_MAX + 44) /* scroll field backward a line */
#define REQ_SCR_FPAGE (KEY_MAX + 45) /* scroll field forward a page */
#define REQ_SCR_BPAGE (KEY_MAX + 46) /* scroll field backward a page */
#define REQ_SCR_FHPAGE (KEY_MAX + 47) /* scroll field forward half page */
#define REQ_SCR_BHPAGE (KEY_MAX + 48) /* scroll field backward half page */
#define REQ_SCR_FCHAR (KEY_MAX + 49) /* horizontal scroll char */
#define REQ_SCR_BCHAR (KEY_MAX + 50) /* horizontal scroll char */
#define REQ_SCR_HFLINE (KEY_MAX + 51) /* horizontal scroll line */
#define REQ_SCR_HBLINE (KEY_MAX + 52) /* horizontal scroll line */
#define REQ_SCR_HFHALF (KEY_MAX + 53) /* horizontal scroll half line */
#define REQ_SCR_HBHALF (KEY_MAX + 54) /* horizontal scroll half line */
 
#define REQ_VALIDATION (KEY_MAX + 55) /* validate field */
#define REQ_NEXT_CHOICE (KEY_MAX + 56) /* display next field choice */
#define REQ_PREV_CHOICE (KEY_MAX + 57) /* display prev field choice */
 
#define MIN_FORM_COMMAND (KEY_MAX + 1) /* used by form_driver */
#define MAX_FORM_COMMAND (KEY_MAX + 57) /* used by form_driver */
 
#if defined(MAX_COMMAND)
# if (MAX_FORM_COMMAND > MAX_COMMAND)
# error Something is wrong -- MAX_FORM_COMMAND is greater than MAX_COMMAND
# elif (MAX_COMMAND != (KEY_MAX + 128))
# error Something is wrong -- MAX_COMMAND is already inconsistently defined.
# endif
#else
# define MAX_COMMAND (KEY_MAX + 128)
#endif
 
/*************************
* standard field types *
*************************/
extern FIELDTYPE *TYPE_ALPHA,
*TYPE_ALNUM,
*TYPE_ENUM,
*TYPE_INTEGER,
*TYPE_NUMERIC,
*TYPE_REGEXP;
 
/************************************
* built-in additional field types *
* They are not defined in SVr4 *
************************************/
extern FIELDTYPE *TYPE_IPV4; /* Internet IP Version 4 address */
 
/***********************
* Default objects *
***********************/
extern FORM *_nc_Default_Form;
extern FIELD *_nc_Default_Field;
 
 
/***********************
* FIELDTYPE routines *
***********************/
extern FIELDTYPE
*new_fieldtype(
bool (* const field_check)(FIELD *,const void *),
bool (* const char_check)(int,const void *)),
*link_fieldtype(FIELDTYPE *,FIELDTYPE *);
 
extern int free_fieldtype(FIELDTYPE *),
set_fieldtype_arg(FIELDTYPE *,
void * (* const make_arg)(va_list *),
void * (* const copy_arg)(const void *),
void (* const free_arg)(void *)),
set_fieldtype_choice (FIELDTYPE *,
bool (* const next_choice)(FIELD *,const void *),
bool (* const prev_choice)(FIELD *,const void *));
 
/*******************
* FIELD routines *
*******************/
extern FIELD *new_field(int,int,int,int,int,int),
*dup_field(FIELD *,int,int),
*link_field(FIELD *,int,int);
 
extern int free_field(FIELD *),
field_info(const FIELD *,int *,int *,int *,int *,int *,int *),
dynamic_field_info(const FIELD *,int *,int *,int *),
set_max_field( FIELD *,int),
move_field(FIELD *,int,int),
set_field_type(FIELD *,FIELDTYPE *,...),
set_new_page(FIELD *,bool),
set_field_just(FIELD *,int),
field_just(const FIELD *),
set_field_fore(FIELD *,chtype),
set_field_back(FIELD *,chtype),
set_field_pad(FIELD *,int),
field_pad(const FIELD *),
set_field_buffer(FIELD *,int,const char *),
set_field_status(FIELD *,bool),
set_field_userptr(FIELD *, void *),
set_field_opts(FIELD *,Field_Options),
field_opts_on(FIELD *,Field_Options),
field_opts_off(FIELD *,Field_Options);
 
extern chtype field_fore(const FIELD *),
field_back(const FIELD *);
 
extern bool new_page(const FIELD *),
field_status(const FIELD *);
 
extern void *field_arg(const FIELD *);
 
extern void *field_userptr(const FIELD *);
 
extern FIELDTYPE
*field_type(const FIELD *);
 
extern char* field_buffer(const FIELD *,int);
 
extern Field_Options
field_opts(const FIELD *);
 
/******************
* FORM routines *
******************/
extern FORM *new_form(FIELD **);
 
extern FIELD **form_fields(const FORM *),
*current_field(const FORM *);
 
extern WINDOW *form_win(const FORM *),
*form_sub(const FORM *);
 
extern Form_Hook
form_init(const FORM *),
form_term(const FORM *),
field_init(const FORM *),
field_term(const FORM *);
 
extern int free_form(FORM *),
set_form_fields(FORM *,FIELD **),
field_count(const FORM *),
set_form_win(FORM *,WINDOW *),
set_form_sub(FORM *,WINDOW *),
set_current_field(FORM *,FIELD *),
field_index(const FIELD *),
set_form_page(FORM *,int),
form_page(const FORM *),
scale_form(const FORM *,int *,int *),
set_form_init(FORM *,Form_Hook),
set_form_term(FORM *,Form_Hook),
set_field_init(FORM *,Form_Hook),
set_field_term(FORM *,Form_Hook),
post_form(FORM *),
unpost_form(FORM *),
pos_form_cursor(FORM *),
form_driver(FORM *,int),
set_form_userptr(FORM *,void *),
set_form_opts(FORM *,Form_Options),
form_opts_on(FORM *,Form_Options),
form_opts_off(FORM *,Form_Options),
form_request_by_name(const char *);
 
extern const char
*form_request_name(int);
 
extern void *form_userptr(const FORM *);
 
extern Form_Options
form_opts(const FORM *);
 
extern bool data_ahead(const FORM *),
data_behind(const FORM *);
 
#ifdef __cplusplus
}
#endif
 
#endif /* FORM_H */
/contrib/media/updf/include/freetype/config/ftconfig.h
0,0 → 1,528
/***************************************************************************/
/* */
/* ftconfig.h */
/* */
/* ANSI-specific configuration file (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* This header file contains a number of macro definitions that are used */
/* by the rest of the engine. Most of the macros here are automatically */
/* determined at compile time, and you should not need to change it to */
/* port FreeType, except to compile the library with a non-ANSI */
/* compiler. */
/* */
/* Note however that if some specific modifications are needed, we */
/* advise you to place a modified copy in your build directory. */
/* */
/* The build directory is usually `freetype/builds/<system>', and */
/* contains system-specific files that are always included first when */
/* building the library. */
/* */
/* This ANSI version should stay in `include/freetype/config'. */
/* */
/*************************************************************************/
 
#ifndef __FTCONFIG_H__
#define __FTCONFIG_H__
 
#include <ft2build.h>
#include FT_CONFIG_OPTIONS_H
#include FT_CONFIG_STANDARD_LIBRARY_H
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* PLATFORM-SPECIFIC CONFIGURATION MACROS */
/* */
/* These macros can be toggled to suit a specific system. The current */
/* ones are defaults used to compile FreeType in an ANSI C environment */
/* (16bit compilers are also supported). Copy this file to your own */
/* `freetype/builds/<system>' directory, and edit it to port the engine. */
/* */
/*************************************************************************/
 
 
/* There are systems (like the Texas Instruments 'C54x) where a `char' */
/* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
/* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
/* is probably unexpected. */
/* */
/* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
/* `char' type. */
 
#ifndef FT_CHAR_BIT
#define FT_CHAR_BIT CHAR_BIT
#endif
 
 
/* The size of an `int' type. */
#if FT_UINT_MAX == 0xFFFFUL
#define FT_SIZEOF_INT (16 / FT_CHAR_BIT)
#elif FT_UINT_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_INT (32 / FT_CHAR_BIT)
#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
#define FT_SIZEOF_INT (64 / FT_CHAR_BIT)
#else
#error "Unsupported size of `int' type!"
#endif
 
/* The size of a `long' type. A five-byte `long' (as used e.g. on the */
/* DM642) is recognized but avoided. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT)
#else
#error "Unsupported size of `long' type!"
#endif
 
 
/* Preferred alignment of data */
#define FT_ALIGNMENT 8
 
 
/* FT_UNUSED is a macro used to indicate that a given parameter is not */
/* used -- this is only used to get rid of unpleasant compiler warnings */
#ifndef FT_UNUSED
#define FT_UNUSED( arg ) ( (arg) = (arg) )
#endif
 
 
/*************************************************************************/
/* */
/* AUTOMATIC CONFIGURATION MACROS */
/* */
/* These macros are computed from the ones defined above. Don't touch */
/* their definition, unless you know precisely what you are doing. No */
/* porter should need to mess with them. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* Mac support */
/* */
/* This is the only necessary change, so it is defined here instead */
/* providing a new configuration file. */
/* */
#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
( defined( __MWERKS__ ) && defined( macintosh ) )
/* no Carbon frameworks for 64bit 10.4.x */
#include "AvailabilityMacros.h"
#if defined( __LP64__ ) && \
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
#define DARWIN_NO_CARBON 1
#else
#define FT_MACINTOSH 1
#endif
 
#elif defined( __SC__ ) || defined( __MRC__ )
/* Classic MacOS compilers */
#include "ConditionalMacros.h"
#if TARGET_OS_MAC
#define FT_MACINTOSH 1
#endif
 
#endif
 
 
/*************************************************************************/
/* */
/* <Section> */
/* basic_types */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Int16 */
/* */
/* <Description> */
/* A typedef for a 16bit signed integer type. */
/* */
typedef signed short FT_Int16;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt16 */
/* */
/* <Description> */
/* A typedef for a 16bit unsigned integer type. */
/* */
typedef unsigned short FT_UInt16;
 
/* */
 
 
/* this #if 0 ... #endif clause is for documentation purposes */
#if 0
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Int32 */
/* */
/* <Description> */
/* A typedef for a 32bit signed integer type. The size depends on */
/* the configuration. */
/* */
typedef signed XXX FT_Int32;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt32 */
/* */
/* A typedef for a 32bit unsigned integer type. The size depends on */
/* the configuration. */
/* */
typedef unsigned XXX FT_UInt32;
 
/* */
 
#endif
 
#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)
 
typedef signed int FT_Int32;
typedef unsigned int FT_UInt32;
 
#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)
 
typedef signed long FT_Int32;
typedef unsigned long FT_UInt32;
 
#else
#error "no 32bit type found -- please check your configuration files"
#endif
 
 
/* look up an integer type that is at least 32 bits */
#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
 
typedef int FT_Fast;
typedef unsigned int FT_UFast;
 
#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)
 
typedef long FT_Fast;
typedef unsigned long FT_UFast;
 
#endif
 
 
/* determine whether we have a 64-bit int type for platforms without */
/* Autoconf */
#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)
 
/* FT_LONG64 must be defined if a 64-bit type is available */
#define FT_LONG64
#define FT_INT64 long
 
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
 
/* this compiler provides the __int64 type */
#define FT_LONG64
#define FT_INT64 __int64
 
#elif defined( __BORLANDC__ ) /* Borland C++ */
 
/* XXXX: We should probably check the value of __BORLANDC__ in order */
/* to test the compiler version. */
 
/* this compiler provides the __int64 type */
#define FT_LONG64
#define FT_INT64 __int64
 
#elif defined( __WATCOMC__ ) /* Watcom C++ */
 
/* Watcom doesn't provide 64-bit data types */
 
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
 
#define FT_LONG64
#define FT_INT64 long long int
 
#elif defined( __GNUC__ )
 
/* GCC provides the `long long' type */
#define FT_LONG64
#define FT_INT64 long long int
 
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
 
 
/*************************************************************************/
/* */
/* A 64-bit data type will create compilation problems if you compile */
/* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */
/* is defined. You can however ignore this rule by defining the */
/* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
/* */
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
 
#ifdef __STDC__
 
/* undefine the 64-bit macros in strict ANSI compilation mode */
#undef FT_LONG64
#undef FT_INT64
 
#endif /* __STDC__ */
 
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
 
 
#define FT_BEGIN_STMNT do {
#define FT_END_STMNT } while ( 0 )
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
 
 
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
/* Provide assembler fragments for performance-critical functions. */
/* These must be defined `static __inline__' with GCC. */
 
#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
 
/* documentation is in freetype.h */
 
static __inline FT_Int32
FT_MulFix_arm( FT_Int32 a,
FT_Int32 b )
{
register FT_Int32 t, t2;
 
 
__asm
{
smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
mov a, t, asr #31 /* a = (hi >> 31) */
add a, a, #0x8000 /* a += 0x8000 */
adds t2, t2, a /* t2 += a */
adc t, t, #0 /* t += carry */
mov a, t2, lsr #16 /* a = t2 >> 16 */
orr a, a, t, lsl #16 /* a |= t << 16 */
}
return a;
}
 
#endif /* __CC_ARM || __ARMCC__ */
 
 
#ifdef __GNUC__
 
#if defined( __arm__ ) && !defined( __thumb__ ) && \
!( defined( __CC_ARM ) || defined( __ARMCC__ ) )
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
 
/* documentation is in freetype.h */
 
static __inline__ FT_Int32
FT_MulFix_arm( FT_Int32 a,
FT_Int32 b )
{
register FT_Int32 t, t2;
 
 
asm __volatile__ (
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
"mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
"add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
"adds %1, %1, %0\n\t" /* %1 += %0 */
"adc %2, %2, #0\n\t" /* %2 += carry */
"mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
"orr %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
: "=r"(a), "=&r"(t2), "=&r"(t)
: "r"(a), "r"(b) );
return a;
}
 
#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
 
#if defined( __i386__ )
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
 
/* documentation is in freetype.h */
 
static __inline__ FT_Int32
FT_MulFix_i386( FT_Int32 a,
FT_Int32 b )
{
register FT_Int32 result;
 
 
__asm__ __volatile__ (
"imul %%edx\n"
"movl %%edx, %%ecx\n"
"sarl $31, %%ecx\n"
"addl $0x8000, %%ecx\n"
"addl %%ecx, %%eax\n"
"adcl $0, %%edx\n"
"shrl $16, %%eax\n"
"shll $16, %%edx\n"
"addl %%edx, %%eax\n"
: "=a"(result), "=d"(b)
: "a"(a), "d"(b)
: "%ecx", "cc" );
return result;
}
 
#endif /* i386 */
 
#endif /* __GNUC__ */
 
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
 
 
#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
#ifdef FT_MULFIX_ASSEMBLER
#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER
#endif
#endif
 
 
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
 
#define FT_LOCAL( x ) static x
#define FT_LOCAL_DEF( x ) static x
 
#else
 
#ifdef __cplusplus
#define FT_LOCAL( x ) extern "C" x
#define FT_LOCAL_DEF( x ) extern "C" x
#else
#define FT_LOCAL( x ) extern x
#define FT_LOCAL_DEF( x ) x
#endif
 
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
 
 
#ifndef FT_BASE
 
#ifdef __cplusplus
#define FT_BASE( x ) extern "C" x
#else
#define FT_BASE( x ) extern x
#endif
 
#endif /* !FT_BASE */
 
 
#ifndef FT_BASE_DEF
 
#ifdef __cplusplus
#define FT_BASE_DEF( x ) x
#else
#define FT_BASE_DEF( x ) x
#endif
 
#endif /* !FT_BASE_DEF */
 
 
#ifndef FT_EXPORT
 
#ifdef __cplusplus
#define FT_EXPORT( x ) extern "C" x
#else
#define FT_EXPORT( x ) extern x
#endif
 
#endif /* !FT_EXPORT */
 
 
#ifndef FT_EXPORT_DEF
 
#ifdef __cplusplus
#define FT_EXPORT_DEF( x ) extern "C" x
#else
#define FT_EXPORT_DEF( x ) extern x
#endif
 
#endif /* !FT_EXPORT_DEF */
 
 
#ifndef FT_EXPORT_VAR
 
#ifdef __cplusplus
#define FT_EXPORT_VAR( x ) extern "C" x
#else
#define FT_EXPORT_VAR( x ) extern x
#endif
 
#endif /* !FT_EXPORT_VAR */
 
/* The following macros are needed to compile the library with a */
/* C++ compiler and with 16bit compilers. */
/* */
 
/* This is special. Within C++, you must specify `extern "C"' for */
/* functions which are used via function pointers, and you also */
/* must do that for structures which contain function pointers to */
/* assure C linkage -- it's not possible to have (local) anonymous */
/* functions which are accessed by (global) function pointers. */
/* */
/* */
/* FT_CALLBACK_DEF is used to _define_ a callback function. */
/* */
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
/* contains pointers to callback functions. */
/* */
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
/* that contains pointers to callback functions. */
/* */
/* */
/* Some 16bit compilers have to redefine these macros to insert */
/* the infamous `_cdecl' or `__fastcall' declarations. */
/* */
#ifndef FT_CALLBACK_DEF
#ifdef __cplusplus
#define FT_CALLBACK_DEF( x ) extern "C" x
#else
#define FT_CALLBACK_DEF( x ) static x
#endif
#endif /* FT_CALLBACK_DEF */
 
#ifndef FT_CALLBACK_TABLE
#ifdef __cplusplus
#define FT_CALLBACK_TABLE extern "C"
#define FT_CALLBACK_TABLE_DEF extern "C"
#else
#define FT_CALLBACK_TABLE extern
#define FT_CALLBACK_TABLE_DEF /* nothing */
#endif
#endif /* FT_CALLBACK_TABLE */
 
 
FT_END_HEADER
 
 
#endif /* __FTCONFIG_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/config/ftheader.h
0,0 → 1,780
/***************************************************************************/
/* */
/* ftheader.h */
/* */
/* Build macros of the FreeType 2 library. */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
#ifndef __FT_HEADER_H__
#define __FT_HEADER_H__
 
 
/*@***********************************************************************/
/* */
/* <Macro> */
/* FT_BEGIN_HEADER */
/* */
/* <Description> */
/* This macro is used in association with @FT_END_HEADER in header */
/* files to ensure that the declarations within are properly */
/* encapsulated in an `extern "C" { .. }' block when included from a */
/* C++ compiler. */
/* */
#ifdef __cplusplus
#define FT_BEGIN_HEADER extern "C" {
#else
#define FT_BEGIN_HEADER /* nothing */
#endif
 
 
/*@***********************************************************************/
/* */
/* <Macro> */
/* FT_END_HEADER */
/* */
/* <Description> */
/* This macro is used in association with @FT_BEGIN_HEADER in header */
/* files to ensure that the declarations within are properly */
/* encapsulated in an `extern "C" { .. }' block when included from a */
/* C++ compiler. */
/* */
#ifdef __cplusplus
#define FT_END_HEADER }
#else
#define FT_END_HEADER /* nothing */
#endif
 
 
/*************************************************************************/
/* */
/* Aliases for the FreeType 2 public and configuration files. */
/* */
/*************************************************************************/
 
/*************************************************************************/
/* */
/* <Section> */
/* header_file_macros */
/* */
/* <Title> */
/* Header File Macros */
/* */
/* <Abstract> */
/* Macro definitions used to #include specific header files. */
/* */
/* <Description> */
/* The following macros are defined to the name of specific */
/* FreeType~2 header files. They can be used directly in #include */
/* statements as in: */
/* */
/* { */
/* #include FT_FREETYPE_H */
/* #include FT_MULTIPLE_MASTERS_H */
/* #include FT_GLYPH_H */
/* } */
/* */
/* There are several reasons why we are now using macros to name */
/* public header files. The first one is that such macros are not */
/* limited to the infamous 8.3~naming rule required by DOS (and */
/* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
/* */
/* The second reason is that it allows for more flexibility in the */
/* way FreeType~2 is installed on a given system. */
/* */
/*************************************************************************/
 
 
/* configuration files */
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_CONFIG_H
*
* @description:
* A macro used in #include statements to name the file containing
* FreeType~2 configuration data.
*
*/
#ifndef FT_CONFIG_CONFIG_H
#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h>
#endif
 
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_STANDARD_LIBRARY_H
*
* @description:
* A macro used in #include statements to name the file containing
* FreeType~2 interface to the standard C library functions.
*
*/
#ifndef FT_CONFIG_STANDARD_LIBRARY_H
#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
#endif
 
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_OPTIONS_H
*
* @description:
* A macro used in #include statements to name the file containing
* FreeType~2 project-specific configuration options.
*
*/
#ifndef FT_CONFIG_OPTIONS_H
#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
#endif
 
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_MODULES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list of FreeType~2 modules that are statically linked to new library
* instances in @FT_Init_FreeType.
*
*/
#ifndef FT_CONFIG_MODULES_H
#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h>
#endif
 
/* */
 
/* public headers */
 
/*************************************************************************
*
* @macro:
* FT_FREETYPE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* base FreeType~2 API.
*
*/
#define FT_FREETYPE_H <freetype/freetype.h>
 
 
/*************************************************************************
*
* @macro:
* FT_ERRORS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list of FreeType~2 error codes (and messages).
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_ERRORS_H <freetype/fterrors.h>
 
 
/*************************************************************************
*
* @macro:
* FT_MODULE_ERRORS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list of FreeType~2 module error offsets (and messages).
*
*/
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SYSTEM_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 interface to low-level operations (i.e., memory management
* and stream i/o).
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_SYSTEM_H <freetype/ftsystem.h>
 
 
/*************************************************************************
*
* @macro:
* FT_IMAGE_H
*
* @description:
* A macro used in #include statements to name the file containing type
* definitions related to glyph images (i.e., bitmaps, outlines,
* scan-converter parameters).
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_IMAGE_H <freetype/ftimage.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TYPES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* basic data types defined by FreeType~2.
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_TYPES_H <freetype/fttypes.h>
 
 
/*************************************************************************
*
* @macro:
* FT_LIST_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list management API of FreeType~2.
*
* (Most applications will never need to include this file.)
*
*/
#define FT_LIST_H <freetype/ftlist.h>
 
 
/*************************************************************************
*
* @macro:
* FT_OUTLINE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* scalable outline management API of FreeType~2.
*
*/
#define FT_OUTLINE_H <freetype/ftoutln.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SIZES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API which manages multiple @FT_Size objects per face.
*
*/
#define FT_SIZES_H <freetype/ftsizes.h>
 
 
/*************************************************************************
*
* @macro:
* FT_MODULE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* module management API of FreeType~2.
*
*/
#define FT_MODULE_H <freetype/ftmodapi.h>
 
 
/*************************************************************************
*
* @macro:
* FT_RENDER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* renderer module management API of FreeType~2.
*
*/
#define FT_RENDER_H <freetype/ftrender.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TYPE1_TABLES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* types and API specific to the Type~1 format.
*
*/
#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRUETYPE_IDS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* enumeration values which identify name strings, languages, encodings,
* etc. This file really contains a _large_ set of constant macro
* definitions, taken from the TrueType and OpenType specifications.
*
*/
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRUETYPE_TABLES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* types and API specific to the TrueType (as well as OpenType) format.
*
*/
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRUETYPE_TAGS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of TrueType four-byte `tags' which identify blocks in
* SFNT-based font formats (i.e., TrueType and OpenType).
*
*/
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
 
 
/*************************************************************************
*
* @macro:
* FT_BDF_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which accesses BDF-specific strings from a
* face.
*
*/
#define FT_BDF_H <freetype/ftbdf.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CID_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which access CID font information from a
* face.
*
*/
#define FT_CID_H <freetype/ftcid.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GZIP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which supports gzip-compressed files.
*
*/
#define FT_GZIP_H <freetype/ftgzip.h>
 
 
/*************************************************************************
*
* @macro:
* FT_LZW_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which supports LZW-compressed files.
*
*/
#define FT_LZW_H <freetype/ftlzw.h>
 
 
/*************************************************************************
*
* @macro:
* FT_WINFONTS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which supports Windows FNT files.
*
*/
#define FT_WINFONTS_H <freetype/ftwinfnt.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GLYPH_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional glyph management component.
*
*/
#define FT_GLYPH_H <freetype/ftglyph.h>
 
 
/*************************************************************************
*
* @macro:
* FT_BITMAP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional bitmap conversion component.
*
*/
#define FT_BITMAP_H <freetype/ftbitmap.h>
 
 
/*************************************************************************
*
* @macro:
* FT_BBOX_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional exact bounding box computation routines.
*
*/
#define FT_BBOX_H <freetype/ftbbox.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional FreeType~2 cache sub-system.
*
*/
#define FT_CACHE_H <freetype/ftcache.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_IMAGE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `glyph image' API of the FreeType~2 cache sub-system.
*
* It is used to define a cache for @FT_Glyph elements. You can also
* use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to
* store small glyph bitmaps, as it will use less memory.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* glyph image-related cache declarations.
*
*/
#define FT_CACHE_IMAGE_H FT_CACHE_H
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_SMALL_BITMAPS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `small bitmaps' API of the FreeType~2 cache sub-system.
*
* It is used to define a cache for small glyph bitmaps in a relatively
* memory-efficient way. You can also use the API defined in
* @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,
* including scalable outlines.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* small bitmaps-related cache declarations.
*
*/
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_CHARMAP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `charmap' API of the FreeType~2 cache sub-system.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* charmap-based cache declarations.
*
*/
#define FT_CACHE_CHARMAP_H FT_CACHE_H
 
 
/*************************************************************************
*
* @macro:
* FT_MAC_H
*
* @description:
* A macro used in #include statements to name the file containing the
* Macintosh-specific FreeType~2 API. The latter is used to access
* fonts embedded in resource forks.
*
* This header file must be explicitly included by client applications
* compiled on the Mac (note that the base API still works though).
*
*/
#define FT_MAC_H <freetype/ftmac.h>
 
 
/*************************************************************************
*
* @macro:
* FT_MULTIPLE_MASTERS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional multiple-masters management API of FreeType~2.
*
*/
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SFNT_NAMES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which accesses embedded `name' strings in
* SFNT-based font formats (i.e., TrueType and OpenType).
*
*/
#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
 
 
/*************************************************************************
*
* @macro:
* FT_OPENTYPE_VALIDATE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which validates OpenType tables (BASE, GDEF,
* GPOS, GSUB, JSTF).
*
*/
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GX_VALIDATE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,
* mort, morx, bsln, just, kern, opbd, trak, prop).
*
*/
#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
 
 
/*************************************************************************
*
* @macro:
* FT_PFR_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which accesses PFR-specific data.
*
*/
#define FT_PFR_H <freetype/ftpfr.h>
 
 
/*************************************************************************
*
* @macro:
* FT_STROKER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which provides functions to stroke outline paths.
*/
#define FT_STROKER_H <freetype/ftstroke.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SYNTHESIS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs artificial obliquing and emboldening.
*/
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
 
 
/*************************************************************************
*
* @macro:
* FT_XFREE86_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which provides functions specific to the XFree86 and
* X.Org X11 servers.
*/
#define FT_XFREE86_H <freetype/ftxf86.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRIGONOMETRY_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs trigonometric computations (e.g.,
* cosines and arc tangents).
*/
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
 
 
/*************************************************************************
*
* @macro:
* FT_LCD_FILTER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
 
 
/*************************************************************************
*
* @macro:
* FT_UNPATENTED_HINTING_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h>
 
 
/*************************************************************************
*
* @macro:
* FT_INCREMENTAL_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GASP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which returns entries from the TrueType GASP table.
*/
#define FT_GASP_H <freetype/ftgasp.h>
 
 
/*************************************************************************
*
* @macro:
* FT_ADVANCES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which returns individual and ranged glyph advances.
*/
#define FT_ADVANCES_H <freetype/ftadvanc.h>
 
 
/* */
 
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
 
 
/* The internals of the cache sub-system are no longer exposed. We */
/* default to FT_CACHE_H at the moment just in case, but we know of */
/* no rogue client that uses them. */
/* */
#define FT_CACHE_MANAGER_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h>
 
 
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
 
#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
 
 
/*
* Include internal headers definitions from <freetype/internal/...>
* only when building the library.
*/
#ifdef FT2_BUILD_LIBRARY
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
#include FT_INTERNAL_INTERNAL_H
#endif /* FT2_BUILD_LIBRARY */
 
 
#endif /* __FT2_BUILD_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/config/ftmodule.h
0,0 → 1,26
/*
* This file registers the FreeType modules compiled into the library.
*
* If you use GNU make, this file IS NOT USED! Instead, it is created in
* the objects directory (normally `<topdir>/objs/') based on information
* from `<topdir>/modules.cfg'.
*
* Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
* FreeType without GNU make.
*
*/
 
FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
FT_USE_MODULE( FT_Module_Class, psaux_module_class )
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
 
/* EOF */
/contrib/media/updf/include/freetype/config/ftoption.h
0,0 → 1,733
/***************************************************************************/
/* */
/* ftoption.h */
/* */
/* User-selectable configuration macros (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTOPTION_H__
#define __FTOPTION_H__
 
 
#include <ft2build.h>
 
 
FT_BEGIN_HEADER
 
/*************************************************************************/
/* */
/* USER-SELECTABLE CONFIGURATION MACROS */
/* */
/* This file contains the default configuration macro definitions for */
/* a standard build of the FreeType library. There are three ways to */
/* use this file to build project-specific versions of the library: */
/* */
/* - You can modify this file by hand, but this is not recommended in */
/* cases where you would like to build several versions of the */
/* library from a single source directory. */
/* */
/* - You can put a copy of this file in your build directory, more */
/* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
/* is the name of a directory that is included _before_ the FreeType */
/* include path during compilation. */
/* */
/* The default FreeType Makefiles and Jamfiles use the build */
/* directory `builds/<system>' by default, but you can easily change */
/* that for your own projects. */
/* */
/* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
/* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
/* locate this file during the build. For example, */
/* */
/* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
/* #include <freetype/config/ftheader.h> */
/* */
/* will use `$BUILD/myftoptions.h' instead of this file for macro */
/* definitions. */
/* */
/* Note also that you can similarly pre-define the macro */
/* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
/* that are statically linked to the library at compile time. By */
/* default, this file is <freetype/config/ftmodule.h>. */
/* */
/* We highly recommend using the third method whenever possible. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* Uncomment the line below if you want to activate sub-pixel rendering */
/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
/* */
/* Note that this feature is covered by several Microsoft patents */
/* and should not be activated in any default build of the library. */
/* */
/* This macro has no impact on the FreeType API, only on its */
/* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
/* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
/* the original size in case this macro isn't defined; however, each */
/* triplet of subpixels has R=G=B. */
/* */
/* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* */
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
 
 
/*************************************************************************/
/* */
/* Many compilers provide a non-ANSI 64-bit data type that can be used */
/* by FreeType to speed up some computations. However, this will create */
/* some problems when compiling the library in strict ANSI mode. */
/* */
/* For this reason, the use of 64-bit integers is normally disabled when */
/* the __STDC__ macro is defined. You can however disable this by */
/* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
/* */
/* For most compilers, this will only create compilation warnings when */
/* building the library. */
/* */
/* ObNote: The compiler-specific 64-bit integers are detected in the */
/* file `ftconfig.h' either statically or through the */
/* `configure' script on supported platforms. */
/* */
#undef FT_CONFIG_OPTION_FORCE_INT64
 
 
/*************************************************************************/
/* */
/* If this macro is defined, do not try to use an assembler version of */
/* performance-critical functions (e.g. FT_MulFix). You should only do */
/* that to verify that the assembler function works properly, or to */
/* execute benchmark tests of the various implementations. */
/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
 
 
/*************************************************************************/
/* */
/* If this macro is defined, try to use an inlined assembler version of */
/* the `FT_MulFix' function, which is a `hotspot' when loading and */
/* hinting glyphs, and which should be executed as fast as possible. */
/* */
/* Note that if your compiler or CPU is not supported, this will default */
/* to the standard and portable implementation found in `ftcalc.c'. */
/* */
#define FT_CONFIG_OPTION_INLINE_MULFIX
 
 
/*************************************************************************/
/* */
/* LZW-compressed file support. */
/* */
/* FreeType now handles font files that have been compressed with the */
/* `compress' program. This is mostly used to parse many of the PCF */
/* files that come with various X11 distributions. The implementation */
/* uses NetBSD's `zopen' to partially uncompress the file on the fly */
/* (see src/lzw/ftgzip.c). */
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
#define FT_CONFIG_OPTION_USE_LZW
 
 
/*************************************************************************/
/* */
/* Gzip-compressed file support. */
/* */
/* FreeType now handles font files that have been compressed with the */
/* `gzip' program. This is mostly used to parse many of the PCF files */
/* that come with XFree86. The implementation uses `zlib' to */
/* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
/* */
/* Define this macro if you want to enable this `feature'. See also */
/* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
/* */
#define FT_CONFIG_OPTION_USE_ZLIB
 
 
/*************************************************************************/
/* */
/* ZLib library selection */
/* */
/* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
/* It allows FreeType's `ftgzip' component to link to the system's */
/* installation of the ZLib library. This is useful on systems like */
/* Unix or VMS where it generally is already available. */
/* */
/* If you let it undefined, the component will use its own copy */
/* of the zlib sources instead. These have been modified to be */
/* included directly within the component and *not* export external */
/* function names. This allows you to link any program with FreeType */
/* _and_ ZLib without linking conflicts. */
/* */
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
/* */
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
 
 
/*************************************************************************/
/* */
/* DLL export compilation */
/* */
/* When compiling FreeType as a DLL, some systems/compilers need a */
/* special keyword in front OR after the return type of function */
/* declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
/* will be later automatically defined as `extern return_type' to */
/* allow normal compilation. */
/* */
/* Do not #undef these macros here since the build system might define */
/* them for certain configurations only. */
/* */
/* #define FT_EXPORT(x) extern x */
/* #define FT_EXPORT_DEF(x) x */
 
 
/*************************************************************************/
/* */
/* Glyph Postscript Names handling */
/* */
/* By default, FreeType 2 is compiled with the `psnames' module. This */
/* module is in charge of converting a glyph name string into a */
/* Unicode value, or return a Macintosh standard glyph name for the */
/* use with the TrueType `post' table. */
/* */
/* Undefine this macro if you do not want `psnames' compiled in your */
/* build of FreeType. This has the following effects: */
/* */
/* - The TrueType driver will provide its own set of glyph names, */
/* if you build it to support postscript names in the TrueType */
/* `post' table. */
/* */
/* - The Type 1 driver will not be able to synthesize a Unicode */
/* charmap out of the glyphs found in the fonts. */
/* */
/* You would normally undefine this configuration macro when building */
/* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
/* */
#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
 
 
/*************************************************************************/
/* */
/* Postscript Names to Unicode Values support */
/* */
/* By default, FreeType 2 is built with the `PSNames' module compiled */
/* in. Among other things, the module is used to convert a glyph name */
/* into a Unicode value. This is especially useful in order to */
/* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */
/* through a big table named the `Adobe Glyph List' (AGL). */
/* */
/* Undefine this macro if you do not want the Adobe Glyph List */
/* compiled in your `PSNames' module. The Type 1 driver will not be */
/* able to synthesize a Unicode charmap out of the glyphs found in the */
/* fonts. */
/* */
#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
 
 
/*************************************************************************/
/* */
/* Support for Mac fonts */
/* */
/* Define this macro if you want support for outline fonts in Mac */
/* format (mac dfont, mac resource, macbinary containing a mac */
/* resource) on non-Mac platforms. */
/* */
/* Note that the `FOND' resource isn't checked. */
/* */
#define FT_CONFIG_OPTION_MAC_FONTS
 
 
/*************************************************************************/
/* */
/* Guessing methods to access embedded resource forks */
/* */
/* Enable extra Mac fonts support on non-Mac platforms (e.g. */
/* GNU/Linux). */
/* */
/* Resource forks which include fonts data are stored sometimes in */
/* locations which users or developers don't expected. In some cases, */
/* resource forks start with some offset from the head of a file. In */
/* other cases, the actual resource fork is stored in file different */
/* from what the user specifies. If this option is activated, */
/* FreeType tries to guess whether such offsets or different file */
/* names must be used. */
/* */
/* Note that normal, direct access of resource forks is controlled via */
/* the FT_CONFIG_OPTION_MAC_FONTS option. */
/* */
#ifdef FT_CONFIG_OPTION_MAC_FONTS
#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
#endif
 
 
/*************************************************************************/
/* */
/* Allow the use of FT_Incremental_Interface to load typefaces that */
/* contain no glyph data, but supply it via a callback function. */
/* This is required by clients supporting document formats which */
/* supply font data incrementally as the document is parsed, such */
/* as the Ghostscript interpreter for the PostScript language. */
/* */
#define FT_CONFIG_OPTION_INCREMENTAL
 
 
/*************************************************************************/
/* */
/* The size in bytes of the render pool used by the scan-line converter */
/* to do all of its work. */
/* */
/* This must be greater than 4KByte if you use FreeType to rasterize */
/* glyphs; otherwise, you may set it to zero to avoid unnecessary */
/* allocation of the render pool. */
/* */
#define FT_RENDER_POOL_SIZE 16384L
 
 
/*************************************************************************/
/* */
/* FT_MAX_MODULES */
/* */
/* The maximum number of modules that can be registered in a single */
/* FreeType library object. 32 is the default. */
/* */
#define FT_MAX_MODULES 32
 
 
/*************************************************************************/
/* */
/* Debug level */
/* */
/* FreeType can be compiled in debug or trace mode. In debug mode, */
/* errors are reported through the `ftdebug' component. In trace */
/* mode, additional messages are sent to the standard output during */
/* execution. */
/* */
/* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
/* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
/* */
/* Don't define any of these macros to compile in `release' mode! */
/* */
/* Do not #undef these macros here since the build system might define */
/* them for certain configurations only. */
/* */
/* #define FT_DEBUG_LEVEL_ERROR */
/* #define FT_DEBUG_LEVEL_TRACE */
 
 
/*************************************************************************/
/* */
/* Memory Debugging */
/* */
/* FreeType now comes with an integrated memory debugger that is */
/* capable of detecting simple errors like memory leaks or double */
/* deletes. To compile it within your build of the library, you */
/* should define FT_DEBUG_MEMORY here. */
/* */
/* Note that the memory debugger is only activated at runtime when */
/* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
/* */
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
/* */
/* #define FT_DEBUG_MEMORY */
 
 
/*************************************************************************/
/* */
/* Module errors */
/* */
/* If this macro is set (which is _not_ the default), the higher byte */
/* of an error code gives the module in which the error has occurred, */
/* while the lower byte is the real error code. */
/* */
/* Setting this macro makes sense for debugging purposes only, since */
/* it would break source compatibility of certain programs that use */
/* FreeType 2. */
/* */
/* More details can be found in the files ftmoderr.h and fterrors.h. */
/* */
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
 
 
/*************************************************************************/
/* */
/* Position Independent Code */
/* */
/* If this macro is set (which is _not_ the default), FreeType2 will */
/* avoid creating constants that require address fixups. Instead the */
/* constants will be moved into a struct and additional intialization */
/* code will be used. */
/* */
/* Setting this macro is needed for systems that prohibit address */
/* fixups, such as BREW. */
/* */
/* #define FT_CONFIG_OPTION_PIC */
 
 
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** S F N T D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
/* embedded bitmaps in all formats using the SFNT module (namely */
/* TrueType & OpenType). */
/* */
#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
 
 
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
/* load and enumerate the glyph Postscript names in a TrueType or */
/* OpenType file. */
/* */
/* Note that when you do not compile the `PSNames' module by undefining */
/* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
/* contain additional code used to read the PS Names table from a font. */
/* */
/* (By default, the module uses `PSNames' to extract glyph names.) */
/* */
#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
 
 
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
/* access the internal name table in a SFNT-based format like TrueType */
/* or OpenType. The name table contains various strings used to */
/* describe the font, like family name, copyright, version, etc. It */
/* does not contain any glyph name though. */
/* */
/* Accessing SFNT names is done through the functions declared in */
/* `freetype/ftsnames.h'. */
/* */
#define TT_CONFIG_OPTION_SFNT_NAMES
 
 
/*************************************************************************/
/* */
/* TrueType CMap support */
/* */
/* Here you can fine-tune which TrueType CMap table format shall be */
/* supported. */
#define TT_CONFIG_CMAP_FORMAT_0
#define TT_CONFIG_CMAP_FORMAT_2
#define TT_CONFIG_CMAP_FORMAT_4
#define TT_CONFIG_CMAP_FORMAT_6
#define TT_CONFIG_CMAP_FORMAT_8
#define TT_CONFIG_CMAP_FORMAT_10
#define TT_CONFIG_CMAP_FORMAT_12
#define TT_CONFIG_CMAP_FORMAT_13
#define TT_CONFIG_CMAP_FORMAT_14
 
 
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
 
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
/* a bytecode interpreter in the TrueType driver. */
/* */
/* By undefining this, you will only compile the code necessary to load */
/* TrueType glyphs without hinting. */
/* */
/* Do not #undef this macro here, since the build system might */
/* define it for certain configurations only. */
/* */
#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
 
 
/*************************************************************************/
/* */
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
/* of the TrueType bytecode interpreter is used that doesn't implement */
/* any of the patented opcodes and algorithms. The patents related to */
/* TrueType hinting have expired worldwide since May 2010; this option */
/* is now deprecated. */
/* */
/* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
/* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
/* */
/* This macro is only useful for a small number of font files (mostly */
/* for Asian scripts) that require bytecode interpretation to properly */
/* load glyphs. For all other fonts, this produces unpleasant results, */
/* thus the unpatented interpreter is never used to load glyphs from */
/* TrueType fonts unless one of the following two options is used. */
/* */
/* - The unpatented interpreter is explicitly activated by the user */
/* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
/* when opening the FT_Face. */
/* */
/* - FreeType detects that the FT_Face corresponds to one of the */
/* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
/* contains a hard-coded list of font names and other matching */
/* parameters (see function `tt_face_init' in file */
/* `src/truetype/ttobjs.c'). */
/* */
/* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
/* */
/* { */
/* FT_Parameter parameter; */
/* FT_Open_Args open_args; */
/* */
/* */
/* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
/* */
/* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
/* open_args.pathname = my_font_pathname; */
/* open_args.num_params = 1; */
/* open_args.params = &parameter; */
/* */
/* error = FT_Open_Face( library, &open_args, index, &face ); */
/* ... */
/* } */
/* */
/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
 
 
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
/* bytecode interpreter with a huge switch statement, rather than a call */
/* table. This results in smaller and faster code for a number of */
/* architectures. */
/* */
/* Note however that on some compiler/processor combinations, undefining */
/* this macro will generate faster, though larger, code. */
/* */
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
 
 
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
/* TrueType glyph loader to use Apple's definition of how to handle */
/* component offsets in composite glyphs. */
/* */
/* Apple and MS disagree on the default behavior of component offsets */
/* in composites. Apple says that they should be scaled by the scaling */
/* factors in the transformation matrix (roughly, it's more complex) */
/* while MS says they should not. OpenType defines two bits in the */
/* composite flags array which can be used to disambiguate, but old */
/* fonts will not have them. */
/* */
/* http://partners.adobe.com/asn/developer/opentype/glyf.html */
/* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
/* */
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
 
 
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
/* support for Apple's distortable font technology (fvar, gvar, cvar, */
/* and avar tables). This has many similarities to Type 1 Multiple */
/* Masters support. */
/* */
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
 
 
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_BDF if you want to include support for */
/* an embedded `BDF ' table within SFNT-based bitmap formats. */
/* */
#define TT_CONFIG_OPTION_BDF
 
 
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
/* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
/* required. */
/* */
#define T1_MAX_DICT_DEPTH 5
 
 
/*************************************************************************/
/* */
/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
/* calls during glyph loading. */
/* */
#define T1_MAX_SUBRS_CALLS 16
 
 
/*************************************************************************/
/* */
/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
/* minimum of 16 is required. */
/* */
/* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
/* */
#define T1_MAX_CHARSTRINGS_OPERANDS 256
 
 
/*************************************************************************/
/* */
/* Define this configuration macro if you want to prevent the */
/* compilation of `t1afm', which is in charge of reading Type 1 AFM */
/* files into an existing face. Note that if set, the T1 driver will be */
/* unable to produce kerning distances. */
/* */
#undef T1_CONFIG_OPTION_NO_AFM
 
 
/*************************************************************************/
/* */
/* Define this configuration macro if you want to prevent the */
/* compilation of the Multiple Masters font support in the Type 1 */
/* driver. */
/* */
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
 
 
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* Compile autofit module with CJK (Chinese, Japanese, Korean) script */
/* support. */
/* */
#define AF_CONFIG_OPTION_CJK
 
/*************************************************************************/
/* */
/* Compile autofit module with Indic script support. */
/* */
#define AF_CONFIG_OPTION_INDIC
 
/* */
 
 
/*
* Define this variable if you want to keep the layout of internal
* structures that was used prior to FreeType 2.2. This also compiles in
* a few obsolete functions to avoid linking problems on typical Unix
* distributions.
*
* For embedded systems or building a new distribution from scratch, it
* is recommended to disable the macro since it reduces the library's code
* size and activates a few memory-saving optimizations as well.
*/
#define FT_CONFIG_OPTION_OLD_INTERNALS
 
 
/*
* To detect legacy cache-lookup call from a rogue client (<= 2.1.7),
* we restrict the number of charmaps in a font. The current API of
* FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API
* takes charcode only. To determine the passed value is for cmap_index
* or charcode, the possible cmap_index is restricted not to exceed
* the minimum possible charcode by a rogue client. It is also very
* unlikely that a rogue client is interested in Unicode values 0 to 15.
*
* NOTE: The original threshold was 4 deduced from popular number of
* cmap subtables in UCS-4 TrueType fonts, but now it is not
* irregular for OpenType fonts to have more than 4 subtables,
* because variation selector subtables are available for Apple
* and Microsoft platforms.
*/
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_MAX_CHARMAP_CACHEABLE 15
#endif
 
 
/*
* This macro is defined if either unpatented or native TrueType
* hinting is requested by the definitions above.
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
#undef TT_CONFIG_OPTION_UNPATENTED_HINTING
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
#define TT_USE_BYTECODE_INTERPRETER
#endif
 
FT_END_HEADER
 
 
#endif /* __FTOPTION_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/config/ftstdlib.h
0,0 → 1,173
/***************************************************************************/
/* */
/* ftstdlib.h */
/* */
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* This file is used to group all #includes to the ANSI C library that */
/* FreeType normally requires. It also defines macros to rename the */
/* standard functions within the FreeType source code. */
/* */
/* Load a file which defines __FTSTDLIB_H__ before this one to override */
/* it. */
/* */
/*************************************************************************/
 
 
#ifndef __FTSTDLIB_H__
#define __FTSTDLIB_H__
 
 
#include <stddef.h>
 
#define ft_ptrdiff_t ptrdiff_t
 
 
/**********************************************************************/
/* */
/* integer limits */
/* */
/* UINT_MAX and ULONG_MAX are used to automatically compute the size */
/* of `int' and `long' in bytes at compile-time. So far, this works */
/* for all platforms the library has been tested on. */
/* */
/* Note that on the extremely rare platforms that do not provide */
/* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
/* old Crays where `int' is 36 bits), we do not make any guarantee */
/* about the correct behaviour of FT2 with all fonts. */
/* */
/* In these case, `ftconfig.h' will refuse to compile anyway with a */
/* message like `couldn't find 32-bit type' or something similar. */
/* */
/**********************************************************************/
 
 
#include <limits.h>
 
#define FT_CHAR_BIT CHAR_BIT
#define FT_INT_MAX INT_MAX
#define FT_INT_MIN INT_MIN
#define FT_UINT_MAX UINT_MAX
#define FT_ULONG_MAX ULONG_MAX
 
 
/**********************************************************************/
/* */
/* character and string processing */
/* */
/**********************************************************************/
 
 
#include <string.h>
 
#define ft_memchr memchr
#define ft_memcmp memcmp
#define ft_memcpy memcpy
#define ft_memmove memmove
#define ft_memset memset
#define ft_strcat strcat
#define ft_strcmp strcmp
#define ft_strcpy strcpy
#define ft_strlen strlen
#define ft_strncmp strncmp
#define ft_strncpy strncpy
#define ft_strrchr strrchr
#define ft_strstr strstr
 
 
/**********************************************************************/
/* */
/* file handling */
/* */
/**********************************************************************/
 
 
#include <stdio.h>
 
#define FT_FILE FILE
#define ft_fclose fclose
#define ft_fopen fopen
#define ft_fread fread
#define ft_fseek fseek
#define ft_ftell ftell
#define ft_sprintf sprintf
 
 
/**********************************************************************/
/* */
/* sorting */
/* */
/**********************************************************************/
 
 
#include <stdlib.h>
 
#define ft_qsort qsort
 
 
/**********************************************************************/
/* */
/* memory allocation */
/* */
/**********************************************************************/
 
 
#define ft_scalloc calloc
#define ft_sfree free
#define ft_smalloc malloc
#define ft_srealloc realloc
 
 
/**********************************************************************/
/* */
/* miscellaneous */
/* */
/**********************************************************************/
 
 
#define ft_atol atol
#define ft_labs labs
 
 
/**********************************************************************/
/* */
/* execution control */
/* */
/**********************************************************************/
 
 
#include <setjmp.h>
 
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* jmp_buf is defined as a macro */
/* on certain platforms */
 
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) ) /* same thing here */
 
 
/* the following is only used for debugging purposes, i.e., if */
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
 
#include <stdarg.h>
 
 
#endif /* __FTSTDLIB_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/freetype.h
0,0 → 1,3919
/***************************************************************************/
/* */
/* freetype.h */
/* */
/* FreeType high-level API and common types (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef FT_FREETYPE_H
#error "`ft2build.h' hasn't been included yet!"
#error "Please always use macros to include FreeType header files."
#error "Example:"
#error " #include <ft2build.h>"
#error " #include FT_FREETYPE_H"
#endif
 
 
#ifndef __FREETYPE_H__
#define __FREETYPE_H__
 
 
#include <ft2build.h>
#include FT_CONFIG_CONFIG_H
#include FT_ERRORS_H
#include FT_TYPES_H
 
 
FT_BEGIN_HEADER
 
 
 
/*************************************************************************/
/* */
/* <Section> */
/* user_allocation */
/* */
/* <Title> */
/* User allocation */
/* */
/* <Abstract> */
/* How client applications should allocate FreeType data structures. */
/* */
/* <Description> */
/* FreeType assumes that structures allocated by the user and passed */
/* as arguments are zeroed out except for the actual data. In other */
/* words, it is recommended to use `calloc' (or variants of it) */
/* instead of `malloc' for allocation. */
/* */
/*************************************************************************/
 
 
 
/*************************************************************************/
/*************************************************************************/
/* */
/* B A S I C T Y P E S */
/* */
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Section> */
/* base_interface */
/* */
/* <Title> */
/* Base Interface */
/* */
/* <Abstract> */
/* The FreeType~2 base font interface. */
/* */
/* <Description> */
/* This section describes the public high-level API of FreeType~2. */
/* */
/* <Order> */
/* FT_Library */
/* FT_Face */
/* FT_Size */
/* FT_GlyphSlot */
/* FT_CharMap */
/* FT_Encoding */
/* */
/* FT_FaceRec */
/* */
/* FT_FACE_FLAG_SCALABLE */
/* FT_FACE_FLAG_FIXED_SIZES */
/* FT_FACE_FLAG_FIXED_WIDTH */
/* FT_FACE_FLAG_HORIZONTAL */
/* FT_FACE_FLAG_VERTICAL */
/* FT_FACE_FLAG_SFNT */
/* FT_FACE_FLAG_KERNING */
/* FT_FACE_FLAG_MULTIPLE_MASTERS */
/* FT_FACE_FLAG_GLYPH_NAMES */
/* FT_FACE_FLAG_EXTERNAL_STREAM */
/* FT_FACE_FLAG_FAST_GLYPHS */
/* FT_FACE_FLAG_HINTER */
/* */
/* FT_STYLE_FLAG_BOLD */
/* FT_STYLE_FLAG_ITALIC */
/* */
/* FT_SizeRec */
/* FT_Size_Metrics */
/* */
/* FT_GlyphSlotRec */
/* FT_Glyph_Metrics */
/* FT_SubGlyph */
/* */
/* FT_Bitmap_Size */
/* */
/* FT_Init_FreeType */
/* FT_Done_FreeType */
/* */
/* FT_New_Face */
/* FT_Done_Face */
/* FT_New_Memory_Face */
/* FT_Open_Face */
/* FT_Open_Args */
/* FT_Parameter */
/* FT_Attach_File */
/* FT_Attach_Stream */
/* */
/* FT_Set_Char_Size */
/* FT_Set_Pixel_Sizes */
/* FT_Request_Size */
/* FT_Select_Size */
/* FT_Size_Request_Type */
/* FT_Size_Request */
/* FT_Set_Transform */
/* FT_Load_Glyph */
/* FT_Get_Char_Index */
/* FT_Get_Name_Index */
/* FT_Load_Char */
/* */
/* FT_OPEN_MEMORY */
/* FT_OPEN_STREAM */
/* FT_OPEN_PATHNAME */
/* FT_OPEN_DRIVER */
/* FT_OPEN_PARAMS */
/* */
/* FT_LOAD_DEFAULT */
/* FT_LOAD_RENDER */
/* FT_LOAD_MONOCHROME */
/* FT_LOAD_LINEAR_DESIGN */
/* FT_LOAD_NO_SCALE */
/* FT_LOAD_NO_HINTING */
/* FT_LOAD_NO_BITMAP */
/* FT_LOAD_CROP_BITMAP */
/* */
/* FT_LOAD_VERTICAL_LAYOUT */
/* FT_LOAD_IGNORE_TRANSFORM */
/* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
/* FT_LOAD_FORCE_AUTOHINT */
/* FT_LOAD_NO_RECURSE */
/* FT_LOAD_PEDANTIC */
/* */
/* FT_LOAD_TARGET_NORMAL */
/* FT_LOAD_TARGET_LIGHT */
/* FT_LOAD_TARGET_MONO */
/* FT_LOAD_TARGET_LCD */
/* FT_LOAD_TARGET_LCD_V */
/* */
/* FT_Render_Glyph */
/* FT_Render_Mode */
/* FT_Get_Kerning */
/* FT_Kerning_Mode */
/* FT_Get_Track_Kerning */
/* FT_Get_Glyph_Name */
/* FT_Get_Postscript_Name */
/* */
/* FT_CharMapRec */
/* FT_Select_Charmap */
/* FT_Set_Charmap */
/* FT_Get_Charmap_Index */
/* */
/* FT_FSTYPE_INSTALLABLE_EMBEDDING */
/* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */
/* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */
/* FT_FSTYPE_EDITABLE_EMBEDDING */
/* FT_FSTYPE_NO_SUBSETTING */
/* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */
/* */
/* FT_Get_FSType_Flags */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Glyph_Metrics */
/* */
/* <Description> */
/* A structure used to model the metrics of a single glyph. The */
/* values are expressed in 26.6 fractional pixel format; if the flag */
/* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
/* are expressed in font units instead. */
/* */
/* <Fields> */
/* width :: */
/* The glyph's width. */
/* */
/* height :: */
/* The glyph's height. */
/* */
/* horiBearingX :: */
/* Left side bearing for horizontal layout. */
/* */
/* horiBearingY :: */
/* Top side bearing for horizontal layout. */
/* */
/* horiAdvance :: */
/* Advance width for horizontal layout. */
/* */
/* vertBearingX :: */
/* Left side bearing for vertical layout. */
/* */
/* vertBearingY :: */
/* Top side bearing for vertical layout. */
/* */
/* vertAdvance :: */
/* Advance height for vertical layout. */
/* */
/* <Note> */
/* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
/* dimensions of the hinted glyph (in case hinting is applicable). */
/* */
typedef struct FT_Glyph_Metrics_
{
FT_Pos width;
FT_Pos height;
 
FT_Pos horiBearingX;
FT_Pos horiBearingY;
FT_Pos horiAdvance;
 
FT_Pos vertBearingX;
FT_Pos vertBearingY;
FT_Pos vertAdvance;
 
} FT_Glyph_Metrics;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Bitmap_Size */
/* */
/* <Description> */
/* This structure models the metrics of a bitmap strike (i.e., a set */
/* of glyphs for a given point size and resolution) in a bitmap font. */
/* It is used for the `available_sizes' field of @FT_Face. */
/* */
/* <Fields> */
/* height :: The vertical distance, in pixels, between two */
/* consecutive baselines. It is always positive. */
/* */
/* width :: The average width, in pixels, of all glyphs in the */
/* strike. */
/* */
/* size :: The nominal size of the strike in 26.6 fractional */
/* points. This field is not very useful. */
/* */
/* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */
/* pixels. */
/* */
/* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */
/* pixels. */
/* */
/* <Note> */
/* Windows FNT: */
/* The nominal size given in a FNT font is not reliable. Thus when */
/* the driver finds it incorrect, it sets `size' to some calculated */
/* values and sets `x_ppem' and `y_ppem' to the pixel width and */
/* height given in the font, respectively. */
/* */
/* TrueType embedded bitmaps: */
/* `size', `width', and `height' values are not contained in the */
/* bitmap strike itself. They are computed from the global font */
/* parameters. */
/* */
typedef struct FT_Bitmap_Size_
{
FT_Short height;
FT_Short width;
 
FT_Pos size;
 
FT_Pos x_ppem;
FT_Pos y_ppem;
 
} FT_Bitmap_Size;
 
 
/*************************************************************************/
/*************************************************************************/
/* */
/* O B J E C T C L A S S E S */
/* */
/*************************************************************************/
/*************************************************************************/
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Library */
/* */
/* <Description> */
/* A handle to a FreeType library instance. Each `library' is */
/* completely independent from the others; it is the `root' of a set */
/* of objects like fonts, faces, sizes, etc. */
/* */
/* It also embeds a memory manager (see @FT_Memory), as well as a */
/* scan-line converter object (see @FT_Raster). */
/* */
/* For multi-threading applications each thread should have its own */
/* FT_Library object. */
/* */
/* <Note> */
/* Library objects are normally created by @FT_Init_FreeType, and */
/* destroyed with @FT_Done_FreeType. */
/* */
typedef struct FT_LibraryRec_ *FT_Library;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Module */
/* */
/* <Description> */
/* A handle to a given FreeType module object. Each module can be a */
/* font driver, a renderer, or anything else that provides services */
/* to the formers. */
/* */
typedef struct FT_ModuleRec_* FT_Module;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Driver */
/* */
/* <Description> */
/* A handle to a given FreeType font driver object. Each font driver */
/* is a special module capable of creating faces from font files. */
/* */
typedef struct FT_DriverRec_* FT_Driver;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Renderer */
/* */
/* <Description> */
/* A handle to a given FreeType renderer. A renderer is a special */
/* module in charge of converting a glyph image to a bitmap, when */
/* necessary. Each renderer supports a given glyph image format, and */
/* one or more target surface depths. */
/* */
typedef struct FT_RendererRec_* FT_Renderer;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Face */
/* */
/* <Description> */
/* A handle to a given typographic face object. A face object models */
/* a given typeface, in a given style. */
/* */
/* <Note> */
/* Each face object also owns a single @FT_GlyphSlot object, as well */
/* as one or more @FT_Size objects. */
/* */
/* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
/* a given filepathname or a custom input stream. */
/* */
/* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
/* */
/* <Also> */
/* See @FT_FaceRec for the publicly accessible fields of a given face */
/* object. */
/* */
typedef struct FT_FaceRec_* FT_Face;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Size */
/* */
/* <Description> */
/* A handle to an object used to model a face scaled to a given */
/* character size. */
/* */
/* <Note> */
/* Each @FT_Face has an _active_ @FT_Size object that is used by */
/* functions like @FT_Load_Glyph to determine the scaling */
/* transformation which is used to load and hint glyphs and metrics. */
/* */
/* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */
/* @FT_Request_Size or even @FT_Select_Size to change the content */
/* (i.e., the scaling values) of the active @FT_Size. */
/* */
/* You can use @FT_New_Size to create additional size objects for a */
/* given @FT_Face, but they won't be used by other functions until */
/* you activate it through @FT_Activate_Size. Only one size can be */
/* activated at any given time per face. */
/* */
/* <Also> */
/* See @FT_SizeRec for the publicly accessible fields of a given size */
/* object. */
/* */
typedef struct FT_SizeRec_* FT_Size;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_GlyphSlot */
/* */
/* <Description> */
/* A handle to a given `glyph slot'. A slot is a container where it */
/* is possible to load any of the glyphs contained in its parent */
/* face. */
/* */
/* In other words, each time you call @FT_Load_Glyph or */
/* @FT_Load_Char, the slot's content is erased by the new glyph data, */
/* i.e., the glyph's metrics, its image (bitmap or outline), and */
/* other control information. */
/* */
/* <Also> */
/* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
/* */
typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_CharMap */
/* */
/* <Description> */
/* A handle to a given character map. A charmap is used to translate */
/* character codes in a given encoding into glyph indexes for its */
/* parent's face. Some font formats may provide several charmaps per */
/* font. */
/* */
/* Each face object owns zero or more charmaps, but only one of them */
/* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
/* */
/* The list of available charmaps in a face is available through the */
/* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
/* */
/* The currently active charmap is available as `face->charmap'. */
/* You should call @FT_Set_Charmap to change it. */
/* */
/* <Note> */
/* When a new face is created (either through @FT_New_Face or */
/* @FT_Open_Face), the library looks for a Unicode charmap within */
/* the list and automatically activates it. */
/* */
/* <Also> */
/* See @FT_CharMapRec for the publicly accessible fields of a given */
/* character map. */
/* */
typedef struct FT_CharMapRec_* FT_CharMap;
 
 
/*************************************************************************/
/* */
/* <Macro> */
/* FT_ENC_TAG */
/* */
/* <Description> */
/* This macro converts four-letter tags into an unsigned long. It is */
/* used to define `encoding' identifiers (see @FT_Encoding). */
/* */
/* <Note> */
/* Since many 16-bit compilers don't like 32-bit enumerations, you */
/* should redefine this macro in case of problems to something like */
/* this: */
/* */
/* { */
/* #define FT_ENC_TAG( value, a, b, c, d ) value */
/* } */
/* */
/* to get a simple enumeration without assigning special numbers. */
/* */
 
#ifndef FT_ENC_TAG
#define FT_ENC_TAG( value, a, b, c, d ) \
value = ( ( (FT_UInt32)(a) << 24 ) | \
( (FT_UInt32)(b) << 16 ) | \
( (FT_UInt32)(c) << 8 ) | \
(FT_UInt32)(d) )
 
#endif /* FT_ENC_TAG */
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Encoding */
/* */
/* <Description> */
/* An enumeration used to specify character sets supported by */
/* charmaps. Used in the @FT_Select_Charmap API function. */
/* */
/* <Note> */
/* Despite the name, this enumeration lists specific character */
/* repertories (i.e., charsets), and not text encoding methods (e.g., */
/* UTF-8, UTF-16, etc.). */
/* */
/* Other encodings might be defined in the future. */
/* */
/* <Values> */
/* FT_ENCODING_NONE :: */
/* The encoding value~0 is reserved. */
/* */
/* FT_ENCODING_UNICODE :: */
/* Corresponds to the Unicode character set. This value covers */
/* all versions of the Unicode repertoire, including ASCII and */
/* Latin-1. Most fonts include a Unicode charmap, but not all */
/* of them. */
/* */
/* For example, if you want to access Unicode value U+1F028 (and */
/* the font contains it), use value 0x1F028 as the input value for */
/* @FT_Get_Char_Index. */
/* */
/* FT_ENCODING_MS_SYMBOL :: */
/* Corresponds to the Microsoft Symbol encoding, used to encode */
/* mathematical symbols in the 32..255 character code range. For */
/* more information, see `http://www.ceviz.net/symbol.htm'. */
/* */
/* FT_ENCODING_SJIS :: */
/* Corresponds to Japanese SJIS encoding. More info at */
/* at `http://langsupport.japanreference.com/encoding.shtml'. */
/* See note on multi-byte encodings below. */
/* */
/* FT_ENCODING_GB2312 :: */
/* Corresponds to an encoding system for Simplified Chinese as used */
/* used in mainland China. */
/* */
/* FT_ENCODING_BIG5 :: */
/* Corresponds to an encoding system for Traditional Chinese as */
/* used in Taiwan and Hong Kong. */
/* */
/* FT_ENCODING_WANSUNG :: */
/* Corresponds to the Korean encoding system known as Wansung. */
/* For more information see */
/* `http://www.microsoft.com/typography/unicode/949.txt'. */
/* */
/* FT_ENCODING_JOHAB :: */
/* The Korean standard character set (KS~C 5601-1992), which */
/* corresponds to MS Windows code page 1361. This character set */
/* includes all possible Hangeul character combinations. */
/* */
/* FT_ENCODING_ADOBE_LATIN_1 :: */
/* Corresponds to a Latin-1 encoding as defined in a Type~1 */
/* PostScript font. It is limited to 256 character codes. */
/* */
/* FT_ENCODING_ADOBE_STANDARD :: */
/* Corresponds to the Adobe Standard encoding, as found in Type~1, */
/* CFF, and OpenType/CFF fonts. It is limited to 256 character */
/* codes. */
/* */
/* FT_ENCODING_ADOBE_EXPERT :: */
/* Corresponds to the Adobe Expert encoding, as found in Type~1, */
/* CFF, and OpenType/CFF fonts. It is limited to 256 character */
/* codes. */
/* */
/* FT_ENCODING_ADOBE_CUSTOM :: */
/* Corresponds to a custom encoding, as found in Type~1, CFF, and */
/* OpenType/CFF fonts. It is limited to 256 character codes. */
/* */
/* FT_ENCODING_APPLE_ROMAN :: */
/* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
/* and OpenType fonts contain a charmap for this encoding, since */
/* older versions of Mac OS are able to use it. */
/* */
/* FT_ENCODING_OLD_LATIN_2 :: */
/* This value is deprecated and was never used nor reported by */
/* FreeType. Don't use or test for it. */
/* */
/* FT_ENCODING_MS_SJIS :: */
/* Same as FT_ENCODING_SJIS. Deprecated. */
/* */
/* FT_ENCODING_MS_GB2312 :: */
/* Same as FT_ENCODING_GB2312. Deprecated. */
/* */
/* FT_ENCODING_MS_BIG5 :: */
/* Same as FT_ENCODING_BIG5. Deprecated. */
/* */
/* FT_ENCODING_MS_WANSUNG :: */
/* Same as FT_ENCODING_WANSUNG. Deprecated. */
/* */
/* FT_ENCODING_MS_JOHAB :: */
/* Same as FT_ENCODING_JOHAB. Deprecated. */
/* */
/* <Note> */
/* By default, FreeType automatically synthesizes a Unicode charmap */
/* for PostScript fonts, using their glyph names dictionaries. */
/* However, it also reports the encodings defined explicitly in the */
/* font file, for the cases when they are needed, with the Adobe */
/* values as well. */
/* */
/* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
/* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
/* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
/* which encoding is really present. If, for example, the */
/* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
/* the font is encoded in KOI8-R. */
/* */
/* FT_ENCODING_NONE is always set (with a single exception) by the */
/* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
/* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
/* which encoding is really present. For example, */
/* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
/* Russian). */
/* */
/* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
/* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
/* FT_ENCODING_APPLE_ROMAN). */
/* */
/* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
/* @FT_Get_CMap_Language_ID to query the Mac language ID which may */
/* be needed to be able to distinguish Apple encoding variants. See */
/* */
/* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */
/* */
/* to get an idea how to do that. Basically, if the language ID */
/* is~0, don't use it, otherwise subtract 1 from the language ID. */
/* Then examine `encoding_id'. If, for example, `encoding_id' is */
/* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
/* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
/* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
/* variant the Arabic encoding. */
/* */
typedef enum FT_Encoding_
{
FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
 
FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ),
 
FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ),
FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ),
FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ),
FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ),
 
/* for backwards compatibility */
FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,
FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,
FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,
FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,
 
FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ),
FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ),
FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ),
 
FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
 
FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
 
} FT_Encoding;
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* ft_encoding_xxx */
/* */
/* <Description> */
/* These constants are deprecated; use the corresponding @FT_Encoding */
/* values instead. */
/* */
#define ft_encoding_none FT_ENCODING_NONE
#define ft_encoding_unicode FT_ENCODING_UNICODE
#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
#define ft_encoding_sjis FT_ENCODING_SJIS
#define ft_encoding_gb2312 FT_ENCODING_GB2312
#define ft_encoding_big5 FT_ENCODING_BIG5
#define ft_encoding_wansung FT_ENCODING_WANSUNG
#define ft_encoding_johab FT_ENCODING_JOHAB
 
#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD
#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT
#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM
#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_CharMapRec */
/* */
/* <Description> */
/* The base charmap structure. */
/* */
/* <Fields> */
/* face :: A handle to the parent face object. */
/* */
/* encoding :: An @FT_Encoding tag identifying the charmap. Use */
/* this with @FT_Select_Charmap. */
/* */
/* platform_id :: An ID number describing the platform for the */
/* following encoding ID. This comes directly from */
/* the TrueType specification and should be emulated */
/* for other formats. */
/* */
/* encoding_id :: A platform specific encoding number. This also */
/* comes from the TrueType specification and should be */
/* emulated similarly. */
/* */
typedef struct FT_CharMapRec_
{
FT_Face face;
FT_Encoding encoding;
FT_UShort platform_id;
FT_UShort encoding_id;
 
} FT_CharMapRec;
 
 
/*************************************************************************/
/*************************************************************************/
/* */
/* B A S E O B J E C T C L A S S E S */
/* */
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Face_Internal */
/* */
/* <Description> */
/* An opaque handle to an `FT_Face_InternalRec' structure, used to */
/* model private data of a given @FT_Face object. */
/* */
/* This structure might change between releases of FreeType~2 and is */
/* not generally available to client applications. */
/* */
typedef struct FT_Face_InternalRec_* FT_Face_Internal;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_FaceRec */
/* */
/* <Description> */
/* FreeType root face class structure. A face object models a */
/* typeface in a font file. */
/* */
/* <Fields> */
/* num_faces :: The number of faces in the font file. Some */
/* font formats can have multiple faces in */
/* a font file. */
/* */
/* face_index :: The index of the face in the font file. It */
/* is set to~0 if there is only one face in */
/* the font file. */
/* */
/* face_flags :: A set of bit flags that give important */
/* information about the face; see */
/* @FT_FACE_FLAG_XXX for the details. */
/* */
/* style_flags :: A set of bit flags indicating the style of */
/* the face; see @FT_STYLE_FLAG_XXX for the */
/* details. */
/* */
/* num_glyphs :: The number of glyphs in the face. If the */
/* face is scalable and has sbits (see */
/* `num_fixed_sizes'), it is set to the number */
/* of outline glyphs. */
/* */
/* For CID-keyed fonts, this value gives the */
/* highest CID used in the font. */
/* */
/* family_name :: The face's family name. This is an ASCII */
/* string, usually in English, which describes */
/* the typeface's family (like `Times New */
/* Roman', `Bodoni', `Garamond', etc). This */
/* is a least common denominator used to list */
/* fonts. Some formats (TrueType & OpenType) */
/* provide localized and Unicode versions of */
/* this string. Applications should use the */
/* format specific interface to access them. */
/* Can be NULL (e.g., in fonts embedded in a */
/* PDF file). */
/* */
/* style_name :: The face's style name. This is an ASCII */
/* string, usually in English, which describes */
/* the typeface's style (like `Italic', */
/* `Bold', `Condensed', etc). Not all font */
/* formats provide a style name, so this field */
/* is optional, and can be set to NULL. As */
/* for `family_name', some formats provide */
/* localized and Unicode versions of this */
/* string. Applications should use the format */
/* specific interface to access them. */
/* */
/* num_fixed_sizes :: The number of bitmap strikes in the face. */
/* Even if the face is scalable, there might */
/* still be bitmap strikes, which are called */
/* `sbits' in that case. */
/* */
/* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */
/* strikes in the face. It is set to NULL if */
/* there is no bitmap strike. */
/* */
/* num_charmaps :: The number of charmaps in the face. */
/* */
/* charmaps :: An array of the charmaps of the face. */
/* */
/* generic :: A field reserved for client uses. See the */
/* @FT_Generic type description. */
/* */
/* bbox :: The font bounding box. Coordinates are */
/* expressed in font units (see */
/* `units_per_EM'). The box is large enough */
/* to contain any glyph from the font. Thus, */
/* `bbox.yMax' can be seen as the `maximal */
/* ascender', and `bbox.yMin' as the `minimal */
/* descender'. Only relevant for scalable */
/* formats. */
/* */
/* Note that the bounding box might be off by */
/* (at least) one pixel for hinted fonts. See */
/* @FT_Size_Metrics for further discussion. */
/* */
/* units_per_EM :: The number of font units per EM square for */
/* this face. This is typically 2048 for */
/* TrueType fonts, and 1000 for Type~1 fonts. */
/* Only relevant for scalable formats. */
/* */
/* ascender :: The typographic ascender of the face, */
/* expressed in font units. For font formats */
/* not having this information, it is set to */
/* `bbox.yMax'. Only relevant for scalable */
/* formats. */
/* */
/* descender :: The typographic descender of the face, */
/* expressed in font units. For font formats */
/* not having this information, it is set to */
/* `bbox.yMin'. Note that this field is */
/* usually negative. Only relevant for */
/* scalable formats. */
/* */
/* height :: The height is the vertical distance */
/* between two consecutive baselines, */
/* expressed in font units. It is always */
/* positive. Only relevant for scalable */
/* formats. */
/* */
/* max_advance_width :: The maximal advance width, in font units, */
/* for all glyphs in this face. This can be */
/* used to make word wrapping computations */
/* faster. Only relevant for scalable */
/* formats. */
/* */
/* max_advance_height :: The maximal advance height, in font units, */
/* for all glyphs in this face. This is only */
/* relevant for vertical layouts, and is set */
/* to `height' for fonts that do not provide */
/* vertical metrics. Only relevant for */
/* scalable formats. */
/* */
/* underline_position :: The position, in font units, of the */
/* underline line for this face. It is the */
/* center of the underlining stem. Only */
/* relevant for scalable formats. */
/* */
/* underline_thickness :: The thickness, in font units, of the */
/* underline for this face. Only relevant for */
/* scalable formats. */
/* */
/* glyph :: The face's associated glyph slot(s). */
/* */
/* size :: The current active size for this face. */
/* */
/* charmap :: The current active charmap for this face. */
/* */
/* <Note> */
/* Fields may be changed after a call to @FT_Attach_File or */
/* @FT_Attach_Stream. */
/* */
typedef struct FT_FaceRec_
{
FT_Long num_faces;
FT_Long face_index;
 
FT_Long face_flags;
FT_Long style_flags;
 
FT_Long num_glyphs;
 
FT_String* family_name;
FT_String* style_name;
 
FT_Int num_fixed_sizes;
FT_Bitmap_Size* available_sizes;
 
FT_Int num_charmaps;
FT_CharMap* charmaps;
 
FT_Generic generic;
 
/*# The following member variables (down to `underline_thickness') */
/*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
/*# for bitmap fonts. */
FT_BBox bbox;
 
FT_UShort units_per_EM;
FT_Short ascender;
FT_Short descender;
FT_Short height;
 
FT_Short max_advance_width;
FT_Short max_advance_height;
 
FT_Short underline_position;
FT_Short underline_thickness;
 
FT_GlyphSlot glyph;
FT_Size size;
FT_CharMap charmap;
 
/*@private begin */
 
FT_Driver driver;
FT_Memory memory;
FT_Stream stream;
 
FT_ListRec sizes_list;
 
FT_Generic autohint;
void* extensions;
 
FT_Face_Internal internal;
 
/*@private end */
 
} FT_FaceRec;
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_FACE_FLAG_XXX */
/* */
/* <Description> */
/* A list of bit flags used in the `face_flags' field of the */
/* @FT_FaceRec structure. They inform client applications of */
/* properties of the corresponding face. */
/* */
/* <Values> */
/* FT_FACE_FLAG_SCALABLE :: */
/* Indicates that the face contains outline glyphs. This doesn't */
/* prevent bitmap strikes, i.e., a face can have both this and */
/* and @FT_FACE_FLAG_FIXED_SIZES set. */
/* */
/* FT_FACE_FLAG_FIXED_SIZES :: */
/* Indicates that the face contains bitmap strikes. See also the */
/* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */
/* */
/* FT_FACE_FLAG_FIXED_WIDTH :: */
/* Indicates that the face contains fixed-width characters (like */
/* Courier, Lucido, MonoType, etc.). */
/* */
/* FT_FACE_FLAG_SFNT :: */
/* Indicates that the face uses the `sfnt' storage scheme. For */
/* now, this means TrueType and OpenType. */
/* */
/* FT_FACE_FLAG_HORIZONTAL :: */
/* Indicates that the face contains horizontal glyph metrics. This */
/* should be set for all common formats. */
/* */
/* FT_FACE_FLAG_VERTICAL :: */
/* Indicates that the face contains vertical glyph metrics. This */
/* is only available in some formats, not all of them. */
/* */
/* FT_FACE_FLAG_KERNING :: */
/* Indicates that the face contains kerning information. If set, */
/* the kerning distance can be retrieved through the function */
/* @FT_Get_Kerning. Otherwise the function always return the */
/* vector (0,0). Note that FreeType doesn't handle kerning data */
/* from the `GPOS' table (as present in some OpenType fonts). */
/* */
/* FT_FACE_FLAG_FAST_GLYPHS :: */
/* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
/* */
/* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
/* Indicates that the font contains multiple masters and is capable */
/* of interpolating between them. See the multiple-masters */
/* specific API for details. */
/* */
/* FT_FACE_FLAG_GLYPH_NAMES :: */
/* Indicates that the font contains glyph names that can be */
/* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */
/* fonts contain broken glyph name tables. Use the function */
/* @FT_Has_PS_Glyph_Names when needed. */
/* */
/* FT_FACE_FLAG_EXTERNAL_STREAM :: */
/* Used internally by FreeType to indicate that a face's stream was */
/* provided by the client application and should not be destroyed */
/* when @FT_Done_Face is called. Don't read or test this flag. */
/* */
/* FT_FACE_FLAG_HINTER :: */
/* Set if the font driver has a hinting machine of its own. For */
/* example, with TrueType fonts, it makes sense to use data from */
/* the SFNT `gasp' table only if the native TrueType hinting engine */
/* (with the bytecode interpreter) is available and active. */
/* */
/* FT_FACE_FLAG_CID_KEYED :: */
/* Set if the font is CID-keyed. In that case, the font is not */
/* accessed by glyph indices but by CID values. For subsetted */
/* CID-keyed fonts this has the consequence that not all index */
/* values are a valid argument to FT_Load_Glyph. Only the CID */
/* values for which corresponding glyphs in the subsetted font */
/* exist make FT_Load_Glyph return successfully; in all other cases */
/* you get an `FT_Err_Invalid_Argument' error. */
/* */
/* Note that CID-keyed fonts which are in an SFNT wrapper don't */
/* have this flag set since the glyphs are accessed in the normal */
/* way (using contiguous indices); the `CID-ness' isn't visible to */
/* the application. */
/* */
/* FT_FACE_FLAG_TRICKY :: */
/* Set if the font is `tricky', this is, it always needs the */
/* font format's native hinting engine to get a reasonable result. */
/* A typical example is the Chinese font `mingli.ttf' which uses */
/* TrueType bytecode instructions to move and scale all of its */
/* subglyphs. */
/* */
/* It is not possible to autohint such fonts using */
/* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
/* @FT_LOAD_NO_HINTING. You have to set both FT_LOAD_NO_HINTING */
/* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
/* probably never want this except for demonstration purposes. */
/* */
/* Currently, there are six TrueType fonts in the list of tricky */
/* fonts; they are hard-coded in file `ttobjs.c'. */
/* */
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
#define FT_FACE_FLAG_SFNT ( 1L << 3 )
#define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 )
#define FT_FACE_FLAG_VERTICAL ( 1L << 5 )
#define FT_FACE_FLAG_KERNING ( 1L << 6 )
#define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 )
#define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 )
#define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 )
#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
#define FT_FACE_FLAG_HINTER ( 1L << 11 )
#define FT_FACE_FLAG_CID_KEYED ( 1L << 12 )
#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
 
 
/*************************************************************************
*
* @macro:
* FT_HAS_HORIZONTAL( face )
*
* @description:
* A macro that returns true whenever a face object contains
* horizontal metrics (this is true for all font formats though).
*
* @also:
* @FT_HAS_VERTICAL can be used to check for vertical metrics.
*
*/
#define FT_HAS_HORIZONTAL( face ) \
( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
 
 
/*************************************************************************
*
* @macro:
* FT_HAS_VERTICAL( face )
*
* @description:
* A macro that returns true whenever a face object contains vertical
* metrics.
*
*/
#define FT_HAS_VERTICAL( face ) \
( face->face_flags & FT_FACE_FLAG_VERTICAL )
 
 
/*************************************************************************
*
* @macro:
* FT_HAS_KERNING( face )
*
* @description:
* A macro that returns true whenever a face object contains kerning
* data that can be accessed with @FT_Get_Kerning.
*
*/
#define FT_HAS_KERNING( face ) \
( face->face_flags & FT_FACE_FLAG_KERNING )
 
 
/*************************************************************************
*
* @macro:
* FT_IS_SCALABLE( face )
*
* @description:
* A macro that returns true whenever a face object contains a scalable
* font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,
* and PFR font formats.
*
*/
#define FT_IS_SCALABLE( face ) \
( face->face_flags & FT_FACE_FLAG_SCALABLE )
 
 
/*************************************************************************
*
* @macro:
* FT_IS_SFNT( face )
*
* @description:
* A macro that returns true whenever a face object contains a font
* whose format is based on the SFNT storage scheme. This usually
* means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded
* bitmap fonts.
*
* If this macro is true, all functions defined in @FT_SFNT_NAMES_H and
* @FT_TRUETYPE_TABLES_H are available.
*
*/
#define FT_IS_SFNT( face ) \
( face->face_flags & FT_FACE_FLAG_SFNT )
 
 
/*************************************************************************
*
* @macro:
* FT_IS_FIXED_WIDTH( face )
*
* @description:
* A macro that returns true whenever a face object contains a font face
* that contains fixed-width (or `monospace', `fixed-pitch', etc.)
* glyphs.
*
*/
#define FT_IS_FIXED_WIDTH( face ) \
( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
 
 
/*************************************************************************
*
* @macro:
* FT_HAS_FIXED_SIZES( face )
*
* @description:
* A macro that returns true whenever a face object contains some
* embedded bitmaps. See the `available_sizes' field of the
* @FT_FaceRec structure.
*
*/
#define FT_HAS_FIXED_SIZES( face ) \
( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
 
 
/*************************************************************************
*
* @macro:
* FT_HAS_FAST_GLYPHS( face )
*
* @description:
* Deprecated.
*
*/
#define FT_HAS_FAST_GLYPHS( face ) 0
 
 
/*************************************************************************
*
* @macro:
* FT_HAS_GLYPH_NAMES( face )
*
* @description:
* A macro that returns true whenever a face object contains some glyph
* names that can be accessed through @FT_Get_Glyph_Name.
*
*/
#define FT_HAS_GLYPH_NAMES( face ) \
( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
 
 
/*************************************************************************
*
* @macro:
* FT_HAS_MULTIPLE_MASTERS( face )
*
* @description:
* A macro that returns true whenever a face object contains some
* multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H
* are then available to choose the exact design you want.
*
*/
#define FT_HAS_MULTIPLE_MASTERS( face ) \
( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
 
 
/*************************************************************************
*
* @macro:
* FT_IS_CID_KEYED( face )
*
* @description:
* A macro that returns true whenever a face object contains a CID-keyed
* font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more
* details.
*
* If this macro is true, all functions defined in @FT_CID_H are
* available.
*
*/
#define FT_IS_CID_KEYED( face ) \
( face->face_flags & FT_FACE_FLAG_CID_KEYED )
 
 
/*************************************************************************
*
* @macro:
* FT_IS_TRICKY( face )
*
* @description:
* A macro that returns true whenever a face represents a `tricky' font.
* See the discussion of @FT_FACE_FLAG_TRICKY for more details.
*
*/
#define FT_IS_TRICKY( face ) \
( face->face_flags & FT_FACE_FLAG_TRICKY )
 
 
/*************************************************************************/
/* */
/* <Const> */
/* FT_STYLE_FLAG_XXX */
/* */
/* <Description> */
/* A list of bit-flags used to indicate the style of a given face. */
/* These are used in the `style_flags' field of @FT_FaceRec. */
/* */
/* <Values> */
/* FT_STYLE_FLAG_ITALIC :: */
/* Indicates that a given face style is italic or oblique. */
/* */
/* FT_STYLE_FLAG_BOLD :: */
/* Indicates that a given face is bold. */
/* */
/* <Note> */
/* The style information as provided by FreeType is very basic. More */
/* details are beyond the scope and should be done on a higher level */
/* (for example, by analyzing various fields of the `OS/2' table in */
/* SFNT based fonts). */
/* */
#define FT_STYLE_FLAG_ITALIC ( 1 << 0 )
#define FT_STYLE_FLAG_BOLD ( 1 << 1 )
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Size_Internal */
/* */
/* <Description> */
/* An opaque handle to an `FT_Size_InternalRec' structure, used to */
/* model private data of a given @FT_Size object. */
/* */
typedef struct FT_Size_InternalRec_* FT_Size_Internal;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Size_Metrics */
/* */
/* <Description> */
/* The size metrics structure gives the metrics of a size object. */
/* */
/* <Fields> */
/* x_ppem :: The width of the scaled EM square in pixels, hence */
/* the term `ppem' (pixels per EM). It is also */
/* referred to as `nominal width'. */
/* */
/* y_ppem :: The height of the scaled EM square in pixels, */
/* hence the term `ppem' (pixels per EM). It is also */
/* referred to as `nominal height'. */
/* */
/* x_scale :: A 16.16 fractional scaling value used to convert */
/* horizontal metrics from font units to 26.6 */
/* fractional pixels. Only relevant for scalable */
/* font formats. */
/* */
/* y_scale :: A 16.16 fractional scaling value used to convert */
/* vertical metrics from font units to 26.6 */
/* fractional pixels. Only relevant for scalable */
/* font formats. */
/* */
/* ascender :: The ascender in 26.6 fractional pixels. See */
/* @FT_FaceRec for the details. */
/* */
/* descender :: The descender in 26.6 fractional pixels. See */
/* @FT_FaceRec for the details. */
/* */
/* height :: The height in 26.6 fractional pixels. See */
/* @FT_FaceRec for the details. */
/* */
/* max_advance :: The maximal advance width in 26.6 fractional */
/* pixels. See @FT_FaceRec for the details. */
/* */
/* <Note> */
/* The scaling values, if relevant, are determined first during a */
/* size changing operation. The remaining fields are then set by the */
/* driver. For scalable formats, they are usually set to scaled */
/* values of the corresponding fields in @FT_FaceRec. */
/* */
/* Note that due to glyph hinting, these values might not be exact */
/* for certain fonts. Thus they must be treated as unreliable */
/* with an error margin of at least one pixel! */
/* */
/* Indeed, the only way to get the exact metrics is to render _all_ */
/* glyphs. As this would be a definite performance hit, it is up to */
/* client applications to perform such computations. */
/* */
/* The FT_Size_Metrics structure is valid for bitmap fonts also. */
/* */
typedef struct FT_Size_Metrics_
{
FT_UShort x_ppem; /* horizontal pixels per EM */
FT_UShort y_ppem; /* vertical pixels per EM */
 
FT_Fixed x_scale; /* scaling values used to convert font */
FT_Fixed y_scale; /* units to 26.6 fractional pixels */
 
FT_Pos ascender; /* ascender in 26.6 frac. pixels */
FT_Pos descender; /* descender in 26.6 frac. pixels */
FT_Pos height; /* text height in 26.6 frac. pixels */
FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
 
} FT_Size_Metrics;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_SizeRec */
/* */
/* <Description> */
/* FreeType root size class structure. A size object models a face */
/* object at a given size. */
/* */
/* <Fields> */
/* face :: Handle to the parent face object. */
/* */
/* generic :: A typeless pointer, which is unused by the FreeType */
/* library or any of its drivers. It can be used by */
/* client applications to link their own data to each size */
/* object. */
/* */
/* metrics :: Metrics for this size object. This field is read-only. */
/* */
typedef struct FT_SizeRec_
{
FT_Face face; /* parent face object */
FT_Generic generic; /* generic pointer for client uses */
FT_Size_Metrics metrics; /* size metrics */
FT_Size_Internal internal;
 
} FT_SizeRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_SubGlyph */
/* */
/* <Description> */
/* The subglyph structure is an internal object used to describe */
/* subglyphs (for example, in the case of composites). */
/* */
/* <Note> */
/* The subglyph implementation is not part of the high-level API, */
/* hence the forward structure declaration. */
/* */
/* You can however retrieve subglyph information with */
/* @FT_Get_SubGlyph_Info. */
/* */
typedef struct FT_SubGlyphRec_* FT_SubGlyph;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Slot_Internal */
/* */
/* <Description> */
/* An opaque handle to an `FT_Slot_InternalRec' structure, used to */
/* model private data of a given @FT_GlyphSlot object. */
/* */
typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_GlyphSlotRec */
/* */
/* <Description> */
/* FreeType root glyph slot class structure. A glyph slot is a */
/* container where individual glyphs can be loaded, be they in */
/* outline or bitmap format. */
/* */
/* <Fields> */
/* library :: A handle to the FreeType library instance */
/* this slot belongs to. */
/* */
/* face :: A handle to the parent face object. */
/* */
/* next :: In some cases (like some font tools), several */
/* glyph slots per face object can be a good */
/* thing. As this is rare, the glyph slots are */
/* listed through a direct, single-linked list */
/* using its `next' field. */
/* */
/* generic :: A typeless pointer which is unused by the */
/* FreeType library or any of its drivers. It */
/* can be used by client applications to link */
/* their own data to each glyph slot object. */
/* */
/* metrics :: The metrics of the last loaded glyph in the */
/* slot. The returned values depend on the last */
/* load flags (see the @FT_Load_Glyph API */
/* function) and can be expressed either in 26.6 */
/* fractional pixels or font units. */
/* */
/* Note that even when the glyph image is */
/* transformed, the metrics are not. */
/* */
/* linearHoriAdvance :: The advance width of the unhinted glyph. */
/* Its value is expressed in 16.16 fractional */
/* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
/* when loading the glyph. This field can be */
/* important to perform correct WYSIWYG layout. */
/* Only relevant for outline glyphs. */
/* */
/* linearVertAdvance :: The advance height of the unhinted glyph. */
/* Its value is expressed in 16.16 fractional */
/* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
/* when loading the glyph. This field can be */
/* important to perform correct WYSIWYG layout. */
/* Only relevant for outline glyphs. */
/* */
/* advance :: This shorthand is, depending on */
/* @FT_LOAD_IGNORE_TRANSFORM, the transformed */
/* advance width for the glyph (in 26.6 */
/* fractional pixel format). As specified with */
/* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */
/* `horiAdvance' or the `vertAdvance' value of */
/* `metrics' field. */
/* */
/* format :: This field indicates the format of the image */
/* contained in the glyph slot. Typically */
/* @FT_GLYPH_FORMAT_BITMAP, */
/* @FT_GLYPH_FORMAT_OUTLINE, or */
/* @FT_GLYPH_FORMAT_COMPOSITE, but others are */
/* possible. */
/* */
/* bitmap :: This field is used as a bitmap descriptor */
/* when the slot format is */
/* @FT_GLYPH_FORMAT_BITMAP. Note that the */
/* address and content of the bitmap buffer can */
/* change between calls of @FT_Load_Glyph and a */
/* few other functions. */
/* */
/* bitmap_left :: This is the bitmap's left bearing expressed */
/* in integer pixels. Of course, this is only */
/* valid if the format is */
/* @FT_GLYPH_FORMAT_BITMAP. */
/* */
/* bitmap_top :: This is the bitmap's top bearing expressed in */
/* integer pixels. Remember that this is the */
/* distance from the baseline to the top-most */
/* glyph scanline, upwards y~coordinates being */
/* *positive*. */
/* */
/* outline :: The outline descriptor for the current glyph */
/* image if its format is */
/* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */
/* loaded, `outline' can be transformed, */
/* distorted, embolded, etc. However, it must */
/* not be freed. */
/* */
/* num_subglyphs :: The number of subglyphs in a composite glyph. */
/* This field is only valid for the composite */
/* glyph format that should normally only be */
/* loaded with the @FT_LOAD_NO_RECURSE flag. */
/* For now this is internal to FreeType. */
/* */
/* subglyphs :: An array of subglyph descriptors for */
/* composite glyphs. There are `num_subglyphs' */
/* elements in there. Currently internal to */
/* FreeType. */
/* */
/* control_data :: Certain font drivers can also return the */
/* control data for a given glyph image (e.g. */
/* TrueType bytecode, Type~1 charstrings, etc.). */
/* This field is a pointer to such data. */
/* */
/* control_len :: This is the length in bytes of the control */
/* data. */
/* */
/* other :: Really wicked formats can use this pointer to */
/* present their own glyph image to client */
/* applications. Note that the application */
/* needs to know about the image format. */
/* */
/* lsb_delta :: The difference between hinted and unhinted */
/* left side bearing while autohinting is */
/* active. Zero otherwise. */
/* */
/* rsb_delta :: The difference between hinted and unhinted */
/* right side bearing while autohinting is */
/* active. Zero otherwise. */
/* */
/* <Note> */
/* If @FT_Load_Glyph is called with default flags (see */
/* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
/* its native format (e.g., an outline glyph for TrueType and Type~1 */
/* formats). */
/* */
/* This image can later be converted into a bitmap by calling */
/* @FT_Render_Glyph. This function finds the current renderer for */
/* the native image's format, then invokes it. */
/* */
/* The renderer is in charge of transforming the native image through */
/* the slot's face transformation fields, then converting it into a */
/* bitmap that is returned in `slot->bitmap'. */
/* */
/* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
/* to specify the position of the bitmap relative to the current pen */
/* position (e.g., coordinates (0,0) on the baseline). Of course, */
/* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
/* */
/* <Note> */
/* Here a small pseudo code fragment which shows how to use */
/* `lsb_delta' and `rsb_delta': */
/* */
/* { */
/* FT_Pos origin_x = 0; */
/* FT_Pos prev_rsb_delta = 0; */
/* */
/* */
/* for all glyphs do */
/* <compute kern between current and previous glyph and add it to */
/* `origin_x'> */
/* */
/* <load glyph with `FT_Load_Glyph'> */
/* */
/* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
/* origin_x -= 64; */
/* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
/* origin_x += 64; */
/* */
/* prev_rsb_delta = face->glyph->rsb_delta; */
/* */
/* <save glyph image, or render glyph, or ...> */
/* */
/* origin_x += face->glyph->advance.x; */
/* endfor */
/* } */
/* */
typedef struct FT_GlyphSlotRec_
{
FT_Library library;
FT_Face face;
FT_GlyphSlot next;
FT_UInt reserved; /* retained for binary compatibility */
FT_Generic generic;
 
FT_Glyph_Metrics metrics;
FT_Fixed linearHoriAdvance;
FT_Fixed linearVertAdvance;
FT_Vector advance;
 
FT_Glyph_Format format;
 
FT_Bitmap bitmap;
FT_Int bitmap_left;
FT_Int bitmap_top;
 
FT_Outline outline;
 
FT_UInt num_subglyphs;
FT_SubGlyph subglyphs;
 
void* control_data;
long control_len;
 
FT_Pos lsb_delta;
FT_Pos rsb_delta;
 
void* other;
 
FT_Slot_Internal internal;
 
} FT_GlyphSlotRec;
 
 
/*************************************************************************/
/*************************************************************************/
/* */
/* F U N C T I O N S */
/* */
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Init_FreeType */
/* */
/* <Description> */
/* Initialize a new FreeType library object. The set of modules */
/* that are registered by this function is determined at build time. */
/* */
/* <Output> */
/* alibrary :: A handle to a new library object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* In case you want to provide your own memory allocating routines, */
/* use @FT_New_Library instead, followed by a call to */
/* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
/* */
FT_EXPORT( FT_Error )
FT_Init_FreeType( FT_Library *alibrary );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_FreeType */
/* */
/* <Description> */
/* Destroy a given FreeType library object and all of its children, */
/* including resources, drivers, faces, sizes, etc. */
/* */
/* <Input> */
/* library :: A handle to the target library object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Done_FreeType( FT_Library library );
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_OPEN_XXX */
/* */
/* <Description> */
/* A list of bit-field constants used within the `flags' field of the */
/* @FT_Open_Args structure. */
/* */
/* <Values> */
/* FT_OPEN_MEMORY :: This is a memory-based stream. */
/* */
/* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
/* */
/* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */
/* name. */
/* */
/* FT_OPEN_DRIVER :: Use the `driver' field. */
/* */
/* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */
/* */
/* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */
/* */
/* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */
/* */
/* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */
/* */
/* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */
/* */
/* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */
/* */
/* <Note> */
/* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
/* flags are mutually exclusive. */
/* */
#define FT_OPEN_MEMORY 0x1
#define FT_OPEN_STREAM 0x2
#define FT_OPEN_PATHNAME 0x4
#define FT_OPEN_DRIVER 0x8
#define FT_OPEN_PARAMS 0x10
 
#define ft_open_memory FT_OPEN_MEMORY /* deprecated */
#define ft_open_stream FT_OPEN_STREAM /* deprecated */
#define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */
#define ft_open_driver FT_OPEN_DRIVER /* deprecated */
#define ft_open_params FT_OPEN_PARAMS /* deprecated */
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Parameter */
/* */
/* <Description> */
/* A simple structure used to pass more or less generic parameters to */
/* @FT_Open_Face. */
/* */
/* <Fields> */
/* tag :: A four-byte identification tag. */
/* */
/* data :: A pointer to the parameter data. */
/* */
/* <Note> */
/* The ID and function of parameters are driver-specific. See the */
/* various FT_PARAM_TAG_XXX flags for more information. */
/* */
typedef struct FT_Parameter_
{
FT_ULong tag;
FT_Pointer data;
 
} FT_Parameter;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Open_Args */
/* */
/* <Description> */
/* A structure used to indicate how to open a new font file or */
/* stream. A pointer to such a structure can be used as a parameter */
/* for the functions @FT_Open_Face and @FT_Attach_Stream. */
/* */
/* <Fields> */
/* flags :: A set of bit flags indicating how to use the */
/* structure. */
/* */
/* memory_base :: The first byte of the file in memory. */
/* */
/* memory_size :: The size in bytes of the file in memory. */
/* */
/* pathname :: A pointer to an 8-bit file pathname. */
/* */
/* stream :: A handle to a source stream object. */
/* */
/* driver :: This field is exclusively used by @FT_Open_Face; */
/* it simply specifies the font driver to use to open */
/* the face. If set to~0, FreeType tries to load the */
/* face with each one of the drivers in its list. */
/* */
/* num_params :: The number of extra parameters. */
/* */
/* params :: Extra parameters passed to the font driver when */
/* opening a new face. */
/* */
/* <Note> */
/* The stream type is determined by the contents of `flags' which */
/* are tested in the following order by @FT_Open_Face: */
/* */
/* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */
/* memory file of `memory_size' bytes, located at `memory_address'. */
/* The data are are not copied, and the client is responsible for */
/* releasing and destroying them _after_ the corresponding call to */
/* @FT_Done_Face. */
/* */
/* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */
/* custom input stream `stream' is used. */
/* */
/* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */
/* is a normal file and use `pathname' to open it. */
/* */
/* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */
/* open the file with the driver whose handler is in `driver'. */
/* */
/* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */
/* `num_params' and `params' is used. They are ignored otherwise. */
/* */
/* Ideally, both the `pathname' and `params' fields should be tagged */
/* as `const'; this is missing for API backwards compatibility. In */
/* other words, applications should treat them as read-only. */
/* */
typedef struct FT_Open_Args_
{
FT_UInt flags;
const FT_Byte* memory_base;
FT_Long memory_size;
FT_String* pathname;
FT_Stream stream;
FT_Module driver;
FT_Int num_params;
FT_Parameter* params;
 
} FT_Open_Args;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face */
/* */
/* <Description> */
/* This function calls @FT_Open_Face to open a font by its pathname. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* pathname :: A path to the font file. */
/* */
/* face_index :: The index of the face within the font. The first */
/* face has index~0. */
/* */
/* <Output> */
/* aface :: A handle to a new face object. If `face_index' is */
/* greater than or equal to zero, it must be non-NULL. */
/* See @FT_Open_Face for more details. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_New_Face( FT_Library library,
const char* filepathname,
FT_Long face_index,
FT_Face *aface );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Memory_Face */
/* */
/* <Description> */
/* This function calls @FT_Open_Face to open a font which has been */
/* loaded into memory. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* file_base :: A pointer to the beginning of the font data. */
/* */
/* file_size :: The size of the memory chunk used by the font data. */
/* */
/* face_index :: The index of the face within the font. The first */
/* face has index~0. */
/* */
/* <Output> */
/* aface :: A handle to a new face object. If `face_index' is */
/* greater than or equal to zero, it must be non-NULL. */
/* See @FT_Open_Face for more details. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* You must not deallocate the memory before calling @FT_Done_Face. */
/* */
FT_EXPORT( FT_Error )
FT_New_Memory_Face( FT_Library library,
const FT_Byte* file_base,
FT_Long file_size,
FT_Long face_index,
FT_Face *aface );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Open_Face */
/* */
/* <Description> */
/* Create a face object from a given resource described by */
/* @FT_Open_Args. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* args :: A pointer to an `FT_Open_Args' structure which must */
/* be filled by the caller. */
/* */
/* face_index :: The index of the face within the font. The first */
/* face has index~0. */
/* */
/* <Output> */
/* aface :: A handle to a new face object. If `face_index' is */
/* greater than or equal to zero, it must be non-NULL. */
/* See note below. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* Unlike FreeType 1.x, this function automatically creates a glyph */
/* slot for the face object which can be accessed directly through */
/* `face->glyph'. */
/* */
/* FT_Open_Face can be used to quickly check whether the font */
/* format of a given font resource is supported by FreeType. If the */
/* `face_index' field is negative, the function's return value is~0 */
/* if the font format is recognized, or non-zero otherwise; */
/* the function returns a more or less empty face handle in `*aface' */
/* (if `aface' isn't NULL). The only useful field in this special */
/* case is `face->num_faces' which gives the number of faces within */
/* the font file. After examination, the returned @FT_Face structure */
/* should be deallocated with a call to @FT_Done_Face. */
/* */
/* Each new face object created with this function also owns a */
/* default @FT_Size object, accessible as `face->size'. */
/* */
/* See the discussion of reference counters in the description of */
/* @FT_Reference_Face. */
/* */
FT_EXPORT( FT_Error )
FT_Open_Face( FT_Library library,
const FT_Open_Args* args,
FT_Long face_index,
FT_Face *aface );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Attach_File */
/* */
/* <Description> */
/* This function calls @FT_Attach_Stream to attach a file. */
/* */
/* <InOut> */
/* face :: The target face object. */
/* */
/* <Input> */
/* filepathname :: The pathname. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Attach_File( FT_Face face,
const char* filepathname );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Attach_Stream */
/* */
/* <Description> */
/* `Attach' data to a face object. Normally, this is used to read */
/* additional information for the face object. For example, you can */
/* attach an AFM file that comes with a Type~1 font to get the */
/* kerning values and other metrics. */
/* */
/* <InOut> */
/* face :: The target face object. */
/* */
/* <Input> */
/* parameters :: A pointer to @FT_Open_Args which must be filled by */
/* the caller. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The meaning of the `attach' (i.e., what really happens when the */
/* new file is read) is not fixed by FreeType itself. It really */
/* depends on the font format (and thus the font driver). */
/* */
/* Client applications are expected to know what they are doing */
/* when invoking this function. Most drivers simply do not implement */
/* file attachments. */
/* */
FT_EXPORT( FT_Error )
FT_Attach_Stream( FT_Face face,
FT_Open_Args* parameters );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Reference_Face */
/* */
/* <Description> */
/* A counter gets initialized to~1 at the time an @FT_Face structure */
/* is created. This function increments the counter. @FT_Done_Face */
/* then only destroys a face if the counter is~1, otherwise it simply */
/* decrements the counter. */
/* */
/* This function helps in managing life-cycles of structures which */
/* reference @FT_Face objects. */
/* */
/* <Input> */
/* face :: A handle to a target face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Since> */
/* 2.4.2 */
/* */
FT_EXPORT( FT_Error )
FT_Reference_Face( FT_Face face );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_Face */
/* */
/* <Description> */
/* Discard a given face object, as well as all of its child slots and */
/* sizes. */
/* */
/* <Input> */
/* face :: A handle to a target face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* See the discussion of reference counters in the description of */
/* @FT_Reference_Face. */
/* */
FT_EXPORT( FT_Error )
FT_Done_Face( FT_Face face );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Select_Size */
/* */
/* <Description> */
/* Select a bitmap strike. */
/* */
/* <InOut> */
/* face :: A handle to a target face object. */
/* */
/* <Input> */
/* strike_index :: The index of the bitmap strike in the */
/* `available_sizes' field of @FT_FaceRec structure. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Select_Size( FT_Face face,
FT_Int strike_index );
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Size_Request_Type */
/* */
/* <Description> */
/* An enumeration type that lists the supported size request types. */
/* */
/* <Values> */
/* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
/* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
/* used to determine both scaling values. */
/* */
/* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
/* The real dimension. The sum of the the `Ascender' and (minus */
/* of) the `Descender' fields of @FT_FaceRec are used to determine */
/* both scaling values. */
/* */
/* FT_SIZE_REQUEST_TYPE_BBOX :: */
/* The font bounding box. The width and height of the `bbox' field */
/* of @FT_FaceRec are used to determine the horizontal and vertical */
/* scaling value, respectively. */
/* */
/* FT_SIZE_REQUEST_TYPE_CELL :: */
/* The `max_advance_width' field of @FT_FaceRec is used to */
/* determine the horizontal scaling value; the vertical scaling */
/* value is determined the same way as */
/* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */
/* values are set to the smaller one. This type is useful if you */
/* want to specify the font size for, say, a window of a given */
/* dimension and 80x24 cells. */
/* */
/* FT_SIZE_REQUEST_TYPE_SCALES :: */
/* Specify the scaling values directly. */
/* */
/* <Note> */
/* The above descriptions only apply to scalable formats. For bitmap */
/* formats, the behaviour is up to the driver. */
/* */
/* See the note section of @FT_Size_Metrics if you wonder how size */
/* requesting relates to scaling values. */
/* */
typedef enum FT_Size_Request_Type_
{
FT_SIZE_REQUEST_TYPE_NOMINAL,
FT_SIZE_REQUEST_TYPE_REAL_DIM,
FT_SIZE_REQUEST_TYPE_BBOX,
FT_SIZE_REQUEST_TYPE_CELL,
FT_SIZE_REQUEST_TYPE_SCALES,
 
FT_SIZE_REQUEST_TYPE_MAX
 
} FT_Size_Request_Type;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Size_RequestRec */
/* */
/* <Description> */
/* A structure used to model a size request. */
/* */
/* <Fields> */
/* type :: See @FT_Size_Request_Type. */
/* */
/* width :: The desired width. */
/* */
/* height :: The desired height. */
/* */
/* horiResolution :: The horizontal resolution. If set to zero, */
/* `width' is treated as a 26.6 fractional pixel */
/* value. */
/* */
/* vertResolution :: The vertical resolution. If set to zero, */
/* `height' is treated as a 26.6 fractional pixel */
/* value. */
/* */
/* <Note> */
/* If `width' is zero, then the horizontal scaling value is set equal */
/* to the vertical scaling value, and vice versa. */
/* */
typedef struct FT_Size_RequestRec_
{
FT_Size_Request_Type type;
FT_Long width;
FT_Long height;
FT_UInt horiResolution;
FT_UInt vertResolution;
 
} FT_Size_RequestRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Size_Request */
/* */
/* <Description> */
/* A handle to a size request structure. */
/* */
typedef struct FT_Size_RequestRec_ *FT_Size_Request;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Request_Size */
/* */
/* <Description> */
/* Resize the scale of the active @FT_Size object in a face. */
/* */
/* <InOut> */
/* face :: A handle to a target face object. */
/* */
/* <Input> */
/* req :: A pointer to a @FT_Size_RequestRec. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* Although drivers may select the bitmap strike matching the */
/* request, you should not rely on this if you intend to select a */
/* particular bitmap strike. Use @FT_Select_Size instead in that */
/* case. */
/* */
FT_EXPORT( FT_Error )
FT_Request_Size( FT_Face face,
FT_Size_Request req );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Char_Size */
/* */
/* <Description> */
/* This function calls @FT_Request_Size to request the nominal size */
/* (in points). */
/* */
/* <InOut> */
/* face :: A handle to a target face object. */
/* */
/* <Input> */
/* char_width :: The nominal width, in 26.6 fractional points. */
/* */
/* char_height :: The nominal height, in 26.6 fractional points. */
/* */
/* horz_resolution :: The horizontal resolution in dpi. */
/* */
/* vert_resolution :: The vertical resolution in dpi. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* If either the character width or height is zero, it is set equal */
/* to the other value. */
/* */
/* If either the horizontal or vertical resolution is zero, it is set */
/* equal to the other value. */
/* */
/* A character width or height smaller than 1pt is set to 1pt; if */
/* both resolution values are zero, they are set to 72dpi. */
/* */
/* Don't use this function if you are using the FreeType cache API. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Char_Size( FT_Face face,
FT_F26Dot6 char_width,
FT_F26Dot6 char_height,
FT_UInt horz_resolution,
FT_UInt vert_resolution );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Pixel_Sizes */
/* */
/* <Description> */
/* This function calls @FT_Request_Size to request the nominal size */
/* (in pixels). */
/* */
/* <InOut> */
/* face :: A handle to the target face object. */
/* */
/* <Input> */
/* pixel_width :: The nominal width, in pixels. */
/* */
/* pixel_height :: The nominal height, in pixels. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Pixel_Sizes( FT_Face face,
FT_UInt pixel_width,
FT_UInt pixel_height );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Load_Glyph */
/* */
/* <Description> */
/* A function used to load a single glyph into the glyph slot of a */
/* face object. */
/* */
/* <InOut> */
/* face :: A handle to the target face object where the glyph */
/* is loaded. */
/* */
/* <Input> */
/* glyph_index :: The index of the glyph in the font file. For */
/* CID-keyed fonts (either in PS or in CFF format) */
/* this argument specifies the CID value. */
/* */
/* load_flags :: A flag indicating what to load for this glyph. The */
/* @FT_LOAD_XXX constants can be used to control the */
/* glyph loading process (e.g., whether the outline */
/* should be scaled, whether to load bitmaps or not, */
/* whether to hint the outline, etc). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The loaded glyph may be transformed. See @FT_Set_Transform for */
/* the details. */
/* */
/* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */
/* returned for invalid CID values (this is, for CID values which */
/* don't have a corresponding glyph in the font). See the discussion */
/* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
/* */
FT_EXPORT( FT_Error )
FT_Load_Glyph( FT_Face face,
FT_UInt glyph_index,
FT_Int32 load_flags );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Load_Char */
/* */
/* <Description> */
/* A function used to load a single glyph into the glyph slot of a */
/* face object, according to its character code. */
/* */
/* <InOut> */
/* face :: A handle to a target face object where the glyph */
/* is loaded. */
/* */
/* <Input> */
/* char_code :: The glyph's character code, according to the */
/* current charmap used in the face. */
/* */
/* load_flags :: A flag indicating what to load for this glyph. The */
/* @FT_LOAD_XXX constants can be used to control the */
/* glyph loading process (e.g., whether the outline */
/* should be scaled, whether to load bitmaps or not, */
/* whether to hint the outline, etc). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */
/* */
FT_EXPORT( FT_Error )
FT_Load_Char( FT_Face face,
FT_ULong char_code,
FT_Int32 load_flags );
 
 
/*************************************************************************
*
* @enum:
* FT_LOAD_XXX
*
* @description:
* A list of bit-field constants used with @FT_Load_Glyph to indicate
* what kind of operations to perform during glyph loading.
*
* @values:
* FT_LOAD_DEFAULT ::
* Corresponding to~0, this value is used as the default glyph load
* operation. In this case, the following happens:
*
* 1. FreeType looks for a bitmap for the glyph corresponding to the
* face's current size. If one is found, the function returns.
* The bitmap data can be accessed from the glyph slot (see note
* below).
*
* 2. If no embedded bitmap is searched or found, FreeType looks for a
* scalable outline. If one is found, it is loaded from the font
* file, scaled to device pixels, then `hinted' to the pixel grid
* in order to optimize it. The outline data can be accessed from
* the glyph slot (see note below).
*
* Note that by default, the glyph loader doesn't render outlines into
* bitmaps. The following flags are used to modify this default
* behaviour to more specific and useful cases.
*
* FT_LOAD_NO_SCALE ::
* Don't scale the outline glyph loaded, but keep it in font units.
*
* This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
* unsets @FT_LOAD_RENDER.
*
* FT_LOAD_NO_HINTING ::
* Disable hinting. This generally generates `blurrier' bitmap glyph
* when the glyph is rendered in any of the anti-aliased modes. See
* also the note below.
*
* This flag is implied by @FT_LOAD_NO_SCALE.
*
* FT_LOAD_RENDER ::
* Call @FT_Render_Glyph after the glyph is loaded. By default, the
* glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be
* overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.
*
* This flag is unset by @FT_LOAD_NO_SCALE.
*
* FT_LOAD_NO_BITMAP ::
* Ignore bitmap strikes when loading. Bitmap-only fonts ignore this
* flag.
*
* @FT_LOAD_NO_SCALE always sets this flag.
*
* FT_LOAD_VERTICAL_LAYOUT ::
* Load the glyph for vertical text layout. _Don't_ use it as it is
* problematic currently.
*
* FT_LOAD_FORCE_AUTOHINT ::
* Indicates that the auto-hinter is preferred over the font's native
* hinter. See also the note below.
*
* FT_LOAD_CROP_BITMAP ::
* Indicates that the font driver should crop the loaded bitmap glyph
* (i.e., remove all space around its black bits). Not all drivers
* implement this.
*
* FT_LOAD_PEDANTIC ::
* Indicates that the font driver should perform pedantic verifications
* during glyph loading. This is mostly used to detect broken glyphs
* in fonts. By default, FreeType tries to handle broken fonts also.
*
* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
* Indicates that the font driver should ignore the global advance
* width defined in the font. By default, that value is used as the
* advance width for all glyphs when the face has
* @FT_FACE_FLAG_FIXED_WIDTH set.
*
* This flag exists for historical reasons (to support buggy CJK
* fonts).
*
* FT_LOAD_NO_RECURSE ::
* This flag is only used internally. It merely indicates that the
* font driver should not load composite glyphs recursively. Instead,
* it should set the `num_subglyph' and `subglyphs' values of the
* glyph slot accordingly, and set `glyph->format' to
* @FT_GLYPH_FORMAT_COMPOSITE.
*
* The description of sub-glyphs is not available to client
* applications for now.
*
* This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
*
* FT_LOAD_IGNORE_TRANSFORM ::
* Indicates that the transform matrix set by @FT_Set_Transform should
* be ignored.
*
* FT_LOAD_MONOCHROME ::
* This flag is used with @FT_LOAD_RENDER to indicate that you want to
* render an outline glyph to a 1-bit monochrome bitmap glyph, with
* 8~pixels packed into each byte of the bitmap data.
*
* Note that this has no effect on the hinting algorithm used. You
* should rather use @FT_LOAD_TARGET_MONO so that the
* monochrome-optimized hinting algorithm is used.
*
* FT_LOAD_LINEAR_DESIGN ::
* Indicates that the `linearHoriAdvance' and `linearVertAdvance'
* fields of @FT_GlyphSlotRec should be kept in font units. See
* @FT_GlyphSlotRec for details.
*
* FT_LOAD_NO_AUTOHINT ::
* Disable auto-hinter. See also the note below.
*
* @note:
* By default, hinting is enabled and the font's native hinter (see
* @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can
* disable hinting by setting @FT_LOAD_NO_HINTING or change the
* precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set
* @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be
* used at all.
*
* See the description of @FT_FACE_FLAG_TRICKY for a special exception
* (affecting only a handful of Asian fonts).
*
* Besides deciding which hinter to use, you can also decide which
* hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
*
*/
#define FT_LOAD_DEFAULT 0x0
#define FT_LOAD_NO_SCALE 0x1
#define FT_LOAD_NO_HINTING 0x2
#define FT_LOAD_RENDER 0x4
#define FT_LOAD_NO_BITMAP 0x8
#define FT_LOAD_VERTICAL_LAYOUT 0x10
#define FT_LOAD_FORCE_AUTOHINT 0x20
#define FT_LOAD_CROP_BITMAP 0x40
#define FT_LOAD_PEDANTIC 0x80
#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 0x200
#define FT_LOAD_NO_RECURSE 0x400
#define FT_LOAD_IGNORE_TRANSFORM 0x800
#define FT_LOAD_MONOCHROME 0x1000
#define FT_LOAD_LINEAR_DESIGN 0x2000
#define FT_LOAD_NO_AUTOHINT 0x8000U
 
/* */
 
/* used internally only by certain font drivers! */
#define FT_LOAD_ADVANCE_ONLY 0x100
#define FT_LOAD_SBITS_ONLY 0x4000
 
 
/**************************************************************************
*
* @enum:
* FT_LOAD_TARGET_XXX
*
* @description:
* A list of values that are used to select a specific hinting algorithm
* to use by the hinter. You should OR one of these values to your
* `load_flags' when calling @FT_Load_Glyph.
*
* Note that font's native hinters may ignore the hinting algorithm you
* have specified (e.g., the TrueType bytecode interpreter). You can set
* @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.
*
* Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it
* always implies @FT_LOAD_FORCE_AUTOHINT.
*
* @values:
* FT_LOAD_TARGET_NORMAL ::
* This corresponds to the default hinting algorithm, optimized for
* standard gray-level rendering. For monochrome output, use
* @FT_LOAD_TARGET_MONO instead.
*
* FT_LOAD_TARGET_LIGHT ::
* A lighter hinting algorithm for non-monochrome modes. Many
* generated glyphs are more fuzzy but better resemble its original
* shape. A bit like rendering on Mac OS~X.
*
* As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.
*
* FT_LOAD_TARGET_MONO ::
* Strong hinting algorithm that should only be used for monochrome
* output. The result is probably unpleasant if the glyph is rendered
* in non-monochrome modes.
*
* FT_LOAD_TARGET_LCD ::
* A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally
* decimated LCD displays.
*
* FT_LOAD_TARGET_LCD_V ::
* A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically
* decimated LCD displays.
*
* @note:
* You should use only _one_ of the FT_LOAD_TARGET_XXX values in your
* `load_flags'. They can't be ORed.
*
* If @FT_LOAD_RENDER is also set, the glyph is rendered in the
* corresponding mode (i.e., the mode which matches the used algorithm
* best) unless @FT_LOAD_MONOCHROME is set.
*
* You can use a hinting algorithm that doesn't correspond to the same
* rendering mode. As an example, it is possible to use the `light'
* hinting algorithm and have the results rendered in horizontal LCD
* pixel mode, with code like
*
* {
* FT_Load_Glyph( face, glyph_index,
* load_flags | FT_LOAD_TARGET_LIGHT );
*
* FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
* }
*
*/
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
 
#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
 
 
/**************************************************************************
*
* @macro:
* FT_LOAD_TARGET_MODE
*
* @description:
* Return the @FT_Render_Mode corresponding to a given
* @FT_LOAD_TARGET_XXX value.
*
*/
#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Transform */
/* */
/* <Description> */
/* A function used to set the transformation that is applied to glyph */
/* images when they are loaded into a glyph slot through */
/* @FT_Load_Glyph. */
/* */
/* <InOut> */
/* face :: A handle to the source face object. */
/* */
/* <Input> */
/* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */
/* the identity matrix. */
/* delta :: A pointer to the translation vector. Use~0 for the null */
/* vector. */
/* */
/* <Note> */
/* The transformation is only applied to scalable image formats after */
/* the glyph has been loaded. It means that hinting is unaltered by */
/* the transformation and is performed on the character size given in */
/* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */
/* */
/* Note that this also transforms the `face.glyph.advance' field, but */
/* *not* the values in `face.glyph.metrics'. */
/* */
FT_EXPORT( void )
FT_Set_Transform( FT_Face face,
FT_Matrix* matrix,
FT_Vector* delta );
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Render_Mode */
/* */
/* <Description> */
/* An enumeration type that lists the render modes supported by */
/* FreeType~2. Each mode corresponds to a specific type of scanline */
/* conversion performed on the outline. */
/* */
/* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
/* field in the @FT_GlyphSlotRec structure gives the format of the */
/* returned bitmap. */
/* */
/* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
/* */
/* <Values> */
/* FT_RENDER_MODE_NORMAL :: */
/* This is the default render mode; it corresponds to 8-bit */
/* anti-aliased bitmaps. */
/* */
/* FT_RENDER_MODE_LIGHT :: */
/* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
/* defined as a separate value because render modes are also used */
/* indirectly to define hinting algorithm selectors. See */
/* @FT_LOAD_TARGET_XXX for details. */
/* */
/* FT_RENDER_MODE_MONO :: */
/* This mode corresponds to 1-bit bitmaps (with 2~levels of */
/* opacity). */
/* */
/* FT_RENDER_MODE_LCD :: */
/* This mode corresponds to horizontal RGB and BGR sub-pixel */
/* displays like LCD screens. It produces 8-bit bitmaps that are */
/* 3~times the width of the original glyph outline in pixels, and */
/* which use the @FT_PIXEL_MODE_LCD mode. */
/* */
/* FT_RENDER_MODE_LCD_V :: */
/* This mode corresponds to vertical RGB and BGR sub-pixel displays */
/* (like PDA screens, rotated LCD displays, etc.). It produces */
/* 8-bit bitmaps that are 3~times the height of the original */
/* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
/* */
/* <Note> */
/* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
/* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
/* (not active in the default builds). It is up to the caller to */
/* either call @FT_Library_SetLcdFilter (if available) or do the */
/* filtering itself. */
/* */
/* The selected render mode only affects vector glyphs of a font. */
/* Embedded bitmaps often have a different pixel mode like */
/* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */
/* them into 8-bit pixmaps. */
/* */
typedef enum FT_Render_Mode_
{
FT_RENDER_MODE_NORMAL = 0,
FT_RENDER_MODE_LIGHT,
FT_RENDER_MODE_MONO,
FT_RENDER_MODE_LCD,
FT_RENDER_MODE_LCD_V,
 
FT_RENDER_MODE_MAX
 
} FT_Render_Mode;
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* ft_render_mode_xxx */
/* */
/* <Description> */
/* These constants are deprecated. Use the corresponding */
/* @FT_Render_Mode values instead. */
/* */
/* <Values> */
/* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */
/* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */
/* */
#define ft_render_mode_normal FT_RENDER_MODE_NORMAL
#define ft_render_mode_mono FT_RENDER_MODE_MONO
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Render_Glyph */
/* */
/* <Description> */
/* Convert a given glyph image to a bitmap. It does so by inspecting */
/* the glyph image format, finding the relevant renderer, and */
/* invoking it. */
/* */
/* <InOut> */
/* slot :: A handle to the glyph slot containing the image to */
/* convert. */
/* */
/* <Input> */
/* render_mode :: This is the render mode used to render the glyph */
/* image into a bitmap. See @FT_Render_Mode for a */
/* list of possible values. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Render_Glyph( FT_GlyphSlot slot,
FT_Render_Mode render_mode );
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Kerning_Mode */
/* */
/* <Description> */
/* An enumeration used to specify which kerning values to return in */
/* @FT_Get_Kerning. */
/* */
/* <Values> */
/* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */
/* distances (value is~0). */
/* */
/* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */
/* distances. */
/* */
/* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
/* units. */
/* */
typedef enum FT_Kerning_Mode_
{
FT_KERNING_DEFAULT = 0,
FT_KERNING_UNFITTED,
FT_KERNING_UNSCALED
 
} FT_Kerning_Mode;
 
 
/*************************************************************************/
/* */
/* <Const> */
/* ft_kerning_default */
/* */
/* <Description> */
/* This constant is deprecated. Please use @FT_KERNING_DEFAULT */
/* instead. */
/* */
#define ft_kerning_default FT_KERNING_DEFAULT
 
 
/*************************************************************************/
/* */
/* <Const> */
/* ft_kerning_unfitted */
/* */
/* <Description> */
/* This constant is deprecated. Please use @FT_KERNING_UNFITTED */
/* instead. */
/* */
#define ft_kerning_unfitted FT_KERNING_UNFITTED
 
 
/*************************************************************************/
/* */
/* <Const> */
/* ft_kerning_unscaled */
/* */
/* <Description> */
/* This constant is deprecated. Please use @FT_KERNING_UNSCALED */
/* instead. */
/* */
#define ft_kerning_unscaled FT_KERNING_UNSCALED
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Kerning */
/* */
/* <Description> */
/* Return the kerning vector between two glyphs of a same face. */
/* */
/* <Input> */
/* face :: A handle to a source face object. */
/* */
/* left_glyph :: The index of the left glyph in the kern pair. */
/* */
/* right_glyph :: The index of the right glyph in the kern pair. */
/* */
/* kern_mode :: See @FT_Kerning_Mode for more information. */
/* Determines the scale and dimension of the returned */
/* kerning vector. */
/* */
/* <Output> */
/* akerning :: The kerning vector. This is either in font units */
/* or in pixels (26.6 format) for scalable formats, */
/* and in pixels for fixed-sizes formats. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* Only horizontal layouts (left-to-right & right-to-left) are */
/* supported by this method. Other layouts, or more sophisticated */
/* kernings, are out of the scope of this API function -- they can be */
/* implemented through format-specific interfaces. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Kerning( FT_Face face,
FT_UInt left_glyph,
FT_UInt right_glyph,
FT_UInt kern_mode,
FT_Vector *akerning );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Track_Kerning */
/* */
/* <Description> */
/* Return the track kerning for a given face object at a given size. */
/* */
/* <Input> */
/* face :: A handle to a source face object. */
/* */
/* point_size :: The point size in 16.16 fractional points. */
/* */
/* degree :: The degree of tightness. */
/* */
/* <Output> */
/* akerning :: The kerning in 16.16 fractional points. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Track_Kerning( FT_Face face,
FT_Fixed point_size,
FT_Int degree,
FT_Fixed* akerning );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Glyph_Name */
/* */
/* <Description> */
/* Retrieve the ASCII name of a given glyph in a face. This only */
/* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */
/* */
/* <Input> */
/* face :: A handle to a source face object. */
/* */
/* glyph_index :: The glyph index. */
/* */
/* buffer_max :: The maximal number of bytes available in the */
/* buffer. */
/* */
/* <Output> */
/* buffer :: A pointer to a target buffer where the name is */
/* copied to. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* An error is returned if the face doesn't provide glyph names or if */
/* the glyph index is invalid. In all cases of failure, the first */
/* byte of `buffer' is set to~0 to indicate an empty name. */
/* */
/* The glyph name is truncated to fit within the buffer if it is too */
/* long. The returned string is always zero-terminated. */
/* */
/* This function is not compiled within the library if the config */
/* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */
/* `include/freetype/config/ftoptions.h'. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Glyph_Name( FT_Face face,
FT_UInt glyph_index,
FT_Pointer buffer,
FT_UInt buffer_max );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Postscript_Name */
/* */
/* <Description> */
/* Retrieve the ASCII PostScript name of a given face, if available. */
/* This only works with PostScript and TrueType fonts. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
/* */
/* <Return> */
/* A pointer to the face's PostScript name. NULL if unavailable. */
/* */
/* <Note> */
/* The returned pointer is owned by the face and is destroyed with */
/* it. */
/* */
FT_EXPORT( const char* )
FT_Get_Postscript_Name( FT_Face face );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Select_Charmap */
/* */
/* <Description> */
/* Select a given charmap by its encoding tag (as listed in */
/* `freetype.h'). */
/* */
/* <InOut> */
/* face :: A handle to the source face object. */
/* */
/* <Input> */
/* encoding :: A handle to the selected encoding. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* This function returns an error if no charmap in the face */
/* corresponds to the encoding queried here. */
/* */
/* Because many fonts contain more than a single cmap for Unicode */
/* encoding, this function has some special code to select the one */
/* which covers Unicode best (`best' in the sense that a UCS-4 cmap */
/* is preferred to a UCS-2 cmap). It is thus preferable to */
/* @FT_Set_Charmap in this case. */
/* */
FT_EXPORT( FT_Error )
FT_Select_Charmap( FT_Face face,
FT_Encoding encoding );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Charmap */
/* */
/* <Description> */
/* Select a given charmap for character code to glyph index mapping. */
/* */
/* <InOut> */
/* face :: A handle to the source face object. */
/* */
/* <Input> */
/* charmap :: A handle to the selected charmap. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* This function returns an error if the charmap is not part of */
/* the face (i.e., if it is not listed in the `face->charmaps' */
/* table). */
/* */
/* It also fails if a type~14 charmap is selected. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Charmap( FT_Face face,
FT_CharMap charmap );
 
 
/*************************************************************************
*
* @function:
* FT_Get_Charmap_Index
*
* @description:
* Retrieve index of a given charmap.
*
* @input:
* charmap ::
* A handle to a charmap.
*
* @return:
* The index into the array of character maps within the face to which
* `charmap' belongs. If an error occurs, -1 is returned.
*
*/
FT_EXPORT( FT_Int )
FT_Get_Charmap_Index( FT_CharMap charmap );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Char_Index */
/* */
/* <Description> */
/* Return the glyph index of a given character code. This function */
/* uses a charmap object to do the mapping. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
/* */
/* charcode :: The character code. */
/* */
/* <Return> */
/* The glyph index. 0~means `undefined character code'. */
/* */
/* <Note> */
/* If you use FreeType to manipulate the contents of font files */
/* directly, be aware that the glyph index returned by this function */
/* doesn't always correspond to the internal indices used within */
/* the file. This is done to ensure that value~0 always corresponds */
/* to the `missing glyph'. */
/* */
FT_EXPORT( FT_UInt )
FT_Get_Char_Index( FT_Face face,
FT_ULong charcode );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_First_Char */
/* */
/* <Description> */
/* This function is used to return the first character code in the */
/* current charmap of a given face. It also returns the */
/* corresponding glyph index. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
/* */
/* <Output> */
/* agindex :: Glyph index of first character code. 0~if charmap is */
/* empty. */
/* */
/* <Return> */
/* The charmap's first character code. */
/* */
/* <Note> */
/* You should use this function with @FT_Get_Next_Char to be able to */
/* parse all character codes available in a given charmap. The code */
/* should look like this: */
/* */
/* { */
/* FT_ULong charcode; */
/* FT_UInt gindex; */
/* */
/* */
/* charcode = FT_Get_First_Char( face, &gindex ); */
/* while ( gindex != 0 ) */
/* { */
/* ... do something with (charcode,gindex) pair ... */
/* */
/* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */
/* } */
/* } */
/* */
/* Note that `*agindex' is set to~0 if the charmap is empty. The */
/* result itself can be~0 in two cases: if the charmap is empty or */
/* if the value~0 is the first valid character code. */
/* */
FT_EXPORT( FT_ULong )
FT_Get_First_Char( FT_Face face,
FT_UInt *agindex );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Next_Char */
/* */
/* <Description> */
/* This function is used to return the next character code in the */
/* current charmap of a given face following the value `char_code', */
/* as well as the corresponding glyph index. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
/* char_code :: The starting character code. */
/* */
/* <Output> */
/* agindex :: Glyph index of next character code. 0~if charmap */
/* is empty. */
/* */
/* <Return> */
/* The charmap's next character code. */
/* */
/* <Note> */
/* You should use this function with @FT_Get_First_Char to walk */
/* over all character codes available in a given charmap. See the */
/* note for this function for a simple code example. */
/* */
/* Note that `*agindex' is set to~0 when there are no more codes in */
/* the charmap. */
/* */
FT_EXPORT( FT_ULong )
FT_Get_Next_Char( FT_Face face,
FT_ULong char_code,
FT_UInt *agindex );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Name_Index */
/* */
/* <Description> */
/* Return the glyph index of a given glyph name. This function uses */
/* driver specific objects to do the translation. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
/* */
/* glyph_name :: The glyph name. */
/* */
/* <Return> */
/* The glyph index. 0~means `undefined character code'. */
/* */
FT_EXPORT( FT_UInt )
FT_Get_Name_Index( FT_Face face,
FT_String* glyph_name );
 
 
/*************************************************************************
*
* @macro:
* FT_SUBGLYPH_FLAG_XXX
*
* @description:
* A list of constants used to describe subglyphs. Please refer to the
* TrueType specification for the meaning of the various flags.
*
* @values:
* FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
* FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::
* FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::
* FT_SUBGLYPH_FLAG_SCALE ::
* FT_SUBGLYPH_FLAG_XY_SCALE ::
* FT_SUBGLYPH_FLAG_2X2 ::
* FT_SUBGLYPH_FLAG_USE_MY_METRICS ::
*
*/
#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
#define FT_SUBGLYPH_FLAG_SCALE 8
#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
#define FT_SUBGLYPH_FLAG_2X2 0x80
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
 
 
/*************************************************************************
*
* @func:
* FT_Get_SubGlyph_Info
*
* @description:
* Retrieve a description of a given subglyph. Only use it if
* `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is
* returned otherwise.
*
* @input:
* glyph ::
* The source glyph slot.
*
* sub_index ::
* The index of the subglyph. Must be less than
* `glyph->num_subglyphs'.
*
* @output:
* p_index ::
* The glyph index of the subglyph.
*
* p_flags ::
* The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.
*
* p_arg1 ::
* The subglyph's first argument (if any).
*
* p_arg2 ::
* The subglyph's second argument (if any).
*
* p_transform ::
* The subglyph transformation (if any).
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The values of `*p_arg1', `*p_arg2', and `*p_transform' must be
* interpreted depending on the flags returned in `*p_flags'. See the
* TrueType specification for details.
*
*/
FT_EXPORT( FT_Error )
FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,
FT_UInt sub_index,
FT_Int *p_index,
FT_UInt *p_flags,
FT_Int *p_arg1,
FT_Int *p_arg2,
FT_Matrix *p_transform );
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_FSTYPE_XXX */
/* */
/* <Description> */
/* A list of bit flags used in the `fsType' field of the OS/2 table */
/* in a TrueType or OpenType font and the `FSType' entry in a */
/* PostScript font. These bit flags are returned by */
/* @FT_Get_FSType_Flags; they inform client applications of embedding */
/* and subsetting restrictions associated with a font. */
/* */
/* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */
/* more details. */
/* */
/* <Values> */
/* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */
/* Fonts with no fsType bit set may be embedded and permanently */
/* installed on the remote system by an application. */
/* */
/* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */
/* Fonts that have only this bit set must not be modified, embedded */
/* or exchanged in any manner without first obtaining permission of */
/* the font software copyright owner. */
/* */
/* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
/* If this bit is set, the font may be embedded and temporarily */
/* loaded on the remote system. Documents containing Preview & */
/* Print fonts must be opened `read-only'; no edits can be applied */
/* to the document. */
/* */
/* FT_FSTYPE_EDITABLE_EMBEDDING :: */
/* If this bit is set, the font may be embedded but must only be */
/* installed temporarily on other systems. In contrast to Preview */
/* & Print fonts, documents containing editable fonts may be opened */
/* for reading, editing is permitted, and changes may be saved. */
/* */
/* FT_FSTYPE_NO_SUBSETTING :: */
/* If this bit is set, the font may not be subsetted prior to */
/* embedding. */
/* */
/* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
/* If this bit is set, only bitmaps contained in the font may be */
/* embedded; no outline data may be embedded. If there are no */
/* bitmaps available in the font, then the font is unembeddable. */
/* */
/* <Note> */
/* While the fsType flags can indicate that a font may be embedded, a */
/* license with the font vendor may be separately required to use the */
/* font in this way. */
/* */
#define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000
#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002
#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004
#define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008
#define FT_FSTYPE_NO_SUBSETTING 0x0100
#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_FSType_Flags */
/* */
/* <Description> */
/* Return the fsType flags for a font. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
/* */
/* <Return> */
/* The fsType flags, @FT_FSTYPE_XXX. */
/* */
/* <Note> */
/* Use this function rather than directly reading the `fs_type' field */
/* in the @PS_FontInfoRec structure which is only guaranteed to */
/* return the correct results for Type~1 fonts. */
/* */
FT_EXPORT( FT_UShort )
FT_Get_FSType_Flags( FT_Face face );
 
 
/*************************************************************************/
/* */
/* <Section> */
/* glyph_variants */
/* */
/* <Title> */
/* Glyph Variants */
/* */
/* <Abstract> */
/* The FreeType~2 interface to Unicode Ideographic Variation */
/* Sequences (IVS), using the SFNT cmap format~14. */
/* */
/* <Description> */
/* Many CJK characters have variant forms. They are a sort of grey */
/* area somewhere between being totally irrelevant and semantically */
/* distinct; for this reason, the Unicode consortium decided to */
/* introduce Ideographic Variation Sequences (IVS), consisting of a */
/* Unicode base character and one of 240 variant selectors */
/* (U+E0100-U+E01EF), instead of further extending the already huge */
/* code range for CJK characters. */
/* */
/* An IVS is registered and unique; for further details please refer */
/* to Unicode Technical Report #37, the Ideographic Variation */
/* Database. To date (October 2007), the character with the most */
/* variants is U+908A, having 8~such IVS. */
/* */
/* Adobe and MS decided to support IVS with a new cmap subtable */
/* (format~14). It is an odd subtable because it is not a mapping of */
/* input code points to glyphs, but contains lists of all variants */
/* supported by the font. */
/* */
/* A variant may be either `default' or `non-default'. A default */
/* variant is the one you will get for that code point if you look it */
/* up in the standard Unicode cmap. A non-default variant is a */
/* different glyph. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Face_GetCharVariantIndex */
/* */
/* <Description> */
/* Return the glyph index of a given character code as modified by */
/* the variation selector. */
/* */
/* <Input> */
/* face :: */
/* A handle to the source face object. */
/* */
/* charcode :: */
/* The character code point in Unicode. */
/* */
/* variantSelector :: */
/* The Unicode code point of the variation selector. */
/* */
/* <Return> */
/* The glyph index. 0~means either `undefined character code', or */
/* `undefined selector code', or `no variation selector cmap */
/* subtable', or `current CharMap is not Unicode'. */
/* */
/* <Note> */
/* If you use FreeType to manipulate the contents of font files */
/* directly, be aware that the glyph index returned by this function */
/* doesn't always correspond to the internal indices used within */
/* the file. This is done to ensure that value~0 always corresponds */
/* to the `missing glyph'. */
/* */
/* This function is only meaningful if */
/* a) the font has a variation selector cmap sub table, */
/* and */
/* b) the current charmap has a Unicode encoding. */
/* */
/* <Since> */
/* 2.3.6 */
/* */
FT_EXPORT( FT_UInt )
FT_Face_GetCharVariantIndex( FT_Face face,
FT_ULong charcode,
FT_ULong variantSelector );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Face_GetCharVariantIsDefault */
/* */
/* <Description> */
/* Check whether this variant of this Unicode character is the one to */
/* be found in the `cmap'. */
/* */
/* <Input> */
/* face :: */
/* A handle to the source face object. */
/* */
/* charcode :: */
/* The character codepoint in Unicode. */
/* */
/* variantSelector :: */
/* The Unicode codepoint of the variation selector. */
/* */
/* <Return> */
/* 1~if found in the standard (Unicode) cmap, 0~if found in the */
/* variation selector cmap, or -1 if it is not a variant. */
/* */
/* <Note> */
/* This function is only meaningful if the font has a variation */
/* selector cmap subtable. */
/* */
/* <Since> */
/* 2.3.6 */
/* */
FT_EXPORT( FT_Int )
FT_Face_GetCharVariantIsDefault( FT_Face face,
FT_ULong charcode,
FT_ULong variantSelector );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Face_GetVariantSelectors */
/* */
/* <Description> */
/* Return a zero-terminated list of Unicode variant selectors found */
/* in the font. */
/* */
/* <Input> */
/* face :: */
/* A handle to the source face object. */
/* */
/* <Return> */
/* A pointer to an array of selector code points, or NULL if there is */
/* no valid variant selector cmap subtable. */
/* */
/* <Note> */
/* The last item in the array is~0; the array is owned by the */
/* @FT_Face object but can be overwritten or released on the next */
/* call to a FreeType function. */
/* */
/* <Since> */
/* 2.3.6 */
/* */
FT_EXPORT( FT_UInt32* )
FT_Face_GetVariantSelectors( FT_Face face );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Face_GetVariantsOfChar */
/* */
/* <Description> */
/* Return a zero-terminated list of Unicode variant selectors found */
/* for the specified character code. */
/* */
/* <Input> */
/* face :: */
/* A handle to the source face object. */
/* */
/* charcode :: */
/* The character codepoint in Unicode. */
/* */
/* <Return> */
/* A pointer to an array of variant selector code points which are */
/* active for the given character, or NULL if the corresponding list */
/* is empty. */
/* */
/* <Note> */
/* The last item in the array is~0; the array is owned by the */
/* @FT_Face object but can be overwritten or released on the next */
/* call to a FreeType function. */
/* */
/* <Since> */
/* 2.3.6 */
/* */
FT_EXPORT( FT_UInt32* )
FT_Face_GetVariantsOfChar( FT_Face face,
FT_ULong charcode );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Face_GetCharsOfVariant */
/* */
/* <Description> */
/* Return a zero-terminated list of Unicode character codes found for */
/* the specified variant selector. */
/* */
/* <Input> */
/* face :: */
/* A handle to the source face object. */
/* */
/* variantSelector :: */
/* The variant selector code point in Unicode. */
/* */
/* <Return> */
/* A list of all the code points which are specified by this selector */
/* (both default and non-default codes are returned) or NULL if there */
/* is no valid cmap or the variant selector is invalid. */
/* */
/* <Note> */
/* The last item in the array is~0; the array is owned by the */
/* @FT_Face object but can be overwritten or released on the next */
/* call to a FreeType function. */
/* */
/* <Since> */
/* 2.3.6 */
/* */
FT_EXPORT( FT_UInt32* )
FT_Face_GetCharsOfVariant( FT_Face face,
FT_ULong variantSelector );
 
 
/*************************************************************************/
/* */
/* <Section> */
/* computations */
/* */
/* <Title> */
/* Computations */
/* */
/* <Abstract> */
/* Crunching fixed numbers and vectors. */
/* */
/* <Description> */
/* This section contains various functions used to perform */
/* computations on 16.16 fixed-float numbers or 2d vectors. */
/* */
/* <Order> */
/* FT_MulDiv */
/* FT_MulFix */
/* FT_DivFix */
/* FT_RoundFix */
/* FT_CeilFix */
/* FT_FloorFix */
/* FT_Vector_Transform */
/* FT_Matrix_Multiply */
/* FT_Matrix_Invert */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_MulDiv */
/* */
/* <Description> */
/* A very simple function used to perform the computation `(a*b)/c' */
/* with maximal accuracy (it uses a 64-bit intermediate integer */
/* whenever necessary). */
/* */
/* This function isn't necessarily as fast as some processor specific */
/* operations, but is at least completely portable. */
/* */
/* <Input> */
/* a :: The first multiplier. */
/* b :: The second multiplier. */
/* c :: The divisor. */
/* */
/* <Return> */
/* The result of `(a*b)/c'. This function never traps when trying to */
/* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
/* on the signs of `a' and `b'. */
/* */
FT_EXPORT( FT_Long )
FT_MulDiv( FT_Long a,
FT_Long b,
FT_Long c );
 
 
/* */
 
/* The following #if 0 ... #endif is for the documentation formatter, */
/* hiding the internal `FT_MULFIX_INLINED' macro. */
 
#if 0
/*************************************************************************/
/* */
/* <Function> */
/* FT_MulFix */
/* */
/* <Description> */
/* A very simple function used to perform the computation */
/* `(a*b)/0x10000' with maximal accuracy. Most of the time this is */
/* used to multiply a given value by a 16.16 fixed float factor. */
/* */
/* <Input> */
/* a :: The first multiplier. */
/* b :: The second multiplier. Use a 16.16 factor here whenever */
/* possible (see note below). */
/* */
/* <Return> */
/* The result of `(a*b)/0x10000'. */
/* */
/* <Note> */
/* This function has been optimized for the case where the absolute */
/* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
/* As this happens mainly when scaling from notional units to */
/* fractional pixels in FreeType, it resulted in noticeable speed */
/* improvements between versions 2.x and 1.x. */
/* */
/* As a conclusion, always try to place a 16.16 factor as the */
/* _second_ argument of this function; this can make a great */
/* difference. */
/* */
FT_EXPORT( FT_Long )
FT_MulFix( FT_Long a,
FT_Long b );
 
/* */
#endif
 
#ifdef FT_MULFIX_INLINED
#define FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b )
#else
FT_EXPORT( FT_Long )
FT_MulFix( FT_Long a,
FT_Long b );
#endif
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_DivFix */
/* */
/* <Description> */
/* A very simple function used to perform the computation */
/* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */
/* used to divide a given value by a 16.16 fixed float factor. */
/* */
/* <Input> */
/* a :: The first multiplier. */
/* b :: The second multiplier. Use a 16.16 factor here whenever */
/* possible (see note below). */
/* */
/* <Return> */
/* The result of `(a*0x10000)/b'. */
/* */
/* <Note> */
/* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */
/* 32~bits, then the division is computed directly. Otherwise, we */
/* use a specialized version of @FT_MulDiv. */
/* */
FT_EXPORT( FT_Long )
FT_DivFix( FT_Long a,
FT_Long b );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_RoundFix */
/* */
/* <Description> */
/* A very simple function used to round a 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number to be rounded. */
/* */
/* <Return> */
/* The result of `(a + 0x8000) & -0x10000'. */
/* */
FT_EXPORT( FT_Fixed )
FT_RoundFix( FT_Fixed a );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_CeilFix */
/* */
/* <Description> */
/* A very simple function used to compute the ceiling function of a */
/* 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number for which the ceiling function is to be computed. */
/* */
/* <Return> */
/* The result of `(a + 0x10000 - 1) & -0x10000'. */
/* */
FT_EXPORT( FT_Fixed )
FT_CeilFix( FT_Fixed a );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_FloorFix */
/* */
/* <Description> */
/* A very simple function used to compute the floor function of a */
/* 16.16 fixed number. */
/* */
/* <Input> */
/* a :: The number for which the floor function is to be computed. */
/* */
/* <Return> */
/* The result of `a & -0x10000'. */
/* */
FT_EXPORT( FT_Fixed )
FT_FloorFix( FT_Fixed a );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Vector_Transform */
/* */
/* <Description> */
/* Transform a single vector through a 2x2 matrix. */
/* */
/* <InOut> */
/* vector :: The target vector to transform. */
/* */
/* <Input> */
/* matrix :: A pointer to the source 2x2 matrix. */
/* */
/* <Note> */
/* The result is undefined if either `vector' or `matrix' is invalid. */
/* */
FT_EXPORT( void )
FT_Vector_Transform( FT_Vector* vec,
const FT_Matrix* matrix );
 
 
/*************************************************************************/
/* */
/* <Section> */
/* version */
/* */
/* <Title> */
/* FreeType Version */
/* */
/* <Abstract> */
/* Functions and macros related to FreeType versions. */
/* */
/* <Description> */
/* Note that those functions and macros are of limited use because */
/* even a new release of FreeType with only documentation changes */
/* increases the version number. */
/* */
/*************************************************************************/
 
 
/*************************************************************************
*
* @enum:
* FREETYPE_XXX
*
* @description:
* These three macros identify the FreeType source code version.
* Use @FT_Library_Version to access them at runtime.
*
* @values:
* FREETYPE_MAJOR :: The major version number.
* FREETYPE_MINOR :: The minor version number.
* FREETYPE_PATCH :: The patch level.
*
* @note:
* The version number of FreeType if built as a dynamic link library
* with the `libtool' package is _not_ controlled by these three
* macros.
*
*/
#define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 4
#define FREETYPE_PATCH 4
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Library_Version */
/* */
/* <Description> */
/* Return the version of the FreeType library being used. This is */
/* useful when dynamically linking to the library, since one cannot */
/* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */
/* @FREETYPE_PATCH. */
/* */
/* <Input> */
/* library :: A source library handle. */
/* */
/* <Output> */
/* amajor :: The major version number. */
/* */
/* aminor :: The minor version number. */
/* */
/* apatch :: The patch version number. */
/* */
/* <Note> */
/* The reason why this function takes a `library' argument is because */
/* certain programs implement library initialization in a custom way */
/* that doesn't use @FT_Init_FreeType. */
/* */
/* In such cases, the library version might not be available before */
/* the library object has been created. */
/* */
FT_EXPORT( void )
FT_Library_Version( FT_Library library,
FT_Int *amajor,
FT_Int *aminor,
FT_Int *apatch );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Face_CheckTrueTypePatents */
/* */
/* <Description> */
/* Parse all bytecode instructions of a TrueType font file to check */
/* whether any of the patented opcodes are used. This is only useful */
/* if you want to be able to use the unpatented hinter with */
/* fonts that do *not* use these opcodes. */
/* */
/* Note that this function parses *all* glyph instructions in the */
/* font file, which may be slow. */
/* */
/* <Input> */
/* face :: A face handle. */
/* */
/* <Return> */
/* 1~if this is a TrueType font that uses one of the patented */
/* opcodes, 0~otherwise. */
/* */
/* <Note> */
/* Since May 2010, TrueType hinting is no longer patented. */
/* */
/* <Since> */
/* 2.3.5 */
/* */
FT_EXPORT( FT_Bool )
FT_Face_CheckTrueTypePatents( FT_Face face );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Face_SetUnpatentedHinting */
/* */
/* <Description> */
/* Enable or disable the unpatented hinter for a given face. */
/* Only enable it if you have determined that the face doesn't */
/* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */
/* */
/* <Input> */
/* face :: A face handle. */
/* */
/* value :: New boolean setting. */
/* */
/* <Return> */
/* The old setting value. This will always be false if this is not */
/* an SFNT font, or if the unpatented hinter is not compiled in this */
/* instance of the library. */
/* */
/* <Note> */
/* Since May 2010, TrueType hinting is no longer patented. */
/* */
/* <Since> */
/* 2.3.5 */
/* */
FT_EXPORT( FT_Bool )
FT_Face_SetUnpatentedHinting( FT_Face face,
FT_Bool value );
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FREETYPE_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ft2build.h
0,0 → 1,39
/***************************************************************************/
/* */
/* ft2build.h */
/* */
/* FreeType 2 build and setup macros. */
/* (Generic version) */
/* */
/* Copyright 1996-2001, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* This file corresponds to the default `ft2build.h' file for */
/* FreeType 2. It uses the `freetype' include root. */
/* */
/* Note that specific platforms might use a different configuration. */
/* See builds/unix/ft2unix.h for an example. */
/* */
/*************************************************************************/
 
 
#ifndef __FT2_BUILD_GENERIC_H__
#define __FT2_BUILD_GENERIC_H__
 
#include "ftheader.h"
 
#endif /* __FT2_BUILD_GENERIC_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ft_conf.h
0,0 → 1,130
/* This file is part of the FreeType project */
 
/* ft_conf.h for MSDOS */
 
 
/* we need the following because there are some typedefs in this file */
 
#ifndef FT_CONF_H
#define FT_CONF_H
 
/* Define to empty if the keyword does not work. */
/* #undef const */
 
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
 
/* Define if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H
 
/* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE
 
/* Define if you have the memcpy function. */
#define HAVE_MEMCPY
 
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE
 
/* Define if you have the valloc function. */
#undef HAVE_VALLOC
 
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H
 
/* Define if you have the <unistd.h> header file. */
#if defined( __EMX__ ) || defined( __DJGPP__ ) || defined( __GO32__ )
/* some compilers are known to have <unistd.h>; */
/* add yours if needed, and report to us the update. */
#define HAVE_UNISTD_H
#else
/* most MS-DOS compilers lack <unistd.h> */
#undef HAVE_UNISTD_H
#endif
 
/* Define if you need <conio.h> for console I/O functions. */
#ifdef __EMX__
#define HAVE_CONIO_H
#endif
 
/* Define if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
 
/* Define if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
 
/* Define if you have the libintl library. */
#undef HAVE_LIBINTL
 
#define HAVE_PRINT_FUNCTION 1
 
#define Print( format, ap )
 
#include <limits.h>
#if UINT_MAX == 0xFFFF
#define SIZEOF_INT 2
#elif UINT_MAX == 0xFFFFFFFF
#define SIZEOF_INT 4
#else
#error "Unsupported number of bytes in `int' type!"
#endif
 
#define SIZEOF_LONG 4
 
 
#define TT_CONFIG_OPTION_EXTEND_ENGINE
 
#define TT_CONFIG_OPTION_GRAY_SCALING
 
#undef TT_CONFIG_OPTION_NO_INTERPRETER
 
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
 
#undef TT_CONFIG_OPTION_STATIC_INTERPRETER
 
#undef TT_CONFIG_OPTION_STATIC_RASTER
 
#undef TT_CONFIG_OPTION_THREAD_SAFE
 
#undef DEBUG_LEVEL_TRACE
#undef DEBUG_LEVEL_ERROR
 
 
#if SIZEOF_INT == 4
 
typedef signed int TT_Int32;
typedef unsigned int TT_Word32;
 
#elif SIZEOF_LONG == 4
 
typedef signed long TT_Int32;
typedef unsigned long TT_Word32;
 
#else
#error "no 32bit type found"
#endif
 
#if SIZEOF_LONG == 8
 
/* LONG64 must be defined when a 64-bit type is available */
/* INT64 must then be defined to this type.. */
#define LONG64
#define INT64 long
 
#else
 
/* GCC provides the non-ANSI 'long long' 64-bit type. You can activate */
/* by defining the TT_USE_LONG_LONG macro in 'ft_conf.h'. Note that this */
/* will produce many -ansi warnings during library compilation. */
#ifdef TT_USE_LONG_LONG
 
#define LONG64
#define INT64 long long
 
#endif /* TT_USE_LONG_LONG */
#endif
 
#endif /* FT_CONF_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ftadvanc.h
0,0 → 1,179
/***************************************************************************/
/* */
/* ftadvanc.h */
/* */
/* Quick computation of advance widths (specification only). */
/* */
/* Copyright 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTADVANC_H__
#define __FTADVANC_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/**************************************************************************
*
* @section:
* quick_advance
*
* @title:
* Quick retrieval of advance values
*
* @abstract:
* Retrieve horizontal and vertical advance values without processing
* glyph outlines, if possible.
*
* @description:
* This section contains functions to quickly extract advance values
* without handling glyph outlines, if possible.
*/
 
 
/*************************************************************************/
/* */
/* <Const> */
/* FT_ADVANCE_FLAG_FAST_ONLY */
/* */
/* <Description> */
/* A bit-flag to be OR-ed with the `flags' parameter of the */
/* @FT_Get_Advance and @FT_Get_Advances functions. */
/* */
/* If set, it indicates that you want these functions to fail if the */
/* corresponding hinting mode or font driver doesn't allow for very */
/* quick advance computation. */
/* */
/* Typically, glyphs which are either unscaled, unhinted, bitmapped, */
/* or light-hinted can have their advance width computed very */
/* quickly. */
/* */
/* Normal and bytecode hinted modes, which require loading, scaling, */
/* and hinting of the glyph outline, are extremely slow by */
/* comparison. */
/* */
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Advance */
/* */
/* <Description> */
/* Retrieve the advance value of a given glyph outline in an */
/* @FT_Face. By default, the unhinted advance is returned in font */
/* units. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
/* */
/* gindex :: The glyph index. */
/* */
/* load_flags :: A set of bit flags similar to those used when */
/* calling @FT_Load_Glyph, used to determine what kind */
/* of advances you need. */
/* <Output> */
/* padvance :: The advance value, in either font units or 16.16 */
/* format. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
/* vertical advance corresponding to a vertical layout. */
/* Otherwise, it is the horizontal advance in a */
/* horizontal layout. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
/* if the corresponding font backend doesn't have a quick way to */
/* retrieve the advances. */
/* */
/* A scaled advance is returned in 16.16 format but isn't transformed */
/* by the affine transformation specified by @FT_Set_Transform. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Advance( FT_Face face,
FT_UInt gindex,
FT_Int32 load_flags,
FT_Fixed *padvance );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Advances */
/* */
/* <Description> */
/* Retrieve the advance values of several glyph outlines in an */
/* @FT_Face. By default, the unhinted advances are returned in font */
/* units. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
/* */
/* start :: The first glyph index. */
/* */
/* count :: The number of advance values you want to retrieve. */
/* */
/* load_flags :: A set of bit flags similar to those used when */
/* calling @FT_Load_Glyph. */
/* */
/* <Output> */
/* padvance :: The advances, in either font units or 16.16 format. */
/* This array must contain at least `count' elements. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
/* vertical advances corresponding to a vertical layout. */
/* Otherwise, they are the horizontal advances in a */
/* horizontal layout. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
/* if the corresponding font backend doesn't have a quick way to */
/* retrieve the advances. */
/* */
/* Scaled advances are returned in 16.16 format but aren't */
/* transformed by the affine transformation specified by */
/* @FT_Set_Transform. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Advances( FT_Face face,
FT_UInt start,
FT_UInt count,
FT_Int32 load_flags,
FT_Fixed *padvances );
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTADVANC_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftbbox.h
0,0 → 1,94
/***************************************************************************/
/* */
/* ftbbox.h */
/* */
/* FreeType exact bbox computation (specification). */
/* */
/* Copyright 1996-2001, 2003, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* This component has a _single_ role: to compute exact outline bounding */
/* boxes. */
/* */
/* It is separated from the rest of the engine for various technical */
/* reasons. It may well be integrated in `ftoutln' later. */
/* */
/*************************************************************************/
 
 
#ifndef __FTBBOX_H__
#define __FTBBOX_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* outline_processing */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Get_BBox */
/* */
/* <Description> */
/* Compute the exact bounding box of an outline. This is slower */
/* than computing the control box. However, it uses an advanced */
/* algorithm which returns _very_ quickly when the two boxes */
/* coincide. Otherwise, the outline Bézier arcs are traversed to */
/* extract their extrema. */
/* */
/* <Input> */
/* outline :: A pointer to the source outline. */
/* */
/* <Output> */
/* abbox :: The outline's exact bounding box. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox );
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTBBOX_H__ */
 
 
/* END */
 
 
/* Local Variables: */
/* coding: utf-8 */
/* End: */
/contrib/media/updf/include/freetype/ftbdf.h
0,0 → 1,209
/***************************************************************************/
/* */
/* ftbdf.h */
/* */
/* FreeType API for accessing BDF-specific strings (specification). */
/* */
/* Copyright 2002, 2003, 2004, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTBDF_H__
#define __FTBDF_H__
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* bdf_fonts */
/* */
/* <Title> */
/* BDF and PCF Files */
/* */
/* <Abstract> */
/* BDF and PCF specific API. */
/* */
/* <Description> */
/* This section contains the declaration of functions specific to BDF */
/* and PCF fonts. */
/* */
/*************************************************************************/
 
 
/**********************************************************************
*
* @enum:
* FT_PropertyType
*
* @description:
* A list of BDF property types.
*
* @values:
* BDF_PROPERTY_TYPE_NONE ::
* Value~0 is used to indicate a missing property.
*
* BDF_PROPERTY_TYPE_ATOM ::
* Property is a string atom.
*
* BDF_PROPERTY_TYPE_INTEGER ::
* Property is a 32-bit signed integer.
*
* BDF_PROPERTY_TYPE_CARDINAL ::
* Property is a 32-bit unsigned integer.
*/
typedef enum BDF_PropertyType_
{
BDF_PROPERTY_TYPE_NONE = 0,
BDF_PROPERTY_TYPE_ATOM = 1,
BDF_PROPERTY_TYPE_INTEGER = 2,
BDF_PROPERTY_TYPE_CARDINAL = 3
 
} BDF_PropertyType;
 
 
/**********************************************************************
*
* @type:
* BDF_Property
*
* @description:
* A handle to a @BDF_PropertyRec structure to model a given
* BDF/PCF property.
*/
typedef struct BDF_PropertyRec_* BDF_Property;
 
 
/**********************************************************************
*
* @struct:
* BDF_PropertyRec
*
* @description:
* This structure models a given BDF/PCF property.
*
* @fields:
* type ::
* The property type.
*
* u.atom ::
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
*
* u.integer ::
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
*
* u.cardinal ::
* An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
*/
typedef struct BDF_PropertyRec_
{
BDF_PropertyType type;
union {
const char* atom;
FT_Int32 integer;
FT_UInt32 cardinal;
 
} u;
 
} BDF_PropertyRec;
 
 
/**********************************************************************
*
* @function:
* FT_Get_BDF_Charset_ID
*
* @description:
* Retrieve a BDF font character set identity, according to
* the BDF specification.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* acharset_encoding ::
* Charset encoding, as a C~string, owned by the face.
*
* acharset_registry ::
* Charset registry, as a C~string, owned by the face.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with BDF faces, returning an error otherwise.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Charset_ID( FT_Face face,
const char* *acharset_encoding,
const char* *acharset_registry );
 
 
/**********************************************************************
*
* @function:
* FT_Get_BDF_Property
*
* @description:
* Retrieve a BDF property from a BDF or PCF font file.
*
* @input:
* face :: A handle to the input face.
*
* name :: The property name.
*
* @output:
* aproperty :: The property.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function works with BDF _and_ PCF fonts. It returns an error
* otherwise. It also returns an error if the property is not in the
* font.
*
* A `property' is a either key-value pair within the STARTPROPERTIES
* ... ENDPROPERTIES block of a BDF font or a key-value pair from the
* `info->props' array within a `FontRec' structure of a PCF font.
*
* Integer properties are always stored as `signed' within PCF fonts;
* consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
* for BDF fonts only.
*
* In case of error, `aproperty->type' is always set to
* @BDF_PROPERTY_TYPE_NONE.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Property( FT_Face face,
const char* prop_name,
BDF_PropertyRec *aproperty );
 
/* */
 
FT_END_HEADER
 
#endif /* __FTBDF_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftbitmap.h
0,0 → 1,227
/***************************************************************************/
/* */
/* ftbitmap.h */
/* */
/* FreeType utility functions for bitmaps (specification). */
/* */
/* Copyright 2004, 2005, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTBITMAP_H__
#define __FTBITMAP_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* bitmap_handling */
/* */
/* <Title> */
/* Bitmap Handling */
/* */
/* <Abstract> */
/* Handling FT_Bitmap objects. */
/* */
/* <Description> */
/* This section contains functions for converting FT_Bitmap objects. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_New */
/* */
/* <Description> */
/* Initialize a pointer to an @FT_Bitmap structure. */
/* */
/* <InOut> */
/* abitmap :: A pointer to the bitmap structure. */
/* */
FT_EXPORT( void )
FT_Bitmap_New( FT_Bitmap *abitmap );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Copy */
/* */
/* <Description> */
/* Copy a bitmap into another one. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* source :: A handle to the source bitmap. */
/* */
/* <Output> */
/* target :: A handle to the target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target);
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Embolden */
/* */
/* <Description> */
/* Embolden a bitmap. The new bitmap will be about `xStrength' */
/* pixels wider and `yStrength' pixels higher. The left and bottom */
/* borders are kept unchanged. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* xStrength :: How strong the glyph is emboldened horizontally. */
/* Expressed in 26.6 pixel format. */
/* */
/* yStrength :: How strong the glyph is emboldened vertically. */
/* Expressed in 26.6 pixel format. */
/* */
/* <InOut> */
/* bitmap :: A handle to the target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The current implementation restricts `xStrength' to be less than */
/* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
/* */
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
/* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap,
FT_Pos xStrength,
FT_Pos yStrength );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Convert */
/* */
/* <Description> */
/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
/* bitmap object with depth 8bpp, making the number of used bytes per */
/* line (a.k.a. the `pitch') a multiple of `alignment'. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* source :: The source bitmap. */
/* */
/* alignment :: The pitch of the bitmap is a multiple of this */
/* parameter. Common values are 1, 2, or 4. */
/* */
/* <Output> */
/* target :: The target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* It is possible to call @FT_Bitmap_Convert multiple times without */
/* calling @FT_Bitmap_Done (the memory is simply reallocated). */
/* */
/* Use @FT_Bitmap_Done to finally remove the bitmap object. */
/* */
/* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Convert( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target,
FT_Int alignment );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_GlyphSlot_Own_Bitmap */
/* */
/* <Description> */
/* Make sure that a glyph slot owns `slot->bitmap'. */
/* */
/* <Input> */
/* slot :: The glyph slot. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* This function is to be used in combination with */
/* @FT_Bitmap_Embolden. */
/* */
FT_EXPORT( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Done */
/* */
/* <Description> */
/* Destroy a bitmap object created with @FT_Bitmap_New. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* bitmap :: The bitmap object to be freed. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Done( FT_Library library,
FT_Bitmap *bitmap );
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTBITMAP_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftcache.h
0,0 → 1,1140
/***************************************************************************/
/* */
/* ftcache.h */
/* */
/* FreeType Cache subsystem (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTCACHE_H__
#define __FTCACHE_H__
 
 
#include <ft2build.h>
#include FT_GLYPH_H
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************
*
* <Section>
* cache_subsystem
*
* <Title>
* Cache Sub-System
*
* <Abstract>
* How to cache face, size, and glyph data with FreeType~2.
*
* <Description>
* This section describes the FreeType~2 cache sub-system, which is used
* to limit the number of concurrently opened @FT_Face and @FT_Size
* objects, as well as caching information like character maps and glyph
* images while limiting their maximum memory usage.
*
* Note that all types and functions begin with the `FTC_' prefix.
*
* The cache is highly portable and thus doesn't know anything about the
* fonts installed on your system, or how to access them. This implies
* the following scheme:
*
* First, available or installed font faces are uniquely identified by
* @FTC_FaceID values, provided to the cache by the client. Note that
* the cache only stores and compares these values, and doesn't try to
* interpret them in any way.
*
* Second, the cache calls, only when needed, a client-provided function
* to convert an @FTC_FaceID into a new @FT_Face object. The latter is
* then completely managed by the cache, including its termination
* through @FT_Done_Face. To monitor termination of face objects, the
* finalizer callback in the `generic' field of the @FT_Face object can
* be used, which might also be used to store the @FTC_FaceID of the
* face.
*
* Clients are free to map face IDs to anything else. The most simple
* usage is to associate them to a (pathname,face_index) pair that is
* used to call @FT_New_Face. However, more complex schemes are also
* possible.
*
* Note that for the cache to work correctly, the face ID values must be
* *persistent*, which means that the contents they point to should not
* change at runtime, or that their value should not become invalid.
*
* If this is unavoidable (e.g., when a font is uninstalled at runtime),
* you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
* the cache get rid of any references to the old @FTC_FaceID it may
* keep internally. Failure to do so will lead to incorrect behaviour
* or even crashes.
*
* To use the cache, start with calling @FTC_Manager_New to create a new
* @FTC_Manager object, which models a single cache instance. You can
* then look up @FT_Face and @FT_Size objects with
* @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
*
* If you want to use the charmap caching, call @FTC_CMapCache_New, then
* later use @FTC_CMapCache_Lookup to perform the equivalent of
* @FT_Get_Char_Index, only much faster.
*
* If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
* later use @FTC_ImageCache_Lookup to retrieve the corresponding
* @FT_Glyph objects from the cache.
*
* If you need lots of small bitmaps, it is much more memory efficient
* to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
* returns @FTC_SBitRec structures, which are used to store small
* bitmaps directly. (A small bitmap is one whose metrics and
* dimensions all fit into 8-bit integers).
*
* We hope to also provide a kerning cache in the near future.
*
*
* <Order>
* FTC_Manager
* FTC_FaceID
* FTC_Face_Requester
*
* FTC_Manager_New
* FTC_Manager_Reset
* FTC_Manager_Done
* FTC_Manager_LookupFace
* FTC_Manager_LookupSize
* FTC_Manager_RemoveFaceID
*
* FTC_Node
* FTC_Node_Unref
*
* FTC_ImageCache
* FTC_ImageCache_New
* FTC_ImageCache_Lookup
*
* FTC_SBit
* FTC_SBitCache
* FTC_SBitCache_New
* FTC_SBitCache_Lookup
*
* FTC_CMapCache
* FTC_CMapCache_New
* FTC_CMapCache_Lookup
*
*************************************************************************/
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** BASIC TYPE DEFINITIONS *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************
*
* @type: FTC_FaceID
*
* @description:
* An opaque pointer type that is used to identity face objects. The
* contents of such objects is application-dependent.
*
* These pointers are typically used to point to a user-defined
* structure containing a font file path, and face index.
*
* @note:
* Never use NULL as a valid @FTC_FaceID.
*
* Face IDs are passed by the client to the cache manager, which calls,
* when needed, the @FTC_Face_Requester to translate them into new
* @FT_Face objects.
*
* If the content of a given face ID changes at runtime, or if the value
* becomes invalid (e.g., when uninstalling a font), you should
* immediately call @FTC_Manager_RemoveFaceID before any other cache
* function.
*
* Failure to do so will result in incorrect behaviour or even
* memory leaks and crashes.
*/
typedef FT_Pointer FTC_FaceID;
 
 
/************************************************************************
*
* @functype:
* FTC_Face_Requester
*
* @description:
* A callback function provided by client applications. It is used by
* the cache manager to translate a given @FTC_FaceID into a new valid
* @FT_Face object, on demand.
*
* <Input>
* face_id ::
* The face ID to resolve.
*
* library ::
* A handle to a FreeType library object.
*
* req_data ::
* Application-provided request data (see note below).
*
* <Output>
* aface ::
* A new @FT_Face handle.
*
* <Return>
* FreeType error code. 0~means success.
*
* <Note>
* The third parameter `req_data' is the same as the one passed by the
* client when @FTC_Manager_New is called.
*
* The face requester should not perform funny things on the returned
* face object, like creating a new @FT_Size for it, or setting a
* transformation through @FT_Set_Transform!
*/
typedef FT_Error
(*FTC_Face_Requester)( FTC_FaceID face_id,
FT_Library library,
FT_Pointer request_data,
FT_Face* aface );
 
/* */
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
/* these macros are incompatible with LLP64, should not be used */
 
#define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) )
 
#define FTC_FACE_ID_HASH( i ) \
((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
 
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** CACHE MANAGER OBJECT *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FTC_Manager */
/* */
/* <Description> */
/* This object corresponds to one instance of the cache-subsystem. */
/* It is used to cache one or more @FT_Face objects, along with */
/* corresponding @FT_Size objects. */
/* */
/* The manager intentionally limits the total number of opened */
/* @FT_Face and @FT_Size objects to control memory usage. See the */
/* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */
/* */
/* The manager is also used to cache `nodes' of various types while */
/* limiting their total memory usage. */
/* */
/* All limitations are enforced by keeping lists of managed objects */
/* in most-recently-used order, and flushing old nodes to make room */
/* for new ones. */
/* */
typedef struct FTC_ManagerRec_* FTC_Manager;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FTC_Node */
/* */
/* <Description> */
/* An opaque handle to a cache node object. Each cache node is */
/* reference-counted. A node with a count of~0 might be flushed */
/* out of a full cache whenever a lookup request is performed. */
/* */
/* If you look up nodes, you have the ability to `acquire' them, */
/* i.e., to increment their reference count. This will prevent the */
/* node from being flushed out of the cache until you explicitly */
/* `release' it (see @FTC_Node_Unref). */
/* */
/* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
/* */
typedef struct FTC_NodeRec_* FTC_Node;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Manager_New */
/* */
/* <Description> */
/* Create a new cache manager. */
/* */
/* <Input> */
/* library :: The parent FreeType library handle to use. */
/* */
/* max_faces :: Maximum number of opened @FT_Face objects managed by */
/* this cache instance. Use~0 for defaults. */
/* */
/* max_sizes :: Maximum number of opened @FT_Size objects managed by */
/* this cache instance. Use~0 for defaults. */
/* */
/* max_bytes :: Maximum number of bytes to use for cached data nodes. */
/* Use~0 for defaults. Note that this value does not */
/* account for managed @FT_Face and @FT_Size objects. */
/* */
/* requester :: An application-provided callback used to translate */
/* face IDs into real @FT_Face objects. */
/* */
/* req_data :: A generic pointer that is passed to the requester */
/* each time it is called (see @FTC_Face_Requester). */
/* */
/* <Output> */
/* amanager :: A handle to a new manager object. 0~in case of */
/* failure. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FTC_Manager_New( FT_Library library,
FT_UInt max_faces,
FT_UInt max_sizes,
FT_ULong max_bytes,
FTC_Face_Requester requester,
FT_Pointer req_data,
FTC_Manager *amanager );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Manager_Reset */
/* */
/* <Description> */
/* Empty a given cache manager. This simply gets rid of all the */
/* currently cached @FT_Face and @FT_Size objects within the manager. */
/* */
/* <InOut> */
/* manager :: A handle to the manager. */
/* */
FT_EXPORT( void )
FTC_Manager_Reset( FTC_Manager manager );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Manager_Done */
/* */
/* <Description> */
/* Destroy a given manager after emptying it. */
/* */
/* <Input> */
/* manager :: A handle to the target cache manager object. */
/* */
FT_EXPORT( void )
FTC_Manager_Done( FTC_Manager manager );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Manager_LookupFace */
/* */
/* <Description> */
/* Retrieve the @FT_Face object that corresponds to a given face ID */
/* through a cache manager. */
/* */
/* <Input> */
/* manager :: A handle to the cache manager. */
/* */
/* face_id :: The ID of the face object. */
/* */
/* <Output> */
/* aface :: A handle to the face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The returned @FT_Face object is always owned by the manager. You */
/* should never try to discard it yourself. */
/* */
/* The @FT_Face object doesn't necessarily have a current size object */
/* (i.e., face->size can be 0). If you need a specific `font size', */
/* use @FTC_Manager_LookupSize instead. */
/* */
/* Never change the face's transformation matrix (i.e., never call */
/* the @FT_Set_Transform function) on a returned face! If you need */
/* to transform glyphs, do it yourself after glyph loading. */
/* */
/* When you perform a lookup, out-of-memory errors are detected */
/* _within_ the lookup and force incremental flushes of the cache */
/* until enough memory is released for the lookup to succeed. */
/* */
/* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
/* already been completely flushed, and still no memory was available */
/* for the operation. */
/* */
FT_EXPORT( FT_Error )
FTC_Manager_LookupFace( FTC_Manager manager,
FTC_FaceID face_id,
FT_Face *aface );
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FTC_ScalerRec */
/* */
/* <Description> */
/* A structure used to describe a given character size in either */
/* pixels or points to the cache manager. See */
/* @FTC_Manager_LookupSize. */
/* */
/* <Fields> */
/* face_id :: The source face ID. */
/* */
/* width :: The character width. */
/* */
/* height :: The character height. */
/* */
/* pixel :: A Boolean. If 1, the `width' and `height' fields are */
/* interpreted as integer pixel character sizes. */
/* Otherwise, they are expressed as 1/64th of points. */
/* */
/* x_res :: Only used when `pixel' is value~0 to indicate the */
/* horizontal resolution in dpi. */
/* */
/* y_res :: Only used when `pixel' is value~0 to indicate the */
/* vertical resolution in dpi. */
/* */
/* <Note> */
/* This type is mainly used to retrieve @FT_Size objects through the */
/* cache manager. */
/* */
typedef struct FTC_ScalerRec_
{
FTC_FaceID face_id;
FT_UInt width;
FT_UInt height;
FT_Int pixel;
FT_UInt x_res;
FT_UInt y_res;
 
} FTC_ScalerRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FTC_Scaler */
/* */
/* <Description> */
/* A handle to an @FTC_ScalerRec structure. */
/* */
typedef struct FTC_ScalerRec_* FTC_Scaler;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Manager_LookupSize */
/* */
/* <Description> */
/* Retrieve the @FT_Size object that corresponds to a given */
/* @FTC_ScalerRec pointer through a cache manager. */
/* */
/* <Input> */
/* manager :: A handle to the cache manager. */
/* */
/* scaler :: A scaler handle. */
/* */
/* <Output> */
/* asize :: A handle to the size object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The returned @FT_Size object is always owned by the manager. You */
/* should never try to discard it by yourself. */
/* */
/* You can access the parent @FT_Face object simply as `size->face' */
/* if you need it. Note that this object is also owned by the */
/* manager. */
/* */
/* <Note> */
/* When you perform a lookup, out-of-memory errors are detected */
/* _within_ the lookup and force incremental flushes of the cache */
/* until enough memory is released for the lookup to succeed. */
/* */
/* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
/* already been completely flushed, and still no memory is available */
/* for the operation. */
/* */
FT_EXPORT( FT_Error )
FTC_Manager_LookupSize( FTC_Manager manager,
FTC_Scaler scaler,
FT_Size *asize );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Node_Unref */
/* */
/* <Description> */
/* Decrement a cache node's internal reference count. When the count */
/* reaches 0, it is not destroyed but becomes eligible for subsequent */
/* cache flushes. */
/* */
/* <Input> */
/* node :: The cache node handle. */
/* */
/* manager :: The cache manager handle. */
/* */
FT_EXPORT( void )
FTC_Node_Unref( FTC_Node node,
FTC_Manager manager );
 
 
/*************************************************************************
*
* @function:
* FTC_Manager_RemoveFaceID
*
* @description:
* A special function used to indicate to the cache manager that
* a given @FTC_FaceID is no longer valid, either because its
* content changed, or because it was deallocated or uninstalled.
*
* @input:
* manager ::
* The cache manager handle.
*
* face_id ::
* The @FTC_FaceID to be removed.
*
* @note:
* This function flushes all nodes from the cache corresponding to this
* `face_id', with the exception of nodes with a non-null reference
* count.
*
* Such nodes are however modified internally so as to never appear
* in later lookups with the same `face_id' value, and to be immediately
* destroyed when released by all their users.
*
*/
FT_EXPORT( void )
FTC_Manager_RemoveFaceID( FTC_Manager manager,
FTC_FaceID face_id );
 
 
/*************************************************************************/
/* */
/* <Section> */
/* cache_subsystem */
/* */
/*************************************************************************/
 
/*************************************************************************
*
* @type:
* FTC_CMapCache
*
* @description:
* An opaque handle used to model a charmap cache. This cache is to
* hold character codes -> glyph indices mappings.
*
*/
typedef struct FTC_CMapCacheRec_* FTC_CMapCache;
 
 
/*************************************************************************
*
* @function:
* FTC_CMapCache_New
*
* @description:
* Create a new charmap cache.
*
* @input:
* manager ::
* A handle to the cache manager.
*
* @output:
* acache ::
* A new cache handle. NULL in case of error.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* Like all other caches, this one will be destroyed with the cache
* manager.
*
*/
FT_EXPORT( FT_Error )
FTC_CMapCache_New( FTC_Manager manager,
FTC_CMapCache *acache );
 
 
/************************************************************************
*
* @function:
* FTC_CMapCache_Lookup
*
* @description:
* Translate a character code into a glyph index, using the charmap
* cache.
*
* @input:
* cache ::
* A charmap cache handle.
*
* face_id ::
* The source face ID.
*
* cmap_index ::
* The index of the charmap in the source face. Any negative value
* means to use the cache @FT_Face's default charmap.
*
* char_code ::
* The character code (in the corresponding charmap).
*
* @return:
* Glyph index. 0~means `no glyph'.
*
*/
FT_EXPORT( FT_UInt )
FTC_CMapCache_Lookup( FTC_CMapCache cache,
FTC_FaceID face_id,
FT_Int cmap_index,
FT_UInt32 char_code );
 
 
/*************************************************************************/
/* */
/* <Section> */
/* cache_subsystem */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** IMAGE CACHE OBJECT *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************
*
* @struct:
* FTC_ImageTypeRec
*
* @description:
* A structure used to model the type of images in a glyph cache.
*
* @fields:
* face_id ::
* The face ID.
*
* width ::
* The width in pixels.
*
* height ::
* The height in pixels.
*
* flags ::
* The load flags, as in @FT_Load_Glyph.
*
*/
typedef struct FTC_ImageTypeRec_
{
FTC_FaceID face_id;
FT_Int width;
FT_Int height;
FT_Int32 flags;
 
} FTC_ImageTypeRec;
 
 
/*************************************************************************
*
* @type:
* FTC_ImageType
*
* @description:
* A handle to an @FTC_ImageTypeRec structure.
*
*/
typedef struct FTC_ImageTypeRec_* FTC_ImageType;
 
 
/* */
 
 
#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
( (d1)->face_id == (d2)->face_id && \
(d1)->width == (d2)->width && \
(d1)->flags == (d2)->flags )
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
/* this macro is incompatible with LLP64, should not be used */
 
#define FTC_IMAGE_TYPE_HASH( d ) \
(FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
( (d)->width << 8 ) ^ (d)->height ^ \
( (d)->flags << 4 ) )
 
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FTC_ImageCache */
/* */
/* <Description> */
/* A handle to an glyph image cache object. They are designed to */
/* hold many distinct glyph images while not exceeding a certain */
/* memory threshold. */
/* */
typedef struct FTC_ImageCacheRec_* FTC_ImageCache;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_ImageCache_New */
/* */
/* <Description> */
/* Create a new glyph image cache. */
/* */
/* <Input> */
/* manager :: The parent manager for the image cache. */
/* */
/* <Output> */
/* acache :: A handle to the new glyph image cache object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FTC_ImageCache_New( FTC_Manager manager,
FTC_ImageCache *acache );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_ImageCache_Lookup */
/* */
/* <Description> */
/* Retrieve a given glyph image from a glyph image cache. */
/* */
/* <Input> */
/* cache :: A handle to the source glyph image cache. */
/* */
/* type :: A pointer to a glyph image type descriptor. */
/* */
/* gindex :: The glyph index to retrieve. */
/* */
/* <Output> */
/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
/* failure. */
/* */
/* anode :: Used to return the address of of the corresponding cache */
/* node after incrementing its reference count (see note */
/* below). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The returned glyph is owned and managed by the glyph image cache. */
/* Never try to transform or discard it manually! You can however */
/* create a copy with @FT_Glyph_Copy and modify the new one. */
/* */
/* If `anode' is _not_ NULL, it receives the address of the cache */
/* node containing the glyph image, after increasing its reference */
/* count. This ensures that the node (as well as the @FT_Glyph) will */
/* always be kept in the cache until you call @FTC_Node_Unref to */
/* `release' it. */
/* */
/* If `anode' is NULL, the cache node is left unchanged, which means */
/* that the @FT_Glyph could be flushed out of the cache on the next */
/* call to one of the caching sub-system APIs. Don't assume that it */
/* is persistent! */
/* */
FT_EXPORT( FT_Error )
FTC_ImageCache_Lookup( FTC_ImageCache cache,
FTC_ImageType type,
FT_UInt gindex,
FT_Glyph *aglyph,
FTC_Node *anode );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_ImageCache_LookupScaler */
/* */
/* <Description> */
/* A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec */
/* to specify the face ID and its size. */
/* */
/* <Input> */
/* cache :: A handle to the source glyph image cache. */
/* */
/* scaler :: A pointer to a scaler descriptor. */
/* */
/* load_flags :: The corresponding load flags. */
/* */
/* gindex :: The glyph index to retrieve. */
/* */
/* <Output> */
/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
/* failure. */
/* */
/* anode :: Used to return the address of of the corresponding */
/* cache node after incrementing its reference count */
/* (see note below). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The returned glyph is owned and managed by the glyph image cache. */
/* Never try to transform or discard it manually! You can however */
/* create a copy with @FT_Glyph_Copy and modify the new one. */
/* */
/* If `anode' is _not_ NULL, it receives the address of the cache */
/* node containing the glyph image, after increasing its reference */
/* count. This ensures that the node (as well as the @FT_Glyph) will */
/* always be kept in the cache until you call @FTC_Node_Unref to */
/* `release' it. */
/* */
/* If `anode' is NULL, the cache node is left unchanged, which means */
/* that the @FT_Glyph could be flushed out of the cache on the next */
/* call to one of the caching sub-system APIs. Don't assume that it */
/* is persistent! */
/* */
/* Calls to @FT_Set_Char_Size and friends have no effect on cached */
/* glyphs; you should always use the FreeType cache API instead. */
/* */
FT_EXPORT( FT_Error )
FTC_ImageCache_LookupScaler( FTC_ImageCache cache,
FTC_Scaler scaler,
FT_ULong load_flags,
FT_UInt gindex,
FT_Glyph *aglyph,
FTC_Node *anode );
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FTC_SBit */
/* */
/* <Description> */
/* A handle to a small bitmap descriptor. See the @FTC_SBitRec */
/* structure for details. */
/* */
typedef struct FTC_SBitRec_* FTC_SBit;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FTC_SBitRec */
/* */
/* <Description> */
/* A very compact structure used to describe a small glyph bitmap. */
/* */
/* <Fields> */
/* width :: The bitmap width in pixels. */
/* */
/* height :: The bitmap height in pixels. */
/* */
/* left :: The horizontal distance from the pen position to the */
/* left bitmap border (a.k.a. `left side bearing', or */
/* `lsb'). */
/* */
/* top :: The vertical distance from the pen position (on the */
/* baseline) to the upper bitmap border (a.k.a. `top */
/* side bearing'). The distance is positive for upwards */
/* y~coordinates. */
/* */
/* format :: The format of the glyph bitmap (monochrome or gray). */
/* */
/* max_grays :: Maximum gray level value (in the range 1 to~255). */
/* */
/* pitch :: The number of bytes per bitmap line. May be positive */
/* or negative. */
/* */
/* xadvance :: The horizontal advance width in pixels. */
/* */
/* yadvance :: The vertical advance height in pixels. */
/* */
/* buffer :: A pointer to the bitmap pixels. */
/* */
typedef struct FTC_SBitRec_
{
FT_Byte width;
FT_Byte height;
FT_Char left;
FT_Char top;
 
FT_Byte format;
FT_Byte max_grays;
FT_Short pitch;
FT_Char xadvance;
FT_Char yadvance;
 
FT_Byte* buffer;
 
} FTC_SBitRec;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FTC_SBitCache */
/* */
/* <Description> */
/* A handle to a small bitmap cache. These are special cache objects */
/* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */
/* much more efficient way than the traditional glyph image cache */
/* implemented by @FTC_ImageCache. */
/* */
typedef struct FTC_SBitCacheRec_* FTC_SBitCache;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_SBitCache_New */
/* */
/* <Description> */
/* Create a new cache to store small glyph bitmaps. */
/* */
/* <Input> */
/* manager :: A handle to the source cache manager. */
/* */
/* <Output> */
/* acache :: A handle to the new sbit cache. NULL in case of error. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FTC_SBitCache_New( FTC_Manager manager,
FTC_SBitCache *acache );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_SBitCache_Lookup */
/* */
/* <Description> */
/* Look up a given small glyph bitmap in a given sbit cache and */
/* `lock' it to prevent its flushing from the cache until needed. */
/* */
/* <Input> */
/* cache :: A handle to the source sbit cache. */
/* */
/* type :: A pointer to the glyph image type descriptor. */
/* */
/* gindex :: The glyph index. */
/* */
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* anode :: Used to return the address of of the corresponding cache */
/* node after incrementing its reference count (see note */
/* below). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The small bitmap descriptor and its bit buffer are owned by the */
/* cache and should never be freed by the application. They might */
/* as well disappear from memory on the next cache lookup, so don't */
/* treat them as persistent data. */
/* */
/* The descriptor's `buffer' field is set to~0 to indicate a missing */
/* glyph bitmap. */
/* */
/* If `anode' is _not_ NULL, it receives the address of the cache */
/* node containing the bitmap, after increasing its reference count. */
/* This ensures that the node (as well as the image) will always be */
/* kept in the cache until you call @FTC_Node_Unref to `release' it. */
/* */
/* If `anode' is NULL, the cache node is left unchanged, which means */
/* that the bitmap could be flushed out of the cache on the next */
/* call to one of the caching sub-system APIs. Don't assume that it */
/* is persistent! */
/* */
FT_EXPORT( FT_Error )
FTC_SBitCache_Lookup( FTC_SBitCache cache,
FTC_ImageType type,
FT_UInt gindex,
FTC_SBit *sbit,
FTC_Node *anode );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FTC_SBitCache_LookupScaler */
/* */
/* <Description> */
/* A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec */
/* to specify the face ID and its size. */
/* */
/* <Input> */
/* cache :: A handle to the source sbit cache. */
/* */
/* scaler :: A pointer to the scaler descriptor. */
/* */
/* load_flags :: The corresponding load flags. */
/* */
/* gindex :: The glyph index. */
/* */
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* anode :: Used to return the address of of the corresponding */
/* cache node after incrementing its reference count */
/* (see note below). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The small bitmap descriptor and its bit buffer are owned by the */
/* cache and should never be freed by the application. They might */
/* as well disappear from memory on the next cache lookup, so don't */
/* treat them as persistent data. */
/* */
/* The descriptor's `buffer' field is set to~0 to indicate a missing */
/* glyph bitmap. */
/* */
/* If `anode' is _not_ NULL, it receives the address of the cache */
/* node containing the bitmap, after increasing its reference count. */
/* This ensures that the node (as well as the image) will always be */
/* kept in the cache until you call @FTC_Node_Unref to `release' it. */
/* */
/* If `anode' is NULL, the cache node is left unchanged, which means */
/* that the bitmap could be flushed out of the cache on the next */
/* call to one of the caching sub-system APIs. Don't assume that it */
/* is persistent! */
/* */
FT_EXPORT( FT_Error )
FTC_SBitCache_LookupScaler( FTC_SBitCache cache,
FTC_Scaler scaler,
FT_ULong load_flags,
FT_UInt gindex,
FTC_SBit *sbit,
FTC_Node *anode );
 
 
/* */
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
/*@***********************************************************************/
/* */
/* <Struct> */
/* FTC_FontRec */
/* */
/* <Description> */
/* A simple structure used to describe a given `font' to the cache */
/* manager. Note that a `font' is the combination of a given face */
/* with a given character size. */
/* */
/* <Fields> */
/* face_id :: The ID of the face to use. */
/* */
/* pix_width :: The character width in integer pixels. */
/* */
/* pix_height :: The character height in integer pixels. */
/* */
typedef struct FTC_FontRec_
{
FTC_FaceID face_id;
FT_UShort pix_width;
FT_UShort pix_height;
 
} FTC_FontRec;
 
 
/* */
 
 
#define FTC_FONT_COMPARE( f1, f2 ) \
( (f1)->face_id == (f2)->face_id && \
(f1)->pix_width == (f2)->pix_width && \
(f1)->pix_height == (f2)->pix_height )
 
/* this macro is incompatible with LLP64, should not be used */
#define FTC_FONT_HASH( f ) \
(FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
((f)->pix_width << 8) ^ \
((f)->pix_height) )
 
typedef FTC_FontRec* FTC_Font;
 
 
FT_EXPORT( FT_Error )
FTC_Manager_Lookup_Face( FTC_Manager manager,
FTC_FaceID face_id,
FT_Face *aface );
 
FT_EXPORT( FT_Error )
FTC_Manager_Lookup_Size( FTC_Manager manager,
FTC_Font font,
FT_Face *aface,
FT_Size *asize );
 
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
 
/* */
 
FT_END_HEADER
 
#endif /* __FTCACHE_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftchapters.h
0,0 → 1,103
/***************************************************************************/
/* */
/* This file defines the structure of the FreeType reference. */
/* It is used by the python script which generates the HTML files. */
/* */
/***************************************************************************/
 
 
/***************************************************************************/
/* */
/* <Chapter> */
/* general_remarks */
/* */
/* <Title> */
/* General Remarks */
/* */
/* <Sections> */
/* user_allocation */
/* */
/***************************************************************************/
 
 
/***************************************************************************/
/* */
/* <Chapter> */
/* core_api */
/* */
/* <Title> */
/* Core API */
/* */
/* <Sections> */
/* version */
/* basic_types */
/* base_interface */
/* glyph_variants */
/* glyph_management */
/* mac_specific */
/* sizes_management */
/* header_file_macros */
/* */
/***************************************************************************/
 
 
/***************************************************************************/
/* */
/* <Chapter> */
/* format_specific */
/* */
/* <Title> */
/* Format-Specific API */
/* */
/* <Sections> */
/* multiple_masters */
/* truetype_tables */
/* type1_tables */
/* sfnt_names */
/* bdf_fonts */
/* cid_fonts */
/* pfr_fonts */
/* winfnt_fonts */
/* font_formats */
/* gasp_table */
/* */
/***************************************************************************/
 
 
/***************************************************************************/
/* */
/* <Chapter> */
/* cache_subsystem */
/* */
/* <Title> */
/* Cache Sub-System */
/* */
/* <Sections> */
/* cache_subsystem */
/* */
/***************************************************************************/
 
 
/***************************************************************************/
/* */
/* <Chapter> */
/* support_api */
/* */
/* <Title> */
/* Support API */
/* */
/* <Sections> */
/* computations */
/* list_processing */
/* outline_processing */
/* quick_advance */
/* bitmap_handling */
/* raster */
/* glyph_stroker */
/* system_interface */
/* module_management */
/* gzip */
/* lzw */
/* lcd_filtering */
/* */
/***************************************************************************/
/contrib/media/updf/include/freetype/ftcid.h
0,0 → 1,166
/***************************************************************************/
/* */
/* ftcid.h */
/* */
/* FreeType API for accessing CID font information (specification). */
/* */
/* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTCID_H__
#define __FTCID_H__
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* cid_fonts */
/* */
/* <Title> */
/* CID Fonts */
/* */
/* <Abstract> */
/* CID-keyed font specific API. */
/* */
/* <Description> */
/* This section contains the declaration of CID-keyed font specific */
/* functions. */
/* */
/*************************************************************************/
 
 
/**********************************************************************
*
* @function:
* FT_Get_CID_Registry_Ordering_Supplement
*
* @description:
* Retrieve the Registry/Ordering/Supplement triple (also known as the
* "R/O/S") from a CID-keyed font.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* registry ::
* The registry, as a C~string, owned by the face.
*
* ordering ::
* The ordering, as a C~string, owned by the face.
*
* supplement ::
* The supplement.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces, returning an error
* otherwise.
*
* @since:
* 2.3.6
*/
FT_EXPORT( FT_Error )
FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
const char* *registry,
const char* *ordering,
FT_Int *supplement);
 
 
/**********************************************************************
*
* @function:
* FT_Get_CID_Is_Internally_CID_Keyed
*
* @description:
* Retrieve the type of the input face, CID keyed or not. In
* constrast to the @FT_IS_CID_KEYED macro this function returns
* successfully also for CID-keyed fonts in an SNFT wrapper.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* is_cid ::
* The type of the face as an @FT_Bool.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces and OpenType fonts,
* returning an error otherwise.
*
* @since:
* 2.3.9
*/
FT_EXPORT( FT_Error )
FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
FT_Bool *is_cid );
 
 
/**********************************************************************
*
* @function:
* FT_Get_CID_From_Glyph_Index
*
* @description:
* Retrieve the CID of the input glyph index.
*
* @input:
* face ::
* A handle to the input face.
*
* glyph_index ::
* The input glyph index.
*
* @output:
* cid ::
* The CID as an @FT_UInt.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces and OpenType fonts,
* returning an error otherwise.
*
* @since:
* 2.3.9
*/
FT_EXPORT( FT_Error )
FT_Get_CID_From_Glyph_Index( FT_Face face,
FT_UInt glyph_index,
FT_UInt *cid );
 
/* */
 
FT_END_HEADER
 
#endif /* __FTCID_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/fterrdef.h
0,0 → 1,244
/***************************************************************************/
/* */
/* fterrdef.h */
/* */
/* FreeType error codes (specification). */
/* */
/* Copyright 2002, 2004, 2006, 2007, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** LIST OF ERROR CODES/MESSAGES *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
 
 
/* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */
/* including this file. */
 
 
/* generic errors */
 
FT_NOERRORDEF_( Ok, 0x00, \
"no error" )
 
FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \
"cannot open resource" )
FT_ERRORDEF_( Unknown_File_Format, 0x02, \
"unknown file format" )
FT_ERRORDEF_( Invalid_File_Format, 0x03, \
"broken file" )
FT_ERRORDEF_( Invalid_Version, 0x04, \
"invalid FreeType version" )
FT_ERRORDEF_( Lower_Module_Version, 0x05, \
"module version is too low" )
FT_ERRORDEF_( Invalid_Argument, 0x06, \
"invalid argument" )
FT_ERRORDEF_( Unimplemented_Feature, 0x07, \
"unimplemented feature" )
FT_ERRORDEF_( Invalid_Table, 0x08, \
"broken table" )
FT_ERRORDEF_( Invalid_Offset, 0x09, \
"broken offset within table" )
FT_ERRORDEF_( Array_Too_Large, 0x0A, \
"array allocation size too large" )
 
/* glyph/character errors */
 
FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \
"invalid glyph index" )
FT_ERRORDEF_( Invalid_Character_Code, 0x11, \
"invalid character code" )
FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \
"unsupported glyph image format" )
FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \
"cannot render this glyph format" )
FT_ERRORDEF_( Invalid_Outline, 0x14, \
"invalid outline" )
FT_ERRORDEF_( Invalid_Composite, 0x15, \
"invalid composite glyph" )
FT_ERRORDEF_( Too_Many_Hints, 0x16, \
"too many hints" )
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \
"invalid pixel size" )
 
/* handle errors */
 
FT_ERRORDEF_( Invalid_Handle, 0x20, \
"invalid object handle" )
FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \
"invalid library handle" )
FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \
"invalid module handle" )
FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \
"invalid face handle" )
FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \
"invalid size handle" )
FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \
"invalid glyph slot handle" )
FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \
"invalid charmap handle" )
FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \
"invalid cache manager handle" )
FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \
"invalid stream handle" )
 
/* driver errors */
 
FT_ERRORDEF_( Too_Many_Drivers, 0x30, \
"too many modules" )
FT_ERRORDEF_( Too_Many_Extensions, 0x31, \
"too many extensions" )
 
/* memory errors */
 
FT_ERRORDEF_( Out_Of_Memory, 0x40, \
"out of memory" )
FT_ERRORDEF_( Unlisted_Object, 0x41, \
"unlisted object" )
 
/* stream errors */
 
FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \
"cannot open stream" )
FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \
"invalid stream seek" )
FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \
"invalid stream skip" )
FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \
"invalid stream read" )
FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \
"invalid stream operation" )
FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \
"invalid frame operation" )
FT_ERRORDEF_( Nested_Frame_Access, 0x57, \
"nested frame access" )
FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \
"invalid frame read" )
 
/* raster errors */
 
FT_ERRORDEF_( Raster_Uninitialized, 0x60, \
"raster uninitialized" )
FT_ERRORDEF_( Raster_Corrupted, 0x61, \
"raster corrupted" )
FT_ERRORDEF_( Raster_Overflow, 0x62, \
"raster overflow" )
FT_ERRORDEF_( Raster_Negative_Height, 0x63, \
"negative height while rastering" )
 
/* cache errors */
 
FT_ERRORDEF_( Too_Many_Caches, 0x70, \
"too many registered caches" )
 
/* TrueType and SFNT errors */
 
FT_ERRORDEF_( Invalid_Opcode, 0x80, \
"invalid opcode" )
FT_ERRORDEF_( Too_Few_Arguments, 0x81, \
"too few arguments" )
FT_ERRORDEF_( Stack_Overflow, 0x82, \
"stack overflow" )
FT_ERRORDEF_( Code_Overflow, 0x83, \
"code overflow" )
FT_ERRORDEF_( Bad_Argument, 0x84, \
"bad argument" )
FT_ERRORDEF_( Divide_By_Zero, 0x85, \
"division by zero" )
FT_ERRORDEF_( Invalid_Reference, 0x86, \
"invalid reference" )
FT_ERRORDEF_( Debug_OpCode, 0x87, \
"found debug opcode" )
FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \
"found ENDF opcode in execution stream" )
FT_ERRORDEF_( Nested_DEFS, 0x89, \
"nested DEFS" )
FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \
"invalid code range" )
FT_ERRORDEF_( Execution_Too_Long, 0x8B, \
"execution context too long" )
FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \
"too many function definitions" )
FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \
"too many instruction definitions" )
FT_ERRORDEF_( Table_Missing, 0x8E, \
"SFNT font table missing" )
FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \
"horizontal header (hhea) table missing" )
FT_ERRORDEF_( Locations_Missing, 0x90, \
"locations (loca) table missing" )
FT_ERRORDEF_( Name_Table_Missing, 0x91, \
"name table missing" )
FT_ERRORDEF_( CMap_Table_Missing, 0x92, \
"character map (cmap) table missing" )
FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \
"horizontal metrics (hmtx) table missing" )
FT_ERRORDEF_( Post_Table_Missing, 0x94, \
"PostScript (post) table missing" )
FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \
"invalid horizontal metrics" )
FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \
"invalid character map (cmap) format" )
FT_ERRORDEF_( Invalid_PPem, 0x97, \
"invalid ppem value" )
FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \
"invalid vertical metrics" )
FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \
"could not find context" )
FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \
"invalid PostScript (post) table format" )
FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \
"invalid PostScript (post) table" )
 
/* CFF, CID, and Type 1 errors */
 
FT_ERRORDEF_( Syntax_Error, 0xA0, \
"opcode syntax error" )
FT_ERRORDEF_( Stack_Underflow, 0xA1, \
"argument stack underflow" )
FT_ERRORDEF_( Ignore, 0xA2, \
"ignore" )
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \
"no Unicode glyph name found" )
 
 
/* BDF errors */
 
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \
"`STARTFONT' field missing" )
FT_ERRORDEF_( Missing_Font_Field, 0xB1, \
"`FONT' field missing" )
FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
"`SIZE' field missing" )
FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \
"`FONTBOUNDINGBOX' field missing" )
FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \
"`CHARS' field missing" )
FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \
"`STARTCHAR' field missing" )
FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \
"`ENCODING' field missing" )
FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \
"`BBX' field missing" )
FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \
"`BBX' too big" )
FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \
"Font header corrupted or missing fields" )
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \
"Font glyphs corrupted or missing fields" )
 
 
/* END */
/contrib/media/updf/include/freetype/fterrid.h
0,0 → 1,161
/*******************************************************************
*
* fterrid.h
*
* TrueType Error ID definitions
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
******************************************************************/
 
#ifndef FREETYPE_H
#error "Don't include this file! Use freetype.h instead."
#endif
 
#ifndef FTERRID_H
#define FTERRID_H
 
/************************ error codes declaration **************/
 
/* The error codes are grouped in 'classes' used to indicate the */
/* 'level' at which the error happened. */
/* The class is given by an error code's high byte. */
 
 
/* ------------- Success is always 0 -------- */
 
#define TT_Err_Ok 0
 
 
/* -------- High-level API error codes ------ */
 
#define TT_Err_Invalid_Face_Handle 0x001
#define TT_Err_Invalid_Instance_Handle 0x002
#define TT_Err_Invalid_Glyph_Handle 0x003
#define TT_Err_Invalid_CharMap_Handle 0x004
#define TT_Err_Invalid_Result_Address 0x005
#define TT_Err_Invalid_Glyph_Index 0x006
#define TT_Err_Invalid_Argument 0x007
#define TT_Err_Could_Not_Open_File 0x008
#define TT_Err_File_Is_Not_Collection 0x009
 
#define TT_Err_Table_Missing 0x00A
#define TT_Err_Invalid_Horiz_Metrics 0x00B
#define TT_Err_Invalid_CharMap_Format 0x00C
#define TT_Err_Invalid_PPem 0x00D
#define TT_Err_Invalid_Vert_Metrics 0x00E
 
#define TT_Err_Invalid_File_Format 0x010
 
#define TT_Err_Invalid_Engine 0x020
#define TT_Err_Too_Many_Extensions 0x021
#define TT_Err_Extensions_Unsupported 0x022
#define TT_Err_Invalid_Extension_Id 0x023
 
#define TT_Err_No_Vertical_Data 0x030
 
#define TT_Err_Max_Profile_Missing 0x080
#define TT_Err_Header_Table_Missing 0x081
#define TT_Err_Horiz_Header_Missing 0x082
#define TT_Err_Locations_Missing 0x083
#define TT_Err_Name_Table_Missing 0x084
#define TT_Err_CMap_Table_Missing 0x085
#define TT_Err_Hmtx_Table_Missing 0x086
#define TT_Err_OS2_Table_Missing 0x087
#define TT_Err_Post_Table_Missing 0x088
#define TT_Err_Glyf_Table_Missing 0x089
 
 
/* -------- Memory component error codes ---- */
 
/* this error indicates that an operation cannot */
/* be performed due to memory exhaustion. */
 
#define TT_Err_Out_Of_Memory 0x100
 
 
/* -------- File component error codes ------ */
 
/* these error codes indicate that the file could */
/* not be accessed properly. Usually, this means */
/* a broken font file! */
 
#define TT_Err_Invalid_File_Offset 0x200
#define TT_Err_Invalid_File_Read 0x201
#define TT_Err_Invalid_Frame_Access 0x202
 
 
/* -------- Glyph loader error codes -------- */
 
/* Produced only by the glyph loader, these error */
/* codes indicate a broken glyph in a font file. */
 
#define TT_Err_Too_Many_Points 0x300
#define TT_Err_Too_Many_Contours 0x301
#define TT_Err_Invalid_Composite 0x302
#define TT_Err_Too_Many_Ins 0x303
 
 
/* --- bytecode interpreter error codes ----- */
 
/* These error codes are produced by the TrueType */
/* bytecode interpreter. They usually indicate a */
/* broken font file, a broken glyph within a font */
/* file, or a bug in the interpreter! */
 
#define TT_Err_Invalid_Opcode 0x400
#define TT_Err_Too_Few_Arguments 0x401
#define TT_Err_Stack_Overflow 0x402
#define TT_Err_Code_Overflow 0x403
#define TT_Err_Bad_Argument 0x404
#define TT_Err_Divide_By_Zero 0x405
#define TT_Err_Storage_Overflow 0x406
#define TT_Err_Cvt_Overflow 0x407
#define TT_Err_Invalid_Reference 0x408
#define TT_Err_Invalid_Distance 0x409
#define TT_Err_Interpolate_Twilight 0x40A
#define TT_Err_Debug_OpCode 0x40B
#define TT_Err_ENDF_In_Exec_Stream 0x40C
#define TT_Err_Out_Of_CodeRanges 0x40D
#define TT_Err_Nested_DEFS 0x40E
#define TT_Err_Invalid_CodeRange 0x40F
#define TT_Err_Invalid_Displacement 0x410
#define TT_Err_Execution_Too_Long 0x411
 
 
/* ------ internal failure error codes ----- */
 
/* These error codes are produced when an incoherent */
/* library state has been detected. These reflect a */
/* severe bug in the engine! (Or a major overwrite */
/* of your application into the library's data.) */
 
#define TT_Err_Nested_Frame_Access 0x500
#define TT_Err_Invalid_Cache_List 0x501
#define TT_Err_Could_Not_Find_Context 0x502
#define TT_Err_Unlisted_Object 0x503
 
 
/* ---- scan-line converter error codes ----- */
 
/* These error codes are produced by the raster component. */
/* They indicate that an outline structure was incoherently */
/* setup, or that you're trying to render an horribly */
/* complex glyph! */
 
#define TT_Err_Raster_Pool_Overflow 0x600
#define TT_Err_Raster_Negative_Height 0x601
#define TT_Err_Raster_Invalid_Value 0x602
#define TT_Err_Raster_Not_Initialized 0x603
 
#endif /* FTERRID_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/fterrors.h
0,0 → 1,206
/***************************************************************************/
/* */
/* fterrors.h */
/* */
/* FreeType error code handling (specification). */
/* */
/* Copyright 1996-2001, 2002, 2004, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* This special header file is used to define the handling of FT2 */
/* enumeration constants. It can also be used to generate error message */
/* strings with a small macro trick explained below. */
/* */
/* I - Error Formats */
/* ----------------- */
/* */
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
/* defined in ftoption.h in order to make the higher byte indicate */
/* the module where the error has happened (this is not compatible */
/* with standard builds of FreeType 2). You can then use the macro */
/* FT_ERROR_BASE macro to extract the generic error code from an */
/* FT_Error value. */
/* */
/* */
/* II - Error Message strings */
/* -------------------------- */
/* */
/* The error definitions below are made through special macros that */
/* allow client applications to build a table of error message strings */
/* if they need it. The strings are not included in a normal build of */
/* FreeType 2 to save space (most client applications do not use */
/* them). */
/* */
/* To do so, you have to define the following macros before including */
/* this file: */
/* */
/* FT_ERROR_START_LIST :: */
/* This macro is called before anything else to define the start of */
/* the error list. It is followed by several FT_ERROR_DEF calls */
/* (see below). */
/* */
/* FT_ERROR_DEF( e, v, s ) :: */
/* This macro is called to define one single error. */
/* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */
/* `v' is the error numerical value. */
/* `s' is the corresponding error string. */
/* */
/* FT_ERROR_END_LIST :: */
/* This macro ends the list. */
/* */
/* Additionally, you have to undefine __FTERRORS_H__ before #including */
/* this file. */
/* */
/* Here is a simple example: */
/* */
/* { */
/* #undef __FTERRORS_H__ */
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
/* #define FT_ERROR_START_LIST { */
/* #define FT_ERROR_END_LIST { 0, 0 } }; */
/* */
/* const struct */
/* { */
/* int err_code; */
/* const char* err_msg; */
/* } ft_errors[] = */
/* */
/* #include FT_ERRORS_H */
/* } */
/* */
/*************************************************************************/
 
 
#ifndef __FTERRORS_H__
#define __FTERRORS_H__
 
 
/* include module base error codes */
#include FT_MODULE_ERRORS_H
 
 
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** SETUP MACROS *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
 
 
#undef FT_NEED_EXTERN_C
 
#undef FT_ERR_XCAT
#undef FT_ERR_CAT
 
#define FT_ERR_XCAT( x, y ) x ## y
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
 
 
/* FT_ERR_PREFIX is used as a prefix for error identifiers. */
/* By default, we use `FT_Err_'. */
/* */
#ifndef FT_ERR_PREFIX
#define FT_ERR_PREFIX FT_Err_
#endif
 
 
/* FT_ERR_BASE is used as the base for module-specific errors. */
/* */
#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
 
#ifndef FT_ERR_BASE
#define FT_ERR_BASE FT_Mod_Err_Base
#endif
 
#else
 
#undef FT_ERR_BASE
#define FT_ERR_BASE 0
 
#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */
 
 
/* If FT_ERRORDEF is not defined, we need to define a simple */
/* enumeration type. */
/* */
#ifndef FT_ERRORDEF
 
#define FT_ERRORDEF( e, v, s ) e = v,
#define FT_ERROR_START_LIST enum {
#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
 
#ifdef __cplusplus
#define FT_NEED_EXTERN_C
extern "C" {
#endif
 
#endif /* !FT_ERRORDEF */
 
 
/* this macro is used to define an error */
#define FT_ERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
 
/* this is only used for <module>_Err_Ok, which must be 0! */
#define FT_NOERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
 
 
#ifdef FT_ERROR_START_LIST
FT_ERROR_START_LIST
#endif
 
 
/* now include the error codes */
#include FT_ERROR_DEFINITIONS_H
 
 
#ifdef FT_ERROR_END_LIST
FT_ERROR_END_LIST
#endif
 
 
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** SIMPLE CLEANUP *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
 
#ifdef FT_NEED_EXTERN_C
}
#endif
 
#undef FT_ERROR_START_LIST
#undef FT_ERROR_END_LIST
 
#undef FT_ERRORDEF
#undef FT_ERRORDEF_
#undef FT_NOERRORDEF_
 
#undef FT_NEED_EXTERN_C
#undef FT_ERR_CONCAT
#undef FT_ERR_BASE
 
/* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */
#ifndef FT_KEEP_ERR_PREFIX
#undef FT_ERR_PREFIX
#endif
 
#endif /* __FTERRORS_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftgasp.h
0,0 → 1,120
/***************************************************************************/
/* */
/* ftgasp.h */
/* */
/* Access of TrueType's `gasp' table (specification). */
/* */
/* Copyright 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef _FT_GASP_H_
#define _FT_GASP_H_
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
/***************************************************************************
*
* @section:
* gasp_table
*
* @title:
* Gasp Table
*
* @abstract:
* Retrieving TrueType `gasp' table entries.
*
* @description:
* The function @FT_Get_Gasp can be used to query a TrueType or OpenType
* font for specific entries in its `gasp' table, if any. This is
* mainly useful when implementing native TrueType hinting with the
* bytecode interpreter to duplicate the Windows text rendering results.
*/
 
/*************************************************************************
*
* @enum:
* FT_GASP_XXX
*
* @description:
* A list of values and/or bit-flags returned by the @FT_Get_Gasp
* function.
*
* @values:
* FT_GASP_NO_TABLE ::
* This special value means that there is no GASP table in this face.
* It is up to the client to decide what to do.
*
* FT_GASP_DO_GRIDFIT ::
* Grid-fitting and hinting should be performed at the specified ppem.
* This *really* means TrueType bytecode interpretation.
*
* FT_GASP_DO_GRAY ::
* Anti-aliased rendering should be performed at the specified ppem.
*
* FT_GASP_SYMMETRIC_SMOOTHING ::
* Smoothing along multiple axes must be used with ClearType.
*
* FT_GASP_SYMMETRIC_GRIDFIT ::
* Grid-fitting must be used with ClearType's symmetric smoothing.
*
* @note:
* `ClearType' is Microsoft's implementation of LCD rendering, partly
* protected by patents.
*
* @since:
* 2.3.0
*/
#define FT_GASP_NO_TABLE -1
#define FT_GASP_DO_GRIDFIT 0x01
#define FT_GASP_DO_GRAY 0x02
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
 
 
/*************************************************************************
*
* @func:
* FT_Get_Gasp
*
* @description:
* Read the `gasp' table from a TrueType or OpenType font file and
* return the entry corresponding to a given character pixel size.
*
* @input:
* face :: The source face handle.
* ppem :: The vertical character pixel size.
*
* @return:
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
* `gasp' table in the face.
*
* @since:
* 2.3.0
*/
FT_EXPORT( FT_Int )
FT_Get_Gasp( FT_Face face,
FT_UInt ppem );
 
/* */
 
#endif /* _FT_GASP_H_ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftglyph.h
0,0 → 1,613
/***************************************************************************/
/* */
/* ftglyph.h */
/* */
/* FreeType convenience functions to handle glyphs (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* This file contains the definition of several convenience functions */
/* that can be used by client applications to easily retrieve glyph */
/* bitmaps and outlines from a given face. */
/* */
/* These functions should be optional if you are writing a font server */
/* or text layout engine on top of FreeType. However, they are pretty */
/* handy for many other simple uses of the library. */
/* */
/*************************************************************************/
 
 
#ifndef __FTGLYPH_H__
#define __FTGLYPH_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* glyph_management */
/* */
/* <Title> */
/* Glyph Management */
/* */
/* <Abstract> */
/* Generic interface to manage individual glyph data. */
/* */
/* <Description> */
/* This section contains definitions used to manage glyph data */
/* through generic FT_Glyph objects. Each of them can contain a */
/* bitmap, a vector outline, or even images in other formats. */
/* */
/*************************************************************************/
 
 
/* forward declaration to a private type */
typedef struct FT_Glyph_Class_ FT_Glyph_Class;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Glyph */
/* */
/* <Description> */
/* Handle to an object used to model generic glyph images. It is a */
/* pointer to the @FT_GlyphRec structure and can contain a glyph */
/* bitmap or pointer. */
/* */
/* <Note> */
/* Glyph objects are not owned by the library. You must thus release */
/* them manually (through @FT_Done_Glyph) _before_ calling */
/* @FT_Done_FreeType. */
/* */
typedef struct FT_GlyphRec_* FT_Glyph;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_GlyphRec */
/* */
/* <Description> */
/* The root glyph structure contains a given glyph image plus its */
/* advance width in 16.16 fixed float format. */
/* */
/* <Fields> */
/* library :: A handle to the FreeType library object. */
/* */
/* clazz :: A pointer to the glyph's class. Private. */
/* */
/* format :: The format of the glyph's image. */
/* */
/* advance :: A 16.16 vector that gives the glyph's advance width. */
/* */
typedef struct FT_GlyphRec_
{
FT_Library library;
const FT_Glyph_Class* clazz;
FT_Glyph_Format format;
FT_Vector advance;
 
} FT_GlyphRec;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_BitmapGlyph */
/* */
/* <Description> */
/* A handle to an object used to model a bitmap glyph image. This is */
/* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */
/* */
typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_BitmapGlyphRec */
/* */
/* <Description> */
/* A structure used for bitmap glyph images. This really is a */
/* `sub-class' of @FT_GlyphRec. */
/* */
/* <Fields> */
/* root :: The root @FT_Glyph fields. */
/* */
/* left :: The left-side bearing, i.e., the horizontal distance */
/* from the current pen position to the left border of the */
/* glyph bitmap. */
/* */
/* top :: The top-side bearing, i.e., the vertical distance from */
/* the current pen position to the top border of the glyph */
/* bitmap. This distance is positive for upwards~y! */
/* */
/* bitmap :: A descriptor for the bitmap. */
/* */
/* <Note> */
/* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */
/* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */
/* the bitmap's contents easily. */
/* */
/* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */
/* and is thus created and destroyed with it. */
/* */
typedef struct FT_BitmapGlyphRec_
{
FT_GlyphRec root;
FT_Int left;
FT_Int top;
FT_Bitmap bitmap;
 
} FT_BitmapGlyphRec;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_OutlineGlyph */
/* */
/* <Description> */
/* A handle to an object used to model an outline glyph image. This */
/* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */
/* */
typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_OutlineGlyphRec */
/* */
/* <Description> */
/* A structure used for outline (vectorial) glyph images. This */
/* really is a `sub-class' of @FT_GlyphRec. */
/* */
/* <Fields> */
/* root :: The root @FT_Glyph fields. */
/* */
/* outline :: A descriptor for the outline. */
/* */
/* <Note> */
/* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */
/* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */
/* the outline's content easily. */
/* */
/* As the outline is extracted from a glyph slot, its coordinates are */
/* expressed normally in 26.6 pixels, unless the flag */
/* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */
/* */
/* The outline's tables are always owned by the object and are */
/* destroyed with it. */
/* */
typedef struct FT_OutlineGlyphRec_
{
FT_GlyphRec root;
FT_Outline outline;
 
} FT_OutlineGlyphRec;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Glyph */
/* */
/* <Description> */
/* A function used to extract a glyph image from a slot. Note that */
/* the created @FT_Glyph object must be released with @FT_Done_Glyph. */
/* */
/* <Input> */
/* slot :: A handle to the source glyph slot. */
/* */
/* <Output> */
/* aglyph :: A handle to the glyph object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Glyph( FT_GlyphSlot slot,
FT_Glyph *aglyph );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Glyph_Copy */
/* */
/* <Description> */
/* A function used to copy a glyph image. Note that the created */
/* @FT_Glyph object must be released with @FT_Done_Glyph. */
/* */
/* <Input> */
/* source :: A handle to the source glyph object. */
/* */
/* <Output> */
/* target :: A handle to the target glyph object. 0~in case of */
/* error. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Glyph_Copy( FT_Glyph source,
FT_Glyph *target );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Glyph_Transform */
/* */
/* <Description> */
/* Transform a glyph image if its format is scalable. */
/* */
/* <InOut> */
/* glyph :: A handle to the target glyph object. */
/* */
/* <Input> */
/* matrix :: A pointer to a 2x2 matrix to apply. */
/* */
/* delta :: A pointer to a 2d vector to apply. Coordinates are */
/* expressed in 1/64th of a pixel. */
/* */
/* <Return> */
/* FreeType error code (if not 0, the glyph format is not scalable). */
/* */
/* <Note> */
/* The 2x2 transformation matrix is also applied to the glyph's */
/* advance vector. */
/* */
FT_EXPORT( FT_Error )
FT_Glyph_Transform( FT_Glyph glyph,
FT_Matrix* matrix,
FT_Vector* delta );
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Glyph_BBox_Mode */
/* */
/* <Description> */
/* The mode how the values of @FT_Glyph_Get_CBox are returned. */
/* */
/* <Values> */
/* FT_GLYPH_BBOX_UNSCALED :: */
/* Return unscaled font units. */
/* */
/* FT_GLYPH_BBOX_SUBPIXELS :: */
/* Return unfitted 26.6 coordinates. */
/* */
/* FT_GLYPH_BBOX_GRIDFIT :: */
/* Return grid-fitted 26.6 coordinates. */
/* */
/* FT_GLYPH_BBOX_TRUNCATE :: */
/* Return coordinates in integer pixels. */
/* */
/* FT_GLYPH_BBOX_PIXELS :: */
/* Return grid-fitted pixel coordinates. */
/* */
typedef enum FT_Glyph_BBox_Mode_
{
FT_GLYPH_BBOX_UNSCALED = 0,
FT_GLYPH_BBOX_SUBPIXELS = 0,
FT_GLYPH_BBOX_GRIDFIT = 1,
FT_GLYPH_BBOX_TRUNCATE = 2,
FT_GLYPH_BBOX_PIXELS = 3
 
} FT_Glyph_BBox_Mode;
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* ft_glyph_bbox_xxx */
/* */
/* <Description> */
/* These constants are deprecated. Use the corresponding */
/* @FT_Glyph_BBox_Mode values instead. */
/* */
/* <Values> */
/* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */
/* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */
/* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */
/* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */
/* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */
/* */
#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT
#define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE
#define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Glyph_Get_CBox */
/* */
/* <Description> */
/* Return a glyph's `control box'. The control box encloses all the */
/* outline's points, including Bézier control points. Though it */
/* coincides with the exact bounding box for most glyphs, it can be */
/* slightly larger in some situations (like when rotating an outline */
/* which contains Bézier outside arcs). */
/* */
/* Computing the control box is very fast, while getting the bounding */
/* box can take much more time as it needs to walk over all segments */
/* and arcs in the outline. To get the latter, you can use the */
/* `ftbbox' component which is dedicated to this single task. */
/* */
/* <Input> */
/* glyph :: A handle to the source glyph object. */
/* */
/* mode :: The mode which indicates how to interpret the returned */
/* bounding box values. */
/* */
/* <Output> */
/* acbox :: The glyph coordinate bounding box. Coordinates are */
/* expressed in 1/64th of pixels if it is grid-fitted. */
/* */
/* <Note> */
/* Coordinates are relative to the glyph origin, using the y~upwards */
/* convention. */
/* */
/* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */
/* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */
/* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */
/* is another name for this constant. */
/* */
/* Note that the maximum coordinates are exclusive, which means that */
/* one can compute the width and height of the glyph image (be it in */
/* integer or 26.6 pixels) as: */
/* */
/* { */
/* width = bbox.xMax - bbox.xMin; */
/* height = bbox.yMax - bbox.yMin; */
/* } */
/* */
/* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
/* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */
/* which corresponds to: */
/* */
/* { */
/* bbox.xMin = FLOOR(bbox.xMin); */
/* bbox.yMin = FLOOR(bbox.yMin); */
/* bbox.xMax = CEILING(bbox.xMax); */
/* bbox.yMax = CEILING(bbox.yMax); */
/* } */
/* */
/* To get the bbox in pixel coordinates, set `bbox_mode' to */
/* @FT_GLYPH_BBOX_TRUNCATE. */
/* */
/* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
/* to @FT_GLYPH_BBOX_PIXELS. */
/* */
FT_EXPORT( void )
FT_Glyph_Get_CBox( FT_Glyph glyph,
FT_UInt bbox_mode,
FT_BBox *acbox );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Glyph_To_Bitmap */
/* */
/* <Description> */
/* Convert a given glyph object to a bitmap glyph object. */
/* */
/* <InOut> */
/* the_glyph :: A pointer to a handle to the target glyph. */
/* */
/* <Input> */
/* render_mode :: An enumeration that describes how the data is */
/* rendered. */
/* */
/* origin :: A pointer to a vector used to translate the glyph */
/* image before rendering. Can be~0 (if no */
/* translation). The origin is expressed in */
/* 26.6 pixels. */
/* */
/* destroy :: A boolean that indicates that the original glyph */
/* image should be destroyed by this function. It is */
/* never destroyed in case of error. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* This function does nothing if the glyph format isn't scalable. */
/* */
/* The glyph image is translated with the `origin' vector before */
/* rendering. */
/* */
/* The first parameter is a pointer to an @FT_Glyph handle, that will */
/* be _replaced_ by this function (with newly allocated data). */
/* Typically, you would use (omitting error handling): */
/* */
/* */
/* { */
/* FT_Glyph glyph; */
/* FT_BitmapGlyph glyph_bitmap; */
/* */
/* */
/* // load glyph */
/* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
/* */
/* // extract glyph image */
/* error = FT_Get_Glyph( face->glyph, &glyph ); */
/* */
/* // convert to a bitmap (default render mode + destroying old) */
/* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
/* { */
/* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */
/* 0, 1 ); */
/* if ( error ) // `glyph' unchanged */
/* ... */
/* } */
/* */
/* // access bitmap content by typecasting */
/* glyph_bitmap = (FT_BitmapGlyph)glyph; */
/* */
/* // do funny stuff with it, like blitting/drawing */
/* ... */
/* */
/* // discard glyph image (bitmap or not) */
/* FT_Done_Glyph( glyph ); */
/* } */
/* */
/* */
/* Here another example, again without error handling: */
/* */
/* */
/* { */
/* FT_Glyph glyphs[MAX_GLYPHS] */
/* */
/* */
/* ... */
/* */
/* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
/* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || */
/* FT_Get_Glyph ( face->glyph, &glyph[idx] ); */
/* */
/* ... */
/* */
/* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
/* { */
/* FT_Glyph bitmap = glyphs[idx]; */
/* */
/* */
/* ... */
/* */
/* // after this call, `bitmap' no longer points into */
/* // the `glyphs' array (and the old value isn't destroyed) */
/* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); */
/* */
/* ... */
/* */
/* FT_Done_Glyph( bitmap ); */
/* } */
/* */
/* ... */
/* */
/* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
/* FT_Done_Glyph( glyphs[idx] ); */
/* } */
/* */
FT_EXPORT( FT_Error )
FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
FT_Render_Mode render_mode,
FT_Vector* origin,
FT_Bool destroy );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_Glyph */
/* */
/* <Description> */
/* Destroy a given glyph. */
/* */
/* <Input> */
/* glyph :: A handle to the target glyph object. */
/* */
FT_EXPORT( void )
FT_Done_Glyph( FT_Glyph glyph );
 
/* */
 
 
/* other helpful functions */
 
/*************************************************************************/
/* */
/* <Section> */
/* computations */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Matrix_Multiply */
/* */
/* <Description> */
/* Perform the matrix operation `b = a*b'. */
/* */
/* <Input> */
/* a :: A pointer to matrix `a'. */
/* */
/* <InOut> */
/* b :: A pointer to matrix `b'. */
/* */
/* <Note> */
/* The result is undefined if either `a' or `b' is zero. */
/* */
FT_EXPORT( void )
FT_Matrix_Multiply( const FT_Matrix* a,
FT_Matrix* b );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Matrix_Invert */
/* */
/* <Description> */
/* Invert a 2x2 matrix. Return an error if it can't be inverted. */
/* */
/* <InOut> */
/* matrix :: A pointer to the target matrix. Remains untouched in */
/* case of error. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Matrix_Invert( FT_Matrix* matrix );
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTGLYPH_H__ */
 
 
/* END */
 
 
/* Local Variables: */
/* coding: utf-8 */
/* End: */
/contrib/media/updf/include/freetype/ftgxval.h
0,0 → 1,358
/***************************************************************************/
/* */
/* ftgxval.h */
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
/* Copyright 2004, 2005, 2006 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
/***************************************************************************/
/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */
/* */
/***************************************************************************/
 
 
#ifndef __FTGXVAL_H__
#define __FTGXVAL_H__
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* gx_validation */
/* */
/* <Title> */
/* TrueTypeGX/AAT Validation */
/* */
/* <Abstract> */
/* An API to validate TrueTypeGX/AAT tables. */
/* */
/* <Description> */
/* This section contains the declaration of functions to validate */
/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
/* trak, prop, lcar). */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* */
/* Warning: Use FT_VALIDATE_XXX to validate a table. */
/* Following definitions are for gxvalid developers. */
/* */
/* */
/*************************************************************************/
 
#define FT_VALIDATE_feat_INDEX 0
#define FT_VALIDATE_mort_INDEX 1
#define FT_VALIDATE_morx_INDEX 2
#define FT_VALIDATE_bsln_INDEX 3
#define FT_VALIDATE_just_INDEX 4
#define FT_VALIDATE_kern_INDEX 5
#define FT_VALIDATE_opbd_INDEX 6
#define FT_VALIDATE_trak_INDEX 7
#define FT_VALIDATE_prop_INDEX 8
#define FT_VALIDATE_lcar_INDEX 9
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
 
 
/*************************************************************************
*
* @macro:
* FT_VALIDATE_GX_LENGTH
*
* @description:
* The number of tables checked in this module. Use it as a parameter
* for the `table-length' argument of function @FT_TrueTypeGX_Validate.
*/
#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
 
/* */
 
/* Up to 0x1000 is used by otvalid.
Ox2xxx is reserved for feature OT extension. */
#define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
 
 
/**********************************************************************
*
* @enum:
* FT_VALIDATE_GXXXX
*
* @description:
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to
* indicate which TrueTypeGX/AAT Type tables should be validated.
*
* @values:
* FT_VALIDATE_feat ::
* Validate `feat' table.
*
* FT_VALIDATE_mort ::
* Validate `mort' table.
*
* FT_VALIDATE_morx ::
* Validate `morx' table.
*
* FT_VALIDATE_bsln ::
* Validate `bsln' table.
*
* FT_VALIDATE_just ::
* Validate `just' table.
*
* FT_VALIDATE_kern ::
* Validate `kern' table.
*
* FT_VALIDATE_opbd ::
* Validate `opbd' table.
*
* FT_VALIDATE_trak ::
* Validate `trak' table.
*
* FT_VALIDATE_prop ::
* Validate `prop' table.
*
* FT_VALIDATE_lcar ::
* Validate `lcar' table.
*
* FT_VALIDATE_GX ::
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
* opbd, trak, prop and lcar).
*
*/
 
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
 
#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
FT_VALIDATE_mort | \
FT_VALIDATE_morx | \
FT_VALIDATE_bsln | \
FT_VALIDATE_just | \
FT_VALIDATE_kern | \
FT_VALIDATE_opbd | \
FT_VALIDATE_trak | \
FT_VALIDATE_prop | \
FT_VALIDATE_lcar )
 
 
/* */
 
/**********************************************************************
*
* @function:
* FT_TrueTypeGX_Validate
*
* @description:
* Validate various TrueTypeGX tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library which
* actually does the text layout can access those tables without
* error checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field which specifies the tables to be validated. See
* @FT_VALIDATE_GXXXX for possible values.
*
* table_length ::
* The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
* should be passed.
*
* @output:
* tables ::
* The array where all validated sfnt tables are stored.
* The array itself must be allocated by a client.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with TrueTypeGX fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the buffers pointed to by
* each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
* indicates that the table either doesn't exist in the font, the
* application hasn't asked for validation, or the validator doesn't have
* the ability to validate the sfnt table.
*/
FT_EXPORT( FT_Error )
FT_TrueTypeGX_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
FT_UInt table_length );
 
 
/* */
 
/**********************************************************************
*
* @function:
* FT_TrueTypeGX_Free
*
* @description:
* Free the buffer allocated by TrueTypeGX validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer allocated by
* @FT_TrueTypeGX_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_TrueTypeGX_Validate only.
*/
FT_EXPORT( void )
FT_TrueTypeGX_Free( FT_Face face,
FT_Bytes table );
 
 
/* */
 
/**********************************************************************
*
* @enum:
* FT_VALIDATE_CKERNXXX
*
* @description:
* A list of bit-field constants used with @FT_ClassicKern_Validate
* to indicate the classic kern dialect or dialects. If the selected
* type doesn't fit, @FT_ClassicKern_Validate regards the table as
* invalid.
*
* @values:
* FT_VALIDATE_MS ::
* Handle the `kern' table as a classic Microsoft kern table.
*
* FT_VALIDATE_APPLE ::
* Handle the `kern' table as a classic Apple kern table.
*
* FT_VALIDATE_CKERN ::
* Handle the `kern' as either classic Apple or Microsoft kern table.
*/
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
 
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
 
 
/* */
 
/**********************************************************************
*
* @function:
* FT_ClassicKern_Validate
*
* @description:
* Validate classic (16-bit format) kern table to assure that the offsets
* and indices are valid. The idea is that a higher-level library which
* actually does the text layout can access those tables without error
* checking (which can be quite time consuming).
*
* The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
* the new 32-bit format and the classic 16-bit format, while
* FT_ClassicKern_Validate only supports the classic 16-bit format.
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field which specifies the dialect to be validated. See
* @FT_VALIDATE_CKERNXXX for possible values.
*
* @output:
* ckern_table ::
* A pointer to the kern table.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* After use, the application should deallocate the buffers pointed to by
* `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
* indicates that the table doesn't exist in the font.
*/
FT_EXPORT( FT_Error )
FT_ClassicKern_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes *ckern_table );
 
 
/* */
 
/**********************************************************************
*
* @function:
* FT_ClassicKern_Free
*
* @description:
* Free the buffer allocated by classic Kern validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_ClassicKern_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_ClassicKern_Validate only.
*/
FT_EXPORT( void )
FT_ClassicKern_Free( FT_Face face,
FT_Bytes table );
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTGXVAL_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftgzip.h
0,0 → 1,102
/***************************************************************************/
/* */
/* ftgzip.h */
/* */
/* Gzip-compressed stream support. */
/* */
/* Copyright 2002, 2003, 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTGZIP_H__
#define __FTGZIP_H__
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
/*************************************************************************/
/* */
/* <Section> */
/* gzip */
/* */
/* <Title> */
/* GZIP Streams */
/* */
/* <Abstract> */
/* Using gzip-compressed font files. */
/* */
/* <Description> */
/* This section contains the declaration of Gzip-specific functions. */
/* */
/*************************************************************************/
 
 
/************************************************************************
*
* @function:
* FT_Stream_OpenGzip
*
* @description:
* Open a new stream to parse gzip-compressed font files. This is
* mainly used to support the compressed `*.pcf.gz' fonts that come
* with XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream.
*
* In certain builds of the library, gzip compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a gzipped stream from
* it and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with zlib support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenGzip( FT_Stream stream,
FT_Stream source );
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTGZIP_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftheader.h
0,0 → 1,780
/***************************************************************************/
/* */
/* ftheader.h */
/* */
/* Build macros of the FreeType 2 library. */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
#ifndef __FT_HEADER_H__
#define __FT_HEADER_H__
 
 
/*@***********************************************************************/
/* */
/* <Macro> */
/* FT_BEGIN_HEADER */
/* */
/* <Description> */
/* This macro is used in association with @FT_END_HEADER in header */
/* files to ensure that the declarations within are properly */
/* encapsulated in an `extern "C" { .. }' block when included from a */
/* C++ compiler. */
/* */
#ifdef __cplusplus
#define FT_BEGIN_HEADER extern "C" {
#else
#define FT_BEGIN_HEADER /* nothing */
#endif
 
 
/*@***********************************************************************/
/* */
/* <Macro> */
/* FT_END_HEADER */
/* */
/* <Description> */
/* This macro is used in association with @FT_BEGIN_HEADER in header */
/* files to ensure that the declarations within are properly */
/* encapsulated in an `extern "C" { .. }' block when included from a */
/* C++ compiler. */
/* */
#ifdef __cplusplus
#define FT_END_HEADER }
#else
#define FT_END_HEADER /* nothing */
#endif
 
 
/*************************************************************************/
/* */
/* Aliases for the FreeType 2 public and configuration files. */
/* */
/*************************************************************************/
 
/*************************************************************************/
/* */
/* <Section> */
/* header_file_macros */
/* */
/* <Title> */
/* Header File Macros */
/* */
/* <Abstract> */
/* Macro definitions used to #include specific header files. */
/* */
/* <Description> */
/* The following macros are defined to the name of specific */
/* FreeType~2 header files. They can be used directly in #include */
/* statements as in: */
/* */
/* { */
/* #include FT_FREETYPE_H */
/* #include FT_MULTIPLE_MASTERS_H */
/* #include FT_GLYPH_H */
/* } */
/* */
/* There are several reasons why we are now using macros to name */
/* public header files. The first one is that such macros are not */
/* limited to the infamous 8.3~naming rule required by DOS (and */
/* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
/* */
/* The second reason is that it allows for more flexibility in the */
/* way FreeType~2 is installed on a given system. */
/* */
/*************************************************************************/
 
 
/* configuration files */
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_CONFIG_H
*
* @description:
* A macro used in #include statements to name the file containing
* FreeType~2 configuration data.
*
*/
#ifndef FT_CONFIG_CONFIG_H
#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h>
#endif
 
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_STANDARD_LIBRARY_H
*
* @description:
* A macro used in #include statements to name the file containing
* FreeType~2 interface to the standard C library functions.
*
*/
#ifndef FT_CONFIG_STANDARD_LIBRARY_H
#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
#endif
 
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_OPTIONS_H
*
* @description:
* A macro used in #include statements to name the file containing
* FreeType~2 project-specific configuration options.
*
*/
#ifndef FT_CONFIG_OPTIONS_H
#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
#endif
 
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_MODULES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list of FreeType~2 modules that are statically linked to new library
* instances in @FT_Init_FreeType.
*
*/
#ifndef FT_CONFIG_MODULES_H
#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h>
#endif
 
/* */
 
/* public headers */
 
/*************************************************************************
*
* @macro:
* FT_FREETYPE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* base FreeType~2 API.
*
*/
#define FT_FREETYPE_H <freetype/freetype.h>
 
 
/*************************************************************************
*
* @macro:
* FT_ERRORS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list of FreeType~2 error codes (and messages).
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_ERRORS_H <freetype/fterrors.h>
 
 
/*************************************************************************
*
* @macro:
* FT_MODULE_ERRORS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list of FreeType~2 module error offsets (and messages).
*
*/
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SYSTEM_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 interface to low-level operations (i.e., memory management
* and stream i/o).
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_SYSTEM_H <freetype/ftsystem.h>
 
 
/*************************************************************************
*
* @macro:
* FT_IMAGE_H
*
* @description:
* A macro used in #include statements to name the file containing type
* definitions related to glyph images (i.e., bitmaps, outlines,
* scan-converter parameters).
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_IMAGE_H <freetype/ftimage.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TYPES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* basic data types defined by FreeType~2.
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_TYPES_H <freetype/fttypes.h>
 
 
/*************************************************************************
*
* @macro:
* FT_LIST_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list management API of FreeType~2.
*
* (Most applications will never need to include this file.)
*
*/
#define FT_LIST_H <freetype/ftlist.h>
 
 
/*************************************************************************
*
* @macro:
* FT_OUTLINE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* scalable outline management API of FreeType~2.
*
*/
#define FT_OUTLINE_H <freetype/ftoutln.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SIZES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API which manages multiple @FT_Size objects per face.
*
*/
#define FT_SIZES_H <freetype/ftsizes.h>
 
 
/*************************************************************************
*
* @macro:
* FT_MODULE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* module management API of FreeType~2.
*
*/
#define FT_MODULE_H <freetype/ftmodapi.h>
 
 
/*************************************************************************
*
* @macro:
* FT_RENDER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* renderer module management API of FreeType~2.
*
*/
#define FT_RENDER_H <freetype/ftrender.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TYPE1_TABLES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* types and API specific to the Type~1 format.
*
*/
#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRUETYPE_IDS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* enumeration values which identify name strings, languages, encodings,
* etc. This file really contains a _large_ set of constant macro
* definitions, taken from the TrueType and OpenType specifications.
*
*/
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRUETYPE_TABLES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* types and API specific to the TrueType (as well as OpenType) format.
*
*/
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRUETYPE_TAGS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of TrueType four-byte `tags' which identify blocks in
* SFNT-based font formats (i.e., TrueType and OpenType).
*
*/
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
 
 
/*************************************************************************
*
* @macro:
* FT_BDF_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which accesses BDF-specific strings from a
* face.
*
*/
#define FT_BDF_H <freetype/ftbdf.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CID_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which access CID font information from a
* face.
*
*/
#define FT_CID_H <freetype/ftcid.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GZIP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which supports gzip-compressed files.
*
*/
#define FT_GZIP_H <freetype/ftgzip.h>
 
 
/*************************************************************************
*
* @macro:
* FT_LZW_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which supports LZW-compressed files.
*
*/
#define FT_LZW_H <freetype/ftlzw.h>
 
 
/*************************************************************************
*
* @macro:
* FT_WINFONTS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which supports Windows FNT files.
*
*/
#define FT_WINFONTS_H <freetype/ftwinfnt.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GLYPH_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional glyph management component.
*
*/
#define FT_GLYPH_H <freetype/ftglyph.h>
 
 
/*************************************************************************
*
* @macro:
* FT_BITMAP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional bitmap conversion component.
*
*/
#define FT_BITMAP_H <freetype/ftbitmap.h>
 
 
/*************************************************************************
*
* @macro:
* FT_BBOX_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional exact bounding box computation routines.
*
*/
#define FT_BBOX_H <freetype/ftbbox.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional FreeType~2 cache sub-system.
*
*/
#define FT_CACHE_H <freetype/ftcache.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_IMAGE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `glyph image' API of the FreeType~2 cache sub-system.
*
* It is used to define a cache for @FT_Glyph elements. You can also
* use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to
* store small glyph bitmaps, as it will use less memory.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* glyph image-related cache declarations.
*
*/
#define FT_CACHE_IMAGE_H FT_CACHE_H
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_SMALL_BITMAPS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `small bitmaps' API of the FreeType~2 cache sub-system.
*
* It is used to define a cache for small glyph bitmaps in a relatively
* memory-efficient way. You can also use the API defined in
* @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,
* including scalable outlines.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* small bitmaps-related cache declarations.
*
*/
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_CHARMAP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `charmap' API of the FreeType~2 cache sub-system.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* charmap-based cache declarations.
*
*/
#define FT_CACHE_CHARMAP_H FT_CACHE_H
 
 
/*************************************************************************
*
* @macro:
* FT_MAC_H
*
* @description:
* A macro used in #include statements to name the file containing the
* Macintosh-specific FreeType~2 API. The latter is used to access
* fonts embedded in resource forks.
*
* This header file must be explicitly included by client applications
* compiled on the Mac (note that the base API still works though).
*
*/
#define FT_MAC_H <freetype/ftmac.h>
 
 
/*************************************************************************
*
* @macro:
* FT_MULTIPLE_MASTERS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional multiple-masters management API of FreeType~2.
*
*/
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SFNT_NAMES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which accesses embedded `name' strings in
* SFNT-based font formats (i.e., TrueType and OpenType).
*
*/
#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
 
 
/*************************************************************************
*
* @macro:
* FT_OPENTYPE_VALIDATE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which validates OpenType tables (BASE, GDEF,
* GPOS, GSUB, JSTF).
*
*/
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GX_VALIDATE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,
* mort, morx, bsln, just, kern, opbd, trak, prop).
*
*/
#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
 
 
/*************************************************************************
*
* @macro:
* FT_PFR_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which accesses PFR-specific data.
*
*/
#define FT_PFR_H <freetype/ftpfr.h>
 
 
/*************************************************************************
*
* @macro:
* FT_STROKER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which provides functions to stroke outline paths.
*/
#define FT_STROKER_H <freetype/ftstroke.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SYNTHESIS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs artificial obliquing and emboldening.
*/
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
 
 
/*************************************************************************
*
* @macro:
* FT_XFREE86_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which provides functions specific to the XFree86 and
* X.Org X11 servers.
*/
#define FT_XFREE86_H <freetype/ftxf86.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRIGONOMETRY_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs trigonometric computations (e.g.,
* cosines and arc tangents).
*/
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
 
 
/*************************************************************************
*
* @macro:
* FT_LCD_FILTER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
 
 
/*************************************************************************
*
* @macro:
* FT_UNPATENTED_HINTING_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h>
 
 
/*************************************************************************
*
* @macro:
* FT_INCREMENTAL_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GASP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which returns entries from the TrueType GASP table.
*/
#define FT_GASP_H <freetype/ftgasp.h>
 
 
/*************************************************************************
*
* @macro:
* FT_ADVANCES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which returns individual and ranged glyph advances.
*/
#define FT_ADVANCES_H <freetype/ftadvanc.h>
 
 
/* */
 
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
 
 
/* The internals of the cache sub-system are no longer exposed. We */
/* default to FT_CACHE_H at the moment just in case, but we know of */
/* no rogue client that uses them. */
/* */
#define FT_CACHE_MANAGER_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h>
 
 
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
 
#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
 
 
/*
* Include internal headers definitions from <freetype/internal/...>
* only when building the library.
*/
#ifdef FT2_BUILD_LIBRARY
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
#include FT_INTERNAL_INTERNAL_H
#endif /* FT2_BUILD_LIBRARY */
 
 
#endif /* __FT2_BUILD_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftimage.h
0,0 → 1,1313
/***************************************************************************/
/* */
/* ftimage.h */
/* */
/* FreeType glyph image formats and default raster interface */
/* (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
/*************************************************************************/
/* */
/* Note: A `raster' is simply a scan-line converter, used to render */
/* FT_Outlines into FT_Bitmaps. */
/* */
/*************************************************************************/
 
 
#ifndef __FTIMAGE_H__
#define __FTIMAGE_H__
 
 
/* _STANDALONE_ is from ftgrays.c */
#ifndef _STANDALONE_
#include <ft2build.h>
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* basic_types */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Pos */
/* */
/* <Description> */
/* The type FT_Pos is used to store vectorial coordinates. Depending */
/* on the context, these can represent distances in integer font */
/* units, or 16.16, or 26.6 fixed float pixel coordinates. */
/* */
typedef signed long FT_Pos;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Vector */
/* */
/* <Description> */
/* A simple structure used to store a 2D vector; coordinates are of */
/* the FT_Pos type. */
/* */
/* <Fields> */
/* x :: The horizontal coordinate. */
/* y :: The vertical coordinate. */
/* */
typedef struct FT_Vector_
{
FT_Pos x;
FT_Pos y;
 
} FT_Vector;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_BBox */
/* */
/* <Description> */
/* A structure used to hold an outline's bounding box, i.e., the */
/* coordinates of its extrema in the horizontal and vertical */
/* directions. */
/* */
/* <Fields> */
/* xMin :: The horizontal minimum (left-most). */
/* */
/* yMin :: The vertical minimum (bottom-most). */
/* */
/* xMax :: The horizontal maximum (right-most). */
/* */
/* yMax :: The vertical maximum (top-most). */
/* */
/* <Note> */
/* The bounding box is specified with the coordinates of the lower */
/* left and the upper right corner. In PostScript, those values are */
/* often called (llx,lly) and (urx,ury), respectively. */
/* */
/* If `yMin' is negative, this value gives the glyph's descender. */
/* Otherwise, the glyph doesn't descend below the baseline. */
/* Similarly, if `ymax' is positive, this value gives the glyph's */
/* ascender. */
/* */
/* `xMin' gives the horizontal distance from the glyph's origin to */
/* the left edge of the glyph's bounding box. If `xMin' is negative, */
/* the glyph extends to the left of the origin. */
/* */
typedef struct FT_BBox_
{
FT_Pos xMin, yMin;
FT_Pos xMax, yMax;
 
} FT_BBox;
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Pixel_Mode */
/* */
/* <Description> */
/* An enumeration type used to describe the format of pixels in a */
/* given bitmap. Note that additional formats may be added in the */
/* future. */
/* */
/* <Values> */
/* FT_PIXEL_MODE_NONE :: */
/* Value~0 is reserved. */
/* */
/* FT_PIXEL_MODE_MONO :: */
/* A monochrome bitmap, using 1~bit per pixel. Note that pixels */
/* are stored in most-significant order (MSB), which means that */
/* the left-most pixel in a byte has value 128. */
/* */
/* FT_PIXEL_MODE_GRAY :: */
/* An 8-bit bitmap, generally used to represent anti-aliased glyph */
/* images. Each pixel is stored in one byte. Note that the number */
/* of `gray' levels is stored in the `num_grays' field of the */
/* @FT_Bitmap structure (it generally is 256). */
/* */
/* FT_PIXEL_MODE_GRAY2 :: */
/* A 2-bit per pixel bitmap, used to represent embedded */
/* anti-aliased bitmaps in font files according to the OpenType */
/* specification. We haven't found a single font using this */
/* format, however. */
/* */
/* FT_PIXEL_MODE_GRAY4 :: */
/* A 4-bit per pixel bitmap, representing embedded anti-aliased */
/* bitmaps in font files according to the OpenType specification. */
/* We haven't found a single font using this format, however. */
/* */
/* FT_PIXEL_MODE_LCD :: */
/* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
/* used for display on LCD displays; the bitmap is three times */
/* wider than the original glyph image. See also */
/* @FT_RENDER_MODE_LCD. */
/* */
/* FT_PIXEL_MODE_LCD_V :: */
/* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
/* used for display on rotated LCD displays; the bitmap is three */
/* times taller than the original glyph image. See also */
/* @FT_RENDER_MODE_LCD_V. */
/* */
typedef enum FT_Pixel_Mode_
{
FT_PIXEL_MODE_NONE = 0,
FT_PIXEL_MODE_MONO,
FT_PIXEL_MODE_GRAY,
FT_PIXEL_MODE_GRAY2,
FT_PIXEL_MODE_GRAY4,
FT_PIXEL_MODE_LCD,
FT_PIXEL_MODE_LCD_V,
 
FT_PIXEL_MODE_MAX /* do not remove */
 
} FT_Pixel_Mode;
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* ft_pixel_mode_xxx */
/* */
/* <Description> */
/* A list of deprecated constants. Use the corresponding */
/* @FT_Pixel_Mode values instead. */
/* */
/* <Values> */
/* ft_pixel_mode_none :: See @FT_PIXEL_MODE_NONE. */
/* ft_pixel_mode_mono :: See @FT_PIXEL_MODE_MONO. */
/* ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY. */
/* ft_pixel_mode_pal2 :: See @FT_PIXEL_MODE_GRAY2. */
/* ft_pixel_mode_pal4 :: See @FT_PIXEL_MODE_GRAY4. */
/* */
#define ft_pixel_mode_none FT_PIXEL_MODE_NONE
#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY
#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
 
/* */
 
#if 0
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Palette_Mode */
/* */
/* <Description> */
/* THIS TYPE IS DEPRECATED. DO NOT USE IT! */
/* */
/* An enumeration type to describe the format of a bitmap palette, */
/* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
/* */
/* <Values> */
/* ft_palette_mode_rgb :: The palette is an array of 3-byte RGB */
/* records. */
/* */
/* ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA */
/* records. */
/* */
/* <Note> */
/* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */
/* FreeType, these types are not handled by the library itself. */
/* */
typedef enum FT_Palette_Mode_
{
ft_palette_mode_rgb = 0,
ft_palette_mode_rgba,
 
ft_palette_mode_max /* do not remove */
 
} FT_Palette_Mode;
 
/* */
 
#endif
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Bitmap */
/* */
/* <Description> */
/* A structure used to describe a bitmap or pixmap to the raster. */
/* Note that we now manage pixmaps of various depths through the */
/* `pixel_mode' field. */
/* */
/* <Fields> */
/* rows :: The number of bitmap rows. */
/* */
/* width :: The number of pixels in bitmap row. */
/* */
/* pitch :: The pitch's absolute value is the number of bytes */
/* taken by one bitmap row, including padding. */
/* However, the pitch is positive when the bitmap has */
/* a `down' flow, and negative when it has an `up' */
/* flow. In all cases, the pitch is an offset to add */
/* to a bitmap pointer in order to go down one row. */
/* */
/* Note that `padding' means the alignment of a */
/* bitmap to a byte border, and FreeType functions */
/* normally align to the smallest possible integer */
/* value. */
/* */
/* For the B/W rasterizer, `pitch' is always an even */
/* number. */
/* */
/* To change the pitch of a bitmap (say, to make it a */
/* multiple of 4), use @FT_Bitmap_Convert. */
/* Alternatively, you might use callback functions to */
/* directly render to the application's surface; see */
/* the file `example2.cpp' in the tutorial for a */
/* demonstration. */
/* */
/* buffer :: A typeless pointer to the bitmap buffer. This */
/* value should be aligned on 32-bit boundaries in */
/* most cases. */
/* */
/* num_grays :: This field is only used with */
/* @FT_PIXEL_MODE_GRAY; it gives the number of gray */
/* levels used in the bitmap. */
/* */
/* pixel_mode :: The pixel mode, i.e., how pixel bits are stored. */
/* See @FT_Pixel_Mode for possible values. */
/* */
/* palette_mode :: This field is intended for paletted pixel modes; */
/* it indicates how the palette is stored. Not */
/* used currently. */
/* */
/* palette :: A typeless pointer to the bitmap palette; this */
/* field is intended for paletted pixel modes. Not */
/* used currently. */
/* */
/* <Note> */
/* For now, the only pixel modes supported by FreeType are mono and */
/* grays. However, drivers might be added in the future to support */
/* more `colorful' options. */
/* */
typedef struct FT_Bitmap_
{
int rows;
int width;
int pitch;
unsigned char* buffer;
short num_grays;
char pixel_mode;
char palette_mode;
void* palette;
 
} FT_Bitmap;
 
 
/*************************************************************************/
/* */
/* <Section> */
/* outline_processing */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Outline */
/* */
/* <Description> */
/* This structure is used to describe an outline to the scan-line */
/* converter. */
/* */
/* <Fields> */
/* n_contours :: The number of contours in the outline. */
/* */
/* n_points :: The number of points in the outline. */
/* */
/* points :: A pointer to an array of `n_points' @FT_Vector */
/* elements, giving the outline's point coordinates. */
/* */
/* tags :: A pointer to an array of `n_points' chars, giving */
/* each outline point's type. */
/* */
/* If bit~0 is unset, the point is `off' the curve, */
/* i.e., a Bézier control point, while it is `on' if */
/* set. */
/* */
/* Bit~1 is meaningful for `off' points only. If set, */
/* it indicates a third-order Bézier arc control point; */
/* and a second-order control point if unset. */
/* */
/* If bit~2 is set, bits 5-7 contain the drop-out mode */
/* (as defined in the OpenType specification; the value */
/* is the same as the argument to the SCANMODE */
/* instruction). */
/* */
/* Bits 3 and~4 are reserved for internal purposes. */
/* */
/* contours :: An array of `n_contours' shorts, giving the end */
/* point of each contour within the outline. For */
/* example, the first contour is defined by the points */
/* `0' to `contours[0]', the second one is defined by */
/* the points `contours[0]+1' to `contours[1]', etc. */
/* */
/* flags :: A set of bit flags used to characterize the outline */
/* and give hints to the scan-converter and hinter on */
/* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */
/* */
/* <Note> */
/* The B/W rasterizer only checks bit~2 in the `tags' array for the */
/* first point of each contour. The drop-out mode as given with */
/* @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and */
/* @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden. */
/* */
typedef struct FT_Outline_
{
short n_contours; /* number of contours in glyph */
short n_points; /* number of points in the glyph */
 
FT_Vector* points; /* the outline's points */
char* tags; /* the points flags */
short* contours; /* the contour end points */
 
int flags; /* outline masks */
 
} FT_Outline;
 
/* Following limits must be consistent with */
/* FT_Outline.{n_contours,n_points} */
#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX
#define FT_OUTLINE_POINTS_MAX SHRT_MAX
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_OUTLINE_FLAGS */
/* */
/* <Description> */
/* A list of bit-field constants use for the flags in an outline's */
/* `flags' field. */
/* */
/* <Values> */
/* FT_OUTLINE_NONE :: */
/* Value~0 is reserved. */
/* */
/* FT_OUTLINE_OWNER :: */
/* If set, this flag indicates that the outline's field arrays */
/* (i.e., `points', `flags', and `contours') are `owned' by the */
/* outline object, and should thus be freed when it is destroyed. */
/* */
/* FT_OUTLINE_EVEN_ODD_FILL :: */
/* By default, outlines are filled using the non-zero winding rule. */
/* If set to 1, the outline will be filled using the even-odd fill */
/* rule (only works with the smooth rasterizer). */
/* */
/* FT_OUTLINE_REVERSE_FILL :: */
/* By default, outside contours of an outline are oriented in */
/* clock-wise direction, as defined in the TrueType specification. */
/* This flag is set if the outline uses the opposite direction */
/* (typically for Type~1 fonts). This flag is ignored by the scan */
/* converter. */
/* */
/* FT_OUTLINE_IGNORE_DROPOUTS :: */
/* By default, the scan converter will try to detect drop-outs in */
/* an outline and correct the glyph bitmap to ensure consistent */
/* shape continuity. If set, this flag hints the scan-line */
/* converter to ignore such cases. See below for more information. */
/* */
/* FT_OUTLINE_SMART_DROPOUTS :: */
/* Select smart dropout control. If unset, use simple dropout */
/* control. Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See */
/* below for more information. */
/* */
/* FT_OUTLINE_INCLUDE_STUBS :: */
/* If set, turn pixels on for `stubs', otherwise exclude them. */
/* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for */
/* more information. */
/* */
/* FT_OUTLINE_HIGH_PRECISION :: */
/* This flag indicates that the scan-line converter should try to */
/* convert this outline to bitmaps with the highest possible */
/* quality. It is typically set for small character sizes. Note */
/* that this is only a hint that might be completely ignored by a */
/* given scan-converter. */
/* */
/* FT_OUTLINE_SINGLE_PASS :: */
/* This flag is set to force a given scan-converter to only use a */
/* single pass over the outline to render a bitmap glyph image. */
/* Normally, it is set for very large character sizes. It is only */
/* a hint that might be completely ignored by a given */
/* scan-converter. */
/* */
/* <Note> */
/* The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */
/* and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth */
/* rasterizer. */
/* */
/* There exists a second mechanism to pass the drop-out mode to the */
/* B/W rasterizer; see the `tags' field in @FT_Outline. */
/* */
/* Please refer to the description of the `SCANTYPE' instruction in */
/* the OpenType specification (in file `ttinst1.doc') how simple */
/* drop-outs, smart drop-outs, and stubs are defined. */
/* */
#define FT_OUTLINE_NONE 0x0
#define FT_OUTLINE_OWNER 0x1
#define FT_OUTLINE_EVEN_ODD_FILL 0x2
#define FT_OUTLINE_REVERSE_FILL 0x4
#define FT_OUTLINE_IGNORE_DROPOUTS 0x8
#define FT_OUTLINE_SMART_DROPOUTS 0x10
#define FT_OUTLINE_INCLUDE_STUBS 0x20
 
#define FT_OUTLINE_HIGH_PRECISION 0x100
#define FT_OUTLINE_SINGLE_PASS 0x200
 
 
/*************************************************************************
*
* @enum:
* ft_outline_flags
*
* @description:
* These constants are deprecated. Please use the corresponding
* @FT_OUTLINE_FLAGS values.
*
* @values:
* ft_outline_none :: See @FT_OUTLINE_NONE.
* ft_outline_owner :: See @FT_OUTLINE_OWNER.
* ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL.
* ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL.
* ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.
* ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION.
* ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS.
*/
#define ft_outline_none FT_OUTLINE_NONE
#define ft_outline_owner FT_OUTLINE_OWNER
#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL
#define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL
#define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS
#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION
#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS
 
/* */
 
#define FT_CURVE_TAG( flag ) ( flag & 3 )
 
#define FT_CURVE_TAG_ON 1
#define FT_CURVE_TAG_CONIC 0
#define FT_CURVE_TAG_CUBIC 2
 
#define FT_CURVE_TAG_HAS_SCANMODE 4
 
#define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */
#define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */
 
#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \
FT_CURVE_TAG_TOUCH_Y )
 
#define FT_Curve_Tag_On FT_CURVE_TAG_ON
#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC
#define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC
#define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X
#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Outline_MoveToFunc */
/* */
/* <Description> */
/* A function pointer type used to describe the signature of a `move */
/* to' function during outline walking/decomposition. */
/* */
/* A `move to' is emitted to start a new contour in an outline. */
/* */
/* <Input> */
/* to :: A pointer to the target point of the `move to'. */
/* */
/* user :: A typeless pointer which is passed from the caller of the */
/* decomposition function. */
/* */
/* <Return> */
/* Error code. 0~means success. */
/* */
typedef int
(*FT_Outline_MoveToFunc)( const FT_Vector* to,
void* user );
 
#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Outline_LineToFunc */
/* */
/* <Description> */
/* A function pointer type used to describe the signature of a `line */
/* to' function during outline walking/decomposition. */
/* */
/* A `line to' is emitted to indicate a segment in the outline. */
/* */
/* <Input> */
/* to :: A pointer to the target point of the `line to'. */
/* */
/* user :: A typeless pointer which is passed from the caller of the */
/* decomposition function. */
/* */
/* <Return> */
/* Error code. 0~means success. */
/* */
typedef int
(*FT_Outline_LineToFunc)( const FT_Vector* to,
void* user );
 
#define FT_Outline_LineTo_Func FT_Outline_LineToFunc
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Outline_ConicToFunc */
/* */
/* <Description> */
/* A function pointer type used to describe the signature of a `conic */
/* to' function during outline walking or decomposition. */
/* */
/* A `conic to' is emitted to indicate a second-order Bézier arc in */
/* the outline. */
/* */
/* <Input> */
/* control :: An intermediate control point between the last position */
/* and the new target in `to'. */
/* */
/* to :: A pointer to the target end point of the conic arc. */
/* */
/* user :: A typeless pointer which is passed from the caller of */
/* the decomposition function. */
/* */
/* <Return> */
/* Error code. 0~means success. */
/* */
typedef int
(*FT_Outline_ConicToFunc)( const FT_Vector* control,
const FT_Vector* to,
void* user );
 
#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Outline_CubicToFunc */
/* */
/* <Description> */
/* A function pointer type used to describe the signature of a `cubic */
/* to' function during outline walking or decomposition. */
/* */
/* A `cubic to' is emitted to indicate a third-order Bézier arc. */
/* */
/* <Input> */
/* control1 :: A pointer to the first Bézier control point. */
/* */
/* control2 :: A pointer to the second Bézier control point. */
/* */
/* to :: A pointer to the target end point. */
/* */
/* user :: A typeless pointer which is passed from the caller of */
/* the decomposition function. */
/* */
/* <Return> */
/* Error code. 0~means success. */
/* */
typedef int
(*FT_Outline_CubicToFunc)( const FT_Vector* control1,
const FT_Vector* control2,
const FT_Vector* to,
void* user );
 
#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Outline_Funcs */
/* */
/* <Description> */
/* A structure to hold various function pointers used during outline */
/* decomposition in order to emit segments, conic, and cubic Béziers. */
/* */
/* <Fields> */
/* move_to :: The `move to' emitter. */
/* */
/* line_to :: The segment emitter. */
/* */
/* conic_to :: The second-order Bézier arc emitter. */
/* */
/* cubic_to :: The third-order Bézier arc emitter. */
/* */
/* shift :: The shift that is applied to coordinates before they */
/* are sent to the emitter. */
/* */
/* delta :: The delta that is applied to coordinates before they */
/* are sent to the emitter, but after the shift. */
/* */
/* <Note> */
/* The point coordinates sent to the emitters are the transformed */
/* version of the original coordinates (this is important for high */
/* accuracy during scan-conversion). The transformation is simple: */
/* */
/* { */
/* x' = (x << shift) - delta */
/* y' = (x << shift) - delta */
/* } */
/* */
/* Set the values of `shift' and `delta' to~0 to get the original */
/* point coordinates. */
/* */
typedef struct FT_Outline_Funcs_
{
FT_Outline_MoveToFunc move_to;
FT_Outline_LineToFunc line_to;
FT_Outline_ConicToFunc conic_to;
FT_Outline_CubicToFunc cubic_to;
 
int shift;
FT_Pos delta;
 
} FT_Outline_Funcs;
 
 
/*************************************************************************/
/* */
/* <Section> */
/* basic_types */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Macro> */
/* FT_IMAGE_TAG */
/* */
/* <Description> */
/* This macro converts four-letter tags to an unsigned long type. */
/* */
/* <Note> */
/* Since many 16-bit compilers don't like 32-bit enumerations, you */
/* should redefine this macro in case of problems to something like */
/* this: */
/* */
/* { */
/* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */
/* } */
/* */
/* to get a simple enumeration without assigning special numbers. */
/* */
#ifndef FT_IMAGE_TAG
#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
value = ( ( (unsigned long)_x1 << 24 ) | \
( (unsigned long)_x2 << 16 ) | \
( (unsigned long)_x3 << 8 ) | \
(unsigned long)_x4 )
#endif /* FT_IMAGE_TAG */
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Glyph_Format */
/* */
/* <Description> */
/* An enumeration type used to describe the format of a given glyph */
/* image. Note that this version of FreeType only supports two image */
/* formats, even though future font drivers will be able to register */
/* their own format. */
/* */
/* <Values> */
/* FT_GLYPH_FORMAT_NONE :: */
/* The value~0 is reserved. */
/* */
/* FT_GLYPH_FORMAT_COMPOSITE :: */
/* The glyph image is a composite of several other images. This */
/* format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to */
/* report compound glyphs (like accented characters). */
/* */
/* FT_GLYPH_FORMAT_BITMAP :: */
/* The glyph image is a bitmap, and can be described as an */
/* @FT_Bitmap. You generally need to access the `bitmap' field of */
/* the @FT_GlyphSlotRec structure to read it. */
/* */
/* FT_GLYPH_FORMAT_OUTLINE :: */
/* The glyph image is a vectorial outline made of line segments */
/* and Bézier arcs; it can be described as an @FT_Outline; you */
/* generally want to access the `outline' field of the */
/* @FT_GlyphSlotRec structure to read it. */
/* */
/* FT_GLYPH_FORMAT_PLOTTER :: */
/* The glyph image is a vectorial path with no inside and outside */
/* contours. Some Type~1 fonts, like those in the Hershey family, */
/* contain glyphs in this format. These are described as */
/* @FT_Outline, but FreeType isn't currently capable of rendering */
/* them correctly. */
/* */
typedef enum FT_Glyph_Format_
{
FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),
 
FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ),
FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ),
FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' )
 
} FT_Glyph_Format;
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* ft_glyph_format_xxx */
/* */
/* <Description> */
/* A list of deprecated constants. Use the corresponding */
/* @FT_Glyph_Format values instead. */
/* */
/* <Values> */
/* ft_glyph_format_none :: See @FT_GLYPH_FORMAT_NONE. */
/* ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE. */
/* ft_glyph_format_bitmap :: See @FT_GLYPH_FORMAT_BITMAP. */
/* ft_glyph_format_outline :: See @FT_GLYPH_FORMAT_OUTLINE. */
/* ft_glyph_format_plotter :: See @FT_GLYPH_FORMAT_PLOTTER. */
/* */
#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP
#define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE
#define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** R A S T E R D E F I N I T I O N S *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* A raster is a scan converter, in charge of rendering an outline into */
/* a a bitmap. This section contains the public API for rasters. */
/* */
/* Note that in FreeType 2, all rasters are now encapsulated within */
/* specific modules called `renderers'. See `freetype/ftrender.h' for */
/* more details on renderers. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Section> */
/* raster */
/* */
/* <Title> */
/* Scanline Converter */
/* */
/* <Abstract> */
/* How vectorial outlines are converted into bitmaps and pixmaps. */
/* */
/* <Description> */
/* This section contains technical definitions. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Raster */
/* */
/* <Description> */
/* A handle (pointer) to a raster object. Each object can be used */
/* independently to convert an outline into a bitmap or pixmap. */
/* */
typedef struct FT_RasterRec_* FT_Raster;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Span */
/* */
/* <Description> */
/* A structure used to model a single span of gray (or black) pixels */
/* when rendering a monochrome or anti-aliased bitmap. */
/* */
/* <Fields> */
/* x :: The span's horizontal start position. */
/* */
/* len :: The span's length in pixels. */
/* */
/* coverage :: The span color/coverage, ranging from 0 (background) */
/* to 255 (foreground). Only used for anti-aliased */
/* rendering. */
/* */
/* <Note> */
/* This structure is used by the span drawing callback type named */
/* @FT_SpanFunc which takes the y~coordinate of the span as a */
/* a parameter. */
/* */
/* The coverage value is always between 0 and 255. If you want less */
/* gray values, the callback function has to reduce them. */
/* */
typedef struct FT_Span_
{
short x;
unsigned short len;
unsigned char coverage;
 
} FT_Span;
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_SpanFunc */
/* */
/* <Description> */
/* A function used as a call-back by the anti-aliased renderer in */
/* order to let client applications draw themselves the gray pixel */
/* spans on each scan line. */
/* */
/* <Input> */
/* y :: The scanline's y~coordinate. */
/* */
/* count :: The number of spans to draw on this scanline. */
/* */
/* spans :: A table of `count' spans to draw on the scanline. */
/* */
/* user :: User-supplied data that is passed to the callback. */
/* */
/* <Note> */
/* This callback allows client applications to directly render the */
/* gray spans of the anti-aliased bitmap to any kind of surfaces. */
/* */
/* This can be used to write anti-aliased outlines directly to a */
/* given background bitmap, and even perform translucency. */
/* */
/* Note that the `count' field cannot be greater than a fixed value */
/* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */
/* `ftoption.h'. By default, this value is set to~32, which means */
/* that if there are more than 32~spans on a given scanline, the */
/* callback is called several times with the same `y' parameter in */
/* order to draw all callbacks. */
/* */
/* Otherwise, the callback is only called once per scan-line, and */
/* only for those scanlines that do have `gray' pixels on them. */
/* */
typedef void
(*FT_SpanFunc)( int y,
int count,
const FT_Span* spans,
void* user );
 
#define FT_Raster_Span_Func FT_SpanFunc
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Raster_BitTest_Func */
/* */
/* <Description> */
/* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
/* */
/* A function used as a call-back by the monochrome scan-converter */
/* to test whether a given target pixel is already set to the drawing */
/* `color'. These tests are crucial to implement drop-out control */
/* per-se the TrueType spec. */
/* */
/* <Input> */
/* y :: The pixel's y~coordinate. */
/* */
/* x :: The pixel's x~coordinate. */
/* */
/* user :: User-supplied data that is passed to the callback. */
/* */
/* <Return> */
/* 1~if the pixel is `set', 0~otherwise. */
/* */
typedef int
(*FT_Raster_BitTest_Func)( int y,
int x,
void* user );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Raster_BitSet_Func */
/* */
/* <Description> */
/* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
/* */
/* A function used as a call-back by the monochrome scan-converter */
/* to set an individual target pixel. This is crucial to implement */
/* drop-out control according to the TrueType specification. */
/* */
/* <Input> */
/* y :: The pixel's y~coordinate. */
/* */
/* x :: The pixel's x~coordinate. */
/* */
/* user :: User-supplied data that is passed to the callback. */
/* */
/* <Return> */
/* 1~if the pixel is `set', 0~otherwise. */
/* */
typedef void
(*FT_Raster_BitSet_Func)( int y,
int x,
void* user );
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_RASTER_FLAG_XXX */
/* */
/* <Description> */
/* A list of bit flag constants as used in the `flags' field of a */
/* @FT_Raster_Params structure. */
/* */
/* <Values> */
/* FT_RASTER_FLAG_DEFAULT :: This value is 0. */
/* */
/* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */
/* anti-aliased glyph image should be */
/* generated. Otherwise, it will be */
/* monochrome (1-bit). */
/* */
/* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */
/* rendering. In this mode, client */
/* applications must provide their own span */
/* callback. This lets them directly */
/* draw or compose over an existing bitmap. */
/* If this bit is not set, the target */
/* pixmap's buffer _must_ be zeroed before */
/* rendering. */
/* */
/* Note that for now, direct rendering is */
/* only possible with anti-aliased glyphs. */
/* */
/* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */
/* rendering mode. If set, the output will */
/* be clipped to a box specified in the */
/* `clip_box' field of the */
/* @FT_Raster_Params structure. */
/* */
/* Note that by default, the glyph bitmap */
/* is clipped to the target pixmap, except */
/* in direct rendering mode where all spans */
/* are generated if no clipping box is set. */
/* */
#define FT_RASTER_FLAG_DEFAULT 0x0
#define FT_RASTER_FLAG_AA 0x1
#define FT_RASTER_FLAG_DIRECT 0x2
#define FT_RASTER_FLAG_CLIP 0x4
 
/* deprecated */
#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT
#define ft_raster_flag_aa FT_RASTER_FLAG_AA
#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT
#define ft_raster_flag_clip FT_RASTER_FLAG_CLIP
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Raster_Params */
/* */
/* <Description> */
/* A structure to hold the arguments used by a raster's render */
/* function. */
/* */
/* <Fields> */
/* target :: The target bitmap. */
/* */
/* source :: A pointer to the source glyph image (e.g., an */
/* @FT_Outline). */
/* */
/* flags :: The rendering flags. */
/* */
/* gray_spans :: The gray span drawing callback. */
/* */
/* black_spans :: The black span drawing callback. UNIMPLEMENTED! */
/* */
/* bit_test :: The bit test callback. UNIMPLEMENTED! */
/* */
/* bit_set :: The bit set callback. UNIMPLEMENTED! */
/* */
/* user :: User-supplied data that is passed to each drawing */
/* callback. */
/* */
/* clip_box :: An optional clipping box. It is only used in */
/* direct rendering mode. Note that coordinates here */
/* should be expressed in _integer_ pixels (and not in */
/* 26.6 fixed-point units). */
/* */
/* <Note> */
/* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA */
/* bit flag is set in the `flags' field, otherwise a monochrome */
/* bitmap is generated. */
/* */
/* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
/* raster will call the `gray_spans' callback to draw gray pixel */
/* spans, in the case of an aa glyph bitmap, it will call */
/* `black_spans', and `bit_test' and `bit_set' in the case of a */
/* monochrome bitmap. This allows direct composition over a */
/* pre-existing bitmap through user-provided callbacks to perform the */
/* span drawing/composition. */
/* */
/* Note that the `bit_test' and `bit_set' callbacks are required when */
/* rendering a monochrome bitmap, as they are crucial to implement */
/* correct drop-out control as defined in the TrueType specification. */
/* */
typedef struct FT_Raster_Params_
{
const FT_Bitmap* target;
const void* source;
int flags;
FT_SpanFunc gray_spans;
FT_SpanFunc black_spans; /* doesn't work! */
FT_Raster_BitTest_Func bit_test; /* doesn't work! */
FT_Raster_BitSet_Func bit_set; /* doesn't work! */
void* user;
FT_BBox clip_box;
 
} FT_Raster_Params;
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Raster_NewFunc */
/* */
/* <Description> */
/* A function used to create a new raster object. */
/* */
/* <Input> */
/* memory :: A handle to the memory allocator. */
/* */
/* <Output> */
/* raster :: A handle to the new raster object. */
/* */
/* <Return> */
/* Error code. 0~means success. */
/* */
/* <Note> */
/* The `memory' parameter is a typeless pointer in order to avoid */
/* un-wanted dependencies on the rest of the FreeType code. In */
/* practice, it is an @FT_Memory object, i.e., a handle to the */
/* standard FreeType memory allocator. However, this field can be */
/* completely ignored by a given raster implementation. */
/* */
typedef int
(*FT_Raster_NewFunc)( void* memory,
FT_Raster* raster );
 
#define FT_Raster_New_Func FT_Raster_NewFunc
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Raster_DoneFunc */
/* */
/* <Description> */
/* A function used to destroy a given raster object. */
/* */
/* <Input> */
/* raster :: A handle to the raster object. */
/* */
typedef void
(*FT_Raster_DoneFunc)( FT_Raster raster );
 
#define FT_Raster_Done_Func FT_Raster_DoneFunc
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Raster_ResetFunc */
/* */
/* <Description> */
/* FreeType provides an area of memory called the `render pool', */
/* available to all registered rasters. This pool can be freely used */
/* during a given scan-conversion but is shared by all rasters. Its */
/* content is thus transient. */
/* */
/* This function is called each time the render pool changes, or just */
/* after a new raster object is created. */
/* */
/* <Input> */
/* raster :: A handle to the new raster object. */
/* */
/* pool_base :: The address in memory of the render pool. */
/* */
/* pool_size :: The size in bytes of the render pool. */
/* */
/* <Note> */
/* Rasters can ignore the render pool and rely on dynamic memory */
/* allocation if they want to (a handle to the memory allocator is */
/* passed to the raster constructor). However, this is not */
/* recommended for efficiency purposes. */
/* */
typedef void
(*FT_Raster_ResetFunc)( FT_Raster raster,
unsigned char* pool_base,
unsigned long pool_size );
 
#define FT_Raster_Reset_Func FT_Raster_ResetFunc
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Raster_SetModeFunc */
/* */
/* <Description> */
/* This function is a generic facility to change modes or attributes */
/* in a given raster. This can be used for debugging purposes, or */
/* simply to allow implementation-specific `features' in a given */
/* raster module. */
/* */
/* <Input> */
/* raster :: A handle to the new raster object. */
/* */
/* mode :: A 4-byte tag used to name the mode or property. */
/* */
/* args :: A pointer to the new mode/property to use. */
/* */
typedef int
(*FT_Raster_SetModeFunc)( FT_Raster raster,
unsigned long mode,
void* args );
 
#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Raster_RenderFunc */
/* */
/* <Description> */
/* Invoke a given raster to scan-convert a given glyph image into a */
/* target bitmap. */
/* */
/* <Input> */
/* raster :: A handle to the raster object. */
/* */
/* params :: A pointer to an @FT_Raster_Params structure used to */
/* store the rendering parameters. */
/* */
/* <Return> */
/* Error code. 0~means success. */
/* */
/* <Note> */
/* The exact format of the source image depends on the raster's glyph */
/* format defined in its @FT_Raster_Funcs structure. It can be an */
/* @FT_Outline or anything else in order to support a large array of */
/* glyph formats. */
/* */
/* Note also that the render function can fail and return a */
/* `FT_Err_Unimplemented_Feature' error code if the raster used does */
/* not support direct composition. */
/* */
/* XXX: For now, the standard raster doesn't support direct */
/* composition but this should change for the final release (see */
/* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */
/* for examples of distinct implementations which support direct */
/* composition). */
/* */
typedef int
(*FT_Raster_RenderFunc)( FT_Raster raster,
const FT_Raster_Params* params );
 
#define FT_Raster_Render_Func FT_Raster_RenderFunc
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Raster_Funcs */
/* */
/* <Description> */
/* A structure used to describe a given raster class to the library. */
/* */
/* <Fields> */
/* glyph_format :: The supported glyph format for this raster. */
/* */
/* raster_new :: The raster constructor. */
/* */
/* raster_reset :: Used to reset the render pool within the raster. */
/* */
/* raster_render :: A function to render a glyph into a given bitmap. */
/* */
/* raster_done :: The raster destructor. */
/* */
typedef struct FT_Raster_Funcs_
{
FT_Glyph_Format glyph_format;
FT_Raster_NewFunc raster_new;
FT_Raster_ResetFunc raster_reset;
FT_Raster_SetModeFunc raster_set_mode;
FT_Raster_RenderFunc raster_render;
FT_Raster_DoneFunc raster_done;
 
} FT_Raster_Funcs;
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTIMAGE_H__ */
 
 
/* END */
 
 
/* Local Variables: */
/* coding: utf-8 */
/* End: */
/contrib/media/updf/include/freetype/ftincrem.h
0,0 → 1,353
/***************************************************************************/
/* */
/* ftincrem.h */
/* */
/* FreeType incremental loading (specification). */
/* */
/* Copyright 2002, 2003, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTINCREM_H__
#define __FTINCREM_H__
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
/***************************************************************************
*
* @section:
* incremental
*
* @title:
* Incremental Loading
*
* @abstract:
* Custom Glyph Loading.
*
* @description:
* This section contains various functions used to perform so-called
* `incremental' glyph loading. This is a mode where all glyphs loaded
* from a given @FT_Face are provided by the client application,
*
* Apart from that, all other tables are loaded normally from the font
* file. This mode is useful when FreeType is used within another
* engine, e.g., a PostScript Imaging Processor.
*
* To enable this mode, you must use @FT_Open_Face, passing an
* @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
* @FT_Incremental_Interface value. See the comments for
* @FT_Incremental_InterfaceRec for an example.
*
*/
 
 
/***************************************************************************
*
* @type:
* FT_Incremental
*
* @description:
* An opaque type describing a user-provided object used to implement
* `incremental' glyph loading within FreeType. This is used to support
* embedded fonts in certain environments (e.g., PostScript interpreters),
* where the glyph data isn't in the font file, or must be overridden by
* different values.
*
* @note:
* It is up to client applications to create and implement @FT_Incremental
* objects, as long as they provide implementations for the methods
* @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
* and @FT_Incremental_GetGlyphMetricsFunc.
*
* See the description of @FT_Incremental_InterfaceRec to understand how
* to use incremental objects with FreeType.
*
*/
typedef struct FT_IncrementalRec_* FT_Incremental;
 
 
/***************************************************************************
*
* @struct:
* FT_Incremental_MetricsRec
*
* @description:
* A small structure used to contain the basic glyph metrics returned
* by the @FT_Incremental_GetGlyphMetricsFunc method.
*
* @fields:
* bearing_x ::
* Left bearing, in font units.
*
* bearing_y ::
* Top bearing, in font units.
*
* advance ::
* Horizontal component of glyph advance, in font units.
*
* advance_v ::
* Vertical component of glyph advance, in font units.
*
* @note:
* These correspond to horizontal or vertical metrics depending on the
* value of the `vertical' argument to the function
* @FT_Incremental_GetGlyphMetricsFunc.
*
*/
typedef struct FT_Incremental_MetricsRec_
{
FT_Long bearing_x;
FT_Long bearing_y;
FT_Long advance;
FT_Long advance_v; /* since 2.3.12 */
 
} FT_Incremental_MetricsRec;
 
 
/***************************************************************************
*
* @struct:
* FT_Incremental_Metrics
*
* @description:
* A handle to an @FT_Incremental_MetricsRec structure.
*
*/
typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics;
 
 
/***************************************************************************
*
* @type:
* FT_Incremental_GetGlyphDataFunc
*
* @description:
* A function called by FreeType to access a given glyph's data bytes
* during @FT_Load_Glyph or @FT_Load_Char if incremental loading is
* enabled.
*
* Note that the format of the glyph's data bytes depends on the font
* file format. For TrueType, it must correspond to the raw bytes within
* the `glyf' table. For PostScript formats, it must correspond to the
* *unencrypted* charstring bytes, without any `lenIV' header. It is
* undefined for any other format.
*
* @input:
* incremental ::
* Handle to an opaque @FT_Incremental handle provided by the client
* application.
*
* glyph_index ::
* Index of relevant glyph.
*
* @output:
* adata ::
* A structure describing the returned glyph data bytes (which will be
* accessed as a read-only byte block).
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If this function returns successfully the method
* @FT_Incremental_FreeGlyphDataFunc will be called later to release
* the data bytes.
*
* Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
* compound glyphs.
*
*/
typedef FT_Error
(*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental,
FT_UInt glyph_index,
FT_Data* adata );
 
 
/***************************************************************************
*
* @type:
* FT_Incremental_FreeGlyphDataFunc
*
* @description:
* A function used to release the glyph data bytes returned by a
* successful call to @FT_Incremental_GetGlyphDataFunc.
*
* @input:
* incremental ::
* A handle to an opaque @FT_Incremental handle provided by the client
* application.
*
* data ::
* A structure describing the glyph data bytes (which will be accessed
* as a read-only byte block).
*
*/
typedef void
(*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental,
FT_Data* data );
 
 
/***************************************************************************
*
* @type:
* FT_Incremental_GetGlyphMetricsFunc
*
* @description:
* A function used to retrieve the basic metrics of a given glyph index
* before accessing its data. This is necessary because, in certain
* formats like TrueType, the metrics are stored in a different place from
* the glyph images proper.
*
* @input:
* incremental ::
* A handle to an opaque @FT_Incremental handle provided by the client
* application.
*
* glyph_index ::
* Index of relevant glyph.
*
* vertical ::
* If true, return vertical metrics.
*
* ametrics ::
* This parameter is used for both input and output.
* The original glyph metrics, if any, in font units. If metrics are
* not available all the values must be set to zero.
*
* @output:
* ametrics ::
* The replacement glyph metrics in font units.
*
*/
typedef FT_Error
(*FT_Incremental_GetGlyphMetricsFunc)
( FT_Incremental incremental,
FT_UInt glyph_index,
FT_Bool vertical,
FT_Incremental_MetricsRec *ametrics );
 
 
/**************************************************************************
*
* @struct:
* FT_Incremental_FuncsRec
*
* @description:
* A table of functions for accessing fonts that load data
* incrementally. Used in @FT_Incremental_InterfaceRec.
*
* @fields:
* get_glyph_data ::
* The function to get glyph data. Must not be null.
*
* free_glyph_data ::
* The function to release glyph data. Must not be null.
*
* get_glyph_metrics ::
* The function to get glyph metrics. May be null if the font does
* not provide overriding glyph metrics.
*
*/
typedef struct FT_Incremental_FuncsRec_
{
FT_Incremental_GetGlyphDataFunc get_glyph_data;
FT_Incremental_FreeGlyphDataFunc free_glyph_data;
FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics;
 
} FT_Incremental_FuncsRec;
 
 
/***************************************************************************
*
* @struct:
* FT_Incremental_InterfaceRec
*
* @description:
* A structure to be used with @FT_Open_Face to indicate that the user
* wants to support incremental glyph loading. You should use it with
* @FT_PARAM_TAG_INCREMENTAL as in the following example:
*
* {
* FT_Incremental_InterfaceRec inc_int;
* FT_Parameter parameter;
* FT_Open_Args open_args;
*
*
* // set up incremental descriptor
* inc_int.funcs = my_funcs;
* inc_int.object = my_object;
*
* // set up optional parameter
* parameter.tag = FT_PARAM_TAG_INCREMENTAL;
* parameter.data = &inc_int;
*
* // set up FT_Open_Args structure
* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
* open_args.pathname = my_font_pathname;
* open_args.num_params = 1;
* open_args.params = &parameter; // we use one optional argument
*
* // open the font
* error = FT_Open_Face( library, &open_args, index, &face );
* ...
* }
*
*/
typedef struct FT_Incremental_InterfaceRec_
{
const FT_Incremental_FuncsRec* funcs;
FT_Incremental object;
 
} FT_Incremental_InterfaceRec;
 
 
/***************************************************************************
*
* @type:
* FT_Incremental_Interface
*
* @description:
* A pointer to an @FT_Incremental_InterfaceRec structure.
*
*/
typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
 
 
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_INCREMENTAL
*
* @description:
* A constant used as the tag of @FT_Parameter structures to indicate
* an incremental loading object to be used by FreeType.
*
*/
#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
 
/* */
 
FT_END_HEADER
 
#endif /* __FTINCREM_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftlcdfil.h
0,0 → 1,213
/***************************************************************************/
/* */
/* ftlcdfil.h */
/* */
/* FreeType API for color filtering of subpixel bitmap glyphs */
/* (specification). */
/* */
/* Copyright 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FT_LCD_FILTER_H__
#define __FT_LCD_FILTER_H__
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
/***************************************************************************
*
* @section:
* lcd_filtering
*
* @title:
* LCD Filtering
*
* @abstract:
* Reduce color fringes of LCD-optimized bitmaps.
*
* @description:
* The @FT_Library_SetLcdFilter API can be used to specify a low-pass
* filter which is then applied to LCD-optimized bitmaps generated
* through @FT_Render_Glyph. This is useful to reduce color fringes
* which would occur with unfiltered rendering.
*
* Note that no filter is active by default, and that this function is
* *not* implemented in default builds of the library. You need to
* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
* in order to activate it.
*/
 
 
/****************************************************************************
*
* @enum:
* FT_LcdFilter
*
* @description:
* A list of values to identify various types of LCD filters.
*
* @values:
* FT_LCD_FILTER_NONE ::
* Do not perform filtering. When used with subpixel rendering, this
* results in sometimes severe color fringes.
*
* FT_LCD_FILTER_DEFAULT ::
* The default filter reduces color fringes considerably, at the cost
* of a slight blurriness in the output.
*
* FT_LCD_FILTER_LIGHT ::
* The light filter is a variant that produces less blurriness at the
* cost of slightly more color fringes than the default one. It might
* be better, depending on taste, your monitor, or your personal vision.
*
* FT_LCD_FILTER_LEGACY ::
* This filter corresponds to the original libXft color filter. It
* provides high contrast output but can exhibit really bad color
* fringes if glyphs are not extremely well hinted to the pixel grid.
* In other words, it only works well if the TrueType bytecode
* interpreter is enabled *and* high-quality hinted fonts are used.
*
* This filter is only provided for comparison purposes, and might be
* disabled or stay unsupported in the future.
*
* @since:
* 2.3.0
*/
typedef enum FT_LcdFilter_
{
FT_LCD_FILTER_NONE = 0,
FT_LCD_FILTER_DEFAULT = 1,
FT_LCD_FILTER_LIGHT = 2,
FT_LCD_FILTER_LEGACY = 16,
 
FT_LCD_FILTER_MAX /* do not remove */
 
} FT_LcdFilter;
 
 
/**************************************************************************
*
* @func:
* FT_Library_SetLcdFilter
*
* @description:
* This function is used to apply color filtering to LCD decimated
* bitmaps, like the ones used when calling @FT_Render_Glyph with
* @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
*
* @input:
* library ::
* A handle to the target library instance.
*
* filter ::
* The filter type.
*
* You can use @FT_LCD_FILTER_NONE here to disable this feature, or
* @FT_LCD_FILTER_DEFAULT to use a default filter that should work
* well on most LCD screens.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This feature is always disabled by default. Clients must make an
* explicit call to this function with a `filter' value other than
* @FT_LCD_FILTER_NONE in order to enable it.
*
* Due to *PATENTS* covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature' if the
* configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
*
* The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
* @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.
*
* It does _not_ affect the output of @FT_Outline_Render and
* @FT_Outline_Get_Bitmap.
*
* If this feature is activated, the dimensions of LCD glyph bitmaps are
* either larger or taller than the dimensions of the corresponding
* outline with regards to the pixel grid. For example, for
* @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and
* up to 3~pixels to the right.
*
* The bitmap offset values are adjusted correctly, so clients shouldn't
* need to modify their layout and glyph positioning code when enabling
* the filter.
*
* @since:
* 2.3.0
*/
FT_EXPORT( FT_Error )
FT_Library_SetLcdFilter( FT_Library library,
FT_LcdFilter filter );
 
 
/**************************************************************************
*
* @func:
* FT_Library_SetLcdFilterWeights
*
* @description:
* Use this function to override the filter weights selected by
* @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple
* (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,
* 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and
* FT_LCD_FILTER_LEGACY.
*
* @input:
* library ::
* A handle to the target library instance.
*
* weights ::
* A pointer to an array; the function copies the first five bytes and
* uses them to specify the filter weights.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* Due to *PATENTS* covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature' if the
* configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
*
* This function must be called after @FT_Library_SetLcdFilter to have
* any effect.
*
* @since:
* 2.4.0
*/
FT_EXPORT( FT_Error )
FT_Library_SetLcdFilterWeights( FT_Library library,
unsigned char *weights );
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FT_LCD_FILTER_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftlist.h
0,0 → 1,277
/***************************************************************************/
/* */
/* ftlist.h */
/* */
/* Generic list support for FreeType (specification). */
/* */
/* Copyright 1996-2001, 2003, 2007, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* This file implements functions relative to list processing. Its */
/* data structures are defined in `freetype.h'. */
/* */
/*************************************************************************/
 
 
#ifndef __FTLIST_H__
#define __FTLIST_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* list_processing */
/* */
/* <Title> */
/* List Processing */
/* */
/* <Abstract> */
/* Simple management of lists. */
/* */
/* <Description> */
/* This section contains various definitions related to list */
/* processing using doubly-linked nodes. */
/* */
/* <Order> */
/* FT_List */
/* FT_ListNode */
/* FT_ListRec */
/* FT_ListNodeRec */
/* */
/* FT_List_Add */
/* FT_List_Insert */
/* FT_List_Find */
/* FT_List_Remove */
/* FT_List_Up */
/* FT_List_Iterate */
/* FT_List_Iterator */
/* FT_List_Finalize */
/* FT_List_Destructor */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Find */
/* */
/* <Description> */
/* Find the list node for a given listed object. */
/* */
/* <Input> */
/* list :: A pointer to the parent list. */
/* data :: The address of the listed object. */
/* */
/* <Return> */
/* List node. NULL if it wasn't found. */
/* */
FT_EXPORT( FT_ListNode )
FT_List_Find( FT_List list,
void* data );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Add */
/* */
/* <Description> */
/* Append an element to the end of a list. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* node :: The node to append. */
/* */
FT_EXPORT( void )
FT_List_Add( FT_List list,
FT_ListNode node );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Insert */
/* */
/* <Description> */
/* Insert an element at the head of a list. */
/* */
/* <InOut> */
/* list :: A pointer to parent list. */
/* node :: The node to insert. */
/* */
FT_EXPORT( void )
FT_List_Insert( FT_List list,
FT_ListNode node );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Remove */
/* */
/* <Description> */
/* Remove a node from a list. This function doesn't check whether */
/* the node is in the list! */
/* */
/* <Input> */
/* node :: The node to remove. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* */
FT_EXPORT( void )
FT_List_Remove( FT_List list,
FT_ListNode node );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Up */
/* */
/* <Description> */
/* Move a node to the head/top of a list. Used to maintain LRU */
/* lists. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* node :: The node to move. */
/* */
FT_EXPORT( void )
FT_List_Up( FT_List list,
FT_ListNode node );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_List_Iterator */
/* */
/* <Description> */
/* An FT_List iterator function which is called during a list parse */
/* by @FT_List_Iterate. */
/* */
/* <Input> */
/* node :: The current iteration list node. */
/* */
/* user :: A typeless pointer passed to @FT_List_Iterate. */
/* Can be used to point to the iteration's state. */
/* */
typedef FT_Error
(*FT_List_Iterator)( FT_ListNode node,
void* user );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Iterate */
/* */
/* <Description> */
/* Parse a list and calls a given iterator function on each element. */
/* Note that parsing is stopped as soon as one of the iterator calls */
/* returns a non-zero value. */
/* */
/* <Input> */
/* list :: A handle to the list. */
/* iterator :: An iterator function, called on each node of the list. */
/* user :: A user-supplied field which is passed as the second */
/* argument to the iterator. */
/* */
/* <Return> */
/* The result (a FreeType error code) of the last iterator call. */
/* */
FT_EXPORT( FT_Error )
FT_List_Iterate( FT_List list,
FT_List_Iterator iterator,
void* user );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_List_Destructor */
/* */
/* <Description> */
/* An @FT_List iterator function which is called during a list */
/* finalization by @FT_List_Finalize to destroy all elements in a */
/* given list. */
/* */
/* <Input> */
/* system :: The current system object. */
/* */
/* data :: The current object to destroy. */
/* */
/* user :: A typeless pointer passed to @FT_List_Iterate. It can */
/* be used to point to the iteration's state. */
/* */
typedef void
(*FT_List_Destructor)( FT_Memory memory,
void* data,
void* user );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Finalize */
/* */
/* <Description> */
/* Destroy all elements in the list as well as the list itself. */
/* */
/* <Input> */
/* list :: A handle to the list. */
/* */
/* destroy :: A list destructor that will be applied to each element */
/* of the list. */
/* */
/* memory :: The current memory object which handles deallocation. */
/* */
/* user :: A user-supplied field which is passed as the last */
/* argument to the destructor. */
/* */
/* <Note> */
/* This function expects that all nodes added by @FT_List_Add or */
/* @FT_List_Insert have been dynamically allocated. */
/* */
FT_EXPORT( void )
FT_List_Finalize( FT_List list,
FT_List_Destructor destroy,
FT_Memory memory,
void* user );
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTLIST_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftlzw.h
0,0 → 1,99
/***************************************************************************/
/* */
/* ftlzw.h */
/* */
/* LZW-compressed stream support. */
/* */
/* Copyright 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTLZW_H__
#define __FTLZW_H__
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
/*************************************************************************/
/* */
/* <Section> */
/* lzw */
/* */
/* <Title> */
/* LZW Streams */
/* */
/* <Abstract> */
/* Using LZW-compressed font files. */
/* */
/* <Description> */
/* This section contains the declaration of LZW-specific functions. */
/* */
/*************************************************************************/
 
/************************************************************************
*
* @function:
* FT_Stream_OpenLZW
*
* @description:
* Open a new stream to parse LZW-compressed font files. This is
* mainly used to support the compressed `*.pcf.Z' fonts that come
* with XFree86.
*
* @input:
* stream :: The target embedding stream.
*
* source :: The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream
*
* In certain builds of the library, LZW compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a LZW stream from it
* and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with LZW support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenLZW( FT_Stream stream,
FT_Stream source );
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTLZW_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftmac.h
0,0 → 1,274
/***************************************************************************/
/* */
/* ftmac.h */
/* */
/* Additional Mac-specific API. */
/* */
/* Copyright 1996-2001, 2004, 2006, 2007 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/***************************************************************************/
/* */
/* NOTE: Include this file after <freetype/freetype.h> and after any */
/* Mac-specific headers (because this header uses Mac types such as */
/* Handle, FSSpec, FSRef, etc.) */
/* */
/***************************************************************************/
 
 
#ifndef __FTMAC_H__
#define __FTMAC_H__
 
 
#include <ft2build.h>
 
 
FT_BEGIN_HEADER
 
 
/* gcc-3.4.1 and later can warn about functions tagged as deprecated */
#ifndef FT_DEPRECATED_ATTRIBUTE
#if defined(__GNUC__) && \
((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#else
#define FT_DEPRECATED_ATTRIBUTE
#endif
#endif
 
 
/*************************************************************************/
/* */
/* <Section> */
/* mac_specific */
/* */
/* <Title> */
/* Mac Specific Interface */
/* */
/* <Abstract> */
/* Only available on the Macintosh. */
/* */
/* <Description> */
/* The following definitions are only available if FreeType is */
/* compiled on a Macintosh. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FOND */
/* */
/* <Description> */
/* Create a new face object from a FOND resource. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* fond :: A FOND resource. */
/* */
/* face_index :: Only supported for the -1 `sanity check' special */
/* case. */
/* */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Notes> */
/* This function can be used to create @FT_Face objects from fonts */
/* that are installed in the system as follows. */
/* */
/* { */
/* fond = GetResource( 'FOND', fontName ); */
/* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
/* } */
/* */
FT_EXPORT( FT_Error )
FT_New_Face_From_FOND( FT_Library library,
Handle fond,
FT_Long face_index,
FT_Face *aface )
FT_DEPRECATED_ATTRIBUTE;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFile_From_Mac_Name */
/* */
/* <Description> */
/* Return an FSSpec for the disk file containing the named font. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font (e.g., Times New Roman */
/* Bold). */
/* */
/* <Output> */
/* pathSpec :: FSSpec to the file. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* face_index :: Index of the face. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_Name( const char* fontName,
FSSpec* pathSpec,
FT_Long* face_index )
FT_DEPRECATED_ATTRIBUTE;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFile_From_Mac_ATS_Name */
/* */
/* <Description> */
/* Return an FSSpec for the disk file containing the named font. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font in ATS framework. */
/* */
/* <Output> */
/* pathSpec :: FSSpec to the file. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* face_index :: Index of the face. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_ATS_Name( const char* fontName,
FSSpec* pathSpec,
FT_Long* face_index )
FT_DEPRECATED_ATTRIBUTE;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFilePath_From_Mac_ATS_Name */
/* */
/* <Description> */
/* Return a pathname of the disk file and face index for given font */
/* name which is handled by ATS framework. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font in ATS framework. */
/* */
/* <Output> */
/* path :: Buffer to store pathname of the file. For passing */
/* to @FT_New_Face. The client must allocate this */
/* buffer before calling this function. */
/* */
/* maxPathSize :: Lengths of the buffer `path' that client allocated. */
/* */
/* face_index :: Index of the face. For passing to @FT_New_Face. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
UInt8* path,
UInt32 maxPathSize,
FT_Long* face_index )
FT_DEPRECATED_ATTRIBUTE;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FSSpec */
/* */
/* <Description> */
/* Create a new face object from a given resource and typeface index */
/* using an FSSpec to the font file. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* spec :: FSSpec to the font file. */
/* */
/* face_index :: The index of the face within the resource. The */
/* first face has index~0. */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
/* it accepts an FSSpec instead of a path. */
/* */
FT_EXPORT( FT_Error )
FT_New_Face_From_FSSpec( FT_Library library,
const FSSpec *spec,
FT_Long face_index,
FT_Face *aface )
FT_DEPRECATED_ATTRIBUTE;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FSRef */
/* */
/* <Description> */
/* Create a new face object from a given resource and typeface index */
/* using an FSRef to the font file. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* spec :: FSRef to the font file. */
/* */
/* face_index :: The index of the face within the resource. The */
/* first face has index~0. */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
/* it accepts an FSRef instead of a path. */
/* */
FT_EXPORT( FT_Error )
FT_New_Face_From_FSRef( FT_Library library,
const FSRef *ref,
FT_Long face_index,
FT_Face *aface )
FT_DEPRECATED_ATTRIBUTE;
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __FTMAC_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftmm.h
0,0 → 1,378
/***************************************************************************/
/* */
/* ftmm.h */
/* */
/* FreeType Multiple Master font interface (specification). */
/* */
/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTMM_H__
#define __FTMM_H__
 
 
#include <ft2build.h>
#include FT_TYPE1_TABLES_H
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* multiple_masters */
/* */
/* <Title> */
/* Multiple Masters */
/* */
/* <Abstract> */
/* How to manage Multiple Masters fonts. */
/* */
/* <Description> */
/* The following types and functions are used to manage Multiple */
/* Master fonts, i.e., the selection of specific design instances by */
/* setting design axis coordinates. */
/* */
/* George Williams has extended this interface to make it work with */
/* both Type~1 Multiple Masters fonts and GX distortable (var) */
/* fonts. Some of these routines only work with MM fonts, others */
/* will work with both types. They are similar enough that a */
/* consistent interface makes sense. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_MM_Axis */
/* */
/* <Description> */
/* A simple structure used to model a given axis in design space for */
/* Multiple Masters fonts. */
/* */
/* This structure can't be used for GX var fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
/* */
/* minimum :: The axis's minimum design coordinate. */
/* */
/* maximum :: The axis's maximum design coordinate. */
/* */
typedef struct FT_MM_Axis_
{
FT_String* name;
FT_Long minimum;
FT_Long maximum;
 
} FT_MM_Axis;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Multi_Master */
/* */
/* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */
/* font. */
/* */
/* This structure can't be used for GX var fonts. */
/* */
/* <Fields> */
/* num_axis :: Number of axes. Cannot exceed~4. */
/* */
/* num_designs :: Number of designs; should be normally 2^num_axis */
/* even though the Type~1 specification strangely */
/* allows for intermediate designs to be present. This */
/* number cannot exceed~16. */
/* */
/* axis :: A table of axis descriptors. */
/* */
typedef struct FT_Multi_Master_
{
FT_UInt num_axis;
FT_UInt num_designs;
FT_MM_Axis axis[T1_MAX_MM_AXIS];
 
} FT_Multi_Master;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Var_Axis */
/* */
/* <Description> */
/* A simple structure used to model a given axis in design space for */
/* Multiple Masters and GX var fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
/* Not always meaningful for GX. */
/* */
/* minimum :: The axis's minimum design coordinate. */
/* */
/* def :: The axis's default design coordinate. */
/* FreeType computes meaningful default values for MM; it */
/* is then an integer value, not in 16.16 format. */
/* */
/* maximum :: The axis's maximum design coordinate. */
/* */
/* tag :: The axis's tag (the GX equivalent to `name'). */
/* FreeType provides default values for MM if possible. */
/* */
/* strid :: The entry in `name' table (another GX version of */
/* `name'). */
/* Not meaningful for MM. */
/* */
typedef struct FT_Var_Axis_
{
FT_String* name;
 
FT_Fixed minimum;
FT_Fixed def;
FT_Fixed maximum;
 
FT_ULong tag;
FT_UInt strid;
 
} FT_Var_Axis;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Var_Named_Style */
/* */
/* <Description> */
/* A simple structure used to model a named style in a GX var font. */
/* */
/* This structure can't be used for MM fonts. */
/* */
/* <Fields> */
/* coords :: The design coordinates for this style. */
/* This is an array with one entry for each axis. */
/* */
/* strid :: The entry in `name' table identifying this style. */
/* */
typedef struct FT_Var_Named_Style_
{
FT_Fixed* coords;
FT_UInt strid;
 
} FT_Var_Named_Style;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_MM_Var */
/* */
/* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */
/* or GX var distortable font. */
/* */
/* Some fields are specific to one format and not to the other. */
/* */
/* <Fields> */
/* num_axis :: The number of axes. The maximum value is~4 for */
/* MM; no limit in GX. */
/* */
/* num_designs :: The number of designs; should be normally */
/* 2^num_axis for MM fonts. Not meaningful for GX */
/* (where every glyph could have a different */
/* number of designs). */
/* */
/* num_namedstyles :: The number of named styles; only meaningful for */
/* GX which allows certain design coordinates to */
/* have a string ID (in the `name' table) */
/* associated with them. The font can tell the */
/* user that, for example, Weight=1.5 is `Bold'. */
/* */
/* axis :: A table of axis descriptors. */
/* GX fonts contain slightly more data than MM. */
/* */
/* namedstyles :: A table of named styles. */
/* Only meaningful with GX. */
/* */
typedef struct FT_MM_Var_
{
FT_UInt num_axis;
FT_UInt num_designs;
FT_UInt num_namedstyles;
FT_Var_Axis* axis;
FT_Var_Named_Style* namedstyle;
 
} FT_MM_Var;
 
 
/* */
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Multi_Master */
/* */
/* <Description> */
/* Retrieve the Multiple Master descriptor of a given font. */
/* */
/* This function can't be used with GX fonts. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Output> */
/* amaster :: The Multiple Masters descriptor. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master *amaster );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_MM_Var */
/* */
/* <Description> */
/* Retrieve the Multiple Master/GX var descriptor of a given font. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Output> */
/* amaster :: The Multiple Masters/GX var descriptor. */
/* Allocates a data structure, which the user must free */
/* (a single call to FT_FREE will do it). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Get_MM_Var( FT_Face face,
FT_MM_Var* *amaster );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Design_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters fonts, choose an interpolated font design */
/* through design coordinates. */
/* */
/* This function can't be used with GX fonts. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */
/* */
/* coords :: An array of design coordinates. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Var_Design_Coordinates */
/* */
/* <Description> */
/* For Multiple Master or GX Var fonts, choose an interpolated font */
/* design through design coordinates. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */
/* */
/* coords :: An array of design coordinates. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Blend_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters and GX var fonts, choose an interpolated font */
/* design through normalized blend coordinates. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */
/* */
/* coords :: The design coordinates array (each element must be */
/* between 0 and 1.0). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Var_Blend_Coordinates */
/* */
/* <Description> */
/* This is another name of @FT_Set_MM_Blend_Coordinates. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Var_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTMM_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftmodapi.h
0,0 → 1,483
/***************************************************************************/
/* */
/* ftmodapi.h */
/* */
/* FreeType modules public interface (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTMODAPI_H__
#define __FTMODAPI_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* module_management */
/* */
/* <Title> */
/* Module Management */
/* */
/* <Abstract> */
/* How to add, upgrade, and remove modules from FreeType. */
/* */
/* <Description> */
/* The definitions below are used to manage modules within FreeType. */
/* Modules can be added, upgraded, and removed at runtime. */
/* */
/*************************************************************************/
 
 
/* module bit flags */
#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */
#define FT_MODULE_RENDERER 2 /* this module is a renderer */
#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */
#define FT_MODULE_STYLER 8 /* this module is a styler */
 
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
/* scalable fonts */
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
/* support vector outlines */
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
/* own hinter */
 
 
/* deprecated values */
#define ft_module_font_driver FT_MODULE_FONT_DRIVER
#define ft_module_renderer FT_MODULE_RENDERER
#define ft_module_hinter FT_MODULE_HINTER
#define ft_module_styler FT_MODULE_STYLER
 
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
 
 
typedef FT_Pointer FT_Module_Interface;
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Module_Constructor */
/* */
/* <Description> */
/* A function used to initialize (not create) a new module object. */
/* */
/* <Input> */
/* module :: The module to initialize. */
/* */
typedef FT_Error
(*FT_Module_Constructor)( FT_Module module );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Module_Destructor */
/* */
/* <Description> */
/* A function used to finalize (not destroy) a given module object. */
/* */
/* <Input> */
/* module :: The module to finalize. */
/* */
typedef void
(*FT_Module_Destructor)( FT_Module module );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Module_Requester */
/* */
/* <Description> */
/* A function used to query a given module for a specific interface. */
/* */
/* <Input> */
/* module :: The module to finalize. */
/* */
/* name :: The name of the interface in the module. */
/* */
typedef FT_Module_Interface
(*FT_Module_Requester)( FT_Module module,
const char* name );
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Module_Class */
/* */
/* <Description> */
/* The module class descriptor. */
/* */
/* <Fields> */
/* module_flags :: Bit flags describing the module. */
/* */
/* module_size :: The size of one module object/instance in */
/* bytes. */
/* */
/* module_name :: The name of the module. */
/* */
/* module_version :: The version, as a 16.16 fixed number */
/* (major.minor). */
/* */
/* module_requires :: The version of FreeType this module requires, */
/* as a 16.16 fixed number (major.minor). Starts */
/* at version 2.0, i.e., 0x20000. */
/* */
/* module_init :: The initializing function. */
/* */
/* module_done :: The finalizing function. */
/* */
/* get_interface :: The interface requesting function. */
/* */
typedef struct FT_Module_Class_
{
FT_ULong module_flags;
FT_Long module_size;
const FT_String* module_name;
FT_Fixed module_version;
FT_Fixed module_requires;
 
const void* module_interface;
 
FT_Module_Constructor module_init;
FT_Module_Destructor module_done;
FT_Module_Requester get_interface;
 
} FT_Module_Class;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Add_Module */
/* */
/* <Description> */
/* Add a new module to a given library instance. */
/* */
/* <InOut> */
/* library :: A handle to the library object. */
/* */
/* <Input> */
/* clazz :: A pointer to class descriptor for the module. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* An error will be returned if a module already exists by that name, */
/* or if the module requires a version of FreeType that is too great. */
/* */
FT_EXPORT( FT_Error )
FT_Add_Module( FT_Library library,
const FT_Module_Class* clazz );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Module */
/* */
/* <Description> */
/* Find a module by its name. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* module_name :: The module's name (as an ASCII string). */
/* */
/* <Return> */
/* A module handle. 0~if none was found. */
/* */
/* <Note> */
/* FreeType's internal modules aren't documented very well, and you */
/* should look up the source code for details. */
/* */
FT_EXPORT( FT_Module )
FT_Get_Module( FT_Library library,
const char* module_name );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Remove_Module */
/* */
/* <Description> */
/* Remove a given module from a library instance. */
/* */
/* <InOut> */
/* library :: A handle to a library object. */
/* */
/* <Input> */
/* module :: A handle to a module object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The module object is destroyed by the function in case of success. */
/* */
FT_EXPORT( FT_Error )
FT_Remove_Module( FT_Library library,
FT_Module module );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Reference_Library */
/* */
/* <Description> */
/* A counter gets initialized to~1 at the time an @FT_Library */
/* structure is created. This function increments the counter. */
/* @FT_Done_Library then only destroys a library if the counter is~1, */
/* otherwise it simply decrements the counter. */
/* */
/* This function helps in managing life-cycles of structures which */
/* reference @FT_Library objects. */
/* */
/* <Input> */
/* library :: A handle to a target library object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Since> */
/* 2.4.2 */
/* */
FT_EXPORT( FT_Error )
FT_Reference_Library( FT_Library library );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Library */
/* */
/* <Description> */
/* This function is used to create a new FreeType library instance */
/* from a given memory object. It is thus possible to use libraries */
/* with distinct memory allocators within the same program. */
/* */
/* Normally, you would call this function (followed by a call to */
/* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
/* instead of @FT_Init_FreeType to initialize the FreeType library. */
/* */
/* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */
/* library instance. */
/* */
/* <Input> */
/* memory :: A handle to the original memory object. */
/* */
/* <Output> */
/* alibrary :: A pointer to handle of a new library object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* See the discussion of reference counters in the description of */
/* @FT_Reference_Library. */
/* */
FT_EXPORT( FT_Error )
FT_New_Library( FT_Memory memory,
FT_Library *alibrary );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_Library */
/* */
/* <Description> */
/* Discard a given library object. This closes all drivers and */
/* discards all resource objects. */
/* */
/* <Input> */
/* library :: A handle to the target library. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* See the discussion of reference counters in the description of */
/* @FT_Reference_Library. */
/* */
FT_EXPORT( FT_Error )
FT_Done_Library( FT_Library library );
 
/* */
 
typedef void
(*FT_DebugHook_Func)( void* arg );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Debug_Hook */
/* */
/* <Description> */
/* Set a debug hook function for debugging the interpreter of a font */
/* format. */
/* */
/* <InOut> */
/* library :: A handle to the library object. */
/* */
/* <Input> */
/* hook_index :: The index of the debug hook. You should use the */
/* values defined in `ftobjs.h', e.g., */
/* `FT_DEBUG_HOOK_TRUETYPE'. */
/* */
/* debug_hook :: The function used to debug the interpreter. */
/* */
/* <Note> */
/* Currently, four debug hook slots are available, but only two (for */
/* the TrueType and the Type~1 interpreter) are defined. */
/* */
/* Since the internal headers of FreeType are no longer installed, */
/* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */
/* This is a bug and will be fixed in a forthcoming release. */
/* */
FT_EXPORT( void )
FT_Set_Debug_Hook( FT_Library library,
FT_UInt hook_index,
FT_DebugHook_Func debug_hook );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Add_Default_Modules */
/* */
/* <Description> */
/* Add the set of default drivers to a given library object. */
/* This is only useful when you create a library object with */
/* @FT_New_Library (usually to plug a custom memory manager). */
/* */
/* <InOut> */
/* library :: A handle to a new library object. */
/* */
FT_EXPORT( void )
FT_Add_Default_Modules( FT_Library library );
 
 
 
/**************************************************************************
*
* @section:
* truetype_engine
*
* @title:
* The TrueType Engine
*
* @abstract:
* TrueType bytecode support.
*
* @description:
* This section contains a function used to query the level of TrueType
* bytecode support compiled in this version of the library.
*
*/
 
 
/**************************************************************************
*
* @enum:
* FT_TrueTypeEngineType
*
* @description:
* A list of values describing which kind of TrueType bytecode
* engine is implemented in a given FT_Library instance. It is used
* by the @FT_Get_TrueType_Engine_Type function.
*
* @values:
* FT_TRUETYPE_ENGINE_TYPE_NONE ::
* The library doesn't implement any kind of bytecode interpreter.
*
* FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
* The library implements a bytecode interpreter that doesn't
* support the patented operations of the TrueType virtual machine.
*
* Its main use is to load certain Asian fonts which position and
* scale glyph components with bytecode instructions. It produces
* bad output for most other fonts.
*
* FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
* The library implements a bytecode interpreter that covers
* the full instruction set of the TrueType virtual machine (this
* was governed by patents until May 2010, hence the name).
*
* @since:
* 2.2
*
*/
typedef enum FT_TrueTypeEngineType_
{
FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
FT_TRUETYPE_ENGINE_TYPE_PATENTED
 
} FT_TrueTypeEngineType;
 
 
/**************************************************************************
*
* @func:
* FT_Get_TrueType_Engine_Type
*
* @description:
* Return an @FT_TrueTypeEngineType value to indicate which level of
* the TrueType virtual machine a given library instance supports.
*
* @input:
* library ::
* A library instance.
*
* @return:
* A value indicating which level is supported.
*
* @since:
* 2.2
*
*/
FT_EXPORT( FT_TrueTypeEngineType )
FT_Get_TrueType_Engine_Type( FT_Library library );
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTMODAPI_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftmoderr.h
0,0 → 1,155
/***************************************************************************/
/* */
/* ftmoderr.h */
/* */
/* FreeType module error offsets (specification). */
/* */
/* Copyright 2001, 2002, 2003, 2004, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* This file is used to define the FreeType module error offsets. */
/* */
/* The lower byte gives the error code, the higher byte gives the */
/* module. The base module has error offset 0. For example, the error */
/* `FT_Err_Invalid_File_Format' has value 0x003, the error */
/* `TT_Err_Invalid_File_Format' has value 0x1103, the error */
/* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */
/* */
/* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */
/* to make the higher byte always zero (disabling the module error */
/* mechanism). */
/* */
/* It can also be used to create a module error message table easily */
/* with something like */
/* */
/* { */
/* #undef __FTMODERR_H__ */
/* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
/* #define FT_MODERR_START_LIST { */
/* #define FT_MODERR_END_LIST { 0, 0 } }; */
/* */
/* const struct */
/* { */
/* int mod_err_offset; */
/* const char* mod_err_msg */
/* } ft_mod_errors[] = */
/* */
/* #include FT_MODULE_ERRORS_H */
/* } */
/* */
/* To use such a table, all errors must be ANDed with 0xFF00 to remove */
/* the error code. */
/* */
/*************************************************************************/
 
 
#ifndef __FTMODERR_H__
#define __FTMODERR_H__
 
 
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** SETUP MACROS *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
 
 
#undef FT_NEED_EXTERN_C
 
#ifndef FT_MODERRDEF
 
#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v,
#else
#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0,
#endif
 
#define FT_MODERR_START_LIST enum {
#define FT_MODERR_END_LIST FT_Mod_Err_Max };
 
#ifdef __cplusplus
#define FT_NEED_EXTERN_C
extern "C" {
#endif
 
#endif /* !FT_MODERRDEF */
 
 
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** LIST MODULE ERROR BASES *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
 
 
#ifdef FT_MODERR_START_LIST
FT_MODERR_START_LIST
#endif
 
 
FT_MODERRDEF( Base, 0x000, "base module" )
FT_MODERRDEF( Autofit, 0x100, "autofitter module" )
FT_MODERRDEF( BDF, 0x200, "BDF module" )
FT_MODERRDEF( Cache, 0x300, "cache module" )
FT_MODERRDEF( CFF, 0x400, "CFF module" )
FT_MODERRDEF( CID, 0x500, "CID module" )
FT_MODERRDEF( Gzip, 0x600, "Gzip module" )
FT_MODERRDEF( LZW, 0x700, "LZW module" )
FT_MODERRDEF( OTvalid, 0x800, "OpenType validation module" )
FT_MODERRDEF( PCF, 0x900, "PCF module" )
FT_MODERRDEF( PFR, 0xA00, "PFR module" )
FT_MODERRDEF( PSaux, 0xB00, "PS auxiliary module" )
FT_MODERRDEF( PShinter, 0xC00, "PS hinter module" )
FT_MODERRDEF( PSnames, 0xD00, "PS names module" )
FT_MODERRDEF( Raster, 0xE00, "raster module" )
FT_MODERRDEF( SFNT, 0xF00, "SFNT module" )
FT_MODERRDEF( Smooth, 0x1000, "smooth raster module" )
FT_MODERRDEF( TrueType, 0x1100, "TrueType module" )
FT_MODERRDEF( Type1, 0x1200, "Type 1 module" )
FT_MODERRDEF( Type42, 0x1300, "Type 42 module" )
FT_MODERRDEF( Winfonts, 0x1400, "Windows FON/FNT module" )
 
 
#ifdef FT_MODERR_END_LIST
FT_MODERR_END_LIST
#endif
 
 
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** CLEANUP *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
 
 
#ifdef FT_NEED_EXTERN_C
}
#endif
 
#undef FT_MODERR_START_LIST
#undef FT_MODERR_END_LIST
#undef FT_MODERRDEF
#undef FT_NEED_EXTERN_C
 
 
#endif /* __FTMODERR_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftnameid.h
0,0 → 1,628
/*******************************************************************
*
* ftnameid.h
*
* TrueType Name ID definitions
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
******************************************************************/
 
#ifndef FREETYPE_H
#error "Don't include this file! Use freetype.h instead."
#endif
 
#ifndef FTNAMEID_H
#define FTNAMEID_H
 
/*
* possible values for the 'Platform' identifier code in the name
* records of the TTF "name" table
*/
 
#define TT_PLATFORM_APPLE_UNICODE 0
#define TT_PLATFORM_MACINTOSH 1
#define TT_PLATFORM_ISO 2
#define TT_PLATFORM_MICROSOFT 3
 
 
/*
* possible values of the platform specific encoding identifier field in
* the name records of the TTF "name" table when the 'Platform' identifier
* code is TT_PLATFORM_APPLE_UNICODE
*/
 
#define TT_APPLE_ID_DEFAULT 0
#define TT_APPLE_ID_UNICODE_1_1 1
#define TT_APPLE_ID_ISO_10646 2
#define TT_APPLE_ID_UNICODE_2_0 3
 
 
/*
* possible values of the platform specific encoding identifier field in
* the name records of the TTF "name" table when the 'Platform' identifier
* code is TT_PLATFORM_MACINTOSH
*/
 
#define TT_MAC_ID_ROMAN 0
#define TT_MAC_ID_JAPANESE 1
#define TT_MAC_ID_TRADITIONAL_CHINESE 2
#define TT_MAC_ID_KOREAN 3
#define TT_MAC_ID_ARABIC 4
#define TT_MAC_ID_HEBREW 5
#define TT_MAC_ID_GREEK 6
#define TT_MAC_ID_RUSSIAN 7
#define TT_MAC_ID_RSYMBOL 8
#define TT_MAC_ID_DEVANAGARI 9
#define TT_MAC_ID_GURMUKHI 10
#define TT_MAC_ID_GUJARATI 11
#define TT_MAC_ID_ORIYA 12
#define TT_MAC_ID_BENGALI 13
#define TT_MAC_ID_TAMIL 14
#define TT_MAC_ID_TELUGU 15
#define TT_MAC_ID_KANNADA 16
#define TT_MAC_ID_MALAYALAM 17
#define TT_MAC_ID_SINHALESE 18
#define TT_MAC_ID_BURMESE 19
#define TT_MAC_ID_KHMER 20
#define TT_MAC_ID_THAI 21
#define TT_MAC_ID_LAOTIAN 22
#define TT_MAC_ID_GEORGIAN 23
#define TT_MAC_ID_ARMENIAN 24
#define TT_MAC_ID_MALDIVIAN 25
#define TT_MAC_ID_SIMPLIFIED_CHINESE 25
#define TT_MAC_ID_TIBETAN 26
#define TT_MAC_ID_MONGOLIAN 27
#define TT_MAC_ID_GEEZ 28
#define TT_MAC_ID_SLAVIC 29
#define TT_MAC_ID_VIETNAMESE 30
#define TT_MAC_ID_SINDHI 31
#define TT_MAC_ID_UNINTERP 32
 
 
/*
* possible values of the platform specific encoding identifier field in
* the name records of the TTF "name" table when the 'Platform' identifier
* code is TT_PLATFORM_ISO
*/
 
#define TT_ISO_ID_7BIT_ASCII 0
#define TT_ISO_ID_10646 1
#define TT_ISO_ID_8859_1 2
 
 
/*
* possible values of the platform specific encoding identifier field in
* the name records of the TTF "name" table when the 'Platform' identifier
* code is TT_PLATFORM_MICROSOFT
*/
 
#define TT_MS_ID_SYMBOL_CS 0
#define TT_MS_ID_UNICODE_CS 1
#define TT_MS_ID_SJIS 2
#define TT_MS_ID_GB2312 3
#define TT_MS_ID_BIG_5 4
#define TT_MS_ID_WANSUNG 5
#define TT_MS_ID_JOHAB 6
 
 
 
/*
* possible values of the language identifier field in the name records of
* the TTF "name" table when the 'Platform' identifier code is
* TT_PLATFORM_MACINTOSH
*
* the canonical source for the Apple assigned Language ID's is at
* http://fonts.apple.com/TTRefMan/RM06/Chap6name.html
*/
 
#define TT_MAC_LANGID_ENGLISH 0
#define TT_MAC_LANGID_FRENCH 1
#define TT_MAC_LANGID_GERMAN 2
#define TT_MAC_LANGID_ITALIAN 3
#define TT_MAC_LANGID_DUTCH 4
#define TT_MAC_LANGID_SWEDISH 5
#define TT_MAC_LANGID_SPANISH 6
#define TT_MAC_LANGID_DANISH 7
#define TT_MAC_LANGID_PORTUGUESE 8
#define TT_MAC_LANGID_NORWEGIAN 9
#define TT_MAC_LANGID_HEBREW 10
#define TT_MAC_LANGID_JAPANESE 11
#define TT_MAC_LANGID_ARABIC 12
#define TT_MAC_LANGID_FINNISH 13
#define TT_MAC_LANGID_GREEK 14
#define TT_MAC_LANGID_ICELANDIC 15
#define TT_MAC_LANGID_MALTESE 16
#define TT_MAC_LANGID_TURKISH 17
#define TT_MAC_LANGID_CROATIAN 18
#define TT_MAC_LANGID_CHINESE_TRADITIONAL 19
#define TT_MAC_LANGID_URDU 20
#define TT_MAC_LANGID_HINDI 21
#define TT_MAC_LANGID_THAI 22
#define TT_MAC_LANGID_KOREAN 23
#define TT_MAC_LANGID_LITHUANIAN 24
#define TT_MAC_LANGID_POLISH 25
#define TT_MAC_LANGID_HUNGARIAN 26
#define TT_MAC_LANGID_ESTONIAN 27
#define TT_MAC_LANGID_LETTISH 28
#define TT_MAC_LANGID_SAAMISK 29
#define TT_MAC_LANGID_FAEROESE 30
#define TT_MAC_LANGID_FARSI 31
#define TT_MAC_LANGID_RUSSIAN 32
#define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33
#define TT_MAC_LANGID_FLEMISH 34
#define TT_MAC_LANGID_IRISH 35
#define TT_MAC_LANGID_ALBANIAN 36
#define TT_MAC_LANGID_ROMANIAN 37
#define TT_MAC_LANGID_CZECH 38
#define TT_MAC_LANGID_SLOVAK 39
#define TT_MAC_LANGID_SLOVENIAN 40
#define TT_MAC_LANGID_YIDDISH 41
#define TT_MAC_LANGID_SERBIAN 42
#define TT_MAC_LANGID_MACEDONIAN 43
#define TT_MAC_LANGID_BULGARIAN 44
#define TT_MAC_LANGID_UKRAINIAN 45
#define TT_MAC_LANGID_BYELORUSSIAN 46
#define TT_MAC_LANGID_UZBEK 47
#define TT_MAC_LANGID_KAZAKH 48
#define TT_MAC_LANGID_AZERBAIJANI 49
#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50
#define TT_MAC_LANGID_ARMENIAN 51
#define TT_MAC_LANGID_GEORGIAN 52
#define TT_MAC_LANGID_MOLDAVIAN 53
#define TT_MAC_LANGID_KIRGHIZ 54
#define TT_MAC_LANGID_TAJIKI 55
#define TT_MAC_LANGID_TURKMEN 56
#define TT_MAC_LANGID_MONGOLIAN 57
#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58
#define TT_MAC_LANGID_PASHTO 59
#define TT_MAC_LANGID_KURDISH 60
#define TT_MAC_LANGID_KASHMIRI 61
#define TT_MAC_LANGID_SINDHI 62
#define TT_MAC_LANGID_TIBETAN 63
#define TT_MAC_LANGID_NEPALI 64
#define TT_MAC_LANGID_SANSKRIT 65
#define TT_MAC_LANGID_MARATHI 66
#define TT_MAC_LANGID_BENGALI 67
#define TT_MAC_LANGID_ASSAMESE 68
#define TT_MAC_LANGID_GUJARATI 69
#define TT_MAC_LANGID_PUNJABI 70
#define TT_MAC_LANGID_ORIYA 71
#define TT_MAC_LANGID_MALAYALAM 72
#define TT_MAC_LANGID_KANNADA 73
#define TT_MAC_LANGID_TAMIL 74
#define TT_MAC_LANGID_TELUGU 75
#define TT_MAC_LANGID_SINHALESE 76
#define TT_MAC_LANGID_BURMESE 77
#define TT_MAC_LANGID_KHMER 78
#define TT_MAC_LANGID_LAO 79
#define TT_MAC_LANGID_VIETNAMESE 80
#define TT_MAC_LANGID_INDONESIAN 81
#define TT_MAC_LANGID_TAGALOG 82
#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83
#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84
#define TT_MAC_LANGID_AMHARIC 85
#define TT_MAC_LANGID_TIGRINYA 86
#define TT_MAC_LANGID_GALLA 87
#define TT_MAC_LANGID_SOMALI 88
#define TT_MAC_LANGID_SWAHILI 89
#define TT_MAC_LANGID_RUANDA 90
#define TT_MAC_LANGID_RUNDI 91
#define TT_MAC_LANGID_CHEWA 92
#define TT_MAC_LANGID_MALAGASY 93
#define TT_MAC_LANGID_ESPERANTO 94
#define TT_MAC_LANGID_WELSH 128
#define TT_MAC_LANGID_BASQUE 129
#define TT_MAC_LANGID_CATALAN 130
#define TT_MAC_LANGID_LATIN 131
#define TT_MAC_LANGID_QUECHUA 132
#define TT_MAC_LANGID_GUARANI 133
#define TT_MAC_LANGID_AYMARA 134
#define TT_MAC_LANGID_TATAR 135
#define TT_MAC_LANGID_UIGHUR 136
#define TT_MAC_LANGID_DZONGKHA 137
#define TT_MAC_LANGID_JAVANESE 138
#define TT_MAC_LANGID_SUNDANESE 139
#define TT_MAC_LANGID_SCOTTISH_GAELIC 140
#define TT_MAC_LANGID_IRISH_GAELIC 141
#define TT_MAC_LANGID_BRETON 142
#define TT_MAC_LANGID_INUKTITUT 143
 
 
/*
* possible values of the language identifier field in the name records of
* the TTF "name" table when the 'Platform' identifier code is
* TT_PLATFORM_MICROSOFT
*
* the canonical source for the MS assigned LCID's is at
* http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt
*/
 
#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401
#define TT_MS_LANGID_ARABIC_IRAQ 0x0801
#define TT_MS_LANGID_ARABIC_EGYPT 0x0c01
#define TT_MS_LANGID_ARABIC_LIBYA 0x1001
#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401
#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801
#define TT_MS_LANGID_ARABIC_TUNISIA 0x1c01
#define TT_MS_LANGID_ARABIC_OMAN 0x2001
#define TT_MS_LANGID_ARABIC_YEMEN 0x2401
#define TT_MS_LANGID_ARABIC_SYRIA 0x2801
#define TT_MS_LANGID_ARABIC_JORDAN 0x2c01
#define TT_MS_LANGID_ARABIC_LEBANON 0x3001
#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401
#define TT_MS_LANGID_ARABIC_UAE 0x3801
#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3c01
#define TT_MS_LANGID_ARABIC_QATAR 0x4001
#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402
#define TT_MS_LANGID_CATALAN_SPAIN 0x0403
#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404
#define TT_MS_LANGID_CHINESE_PRC 0x0804
#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04
#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004
#define TT_MS_LANGID_CHINESE_MACAU 0x1404
#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405
#define TT_MS_LANGID_DANISH_DENMARK 0x0406
#define TT_MS_LANGID_GERMAN_GERMANY 0x0407
#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807
#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0c07
#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007
#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407
#define TT_MS_LANGID_GREEK_GREECE 0x0408
#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809
#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0c09
#define TT_MS_LANGID_ENGLISH_CANADA 0x1009
#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409
#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809
#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1c09
#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009
#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409
#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809
#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2c09
#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009
#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409
#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040a
#define TT_MS_LANGID_SPANISH_MEXICO 0x080a
#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0c0a
#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100a
#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140a
#define TT_MS_LANGID_SPANISH_PANAMA 0x180a
#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1c0a
#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200a
#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240a
#define TT_MS_LANGID_SPANISH_PERU 0x280a
#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2c0a
#define TT_MS_LANGID_SPANISH_ECUADOR 0x300a
#define TT_MS_LANGID_SPANISH_CHILE 0x340a
#define TT_MS_LANGID_SPANISH_URUGUAY 0x380a
#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3c0a
#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400a
#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440a
#define TT_MS_LANGID_SPANISH_HONDURAS 0x480a
#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a
#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a
#define TT_MS_LANGID_FINNISH_FINLAND 0x040b
#define TT_MS_LANGID_FRENCH_FRANCE 0x040c
#define TT_MS_LANGID_FRENCH_BELGIUM 0x080c
#define TT_MS_LANGID_FRENCH_CANADA 0x0c0c
#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100c
#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140c
#define TT_MS_LANGID_FRENCH_MONACO 0x180c
#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d
#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e
#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040f
#define TT_MS_LANGID_ITALIAN_ITALY 0x0410
#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810
#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411
#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412
#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812
#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413
#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813
#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414
#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814
#define TT_MS_LANGID_POLISH_POLAND 0x0415
#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416
#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816
#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417
#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418
#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419
#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819
#define TT_MS_LANGID_CROATIAN_CROATIA 0x041a
#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081a
#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0c1a
#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041b
#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041c
#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041d
#define TT_MS_LANGID_SWEDISH_FINLAND 0x081d
#define TT_MS_LANGID_THAI_THAILAND 0x041e
#define TT_MS_LANGID_TURKISH_TURKEY 0x041f
#define TT_MS_LANGID_URDU_PAKISTAN 0x0420
#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421
#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422
#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423
#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424
#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425
#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426
#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427
#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0428
#define TT_MS_LANGID_FARSI_IRAN 0x0429
#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a
#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b
#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042c
#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082c
#define TT_MS_LANGID_BASQUE_SPAIN 0x042d
#define TT_MS_LANGID_SORBIAN_GERMANY 0x042e
#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042f
#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430
#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431
#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432
#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433
#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434
#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435
#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436
#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437
#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438
#define TT_MS_LANGID_HINDI_INDIA 0x0439
#define TT_MS_LANGID_MALTESE_MALTA 0x043a
#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b
#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c
#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c
#define TT_MS_LANGID_MALAY_MALAYSIA 0x043e
#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e
#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f
#define TT_MS_LANGID_SWAHILI_KENYA 0x0441
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843
#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444
#define TT_MS_LANGID_BENGALI_INDIA 0x0445
#define TT_MS_LANGID_PUNJABI_INDIA 0x0446
#define TT_MS_LANGID_GUJARATI_INDIA 0x0447
#define TT_MS_LANGID_ORIYA_INDIA 0x0448
#define TT_MS_LANGID_TAMIL_INDIA 0x0449
#define TT_MS_LANGID_TELUGU_INDIA 0x044a
#define TT_MS_LANGID_KANNADA_INDIA 0x044b
#define TT_MS_LANGID_MALAYALAM_INDIA 0x044c
#define TT_MS_LANGID_ASSAMESE_INDIA 0x044d
#define TT_MS_LANGID_MARATHI_INDIA 0x044e
#define TT_MS_LANGID_SANSKRIT_INDIA 0x044f
#define TT_MS_LANGID_KONKANI_INDIA 0x0457
 
 
/*
* possible values of the 'Name' identifier field in the name records of
* the TTF "name" table. These values are platform independent.
*/
 
#define TT_NAME_ID_COPYRIGHT 0
#define TT_NAME_ID_FONT_FAMILY 1
#define TT_NAME_ID_FONT_SUBFAMILY 2
#define TT_NAME_ID_UNIQUE_ID 3
#define TT_NAME_ID_FULL_NAME 4
#define TT_NAME_ID_VERSION_STRING 5
#define TT_NAME_ID_PS_NAME 6
#define TT_NAME_ID_TRADEMARK 7
/* the following values are from the OpenType spec */
#define TT_NAME_ID_MANUFACTURER 8
#define TT_NAME_ID_DESIGNER 9
#define TT_NAME_ID_DESCRIPTION 10
#define TT_NAME_ID_VENDOR_URL 11
#define TT_NAME_ID_DESIGNER_URL 12
#define TT_NAME_ID_LICENSE 13
#define TT_NAME_ID_LICENSE_URL 14
/* number 15 is reserved */
#define TT_NAME_ID_PREFERRED_FAMILY 16
#define TT_NAME_ID_PREFERRED_SUBFAMILY 17
#define TT_NAME_ID_MAC_FULL_NAME 18
 
 
/*
* Bit Mask values for the Unicode Ranges from the TTF "OS2 " table.
*/
 
/* General Scripts Area */
 
/* Bit 0 C0 Controls and Basic Latin */
#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0000-U+007F */
/* Bit 1 C1 Controls and Latin-1 Supplement */
#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */
/* Bit 2 Latin Extended-A */
#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
/* Bit 3 Latin Extended-B */
#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
/* Bit 4 IPA Extensions */
#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
/* Bit 5 Spacing Modifier Letters */
#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
/* Bit 6 Combining Diacritical Marks */
#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */
/* Bit 7 Greek */
#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
/* Bit 8 is reserved (was: Greek Symbols and Coptic) */
/* Bit 9 Cyrillic */
#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
/* Bit 10 Armenian */
#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
/* Bit 11 Hebrew */
#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
/* Bit 12 is reserved (was: Hebrew Extended) */
/* Bit 13 Arabic */
#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
/* Bit 14 is reserved (was: Arabic Extended) */
/* Bit 15 Devanagari */
#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
/* Bit 16 Bengali */
#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */
/* Bit 17 Gurmukhi */
#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */
/* Bit 18 Gujarati */
#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */
/* Bit 19 Oriya */
#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */
/* Bit 20 Tamil */
#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */
/* Bit 21 Telugu */
#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */
/* Bit 22 Kannada */
#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */
/* Bit 23 Malayalam */
#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */
/* Bit 24 Thai */
#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
/* Bit 25 Lao */
#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
/* Bit 26 Georgian */
#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
/* Bit 27 is reserved (was Georgian Extended) */
/* Bit 28 Hangul Jamo */
#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
/* Bit 29 Latin Extended Additional */
#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
/* Bit 30 Greek Extended */
#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
 
/* Symbols Area */
 
/* Bit 31 General Punctuation */
#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
/* Bit 32 Superscripts And Subscripts */
#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
/* Bit 33 Currency Symbols */
#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
/* Bit 34 Combining Diacritical Marks For Symbols */
#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */
/* Bit 35 Letterlike Symbols */
#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
/* Bit 36 Number Forms */
#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
/* Bit 37 Arrows */
#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
/* Bit 38 Mathematical Operators */
#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
/* Bit 39 Miscellaneous Technical */
#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */
/* Bit 40 Control Pictures */
#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */
/* Bit 41 Optical Character Recognition */
#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */
/* Bit 42 Enclosed Alphanumerics */
#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */
/* Bit 43 Box Drawing */
#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */
/* Bit 44 Block Elements */
#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */
/* Bit 45 Geometric Shapes */
#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */
/* Bit 46 Miscellaneous Symbols */
#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
/* Bit 47 Dingbats */
#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
 
/* CJK Phonetics and Symbols Area */
 
/* Bit 48 CJK Symbols And Punctuation */
#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
/* Bit 49 Hiragana */
#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
/* Bit 50 Katakana */
#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
/* Bit 51 Bopomofo */
#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
/* Bit 52 Hangul Compatibility Jamo */
#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
/* Bit 53 CJK Miscellaneous */
#define TT_UCR_CJK_MISC (1L << 21) /* U+3190-U+319F */
/* Bit 54 Enclosed CJK Letters And Months */
#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
/* Bit 55 CJK Compatibility */
#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
 
/* Hangul Syllables Area */
 
/* Bit 56 Hangul */
#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
 
/* Surrogates Area */
 
/* Bit 57 Surrogates */
#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DFFF */
/* Bit 58 is reserved for Unicode SubRanges */
 
/* CJK Ideographs Area */
 
/* Bit 59 CJK Unified Ideographs */
#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
 
/* Private Use Area */
 
/* Bit 60 Private Use */
#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
 
/* Compatibility Area and Specials */
 
/* Bit 61 CJK Compatibility Ideographs */
#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+F900-U+FAFF */
/* Bit 62 Alphabetic Presentation Forms */
#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
/* Bit 63 Arabic Presentation Forms-A */
#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FSFF */
/* Bit 64 Combining Half Marks */
#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
/* Bit 65 CJK Compatibility Forms */
#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE30-U+FE4F */
/* Bit 66 Small Form Variants */
#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
/* Bit 67 Arabic Presentation Forms-B */
#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFF */
/* Bit 68 Halfwidth And Fullwidth Forms */
#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
/* Bit 69 Specials */
#define TT_UCR_SPECIALS (1L << 5) /* U+FEFF,
U+FFF0-U+FFFF */
/* Bit 70 Tibetan */
#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FBF */
 
 
/* Some compilers have a very limited length of identifiers. */
#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )
#define HAVE_LIMIT_ON_IDENTS
#endif
 
#ifndef HAVE_LIMIT_ON_IDENTS
 
/*
* Here some alias #defines in order to be clearer.
*
* These are not always #defined to stay within the 31 character limit
* which some compilers have.
*
* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern
* Borland compilers (read: from BC++ 3.1 on) can increase this limit.
* If you get a warning with such a compiler, use the -i40 switch.
*/
#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \
TT_UCR_ARABIC_PRESENTATIONS_A
#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \
TT_UCR_ARABIC_PRESENTATIONS_B
 
#define TT_UCR_COMBINING_DIACRITICAL_MARKS \
TT_UCR_COMBINING_DIACRITICS
#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
TT_UCR_COMBINING_DIACRITICS_SYMB
 
#endif /* ndef HAVE_LIMIT_ON_IDENTS */
 
#endif /* FTNAMEID_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ftotval.h
0,0 → 1,203
/***************************************************************************/
/* */
/* ftotval.h */
/* */
/* FreeType API for validating OpenType tables (specification). */
/* */
/* Copyright 2004, 2005, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/***************************************************************************/
/* */
/* */
/* Warning: This module might be moved to a different library in the */
/* future to avoid a tight dependency between FreeType and the */
/* OpenType specification. */
/* */
/* */
/***************************************************************************/
 
 
#ifndef __FTOTVAL_H__
#define __FTOTVAL_H__
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* ot_validation */
/* */
/* <Title> */
/* OpenType Validation */
/* */
/* <Abstract> */
/* An API to validate OpenType tables. */
/* */
/* <Description> */
/* This section contains the declaration of functions to validate */
/* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */
/* */
/*************************************************************************/
 
 
/**********************************************************************
*
* @enum:
* FT_VALIDATE_OTXXX
*
* @description:
* A list of bit-field constants used with @FT_OpenType_Validate to
* indicate which OpenType tables should be validated.
*
* @values:
* FT_VALIDATE_BASE ::
* Validate BASE table.
*
* FT_VALIDATE_GDEF ::
* Validate GDEF table.
*
* FT_VALIDATE_GPOS ::
* Validate GPOS table.
*
* FT_VALIDATE_GSUB ::
* Validate GSUB table.
*
* FT_VALIDATE_JSTF ::
* Validate JSTF table.
*
* FT_VALIDATE_MATH ::
* Validate MATH table.
*
* FT_VALIDATE_OT ::
* Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
*
*/
#define FT_VALIDATE_BASE 0x0100
#define FT_VALIDATE_GDEF 0x0200
#define FT_VALIDATE_GPOS 0x0400
#define FT_VALIDATE_GSUB 0x0800
#define FT_VALIDATE_JSTF 0x1000
#define FT_VALIDATE_MATH 0x2000
 
#define FT_VALIDATE_OT FT_VALIDATE_BASE | \
FT_VALIDATE_GDEF | \
FT_VALIDATE_GPOS | \
FT_VALIDATE_GSUB | \
FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH
 
/* */
 
/**********************************************************************
*
* @function:
* FT_OpenType_Validate
*
* @description:
* Validate various OpenType tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library which
* actually does the text layout can access those tables without
* error checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field which specifies the tables to be validated. See
* @FT_VALIDATE_OTXXX for possible values.
*
* @output:
* BASE_table ::
* A pointer to the BASE table.
*
* GDEF_table ::
* A pointer to the GDEF table.
*
* GPOS_table ::
* A pointer to the GPOS table.
*
* GSUB_table ::
* A pointer to the GSUB table.
*
* JSTF_table ::
* A pointer to the JSTF table.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with OpenType fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the five tables with
* @FT_OpenType_Free. A NULL value indicates that the table either
* doesn't exist in the font, or the application hasn't asked for
* validation.
*/
FT_EXPORT( FT_Error )
FT_OpenType_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes *BASE_table,
FT_Bytes *GDEF_table,
FT_Bytes *GPOS_table,
FT_Bytes *GSUB_table,
FT_Bytes *JSTF_table );
 
/* */
 
/**********************************************************************
*
* @function:
* FT_OpenType_Free
*
* @description:
* Free the buffer allocated by OpenType validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_OpenType_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_OpenType_Validate only.
*/
FT_EXPORT( void )
FT_OpenType_Free( FT_Face face,
FT_Bytes table );
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTOTVAL_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftoutln.h
0,0 → 1,537
/***************************************************************************/
/* */
/* ftoutln.h */
/* */
/* Support for the FT_Outline type used to store glyph shapes of */
/* most scalable font formats (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTOUTLN_H__
#define __FTOUTLN_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* outline_processing */
/* */
/* <Title> */
/* Outline Processing */
/* */
/* <Abstract> */
/* Functions to create, transform, and render vectorial glyph images. */
/* */
/* <Description> */
/* This section contains routines used to create and destroy scalable */
/* glyph images known as `outlines'. These can also be measured, */
/* transformed, and converted into bitmaps and pixmaps. */
/* */
/* <Order> */
/* FT_Outline */
/* FT_OUTLINE_FLAGS */
/* FT_Outline_New */
/* FT_Outline_Done */
/* FT_Outline_Copy */
/* FT_Outline_Translate */
/* FT_Outline_Transform */
/* FT_Outline_Embolden */
/* FT_Outline_Reverse */
/* FT_Outline_Check */
/* */
/* FT_Outline_Get_CBox */
/* FT_Outline_Get_BBox */
/* */
/* FT_Outline_Get_Bitmap */
/* FT_Outline_Render */
/* */
/* FT_Outline_Decompose */
/* FT_Outline_Funcs */
/* FT_Outline_MoveTo_Func */
/* FT_Outline_LineTo_Func */
/* FT_Outline_ConicTo_Func */
/* FT_Outline_CubicTo_Func */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Decompose */
/* */
/* <Description> */
/* Walk over an outline's structure to decompose it into individual */
/* segments and Bézier arcs. This function also emits `move to' */
/* operations to indicate the start of new contours in the outline. */
/* */
/* <Input> */
/* outline :: A pointer to the source target. */
/* */
/* func_interface :: A table of `emitters', i.e., function pointers */
/* called during decomposition to indicate path */
/* operations. */
/* */
/* <InOut> */
/* user :: A typeless pointer which is passed to each */
/* emitter during the decomposition. It can be */
/* used to store the state during the */
/* decomposition. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Decompose( FT_Outline* outline,
const FT_Outline_Funcs* func_interface,
void* user );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_New */
/* */
/* <Description> */
/* Create a new outline of a given size. */
/* */
/* <Input> */
/* library :: A handle to the library object from where the */
/* outline is allocated. Note however that the new */
/* outline will *not* necessarily be *freed*, when */
/* destroying the library, by @FT_Done_FreeType. */
/* */
/* numPoints :: The maximal number of points within the outline. */
/* */
/* numContours :: The maximal number of contours within the outline. */
/* */
/* <Output> */
/* anoutline :: A handle to the new outline. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The reason why this function takes a `library' parameter is simply */
/* to use the library's memory allocator. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_New( FT_Library library,
FT_UInt numPoints,
FT_Int numContours,
FT_Outline *anoutline );
 
 
FT_EXPORT( FT_Error )
FT_Outline_New_Internal( FT_Memory memory,
FT_UInt numPoints,
FT_Int numContours,
FT_Outline *anoutline );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Done */
/* */
/* <Description> */
/* Destroy an outline created with @FT_Outline_New. */
/* */
/* <Input> */
/* library :: A handle of the library object used to allocate the */
/* outline. */
/* */
/* outline :: A pointer to the outline object to be discarded. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* If the outline's `owner' field is not set, only the outline */
/* descriptor will be released. */
/* */
/* The reason why this function takes an `library' parameter is */
/* simply to use ft_mem_free(). */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Done( FT_Library library,
FT_Outline* outline );
 
 
FT_EXPORT( FT_Error )
FT_Outline_Done_Internal( FT_Memory memory,
FT_Outline* outline );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Check */
/* */
/* <Description> */
/* Check the contents of an outline descriptor. */
/* */
/* <Input> */
/* outline :: A handle to a source outline. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Check( FT_Outline* outline );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Get_CBox */
/* */
/* <Description> */
/* Return an outline's `control box'. The control box encloses all */
/* the outline's points, including Bézier control points. Though it */
/* coincides with the exact bounding box for most glyphs, it can be */
/* slightly larger in some situations (like when rotating an outline */
/* which contains Bézier outside arcs). */
/* */
/* Computing the control box is very fast, while getting the bounding */
/* box can take much more time as it needs to walk over all segments */
/* and arcs in the outline. To get the latter, you can use the */
/* `ftbbox' component which is dedicated to this single task. */
/* */
/* <Input> */
/* outline :: A pointer to the source outline descriptor. */
/* */
/* <Output> */
/* acbox :: The outline's control box. */
/* */
FT_EXPORT( void )
FT_Outline_Get_CBox( const FT_Outline* outline,
FT_BBox *acbox );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Translate */
/* */
/* <Description> */
/* Apply a simple translation to the points of an outline. */
/* */
/* <InOut> */
/* outline :: A pointer to the target outline descriptor. */
/* */
/* <Input> */
/* xOffset :: The horizontal offset. */
/* */
/* yOffset :: The vertical offset. */
/* */
FT_EXPORT( void )
FT_Outline_Translate( const FT_Outline* outline,
FT_Pos xOffset,
FT_Pos yOffset );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Copy */
/* */
/* <Description> */
/* Copy an outline into another one. Both objects must have the */
/* same sizes (number of points & number of contours) when this */
/* function is called. */
/* */
/* <Input> */
/* source :: A handle to the source outline. */
/* */
/* <Output> */
/* target :: A handle to the target outline. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Copy( const FT_Outline* source,
FT_Outline *target );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Transform */
/* */
/* <Description> */
/* Apply a simple 2x2 matrix to all of an outline's points. Useful */
/* for applying rotations, slanting, flipping, etc. */
/* */
/* <InOut> */
/* outline :: A pointer to the target outline descriptor. */
/* */
/* <Input> */
/* matrix :: A pointer to the transformation matrix. */
/* */
/* <Note> */
/* You can use @FT_Outline_Translate if you need to translate the */
/* outline's points. */
/* */
FT_EXPORT( void )
FT_Outline_Transform( const FT_Outline* outline,
const FT_Matrix* matrix );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Embolden */
/* */
/* <Description> */
/* Embolden an outline. The new outline will be at most 4~times */
/* `strength' pixels wider and higher. You may think of the left and */
/* bottom borders as unchanged. */
/* */
/* Negative `strength' values to reduce the outline thickness are */
/* possible also. */
/* */
/* <InOut> */
/* outline :: A handle to the target outline. */
/* */
/* <Input> */
/* strength :: How strong the glyph is emboldened. Expressed in */
/* 26.6 pixel format. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The used algorithm to increase or decrease the thickness of the */
/* glyph doesn't change the number of points; this means that certain */
/* situations like acute angles or intersections are sometimes */
/* handled incorrectly. */
/* */
/* If you need `better' metrics values you should call */
/* @FT_Outline_Get_CBox ot @FT_Outline_Get_BBox. */
/* */
/* Example call: */
/* */
/* { */
/* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */
/* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */
/* FT_Outline_Embolden( &face->slot->outline, strength ); */
/* } */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Embolden( FT_Outline* outline,
FT_Pos strength );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Reverse */
/* */
/* <Description> */
/* Reverse the drawing direction of an outline. This is used to */
/* ensure consistent fill conventions for mirrored glyphs. */
/* */
/* <InOut> */
/* outline :: A pointer to the target outline descriptor. */
/* */
/* <Note> */
/* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */
/* the outline's `flags' field. */
/* */
/* It shouldn't be used by a normal client application, unless it */
/* knows what it is doing. */
/* */
FT_EXPORT( void )
FT_Outline_Reverse( FT_Outline* outline );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Get_Bitmap */
/* */
/* <Description> */
/* Render an outline within a bitmap. The outline's image is simply */
/* OR-ed to the target bitmap. */
/* */
/* <Input> */
/* library :: A handle to a FreeType library object. */
/* */
/* outline :: A pointer to the source outline descriptor. */
/* */
/* <InOut> */
/* abitmap :: A pointer to the target bitmap descriptor. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* This function does NOT CREATE the bitmap, it only renders an */
/* outline image within the one you pass to it! Consequently, the */
/* various fields in `abitmap' should be set accordingly. */
/* */
/* It will use the raster corresponding to the default glyph format. */
/* */
/* The value of the `num_grays' field in `abitmap' is ignored. If */
/* you select the gray-level rasterizer, and you want less than 256 */
/* gray levels, you have to use @FT_Outline_Render directly. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Get_Bitmap( FT_Library library,
FT_Outline* outline,
const FT_Bitmap *abitmap );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Render */
/* */
/* <Description> */
/* Render an outline within a bitmap using the current scan-convert. */
/* This function uses an @FT_Raster_Params structure as an argument, */
/* allowing advanced features like direct composition, translucency, */
/* etc. */
/* */
/* <Input> */
/* library :: A handle to a FreeType library object. */
/* */
/* outline :: A pointer to the source outline descriptor. */
/* */
/* <InOut> */
/* params :: A pointer to an @FT_Raster_Params structure used to */
/* describe the rendering operation. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* You should know what you are doing and how @FT_Raster_Params works */
/* to use this function. */
/* */
/* The field `params.source' will be set to `outline' before the scan */
/* converter is called, which means that the value you give to it is */
/* actually ignored. */
/* */
/* The gray-level rasterizer always uses 256 gray levels. If you */
/* want less gray levels, you have to provide your own span callback. */
/* See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the */
/* @FT_Raster_Params structure for more details. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Render( FT_Library library,
FT_Outline* outline,
FT_Raster_Params* params );
 
 
/**************************************************************************
*
* @enum:
* FT_Orientation
*
* @description:
* A list of values used to describe an outline's contour orientation.
*
* The TrueType and PostScript specifications use different conventions
* to determine whether outline contours should be filled or unfilled.
*
* @values:
* FT_ORIENTATION_TRUETYPE ::
* According to the TrueType specification, clockwise contours must
* be filled, and counter-clockwise ones must be unfilled.
*
* FT_ORIENTATION_POSTSCRIPT ::
* According to the PostScript specification, counter-clockwise contours
* must be filled, and clockwise ones must be unfilled.
*
* FT_ORIENTATION_FILL_RIGHT ::
* This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
* remember that in TrueType, everything that is to the right of
* the drawing direction of a contour must be filled.
*
* FT_ORIENTATION_FILL_LEFT ::
* This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
* remember that in PostScript, everything that is to the left of
* the drawing direction of a contour must be filled.
*
* FT_ORIENTATION_NONE ::
* The orientation cannot be determined. That is, different parts of
* the glyph have different orientation.
*
*/
typedef enum FT_Orientation_
{
FT_ORIENTATION_TRUETYPE = 0,
FT_ORIENTATION_POSTSCRIPT = 1,
FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,
FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT,
FT_ORIENTATION_NONE
 
} FT_Orientation;
 
 
/**************************************************************************
*
* @function:
* FT_Outline_Get_Orientation
*
* @description:
* This function analyzes a glyph outline and tries to compute its
* fill orientation (see @FT_Orientation). This is done by computing
* the direction of each global horizontal and/or vertical extrema
* within the outline.
*
* Note that this will return @FT_ORIENTATION_TRUETYPE for empty
* outlines.
*
* @input:
* outline ::
* A handle to the source outline.
*
* @return:
* The orientation.
*
*/
FT_EXPORT( FT_Orientation )
FT_Outline_Get_Orientation( FT_Outline* outline );
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTOUTLN_H__ */
 
 
/* END */
 
 
/* Local Variables: */
/* coding: utf-8 */
/* End: */
/contrib/media/updf/include/freetype/ftpfr.h
0,0 → 1,172
/***************************************************************************/
/* */
/* ftpfr.h */
/* */
/* FreeType API for accessing PFR-specific data (specification only). */
/* */
/* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTPFR_H__
#define __FTPFR_H__
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* pfr_fonts */
/* */
/* <Title> */
/* PFR Fonts */
/* */
/* <Abstract> */
/* PFR/TrueDoc specific API. */
/* */
/* <Description> */
/* This section contains the declaration of PFR-specific functions. */
/* */
/*************************************************************************/
 
 
/**********************************************************************
*
* @function:
* FT_Get_PFR_Metrics
*
* @description:
* Return the outline and metrics resolutions of a given PFR face.
*
* @input:
* face :: Handle to the input face. It can be a non-PFR face.
*
* @output:
* aoutline_resolution ::
* Outline resolution. This is equivalent to `face->units_per_EM'
* for non-PFR fonts. Optional (parameter can be NULL).
*
* ametrics_resolution ::
* Metrics resolution. This is equivalent to `outline_resolution'
* for non-PFR fonts. Optional (parameter can be NULL).
*
* ametrics_x_scale ::
* A 16.16 fixed-point number used to scale distance expressed
* in metrics units to device sub-pixels. This is equivalent to
* `face->size->x_scale', but for metrics only. Optional (parameter
* can be NULL).
*
* ametrics_y_scale ::
* Same as `ametrics_x_scale' but for the vertical direction.
* optional (parameter can be NULL).
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If the input face is not a PFR, this function will return an error.
* However, in all cases, it will return valid values.
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Metrics( FT_Face face,
FT_UInt *aoutline_resolution,
FT_UInt *ametrics_resolution,
FT_Fixed *ametrics_x_scale,
FT_Fixed *ametrics_y_scale );
 
 
/**********************************************************************
*
* @function:
* FT_Get_PFR_Kerning
*
* @description:
* Return the kerning pair corresponding to two glyphs in a PFR face.
* The distance is expressed in metrics units, unlike the result of
* @FT_Get_Kerning.
*
* @input:
* face :: A handle to the input face.
*
* left :: Index of the left glyph.
*
* right :: Index of the right glyph.
*
* @output:
* avector :: A kerning vector.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function always return distances in original PFR metrics
* units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
* mode, which always returns distances converted to outline units.
*
* You can use the value of the `x_scale' and `y_scale' parameters
* returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Kerning( FT_Face face,
FT_UInt left,
FT_UInt right,
FT_Vector *avector );
 
 
/**********************************************************************
*
* @function:
* FT_Get_PFR_Advance
*
* @description:
* Return a given glyph advance, expressed in original metrics units,
* from a PFR font.
*
* @input:
* face :: A handle to the input face.
*
* gindex :: The glyph index.
*
* @output:
* aadvance :: The glyph advance in metrics units.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
* to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Advance( FT_Face face,
FT_UInt gindex,
FT_Pos *aadvance );
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTPFR_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftrender.h
0,0 → 1,230
/***************************************************************************/
/* */
/* ftrender.h */
/* */
/* FreeType renderer modules public interface (specification). */
/* */
/* Copyright 1996-2001, 2005, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTRENDER_H__
#define __FTRENDER_H__
 
 
#include <ft2build.h>
#include FT_MODULE_H
#include FT_GLYPH_H
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* module_management */
/* */
/*************************************************************************/
 
 
/* create a new glyph object */
typedef FT_Error
(*FT_Glyph_InitFunc)( FT_Glyph glyph,
FT_GlyphSlot slot );
 
/* destroys a given glyph object */
typedef void
(*FT_Glyph_DoneFunc)( FT_Glyph glyph );
 
typedef void
(*FT_Glyph_TransformFunc)( FT_Glyph glyph,
const FT_Matrix* matrix,
const FT_Vector* delta );
 
typedef void
(*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
FT_BBox* abbox );
 
typedef FT_Error
(*FT_Glyph_CopyFunc)( FT_Glyph source,
FT_Glyph target );
 
typedef FT_Error
(*FT_Glyph_PrepareFunc)( FT_Glyph glyph,
FT_GlyphSlot slot );
 
/* deprecated */
#define FT_Glyph_Init_Func FT_Glyph_InitFunc
#define FT_Glyph_Done_Func FT_Glyph_DoneFunc
#define FT_Glyph_Transform_Func FT_Glyph_TransformFunc
#define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc
#define FT_Glyph_Copy_Func FT_Glyph_CopyFunc
#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc
 
 
struct FT_Glyph_Class_
{
FT_Long glyph_size;
FT_Glyph_Format glyph_format;
FT_Glyph_InitFunc glyph_init;
FT_Glyph_DoneFunc glyph_done;
FT_Glyph_CopyFunc glyph_copy;
FT_Glyph_TransformFunc glyph_transform;
FT_Glyph_GetBBoxFunc glyph_bbox;
FT_Glyph_PrepareFunc glyph_prepare;
};
 
 
typedef FT_Error
(*FT_Renderer_RenderFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
FT_UInt mode,
const FT_Vector* origin );
 
typedef FT_Error
(*FT_Renderer_TransformFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
const FT_Matrix* matrix,
const FT_Vector* delta );
 
 
typedef void
(*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
FT_BBox* cbox );
 
 
typedef FT_Error
(*FT_Renderer_SetModeFunc)( FT_Renderer renderer,
FT_ULong mode_tag,
FT_Pointer mode_ptr );
 
/* deprecated identifiers */
#define FTRenderer_render FT_Renderer_RenderFunc
#define FTRenderer_transform FT_Renderer_TransformFunc
#define FTRenderer_getCBox FT_Renderer_GetCBoxFunc
#define FTRenderer_setMode FT_Renderer_SetModeFunc
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Renderer_Class */
/* */
/* <Description> */
/* The renderer module class descriptor. */
/* */
/* <Fields> */
/* root :: The root @FT_Module_Class fields. */
/* */
/* glyph_format :: The glyph image format this renderer handles. */
/* */
/* render_glyph :: A method used to render the image that is in a */
/* given glyph slot into a bitmap. */
/* */
/* transform_glyph :: A method used to transform the image that is in */
/* a given glyph slot. */
/* */
/* get_glyph_cbox :: A method used to access the glyph's cbox. */
/* */
/* set_mode :: A method used to pass additional parameters. */
/* */
/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
/* This is a pointer to its raster's class. */
/* */
typedef struct FT_Renderer_Class_
{
FT_Module_Class root;
 
FT_Glyph_Format glyph_format;
 
FT_Renderer_RenderFunc render_glyph;
FT_Renderer_TransformFunc transform_glyph;
FT_Renderer_GetCBoxFunc get_glyph_cbox;
FT_Renderer_SetModeFunc set_mode;
 
FT_Raster_Funcs* raster_class;
 
} FT_Renderer_Class;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Renderer */
/* */
/* <Description> */
/* Retrieve the current renderer for a given glyph format. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* format :: The glyph format. */
/* */
/* <Return> */
/* A renderer handle. 0~if none found. */
/* */
/* <Note> */
/* An error will be returned if a module already exists by that name, */
/* or if the module requires a version of FreeType that is too great. */
/* */
/* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
/* renderer by its name, use @FT_Get_Module. */
/* */
FT_EXPORT( FT_Renderer )
FT_Get_Renderer( FT_Library library,
FT_Glyph_Format format );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Renderer */
/* */
/* <Description> */
/* Set the current renderer to use, and set additional mode. */
/* */
/* <InOut> */
/* library :: A handle to the library object. */
/* */
/* <Input> */
/* renderer :: A handle to the renderer object. */
/* */
/* num_params :: The number of additional parameters. */
/* */
/* parameters :: Additional parameters. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* In case of success, the renderer will be used to convert glyph */
/* images in the renderer's known format into bitmaps. */
/* */
/* This doesn't change the current renderer for other formats. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Renderer( FT_Library library,
FT_Renderer renderer,
FT_UInt num_params,
FT_Parameter* parameters );
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTRENDER_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftsizes.h
0,0 → 1,159
/***************************************************************************/
/* */
/* ftsizes.h */
/* */
/* FreeType size objects management (specification). */
/* */
/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* Typical application would normally not need to use these functions. */
/* However, they have been placed in a public API for the rare cases */
/* where they are needed. */
/* */
/*************************************************************************/
 
 
#ifndef __FTSIZES_H__
#define __FTSIZES_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* sizes_management */
/* */
/* <Title> */
/* Size Management */
/* */
/* <Abstract> */
/* Managing multiple sizes per face. */
/* */
/* <Description> */
/* When creating a new face object (e.g., with @FT_New_Face), an */
/* @FT_Size object is automatically created and used to store all */
/* pixel-size dependent information, available in the `face->size' */
/* field. */
/* */
/* It is however possible to create more sizes for a given face, */
/* mostly in order to manage several character pixel sizes of the */
/* same font family and style. See @FT_New_Size and @FT_Done_Size. */
/* */
/* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
/* modify the contents of the current `active' size; you thus need */
/* to use @FT_Activate_Size to change it. */
/* */
/* 99% of applications won't need the functions provided here, */
/* especially if they use the caching sub-system, so be cautious */
/* when using these. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Size */
/* */
/* <Description> */
/* Create a new size object from a given face object. */
/* */
/* <Input> */
/* face :: A handle to a parent face object. */
/* */
/* <Output> */
/* asize :: A handle to a new size object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* You need to call @FT_Activate_Size in order to select the new size */
/* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */
/* @FT_Load_Glyph, @FT_Load_Char, etc. */
/* */
FT_EXPORT( FT_Error )
FT_New_Size( FT_Face face,
FT_Size* size );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_Size */
/* */
/* <Description> */
/* Discard a given size object. Note that @FT_Done_Face */
/* automatically discards all size objects allocated with */
/* @FT_New_Size. */
/* */
/* <Input> */
/* size :: A handle to a target size object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Done_Size( FT_Size size );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Activate_Size */
/* */
/* <Description> */
/* Even though it is possible to create several size objects for a */
/* given face (see @FT_New_Size for details), functions like */
/* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */
/* activated last to determine the `current character pixel size'. */
/* */
/* This function can be used to `activate' a previously created size */
/* object. */
/* */
/* <Input> */
/* size :: A handle to a target size object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* If `face' is the size's parent face object, this function changes */
/* the value of `face->size' to the input size handle. */
/* */
FT_EXPORT( FT_Error )
FT_Activate_Size( FT_Size size );
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTSIZES_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftsnames.h
0,0 → 1,200
/***************************************************************************/
/* */
/* ftsnames.h */
/* */
/* Simple interface to access SFNT name tables (which are used */
/* to hold font names, copyright info, notices, etc.) (specification). */
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FT_SFNT_NAMES_H__
#define __FT_SFNT_NAMES_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* sfnt_names */
/* */
/* <Title> */
/* SFNT Names */
/* */
/* <Abstract> */
/* Access the names embedded in TrueType and OpenType files. */
/* */
/* <Description> */
/* The TrueType and OpenType specifications allow the inclusion of */
/* a special `names table' in font files. This table contains */
/* textual (and internationalized) information regarding the font, */
/* like family name, copyright, version, etc. */
/* */
/* The definitions below are used to access them if available. */
/* */
/* Note that this has nothing to do with glyph names! */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_SfntName */
/* */
/* <Description> */
/* A structure used to model an SFNT `name' table entry. */
/* */
/* <Fields> */
/* platform_id :: The platform ID for `string'. */
/* */
/* encoding_id :: The encoding ID for `string'. */
/* */
/* language_id :: The language ID for `string'. */
/* */
/* name_id :: An identifier for `string'. */
/* */
/* string :: The `name' string. Note that its format differs */
/* depending on the (platform,encoding) pair. It can */
/* be a Pascal String, a UTF-16 one, etc. */
/* */
/* Generally speaking, the string is not */
/* zero-terminated. Please refer to the TrueType */
/* specification for details. */
/* */
/* string_len :: The length of `string' in bytes. */
/* */
/* <Note> */
/* Possible values for `platform_id', `encoding_id', `language_id', */
/* and `name_id' are given in the file `ttnameid.h'. For details */
/* please refer to the TrueType or OpenType specification. */
/* */
/* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
/* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
/* */
typedef struct FT_SfntName_
{
FT_UShort platform_id;
FT_UShort encoding_id;
FT_UShort language_id;
FT_UShort name_id;
 
FT_Byte* string; /* this string is *not* null-terminated! */
FT_UInt string_len; /* in bytes */
 
} FT_SfntName;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_Name_Count */
/* */
/* <Description> */
/* Retrieve the number of name strings in the SFNT `name' table. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Return> */
/* The number of strings in the `name' table. */
/* */
FT_EXPORT( FT_UInt )
FT_Get_Sfnt_Name_Count( FT_Face face );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_Name */
/* */
/* <Description> */
/* Retrieve a string of the SFNT `name' table for a given index. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* idx :: The index of the `name' string. */
/* */
/* <Output> */
/* aname :: The indexed @FT_SfntName structure. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The `string' array returned in the `aname' structure is not */
/* null-terminated. The application should deallocate it if it is no */
/* longer in use. */
/* */
/* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
/* `name' table entries, then do a loop until you get the right */
/* platform, encoding, and name ID. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Sfnt_Name( FT_Face face,
FT_UInt idx,
FT_SfntName *aname );
 
 
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
*
* @description:
* A constant used as the tag of @FT_Parameter structures to make
* FT_Open_Face() ignore preferred family subfamily names in `name'
* table since OpenType version 1.4. For backwards compatibility with
* legacy systems which has 4-face-per-family restriction.
*
*/
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
 
 
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
*
* @description:
* A constant used as the tag of @FT_Parameter structures to make
* FT_Open_Face() ignore preferred subfamily names in `name' table since
* OpenType version 1.4. For backwards compatibility with legacy
* systems which has 4-face-per-family restriction.
*
*/
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FT_SFNT_NAMES_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftstroke.h
0,0 → 1,716
/***************************************************************************/
/* */
/* ftstroke.h */
/* */
/* FreeType path stroker (specification). */
/* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FT_STROKE_H__
#define __FT_STROKE_H__
 
#include <ft2build.h>
#include FT_OUTLINE_H
#include FT_GLYPH_H
 
 
FT_BEGIN_HEADER
 
 
/************************************************************************
*
* @section:
* glyph_stroker
*
* @title:
* Glyph Stroker
*
* @abstract:
* Generating bordered and stroked glyphs.
*
* @description:
* This component generates stroked outlines of a given vectorial
* glyph. It also allows you to retrieve the `outside' and/or the
* `inside' borders of the stroke.
*
* This can be useful to generate `bordered' glyph, i.e., glyphs
* displayed with a coloured (and anti-aliased) border around their
* shape.
*/
 
 
/**************************************************************
*
* @type:
* FT_Stroker
*
* @description:
* Opaque handler to a path stroker object.
*/
typedef struct FT_StrokerRec_* FT_Stroker;
 
 
/**************************************************************
*
* @enum:
* FT_Stroker_LineJoin
*
* @description:
* These values determine how two joining lines are rendered
* in a stroker.
*
* @values:
* FT_STROKER_LINEJOIN_ROUND ::
* Used to render rounded line joins. Circular arcs are used
* to join two lines smoothly.
*
* FT_STROKER_LINEJOIN_BEVEL ::
* Used to render beveled line joins; i.e., the two joining lines
* are extended until they intersect.
*
* FT_STROKER_LINEJOIN_MITER ::
* Same as beveled rendering, except that an additional line
* break is added if the angle between the two joining lines
* is too closed (this is useful to avoid unpleasant spikes
* in beveled rendering).
*/
typedef enum FT_Stroker_LineJoin_
{
FT_STROKER_LINEJOIN_ROUND = 0,
FT_STROKER_LINEJOIN_BEVEL,
FT_STROKER_LINEJOIN_MITER
 
} FT_Stroker_LineJoin;
 
 
/**************************************************************
*
* @enum:
* FT_Stroker_LineCap
*
* @description:
* These values determine how the end of opened sub-paths are
* rendered in a stroke.
*
* @values:
* FT_STROKER_LINECAP_BUTT ::
* The end of lines is rendered as a full stop on the last
* point itself.
*
* FT_STROKER_LINECAP_ROUND ::
* The end of lines is rendered as a half-circle around the
* last point.
*
* FT_STROKER_LINECAP_SQUARE ::
* The end of lines is rendered as a square around the
* last point.
*/
typedef enum FT_Stroker_LineCap_
{
FT_STROKER_LINECAP_BUTT = 0,
FT_STROKER_LINECAP_ROUND,
FT_STROKER_LINECAP_SQUARE
 
} FT_Stroker_LineCap;
 
 
/**************************************************************
*
* @enum:
* FT_StrokerBorder
*
* @description:
* These values are used to select a given stroke border
* in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
*
* @values:
* FT_STROKER_BORDER_LEFT ::
* Select the left border, relative to the drawing direction.
*
* FT_STROKER_BORDER_RIGHT ::
* Select the right border, relative to the drawing direction.
*
* @note:
* Applications are generally interested in the `inside' and `outside'
* borders. However, there is no direct mapping between these and the
* `left' and `right' ones, since this really depends on the glyph's
* drawing orientation, which varies between font formats.
*
* You can however use @FT_Outline_GetInsideBorder and
* @FT_Outline_GetOutsideBorder to get these.
*/
typedef enum FT_StrokerBorder_
{
FT_STROKER_BORDER_LEFT = 0,
FT_STROKER_BORDER_RIGHT
 
} FT_StrokerBorder;
 
 
/**************************************************************
*
* @function:
* FT_Outline_GetInsideBorder
*
* @description:
* Retrieve the @FT_StrokerBorder value corresponding to the
* `inside' borders of a given outline.
*
* @input:
* outline ::
* The source outline handle.
*
* @return:
* The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid
* outlines.
*/
FT_EXPORT( FT_StrokerBorder )
FT_Outline_GetInsideBorder( FT_Outline* outline );
 
 
/**************************************************************
*
* @function:
* FT_Outline_GetOutsideBorder
*
* @description:
* Retrieve the @FT_StrokerBorder value corresponding to the
* `outside' borders of a given outline.
*
* @input:
* outline ::
* The source outline handle.
*
* @return:
* The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
* outlines.
*/
FT_EXPORT( FT_StrokerBorder )
FT_Outline_GetOutsideBorder( FT_Outline* outline );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_New
*
* @description:
* Create a new stroker object.
*
* @input:
* library ::
* FreeType library handle.
*
* @output:
* astroker ::
* A new stroker object handle. NULL in case of error.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT( FT_Error )
FT_Stroker_New( FT_Library library,
FT_Stroker *astroker );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_Set
*
* @description:
* Reset a stroker object's attributes.
*
* @input:
* stroker ::
* The target stroker handle.
*
* radius ::
* The border radius.
*
* line_cap ::
* The line cap style.
*
* line_join ::
* The line join style.
*
* miter_limit ::
* The miter limit for the FT_STROKER_LINEJOIN_MITER style,
* expressed as 16.16 fixed point value.
*
* @note:
* The radius is expressed in the same units as the outline
* coordinates.
*/
FT_EXPORT( void )
FT_Stroker_Set( FT_Stroker stroker,
FT_Fixed radius,
FT_Stroker_LineCap line_cap,
FT_Stroker_LineJoin line_join,
FT_Fixed miter_limit );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_Rewind
*
* @description:
* Reset a stroker object without changing its attributes.
* You should call this function before beginning a new
* series of calls to @FT_Stroker_BeginSubPath or
* @FT_Stroker_EndSubPath.
*
* @input:
* stroker ::
* The target stroker handle.
*/
FT_EXPORT( void )
FT_Stroker_Rewind( FT_Stroker stroker );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_ParseOutline
*
* @description:
* A convenience function used to parse a whole outline with
* the stroker. The resulting outline(s) can be retrieved
* later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
*
* @input:
* stroker ::
* The target stroker handle.
*
* outline ::
* The source outline.
*
* opened ::
* A boolean. If~1, the outline is treated as an open path instead
* of a closed one.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If `opened' is~0 (the default), the outline is treated as a closed
* path, and the stroker generates two distinct `border' outlines.
*
* If `opened' is~1, the outline is processed as an open path, and the
* stroker generates a single `stroke' outline.
*
* This function calls @FT_Stroker_Rewind automatically.
*/
FT_EXPORT( FT_Error )
FT_Stroker_ParseOutline( FT_Stroker stroker,
FT_Outline* outline,
FT_Bool opened );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_BeginSubPath
*
* @description:
* Start a new sub-path in the stroker.
*
* @input:
* stroker ::
* The target stroker handle.
*
* to ::
* A pointer to the start vector.
*
* open ::
* A boolean. If~1, the sub-path is treated as an open one.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function is useful when you need to stroke a path that is
* not stored as an @FT_Outline object.
*/
FT_EXPORT( FT_Error )
FT_Stroker_BeginSubPath( FT_Stroker stroker,
FT_Vector* to,
FT_Bool open );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_EndSubPath
*
* @description:
* Close the current sub-path in the stroker.
*
* @input:
* stroker ::
* The target stroker handle.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* You should call this function after @FT_Stroker_BeginSubPath.
* If the subpath was not `opened', this function `draws' a
* single line segment to the start position when needed.
*/
FT_EXPORT( FT_Error )
FT_Stroker_EndSubPath( FT_Stroker stroker );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_LineTo
*
* @description:
* `Draw' a single line segment in the stroker's current sub-path,
* from the last position.
*
* @input:
* stroker ::
* The target stroker handle.
*
* to ::
* A pointer to the destination point.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* You should call this function between @FT_Stroker_BeginSubPath and
* @FT_Stroker_EndSubPath.
*/
FT_EXPORT( FT_Error )
FT_Stroker_LineTo( FT_Stroker stroker,
FT_Vector* to );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_ConicTo
*
* @description:
* `Draw' a single quadratic Bézier in the stroker's current sub-path,
* from the last position.
*
* @input:
* stroker ::
* The target stroker handle.
*
* control ::
* A pointer to a Bézier control point.
*
* to ::
* A pointer to the destination point.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* You should call this function between @FT_Stroker_BeginSubPath and
* @FT_Stroker_EndSubPath.
*/
FT_EXPORT( FT_Error )
FT_Stroker_ConicTo( FT_Stroker stroker,
FT_Vector* control,
FT_Vector* to );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_CubicTo
*
* @description:
* `Draw' a single cubic Bézier in the stroker's current sub-path,
* from the last position.
*
* @input:
* stroker ::
* The target stroker handle.
*
* control1 ::
* A pointer to the first Bézier control point.
*
* control2 ::
* A pointer to second Bézier control point.
*
* to ::
* A pointer to the destination point.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* You should call this function between @FT_Stroker_BeginSubPath and
* @FT_Stroker_EndSubPath.
*/
FT_EXPORT( FT_Error )
FT_Stroker_CubicTo( FT_Stroker stroker,
FT_Vector* control1,
FT_Vector* control2,
FT_Vector* to );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_GetBorderCounts
*
* @description:
* Call this function once you have finished parsing your paths
* with the stroker. It returns the number of points and
* contours necessary to export one of the `border' or `stroke'
* outlines generated by the stroker.
*
* @input:
* stroker ::
* The target stroker handle.
*
* border ::
* The border index.
*
* @output:
* anum_points ::
* The number of points.
*
* anum_contours ::
* The number of contours.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* When an outline, or a sub-path, is `closed', the stroker generates
* two independent `border' outlines, named `left' and `right'.
*
* When the outline, or a sub-path, is `opened', the stroker merges
* the `border' outlines with caps. The `left' border receives all
* points, while the `right' border becomes empty.
*
* Use the function @FT_Stroker_GetCounts instead if you want to
* retrieve the counts associated to both borders.
*/
FT_EXPORT( FT_Error )
FT_Stroker_GetBorderCounts( FT_Stroker stroker,
FT_StrokerBorder border,
FT_UInt *anum_points,
FT_UInt *anum_contours );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_ExportBorder
*
* @description:
* Call this function after @FT_Stroker_GetBorderCounts to
* export the corresponding border to your own @FT_Outline
* structure.
*
* Note that this function appends the border points and
* contours to your outline, but does not try to resize its
* arrays.
*
* @input:
* stroker ::
* The target stroker handle.
*
* border ::
* The border index.
*
* outline ::
* The target outline handle.
*
* @note:
* Always call this function after @FT_Stroker_GetBorderCounts to
* get sure that there is enough room in your @FT_Outline object to
* receive all new data.
*
* When an outline, or a sub-path, is `closed', the stroker generates
* two independent `border' outlines, named `left' and `right'
*
* When the outline, or a sub-path, is `opened', the stroker merges
* the `border' outlines with caps. The `left' border receives all
* points, while the `right' border becomes empty.
*
* Use the function @FT_Stroker_Export instead if you want to
* retrieve all borders at once.
*/
FT_EXPORT( void )
FT_Stroker_ExportBorder( FT_Stroker stroker,
FT_StrokerBorder border,
FT_Outline* outline );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_GetCounts
*
* @description:
* Call this function once you have finished parsing your paths
* with the stroker. It returns the number of points and
* contours necessary to export all points/borders from the stroked
* outline/path.
*
* @input:
* stroker ::
* The target stroker handle.
*
* @output:
* anum_points ::
* The number of points.
*
* anum_contours ::
* The number of contours.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT( FT_Error )
FT_Stroker_GetCounts( FT_Stroker stroker,
FT_UInt *anum_points,
FT_UInt *anum_contours );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_Export
*
* @description:
* Call this function after @FT_Stroker_GetBorderCounts to
* export all borders to your own @FT_Outline structure.
*
* Note that this function appends the border points and
* contours to your outline, but does not try to resize its
* arrays.
*
* @input:
* stroker ::
* The target stroker handle.
*
* outline ::
* The target outline handle.
*/
FT_EXPORT( void )
FT_Stroker_Export( FT_Stroker stroker,
FT_Outline* outline );
 
 
/**************************************************************
*
* @function:
* FT_Stroker_Done
*
* @description:
* Destroy a stroker object.
*
* @input:
* stroker ::
* A stroker handle. Can be NULL.
*/
FT_EXPORT( void )
FT_Stroker_Done( FT_Stroker stroker );
 
 
/**************************************************************
*
* @function:
* FT_Glyph_Stroke
*
* @description:
* Stroke a given outline glyph object with a given stroker.
*
* @inout:
* pglyph ::
* Source glyph handle on input, new glyph handle on output.
*
* @input:
* stroker ::
* A stroker handle.
*
* destroy ::
* A Boolean. If~1, the source glyph object is destroyed
* on success.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source glyph is untouched in case of error.
*/
FT_EXPORT( FT_Error )
FT_Glyph_Stroke( FT_Glyph *pglyph,
FT_Stroker stroker,
FT_Bool destroy );
 
 
/**************************************************************
*
* @function:
* FT_Glyph_StrokeBorder
*
* @description:
* Stroke a given outline glyph object with a given stroker, but
* only return either its inside or outside border.
*
* @inout:
* pglyph ::
* Source glyph handle on input, new glyph handle on output.
*
* @input:
* stroker ::
* A stroker handle.
*
* inside ::
* A Boolean. If~1, return the inside border, otherwise
* the outside border.
*
* destroy ::
* A Boolean. If~1, the source glyph object is destroyed
* on success.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source glyph is untouched in case of error.
*/
FT_EXPORT( FT_Error )
FT_Glyph_StrokeBorder( FT_Glyph *pglyph,
FT_Stroker stroker,
FT_Bool inside,
FT_Bool destroy );
 
/* */
 
FT_END_HEADER
 
#endif /* __FT_STROKE_H__ */
 
 
/* END */
 
 
/* Local Variables: */
/* coding: utf-8 */
/* End: */
/contrib/media/updf/include/freetype/ftsynth.h
0,0 → 1,80
/***************************************************************************/
/* */
/* ftsynth.h */
/* */
/* FreeType synthesizing code for emboldening and slanting */
/* (specification). */
/* */
/* Copyright 2000-2001, 2003, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/********* *********/
/********* WARNING, THIS IS ALPHA CODE! THIS API *********/
/********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/
/********* FREETYPE DEVELOPMENT TEAM *********/
/********* *********/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/* Main reason for not lifting the functions in this module to a */
/* `standard' API is that the used parameters for emboldening and */
/* slanting are not configurable. Consider the functions as a */
/* code resource which should be copied into the application and */
/* adapted to the particular needs. */
 
 
#ifndef __FTSYNTH_H__
#define __FTSYNTH_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
/* Embolden a glyph by a `reasonable' value (which is highly a matter of */
/* taste). This function is actually a convenience function, providing */
/* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
/* */
/* For emboldened outlines the metrics are estimates only; if you need */
/* precise values you should call @FT_Outline_Get_CBox. */
FT_EXPORT( void )
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
 
/* Slant an outline glyph to the right by about 12 degrees. */
FT_EXPORT( void )
FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
 
/* */
 
FT_END_HEADER
 
#endif /* __FTSYNTH_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftsystem.h
0,0 → 1,347
/***************************************************************************/
/* */
/* ftsystem.h */
/* */
/* FreeType low-level system interface definition (specification). */
/* */
/* Copyright 1996-2001, 2002, 2005, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTSYSTEM_H__
#define __FTSYSTEM_H__
 
 
#include <ft2build.h>
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* system_interface */
/* */
/* <Title> */
/* System Interface */
/* */
/* <Abstract> */
/* How FreeType manages memory and i/o. */
/* */
/* <Description> */
/* This section contains various definitions related to memory */
/* management and i/o access. You need to understand this */
/* information if you want to use a custom memory manager or you own */
/* i/o streams. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* M E M O R Y M A N A G E M E N T */
/* */
/*************************************************************************/
 
 
/*************************************************************************
*
* @type:
* FT_Memory
*
* @description:
* A handle to a given memory manager object, defined with an
* @FT_MemoryRec structure.
*
*/
typedef struct FT_MemoryRec_* FT_Memory;
 
 
/*************************************************************************
*
* @functype:
* FT_Alloc_Func
*
* @description:
* A function used to allocate `size' bytes from `memory'.
*
* @input:
* memory ::
* A handle to the source memory manager.
*
* size ::
* The size in bytes to allocate.
*
* @return:
* Address of new memory block. 0~in case of failure.
*
*/
typedef void*
(*FT_Alloc_Func)( FT_Memory memory,
long size );
 
 
/*************************************************************************
*
* @functype:
* FT_Free_Func
*
* @description:
* A function used to release a given block of memory.
*
* @input:
* memory ::
* A handle to the source memory manager.
*
* block ::
* The address of the target memory block.
*
*/
typedef void
(*FT_Free_Func)( FT_Memory memory,
void* block );
 
 
/*************************************************************************
*
* @functype:
* FT_Realloc_Func
*
* @description:
* A function used to re-allocate a given block of memory.
*
* @input:
* memory ::
* A handle to the source memory manager.
*
* cur_size ::
* The block's current size in bytes.
*
* new_size ::
* The block's requested new size.
*
* block ::
* The block's current address.
*
* @return:
* New block address. 0~in case of memory shortage.
*
* @note:
* In case of error, the old block must still be available.
*
*/
typedef void*
(*FT_Realloc_Func)( FT_Memory memory,
long cur_size,
long new_size,
void* block );
 
 
/*************************************************************************
*
* @struct:
* FT_MemoryRec
*
* @description:
* A structure used to describe a given memory manager to FreeType~2.
*
* @fields:
* user ::
* A generic typeless pointer for user data.
*
* alloc ::
* A pointer type to an allocation function.
*
* free ::
* A pointer type to an memory freeing function.
*
* realloc ::
* A pointer type to a reallocation function.
*
*/
struct FT_MemoryRec_
{
void* user;
FT_Alloc_Func alloc;
FT_Free_Func free;
FT_Realloc_Func realloc;
};
 
 
/*************************************************************************/
/* */
/* I / O M A N A G E M E N T */
/* */
/*************************************************************************/
 
 
/*************************************************************************
*
* @type:
* FT_Stream
*
* @description:
* A handle to an input stream.
*
*/
typedef struct FT_StreamRec_* FT_Stream;
 
 
/*************************************************************************
*
* @struct:
* FT_StreamDesc
*
* @description:
* A union type used to store either a long or a pointer. This is used
* to store a file descriptor or a `FILE*' in an input stream.
*
*/
typedef union FT_StreamDesc_
{
long value;
void* pointer;
 
} FT_StreamDesc;
 
 
/*************************************************************************
*
* @functype:
* FT_Stream_IoFunc
*
* @description:
* A function used to seek and read data from a given input stream.
*
* @input:
* stream ::
* A handle to the source stream.
*
* offset ::
* The offset of read in stream (always from start).
*
* buffer ::
* The address of the read buffer.
*
* count ::
* The number of bytes to read from the stream.
*
* @return:
* The number of bytes effectively read by the stream.
*
* @note:
* This function might be called to perform a seek or skip operation
* with a `count' of~0. A non-zero return value then indicates an
* error.
*
*/
typedef unsigned long
(*FT_Stream_IoFunc)( FT_Stream stream,
unsigned long offset,
unsigned char* buffer,
unsigned long count );
 
 
/*************************************************************************
*
* @functype:
* FT_Stream_CloseFunc
*
* @description:
* A function used to close a given input stream.
*
* @input:
* stream ::
* A handle to the target stream.
*
*/
typedef void
(*FT_Stream_CloseFunc)( FT_Stream stream );
 
 
/*************************************************************************
*
* @struct:
* FT_StreamRec
*
* @description:
* A structure used to describe an input stream.
*
* @input:
* base ::
* For memory-based streams, this is the address of the first stream
* byte in memory. This field should always be set to NULL for
* disk-based streams.
*
* size ::
* The stream size in bytes.
*
* pos ::
* The current position within the stream.
*
* descriptor ::
* This field is a union that can hold an integer or a pointer. It is
* used by stream implementations to store file descriptors or `FILE*'
* pointers.
*
* pathname ::
* This field is completely ignored by FreeType. However, it is often
* useful during debugging to use it to store the stream's filename
* (where available).
*
* read ::
* The stream's input function.
*
* close ::
* The stream's close function.
*
* memory ::
* The memory manager to use to preload frames. This is set
* internally by FreeType and shouldn't be touched by stream
* implementations.
*
* cursor ::
* This field is set and used internally by FreeType when parsing
* frames.
*
* limit ::
* This field is set and used internally by FreeType when parsing
* frames.
*
*/
typedef struct FT_StreamRec_
{
unsigned char* base;
unsigned long size;
unsigned long pos;
 
FT_StreamDesc descriptor;
FT_StreamDesc pathname;
FT_Stream_IoFunc read;
FT_Stream_CloseFunc close;
 
FT_Memory memory;
unsigned char* cursor;
unsigned char* limit;
 
} FT_StreamRec;
 
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTSYSTEM_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/fttrigon.h
0,0 → 1,350
/***************************************************************************/
/* */
/* fttrigon.h */
/* */
/* FreeType trigonometric functions (specification). */
/* */
/* Copyright 2001, 2003, 2005, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTTRIGON_H__
#define __FTTRIGON_H__
 
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* computations */
/* */
/*************************************************************************/
 
 
/*************************************************************************
*
* @type:
* FT_Angle
*
* @description:
* This type is used to model angle values in FreeType. Note that the
* angle is a 16.16 fixed float value expressed in degrees.
*
*/
typedef FT_Fixed FT_Angle;
 
 
/*************************************************************************
*
* @macro:
* FT_ANGLE_PI
*
* @description:
* The angle pi expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_PI ( 180L << 16 )
 
 
/*************************************************************************
*
* @macro:
* FT_ANGLE_2PI
*
* @description:
* The angle 2*pi expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
 
 
/*************************************************************************
*
* @macro:
* FT_ANGLE_PI2
*
* @description:
* The angle pi/2 expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
 
 
/*************************************************************************
*
* @macro:
* FT_ANGLE_PI4
*
* @description:
* The angle pi/4 expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
 
 
/*************************************************************************
*
* @function:
* FT_Sin
*
* @description:
* Return the sinus of a given angle in fixed point format.
*
* @input:
* angle ::
* The input angle.
*
* @return:
* The sinus value.
*
* @note:
* If you need both the sinus and cosinus for a given angle, use the
* function @FT_Vector_Unit.
*
*/
FT_EXPORT( FT_Fixed )
FT_Sin( FT_Angle angle );
 
 
/*************************************************************************
*
* @function:
* FT_Cos
*
* @description:
* Return the cosinus of a given angle in fixed point format.
*
* @input:
* angle ::
* The input angle.
*
* @return:
* The cosinus value.
*
* @note:
* If you need both the sinus and cosinus for a given angle, use the
* function @FT_Vector_Unit.
*
*/
FT_EXPORT( FT_Fixed )
FT_Cos( FT_Angle angle );
 
 
/*************************************************************************
*
* @function:
* FT_Tan
*
* @description:
* Return the tangent of a given angle in fixed point format.
*
* @input:
* angle ::
* The input angle.
*
* @return:
* The tangent value.
*
*/
FT_EXPORT( FT_Fixed )
FT_Tan( FT_Angle angle );
 
 
/*************************************************************************
*
* @function:
* FT_Atan2
*
* @description:
* Return the arc-tangent corresponding to a given vector (x,y) in
* the 2d plane.
*
* @input:
* x ::
* The horizontal vector coordinate.
*
* y ::
* The vertical vector coordinate.
*
* @return:
* The arc-tangent value (i.e. angle).
*
*/
FT_EXPORT( FT_Angle )
FT_Atan2( FT_Fixed x,
FT_Fixed y );
 
 
/*************************************************************************
*
* @function:
* FT_Angle_Diff
*
* @description:
* Return the difference between two angles. The result is always
* constrained to the ]-PI..PI] interval.
*
* @input:
* angle1 ::
* First angle.
*
* angle2 ::
* Second angle.
*
* @return:
* Constrained value of `value2-value1'.
*
*/
FT_EXPORT( FT_Angle )
FT_Angle_Diff( FT_Angle angle1,
FT_Angle angle2 );
 
 
/*************************************************************************
*
* @function:
* FT_Vector_Unit
*
* @description:
* Return the unit vector corresponding to a given angle. After the
* call, the value of `vec.x' will be `sin(angle)', and the value of
* `vec.y' will be `cos(angle)'.
*
* This function is useful to retrieve both the sinus and cosinus of a
* given angle quickly.
*
* @output:
* vec ::
* The address of target vector.
*
* @input:
* angle ::
* The address of angle.
*
*/
FT_EXPORT( void )
FT_Vector_Unit( FT_Vector* vec,
FT_Angle angle );
 
 
/*************************************************************************
*
* @function:
* FT_Vector_Rotate
*
* @description:
* Rotate a vector by a given angle.
*
* @inout:
* vec ::
* The address of target vector.
*
* @input:
* angle ::
* The address of angle.
*
*/
FT_EXPORT( void )
FT_Vector_Rotate( FT_Vector* vec,
FT_Angle angle );
 
 
/*************************************************************************
*
* @function:
* FT_Vector_Length
*
* @description:
* Return the length of a given vector.
*
* @input:
* vec ::
* The address of target vector.
*
* @return:
* The vector length, expressed in the same units that the original
* vector coordinates.
*
*/
FT_EXPORT( FT_Fixed )
FT_Vector_Length( FT_Vector* vec );
 
 
/*************************************************************************
*
* @function:
* FT_Vector_Polarize
*
* @description:
* Compute both the length and angle of a given vector.
*
* @input:
* vec ::
* The address of source vector.
*
* @output:
* length ::
* The vector length.
*
* angle ::
* The vector angle.
*
*/
FT_EXPORT( void )
FT_Vector_Polarize( FT_Vector* vec,
FT_Fixed *length,
FT_Angle *angle );
 
 
/*************************************************************************
*
* @function:
* FT_Vector_From_Polar
*
* @description:
* Compute vector coordinates from a length and angle.
*
* @output:
* vec ::
* The address of source vector.
*
* @input:
* length ::
* The vector length.
*
* angle ::
* The vector angle.
*
*/
FT_EXPORT( void )
FT_Vector_From_Polar( FT_Vector* vec,
FT_Fixed length,
FT_Angle angle );
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTTRIGON_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/fttypes.h
0,0 → 1,588
/***************************************************************************/
/* */
/* fttypes.h */
/* */
/* FreeType simple types definitions (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTTYPES_H__
#define __FTTYPES_H__
 
 
#include <ft2build.h>
#include FT_CONFIG_CONFIG_H
#include FT_SYSTEM_H
#include FT_IMAGE_H
 
#include <stddef.h>
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* basic_types */
/* */
/* <Title> */
/* Basic Data Types */
/* */
/* <Abstract> */
/* The basic data types defined by the library. */
/* */
/* <Description> */
/* This section contains the basic data types defined by FreeType~2, */
/* ranging from simple scalar types to bitmap descriptors. More */
/* font-specific structures are defined in a different section. */
/* */
/* <Order> */
/* FT_Byte */
/* FT_Bytes */
/* FT_Char */
/* FT_Int */
/* FT_UInt */
/* FT_Int16 */
/* FT_UInt16 */
/* FT_Int32 */
/* FT_UInt32 */
/* FT_Short */
/* FT_UShort */
/* FT_Long */
/* FT_ULong */
/* FT_Bool */
/* FT_Offset */
/* FT_PtrDist */
/* FT_String */
/* FT_Tag */
/* FT_Error */
/* FT_Fixed */
/* FT_Pointer */
/* FT_Pos */
/* FT_Vector */
/* FT_BBox */
/* FT_Matrix */
/* FT_FWord */
/* FT_UFWord */
/* FT_F2Dot14 */
/* FT_UnitVector */
/* FT_F26Dot6 */
/* */
/* */
/* FT_Generic */
/* FT_Generic_Finalizer */
/* */
/* FT_Bitmap */
/* FT_Pixel_Mode */
/* FT_Palette_Mode */
/* FT_Glyph_Format */
/* FT_IMAGE_TAG */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Bool */
/* */
/* <Description> */
/* A typedef of unsigned char, used for simple booleans. As usual, */
/* values 1 and~0 represent true and false, respectively. */
/* */
typedef unsigned char FT_Bool;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_FWord */
/* */
/* <Description> */
/* A signed 16-bit integer used to store a distance in original font */
/* units. */
/* */
typedef signed short FT_FWord; /* distance in FUnits */
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_UFWord */
/* */
/* <Description> */
/* An unsigned 16-bit integer used to store a distance in original */
/* font units. */
/* */
typedef unsigned short FT_UFWord; /* unsigned distance */
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Char */
/* */
/* <Description> */
/* A simple typedef for the _signed_ char type. */
/* */
typedef signed char FT_Char;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Byte */
/* */
/* <Description> */
/* A simple typedef for the _unsigned_ char type. */
/* */
typedef unsigned char FT_Byte;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Bytes */
/* */
/* <Description> */
/* A typedef for constant memory areas. */
/* */
typedef const FT_Byte* FT_Bytes;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Tag */
/* */
/* <Description> */
/* A typedef for 32-bit tags (as used in the SFNT format). */
/* */
typedef FT_UInt32 FT_Tag;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_String */
/* */
/* <Description> */
/* A simple typedef for the char type, usually used for strings. */
/* */
typedef char FT_String;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Short */
/* */
/* <Description> */
/* A typedef for signed short. */
/* */
typedef signed short FT_Short;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_UShort */
/* */
/* <Description> */
/* A typedef for unsigned short. */
/* */
typedef unsigned short FT_UShort;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Int */
/* */
/* <Description> */
/* A typedef for the int type. */
/* */
typedef signed int FT_Int;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt */
/* */
/* <Description> */
/* A typedef for the unsigned int type. */
/* */
typedef unsigned int FT_UInt;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Long */
/* */
/* <Description> */
/* A typedef for signed long. */
/* */
typedef signed long FT_Long;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_ULong */
/* */
/* <Description> */
/* A typedef for unsigned long. */
/* */
typedef unsigned long FT_ULong;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_F2Dot14 */
/* */
/* <Description> */
/* A signed 2.14 fixed float type used for unit vectors. */
/* */
typedef signed short FT_F2Dot14;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_F26Dot6 */
/* */
/* <Description> */
/* A signed 26.6 fixed float type used for vectorial pixel */
/* coordinates. */
/* */
typedef signed long FT_F26Dot6;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Fixed */
/* */
/* <Description> */
/* This type is used to store 16.16 fixed float values, like scaling */
/* values or matrix coefficients. */
/* */
typedef signed long FT_Fixed;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Error */
/* */
/* <Description> */
/* The FreeType error code type. A value of~0 is always interpreted */
/* as a successful operation. */
/* */
typedef int FT_Error;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Pointer */
/* */
/* <Description> */
/* A simple typedef for a typeless pointer. */
/* */
typedef void* FT_Pointer;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_Offset */
/* */
/* <Description> */
/* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */
/* _unsigned_ integer type used to express a file size or position, */
/* or a memory block size. */
/* */
typedef size_t FT_Offset;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_PtrDist */
/* */
/* <Description> */
/* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */
/* largest _signed_ integer type used to express the distance */
/* between two pointers. */
/* */
typedef ft_ptrdiff_t FT_PtrDist;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_UnitVector */
/* */
/* <Description> */
/* A simple structure used to store a 2D vector unit vector. Uses */
/* FT_F2Dot14 types. */
/* */
/* <Fields> */
/* x :: Horizontal coordinate. */
/* */
/* y :: Vertical coordinate. */
/* */
typedef struct FT_UnitVector_
{
FT_F2Dot14 x;
FT_F2Dot14 y;
 
} FT_UnitVector;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Matrix */
/* */
/* <Description> */
/* A simple structure used to store a 2x2 matrix. Coefficients are */
/* in 16.16 fixed float format. The computation performed is: */
/* */
/* { */
/* x' = x*xx + y*xy */
/* y' = x*yx + y*yy */
/* } */
/* */
/* <Fields> */
/* xx :: Matrix coefficient. */
/* */
/* xy :: Matrix coefficient. */
/* */
/* yx :: Matrix coefficient. */
/* */
/* yy :: Matrix coefficient. */
/* */
typedef struct FT_Matrix_
{
FT_Fixed xx, xy;
FT_Fixed yx, yy;
 
} FT_Matrix;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Data */
/* */
/* <Description> */
/* Read-only binary data represented as a pointer and a length. */
/* */
/* <Fields> */
/* pointer :: The data. */
/* */
/* length :: The length of the data in bytes. */
/* */
typedef struct FT_Data_
{
const FT_Byte* pointer;
FT_Int length;
 
} FT_Data;
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Generic_Finalizer */
/* */
/* <Description> */
/* Describe a function used to destroy the `client' data of any */
/* FreeType object. See the description of the @FT_Generic type for */
/* details of usage. */
/* */
/* <Input> */
/* The address of the FreeType object which is under finalization. */
/* Its client data is accessed through its `generic' field. */
/* */
typedef void (*FT_Generic_Finalizer)(void* object);
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Generic */
/* */
/* <Description> */
/* Client applications often need to associate their own data to a */
/* variety of FreeType core objects. For example, a text layout API */
/* might want to associate a glyph cache to a given size object. */
/* */
/* Most FreeType object contains a `generic' field, of type */
/* FT_Generic, which usage is left to client applications and font */
/* servers. */
/* */
/* It can be used to store a pointer to client-specific data, as well */
/* as the address of a `finalizer' function, which will be called by */
/* FreeType when the object is destroyed (for example, the previous */
/* client example would put the address of the glyph cache destructor */
/* in the `finalizer' field). */
/* */
/* <Fields> */
/* data :: A typeless pointer to any client-specified data. This */
/* field is completely ignored by the FreeType library. */
/* */
/* finalizer :: A pointer to a `generic finalizer' function, which */
/* will be called when the object is destroyed. If this */
/* field is set to NULL, no code will be called. */
/* */
typedef struct FT_Generic_
{
void* data;
FT_Generic_Finalizer finalizer;
 
} FT_Generic;
 
 
/*************************************************************************/
/* */
/* <Macro> */
/* FT_MAKE_TAG */
/* */
/* <Description> */
/* This macro converts four-letter tags which are used to label */
/* TrueType tables into an unsigned long to be used within FreeType. */
/* */
/* <Note> */
/* The produced values *must* be 32-bit integers. Don't redefine */
/* this macro. */
/* */
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
(FT_Tag) \
( ( (FT_ULong)_x1 << 24 ) | \
( (FT_ULong)_x2 << 16 ) | \
( (FT_ULong)_x3 << 8 ) | \
(FT_ULong)_x4 )
 
 
/*************************************************************************/
/*************************************************************************/
/* */
/* L I S T M A N A G E M E N T */
/* */
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Section> */
/* list_processing */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_ListNode */
/* */
/* <Description> */
/* Many elements and objects in FreeType are listed through an */
/* @FT_List record (see @FT_ListRec). As its name suggests, an */
/* FT_ListNode is a handle to a single list element. */
/* */
typedef struct FT_ListNodeRec_* FT_ListNode;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* FT_List */
/* */
/* <Description> */
/* A handle to a list record (see @FT_ListRec). */
/* */
typedef struct FT_ListRec_* FT_List;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_ListNodeRec */
/* */
/* <Description> */
/* A structure used to hold a single list element. */
/* */
/* <Fields> */
/* prev :: The previous element in the list. NULL if first. */
/* */
/* next :: The next element in the list. NULL if last. */
/* */
/* data :: A typeless pointer to the listed object. */
/* */
typedef struct FT_ListNodeRec_
{
FT_ListNode prev;
FT_ListNode next;
void* data;
 
} FT_ListNodeRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_ListRec */
/* */
/* <Description> */
/* A structure used to hold a simple doubly-linked list. These are */
/* used in many parts of FreeType. */
/* */
/* <Fields> */
/* head :: The head (first element) of doubly-linked list. */
/* */
/* tail :: The tail (last element) of doubly-linked list. */
/* */
typedef struct FT_ListRec_
{
FT_ListNode head;
FT_ListNode tail;
 
} FT_ListRec;
 
 
/* */
 
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
 
/* return base error code (without module-specific prefix) */
#define FT_ERROR_BASE( x ) ( (x) & 0xFF )
 
/* return module error code */
#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U )
 
#define FT_BOOL( x ) ( (FT_Bool)( x ) )
 
FT_END_HEADER
 
#endif /* __FTTYPES_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ftwinfnt.h
0,0 → 1,274
/***************************************************************************/
/* */
/* ftwinfnt.h */
/* */
/* FreeType API for accessing Windows fnt-specific data. */
/* */
/* Copyright 2003, 2004, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTWINFNT_H__
#define __FTWINFNT_H__
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* winfnt_fonts */
/* */
/* <Title> */
/* Window FNT Files */
/* */
/* <Abstract> */
/* Windows FNT specific API. */
/* */
/* <Description> */
/* This section contains the declaration of Windows FNT specific */
/* functions. */
/* */
/*************************************************************************/
 
 
/*************************************************************************
*
* @enum:
* FT_WinFNT_ID_XXX
*
* @description:
* A list of valid values for the `charset' byte in
* @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
* encodings (except for cp1361) can be found at ftp://ftp.unicode.org
* in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is
* roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
*
* @values:
* FT_WinFNT_ID_DEFAULT ::
* This is used for font enumeration and font creation as a
* `don't care' value. Valid font files don't contain this value.
* When querying for information about the character set of the font
* that is currently selected into a specified device context, this
* return value (of the related Windows API) simply denotes failure.
*
* FT_WinFNT_ID_SYMBOL ::
* There is no known mapping table available.
*
* FT_WinFNT_ID_MAC ::
* Mac Roman encoding.
*
* FT_WinFNT_ID_OEM ::
* From Michael Pöttgen <michael@poettgen.de>:
*
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
* is used for the charset of vector fonts, like `modern.fon',
* `roman.fon', and `script.fon' on Windows.
*
* The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
* specifies a character set that is operating-system dependent.
*
* The `IFIMETRICS' documentation from the `Windows Driver
* Development Kit' says: This font supports an OEM-specific
* character set. The OEM character set is system dependent.
*
* In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
* second default codepage that most international versions of
* Windows have. It is one of the OEM codepages from
*
* http://www.microsoft.com/globaldev/reference/cphome.mspx,
*
* and is used for the `DOS boxes', to support legacy applications.
* A German Windows version for example usually uses ANSI codepage
* 1252 and OEM codepage 850.
*
* FT_WinFNT_ID_CP874 ::
* A superset of Thai TIS 620 and ISO 8859-11.
*
* FT_WinFNT_ID_CP932 ::
* A superset of Japanese Shift-JIS (with minor deviations).
*
* FT_WinFNT_ID_CP936 ::
* A superset of simplified Chinese GB 2312-1980 (with different
* ordering and minor deviations).
*
* FT_WinFNT_ID_CP949 ::
* A superset of Korean Hangul KS~C 5601-1987 (with different
* ordering and minor deviations).
*
* FT_WinFNT_ID_CP950 ::
* A superset of traditional Chinese Big~5 ETen (with different
* ordering and minor deviations).
*
* FT_WinFNT_ID_CP1250 ::
* A superset of East European ISO 8859-2 (with slightly different
* ordering).
*
* FT_WinFNT_ID_CP1251 ::
* A superset of Russian ISO 8859-5 (with different ordering).
*
* FT_WinFNT_ID_CP1252 ::
* ANSI encoding. A superset of ISO 8859-1.
*
* FT_WinFNT_ID_CP1253 ::
* A superset of Greek ISO 8859-7 (with minor modifications).
*
* FT_WinFNT_ID_CP1254 ::
* A superset of Turkish ISO 8859-9.
*
* FT_WinFNT_ID_CP1255 ::
* A superset of Hebrew ISO 8859-8 (with some modifications).
*
* FT_WinFNT_ID_CP1256 ::
* A superset of Arabic ISO 8859-6 (with different ordering).
*
* FT_WinFNT_ID_CP1257 ::
* A superset of Baltic ISO 8859-13 (with some deviations).
*
* FT_WinFNT_ID_CP1258 ::
* For Vietnamese. This encoding doesn't cover all necessary
* characters.
*
* FT_WinFNT_ID_CP1361 ::
* Korean (Johab).
*/
 
#define FT_WinFNT_ID_CP1252 0
#define FT_WinFNT_ID_DEFAULT 1
#define FT_WinFNT_ID_SYMBOL 2
#define FT_WinFNT_ID_MAC 77
#define FT_WinFNT_ID_CP932 128
#define FT_WinFNT_ID_CP949 129
#define FT_WinFNT_ID_CP1361 130
#define FT_WinFNT_ID_CP936 134
#define FT_WinFNT_ID_CP950 136
#define FT_WinFNT_ID_CP1253 161
#define FT_WinFNT_ID_CP1254 162
#define FT_WinFNT_ID_CP1258 163
#define FT_WinFNT_ID_CP1255 177
#define FT_WinFNT_ID_CP1256 178
#define FT_WinFNT_ID_CP1257 186
#define FT_WinFNT_ID_CP1251 204
#define FT_WinFNT_ID_CP874 222
#define FT_WinFNT_ID_CP1250 238
#define FT_WinFNT_ID_OEM 255
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_WinFNT_HeaderRec */
/* */
/* <Description> */
/* Windows FNT Header info. */
/* */
typedef struct FT_WinFNT_HeaderRec_
{
FT_UShort version;
FT_ULong file_size;
FT_Byte copyright[60];
FT_UShort file_type;
FT_UShort nominal_point_size;
FT_UShort vertical_resolution;
FT_UShort horizontal_resolution;
FT_UShort ascent;
FT_UShort internal_leading;
FT_UShort external_leading;
FT_Byte italic;
FT_Byte underline;
FT_Byte strike_out;
FT_UShort weight;
FT_Byte charset;
FT_UShort pixel_width;
FT_UShort pixel_height;
FT_Byte pitch_and_family;
FT_UShort avg_width;
FT_UShort max_width;
FT_Byte first_char;
FT_Byte last_char;
FT_Byte default_char;
FT_Byte break_char;
FT_UShort bytes_per_row;
FT_ULong device_offset;
FT_ULong face_name_offset;
FT_ULong bits_pointer;
FT_ULong bits_offset;
FT_Byte reserved;
FT_ULong flags;
FT_UShort A_space;
FT_UShort B_space;
FT_UShort C_space;
FT_UShort color_table_offset;
FT_ULong reserved1[4];
 
} FT_WinFNT_HeaderRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_WinFNT_Header */
/* */
/* <Description> */
/* A handle to an @FT_WinFNT_HeaderRec structure. */
/* */
typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
 
 
/**********************************************************************
*
* @function:
* FT_Get_WinFNT_Header
*
* @description:
* Retrieve a Windows FNT font info header.
*
* @input:
* face :: A handle to the input face.
*
* @output:
* aheader :: The WinFNT header.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with Windows FNT faces, returning an error
* otherwise.
*/
FT_EXPORT( FT_Error )
FT_Get_WinFNT_Header( FT_Face face,
FT_WinFNT_HeaderRec *aheader );
 
 
/* */
 
FT_END_HEADER
 
#endif /* __FTWINFNT_H__ */
 
 
/* END */
 
 
/* Local Variables: */
/* coding: utf-8 */
/* End: */
/contrib/media/updf/include/freetype/ftxf86.h
0,0 → 1,83
/***************************************************************************/
/* */
/* ftxf86.h */
/* */
/* Support functions for X11. */
/* */
/* Copyright 2002, 2003, 2004, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTXF86_H__
#define __FTXF86_H__
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* font_formats */
/* */
/* <Title> */
/* Font Formats */
/* */
/* <Abstract> */
/* Getting the font format. */
/* */
/* <Description> */
/* The single function in this section can be used to get the font */
/* format. Note that this information is not needed normally; */
/* however, there are special cases (like in PDF devices) where it is */
/* important to differentiate, in spite of FreeType's uniform API. */
/* */
/* This function is in the X11/xf86 namespace for historical reasons */
/* and in no way depends on that windowing system. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_X11_Font_Format */
/* */
/* <Description> */
/* Return a string describing the format of a given face, using values */
/* which can be used as an X11 FONT_PROPERTY. Possible values are */
/* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */
/* `PFR', and `Windows~FNT'. */
/* */
/* <Input> */
/* face :: */
/* Input face handle. */
/* */
/* <Return> */
/* Font format string. NULL in case of error. */
/* */
FT_EXPORT( const char* )
FT_Get_X11_Font_Format( FT_Face face );
 
/* */
 
FT_END_HEADER
 
#endif /* __FTXF86_H__ */
/contrib/media/updf/include/freetype/header.h
0,0 → 1,49
/*******************************************************************
*
* Function :
*
* Description :
*
* Input :
*
* Output :
*
* Notes :
*
******************************************************************/
 
/*******************************************************************
*
* Function :
*
* Description :
*
* Input : None
*
* Output : Error code.
*
******************************************************************/
 
/*******************************************************************
*
* Function :
*
* Description :
*
******************************************************************/
 
/*******************************************************************
*
* Component Name (e.g. TTRaster.C) + eventually a version number.
*
* Component Short Description (e.g. Rasterizer).
*
* Copyright 1996 David Turner, Robert Wilhelm and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
******************************************************************/
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/internal/autohint.h
0,0 → 1,231
/***************************************************************************/
/* */
/* autohint.h */
/* */
/* High-level `autohint' module-specific interface (specification). */
/* */
/* Copyright 1996-2001, 2002, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* The auto-hinter is used to load and automatically hint glyphs if a */
/* format-specific hinter isn't available. */
/* */
/*************************************************************************/
 
 
#ifndef __AUTOHINT_H__
#define __AUTOHINT_H__
 
 
/*************************************************************************/
/* */
/* A small technical note regarding automatic hinting in order to */
/* clarify this module interface. */
/* */
/* An automatic hinter might compute two kinds of data for a given face: */
/* */
/* - global hints: Usually some metrics that describe global properties */
/* of the face. It is computed by scanning more or less */
/* aggressively the glyphs in the face, and thus can be */
/* very slow to compute (even if the size of global */
/* hints is really small). */
/* */
/* - glyph hints: These describe some important features of the glyph */
/* outline, as well as how to align them. They are */
/* generally much faster to compute than global hints. */
/* */
/* The current FreeType auto-hinter does a pretty good job while */
/* performing fast computations for both global and glyph hints. */
/* However, we might be interested in introducing more complex and */
/* powerful algorithms in the future, like the one described in the John */
/* D. Hobby paper, which unfortunately requires a lot more horsepower. */
/* */
/* Because a sufficiently sophisticated font management system would */
/* typically implement an LRU cache of opened face objects to reduce */
/* memory usage, it is a good idea to be able to avoid recomputing */
/* global hints every time the same face is re-opened. */
/* */
/* We thus provide the ability to cache global hints outside of the face */
/* object, in order to speed up font re-opening time. Of course, this */
/* feature is purely optional, so most client programs won't even notice */
/* it. */
/* */
/* I initially thought that it would be a good idea to cache the glyph */
/* hints too. However, my general idea now is that if you really need */
/* to cache these too, you are simply in need of a new font format, */
/* where all this information could be stored within the font file and */
/* decoded on the fly. */
/* */
/*************************************************************************/
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
 
FT_BEGIN_HEADER
 
 
typedef struct FT_AutoHinterRec_ *FT_AutoHinter;
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_AutoHinter_GlobalGetFunc */
/* */
/* <Description> */
/* Retrieves the global hints computed for a given face object the */
/* resulting data is dissociated from the face and will survive a */
/* call to FT_Done_Face(). It must be discarded through the API */
/* FT_AutoHinter_GlobalDoneFunc(). */
/* */
/* <Input> */
/* hinter :: A handle to the source auto-hinter. */
/* */
/* face :: A handle to the source face object. */
/* */
/* <Output> */
/* global_hints :: A typeless pointer to the global hints. */
/* */
/* global_len :: The size in bytes of the global hints. */
/* */
typedef void
(*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter,
FT_Face face,
void** global_hints,
long* global_len );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_AutoHinter_GlobalDoneFunc */
/* */
/* <Description> */
/* Discards the global hints retrieved through */
/* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints */
/* are freed from memory. */
/* */
/* <Input> */
/* hinter :: A handle to the auto-hinter module. */
/* */
/* global :: A pointer to retrieved global hints to discard. */
/* */
typedef void
(*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter,
void* global );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_AutoHinter_GlobalResetFunc */
/* */
/* <Description> */
/* This function is used to recompute the global metrics in a given */
/* font. This is useful when global font data changes (e.g. Multiple */
/* Masters fonts where blend coordinates change). */
/* */
/* <Input> */
/* hinter :: A handle to the source auto-hinter. */
/* */
/* face :: A handle to the face. */
/* */
typedef void
(*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter hinter,
FT_Face face );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_AutoHinter_GlyphLoadFunc */
/* */
/* <Description> */
/* This function is used to load, scale, and automatically hint a */
/* glyph from a given face. */
/* */
/* <Input> */
/* face :: A handle to the face. */
/* */
/* glyph_index :: The glyph index. */
/* */
/* load_flags :: The load flags. */
/* */
/* <Note> */
/* This function is capable of loading composite glyphs by hinting */
/* each sub-glyph independently (which improves quality). */
/* */
/* It will call the font driver with FT_Load_Glyph(), with */
/* FT_LOAD_NO_SCALE set. */
/* */
typedef FT_Error
(*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter,
FT_GlyphSlot slot,
FT_Size size,
FT_UInt glyph_index,
FT_Int32 load_flags );
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_AutoHinter_ServiceRec */
/* */
/* <Description> */
/* The auto-hinter module's interface. */
/* */
typedef struct FT_AutoHinter_ServiceRec_
{
FT_AutoHinter_GlobalResetFunc reset_face;
FT_AutoHinter_GlobalGetFunc get_global_hints;
FT_AutoHinter_GlobalDoneFunc done_global_hints;
FT_AutoHinter_GlyphLoadFunc load_glyph;
 
} FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service;
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \
done_global_hints_, load_glyph_) \
FT_CALLBACK_TABLE_DEF \
const FT_AutoHinter_ServiceRec class_ = \
{ \
reset_face_, get_global_hints_, done_global_hints_, load_glyph_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \
done_global_hints_, load_glyph_) \
void \
FT_Init_Class_##class_( FT_Library library, \
FT_AutoHinter_ServiceRec* clazz) \
{ \
FT_UNUSED(library); \
clazz->reset_face = reset_face_; \
clazz->get_global_hints = get_global_hints_; \
clazz->done_global_hints = done_global_hints_; \
clazz->load_glyph = load_glyph_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
FT_END_HEADER
 
#endif /* __AUTOHINT_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/ftcalc.h
0,0 → 1,179
/***************************************************************************/
/* */
/* ftcalc.h */
/* */
/* Arithmetic computations (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTCALC_H__
#define __FTCALC_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_FixedSqrt */
/* */
/* <Description> */
/* Computes the square root of a 16.16 fixed point value. */
/* */
/* <Input> */
/* x :: The value to compute the root for. */
/* */
/* <Return> */
/* The result of `sqrt(x)'. */
/* */
/* <Note> */
/* This function is not very fast. */
/* */
FT_BASE( FT_Int32 )
FT_SqrtFixed( FT_Int32 x );
 
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Sqrt32 */
/* */
/* <Description> */
/* Computes the square root of an Int32 integer (which will be */
/* handled as an unsigned long value). */
/* */
/* <Input> */
/* x :: The value to compute the root for. */
/* */
/* <Return> */
/* The result of `sqrt(x)'. */
/* */
FT_EXPORT( FT_Int32 )
FT_Sqrt32( FT_Int32 x );
 
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
 
/*************************************************************************/
/* */
/* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */
/* */
/*************************************************************************/
 
 
#ifdef TT_USE_BYTECODE_INTERPRETER
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_MulDiv_No_Round */
/* */
/* <Description> */
/* A very simple function used to perform the computation `(a*b)/c' */
/* (without rounding) with maximal accuracy (it uses a 64-bit */
/* intermediate integer whenever necessary). */
/* */
/* This function isn't necessarily as fast as some processor specific */
/* operations, but is at least completely portable. */
/* */
/* <Input> */
/* a :: The first multiplier. */
/* b :: The second multiplier. */
/* c :: The divisor. */
/* */
/* <Return> */
/* The result of `(a*b)/c'. This function never traps when trying to */
/* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
/* on the signs of `a' and `b'. */
/* */
FT_BASE( FT_Long )
FT_MulDiv_No_Round( FT_Long a,
FT_Long b,
FT_Long c );
 
#endif /* TT_USE_BYTECODE_INTERPRETER */
 
 
/*
* A variant of FT_Matrix_Multiply which scales its result afterwards.
* The idea is that both `a' and `b' are scaled by factors of 10 so that
* the values are as precise as possible to get a correct result during
* the 64bit multiplication. Let `sa' and `sb' be the scaling factors of
* `a' and `b', respectively, then the scaling factor of the result is
* `sa*sb'.
*/
FT_BASE( void )
FT_Matrix_Multiply_Scaled( const FT_Matrix* a,
FT_Matrix *b,
FT_Long scaling );
 
 
/*
* A variant of FT_Vector_Transform. See comments for
* FT_Matrix_Multiply_Scaled.
*/
 
FT_BASE( void )
FT_Vector_Transform_Scaled( FT_Vector* vector,
const FT_Matrix* matrix,
FT_Long scaling );
 
 
/*
* Return -1, 0, or +1, depending on the orientation of a given corner.
* We use the Cartesian coordinate system, with positive vertical values
* going upwards. The function returns +1 if the corner turns to the
* left, -1 to the right, and 0 for undecidable cases.
*/
FT_BASE( FT_Int )
ft_corner_orientation( FT_Pos in_x,
FT_Pos in_y,
FT_Pos out_x,
FT_Pos out_y );
 
/*
* Return TRUE if a corner is flat or nearly flat. This is equivalent to
* saying that the angle difference between the `in' and `out' vectors is
* very small.
*/
FT_BASE( FT_Int )
ft_corner_is_flat( FT_Pos in_x,
FT_Pos in_y,
FT_Pos out_x,
FT_Pos out_y );
 
 
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
#define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 )
#define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) << 2 )
#define FLOAT_TO_FIXED( x ) ( (FT_Long)( x * 65536.0 ) )
#define FIXED_TO_INT( x ) ( FT_RoundFix( x ) >> 16 )
 
#define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \
: ( -( ( 32 - (x) ) & -64 ) ) )
 
 
FT_END_HEADER
 
#endif /* __FTCALC_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/ftdebug.h
0,0 → 1,250
/***************************************************************************/
/* */
/* ftdebug.h */
/* */
/* Debugging and logging component (specification). */
/* */
/* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/* */
/* IMPORTANT: A description of FreeType's debugging support can be */
/* found in `docs/DEBUG.TXT'. Read it if you need to use or */
/* understand this code. */
/* */
/***************************************************************************/
 
 
#ifndef __FTDEBUG_H__
#define __FTDEBUG_H__
 
 
#include <ft2build.h>
#include FT_CONFIG_CONFIG_H
#include FT_FREETYPE_H
 
 
FT_BEGIN_HEADER
 
 
/* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */
/* is already defined; this simplifies the following #ifdefs */
/* */
#ifdef FT_DEBUG_LEVEL_TRACE
#undef FT_DEBUG_LEVEL_ERROR
#define FT_DEBUG_LEVEL_ERROR
#endif
 
 
/*************************************************************************/
/* */
/* Define the trace enums as well as the trace levels array when they */
/* are needed. */
/* */
/*************************************************************************/
 
#ifdef FT_DEBUG_LEVEL_TRACE
 
#define FT_TRACE_DEF( x ) trace_ ## x ,
 
/* defining the enumeration */
typedef enum FT_Trace_
{
#include FT_INTERNAL_TRACE_H
trace_count
 
} FT_Trace;
 
 
/* defining the array of trace levels, provided by `src/base/ftdebug.c' */
extern int ft_trace_levels[trace_count];
 
#undef FT_TRACE_DEF
 
#endif /* FT_DEBUG_LEVEL_TRACE */
 
 
/*************************************************************************/
/* */
/* Define the FT_TRACE macro */
/* */
/* IMPORTANT! */
/* */
/* Each component must define the macro FT_COMPONENT to a valid FT_Trace */
/* value before using any TRACE macro. */
/* */
/*************************************************************************/
 
#ifdef FT_DEBUG_LEVEL_TRACE
 
#define FT_TRACE( level, varformat ) \
do \
{ \
if ( ft_trace_levels[FT_COMPONENT] >= level ) \
FT_Message varformat; \
} while ( 0 )
 
#else /* !FT_DEBUG_LEVEL_TRACE */
 
#define FT_TRACE( level, varformat ) do { } while ( 0 ) /* nothing */
 
#endif /* !FT_DEBUG_LEVEL_TRACE */
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Trace_Get_Count */
/* */
/* <Description> */
/* Return the number of available trace components. */
/* */
/* <Return> */
/* The number of trace components. 0 if FreeType 2 is not built with */
/* FT_DEBUG_LEVEL_TRACE definition. */
/* */
/* <Note> */
/* This function may be useful if you want to access elements of */
/* the internal `ft_trace_levels' array by an index. */
/* */
FT_BASE( FT_Int )
FT_Trace_Get_Count( void );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Trace_Get_Name */
/* */
/* <Description> */
/* Return the name of a trace component. */
/* */
/* <Input> */
/* The index of the trace component. */
/* */
/* <Return> */
/* The name of the trace component. This is a statically allocated */
/* C string, so do not free it after use. NULL if FreeType 2 is not */
/* built with FT_DEBUG_LEVEL_TRACE definition. */
/* */
/* <Note> */
/* Use @FT_Trace_Get_Count to get the number of available trace */
/* components. */
/* */
/* This function may be useful if you want to control FreeType 2's */
/* debug level in your application. */
/* */
FT_BASE( const char * )
FT_Trace_Get_Name( FT_Int idx );
 
 
/*************************************************************************/
/* */
/* You need two opening and closing parentheses! */
/* */
/* Example: FT_TRACE0(( "Value is %i", foo )) */
/* */
/* Output of the FT_TRACEX macros is sent to stderr. */
/* */
/*************************************************************************/
 
#define FT_TRACE0( varformat ) FT_TRACE( 0, varformat )
#define FT_TRACE1( varformat ) FT_TRACE( 1, varformat )
#define FT_TRACE2( varformat ) FT_TRACE( 2, varformat )
#define FT_TRACE3( varformat ) FT_TRACE( 3, varformat )
#define FT_TRACE4( varformat ) FT_TRACE( 4, varformat )
#define FT_TRACE5( varformat ) FT_TRACE( 5, varformat )
#define FT_TRACE6( varformat ) FT_TRACE( 6, varformat )
#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
 
 
/*************************************************************************/
/* */
/* Define the FT_ERROR macro. */
/* */
/* Output of this macro is sent to stderr. */
/* */
/*************************************************************************/
 
#ifdef FT_DEBUG_LEVEL_ERROR
 
#define FT_ERROR( varformat ) FT_Message varformat
 
#else /* !FT_DEBUG_LEVEL_ERROR */
 
#define FT_ERROR( varformat ) do { } while ( 0 ) /* nothing */
 
#endif /* !FT_DEBUG_LEVEL_ERROR */
 
 
/*************************************************************************/
/* */
/* Define the FT_ASSERT macro. */
/* */
/*************************************************************************/
 
#ifdef FT_DEBUG_LEVEL_ERROR
 
#define FT_ASSERT( condition ) \
do \
{ \
if ( !( condition ) ) \
FT_Panic( "assertion failed on line %d of file %s\n", \
__LINE__, __FILE__ ); \
} while ( 0 )
 
#else /* !FT_DEBUG_LEVEL_ERROR */
 
#define FT_ASSERT( condition ) do { } while ( 0 )
 
#endif /* !FT_DEBUG_LEVEL_ERROR */
 
 
/*************************************************************************/
/* */
/* Define `FT_Message' and `FT_Panic' when needed. */
/* */
/*************************************************************************/
 
#ifdef FT_DEBUG_LEVEL_ERROR
 
#include "stdio.h" /* for vfprintf() */
 
/* print a message */
FT_BASE( void )
FT_Message( const char* fmt,
... );
 
/* print a message and exit */
FT_BASE( void )
FT_Panic( const char* fmt,
... );
 
#endif /* FT_DEBUG_LEVEL_ERROR */
 
 
FT_BASE( void )
ft_debug_init( void );
 
 
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
 
/* We disable the warning `conditional expression is constant' here */
/* in order to compile cleanly with the maximum level of warnings. */
#pragma warning( disable : 4127 )
 
#endif /* _MSC_VER */
 
 
FT_END_HEADER
 
#endif /* __FTDEBUG_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/ftdriver.h
0,0 → 1,422
/***************************************************************************/
/* */
/* ftdriver.h */
/* */
/* FreeType font driver interface (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTDRIVER_H__
#define __FTDRIVER_H__
 
 
#include <ft2build.h>
#include FT_MODULE_H
 
 
FT_BEGIN_HEADER
 
 
typedef FT_Error
(*FT_Face_InitFunc)( FT_Stream stream,
FT_Face face,
FT_Int typeface_index,
FT_Int num_params,
FT_Parameter* parameters );
 
typedef void
(*FT_Face_DoneFunc)( FT_Face face );
 
 
typedef FT_Error
(*FT_Size_InitFunc)( FT_Size size );
 
typedef void
(*FT_Size_DoneFunc)( FT_Size size );
 
 
typedef FT_Error
(*FT_Slot_InitFunc)( FT_GlyphSlot slot );
 
typedef void
(*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
 
 
typedef FT_Error
(*FT_Size_RequestFunc)( FT_Size size,
FT_Size_Request req );
 
typedef FT_Error
(*FT_Size_SelectFunc)( FT_Size size,
FT_ULong size_index );
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
typedef FT_Error
(*FT_Size_ResetPointsFunc)( FT_Size size,
FT_F26Dot6 char_width,
FT_F26Dot6 char_height,
FT_UInt horz_resolution,
FT_UInt vert_resolution );
 
typedef FT_Error
(*FT_Size_ResetPixelsFunc)( FT_Size size,
FT_UInt pixel_width,
FT_UInt pixel_height );
 
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
typedef FT_Error
(*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
FT_Size size,
FT_UInt glyph_index,
FT_Int32 load_flags );
 
 
typedef FT_UInt
(*FT_CharMap_CharIndexFunc)( FT_CharMap charmap,
FT_Long charcode );
 
typedef FT_Long
(*FT_CharMap_CharNextFunc)( FT_CharMap charmap,
FT_Long charcode );
 
 
typedef FT_Error
(*FT_Face_GetKerningFunc)( FT_Face face,
FT_UInt left_glyph,
FT_UInt right_glyph,
FT_Vector* kerning );
 
 
typedef FT_Error
(*FT_Face_AttachFunc)( FT_Face face,
FT_Stream stream );
 
 
typedef FT_Error
(*FT_Face_GetAdvancesFunc)( FT_Face face,
FT_UInt first,
FT_UInt count,
FT_Int32 flags,
FT_Fixed* advances );
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Driver_ClassRec */
/* */
/* <Description> */
/* The font driver class. This structure mostly contains pointers to */
/* driver methods. */
/* */
/* <Fields> */
/* root :: The parent module. */
/* */
/* face_object_size :: The size of a face object in bytes. */
/* */
/* size_object_size :: The size of a size object in bytes. */
/* */
/* slot_object_size :: The size of a glyph object in bytes. */
/* */
/* init_face :: The format-specific face constructor. */
/* */
/* done_face :: The format-specific face destructor. */
/* */
/* init_size :: The format-specific size constructor. */
/* */
/* done_size :: The format-specific size destructor. */
/* */
/* init_slot :: The format-specific slot constructor. */
/* */
/* done_slot :: The format-specific slot destructor. */
/* */
/* */
/* load_glyph :: A function handle to load a glyph to a slot. */
/* This field is mandatory! */
/* */
/* get_kerning :: A function handle to return the unscaled */
/* kerning for a given pair of glyphs. Can be */
/* set to 0 if the format doesn't support */
/* kerning. */
/* */
/* attach_file :: This function handle is used to read */
/* additional data for a face from another */
/* file/stream. For example, this can be used to */
/* add data from AFM or PFM files on a Type 1 */
/* face, or a CIDMap on a CID-keyed face. */
/* */
/* get_advances :: A function handle used to return advance */
/* widths of `count' glyphs (in font units), */
/* starting at `first'. The `vertical' flag must */
/* be set to get vertical advance heights. The */
/* `advances' buffer is caller-allocated. */
/* Currently not implemented. The idea of this */
/* function is to be able to perform */
/* device-independent text layout without loading */
/* a single glyph image. */
/* */
/* request_size :: A handle to a function used to request the new */
/* character size. Can be set to 0 if the */
/* scaling done in the base layer suffices. */
/* */
/* select_size :: A handle to a function used to select a new */
/* fixed size. It is used only if */
/* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */
/* to 0 if the scaling done in the base layer */
/* suffices. */
/* <Note> */
/* Most function pointers, with the exception of `load_glyph', can be */
/* set to 0 to indicate a default behaviour. */
/* */
typedef struct FT_Driver_ClassRec_
{
FT_Module_Class root;
 
FT_Long face_object_size;
FT_Long size_object_size;
FT_Long slot_object_size;
 
FT_Face_InitFunc init_face;
FT_Face_DoneFunc done_face;
 
FT_Size_InitFunc init_size;
FT_Size_DoneFunc done_size;
 
FT_Slot_InitFunc init_slot;
FT_Slot_DoneFunc done_slot;
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
FT_Size_ResetPointsFunc set_char_sizes;
FT_Size_ResetPixelsFunc set_pixel_sizes;
 
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
FT_Slot_LoadFunc load_glyph;
 
FT_Face_GetKerningFunc get_kerning;
FT_Face_AttachFunc attach_file;
FT_Face_GetAdvancesFunc get_advances;
 
/* since version 2.2 */
FT_Size_RequestFunc request_size;
FT_Size_SelectFunc select_size;
 
} FT_Driver_ClassRec, *FT_Driver_Class;
 
 
/*
* The following functions are used as stubs for `set_char_sizes' and
* `set_pixel_sizes'; the code uses `request_size' and `select_size'
* functions instead.
*
* Implementation is in `src/base/ftobjs.c'.
*/
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
FT_BASE( FT_Error )
ft_stub_set_char_sizes( FT_Size size,
FT_F26Dot6 width,
FT_F26Dot6 height,
FT_UInt horz_res,
FT_UInt vert_res );
 
FT_BASE( FT_Error )
ft_stub_set_pixel_sizes( FT_Size size,
FT_UInt width,
FT_UInt height );
 
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
/*************************************************************************/
/* */
/* <Macro> */
/* FT_DECLARE_DRIVER */
/* */
/* <Description> */
/* Used to create a forward declaration of a */
/* FT_Driver_ClassRec stract instance. */
/* */
/* <Macro> */
/* FT_DEFINE_DRIVER */
/* */
/* <Description> */
/* Used to initialize an instance of FT_Driver_ClassRec struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */
/* to called with a pointer where the allocated stracture is returned.*/
/* And when it is no longer needed a Destroy function needs */
/* to be called to release that allocation. */
/* fcinit.c (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */
/* described in ftmodule.h */
/* */
/* Notice that the created Create and Destroy functions call */
/* pic_init and pic_free function to allow you to manually allocate */
/* and initialize any additional global data, like module specific */
/* interface, and put them in the global pic container defined in */
/* ftpic.h. if you don't need them just implement the functions as */
/* empty to resolve the link error. */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \
a_, b_,
#else
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_)
#endif
 
#define FT_DECLARE_DRIVER(class_) \
FT_CALLBACK_TABLE \
const FT_Driver_ClassRec class_;
 
#define FT_DEFINE_DRIVER(class_, \
flags_, size_, name_, version_, requires_, \
interface_, init_, done_, get_interface_, \
face_object_size_, size_object_size_, \
slot_object_size_, init_face_, done_face_, \
init_size_, done_size_, init_slot_, done_slot_, \
old_set_char_sizes_, old_set_pixel_sizes_, \
load_glyph_, get_kerning_, attach_file_, \
get_advances_, request_size_, select_size_ ) \
FT_CALLBACK_TABLE_DEF \
const FT_Driver_ClassRec class_ = \
{ \
FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_, \
init_,done_,get_interface_) \
\
face_object_size_, \
size_object_size_, \
slot_object_size_, \
\
init_face_, \
done_face_, \
\
init_size_, \
done_size_, \
\
init_slot_, \
done_slot_, \
\
FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \
\
load_glyph_, \
\
get_kerning_, \
attach_file_, \
get_advances_, \
\
request_size_, \
select_size_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \
clazz->set_char_sizes = a_; \
clazz->set_pixel_sizes = b_;
#else
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_)
#endif
 
#define FT_DECLARE_DRIVER(class_) FT_DECLARE_MODULE(class_)
 
#define FT_DEFINE_DRIVER(class_, \
flags_, size_, name_, version_, requires_, \
interface_, init_, done_, get_interface_, \
face_object_size_, size_object_size_, \
slot_object_size_, init_face_, done_face_, \
init_size_, done_size_, init_slot_, done_slot_, \
old_set_char_sizes_, old_set_pixel_sizes_, \
load_glyph_, get_kerning_, attach_file_, \
get_advances_, request_size_, select_size_ ) \
void class_##_pic_free( FT_Library library ); \
FT_Error class_##_pic_init( FT_Library library ); \
\
void \
FT_Destroy_Class_##class_( FT_Library library, \
FT_Module_Class* clazz ) \
{ \
FT_Memory memory = library->memory; \
FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \
class_##_pic_free( library ); \
if ( dclazz ) \
FT_FREE( dclazz ); \
} \
\
FT_Error \
FT_Create_Class_##class_( FT_Library library, \
FT_Module_Class** output_class ) \
{ \
FT_Driver_Class clazz; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \
return error; \
\
error = class_##_pic_init( library ); \
if(error) \
{ \
FT_FREE( clazz ); \
return error; \
} \
\
FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_, \
init_,done_,get_interface_) \
\
clazz->face_object_size = face_object_size_; \
clazz->size_object_size = size_object_size_; \
clazz->slot_object_size = slot_object_size_; \
\
clazz->init_face = init_face_; \
clazz->done_face = done_face_; \
\
clazz->init_size = init_size_; \
clazz->done_size = done_size_; \
\
clazz->init_slot = init_slot_; \
clazz->done_slot = done_slot_; \
\
FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \
\
clazz->load_glyph = load_glyph_; \
\
clazz->get_kerning = get_kerning_; \
clazz->attach_file = attach_file_; \
clazz->get_advances = get_advances_; \
\
clazz->request_size = request_size_; \
clazz->select_size = select_size_; \
\
*output_class = (FT_Module_Class*)clazz; \
return FT_Err_Ok; \
}
 
 
#endif /* FT_CONFIG_OPTION_PIC */
 
FT_END_HEADER
 
#endif /* __FTDRIVER_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/ftgloadr.h
0,0 → 1,168
/***************************************************************************/
/* */
/* ftgloadr.h */
/* */
/* The FreeType glyph loader (specification). */
/* */
/* Copyright 2002, 2003, 2005, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTGLOADR_H__
#define __FTGLOADR_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_GlyphLoader */
/* */
/* <Description> */
/* The glyph loader is an internal object used to load several glyphs */
/* together (for example, in the case of composites). */
/* */
/* <Note> */
/* The glyph loader implementation is not part of the high-level API, */
/* hence the forward structure declaration. */
/* */
typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
 
 
#if 0 /* moved to freetype.h in version 2.2 */
#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
#define FT_SUBGLYPH_FLAG_SCALE 8
#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
#define FT_SUBGLYPH_FLAG_2X2 0x80
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
#endif
 
 
typedef struct FT_SubGlyphRec_
{
FT_Int index;
FT_UShort flags;
FT_Int arg1;
FT_Int arg2;
FT_Matrix transform;
 
} FT_SubGlyphRec;
 
 
typedef struct FT_GlyphLoadRec_
{
FT_Outline outline; /* outline */
FT_Vector* extra_points; /* extra points table */
FT_Vector* extra_points2; /* second extra points table */
FT_UInt num_subglyphs; /* number of subglyphs */
FT_SubGlyph subglyphs; /* subglyphs */
 
} FT_GlyphLoadRec, *FT_GlyphLoad;
 
 
typedef struct FT_GlyphLoaderRec_
{
FT_Memory memory;
FT_UInt max_points;
FT_UInt max_contours;
FT_UInt max_subglyphs;
FT_Bool use_extra;
 
FT_GlyphLoadRec base;
FT_GlyphLoadRec current;
 
void* other; /* for possible future extension? */
 
} FT_GlyphLoaderRec;
 
 
/* create new empty glyph loader */
FT_BASE( FT_Error )
FT_GlyphLoader_New( FT_Memory memory,
FT_GlyphLoader *aloader );
 
/* add an extra points table to a glyph loader */
FT_BASE( FT_Error )
FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader );
 
/* destroy a glyph loader */
FT_BASE( void )
FT_GlyphLoader_Done( FT_GlyphLoader loader );
 
/* reset a glyph loader (frees everything int it) */
FT_BASE( void )
FT_GlyphLoader_Reset( FT_GlyphLoader loader );
 
/* rewind a glyph loader */
FT_BASE( void )
FT_GlyphLoader_Rewind( FT_GlyphLoader loader );
 
/* check that there is enough space to add `n_points' and `n_contours' */
/* to the glyph loader */
FT_BASE( FT_Error )
FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader,
FT_UInt n_points,
FT_UInt n_contours );
 
 
#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
( (_count) == 0 || ((_loader)->base.outline.n_points + \
(_loader)->current.outline.n_points + \
(unsigned long)(_count)) <= (_loader)->max_points )
 
#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
( (_count) == 0 || ((_loader)->base.outline.n_contours + \
(_loader)->current.outline.n_contours + \
(unsigned long)(_count)) <= (_loader)->max_contours )
 
#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours ) \
( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
? 0 \
: FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )
 
 
/* check that there is enough space to add `n_subs' sub-glyphs to */
/* a glyph loader */
FT_BASE( FT_Error )
FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader,
FT_UInt n_subs );
 
/* prepare a glyph loader, i.e. empty the current glyph */
FT_BASE( void )
FT_GlyphLoader_Prepare( FT_GlyphLoader loader );
 
/* add the current glyph to the base glyph */
FT_BASE( void )
FT_GlyphLoader_Add( FT_GlyphLoader loader );
 
/* copy points from one glyph loader to another */
FT_BASE( FT_Error )
FT_GlyphLoader_CopyPoints( FT_GlyphLoader target,
FT_GlyphLoader source );
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTGLOADR_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/ftmemory.h
0,0 → 1,380
/***************************************************************************/
/* */
/* ftmemory.h */
/* */
/* The FreeType memory management macros (specification). */
/* */
/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTMEMORY_H__
#define __FTMEMORY_H__
 
 
#include <ft2build.h>
#include FT_CONFIG_CONFIG_H
#include FT_TYPES_H
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Macro> */
/* FT_SET_ERROR */
/* */
/* <Description> */
/* This macro is used to set an implicit `error' variable to a given */
/* expression's value (usually a function call), and convert it to a */
/* boolean which is set whenever the value is != 0. */
/* */
#undef FT_SET_ERROR
#define FT_SET_ERROR( expression ) \
( ( error = (expression) ) != 0 )
 
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** M E M O R Y ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*
* C++ refuses to handle statements like p = (void*)anything, with `p' a
* typed pointer. Since we don't have a `typeof' operator in standard
* C++, we have to use a template to emulate it.
*/
 
#ifdef __cplusplus
 
extern "C++"
template <typename T> inline T*
cplusplus_typeof( T*,
void *v )
{
return static_cast <T*> ( v );
}
 
#define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) )
 
#else
 
#define FT_ASSIGNP( p, val ) (p) = (val)
 
#endif
 
 
 
#ifdef FT_DEBUG_MEMORY
 
FT_BASE( const char* ) _ft_debug_file;
FT_BASE( long ) _ft_debug_lineno;
 
#define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \
_ft_debug_lineno = __LINE__, \
(exp) )
 
#define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \
_ft_debug_lineno = __LINE__, \
FT_ASSIGNP( p, exp ) )
 
#else /* !FT_DEBUG_MEMORY */
 
#define FT_DEBUG_INNER( exp ) (exp)
#define FT_ASSIGNP_INNER( p, exp ) FT_ASSIGNP( p, exp )
 
#endif /* !FT_DEBUG_MEMORY */
 
 
/*
* The allocation functions return a pointer, and the error code
* is written to through the `p_error' parameter. See below for
* for documentation.
*/
 
FT_BASE( FT_Pointer )
ft_mem_alloc( FT_Memory memory,
FT_Long size,
FT_Error *p_error );
 
FT_BASE( FT_Pointer )
ft_mem_qalloc( FT_Memory memory,
FT_Long size,
FT_Error *p_error );
 
FT_BASE( FT_Pointer )
ft_mem_realloc( FT_Memory memory,
FT_Long item_size,
FT_Long cur_count,
FT_Long new_count,
void* block,
FT_Error *p_error );
 
FT_BASE( FT_Pointer )
ft_mem_qrealloc( FT_Memory memory,
FT_Long item_size,
FT_Long cur_count,
FT_Long new_count,
void* block,
FT_Error *p_error );
 
FT_BASE( void )
ft_mem_free( FT_Memory memory,
const void* P );
 
 
#define FT_MEM_ALLOC( ptr, size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, (size), &error ) )
 
#define FT_MEM_FREE( ptr ) \
FT_BEGIN_STMNT \
ft_mem_free( memory, (ptr) ); \
(ptr) = NULL; \
FT_END_STMNT
 
#define FT_MEM_NEW( ptr ) \
FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
 
#define FT_MEM_REALLOC( ptr, cursz, newsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, 1, \
(cursz), (newsz), \
(ptr), &error ) )
 
#define FT_MEM_QALLOC( ptr, size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, (size), &error ) )
 
#define FT_MEM_QNEW( ptr ) \
FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
 
#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, 1, \
(cursz), (newsz), \
(ptr), &error ) )
 
#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
(cursz), (newsz), \
(ptr), &error ) )
 
#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (item_size), \
0, (count), \
NULL, &error ) )
 
#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (itmsz), \
(oldcnt), (newcnt), \
(ptr), &error ) )
 
#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (item_size), \
0, (count), \
NULL, &error ) )
 
#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (itmsz), \
(oldcnt), (newcnt), \
(ptr), &error ) )
 
 
#define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 )
 
 
#define FT_MEM_SET( dest, byte, count ) ft_memset( dest, byte, count )
 
#define FT_MEM_COPY( dest, source, count ) ft_memcpy( dest, source, count )
 
#define FT_MEM_MOVE( dest, source, count ) ft_memmove( dest, source, count )
 
 
#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count )
 
#define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) )
 
 
#define FT_ARRAY_ZERO( dest, count ) \
FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )
 
#define FT_ARRAY_COPY( dest, source, count ) \
FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) )
 
#define FT_ARRAY_MOVE( dest, source, count ) \
FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) )
 
 
/*
* Return the maximum number of addressable elements in an array.
* We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid
* any problems.
*/
#define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) )
 
#define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) )
 
 
/*************************************************************************/
/* */
/* The following functions macros expect that their pointer argument is */
/* _typed_ in order to automatically compute array element sizes. */
/* */
 
#define FT_MEM_NEW_ARRAY( ptr, count ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
0, (count), \
NULL, &error ) )
 
#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
(cursz), (newsz), \
(ptr), &error ) )
 
#define FT_MEM_QNEW_ARRAY( ptr, count ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
0, (count), \
NULL, &error ) )
 
#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
(cursz), (newsz), \
(ptr), &error ) )
 
 
#define FT_ALLOC( ptr, size ) \
FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )
 
#define FT_REALLOC( ptr, cursz, newsz ) \
FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )
 
#define FT_ALLOC_MULT( ptr, count, item_size ) \
FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )
 
#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt, \
newcnt, itmsz ) )
 
#define FT_QALLOC( ptr, size ) \
FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )
 
#define FT_QREALLOC( ptr, cursz, newsz ) \
FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )
 
#define FT_QALLOC_MULT( ptr, count, item_size ) \
FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )
 
#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt, \
newcnt, itmsz ) )
 
#define FT_FREE( ptr ) FT_MEM_FREE( ptr )
 
#define FT_NEW( ptr ) FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )
 
#define FT_NEW_ARRAY( ptr, count ) \
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
 
#define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
 
#define FT_QNEW( ptr ) \
FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
 
#define FT_QNEW_ARRAY( ptr, count ) \
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
 
#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
 
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
FT_BASE( FT_Error )
FT_Alloc( FT_Memory memory,
FT_Long size,
void* *P );
 
FT_BASE( FT_Error )
FT_QAlloc( FT_Memory memory,
FT_Long size,
void* *p );
 
FT_BASE( FT_Error )
FT_Realloc( FT_Memory memory,
FT_Long current,
FT_Long size,
void* *P );
 
FT_BASE( FT_Error )
FT_QRealloc( FT_Memory memory,
FT_Long current,
FT_Long size,
void* *p );
 
FT_BASE( void )
FT_Free( FT_Memory memory,
void* *P );
 
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
 
FT_BASE( FT_Pointer )
ft_mem_strdup( FT_Memory memory,
const char* str,
FT_Error *p_error );
 
FT_BASE( FT_Pointer )
ft_mem_dup( FT_Memory memory,
const void* address,
FT_ULong size,
FT_Error *p_error );
 
#define FT_MEM_STRDUP( dst, str ) \
(dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
 
#define FT_STRDUP( dst, str ) \
FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )
 
#define FT_MEM_DUP( dst, address, size ) \
(dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )
 
#define FT_DUP( dst, address, size ) \
FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )
 
 
/* Return >= 1 if a truncation occurs. */
/* Return 0 if the source string fits the buffer. */
/* This is *not* the same as strlcpy(). */
FT_BASE( FT_Int )
ft_mem_strcpyn( char* dst,
const char* src,
FT_ULong size );
 
#define FT_STRCPYN( dst, src, size ) \
ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )
 
/* */
 
 
FT_END_HEADER
 
#endif /* __FTMEMORY_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/ftobjs.h
0,0 → 1,1428
/***************************************************************************/
/* */
/* ftobjs.h */
/* */
/* The FreeType private base classes (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* This file contains the definition of all internal FreeType classes. */
/* */
/*************************************************************************/
 
 
#ifndef __FTOBJS_H__
#define __FTOBJS_H__
 
#include <ft2build.h>
#include FT_RENDER_H
#include FT_SIZES_H
#include FT_LCD_FILTER_H
#include FT_INTERNAL_MEMORY_H
#include FT_INTERNAL_GLYPH_LOADER_H
#include FT_INTERNAL_DRIVER_H
#include FT_INTERNAL_AUTOHINT_H
#include FT_INTERNAL_SERVICE_H
#include FT_INTERNAL_PIC_H
 
#ifdef FT_CONFIG_OPTION_INCREMENTAL
#include FT_INCREMENTAL_H
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* Some generic definitions. */
/* */
#ifndef TRUE
#define TRUE 1
#endif
 
#ifndef FALSE
#define FALSE 0
#endif
 
#ifndef NULL
#define NULL (void*)0
#endif
 
 
/*************************************************************************/
/* */
/* The min and max functions missing in C. As usual, be careful not to */
/* write things like FT_MIN( a++, b++ ) to avoid side effects. */
/* */
#define FT_MIN( a, b ) ( (a) < (b) ? (a) : (b) )
#define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
 
#define FT_ABS( a ) ( (a) < 0 ? -(a) : (a) )
 
 
#define FT_PAD_FLOOR( x, n ) ( (x) & ~((n)-1) )
#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + ((n)/2), n )
#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + ((n)-1), n )
 
#define FT_PIX_FLOOR( x ) ( (x) & ~63 )
#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
#define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 )
 
 
/*
* Return the highest power of 2 that is <= value; this correspond to
* the highest bit in a given 32-bit value.
*/
FT_BASE( FT_UInt32 )
ft_highpow2( FT_UInt32 value );
 
 
/*
* character classification functions -- since these are used to parse
* font files, we must not use those in <ctypes.h> which are
* locale-dependent
*/
#define ft_isdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U )
 
#define ft_isxdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U || \
( (unsigned)(x) - 'a' ) < 6U || \
( (unsigned)(x) - 'A' ) < 6U )
 
/* the next two macros assume ASCII representation */
#define ft_isupper( x ) ( ( (unsigned)(x) - 'A' ) < 26U )
#define ft_islower( x ) ( ( (unsigned)(x) - 'a' ) < 26U )
 
#define ft_isalpha( x ) ( ft_isupper( x ) || ft_islower( x ) )
#define ft_isalnum( x ) ( ft_isdigit( x ) || ft_isalpha( x ) )
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** C H A R M A P S ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
/* handle to internal charmap object */
typedef struct FT_CMapRec_* FT_CMap;
 
/* handle to charmap class structure */
typedef const struct FT_CMap_ClassRec_* FT_CMap_Class;
 
/* internal charmap object structure */
typedef struct FT_CMapRec_
{
FT_CharMapRec charmap;
FT_CMap_Class clazz;
 
} FT_CMapRec;
 
/* typecase any pointer to a charmap handle */
#define FT_CMAP( x ) ((FT_CMap)( x ))
 
/* obvious macros */
#define FT_CMAP_PLATFORM_ID( x ) FT_CMAP( x )->charmap.platform_id
#define FT_CMAP_ENCODING_ID( x ) FT_CMAP( x )->charmap.encoding_id
#define FT_CMAP_ENCODING( x ) FT_CMAP( x )->charmap.encoding
#define FT_CMAP_FACE( x ) FT_CMAP( x )->charmap.face
 
 
/* class method definitions */
typedef FT_Error
(*FT_CMap_InitFunc)( FT_CMap cmap,
FT_Pointer init_data );
 
typedef void
(*FT_CMap_DoneFunc)( FT_CMap cmap );
 
typedef FT_UInt
(*FT_CMap_CharIndexFunc)( FT_CMap cmap,
FT_UInt32 char_code );
 
typedef FT_UInt
(*FT_CMap_CharNextFunc)( FT_CMap cmap,
FT_UInt32 *achar_code );
 
typedef FT_UInt
(*FT_CMap_CharVarIndexFunc)( FT_CMap cmap,
FT_CMap unicode_cmap,
FT_UInt32 char_code,
FT_UInt32 variant_selector );
 
typedef FT_Bool
(*FT_CMap_CharVarIsDefaultFunc)( FT_CMap cmap,
FT_UInt32 char_code,
FT_UInt32 variant_selector );
 
typedef FT_UInt32 *
(*FT_CMap_VariantListFunc)( FT_CMap cmap,
FT_Memory mem );
 
typedef FT_UInt32 *
(*FT_CMap_CharVariantListFunc)( FT_CMap cmap,
FT_Memory mem,
FT_UInt32 char_code );
 
typedef FT_UInt32 *
(*FT_CMap_VariantCharListFunc)( FT_CMap cmap,
FT_Memory mem,
FT_UInt32 variant_selector );
 
 
typedef struct FT_CMap_ClassRec_
{
FT_ULong size;
FT_CMap_InitFunc init;
FT_CMap_DoneFunc done;
FT_CMap_CharIndexFunc char_index;
FT_CMap_CharNextFunc char_next;
 
/* Subsequent entries are special ones for format 14 -- the variant */
/* selector subtable which behaves like no other */
 
FT_CMap_CharVarIndexFunc char_var_index;
FT_CMap_CharVarIsDefaultFunc char_var_default;
FT_CMap_VariantListFunc variant_list;
FT_CMap_CharVariantListFunc charvariant_list;
FT_CMap_VariantCharListFunc variantchar_list;
 
} FT_CMap_ClassRec;
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DECLARE_CMAP_CLASS(class_) \
FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
 
#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_, \
char_next_, char_var_index_, char_var_default_, variant_list_, \
charvariant_list_, variantchar_list_) \
FT_CALLBACK_TABLE_DEF \
const FT_CMap_ClassRec class_ = \
{ \
size_, init_, done_, char_index_, char_next_, char_var_index_, \
char_var_default_, variant_list_, charvariant_list_, variantchar_list_ \
};
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DECLARE_CMAP_CLASS(class_) \
void FT_Init_Class_##class_( FT_Library library, FT_CMap_ClassRec* clazz);
 
#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_, \
char_next_, char_var_index_, char_var_default_, variant_list_, \
charvariant_list_, variantchar_list_) \
void \
FT_Init_Class_##class_( FT_Library library, \
FT_CMap_ClassRec* clazz) \
{ \
FT_UNUSED(library); \
clazz->size = size_; \
clazz->init = init_; \
clazz->done = done_; \
clazz->char_index = char_index_; \
clazz->char_next = char_next_; \
clazz->char_var_index = char_var_index_; \
clazz->char_var_default = char_var_default_; \
clazz->variant_list = variant_list_; \
clazz->charvariant_list = charvariant_list_; \
clazz->variantchar_list = variantchar_list_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
 
/* create a new charmap and add it to charmap->face */
FT_BASE( FT_Error )
FT_CMap_New( FT_CMap_Class clazz,
FT_Pointer init_data,
FT_CharMap charmap,
FT_CMap *acmap );
 
/* destroy a charmap and remove it from face's list */
FT_BASE( void )
FT_CMap_Done( FT_CMap cmap );
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Face_InternalRec */
/* */
/* <Description> */
/* This structure contains the internal fields of each FT_Face */
/* object. These fields may change between different releases of */
/* FreeType. */
/* */
/* <Fields> */
/* max_points :: */
/* The maximal number of points used to store the vectorial outline */
/* of any glyph in this face. If this value cannot be known in */
/* advance, or if the face isn't scalable, this should be set to 0. */
/* Only relevant for scalable formats. */
/* */
/* max_contours :: */
/* The maximal number of contours used to store the vectorial */
/* outline of any glyph in this face. If this value cannot be */
/* known in advance, or if the face isn't scalable, this should be */
/* set to 0. Only relevant for scalable formats. */
/* */
/* transform_matrix :: */
/* A 2x2 matrix of 16.16 coefficients used to transform glyph */
/* outlines after they are loaded from the font. Only used by the */
/* convenience functions. */
/* */
/* transform_delta :: */
/* A translation vector used to transform glyph outlines after they */
/* are loaded from the font. Only used by the convenience */
/* functions. */
/* */
/* transform_flags :: */
/* Some flags used to classify the transform. Only used by the */
/* convenience functions. */
/* */
/* services :: */
/* A cache for frequently used services. It should be only */
/* accessed with the macro `FT_FACE_LOOKUP_SERVICE'. */
/* */
/* incremental_interface :: */
/* If non-null, the interface through which glyph data and metrics */
/* are loaded incrementally for faces that do not provide all of */
/* this data when first opened. This field exists only if */
/* @FT_CONFIG_OPTION_INCREMENTAL is defined. */
/* */
/* ignore_unpatented_hinter :: */
/* This boolean flag instructs the glyph loader to ignore the */
/* native font hinter, if one is found. This is exclusively used */
/* in the case when the unpatented hinter is compiled within the */
/* library. */
/* */
/* refcount :: */
/* A counter initialized to~1 at the time an @FT_Face structure is */
/* created. @FT_Reference_Face increments this counter, and */
/* @FT_Done_Face only destroys a face if the counter is~1, */
/* otherwise it simply decrements it. */
/* */
typedef struct FT_Face_InternalRec_
{
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
FT_UShort reserved1;
FT_Short reserved2;
#endif
FT_Matrix transform_matrix;
FT_Vector transform_delta;
FT_Int transform_flags;
 
FT_ServiceCacheRec services;
 
#ifdef FT_CONFIG_OPTION_INCREMENTAL
FT_Incremental_InterfaceRec* incremental_interface;
#endif
 
FT_Bool ignore_unpatented_hinter;
FT_UInt refcount;
 
} FT_Face_InternalRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Slot_InternalRec */
/* */
/* <Description> */
/* This structure contains the internal fields of each FT_GlyphSlot */
/* object. These fields may change between different releases of */
/* FreeType. */
/* */
/* <Fields> */
/* loader :: The glyph loader object used to load outlines */
/* into the glyph slot. */
/* */
/* flags :: Possible values are zero or */
/* FT_GLYPH_OWN_BITMAP. The latter indicates */
/* that the FT_GlyphSlot structure owns the */
/* bitmap buffer. */
/* */
/* glyph_transformed :: Boolean. Set to TRUE when the loaded glyph */
/* must be transformed through a specific */
/* font transformation. This is _not_ the same */
/* as the face transform set through */
/* FT_Set_Transform(). */
/* */
/* glyph_matrix :: The 2x2 matrix corresponding to the glyph */
/* transformation, if necessary. */
/* */
/* glyph_delta :: The 2d translation vector corresponding to */
/* the glyph transformation, if necessary. */
/* */
/* glyph_hints :: Format-specific glyph hints management. */
/* */
 
#define FT_GLYPH_OWN_BITMAP 0x1
 
typedef struct FT_Slot_InternalRec_
{
FT_GlyphLoader loader;
FT_UInt flags;
FT_Bool glyph_transformed;
FT_Matrix glyph_matrix;
FT_Vector glyph_delta;
void* glyph_hints;
 
} FT_GlyphSlot_InternalRec;
 
 
#if 0
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Size_InternalRec */
/* */
/* <Description> */
/* This structure contains the internal fields of each FT_Size */
/* object. Currently, it's empty. */
/* */
/*************************************************************************/
 
typedef struct FT_Size_InternalRec_
{
/* empty */
 
} FT_Size_InternalRec;
 
#endif
 
 
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** M O D U L E S ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_ModuleRec */
/* */
/* <Description> */
/* A module object instance. */
/* */
/* <Fields> */
/* clazz :: A pointer to the module's class. */
/* */
/* library :: A handle to the parent library object. */
/* */
/* memory :: A handle to the memory manager. */
/* */
/* generic :: A generic structure for user-level extensibility (?). */
/* */
typedef struct FT_ModuleRec_
{
FT_Module_Class* clazz;
FT_Library library;
FT_Memory memory;
FT_Generic generic;
 
} FT_ModuleRec;
 
 
/* typecast an object to a FT_Module */
#define FT_MODULE( x ) ((FT_Module)( x ))
#define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz
#define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library
#define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory
 
 
#define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
FT_MODULE_FONT_DRIVER )
 
#define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
FT_MODULE_RENDERER )
 
#define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
FT_MODULE_HINTER )
 
#define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
FT_MODULE_STYLER )
 
#define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS( x )->module_flags & \
FT_MODULE_DRIVER_SCALABLE )
 
#define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS( x )->module_flags & \
FT_MODULE_DRIVER_NO_OUTLINES )
 
#define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
FT_MODULE_DRIVER_HAS_HINTER )
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Module_Interface */
/* */
/* <Description> */
/* Finds a module and returns its specific interface as a typeless */
/* pointer. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* module_name :: The module's name (as an ASCII string). */
/* */
/* <Return> */
/* A module-specific interface if available, 0 otherwise. */
/* */
/* <Note> */
/* You should better be familiar with FreeType internals to know */
/* which module to look for, and what its interface is :-) */
/* */
FT_BASE( const void* )
FT_Get_Module_Interface( FT_Library library,
const char* mod_name );
 
FT_BASE( FT_Pointer )
ft_module_get_service( FT_Module module,
const char* service_id );
 
/* */
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** FACE, SIZE & GLYPH SLOT OBJECTS ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
/* a few macros used to perform easy typecasts with minimal brain damage */
 
#define FT_FACE( x ) ((FT_Face)(x))
#define FT_SIZE( x ) ((FT_Size)(x))
#define FT_SLOT( x ) ((FT_GlyphSlot)(x))
 
#define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
#define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
#define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
#define FT_FACE_STREAM( x ) FT_FACE( x )->stream
 
#define FT_SIZE_FACE( x ) FT_SIZE( x )->face
#define FT_SLOT_FACE( x ) FT_SLOT( x )->face
 
#define FT_FACE_SLOT( x ) FT_FACE( x )->glyph
#define FT_FACE_SIZE( x ) FT_FACE( x )->size
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_GlyphSlot */
/* */
/* <Description> */
/* It is sometimes useful to have more than one glyph slot for a */
/* given face object. This function is used to create additional */
/* slots. All of them are automatically discarded when the face is */
/* destroyed. */
/* */
/* <Input> */
/* face :: A handle to a parent face object. */
/* */
/* <Output> */
/* aslot :: A handle to a new glyph slot object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_BASE( FT_Error )
FT_New_GlyphSlot( FT_Face face,
FT_GlyphSlot *aslot );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_GlyphSlot */
/* */
/* <Description> */
/* Destroys a given glyph slot. Remember however that all slots are */
/* automatically destroyed with its parent. Using this function is */
/* not always mandatory. */
/* */
/* <Input> */
/* slot :: A handle to a target glyph slot. */
/* */
FT_BASE( void )
FT_Done_GlyphSlot( FT_GlyphSlot slot );
 
/* */
 
#define FT_REQUEST_WIDTH( req ) \
( (req)->horiResolution \
? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \
: (req)->width )
 
#define FT_REQUEST_HEIGHT( req ) \
( (req)->vertResolution \
? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \
: (req)->height )
 
 
/* Set the metrics according to a bitmap strike. */
FT_BASE( void )
FT_Select_Metrics( FT_Face face,
FT_ULong strike_index );
 
 
/* Set the metrics according to a size request. */
FT_BASE( void )
FT_Request_Metrics( FT_Face face,
FT_Size_Request req );
 
 
/* Match a size request against `available_sizes'. */
FT_BASE( FT_Error )
FT_Match_Size( FT_Face face,
FT_Size_Request req,
FT_Bool ignore_width,
FT_ULong* size_index );
 
 
/* Use the horizontal metrics to synthesize the vertical metrics. */
/* If `advance' is zero, it is also synthesized. */
FT_BASE( void )
ft_synthesize_vertical_metrics( FT_Glyph_Metrics* metrics,
FT_Pos advance );
 
 
/* Free the bitmap of a given glyphslot when needed (i.e., only when it */
/* was allocated with ft_glyphslot_alloc_bitmap). */
FT_BASE( void )
ft_glyphslot_free_bitmap( FT_GlyphSlot slot );
 
 
/* Allocate a new bitmap buffer in a glyph slot. */
FT_BASE( FT_Error )
ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
FT_ULong size );
 
 
/* Set the bitmap buffer in a glyph slot to a given pointer. The buffer */
/* will not be freed by a later call to ft_glyphslot_free_bitmap. */
FT_BASE( void )
ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
FT_Byte* buffer );
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** R E N D E R E R S ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
#define FT_RENDERER( x ) ((FT_Renderer)( x ))
#define FT_GLYPH( x ) ((FT_Glyph)( x ))
#define FT_BITMAP_GLYPH( x ) ((FT_BitmapGlyph)( x ))
#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
 
 
typedef struct FT_RendererRec_
{
FT_ModuleRec root;
FT_Renderer_Class* clazz;
FT_Glyph_Format glyph_format;
FT_Glyph_Class glyph_class;
 
FT_Raster raster;
FT_Raster_Render_Func raster_render;
FT_Renderer_RenderFunc render;
 
} FT_RendererRec;
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** F O N T D R I V E R S ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/* typecast a module into a driver easily */
#define FT_DRIVER( x ) ((FT_Driver)(x))
 
/* typecast a module as a driver, and get its driver class */
#define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_DriverRec */
/* */
/* <Description> */
/* The root font driver class. A font driver is responsible for */
/* managing and loading font files of a given format. */
/* */
/* <Fields> */
/* root :: Contains the fields of the root module class. */
/* */
/* clazz :: A pointer to the font driver's class. Note that */
/* this is NOT root.clazz. `class' wasn't used */
/* as it is a reserved word in C++. */
/* */
/* faces_list :: The list of faces currently opened by this */
/* driver. */
/* */
/* extensions :: A typeless pointer to the driver's extensions */
/* registry, if they are supported through the */
/* configuration macro FT_CONFIG_OPTION_EXTENSIONS. */
/* */
/* glyph_loader :: The glyph loader for all faces managed by this */
/* driver. This object isn't defined for unscalable */
/* formats. */
/* */
typedef struct FT_DriverRec_
{
FT_ModuleRec root;
FT_Driver_Class clazz;
 
FT_ListRec faces_list;
void* extensions;
 
FT_GlyphLoader glyph_loader;
 
} FT_DriverRec;
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** L I B R A R I E S ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/* This hook is used by the TrueType debugger. It must be set to an */
/* alternate truetype bytecode interpreter function. */
#define FT_DEBUG_HOOK_TRUETYPE 0
 
 
/* Set this debug hook to a non-null pointer to force unpatented hinting */
/* for all faces when both TT_USE_BYTECODE_INTERPRETER and */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. This is only used */
/* during debugging. */
#define FT_DEBUG_HOOK_UNPATENTED_HINTING 1
 
 
typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
FT_Render_Mode render_mode,
FT_Library library );
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* FT_LibraryRec */
/* */
/* <Description> */
/* The FreeType library class. This is the root of all FreeType */
/* data. Use FT_New_Library() to create a library object, and */
/* FT_Done_Library() to discard it and all child objects. */
/* */
/* <Fields> */
/* memory :: The library's memory object. Manages memory */
/* allocation. */
/* */
/* generic :: Client data variable. Used to extend the */
/* Library class by higher levels and clients. */
/* */
/* version_major :: The major version number of the library. */
/* */
/* version_minor :: The minor version number of the library. */
/* */
/* version_patch :: The current patch level of the library. */
/* */
/* num_modules :: The number of modules currently registered */
/* within this library. This is set to 0 for new */
/* libraries. New modules are added through the */
/* FT_Add_Module() API function. */
/* */
/* modules :: A table used to store handles to the currently */
/* registered modules. Note that each font driver */
/* contains a list of its opened faces. */
/* */
/* renderers :: The list of renderers currently registered */
/* within the library. */
/* */
/* cur_renderer :: The current outline renderer. This is a */
/* shortcut used to avoid parsing the list on */
/* each call to FT_Outline_Render(). It is a */
/* handle to the current renderer for the */
/* FT_GLYPH_FORMAT_OUTLINE format. */
/* */
/* auto_hinter :: XXX */
/* */
/* raster_pool :: The raster object's render pool. This can */
/* ideally be changed dynamically at run-time. */
/* */
/* raster_pool_size :: The size of the render pool in bytes. */
/* */
/* debug_hooks :: XXX */
/* */
/* lcd_filter :: If subpixel rendering is activated, the */
/* selected LCD filter mode. */
/* */
/* lcd_extra :: If subpixel rendering is activated, the number */
/* of extra pixels needed for the LCD filter. */
/* */
/* lcd_weights :: If subpixel rendering is activated, the LCD */
/* filter weights, if any. */
/* */
/* lcd_filter_func :: If subpixel rendering is activated, the LCD */
/* filtering callback function. */
/* */
/* pic_container :: Contains global structs and tables, instead */
/* of defining them globallly. */
/* */
/* refcount :: A counter initialized to~1 at the time an */
/* @FT_Library structure is created. */
/* @FT_Reference_Library increments this counter, */
/* and @FT_Done_Library only destroys a library */
/* if the counter is~1, otherwise it simply */
/* decrements it. */
/* */
typedef struct FT_LibraryRec_
{
FT_Memory memory; /* library's memory manager */
 
FT_Generic generic;
 
FT_Int version_major;
FT_Int version_minor;
FT_Int version_patch;
 
FT_UInt num_modules;
FT_Module modules[FT_MAX_MODULES]; /* module objects */
 
FT_ListRec renderers; /* list of renderers */
FT_Renderer cur_renderer; /* current outline renderer */
FT_Module auto_hinter;
 
FT_Byte* raster_pool; /* scan-line conversion */
/* render pool */
FT_ULong raster_pool_size; /* size of render pool in bytes */
 
FT_DebugHook_Func debug_hooks[4];
 
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
FT_LcdFilter lcd_filter;
FT_Int lcd_extra; /* number of extra pixels */
FT_Byte lcd_weights[7]; /* filter weights, if any */
FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
#endif
 
#ifdef FT_CONFIG_OPTION_PIC
FT_PIC_Container pic_container;
#endif
 
FT_UInt refcount;
 
} FT_LibraryRec;
 
 
FT_BASE( FT_Renderer )
FT_Lookup_Renderer( FT_Library library,
FT_Glyph_Format format,
FT_ListNode* node );
 
FT_BASE( FT_Error )
FT_Render_Glyph_Internal( FT_Library library,
FT_GlyphSlot slot,
FT_Render_Mode render_mode );
 
typedef const char*
(*FT_Face_GetPostscriptNameFunc)( FT_Face face );
 
typedef FT_Error
(*FT_Face_GetGlyphNameFunc)( FT_Face face,
FT_UInt glyph_index,
FT_Pointer buffer,
FT_UInt buffer_max );
 
typedef FT_UInt
(*FT_Face_GetGlyphNameIndexFunc)( FT_Face face,
FT_String* glyph_name );
 
 
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Memory */
/* */
/* <Description> */
/* Creates a new memory object. */
/* */
/* <Return> */
/* A pointer to the new memory object. 0 in case of error. */
/* */
FT_BASE( FT_Memory )
FT_New_Memory( void );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_Memory */
/* */
/* <Description> */
/* Discards memory manager. */
/* */
/* <Input> */
/* memory :: A handle to the memory manager. */
/* */
FT_BASE( void )
FT_Done_Memory( FT_Memory memory );
 
#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
 
 
/* Define default raster's interface. The default raster is located in */
/* `src/base/ftraster.c'. */
/* */
/* Client applications can register new rasters through the */
/* FT_Set_Raster() API. */
 
#ifndef FT_NO_DEFAULT_RASTER
FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
#endif
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** PIC-Support Macros for ftimage.h ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Macro> */
/* FT_DEFINE_OUTLINE_FUNCS */
/* */
/* <Description> */
/* Used to initialize an instance of FT_Outline_Funcs struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* called with a pre-allocated stracture to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \
cubic_to_, shift_, delta_) \
static const FT_Outline_Funcs class_ = \
{ \
move_to_, line_to_, conic_to_, cubic_to_, shift_, delta_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \
cubic_to_, shift_, delta_) \
static FT_Error \
Init_Class_##class_( FT_Outline_Funcs* clazz ) \
{ \
clazz->move_to = move_to_; \
clazz->line_to = line_to_; \
clazz->conic_to = conic_to_; \
clazz->cubic_to = cubic_to_; \
clazz->shift = shift_; \
clazz->delta = delta_; \
return FT_Err_Ok; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/*************************************************************************/
/* */
/* <Macro> */
/* FT_DEFINE_RASTER_FUNCS */
/* */
/* <Description> */
/* Used to initialize an instance of FT_Raster_Funcs struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* called with a pre-allocated stracture to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \
raster_reset_, raster_set_mode_, \
raster_render_, raster_done_) \
const FT_Raster_Funcs class_ = \
{ \
glyph_format_, raster_new_, raster_reset_, \
raster_set_mode_, raster_render_, raster_done_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \
raster_reset_, raster_set_mode_, raster_render_, raster_done_) \
void \
FT_Init_Class_##class_( FT_Raster_Funcs* clazz ) \
{ \
clazz->glyph_format = glyph_format_; \
clazz->raster_new = raster_new_; \
clazz->raster_reset = raster_reset_; \
clazz->raster_set_mode = raster_set_mode_; \
clazz->raster_render = raster_render_; \
clazz->raster_done = raster_done_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** PIC-Support Macros for ftrender.h ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
 
/*************************************************************************/
/* */
/* <Macro> */
/* FT_DEFINE_GLYPH */
/* */
/* <Description> */
/* Used to initialize an instance of FT_Glyph_Class struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* called with a pre-allocated stracture to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \
transform_, bbox_, prepare_) \
FT_CALLBACK_TABLE_DEF \
const FT_Glyph_Class class_ = \
{ \
size_, format_, init_, done_, copy_, transform_, bbox_, prepare_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \
transform_, bbox_, prepare_) \
void \
FT_Init_Class_##class_( FT_Glyph_Class* clazz ) \
{ \
clazz->glyph_size = size_; \
clazz->glyph_format = format_; \
clazz->glyph_init = init_; \
clazz->glyph_done = done_; \
clazz->glyph_copy = copy_; \
clazz->glyph_transform = transform_; \
clazz->glyph_bbox = bbox_; \
clazz->glyph_prepare = prepare_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/*************************************************************************/
/* */
/* <Macro> */
/* FT_DECLARE_RENDERER */
/* */
/* <Description> */
/* Used to create a forward declaration of a */
/* FT_Renderer_Class stract instance. */
/* */
/* <Macro> */
/* FT_DEFINE_RENDERER */
/* */
/* <Description> */
/* Used to initialize an instance of FT_Renderer_Class struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */
/* to called with a pointer where the allocated stracture is returned.*/
/* And when it is no longer needed a Destroy function needs */
/* to be called to release that allocation. */
/* fcinit.c (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */
/* described in ftmodule.h */
/* */
/* Notice that the created Create and Destroy functions call */
/* pic_init and pic_free function to allow you to manually allocate */
/* and initialize any additional global data, like module specific */
/* interface, and put them in the global pic container defined in */
/* ftpic.h. if you don't need them just implement the functions as */
/* empty to resolve the link error. */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DECLARE_RENDERER(class_) \
FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
 
#define FT_DEFINE_RENDERER(class_, \
flags_, size_, name_, version_, requires_, \
interface_, init_, done_, get_interface_, \
glyph_format_, render_glyph_, transform_glyph_, \
get_glyph_cbox_, set_mode_, raster_class_ ) \
FT_CALLBACK_TABLE_DEF \
const FT_Renderer_Class class_ = \
{ \
FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_, \
interface_,init_,done_,get_interface_) \
glyph_format_, \
\
render_glyph_, \
transform_glyph_, \
get_glyph_cbox_, \
set_mode_, \
\
raster_class_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DECLARE_RENDERER(class_) FT_DECLARE_MODULE(class_)
 
#define FT_DEFINE_RENDERER(class_, \
flags_, size_, name_, version_, requires_, \
interface_, init_, done_, get_interface_, \
glyph_format_, render_glyph_, transform_glyph_, \
get_glyph_cbox_, set_mode_, raster_class_ ) \
void class_##_pic_free( FT_Library library ); \
FT_Error class_##_pic_init( FT_Library library ); \
\
void \
FT_Destroy_Class_##class_( FT_Library library, \
FT_Module_Class* clazz ) \
{ \
FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz; \
FT_Memory memory = library->memory; \
class_##_pic_free( library ); \
if ( rclazz ) \
FT_FREE( rclazz ); \
} \
\
FT_Error \
FT_Create_Class_##class_( FT_Library library, \
FT_Module_Class** output_class ) \
{ \
FT_Renderer_Class* clazz; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \
return error; \
\
error = class_##_pic_init( library ); \
if(error) \
{ \
FT_FREE( clazz ); \
return error; \
} \
\
FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_, \
interface_,init_,done_,get_interface_) \
\
clazz->glyph_format = glyph_format_; \
\
clazz->render_glyph = render_glyph_; \
clazz->transform_glyph = transform_glyph_; \
clazz->get_glyph_cbox = get_glyph_cbox_; \
clazz->set_mode = set_mode_; \
\
clazz->raster_class = raster_class_; \
\
*output_class = (FT_Module_Class*)clazz; \
return FT_Err_Ok; \
}
 
 
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** PIC-Support Macros for ftmodapi.h ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
#ifdef FT_CONFIG_OPTION_PIC
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Module_Creator */
/* */
/* <Description> */
/* A function used to create (allocate) a new module class object. */
/* The object's members are initialized, but the module itself is */
/* not. */
/* */
/* <Input> */
/* memory :: A handle to the memory manager. */
/* output_class :: Initialized with the newly allocated class. */
/* */
typedef FT_Error
(*FT_Module_Creator)( FT_Memory memory,
FT_Module_Class** output_class );
 
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_Module_Destroyer */
/* */
/* <Description> */
/* A function used to destroy (deallocate) a module class object. */
/* */
/* <Input> */
/* memory :: A handle to the memory manager. */
/* clazz :: Module class to destroy. */
/* */
typedef void
(*FT_Module_Destroyer)( FT_Memory memory,
FT_Module_Class* clazz );
 
#endif
 
/*************************************************************************/
/* */
/* <Macro> */
/* FT_DECLARE_MODULE */
/* */
/* <Description> */
/* Used to create a forward declaration of a */
/* FT_Module_Class stract instance. */
/* */
/* <Macro> */
/* FT_DEFINE_MODULE */
/* */
/* <Description> */
/* Used to initialize an instance of FT_Module_Class struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */
/* to called with a pointer where the allocated stracture is returned.*/
/* And when it is no longer needed a Destroy function needs */
/* to be called to release that allocation. */
/* fcinit.c (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */
/* described in ftmodule.h */
/* */
/* Notice that the created Create and Destroy functions call */
/* pic_init and pic_free function to allow you to manually allocate */
/* and initialize any additional global data, like module specific */
/* interface, and put them in the global pic container defined in */
/* ftpic.h. if you don't need them just implement the functions as */
/* empty to resolve the link error. */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* */
/* <Macro> */
/* FT_DEFINE_ROOT_MODULE */
/* */
/* <Description> */
/* Used to initialize an instance of FT_Module_Class struct inside */
/* another stract that contains it or in a function that initializes */
/* that containing stract */
/* */
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DECLARE_MODULE(class_) \
FT_CALLBACK_TABLE \
const FT_Module_Class class_; \
 
#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_, \
interface_, init_, done_, get_interface_) \
{ \
flags_, \
size_, \
\
name_, \
version_, \
requires_, \
\
interface_, \
\
init_, \
done_, \
get_interface_, \
},
 
#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_, \
interface_, init_, done_, get_interface_) \
FT_CALLBACK_TABLE_DEF \
const FT_Module_Class class_ = \
{ \
flags_, \
size_, \
\
name_, \
version_, \
requires_, \
\
interface_, \
\
init_, \
done_, \
get_interface_, \
};
 
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DECLARE_MODULE(class_) \
FT_Error FT_Create_Class_##class_( FT_Library library, \
FT_Module_Class** output_class ); \
void FT_Destroy_Class_##class_( FT_Library library, \
FT_Module_Class* clazz );
 
#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_, \
interface_, init_, done_, get_interface_) \
clazz->root.module_flags = flags_; \
clazz->root.module_size = size_; \
clazz->root.module_name = name_; \
clazz->root.module_version = version_; \
clazz->root.module_requires = requires_; \
\
clazz->root.module_interface = interface_; \
\
clazz->root.module_init = init_; \
clazz->root.module_done = done_; \
clazz->root.get_interface = get_interface_;
 
#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_, \
interface_, init_, done_, get_interface_) \
void class_##_pic_free( FT_Library library ); \
FT_Error class_##_pic_init( FT_Library library ); \
\
void \
FT_Destroy_Class_##class_( FT_Library library, \
FT_Module_Class* clazz ) \
{ \
FT_Memory memory = library->memory; \
class_##_pic_free( library ); \
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_##class_( FT_Library library, \
FT_Module_Class** output_class ) \
{ \
FT_Memory memory = library->memory; \
FT_Module_Class* clazz; \
FT_Error error; \
\
if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \
return error; \
error = class_##_pic_init( library ); \
if(error) \
{ \
FT_FREE( clazz ); \
return error; \
} \
\
clazz->module_flags = flags_; \
clazz->module_size = size_; \
clazz->module_name = name_; \
clazz->module_version = version_; \
clazz->module_requires = requires_; \
\
clazz->module_interface = interface_; \
\
clazz->module_init = init_; \
clazz->module_done = done_; \
clazz->get_interface = get_interface_; \
\
*output_class = clazz; \
return FT_Err_Ok; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
 
FT_END_HEADER
 
#endif /* __FTOBJS_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/ftpic.h
0,0 → 1,67
/***************************************************************************/
/* */
/* ftpic.h */
/* */
/* The FreeType position independent code services (declaration). */
/* */
/* Copyright 2009 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
/*************************************************************************/
/* */
/* Modules that ordinarily have const global data that need address */
/* can instead define pointers here. */
/* */
/*************************************************************************/
 
 
#ifndef __FTPIC_H__
#define __FTPIC_H__
 
FT_BEGIN_HEADER
 
#ifdef FT_CONFIG_OPTION_PIC
 
typedef struct FT_PIC_Container_
{
/* pic containers for base */
void* base;
/* pic containers for modules */
void* autofit;
void* cff;
void* pshinter;
void* psnames;
void* raster;
void* sfnt;
void* smooth;
void* truetype;
} FT_PIC_Container;
 
/* Initialize the various function tables, structs, etc. stored in the container. */
FT_BASE( FT_Error )
ft_pic_container_init( FT_Library library );
 
 
/* Destroy the contents of the container. */
FT_BASE( void )
ft_pic_container_destroy( FT_Library library );
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/* */
 
FT_END_HEADER
 
#endif /* __FTPIC_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/ftrfork.h
0,0 → 1,196
/***************************************************************************/
/* */
/* ftrfork.h */
/* */
/* Embedded resource forks accessor (specification). */
/* */
/* Copyright 2004, 2006, 2007 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
/***************************************************************************/
/* Development of the code in this file is support of */
/* Information-technology Promotion Agency, Japan. */
/***************************************************************************/
 
 
#ifndef __FTRFORK_H__
#define __FTRFORK_H__
 
 
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
 
 
FT_BEGIN_HEADER
 
 
/* Number of guessing rules supported in `FT_Raccess_Guess'. */
/* Don't forget to increment the number if you add a new guessing rule. */
#define FT_RACCESS_N_RULES 9
 
 
/* A structure to describe a reference in a resource by its resource ID */
/* and internal offset. The `POST' resource expects to be concatenated */
/* by the order of resource IDs instead of its appearance in the file. */
 
typedef struct FT_RFork_Ref_
{
FT_UShort res_id;
FT_ULong offset;
 
} FT_RFork_Ref;
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Raccess_Guess */
/* */
/* <Description> */
/* Guess a file name and offset where the actual resource fork is */
/* stored. The macro FT_RACCESS_N_RULES holds the number of */
/* guessing rules; the guessed result for the Nth rule is */
/* represented as a triplet: a new file name (new_names[N]), a file */
/* offset (offsets[N]), and an error code (errors[N]). */
/* */
/* <Input> */
/* library :: */
/* A FreeType library instance. */
/* */
/* stream :: */
/* A file stream containing the resource fork. */
/* */
/* base_name :: */
/* The (base) file name of the resource fork used for some */
/* guessing rules. */
/* */
/* <Output> */
/* new_names :: */
/* An array of guessed file names in which the resource forks may */
/* exist. If `new_names[N]' is NULL, the guessed file name is */
/* equal to `base_name'. */
/* */
/* offsets :: */
/* An array of guessed file offsets. `offsets[N]' holds the file */
/* offset of the possible start of the resource fork in file */
/* `new_names[N]'. */
/* */
/* errors :: */
/* An array of FreeType error codes. `errors[N]' is the error */
/* code of Nth guessing rule function. If `errors[N]' is not */
/* FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless. */
/* */
FT_BASE( void )
FT_Raccess_Guess( FT_Library library,
FT_Stream stream,
char* base_name,
char** new_names,
FT_Long* offsets,
FT_Error* errors );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Raccess_Get_HeaderInfo */
/* */
/* <Description> */
/* Get the information from the header of resource fork. The */
/* information includes the file offset where the resource map */
/* starts, and the file offset where the resource data starts. */
/* `FT_Raccess_Get_DataOffsets' requires these two data. */
/* */
/* <Input> */
/* library :: */
/* A FreeType library instance. */
/* */
/* stream :: */
/* A file stream containing the resource fork. */
/* */
/* rfork_offset :: */
/* The file offset where the resource fork starts. */
/* */
/* <Output> */
/* map_offset :: */
/* The file offset where the resource map starts. */
/* */
/* rdata_pos :: */
/* The file offset where the resource data starts. */
/* */
/* <Return> */
/* FreeType error code. FT_Err_Ok means success. */
/* */
FT_BASE( FT_Error )
FT_Raccess_Get_HeaderInfo( FT_Library library,
FT_Stream stream,
FT_Long rfork_offset,
FT_Long *map_offset,
FT_Long *rdata_pos );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Raccess_Get_DataOffsets */
/* */
/* <Description> */
/* Get the data offsets for a tag in a resource fork. Offsets are */
/* stored in an array because, in some cases, resources in a resource */
/* fork have the same tag. */
/* */
/* <Input> */
/* library :: */
/* A FreeType library instance. */
/* */
/* stream :: */
/* A file stream containing the resource fork. */
/* */
/* map_offset :: */
/* The file offset where the resource map starts. */
/* */
/* rdata_pos :: */
/* The file offset where the resource data starts. */
/* */
/* tag :: */
/* The resource tag. */
/* */
/* <Output> */
/* offsets :: */
/* The stream offsets for the resource data specified by `tag'. */
/* This array is allocated by the function, so you have to call */
/* @ft_mem_free after use. */
/* */
/* count :: */
/* The length of offsets array. */
/* */
/* <Return> */
/* FreeType error code. FT_Err_Ok means success. */
/* */
/* <Note> */
/* Normally you should use `FT_Raccess_Get_HeaderInfo' to get the */
/* value for `map_offset' and `rdata_pos'. */
/* */
FT_BASE( FT_Error )
FT_Raccess_Get_DataOffsets( FT_Library library,
FT_Stream stream,
FT_Long map_offset,
FT_Long rdata_pos,
FT_Long tag,
FT_Long **offsets,
FT_Long *count );
 
 
FT_END_HEADER
 
#endif /* __FTRFORK_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/ftserv.h
0,0 → 1,620
/***************************************************************************/
/* */
/* ftserv.h */
/* */
/* The FreeType services (specification only). */
/* */
/* Copyright 2003, 2004, 2005, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
/*************************************************************************/
/* */
/* Each module can export one or more `services'. Each service is */
/* identified by a constant string and modeled by a pointer; the latter */
/* generally corresponds to a structure containing function pointers. */
/* */
/* Note that a service's data cannot be a mere function pointer because */
/* in C it is possible that function pointers might be implemented */
/* differently than data pointers (e.g. 48 bits instead of 32). */
/* */
/*************************************************************************/
 
 
#ifndef __FTSERV_H__
#define __FTSERV_H__
 
 
FT_BEGIN_HEADER
 
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
 
/* we disable the warning `conditional expression is constant' here */
/* in order to compile cleanly with the maximum level of warnings */
#pragma warning( disable : 4127 )
 
#endif /* _MSC_VER */
 
/*
* @macro:
* FT_FACE_FIND_SERVICE
*
* @description:
* This macro is used to look up a service from a face's driver module.
*
* @input:
* face ::
* The source face handle.
*
* id ::
* A string describing the service as defined in the service's
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
* `multi-masters'). It is automatically prefixed with
* `FT_SERVICE_ID_'.
*
* @output:
* ptr ::
* A variable that receives the service pointer. Will be NULL
* if not found.
*/
#ifdef __cplusplus
 
#define FT_FACE_FIND_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
FT_Pointer _tmp_ = NULL; \
FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
\
\
if ( module->clazz->get_interface ) \
_tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
*_pptr_ = _tmp_; \
FT_END_STMNT
 
#else /* !C++ */
 
#define FT_FACE_FIND_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
FT_Pointer _tmp_ = NULL; \
\
if ( module->clazz->get_interface ) \
_tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
ptr = _tmp_; \
FT_END_STMNT
 
#endif /* !C++ */
 
/*
* @macro:
* FT_FACE_FIND_GLOBAL_SERVICE
*
* @description:
* This macro is used to look up a service from all modules.
*
* @input:
* face ::
* The source face handle.
*
* id ::
* A string describing the service as defined in the service's
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
* `multi-masters'). It is automatically prefixed with
* `FT_SERVICE_ID_'.
*
* @output:
* ptr ::
* A variable that receives the service pointer. Will be NULL
* if not found.
*/
#ifdef __cplusplus
 
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
FT_Pointer _tmp_; \
FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
\
\
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
*_pptr_ = _tmp_; \
FT_END_STMNT
 
#else /* !C++ */
 
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
FT_Pointer _tmp_; \
\
\
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
ptr = _tmp_; \
FT_END_STMNT
 
#endif /* !C++ */
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** S E R V I C E D E S C R I P T O R S *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
/*
* The following structure is used to _describe_ a given service
* to the library. This is useful to build simple static service lists.
*/
typedef struct FT_ServiceDescRec_
{
const char* serv_id; /* service name */
const void* serv_data; /* service pointer/data */
 
} FT_ServiceDescRec;
 
typedef const FT_ServiceDescRec* FT_ServiceDesc;
 
/*************************************************************************/
/* */
/* <Macro> */
/* FT_DEFINE_SERVICEDESCREC1 .. FT_DEFINE_SERVICEDESCREC6 */
/* */
/* <Description> */
/* Used to initialize an array of FT_ServiceDescRec structs. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */
/* to called with a pointer where the allocated array is returned. */
/* And when it is no longer needed a Destroy function needs */
/* to be called to release that allocation. */
/* */
/* These functions should be manyally called from the pic_init and */
/* pic_free functions of your module (see FT_DEFINE_MODULE) */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the array will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_SERVICEDESCREC1(class_, serv_id_1, serv_data_1) \
static const FT_ServiceDescRec class_[] = \
{ \
{serv_id_1, serv_data_1}, \
{NULL, NULL} \
};
#define FT_DEFINE_SERVICEDESCREC2(class_, serv_id_1, serv_data_1, \
serv_id_2, serv_data_2) \
static const FT_ServiceDescRec class_[] = \
{ \
{serv_id_1, serv_data_1}, \
{serv_id_2, serv_data_2}, \
{NULL, NULL} \
};
#define FT_DEFINE_SERVICEDESCREC3(class_, serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, serv_id_3, serv_data_3) \
static const FT_ServiceDescRec class_[] = \
{ \
{serv_id_1, serv_data_1}, \
{serv_id_2, serv_data_2}, \
{serv_id_3, serv_data_3}, \
{NULL, NULL} \
};
#define FT_DEFINE_SERVICEDESCREC4(class_, serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, serv_id_3, serv_data_3, \
serv_id_4, serv_data_4) \
static const FT_ServiceDescRec class_[] = \
{ \
{serv_id_1, serv_data_1}, \
{serv_id_2, serv_data_2}, \
{serv_id_3, serv_data_3}, \
{serv_id_4, serv_data_4}, \
{NULL, NULL} \
};
#define FT_DEFINE_SERVICEDESCREC5(class_, serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, serv_id_5, serv_data_5) \
static const FT_ServiceDescRec class_[] = \
{ \
{serv_id_1, serv_data_1}, \
{serv_id_2, serv_data_2}, \
{serv_id_3, serv_data_3}, \
{serv_id_4, serv_data_4}, \
{serv_id_5, serv_data_5}, \
{NULL, NULL} \
};
#define FT_DEFINE_SERVICEDESCREC6(class_, serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, serv_id_5, serv_data_5, \
serv_id_6, serv_data_6) \
static const FT_ServiceDescRec class_[] = \
{ \
{serv_id_1, serv_data_1}, \
{serv_id_2, serv_data_2}, \
{serv_id_3, serv_data_3}, \
{serv_id_4, serv_data_4}, \
{serv_id_5, serv_data_5}, \
{serv_id_6, serv_data_6}, \
{NULL, NULL} \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_SERVICEDESCREC1(class_, serv_id_1, serv_data_1) \
void \
FT_Destroy_Class_##class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_##class_( FT_Library library, \
FT_ServiceDescRec** output_class) \
{ \
FT_ServiceDescRec* clazz; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
if ( FT_ALLOC( clazz, sizeof(*clazz)*2 ) ) \
return error; \
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = NULL; \
clazz[1].serv_data = NULL; \
*output_class = clazz; \
return FT_Err_Ok; \
}
 
#define FT_DEFINE_SERVICEDESCREC2(class_, serv_id_1, serv_data_1, \
serv_id_2, serv_data_2) \
void \
FT_Destroy_Class_##class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_##class_( FT_Library library, \
FT_ServiceDescRec** output_class) \
{ \
FT_ServiceDescRec* clazz; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
if ( FT_ALLOC( clazz, sizeof(*clazz)*3 ) ) \
return error; \
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = NULL; \
clazz[2].serv_data = NULL; \
*output_class = clazz; \
return FT_Err_Ok; \
}
 
#define FT_DEFINE_SERVICEDESCREC3(class_, serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, serv_id_3, serv_data_3) \
void \
FT_Destroy_Class_##class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_##class_( FT_Library library, \
FT_ServiceDescRec** output_class) \
{ \
FT_ServiceDescRec* clazz; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
if ( FT_ALLOC( clazz, sizeof(*clazz)*4 ) ) \
return error; \
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = NULL; \
clazz[3].serv_data = NULL; \
*output_class = clazz; \
return FT_Err_Ok; \
}
 
#define FT_DEFINE_SERVICEDESCREC4(class_, serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, serv_id_3, serv_data_3, \
serv_id_4, serv_data_4) \
void \
FT_Destroy_Class_##class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_##class_( FT_Library library, \
FT_ServiceDescRec** output_class) \
{ \
FT_ServiceDescRec* clazz; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
if ( FT_ALLOC( clazz, sizeof(*clazz)*5 ) ) \
return error; \
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = NULL; \
clazz[4].serv_data = NULL; \
*output_class = clazz; \
return FT_Err_Ok; \
}
 
#define FT_DEFINE_SERVICEDESCREC5(class_, serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, serv_id_3, serv_data_3, serv_id_4, \
serv_data_4, serv_id_5, serv_data_5) \
void \
FT_Destroy_Class_##class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_##class_( FT_Library library, \
FT_ServiceDescRec** output_class) \
{ \
FT_ServiceDescRec* clazz; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
if ( FT_ALLOC( clazz, sizeof(*clazz)*6 ) ) \
return error; \
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = NULL; \
clazz[5].serv_data = NULL; \
*output_class = clazz; \
return FT_Err_Ok; \
}
 
#define FT_DEFINE_SERVICEDESCREC6(class_, serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, serv_id_5, serv_data_5, \
serv_id_6, serv_data_6) \
void \
FT_Destroy_Class_##class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_##class_( FT_Library library, \
FT_ServiceDescRec** output_class) \
{ \
FT_ServiceDescRec* clazz; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
if ( FT_ALLOC( clazz, sizeof(*clazz)*7 ) ) \
return error; \
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = serv_id_6; \
clazz[5].serv_data = serv_data_6; \
clazz[6].serv_id = NULL; \
clazz[6].serv_data = NULL; \
*output_class = clazz; \
return FT_Err_Ok; \
}
#endif /* FT_CONFIG_OPTION_PIC */
 
/*
* Parse a list of FT_ServiceDescRec descriptors and look for
* a specific service by ID. Note that the last element in the
* array must be { NULL, NULL }, and that the function should
* return NULL if the service isn't available.
*
* This function can be used by modules to implement their
* `get_service' method.
*/
FT_BASE( FT_Pointer )
ft_service_list_lookup( FT_ServiceDesc service_descriptors,
const char* service_id );
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** S E R V I C E S C A C H E *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
/*
* This structure is used to store a cache for several frequently used
* services. It is the type of `face->internal->services'. You
* should only use FT_FACE_LOOKUP_SERVICE to access it.
*
* All fields should have the type FT_Pointer to relax compilation
* dependencies. We assume the developer isn't completely stupid.
*
* Each field must be named `service_XXXX' where `XXX' corresponds to
* the correct FT_SERVICE_ID_XXXX macro. See the definition of
* FT_FACE_LOOKUP_SERVICE below how this is implemented.
*
*/
typedef struct FT_ServiceCacheRec_
{
FT_Pointer service_POSTSCRIPT_FONT_NAME;
FT_Pointer service_MULTI_MASTERS;
FT_Pointer service_GLYPH_DICT;
FT_Pointer service_PFR_METRICS;
FT_Pointer service_WINFNT;
 
} FT_ServiceCacheRec, *FT_ServiceCache;
 
 
/*
* A magic number used within the services cache.
*/
#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)-2) /* magic number */
 
 
/*
* @macro:
* FT_FACE_LOOKUP_SERVICE
*
* @description:
* This macro is used to lookup a service from a face's driver module
* using its cache.
*
* @input:
* face::
* The source face handle containing the cache.
*
* field ::
* The field name in the cache.
*
* id ::
* The service ID.
*
* @output:
* ptr ::
* A variable receiving the service data. NULL if not available.
*/
#ifdef __cplusplus
 
#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \
FT_Pointer svc; \
FT_Pointer* Pptr = (FT_Pointer*)&(ptr); \
\
\
svc = FT_FACE( face )->internal->services. service_ ## id; \
if ( svc == FT_SERVICE_UNAVAILABLE ) \
svc = NULL; \
else if ( svc == NULL ) \
{ \
FT_FACE_FIND_SERVICE( face, svc, id ); \
\
FT_FACE( face )->internal->services. service_ ## id = \
(FT_Pointer)( svc != NULL ? svc \
: FT_SERVICE_UNAVAILABLE ); \
} \
*Pptr = svc; \
FT_END_STMNT
 
#else /* !C++ */
 
#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \
FT_Pointer svc; \
\
\
svc = FT_FACE( face )->internal->services. service_ ## id; \
if ( svc == FT_SERVICE_UNAVAILABLE ) \
svc = NULL; \
else if ( svc == NULL ) \
{ \
FT_FACE_FIND_SERVICE( face, svc, id ); \
\
FT_FACE( face )->internal->services. service_ ## id = \
(FT_Pointer)( svc != NULL ? svc \
: FT_SERVICE_UNAVAILABLE ); \
} \
ptr = svc; \
FT_END_STMNT
 
#endif /* !C++ */
 
/*
* A macro used to define new service structure types.
*/
 
#define FT_DEFINE_SERVICE( name ) \
typedef struct FT_Service_ ## name ## Rec_ \
FT_Service_ ## name ## Rec ; \
typedef struct FT_Service_ ## name ## Rec_ \
const * FT_Service_ ## name ; \
struct FT_Service_ ## name ## Rec_
 
/* */
 
/*
* The header files containing the services.
*/
 
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
#define FT_SERVICE_CID_H <freetype/internal/services/svcid.h>
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h>
#define FT_SERVICE_OPENTYPE_VALIDATE_H <freetype/internal/services/svotval.h>
#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h>
#define FT_SERVICE_POSTSCRIPT_CMAPS_H <freetype/internal/services/svpscmap.h>
#define FT_SERVICE_POSTSCRIPT_INFO_H <freetype/internal/services/svpsinfo.h>
#define FT_SERVICE_POSTSCRIPT_NAME_H <freetype/internal/services/svpostnm.h>
#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h>
#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
#define FT_SERVICE_XFREE86_NAME_H <freetype/internal/services/svxf86nm.h>
#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
 
/* */
 
FT_END_HEADER
 
#endif /* __FTSERV_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/ftstream.h
0,0 → 1,539
/***************************************************************************/
/* */
/* ftstream.h */
/* */
/* Stream handling (specification). */
/* */
/* Copyright 1996-2001, 2002, 2004, 2005, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTSTREAM_H__
#define __FTSTREAM_H__
 
 
#include <ft2build.h>
#include FT_SYSTEM_H
#include FT_INTERNAL_OBJECTS_H
 
 
FT_BEGIN_HEADER
 
 
/* format of an 8-bit frame_op value: */
/* */
/* bit 76543210 */
/* xxxxxxes */
/* */
/* s is set to 1 if the value is signed. */
/* e is set to 1 if the value is little-endian. */
/* xxx is a command. */
 
#define FT_FRAME_OP_SHIFT 2
#define FT_FRAME_OP_SIGNED 1
#define FT_FRAME_OP_LITTLE 2
#define FT_FRAME_OP_COMMAND( x ) ( x >> FT_FRAME_OP_SHIFT )
 
#define FT_MAKE_FRAME_OP( command, little, sign ) \
( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )
 
#define FT_FRAME_OP_END 0
#define FT_FRAME_OP_START 1 /* start a new frame */
#define FT_FRAME_OP_BYTE 2 /* read 1-byte value */
#define FT_FRAME_OP_SHORT 3 /* read 2-byte value */
#define FT_FRAME_OP_LONG 4 /* read 4-byte value */
#define FT_FRAME_OP_OFF3 5 /* read 3-byte value */
#define FT_FRAME_OP_BYTES 6 /* read a bytes sequence */
 
 
typedef enum FT_Frame_Op_
{
ft_frame_end = 0,
ft_frame_start = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),
 
ft_frame_byte = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 0 ),
ft_frame_schar = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 1 ),
 
ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),
ft_frame_short_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),
ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),
ft_frame_short_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),
 
ft_frame_ulong_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),
ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),
ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),
ft_frame_long_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),
 
ft_frame_uoff3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),
ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),
ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),
ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),
 
ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),
ft_frame_skip = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )
 
} FT_Frame_Op;
 
 
typedef struct FT_Frame_Field_
{
FT_Byte value;
FT_Byte size;
FT_UShort offset;
 
} FT_Frame_Field;
 
 
/* Construct an FT_Frame_Field out of a structure type and a field name. */
/* The structure type must be set in the FT_STRUCTURE macro before */
/* calling the FT_FRAME_START() macro. */
/* */
#define FT_FIELD_SIZE( f ) \
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )
 
#define FT_FIELD_SIZE_DELTA( f ) \
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )
 
#define FT_FIELD_OFFSET( f ) \
(FT_UShort)( offsetof( FT_STRUCTURE, f ) )
 
#define FT_FRAME_FIELD( frame_op, field ) \
{ \
frame_op, \
FT_FIELD_SIZE( field ), \
FT_FIELD_OFFSET( field ) \
}
 
#define FT_MAKE_EMPTY_FIELD( frame_op ) { frame_op, 0, 0 }
 
#define FT_FRAME_START( size ) { ft_frame_start, 0, size }
#define FT_FRAME_END { ft_frame_end, 0, 0 }
 
#define FT_FRAME_LONG( f ) FT_FRAME_FIELD( ft_frame_long_be, f )
#define FT_FRAME_ULONG( f ) FT_FRAME_FIELD( ft_frame_ulong_be, f )
#define FT_FRAME_SHORT( f ) FT_FRAME_FIELD( ft_frame_short_be, f )
#define FT_FRAME_USHORT( f ) FT_FRAME_FIELD( ft_frame_ushort_be, f )
#define FT_FRAME_OFF3( f ) FT_FRAME_FIELD( ft_frame_off3_be, f )
#define FT_FRAME_UOFF3( f ) FT_FRAME_FIELD( ft_frame_uoff3_be, f )
#define FT_FRAME_BYTE( f ) FT_FRAME_FIELD( ft_frame_byte, f )
#define FT_FRAME_CHAR( f ) FT_FRAME_FIELD( ft_frame_schar, f )
 
#define FT_FRAME_LONG_LE( f ) FT_FRAME_FIELD( ft_frame_long_le, f )
#define FT_FRAME_ULONG_LE( f ) FT_FRAME_FIELD( ft_frame_ulong_le, f )
#define FT_FRAME_SHORT_LE( f ) FT_FRAME_FIELD( ft_frame_short_le, f )
#define FT_FRAME_USHORT_LE( f ) FT_FRAME_FIELD( ft_frame_ushort_le, f )
#define FT_FRAME_OFF3_LE( f ) FT_FRAME_FIELD( ft_frame_off3_le, f )
#define FT_FRAME_UOFF3_LE( f ) FT_FRAME_FIELD( ft_frame_uoff3_le, f )
 
#define FT_FRAME_SKIP_LONG { ft_frame_long_be, 0, 0 }
#define FT_FRAME_SKIP_SHORT { ft_frame_short_be, 0, 0 }
#define FT_FRAME_SKIP_BYTE { ft_frame_byte, 0, 0 }
 
#define FT_FRAME_BYTES( field, count ) \
{ \
ft_frame_bytes, \
count, \
FT_FIELD_OFFSET( field ) \
}
 
#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
 
 
/*************************************************************************/
/* */
/* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */
/* type `char*' or equivalent (1-byte elements). */
/* */
 
#define FT_BYTE_( p, i ) ( ((const FT_Byte*)(p))[(i)] )
#define FT_INT8_( p, i ) ( ((const FT_Char*)(p))[(i)] )
 
#define FT_INT16( x ) ( (FT_Int16)(x) )
#define FT_UINT16( x ) ( (FT_UInt16)(x) )
#define FT_INT32( x ) ( (FT_Int32)(x) )
#define FT_UINT32( x ) ( (FT_UInt32)(x) )
 
#define FT_BYTE_I16( p, i, s ) ( FT_INT16( FT_BYTE_( p, i ) ) << (s) )
#define FT_BYTE_U16( p, i, s ) ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )
#define FT_BYTE_I32( p, i, s ) ( FT_INT32( FT_BYTE_( p, i ) ) << (s) )
#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
 
#define FT_INT8_I16( p, i, s ) ( FT_INT16( FT_INT8_( p, i ) ) << (s) )
#define FT_INT8_U16( p, i, s ) ( FT_UINT16( FT_INT8_( p, i ) ) << (s) )
#define FT_INT8_I32( p, i, s ) ( FT_INT32( FT_INT8_( p, i ) ) << (s) )
#define FT_INT8_U32( p, i, s ) ( FT_UINT32( FT_INT8_( p, i ) ) << (s) )
 
 
#define FT_PEEK_SHORT( p ) FT_INT16( FT_INT8_I16( p, 0, 8) | \
FT_BYTE_I16( p, 1, 0) )
 
#define FT_PEEK_USHORT( p ) FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
FT_BYTE_U16( p, 1, 0 ) )
 
#define FT_PEEK_LONG( p ) FT_INT32( FT_INT8_I32( p, 0, 24 ) | \
FT_BYTE_I32( p, 1, 16 ) | \
FT_BYTE_I32( p, 2, 8 ) | \
FT_BYTE_I32( p, 3, 0 ) )
 
#define FT_PEEK_ULONG( p ) FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \
FT_BYTE_U32( p, 1, 16 ) | \
FT_BYTE_U32( p, 2, 8 ) | \
FT_BYTE_U32( p, 3, 0 ) )
 
#define FT_PEEK_OFF3( p ) FT_INT32( FT_INT8_I32( p, 0, 16 ) | \
FT_BYTE_I32( p, 1, 8 ) | \
FT_BYTE_I32( p, 2, 0 ) )
 
#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 2, 0 ) )
 
#define FT_PEEK_SHORT_LE( p ) FT_INT16( FT_INT8_I16( p, 1, 8 ) | \
FT_BYTE_I16( p, 0, 0 ) )
 
#define FT_PEEK_USHORT_LE( p ) FT_UINT16( FT_BYTE_U16( p, 1, 8 ) | \
FT_BYTE_U16( p, 0, 0 ) )
 
#define FT_PEEK_LONG_LE( p ) FT_INT32( FT_INT8_I32( p, 3, 24 ) | \
FT_BYTE_I32( p, 2, 16 ) | \
FT_BYTE_I32( p, 1, 8 ) | \
FT_BYTE_I32( p, 0, 0 ) )
 
#define FT_PEEK_ULONG_LE( p ) FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \
FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
 
#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_INT8_I32( p, 2, 16 ) | \
FT_BYTE_I32( p, 1, 8 ) | \
FT_BYTE_I32( p, 0, 0 ) )
 
#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
 
 
#define FT_NEXT_CHAR( buffer ) \
( (signed char)*buffer++ )
 
#define FT_NEXT_BYTE( buffer ) \
( (unsigned char)*buffer++ )
 
#define FT_NEXT_SHORT( buffer ) \
( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )
 
#define FT_NEXT_USHORT( buffer ) \
( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )
 
#define FT_NEXT_OFF3( buffer ) \
( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )
 
#define FT_NEXT_UOFF3( buffer ) \
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )
 
#define FT_NEXT_LONG( buffer ) \
( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )
 
#define FT_NEXT_ULONG( buffer ) \
( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )
 
 
#define FT_NEXT_SHORT_LE( buffer ) \
( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )
 
#define FT_NEXT_USHORT_LE( buffer ) \
( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )
 
#define FT_NEXT_OFF3_LE( buffer ) \
( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )
 
#define FT_NEXT_UOFF3_LE( buffer ) \
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )
 
#define FT_NEXT_LONG_LE( buffer ) \
( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )
 
#define FT_NEXT_ULONG_LE( buffer ) \
( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
 
 
/*************************************************************************/
/* */
/* Each GET_xxxx() macro uses an implicit `stream' variable. */
/* */
#if 0
#define FT_GET_MACRO( type ) FT_NEXT_ ## type ( stream->cursor )
 
#define FT_GET_CHAR() FT_GET_MACRO( CHAR )
#define FT_GET_BYTE() FT_GET_MACRO( BYTE )
#define FT_GET_SHORT() FT_GET_MACRO( SHORT )
#define FT_GET_USHORT() FT_GET_MACRO( USHORT )
#define FT_GET_OFF3() FT_GET_MACRO( OFF3 )
#define FT_GET_UOFF3() FT_GET_MACRO( UOFF3 )
#define FT_GET_LONG() FT_GET_MACRO( LONG )
#define FT_GET_ULONG() FT_GET_MACRO( ULONG )
#define FT_GET_TAG4() FT_GET_MACRO( ULONG )
 
#define FT_GET_SHORT_LE() FT_GET_MACRO( SHORT_LE )
#define FT_GET_USHORT_LE() FT_GET_MACRO( USHORT_LE )
#define FT_GET_LONG_LE() FT_GET_MACRO( LONG_LE )
#define FT_GET_ULONG_LE() FT_GET_MACRO( ULONG_LE )
 
#else
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
 
#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetShort, FT_Short )
#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetShort, FT_UShort )
#define FT_GET_OFF3() FT_GET_MACRO( FT_Stream_GetOffset, FT_Long )
#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetOffset, FT_ULong )
#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetLong, FT_Long )
#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetLong, FT_ULong )
#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetLong, FT_ULong )
 
#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetShortLE, FT_Short )
#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetShortLE, FT_UShort )
#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetLongLE, FT_Long )
#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetLongLE, FT_ULong )
#endif
 
#define FT_READ_MACRO( func, type, var ) \
( var = (type)func( stream, &error ), \
error != FT_Err_Ok )
 
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadShort, FT_Short, var )
#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadShort, FT_UShort, var )
#define FT_READ_OFF3( var ) FT_READ_MACRO( FT_Stream_ReadOffset, FT_Long, var )
#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadOffset, FT_ULong, var )
#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadLong, FT_Long, var )
#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadLong, FT_ULong, var )
 
#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadShortLE, FT_Short, var )
#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadShortLE, FT_UShort, var )
#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadLongLE, FT_Long, var )
#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadLongLE, FT_ULong, var )
 
 
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
 
/* initialize a stream for reading a regular system stream */
FT_BASE( FT_Error )
FT_Stream_Open( FT_Stream stream,
const char* filepathname );
 
#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
 
 
/* create a new (input) stream from an FT_Open_Args structure */
FT_BASE( FT_Error )
FT_Stream_New( FT_Library library,
const FT_Open_Args* args,
FT_Stream *astream );
 
/* free a stream */
FT_BASE( void )
FT_Stream_Free( FT_Stream stream,
FT_Int external );
 
/* initialize a stream for reading in-memory data */
FT_BASE( void )
FT_Stream_OpenMemory( FT_Stream stream,
const FT_Byte* base,
FT_ULong size );
 
/* close a stream (does not destroy the stream structure) */
FT_BASE( void )
FT_Stream_Close( FT_Stream stream );
 
 
/* seek within a stream. position is relative to start of stream */
FT_BASE( FT_Error )
FT_Stream_Seek( FT_Stream stream,
FT_ULong pos );
 
/* skip bytes in a stream */
FT_BASE( FT_Error )
FT_Stream_Skip( FT_Stream stream,
FT_Long distance );
 
/* return current stream position */
FT_BASE( FT_Long )
FT_Stream_Pos( FT_Stream stream );
 
/* read bytes from a stream into a user-allocated buffer, returns an */
/* error if not all bytes could be read. */
FT_BASE( FT_Error )
FT_Stream_Read( FT_Stream stream,
FT_Byte* buffer,
FT_ULong count );
 
/* read bytes from a stream at a given position */
FT_BASE( FT_Error )
FT_Stream_ReadAt( FT_Stream stream,
FT_ULong pos,
FT_Byte* buffer,
FT_ULong count );
 
/* try to read bytes at the end of a stream; return number of bytes */
/* really available */
FT_BASE( FT_ULong )
FT_Stream_TryRead( FT_Stream stream,
FT_Byte* buffer,
FT_ULong count );
 
/* Enter a frame of `count' consecutive bytes in a stream. Returns an */
/* error if the frame could not be read/accessed. The caller can use */
/* the FT_Stream_Get_XXX functions to retrieve frame data without */
/* error checks. */
/* */
/* You must _always_ call FT_Stream_ExitFrame() once you have entered */
/* a stream frame! */
/* */
FT_BASE( FT_Error )
FT_Stream_EnterFrame( FT_Stream stream,
FT_ULong count );
 
/* exit a stream frame */
FT_BASE( void )
FT_Stream_ExitFrame( FT_Stream stream );
 
/* Extract a stream frame. If the stream is disk-based, a heap block */
/* is allocated and the frame bytes are read into it. If the stream */
/* is memory-based, this function simply set a pointer to the data. */
/* */
/* Useful to optimize access to memory-based streams transparently. */
/* */
/* All extracted frames must be `freed' with a call to the function */
/* FT_Stream_ReleaseFrame(). */
/* */
FT_BASE( FT_Error )
FT_Stream_ExtractFrame( FT_Stream stream,
FT_ULong count,
FT_Byte** pbytes );
 
/* release an extract frame (see FT_Stream_ExtractFrame) */
FT_BASE( void )
FT_Stream_ReleaseFrame( FT_Stream stream,
FT_Byte** pbytes );
 
/* read a byte from an entered frame */
FT_BASE( FT_Char )
FT_Stream_GetChar( FT_Stream stream );
 
/* read a 16-bit big-endian integer from an entered frame */
FT_BASE( FT_Short )
FT_Stream_GetShort( FT_Stream stream );
 
/* read a 24-bit big-endian integer from an entered frame */
FT_BASE( FT_Long )
FT_Stream_GetOffset( FT_Stream stream );
 
/* read a 32-bit big-endian integer from an entered frame */
FT_BASE( FT_Long )
FT_Stream_GetLong( FT_Stream stream );
 
/* read a 16-bit little-endian integer from an entered frame */
FT_BASE( FT_Short )
FT_Stream_GetShortLE( FT_Stream stream );
 
/* read a 32-bit little-endian integer from an entered frame */
FT_BASE( FT_Long )
FT_Stream_GetLongLE( FT_Stream stream );
 
 
/* read a byte from a stream */
FT_BASE( FT_Char )
FT_Stream_ReadChar( FT_Stream stream,
FT_Error* error );
 
/* read a 16-bit big-endian integer from a stream */
FT_BASE( FT_Short )
FT_Stream_ReadShort( FT_Stream stream,
FT_Error* error );
 
/* read a 24-bit big-endian integer from a stream */
FT_BASE( FT_Long )
FT_Stream_ReadOffset( FT_Stream stream,
FT_Error* error );
 
/* read a 32-bit big-endian integer from a stream */
FT_BASE( FT_Long )
FT_Stream_ReadLong( FT_Stream stream,
FT_Error* error );
 
/* read a 16-bit little-endian integer from a stream */
FT_BASE( FT_Short )
FT_Stream_ReadShortLE( FT_Stream stream,
FT_Error* error );
 
/* read a 32-bit little-endian integer from a stream */
FT_BASE( FT_Long )
FT_Stream_ReadLongLE( FT_Stream stream,
FT_Error* error );
 
/* Read a structure from a stream. The structure must be described */
/* by an array of FT_Frame_Field records. */
FT_BASE( FT_Error )
FT_Stream_ReadFields( FT_Stream stream,
const FT_Frame_Field* fields,
void* structure );
 
 
#define FT_STREAM_POS() \
FT_Stream_Pos( stream )
 
#define FT_STREAM_SEEK( position ) \
FT_SET_ERROR( FT_Stream_Seek( stream, position ) )
 
#define FT_STREAM_SKIP( distance ) \
FT_SET_ERROR( FT_Stream_Skip( stream, distance ) )
 
#define FT_STREAM_READ( buffer, count ) \
FT_SET_ERROR( FT_Stream_Read( stream, \
(FT_Byte*)buffer, \
count ) )
 
#define FT_STREAM_READ_AT( position, buffer, count ) \
FT_SET_ERROR( FT_Stream_ReadAt( stream, \
position, \
(FT_Byte*)buffer, \
count ) )
 
#define FT_STREAM_READ_FIELDS( fields, object ) \
FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
 
 
#define FT_FRAME_ENTER( size ) \
FT_SET_ERROR( \
FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, size ) ) )
 
#define FT_FRAME_EXIT() \
FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
 
#define FT_FRAME_EXTRACT( size, bytes ) \
FT_SET_ERROR( \
FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, size, \
(FT_Byte**)&(bytes) ) ) )
 
#define FT_FRAME_RELEASE( bytes ) \
FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream, \
(FT_Byte**)&(bytes) ) )
 
 
FT_END_HEADER
 
#endif /* __FTSTREAM_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/fttrace.h
0,0 → 1,139
/***************************************************************************/
/* */
/* fttrace.h */
/* */
/* Tracing handling (specification only). */
/* */
/* Copyright 2002, 2004, 2005, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/* definitions of trace levels for FreeType 2 */
 
/* the first level must always be `trace_any' */
FT_TRACE_DEF( any )
 
/* base components */
FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */
FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */
FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */
FT_TRACE_DEF( io ) /* i/o interface (ftsystem.c) */
FT_TRACE_DEF( list ) /* list management (ftlist.c) */
FT_TRACE_DEF( init ) /* initialization (ftinit.c) */
FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */
FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */
FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */
FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */
 
FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
 
/* Cache sub-system */
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
 
/* SFNT driver components */
FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */
FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */
FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
 
/* TrueType driver components */
FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */
FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.c) */
FT_TRACE_DEF( ttinterp ) /* bytecode interpreter (ttinterp.c) */
FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */
FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */
FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */
 
/* Type 1 driver components */
FT_TRACE_DEF( t1afm )
FT_TRACE_DEF( t1driver )
FT_TRACE_DEF( t1gload )
FT_TRACE_DEF( t1hint )
FT_TRACE_DEF( t1load )
FT_TRACE_DEF( t1objs )
FT_TRACE_DEF( t1parse )
 
/* PostScript helper module `psaux' */
FT_TRACE_DEF( t1decode )
FT_TRACE_DEF( psobjs )
 
/* PostScript hinting module `pshinter' */
FT_TRACE_DEF( pshrec )
FT_TRACE_DEF( pshalgo1 )
FT_TRACE_DEF( pshalgo2 )
 
/* Type 2 driver components */
FT_TRACE_DEF( cffdriver )
FT_TRACE_DEF( cffgload )
FT_TRACE_DEF( cffload )
FT_TRACE_DEF( cffobjs )
FT_TRACE_DEF( cffparse )
 
/* Type 42 driver component */
FT_TRACE_DEF( t42 )
 
/* CID driver components */
FT_TRACE_DEF( cidafm )
FT_TRACE_DEF( ciddriver )
FT_TRACE_DEF( cidgload )
FT_TRACE_DEF( cidload )
FT_TRACE_DEF( cidobjs )
FT_TRACE_DEF( cidparse )
 
/* Windows font component */
FT_TRACE_DEF( winfnt )
 
/* PCF font components */
FT_TRACE_DEF( pcfdriver )
FT_TRACE_DEF( pcfread )
 
/* BDF font components */
FT_TRACE_DEF( bdfdriver )
FT_TRACE_DEF( bdflib )
 
/* PFR font component */
FT_TRACE_DEF( pfr )
 
/* OpenType validation components */
FT_TRACE_DEF( otvmodule )
FT_TRACE_DEF( otvcommon )
FT_TRACE_DEF( otvbase )
FT_TRACE_DEF( otvgdef )
FT_TRACE_DEF( otvgpos )
FT_TRACE_DEF( otvgsub )
FT_TRACE_DEF( otvjstf )
FT_TRACE_DEF( otvmath )
 
/* TrueTypeGX/AAT validation components */
FT_TRACE_DEF( gxvmodule )
FT_TRACE_DEF( gxvcommon )
FT_TRACE_DEF( gxvfeat )
FT_TRACE_DEF( gxvmort )
FT_TRACE_DEF( gxvmorx )
FT_TRACE_DEF( gxvbsln )
FT_TRACE_DEF( gxvjust )
FT_TRACE_DEF( gxvkern )
FT_TRACE_DEF( gxvopbd )
FT_TRACE_DEF( gxvtrak )
FT_TRACE_DEF( gxvprop )
FT_TRACE_DEF( gxvlcar )
 
 
/* END */
/contrib/media/updf/include/freetype/internal/ftvalid.h
0,0 → 1,150
/***************************************************************************/
/* */
/* ftvalid.h */
/* */
/* FreeType validation support (specification). */
/* */
/* Copyright 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __FTVALID_H__
#define __FTVALID_H__
 
#include <ft2build.h>
#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** V A L I D A T I O N ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
/* handle to a validation object */
typedef struct FT_ValidatorRec_ volatile* FT_Validator;
 
 
/*************************************************************************/
/* */
/* There are three distinct validation levels defined here: */
/* */
/* FT_VALIDATE_DEFAULT :: */
/* A table that passes this validation level can be used reliably by */
/* FreeType. It generally means that all offsets have been checked to */
/* prevent out-of-bound reads, that array counts are correct, etc. */
/* */
/* FT_VALIDATE_TIGHT :: */
/* A table that passes this validation level can be used reliably and */
/* doesn't contain invalid data. For example, a charmap table that */
/* returns invalid glyph indices will not pass, even though it can */
/* be used with FreeType in default mode (the library will simply */
/* return an error later when trying to load the glyph). */
/* */
/* It also checks that fields which must be a multiple of 2, 4, or 8, */
/* don't have incorrect values, etc. */
/* */
/* FT_VALIDATE_PARANOID :: */
/* Only for font debugging. Checks that a table follows the */
/* specification by 100%. Very few fonts will be able to pass this */
/* level anyway but it can be useful for certain tools like font */
/* editors/converters. */
/* */
typedef enum FT_ValidationLevel_
{
FT_VALIDATE_DEFAULT = 0,
FT_VALIDATE_TIGHT,
FT_VALIDATE_PARANOID
 
} FT_ValidationLevel;
 
 
/* validator structure */
typedef struct FT_ValidatorRec_
{
const FT_Byte* base; /* address of table in memory */
const FT_Byte* limit; /* `base' + sizeof(table) in memory */
FT_ValidationLevel level; /* validation level */
FT_Error error; /* error returned. 0 means success */
 
ft_jmp_buf jump_buffer; /* used for exception handling */
 
} FT_ValidatorRec;
 
 
#define FT_VALIDATOR( x ) ((FT_Validator)( x ))
 
 
FT_BASE( void )
ft_validator_init( FT_Validator valid,
const FT_Byte* base,
const FT_Byte* limit,
FT_ValidationLevel level );
 
/* Do not use this. It's broken and will cause your validator to crash */
/* if you run it on an invalid font. */
FT_BASE( FT_Int )
ft_validator_run( FT_Validator valid );
 
/* Sets the error field in a validator, then calls `longjmp' to return */
/* to high-level caller. Using `setjmp/longjmp' avoids many stupid */
/* error checks within the validation routines. */
/* */
FT_BASE( void )
ft_validator_error( FT_Validator valid,
FT_Error error );
 
 
/* Calls ft_validate_error. Assumes that the `valid' local variable */
/* holds a pointer to the current validator object. */
/* */
/* Use preprocessor prescan to pass FT_ERR_PREFIX. */
/* */
#define FT_INVALID( _prefix, _error ) FT_INVALID_( _prefix, _error )
#define FT_INVALID_( _prefix, _error ) \
ft_validator_error( valid, _prefix ## _error )
 
/* called when a broken table is detected */
#define FT_INVALID_TOO_SHORT \
FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
 
/* called when an invalid offset is detected */
#define FT_INVALID_OFFSET \
FT_INVALID( FT_ERR_PREFIX, Invalid_Offset )
 
/* called when an invalid format/value is detected */
#define FT_INVALID_FORMAT \
FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
 
/* called when an invalid glyph index is detected */
#define FT_INVALID_GLYPH_ID \
FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index )
 
/* called when an invalid field value is detected */
#define FT_INVALID_DATA \
FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
 
 
FT_END_HEADER
 
#endif /* __FTVALID_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/internal.h
0,0 → 1,51
/***************************************************************************/
/* */
/* internal.h */
/* */
/* Internal header files (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* This file is automatically included by `ft2build.h'. */
/* Do not include it manually! */
/* */
/*************************************************************************/
 
 
#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h>
#define FT_INTERNAL_PIC_H <freetype/internal/ftpic.h>
#define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h>
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
#define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h>
#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h>
#define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h>
#define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h>
#define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h>
#define FT_INTERNAL_SERVICE_H <freetype/internal/ftserv.h>
#define FT_INTERNAL_RFORK_H <freetype/internal/ftrfork.h>
#define FT_INTERNAL_VALIDATE_H <freetype/internal/ftvalid.h>
 
#define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h>
#define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h>
 
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>
#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h>
 
#define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h>
 
 
/* END */
/contrib/media/updf/include/freetype/internal/pcftypes.h
0,0 → 1,56
/* pcftypes.h
 
FreeType font driver for pcf fonts
 
Copyright (C) 2000, 2001, 2002 by
Francesco Zappa Nardelli
 
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
 
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
 
 
#ifndef __PCFTYPES_H__
#define __PCFTYPES_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
 
FT_BEGIN_HEADER
 
 
typedef struct PCF_Public_FaceRec_
{
FT_FaceRec root;
FT_StreamRec gzip_stream;
FT_Stream gzip_source;
 
char* charset_encoding;
char* charset_registry;
 
} PCF_Public_FaceRec, *PCF_Public_Face;
 
 
FT_END_HEADER
 
#endif /* __PCFTYPES_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/psaux.h
0,0 → 1,873
/***************************************************************************/
/* */
/* psaux.h */
/* */
/* Auxiliary functions and data structures related to PostScript fonts */
/* (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __PSAUX_H__
#define __PSAUX_H__
 
 
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_TYPE1_TYPES_H
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** T1_TABLE *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
 
typedef struct PS_TableRec_* PS_Table;
typedef const struct PS_Table_FuncsRec_* PS_Table_Funcs;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* PS_Table_FuncsRec */
/* */
/* <Description> */
/* A set of function pointers to manage PS_Table objects. */
/* */
/* <Fields> */
/* table_init :: Used to initialize a table. */
/* */
/* table_done :: Finalizes resp. destroy a given table. */
/* */
/* table_add :: Adds a new object to a table. */
/* */
/* table_release :: Releases table data, then finalizes it. */
/* */
typedef struct PS_Table_FuncsRec_
{
FT_Error
(*init)( PS_Table table,
FT_Int count,
FT_Memory memory );
 
void
(*done)( PS_Table table );
 
FT_Error
(*add)( PS_Table table,
FT_Int idx,
void* object,
FT_PtrDist length );
 
void
(*release)( PS_Table table );
 
} PS_Table_FuncsRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* PS_TableRec */
/* */
/* <Description> */
/* A PS_Table is a simple object used to store an array of objects in */
/* a single memory block. */
/* */
/* <Fields> */
/* block :: The address in memory of the growheap's block. This */
/* can change between two object adds, due to */
/* reallocation. */
/* */
/* cursor :: The current top of the grow heap within its block. */
/* */
/* capacity :: The current size of the heap block. Increments by */
/* 1kByte chunks. */
/* */
/* max_elems :: The maximum number of elements in table. */
/* */
/* num_elems :: The current number of elements in table. */
/* */
/* elements :: A table of element addresses within the block. */
/* */
/* lengths :: A table of element sizes within the block. */
/* */
/* memory :: The object used for memory operations */
/* (alloc/realloc). */
/* */
/* funcs :: A table of method pointers for this object. */
/* */
typedef struct PS_TableRec_
{
FT_Byte* block; /* current memory block */
FT_Offset cursor; /* current cursor in memory block */
FT_Offset capacity; /* current size of memory block */
FT_Long init;
 
FT_Int max_elems;
FT_Int num_elems;
FT_Byte** elements; /* addresses of table elements */
FT_PtrDist* lengths; /* lengths of table elements */
 
FT_Memory memory;
PS_Table_FuncsRec funcs;
 
} PS_TableRec;
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** T1 FIELDS & TOKENS *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
typedef struct PS_ParserRec_* PS_Parser;
 
typedef struct T1_TokenRec_* T1_Token;
 
typedef struct T1_FieldRec_* T1_Field;
 
 
/* simple enumeration type used to identify token types */
typedef enum T1_TokenType_
{
T1_TOKEN_TYPE_NONE = 0,
T1_TOKEN_TYPE_ANY,
T1_TOKEN_TYPE_STRING,
T1_TOKEN_TYPE_ARRAY,
T1_TOKEN_TYPE_KEY, /* aka `name' */
 
/* do not remove */
T1_TOKEN_TYPE_MAX
 
} T1_TokenType;
 
 
/* a simple structure used to identify tokens */
typedef struct T1_TokenRec_
{
FT_Byte* start; /* first character of token in input stream */
FT_Byte* limit; /* first character after the token */
T1_TokenType type; /* type of token */
 
} T1_TokenRec;
 
 
/* enumeration type used to identify object fields */
typedef enum T1_FieldType_
{
T1_FIELD_TYPE_NONE = 0,
T1_FIELD_TYPE_BOOL,
T1_FIELD_TYPE_INTEGER,
T1_FIELD_TYPE_FIXED,
T1_FIELD_TYPE_FIXED_1000,
T1_FIELD_TYPE_STRING,
T1_FIELD_TYPE_KEY,
T1_FIELD_TYPE_BBOX,
T1_FIELD_TYPE_INTEGER_ARRAY,
T1_FIELD_TYPE_FIXED_ARRAY,
T1_FIELD_TYPE_CALLBACK,
 
/* do not remove */
T1_FIELD_TYPE_MAX
 
} T1_FieldType;
 
 
typedef enum T1_FieldLocation_
{
T1_FIELD_LOCATION_CID_INFO,
T1_FIELD_LOCATION_FONT_DICT,
T1_FIELD_LOCATION_FONT_EXTRA,
T1_FIELD_LOCATION_FONT_INFO,
T1_FIELD_LOCATION_PRIVATE,
T1_FIELD_LOCATION_BBOX,
T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE,
T1_FIELD_LOCATION_BLEND,
 
/* do not remove */
T1_FIELD_LOCATION_MAX
 
} T1_FieldLocation;
 
 
typedef void
(*T1_Field_ParseFunc)( FT_Face face,
FT_Pointer parser );
 
 
/* structure type used to model object fields */
typedef struct T1_FieldRec_
{
const char* ident; /* field identifier */
T1_FieldLocation location;
T1_FieldType type; /* type of field */
T1_Field_ParseFunc reader;
FT_UInt offset; /* offset of field in object */
FT_Byte size; /* size of field in bytes */
FT_UInt array_max; /* maximal number of elements for */
/* array */
FT_UInt count_offset; /* offset of element count for */
/* arrays; must not be zero if in */
/* use -- in other words, a */
/* `num_FOO' element must not */
/* start the used structure if we */
/* parse a `FOO' array */
FT_UInt dict; /* where we expect it */
} T1_FieldRec;
 
#define T1_FIELD_DICT_FONTDICT ( 1 << 0 ) /* also FontInfo and FDArray */
#define T1_FIELD_DICT_PRIVATE ( 1 << 1 )
 
 
 
#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \
{ \
_ident, T1CODE, _type, \
0, \
FT_FIELD_OFFSET( _fname ), \
FT_FIELD_SIZE( _fname ), \
0, 0, \
_dict \
},
 
#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \
{ \
_ident, T1CODE, T1_FIELD_TYPE_CALLBACK, \
(T1_Field_ParseFunc)_reader, \
0, 0, \
0, 0, \
_dict \
},
 
#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \
{ \
_ident, T1CODE, _type, \
0, \
FT_FIELD_OFFSET( _fname ), \
FT_FIELD_SIZE_DELTA( _fname ), \
_max, \
FT_FIELD_OFFSET( num_ ## _fname ), \
_dict \
},
 
#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \
{ \
_ident, T1CODE, _type, \
0, \
FT_FIELD_OFFSET( _fname ), \
FT_FIELD_SIZE_DELTA( _fname ), \
_max, 0, \
_dict \
},
 
 
#define T1_FIELD_BOOL( _ident, _fname, _dict ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname, _dict )
 
#define T1_FIELD_NUM( _ident, _fname, _dict ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname, _dict )
 
#define T1_FIELD_FIXED( _ident, _fname, _dict ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname, _dict )
 
#define T1_FIELD_FIXED_1000( _ident, _fname, _dict ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname, \
_dict )
 
#define T1_FIELD_STRING( _ident, _fname, _dict ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname, _dict )
 
#define T1_FIELD_KEY( _ident, _fname, _dict ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname, _dict )
 
#define T1_FIELD_BBOX( _ident, _fname, _dict ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname, _dict )
 
 
#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict ) \
T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
_fname, _fmax, _dict )
 
#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict ) \
T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
_fname, _fmax, _dict )
 
#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict ) \
T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
_fname, _fmax, _dict )
 
#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict ) \
T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
_fname, _fmax, _dict )
 
#define T1_FIELD_CALLBACK( _ident, _name, _dict ) \
T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** T1 PARSER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
typedef const struct PS_Parser_FuncsRec_* PS_Parser_Funcs;
 
typedef struct PS_Parser_FuncsRec_
{
void
(*init)( PS_Parser parser,
FT_Byte* base,
FT_Byte* limit,
FT_Memory memory );
 
void
(*done)( PS_Parser parser );
 
void
(*skip_spaces)( PS_Parser parser );
void
(*skip_PS_token)( PS_Parser parser );
 
FT_Long
(*to_int)( PS_Parser parser );
FT_Fixed
(*to_fixed)( PS_Parser parser,
FT_Int power_ten );
 
FT_Error
(*to_bytes)( PS_Parser parser,
FT_Byte* bytes,
FT_Offset max_bytes,
FT_Long* pnum_bytes,
FT_Bool delimiters );
 
FT_Int
(*to_coord_array)( PS_Parser parser,
FT_Int max_coords,
FT_Short* coords );
FT_Int
(*to_fixed_array)( PS_Parser parser,
FT_Int max_values,
FT_Fixed* values,
FT_Int power_ten );
 
void
(*to_token)( PS_Parser parser,
T1_Token token );
void
(*to_token_array)( PS_Parser parser,
T1_Token tokens,
FT_UInt max_tokens,
FT_Int* pnum_tokens );
 
FT_Error
(*load_field)( PS_Parser parser,
const T1_Field field,
void** objects,
FT_UInt max_objects,
FT_ULong* pflags );
 
FT_Error
(*load_field_table)( PS_Parser parser,
const T1_Field field,
void** objects,
FT_UInt max_objects,
FT_ULong* pflags );
 
} PS_Parser_FuncsRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* PS_ParserRec */
/* */
/* <Description> */
/* A PS_Parser is an object used to parse a Type 1 font very quickly. */
/* */
/* <Fields> */
/* cursor :: The current position in the text. */
/* */
/* base :: Start of the processed text. */
/* */
/* limit :: End of the processed text. */
/* */
/* error :: The last error returned. */
/* */
/* memory :: The object used for memory operations (alloc/realloc). */
/* */
/* funcs :: A table of functions for the parser. */
/* */
typedef struct PS_ParserRec_
{
FT_Byte* cursor;
FT_Byte* base;
FT_Byte* limit;
FT_Error error;
FT_Memory memory;
 
PS_Parser_FuncsRec funcs;
 
} PS_ParserRec;
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** T1 BUILDER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
 
typedef struct T1_BuilderRec_* T1_Builder;
 
 
typedef FT_Error
(*T1_Builder_Check_Points_Func)( T1_Builder builder,
FT_Int count );
 
typedef void
(*T1_Builder_Add_Point_Func)( T1_Builder builder,
FT_Pos x,
FT_Pos y,
FT_Byte flag );
 
typedef FT_Error
(*T1_Builder_Add_Point1_Func)( T1_Builder builder,
FT_Pos x,
FT_Pos y );
 
typedef FT_Error
(*T1_Builder_Add_Contour_Func)( T1_Builder builder );
 
typedef FT_Error
(*T1_Builder_Start_Point_Func)( T1_Builder builder,
FT_Pos x,
FT_Pos y );
 
typedef void
(*T1_Builder_Close_Contour_Func)( T1_Builder builder );
 
 
typedef const struct T1_Builder_FuncsRec_* T1_Builder_Funcs;
 
typedef struct T1_Builder_FuncsRec_
{
void
(*init)( T1_Builder builder,
FT_Face face,
FT_Size size,
FT_GlyphSlot slot,
FT_Bool hinting );
 
void
(*done)( T1_Builder builder );
 
T1_Builder_Check_Points_Func check_points;
T1_Builder_Add_Point_Func add_point;
T1_Builder_Add_Point1_Func add_point1;
T1_Builder_Add_Contour_Func add_contour;
T1_Builder_Start_Point_Func start_point;
T1_Builder_Close_Contour_Func close_contour;
 
} T1_Builder_FuncsRec;
 
 
/* an enumeration type to handle charstring parsing states */
typedef enum T1_ParseState_
{
T1_Parse_Start,
T1_Parse_Have_Width,
T1_Parse_Have_Moveto,
T1_Parse_Have_Path
 
} T1_ParseState;
 
 
/*************************************************************************/
/* */
/* <Structure> */
/* T1_BuilderRec */
/* */
/* <Description> */
/* A structure used during glyph loading to store its outline. */
/* */
/* <Fields> */
/* memory :: The current memory object. */
/* */
/* face :: The current face object. */
/* */
/* glyph :: The current glyph slot. */
/* */
/* loader :: XXX */
/* */
/* base :: The base glyph outline. */
/* */
/* current :: The current glyph outline. */
/* */
/* max_points :: maximum points in builder outline */
/* */
/* max_contours :: Maximal number of contours in builder outline. */
/* */
/* pos_x :: The horizontal translation (if composite glyph). */
/* */
/* pos_y :: The vertical translation (if composite glyph). */
/* */
/* left_bearing :: The left side bearing point. */
/* */
/* advance :: The horizontal advance vector. */
/* */
/* bbox :: Unused. */
/* */
/* parse_state :: An enumeration which controls the charstring */
/* parsing state. */
/* */
/* load_points :: If this flag is not set, no points are loaded. */
/* */
/* no_recurse :: Set but not used. */
/* */
/* metrics_only :: A boolean indicating that we only want to compute */
/* the metrics of a given glyph, not load all of its */
/* points. */
/* */
/* funcs :: An array of function pointers for the builder. */
/* */
typedef struct T1_BuilderRec_
{
FT_Memory memory;
FT_Face face;
FT_GlyphSlot glyph;
FT_GlyphLoader loader;
FT_Outline* base;
FT_Outline* current;
 
FT_Pos pos_x;
FT_Pos pos_y;
 
FT_Vector left_bearing;
FT_Vector advance;
 
FT_BBox bbox; /* bounding box */
T1_ParseState parse_state;
FT_Bool load_points;
FT_Bool no_recurse;
 
FT_Bool metrics_only;
 
void* hints_funcs; /* hinter-specific */
void* hints_globals; /* hinter-specific */
 
T1_Builder_FuncsRec funcs;
 
} T1_BuilderRec;
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** T1 DECODER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
#if 0
 
/*************************************************************************/
/* */
/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
/* calls during glyph loading. */
/* */
#define T1_MAX_SUBRS_CALLS 8
 
 
/*************************************************************************/
/* */
/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
/* minimum of 16 is required. */
/* */
#define T1_MAX_CHARSTRINGS_OPERANDS 32
 
#endif /* 0 */
 
 
typedef struct T1_Decoder_ZoneRec_
{
FT_Byte* cursor;
FT_Byte* base;
FT_Byte* limit;
 
} T1_Decoder_ZoneRec, *T1_Decoder_Zone;
 
 
typedef struct T1_DecoderRec_* T1_Decoder;
typedef const struct T1_Decoder_FuncsRec_* T1_Decoder_Funcs;
 
 
typedef FT_Error
(*T1_Decoder_Callback)( T1_Decoder decoder,
FT_UInt glyph_index );
 
 
typedef struct T1_Decoder_FuncsRec_
{
FT_Error
(*init)( T1_Decoder decoder,
FT_Face face,
FT_Size size,
FT_GlyphSlot slot,
FT_Byte** glyph_names,
PS_Blend blend,
FT_Bool hinting,
FT_Render_Mode hint_mode,
T1_Decoder_Callback callback );
 
void
(*done)( T1_Decoder decoder );
 
FT_Error
(*parse_charstrings)( T1_Decoder decoder,
FT_Byte* base,
FT_UInt len );
 
} T1_Decoder_FuncsRec;
 
 
typedef struct T1_DecoderRec_
{
T1_BuilderRec builder;
 
FT_Long stack[T1_MAX_CHARSTRINGS_OPERANDS];
FT_Long* top;
 
T1_Decoder_ZoneRec zones[T1_MAX_SUBRS_CALLS + 1];
T1_Decoder_Zone zone;
 
FT_Service_PsCMaps psnames; /* for seac */
FT_UInt num_glyphs;
FT_Byte** glyph_names;
 
FT_Int lenIV; /* internal for sub routine calls */
FT_UInt num_subrs;
FT_Byte** subrs;
FT_PtrDist* subrs_len; /* array of subrs length (optional) */
 
FT_Matrix font_matrix;
FT_Vector font_offset;
 
FT_Int flex_state;
FT_Int num_flex_vectors;
FT_Vector flex_vectors[7];
 
PS_Blend blend; /* for multiple master support */
 
FT_Render_Mode hint_mode;
 
T1_Decoder_Callback parse_callback;
T1_Decoder_FuncsRec funcs;
 
FT_Long* buildchar;
FT_UInt len_buildchar;
 
FT_Bool seac;
 
} T1_DecoderRec;
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** AFM PARSER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
typedef struct AFM_ParserRec_* AFM_Parser;
 
typedef struct AFM_Parser_FuncsRec_
{
FT_Error
(*init)( AFM_Parser parser,
FT_Memory memory,
FT_Byte* base,
FT_Byte* limit );
 
void
(*done)( AFM_Parser parser );
 
FT_Error
(*parse)( AFM_Parser parser );
 
} AFM_Parser_FuncsRec;
 
 
typedef struct AFM_StreamRec_* AFM_Stream;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* AFM_ParserRec */
/* */
/* <Description> */
/* An AFM_Parser is a parser for the AFM files. */
/* */
/* <Fields> */
/* memory :: The object used for memory operations (alloc and */
/* realloc). */
/* */
/* stream :: This is an opaque object. */
/* */
/* FontInfo :: The result will be stored here. */
/* */
/* get_index :: A user provided function to get a glyph index by its */
/* name. */
/* */
typedef struct AFM_ParserRec_
{
FT_Memory memory;
AFM_Stream stream;
 
AFM_FontInfo FontInfo;
 
FT_Int
(*get_index)( const char* name,
FT_Offset len,
void* user_data );
 
void* user_data;
 
} AFM_ParserRec;
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** TYPE1 CHARMAPS *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
typedef const struct T1_CMap_ClassesRec_* T1_CMap_Classes;
 
typedef struct T1_CMap_ClassesRec_
{
FT_CMap_Class standard;
FT_CMap_Class expert;
FT_CMap_Class custom;
FT_CMap_Class unicode;
 
} T1_CMap_ClassesRec;
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** PSAux Module Interface *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
typedef struct PSAux_ServiceRec_
{
/* don't use `PS_Table_Funcs' and friends to avoid compiler warnings */
const PS_Table_FuncsRec* ps_table_funcs;
const PS_Parser_FuncsRec* ps_parser_funcs;
const T1_Builder_FuncsRec* t1_builder_funcs;
const T1_Decoder_FuncsRec* t1_decoder_funcs;
 
void
(*t1_decrypt)( FT_Byte* buffer,
FT_Offset length,
FT_UShort seed );
 
T1_CMap_Classes t1_cmap_classes;
 
/* fields after this comment line were added after version 2.1.10 */
const AFM_Parser_FuncsRec* afm_parser_funcs;
 
} PSAux_ServiceRec, *PSAux_Service;
 
/* backwards-compatible type definition */
typedef PSAux_ServiceRec PSAux_Interface;
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** Some convenience functions *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
#define IS_PS_NEWLINE( ch ) \
( (ch) == '\r' || \
(ch) == '\n' )
 
#define IS_PS_SPACE( ch ) \
( (ch) == ' ' || \
IS_PS_NEWLINE( ch ) || \
(ch) == '\t' || \
(ch) == '\f' || \
(ch) == '\0' )
 
#define IS_PS_SPECIAL( ch ) \
( (ch) == '/' || \
(ch) == '(' || (ch) == ')' || \
(ch) == '<' || (ch) == '>' || \
(ch) == '[' || (ch) == ']' || \
(ch) == '{' || (ch) == '}' || \
(ch) == '%' )
 
#define IS_PS_DELIM( ch ) \
( IS_PS_SPACE( ch ) || \
IS_PS_SPECIAL( ch ) )
 
#define IS_PS_DIGIT( ch ) \
( (ch) >= '0' && (ch) <= '9' )
 
#define IS_PS_XDIGIT( ch ) \
( IS_PS_DIGIT( ch ) || \
( (ch) >= 'A' && (ch) <= 'F' ) || \
( (ch) >= 'a' && (ch) <= 'f' ) )
 
#define IS_PS_BASE85( ch ) \
( (ch) >= '!' && (ch) <= 'u' )
 
#define IS_PS_TOKEN( cur, limit, token ) \
( (char)(cur)[0] == (token)[0] && \
( (cur) + sizeof ( (token) ) == (limit) || \
( (cur) + sizeof( (token) ) < (limit) && \
IS_PS_DELIM( (cur)[sizeof ( (token) ) - 1] ) ) ) && \
ft_strncmp( (char*)(cur), (token), sizeof ( (token) ) - 1 ) == 0 )
 
 
FT_END_HEADER
 
#endif /* __PSAUX_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/pshints.h
0,0 → 1,712
/***************************************************************************/
/* */
/* pshints.h */
/* */
/* Interface to Postscript-specific (Type 1 and Type 2) hints */
/* recorders (specification only). These are used to support native */
/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */
/* */
/* Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __PSHINTS_H__
#define __PSHINTS_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_TYPE1_TABLES_H
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** INTERNAL REPRESENTATION OF GLOBALS *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
typedef struct PSH_GlobalsRec_* PSH_Globals;
 
typedef FT_Error
(*PSH_Globals_NewFunc)( FT_Memory memory,
T1_Private* private_dict,
PSH_Globals* aglobals );
 
typedef FT_Error
(*PSH_Globals_SetScaleFunc)( PSH_Globals globals,
FT_Fixed x_scale,
FT_Fixed y_scale,
FT_Fixed x_delta,
FT_Fixed y_delta );
 
typedef void
(*PSH_Globals_DestroyFunc)( PSH_Globals globals );
 
 
typedef struct PSH_Globals_FuncsRec_
{
PSH_Globals_NewFunc create;
PSH_Globals_SetScaleFunc set_scale;
PSH_Globals_DestroyFunc destroy;
 
} PSH_Globals_FuncsRec, *PSH_Globals_Funcs;
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** PUBLIC TYPE 1 HINTS RECORDER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
/*************************************************************************
*
* @type:
* T1_Hints
*
* @description:
* This is a handle to an opaque structure used to record glyph hints
* from a Type 1 character glyph character string.
*
* The methods used to operate on this object are defined by the
* @T1_Hints_FuncsRec structure. Recording glyph hints is normally
* achieved through the following scheme:
*
* - Open a new hint recording session by calling the `open' method.
* This rewinds the recorder and prepare it for new input.
*
* - For each hint found in the glyph charstring, call the corresponding
* method (`stem', `stem3', or `reset'). Note that these functions do
* not return an error code.
*
* - Close the recording session by calling the `close' method. It
* returns an error code if the hints were invalid or something
* strange happened (e.g., memory shortage).
*
* The hints accumulated in the object can later be used by the
* PostScript hinter.
*
*/
typedef struct T1_HintsRec_* T1_Hints;
 
 
/*************************************************************************
*
* @type:
* T1_Hints_Funcs
*
* @description:
* A pointer to the @T1_Hints_FuncsRec structure that defines the API of
* a given @T1_Hints object.
*
*/
typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs;
 
 
/*************************************************************************
*
* @functype:
* T1_Hints_OpenFunc
*
* @description:
* A method of the @T1_Hints class used to prepare it for a new Type 1
* hints recording session.
*
* @input:
* hints ::
* A handle to the Type 1 hints recorder.
*
* @note:
* You should always call the @T1_Hints_CloseFunc method in order to
* close an opened recording session.
*
*/
typedef void
(*T1_Hints_OpenFunc)( T1_Hints hints );
 
 
/*************************************************************************
*
* @functype:
* T1_Hints_SetStemFunc
*
* @description:
* A method of the @T1_Hints class used to record a new horizontal or
* vertical stem. This corresponds to the Type 1 `hstem' and `vstem'
* operators.
*
* @input:
* hints ::
* A handle to the Type 1 hints recorder.
*
* dimension ::
* 0 for horizontal stems (hstem), 1 for vertical ones (vstem).
*
* coords ::
* Array of 2 coordinates in 16.16 format, used as (position,length)
* stem descriptor.
*
* @note:
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
* horizontal coordinates (x) for vertical stems (dim=1).
*
* `coords[0]' is the absolute stem position (lowest coordinate);
* `coords[1]' is the length.
*
* The length can be negative, in which case it must be either -20 or
* -21. It is interpreted as a `ghost' stem, according to the Type 1
* specification.
*
* If the length is -21 (corresponding to a bottom ghost stem), then
* the real stem position is `coords[0]+coords[1]'.
*
*/
typedef void
(*T1_Hints_SetStemFunc)( T1_Hints hints,
FT_UInt dimension,
FT_Fixed* coords );
 
 
/*************************************************************************
*
* @functype:
* T1_Hints_SetStem3Func
*
* @description:
* A method of the @T1_Hints class used to record three
* counter-controlled horizontal or vertical stems at once.
*
* @input:
* hints ::
* A handle to the Type 1 hints recorder.
*
* dimension ::
* 0 for horizontal stems, 1 for vertical ones.
*
* coords ::
* An array of 6 values in 16.16 format, holding 3 (position,length)
* pairs for the counter-controlled stems.
*
* @note:
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
* horizontal coordinates (x) for vertical stems (dim=1).
*
* The lengths cannot be negative (ghost stems are never
* counter-controlled).
*
*/
typedef void
(*T1_Hints_SetStem3Func)( T1_Hints hints,
FT_UInt dimension,
FT_Fixed* coords );
 
 
/*************************************************************************
*
* @functype:
* T1_Hints_ResetFunc
*
* @description:
* A method of the @T1_Hints class used to reset the stems hints in a
* recording session.
*
* @input:
* hints ::
* A handle to the Type 1 hints recorder.
*
* end_point ::
* The index of the last point in the input glyph in which the
* previously defined hints apply.
*
*/
typedef void
(*T1_Hints_ResetFunc)( T1_Hints hints,
FT_UInt end_point );
 
 
/*************************************************************************
*
* @functype:
* T1_Hints_CloseFunc
*
* @description:
* A method of the @T1_Hints class used to close a hint recording
* session.
*
* @input:
* hints ::
* A handle to the Type 1 hints recorder.
*
* end_point ::
* The index of the last point in the input glyph.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* The error code is set to indicate that an error occurred during the
* recording session.
*
*/
typedef FT_Error
(*T1_Hints_CloseFunc)( T1_Hints hints,
FT_UInt end_point );
 
 
/*************************************************************************
*
* @functype:
* T1_Hints_ApplyFunc
*
* @description:
* A method of the @T1_Hints class used to apply hints to the
* corresponding glyph outline. Must be called once all hints have been
* recorded.
*
* @input:
* hints ::
* A handle to the Type 1 hints recorder.
*
* outline ::
* A pointer to the target outline descriptor.
*
* globals ::
* The hinter globals for this font.
*
* hint_mode ::
* Hinting information.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* On input, all points within the outline are in font coordinates. On
* output, they are in 1/64th of pixels.
*
* The scaling transformation is taken from the `globals' object which
* must correspond to the same font as the glyph.
*
*/
typedef FT_Error
(*T1_Hints_ApplyFunc)( T1_Hints hints,
FT_Outline* outline,
PSH_Globals globals,
FT_Render_Mode hint_mode );
 
 
/*************************************************************************
*
* @struct:
* T1_Hints_FuncsRec
*
* @description:
* The structure used to provide the API to @T1_Hints objects.
*
* @fields:
* hints ::
* A handle to the T1 Hints recorder.
*
* open ::
* The function to open a recording session.
*
* close ::
* The function to close a recording session.
*
* stem ::
* The function to set a simple stem.
*
* stem3 ::
* The function to set counter-controlled stems.
*
* reset ::
* The function to reset stem hints.
*
* apply ::
* The function to apply the hints to the corresponding glyph outline.
*
*/
typedef struct T1_Hints_FuncsRec_
{
T1_Hints hints;
T1_Hints_OpenFunc open;
T1_Hints_CloseFunc close;
T1_Hints_SetStemFunc stem;
T1_Hints_SetStem3Func stem3;
T1_Hints_ResetFunc reset;
T1_Hints_ApplyFunc apply;
 
} T1_Hints_FuncsRec;
 
 
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** PUBLIC TYPE 2 HINTS RECORDER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
 
/*************************************************************************
*
* @type:
* T2_Hints
*
* @description:
* This is a handle to an opaque structure used to record glyph hints
* from a Type 2 character glyph character string.
*
* The methods used to operate on this object are defined by the
* @T2_Hints_FuncsRec structure. Recording glyph hints is normally
* achieved through the following scheme:
*
* - Open a new hint recording session by calling the `open' method.
* This rewinds the recorder and prepare it for new input.
*
* - For each hint found in the glyph charstring, call the corresponding
* method (`stems', `hintmask', `counters'). Note that these
* functions do not return an error code.
*
* - Close the recording session by calling the `close' method. It
* returns an error code if the hints were invalid or something
* strange happened (e.g., memory shortage).
*
* The hints accumulated in the object can later be used by the
* Postscript hinter.
*
*/
typedef struct T2_HintsRec_* T2_Hints;
 
 
/*************************************************************************
*
* @type:
* T2_Hints_Funcs
*
* @description:
* A pointer to the @T2_Hints_FuncsRec structure that defines the API of
* a given @T2_Hints object.
*
*/
typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs;
 
 
/*************************************************************************
*
* @functype:
* T2_Hints_OpenFunc
*
* @description:
* A method of the @T2_Hints class used to prepare it for a new Type 2
* hints recording session.
*
* @input:
* hints ::
* A handle to the Type 2 hints recorder.
*
* @note:
* You should always call the @T2_Hints_CloseFunc method in order to
* close an opened recording session.
*
*/
typedef void
(*T2_Hints_OpenFunc)( T2_Hints hints );
 
 
/*************************************************************************
*
* @functype:
* T2_Hints_StemsFunc
*
* @description:
* A method of the @T2_Hints class used to set the table of stems in
* either the vertical or horizontal dimension. Equivalent to the
* `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.
*
* @input:
* hints ::
* A handle to the Type 2 hints recorder.
*
* dimension ::
* 0 for horizontal stems (hstem), 1 for vertical ones (vstem).
*
* count ::
* The number of stems.
*
* coords ::
* An array of `count' (position,length) pairs in 16.16 format.
*
* @note:
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
* horizontal coordinates (x) for vertical stems (dim=1).
*
* There are `2*count' elements in the `coords' array. Each even
* element is an absolute position in font units, each odd element is a
* length in font units.
*
* A length can be negative, in which case it must be either -20 or
* -21. It is interpreted as a `ghost' stem, according to the Type 1
* specification.
*
*/
typedef void
(*T2_Hints_StemsFunc)( T2_Hints hints,
FT_UInt dimension,
FT_UInt count,
FT_Fixed* coordinates );
 
 
/*************************************************************************
*
* @functype:
* T2_Hints_MaskFunc
*
* @description:
* A method of the @T2_Hints class used to set a given hintmask (this
* corresponds to the `hintmask' Type 2 operator).
*
* @input:
* hints ::
* A handle to the Type 2 hints recorder.
*
* end_point ::
* The glyph index of the last point to which the previously defined
* or activated hints apply.
*
* bit_count ::
* The number of bits in the hint mask.
*
* bytes ::
* An array of bytes modelling the hint mask.
*
* @note:
* If the hintmask starts the charstring (before any glyph point
* definition), the value of `end_point' should be 0.
*
* `bit_count' is the number of meaningful bits in the `bytes' array; it
* must be equal to the total number of hints defined so far (i.e.,
* horizontal+verticals).
*
* The `bytes' array can come directly from the Type 2 charstring and
* respects the same format.
*
*/
typedef void
(*T2_Hints_MaskFunc)( T2_Hints hints,
FT_UInt end_point,
FT_UInt bit_count,
const FT_Byte* bytes );
 
 
/*************************************************************************
*
* @functype:
* T2_Hints_CounterFunc
*
* @description:
* A method of the @T2_Hints class used to set a given counter mask
* (this corresponds to the `hintmask' Type 2 operator).
*
* @input:
* hints ::
* A handle to the Type 2 hints recorder.
*
* end_point ::
* A glyph index of the last point to which the previously defined or
* active hints apply.
*
* bit_count ::
* The number of bits in the hint mask.
*
* bytes ::
* An array of bytes modelling the hint mask.
*
* @note:
* If the hintmask starts the charstring (before any glyph point
* definition), the value of `end_point' should be 0.
*
* `bit_count' is the number of meaningful bits in the `bytes' array; it
* must be equal to the total number of hints defined so far (i.e.,
* horizontal+verticals).
*
* The `bytes' array can come directly from the Type 2 charstring and
* respects the same format.
*
*/
typedef void
(*T2_Hints_CounterFunc)( T2_Hints hints,
FT_UInt bit_count,
const FT_Byte* bytes );
 
 
/*************************************************************************
*
* @functype:
* T2_Hints_CloseFunc
*
* @description:
* A method of the @T2_Hints class used to close a hint recording
* session.
*
* @input:
* hints ::
* A handle to the Type 2 hints recorder.
*
* end_point ::
* The index of the last point in the input glyph.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* The error code is set to indicate that an error occurred during the
* recording session.
*
*/
typedef FT_Error
(*T2_Hints_CloseFunc)( T2_Hints hints,
FT_UInt end_point );
 
 
/*************************************************************************
*
* @functype:
* T2_Hints_ApplyFunc
*
* @description:
* A method of the @T2_Hints class used to apply hints to the
* corresponding glyph outline. Must be called after the `close'
* method.
*
* @input:
* hints ::
* A handle to the Type 2 hints recorder.
*
* outline ::
* A pointer to the target outline descriptor.
*
* globals ::
* The hinter globals for this font.
*
* hint_mode ::
* Hinting information.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* On input, all points within the outline are in font coordinates. On
* output, they are in 1/64th of pixels.
*
* The scaling transformation is taken from the `globals' object which
* must correspond to the same font than the glyph.
*
*/
typedef FT_Error
(*T2_Hints_ApplyFunc)( T2_Hints hints,
FT_Outline* outline,
PSH_Globals globals,
FT_Render_Mode hint_mode );
 
 
/*************************************************************************
*
* @struct:
* T2_Hints_FuncsRec
*
* @description:
* The structure used to provide the API to @T2_Hints objects.
*
* @fields:
* hints ::
* A handle to the T2 hints recorder object.
*
* open ::
* The function to open a recording session.
*
* close ::
* The function to close a recording session.
*
* stems ::
* The function to set the dimension's stems table.
*
* hintmask ::
* The function to set hint masks.
*
* counter ::
* The function to set counter masks.
*
* apply ::
* The function to apply the hints on the corresponding glyph outline.
*
*/
typedef struct T2_Hints_FuncsRec_
{
T2_Hints hints;
T2_Hints_OpenFunc open;
T2_Hints_CloseFunc close;
T2_Hints_StemsFunc stems;
T2_Hints_MaskFunc hintmask;
T2_Hints_CounterFunc counter;
T2_Hints_ApplyFunc apply;
 
} T2_Hints_FuncsRec;
 
 
/* */
 
 
typedef struct PSHinter_Interface_
{
PSH_Globals_Funcs (*get_globals_funcs)( FT_Module module );
T1_Hints_Funcs (*get_t1_funcs) ( FT_Module module );
T2_Hints_Funcs (*get_t2_funcs) ( FT_Module module );
 
} PSHinter_Interface;
 
typedef PSHinter_Interface* PSHinter_Service;
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_, \
get_t1_funcs_, get_t2_funcs_) \
static const PSHinter_Interface class_ = \
{ \
get_globals_funcs_, get_t1_funcs_, get_t2_funcs_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_, \
get_t1_funcs_, get_t2_funcs_) \
void \
FT_Init_Class_##class_( FT_Library library, \
PSHinter_Interface* clazz) \
{ \
FT_UNUSED(library); \
clazz->get_globals_funcs = get_globals_funcs_; \
clazz->get_t1_funcs = get_t1_funcs_; \
clazz->get_t2_funcs = get_t2_funcs_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
FT_END_HEADER
 
#endif /* __PSHINTS_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svbdf.h
0,0 → 1,77
/***************************************************************************/
/* */
/* svbdf.h */
/* */
/* The FreeType BDF services (specification). */
/* */
/* Copyright 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVBDF_H__
#define __SVBDF_H__
 
#include FT_BDF_H
#include FT_INTERNAL_SERVICE_H
 
 
FT_BEGIN_HEADER
 
 
#define FT_SERVICE_ID_BDF "bdf"
 
typedef FT_Error
(*FT_BDF_GetCharsetIdFunc)( FT_Face face,
const char* *acharset_encoding,
const char* *acharset_registry );
 
typedef FT_Error
(*FT_BDF_GetPropertyFunc)( FT_Face face,
const char* prop_name,
BDF_PropertyRec *aproperty );
 
 
FT_DEFINE_SERVICE( BDF )
{
FT_BDF_GetCharsetIdFunc get_charset_id;
FT_BDF_GetPropertyFunc get_property;
};
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \
static const FT_Service_BDFRec class_ = \
{ \
get_charset_id_, get_property_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \
void \
FT_Init_Class_##class_( FT_Service_BDFRec* clazz ) \
{ \
clazz->get_charset_id = get_charset_id_; \
clazz->get_property = get_property_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVBDF_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svcid.h
0,0 → 1,83
/***************************************************************************/
/* */
/* svcid.h */
/* */
/* The FreeType CID font services (specification). */
/* */
/* Copyright 2007, 2009 by Derek Clegg, Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVCID_H__
#define __SVCID_H__
 
#include FT_INTERNAL_SERVICE_H
 
 
FT_BEGIN_HEADER
 
 
#define FT_SERVICE_ID_CID "CID"
 
typedef FT_Error
(*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face face,
const char* *registry,
const char* *ordering,
FT_Int *supplement );
typedef FT_Error
(*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face,
FT_Bool *is_cid );
typedef FT_Error
(*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face,
FT_UInt glyph_index,
FT_UInt *cid );
 
FT_DEFINE_SERVICE( CID )
{
FT_CID_GetRegistryOrderingSupplementFunc get_ros;
FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid;
FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index;
};
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_, \
get_is_cid_, get_cid_from_glyph_index_ ) \
static const FT_Service_CIDRec class_ = \
{ \
get_ros_, get_is_cid_, get_cid_from_glyph_index_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_, \
get_is_cid_, get_cid_from_glyph_index_ ) \
void \
FT_Init_Class_##class_( FT_Library library, \
FT_Service_CIDRec* clazz) \
{ \
FT_UNUSED(library); \
clazz->get_ros = get_ros_; \
clazz->get_is_cid = get_is_cid_; \
clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVCID_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svgldict.h
0,0 → 1,82
/***************************************************************************/
/* */
/* svgldict.h */
/* */
/* The FreeType glyph dictionary services (specification). */
/* */
/* Copyright 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVGLDICT_H__
#define __SVGLDICT_H__
 
#include FT_INTERNAL_SERVICE_H
 
 
FT_BEGIN_HEADER
 
 
/*
* A service used to retrieve glyph names, as well as to find the
* index of a given glyph name in a font.
*
*/
 
#define FT_SERVICE_ID_GLYPH_DICT "glyph-dict"
 
 
typedef FT_Error
(*FT_GlyphDict_GetNameFunc)( FT_Face face,
FT_UInt glyph_index,
FT_Pointer buffer,
FT_UInt buffer_max );
 
typedef FT_UInt
(*FT_GlyphDict_NameIndexFunc)( FT_Face face,
FT_String* glyph_name );
 
 
FT_DEFINE_SERVICE( GlyphDict )
{
FT_GlyphDict_GetNameFunc get_name;
FT_GlyphDict_NameIndexFunc name_index; /* optional */
};
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \
static const FT_Service_GlyphDictRec class_ = \
{ \
get_name_, name_index_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \
void \
FT_Init_Class_##class_( FT_Library library, \
FT_Service_GlyphDictRec* clazz) \
{ \
FT_UNUSED(library); \
clazz->get_name = get_name_; \
clazz->name_index = name_index_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVGLDICT_H__ */
/contrib/media/updf/include/freetype/internal/services/svgxval.h
0,0 → 1,72
/***************************************************************************/
/* */
/* svgxval.h */
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
/* Copyright 2004, 2005 by */
/* Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
/***************************************************************************/
/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */
/* */
/***************************************************************************/
 
 
#ifndef __SVGXVAL_H__
#define __SVGXVAL_H__
 
#include FT_GX_VALIDATE_H
#include FT_INTERNAL_VALIDATE_H
 
FT_BEGIN_HEADER
 
 
#define FT_SERVICE_ID_GX_VALIDATE "truetypegx-validate"
#define FT_SERVICE_ID_CLASSICKERN_VALIDATE "classickern-validate"
 
typedef FT_Error
(*gxv_validate_func)( FT_Face face,
FT_UInt gx_flags,
FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
FT_UInt table_length );
 
 
typedef FT_Error
(*ckern_validate_func)( FT_Face face,
FT_UInt ckern_flags,
FT_Bytes *ckern_table );
 
 
FT_DEFINE_SERVICE( GXvalidate )
{
gxv_validate_func validate;
};
 
FT_DEFINE_SERVICE( CKERNvalidate )
{
ckern_validate_func validate;
};
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVGXVAL_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svkern.h
0,0 → 1,51
/***************************************************************************/
/* */
/* svkern.h */
/* */
/* The FreeType Kerning service (specification). */
/* */
/* Copyright 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVKERN_H__
#define __SVKERN_H__
 
#include FT_INTERNAL_SERVICE_H
#include FT_TRUETYPE_TABLES_H
 
 
FT_BEGIN_HEADER
 
#define FT_SERVICE_ID_KERNING "kerning"
 
 
typedef FT_Error
(*FT_Kerning_TrackGetFunc)( FT_Face face,
FT_Fixed point_size,
FT_Int degree,
FT_Fixed* akerning );
 
FT_DEFINE_SERVICE( Kerning )
{
FT_Kerning_TrackGetFunc get_track;
};
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVKERN_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svmm.h
0,0 → 1,104
/***************************************************************************/
/* */
/* svmm.h */
/* */
/* The FreeType Multiple Masters and GX var services (specification). */
/* */
/* Copyright 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVMM_H__
#define __SVMM_H__
 
#include FT_INTERNAL_SERVICE_H
 
 
FT_BEGIN_HEADER
 
 
/*
* A service used to manage multiple-masters data in a given face.
*
* See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).
*
*/
 
#define FT_SERVICE_ID_MULTI_MASTERS "multi-masters"
 
 
typedef FT_Error
(*FT_Get_MM_Func)( FT_Face face,
FT_Multi_Master* master );
 
typedef FT_Error
(*FT_Get_MM_Var_Func)( FT_Face face,
FT_MM_Var* *master );
 
typedef FT_Error
(*FT_Set_MM_Design_Func)( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
 
typedef FT_Error
(*FT_Set_Var_Design_Func)( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
 
typedef FT_Error
(*FT_Set_MM_Blend_Func)( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
 
 
FT_DEFINE_SERVICE( MultiMasters )
{
FT_Get_MM_Func get_mm;
FT_Set_MM_Design_Func set_mm_design;
FT_Set_MM_Blend_Func set_mm_blend;
FT_Get_MM_Var_Func get_mm_var;
FT_Set_Var_Design_Func set_var_design;
};
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_, \
set_mm_blend_, get_mm_var_, set_var_design_) \
static const FT_Service_MultiMastersRec class_ = \
{ \
get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_, \
set_mm_blend_, get_mm_var_, set_var_design_) \
void \
FT_Init_Class_##class_( FT_Service_MultiMastersRec* clazz ) \
{ \
clazz->get_mm = get_mm_; \
clazz->set_mm_design = set_mm_design_; \
clazz->set_mm_blend = set_mm_blend_; \
clazz->get_mm_var = get_mm_var_; \
clazz->set_var_design = set_var_design_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/* */
 
 
FT_END_HEADER
 
#endif /* __SVMM_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svotval.h
0,0 → 1,55
/***************************************************************************/
/* */
/* svotval.h */
/* */
/* The FreeType OpenType validation service (specification). */
/* */
/* Copyright 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVOTVAL_H__
#define __SVOTVAL_H__
 
#include FT_OPENTYPE_VALIDATE_H
#include FT_INTERNAL_VALIDATE_H
 
FT_BEGIN_HEADER
 
 
#define FT_SERVICE_ID_OPENTYPE_VALIDATE "opentype-validate"
 
 
typedef FT_Error
(*otv_validate_func)( FT_Face volatile face,
FT_UInt ot_flags,
FT_Bytes *base,
FT_Bytes *gdef,
FT_Bytes *gpos,
FT_Bytes *gsub,
FT_Bytes *jstf );
 
 
FT_DEFINE_SERVICE( OTvalidate )
{
otv_validate_func validate;
};
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVOTVAL_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svpfr.h
0,0 → 1,66
/***************************************************************************/
/* */
/* svpfr.h */
/* */
/* Internal PFR service functions (specification). */
/* */
/* Copyright 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVPFR_H__
#define __SVPFR_H__
 
#include FT_PFR_H
#include FT_INTERNAL_SERVICE_H
 
 
FT_BEGIN_HEADER
 
 
#define FT_SERVICE_ID_PFR_METRICS "pfr-metrics"
 
 
typedef FT_Error
(*FT_PFR_GetMetricsFunc)( FT_Face face,
FT_UInt *aoutline,
FT_UInt *ametrics,
FT_Fixed *ax_scale,
FT_Fixed *ay_scale );
 
typedef FT_Error
(*FT_PFR_GetKerningFunc)( FT_Face face,
FT_UInt left,
FT_UInt right,
FT_Vector *avector );
 
typedef FT_Error
(*FT_PFR_GetAdvanceFunc)( FT_Face face,
FT_UInt gindex,
FT_Pos *aadvance );
 
 
FT_DEFINE_SERVICE( PfrMetrics )
{
FT_PFR_GetMetricsFunc get_metrics;
FT_PFR_GetKerningFunc get_kerning;
FT_PFR_GetAdvanceFunc get_advance;
 
};
 
/* */
 
FT_END_HEADER
 
#endif /* __SVPFR_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svpostnm.h
0,0 → 1,79
/***************************************************************************/
/* */
/* svpostnm.h */
/* */
/* The FreeType PostScript name services (specification). */
/* */
/* Copyright 2003, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVPOSTNM_H__
#define __SVPOSTNM_H__
 
#include FT_INTERNAL_SERVICE_H
 
 
FT_BEGIN_HEADER
 
/*
* A trivial service used to retrieve the PostScript name of a given
* font when available. The `get_name' field should never be NULL.
*
* The corresponding function can return NULL to indicate that the
* PostScript name is not available.
*
* The name is owned by the face and will be destroyed with it.
*/
 
#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME "postscript-font-name"
 
 
typedef const char*
(*FT_PsName_GetFunc)( FT_Face face );
 
 
FT_DEFINE_SERVICE( PsFontName )
{
FT_PsName_GetFunc get_ps_font_name;
};
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \
static const FT_Service_PsFontNameRec class_ = \
{ \
get_ps_font_name_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \
void \
FT_Init_Class_##class_( FT_Library library, \
FT_Service_PsFontNameRec* clazz) \
{ \
FT_UNUSED(library); \
clazz->get_ps_font_name = get_ps_font_name_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVPOSTNM_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svpscmap.h
0,0 → 1,164
/***************************************************************************/
/* */
/* svpscmap.h */
/* */
/* The FreeType PostScript charmap service (specification). */
/* */
/* Copyright 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVPSCMAP_H__
#define __SVPSCMAP_H__
 
#include FT_INTERNAL_OBJECTS_H
 
 
FT_BEGIN_HEADER
 
 
#define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps"
 
 
/*
* Adobe glyph name to unicode value.
*/
typedef FT_UInt32
(*PS_Unicode_ValueFunc)( const char* glyph_name );
 
/*
* Macintosh name id to glyph name. NULL if invalid index.
*/
typedef const char*
(*PS_Macintosh_NameFunc)( FT_UInt name_index );
 
/*
* Adobe standard string ID to glyph name. NULL if invalid index.
*/
typedef const char*
(*PS_Adobe_Std_StringsFunc)( FT_UInt string_index );
 
 
/*
* Simple unicode -> glyph index charmap built from font glyph names
* table.
*/
typedef struct PS_UniMap_
{
FT_UInt32 unicode; /* bit 31 set: is glyph variant */
FT_UInt glyph_index;
 
} PS_UniMap;
 
 
typedef struct PS_UnicodesRec_* PS_Unicodes;
 
typedef struct PS_UnicodesRec_
{
FT_CMapRec cmap;
FT_UInt num_maps;
PS_UniMap* maps;
 
} PS_UnicodesRec;
 
 
/*
* A function which returns a glyph name for a given index. Returns
* NULL if invalid index.
*/
typedef const char*
(*PS_GetGlyphNameFunc)( FT_Pointer data,
FT_UInt string_index );
 
/*
* A function used to release the glyph name returned by
* PS_GetGlyphNameFunc, when needed
*/
typedef void
(*PS_FreeGlyphNameFunc)( FT_Pointer data,
const char* name );
 
typedef FT_Error
(*PS_Unicodes_InitFunc)( FT_Memory memory,
PS_Unicodes unicodes,
FT_UInt num_glyphs,
PS_GetGlyphNameFunc get_glyph_name,
PS_FreeGlyphNameFunc free_glyph_name,
FT_Pointer glyph_data );
 
typedef FT_UInt
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
FT_UInt32 unicode );
 
typedef FT_UInt32
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
FT_UInt32 *unicode );
 
 
FT_DEFINE_SERVICE( PsCMaps )
{
PS_Unicode_ValueFunc unicode_value;
 
PS_Unicodes_InitFunc unicodes_init;
PS_Unicodes_CharIndexFunc unicodes_char_index;
PS_Unicodes_CharNextFunc unicodes_char_next;
 
PS_Macintosh_NameFunc macintosh_name;
PS_Adobe_Std_StringsFunc adobe_std_strings;
const unsigned short* adobe_std_encoding;
const unsigned short* adobe_expert_encoding;
};
 
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \
unicodes_char_index_, unicodes_char_next_, macintosh_name_, \
adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_) \
static const FT_Service_PsCMapsRec class_ = \
{ \
unicode_value_, unicodes_init_, \
unicodes_char_index_, unicodes_char_next_, macintosh_name_, \
adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \
unicodes_char_index_, unicodes_char_next_, macintosh_name_, \
adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_) \
void \
FT_Init_Class_##class_( FT_Library library, \
FT_Service_PsCMapsRec* clazz) \
{ \
FT_UNUSED(library); \
clazz->unicode_value = unicode_value_; \
clazz->unicodes_init = unicodes_init_; \
clazz->unicodes_char_index = unicodes_char_index_; \
clazz->unicodes_char_next = unicodes_char_next_; \
clazz->macintosh_name = macintosh_name_; \
clazz->adobe_std_strings = adobe_std_strings_; \
clazz->adobe_std_encoding = adobe_std_encoding_; \
clazz->adobe_expert_encoding = adobe_expert_encoding_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVPSCMAP_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svpsinfo.h
0,0 → 1,92
/***************************************************************************/
/* */
/* svpsinfo.h */
/* */
/* The FreeType PostScript info service (specification). */
/* */
/* Copyright 2003, 2004, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVPSINFO_H__
#define __SVPSINFO_H__
 
#include FT_INTERNAL_SERVICE_H
#include FT_INTERNAL_TYPE1_TYPES_H
 
 
FT_BEGIN_HEADER
 
 
#define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info"
 
 
typedef FT_Error
(*PS_GetFontInfoFunc)( FT_Face face,
PS_FontInfoRec* afont_info );
 
typedef FT_Error
(*PS_GetFontExtraFunc)( FT_Face face,
PS_FontExtraRec* afont_extra );
 
typedef FT_Int
(*PS_HasGlyphNamesFunc)( FT_Face face );
 
typedef FT_Error
(*PS_GetFontPrivateFunc)( FT_Face face,
PS_PrivateRec* afont_private );
 
 
FT_DEFINE_SERVICE( PsInfo )
{
PS_GetFontInfoFunc ps_get_font_info;
PS_GetFontExtraFunc ps_get_font_extra;
PS_HasGlyphNamesFunc ps_has_glyph_names;
PS_GetFontPrivateFunc ps_get_font_private;
};
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_, \
ps_get_font_extra_, has_glyph_names_, get_font_private_) \
static const FT_Service_PsInfoRec class_ = \
{ \
get_font_info_, ps_get_font_extra_, has_glyph_names_, \
get_font_private_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_, \
ps_get_font_extra_, has_glyph_names_, get_font_private_) \
void \
FT_Init_Class_##class_( FT_Library library, \
FT_Service_PsInfoRec* clazz) \
{ \
FT_UNUSED(library); \
clazz->ps_get_font_info = get_font_info_; \
clazz->ps_get_font_extra = ps_get_font_extra_; \
clazz->ps_has_glyph_names = has_glyph_names_; \
clazz->ps_get_font_private = get_font_private_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVPSINFO_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svsfnt.h
0,0 → 1,102
/***************************************************************************/
/* */
/* svsfnt.h */
/* */
/* The FreeType SFNT table loading service (specification). */
/* */
/* Copyright 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVSFNT_H__
#define __SVSFNT_H__
 
#include FT_INTERNAL_SERVICE_H
#include FT_TRUETYPE_TABLES_H
 
 
FT_BEGIN_HEADER
 
 
/*
* SFNT table loading service.
*/
 
#define FT_SERVICE_ID_SFNT_TABLE "sfnt-table"
 
 
/*
* Used to implement FT_Load_Sfnt_Table().
*/
typedef FT_Error
(*FT_SFNT_TableLoadFunc)( FT_Face face,
FT_ULong tag,
FT_Long offset,
FT_Byte* buffer,
FT_ULong* length );
 
/*
* Used to implement FT_Get_Sfnt_Table().
*/
typedef void*
(*FT_SFNT_TableGetFunc)( FT_Face face,
FT_Sfnt_Tag tag );
 
 
/*
* Used to implement FT_Sfnt_Table_Info().
*/
typedef FT_Error
(*FT_SFNT_TableInfoFunc)( FT_Face face,
FT_UInt idx,
FT_ULong *tag,
FT_ULong *offset,
FT_ULong *length );
 
 
FT_DEFINE_SERVICE( SFNT_Table )
{
FT_SFNT_TableLoadFunc load_table;
FT_SFNT_TableGetFunc get_table;
FT_SFNT_TableInfoFunc table_info;
};
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \
static const FT_Service_SFNT_TableRec class_ = \
{ \
load_, get_, info_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \
void \
FT_Init_Class_##class_( FT_Service_SFNT_TableRec* clazz ) \
{ \
clazz->load_table = load_; \
clazz->get_table = get_; \
clazz->table_info = info_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVSFNT_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svttcmap.h
0,0 → 1,106
/***************************************************************************/
/* */
/* svttcmap.h */
/* */
/* The FreeType TrueType/sfnt cmap extra information service. */
/* */
/* Copyright 2003 by */
/* Masatake YAMATO, Redhat K.K. */
/* */
/* Copyright 2003, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
/* Development of this service is support of
Information-technology Promotion Agency, Japan. */
 
#ifndef __SVTTCMAP_H__
#define __SVTTCMAP_H__
 
#include FT_INTERNAL_SERVICE_H
#include FT_TRUETYPE_TABLES_H
 
 
FT_BEGIN_HEADER
 
 
#define FT_SERVICE_ID_TT_CMAP "tt-cmaps"
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_CMapInfo */
/* */
/* <Description> */
/* A structure used to store TrueType/sfnt specific cmap information */
/* which is not covered by the generic @FT_CharMap structure. This */
/* structure can be accessed with the @FT_Get_TT_CMap_Info function. */
/* */
/* <Fields> */
/* language :: */
/* The language ID used in Mac fonts. Definitions of values are in */
/* freetype/ttnameid.h. */
/* */
/* format :: */
/* The cmap format. OpenType 1.5 defines the formats 0 (byte */
/* encoding table), 2~(high-byte mapping through table), 4~(segment */
/* mapping to delta values), 6~(trimmed table mapping), 8~(mixed */
/* 16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented */
/* coverage), and 14 (Unicode Variation Sequences). */
/* */
typedef struct TT_CMapInfo_
{
FT_ULong language;
FT_Long format;
 
} TT_CMapInfo;
 
 
typedef FT_Error
(*TT_CMap_Info_GetFunc)( FT_CharMap charmap,
TT_CMapInfo *cmap_info );
 
 
FT_DEFINE_SERVICE( TTCMaps )
{
TT_CMap_Info_GetFunc get_cmap_info;
};
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \
static const FT_Service_TTCMapsRec class_ = \
{ \
get_cmap_info_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \
void \
FT_Init_Class_##class_( FT_Library library, \
FT_Service_TTCMapsRec* clazz) \
{ \
FT_UNUSED(library); \
clazz->get_cmap_info = get_cmap_info_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/* */
 
 
FT_END_HEADER
 
#endif /* __SVTTCMAP_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svtteng.h
0,0 → 1,53
/***************************************************************************/
/* */
/* svtteng.h */
/* */
/* The FreeType TrueType engine query service (specification). */
/* */
/* Copyright 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVTTENG_H__
#define __SVTTENG_H__
 
#include FT_INTERNAL_SERVICE_H
#include FT_MODULE_H
 
 
FT_BEGIN_HEADER
 
 
/*
* SFNT table loading service.
*/
 
#define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine"
 
/*
* Used to implement FT_Get_TrueType_Engine_Type
*/
 
FT_DEFINE_SERVICE( TrueTypeEngine )
{
FT_TrueTypeEngineType engine_type;
};
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVTTENG_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svttglyf.h
0,0 → 1,67
/***************************************************************************/
/* */
/* svttglyf.h */
/* */
/* The FreeType TrueType glyph service. */
/* */
/* Copyright 2007 by David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
#ifndef __SVTTGLYF_H__
#define __SVTTGLYF_H__
 
#include FT_INTERNAL_SERVICE_H
#include FT_TRUETYPE_TABLES_H
 
 
FT_BEGIN_HEADER
 
 
#define FT_SERVICE_ID_TT_GLYF "tt-glyf"
 
 
typedef FT_ULong
(*TT_Glyf_GetLocationFunc)( FT_Face face,
FT_UInt gindex,
FT_ULong *psize );
 
FT_DEFINE_SERVICE( TTGlyf )
{
TT_Glyf_GetLocationFunc get_location;
};
 
#ifndef FT_CONFIG_OPTION_PIC
 
#define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ ) \
static const FT_Service_TTGlyfRec class_ = \
{ \
get_location_ \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ ) \
void \
FT_Init_Class_##class_( FT_Service_TTGlyfRec* clazz ) \
{ \
clazz->get_location = get_location_; \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
/* */
 
 
FT_END_HEADER
 
#endif /* __SVTTGLYF_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svwinfnt.h
0,0 → 1,50
/***************************************************************************/
/* */
/* svwinfnt.h */
/* */
/* The FreeType Windows FNT/FONT service (specification). */
/* */
/* Copyright 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVWINFNT_H__
#define __SVWINFNT_H__
 
#include FT_INTERNAL_SERVICE_H
#include FT_WINFONTS_H
 
 
FT_BEGIN_HEADER
 
 
#define FT_SERVICE_ID_WINFNT "winfonts"
 
typedef FT_Error
(*FT_WinFnt_GetHeaderFunc)( FT_Face face,
FT_WinFNT_HeaderRec *aheader );
 
 
FT_DEFINE_SERVICE( WinFnt )
{
FT_WinFnt_GetHeaderFunc get_header;
};
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVWINFNT_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/services/svxf86nm.h
0,0 → 1,55
/***************************************************************************/
/* */
/* svxf86nm.h */
/* */
/* The FreeType XFree86 services (specification only). */
/* */
/* Copyright 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SVXF86NM_H__
#define __SVXF86NM_H__
 
#include FT_INTERNAL_SERVICE_H
 
 
FT_BEGIN_HEADER
 
 
/*
* A trivial service used to return the name of a face's font driver,
* according to the XFree86 nomenclature. Note that the service data
* is a simple constant string pointer.
*/
 
#define FT_SERVICE_ID_XF86_NAME "xf86-driver-name"
 
#define FT_XF86_FORMAT_TRUETYPE "TrueType"
#define FT_XF86_FORMAT_TYPE_1 "Type 1"
#define FT_XF86_FORMAT_BDF "BDF"
#define FT_XF86_FORMAT_PCF "PCF"
#define FT_XF86_FORMAT_TYPE_42 "Type 42"
#define FT_XF86_FORMAT_CID "CID Type 1"
#define FT_XF86_FORMAT_CFF "CFF"
#define FT_XF86_FORMAT_PFR "PFR"
#define FT_XF86_FORMAT_WINFNT "Windows FNT"
 
/* */
 
 
FT_END_HEADER
 
 
#endif /* __SVXF86NM_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/sfnt.h
0,0 → 1,897
/***************************************************************************/
/* */
/* sfnt.h */
/* */
/* High-level `sfnt' driver interface (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __SFNT_H__
#define __SFNT_H__
 
 
#include <ft2build.h>
#include FT_INTERNAL_DRIVER_H
#include FT_INTERNAL_TRUETYPE_TYPES_H
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Init_Face_Func */
/* */
/* <Description> */
/* First part of the SFNT face object initialization. This finds */
/* the face in a SFNT file or collection, and load its format tag in */
/* face->format_tag. */
/* */
/* <Input> */
/* stream :: The input stream. */
/* */
/* face :: A handle to the target face object. */
/* */
/* face_index :: The index of the TrueType font, if we are opening a */
/* collection. */
/* */
/* num_params :: The number of additional parameters. */
/* */
/* params :: Optional additional parameters. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The stream cursor must be at the font file's origin. */
/* */
/* This function recognizes fonts embedded in a `TrueType */
/* collection'. */
/* */
/* Once the format tag has been validated by the font driver, it */
/* should then call the TT_Load_Face_Func() callback to read the rest */
/* of the SFNT tables in the object. */
/* */
typedef FT_Error
(*TT_Init_Face_Func)( FT_Stream stream,
TT_Face face,
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Load_Face_Func */
/* */
/* <Description> */
/* Second part of the SFNT face object initialization. This loads */
/* the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the */
/* face object. */
/* */
/* <Input> */
/* stream :: The input stream. */
/* */
/* face :: A handle to the target face object. */
/* */
/* face_index :: The index of the TrueType font, if we are opening a */
/* collection. */
/* */
/* num_params :: The number of additional parameters. */
/* */
/* params :: Optional additional parameters. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function must be called after TT_Init_Face_Func(). */
/* */
typedef FT_Error
(*TT_Load_Face_Func)( FT_Stream stream,
TT_Face face,
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Done_Face_Func */
/* */
/* <Description> */
/* A callback used to delete the common SFNT data from a face. */
/* */
/* <Input> */
/* face :: A handle to the target face object. */
/* */
/* <Note> */
/* This function does NOT destroy the face object. */
/* */
typedef void
(*TT_Done_Face_Func)( TT_Face face );
 
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Load_SFNT_HeaderRec_Func */
/* */
/* <Description> */
/* Loads the header of a SFNT font file. Supports collections. */
/* */
/* <Input> */
/* face :: A handle to the target face object. */
/* */
/* stream :: The input stream. */
/* */
/* face_index :: The index of the TrueType font, if we are opening a */
/* collection. */
/* */
/* <Output> */
/* sfnt :: The SFNT header. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The stream cursor must be at the font file's origin. */
/* */
/* This function recognizes fonts embedded in a `TrueType */
/* collection'. */
/* */
/* This function checks that the header is valid by looking at the */
/* values of `search_range', `entry_selector', and `range_shift'. */
/* */
typedef FT_Error
(*TT_Load_SFNT_HeaderRec_Func)( TT_Face face,
FT_Stream stream,
FT_Long face_index,
SFNT_Header sfnt );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Load_Directory_Func */
/* */
/* <Description> */
/* Loads the table directory into a face object. */
/* */
/* <Input> */
/* face :: A handle to the target face object. */
/* */
/* stream :: The input stream. */
/* */
/* sfnt :: The SFNT header. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The stream cursor must be on the first byte after the 4-byte font */
/* format tag. This is the case just after a call to */
/* TT_Load_Format_Tag(). */
/* */
typedef FT_Error
(*TT_Load_Directory_Func)( TT_Face face,
FT_Stream stream,
SFNT_Header sfnt );
 
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Load_Any_Func */
/* */
/* <Description> */
/* Load any font table into client memory. */
/* */
/* <Input> */
/* face :: The face object to look for. */
/* */
/* tag :: The tag of table to load. Use the value 0 if you want */
/* to access the whole font file, else set this parameter */
/* to a valid TrueType table tag that you can forge with */
/* the MAKE_TT_TAG macro. */
/* */
/* offset :: The starting offset in the table (or the file if */
/* tag == 0). */
/* */
/* length :: The address of the decision variable: */
/* */
/* If length == NULL: */
/* Loads the whole table. Returns an error if */
/* `offset' == 0! */
/* */
/* If *length == 0: */
/* Exits immediately; returning the length of the given */
/* table or of the font file, depending on the value of */
/* `tag'. */
/* */
/* If *length != 0: */
/* Loads the next `length' bytes of table or font, */
/* starting at offset `offset' (in table or font too). */
/* */
/* <Output> */
/* buffer :: The address of target buffer. */
/* */
/* <Return> */
/* TrueType error code. 0 means success. */
/* */
typedef FT_Error
(*TT_Load_Any_Func)( TT_Face face,
FT_ULong tag,
FT_Long offset,
FT_Byte *buffer,
FT_ULong* length );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Find_SBit_Image_Func */
/* */
/* <Description> */
/* Check whether an embedded bitmap (an `sbit') exists for a given */
/* glyph, at a given strike. */
/* */
/* <Input> */
/* face :: The target face object. */
/* */
/* glyph_index :: The glyph index. */
/* */
/* strike_index :: The current strike index. */
/* */
/* <Output> */
/* arange :: The SBit range containing the glyph index. */
/* */
/* astrike :: The SBit strike containing the glyph index. */
/* */
/* aglyph_offset :: The offset of the glyph data in `EBDT' table. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. Returns */
/* SFNT_Err_Invalid_Argument if no sbit exists for the requested */
/* glyph. */
/* */
typedef FT_Error
(*TT_Find_SBit_Image_Func)( TT_Face face,
FT_UInt glyph_index,
FT_ULong strike_index,
TT_SBit_Range *arange,
TT_SBit_Strike *astrike,
FT_ULong *aglyph_offset );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Load_SBit_Metrics_Func */
/* */
/* <Description> */
/* Get the big metrics for a given embedded bitmap. */
/* */
/* <Input> */
/* stream :: The input stream. */
/* */
/* range :: The SBit range containing the glyph. */
/* */
/* <Output> */
/* big_metrics :: A big SBit metrics structure for the glyph. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The stream cursor must be positioned at the glyph's offset within */
/* the `EBDT' table before the call. */
/* */
/* If the image format uses variable metrics, the stream cursor is */
/* positioned just after the metrics header in the `EBDT' table on */
/* function exit. */
/* */
typedef FT_Error
(*TT_Load_SBit_Metrics_Func)( FT_Stream stream,
TT_SBit_Range range,
TT_SBit_Metrics metrics );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Load_SBit_Image_Func */
/* */
/* <Description> */
/* Load a given glyph sbit image from the font resource. This also */
/* returns its metrics. */
/* */
/* <Input> */
/* face :: */
/* The target face object. */
/* */
/* strike_index :: */
/* The strike index. */
/* */
/* glyph_index :: */
/* The current glyph index. */
/* */
/* load_flags :: */
/* The current load flags. */
/* */
/* stream :: */
/* The input stream. */
/* */
/* <Output> */
/* amap :: */
/* The target pixmap. */
/* */
/* ametrics :: */
/* A big sbit metrics structure for the glyph image. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. Returns an error if no */
/* glyph sbit exists for the index. */
/* */
/* <Note> */
/* The `map.buffer' field is always freed before the glyph is loaded. */
/* */
typedef FT_Error
(*TT_Load_SBit_Image_Func)( TT_Face face,
FT_ULong strike_index,
FT_UInt glyph_index,
FT_UInt load_flags,
FT_Stream stream,
FT_Bitmap *amap,
TT_SBit_MetricsRec *ametrics );
 
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Set_SBit_Strike_OldFunc */
/* */
/* <Description> */
/* Select an sbit strike for a given size request. */
/* */
/* <Input> */
/* face :: The target face object. */
/* */
/* req :: The size request. */
/* */
/* <Output> */
/* astrike_index :: The index of the sbit strike. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. Returns an error if no */
/* sbit strike exists for the selected ppem values. */
/* */
typedef FT_Error
(*TT_Set_SBit_Strike_OldFunc)( TT_Face face,
FT_UInt x_ppem,
FT_UInt y_ppem,
FT_ULong* astrike_index );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_CharMap_Load_Func */
/* */
/* <Description> */
/* Loads a given TrueType character map into memory. */
/* */
/* <Input> */
/* face :: A handle to the parent face object. */
/* */
/* stream :: A handle to the current stream object. */
/* */
/* <InOut> */
/* cmap :: A pointer to a cmap object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The function assumes that the stream is already in use (i.e., */
/* opened). In case of error, all partially allocated tables are */
/* released. */
/* */
typedef FT_Error
(*TT_CharMap_Load_Func)( TT_Face face,
void* cmap,
FT_Stream input );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_CharMap_Free_Func */
/* */
/* <Description> */
/* Destroys a character mapping table. */
/* */
/* <Input> */
/* face :: A handle to the parent face object. */
/* */
/* cmap :: A handle to a cmap object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
typedef FT_Error
(*TT_CharMap_Free_Func)( TT_Face face,
void* cmap );
 
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Set_SBit_Strike_Func */
/* */
/* <Description> */
/* Select an sbit strike for a given size request. */
/* */
/* <Input> */
/* face :: The target face object. */
/* */
/* req :: The size request. */
/* */
/* <Output> */
/* astrike_index :: The index of the sbit strike. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. Returns an error if no */
/* sbit strike exists for the selected ppem values. */
/* */
typedef FT_Error
(*TT_Set_SBit_Strike_Func)( TT_Face face,
FT_Size_Request req,
FT_ULong* astrike_index );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Load_Strike_Metrics_Func */
/* */
/* <Description> */
/* Load the metrics of a given strike. */
/* */
/* <Input> */
/* face :: The target face object. */
/* */
/* strike_index :: The strike index. */
/* */
/* <Output> */
/* metrics :: the metrics of the strike. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. Returns an error if no */
/* such sbit strike exists. */
/* */
typedef FT_Error
(*TT_Load_Strike_Metrics_Func)( TT_Face face,
FT_ULong strike_index,
FT_Size_Metrics* metrics );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Get_PS_Name_Func */
/* */
/* <Description> */
/* Get the PostScript glyph name of a glyph. */
/* */
/* <Input> */
/* idx :: The glyph index. */
/* */
/* PSname :: The address of a string pointer. Will be NULL in case */
/* of error, otherwise it is a pointer to the glyph name. */
/* */
/* You must not modify the returned string! */
/* */
/* <Output> */
/* FreeType error code. 0 means success. */
/* */
typedef FT_Error
(*TT_Get_PS_Name_Func)( TT_Face face,
FT_UInt idx,
FT_String** PSname );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Load_Metrics_Func */
/* */
/* <Description> */
/* Load a metrics table, which is a table with a horizontal and a */
/* vertical version. */
/* */
/* <Input> */
/* face :: A handle to the target face object. */
/* */
/* stream :: The input stream. */
/* */
/* vertical :: A boolean flag. If set, load the vertical one. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
typedef FT_Error
(*TT_Load_Metrics_Func)( TT_Face face,
FT_Stream stream,
FT_Bool vertical );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Get_Metrics_Func */
/* */
/* <Description> */
/* Load the horizontal or vertical header in a face object. */
/* */
/* <Input> */
/* face :: A handle to the target face object. */
/* */
/* stream :: The input stream. */
/* */
/* vertical :: A boolean flag. If set, load vertical metrics. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
typedef FT_Error
(*TT_Get_Metrics_Func)( TT_Face face,
FT_Bool vertical,
FT_UInt gindex,
FT_Short* abearing,
FT_UShort* aadvance );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Load_Table_Func */
/* */
/* <Description> */
/* Load a given TrueType table. */
/* */
/* <Input> */
/* face :: A handle to the target face object. */
/* */
/* stream :: The input stream. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The function uses `face->goto_table' to seek the stream to the */
/* start of the table, except while loading the font directory. */
/* */
typedef FT_Error
(*TT_Load_Table_Func)( TT_Face face,
FT_Stream stream );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Free_Table_Func */
/* */
/* <Description> */
/* Free a given TrueType table. */
/* */
/* <Input> */
/* face :: A handle to the target face object. */
/* */
typedef void
(*TT_Free_Table_Func)( TT_Face face );
 
 
/*
* @functype:
* TT_Face_GetKerningFunc
*
* @description:
* Return the horizontal kerning value between two glyphs.
*
* @input:
* face :: A handle to the source face object.
* left_glyph :: The left glyph index.
* right_glyph :: The right glyph index.
*
* @return:
* The kerning value in font units.
*/
typedef FT_Int
(*TT_Face_GetKerningFunc)( TT_Face face,
FT_UInt left_glyph,
FT_UInt right_glyph );
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* SFNT_Interface */
/* */
/* <Description> */
/* This structure holds pointers to the functions used to load and */
/* free the basic tables that are required in a `sfnt' font file. */
/* */
/* <Fields> */
/* Check the various xxx_Func() descriptions for details. */
/* */
typedef struct SFNT_Interface_
{
TT_Loader_GotoTableFunc goto_table;
 
TT_Init_Face_Func init_face;
TT_Load_Face_Func load_face;
TT_Done_Face_Func done_face;
FT_Module_Requester get_interface;
 
TT_Load_Any_Func load_any;
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
TT_Load_SFNT_HeaderRec_Func load_sfnt_header;
TT_Load_Directory_Func load_directory;
#endif
 
/* these functions are called by `load_face' but they can also */
/* be called from external modules, if there is a need to do so */
TT_Load_Table_Func load_head;
TT_Load_Metrics_Func load_hhea;
TT_Load_Table_Func load_cmap;
TT_Load_Table_Func load_maxp;
TT_Load_Table_Func load_os2;
TT_Load_Table_Func load_post;
 
TT_Load_Table_Func load_name;
TT_Free_Table_Func free_name;
 
/* optional tables */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
TT_Load_Table_Func load_hdmx_stub;
TT_Free_Table_Func free_hdmx_stub;
#endif
 
/* this field was called `load_kerning' up to version 2.1.10 */
TT_Load_Table_Func load_kern;
 
TT_Load_Table_Func load_gasp;
TT_Load_Table_Func load_pclt;
 
/* see `ttload.h'; this field was called `load_bitmap_header' up to */
/* version 2.1.10 */
TT_Load_Table_Func load_bhed;
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
/* see `ttsbit.h' */
TT_Set_SBit_Strike_OldFunc set_sbit_strike_stub;
TT_Load_Table_Func load_sbits_stub;
 
/*
* The following two fields appeared in version 2.1.8, and were placed
* between `load_sbits' and `load_sbit_image'. We support them as a
* special exception since they are used by Xfont library within the
* X.Org xserver, and because the probability that other rogue clients
* use the other version 2.1.7 fields below is _extremely_ low.
*
* Note that this forces us to disable an interesting memory-saving
* optimization though...
*/
 
TT_Find_SBit_Image_Func find_sbit_image;
TT_Load_SBit_Metrics_Func load_sbit_metrics;
 
#endif
 
TT_Load_SBit_Image_Func load_sbit_image;
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
TT_Free_Table_Func free_sbits_stub;
#endif
 
/* see `ttpost.h' */
TT_Get_PS_Name_Func get_psname;
TT_Free_Table_Func free_psnames;
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
TT_CharMap_Load_Func load_charmap_stub;
TT_CharMap_Free_Func free_charmap_stub;
#endif
 
/* starting here, the structure differs from version 2.1.7 */
 
/* this field was introduced in version 2.1.8, named `get_psname' */
TT_Face_GetKerningFunc get_kerning;
 
/* new elements introduced after version 2.1.10 */
 
/* load the font directory, i.e., the offset table and */
/* the table directory */
TT_Load_Table_Func load_font_dir;
TT_Load_Metrics_Func load_hmtx;
 
TT_Load_Table_Func load_eblc;
TT_Free_Table_Func free_eblc;
 
TT_Set_SBit_Strike_Func set_sbit_strike;
TT_Load_Strike_Metrics_Func load_strike_metrics;
 
TT_Get_Metrics_Func get_metrics;
 
} SFNT_Interface;
 
 
/* transitional */
typedef SFNT_Interface* SFNT_Service;
 
#ifndef FT_CONFIG_OPTION_PIC
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a) \
a,
#else
#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a)
#endif
#define FT_INTERNAL(a) \
a,
 
#define FT_DEFINE_SFNT_INTERFACE(class_, \
goto_table_, init_face_, load_face_, done_face_, get_interface_, \
load_any_, load_sfnt_header_, load_directory_, load_head_, \
load_hhea_, load_cmap_, load_maxp_, load_os2_, load_post_, \
load_name_, free_name_, load_hdmx_stub_, free_hdmx_stub_, \
load_kern_, load_gasp_, load_pclt_, load_bhed_, \
set_sbit_strike_stub_, load_sbits_stub_, find_sbit_image_, \
load_sbit_metrics_, load_sbit_image_, free_sbits_stub_, \
get_psname_, free_psnames_, load_charmap_stub_, free_charmap_stub_, \
get_kerning_, load_font_dir_, load_hmtx_, load_eblc_, free_eblc_, \
set_sbit_strike_, load_strike_metrics_, get_metrics_ ) \
static const SFNT_Interface class_ = \
{ \
FT_INTERNAL(goto_table_) \
FT_INTERNAL(init_face_) \
FT_INTERNAL(load_face_) \
FT_INTERNAL(done_face_) \
FT_INTERNAL(get_interface_) \
FT_INTERNAL(load_any_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sfnt_header_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_directory_) \
FT_INTERNAL(load_head_) \
FT_INTERNAL(load_hhea_) \
FT_INTERNAL(load_cmap_) \
FT_INTERNAL(load_maxp_) \
FT_INTERNAL(load_os2_) \
FT_INTERNAL(load_post_) \
FT_INTERNAL(load_name_) \
FT_INTERNAL(free_name_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_hdmx_stub_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_hdmx_stub_) \
FT_INTERNAL(load_kern_) \
FT_INTERNAL(load_gasp_) \
FT_INTERNAL(load_pclt_) \
FT_INTERNAL(load_bhed_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(set_sbit_strike_stub_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbits_stub_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(find_sbit_image_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbit_metrics_) \
FT_INTERNAL(load_sbit_image_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_sbits_stub_) \
FT_INTERNAL(get_psname_) \
FT_INTERNAL(free_psnames_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_charmap_stub_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_charmap_stub_) \
FT_INTERNAL(get_kerning_) \
FT_INTERNAL(load_font_dir_) \
FT_INTERNAL(load_hmtx_) \
FT_INTERNAL(load_eblc_) \
FT_INTERNAL(free_eblc_) \
FT_INTERNAL(set_sbit_strike_) \
FT_INTERNAL(load_strike_metrics_) \
FT_INTERNAL(get_metrics_) \
};
 
#else /* FT_CONFIG_OPTION_PIC */
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a, a_) \
clazz->a = a_;
#else
#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a, a_)
#endif
#define FT_INTERNAL(a, a_) \
clazz->a = a_;
 
#define FT_DEFINE_SFNT_INTERFACE(class_, \
goto_table_, init_face_, load_face_, done_face_, get_interface_, \
load_any_, load_sfnt_header_, load_directory_, load_head_, \
load_hhea_, load_cmap_, load_maxp_, load_os2_, load_post_, \
load_name_, free_name_, load_hdmx_stub_, free_hdmx_stub_, \
load_kern_, load_gasp_, load_pclt_, load_bhed_, \
set_sbit_strike_stub_, load_sbits_stub_, find_sbit_image_, \
load_sbit_metrics_, load_sbit_image_, free_sbits_stub_, \
get_psname_, free_psnames_, load_charmap_stub_, free_charmap_stub_, \
get_kerning_, load_font_dir_, load_hmtx_, load_eblc_, free_eblc_, \
set_sbit_strike_, load_strike_metrics_, get_metrics_ ) \
void \
FT_Init_Class_##class_( FT_Library library, SFNT_Interface* clazz ) \
{ \
FT_UNUSED(library); \
FT_INTERNAL(goto_table,goto_table_) \
FT_INTERNAL(init_face,init_face_) \
FT_INTERNAL(load_face,load_face_) \
FT_INTERNAL(done_face,done_face_) \
FT_INTERNAL(get_interface,get_interface_) \
FT_INTERNAL(load_any,load_any_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sfnt_header,load_sfnt_header_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_directory,load_directory_) \
FT_INTERNAL(load_head,load_head_) \
FT_INTERNAL(load_hhea,load_hhea_) \
FT_INTERNAL(load_cmap,load_cmap_) \
FT_INTERNAL(load_maxp,load_maxp_) \
FT_INTERNAL(load_os2,load_os2_) \
FT_INTERNAL(load_post,load_post_) \
FT_INTERNAL(load_name,load_name_) \
FT_INTERNAL(free_name,free_name_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_hdmx_stub,load_hdmx_stub_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_hdmx_stub,free_hdmx_stub_) \
FT_INTERNAL(load_kern,load_kern_) \
FT_INTERNAL(load_gasp,load_gasp_) \
FT_INTERNAL(load_pclt,load_pclt_) \
FT_INTERNAL(load_bhed,load_bhed_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(set_sbit_strike_stub,set_sbit_strike_stub_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbits_stub,load_sbits_stub_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(find_sbit_image,find_sbit_image_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbit_metrics,load_sbit_metrics_) \
FT_INTERNAL(load_sbit_image,load_sbit_image_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_sbits_stub,free_sbits_stub_) \
FT_INTERNAL(get_psname,get_psname_) \
FT_INTERNAL(free_psnames,free_psnames_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(load_charmap_stub,load_charmap_stub_) \
FT_DEFINE_DRIVERS_OLD_INTERNAL(free_charmap_stub,free_charmap_stub_) \
FT_INTERNAL(get_kerning,get_kerning_) \
FT_INTERNAL(load_font_dir,load_font_dir_) \
FT_INTERNAL(load_hmtx,load_hmtx_) \
FT_INTERNAL(load_eblc,load_eblc_) \
FT_INTERNAL(free_eblc,free_eblc_) \
FT_INTERNAL(set_sbit_strike,set_sbit_strike_) \
FT_INTERNAL(load_strike_metrics,load_strike_metrics_) \
FT_INTERNAL(get_metrics,get_metrics_) \
}
 
#endif /* FT_CONFIG_OPTION_PIC */
 
FT_END_HEADER
 
#endif /* __SFNT_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/t1types.h
0,0 → 1,270
/***************************************************************************/
/* */
/* t1types.h */
/* */
/* Basic Type1/Type2 type definitions and interface (specification */
/* only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __T1TYPES_H__
#define __T1TYPES_H__
 
 
#include <ft2build.h>
#include FT_TYPE1_TABLES_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
#include FT_INTERNAL_SERVICE_H
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* T1_EncodingRec */
/* */
/* <Description> */
/* A structure modeling a custom encoding. */
/* */
/* <Fields> */
/* num_chars :: The number of character codes in the encoding. */
/* Usually 256. */
/* */
/* code_first :: The lowest valid character code in the encoding. */
/* */
/* code_last :: The highest valid character code in the encoding */
/* + 1. When equal to code_first there are no valid */
/* character codes. */
/* */
/* char_index :: An array of corresponding glyph indices. */
/* */
/* char_name :: An array of corresponding glyph names. */
/* */
typedef struct T1_EncodingRecRec_
{
FT_Int num_chars;
FT_Int code_first;
FT_Int code_last;
 
FT_UShort* char_index;
FT_String** char_name;
 
} T1_EncodingRec, *T1_Encoding;
 
 
typedef enum T1_EncodingType_
{
T1_ENCODING_TYPE_NONE = 0,
T1_ENCODING_TYPE_ARRAY,
T1_ENCODING_TYPE_STANDARD,
T1_ENCODING_TYPE_ISOLATIN1,
T1_ENCODING_TYPE_EXPERT
 
} T1_EncodingType;
 
 
/* used to hold extra data of PS_FontInfoRec that
* cannot be stored in the publicly defined structure.
*
* Note these can't be blended with multiple-masters.
*/
typedef struct PS_FontExtraRec_
{
FT_UShort fs_type;
 
} PS_FontExtraRec;
 
 
typedef struct T1_FontRec_
{
PS_FontInfoRec font_info; /* font info dictionary */
PS_FontExtraRec font_extra; /* font info extra fields */
PS_PrivateRec private_dict; /* private dictionary */
FT_String* font_name; /* top-level dictionary */
 
T1_EncodingType encoding_type;
T1_EncodingRec encoding;
 
FT_Byte* subrs_block;
FT_Byte* charstrings_block;
FT_Byte* glyph_names_block;
 
FT_Int num_subrs;
FT_Byte** subrs;
FT_PtrDist* subrs_len;
 
FT_Int num_glyphs;
FT_String** glyph_names; /* array of glyph names */
FT_Byte** charstrings; /* array of glyph charstrings */
FT_PtrDist* charstrings_len;
 
FT_Byte paint_type;
FT_Byte font_type;
FT_Matrix font_matrix;
FT_Vector font_offset;
FT_BBox font_bbox;
FT_Long font_id;
 
FT_Fixed stroke_width;
 
} T1_FontRec, *T1_Font;
 
 
typedef struct CID_SubrsRec_
{
FT_UInt num_subrs;
FT_Byte** code;
 
} CID_SubrsRec, *CID_Subrs;
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** AFM FONT INFORMATION STRUCTURES ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
typedef struct AFM_TrackKernRec_
{
FT_Int degree;
FT_Fixed min_ptsize;
FT_Fixed min_kern;
FT_Fixed max_ptsize;
FT_Fixed max_kern;
 
} AFM_TrackKernRec, *AFM_TrackKern;
 
typedef struct AFM_KernPairRec_
{
FT_Int index1;
FT_Int index2;
FT_Int x;
FT_Int y;
 
} AFM_KernPairRec, *AFM_KernPair;
 
typedef struct AFM_FontInfoRec_
{
FT_Bool IsCIDFont;
FT_BBox FontBBox;
FT_Fixed Ascender;
FT_Fixed Descender;
AFM_TrackKern TrackKerns; /* free if non-NULL */
FT_Int NumTrackKern;
AFM_KernPair KernPairs; /* free if non-NULL */
FT_Int NumKernPair;
 
} AFM_FontInfoRec, *AFM_FontInfo;
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** ORIGINAL T1_FACE CLASS DEFINITION ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
typedef struct T1_FaceRec_* T1_Face;
typedef struct CID_FaceRec_* CID_Face;
 
 
typedef struct T1_FaceRec_
{
FT_FaceRec root;
T1_FontRec type1;
const void* psnames;
const void* psaux;
const void* afm_data;
FT_CharMapRec charmaprecs[2];
FT_CharMap charmaps[2];
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
PS_Unicodes unicode_map;
#endif
 
/* support for Multiple Masters fonts */
PS_Blend blend;
 
/* undocumented, optional: indices of subroutines that express */
/* the NormalizeDesignVector and the ConvertDesignVector procedure, */
/* respectively, as Type 2 charstrings; -1 if keywords not present */
FT_Int ndv_idx;
FT_Int cdv_idx;
 
/* undocumented, optional: has the same meaning as len_buildchar */
/* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */
FT_UInt len_buildchar;
FT_Long* buildchar;
 
/* since version 2.1 - interface to PostScript hinter */
const void* pshinter;
 
} T1_FaceRec;
 
 
typedef struct CID_FaceRec_
{
FT_FaceRec root;
void* psnames;
void* psaux;
CID_FaceInfoRec cid;
PS_FontExtraRec font_extra;
#if 0
void* afm_data;
#endif
CID_Subrs subrs;
 
/* since version 2.1 - interface to PostScript hinter */
void* pshinter;
 
/* since version 2.1.8, but was originally positioned after `afm_data' */
FT_Byte* binary_data; /* used if hex data has been converted */
FT_Stream cid_stream;
 
} CID_FaceRec;
 
 
FT_END_HEADER
 
#endif /* __T1TYPES_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/internal/tttypes.h
0,0 → 1,1543
/***************************************************************************/
/* */
/* tttypes.h */
/* */
/* Basic SFNT/TrueType type definitions and interface (specification */
/* only). */
/* */
/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __TTTYPES_H__
#define __TTTYPES_H__
 
 
#include <ft2build.h>
#include FT_TRUETYPE_TABLES_H
#include FT_INTERNAL_OBJECTS_H
 
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include FT_MULTIPLE_MASTERS_H
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TTC_HeaderRec */
/* */
/* <Description> */
/* TrueType collection header. This table contains the offsets of */
/* the font headers of each distinct TrueType face in the file. */
/* */
/* <Fields> */
/* tag :: Must be `ttc ' to indicate a TrueType collection. */
/* */
/* version :: The version number. */
/* */
/* count :: The number of faces in the collection. The */
/* specification says this should be an unsigned long, but */
/* we use a signed long since we need the value -1 for */
/* specific purposes. */
/* */
/* offsets :: The offsets of the font headers, one per face. */
/* */
typedef struct TTC_HeaderRec_
{
FT_ULong tag;
FT_Fixed version;
FT_Long count;
FT_ULong* offsets;
 
} TTC_HeaderRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* SFNT_HeaderRec */
/* */
/* <Description> */
/* SFNT file format header. */
/* */
/* <Fields> */
/* format_tag :: The font format tag. */
/* */
/* num_tables :: The number of tables in file. */
/* */
/* search_range :: Must be `16 * (max power of 2 <= num_tables)'. */
/* */
/* entry_selector :: Must be log2 of `search_range / 16'. */
/* */
/* range_shift :: Must be `num_tables * 16 - search_range'. */
/* */
typedef struct SFNT_HeaderRec_
{
FT_ULong format_tag;
FT_UShort num_tables;
FT_UShort search_range;
FT_UShort entry_selector;
FT_UShort range_shift;
 
FT_ULong offset; /* not in file */
 
} SFNT_HeaderRec, *SFNT_Header;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_TableRec */
/* */
/* <Description> */
/* This structure describes a given table of a TrueType font. */
/* */
/* <Fields> */
/* Tag :: A four-bytes tag describing the table. */
/* */
/* CheckSum :: The table checksum. This value can be ignored. */
/* */
/* Offset :: The offset of the table from the start of the TrueType */
/* font in its resource. */
/* */
/* Length :: The table length (in bytes). */
/* */
typedef struct TT_TableRec_
{
FT_ULong Tag; /* table type */
FT_ULong CheckSum; /* table checksum */
FT_ULong Offset; /* table file offset */
FT_ULong Length; /* table length */
 
} TT_TableRec, *TT_Table;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_LongMetricsRec */
/* */
/* <Description> */
/* A structure modeling the long metrics of the `hmtx' and `vmtx' */
/* TrueType tables. The values are expressed in font units. */
/* */
/* <Fields> */
/* advance :: The advance width or height for the glyph. */
/* */
/* bearing :: The left-side or top-side bearing for the glyph. */
/* */
typedef struct TT_LongMetricsRec_
{
FT_UShort advance;
FT_Short bearing;
 
} TT_LongMetricsRec, *TT_LongMetrics;
 
 
/*************************************************************************/
/* */
/* <Type> */
/* TT_ShortMetrics */
/* */
/* <Description> */
/* A simple type to model the short metrics of the `hmtx' and `vmtx' */
/* tables. */
/* */
typedef FT_Short TT_ShortMetrics;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_NameEntryRec */
/* */
/* <Description> */
/* A structure modeling TrueType name records. Name records are used */
/* to store important strings like family name, style name, */
/* copyright, etc. in _localized_ versions (i.e., language, encoding, */
/* etc). */
/* */
/* <Fields> */
/* platformID :: The ID of the name's encoding platform. */
/* */
/* encodingID :: The platform-specific ID for the name's encoding. */
/* */
/* languageID :: The platform-specific ID for the name's language. */
/* */
/* nameID :: The ID specifying what kind of name this is. */
/* */
/* stringLength :: The length of the string in bytes. */
/* */
/* stringOffset :: The offset to the string in the `name' table. */
/* */
/* string :: A pointer to the string's bytes. Note that these */
/* are usually UTF-16 encoded characters. */
/* */
typedef struct TT_NameEntryRec_
{
FT_UShort platformID;
FT_UShort encodingID;
FT_UShort languageID;
FT_UShort nameID;
FT_UShort stringLength;
FT_ULong stringOffset;
 
/* this last field is not defined in the spec */
/* but used by the FreeType engine */
 
FT_Byte* string;
 
} TT_NameEntryRec, *TT_NameEntry;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_NameTableRec */
/* */
/* <Description> */
/* A structure modeling the TrueType name table. */
/* */
/* <Fields> */
/* format :: The format of the name table. */
/* */
/* numNameRecords :: The number of names in table. */
/* */
/* storageOffset :: The offset of the name table in the `name' */
/* TrueType table. */
/* */
/* names :: An array of name records. */
/* */
/* stream :: the file's input stream. */
/* */
typedef struct TT_NameTableRec_
{
FT_UShort format;
FT_UInt numNameRecords;
FT_UInt storageOffset;
TT_NameEntryRec* names;
FT_Stream stream;
 
} TT_NameTableRec, *TT_NameTable;
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_GaspRangeRec */
/* */
/* <Description> */
/* A tiny structure used to model a gasp range according to the */
/* TrueType specification. */
/* */
/* <Fields> */
/* maxPPEM :: The maximum ppem value to which `gaspFlag' applies. */
/* */
/* gaspFlag :: A flag describing the grid-fitting and anti-aliasing */
/* modes to be used. */
/* */
typedef struct TT_GaspRangeRec_
{
FT_UShort maxPPEM;
FT_UShort gaspFlag;
 
} TT_GaspRangeRec, *TT_GaspRange;
 
 
#define TT_GASP_GRIDFIT 0x01
#define TT_GASP_DOGRAY 0x02
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_GaspRec */
/* */
/* <Description> */
/* A structure modeling the TrueType `gasp' table used to specify */
/* grid-fitting and anti-aliasing behaviour. */
/* */
/* <Fields> */
/* version :: The version number. */
/* */
/* numRanges :: The number of gasp ranges in table. */
/* */
/* gaspRanges :: An array of gasp ranges. */
/* */
typedef struct TT_Gasp_
{
FT_UShort version;
FT_UShort numRanges;
TT_GaspRange gaspRanges;
 
} TT_GaspRec;
 
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_HdmxEntryRec */
/* */
/* <Description> */
/* A small structure used to model the pre-computed widths of a given */
/* size. They are found in the `hdmx' table. */
/* */
/* <Fields> */
/* ppem :: The pixels per EM value at which these metrics apply. */
/* */
/* max_width :: The maximum advance width for this metric. */
/* */
/* widths :: An array of widths. Note: These are 8-bit bytes. */
/* */
typedef struct TT_HdmxEntryRec_
{
FT_Byte ppem;
FT_Byte max_width;
FT_Byte* widths;
 
} TT_HdmxEntryRec, *TT_HdmxEntry;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_HdmxRec */
/* */
/* <Description> */
/* A structure used to model the `hdmx' table, which contains */
/* pre-computed widths for a set of given sizes/dimensions. */
/* */
/* <Fields> */
/* version :: The version number. */
/* */
/* num_records :: The number of hdmx records. */
/* */
/* records :: An array of hdmx records. */
/* */
typedef struct TT_HdmxRec_
{
FT_UShort version;
FT_Short num_records;
TT_HdmxEntry records;
 
} TT_HdmxRec, *TT_Hdmx;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_Kern0_PairRec */
/* */
/* <Description> */
/* A structure used to model a kerning pair for the kerning table */
/* format 0. The engine now loads this table if it finds one in the */
/* font file. */
/* */
/* <Fields> */
/* left :: The index of the left glyph in pair. */
/* */
/* right :: The index of the right glyph in pair. */
/* */
/* value :: The kerning distance. A positive value spaces the */
/* glyphs, a negative one makes them closer. */
/* */
typedef struct TT_Kern0_PairRec_
{
FT_UShort left; /* index of left glyph in pair */
FT_UShort right; /* index of right glyph in pair */
FT_FWord value; /* kerning value */
 
} TT_Kern0_PairRec, *TT_Kern0_Pair;
 
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** EMBEDDED BITMAPS SUPPORT ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_SBit_MetricsRec */
/* */
/* <Description> */
/* A structure used to hold the big metrics of a given glyph bitmap */
/* in a TrueType or OpenType font. These are usually found in the */
/* `EBDT' (Microsoft) or `bloc' (Apple) table. */
/* */
/* <Fields> */
/* height :: The glyph height in pixels. */
/* */
/* width :: The glyph width in pixels. */
/* */
/* horiBearingX :: The horizontal left bearing. */
/* */
/* horiBearingY :: The horizontal top bearing. */
/* */
/* horiAdvance :: The horizontal advance. */
/* */
/* vertBearingX :: The vertical left bearing. */
/* */
/* vertBearingY :: The vertical top bearing. */
/* */
/* vertAdvance :: The vertical advance. */
/* */
typedef struct TT_SBit_MetricsRec_
{
FT_Byte height;
FT_Byte width;
 
FT_Char horiBearingX;
FT_Char horiBearingY;
FT_Byte horiAdvance;
 
FT_Char vertBearingX;
FT_Char vertBearingY;
FT_Byte vertAdvance;
 
} TT_SBit_MetricsRec, *TT_SBit_Metrics;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_SBit_SmallMetricsRec */
/* */
/* <Description> */
/* A structure used to hold the small metrics of a given glyph bitmap */
/* in a TrueType or OpenType font. These are usually found in the */
/* `EBDT' (Microsoft) or the `bdat' (Apple) table. */
/* */
/* <Fields> */
/* height :: The glyph height in pixels. */
/* */
/* width :: The glyph width in pixels. */
/* */
/* bearingX :: The left-side bearing. */
/* */
/* bearingY :: The top-side bearing. */
/* */
/* advance :: The advance width or height. */
/* */
typedef struct TT_SBit_Small_Metrics_
{
FT_Byte height;
FT_Byte width;
 
FT_Char bearingX;
FT_Char bearingY;
FT_Byte advance;
 
} TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_SBit_LineMetricsRec */
/* */
/* <Description> */
/* A structure used to describe the text line metrics of a given */
/* bitmap strike, for either a horizontal or vertical layout. */
/* */
/* <Fields> */
/* ascender :: The ascender in pixels. */
/* */
/* descender :: The descender in pixels. */
/* */
/* max_width :: The maximum glyph width in pixels. */
/* */
/* caret_slope_enumerator :: Rise of the caret slope, typically set */
/* to 1 for non-italic fonts. */
/* */
/* caret_slope_denominator :: Rise of the caret slope, typically set */
/* to 0 for non-italic fonts. */
/* */
/* caret_offset :: Offset in pixels to move the caret for */
/* proper positioning. */
/* */
/* min_origin_SB :: Minimum of horiBearingX (resp. */
/* vertBearingY). */
/* min_advance_SB :: Minimum of */
/* */
/* horizontal advance - */
/* ( horiBearingX + width ) */
/* */
/* resp. */
/* */
/* vertical advance - */
/* ( vertBearingY + height ) */
/* */
/* max_before_BL :: Maximum of horiBearingY (resp. */
/* vertBearingY). */
/* */
/* min_after_BL :: Minimum of */
/* */
/* horiBearingY - height */
/* */
/* resp. */
/* */
/* vertBearingX - width */
/* */
/* pads :: Unused (to make the size of the record */
/* a multiple of 32 bits. */
/* */
typedef struct TT_SBit_LineMetricsRec_
{
FT_Char ascender;
FT_Char descender;
FT_Byte max_width;
FT_Char caret_slope_numerator;
FT_Char caret_slope_denominator;
FT_Char caret_offset;
FT_Char min_origin_SB;
FT_Char min_advance_SB;
FT_Char max_before_BL;
FT_Char min_after_BL;
FT_Char pads[2];
 
} TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_SBit_RangeRec */
/* */
/* <Description> */
/* A TrueType/OpenType subIndexTable as defined in the `EBLC' */
/* (Microsoft) or `bloc' (Apple) tables. */
/* */
/* <Fields> */
/* first_glyph :: The first glyph index in the range. */
/* */
/* last_glyph :: The last glyph index in the range. */
/* */
/* index_format :: The format of index table. Valid values are 1 */
/* to 5. */
/* */
/* image_format :: The format of `EBDT' image data. */
/* */
/* image_offset :: The offset to image data in `EBDT'. */
/* */
/* image_size :: For index formats 2 and 5. This is the size in */
/* bytes of each glyph bitmap. */
/* */
/* big_metrics :: For index formats 2 and 5. This is the big */
/* metrics for each glyph bitmap. */
/* */
/* num_glyphs :: For index formats 4 and 5. This is the number of */
/* glyphs in the code array. */
/* */
/* glyph_offsets :: For index formats 1 and 3. */
/* */
/* glyph_codes :: For index formats 4 and 5. */
/* */
/* table_offset :: The offset of the index table in the `EBLC' */
/* table. Only used during strike loading. */
/* */
typedef struct TT_SBit_RangeRec_
{
FT_UShort first_glyph;
FT_UShort last_glyph;
 
FT_UShort index_format;
FT_UShort image_format;
FT_ULong image_offset;
 
FT_ULong image_size;
TT_SBit_MetricsRec metrics;
FT_ULong num_glyphs;
 
FT_ULong* glyph_offsets;
FT_UShort* glyph_codes;
 
FT_ULong table_offset;
 
} TT_SBit_RangeRec, *TT_SBit_Range;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_SBit_StrikeRec */
/* */
/* <Description> */
/* A structure used describe a given bitmap strike in the `EBLC' */
/* (Microsoft) or `bloc' (Apple) tables. */
/* */
/* <Fields> */
/* num_index_ranges :: The number of index ranges. */
/* */
/* index_ranges :: An array of glyph index ranges. */
/* */
/* color_ref :: Unused. `color_ref' is put in for future */
/* enhancements, but these fields are already */
/* in use by other platforms (e.g. Newton). */
/* For details, please see */
/* */
/* http://fonts.apple.com/ */
/* TTRefMan/RM06/Chap6bloc.html */
/* */
/* hori :: The line metrics for horizontal layouts. */
/* */
/* vert :: The line metrics for vertical layouts. */
/* */
/* start_glyph :: The lowest glyph index for this strike. */
/* */
/* end_glyph :: The highest glyph index for this strike. */
/* */
/* x_ppem :: The number of horizontal pixels per EM. */
/* */
/* y_ppem :: The number of vertical pixels per EM. */
/* */
/* bit_depth :: The bit depth. Valid values are 1, 2, 4, */
/* and 8. */
/* */
/* flags :: Is this a vertical or horizontal strike? For */
/* details, please see */
/* */
/* http://fonts.apple.com/ */
/* TTRefMan/RM06/Chap6bloc.html */
/* */
typedef struct TT_SBit_StrikeRec_
{
FT_Int num_ranges;
TT_SBit_Range sbit_ranges;
FT_ULong ranges_offset;
 
FT_ULong color_ref;
 
TT_SBit_LineMetricsRec hori;
TT_SBit_LineMetricsRec vert;
 
FT_UShort start_glyph;
FT_UShort end_glyph;
 
FT_Byte x_ppem;
FT_Byte y_ppem;
 
FT_Byte bit_depth;
FT_Char flags;
 
} TT_SBit_StrikeRec, *TT_SBit_Strike;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_SBit_ComponentRec */
/* */
/* <Description> */
/* A simple structure to describe a compound sbit element. */
/* */
/* <Fields> */
/* glyph_code :: The element's glyph index. */
/* */
/* x_offset :: The element's left bearing. */
/* */
/* y_offset :: The element's top bearing. */
/* */
typedef struct TT_SBit_ComponentRec_
{
FT_UShort glyph_code;
FT_Char x_offset;
FT_Char y_offset;
 
} TT_SBit_ComponentRec, *TT_SBit_Component;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_SBit_ScaleRec */
/* */
/* <Description> */
/* A structure used describe a given bitmap scaling table, as defined */
/* in the `EBSC' table. */
/* */
/* <Fields> */
/* hori :: The horizontal line metrics. */
/* */
/* vert :: The vertical line metrics. */
/* */
/* x_ppem :: The number of horizontal pixels per EM. */
/* */
/* y_ppem :: The number of vertical pixels per EM. */
/* */
/* x_ppem_substitute :: Substitution x_ppem value. */
/* */
/* y_ppem_substitute :: Substitution y_ppem value. */
/* */
typedef struct TT_SBit_ScaleRec_
{
TT_SBit_LineMetricsRec hori;
TT_SBit_LineMetricsRec vert;
 
FT_Byte x_ppem;
FT_Byte y_ppem;
 
FT_Byte x_ppem_substitute;
FT_Byte y_ppem_substitute;
 
} TT_SBit_ScaleRec, *TT_SBit_Scale;
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** POSTSCRIPT GLYPH NAMES SUPPORT ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_Post_20Rec */
/* */
/* <Description> */
/* Postscript names sub-table, format 2.0. Stores the PS name of */
/* each glyph in the font face. */
/* */
/* <Fields> */
/* num_glyphs :: The number of named glyphs in the table. */
/* */
/* num_names :: The number of PS names stored in the table. */
/* */
/* glyph_indices :: The indices of the glyphs in the names arrays. */
/* */
/* glyph_names :: The PS names not in Mac Encoding. */
/* */
typedef struct TT_Post_20Rec_
{
FT_UShort num_glyphs;
FT_UShort num_names;
FT_UShort* glyph_indices;
FT_Char** glyph_names;
 
} TT_Post_20Rec, *TT_Post_20;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_Post_25Rec */
/* */
/* <Description> */
/* Postscript names sub-table, format 2.5. Stores the PS name of */
/* each glyph in the font face. */
/* */
/* <Fields> */
/* num_glyphs :: The number of glyphs in the table. */
/* */
/* offsets :: An array of signed offsets in a normal Mac */
/* Postscript name encoding. */
/* */
typedef struct TT_Post_25_
{
FT_UShort num_glyphs;
FT_Char* offsets;
 
} TT_Post_25Rec, *TT_Post_25;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_Post_NamesRec */
/* */
/* <Description> */
/* Postscript names table, either format 2.0 or 2.5. */
/* */
/* <Fields> */
/* loaded :: A flag to indicate whether the PS names are loaded. */
/* */
/* format_20 :: The sub-table used for format 2.0. */
/* */
/* format_25 :: The sub-table used for format 2.5. */
/* */
typedef struct TT_Post_NamesRec_
{
FT_Bool loaded;
 
union
{
TT_Post_20Rec format_20;
TT_Post_25Rec format_25;
 
} names;
 
} TT_Post_NamesRec, *TT_Post_Names;
 
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** GX VARIATION TABLE SUPPORT ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
typedef struct GX_BlendRec_ *GX_Blend;
#endif
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** EMBEDDED BDF PROPERTIES TABLE SUPPORT ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
/*
* These types are used to support a `BDF ' table that isn't part of the
* official TrueType specification. It is mainly used in SFNT-based
* bitmap fonts that were generated from a set of BDF fonts.
*
* The format of the table is as follows.
*
* USHORT version `BDF ' table version number, should be 0x0001.
* USHORT strikeCount Number of strikes (bitmap sizes) in this table.
* ULONG stringTable Offset (from start of BDF table) to string
* table.
*
* This is followed by an array of `strikeCount' descriptors, having the
* following format.
*
* USHORT ppem Vertical pixels per EM for this strike.
* USHORT numItems Number of items for this strike (properties and
* atoms). Maximum is 255.
*
* This array in turn is followed by `strikeCount' value sets. Each
* `value set' is an array of `numItems' items with the following format.
*
* ULONG item_name Offset in string table to item name.
* USHORT item_type The item type. Possible values are
* 0 => string (e.g., COMMENT)
* 1 => atom (e.g., FONT or even SIZE)
* 2 => int32
* 3 => uint32
* 0x10 => A flag to indicate a properties. This
* is ORed with the above values.
* ULONG item_value For strings => Offset into string table without
* the corresponding double quotes.
* For atoms => Offset into string table.
* For integers => Direct value.
*
* All strings in the string table consist of bytes and are
* zero-terminated.
*
*/
 
#ifdef TT_CONFIG_OPTION_BDF
 
typedef struct TT_BDFRec_
{
FT_Byte* table;
FT_Byte* table_end;
FT_Byte* strings;
FT_ULong strings_size;
FT_UInt num_strikes;
FT_Bool loaded;
 
} TT_BDFRec, *TT_BDF;
 
#endif /* TT_CONFIG_OPTION_BDF */
 
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** ORIGINAL TT_FACE CLASS DEFINITION ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* This structure/class is defined here because it is common to the */
/* following formats: TTF, OpenType-TT, and OpenType-CFF. */
/* */
/* Note, however, that the classes TT_Size and TT_GlyphSlot are not */
/* shared between font drivers, and are thus defined in `ttobjs.h'. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Type> */
/* TT_Face */
/* */
/* <Description> */
/* A handle to a TrueType face/font object. A TT_Face encapsulates */
/* the resolution and scaling independent parts of a TrueType font */
/* resource. */
/* */
/* <Note> */
/* The TT_Face structure is also used as a `parent class' for the */
/* OpenType-CFF class (T2_Face). */
/* */
typedef struct TT_FaceRec_* TT_Face;
 
 
/* a function type used for the truetype bytecode interpreter hooks */
typedef FT_Error
(*TT_Interpreter)( void* exec_context );
 
/* forward declaration */
typedef struct TT_LoaderRec_* TT_Loader;
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Loader_GotoTableFunc */
/* */
/* <Description> */
/* Seeks a stream to the start of a given TrueType table. */
/* */
/* <Input> */
/* face :: A handle to the target face object. */
/* */
/* tag :: A 4-byte tag used to name the table. */
/* */
/* stream :: The input stream. */
/* */
/* <Output> */
/* length :: The length of the table in bytes. Set to 0 if not */
/* needed. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The stream cursor must be at the font file's origin. */
/* */
typedef FT_Error
(*TT_Loader_GotoTableFunc)( TT_Face face,
FT_ULong tag,
FT_Stream stream,
FT_ULong* length );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Loader_StartGlyphFunc */
/* */
/* <Description> */
/* Seeks a stream to the start of a given glyph element, and opens a */
/* frame for it. */
/* */
/* <Input> */
/* loader :: The current TrueType glyph loader object. */
/* */
/* glyph index :: The index of the glyph to access. */
/* */
/* offset :: The offset of the glyph according to the */
/* `locations' table. */
/* */
/* byte_count :: The size of the frame in bytes. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function is normally equivalent to FT_STREAM_SEEK(offset) */
/* followed by FT_FRAME_ENTER(byte_count) with the loader's stream, */
/* but alternative formats (e.g. compressed ones) might use something */
/* different. */
/* */
typedef FT_Error
(*TT_Loader_StartGlyphFunc)( TT_Loader loader,
FT_UInt glyph_index,
FT_ULong offset,
FT_UInt byte_count );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Loader_ReadGlyphFunc */
/* */
/* <Description> */
/* Reads one glyph element (its header, a simple glyph, or a */
/* composite) from the loader's current stream frame. */
/* */
/* <Input> */
/* loader :: The current TrueType glyph loader object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
typedef FT_Error
(*TT_Loader_ReadGlyphFunc)( TT_Loader loader );
 
 
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Loader_EndGlyphFunc */
/* */
/* <Description> */
/* Closes the current loader stream frame for the glyph. */
/* */
/* <Input> */
/* loader :: The current TrueType glyph loader object. */
/* */
typedef void
(*TT_Loader_EndGlyphFunc)( TT_Loader loader );
 
 
/*************************************************************************/
/* */
/* TrueType Face Type */
/* */
/* <Struct> */
/* TT_Face */
/* */
/* <Description> */
/* The TrueType face class. These objects model the resolution and */
/* point-size independent data found in a TrueType font file. */
/* */
/* <Fields> */
/* root :: The base FT_Face structure, managed by the */
/* base layer. */
/* */
/* ttc_header :: The TrueType collection header, used when */
/* the file is a `ttc' rather than a `ttf'. */
/* For ordinary font files, the field */
/* `ttc_header.count' is set to 0. */
/* */
/* format_tag :: The font format tag. */
/* */
/* num_tables :: The number of TrueType tables in this font */
/* file. */
/* */
/* dir_tables :: The directory of TrueType tables for this */
/* font file. */
/* */
/* header :: The font's font header (`head' table). */
/* Read on font opening. */
/* */
/* horizontal :: The font's horizontal header (`hhea' */
/* table). This field also contains the */
/* associated horizontal metrics table */
/* (`hmtx'). */
/* */
/* max_profile :: The font's maximum profile table. Read on */
/* font opening. Note that some maximum */
/* values cannot be taken directly from this */
/* table. We thus define additional fields */
/* below to hold the computed maxima. */
/* */
/* vertical_info :: A boolean which is set when the font file */
/* contains vertical metrics. If not, the */
/* value of the `vertical' field is */
/* undefined. */
/* */
/* vertical :: The font's vertical header (`vhea' table). */
/* This field also contains the associated */
/* vertical metrics table (`vmtx'), if found. */
/* IMPORTANT: The contents of this field is */
/* undefined if the `verticalInfo' field is */
/* unset. */
/* */
/* num_names :: The number of name records within this */
/* TrueType font. */
/* */
/* name_table :: The table of name records (`name'). */
/* */
/* os2 :: The font's OS/2 table (`OS/2'). */
/* */
/* postscript :: The font's PostScript table (`post' */
/* table). The PostScript glyph names are */
/* not loaded by the driver on face opening. */
/* See the `ttpost' module for more details. */
/* */
/* cmap_table :: Address of the face's `cmap' SFNT table */
/* in memory (it's an extracted frame). */
/* */
/* cmap_size :: The size in bytes of the `cmap_table' */
/* described above. */
/* */
/* goto_table :: A function called by each TrueType table */
/* loader to position a stream's cursor to */
/* the start of a given table according to */
/* its tag. It defaults to TT_Goto_Face but */
/* can be different for strange formats (e.g. */
/* Type 42). */
/* */
/* access_glyph_frame :: A function used to access the frame of a */
/* given glyph within the face's font file. */
/* */
/* forget_glyph_frame :: A function used to forget the frame of a */
/* given glyph when all data has been loaded. */
/* */
/* read_glyph_header :: A function used to read a glyph header. */
/* It must be called between an `access' and */
/* `forget'. */
/* */
/* read_simple_glyph :: A function used to read a simple glyph. */
/* It must be called after the header was */
/* read, and before the `forget'. */
/* */
/* read_composite_glyph :: A function used to read a composite glyph. */
/* It must be called after the header was */
/* read, and before the `forget'. */
/* */
/* sfnt :: A pointer to the SFNT service. */
/* */
/* psnames :: A pointer to the PostScript names service. */
/* */
/* hdmx :: The face's horizontal device metrics */
/* (`hdmx' table). This table is optional in */
/* TrueType/OpenType fonts. */
/* */
/* gasp :: The grid-fitting and scaling properties */
/* table (`gasp'). This table is optional in */
/* TrueType/OpenType fonts. */
/* */
/* pclt :: The `pclt' SFNT table. */
/* */
/* num_sbit_strikes :: The number of sbit strikes, i.e., bitmap */
/* sizes, embedded in this font. */
/* */
/* sbit_strikes :: An array of sbit strikes embedded in this */
/* font. This table is optional in a */
/* TrueType/OpenType font. */
/* */
/* num_sbit_scales :: The number of sbit scales for this font. */
/* */
/* sbit_scales :: Array of sbit scales embedded in this */
/* font. This table is optional in a */
/* TrueType/OpenType font. */
/* */
/* postscript_names :: A table used to store the Postscript names */
/* of the glyphs for this font. See the */
/* file `ttconfig.h' for comments on the */
/* TT_CONFIG_OPTION_POSTSCRIPT_NAMES option. */
/* */
/* num_locations :: The number of glyph locations in this */
/* TrueType file. This should be */
/* identical to the number of glyphs. */
/* Ignored for Type 2 fonts. */
/* */
/* glyph_locations :: An array of longs. These are offsets to */
/* glyph data within the `glyf' table. */
/* Ignored for Type 2 font faces. */
/* */
/* glyf_len :: The length of the `glyf' table. Needed */
/* for malformed `loca' tables. */
/* */
/* font_program_size :: Size in bytecodes of the face's font */
/* program. 0 if none defined. Ignored for */
/* Type 2 fonts. */
/* */
/* font_program :: The face's font program (bytecode stream) */
/* executed at load time, also used during */
/* glyph rendering. Comes from the `fpgm' */
/* table. Ignored for Type 2 font fonts. */
/* */
/* cvt_program_size :: The size in bytecodes of the face's cvt */
/* program. Ignored for Type 2 fonts. */
/* */
/* cvt_program :: The face's cvt program (bytecode stream) */
/* executed each time an instance/size is */
/* changed/reset. Comes from the `prep' */
/* table. Ignored for Type 2 fonts. */
/* */
/* cvt_size :: Size of the control value table (in */
/* entries). Ignored for Type 2 fonts. */
/* */
/* cvt :: The face's original control value table. */
/* Coordinates are expressed in unscaled font */
/* units. Comes from the `cvt ' table. */
/* Ignored for Type 2 fonts. */
/* */
/* num_kern_pairs :: The number of kerning pairs present in the */
/* font file. The engine only loads the */
/* first horizontal format 0 kern table it */
/* finds in the font file. Ignored for */
/* Type 2 fonts. */
/* */
/* kern_table_index :: The index of the kerning table in the font */
/* kerning directory. Ignored for Type 2 */
/* fonts. */
/* */
/* interpreter :: A pointer to the TrueType bytecode */
/* interpreters field is also used to hook */
/* the debugger in `ttdebug'. */
/* */
/* unpatented_hinting :: If true, use only unpatented methods in */
/* the bytecode interpreter. */
/* */
/* doblend :: A boolean which is set if the font should */
/* be blended (this is for GX var). */
/* */
/* blend :: Contains the data needed to control GX */
/* variation tables (rather like Multiple */
/* Master data). */
/* */
/* extra :: Reserved for third-party font drivers. */
/* */
/* postscript_name :: The PS name of the font. Used by the */
/* postscript name service. */
/* */
typedef struct TT_FaceRec_
{
FT_FaceRec root;
 
TTC_HeaderRec ttc_header;
 
FT_ULong format_tag;
FT_UShort num_tables;
TT_Table dir_tables;
 
TT_Header header; /* TrueType header table */
TT_HoriHeader horizontal; /* TrueType horizontal header */
 
TT_MaxProfile max_profile;
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
FT_ULong max_components; /* stubbed to 0 */
#endif
 
FT_Bool vertical_info;
TT_VertHeader vertical; /* TT Vertical header, if present */
 
FT_UShort num_names; /* number of name records */
TT_NameTableRec name_table; /* name table */
 
TT_OS2 os2; /* TrueType OS/2 table */
TT_Postscript postscript; /* TrueType Postscript table */
 
FT_Byte* cmap_table; /* extracted `cmap' table */
FT_ULong cmap_size;
 
TT_Loader_GotoTableFunc goto_table;
 
TT_Loader_StartGlyphFunc access_glyph_frame;
TT_Loader_EndGlyphFunc forget_glyph_frame;
TT_Loader_ReadGlyphFunc read_glyph_header;
TT_Loader_ReadGlyphFunc read_simple_glyph;
TT_Loader_ReadGlyphFunc read_composite_glyph;
 
/* a typeless pointer to the SFNT_Interface table used to load */
/* the basic TrueType tables in the face object */
void* sfnt;
 
/* a typeless pointer to the FT_Service_PsCMapsRec table used to */
/* handle glyph names <-> unicode & Mac values */
void* psnames;
 
 
/***********************************************************************/
/* */
/* Optional TrueType/OpenType tables */
/* */
/***********************************************************************/
 
/* horizontal device metrics */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
TT_HdmxRec hdmx;
#endif
 
/* grid-fitting and scaling table */
TT_GaspRec gasp; /* the `gasp' table */
 
/* PCL 5 table */
TT_PCLT pclt;
 
/* embedded bitmaps support */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
FT_ULong num_sbit_strikes;
TT_SBit_Strike sbit_strikes;
#endif
 
FT_ULong num_sbit_scales;
TT_SBit_Scale sbit_scales;
 
/* postscript names table */
TT_Post_NamesRec postscript_names;
 
 
/***********************************************************************/
/* */
/* TrueType-specific fields (ignored by the OTF-Type2 driver) */
/* */
/***********************************************************************/
 
/* the glyph locations */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
FT_UShort num_locations_stub;
FT_Long* glyph_locations_stub;
#endif
 
/* the font program, if any */
FT_ULong font_program_size;
FT_Byte* font_program;
 
/* the cvt program, if any */
FT_ULong cvt_program_size;
FT_Byte* cvt_program;
 
/* the original, unscaled, control value table */
FT_ULong cvt_size;
FT_Short* cvt;
 
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
/* the format 0 kerning table, if any */
FT_Int num_kern_pairs;
FT_Int kern_table_index;
TT_Kern0_Pair kern_pairs;
#endif
 
/* A pointer to the bytecode interpreter to use. This is also */
/* used to hook the debugger for the `ttdebug' utility. */
TT_Interpreter interpreter;
 
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
/* Use unpatented hinting only. */
FT_Bool unpatented_hinting;
#endif
 
/***********************************************************************/
/* */
/* Other tables or fields. This is used by derivative formats like */
/* OpenType. */
/* */
/***********************************************************************/
 
FT_Generic extra;
 
const char* postscript_name;
 
/* since version 2.1.8, but was originally placed after */
/* `glyph_locations_stub' */
FT_ULong glyf_len;
 
/* since version 2.1.8, but was originally placed before `extra' */
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_Bool doblend;
GX_Blend blend;
#endif
 
/* since version 2.2 */
 
FT_Byte* horz_metrics;
FT_ULong horz_metrics_size;
 
FT_Byte* vert_metrics;
FT_ULong vert_metrics_size;
 
FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */
FT_Byte* glyph_locations;
 
FT_Byte* hdmx_table;
FT_ULong hdmx_table_size;
FT_UInt hdmx_record_count;
FT_ULong hdmx_record_size;
FT_Byte* hdmx_record_sizes;
 
FT_Byte* sbit_table;
FT_ULong sbit_table_size;
FT_UInt sbit_num_strikes;
 
FT_Byte* kern_table;
FT_ULong kern_table_size;
FT_UInt num_kern_tables;
FT_UInt32 kern_avail_bits;
FT_UInt32 kern_order_bits;
 
#ifdef TT_CONFIG_OPTION_BDF
TT_BDFRec bdf;
#endif /* TT_CONFIG_OPTION_BDF */
 
/* since 2.3.0 */
FT_ULong horz_metrics_offset;
FT_ULong vert_metrics_offset;
 
} TT_FaceRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_GlyphZoneRec */
/* */
/* <Description> */
/* A glyph zone is used to load, scale and hint glyph outline */
/* coordinates. */
/* */
/* <Fields> */
/* memory :: A handle to the memory manager. */
/* */
/* max_points :: The maximal size in points of the zone. */
/* */
/* max_contours :: Max size in links contours of the zone. */
/* */
/* n_points :: The current number of points in the zone. */
/* */
/* n_contours :: The current number of contours in the zone. */
/* */
/* org :: The original glyph coordinates (font */
/* units/scaled). */
/* */
/* cur :: The current glyph coordinates (scaled/hinted). */
/* */
/* tags :: The point control tags. */
/* */
/* contours :: The contours end points. */
/* */
/* first_point :: Offset of the current subglyph's first point. */
/* */
typedef struct TT_GlyphZoneRec_
{
FT_Memory memory;
FT_UShort max_points;
FT_UShort max_contours;
FT_UShort n_points; /* number of points in zone */
FT_Short n_contours; /* number of contours */
 
FT_Vector* org; /* original point coordinates */
FT_Vector* cur; /* current point coordinates */
FT_Vector* orus; /* original (unscaled) point coordinates */
 
FT_Byte* tags; /* current touch flags */
FT_UShort* contours; /* contour end points */
 
FT_UShort first_point; /* offset of first (#0) point */
 
} TT_GlyphZoneRec, *TT_GlyphZone;
 
 
/* handle to execution context */
typedef struct TT_ExecContextRec_* TT_ExecContext;
 
/* glyph loader structure */
typedef struct TT_LoaderRec_
{
FT_Face face;
FT_Size size;
FT_GlyphSlot glyph;
FT_GlyphLoader gloader;
 
FT_ULong load_flags;
FT_UInt glyph_index;
 
FT_Stream stream;
FT_Int byte_len;
 
FT_Short n_contours;
FT_BBox bbox;
FT_Int left_bearing;
FT_Int advance;
FT_Int linear;
FT_Bool linear_def;
FT_Bool preserve_pps;
FT_Vector pp1;
FT_Vector pp2;
 
FT_ULong glyf_offset;
 
/* the zone where we load our glyphs */
TT_GlyphZoneRec base;
TT_GlyphZoneRec zone;
 
TT_ExecContext exec;
FT_Byte* instructions;
FT_ULong ins_pos;
 
/* for possible extensibility in other formats */
void* other;
 
/* since version 2.1.8 */
FT_Int top_bearing;
FT_Int vadvance;
FT_Vector pp3;
FT_Vector pp4;
 
/* since version 2.2.1 */
FT_Byte* cursor;
FT_Byte* limit;
 
} TT_LoaderRec;
 
 
FT_END_HEADER
 
#endif /* __TTTYPES_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/t1tables.h
0,0 → 1,504
/***************************************************************************/
/* */
/* t1tables.h */
/* */
/* Basic Type 1/Type 2 tables definitions and interface (specification */
/* only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __T1TABLES_H__
#define __T1TABLES_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* type1_tables */
/* */
/* <Title> */
/* Type 1 Tables */
/* */
/* <Abstract> */
/* Type~1 (PostScript) specific font tables. */
/* */
/* <Description> */
/* This section contains the definition of Type 1-specific tables, */
/* including structures related to other PostScript font formats. */
/* */
/*************************************************************************/
 
 
/* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
/* structures in order to support Multiple Master fonts. */
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* PS_FontInfoRec */
/* */
/* <Description> */
/* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */
/* Note that for Multiple Master fonts, each instance has its own */
/* FontInfo dictionary. */
/* */
typedef struct PS_FontInfoRec_
{
FT_String* version;
FT_String* notice;
FT_String* full_name;
FT_String* family_name;
FT_String* weight;
FT_Long italic_angle;
FT_Bool is_fixed_pitch;
FT_Short underline_position;
FT_UShort underline_thickness;
 
} PS_FontInfoRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* PS_FontInfo */
/* */
/* <Description> */
/* A handle to a @PS_FontInfoRec structure. */
/* */
typedef struct PS_FontInfoRec_* PS_FontInfo;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* T1_FontInfo */
/* */
/* <Description> */
/* This type is equivalent to @PS_FontInfoRec. It is deprecated but */
/* kept to maintain source compatibility between various versions of */
/* FreeType. */
/* */
typedef PS_FontInfoRec T1_FontInfo;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* PS_PrivateRec */
/* */
/* <Description> */
/* A structure used to model a Type~1 or Type~2 private dictionary. */
/* Note that for Multiple Master fonts, each instance has its own */
/* Private dictionary. */
/* */
typedef struct PS_PrivateRec_
{
FT_Int unique_id;
FT_Int lenIV;
 
FT_Byte num_blue_values;
FT_Byte num_other_blues;
FT_Byte num_family_blues;
FT_Byte num_family_other_blues;
 
FT_Short blue_values[14];
FT_Short other_blues[10];
 
FT_Short family_blues [14];
FT_Short family_other_blues[10];
 
FT_Fixed blue_scale;
FT_Int blue_shift;
FT_Int blue_fuzz;
 
FT_UShort standard_width[1];
FT_UShort standard_height[1];
 
FT_Byte num_snap_widths;
FT_Byte num_snap_heights;
FT_Bool force_bold;
FT_Bool round_stem_up;
 
FT_Short snap_widths [13]; /* including std width */
FT_Short snap_heights[13]; /* including std height */
 
FT_Fixed expansion_factor;
 
FT_Long language_group;
FT_Long password;
 
FT_Short min_feature[2];
 
} PS_PrivateRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* PS_Private */
/* */
/* <Description> */
/* A handle to a @PS_PrivateRec structure. */
/* */
typedef struct PS_PrivateRec_* PS_Private;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* T1_Private */
/* */
/* <Description> */
/* This type is equivalent to @PS_PrivateRec. It is deprecated but */
/* kept to maintain source compatibility between various versions of */
/* FreeType. */
/* */
typedef PS_PrivateRec T1_Private;
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* T1_Blend_Flags */
/* */
/* <Description> */
/* A set of flags used to indicate which fields are present in a */
/* given blend dictionary (font info or private). Used to support */
/* Multiple Masters fonts. */
/* */
typedef enum T1_Blend_Flags_
{
/*# required fields in a FontInfo blend dictionary */
T1_BLEND_UNDERLINE_POSITION = 0,
T1_BLEND_UNDERLINE_THICKNESS,
T1_BLEND_ITALIC_ANGLE,
 
/*# required fields in a Private blend dictionary */
T1_BLEND_BLUE_VALUES,
T1_BLEND_OTHER_BLUES,
T1_BLEND_STANDARD_WIDTH,
T1_BLEND_STANDARD_HEIGHT,
T1_BLEND_STEM_SNAP_WIDTHS,
T1_BLEND_STEM_SNAP_HEIGHTS,
T1_BLEND_BLUE_SCALE,
T1_BLEND_BLUE_SHIFT,
T1_BLEND_FAMILY_BLUES,
T1_BLEND_FAMILY_OTHER_BLUES,
T1_BLEND_FORCE_BOLD,
 
/*# never remove */
T1_BLEND_MAX
 
} T1_Blend_Flags;
 
/* */
 
 
/*# backwards compatible definitions */
#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
#define t1_blend_blue_values T1_BLEND_BLUE_VALUES
#define t1_blend_other_blues T1_BLEND_OTHER_BLUES
#define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH
#define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT
#define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS
#define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS
#define t1_blend_blue_scale T1_BLEND_BLUE_SCALE
#define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT
#define t1_blend_family_blues T1_BLEND_FAMILY_BLUES
#define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES
#define t1_blend_force_bold T1_BLEND_FORCE_BOLD
#define t1_blend_max T1_BLEND_MAX
 
 
/* maximum number of Multiple Masters designs, as defined in the spec */
#define T1_MAX_MM_DESIGNS 16
 
/* maximum number of Multiple Masters axes, as defined in the spec */
#define T1_MAX_MM_AXIS 4
 
/* maximum number of elements in a design map */
#define T1_MAX_MM_MAP_POINTS 20
 
 
/* this structure is used to store the BlendDesignMap entry for an axis */
typedef struct PS_DesignMap_
{
FT_Byte num_points;
FT_Long* design_points;
FT_Fixed* blend_points;
 
} PS_DesignMapRec, *PS_DesignMap;
 
/* backwards-compatible definition */
typedef PS_DesignMapRec T1_DesignMap;
 
 
typedef struct PS_BlendRec_
{
FT_UInt num_designs;
FT_UInt num_axis;
 
FT_String* axis_names[T1_MAX_MM_AXIS];
FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
 
FT_Fixed* weight_vector;
FT_Fixed* default_weight_vector;
 
PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
PS_Private privates [T1_MAX_MM_DESIGNS + 1];
 
FT_ULong blend_bitflags;
 
FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
 
/* since 2.3.0 */
 
/* undocumented, optional: the default design instance; */
/* corresponds to default_weight_vector -- */
/* num_default_design_vector == 0 means it is not present */
/* in the font and associated metrics files */
FT_UInt default_design_vector[T1_MAX_MM_DESIGNS];
FT_UInt num_default_design_vector;
 
} PS_BlendRec, *PS_Blend;
 
 
/* backwards-compatible definition */
typedef PS_BlendRec T1_Blend;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* CID_FaceDictRec */
/* */
/* <Description> */
/* A structure used to represent data in a CID top-level dictionary. */
/* */
typedef struct CID_FaceDictRec_
{
PS_PrivateRec private_dict;
 
FT_UInt len_buildchar;
FT_Fixed forcebold_threshold;
FT_Pos stroke_width;
FT_Fixed expansion_factor;
 
FT_Byte paint_type;
FT_Byte font_type;
FT_Matrix font_matrix;
FT_Vector font_offset;
 
FT_UInt num_subrs;
FT_ULong subrmap_offset;
FT_Int sd_bytes;
 
} CID_FaceDictRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* CID_FaceDict */
/* */
/* <Description> */
/* A handle to a @CID_FaceDictRec structure. */
/* */
typedef struct CID_FaceDictRec_* CID_FaceDict;
 
/* */
 
 
/* backwards-compatible definition */
typedef CID_FaceDictRec CID_FontDict;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* CID_FaceInfoRec */
/* */
/* <Description> */
/* A structure used to represent CID Face information. */
/* */
typedef struct CID_FaceInfoRec_
{
FT_String* cid_font_name;
FT_Fixed cid_version;
FT_Int cid_font_type;
 
FT_String* registry;
FT_String* ordering;
FT_Int supplement;
 
PS_FontInfoRec font_info;
FT_BBox font_bbox;
FT_ULong uid_base;
 
FT_Int num_xuid;
FT_ULong xuid[16];
 
FT_ULong cidmap_offset;
FT_Int fd_bytes;
FT_Int gd_bytes;
FT_ULong cid_count;
 
FT_Int num_dicts;
CID_FaceDict font_dicts;
 
FT_ULong data_offset;
 
} CID_FaceInfoRec;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* CID_FaceInfo */
/* */
/* <Description> */
/* A handle to a @CID_FaceInfoRec structure. */
/* */
typedef struct CID_FaceInfoRec_* CID_FaceInfo;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* CID_Info */
/* */
/* <Description> */
/* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
/* kept to maintain source compatibility between various versions of */
/* FreeType. */
/* */
typedef CID_FaceInfoRec CID_Info;
 
 
/************************************************************************
*
* @function:
* FT_Has_PS_Glyph_Names
*
* @description:
* Return true if a given face provides reliable PostScript glyph
* names. This is similar to using the @FT_HAS_GLYPH_NAMES macro,
* except that certain fonts (mostly TrueType) contain incorrect
* glyph name tables.
*
* When this function returns true, the caller is sure that the glyph
* names returned by @FT_Get_Glyph_Name are reliable.
*
* @input:
* face ::
* face handle
*
* @return:
* Boolean. True if glyph names are reliable.
*
*/
FT_EXPORT( FT_Int )
FT_Has_PS_Glyph_Names( FT_Face face );
 
 
/************************************************************************
*
* @function:
* FT_Get_PS_Font_Info
*
* @description:
* Retrieve the @PS_FontInfoRec structure corresponding to a given
* PostScript font.
*
* @input:
* face ::
* PostScript face handle.
*
* @output:
* afont_info ::
* Output font info structure pointer.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The string pointers within the font info structure are owned by
* the face and don't need to be freed by the caller.
*
* If the font's format is not PostScript-based, this function will
* return the `FT_Err_Invalid_Argument' error code.
*
*/
FT_EXPORT( FT_Error )
FT_Get_PS_Font_Info( FT_Face face,
PS_FontInfo afont_info );
 
 
/************************************************************************
*
* @function:
* FT_Get_PS_Font_Private
*
* @description:
* Retrieve the @PS_PrivateRec structure corresponding to a given
* PostScript font.
*
* @input:
* face ::
* PostScript face handle.
*
* @output:
* afont_private ::
* Output private dictionary structure pointer.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The string pointers within the @PS_PrivateRec structure are owned by
* the face and don't need to be freed by the caller.
*
* If the font's format is not PostScript-based, this function returns
* the `FT_Err_Invalid_Argument' error code.
*
*/
FT_EXPORT( FT_Error )
FT_Get_PS_Font_Private( FT_Face face,
PS_Private afont_private );
 
/* */
 
 
FT_END_HEADER
 
#endif /* __T1TABLES_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ttcache.h
0,0 → 1,216
/*******************************************************************
*
* ttcache.h 1.1
*
* Generic object cache
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*
* This component defines and implements object caches.
*
* An object class is a structure layout that encapsulate one
* given type of data used by the FreeType engine. Each object
* class is completely described by:
*
* - a 'root' or 'leading' structure containing the first
* important fields of the class. The root structure is
* always of fixed size.
*
* It is implemented as a simple C structure, and may
* contain several pointers to sub-tables that can be
* sized and allocated dynamically.
*
* Examples: TFace, TInstance, TGlyph & TExecution_Context
* (defined in 'ttobjs.h')
*
* - we make a difference between 'child' pointers and 'peer'
* pointers. A 'child' pointer points to a sub-table that is
* owned by the object, while a 'peer' pointer points to any
* other kind of data the object isn't responsible for.
*
* An object class is thus usually a 'tree' of 'child' tables.
*
* - each object class needs a constructor and a destructor.
*
* A constructor is a function which receives the address of
* freshly allocated and zeroed object root structure and
* 'builds' all the valid child data that must be associated
* to the object before it becomes 'valid'.
*
* A destructor does the inverse job: given the address of
* a valid object, it must discard all its child data and
* zero its main fields (essentially the pointers and array
* sizes found in the root fields).
*
*
* Important notes:
*
* When the constructor fails to allocate an object, it must
* return immediately with an error code, and not try to release
* what it has previously allocated before the error. The cache
* manager detects the error and calls the destructor on the
* partial object, before returning the error to the caller (along
* with a NULL pointer for the "new" object).
*
* The destructor must thus be able to deal with "partial objects",
* i.e., objects where only part of the child tables are allocated,
* and only release these ones. As the TT_Free() function accepts
* a NULL parameter (and returns successfuly in this case), no check
* is really necessary when using the macro 'FREE()'.
*
* Currently, there is no check in the cache manager to see if a
* destructor fails (double error state!).
*
* This scheme is more compact and more maintanable than the one
* where de-allocation code is duplicated in the constructor
* _and_ the destructor.
*
*
*
* Changes between 1.1 and 1.0:
*
* - introduced the refreshed and finalizer class definition/implementation
* - inserted an engine instance pointer in the cache structure
*
******************************************************************/
 
#ifndef TTCACHE_H
#define TTCACHE_H
 
#include "tttypes.h"
#include "ttconfig.h"
#include "ttmutex.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
typedef TT_Error TConstructor( void* object,
void* parent );
 
typedef TT_Error TDestructor ( void* object );
 
typedef TConstructor TRefresher;
typedef TDestructor TFinalizer;
 
typedef TConstructor* PConstructor;
typedef TDestructor* PDestructor;
typedef TRefresher* PRefresher;
typedef TFinalizer* PFinalizer;
 
 
/* A Cache class record holds the data necessary to define */
/* a cache kind. */
struct TCache_Class_
{
ULong object_size;
Long idle_limit;
PConstructor init;
PDestructor done;
PRefresher reset;
PFinalizer finalize;
};
 
typedef struct TCache_Class_ TCache_Class;
typedef TCache_Class* PCache_Class;
 
 
 
/* Simple list node record. A list element is said to be 'unlinked' */
/* when it doesn't belong to any list. */
struct TList_Element_;
 
typedef struct TList_Element_ TList_Element;
typedef TList_Element* PList_Element;
 
struct TList_Element_
{
PList_Element next;
void* data;
};
 
 
/* Simple singly-linked list record - LIFO style, no tail field */
typedef PList_Element TSingle_List;
 
struct TCache_
{
PEngine_Instance engine;
PCache_Class clazz; /* 'class' is a reserved word in C++ */
TMutex* lock;
TSingle_List active;
TSingle_List idle;
Long idle_count;
};
 
typedef struct TCache_ TCache;
typedef TCache* PCache;
 
/* Returns a new list element, either fresh or recycled. */
/* Note: the returned element is unlinked. */
 
/* An object cache holds two lists tracking the active and */
/* idle objects that are currently created and used by the */
/* engine. It can also be 'protected' by a mutex. */
 
/* Initializes a new cache, of class 'clazz', pointed by 'cache', */
/* protected by the 'lock' mutex. Set 'lock' to NULL if the cache */
/* doesn't need protection */
 
LOCAL_DEF
TT_Error Cache_Create( PEngine_Instance engine,
PCache_Class clazz,
TCache* cache,
TMutex* lock );
 
/* Destroys a cache and all its listed objects */
 
LOCAL_DEF
TT_Error Cache_Destroy( TCache* cache );
 
 
/* Extracts a new object from the cache */
 
LOCAL_DEF
TT_Error Cache_New( TCache* cache,
void** new_object,
void* parent_object );
 
 
/* Returns an object to the cache, or discards it depending */
/* on the cache class' 'idle_limit' field */
 
LOCAL_DEF
TT_Error Cache_Done( TCache* cache, void* data );
 
#define CACHE_New( _cache, _newobj, _parent ) \
Cache_New( (TCache*)_cache, (void**)&_newobj, (void*)_parent )
 
#define CACHE_Done( _cache, _obj ) \
Cache_Done( (TCache*)_cache, (void*)_obj )
 
 
 
LOCAL_DEF
TT_Error TTCache_Init( PEngine_Instance engine );
 
LOCAL_DEF
TT_Error TTCache_Done( PEngine_Instance engine );
 
 
#ifdef __cplusplus
}
#endif
 
#endif /* TTCACHE_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttcalc.h
0,0 → 1,97
/*******************************************************************
*
* ttcalc.h
*
* Arithmetic Computations (specification).
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
******************************************************************/
 
#ifndef TTCALC_H
#define TTCALC_H
 
#include "ttconfig.h"
#include "freetype.h"
 
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifdef LONG64
 
typedef INT64 TT_Int64;
 
#define ADD_64( x, y, z ) z = x + y
#define SUB_64( x, y, z ) z = x - y
#define MUL_64( x, y, z ) z = (TT_Int64)(x) * (y)
 
#define DIV_64( x, y ) ( (x) / (y) )
 
#define SQRT_64( x ) Sqrt64( x )
#define SQRT_32( x ) Sqrt32( x )
 
LOCAL_DEF TT_Int32 Sqrt64( TT_Int64 l );
 
#else /* LONG64 */
 
struct TT_Int64_
{
TT_Word32 lo;
TT_Word32 hi;
};
 
typedef struct TT_Int64_ TT_Int64;
 
#define ADD_64( x, y, z ) Add64( &x, &y, &z )
#define SUB_64( x, y, z ) Sub64( &x, &y, &z )
#define MUL_64( x, y, z ) MulTo64( x, y, &z )
 
#define DIV_64( x, y ) Div64by32( &x, y )
 
#define SQRT_64( x ) Sqrt64( &x )
#define SQRT_32( x ) Sqrt32( x )
 
LOCAL_DEF void Add64( TT_Int64* x, TT_Int64* y, TT_Int64* z );
LOCAL_DEF void Sub64( TT_Int64* x, TT_Int64* y, TT_Int64* z );
 
LOCAL_DEF void MulTo64( TT_Int32 x, TT_Int32 y, TT_Int64* z );
 
LOCAL_DEF TT_Int32 Div64by32( TT_Int64* x, TT_Int32 y );
 
LOCAL_DEF int Order64( TT_Int64* z );
 
LOCAL_DEF TT_Int32 Sqrt64( TT_Int64* l );
 
#endif /* LONG64 */
 
/* The two following functions are now part of the API! */
 
/* TT_Long TT_MulDiv( TT_Long a, TT_Long b, TT_Long c ); */
/* TT_Long TT_MulFix( TT_Long a, TT_Long b ); */
 
 
#define INT_TO_F26DOT6( x ) ( (Long)(x) << 6 )
#define INT_TO_F2DOT14( x ) ( (Long)(x) << 14 )
#define INT_TO_FIXED( x ) ( (Long)(x) << 16 )
#define F2DOT14_TO_FIXED( x ) ( (Long)(x) << 2 )
#define FLOAT_TO_FIXED( x ) ( (Long)(x * 65536.0) )
 
#define ROUND_F26DOT6( x ) ( x >= 0 ? ( ((x) + 32) & -64) \
: ( -((32 - (x)) & -64) ) )
 
#ifdef __cplusplus
}
#endif
 
#endif /* TTCALC_H */
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttcmap.h
0,0 → 1,169
/*******************************************************************
*
* ttcmap.h 1.0
*
* TrueType Character Mappings
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*
******************************************************************/
 
#ifndef TTCMAP_H
#define TTCMAP_H
 
#include "ttconfig.h"
#include "tttypes.h"
 
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* format 0 */
 
struct TCMap0_
{
PByte glyphIdArray;
};
 
typedef struct TCMap0_ TCMap0;
typedef TCMap0* PCMap0;
 
 
/* format 2 */
 
struct TCMap2SubHeader_
{
UShort firstCode; /* first valid low byte */
UShort entryCount; /* number of valid low bytes */
Short idDelta; /* delta value to glyphIndex */
UShort idRangeOffset; /* offset from here to 1st code */
};
 
typedef struct TCMap2SubHeader_ TCMap2SubHeader;
typedef TCMap2SubHeader* PCMap2SubHeader;
 
struct TCMap2_
{
PUShort subHeaderKeys;
/* high byte mapping table */
/* value = subHeader index * 8 */
 
PCMap2SubHeader subHeaders;
PUShort glyphIdArray;
UShort numGlyphId; /* control value */
};
 
typedef struct TCMap2_ TCMap2;
typedef TCMap2* PCMap2;
 
 
/* format 4 */
 
struct TCMap4Segment_
{
UShort endCount;
UShort startCount;
Short idDelta; /* in the specs defined as UShort but the
example there gives negative values... */
UShort idRangeOffset;
};
 
typedef struct TCMap4Segment_ TCMap4Segment;
typedef TCMap4Segment* PCMap4Segment;
 
struct TCMap4_
{
UShort segCountX2; /* number of segments * 2 */
UShort searchRange; /* these parameters can be used */
UShort entrySelector; /* for a binary search */
UShort rangeShift;
 
PCMap4Segment segments;
PUShort glyphIdArray;
UShort numGlyphId; /* control value */
};
 
typedef struct TCMap4_ TCMap4;
typedef TCMap4* PCMap4;
 
 
/* format 6 */
 
struct TCMap6_
{
UShort firstCode; /* first character code of subrange */
UShort entryCount; /* number of character codes in subrange */
 
PUShort glyphIdArray;
};
 
typedef struct TCMap6_ TCMap6;
typedef TCMap6* PCMap6;
 
 
/* charmap table */
 
struct TCMapTable_
{
UShort platformID;
UShort platformEncodingID;
UShort format;
UShort length;
UShort version;
 
Bool loaded;
ULong offset;
 
union
{
TCMap0 cmap0;
TCMap2 cmap2;
TCMap4 cmap4;
TCMap6 cmap6;
} c;
};
 
typedef struct TCMapTable_ TCMapTable;
typedef TCMapTable* PCMapTable;
 
 
 
/* Load character mappings directory when face is loaded. */
/* The mappings themselves are only loaded on demand. */
 
LOCAL_DEF
TT_Error CharMap_Load( PCMapTable table,
TT_Stream input );
 
 
/* Destroy one character mapping table */
 
LOCAL_DEF
TT_Error CharMap_Free( PCMapTable table );
 
 
/* Use character mapping table to perform mapping */
 
LOCAL_DEF
UShort CharMap_Index( PCMapTable cmap,
UShort charCode );
 
/* NOTE: The PFace type isn't defined at this point */
 
#ifdef __cplusplus
}
#endif
 
#endif /* TTCMAP_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttconfig.h
0,0 → 1,279
/*******************************************************************
*
* ttconfig.h 1.0
*
* Configuration settings header file (spec only).
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
* Notes:
*
* All the configuration #define statements have been gathered in
* this file to allow easy check and modification.
*
******************************************************************/
 
#ifndef TTCONFIG_H
#define TTCONFIG_H
 
 
 
/* ------------ auto configuration ------------------------------------- */
 
 
/*************************************************************************/
/* Here we include the file ft_conf.h for system dependent stuff. */
/* The specific makefile is responsible for providing the right path to */
/* this file. */
 
#include "ft_conf.h"
 
 
/**************************************************************************/
/* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */
/* version of the library. */
 
/* #define TT_CONFIG_OPTION_THREAD_SAFE */
 
 
 
/* ------------ general debugging -------------------------------------- */
 
 
/*************************************************************************
*
* There are now three debugging modes:
*
* - trace mode:
*
* Error and trace messages are sent to the log file
* (which can be the standard error output). Define
* DEBUG_LEVEL_TRACE to enable this mode.
*
* - error mode:
*
* Only error messages are generated. Define
* DEBUG_LEVEL_ERROR to enable this mode.
*
* - release mode:
*
* Error messages are neither sent nor generated. The code is
* free from any debugging parts.
*
*
* Note that you should link the engine with the 'ttdebug' component.
* in case either DEBUG_LEVEL_TRACE or DEBUG_LEVEL_ERROR is defined.
*
* Please consult ttdebug.h for more details. */
 
/* #define DEBUG_LEVEL_TRACE */
/* #define DEBUG_LEVEL_ERROR */
 
 
 
/* ------------ special debugging -------------------------------------- */
 
 
/*************************************************************************/
/* Define this if you want to generate a special debug version of the */
/* rasterizer. This will progressively draw the glyphs while the */
/* computations are done directly on the graphics screen... (with */
/* inverted glyphs). */
/* */
/* Use it at your own risk! It is not maintained currently. */
/* */
/* IMPORTANT: This is reserved to developers willing to debug the */
/* rasterizer, which seems working very well in its */
/* current state... */
 
/* #define DEBUG_RASTER */
 
 
/*************************************************************************/
/* Define this to have a simple debugger version of RunIns(). */
/* */
/* Use it at your own risk! It is not maintained currently. */
 
/* #define DEBUG_INTERPRETER */
 
 
/*************************************************************************/
/* Define this to have some housekeeping of allocation and deallocation. */
/* */
/* Please note that probably not all OS-specific versions of ttmemory.c */
/* provide this functionality. */
 
/* #define DEBUG_MEMORY */
 
 
/*************************************************************************/
/* Define this to have bounds checking for file buffer frames. */
/* */
/* Please note that probably not all OS-specific versions of ttfile.c */
/* provide this functionality. */
 
/* #define DEBUG_FILE */
 
 
 
/* ------------ arithmetic and processor support ----------------------- */
 
 
/*************************************************************************/
/* Define TT_USE_LONG_LONG if you want to enable the use of the */
/* 'long long' 64-bit type provided by gcc and other compilers. Note */
/* that : */
/* */
/* 1. The type isn't ANSI, and thus will produce many warnings */
/* during library compilation. */
/* */
/* 2. Though the generated object files are slightly smaller, the */
/* resulting executables are bigger of about 4Kb! gcc must be */
/* linking some extra code in there! */
/* */
/* 3. There is really no speed gain in doing so (but it may help */
/* debug the ttcalc component). */
/* */
/* IMPORTANT NOTE: You don't need to define it on 64-bits machines! */
/* */
/* NOTE 2 : This flag used to be _GNUC_LONG64_ */
 
/* #define TT_USE_LONG_LONG */
 
 
/*************************************************************************/
/* define ALIGNMENT to your processor/environment preferred alignment */
/* size. A value of 8 should work on all current processors, even */
/* 64-bits ones. */
 
#define ALIGNMENT 8
 
 
 
/* --------------- miscellaneous ----------------------------------- */
 
 
/*********************************************************************/
/* The number of extensions available. Don't change this value */
/* except if you add new extensions to the engine. */
 
#define TT_MAX_EXTENSIONS 8
 
 
 
/* --------------- automatic setup -- don't touch ------------------ */
 
 
/*********************************************************************/
/* If HAVE_TT_TEXT is defined we don't provide a default typedef for */
/* defining TT_Text. */
 
#ifndef HAVE_TT_TEXT
#define HAVE_TT_TEXT
typedef char TT_Text;
#endif
 
 
/*********************************************************************/
/* We define NULL in case it's not defined yet. The default */
/* location is stdlib.h. */
 
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
 
 
/*********************************************************************/
/* Some systems can't use vfprintf for error messages on stderr; if */
/* HAVE_PRINT_FUNCTION is defined, the Print macro must be supplied */
/* externally (having the same parameters). */
/* */
/* This is only used by the "ttdebug" component, which should be */
/* linked to the engine only in debug mode. */
 
#if defined( DEBUG_LEVEL_TRACE ) || defined( DEBUG_LEVEL_ERROR )
#ifndef HAVE_PRINT_FUNCTION
#define Print( format, ap ) vfprintf( stderr, (format), (ap) )
#endif
#endif
 
 
/********************************************************************/
/* */
/* I have added the ability to compile the library into a single */
/* object file. This gets rids of all the external symbols defined */
/* in each component interface, and de-pollutes the name-space. */
/* */
/* I use two macros, namely LOCAL_FUNC and LOCAL_DEF, which only */
/* apply to functions that are internal to the engine, and */
/* should never be seen or linked by a client application. */
/* */
/* LOCAL_DEF used in header (.h) files, to define a function */
/* that will be seen by other components. This */
/* translates to "extern" in normal mode, and to */
/* "static" in single-object mode. */
/* */
/* LOCAL_FUNC used in implementation (.c) files, just before */
/* the function body. This translates to nothing */
/* in normal mode, and to "static" in single-object */
/* mode. */
/* */
/* Getting rid of un-necessary symbols makes the "ttcommon" */
/* renaming macros hack unnecessary. Moreover, the stripped */
/* single object file (freetype.o) is 52 Kb, instead of the */
/* previous 57 Kb (size of all combined .o files), and gives */
/* a better idea of the engine's real code size. */
/* */
/* It is called a "MAKE_OPTION" because the macro must be */
/* defined in the Makefile, rather than this one. It allows */
/* any developer to quickly switch from one mode to the other */
/* without messing with "ttconfig.h" each time. */
/* */
#ifndef TT_MAKE_OPTION_SINGLE_OBJECT
#define LOCAL_FUNC /* void */
#define LOCAL_DEF extern
#else
#define LOCAL_FUNC static
#define LOCAL_DEF static
#endif
 
 
/*************************************************************************/
/* Define EXPORT_DEF and EXPORT_FUNC as needed to build e.g. a DLL. All */
/* variables and functions visible from outside have these prefixes. */
 
#ifndef EXPORT_DEF
#define EXPORT_DEF extern
#endif
 
#ifndef EXPORT_FUNC
#define EXPORT_FUNC /* void */
#endif
 
 
 
/* -------------- internal (developer) configuration toggles ------------ */
 
 
#undef TT_STATIC_INTERPRETER
/* Do not undefine this configuration macro. It is now a default that */
/* must be kept in all release builds. */
 
 
#undef TT_STATIC_RASTER
/* Define this if you want to generate a static raster. This makes */
/* a non re-entrant version of the scan-line converter, which is */
/* about 10% faster and 50% bigger than an indirect one! */
 
 
#endif /* TTCONFIG_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttdebug.h
0,0 → 1,170
/*******************************************************************
*
* ttdebug.h
*
* Debugging and Logging component (specification)
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*
* This component contains various macros and functions used to
* ease the debugging of the FreeType engine. Its main purpose
* is in assertion checking, tracing, and error detection.
*
* There are now three debugging modes:
*
* - trace mode:
*
* Error and trace messages are sent to the log file
* (which can be the standard error output). Define
* DEBUG_LEVEL_TRACE to enable this mode.
*
* - error mode:
*
* Only error messages are generated. Define
* DEBUG_LEVEL_ERROR to enable this mode.
*
* - release mode:
*
* Error messages are neither sent nor generated. The code is
* free from any debugging parts.
*
******************************************************************/
 
#ifndef TTDEBUG_H
#define TTDEBUG_H
 
#include "ttconfig.h"
#include "tttypes.h"
 
 
#ifdef __cplusplus
extern "C" {
#endif
 
 
#if defined( DEBUG_LEVEL_TRACE )
 
typedef enum Trace_Component_
{
trace_any = 0,
trace_api,
trace_interp,
trace_load,
trace_gload,
trace_memory,
trace_file,
trace_mutex,
trace_cache,
trace_calc,
trace_cmap,
trace_extend,
trace_objs,
trace_raster,
 
trace_bitmap,
trace_max
 
} Trace_Component;
 
 
/* Here we define an array to hold the trace levels per component. */
/* Since it is globally defined, all array members are set to 0. */
/* You should set the values in this array either in your program */
/* or with your debugger. */
/* */
/* Currently, up to eight levels (PTRACE0-PTRACE7, see below) are */
/* used in some parts of the engine. */
/* */
/* For example, to have all tracing messages in the raster */
/* component, say */
/* */
/* #define DEBUG_LEVEL_TRACE */
/* #include "ttdebug.h" */
/* */
/* ... */
/* set_tt_trace_levels( trace_raster, 7 ) */
/* */
/* in your code before initializing the FreeType engine. */
/* */
/* Maybe it is better to define DEBUG_LEVEL_TRACE in ttconfig.h... */
 
extern char tt_trace_levels[trace_max];
 
/* IMPORTANT: */
/* */
/* Each component must define the macro TT_COMPONENT */
/* to a valid Trace_Component value before using any */
/* PTRACEx macro. */
/* */
 
#define PTRACE( level, varformat ) \
if ( tt_trace_levels[TT_COMPONENT] >= level ) TT_Message##varformat
 
#elif defined( DEBUG_LEVEL_ERROR )
 
#define PTRACE( level, varformat ) /* nothing */
 
#else /* RELEASE MODE */
 
#define TT_Assert( condition, action ) /* nothing */
 
#define PTRACE( level, varformat ) /* nothing */
#define PERROR( varformat ) /* nothing */
#define PANIC( varformat ) /* nothing */
 
#endif
 
 
/************************************************************************/
/* */
/* Define macros and fuctions that are common to the debug and trace */
/* modes. */
/* */
 
#if defined( DEBUG_LEVEL_TRACE ) || defined( DEBUG_LEVEL_ERROR )
 
 
#define TT_Assert( condition, action ) if ( !(condition) ) ( action )
 
void TT_Message( const String* fmt, ... );
void TT_Panic ( const String* fmt, ... );
/* print a message and exit */
 
const String* Cur_U_Line( void* exec );
 
#define PERROR( varformat ) TT_Message##varformat
#define PANIC( varformat ) TT_Panic##varformat
 
#endif
 
#if defined( DEBUG_LEVEL_TRACE )
 
void set_tt_trace_levels( int index, char value );
 
#endif
 
 
#define PTRACE0( varformat ) PTRACE( 0, varformat )
#define PTRACE1( varformat ) PTRACE( 1, varformat )
#define PTRACE2( varformat ) PTRACE( 2, varformat )
#define PTRACE3( varformat ) PTRACE( 3, varformat )
#define PTRACE4( varformat ) PTRACE( 4, varformat )
#define PTRACE5( varformat ) PTRACE( 5, varformat )
#define PTRACE6( varformat ) PTRACE( 6, varformat )
#define PTRACE7( varformat ) PTRACE( 7, varformat )
 
 
#ifdef __cplusplus
}
#endif
 
 
#endif /* TTDEBUG_H */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttengine.h
0,0 → 1,115
/*******************************************************************
*
* ttengine.h 1.1
*
* Engine instance structure definition.
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
* New in 1.1 :
*
* - added the 'raster_lock' mutex field to synchronize
* scan-line conversion in thread-safe and re-entrant builds.
*
******************************************************************/
 
#ifndef TTENGINE_H
#define TTENGINE_H
 
#include "tttypes.h"
#include "ttconfig.h"
#include "freetype.h"
#include "ttmutex.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
/********************************************************************/
/* */
/* The freetype engine instance structure. */
/* */
/* This structure holds all the data that is necessary to run */
/* one instance of the freetype engine. It is needed to get a */
/* completely re-entrant version of the library. */
/* */
/* The goal is to move _all_ component-specific variables, either */
/* static or global in the structure; the component initializers */
/* and finalizers will all be called with the address of a valid */
/* TEngine_Instance. */
/* */
/********************************************************************/
 
struct TEngine_Instance_
{
TMutex lock; /* engine lock */
 
void* list_free_elements;
 
void* objs_face_class; /* the face cache class */
void* objs_instance_class; /* the instance cache class */
void* objs_execution_class; /* the context cache class */
void* objs_glyph_class; /* the glyph cache class */
 
void* objs_face_cache; /* these caches are used to track */
void* objs_exec_cache; /* the current face and execution */
/* context objects */
 
void* file_component; /* ttfile implementation dependent */
 
TMutex raster_lock; /* mutex for this engine's render pool */
void* raster_component; /* ttraster implementation depedent */
Byte raster_palette[5]; /* gray-levels palette for anti-aliasing */
 
void* extension_component; /* extensions dependent */
 
#if 0
TT_Glyph_Loader_Callback glCallback; /* glyph loader callback, if any */
#endif
};
 
/* NOTE : The raster's lock is only acquired by the Render_Glyph and */
/* Render_Gray_Glyph functions, which always release it on exit */
/* They do not lock the engine mutex. This means you shouldn't */
/* be concerned about deadlocks between the two mutexes, as these */
/* should never appear.. */
 
typedef struct TEngine_Instance_ TEngine_Instance;
typedef TEngine_Instance* PEngine_Instance;
 
 
#ifdef TT_CONFIG_OPTION_THREAD_SAFE /* for re-entrant builds */
 
#define ENGINE_ARG TEngine_Instance* _engine
#define ENGINE_ARGS TEngine_Instance* _engine,
 
#define ENGINE_VAR _engine
#define ENGINE_VARS _engine,
 
#define ENGINE _engine
 
#else /* for thread-safe builds */
 
#define ENGINE_ARG /* void */
#define ENGINE_ARGS
 
#define ENGINE_VAR
#define ENGINE_VARS
 
#endif /* TT_CONFIG_OPTION_THREAD_SAFE */
 
#ifdef __cplusplus
}
#endif
 
#endif /* TTENGINE_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttextend.h
0,0 → 1,168
/*******************************************************************
*
* ttextend.h 2.0
*
* Extensions Interface.
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
* This is an updated version of the extension component, now
* located in the main library's source directory. It allows
* the dynamic registration/use of various face object extensions
* through a simple API.
*
******************************************************************/
 
#ifndef TTEXTEND_H
#define TTEXTEND_H
 
#include "ttconfig.h"
#include "tttypes.h"
#include "ttobjs.h"
 
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* The extensions don't need to be integrated at compile time into */
/* the engine, only at link time. */
 
 
/* When a new face object is created, the face constructor calls */
/* the extension constructor with the following arguments: */
/* */
/* ext : typeless pointer to the face's extension block. */
/* Its size is the one given at registration time */
/* in the extension class's 'size' field. */
/* */
/* face : the parent face object. Note that the extension */
/* constructor is called when the face object is */
/* built. */
 
typedef TT_Error TExt_Constructor( void* ext, PFace face );
 
 
/* When a face object is destroyed, the face destructor calls */
/* the extension destructor with the following arguments. */
/* */
/* ext : typeless pointer to the face's extension block. */
/* Its size is the one given at registration time */
/* in the extension class's 'size' field. */
/* */
/* face : the parent face object. Note that the extension */
/* destructor is called before the actual face object */
/* is destroyed. */
 
typedef TT_Error TExt_Destructor ( void* ext, PFace face );
 
typedef TExt_Constructor* PExt_Constructor;
typedef TExt_Destructor* PExt_Destructor;
 
 
struct TExtension_Class_
{
Long id; /* extension id */
Long size; /* size in bytes of extension record */
PExt_Constructor build; /* the extension's class constructor */
PExt_Destructor destroy; /* the extension's class destructor */
 
Long offset; /* offset of ext. record in face obj */
/* (set by the engine) */
};
 
typedef struct TExtension_Class_ TExtension_Class;
typedef TExtension_Class* PExtension_Class;
 
 
#define Build_Extension_ID( a, b, c, d ) \
( ((ULong)(a) << 24) | \
((ULong)(b) << 16) | \
((ULong)(c) << 8 ) | \
(ULong)(d) )
 
/* A note regarding extensions and the single-object compilation */
/* mode : */
/* */
/* When the engine is compiled as a single object file, extensions */
/* must remain linkable *after* compile time. In order to do this, */
/* we need to export the functions that an extension may need. */
/* Fortunately, we can limit ourselves to : */
/* */
/* o TT_Register_Extension (previously called Extension_Register) */
/* which is to be called by each extension on within */
/* it TT_Init_XXXX_Extension initializer. */
/* */
/* o File and frame access functions. Fortunately, these already */
/* have their names prefixed by "TT_", so no change was needed */
/* except replacing the LOCAL_DEF keyword with EXPORT_DEF */
/* */
/* o Memory access functions, i.e. TT_Alloc and TT_Free. Again, */
/* the change is minimal */
/* */
/* o the table-lookup function : TT_LookUp_Table, formerly known */
/* as Load_TrueType_Table in ttload.c. */
/* */
/* */
/* Other than that, an extension should be able to #include all */
/* relevant header files to get access to internal types, but */
/* should not call engine internal functions.. */
/* */
/* If there is a need for a specific internal function call, let */
/* me known to see if we need to export it by default.. */
/* - DavidT */
/* */
 
/* Register a new extension. Called by extension */
/* service initializers. */
EXPORT_DEF
TT_Error TT_Register_Extension( PEngine_Instance engine,
Long id,
Long size,
PExt_Constructor create,
PExt_Destructor destroy );
 
 
#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE
/* Initialize the extension component */
LOCAL_DEF
TT_Error TTExtend_Init( PEngine_Instance engine );
 
/* Finalize the extension component */
LOCAL_DEF
TT_Error TTExtend_Done( PEngine_Instance engine );
 
/* Create an extension within a face object. Called by the */
/* face object constructor. */
LOCAL_DEF
TT_Error Extension_Create( PFace face );
 
/* Destroy all extensions within a face object. Called by the */
/* face object destructor. */
LOCAL_DEF
TT_Error Extension_Destroy( PFace face );
#endif
 
/* Query an extension block by extension_ID. Called by extension */
/* service routines. */
EXPORT_DEF
TT_Error TT_Extension_Get( PFace face,
Long extension_id,
void** extension_block );
 
#ifdef __cplusplus
}
#endif
 
 
#endif /* TTEXTEND_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttfile.h
0,0 → 1,271
/*******************************************************************
*
* ttfile.h 1.3
*
* File I/O Component (specification).
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
* Changes between 1.3 and 1.2:
*
* - all functions report error values now
*
* - the stream semantics have also changed
*
* Changes between 1.2 and 1.1:
*
* - added macros to support re-entrant builds
*
* - added the TT_Duplicate_File function to duplicate streams
* (re-entrant builds only)
*
******************************************************************/
 
#ifndef TTFILE_H
#define TTFILE_H
 
#include "ttconfig.h"
#include "freetype.h"
#include "ttengine.h"
#include "ttdebug.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Initialize file component */
LOCAL_DEF
TT_Error TTFile_Init( PEngine_Instance engine );
 
/* Done with file component */
LOCAL_DEF
TT_Error TTFile_Done( PEngine_Instance engine );
 
 
/**********************************************************************/
/* */
/* Stream functions. */
/* */
/**********************************************************************/
 
/* Open a file and return a stream handle for it. */
/* Should only be used for a new face object's main stream. */
 
LOCAL_DEF
TT_Error TT_Open_Stream( const TT_Text* name,
TT_Stream* stream );
 
 
/* Closes, then discards, a stream when it's no longer needed. */
/* Should only be used for a stream opend with TT_Open_Stream(). */
 
LOCAL_DEF
TT_Error TT_Close_Stream( TT_Stream* stream );
 
 
/* Informs the component that we're going to use the file */
/* opened in 'org_stream', and report errors to the 'error' */
/* variable. */
 
/* in non re-entrant builds, 'org_stream' is simply copied */
/* to 'stream'. Otherwise, the latter is a duplicate handle */
/* for the file opened with 'org_stream' */
 
EXPORT_DEF
TT_Error TT_Use_Stream( TT_Stream org_stream,
TT_Stream* stream );
 
/* Informs the component that we don't need to perform file */
/* operations on the stream 'stream' anymore. This must be */
/* used with streams "opened" with TT_Use_Stream() only! */
 
/* in re-entrant builds, this will really discard the stream */
 
EXPORT_DEF
TT_Error TT_Done_Stream( TT_Stream* stream );
 
/* Closes the stream's file handle to release system resources */
/* The function TT_Use_Stream automatically re-activates a */
/* flushed stream when it uses one */
 
EXPORT_DEF
TT_Error TT_Flush_Stream( TT_Stream* stream );
 
/* The macros STREAM_ARGS and STREAM_ARG let us build a thread-safe */
/* or re-entrant implementation depending on a single configuration */
/*define. */
 
#ifdef TT_CONFIG_OPTION_THREAD_SAFE
 
#define STREAM_ARGS TT_Stream stream,
#define STREAM_ARG TT_Stream stream
 
#else
 
#define STREAM_ARGS /* void */
#define STREAM_ARG void
 
#endif /* TT_CONFIG_OPTION_THREAD_SAFE */
 
 
/****************************************************************/
/* */
/* File Functions. */
/* */
/* The following functions perform file operations on the */
/* currently 'used' stream. In thread-safe builds, only one */
/* stream can be used at a time. Synchronisation is performed */
/* through the Use_Stream()/Done_Stream() functions. */
/* */
/****************************************************************/
 
/* Read 'count' bytes from file into 'buffer' */
 
EXPORT_DEF
TT_Error TT_Read_File( STREAM_ARGS void* buffer,
Long count );
 
 
/* Seek file cursor to a given position */
 
EXPORT_DEF
TT_Error TT_Seek_File( STREAM_ARGS Long position );
 
 
/* Skip the next 'distance' bytes in file */
 
EXPORT_DEF
TT_Error TT_Skip_File( STREAM_ARGS Long distance );
 
 
/* Read the 'count' bytes at 'position' into 'buffer' */
 
EXPORT_DEF
TT_Error TT_Read_At_File( STREAM_ARGS Long position,
void* buffer,
Long count );
 
/* Return current file position */
 
EXPORT_DEF
Long TT_File_Pos( STREAM_ARG );
 
/* Return length of a given stream, even if it is flushed */
 
EXPORT_DEF
Long TT_Stream_Size( TT_Stream stream );
 
 
/********************************************************************/
/* */
/* Frame operations. */
/* */
/* For a comprehensive explanation of frames, please refer to the */
/* documentation files. */
/* */
/********************************************************************/
 
/* Frame type declaration.*/
 
struct TFileFrame_
{
Byte* address; /* frame buffer */
Byte* cursor; /* current cursor position in frame */
Long size; /* frame size */
};
 
typedef struct TFileFrame_ TFileFrame;
 
EXPORT_DEF
const TFileFrame TT_Null_FileFrame;
 
 
/* The macro ZERO_Frame is used to define and init a frame. */
/* It is important to have a default frame of { NULL, NULL, 0 } */
/* before a call to TT_Access_Frame(). Otherwise, the call will */
/* fail with a TT_Err_Nested_Frame_Accesses error. */
 
#define ZERO_Frame( frame ) \
{ \
(frame).address = NULL; \
(frame).cursor = NULL; \
(frame).size = 0; \
}
 
 
/* The macros FRAME_ARGS and FRAME_ARG let us build a thread-safe */
/* or re-entrant implementation depending on a single configuration */
/* define */
 
#ifdef TT_CONFIG_OPTION_THREAD_SAFE
 
#define FRAME_ARGS TFileFrame* frame,
#define FRAME_ARG TFileFrame* frame
 
#else
 
#define FRAME_ARGS /* void */
#define FRAME_ARG void
 
#endif /* TT_CONFIG_OPTION_THREAD_SAFE */
 
 
/* Access the next 'size' bytes from current position. */
/* Fails if all bytes cannot be read/accessed. */
 
EXPORT_DEF
TT_Error TT_Access_Frame( STREAM_ARGS FRAME_ARGS Long size );
 
 
/* Access the bytes located in the next 'size' bytes of the file. */
/* Doesn't fail if less than 'size' bytes are accessible (like */
/* at the end of the file). */
 
EXPORT_DEF
TT_Error TT_Check_And_Access_Frame( STREAM_ARGS FRAME_ARGS Long size );
 
/* Forget frame */
 
EXPORT_DEF
TT_Error TT_Forget_Frame( FRAME_ARG );
 
 
/* primitive routines for data accessing */
 
EXPORT_DEF
Char TT_Get_Char ( FRAME_ARG );
EXPORT_DEF
Short TT_Get_Short( FRAME_ARG );
EXPORT_DEF
Long TT_Get_Long ( FRAME_ARG );
 
#ifdef TT_CONFIG_OPTION_THREAD_SAFE
 
#define TT_Get_Byte( frame ) ( (Byte )TT_Get_Char ( frame ) )
#define TT_Get_UShort( frame ) ( (UShort)TT_Get_Short( frame ) )
#define TT_Get_ULong( frame ) ( (ULong )TT_Get_Long ( frame ) )
 
#else
 
#define TT_Get_Byte() ( (Byte )TT_Get_Char () )
#define TT_Get_UShort() ( (UShort)TT_Get_Short() )
#define TT_Get_ULong() ( (ULong )TT_Get_Long () )
 
#endif /* TT_CONFIG_OPTION_THREAD_SAFE */
 
 
#ifdef __cplusplus
}
#endif
 
#endif /* TTFILE_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttgload.h
0,0 → 1,51
/*******************************************************************
*
* ttgload.h 1.0
*
* TrueType Glyph Loader.
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
******************************************************************/
 
#ifndef TTGLOAD_H
#define TTGLOAD_H
 
#include "ttconfig.h"
#include "tttypes.h"
#include "ttobjs.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
 
LOCAL_DEF
void TT_Get_Metrics( TT_Horizontal_Header* header,
UShort index,
Short* bearing,
UShort* advance );
 
 
LOCAL_DEF
TT_Error Load_TrueType_Glyph( PInstance instance,
PGlyph glyph,
UShort glyph_index,
UShort load_flags );
 
#ifdef __cplusplus
}
#endif
 
 
#endif /* TTGLOAD_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttinterp.h
0,0 → 1,54
/*******************************************************************
*
* ttinterp.h 2.2
*
* TrueType bytecode intepreter.
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*
* Changes between 2.2 and 2.1:
*
* - a small bugfix in the Push opcodes
*
* Changes between 2.1 and 2.0:
*
* - created the TTExec component to take care of all execution
* context management. The interpreter has now one single
* function.
*
* - made some changes to support re-entrancy. The re-entrant
* interpreter is smaller!
*
******************************************************************/
 
#ifndef TTINTERP_H
#define TTINTERP_H
 
#include "ttconfig.h"
#include "ttobjs.h"
 
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Run instructions in current execution context */
 
LOCAL_DEF TT_Error RunIns( PExecution_Context exc );
 
#ifdef __cplusplus
}
#endif
 
#endif /* TTINTERP_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttload.h
0,0 → 1,217
/*******************************************************************
*
* ttload.h 1.1
*
* TrueType Tables Loader.
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*
* Changes between 1.1 and 1.0 :
*
* - add function Load_TrueType_Any used by TT_Get_Font_Data
*
******************************************************************/
 
#ifndef TTLOAD_H
#define TTLOAD_H
 
#include "ttconfig.h"
#include "tttypes.h"
#include "ttobjs.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
EXPORT_DEF
Long TT_LookUp_Table( PFace face, ULong tag );
 
LOCAL_DEF TT_Error Load_TrueType_Directory ( PFace face,
ULong faceIndex );
 
LOCAL_DEF TT_Error Load_TrueType_MaxProfile ( PFace face );
LOCAL_DEF TT_Error Load_TrueType_Gasp ( PFace face );
LOCAL_DEF TT_Error Load_TrueType_Header ( PFace face );
LOCAL_DEF TT_Error Load_TrueType_Locations ( PFace face );
LOCAL_DEF TT_Error Load_TrueType_Names ( PFace face );
LOCAL_DEF TT_Error Load_TrueType_CVT ( PFace face );
LOCAL_DEF TT_Error Load_TrueType_CMap ( PFace face );
LOCAL_DEF TT_Error Load_TrueType_Programs ( PFace face );
LOCAL_DEF TT_Error Load_TrueType_OS2 ( PFace face );
LOCAL_DEF TT_Error Load_TrueType_PostScript ( PFace face );
LOCAL_DEF TT_Error Load_TrueType_Hdmx ( PFace face );
 
LOCAL_DEF TT_Error Load_TrueType_Metrics_Header( PFace face,
Bool vertical );
 
LOCAL_DEF TT_Error Load_TrueType_Any( PFace face,
ULong tag,
Long offset,
void* buffer,
Long* length );
 
LOCAL_DEF TT_Error Free_TrueType_Names( PFace face );
LOCAL_DEF TT_Error Free_TrueType_Hdmx ( PFace face );
 
 
/* The following macros are defined to simplify the writing of */
/* the various table and glyph loaders. */
 
/* For examples see the code in ttload.c, ttgload.c etc. */
 
#define USE_Stream( original, duplicate ) \
( (error = TT_Use_Stream( original, &duplicate )) != TT_Err_Ok )
 
#define DONE_Stream( _stream ) \
TT_Done_Stream( &_stream )
 
/* Define a file frame -- use it only when needed */
#define DEFINE_A_FRAME TFileFrame frame = TT_Null_FileFrame
 
/* Define a stream -- use it only when needed */
#define DEFINE_A_STREAM TT_Stream stream
 
 
#ifdef TT_CONFIG_OPTION_THREAD_SAFE /* re-entrant implementation */
 
/* The following macros define the necessary local */
/* variables used to access streams and frames. */
 
/* Define stream locals with frame */
#define DEFINE_STREAM_LOCALS \
TT_Error error; \
DEFINE_A_STREAM; \
DEFINE_A_FRAME
 
/* Define stream locals without frame */
#define DEFINE_STREAM_LOCALS_WO_FRAME \
TT_Error error; \
DEFINE_A_STREAM
 
/* Define locals with a predefined stream in reentrant mode -- see ttload.c */
#define DEFINE_LOAD_LOCALS( STREAM ) \
TT_Error error; \
DEFINE_A_STREAM = (STREAM); \
DEFINE_A_FRAME
 
/* Define locals without frame with a predefined stream - see ttload.c */
#define DEFINE_LOAD_LOCALS_WO_FRAME( STREAM ) \
TT_Error error; \
DEFINE_A_STREAM = (STREAM)
 
/* Define all locals necessary to access a font file */
#define DEFINE_ALL_LOCALS \
TT_Error error; \
DEFINE_A_STREAM; \
DEFINE_A_FRAME
 
 
#define ACCESS_Frame( _size_ ) \
( (error = TT_Access_Frame( stream, \
&frame, \
(Long)(_size_) )) != TT_Err_Ok )
#define CHECK_ACCESS_Frame( _size_ ) \
( (error = TT_Check_And_Access_Frame( stream, \
&frame, \
(Long)(_size_) )) != TT_Err_Ok )
#define FORGET_Frame() \
( (void)TT_Forget_Frame( &frame ) )
 
#define GET_Byte() TT_Get_Byte ( &frame )
#define GET_Char() TT_Get_Char ( &frame )
#define GET_UShort() TT_Get_UShort( &frame )
#define GET_Short() TT_Get_Short ( &frame )
#define GET_Long() TT_Get_Long ( &frame )
#define GET_ULong() TT_Get_ULong ( &frame )
#define GET_Tag4() TT_Get_ULong ( &frame )
 
#define FILE_Pos() TT_File_Pos ( stream )
 
#define FILE_Seek( _position_ ) \
( (error = TT_Seek_File( stream, \
(Long)(_position_) )) != TT_Err_Ok )
#define FILE_Skip( _distance_ ) \
( (error = TT_Skip_File( stream, \
(Long)(_distance_) )) != TT_Err_Ok )
#define FILE_Read( buffer, count ) \
( (error = TT_Read_File ( stream, \
buffer, \
(Long)(count) )) != TT_Err_Ok )
#define FILE_Read_At( pos, buffer, count ) \
( (error = TT_Read_At_File( stream, \
(Long)(pos), \
buffer, \
(Long)(count) )) != TT_Err_Ok )
 
#else /* thread-safe implementation */
 
/* Define stream locals with frame -- nothing in thread-safe mode */
#define DEFINE_STREAM_LOCALS \
TT_Error error
 
/* Define stream locals without frame -- nothing in thread-safe mode */
#define DEFINE_STREAM_LOCALS_WO_FRAME \
TT_Error error
 
/* Define locals with a predefined stream in reentrant mode -- see ttload.c */
#define DEFINE_LOAD_LOCALS( STREAM ) \
TT_Error error
 
 
/* Define locals without frame with a predefined stream - see ttload.c */
#define DEFINE_LOAD_LOCALS_WO_FRAME( STREAM ) \
TT_Error error
 
/* Define all locals necessary to access a font file */
#define DEFINE_ALL_LOCALS \
TT_Error error; \
DEFINE_A_STREAM
 
 
#define ACCESS_Frame( _size_ ) \
( (error = TT_Access_Frame( (Long)(_size_) )) != TT_Err_Ok )
#define CHECK_ACCESS_Frame( _size_ ) \
( (error = TT_Check_And_Access_Frame( (Long)(_size_) )) != TT_Err_Ok )
#define FORGET_Frame() \
( (void)TT_Forget_Frame() )
 
#define GET_Byte() TT_Get_Byte ()
#define GET_Char() TT_Get_Char ()
#define GET_UShort() TT_Get_UShort()
#define GET_Short() TT_Get_Short ()
#define GET_Long() TT_Get_Long ()
#define GET_ULong() TT_Get_ULong ()
#define GET_Tag4() TT_Get_ULong ()
 
#define FILE_Pos() TT_File_Pos()
 
#define FILE_Seek( _position_ ) \
( (error = TT_Seek_File( (Long)(_position_) )) != TT_Err_Ok )
#define FILE_Skip( _distance_ ) \
( (error = TT_Skip_File( (Long)(_distance_) )) != TT_Err_Ok )
#define FILE_Read( buffer, count ) \
( (error = TT_Read_File ( buffer, \
(Long)(count) )) != TT_Err_Ok )
#define FILE_Read_At( pos, buffer, count ) \
( (error = TT_Read_At_File( (Long)(pos), \
buffer, \
(Long)(count) )) != TT_Err_Ok )
 
#endif /* TT_CONFIG_OPTION_THREAD_SAFE */
 
#ifdef __cplusplus
}
#endif
 
#endif /* TTLOAD_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttmemory.h
0,0 → 1,125
/*******************************************************************
*
* ttmemory.h 1.2
*
* Memory management component (specification).
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
* Changes between 1.2 and 1.1:
*
* - the font pool is gone! All allocations are now performed
* with malloc() and free().
*
* - introduced the FREE() macro and the Free() function for
* future use in destructors.
*
* - Init_FontPool() is now a macro to allow the compilation of
* 'legacy' applications (all four test programs have been updated).
*
******************************************************************/
 
#ifndef TTMEMORY_H
#define TTMEMORY_H
 
#include "ttconfig.h"
#include "tttypes.h"
#include <string.h>
 
 
#ifdef __cplusplus
extern "C" {
#endif
 
#define MEM_Set( dest, byte, count ) memset( dest, byte, count )
 
#ifdef HAVE_MEMCPY
#define MEM_Copy( dest, source, count ) memcpy( dest, source, count )
#else
#define MEM_Copy( dest, source, count ) bcopy( source, dest, count )
#endif
 
#ifdef HAVE_MEMMOVE
#define MEM_Move( dest, source, count ) memmove( dest, source, count )
#else
#define MEM_Move( dest, source, count ) bcopy( source, dest, count )
#endif
 
 
#define MEM_Alloc( _pointer_, _size_ ) \
TT_Alloc( _size_, (void**)&(_pointer_) )
 
#define MEM_Realloc( _pointer_, _size_ ) \
TT_Realloc( _size_, (void**)&(_pointer_) )
 
#define ALLOC( _pointer_, _size_ ) \
( ( error = MEM_Alloc( _pointer_, _size_ ) ) != TT_Err_Ok )
 
#define ALLOC_ARRAY( _pointer_, _count_, _type_ ) \
( ( error = MEM_Alloc( _pointer_, \
(_count_) * sizeof ( _type_ ) ) ) != TT_Err_Ok )
 
#define REALLOC( _pointer_, _size_ ) \
( ( error = MEM_Realloc( _pointer_, _size_ ) ) != TT_Err_Ok )
 
#define REALLOC_ARRAY( _pointer_, _count_, _type_ ) \
( (error = MEM_Realloc( _pointer_, \
(_count_) * sizeof ( _type_ ) ) ) != TT_Err_Ok )
 
#define FREE( _pointer_ ) \
TT_Free( (void**)&(_pointer_) )
 
 
/* Allocate a block of memory of 'Size' bytes from the heap, and */
/* sets the pointer '*P' to its address. If 'Size' is 0, or in */
/* case of error, the pointer is always set to NULL. */
 
EXPORT_DEF
TT_Error TT_Alloc( ULong Size, void** P );
 
#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE
 
/* Reallocates a block of memory pointed to by '*P' to 'Size' */
/* bytes from the heap, possibly changing '*P'. If 'Size' is 0, */
/* TT_Free() is called, if '*P' is NULL, TT_Alloc() is called. */
/* '*P' is freed (if it's non-NULL) in case of error. */
 
EXPORT_DEF
TT_Error TT_Realloc( ULong Size, void** P );
 
#endif /* TT_CONFIG_OPTION_EXTEND_ENGINE */
 
/* Releases a block that was previously allocated through Alloc. */
/* Note that the function returns successfully when P or *P are */
/* already NULL. The pointer '*P' is set to NULL on exit in */
/* case of success. */
 
EXPORT_DEF
TT_Error TT_Free( void** P );
 
 
/* For "legacy" applications, that should be re-coded. */
/* Note that this won't release the previously allocated font pool. */
 
#define Init_FontPool( x, y ) while( 0 ) { }
 
 
LOCAL_DEF TT_Error TTMemory_Init( void );
LOCAL_DEF TT_Error TTMemory_Done( void );
 
 
#ifdef __cplusplus
}
#endif
 
#endif /* TTMEMORY_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttmutex.h
0,0 → 1,59
/*******************************************************************
*
* ttmutex.h 1.0
*
* Mutual exclusion object / dummy generic interface.
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
* Note: This file provides a generic interface. The implementation
* to compile depends on your system and the type of
* library you want to build (either singly-threaded,
* thread-safe or re-entrant).
*
* Please read the technical documentation for more details.
*
******************************************************************/
 
#ifndef TTMUTEX_H
#define TTMUTEX_H
 
#include "ttconfig.h"
 
 
typedef void* TMutex; /* typeless reference to a mutex */
 
#ifdef TT_CONFIG_OPTION_THREAD_SAFE /* thread-safe and re-entrant builds */
 
#define MUTEX_Create( mutex ) TT_Mutex_Create ( &(mutex) )
#define MUTEX_Destroy( mutex ) TT_Mutex_Delete ( &(mutex) )
#define MUTEX_Lock( mutex ) TT_Mutex_Lock ( &(mutex) )
#define MUTEX_Release( mutex ) TT_Mutex_Release( &(mutex) )
 
LOCAL_DEF void TT_Mutex_Create ( TMutex* mutex ); /* Create a new mutex */
LOCAL_DEF void TT_Mutex_Delete ( TMutex* mutex ); /* Delete a mutex */
LOCAL_DEF void TT_Mutex_Lock ( TMutex* mutex ); /* Lock a mutex. */
LOCAL_DEF void TT_Mutex_Release( TMutex* mutex ); /* Release a mutex */
 
#else /* for the single-thread build */
 
#define MUTEX_Create( mutex ) /* nothing */
#define MUTEX_Destroy( mutex ) /* nothing */
#define MUTEX_Lock( mutex ) /* nothing */
#define MUTEX_Release( mutex ) /* nothing */
 
/* No code will be generated for mutex operations */
 
#endif /* TT_CONFIG_OPTION_THREAD_SAFE */
 
#endif /* TTMUTEX_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttnameid.h
0,0 → 1,1247
/***************************************************************************/
/* */
/* ttnameid.h */
/* */
/* TrueType name ID definitions (specification only). */
/* */
/* Copyright 1996-2002, 2003, 2004, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __TTNAMEID_H__
#define __TTNAMEID_H__
 
 
#include <ft2build.h>
 
 
FT_BEGIN_HEADER
 
 
/*************************************************************************/
/* */
/* <Section> */
/* truetype_tables */
/* */
 
 
/*************************************************************************/
/* */
/* Possible values for the `platform' identifier code in the name */
/* records of the TTF `name' table. */
/* */
/*************************************************************************/
 
 
/***********************************************************************
*
* @enum:
* TT_PLATFORM_XXX
*
* @description:
* A list of valid values for the `platform_id' identifier code in
* @FT_CharMapRec and @FT_SfntName structures.
*
* @values:
* TT_PLATFORM_APPLE_UNICODE ::
* Used by Apple to indicate a Unicode character map and/or name entry.
* See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note
* that name entries in this format are coded as big-endian UCS-2
* character codes _only_.
*
* TT_PLATFORM_MACINTOSH ::
* Used by Apple to indicate a MacOS-specific charmap and/or name entry.
* See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that
* most TrueType fonts contain an Apple roman charmap to be usable on
* MacOS systems (even if they contain a Microsoft charmap as well).
*
* TT_PLATFORM_ISO ::
* This value was used to specify ISO/IEC 10646 charmaps. It is however
* now deprecated. See @TT_ISO_ID_XXX for a list of corresponding
* `encoding_id' values.
*
* TT_PLATFORM_MICROSOFT ::
* Used by Microsoft to indicate Windows-specific charmaps. See
* @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.
* Note that most fonts contain a Unicode charmap using
* (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).
*
* TT_PLATFORM_CUSTOM ::
* Used to indicate application-specific charmaps.
*
* TT_PLATFORM_ADOBE ::
* This value isn't part of any font format specification, but is used
* by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec
* structure. See @TT_ADOBE_ID_XXX.
*/
 
#define TT_PLATFORM_APPLE_UNICODE 0
#define TT_PLATFORM_MACINTOSH 1
#define TT_PLATFORM_ISO 2 /* deprecated */
#define TT_PLATFORM_MICROSOFT 3
#define TT_PLATFORM_CUSTOM 4
#define TT_PLATFORM_ADOBE 7 /* artificial */
 
 
/***********************************************************************
*
* @enum:
* TT_APPLE_ID_XXX
*
* @description:
* A list of valid values for the `encoding_id' for
* @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.
*
* @values:
* TT_APPLE_ID_DEFAULT ::
* Unicode version 1.0.
*
* TT_APPLE_ID_UNICODE_1_1 ::
* Unicode 1.1; specifies Hangul characters starting at U+34xx.
*
* TT_APPLE_ID_ISO_10646 ::
* Deprecated (identical to preceding).
*
* TT_APPLE_ID_UNICODE_2_0 ::
* Unicode 2.0 and beyond (UTF-16 BMP only).
*
* TT_APPLE_ID_UNICODE_32 ::
* Unicode 3.1 and beyond, using UTF-32.
*
* TT_APPLE_ID_VARIANT_SELECTOR ::
* From Adobe, not Apple. Not a normal cmap. Specifies variations
* on a real cmap.
*/
 
#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */
#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */
#define TT_APPLE_ID_ISO_10646 2 /* deprecated */
#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */
#define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */
#define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */
 
 
/***********************************************************************
*
* @enum:
* TT_MAC_ID_XXX
*
* @description:
* A list of valid values for the `encoding_id' for
* @TT_PLATFORM_MACINTOSH charmaps and name entries.
*
* @values:
* TT_MAC_ID_ROMAN ::
* TT_MAC_ID_JAPANESE ::
* TT_MAC_ID_TRADITIONAL_CHINESE ::
* TT_MAC_ID_KOREAN ::
* TT_MAC_ID_ARABIC ::
* TT_MAC_ID_HEBREW ::
* TT_MAC_ID_GREEK ::
* TT_MAC_ID_RUSSIAN ::
* TT_MAC_ID_RSYMBOL ::
* TT_MAC_ID_DEVANAGARI ::
* TT_MAC_ID_GURMUKHI ::
* TT_MAC_ID_GUJARATI ::
* TT_MAC_ID_ORIYA ::
* TT_MAC_ID_BENGALI ::
* TT_MAC_ID_TAMIL ::
* TT_MAC_ID_TELUGU ::
* TT_MAC_ID_KANNADA ::
* TT_MAC_ID_MALAYALAM ::
* TT_MAC_ID_SINHALESE ::
* TT_MAC_ID_BURMESE ::
* TT_MAC_ID_KHMER ::
* TT_MAC_ID_THAI ::
* TT_MAC_ID_LAOTIAN ::
* TT_MAC_ID_GEORGIAN ::
* TT_MAC_ID_ARMENIAN ::
* TT_MAC_ID_MALDIVIAN ::
* TT_MAC_ID_SIMPLIFIED_CHINESE ::
* TT_MAC_ID_TIBETAN ::
* TT_MAC_ID_MONGOLIAN ::
* TT_MAC_ID_GEEZ ::
* TT_MAC_ID_SLAVIC ::
* TT_MAC_ID_VIETNAMESE ::
* TT_MAC_ID_SINDHI ::
* TT_MAC_ID_UNINTERP ::
*/
 
#define TT_MAC_ID_ROMAN 0
#define TT_MAC_ID_JAPANESE 1
#define TT_MAC_ID_TRADITIONAL_CHINESE 2
#define TT_MAC_ID_KOREAN 3
#define TT_MAC_ID_ARABIC 4
#define TT_MAC_ID_HEBREW 5
#define TT_MAC_ID_GREEK 6
#define TT_MAC_ID_RUSSIAN 7
#define TT_MAC_ID_RSYMBOL 8
#define TT_MAC_ID_DEVANAGARI 9
#define TT_MAC_ID_GURMUKHI 10
#define TT_MAC_ID_GUJARATI 11
#define TT_MAC_ID_ORIYA 12
#define TT_MAC_ID_BENGALI 13
#define TT_MAC_ID_TAMIL 14
#define TT_MAC_ID_TELUGU 15
#define TT_MAC_ID_KANNADA 16
#define TT_MAC_ID_MALAYALAM 17
#define TT_MAC_ID_SINHALESE 18
#define TT_MAC_ID_BURMESE 19
#define TT_MAC_ID_KHMER 20
#define TT_MAC_ID_THAI 21
#define TT_MAC_ID_LAOTIAN 22
#define TT_MAC_ID_GEORGIAN 23
#define TT_MAC_ID_ARMENIAN 24
#define TT_MAC_ID_MALDIVIAN 25
#define TT_MAC_ID_SIMPLIFIED_CHINESE 25
#define TT_MAC_ID_TIBETAN 26
#define TT_MAC_ID_MONGOLIAN 27
#define TT_MAC_ID_GEEZ 28
#define TT_MAC_ID_SLAVIC 29
#define TT_MAC_ID_VIETNAMESE 30
#define TT_MAC_ID_SINDHI 31
#define TT_MAC_ID_UNINTERP 32
 
 
/***********************************************************************
*
* @enum:
* TT_ISO_ID_XXX
*
* @description:
* A list of valid values for the `encoding_id' for
* @TT_PLATFORM_ISO charmaps and name entries.
*
* Their use is now deprecated.
*
* @values:
* TT_ISO_ID_7BIT_ASCII ::
* ASCII.
* TT_ISO_ID_10646 ::
* ISO/10646.
* TT_ISO_ID_8859_1 ::
* Also known as Latin-1.
*/
 
#define TT_ISO_ID_7BIT_ASCII 0
#define TT_ISO_ID_10646 1
#define TT_ISO_ID_8859_1 2
 
 
/***********************************************************************
*
* @enum:
* TT_MS_ID_XXX
*
* @description:
* A list of valid values for the `encoding_id' for
* @TT_PLATFORM_MICROSOFT charmaps and name entries.
*
* @values:
* TT_MS_ID_SYMBOL_CS ::
* Corresponds to Microsoft symbol encoding. See
* @FT_ENCODING_MS_SYMBOL.
*
* TT_MS_ID_UNICODE_CS ::
* Corresponds to a Microsoft WGL4 charmap, matching Unicode. See
* @FT_ENCODING_UNICODE.
*
* TT_MS_ID_SJIS ::
* Corresponds to SJIS Japanese encoding. See @FT_ENCODING_SJIS.
*
* TT_MS_ID_GB2312 ::
* Corresponds to Simplified Chinese as used in Mainland China. See
* @FT_ENCODING_GB2312.
*
* TT_MS_ID_BIG_5 ::
* Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.
* See @FT_ENCODING_BIG5.
*
* TT_MS_ID_WANSUNG ::
* Corresponds to Korean Wansung encoding. See @FT_ENCODING_WANSUNG.
*
* TT_MS_ID_JOHAB ::
* Corresponds to Johab encoding. See @FT_ENCODING_JOHAB.
*
* TT_MS_ID_UCS_4 ::
* Corresponds to UCS-4 or UTF-32 charmaps. This has been added to
* the OpenType specification version 1.4 (mid-2001.)
*/
 
#define TT_MS_ID_SYMBOL_CS 0
#define TT_MS_ID_UNICODE_CS 1
#define TT_MS_ID_SJIS 2
#define TT_MS_ID_GB2312 3
#define TT_MS_ID_BIG_5 4
#define TT_MS_ID_WANSUNG 5
#define TT_MS_ID_JOHAB 6
#define TT_MS_ID_UCS_4 10
 
 
/***********************************************************************
*
* @enum:
* TT_ADOBE_ID_XXX
*
* @description:
* A list of valid values for the `encoding_id' for
* @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension!
*
* @values:
* TT_ADOBE_ID_STANDARD ::
* Adobe standard encoding.
* TT_ADOBE_ID_EXPERT ::
* Adobe expert encoding.
* TT_ADOBE_ID_CUSTOM ::
* Adobe custom encoding.
* TT_ADOBE_ID_LATIN_1 ::
* Adobe Latin~1 encoding.
*/
 
#define TT_ADOBE_ID_STANDARD 0
#define TT_ADOBE_ID_EXPERT 1
#define TT_ADOBE_ID_CUSTOM 2
#define TT_ADOBE_ID_LATIN_1 3
 
 
/*************************************************************************/
/* */
/* Possible values of the language identifier field in the name records */
/* of the TTF `name' table if the `platform' identifier code is */
/* TT_PLATFORM_MACINTOSH. */
/* */
/* The canonical source for the Apple assigned Language ID's is at */
/* */
/* http://fonts.apple.com/TTRefMan/RM06/Chap6name.html */
/* */
#define TT_MAC_LANGID_ENGLISH 0
#define TT_MAC_LANGID_FRENCH 1
#define TT_MAC_LANGID_GERMAN 2
#define TT_MAC_LANGID_ITALIAN 3
#define TT_MAC_LANGID_DUTCH 4
#define TT_MAC_LANGID_SWEDISH 5
#define TT_MAC_LANGID_SPANISH 6
#define TT_MAC_LANGID_DANISH 7
#define TT_MAC_LANGID_PORTUGUESE 8
#define TT_MAC_LANGID_NORWEGIAN 9
#define TT_MAC_LANGID_HEBREW 10
#define TT_MAC_LANGID_JAPANESE 11
#define TT_MAC_LANGID_ARABIC 12
#define TT_MAC_LANGID_FINNISH 13
#define TT_MAC_LANGID_GREEK 14
#define TT_MAC_LANGID_ICELANDIC 15
#define TT_MAC_LANGID_MALTESE 16
#define TT_MAC_LANGID_TURKISH 17
#define TT_MAC_LANGID_CROATIAN 18
#define TT_MAC_LANGID_CHINESE_TRADITIONAL 19
#define TT_MAC_LANGID_URDU 20
#define TT_MAC_LANGID_HINDI 21
#define TT_MAC_LANGID_THAI 22
#define TT_MAC_LANGID_KOREAN 23
#define TT_MAC_LANGID_LITHUANIAN 24
#define TT_MAC_LANGID_POLISH 25
#define TT_MAC_LANGID_HUNGARIAN 26
#define TT_MAC_LANGID_ESTONIAN 27
#define TT_MAC_LANGID_LETTISH 28
#define TT_MAC_LANGID_SAAMISK 29
#define TT_MAC_LANGID_FAEROESE 30
#define TT_MAC_LANGID_FARSI 31
#define TT_MAC_LANGID_RUSSIAN 32
#define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33
#define TT_MAC_LANGID_FLEMISH 34
#define TT_MAC_LANGID_IRISH 35
#define TT_MAC_LANGID_ALBANIAN 36
#define TT_MAC_LANGID_ROMANIAN 37
#define TT_MAC_LANGID_CZECH 38
#define TT_MAC_LANGID_SLOVAK 39
#define TT_MAC_LANGID_SLOVENIAN 40
#define TT_MAC_LANGID_YIDDISH 41
#define TT_MAC_LANGID_SERBIAN 42
#define TT_MAC_LANGID_MACEDONIAN 43
#define TT_MAC_LANGID_BULGARIAN 44
#define TT_MAC_LANGID_UKRAINIAN 45
#define TT_MAC_LANGID_BYELORUSSIAN 46
#define TT_MAC_LANGID_UZBEK 47
#define TT_MAC_LANGID_KAZAKH 48
#define TT_MAC_LANGID_AZERBAIJANI 49
#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49
#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50
#define TT_MAC_LANGID_ARMENIAN 51
#define TT_MAC_LANGID_GEORGIAN 52
#define TT_MAC_LANGID_MOLDAVIAN 53
#define TT_MAC_LANGID_KIRGHIZ 54
#define TT_MAC_LANGID_TAJIKI 55
#define TT_MAC_LANGID_TURKMEN 56
#define TT_MAC_LANGID_MONGOLIAN 57
#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57
#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58
#define TT_MAC_LANGID_PASHTO 59
#define TT_MAC_LANGID_KURDISH 60
#define TT_MAC_LANGID_KASHMIRI 61
#define TT_MAC_LANGID_SINDHI 62
#define TT_MAC_LANGID_TIBETAN 63
#define TT_MAC_LANGID_NEPALI 64
#define TT_MAC_LANGID_SANSKRIT 65
#define TT_MAC_LANGID_MARATHI 66
#define TT_MAC_LANGID_BENGALI 67
#define TT_MAC_LANGID_ASSAMESE 68
#define TT_MAC_LANGID_GUJARATI 69
#define TT_MAC_LANGID_PUNJABI 70
#define TT_MAC_LANGID_ORIYA 71
#define TT_MAC_LANGID_MALAYALAM 72
#define TT_MAC_LANGID_KANNADA 73
#define TT_MAC_LANGID_TAMIL 74
#define TT_MAC_LANGID_TELUGU 75
#define TT_MAC_LANGID_SINHALESE 76
#define TT_MAC_LANGID_BURMESE 77
#define TT_MAC_LANGID_KHMER 78
#define TT_MAC_LANGID_LAO 79
#define TT_MAC_LANGID_VIETNAMESE 80
#define TT_MAC_LANGID_INDONESIAN 81
#define TT_MAC_LANGID_TAGALOG 82
#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83
#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84
#define TT_MAC_LANGID_AMHARIC 85
#define TT_MAC_LANGID_TIGRINYA 86
#define TT_MAC_LANGID_GALLA 87
#define TT_MAC_LANGID_SOMALI 88
#define TT_MAC_LANGID_SWAHILI 89
#define TT_MAC_LANGID_RUANDA 90
#define TT_MAC_LANGID_RUNDI 91
#define TT_MAC_LANGID_CHEWA 92
#define TT_MAC_LANGID_MALAGASY 93
#define TT_MAC_LANGID_ESPERANTO 94
#define TT_MAC_LANGID_WELSH 128
#define TT_MAC_LANGID_BASQUE 129
#define TT_MAC_LANGID_CATALAN 130
#define TT_MAC_LANGID_LATIN 131
#define TT_MAC_LANGID_QUECHUA 132
#define TT_MAC_LANGID_GUARANI 133
#define TT_MAC_LANGID_AYMARA 134
#define TT_MAC_LANGID_TATAR 135
#define TT_MAC_LANGID_UIGHUR 136
#define TT_MAC_LANGID_DZONGKHA 137
#define TT_MAC_LANGID_JAVANESE 138
#define TT_MAC_LANGID_SUNDANESE 139
 
 
#if 0 /* these seem to be errors that have been dropped */
 
#define TT_MAC_LANGID_SCOTTISH_GAELIC 140
#define TT_MAC_LANGID_IRISH_GAELIC 141
 
#endif
 
 
/* The following codes are new as of 2000-03-10 */
#define TT_MAC_LANGID_GALICIAN 140
#define TT_MAC_LANGID_AFRIKAANS 141
#define TT_MAC_LANGID_BRETON 142
#define TT_MAC_LANGID_INUKTITUT 143
#define TT_MAC_LANGID_SCOTTISH_GAELIC 144
#define TT_MAC_LANGID_MANX_GAELIC 145
#define TT_MAC_LANGID_IRISH_GAELIC 146
#define TT_MAC_LANGID_TONGAN 147
#define TT_MAC_LANGID_GREEK_POLYTONIC 148
#define TT_MAC_LANGID_GREELANDIC 149
#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150
 
 
/*************************************************************************/
/* */
/* Possible values of the language identifier field in the name records */
/* of the TTF `name' table if the `platform' identifier code is */
/* TT_PLATFORM_MICROSOFT. */
/* */
/* The canonical source for the MS assigned LCID's (seems to) be at */
/* */
/* http://www.microsoft.com/globaldev/reference/lcid-all.mspx */
/* */
/* It used to be at various places, among them */
/* */
/* http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt */
/* http://www.microsoft.com/globaldev/reference/loclanghome.asp */
/* http://support.microsoft.com/support/kb/articles/Q224/8/04.ASP */
/* http://msdn.microsoft.com/library/en-us/passport25/ */
/* NET_Passport_VBScript_Documentation/Single_Sign_In/ */
/* Advanced_Single_Sign_In/Localization_and_LCIDs.asp */
/* */
/* Hopefully, it seems now that the Globaldev site prevails... */
/* (updated by Antoine, 2004-02-17) */
 
#define TT_MS_LANGID_ARABIC_GENERAL 0x0001
#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401
#define TT_MS_LANGID_ARABIC_IRAQ 0x0801
#define TT_MS_LANGID_ARABIC_EGYPT 0x0c01
#define TT_MS_LANGID_ARABIC_LIBYA 0x1001
#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401
#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801
#define TT_MS_LANGID_ARABIC_TUNISIA 0x1c01
#define TT_MS_LANGID_ARABIC_OMAN 0x2001
#define TT_MS_LANGID_ARABIC_YEMEN 0x2401
#define TT_MS_LANGID_ARABIC_SYRIA 0x2801
#define TT_MS_LANGID_ARABIC_JORDAN 0x2c01
#define TT_MS_LANGID_ARABIC_LEBANON 0x3001
#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401
#define TT_MS_LANGID_ARABIC_UAE 0x3801
#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3c01
#define TT_MS_LANGID_ARABIC_QATAR 0x4001
#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402
#define TT_MS_LANGID_CATALAN_SPAIN 0x0403
#define TT_MS_LANGID_CHINESE_GENERAL 0x0004
#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404
#define TT_MS_LANGID_CHINESE_PRC 0x0804
#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04
#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004
 
#if 1 /* this looks like the correct value */
#define TT_MS_LANGID_CHINESE_MACAU 0x1404
#else /* but beware, Microsoft may change its mind...
the most recent Word reference has the following: */
#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG
#endif
 
#if 0 /* used only with .NET `cultures'; commented out */
#define TT_MS_LANGID_CHINESE_TRADITIONAL 0x7C04
#endif
 
#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405
#define TT_MS_LANGID_DANISH_DENMARK 0x0406
#define TT_MS_LANGID_GERMAN_GERMANY 0x0407
#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807
#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0c07
#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007
#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407
#define TT_MS_LANGID_GREEK_GREECE 0x0408
 
/* don't ask what this one means... It is commented out currently. */
#if 0
#define TT_MS_LANGID_GREEK_GREECE2 0x2008
#endif
 
#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009
#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809
#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0c09
#define TT_MS_LANGID_ENGLISH_CANADA 0x1009
#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409
#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809
#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1c09
#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009
#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409
#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809
#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2c09
#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009
#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409
#define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809
#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3c09
#define TT_MS_LANGID_ENGLISH_INDIA 0x4009
#define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409
#define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809
#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040a
#define TT_MS_LANGID_SPANISH_MEXICO 0x080a
#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0c0a
#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100a
#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140a
#define TT_MS_LANGID_SPANISH_PANAMA 0x180a
#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1c0a
#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200a
#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240a
#define TT_MS_LANGID_SPANISH_PERU 0x280a
#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2c0a
#define TT_MS_LANGID_SPANISH_ECUADOR 0x300a
#define TT_MS_LANGID_SPANISH_CHILE 0x340a
#define TT_MS_LANGID_SPANISH_URUGUAY 0x380a
#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3c0a
#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400a
#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440a
#define TT_MS_LANGID_SPANISH_HONDURAS 0x480a
#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a
#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a
#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540a
/* The following ID blatantly violate MS specs by using a */
/* sublanguage > 0x1F. */
#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40aU
#define TT_MS_LANGID_FINNISH_FINLAND 0x040b
#define TT_MS_LANGID_FRENCH_FRANCE 0x040c
#define TT_MS_LANGID_FRENCH_BELGIUM 0x080c
#define TT_MS_LANGID_FRENCH_CANADA 0x0c0c
#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100c
#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140c
#define TT_MS_LANGID_FRENCH_MONACO 0x180c
#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1c0c
#define TT_MS_LANGID_FRENCH_REUNION 0x200c
#define TT_MS_LANGID_FRENCH_CONGO 0x240c
/* which was formerly: */
#define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO
#define TT_MS_LANGID_FRENCH_SENEGAL 0x280c
#define TT_MS_LANGID_FRENCH_CAMEROON 0x2c0c
#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300c
#define TT_MS_LANGID_FRENCH_MALI 0x340c
#define TT_MS_LANGID_FRENCH_MOROCCO 0x380c
#define TT_MS_LANGID_FRENCH_HAITI 0x3c0c
/* and another violation of the spec (see 0xE40aU) */
#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40cU
#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d
#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e
#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040f
#define TT_MS_LANGID_ITALIAN_ITALY 0x0410
#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810
#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411
#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412
#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812
#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413
#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813
#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414
#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814
#define TT_MS_LANGID_POLISH_POLAND 0x0415
#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416
#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816
#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417
#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418
#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419
#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819
#define TT_MS_LANGID_CROATIAN_CROATIA 0x041a
#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081a
#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0c1a
 
#if 0 /* this used to be this value, but it looks like we were wrong */
#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101a
#else /* current sources say */
#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101a
#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141a
/* and XPsp2 Platform SDK added (2004-07-26) */
/* Names are shortened to be significant within 40 chars. */
#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181a
#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181a
#endif
 
#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041b
#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041c
#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041d
#define TT_MS_LANGID_SWEDISH_FINLAND 0x081d
#define TT_MS_LANGID_THAI_THAILAND 0x041e
#define TT_MS_LANGID_TURKISH_TURKEY 0x041f
#define TT_MS_LANGID_URDU_PAKISTAN 0x0420
#define TT_MS_LANGID_URDU_INDIA 0x0820
#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421
#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422
#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423
#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424
#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425
#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426
#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427
#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
#define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428
#define TT_MS_LANGID_FARSI_IRAN 0x0429
#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a
#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b
#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042c
#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082c
#define TT_MS_LANGID_BASQUE_SPAIN 0x042d
#define TT_MS_LANGID_SORBIAN_GERMANY 0x042e
#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042f
#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430
#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431
#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432
#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433
#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434
#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435
#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436
#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437
#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438
#define TT_MS_LANGID_HINDI_INDIA 0x0439
#define TT_MS_LANGID_MALTESE_MALTA 0x043a
/* Added by XPsp2 Platform SDK (2004-07-26) */
#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043b
#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083b
#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3b
#define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103b
#define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143b
#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183b
#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3b
#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203b
#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243b
/* ... and we also keep our old identifier... */
#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b
 
#if 0 /* this seems to be a previous inversion */
#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c
#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c
#else
#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c
#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c
#endif
 
#define TT_MS_LANGID_YIDDISH_GERMANY 0x043d
#define TT_MS_LANGID_MALAY_MALAYSIA 0x043e
#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e
#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f
#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440
/* alias declared in Windows 2000 */
#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN
 
#define TT_MS_LANGID_SWAHILI_KENYA 0x0441
#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843
#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444
#define TT_MS_LANGID_BENGALI_INDIA 0x0445
#define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845
#define TT_MS_LANGID_PUNJABI_INDIA 0x0446
#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN 0x0846
#define TT_MS_LANGID_GUJARATI_INDIA 0x0447
#define TT_MS_LANGID_ORIYA_INDIA 0x0448
#define TT_MS_LANGID_TAMIL_INDIA 0x0449
#define TT_MS_LANGID_TELUGU_INDIA 0x044a
#define TT_MS_LANGID_KANNADA_INDIA 0x044b
#define TT_MS_LANGID_MALAYALAM_INDIA 0x044c
#define TT_MS_LANGID_ASSAMESE_INDIA 0x044d
#define TT_MS_LANGID_MARATHI_INDIA 0x044e
#define TT_MS_LANGID_SANSKRIT_INDIA 0x044f
#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450
#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN 0x0850
#define TT_MS_LANGID_TIBETAN_CHINA 0x0451
/* Don't use the next constant! It has */
/* (1) the wrong spelling (Dzonghka) */
/* (2) Microsoft doesn't officially define it -- */
/* at least it is not in the List of Local */
/* ID Values. */
/* (3) Dzongkha is not the same language as */
/* Tibetan, so merging it is wrong anyway. */
/* */
/* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW. */
#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851
 
#if 0
/* the following used to be defined */
#define TT_MS_LANGID_TIBETAN_BHUTAN 0x0451
/* ... but it was changed; */
#else
/* So we will continue to #define it, but with the correct value */
#define TT_MS_LANGID_TIBETAN_BHUTAN TT_MS_LANGID_DZONGHKA_BHUTAN
#endif
 
#define TT_MS_LANGID_WELSH_WALES 0x0452
#define TT_MS_LANGID_KHMER_CAMBODIA 0x0453
#define TT_MS_LANGID_LAO_LAOS 0x0454
#define TT_MS_LANGID_BURMESE_MYANMAR 0x0455
#define TT_MS_LANGID_GALICIAN_SPAIN 0x0456
#define TT_MS_LANGID_KONKANI_INDIA 0x0457
#define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458
#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459
#define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859
/* Missing a LCID for Sindhi in Devanagari script */
#define TT_MS_LANGID_SYRIAC_SYRIA 0x045a
#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045b
#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045c
#define TT_MS_LANGID_INUKTITUT_CANADA 0x045d
#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045e
#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045f
#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085f
/* Missing a LCID for Tifinagh script */
#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460
/* Spelled this way by XPsp2 Platform SDK (2004-07-26) */
/* script is yet unclear... might be Arabic, Nagari or Sharada */
#define TT_MS_LANGID_KASHMIRI_SASIA 0x0860
/* ... and aliased (by MS) for compatibility reasons. */
#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA
#define TT_MS_LANGID_NEPALI_NEPAL 0x0461
#define TT_MS_LANGID_NEPALI_INDIA 0x0861
#define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462
#define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463
#define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464
#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465
/* alias declared in Windows 2000 */
#define TT_MS_LANGID_DIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES
#define TT_MS_LANGID_EDO_NIGERIA 0x0466
#define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467
#define TT_MS_LANGID_HAUSA_NIGERIA 0x0468
#define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469
#define TT_MS_LANGID_YORUBA_NIGERIA 0x046a
#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046b
#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086b
#define TT_MS_LANGID_QUECHUA_PERU 0x0c6b
#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046c
/* Also spelled by XPsp2 Platform SDK (2004-07-26) */
#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \
TT_MS_LANGID_SEPEDI_SOUTH_AFRICA
/* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */
#define TT_MS_LANGID_IGBO_NIGERIA 0x0470
#define TT_MS_LANGID_KANURI_NIGERIA 0x0471
#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472
#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473
#define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873
/* also spelled in the `Passport SDK' list as: */
#define TT_MS_LANGID_TIGRIGNA_ERYTREA TT_MS_LANGID_TIGRIGNA_ERYTHREA
#define TT_MS_LANGID_GUARANI_PARAGUAY 0x0474
#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475
#define TT_MS_LANGID_LATIN 0x0476
#define TT_MS_LANGID_SOMALI_SOMALIA 0x0477
/* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */
/* not written (but OTOH the peculiar writing system is worth */
/* studying). */
#define TT_MS_LANGID_YI_CHINA 0x0478
#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479
/* language codes from 0x047a to 0x047f are (still) unknown. */
#define TT_MS_LANGID_UIGHUR_CHINA 0x0480
#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481
 
#if 0 /* not deemed useful for fonts */
#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04ff
#endif
 
 
/*************************************************************************/
/* */
/* Possible values of the `name' identifier field in the name records of */
/* the TTF `name' table. These values are platform independent. */
/* */
#define TT_NAME_ID_COPYRIGHT 0
#define TT_NAME_ID_FONT_FAMILY 1
#define TT_NAME_ID_FONT_SUBFAMILY 2
#define TT_NAME_ID_UNIQUE_ID 3
#define TT_NAME_ID_FULL_NAME 4
#define TT_NAME_ID_VERSION_STRING 5
#define TT_NAME_ID_PS_NAME 6
#define TT_NAME_ID_TRADEMARK 7
 
/* the following values are from the OpenType spec */
#define TT_NAME_ID_MANUFACTURER 8
#define TT_NAME_ID_DESIGNER 9
#define TT_NAME_ID_DESCRIPTION 10
#define TT_NAME_ID_VENDOR_URL 11
#define TT_NAME_ID_DESIGNER_URL 12
#define TT_NAME_ID_LICENSE 13
#define TT_NAME_ID_LICENSE_URL 14
/* number 15 is reserved */
#define TT_NAME_ID_PREFERRED_FAMILY 16
#define TT_NAME_ID_PREFERRED_SUBFAMILY 17
#define TT_NAME_ID_MAC_FULL_NAME 18
 
/* The following code is new as of 2000-01-21 */
#define TT_NAME_ID_SAMPLE_TEXT 19
 
/* This is new in OpenType 1.3 */
#define TT_NAME_ID_CID_FINDFONT_NAME 20
 
/* This is new in OpenType 1.5 */
#define TT_NAME_ID_WWS_FAMILY 21
#define TT_NAME_ID_WWS_SUBFAMILY 22
 
 
/*************************************************************************/
/* */
/* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */
/* */
/* Updated 08-Nov-2008. */
/* */
 
/* Bit 0 Basic Latin */
#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */
/* Bit 1 C1 Controls and Latin-1 Supplement */
#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */
/* Bit 2 Latin Extended-A */
#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
/* Bit 3 Latin Extended-B */
#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
/* Bit 4 IPA Extensions */
/* Phonetic Extensions */
/* Phonetic Extensions Supplement */
#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
/* U+1D00-U+1D7F */
/* U+1D80-U+1DBF */
/* Bit 5 Spacing Modifier Letters */
/* Modifier Tone Letters */
#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
/* U+A700-U+A71F */
/* Bit 6 Combining Diacritical Marks */
/* Combining Diacritical Marks Supplement */
#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */
/* U+1DC0-U+1DFF */
/* Bit 7 Greek and Coptic */
#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
/* Bit 8 Coptic */
#define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */
/* Bit 9 Cyrillic */
/* Cyrillic Supplement */
/* Cyrillic Extended-A */
/* Cyrillic Extended-B */
#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
/* U+0500-U+052F */
/* U+2DE0-U+2DFF */
/* U+A640-U+A69F */
/* Bit 10 Armenian */
#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
/* Bit 11 Hebrew */
#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
/* Bit 12 Vai */
#define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */
/* Bit 13 Arabic */
/* Arabic Supplement */
#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
/* U+0750-U+077F */
/* Bit 14 NKo */
#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */
/* Bit 15 Devanagari */
#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
/* Bit 16 Bengali */
#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */
/* Bit 17 Gurmukhi */
#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */
/* Bit 18 Gujarati */
#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */
/* Bit 19 Oriya */
#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */
/* Bit 20 Tamil */
#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */
/* Bit 21 Telugu */
#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */
/* Bit 22 Kannada */
#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */
/* Bit 23 Malayalam */
#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */
/* Bit 24 Thai */
#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
/* Bit 25 Lao */
#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
/* Bit 26 Georgian */
/* Georgian Supplement */
#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
/* U+2D00-U+2D2F */
/* Bit 27 Balinese */
#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */
/* Bit 28 Hangul Jamo */
#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
/* Bit 29 Latin Extended Additional */
/* Latin Extended-C */
/* Latin Extended-D */
#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
/* U+2C60-U+2C7F */
/* U+A720-U+A7FF */
/* Bit 30 Greek Extended */
#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
/* Bit 31 General Punctuation */
/* Supplemental Punctuation */
#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
/* U+2E00-U+2E7F */
/* Bit 32 Superscripts And Subscripts */
#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
/* Bit 33 Currency Symbols */
#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
/* Bit 34 Combining Diacritical Marks For Symbols */
#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */
/* Bit 35 Letterlike Symbols */
#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
/* Bit 36 Number Forms */
#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
/* Bit 37 Arrows */
/* Supplemental Arrows-A */
/* Supplemental Arrows-B */
/* Miscellaneous Symbols and Arrows */
#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
/* U+27F0-U+27FF */
/* U+2900-U+297F */
/* U+2B00-U+2BFF */
/* Bit 38 Mathematical Operators */
/* Supplemental Mathematical Operators */
/* Miscellaneous Mathematical Symbols-A */
/* Miscellaneous Mathematical Symbols-B */
#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
/* U+2A00-U+2AFF */
/* U+27C0-U+27EF */
/* U+2980-U+29FF */
/* Bit 39 Miscellaneous Technical */
#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */
/* Bit 40 Control Pictures */
#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */
/* Bit 41 Optical Character Recognition */
#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */
/* Bit 42 Enclosed Alphanumerics */
#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */
/* Bit 43 Box Drawing */
#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */
/* Bit 44 Block Elements */
#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */
/* Bit 45 Geometric Shapes */
#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */
/* Bit 46 Miscellaneous Symbols */
#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
/* Bit 47 Dingbats */
#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
/* Bit 48 CJK Symbols and Punctuation */
#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
/* Bit 49 Hiragana */
#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
/* Bit 50 Katakana */
/* Katakana Phonetic Extensions */
#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
/* U+31F0-U+31FF */
/* Bit 51 Bopomofo */
/* Bopomofo Extended */
#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
/* U+31A0-U+31BF */
/* Bit 52 Hangul Compatibility Jamo */
#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
/* Bit 53 Phags-Pa */
#define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */
#define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */
#define TT_UCR_PHAGSPA
/* Bit 54 Enclosed CJK Letters and Months */
#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
/* Bit 55 CJK Compatibility */
#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
/* Bit 56 Hangul Syllables */
#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
/* Bit 57 High Surrogates */
/* High Private Use Surrogates */
/* Low Surrogates */
/* */
/* According to OpenType specs v.1.3+, */
/* setting bit 57 implies that there is */
/* at least one codepoint beyond the */
/* Basic Multilingual Plane that is */
/* supported by this font. So it really */
/* means >= U+10000 */
#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */
/* U+DB80-U+DBFF */
/* U+DC00-U+DFFF */
#define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES
/* Bit 58 Phoenician */
#define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/
/* Bit 59 CJK Unified Ideographs */
/* CJK Radicals Supplement */
/* Kangxi Radicals */
/* Ideographic Description Characters */
/* CJK Unified Ideographs Extension A */
/* CJK Unified Ideographs Extension B */
/* Kanbun */
#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
/* U+2E80-U+2EFF */
/* U+2F00-U+2FDF */
/* U+2FF0-U+2FFF */
/* U+3400-U+4DB5 */
/*U+20000-U+2A6DF*/
/* U+3190-U+319F */
/* Bit 60 Private Use */
#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
/* Bit 61 CJK Strokes */
/* CJK Compatibility Ideographs */
/* CJK Compatibility Ideographs Supplement */
#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */
/* U+F900-U+FAFF */
/*U+2F800-U+2FA1F*/
/* Bit 62 Alphabetic Presentation Forms */
#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
/* Bit 63 Arabic Presentation Forms-A */
#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */
/* Bit 64 Combining Half Marks */
#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
/* Bit 65 Vertical forms */
/* CJK Compatibility Forms */
#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */
/* U+FE30-U+FE4F */
/* Bit 66 Small Form Variants */
#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
/* Bit 67 Arabic Presentation Forms-B */
#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFE */
/* Bit 68 Halfwidth and Fullwidth Forms */
#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
/* Bit 69 Specials */
#define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */
/* Bit 70 Tibetan */
#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */
/* Bit 71 Syriac */
#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */
/* Bit 72 Thaana */
#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */
/* Bit 73 Sinhala */
#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */
/* Bit 74 Myanmar */
#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */
/* Bit 75 Ethiopic */
/* Ethiopic Supplement */
/* Ethiopic Extended */
#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */
/* U+1380-U+139F */
/* U+2D80-U+2DDF */
/* Bit 76 Cherokee */
#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */
/* Bit 77 Unified Canadian Aboriginal Syllabics */
#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */
/* Bit 78 Ogham */
#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */
/* Bit 79 Runic */
#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */
/* Bit 80 Khmer */
/* Khmer Symbols */
#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */
/* U+19E0-U+19FF */
/* Bit 81 Mongolian */
#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */
/* Bit 82 Braille Patterns */
#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */
/* Bit 83 Yi Syllables */
/* Yi Radicals */
#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */
/* U+A490-U+A4CF */
/* Bit 84 Tagalog */
/* Hanunoo */
/* Buhid */
/* Tagbanwa */
#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */
/* U+1720-U+173F */
/* U+1740-U+175F */
/* U+1760-U+177F */
/* Bit 85 Old Italic */
#define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/
/* Bit 86 Gothic */
#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/
/* Bit 87 Deseret */
#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/
/* Bit 88 Byzantine Musical Symbols */
/* Musical Symbols */
/* Ancient Greek Musical Notation */
#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/
/*U+1D100-U+1D1FF*/
/*U+1D200-U+1D24F*/
/* Bit 89 Mathematical Alphanumeric Symbols */
#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/
/* Bit 90 Private Use (plane 15) */
/* Private Use (plane 16) */
#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/
/*U+100000-U+10FFFD*/
/* Bit 91 Variation Selectors */
/* Variation Selectors Supplement */
#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */
/*U+E0100-U+E01EF*/
/* Bit 92 Tags */
#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/
/* Bit 93 Limbu */
#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */
/* Bit 94 Tai Le */
#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */
/* Bit 95 New Tai Lue */
#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */
/* Bit 96 Buginese */
#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */
/* Bit 97 Glagolitic */
#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */
/* Bit 98 Tifinagh */
#define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */
/* Bit 99 Yijing Hexagram Symbols */
#define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */
/* Bit 100 Syloti Nagri */
#define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */
/* Bit 101 Linear B Syllabary */
/* Linear B Ideograms */
/* Aegean Numbers */
#define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/
/*U+10080-U+100FF*/
/*U+10100-U+1013F*/
/* Bit 102 Ancient Greek Numbers */
#define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/
/* Bit 103 Ugaritic */
#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/
/* Bit 104 Old Persian */
#define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/
/* Bit 105 Shavian */
#define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/
/* Bit 106 Osmanya */
#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/
/* Bit 107 Cypriot Syllabary */
#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/
/* Bit 108 Kharoshthi */
#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/
/* Bit 109 Tai Xuan Jing Symbols */
#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/
/* Bit 110 Cuneiform */
/* Cuneiform Numbers and Punctuation */
#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/
/*U+12400-U+1247F*/
/* Bit 111 Counting Rod Numerals */
#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/
/* Bit 112 Sundanese */
#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */
/* Bit 113 Lepcha */
#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */
/* Bit 114 Ol Chiki */
#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */
/* Bit 115 Saurashtra */
#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */
/* Bit 116 Kayah Li */
#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */
/* Bit 117 Rejang */
#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */
/* Bit 118 Cham */
#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */
/* Bit 119 Ancient Symbols */
#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/
/* Bit 120 Phaistos Disc */
#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/
/* Bit 121 Carian */
/* Lycian */
/* Lydian */
#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/
/*U+10280-U+1029F*/
/*U+10920-U+1093F*/
/* Bit 122 Domino Tiles */
/* Mahjong Tiles */
#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/
/*U+1F000-U+1F02F*/
/* Bit 123-127 Reserved for process-internal usage */
 
 
/*************************************************************************/
/* */
/* Some compilers have a very limited length of identifiers. */
/* */
#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )
#define HAVE_LIMIT_ON_IDENTS
#endif
 
 
#ifndef HAVE_LIMIT_ON_IDENTS
 
 
/*************************************************************************/
/* */
/* Here some alias #defines in order to be clearer. */
/* */
/* These are not always #defined to stay within the 31~character limit */
/* which some compilers have. */
/* */
/* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */
/* Borland compilers (read: from BC++ 3.1 on) can increase this limit. */
/* If you get a warning with such a compiler, use the -i40 switch. */
/* */
#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \
TT_UCR_ARABIC_PRESENTATIONS_A
#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \
TT_UCR_ARABIC_PRESENTATIONS_B
 
#define TT_UCR_COMBINING_DIACRITICAL_MARKS \
TT_UCR_COMBINING_DIACRITICS
#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
TT_UCR_COMBINING_DIACRITICS_SYMB
 
 
#endif /* !HAVE_LIMIT_ON_IDENTS */
 
 
FT_END_HEADER
 
#endif /* __TTNAMEID_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/ttobjs.h
0,0 → 1,873
/*******************************************************************
*
* ttobjs.h 1.0
*
* Objects definition unit.
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
******************************************************************/
 
#ifndef TTOBJS_H
#define TTOBJS_H
 
#include "ttconfig.h"
#include "ttengine.h"
#include "ttmutex.h"
#include "ttcache.h"
#include "tttables.h"
#include "ttcmap.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* */
/* This file contains the definitions and methods of the four */
/* kinds of objects managed by the FreeType engine. These are: */
/* */
/* */
/* Face objects: */
/* */
/* There is always one face object per opened TrueType font */
/* file, and only one. The face object contains data that is */
/* independent of current transform/scaling/rotation and */
/* pointsize, or glyph index. This data is made of several */
/* critical tables that are loaded on face object creation. */
/* */
/* A face object tracks all active and recycled objects of */
/* the instance and execution context classes. Destroying a face */
/* object will automatically destroy all associated instances. */
/* */
/* */
/* Instance objects: */
/* */
/* An instance object always relates to a given face object, */
/* known as its 'parent' or 'owner', and contains only the */
/* data that is specific to one given pointsize/transform of */
/* the face. You can only create an instance from a face object. */
/* */
/* An instance's current transform/pointsize can be changed */
/* at any time using a single high-level API call, */
/* TT_Reset_Instance(). */
/* */
/* Execution Context objects: */
/* */
/* An execution context (or context in short) relates to a face. */
/* It contains the data and tables that are necessary to load */
/* and hint (i.e. execute the glyph instructions of) one glyph. */
/* A context is a transient object that is queried/created on */
/* the fly: client applications never deal with them directly. */
/* */
/* */
/* Glyph objects: */
/* */
/* A glyph object contains only the minimal glyph information */
/* needed to render one glyph correctly. This means that a glyph */
/* object really contains tables that are sized to hold the */
/* contents of _any_ glyph of a given face. A client application */
/* can usually create one glyph object for a given face, then use */
/* it for all subsequent loads. */
/* */
/* Here is an example of a client application : */
/* (NOTE: No error checking performed here!) */
/* */
/* */
/* TT_Face face; -- face handle */
/* TT_Instance ins1, ins2; -- two instance handles */
/* TT_Glyph glyph; -- glyph handle */
/* */
/* TT_Init_FreeType(); */
/* */
/* -- Initialize the engine. This must be done prior to _any_ */
/* operation. */
/* */
/* TT_Open_Face( "/some/face/name.ttf", &face ); */
/* */
/* -- create the face object. This call opens the font file */
/* */
/* TT_New_Instance( face, &ins1 ); */
/* TT_New_Instance( face, &ins2 ); */
/* */
/* TT_Set_Instance_PointSize( ins1, 8 ); */
/* TT_Set_Instance_PointSize( ins2, 12 ); */
/* */
/* -- create two distinct instances of the same face */
/* -- ins1 is pointsize 8 at resolution 96 dpi */
/* -- ins2 is pointsize 12 at resolution 96 dpi */
/* */
/* TT_New_Glyph( face, &glyph ); */
/* */
/* -- create a new glyph object which will receive the contents */
/* of any glyph of 'face' */
/* */
/* TT_Load_Glyph( ins1, glyph, 64, DEFAULT_GLYPH_LOAD ); */
/* */
/* -- load glyph indexed 64 at pointsize 8 in the 'glyph' object */
/* -- NOTE: This call will fail if the instance and the glyph */
/* do not relate to the same face object. */
/* */
/* TT_Get_Outline( glyph, &outline ); */
/* */
/* -- extract the glyph outline from the object and copies it */
/* to the 'outline' record */
/* */
/* TT_Get_Metrics( glyph, &metrics ); */
/* */
/* -- extract the glyph metrics and put them into the 'metrics' */
/* record */
/* */
/* TT_Load_Glyph( ins2, glyph, 64, DEFAULT_GLYPH_LOAD ); */
/* */
/* -- load the same glyph at pointsize 12 in the 'glyph' object */
/* */
/* */
/* TT_Close_Face( &face ); */
/* */
/* -- destroy the face object. This will destroy 'ins1' and */
/* 'ins2'. However, the glyph object will still be available */
/* */
/* TT_Done_FreeType(); */
/* */
/* -- Finalize the engine. This will also destroy all pending */
/* glyph objects (here 'glyph'). */
 
struct TFace_;
struct TInstance_;
struct TExecution_Context_;
struct TGlyph_;
 
typedef struct TFace_ TFace;
typedef TFace* PFace;
 
typedef struct TInstance_ TInstance;
typedef TInstance* PInstance;
 
typedef struct TExecution_Context_ TExecution_Context;
typedef TExecution_Context* PExecution_Context;
 
typedef struct TGlyph_ TGlyph;
typedef TGlyph* PGlyph;
 
 
/*************************************************************/
/* */
/* ADDITIONAL SUBTABLES */
/* */
/* These tables are not precisely defined by the specs */
/* but their structures is implied by the TrueType font */
/* file layout. */
/* */
/*************************************************************/
 
/* Graphics State */
/* */
/* The Graphics State (GS) is managed by the */
/* instruction field, but does not come from */
/* the font file. Thus, we can use 'int's */
/* where needed. */
 
struct TGraphicsState_
{
UShort rp0;
UShort rp1;
UShort rp2;
 
TT_UnitVector dualVector;
TT_UnitVector projVector;
TT_UnitVector freeVector;
 
Long loop;
TT_F26Dot6 minimum_distance;
Int round_state;
 
Bool auto_flip;
TT_F26Dot6 control_value_cutin;
TT_F26Dot6 single_width_cutin;
TT_F26Dot6 single_width_value;
Short delta_base;
Short delta_shift;
 
Byte instruct_control;
Bool scan_control;
Int scan_type;
 
UShort gep0;
UShort gep1;
UShort gep2;
};
 
typedef struct TGraphicsState_ TGraphicsState;
 
 
LOCAL_DEF
const TGraphicsState Default_GraphicsState;
 
 
/*************************************************************/
/* */
/* EXECUTION SUBTABLES */
/* */
/* These sub-tables relate to instruction execution. */
/* */
/*************************************************************/
 
#define MAX_CODE_RANGES 3
 
/* There can only be 3 active code ranges at once: */
/* - the Font Program */
/* - the CVT Program */
/* - a glyph's instructions set */
 
#define TT_CodeRange_Font 1
#define TT_CodeRange_Cvt 2
#define TT_CodeRange_Glyph 3
 
 
struct TCodeRange_
{
PByte Base;
ULong Size;
};
 
typedef struct TCodeRange_ TCodeRange;
typedef TCodeRange* PCodeRange;
 
 
/* Defintion of a code range */
/* */
/* Code ranges can be resident to a glyph (i.e. the Font Program) */
/* while some others are volatile (Glyph instructions). */
/* Tracking the state and presence of code ranges allows function */
/* and instruction definitions within a code range to be forgotten */
/* when the range is discarded. */
 
typedef TCodeRange TCodeRangeTable[MAX_CODE_RANGES];
 
/* defines a function/instruction definition record */
 
struct TDefRecord_
{
Int Range; /* in which code range is it located ? */
ULong Start; /* where does it start ? */
Int Opc; /* function #, or instruction code */
Bool Active; /* is it active ? */
};
 
typedef struct TDefRecord_ TDefRecord;
typedef TDefRecord* PDefRecord;
typedef TDefRecord* PDefArray;
 
/* defines a call record, used to manage function calls. */
 
struct TCallRecord_
{
Int Caller_Range;
ULong Caller_IP;
Long Cur_Count;
ULong Cur_Restart;
};
 
typedef struct TCallRecord_ TCallRecord;
typedef TCallRecord* PCallRecord;
typedef TCallRecord* PCallStack; /* defines a simple call stack */
 
 
/* This type defining a set of glyph points will be used to represent */
/* each zone (regular and twilight) during instructions decoding. */
struct TGlyph_Zone_
{
UShort n_points; /* number of points in zone */
Short n_contours; /* number of contours */
 
TT_Vector* org; /* original points coordinates */
TT_Vector* cur; /* current points coordinates */
 
Byte* touch; /* current touch flags */
UShort* contours; /* contour end points */
};
 
typedef struct TGlyph_Zone_ TGlyph_Zone;
typedef TGlyph_Zone* PGlyph_Zone;
 
 
 
#ifndef TT_STATIC_INTEPRETER /* indirect implementation */
 
#define EXEC_OPS PExecution_Context exc,
#define EXEC_OP PExecution_Context exc
#define EXEC_ARGS exc,
#define EXEC_ARG exc
 
#else /* static implementation */
 
#define EXEC_OPS /* void */
#define EXEC_OP /* void */
#define EXEC_ARGS /* void */
#define EXEC_ARG /* void */
 
#endif
 
/* Rounding function, as used by the interpreter */
typedef TT_F26Dot6 (*TRound_Function)( EXEC_OPS TT_F26Dot6 distance,
TT_F26Dot6 compensation );
 
/* Point displacement along the freedom vector routine, as */
/* used by the interpreter */
typedef void (*TMove_Function)( EXEC_OPS PGlyph_Zone zone,
UShort point,
TT_F26Dot6 distance );
 
/* Distance projection along one of the proj. vectors, as used */
/* by the interpreter */
typedef TT_F26Dot6 (*TProject_Function)( EXEC_OPS TT_Vector* v1,
TT_Vector* v2 );
 
/* reading a cvt value. Take care of non-square pixels when needed */
typedef TT_F26Dot6 (*TGet_CVT_Function)( EXEC_OPS ULong index );
 
/* setting or moving a cvt value. Take care of non-square pixels */
/* when needed */
typedef void (*TSet_CVT_Function)( EXEC_OPS ULong index,
TT_F26Dot6 value );
 
/* subglyph transformation record */
struct TTransform_
{
TT_Fixed xx, xy; /* transformation */
TT_Fixed yx, yy; /* matrix */
TT_F26Dot6 ox, oy; /* offsets */
};
 
typedef struct TTransform_ TTransform;
typedef TTransform* PTransform;
 
/* subglyph loading record. Used to load composite components */
struct TSubglyph_Record_
{
Long index; /* subglyph index; initialized with -1 */
Bool is_scaled; /* is the subglyph scaled? */
Bool is_hinted; /* should it be hinted? */
Bool preserve_pps; /* preserve phantom points? */
 
Long file_offset;
 
TT_Big_Glyph_Metrics metrics;
 
TGlyph_Zone zone;
 
Long arg1; /* first argument */
Long arg2; /* second argument */
 
UShort element_flag; /* current load element flag */
 
TTransform transform; /* transform */
 
TT_Vector pp1, pp2; /* phantom points */
 
};
 
typedef struct TSubglyph_Record_ TSubglyph_Record;
typedef TSubglyph_Record* PSubglyph_Record;
typedef TSubglyph_Record* PSubglyph_Stack;
 
/* A note regarding non-squared pixels: */
/* */
/* (This text will probably go into some docs at some time, for */
/* now, it is kept there to explain some definitions in the */
/* TIns_Metrics record). */
/* */
/* The CVT is a one-dimensional array containing values that */
/* control certain important characteristics in a font, like */
/* the height of all capitals, all lowercase letter, default */
/* spacing or stem width/height. */
/* */
/* These values are found in FUnits in the font file, and must be */
/* scaled to pixel coordinates before being used by the CVT and */
/* glyph programs. Unfortunately, when using distinct x and y */
/* resolutions (or distinct x and y pointsizes), there are two */
/* possible scalings. */
/* */
/* A first try was to implement a 'lazy' scheme where all values */
/* were scaled when first used. However, while some values are always */
/* used in the same direction, and some other are used in many */
/* different circumstances and orientations. */
/* */
/* I have found a simpler way to do the same, and it even seems to */
/* work in most of the cases: */
/* */
/* - all CVT values are scaled to the maximum ppem size */
/* */
/* - when performing a read or write in the CVT, a ratio factor */
/* is used to perform adequate scaling. Example: */
/* */
/* x_ppem = 14 */
/* y_ppem = 10 */
/* */
/* we choose ppem = x_ppem = 14 as the CVT scaling size. All cvt */
/* entries are scaled to it. */
/* */
/* x_ratio = 1.0 */
/* y_ratio = y_ppem/ppem (< 1.0) */
/* */
/* we compute the current ratio like: */
/* */
/* - if projVector is horizontal, */
/* ratio = x_ratio = 1.0 */
/* - if projVector is vertical, */
/* ratop = y_ratio */
/* - else, */
/* ratio = sqrt((proj.x*x_ratio)^2 + (proj.y*y_ratio)^2) */
/* */
/* reading a cvt value returns ratio * cvt[index] */
/* writing a cvt value in pixels cvt[index] / ratio */
/* */
/* the current ppem is simply ratio * ppem */
/* */
 
/* metrics used by the instance and execution context objects */
struct TIns_Metrics_
{
TT_F26Dot6 pointSize; /* point size. 1 point = 1/72 inch. */
 
UShort x_resolution; /* device horizontal resolution in dpi. */
UShort y_resolution; /* device vertical resolution in dpi. */
 
UShort x_ppem; /* horizontal pixels per EM */
UShort y_ppem; /* vertical pixels per EM */
 
Long x_scale1;
Long x_scale2; /* used to scale FUnits to fractional pixels */
 
Long y_scale1;
Long y_scale2; /* used to scale FUnits to fractional pixels */
 
/* for non-square pixels */
Long x_ratio;
Long y_ratio;
 
UShort ppem; /* maximum ppem size */
Long ratio; /* current ratio */
Long scale1;
Long scale2; /* scale for ppem */
 
TT_F26Dot6 compensations[4]; /* device-specific compensations */
 
Bool rotated; /* `is the glyph rotated?'-flag */
Bool stretched; /* `is the glyph stretched?'-flag */
};
 
typedef struct TIns_Metrics_ TIns_Metrics;
typedef TIns_Metrics* PIns_Metrics;
 
 
 
/***********************************************************************/
/* */
/* FreeType Face Type */
/* */
/***********************************************************************/
 
struct TFace_
{
/* parent engine instance for the face object */
PEngine_Instance engine;
 
/* i/o stream */
TT_Stream stream;
 
/* used only by the threaded builds of the library */
TMutex lock;
 
/* TrueType collection header, if any was found */
TTTCHeader ttcHeader;
 
/* maximum profile table, as found in the TrueType file */
TMaxProfile maxProfile;
 
/* Note: */
/* it seems that some maximum values cannot be */
/* taken directly from this table, but rather by */
/* combining some of its fields; e.g. the max. */
/* number of points seems to be given by */
/* MAX( maxPoints, maxCompositePoints ) */
/* */
/* For this reason, we define later our own */
/* max values that are used to load and allocate */
/* further tables. */
 
TT_Header fontHeader; /* the font header, as */
/* found in the TTF file */
TT_Horizontal_Header horizontalHeader; /* the horizontal header */
 
Bool verticalInfo; /* True when vertical table */
TT_Vertical_Header verticalHeader; /* is present in the font */
 
TT_OS2 os2; /* 'OS/2' table */
 
TT_Postscript postscript; /* 'Post' table */
 
TT_Hdmx hdmx; /* 'Hdmx' table */
 
TName_Table nameTable; /* name table */
 
TGasp gasp; /* the 'gasp' table */
 
/* The directory of TrueType tables for this typeface */
UShort numTables;
PTableDirEntry dirTables;
 
/* The directory of character mappings table for */
/* this typeface */
UShort numCMaps;
PCMapTable cMaps;
 
/* The glyph locations table */
ULong numLocations; /* UShort is not enough */
#ifndef TT_HUGE_PTR
PStorage glyphLocations;
#else
Storage TT_HUGE_PTR * glyphLocations;
#endif
 
/* NOTE : The "hmtx" is now part of the horizontal header */
 
/* the font program, if any */
ULong fontPgmSize;
PByte fontProgram;
 
/* the cvt program, if any */
ULong cvtPgmSize;
PByte cvtProgram;
 
/* the original, unscaled, control value table */
ULong cvtSize;
PShort cvt;
 
/* The following values _must_ be set by the */
/* maximum profile loader */
 
UShort numGlyphs; /* the face's total number of glyphs */
UShort maxPoints; /* max glyph points number, simple and composite */
UShort maxContours; /* max glyph contours numb, simple and composite */
UShort maxComponents; /* max components in a composite glyph */
 
/* the following are object caches to track active */
/* and recycled instances and execution contexts */
/* objects. See 'ttcache.h' */
 
TCache instances; /* current instances for this face */
TCache glyphs; /* current glyph containers for this face */
 
 
/* A typeless pointer to the face object extensions defined */
/* in the 'ttextend.*' files. */
void* extension;
Int n_extensions; /* number of extensions */
 
/* Use extensions to provide additional capabilities to the */
/* engine. Read the developer's guide in the documentation */
/* directory to know how to do that. */
 
/* a generic pointer for client use - see TT_Set/Get_Face_Pointer */
void* generic;
};
 
 
 
/***********************************************************************/
/* */
/* FreeType Instance Type */
/* */
/***********************************************************************/
 
struct TInstance_
{
PFace owner; /* face object */
 
Bool valid;
 
TIns_Metrics metrics;
 
UShort numFDefs; /* number of function definitions */
UShort maxFDefs;
PDefArray FDefs; /* table of FDefs entries */
 
UShort numIDefs; /* number of instruction definitions */
UShort maxIDefs;
PDefArray IDefs; /* table of IDefs entries */
 
Int maxFunc; /* maximum function definition id */
Int maxIns; /* maximum instruction definition id */
 
TCodeRangeTable codeRangeTable;
 
TGraphicsState GS;
TGraphicsState default_GS;
 
ULong cvtSize; /* the scaled control value table */
PLong cvt;
 
ULong storeSize; /* The storage area is now part of the */
PLong storage; /* instance */
 
TGlyph_Zone twilight; /* The instance's twilight zone */
 
/* debugging variables */
 
/* When using the debugger, we must keep the */
/* execution context tied to the instance */
/* object rather than asking it on demand */
 
Bool debug;
PExecution_Context context;
 
/* a generic pointer for client use - see TT_Set/Get_Instance_Pointer */
void* generic;
};
 
 
/***********************************************************************/
/* */
/* FreeType Execution Context Type */
/* */
/***********************************************************************/
 
struct TExecution_Context_
{
PFace face;
PInstance instance;
 
/* instructions state */
 
TT_Error error; /* last execution error */
 
Long top; /* top of exec. stack */
 
ULong stackSize; /* size of exec. stack */
PStorage stack; /* current exec. stack */
 
Long args;
ULong new_top; /* new top after exec. */
 
TGlyph_Zone zp0, /* zone records */
zp1,
zp2,
pts,
twilight;
 
TIns_Metrics metrics; /* instance metrics */
 
TGraphicsState GS; /* current graphics state */
 
Int curRange; /* current code range number */
PByte code; /* current code range */
ULong IP; /* current instruction pointer */
ULong codeSize; /* size of current range */
 
Byte opcode; /* current opcode */
Int length; /* length of current opcode */
 
Bool step_ins; /* true if the interpreter must */
/* increment IP after ins. exec */
ULong cvtSize;
PLong cvt;
 
ULong glyphSize; /* glyph instructions buffer size */
PByte glyphIns; /* glyph instructions buffer */
 
UShort numFDefs; /* number of function defs */
UShort maxFDefs; /* maximum number of function defs */
PDefRecord FDefs; /* table of FDefs entries */
 
UShort numIDefs; /* number of instruction defs */
UShort maxIDefs; /* maximum number of instruction defs */
PDefRecord IDefs; /* table of IDefs entries */
 
Int maxFunc;
Int maxIns;
 
Int callTop, /* top of call stack during execution */
callSize; /* size of call stack */
PCallStack callStack; /* call stack */
 
UShort maxPoints; /* capacity of this context's "pts" */
UShort maxContours; /* record, expressed in points and */
/* contours.. */
 
TCodeRangeTable codeRangeTable; /* table of valid coderanges */
/* useful for the debugger */
 
ULong storeSize; /* size of current storage */
PLong storage; /* storage area */
 
TT_F26Dot6 period; /* values used for the */
TT_F26Dot6 phase; /* 'SuperRounding' */
TT_F26Dot6 threshold;
 
/* this seems to be unused */
#if 0
Int cur_ppem; /* ppem along the current proj vector */
#endif
Long scale1; /* scaling values along the current */
Long scale2; /* projection vector too.. */
Bool cached_metrics; /* the ppem is computed lazily. used */
/* to trigger computation when needed */
 
Bool instruction_trap; /* If True, the interpreter will */
/* exit after each instruction */
 
TGraphicsState default_GS; /* graphics state resulting from */
/* the prep program */
Bool is_composite; /* ture if the glyph is composite */
 
Bool pedantic_hinting; /* if true, read and write array */
/* bounds faults halt the hinting */
 
/* latest interpreter additions */
 
Long F_dot_P; /* dot product of freedom and projection */
/* vectors */
TRound_Function func_round; /* current rounding function */
 
TProject_Function func_project, /* current projection function */
func_dualproj, /* current dual proj. function */
func_freeProj; /* current freedom proj. func */
 
TMove_Function func_move; /* current point move function */
 
TGet_CVT_Function func_read_cvt; /* read a cvt entry */
TSet_CVT_Function func_write_cvt; /* write a cvt entry (in pixels) */
TSet_CVT_Function func_move_cvt; /* incr a cvt entry (in pixels) */
 
ULong loadSize;
PSubglyph_Stack loadStack; /* loading subglyph stack */
 
};
 
 
/***********************************************************************/
/* */
/* FreeType Glyph Object Type */
/* */
/***********************************************************************/
 
struct TGlyph_
{
PFace face;
TT_Big_Glyph_Metrics metrics;
TT_Outline outline;
};
 
 
/* The following type is used to load a font from a collection. */
/* See Face_Create in ttobjs.c */
 
struct TFont_Input_
{
TT_Stream stream; /* input stream */
ULong fontIndex; /* index of font in collection */
PEngine_Instance engine; /* parent engine instance */
 
};
 
typedef struct TFont_Input_ TFont_Input;
 
 
/********************************************************************/
/* */
/* Code Range Functions */
/* */
/********************************************************************/
 
/* Goto a specified coderange */
LOCAL_DEF
TT_Error Goto_CodeRange( PExecution_Context exec,
Int range,
ULong IP );
 
#if 0
/* Return a pointer to a given coderange record. */
/* Used only by the debugger. */
LOCAL_DEF
PCodeRange Get_CodeRange( PExecution_Context exec,
Int range );
#endif
 
/* Set a given code range properties */
LOCAL_DEF
TT_Error Set_CodeRange( PExecution_Context exec,
Int range,
void* base,
ULong length );
 
/* Clear a given coderange */
LOCAL_DEF
TT_Error Clear_CodeRange( PExecution_Context exec, Int range );
 
 
LOCAL_DEF
PExecution_Context New_Context( PFace face );
 
LOCAL_DEF
TT_Error Done_Context( PExecution_Context exec );
 
 
LOCAL_DEF
TT_Error Context_Load( PExecution_Context exec,
PFace face,
PInstance ins );
 
LOCAL_DEF
TT_Error Context_Save( PExecution_Context exec,
PInstance ins );
 
LOCAL_DEF
TT_Error Context_Run( PExecution_Context exec,
Bool debug );
 
LOCAL_DEF
TT_Error Instance_Init( PInstance ins );
 
LOCAL_DEF
TT_Error Instance_Reset( PInstance ins );
 
 
/********************************************************************/
/* */
/* Handy scaling functions */
/* */
/********************************************************************/
 
LOCAL_DEF TT_Pos Scale_X( PIns_Metrics metrics, TT_Pos x );
LOCAL_DEF TT_Pos Scale_Y( PIns_Metrics metrics, TT_Pos y );
 
/********************************************************************/
/* */
/* Component Initializer/Finalizer */
/* */
/* Called from 'freetype.c' */
/* The component must create and register the face, instance and */
/* execution context cache classes before any object can be */
/* managed. */
/* */
/********************************************************************/
 
LOCAL_DEF TT_Error TTObjs_Init( PEngine_Instance engine );
LOCAL_DEF TT_Error TTObjs_Done( PEngine_Instance engine );
 
#ifdef __cplusplus
}
#endif
 
#endif /* TTOBJS_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttraster.h
0,0 → 1,127
/*******************************************************************
*
* ttraster.h v 1.4
*
* The FreeType glyph rasterizer.
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
* NOTES:
*
* This version supports the following:
*
* - direct grayscaling
* - sub-banding
* - drop-out modes 4 and 5
* - second pass for complete drop-out control (bitmap only)
* - variable precision
*
*
* Changes between 1.4 and 1.3:
*
* Mainly performance tunings:
*
* - Line_Down() and Bezier_Down() now use the functions Line_Up()
* and Bezier_Up() to do their work.
* - optimized Split_Bezier()
* - optimized linked lists used during sweeps
*
* Changes between 1.2 and 1.3:
*
* - made the engine optionaly re-entrant. Saves a lot
* of code for a moderate performance hit.
*
******************************************************************/
 
#ifndef TTRASTER_H
#define TTRASTER_H
 
#include "ttconfig.h"
#include "freetype.h" /* for TT_Outline */
#include "ttengine.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* We provide two different builds of the scan-line converter */
/* The static build uses global variables and isn't */
/* re-entrant. */
/* The indirect build is re-entrant but accesses all variables */
/* indirectly. */
/* */
/* As a consequence, the indirect build is about 10% slower */
/* than the static one on a _Pentium_ (this could get worse */
/* on older processors), but the code size is reduced by */
/* more than 30% ! */
/* */
/* The indirect build is now the default, defined in */
/* ttconfig.h. Be careful if you experiment with this. */
 
/* Note also that, though its code can be re-entrant, the */
/* component is always used in thread-safe mode. This is */
/* simply due to the fact that we want to use a single */
/* render pool (of 64 Kb), and not to waste memory. */
 
#ifdef TT_STATIC_RASTER
 
#define RAS_ARGS /* void */
#define RAS_ARG /* void */
 
#define RAS_VARS /* void */
#define RAS_VAR /* void */
 
#else
 
#define RAS_ARGS TRaster_Instance* raster,
#define RAS_ARG TRaster_Instance* raster
 
#define RAS_VARS raster,
#define RAS_VAR raster
 
#endif
 
 
struct TRaster_Instance_;
typedef struct TRaster_Instance_ TRaster_Instance;
 
/* Render one glyph in the target bitmap, using drop-out control */
/* mode 'scan'. */
LOCAL_DEF
TT_Error Render_Glyph( RAS_ARGS TT_Outline* glyph,
TT_Raster_Map* target );
 
#ifdef TT_CONFIG_OPTION_GRAY_SCALING
/* Render one gray-level glyph in the target pixmap. */
/* Palette points to an array of 5 colors used for the rendering. */
/* Use NULL to reuse the last palette. Default is VGA graylevels. */
LOCAL_DEF
TT_Error Render_Gray_Glyph( RAS_ARGS TT_Outline* glyph,
TT_Raster_Map* target,
Byte* palette );
#endif
 
/* Initialize rasterizer */
LOCAL_DEF
TT_Error TTRaster_Init( PEngine_Instance engine );
 
/* Finalize it */
LOCAL_DEF
TT_Error TTRaster_Done( PEngine_Instance engine );
 
 
#ifdef __cplusplus
}
#endif
 
#endif /* TTRASTER_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/tttables.h
0,0 → 1,759
/***************************************************************************/
/* */
/* tttables.h */
/* */
/* Basic SFNT/TrueType tables definitions and interface */
/* (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __TTTABLES_H__
#define __TTTABLES_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
/*************************************************************************/
/* */
/* <Section> */
/* truetype_tables */
/* */
/* <Title> */
/* TrueType Tables */
/* */
/* <Abstract> */
/* TrueType specific table types and functions. */
/* */
/* <Description> */
/* This section contains the definition of TrueType-specific tables */
/* as well as some routines used to access and process them. */
/* */
/*************************************************************************/
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_Header */
/* */
/* <Description> */
/* A structure used to model a TrueType font header table. All */
/* fields follow the TrueType specification. */
/* */
typedef struct TT_Header_
{
FT_Fixed Table_Version;
FT_Fixed Font_Revision;
 
FT_Long CheckSum_Adjust;
FT_Long Magic_Number;
 
FT_UShort Flags;
FT_UShort Units_Per_EM;
 
FT_Long Created [2];
FT_Long Modified[2];
 
FT_Short xMin;
FT_Short yMin;
FT_Short xMax;
FT_Short yMax;
 
FT_UShort Mac_Style;
FT_UShort Lowest_Rec_PPEM;
 
FT_Short Font_Direction;
FT_Short Index_To_Loc_Format;
FT_Short Glyph_Data_Format;
 
} TT_Header;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_HoriHeader */
/* */
/* <Description> */
/* A structure used to model a TrueType horizontal header, the `hhea' */
/* table, as well as the corresponding horizontal metrics table, */
/* i.e., the `hmtx' table. */
/* */
/* <Fields> */
/* Version :: The table version. */
/* */
/* Ascender :: The font's ascender, i.e., the distance */
/* from the baseline to the top-most of all */
/* glyph points found in the font. */
/* */
/* This value is invalid in many fonts, as */
/* it is usually set by the font designer, */
/* and often reflects only a portion of the */
/* glyphs found in the font (maybe ASCII). */
/* */
/* You should use the `sTypoAscender' field */
/* of the OS/2 table instead if you want */
/* the correct one. */
/* */
/* Descender :: The font's descender, i.e., the distance */
/* from the baseline to the bottom-most of */
/* all glyph points found in the font. It */
/* is negative. */
/* */
/* This value is invalid in many fonts, as */
/* it is usually set by the font designer, */
/* and often reflects only a portion of the */
/* glyphs found in the font (maybe ASCII). */
/* */
/* You should use the `sTypoDescender' */
/* field of the OS/2 table instead if you */
/* want the correct one. */
/* */
/* Line_Gap :: The font's line gap, i.e., the distance */
/* to add to the ascender and descender to */
/* get the BTB, i.e., the */
/* baseline-to-baseline distance for the */
/* font. */
/* */
/* advance_Width_Max :: This field is the maximum of all advance */
/* widths found in the font. It can be */
/* used to compute the maximum width of an */
/* arbitrary string of text. */
/* */
/* min_Left_Side_Bearing :: The minimum left side bearing of all */
/* glyphs within the font. */
/* */
/* min_Right_Side_Bearing :: The minimum right side bearing of all */
/* glyphs within the font. */
/* */
/* xMax_Extent :: The maximum horizontal extent (i.e., the */
/* `width' of a glyph's bounding box) for */
/* all glyphs in the font. */
/* */
/* caret_Slope_Rise :: The rise coefficient of the cursor's */
/* slope of the cursor (slope=rise/run). */
/* */
/* caret_Slope_Run :: The run coefficient of the cursor's */
/* slope. */
/* */
/* Reserved :: 8~reserved bytes. */
/* */
/* metric_Data_Format :: Always~0. */
/* */
/* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */
/* table -- this value can be smaller than */
/* the total number of glyphs in the font. */
/* */
/* long_metrics :: A pointer into the `hmtx' table. */
/* */
/* short_metrics :: A pointer into the `hmtx' table. */
/* */
/* <Note> */
/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
/* be identical except for the names of their fields which */
/* are different. */
/* */
/* This ensures that a single function in the `ttload' */
/* module is able to read both the horizontal and vertical */
/* headers. */
/* */
typedef struct TT_HoriHeader_
{
FT_Fixed Version;
FT_Short Ascender;
FT_Short Descender;
FT_Short Line_Gap;
 
FT_UShort advance_Width_Max; /* advance width maximum */
 
FT_Short min_Left_Side_Bearing; /* minimum left-sb */
FT_Short min_Right_Side_Bearing; /* minimum right-sb */
FT_Short xMax_Extent; /* xmax extents */
FT_Short caret_Slope_Rise;
FT_Short caret_Slope_Run;
FT_Short caret_Offset;
 
FT_Short Reserved[4];
 
FT_Short metric_Data_Format;
FT_UShort number_Of_HMetrics;
 
/* The following fields are not defined by the TrueType specification */
/* but they are used to connect the metrics header to the relevant */
/* `HMTX' table. */
 
void* long_metrics;
void* short_metrics;
 
} TT_HoriHeader;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_VertHeader */
/* */
/* <Description> */
/* A structure used to model a TrueType vertical header, the `vhea' */
/* table, as well as the corresponding vertical metrics table, i.e., */
/* the `vmtx' table. */
/* */
/* <Fields> */
/* Version :: The table version. */
/* */
/* Ascender :: The font's ascender, i.e., the distance */
/* from the baseline to the top-most of */
/* all glyph points found in the font. */
/* */
/* This value is invalid in many fonts, as */
/* it is usually set by the font designer, */
/* and often reflects only a portion of */
/* the glyphs found in the font (maybe */
/* ASCII). */
/* */
/* You should use the `sTypoAscender' */
/* field of the OS/2 table instead if you */
/* want the correct one. */
/* */
/* Descender :: The font's descender, i.e., the */
/* distance from the baseline to the */
/* bottom-most of all glyph points found */
/* in the font. It is negative. */
/* */
/* This value is invalid in many fonts, as */
/* it is usually set by the font designer, */
/* and often reflects only a portion of */
/* the glyphs found in the font (maybe */
/* ASCII). */
/* */
/* You should use the `sTypoDescender' */
/* field of the OS/2 table instead if you */
/* want the correct one. */
/* */
/* Line_Gap :: The font's line gap, i.e., the distance */
/* to add to the ascender and descender to */
/* get the BTB, i.e., the */
/* baseline-to-baseline distance for the */
/* font. */
/* */
/* advance_Height_Max :: This field is the maximum of all */
/* advance heights found in the font. It */
/* can be used to compute the maximum */
/* height of an arbitrary string of text. */
/* */
/* min_Top_Side_Bearing :: The minimum top side bearing of all */
/* glyphs within the font. */
/* */
/* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */
/* glyphs within the font. */
/* */
/* yMax_Extent :: The maximum vertical extent (i.e., the */
/* `height' of a glyph's bounding box) for */
/* all glyphs in the font. */
/* */
/* caret_Slope_Rise :: The rise coefficient of the cursor's */
/* slope of the cursor (slope=rise/run). */
/* */
/* caret_Slope_Run :: The run coefficient of the cursor's */
/* slope. */
/* */
/* caret_Offset :: The cursor's offset for slanted fonts. */
/* This value is `reserved' in vmtx */
/* version 1.0. */
/* */
/* Reserved :: 8~reserved bytes. */
/* */
/* metric_Data_Format :: Always~0. */
/* */
/* number_Of_HMetrics :: Number of VMetrics entries in the */
/* `vmtx' table -- this value can be */
/* smaller than the total number of glyphs */
/* in the font. */
/* */
/* long_metrics :: A pointer into the `vmtx' table. */
/* */
/* short_metrics :: A pointer into the `vmtx' table. */
/* */
/* <Note> */
/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
/* be identical except for the names of their fields which */
/* are different. */
/* */
/* This ensures that a single function in the `ttload' */
/* module is able to read both the horizontal and vertical */
/* headers. */
/* */
typedef struct TT_VertHeader_
{
FT_Fixed Version;
FT_Short Ascender;
FT_Short Descender;
FT_Short Line_Gap;
 
FT_UShort advance_Height_Max; /* advance height maximum */
 
FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */
FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */
FT_Short yMax_Extent; /* xmax or ymax extents */
FT_Short caret_Slope_Rise;
FT_Short caret_Slope_Run;
FT_Short caret_Offset;
 
FT_Short Reserved[4];
 
FT_Short metric_Data_Format;
FT_UShort number_Of_VMetrics;
 
/* The following fields are not defined by the TrueType specification */
/* but they're used to connect the metrics header to the relevant */
/* `HMTX' or `VMTX' table. */
 
void* long_metrics;
void* short_metrics;
 
} TT_VertHeader;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_OS2 */
/* */
/* <Description> */
/* A structure used to model a TrueType OS/2 table. This is the long */
/* table version. All fields comply to the TrueType specification. */
/* */
/* Note that we now support old Mac fonts which do not include an */
/* OS/2 table. In this case, the `version' field is always set to */
/* 0xFFFF. */
/* */
typedef struct TT_OS2_
{
FT_UShort version; /* 0x0001 - more or 0xFFFF */
FT_Short xAvgCharWidth;
FT_UShort usWeightClass;
FT_UShort usWidthClass;
FT_Short fsType;
FT_Short ySubscriptXSize;
FT_Short ySubscriptYSize;
FT_Short ySubscriptXOffset;
FT_Short ySubscriptYOffset;
FT_Short ySuperscriptXSize;
FT_Short ySuperscriptYSize;
FT_Short ySuperscriptXOffset;
FT_Short ySuperscriptYOffset;
FT_Short yStrikeoutSize;
FT_Short yStrikeoutPosition;
FT_Short sFamilyClass;
 
FT_Byte panose[10];
 
FT_ULong ulUnicodeRange1; /* Bits 0-31 */
FT_ULong ulUnicodeRange2; /* Bits 32-63 */
FT_ULong ulUnicodeRange3; /* Bits 64-95 */
FT_ULong ulUnicodeRange4; /* Bits 96-127 */
 
FT_Char achVendID[4];
 
FT_UShort fsSelection;
FT_UShort usFirstCharIndex;
FT_UShort usLastCharIndex;
FT_Short sTypoAscender;
FT_Short sTypoDescender;
FT_Short sTypoLineGap;
FT_UShort usWinAscent;
FT_UShort usWinDescent;
 
/* only version 1 tables: */
 
FT_ULong ulCodePageRange1; /* Bits 0-31 */
FT_ULong ulCodePageRange2; /* Bits 32-63 */
 
/* only version 2 tables: */
 
FT_Short sxHeight;
FT_Short sCapHeight;
FT_UShort usDefaultChar;
FT_UShort usBreakChar;
FT_UShort usMaxContext;
 
} TT_OS2;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_Postscript */
/* */
/* <Description> */
/* A structure used to model a TrueType PostScript table. All fields */
/* comply to the TrueType specification. This structure does not */
/* reference the PostScript glyph names, which can be nevertheless */
/* accessed with the `ttpost' module. */
/* */
typedef struct TT_Postscript_
{
FT_Fixed FormatType;
FT_Fixed italicAngle;
FT_Short underlinePosition;
FT_Short underlineThickness;
FT_ULong isFixedPitch;
FT_ULong minMemType42;
FT_ULong maxMemType42;
FT_ULong minMemType1;
FT_ULong maxMemType1;
 
/* Glyph names follow in the file, but we don't */
/* load them by default. See the ttpost.c file. */
 
} TT_Postscript;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_PCLT */
/* */
/* <Description> */
/* A structure used to model a TrueType PCLT table. All fields */
/* comply to the TrueType specification. */
/* */
typedef struct TT_PCLT_
{
FT_Fixed Version;
FT_ULong FontNumber;
FT_UShort Pitch;
FT_UShort xHeight;
FT_UShort Style;
FT_UShort TypeFamily;
FT_UShort CapHeight;
FT_UShort SymbolSet;
FT_Char TypeFace[16];
FT_Char CharacterComplement[8];
FT_Char FileName[6];
FT_Char StrokeWeight;
FT_Char WidthType;
FT_Byte SerifStyle;
FT_Byte Reserved;
 
} TT_PCLT;
 
 
/*************************************************************************/
/* */
/* <Struct> */
/* TT_MaxProfile */
/* */
/* <Description> */
/* The maximum profile is a table containing many max values which */
/* can be used to pre-allocate arrays. This ensures that no memory */
/* allocation occurs during a glyph load. */
/* */
/* <Fields> */
/* version :: The version number. */
/* */
/* numGlyphs :: The number of glyphs in this TrueType */
/* font. */
/* */
/* maxPoints :: The maximum number of points in a */
/* non-composite TrueType glyph. See also */
/* the structure element */
/* `maxCompositePoints'. */
/* */
/* maxContours :: The maximum number of contours in a */
/* non-composite TrueType glyph. See also */
/* the structure element */
/* `maxCompositeContours'. */
/* */
/* maxCompositePoints :: The maximum number of points in a */
/* composite TrueType glyph. See also the */
/* structure element `maxPoints'. */
/* */
/* maxCompositeContours :: The maximum number of contours in a */
/* composite TrueType glyph. See also the */
/* structure element `maxContours'. */
/* */
/* maxZones :: The maximum number of zones used for */
/* glyph hinting. */
/* */
/* maxTwilightPoints :: The maximum number of points in the */
/* twilight zone used for glyph hinting. */
/* */
/* maxStorage :: The maximum number of elements in the */
/* storage area used for glyph hinting. */
/* */
/* maxFunctionDefs :: The maximum number of function */
/* definitions in the TrueType bytecode for */
/* this font. */
/* */
/* maxInstructionDefs :: The maximum number of instruction */
/* definitions in the TrueType bytecode for */
/* this font. */
/* */
/* maxStackElements :: The maximum number of stack elements used */
/* during bytecode interpretation. */
/* */
/* maxSizeOfInstructions :: The maximum number of TrueType opcodes */
/* used for glyph hinting. */
/* */
/* maxComponentElements :: The maximum number of simple (i.e., non- */
/* composite) glyphs in a composite glyph. */
/* */
/* maxComponentDepth :: The maximum nesting depth of composite */
/* glyphs. */
/* */
/* <Note> */
/* This structure is only used during font loading. */
/* */
typedef struct TT_MaxProfile_
{
FT_Fixed version;
FT_UShort numGlyphs;
FT_UShort maxPoints;
FT_UShort maxContours;
FT_UShort maxCompositePoints;
FT_UShort maxCompositeContours;
FT_UShort maxZones;
FT_UShort maxTwilightPoints;
FT_UShort maxStorage;
FT_UShort maxFunctionDefs;
FT_UShort maxInstructionDefs;
FT_UShort maxStackElements;
FT_UShort maxSizeOfInstructions;
FT_UShort maxComponentElements;
FT_UShort maxComponentDepth;
 
} TT_MaxProfile;
 
 
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Sfnt_Tag */
/* */
/* <Description> */
/* An enumeration used to specify the index of an SFNT table. */
/* Used in the @FT_Get_Sfnt_Table API function. */
/* */
typedef enum FT_Sfnt_Tag_
{
ft_sfnt_head = 0, /* TT_Header */
ft_sfnt_maxp = 1, /* TT_MaxProfile */
ft_sfnt_os2 = 2, /* TT_OS2 */
ft_sfnt_hhea = 3, /* TT_HoriHeader */
ft_sfnt_vhea = 4, /* TT_VertHeader */
ft_sfnt_post = 5, /* TT_Postscript */
ft_sfnt_pclt = 6, /* TT_PCLT */
 
sfnt_max /* internal end mark */
 
} FT_Sfnt_Tag;
 
/* */
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_Table */
/* */
/* <Description> */
/* Return a pointer to a given SFNT table within a face. */
/* */
/* <Input> */
/* face :: A handle to the source. */
/* */
/* tag :: The index of the SFNT table. */
/* */
/* <Return> */
/* A type-less pointer to the table. This will be~0 in case of */
/* error, or if the corresponding table was not found *OR* loaded */
/* from the file. */
/* */
/* Use a typecast according to `tag' to access the structure */
/* elements. */
/* */
/* <Note> */
/* The table is owned by the face object and disappears with it. */
/* */
/* This function is only useful to access SFNT tables that are loaded */
/* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */
/* a list. */
/* */
FT_EXPORT( void* )
FT_Get_Sfnt_Table( FT_Face face,
FT_Sfnt_Tag tag );
 
 
/**************************************************************************
*
* @function:
* FT_Load_Sfnt_Table
*
* @description:
* Load any font table into client memory.
*
* @input:
* face ::
* A handle to the source face.
*
* tag ::
* The four-byte tag of the table to load. Use the value~0 if you want
* to access the whole font file. Otherwise, you can use one of the
* definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
* one with @FT_MAKE_TAG.
*
* offset ::
* The starting offset in the table (or file if tag == 0).
*
* @output:
* buffer ::
* The target buffer address. The client must ensure that the memory
* array is big enough to hold the data.
*
* @inout:
* length ::
* If the `length' parameter is NULL, then try to load the whole table.
* Return an error code if it fails.
*
* Else, if `*length' is~0, exit immediately while returning the
* table's (or file) full size in it.
*
* Else the number of bytes to read from the table or file, from the
* starting offset.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If you need to determine the table's length you should first call this
* function with `*length' set to~0, as in the following example:
*
* {
* FT_ULong length = 0;
*
*
* error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
* if ( error ) { ... table does not exist ... }
*
* buffer = malloc( length );
* if ( buffer == NULL ) { ... not enough memory ... }
*
* error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
* if ( error ) { ... could not load table ... }
* }
*/
FT_EXPORT( FT_Error )
FT_Load_Sfnt_Table( FT_Face face,
FT_ULong tag,
FT_Long offset,
FT_Byte* buffer,
FT_ULong* length );
 
 
/**************************************************************************
*
* @function:
* FT_Sfnt_Table_Info
*
* @description:
* Return information on an SFNT table.
*
* @input:
* face ::
* A handle to the source face.
*
* table_index ::
* The index of an SFNT table. The function returns
* FT_Err_Table_Missing for an invalid value.
*
* @output:
* tag ::
* The name tag of the SFNT table.
*
* length ::
* The length of the SFNT table.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* SFNT tables with length zero are treated as missing.
*
*/
FT_EXPORT( FT_Error )
FT_Sfnt_Table_Info( FT_Face face,
FT_UInt table_index,
FT_ULong *tag,
FT_ULong *length );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_CMap_Language_ID */
/* */
/* <Description> */
/* Return TrueType/sfnt specific cmap language ID. Definitions of */
/* language ID values are in `freetype/ttnameid.h'. */
/* */
/* <Input> */
/* charmap :: */
/* The target charmap. */
/* */
/* <Return> */
/* The language ID of `charmap'. If `charmap' doesn't belong to a */
/* TrueType/sfnt face, just return~0 as the default value. */
/* */
FT_EXPORT( FT_ULong )
FT_Get_CMap_Language_ID( FT_CharMap charmap );
 
 
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_CMap_Format */
/* */
/* <Description> */
/* Return TrueType/sfnt specific cmap format. */
/* */
/* <Input> */
/* charmap :: */
/* The target charmap. */
/* */
/* <Return> */
/* The format of `charmap'. If `charmap' doesn't belong to a */
/* TrueType/sfnt face, return -1. */
/* */
FT_EXPORT( FT_Long )
FT_Get_CMap_Format( FT_CharMap charmap );
 
/* */
 
 
FT_END_HEADER
 
#endif /* __TTTABLES_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/tttags.h
0,0 → 1,107
/***************************************************************************/
/* */
/* tttags.h */
/* */
/* Tags for TrueType and OpenType tables (specification only). */
/* */
/* Copyright 1996-2001, 2004, 2005, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __TTAGS_H__
#define __TTAGS_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
#define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' )
#define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' )
#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' )
#define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' )
#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' )
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' )
#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' )
#define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' )
#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' )
#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' )
#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' )
#define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' )
#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' )
#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' )
#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' )
#define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' )
#define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' )
#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
#define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' )
#define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' )
#define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' )
#define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' )
#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' )
#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
#define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' )
#define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' )
#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' )
#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' )
#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' )
#define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' )
#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' )
#define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' )
#define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' )
#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' )
 
 
FT_END_HEADER
 
#endif /* __TTAGS_H__ */
 
 
/* END */
/contrib/media/updf/include/freetype/tttypes.h
0,0 → 1,150
/*******************************************************************
*
* tttypes.h
*
* Freetype engine's common types specification
* (this spec has no associated body).
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
* NOTE:
*
* All these declarations are library internals, and *not* part
* of the high-level interface. See also 'freetype.h'.
*
******************************************************************/
 
#ifndef TTTYPES_H
#define TTTYPES_H
 
#include "ttconfig.h"
#include "freetype.h"
 
#ifdef __MACTYPES__
#error "<MacTypes.h> have been included, and this prevents the proper\
compilation of this library. Please remove the precompiled headers."
#endif
 
typedef char String;
typedef signed char Char;
typedef unsigned char Byte;
 
typedef unsigned short UShort;
typedef signed short Short;
 
typedef unsigned long ULong;
typedef signed long Long;
 
typedef TT_Int32 Fixed;
 
typedef int Int;
 
/* Simple access types: pointers and tables */
 
typedef Byte* PByte;
typedef UShort* PUShort;
typedef Short* PShort;
typedef ULong* PULong;
typedef Long* PLong;
 
typedef Fixed* PFixed;
 
typedef Int* PInt;
 
typedef void* Pointer;
 
typedef TT_F26Dot6* PCoordinates;
typedef unsigned char* PTouchTable;
 
 
#ifndef Bool
typedef int Bool; /* No boolean type in C */
#endif
 
#ifndef TRUE
#define TRUE 1
#endif
 
#ifndef FALSE
#define FALSE 0
#endif
 
#ifndef NULL
#define NULL (void*)0
#endif
 
typedef Long Storage;
typedef Storage* PStorage;
 
 
/* Rounding mode constants */
 
#define TT_Round_Off 5
#define TT_Round_To_Half_Grid 0
#define TT_Round_To_Grid 1
#define TT_Round_To_Double_Grid 2
#define TT_Round_Up_To_Grid 4
#define TT_Round_Down_To_Grid 3
#define TT_Round_Super 6
#define TT_Round_Super_45 7
 
 
/* Touch flag masks */
 
#define TT_Flag_On_Curve 1
#define TT_Flag_Touched_X 2
#define TT_Flag_Touched_Y 4
#define TT_Flag_Touched_Both 6
 
 
/* Error management constants :) */
 
#define SUCCESS 0
#define FAILURE -1
 
 
/* The min and max functions missing in C. As usual, be careful not to */
/* write things like MIN( a++, b++ ) to avoid side effects. */
 
#ifndef MIN
#define MIN( a, b ) ( (a) < (b) ? (a) : (b) )
#endif
 
#ifndef MAX
#define MAX( a, b ) ( (a) > (b) ? (a) : (b) )
#endif
 
#ifndef ABS
#define ABS( a ) ( (a) < 0 ? -(a) : (a) )
#endif
 
/* conversion macros for the handles defined in freetype.h */
 
#define HANDLE_Val( handle ) ((handle).z)
 
#define HANDLE_Engine( handle ) ((PEngine_Instance)HANDLE_Val( handle ))
 
#define HANDLE_Face( handle ) ((PFace)HANDLE_Val( handle ))
 
#define HANDLE_Instance( handle ) ((PInstance)HANDLE_Val( handle ))
 
/* HANDLE_Stream( handle ) must be defined in ttfile.c */
 
#define HANDLE_Glyph( handle ) ((PGlyph)HANDLE_Val( handle ))
 
#define HANDLE_CharMap( handle ) ((PCMapTable)HANDLE_Val( handle ))
 
#define HANDLE_Set( handle, val ) ((handle).z = (void*)(val))
 
 
#endif /* TTTYPES_H */
 
 
/* END */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/freetype/ttunpat.h
0,0 → 1,59
/***************************************************************************/
/* */
/* ttunpat.h */
/* */
/* Definitions for the unpatented TrueType hinting system */
/* */
/* Copyright 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Written by Graham Asher <graham.asher@btinternet.com> */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
#ifndef __TTUNPAT_H__
#define __TTUNPAT_H__
 
 
#include <ft2build.h>
#include FT_FREETYPE_H
 
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
 
 
FT_BEGIN_HEADER
 
 
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_UNPATENTED_HINTING
*
* @description:
* A constant used as the tag of an @FT_Parameter structure to indicate
* that unpatented methods only should be used by the TrueType bytecode
* interpreter for a typeface opened by @FT_Open_Face.
*
*/
#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
 
/* */
 
FT_END_HEADER
 
 
#endif /* __TTUNPAT_H__ */
 
 
/* END */
/contrib/media/updf/include/fstream
0,0 → 1,7
#ifndef _FSTREAM_INCLUDED
#define _FSTREAM_INCLUDED
#include <iostream>
/*namespace std
{
}*/
#endif
/contrib/media/updf/include/ft2build.h
0,0 → 1,39
/***************************************************************************/
/* */
/* ft2build.h */
/* */
/* FreeType 2 build and setup macros. */
/* (Generic version) */
/* */
/* Copyright 1996-2001, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
 
/*************************************************************************/
/* */
/* This file corresponds to the default `ft2build.h' file for */
/* FreeType 2. It uses the `freetype' include root. */
/* */
/* Note that specific platforms might use a different configuration. */
/* See builds/unix/ft2unix.h for an example. */
/* */
/*************************************************************************/
 
 
#ifndef __FT2_BUILD_GENERIC_H__
#define __FT2_BUILD_GENERIC_H__
 
#include "ftheader.h"
 
#endif /* __FT2_BUILD_GENERIC_H__ */
 
 
/* END */
/contrib/media/updf/include/ftheader.h
0,0 → 1,770
/***************************************************************************/
/* */
/* ftheader.h */
/* */
/* Build macros of the FreeType 2 library. */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
 
#define __FT_HEADER_H__
 
 
/*@***********************************************************************/
/* */
/* <Macro> */
/* FT_BEGIN_HEADER */
/* */
/* <Description> */
/* This macro is used in association with @FT_END_HEADER in header */
/* files to ensure that the declarations within are properly */
/* encapsulated in an `extern "C" { .. }' block when included from a */
/* C++ compiler. */
/* */
#ifdef __cplusplus
#define FT_BEGIN_HEADER extern "C" {
#else
#define FT_BEGIN_HEADER /* nothing */
#endif
 
 
/*@***********************************************************************/
/* */
/* <Macro> */
/* FT_END_HEADER */
/* */
/* <Description> */
/* This macro is used in association with @FT_BEGIN_HEADER in header */
/* files to ensure that the declarations within are properly */
/* encapsulated in an `extern "C" { .. }' block when included from a */
/* C++ compiler. */
/* */
#ifdef __cplusplus
#define FT_END_HEADER }
#else
#define FT_END_HEADER /* nothing */
#endif
 
 
/*************************************************************************/
/* */
/* Aliases for the FreeType 2 public and configuration files. */
/* */
/*************************************************************************/
 
/*************************************************************************/
/* */
/* <Section> */
/* header_file_macros */
/* */
/* <Title> */
/* Header File Macros */
/* */
/* <Abstract> */
/* Macro definitions used to #include specific header files. */
/* */
/* <Description> */
/* The following macros are defined to the name of specific */
/* FreeType~2 header files. They can be used directly in #include */
/* statements as in: */
/* */
/* { */
/* #include FT_FREETYPE_H */
/* #include FT_MULTIPLE_MASTERS_H */
/* #include FT_GLYPH_H */
/* } */
/* */
/* There are several reasons why we are now using macros to name */
/* public header files. The first one is that such macros are not */
/* limited to the infamous 8.3~naming rule required by DOS (and */
/* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
/* */
/* The second reason is that it allows for more flexibility in the */
/* way FreeType~2 is installed on a given system. */
/* */
/*************************************************************************/
 
 
/* configuration files */
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_CONFIG_H
*
* @description:
* A macro used in #include statements to name the file containing
* FreeType~2 configuration data.
*
*/
#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_STANDARD_LIBRARY_H
*
* @description:
* A macro used in #include statements to name the file containing
* FreeType~2 interface to the standard C library functions.
*
*/
#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_OPTIONS_H
*
* @description:
* A macro used in #include statements to name the file containing
* FreeType~2 project-specific configuration options.
*
*/
#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CONFIG_MODULES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list of FreeType~2 modules that are statically linked to new library
* instances in @FT_Init_FreeType.
*
*/
#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h>
 
/* */
 
/* public headers */
 
/*************************************************************************
*
* @macro:
* FT_FREETYPE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* base FreeType~2 API.
*
*/
#define FT_FREETYPE_H <freetype/freetype.h>
 
 
/*************************************************************************
*
* @macro:
* FT_ERRORS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list of FreeType~2 error codes (and messages).
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_ERRORS_H <freetype/fterrors.h>
 
 
/*************************************************************************
*
* @macro:
* FT_MODULE_ERRORS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list of FreeType~2 module error offsets (and messages).
*
*/
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SYSTEM_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 interface to low-level operations (i.e., memory management
* and stream i/o).
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_SYSTEM_H <freetype/ftsystem.h>
 
 
/*************************************************************************
*
* @macro:
* FT_IMAGE_H
*
* @description:
* A macro used in #include statements to name the file containing type
* definitions related to glyph images (i.e., bitmaps, outlines,
* scan-converter parameters).
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_IMAGE_H <freetype/ftimage.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TYPES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* basic data types defined by FreeType~2.
*
* It is included by @FT_FREETYPE_H.
*
*/
#define FT_TYPES_H <freetype/fttypes.h>
 
 
/*************************************************************************
*
* @macro:
* FT_LIST_H
*
* @description:
* A macro used in #include statements to name the file containing the
* list management API of FreeType~2.
*
* (Most applications will never need to include this file.)
*
*/
#define FT_LIST_H <freetype/ftlist.h>
 
 
/*************************************************************************
*
* @macro:
* FT_OUTLINE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* scalable outline management API of FreeType~2.
*
*/
#define FT_OUTLINE_H <freetype/ftoutln.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SIZES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API which manages multiple @FT_Size objects per face.
*
*/
#define FT_SIZES_H <freetype/ftsizes.h>
 
 
/*************************************************************************
*
* @macro:
* FT_MODULE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* module management API of FreeType~2.
*
*/
#define FT_MODULE_H <freetype/ftmodapi.h>
 
 
/*************************************************************************
*
* @macro:
* FT_RENDER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* renderer module management API of FreeType~2.
*
*/
#define FT_RENDER_H <freetype/ftrender.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TYPE1_TABLES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* types and API specific to the Type~1 format.
*
*/
#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRUETYPE_IDS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* enumeration values which identify name strings, languages, encodings,
* etc. This file really contains a _large_ set of constant macro
* definitions, taken from the TrueType and OpenType specifications.
*
*/
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRUETYPE_TABLES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* types and API specific to the TrueType (as well as OpenType) format.
*
*/
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRUETYPE_TAGS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of TrueType four-byte `tags' which identify blocks in
* SFNT-based font formats (i.e., TrueType and OpenType).
*
*/
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
 
 
/*************************************************************************
*
* @macro:
* FT_BDF_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which accesses BDF-specific strings from a
* face.
*
*/
#define FT_BDF_H <freetype/ftbdf.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CID_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which access CID font information from a
* face.
*
*/
#define FT_CID_H <freetype/ftcid.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GZIP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which supports gzip-compressed files.
*
*/
#define FT_GZIP_H <freetype/ftgzip.h>
 
 
/*************************************************************************
*
* @macro:
* FT_LZW_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which supports LZW-compressed files.
*
*/
#define FT_LZW_H <freetype/ftlzw.h>
 
 
/*************************************************************************
*
* @macro:
* FT_WINFONTS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which supports Windows FNT files.
*
*/
#define FT_WINFONTS_H <freetype/ftwinfnt.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GLYPH_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional glyph management component.
*
*/
#define FT_GLYPH_H <freetype/ftglyph.h>
 
 
/*************************************************************************
*
* @macro:
* FT_BITMAP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional bitmap conversion component.
*
*/
#define FT_BITMAP_H <freetype/ftbitmap.h>
 
 
/*************************************************************************
*
* @macro:
* FT_BBOX_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional exact bounding box computation routines.
*
*/
#define FT_BBOX_H <freetype/ftbbox.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* API of the optional FreeType~2 cache sub-system.
*
*/
#define FT_CACHE_H <freetype/ftcache.h>
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_IMAGE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `glyph image' API of the FreeType~2 cache sub-system.
*
* It is used to define a cache for @FT_Glyph elements. You can also
* use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to
* store small glyph bitmaps, as it will use less memory.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* glyph image-related cache declarations.
*
*/
#define FT_CACHE_IMAGE_H FT_CACHE_H
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_SMALL_BITMAPS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `small bitmaps' API of the FreeType~2 cache sub-system.
*
* It is used to define a cache for small glyph bitmaps in a relatively
* memory-efficient way. You can also use the API defined in
* @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,
* including scalable outlines.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* small bitmaps-related cache declarations.
*
*/
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
 
 
/*************************************************************************
*
* @macro:
* FT_CACHE_CHARMAP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `charmap' API of the FreeType~2 cache sub-system.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* charmap-based cache declarations.
*
*/
#define FT_CACHE_CHARMAP_H FT_CACHE_H
 
 
/*************************************************************************
*
* @macro:
* FT_MAC_H
*
* @description:
* A macro used in #include statements to name the file containing the
* Macintosh-specific FreeType~2 API. The latter is used to access
* fonts embedded in resource forks.
*
* This header file must be explicitly included by client applications
* compiled on the Mac (note that the base API still works though).
*
*/
#define FT_MAC_H <freetype/ftmac.h>
 
 
/*************************************************************************
*
* @macro:
* FT_MULTIPLE_MASTERS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional multiple-masters management API of FreeType~2.
*
*/
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SFNT_NAMES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which accesses embedded `name' strings in
* SFNT-based font formats (i.e., TrueType and OpenType).
*
*/
#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
 
 
/*************************************************************************
*
* @macro:
* FT_OPENTYPE_VALIDATE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which validates OpenType tables (BASE, GDEF,
* GPOS, GSUB, JSTF).
*
*/
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GX_VALIDATE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,
* mort, morx, bsln, just, kern, opbd, trak, prop).
*
*/
#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
 
 
/*************************************************************************
*
* @macro:
* FT_PFR_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which accesses PFR-specific data.
*
*/
#define FT_PFR_H <freetype/ftpfr.h>
 
 
/*************************************************************************
*
* @macro:
* FT_STROKER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which provides functions to stroke outline paths.
*/
#define FT_STROKER_H <freetype/ftstroke.h>
 
 
/*************************************************************************
*
* @macro:
* FT_SYNTHESIS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs artificial obliquing and emboldening.
*/
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
 
 
/*************************************************************************
*
* @macro:
* FT_XFREE86_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which provides functions specific to the XFree86 and
* X.Org X11 servers.
*/
#define FT_XFREE86_H <freetype/ftxf86.h>
 
 
/*************************************************************************
*
* @macro:
* FT_TRIGONOMETRY_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs trigonometric computations (e.g.,
* cosines and arc tangents).
*/
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
 
 
/*************************************************************************
*
* @macro:
* FT_LCD_FILTER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
 
 
/*************************************************************************
*
* @macro:
* FT_UNPATENTED_HINTING_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h>
 
 
/*************************************************************************
*
* @macro:
* FT_INCREMENTAL_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
 
 
/*************************************************************************
*
* @macro:
* FT_GASP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which returns entries from the TrueType GASP table.
*/
#define FT_GASP_H <freetype/ftgasp.h>
 
 
/*************************************************************************
*
* @macro:
* FT_ADVANCES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which returns individual and ranged glyph advances.
*/
#define FT_ADVANCES_H <freetype/ftadvanc.h>
 
 
/* */
 
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
 
 
/* The internals of the cache sub-system are no longer exposed. We */
/* default to FT_CACHE_H at the moment just in case, but we know of */
/* no rogue client that uses them. */
/* */
#define FT_CACHE_MANAGER_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h>
 
 
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
 
#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
 
 
/*
* Include internal headers definitions from <freetype/internal/...>
* only when building the library.
*/
#ifdef FT2_BUILD_LIBRARY
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
#include FT_INTERNAL_INTERNAL_H
#endif /* FT2_BUILD_LIBRARY */
 
 
 
 
/* END */
/contrib/media/updf/include/ftp_var.h
0,0 → 1,131
/*
* Copyright (c) 1985, 1989, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ftp_var.h 8.4 (Berkeley) 10/9/94
*/
 
/*
* FTP global variables.
*/
 
#include <sys/param.h>
#include <setjmp.h>
 
#include "extern.h"
 
#ifndef FTP_EXTERN
#define FTP_EXTERN extern
#endif
/*
* Options and other state info.
*/
FTP_EXTERN int trace; /* trace packets exchanged */
FTP_EXTERN int hash; /* print # for each buffer transferred */
FTP_EXTERN int hashbytes; /* number of bytes per # printed */
FTP_EXTERN int sendport; /* use PORT cmd for each data connection */
FTP_EXTERN int verbose; /* print messages coming back from server */
FTP_EXTERN int connected; /* connected to server */
FTP_EXTERN int fromatty; /* input is from a terminal */
FTP_EXTERN int interactive; /* interactively prompt on m* cmds */
FTP_EXTERN int debug; /* debugging level */
FTP_EXTERN int bell; /* ring bell on cmd completion */
FTP_EXTERN int doglob; /* glob local file names */
FTP_EXTERN int autologin; /* establish user account on connection */
FTP_EXTERN int proxy; /* proxy server connection active */
FTP_EXTERN int proxflag; /* proxy connection exists */
FTP_EXTERN int sunique; /* store files on server with unique name */
FTP_EXTERN int runique; /* store local files with unique name */
FTP_EXTERN int mcase; /* map upper to lower case for mget names */
FTP_EXTERN int ntflag; /* use ntin ntout tables for name translation */
FTP_EXTERN int mapflag; /* use mapin mapout templates on file names */
FTP_EXTERN int code; /* return/reply code for ftp command */
FTP_EXTERN int crflag; /* if 1, strip car. rets. on ascii gets */
FTP_EXTERN char pasv[64]; /* passive port for proxy data connection */
FTP_EXTERN int passivemode; /* passive mode enabled */
FTP_EXTERN char *altarg; /* argv[1] with no shell-like preprocessing */
FTP_EXTERN char ntin[17]; /* input translation table */
FTP_EXTERN char ntout[17]; /* output translation table */
extern char *mapin; /* input map template */
extern char *mapout; /* output map template */
FTP_EXTERN char typename[32]; /* name of file transfer type */
FTP_EXTERN int type; /* requested file transfer type */
FTP_EXTERN int curtype; /* current file transfer type */
FTP_EXTERN char structname[32]; /* name of file transfer structure */
FTP_EXTERN int stru; /* file transfer structure */
FTP_EXTERN char formname[32]; /* name of file transfer format */
FTP_EXTERN int form; /* file transfer format */
FTP_EXTERN char modename[32]; /* name of file transfer mode */
FTP_EXTERN int mode; /* file transfer mode */
FTP_EXTERN char bytename[32]; /* local byte size in ascii */
FTP_EXTERN int bytesize; /* local byte size in binary */
 
FTP_EXTERN char *hostname; /* name of host connected to */
FTP_EXTERN int unix_server; /* server is unix, can use binary for ascii */
FTP_EXTERN int unix_proxy; /* proxy is unix, can use binary for ascii */
 
FTP_EXTERN struct servent *sp; /* service spec for tcp/ftp */
 
FTP_EXTERN jmp_buf toplevel; /* non-local goto stuff for cmd scanner */
 
#if HAVE_LIBREADLINE
FTP_EXTERN char *line;
#else
FTP_EXTERN char line[200]; /* input line buffer */
#endif
 
FTP_EXTERN char *stringbase; /* current scan point in line buffer */
FTP_EXTERN char argbuf[200]; /* argument storage buffer */
FTP_EXTERN char *argbase; /* current storage point in arg buffer */
FTP_EXTERN int margc; /* count of arguments on input line */
FTP_EXTERN char *margv[20]; /* args parsed from input line */
FTP_EXTERN int cpend; /* flag: if != 0, then pending server reply */
FTP_EXTERN int mflag; /* flag: if != 0, then active multi command */
 
FTP_EXTERN int options; /* used during socket creation */
 
/*
* Format of command table.
*/
struct cmd {
char *c_name; /* name of command */
char *c_help; /* help string */
char c_bell; /* give bell when command completes */
char c_conn; /* must be connected to use command */
char c_proxy; /* proxy server may execute */
void (*c_handler) __P((int, char **)); /* function to call */
};
 
struct macel {
char mac_name[9]; /* macro name */
char *mac_start; /* start of macro in macbuf */
char *mac_end; /* end of macro in macbuf */
};
 
FTP_EXTERN int macnum; /* number of defined macros */
FTP_EXTERN struct macel macros[16];
FTP_EXTERN char macbuf[4096];
/contrib/media/updf/include/ftw.h
0,0 → 1,38
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_ftw_h_
#define __dj_include_ftw_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#define FTW_F 1
#define FTW_D 2
#define FTW_NS 3
#define FTW_DNR 4
#define FTW_VL 5
 
#include <sys/stat.h>
 
int ftw(const char *_dir,
int (*_fn)(const char *_file, struct stat *_sb, int _flag),
int _depth);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_ftw_h_ */
/contrib/media/updf/include/functional
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_FUNCTIONAL
#include <bits/std_functional.h>
#endif
/contrib/media/updf/include/general.h
0,0 → 1,41
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)general.h 8.1 (Berkeley) 6/6/93
*/
 
/*
* Some general definitions.
*/
 
 
#define numberof(x) (sizeof x/sizeof x[0])
#define highestof(x) (numberof(x)-1)
 
#define ClearElement(x) memset((char *)&x, 0, sizeof x)
#define ClearArray(x) memset((char *)x, 0, sizeof x)
/contrib/media/updf/include/genericobject.h
0,0 → 1,44
 
 
#ifndef __genericobject_h__
#define __genericobject_h__
 
#include "yacasbase.h"
 
/// Not used.
/// This class has pure virtual functions, but no derived classes, so
/// it can never be used.
class LispArgList : public YacasBase
{
public:
virtual ~LispArgList();
virtual LispInt NrArguments()=0;
virtual LispChar * GetArgument(LispInt aIndex, LispInt& aLength)=0;
virtual LispBoolean Compare(LispInt aIndex, LispChar * aString)=0;
};
 
/// Abstract class which can be put inside a LispGenericClass.
class GenericClass : public YacasBase
{
public:
GenericClass() : iReferenceCount(0) {};
virtual ~GenericClass();
virtual LispChar * Send(LispArgList& aArgList)=0;
virtual LispChar * TypeName()=0;
public:
LispInt iReferenceCount; //TODO: perhaps share the method of reference counting with how it is done in other places
};
 
 
/* Definition of DYNCAST: either the cast succeeds, or the variable is assigned NULL.
*/
 
#define DYNCAST(_type,_name,_var,_object) \
_type * _var = NULL ; \
if (_object != NULL) \
{ \
if (StrEqual((_object)->TypeName(),_name)) _var = (_type *)(_object); \
}
 
#endif
 
/contrib/media/updf/include/genericstructs.h
0,0 → 1,49
/** \file genericstructs.h defines the class that handles structs and classes for plugins.
*/
#ifndef __genericstruct_h__
#define __genericstruct_h__
 
#include "yacasbase.h"
#include "genericobject.h"
#include "lispassert.h"
 
/** \class GenericStruct This class maintains a pointer to some arbitrary
* object (which can be any thing). The plugin is responsible for supplying
* functions for manipulating such structs/classes/arrays. The Yacas core
* then needs to know nothing about the internals of such a struct.
*
* The struct is represented by a void pointer to the struct, a pointer
* to a function that can clean up the struct (used when automatically
* deleting the object), and a pointer to a text string representing the
* type of the object (useful for testing if the type passed as an argument
* to a function is correct).
*/
class GenericStruct : public GenericClass
{
public:
GenericStruct(LispChar * aTypeName, void* aData, void (*aDestructor)(void*));
virtual ~GenericStruct();
virtual LispChar * Send(LispArgList& aArgList);
virtual LispChar * TypeName();
inline void* Data() {return iData;}
private:
GenericStruct(const GenericStruct& aOther) : iData(NULL),iTypeName(NULL),iDestructor(NULL)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
GenericStruct& operator=(const GenericStruct& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
public:
void* iData;
LispChar * iTypeName;
void (*iDestructor)(void* data);
};
 
 
#endif
 
/contrib/media/updf/include/getpages.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_getpagesize_h_
#define __dj_include_getpagesize_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <unistd.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_getpagesize_h_ */
/contrib/media/updf/include/glib/glib.h
0,0 → 1,2827
/* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
 
/*
* Modified by the GLib Team and others 1997-1999. 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__
 
/* system specific config file glibconfig.h provides definitions for
* the extrema of many of the standard types. These are:
*
* G_MINSHORT, G_MAXSHORT
* G_MININT, G_MAXINT
* G_MINLONG, G_MAXLONG
* G_MINFLOAT, G_MAXFLOAT
* G_MINDOUBLE, G_MAXDOUBLE
*
* It also provides the following typedefs:
*
* gint8, guint8
* gint16, guint16
* gint32, guint32
* gint64, guint64
*
* It defines the G_BYTE_ORDER symbol to one of G_*_ENDIAN (see later in
* this file).
*
* And it provides a way to store and retrieve a `gint' in/from a `gpointer'.
* This is useful to pass an integer instead of a pointer to a callback.
*
* GINT_TO_POINTER(i), GUINT_TO_POINTER(i)
* GPOINTER_TO_INT(p), GPOINTER_TO_UINT(p)
*
* Finally, it provide the following wrappers to STDC functions:
*
* g_ATEXIT
* To register hooks which are executed on exit().
* Usually a wrapper for STDC atexit.
*
* void *g_memmove(void *dest, const void *src, guint count);
* A wrapper for STDC memmove, or an implementation, if memmove doesn't
* exist. The prototype looks like the above, give or take a const,
* or size_t.
*/
#include <glibconfig.h>
 
/* include varargs functions for assertment macros
*/
#include <stdarg.h>
 
/* optionally feature DMALLOC memory allocation debugger
*/
#ifdef USE_DMALLOC
#include "dmalloc.h"
#endif
 
 
#ifdef NATIVE_WIN32
 
/* On native Win32, directory separator is the backslash, and search path
* separator is the semicolon.
*/
#define G_DIR_SEPARATOR '\\'
#define G_DIR_SEPARATOR_S "\\"
#define G_SEARCHPATH_SEPARATOR ';'
#define G_SEARCHPATH_SEPARATOR_S ";"
 
#else /* !NATIVE_WIN32 */
 
#ifndef __EMX__
/* Unix */
 
#define G_DIR_SEPARATOR '/'
#define G_DIR_SEPARATOR_S "/"
#define G_SEARCHPATH_SEPARATOR ':'
#define G_SEARCHPATH_SEPARATOR_S ":"
 
#else
/* EMX/OS2 */
 
#define G_DIR_SEPARATOR '/'
#define G_DIR_SEPARATOR_S "/"
#define G_SEARCHPATH_SEPARATOR ';'
#define G_SEARCHPATH_SEPARATOR_S ";"
 
#endif
 
#endif /* !NATIVE_WIN32 */
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
 
/* Provide definitions for some commonly used macros.
* Some of them 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 NULL
#define NULL ((void*) 0)
#endif
 
#ifndef FALSE
#define FALSE (0)
#endif
 
#ifndef TRUE
#define TRUE (!FALSE)
#endif
 
#undef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
 
#undef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
 
#undef ABS
#define ABS(a) (((a) < 0) ? -(a) : (a))
 
#undef CLAMP
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
 
 
/* Define G_VA_COPY() to do the right thing for copying va_list variables.
* glibconfig.h may have already defined G_VA_COPY as va_copy or __va_copy.
*/
#if !defined (G_VA_COPY)
# if defined (__GNUC__) && defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
# define G_VA_COPY(ap1, ap2) (*(ap1) = *(ap2))
# elif defined (G_VA_COPY_AS_ARRAY)
# define G_VA_COPY(ap1, ap2) g_memmove ((ap1), (ap2), sizeof (va_list))
# else /* va_list is a pointer */
# define G_VA_COPY(ap1, ap2) ((ap1) = (ap2))
# endif /* va_list is a pointer */
#endif /* !G_VA_COPY */
 
 
/* Provide convenience macros for handling structure
* fields through their offsets.
*/
#define G_STRUCT_OFFSET(struct_type, member) \
((gulong) ((gchar*) &((struct_type*) 0)->member))
#define G_STRUCT_MEMBER_P(struct_p, struct_offset) \
((gpointer) ((gchar*) (struct_p) + (gulong) (struct_offset)))
#define G_STRUCT_MEMBER(member_type, struct_p, struct_offset) \
(*(member_type*) G_STRUCT_MEMBER_P ((struct_p), (struct_offset)))
 
 
/* inlining hassle. for compilers that don't allow the `inline' keyword,
* mostly because of strict ANSI C compliance or dumbness, we try to fall
* back to either `__inline__' or `__inline'.
* we define G_CAN_INLINE, if the compiler seems to be actually
* *capable* to do function inlining, in which case inline function bodys
* do make sense. we also define G_INLINE_FUNC to properly export the
* function prototypes if no inlining can be performed.
* we special case most of the stuff, so inline functions can have a normal
* implementation by defining G_INLINE_FUNC to extern and G_CAN_INLINE to 1.
*/
#ifndef G_INLINE_FUNC
# define G_CAN_INLINE 1
#endif
#ifdef G_HAVE_INLINE
# if defined (__GNUC__) && defined (__STRICT_ANSI__)
# undef inline
# define inline __inline__
# endif
#else /* !G_HAVE_INLINE */
# undef inline
# if defined (G_HAVE___INLINE__)
# define inline __inline__
# else /* !inline && !__inline__ */
# if defined (G_HAVE___INLINE)
# define inline __inline
# else /* !inline && !__inline__ && !__inline */
# define inline /* don't inline, then */
# ifndef G_INLINE_FUNC
# undef G_CAN_INLINE
# endif
# endif
# endif
#endif
#ifndef G_INLINE_FUNC
# ifdef __GNUC__
# ifdef __OPTIMIZE__
# define G_INLINE_FUNC extern inline
# else
# undef G_CAN_INLINE
# define G_INLINE_FUNC extern
# endif
# else /* !__GNUC__ */
# ifdef G_CAN_INLINE
# define G_INLINE_FUNC static inline
# else
# define G_INLINE_FUNC extern
# endif
# endif /* !__GNUC__ */
#endif /* !G_INLINE_FUNC */
 
 
/* Provide simple macro statement wrappers (adapted from Perl):
* G_STMT_START { statements; } G_STMT_END;
* can be used as a single statement, as in
* if (x) G_STMT_START { ... } G_STMT_END; else ...
*
* For gcc we will wrap the statements within `({' and `})' braces.
* For SunOS they will be wrapped within `if (1)' and `else (void) 0',
* and otherwise within `do' and `while (0)'.
*/
#if !(defined (G_STMT_START) && defined (G_STMT_END))
# if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus)
# define G_STMT_START (void)(
# define G_STMT_END )
# else
# if (defined (sun) || defined (__sun__))
# define G_STMT_START if (1)
# define G_STMT_END else (void)0
# else
# define G_STMT_START do
# define G_STMT_END while (0)
# endif
# endif
#endif
 
 
/* Provide macros to feature the GCC function attribute.
*/
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define G_GNUC_PRINTF( format_idx, arg_idx ) \
__attribute__((format (printf, format_idx, arg_idx)))
#define G_GNUC_SCANF( format_idx, arg_idx ) \
__attribute__((format (scanf, format_idx, arg_idx)))
#define G_GNUC_FORMAT( arg_idx ) \
__attribute__((format_arg (arg_idx)))
#define G_GNUC_NORETURN \
__attribute__((noreturn))
#define G_GNUC_CONST \
__attribute__((const))
#define G_GNUC_UNUSED \
__attribute__((unused))
#else /* !__GNUC__ */
#define G_GNUC_PRINTF( format_idx, arg_idx )
#define G_GNUC_SCANF( format_idx, arg_idx )
#define G_GNUC_FORMAT( arg_idx )
#define G_GNUC_NORETURN
#define G_GNUC_CONST
#define G_GNUC_UNUSED
#endif /* !__GNUC__ */
 
 
/* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
* macros, so we can refer to them as strings unconditionally.
*/
#ifdef __GNUC__
#define G_GNUC_FUNCTION __FUNCTION__
#define G_GNUC_PRETTY_FUNCTION __PRETTY_FUNCTION__
#else /* !__GNUC__ */
#define G_GNUC_FUNCTION ""
#define G_GNUC_PRETTY_FUNCTION ""
#endif /* !__GNUC__ */
 
/* we try to provide a usefull equivalent for ATEXIT if it is
* not defined, but use is actually abandoned. people should
* use g_atexit() instead.
*/
#ifndef ATEXIT
# define ATEXIT(proc) g_ATEXIT(proc)
#else
# define G_NATIVE_ATEXIT
#endif /* ATEXIT */
 
/* Hacker macro to place breakpoints for elected machines.
* Actual use is strongly deprecated of course ;)
*/
#if defined (__i386__) && defined (__GNUC__) && __GNUC__ >= 2
#define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END
#elif defined (__alpha__) && defined (__GNUC__) && __GNUC__ >= 2
#define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END
#else /* !__i386__ && !__alpha__ */
#define G_BREAKPOINT()
#endif /* __i386__ */
 
 
/* 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))
# define g_renew(type, mem, count) (REALLOC (mem, 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)))
# define g_renew(type, mem, count) \
((type *) g_realloc (mem, (unsigned) sizeof (type) * (count)))
#endif /* __DMALLOC_H__ */
 
#define g_mem_chunk_create(type, pre_alloc, alloc_type) ( \
g_mem_chunk_new (#type " mem chunks (" #pre_alloc ")", \
sizeof (type), \
sizeof (type) * (pre_alloc), \
(alloc_type)) \
)
#define g_chunk_new(type, chunk) ( \
(type *) g_mem_chunk_alloc (chunk) \
)
#define g_chunk_new0(type, chunk) ( \
(type *) g_mem_chunk_alloc0 (chunk) \
)
#define g_chunk_free(mem, mem_chunk) G_STMT_START { \
g_mem_chunk_free ((mem_chunk), (mem)); \
} G_STMT_END
 
 
#define g_string(x) #x
 
 
/* Provide macros for error handling. The "assert" macros will
* exit on failure. The "return" macros will exit the current
* function. Two different definitions are given for the macros
* if G_DISABLE_ASSERT is not defined, in order to support gcc's
* __PRETTY_FUNCTION__ capability.
*/
 
#ifdef G_DISABLE_ASSERT
 
#define g_assert(expr)
#define g_assert_not_reached()
 
#else /* !G_DISABLE_ASSERT */
 
#ifdef __GNUC__
 
#define g_assert(expr) G_STMT_START{ \
if (!(expr)) \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \
"file %s: line %d (%s): assertion failed: (%s)", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); }G_STMT_END
 
#define g_assert_not_reached() G_STMT_START{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \
"file %s: line %d (%s): should not be reached", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__); }G_STMT_END
 
#else /* !__GNUC__ */
 
#define g_assert(expr) G_STMT_START{ \
if (!(expr)) \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \
"file %s: line %d: assertion failed: (%s)", \
__FILE__, \
__LINE__, \
#expr); }G_STMT_END
 
#define g_assert_not_reached() G_STMT_START{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \
"file %s: line %d: should not be reached", \
__FILE__, \
__LINE__); }G_STMT_END
 
#endif /* __GNUC__ */
 
#endif /* !G_DISABLE_ASSERT */
 
 
#ifdef G_DISABLE_CHECKS
 
#define g_return_if_fail(expr)
#define g_return_val_if_fail(expr,val)
 
#else /* !G_DISABLE_CHECKS */
 
#ifdef __GNUC__
 
#define g_return_if_fail(expr) G_STMT_START{ \
if (!(expr)) \
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed.", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
return; \
}; }G_STMT_END
 
#define g_return_val_if_fail(expr,val) G_STMT_START{ \
if (!(expr)) \
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed.", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
return val; \
}; }G_STMT_END
 
#else /* !__GNUC__ */
 
#define g_return_if_fail(expr) G_STMT_START{ \
if (!(expr)) \
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: assertion `%s' failed.", \
__FILE__, \
__LINE__, \
#expr); \
return; \
}; }G_STMT_END
 
#define g_return_val_if_fail(expr, val) G_STMT_START{ \
if (!(expr)) \
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: assertion `%s' failed.", \
__FILE__, \
__LINE__, \
#expr); \
return val; \
}; }G_STMT_END
 
#endif /* !__GNUC__ */
 
#endif /* !G_DISABLE_CHECKS */
 
 
/* 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 gint 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;
typedef const void *gconstpointer;
 
 
typedef gint32 gssize;
typedef guint32 gsize;
typedef guint32 GQuark;
typedef gint32 GTime;
 
 
/* Portable endian checks and conversions
*
* glibconfig.h defines G_BYTE_ORDER which expands to one of
* the below macros.
*/
#define G_LITTLE_ENDIAN 1234
#define G_BIG_ENDIAN 4321
#define G_PDP_ENDIAN 3412 /* unused, need specific PDP check */
 
 
/* Basic bit swapping functions
*/
#define GUINT16_SWAP_LE_BE_CONSTANT(val) ((guint16) ( \
(((guint16) (val) & (guint16) 0x00ffU) << 8) | \
(((guint16) (val) & (guint16) 0xff00U) >> 8)))
#define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \
(((guint32) (val) & (guint32) 0x000000ffU) << 24) | \
(((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \
(((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \
(((guint32) (val) & (guint32) 0xff000000U) >> 24)))
 
/* Intel specific stuff for speed
*/
#if defined (__i386__) && defined (__GNUC__) && __GNUC__ >= 2
# define GUINT16_SWAP_LE_BE_X86(val) \
(__extension__ \
({ register guint16 __v; \
if (__builtin_constant_p (val)) \
__v = GUINT16_SWAP_LE_BE_CONSTANT (val); \
else \
__asm__ __const__ ("rorw $8, %w0" \
: "=r" (__v) \
: "0" ((guint16) (val))); \
__v; }))
# define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_X86 (val))
# if !defined(__i486__) && !defined(__i586__) \
&& !defined(__pentium__) && !defined(__i686__) && !defined(__pentiumpro__)
# define GUINT32_SWAP_LE_BE_X86(val) \
(__extension__ \
({ register guint32 __v; \
if (__builtin_constant_p (val)) \
__v = GUINT32_SWAP_LE_BE_CONSTANT (val); \
else \
__asm__ __const__ ("rorw $8, %w0\n\t" \
"rorl $16, %0\n\t" \
"rorw $8, %w0" \
: "=r" (__v) \
: "0" ((guint32) (val))); \
__v; }))
# else /* 486 and higher has bswap */
# define GUINT32_SWAP_LE_BE_X86(val) \
(__extension__ \
({ register guint32 __v; \
if (__builtin_constant_p (val)) \
__v = GUINT32_SWAP_LE_BE_CONSTANT (val); \
else \
__asm__ __const__ ("bswap %0" \
: "=r" (__v) \
: "0" ((guint32) (val))); \
__v; }))
# endif /* processor specific 32-bit stuff */
# define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_X86 (val))
#else /* !__i386__ */
# define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_CONSTANT (val))
# define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_CONSTANT (val))
#endif /* __i386__ */
 
#ifdef G_HAVE_GINT64
# define GUINT64_SWAP_LE_BE_CONSTANT(val) ((guint64) ( \
(((guint64) (val) & \
(guint64) G_GINT64_CONSTANT(0x00000000000000ffU)) << 56) | \
(((guint64) (val) & \
(guint64) G_GINT64_CONSTANT(0x000000000000ff00U)) << 40) | \
(((guint64) (val) & \
(guint64) G_GINT64_CONSTANT(0x0000000000ff0000U)) << 24) | \
(((guint64) (val) & \
(guint64) G_GINT64_CONSTANT(0x00000000ff000000U)) << 8) | \
(((guint64) (val) & \
(guint64) G_GINT64_CONSTANT(0x000000ff00000000U)) >> 8) | \
(((guint64) (val) & \
(guint64) G_GINT64_CONSTANT(0x0000ff0000000000U)) >> 24) | \
(((guint64) (val) & \
(guint64) G_GINT64_CONSTANT(0x00ff000000000000U)) >> 40) | \
(((guint64) (val) & \
(guint64) G_GINT64_CONSTANT(0xff00000000000000U)) >> 56)))
# if defined (__i386__) && defined (__GNUC__) && __GNUC__ >= 2
# define GUINT64_SWAP_LE_BE_X86(val) \
(__extension__ \
({ union { guint64 __ll; \
guint32 __l[2]; } __r; \
if (__builtin_constant_p (val)) \
__r.__ll = GUINT64_SWAP_LE_BE_CONSTANT (val); \
else \
{ \
union { guint64 __ll; \
guint32 __l[2]; } __w; \
__w.__ll = ((guint64) val); \
__r.__l[0] = GUINT32_SWAP_LE_BE (__w.__l[1]); \
__r.__l[1] = GUINT32_SWAP_LE_BE (__w.__l[0]); \
} \
__r.__ll; }))
# define GUINT64_SWAP_LE_BE(val) (GUINT64_SWAP_LE_BE_X86 (val))
# else /* !__i386__ */
# define GUINT64_SWAP_LE_BE(val) (GUINT64_SWAP_LE_BE_CONSTANT(val))
# endif
#endif
 
#define GUINT16_SWAP_LE_PDP(val) ((guint16) (val))
#define GUINT16_SWAP_BE_PDP(val) (GUINT16_SWAP_LE_BE (val))
#define GUINT32_SWAP_LE_PDP(val) ((guint32) ( \
(((guint32) (val) & (guint32) 0x0000ffffU) << 16) | \
(((guint32) (val) & (guint32) 0xffff0000U) >> 16)))
#define GUINT32_SWAP_BE_PDP(val) ((guint32) ( \
(((guint32) (val) & (guint32) 0x00ff00ffU) << 8) | \
(((guint32) (val) & (guint32) 0xff00ff00U) >> 8)))
 
/* The G*_TO_?E() macros are defined in glibconfig.h.
* The transformation is symmetric, so the FROM just maps to the TO.
*/
#define GINT16_FROM_LE(val) (GINT16_TO_LE (val))
#define GUINT16_FROM_LE(val) (GUINT16_TO_LE (val))
#define GINT16_FROM_BE(val) (GINT16_TO_BE (val))
#define GUINT16_FROM_BE(val) (GUINT16_TO_BE (val))
#define GINT32_FROM_LE(val) (GINT32_TO_LE (val))
#define GUINT32_FROM_LE(val) (GUINT32_TO_LE (val))
#define GINT32_FROM_BE(val) (GINT32_TO_BE (val))
#define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val))
 
#ifdef G_HAVE_GINT64
#define GINT64_FROM_LE(val) (GINT64_TO_LE (val))
#define GUINT64_FROM_LE(val) (GUINT64_TO_LE (val))
#define GINT64_FROM_BE(val) (GINT64_TO_BE (val))
#define GUINT64_FROM_BE(val) (GUINT64_TO_BE (val))
#endif
 
#define GLONG_FROM_LE(val) (GLONG_TO_LE (val))
#define GULONG_FROM_LE(val) (GULONG_TO_LE (val))
#define GLONG_FROM_BE(val) (GLONG_TO_BE (val))
#define GULONG_FROM_BE(val) (GULONG_TO_BE (val))
 
#define GINT_FROM_LE(val) (GINT_TO_LE (val))
#define GUINT_FROM_LE(val) (GUINT_TO_LE (val))
#define GINT_FROM_BE(val) (GINT_TO_BE (val))
#define GUINT_FROM_BE(val) (GUINT_TO_BE (val))
 
 
/* Portable versions of host-network order stuff
*/
#define g_ntohl(val) (GUINT32_FROM_BE (val))
#define g_ntohs(val) (GUINT16_FROM_BE (val))
#define g_htonl(val) (GUINT32_TO_BE (val))
#define g_htons(val) (GUINT16_TO_BE (val))
 
 
/* Glib version.
* we prefix variable declarations so they can
* properly get exported in windows dlls.
*/
#ifdef NATIVE_WIN32
# ifdef GLIB_COMPILATION
# define GUTILS_C_VAR __declspec(dllexport)
# else /* !GLIB_COMPILATION */
# define GUTILS_C_VAR extern __declspec(dllimport)
# endif /* !GLIB_COMPILATION */
#else /* !NATIVE_WIN32 */
# define GUTILS_C_VAR extern
#endif /* !NATIVE_WIN32 */
 
GUTILS_C_VAR const guint glib_major_version;
GUTILS_C_VAR const guint glib_minor_version;
GUTILS_C_VAR const guint glib_micro_version;
GUTILS_C_VAR const guint glib_interface_age;
GUTILS_C_VAR const guint glib_binary_age;
 
#define GLIB_CHECK_VERSION(major,minor,micro) \
(GLIB_MAJOR_VERSION > (major) || \
(GLIB_MAJOR_VERSION == (major) && GLIB_MINOR_VERSION > (minor)) || \
(GLIB_MAJOR_VERSION == (major) && GLIB_MINOR_VERSION == (minor) && \
GLIB_MICRO_VERSION >= (micro)))
 
/* Forward declarations of glib types.
*/
typedef struct _GAllocator GAllocator;
typedef struct _GArray GArray;
typedef struct _GByteArray GByteArray;
typedef struct _GCache GCache;
typedef struct _GCompletion GCompletion;
typedef struct _GData GData;
typedef struct _GDebugKey GDebugKey;
typedef struct _GHashTable GHashTable;
typedef struct _GHook GHook;
typedef struct _GHookList GHookList;
typedef struct _GList GList;
typedef struct _GMemChunk GMemChunk;
typedef struct _GNode GNode;
typedef struct _GPtrArray GPtrArray;
typedef struct _GRelation GRelation;
typedef struct _GScanner GScanner;
typedef struct _GScannerConfig GScannerConfig;
typedef struct _GSList GSList;
typedef struct _GString GString;
typedef struct _GStringChunk GStringChunk;
typedef struct _GTimer GTimer;
typedef struct _GTree GTree;
typedef struct _GTuples GTuples;
typedef union _GTokenValue GTokenValue;
typedef struct _GIOChannel GIOChannel;
 
/* Tree traverse flags */
typedef enum
{
G_TRAVERSE_LEAFS = 1 << 0,
G_TRAVERSE_NON_LEAFS = 1 << 1,
G_TRAVERSE_ALL = G_TRAVERSE_LEAFS | G_TRAVERSE_NON_LEAFS,
G_TRAVERSE_MASK = 0x03
} GTraverseFlags;
 
/* Tree traverse orders */
typedef enum
{
G_IN_ORDER,
G_PRE_ORDER,
G_POST_ORDER,
G_LEVEL_ORDER
} GTraverseType;
 
/* Log level shift offset for user defined
* log levels (0-7 are used by GLib).
*/
#define G_LOG_LEVEL_USER_SHIFT (8)
 
/* Glib log levels and flags.
*/
typedef enum
{
/* log flags */
G_LOG_FLAG_RECURSION = 1 << 0,
G_LOG_FLAG_FATAL = 1 << 1,
/* GLib log levels */
G_LOG_LEVEL_ERROR = 1 << 2, /* always fatal */
G_LOG_LEVEL_CRITICAL = 1 << 3,
G_LOG_LEVEL_WARNING = 1 << 4,
G_LOG_LEVEL_MESSAGE = 1 << 5,
G_LOG_LEVEL_INFO = 1 << 6,
G_LOG_LEVEL_DEBUG = 1 << 7,
G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL)
} GLogLevelFlags;
 
/* GLib log levels that are considered fatal by default */
#define G_LOG_FATAL_MASK (G_LOG_FLAG_RECURSION | G_LOG_LEVEL_ERROR)
 
 
typedef gpointer (*GCacheNewFunc) (gpointer key);
typedef gpointer (*GCacheDupFunc) (gpointer value);
typedef void (*GCacheDestroyFunc) (gpointer value);
typedef gint (*GCompareFunc) (gconstpointer a,
gconstpointer b);
typedef gchar* (*GCompletionFunc) (gpointer);
typedef void (*GDestroyNotify) (gpointer data);
typedef void (*GDataForeachFunc) (GQuark key_id,
gpointer data,
gpointer user_data);
typedef void (*GFunc) (gpointer data,
gpointer user_data);
typedef guint (*GHashFunc) (gconstpointer key);
typedef void (*GFreeFunc) (gpointer data);
typedef void (*GHFunc) (gpointer key,
gpointer value,
gpointer user_data);
typedef gboolean (*GHRFunc) (gpointer key,
gpointer value,
gpointer user_data);
typedef gint (*GHookCompareFunc) (GHook *new_hook,
GHook *sibling);
typedef gboolean (*GHookFindFunc) (GHook *hook,
gpointer data);
typedef void (*GHookMarshaller) (GHook *hook,
gpointer data);
typedef gboolean (*GHookCheckMarshaller) (GHook *hook,
gpointer data);
typedef void (*GHookFunc) (gpointer data);
typedef gboolean (*GHookCheckFunc) (gpointer data);
typedef void (*GHookFreeFunc) (GHookList *hook_list,
GHook *hook);
typedef void (*GLogFunc) (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,
gpointer user_data);
typedef gboolean (*GNodeTraverseFunc) (GNode *node,
gpointer data);
typedef void (*GNodeForeachFunc) (GNode *node,
gpointer data);
typedef gint (*GSearchFunc) (gpointer key,
gpointer data);
typedef void (*GScannerMsgFunc) (GScanner *scanner,
gchar *message,
gint error);
typedef gint (*GTraverseFunc) (gpointer key,
gpointer value,
gpointer data);
typedef void (*GVoidFunc) (void);
 
 
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 _GByteArray
{
guint8 *data;
guint len;
};
 
struct _GPtrArray
{
gpointer *pdata;
guint len;
};
 
struct _GTuples
{
guint len;
};
 
struct _GDebugKey
{
gchar *key;
guint value;
};
 
 
/* Doubly linked lists
*/
void g_list_push_allocator (GAllocator *allocator);
void g_list_pop_allocator (void);
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_insert_sorted (GList *list,
gpointer data,
GCompareFunc func);
GList* g_list_concat (GList *list1,
GList *list2);
GList* g_list_remove (GList *list,
gpointer data);
GList* g_list_remove_link (GList *list,
GList *llink);
GList* g_list_reverse (GList *list);
GList* g_list_copy (GList *list);
GList* g_list_nth (GList *list,
guint n);
GList* g_list_find (GList *list,
gpointer data);
GList* g_list_find_custom (GList *list,
gpointer data,
GCompareFunc func);
gint g_list_position (GList *list,
GList *llink);
gint g_list_index (GList *list,
gpointer data);
GList* g_list_last (GList *list);
GList* g_list_first (GList *list);
guint g_list_length (GList *list);
void g_list_foreach (GList *list,
GFunc func,
gpointer user_data);
GList* g_list_sort (GList *list,
GCompareFunc compare_func);
gpointer g_list_nth_data (GList *list,
guint n);
#define g_list_previous(list) ((list) ? (((GList *)(list))->prev) : NULL)
#define g_list_next(list) ((list) ? (((GList *)(list))->next) : NULL)
 
 
/* Singly linked lists
*/
void g_slist_push_allocator (GAllocator *allocator);
void g_slist_pop_allocator (void);
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_insert_sorted (GSList *list,
gpointer data,
GCompareFunc func);
GSList* g_slist_concat (GSList *list1,
GSList *list2);
GSList* g_slist_remove (GSList *list,
gpointer data);
GSList* g_slist_remove_link (GSList *list,
GSList *llink);
GSList* g_slist_reverse (GSList *list);
GSList* g_slist_copy (GSList *list);
GSList* g_slist_nth (GSList *list,
guint n);
GSList* g_slist_find (GSList *list,
gpointer data);
GSList* g_slist_find_custom (GSList *list,
gpointer data,
GCompareFunc func);
gint g_slist_position (GSList *list,
GSList *llink);
gint g_slist_index (GSList *list,
gpointer data);
GSList* g_slist_last (GSList *list);
guint g_slist_length (GSList *list);
void g_slist_foreach (GSList *list,
GFunc func,
gpointer user_data);
GSList* g_slist_sort (GSList *list,
GCompareFunc compare_func);
gpointer g_slist_nth_data (GSList *list,
guint n);
#define g_slist_next(slist) ((slist) ? (((GSList *)(slist))->next) : NULL)
 
 
/* 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,
gconstpointer key);
gpointer g_hash_table_lookup (GHashTable *hash_table,
gconstpointer key);
gboolean g_hash_table_lookup_extended(GHashTable *hash_table,
gconstpointer lookup_key,
gpointer *orig_key,
gpointer *value);
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);
guint g_hash_table_foreach_remove (GHashTable *hash_table,
GHRFunc func,
gpointer user_data);
guint g_hash_table_size (GHashTable *hash_table);
 
 
/* 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);
 
 
/* Balanced binary 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);
 
 
 
/* N-way tree implementation
*/
struct _GNode
{
gpointer data;
GNode *next;
GNode *prev;
GNode *parent;
GNode *children;
};
 
#define G_NODE_IS_ROOT(node) (((GNode*) (node))->parent == NULL && \
((GNode*) (node))->prev == NULL && \
((GNode*) (node))->next == NULL)
#define G_NODE_IS_LEAF(node) (((GNode*) (node))->children == NULL)
 
void g_node_push_allocator (GAllocator *allocator);
void g_node_pop_allocator (void);
GNode* g_node_new (gpointer data);
void g_node_destroy (GNode *root);
void g_node_unlink (GNode *node);
GNode* g_node_insert (GNode *parent,
gint position,
GNode *node);
GNode* g_node_insert_before (GNode *parent,
GNode *sibling,
GNode *node);
GNode* g_node_prepend (GNode *parent,
GNode *node);
guint g_node_n_nodes (GNode *root,
GTraverseFlags flags);
GNode* g_node_get_root (GNode *node);
gboolean g_node_is_ancestor (GNode *node,
GNode *descendant);
guint g_node_depth (GNode *node);
GNode* g_node_find (GNode *root,
GTraverseType order,
GTraverseFlags flags,
gpointer data);
 
/* convenience macros */
#define g_node_append(parent, node) \
g_node_insert_before ((parent), NULL, (node))
#define g_node_insert_data(parent, position, data) \
g_node_insert ((parent), (position), g_node_new (data))
#define g_node_insert_data_before(parent, sibling, data) \
g_node_insert_before ((parent), (sibling), g_node_new (data))
#define g_node_prepend_data(parent, data) \
g_node_prepend ((parent), g_node_new (data))
#define g_node_append_data(parent, data) \
g_node_insert_before ((parent), NULL, g_node_new (data))
 
/* traversal function, assumes that `node' is root
* (only traverses `node' and its subtree).
* this function is just a high level interface to
* low level traversal functions, optimized for speed.
*/
void g_node_traverse (GNode *root,
GTraverseType order,
GTraverseFlags flags,
gint max_depth,
GNodeTraverseFunc func,
gpointer data);
 
/* return the maximum tree height starting with `node', this is an expensive
* operation, since we need to visit all nodes. this could be shortened by
* adding `guint height' to struct _GNode, but then again, this is not very
* often needed, and would make g_node_insert() more time consuming.
*/
guint g_node_max_height (GNode *root);
 
void g_node_children_foreach (GNode *node,
GTraverseFlags flags,
GNodeForeachFunc func,
gpointer data);
void g_node_reverse_children (GNode *node);
guint g_node_n_children (GNode *node);
GNode* g_node_nth_child (GNode *node,
guint n);
GNode* g_node_last_child (GNode *node);
GNode* g_node_find_child (GNode *node,
GTraverseFlags flags,
gpointer data);
gint g_node_child_position (GNode *node,
GNode *child);
gint g_node_child_index (GNode *node,
gpointer data);
 
GNode* g_node_first_sibling (GNode *node);
GNode* g_node_last_sibling (GNode *node);
 
#define g_node_prev_sibling(node) ((node) ? \
((GNode*) (node))->prev : NULL)
#define g_node_next_sibling(node) ((node) ? \
((GNode*) (node))->next : NULL)
#define g_node_first_child(node) ((node) ? \
((GNode*) (node))->children : NULL)
 
 
/* Callback maintenance functions
*/
#define G_HOOK_FLAG_USER_SHIFT (4)
typedef enum
{
G_HOOK_FLAG_ACTIVE = 1 << 0,
G_HOOK_FLAG_IN_CALL = 1 << 1,
G_HOOK_FLAG_MASK = 0x0f
} GHookFlagMask;
 
#define G_HOOK_DEFERRED_DESTROY ((GHookFreeFunc) 0x01)
 
struct _GHookList
{
guint seq_id;
guint hook_size;
guint is_setup : 1;
GHook *hooks;
GMemChunk *hook_memchunk;
GHookFreeFunc hook_free; /* virtual function */
GHookFreeFunc hook_destroy; /* virtual function */
};
 
struct _GHook
{
gpointer data;
GHook *next;
GHook *prev;
guint ref_count;
guint hook_id;
guint flags;
gpointer func;
GDestroyNotify destroy;
};
 
#define G_HOOK_ACTIVE(hook) ((((GHook*) hook)->flags & \
G_HOOK_FLAG_ACTIVE) != 0)
#define G_HOOK_IN_CALL(hook) ((((GHook*) hook)->flags & \
G_HOOK_FLAG_IN_CALL) != 0)
#define G_HOOK_IS_VALID(hook) (((GHook*) hook)->hook_id != 0 && \
G_HOOK_ACTIVE (hook))
#define G_HOOK_IS_UNLINKED(hook) (((GHook*) hook)->next == NULL && \
((GHook*) hook)->prev == NULL && \
((GHook*) hook)->hook_id == 0 && \
((GHook*) hook)->ref_count == 0)
 
void g_hook_list_init (GHookList *hook_list,
guint hook_size);
void g_hook_list_clear (GHookList *hook_list);
GHook* g_hook_alloc (GHookList *hook_list);
void g_hook_free (GHookList *hook_list,
GHook *hook);
void g_hook_ref (GHookList *hook_list,
GHook *hook);
void g_hook_unref (GHookList *hook_list,
GHook *hook);
gboolean g_hook_destroy (GHookList *hook_list,
guint hook_id);
void g_hook_destroy_link (GHookList *hook_list,
GHook *hook);
void g_hook_prepend (GHookList *hook_list,
GHook *hook);
void g_hook_insert_before (GHookList *hook_list,
GHook *sibling,
GHook *hook);
void g_hook_insert_sorted (GHookList *hook_list,
GHook *hook,
GHookCompareFunc func);
GHook* g_hook_get (GHookList *hook_list,
guint hook_id);
GHook* g_hook_find (GHookList *hook_list,
gboolean need_valids,
GHookFindFunc func,
gpointer data);
GHook* g_hook_find_data (GHookList *hook_list,
gboolean need_valids,
gpointer data);
GHook* g_hook_find_func (GHookList *hook_list,
gboolean need_valids,
gpointer func);
GHook* g_hook_find_func_data (GHookList *hook_list,
gboolean need_valids,
gpointer func,
gpointer data);
/* return the first valid hook, and increment its reference count */
GHook* g_hook_first_valid (GHookList *hook_list,
gboolean may_be_in_call);
/* return the next valid hook with incremented reference count, and
* decrement the reference count of the original hook
*/
GHook* g_hook_next_valid (GHookList *hook_list,
GHook *hook,
gboolean may_be_in_call);
 
/* GHookCompareFunc implementation to insert hooks sorted by their id */
gint g_hook_compare_ids (GHook *new_hook,
GHook *sibling);
 
/* convenience macros */
#define g_hook_append( hook_list, hook ) \
g_hook_insert_before ((hook_list), NULL, (hook))
 
/* invoke all valid hooks with the (*GHookFunc) signature.
*/
void g_hook_list_invoke (GHookList *hook_list,
gboolean may_recurse);
/* invoke all valid hooks with the (*GHookCheckFunc) signature,
* and destroy the hook if FALSE is returned.
*/
void g_hook_list_invoke_check (GHookList *hook_list,
gboolean may_recurse);
/* invoke a marshaller on all valid hooks.
*/
void g_hook_list_marshal (GHookList *hook_list,
gboolean may_recurse,
GHookMarshaller marshaller,
gpointer data);
void g_hook_list_marshal_check (GHookList *hook_list,
gboolean may_recurse,
GHookCheckMarshaller marshaller,
gpointer data);
 
 
/* Fatal error handlers.
* g_on_error_query() will prompt the user to either
* [E]xit, [H]alt, [P]roceed or show [S]tack trace.
* g_on_error_stack_trace() invokes gdb, which attaches to the current
* process and shows a stack trace.
* These function may cause different actions on non-unix platforms.
* The prg_name arg is required by gdb to find the executable, if it is
* passed as NULL, g_on_error_query() will try g_get_prgname().
*/
void g_on_error_query (const gchar *prg_name);
void g_on_error_stack_trace (const gchar *prg_name);
 
 
/* Logging mechanism
*/
extern const gchar *g_log_domain_glib;
guint g_log_set_handler (const gchar *log_domain,
GLogLevelFlags log_levels,
GLogFunc log_func,
gpointer user_data);
void g_log_remove_handler (const gchar *log_domain,
guint handler_id);
void g_log_default_handler (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,
gpointer unused_data);
void g_log (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *format,
...) G_GNUC_PRINTF (3, 4);
void g_logv (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *format,
va_list args);
GLogLevelFlags g_log_set_fatal_mask (const gchar *log_domain,
GLogLevelFlags fatal_mask);
GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
#ifndef G_LOG_DOMAIN
#define G_LOG_DOMAIN ((gchar*) 0)
#endif /* G_LOG_DOMAIN */
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define g_error(...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \
__VA_ARGS__)
#define g_message(...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_MESSAGE, \
__VA_ARGS__)
#define g_critical(...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
__VA_ARGS__)
#define g_warning(...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_WARNING, \
__VA_ARGS__)
#elif defined (__GNUC__)
#define g_error(format...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \
format)
#define g_message(format...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_MESSAGE, \
format)
#define g_critical(format...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
format)
#define g_warning(format...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_WARNING, \
format)
#else /* !__GNUC__ */
static void
g_error (const gchar *format,
...)
{
va_list args;
va_start (args, format);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
va_end (args);
}
static void
g_message (const gchar *format,
...)
{
va_list args;
va_start (args, format);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, args);
va_end (args);
}
static void
g_warning (const gchar *format,
...)
{
va_list args;
va_start (args, format);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, args);
va_end (args);
}
#endif /* !__GNUC__ */
 
typedef void (*GPrintFunc) (const gchar *string);
void g_print (const gchar *format,
...) G_GNUC_PRINTF (1, 2);
GPrintFunc g_set_print_handler (GPrintFunc func);
void g_printerr (const gchar *format,
...) G_GNUC_PRINTF (1, 2);
GPrintFunc g_set_printerr_handler (GPrintFunc func);
 
/* deprecated compatibility functions, use g_log_set_handler() instead */
typedef void (*GErrorFunc) (const gchar *str);
typedef void (*GWarningFunc) (const gchar *str);
GErrorFunc g_set_error_handler (GErrorFunc func);
GWarningFunc g_set_warning_handler (GWarningFunc func);
GPrintFunc g_set_message_handler (GPrintFunc func);
 
 
/* Memory allocation and debugging
*/
#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);
 
/* Generic allocators
*/
GAllocator* g_allocator_new (const gchar *name,
guint n_preallocs);
void g_allocator_free (GAllocator *allocator);
 
#define G_ALLOCATOR_LIST (1)
#define G_ALLOCATOR_SLIST (2)
#define G_ALLOCATOR_NODE (3)
 
 
/* "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);
gpointer g_mem_chunk_alloc0 (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);
 
 
/* String utility functions that modify a string argument or
* return a constant string that must not be freed.
*/
#define G_STR_DELIMITERS "_-|> <."
gchar* g_strdelimit (gchar *string,
const gchar *delimiters,
gchar new_delimiter);
gdouble g_strtod (const gchar *nptr,
gchar **endptr);
gchar* g_strerror (gint errnum);
gchar* g_strsignal (gint signum);
gint g_strcasecmp (const gchar *s1,
const gchar *s2);
gint g_strncasecmp (const gchar *s1,
const gchar *s2,
guint n);
void g_strdown (gchar *string);
void g_strup (gchar *string);
void g_strreverse (gchar *string);
/* removes leading spaces */
gchar* g_strchug (gchar *string);
/* removes trailing spaces */
gchar* g_strchomp (gchar *string);
/* removes leading & trailing spaces */
#define g_strstrip( string ) g_strchomp (g_strchug (string))
 
/* String utility functions that return a newly allocated string which
* ought to be freed from the caller at some point.
*/
gchar* g_strdup (const gchar *str);
gchar* g_strdup_printf (const gchar *format,
...) G_GNUC_PRINTF (1, 2);
gchar* g_strdup_vprintf (const gchar *format,
va_list args);
gchar* g_strndup (const gchar *str,
guint n);
gchar* g_strnfill (guint length,
gchar fill_char);
gchar* g_strconcat (const gchar *string1,
...); /* NULL terminated */
gchar* g_strjoin (const gchar *separator,
...); /* NULL terminated */
gchar* g_strescape (gchar *string);
gpointer g_memdup (gconstpointer mem,
guint byte_size);
 
/* NULL terminated string arrays.
* g_strsplit() splits up string into max_tokens tokens at delim and
* returns a newly allocated string array.
* g_strjoinv() concatenates all of str_array's strings, sliding in an
* optional separator, the returned string is newly allocated.
* g_strfreev() frees the array itself and all of its strings.
*/
gchar** g_strsplit (const gchar *string,
const gchar *delimiter,
gint max_tokens);
gchar* g_strjoinv (const gchar *separator,
gchar **str_array);
void g_strfreev (gchar **str_array);
 
 
 
/* calculate a string size, guarranteed to fit format + args.
*/
guint g_printf_string_upper_bound (const gchar* format,
va_list args);
 
 
/* Retrive static string info
*/
gchar* g_get_user_name (void);
gchar* g_get_real_name (void);
gchar* g_get_home_dir (void);
gchar* g_get_tmp_dir (void);
gchar* g_get_prgname (void);
void g_set_prgname (const gchar *prgname);
 
 
/* Miscellaneous utility functions
*/
guint g_parse_debug_string (const gchar *string,
GDebugKey *keys,
guint nkeys);
gint g_snprintf (gchar *string,
gulong n,
gchar const *format,
...) G_GNUC_PRINTF (3, 4);
gint g_vsnprintf (gchar *string,
gulong n,
gchar const *format,
va_list args);
gchar* g_basename (const gchar *file_name);
/* Check if a file name is an absolute path */
gboolean g_path_is_absolute (const gchar *file_name);
/* In case of absolute paths, skip the root part */
gchar* g_path_skip_root (gchar *file_name);
 
/* strings are newly allocated with g_malloc() */
gchar* g_dirname (const gchar *file_name);
gchar* g_get_current_dir (void);
 
/* return the environment string for the variable. The returned memory
* must not be freed. */
gchar* g_getenv (const gchar *variable);
 
 
/* we use a GLib function as a replacement for ATEXIT, so
* the programmer is not required to check the return value
* (if there is any in the implementation) and doesn't encounter
* missing include files.
*/
void g_atexit (GVoidFunc func);
 
 
/* Bit tests
*/
G_INLINE_FUNC gint g_bit_nth_lsf (guint32 mask,
gint nth_bit);
#ifdef G_CAN_INLINE
G_INLINE_FUNC gint
g_bit_nth_lsf (guint32 mask,
gint nth_bit)
{
do
{
nth_bit++;
if (mask & (1 << (guint) nth_bit))
return nth_bit;
}
while (nth_bit < 32);
return -1;
}
#endif /* G_CAN_INLINE */
 
G_INLINE_FUNC gint g_bit_nth_msf (guint32 mask,
gint nth_bit);
#ifdef G_CAN_INLINE
G_INLINE_FUNC gint
g_bit_nth_msf (guint32 mask,
gint nth_bit)
{
if (nth_bit < 0)
nth_bit = 32;
do
{
nth_bit--;
if (mask & (1 << (guint) nth_bit))
return nth_bit;
}
while (nth_bit > 0);
return -1;
}
#endif /* G_CAN_INLINE */
 
G_INLINE_FUNC guint g_bit_storage (guint number);
#ifdef G_CAN_INLINE
G_INLINE_FUNC guint
g_bit_storage (guint number)
{
register guint n_bits = 0;
do
{
n_bits++;
number >>= 1;
}
while (number);
return n_bits;
}
#endif /* G_CAN_INLINE */
 
/* String Chunks
*/
GStringChunk* g_string_chunk_new (gint size);
void g_string_chunk_free (GStringChunk *chunk);
gchar* g_string_chunk_insert (GStringChunk *chunk,
const gchar *string);
gchar* g_string_chunk_insert_const (GStringChunk *chunk,
const gchar *string);
 
 
/* Strings
*/
GString* g_string_new (const gchar *init);
GString* g_string_sized_new (guint dfl_size);
void g_string_free (GString *string,
gint free_segment);
GString* g_string_assign (GString *lval,
const gchar *rval);
GString* g_string_truncate (GString *string,
gint len);
GString* g_string_append (GString *string,
const gchar *val);
GString* g_string_append_c (GString *string,
gchar c);
GString* g_string_prepend (GString *string,
const gchar *val);
GString* g_string_prepend_c (GString *string,
gchar c);
GString* g_string_insert (GString *string,
gint pos,
const gchar *val);
GString* g_string_insert_c (GString *string,
gint pos,
gchar c);
GString* g_string_erase (GString *string,
gint pos,
gint len);
GString* g_string_down (GString *string);
GString* g_string_up (GString *string);
void g_string_sprintf (GString *string,
const gchar *format,
...) G_GNUC_PRINTF (2, 3);
void g_string_sprintfa (GString *string,
const gchar *format,
...) G_GNUC_PRINTF (2, 3);
 
 
/* Resizable arrays, remove fills any cleared spot and shortens the
* array, while preserving the order. remove_fast will distort the
* order by moving the last element to the position of the removed
*/
 
#define g_array_append_val(a,v) g_array_append_vals (a, &(v), 1)
#define g_array_prepend_val(a,v) g_array_prepend_vals (a, &(v), 1)
#define g_array_insert_val(a,i,v) g_array_insert_vals (a, i, &(v), 1)
#define g_array_index(a,t,i) (((t*) (a)->data) [(i)])
 
GArray* g_array_new (gboolean zero_terminated,
gboolean clear,
guint element_size);
void g_array_free (GArray *array,
gboolean free_segment);
GArray* g_array_append_vals (GArray *array,
gconstpointer data,
guint len);
GArray* g_array_prepend_vals (GArray *array,
gconstpointer data,
guint len);
GArray* g_array_insert_vals (GArray *array,
guint index,
gconstpointer data,
guint len);
GArray* g_array_set_size (GArray *array,
guint length);
GArray* g_array_remove_index (GArray *array,
guint index);
GArray* g_array_remove_index_fast (GArray *array,
guint index);
 
/* Resizable pointer array. This interface is much less complicated
* than the above. Add appends appends a pointer. Remove fills any
* cleared spot and shortens the array. remove_fast will again distort
* order.
*/
#define g_ptr_array_index(array,index) (array->pdata)[index]
GPtrArray* g_ptr_array_new (void);
void g_ptr_array_free (GPtrArray *array,
gboolean free_seg);
void g_ptr_array_set_size (GPtrArray *array,
gint length);
gpointer g_ptr_array_remove_index (GPtrArray *array,
guint index);
gpointer g_ptr_array_remove_index_fast (GPtrArray *array,
guint index);
gboolean g_ptr_array_remove (GPtrArray *array,
gpointer data);
gboolean g_ptr_array_remove_fast (GPtrArray *array,
gpointer data);
void g_ptr_array_add (GPtrArray *array,
gpointer data);
 
/* Byte arrays, an array of guint8. Implemented as a GArray,
* but type-safe.
*/
 
GByteArray* g_byte_array_new (void);
void g_byte_array_free (GByteArray *array,
gboolean free_segment);
GByteArray* g_byte_array_append (GByteArray *array,
const guint8 *data,
guint len);
GByteArray* g_byte_array_prepend (GByteArray *array,
const guint8 *data,
guint len);
GByteArray* g_byte_array_set_size (GByteArray *array,
guint length);
GByteArray* g_byte_array_remove_index (GByteArray *array,
guint index);
GByteArray* g_byte_array_remove_index_fast (GByteArray *array,
guint index);
 
 
/* Hash Functions
*/
gint g_str_equal (gconstpointer v,
gconstpointer v2);
guint g_str_hash (gconstpointer v);
 
gint g_int_equal (gconstpointer v,
gconstpointer v2);
guint g_int_hash (gconstpointer v);
 
/* This "hash" function will just return the key's adress as an
* unsigned integer. Useful for hashing on plain adresses or
* simple integer values.
* passing NULL into g_hash_table_new() as GHashFunc has the
* same effect as passing g_direct_hash().
*/
guint g_direct_hash (gconstpointer v);
gint g_direct_equal (gconstpointer v,
gconstpointer v2);
 
 
/* Quarks (string<->id association)
*/
GQuark g_quark_try_string (const gchar *string);
GQuark g_quark_from_static_string (const gchar *string);
GQuark g_quark_from_string (const gchar *string);
gchar* g_quark_to_string (GQuark quark);
 
 
/* Keyed Data List
* NOTE: these functions are scheduled for a rename in GLib 1.3
*/
void g_datalist_init (GData **datalist);
void g_datalist_clear (GData **datalist);
gpointer g_datalist_id_get_data (GData **datalist,
GQuark key_id);
void g_datalist_id_set_data_full (GData **datalist,
GQuark key_id,
gpointer data,
GDestroyNotify destroy_func);
void g_datalist_id_remove_no_notify (GData **datalist,
GQuark key_id);
void g_datalist_foreach (GData **datalist,
GDataForeachFunc func,
gpointer user_data);
#define g_datalist_id_set_data(dl, q, d) \
g_datalist_id_set_data_full ((dl), (q), (d), NULL)
#define g_datalist_id_remove_data(dl, q) \
g_datalist_id_set_data ((dl), (q), NULL)
#define g_datalist_get_data(dl, k) \
(g_datalist_id_get_data ((dl), g_quark_try_string (k)))
#define g_datalist_set_data_full(dl, k, d, f) \
g_datalist_id_set_data_full ((dl), g_quark_from_string (k), (d), (f))
#define g_datalist_remove_no_notify(dl, k) \
g_datalist_id_remove_no_notify ((dl), g_quark_try_string (k))
#define g_datalist_set_data(dl, k, d) \
g_datalist_set_data_full ((dl), (k), (d), NULL)
#define g_datalist_remove_data(dl, k) \
g_datalist_id_set_data ((dl), g_quark_try_string (k), NULL)
 
 
/* Location Associated Keyed Data
* NOTE: these functions are scheduled for a rename in GLib 1.3
*/
void g_dataset_destroy (gconstpointer dataset_location);
gpointer g_dataset_id_get_data (gconstpointer dataset_location,
GQuark key_id);
void g_dataset_id_set_data_full (gconstpointer dataset_location,
GQuark key_id,
gpointer data,
GDestroyNotify destroy_func);
void g_dataset_id_remove_no_notify (gconstpointer dataset_location,
GQuark key_id);
void g_dataset_foreach (gconstpointer dataset_location,
GDataForeachFunc func,
gpointer user_data);
#define g_dataset_id_set_data(l, k, d) \
g_dataset_id_set_data_full ((l), (k), (d), NULL)
#define g_dataset_id_remove_data(l, k) \
g_dataset_id_set_data ((l), (k), NULL)
#define g_dataset_get_data(l, k) \
(g_dataset_id_get_data ((l), g_quark_try_string (k)))
#define g_dataset_set_data_full(l, k, d, f) \
g_dataset_id_set_data_full ((l), g_quark_from_string (k), (d), (f))
#define g_dataset_remove_no_notify(l, k) \
g_dataset_id_remove_no_notify ((l), g_quark_try_string (k))
#define g_dataset_set_data(l, k, d) \
g_dataset_set_data_full ((l), (k), (d), NULL)
#define g_dataset_remove_data(l, k) \
g_dataset_id_set_data ((l), g_quark_try_string (k), NULL)
 
 
/* GScanner: Flexible lexical scanner for general purpose.
*/
 
/* Character sets */
#define G_CSET_A_2_Z "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define G_CSET_a_2_z "abcdefghijklmnopqrstuvwxyz"
#define G_CSET_LATINC "\300\301\302\303\304\305\306"\
"\307\310\311\312\313\314\315\316\317\320"\
"\321\322\323\324\325\326"\
"\330\331\332\333\334\335\336"
#define G_CSET_LATINS "\337\340\341\342\343\344\345\346"\
"\347\350\351\352\353\354\355\356\357\360"\
"\361\362\363\364\365\366"\
"\370\371\372\373\374\375\376\377"
 
/* Error types */
typedef enum
{
G_ERR_UNKNOWN,
G_ERR_UNEXP_EOF,
G_ERR_UNEXP_EOF_IN_STRING,
G_ERR_UNEXP_EOF_IN_COMMENT,
G_ERR_NON_DIGIT_IN_CONST,
G_ERR_DIGIT_RADIX,
G_ERR_FLOAT_RADIX,
G_ERR_FLOAT_MALFORMED
} GErrorType;
 
/* Token types */
typedef enum
{
G_TOKEN_EOF = 0,
G_TOKEN_LEFT_PAREN = '(',
G_TOKEN_RIGHT_PAREN = ')',
G_TOKEN_LEFT_CURLY = '{',
G_TOKEN_RIGHT_CURLY = '}',
G_TOKEN_LEFT_BRACE = '[',
G_TOKEN_RIGHT_BRACE = ']',
G_TOKEN_EQUAL_SIGN = '=',
G_TOKEN_COMMA = ',',
G_TOKEN_NONE = 256,
G_TOKEN_ERROR,
G_TOKEN_CHAR,
G_TOKEN_BINARY,
G_TOKEN_OCTAL,
G_TOKEN_INT,
G_TOKEN_HEX,
G_TOKEN_FLOAT,
G_TOKEN_STRING,
G_TOKEN_SYMBOL,
G_TOKEN_IDENTIFIER,
G_TOKEN_IDENTIFIER_NULL,
G_TOKEN_COMMENT_SINGLE,
G_TOKEN_COMMENT_MULTI,
G_TOKEN_LAST
} GTokenType;
 
union _GTokenValue
{
gpointer v_symbol;
gchar *v_identifier;
gulong v_binary;
gulong v_octal;
gulong v_int;
gdouble v_float;
gulong v_hex;
gchar *v_string;
gchar *v_comment;
guchar v_char;
guint v_error;
};
 
struct _GScannerConfig
{
/* Character sets
*/
gchar *cset_skip_characters; /* default: " \t\n" */
gchar *cset_identifier_first;
gchar *cset_identifier_nth;
gchar *cpair_comment_single; /* default: "#\n" */
/* Should symbol lookup work case sensitive?
*/
guint case_sensitive : 1;
/* Boolean values to be adjusted "on the fly"
* to configure scanning behaviour.
*/
guint skip_comment_multi : 1; /* C like comment */
guint skip_comment_single : 1; /* single line comment */
guint scan_comment_multi : 1; /* scan multi line comments? */
guint scan_identifier : 1;
guint scan_identifier_1char : 1;
guint scan_identifier_NULL : 1;
guint scan_symbols : 1;
guint scan_binary : 1;
guint scan_octal : 1;
guint scan_float : 1;
guint scan_hex : 1; /* `0x0ff0' */
guint scan_hex_dollar : 1; /* `$0ff0' */
guint scan_string_sq : 1; /* string: 'anything' */
guint scan_string_dq : 1; /* string: "\\-escapes!\n" */
guint numbers_2_int : 1; /* bin, octal, hex => int */
guint int_2_float : 1; /* int => G_TOKEN_FLOAT? */
guint identifier_2_string : 1;
guint char_2_token : 1; /* return G_TOKEN_CHAR? */
guint symbol_2_token : 1;
guint scope_0_fallback : 1; /* try scope 0 on lookups? */
};
 
struct _GScanner
{
/* unused fields */
gpointer user_data;
guint max_parse_errors;
/* g_scanner_error() increments this field */
guint parse_errors;
/* name of input stream, featured by the default message handler */
const gchar *input_name;
/* data pointer for derived structures */
gpointer derived_data;
/* link into the scanner configuration */
GScannerConfig *config;
/* fields filled in after g_scanner_get_next_token() */
GTokenType token;
GTokenValue value;
guint line;
guint position;
/* fields filled in after g_scanner_peek_next_token() */
GTokenType next_token;
GTokenValue next_value;
guint next_line;
guint next_position;
/* to be considered private */
GHashTable *symbol_table;
gint input_fd;
const gchar *text;
const gchar *text_end;
gchar *buffer;
guint scope_id;
/* handler function for _warn and _error */
GScannerMsgFunc msg_handler;
};
 
GScanner* g_scanner_new (GScannerConfig *config_templ);
void g_scanner_destroy (GScanner *scanner);
void g_scanner_input_file (GScanner *scanner,
gint input_fd);
void g_scanner_sync_file_offset (GScanner *scanner);
void g_scanner_input_text (GScanner *scanner,
const gchar *text,
guint text_len);
GTokenType g_scanner_get_next_token (GScanner *scanner);
GTokenType g_scanner_peek_next_token (GScanner *scanner);
GTokenType g_scanner_cur_token (GScanner *scanner);
GTokenValue g_scanner_cur_value (GScanner *scanner);
guint g_scanner_cur_line (GScanner *scanner);
guint g_scanner_cur_position (GScanner *scanner);
gboolean g_scanner_eof (GScanner *scanner);
guint g_scanner_set_scope (GScanner *scanner,
guint scope_id);
void g_scanner_scope_add_symbol (GScanner *scanner,
guint scope_id,
const gchar *symbol,
gpointer value);
void g_scanner_scope_remove_symbol (GScanner *scanner,
guint scope_id,
const gchar *symbol);
gpointer g_scanner_scope_lookup_symbol (GScanner *scanner,
guint scope_id,
const gchar *symbol);
void g_scanner_scope_foreach_symbol (GScanner *scanner,
guint scope_id,
GHFunc func,
gpointer user_data);
gpointer g_scanner_lookup_symbol (GScanner *scanner,
const gchar *symbol);
void g_scanner_freeze_symbol_table (GScanner *scanner);
void g_scanner_thaw_symbol_table (GScanner *scanner);
void g_scanner_unexp_token (GScanner *scanner,
GTokenType expected_token,
const gchar *identifier_spec,
const gchar *symbol_spec,
const gchar *symbol_name,
const gchar *message,
gint is_error);
void g_scanner_error (GScanner *scanner,
const gchar *format,
...) G_GNUC_PRINTF (2,3);
void g_scanner_warn (GScanner *scanner,
const gchar *format,
...) G_GNUC_PRINTF (2,3);
gint g_scanner_stat_mode (const gchar *filename);
/* keep downward source compatibility */
#define g_scanner_add_symbol( scanner, symbol, value ) G_STMT_START { \
g_scanner_scope_add_symbol ((scanner), 0, (symbol), (value)); \
} G_STMT_END
#define g_scanner_remove_symbol( scanner, symbol ) G_STMT_START { \
g_scanner_scope_remove_symbol ((scanner), 0, (symbol)); \
} G_STMT_END
#define g_scanner_foreach_symbol( scanner, func, data ) G_STMT_START { \
g_scanner_scope_foreach_symbol ((scanner), 0, (func), (data)); \
} G_STMT_END
 
 
/* GCompletion
*/
 
struct _GCompletion
{
GList* items;
GCompletionFunc func;
gchar* prefix;
GList* cache;
};
 
GCompletion* g_completion_new (GCompletionFunc func);
void g_completion_add_items (GCompletion* cmp,
GList* items);
void g_completion_remove_items (GCompletion* cmp,
GList* items);
void g_completion_clear_items (GCompletion* cmp);
GList* g_completion_complete (GCompletion* cmp,
gchar* prefix,
gchar** new_prefix);
void g_completion_free (GCompletion* cmp);
 
 
/* GDate
*
* Date calculations (not time for now, to be resolved). These are a
* mutant combination of Steffen Beyer's DateCalc routines
* (http://www.perl.com/CPAN/authors/id/STBEY/) and Jon Trowbridge's
* date routines (written for in-house software). Written by Havoc
* Pennington <hp@pobox.com>
*/
 
typedef guint16 GDateYear;
typedef guint8 GDateDay; /* day of the month */
typedef struct _GDate GDate;
/* make struct tm known without having to include time.h */
struct tm;
 
/* enum used to specify order of appearance in parsed date strings */
typedef enum
{
G_DATE_DAY = 0,
G_DATE_MONTH = 1,
G_DATE_YEAR = 2
} GDateDMY;
 
/* actual week and month values */
typedef enum
{
G_DATE_BAD_WEEKDAY = 0,
G_DATE_MONDAY = 1,
G_DATE_TUESDAY = 2,
G_DATE_WEDNESDAY = 3,
G_DATE_THURSDAY = 4,
G_DATE_FRIDAY = 5,
G_DATE_SATURDAY = 6,
G_DATE_SUNDAY = 7
} GDateWeekday;
typedef enum
{
G_DATE_BAD_MONTH = 0,
G_DATE_JANUARY = 1,
G_DATE_FEBRUARY = 2,
G_DATE_MARCH = 3,
G_DATE_APRIL = 4,
G_DATE_MAY = 5,
G_DATE_JUNE = 6,
G_DATE_JULY = 7,
G_DATE_AUGUST = 8,
G_DATE_SEPTEMBER = 9,
G_DATE_OCTOBER = 10,
G_DATE_NOVEMBER = 11,
G_DATE_DECEMBER = 12
} GDateMonth;
 
#define G_DATE_BAD_JULIAN 0U
#define G_DATE_BAD_DAY 0U
#define G_DATE_BAD_YEAR 0U
 
/* Note: directly manipulating structs is generally a bad idea, but
* in this case it's an *incredibly* bad idea, because all or part
* of this struct can be invalid at any given time. Use the functions,
* or you will get hosed, I promise.
*/
struct _GDate
{
guint julian_days : 32; /* julian days representation - we use a
* bitfield hoping that 64 bit platforms
* will pack this whole struct in one big
* int
*/
 
guint julian : 1; /* julian is valid */
guint dmy : 1; /* dmy is valid */
 
/* DMY representation */
guint day : 6;
guint month : 4;
guint year : 16;
};
 
/* g_date_new() returns an invalid date, you then have to _set() stuff
* to get a usable object. You can also allocate a GDate statically,
* then call g_date_clear() to initialize.
*/
GDate* g_date_new (void);
GDate* g_date_new_dmy (GDateDay day,
GDateMonth month,
GDateYear year);
GDate* g_date_new_julian (guint32 julian_day);
void g_date_free (GDate *date);
 
/* check g_date_valid() after doing an operation that might fail, like
* _parse. Almost all g_date operations are undefined on invalid
* dates (the exceptions are the mutators, since you need those to
* return to validity).
*/
gboolean g_date_valid (GDate *date);
gboolean g_date_valid_day (GDateDay day);
gboolean g_date_valid_month (GDateMonth month);
gboolean g_date_valid_year (GDateYear year);
gboolean g_date_valid_weekday (GDateWeekday weekday);
gboolean g_date_valid_julian (guint32 julian_date);
gboolean g_date_valid_dmy (GDateDay day,
GDateMonth month,
GDateYear year);
 
GDateWeekday g_date_weekday (GDate *date);
GDateMonth g_date_month (GDate *date);
GDateYear g_date_year (GDate *date);
GDateDay g_date_day (GDate *date);
guint32 g_date_julian (GDate *date);
guint g_date_day_of_year (GDate *date);
 
/* First monday/sunday is the start of week 1; if we haven't reached
* that day, return 0. These are not ISO weeks of the year; that
* routine needs to be added.
* these functions return the number of weeks, starting on the
* corrsponding day
*/
guint g_date_monday_week_of_year (GDate *date);
guint g_date_sunday_week_of_year (GDate *date);
 
/* If you create a static date struct you need to clear it to get it
* in a sane state before use. You can clear a whole array at
* once with the ndates argument.
*/
void g_date_clear (GDate *date,
guint n_dates);
 
/* The parse routine is meant for dates typed in by a user, so it
* permits many formats but tries to catch common typos. If your data
* needs to be strictly validated, it is not an appropriate function.
*/
void g_date_set_parse (GDate *date,
const gchar *str);
void g_date_set_time (GDate *date,
GTime time);
void g_date_set_month (GDate *date,
GDateMonth month);
void g_date_set_day (GDate *date,
GDateDay day);
void g_date_set_year (GDate *date,
GDateYear year);
void g_date_set_dmy (GDate *date,
GDateDay day,
GDateMonth month,
GDateYear y);
void g_date_set_julian (GDate *date,
guint32 julian_date);
gboolean g_date_is_first_of_month (GDate *date);
gboolean g_date_is_last_of_month (GDate *date);
 
/* To go forward by some number of weeks just go forward weeks*7 days */
void g_date_add_days (GDate *date,
guint n_days);
void g_date_subtract_days (GDate *date,
guint n_days);
 
/* If you add/sub months while day > 28, the day might change */
void g_date_add_months (GDate *date,
guint n_months);
void g_date_subtract_months (GDate *date,
guint n_months);
 
/* If it's feb 29, changing years can move you to the 28th */
void g_date_add_years (GDate *date,
guint n_years);
void g_date_subtract_years (GDate *date,
guint n_years);
gboolean g_date_is_leap_year (GDateYear year);
guint8 g_date_days_in_month (GDateMonth month,
GDateYear year);
guint8 g_date_monday_weeks_in_year (GDateYear year);
guint8 g_date_sunday_weeks_in_year (GDateYear year);
 
/* qsort-friendly (with a cast...) */
gint g_date_compare (GDate *lhs,
GDate *rhs);
void g_date_to_struct_tm (GDate *date,
struct tm *tm);
 
/* Just like strftime() except you can only use date-related formats.
* Using a time format is undefined.
*/
gsize g_date_strftime (gchar *s,
gsize slen,
const gchar *format,
GDate *date);
 
 
/* GRelation
*
* Indexed Relations. Imagine a really simple table in a
* database. Relations are not ordered. This data type is meant for
* maintaining a N-way mapping.
*
* g_relation_new() creates a relation with FIELDS fields
*
* g_relation_destroy() frees all resources
* g_tuples_destroy() frees the result of g_relation_select()
*
* g_relation_index() indexes relation FIELD with the provided
* equality and hash functions. this must be done before any
* calls to insert are made.
*
* g_relation_insert() inserts a new tuple. you are expected to
* provide the right number of fields.
*
* g_relation_delete() deletes all relations with KEY in FIELD
* g_relation_select() returns ...
* g_relation_count() counts ...
*/
 
GRelation* g_relation_new (gint fields);
void g_relation_destroy (GRelation *relation);
void g_relation_index (GRelation *relation,
gint field,
GHashFunc hash_func,
GCompareFunc key_compare_func);
void g_relation_insert (GRelation *relation,
...);
gint g_relation_delete (GRelation *relation,
gconstpointer key,
gint field);
GTuples* g_relation_select (GRelation *relation,
gconstpointer key,
gint field);
gint g_relation_count (GRelation *relation,
gconstpointer key,
gint field);
gboolean g_relation_exists (GRelation *relation,
...);
void g_relation_print (GRelation *relation);
 
void g_tuples_destroy (GTuples *tuples);
gpointer g_tuples_index (GTuples *tuples,
gint index,
gint field);
 
 
/* Prime numbers.
*/
 
/* This function returns prime numbers spaced by approximately 1.5-2.0
* and is for use in resizing data structures which prefer
* prime-valued sizes. The closest spaced prime function returns the
* next largest prime, or the highest it knows about which is about
* MAXINT/4.
*/
guint g_spaced_primes_closest (guint num);
 
 
/* GIOChannel
*/
 
typedef struct _GIOFuncs GIOFuncs;
typedef enum
{
G_IO_ERROR_NONE,
G_IO_ERROR_AGAIN,
G_IO_ERROR_INVAL,
G_IO_ERROR_UNKNOWN
} GIOError;
typedef enum
{
G_SEEK_CUR,
G_SEEK_SET,
G_SEEK_END
} GSeekType;
typedef enum
{
G_IO_IN GLIB_SYSDEF_POLLIN,
G_IO_OUT GLIB_SYSDEF_POLLOUT,
G_IO_PRI GLIB_SYSDEF_POLLPRI,
G_IO_ERR GLIB_SYSDEF_POLLERR,
G_IO_HUP GLIB_SYSDEF_POLLHUP,
G_IO_NVAL GLIB_SYSDEF_POLLNVAL
} GIOCondition;
 
struct _GIOChannel
{
guint channel_flags;
guint ref_count;
GIOFuncs *funcs;
};
 
typedef gboolean (*GIOFunc) (GIOChannel *source,
GIOCondition condition,
gpointer data);
struct _GIOFuncs
{
GIOError (*io_read) (GIOChannel *channel,
gchar *buf,
guint count,
guint *bytes_read);
GIOError (*io_write) (GIOChannel *channel,
gchar *buf,
guint count,
guint *bytes_written);
GIOError (*io_seek) (GIOChannel *channel,
gint offset,
GSeekType type);
void (*io_close) (GIOChannel *channel);
guint (*io_add_watch) (GIOChannel *channel,
gint priority,
GIOCondition condition,
GIOFunc func,
gpointer user_data,
GDestroyNotify notify);
void (*io_free) (GIOChannel *channel);
};
 
void g_io_channel_init (GIOChannel *channel);
void g_io_channel_ref (GIOChannel *channel);
void g_io_channel_unref (GIOChannel *channel);
GIOError g_io_channel_read (GIOChannel *channel,
gchar *buf,
guint count,
guint *bytes_read);
GIOError g_io_channel_write (GIOChannel *channel,
gchar *buf,
guint count,
guint *bytes_written);
GIOError g_io_channel_seek (GIOChannel *channel,
gint offset,
GSeekType type);
void g_io_channel_close (GIOChannel *channel);
guint g_io_add_watch_full (GIOChannel *channel,
gint priority,
GIOCondition condition,
GIOFunc func,
gpointer user_data,
GDestroyNotify notify);
guint g_io_add_watch (GIOChannel *channel,
GIOCondition condition,
GIOFunc func,
gpointer user_data);
 
 
/* Main loop
*/
typedef struct _GTimeVal GTimeVal;
typedef struct _GSourceFuncs GSourceFuncs;
typedef struct _GMainLoop GMainLoop; /* Opaque */
 
struct _GTimeVal
{
glong tv_sec;
glong tv_usec;
};
struct _GSourceFuncs
{
gboolean (*prepare) (gpointer source_data,
GTimeVal *current_time,
gint *timeout,
gpointer user_data);
gboolean (*check) (gpointer source_data,
GTimeVal *current_time,
gpointer user_data);
gboolean (*dispatch) (gpointer source_data,
GTimeVal *dispatch_time,
gpointer user_data);
GDestroyNotify destroy;
};
 
/* Standard priorities */
 
#define G_PRIORITY_HIGH -100
#define G_PRIORITY_DEFAULT 0
#define G_PRIORITY_HIGH_IDLE 100
#define G_PRIORITY_DEFAULT_IDLE 200
#define G_PRIORITY_LOW 300
 
typedef gboolean (*GSourceFunc) (gpointer data);
 
/* Hooks for adding to the main loop */
guint g_source_add (gint priority,
gboolean can_recurse,
GSourceFuncs *funcs,
gpointer source_data,
gpointer user_data,
GDestroyNotify notify);
gboolean g_source_remove (guint tag);
gboolean g_source_remove_by_user_data (gpointer user_data);
gboolean g_source_remove_by_source_data (gpointer source_data);
gboolean g_source_remove_by_funcs_user_data (GSourceFuncs *funcs,
gpointer user_data);
 
void g_get_current_time (GTimeVal *result);
 
/* Running the main loop */
GMainLoop* g_main_new (gboolean is_running);
void g_main_run (GMainLoop *loop);
void g_main_quit (GMainLoop *loop);
void g_main_destroy (GMainLoop *loop);
gboolean g_main_is_running (GMainLoop *loop);
 
/* Run a single iteration of the mainloop. If block is FALSE,
* will never block
*/
gboolean g_main_iteration (gboolean may_block);
 
/* See if any events are pending */
gboolean g_main_pending (void);
 
/* Idles and timeouts */
guint g_timeout_add_full (gint priority,
guint interval,
GSourceFunc function,
gpointer data,
GDestroyNotify notify);
guint g_timeout_add (guint interval,
GSourceFunc function,
gpointer data);
guint g_idle_add (GSourceFunc function,
gpointer data);
guint g_idle_add_full (gint priority,
GSourceFunc function,
gpointer data,
GDestroyNotify destroy);
gboolean g_idle_remove_by_data (gpointer data);
 
/* GPollFD
*
* System-specific IO and main loop calls
*
* On Win32, the fd in a GPollFD should be Win32 HANDLE (*not* a file
* descriptor as provided by the C runtime) that can be used by
* MsgWaitForMultipleObjects. This does *not* include file handles
* from CreateFile, SOCKETs, nor pipe handles. (But you can use
* WSAEventSelect to signal events when a SOCKET is readable).
*
* On Win32, fd can also be the special value G_WIN32_MSG_HANDLE to
* indicate polling for messages. These message queue GPollFDs should
* be added with the g_main_poll_win32_msg_add function.
*
* But note that G_WIN32_MSG_HANDLE GPollFDs should not be used by GDK
* (GTK) programs, as GDK itself wants to read messages and convert them
* to GDK events.
*
* So, unless you really know what you are doing, it's best not to try
* to use the main loop polling stuff for your own needs on
* Win32. It's really only written for the GIMP's needs so
* far.
*/
 
typedef struct _GPollFD GPollFD;
typedef gint (*GPollFunc) (GPollFD *ufds,
guint nfsd,
gint timeout);
struct _GPollFD
{
gint fd;
gushort events;
gushort revents;
};
 
void g_main_add_poll (GPollFD *fd,
gint priority);
void g_main_remove_poll (GPollFD *fd);
void g_main_set_poll_func (GPollFunc func);
 
/* On Unix, IO channels created with this function for any file
* descriptor or socket.
*
* On Win32, use this only for plain files opened with the MSVCRT (the
* Microsoft run-time C library) _open(), including file descriptors
* 0, 1 and 2 (corresponding to stdin, stdout and stderr).
* Actually, don't do even that, this code isn't done yet.
*
* The term file descriptor as used in the context of Win32 refers to
* the emulated Unix-like file descriptors MSVCRT provides.
*/
GIOChannel* g_io_channel_unix_new (int fd);
gint g_io_channel_unix_get_fd (GIOChannel *channel);
 
#ifdef NATIVE_WIN32
 
GUTILS_C_VAR guint g_pipe_readable_msg;
 
#define G_WIN32_MSG_HANDLE 19981206
 
/* This is used to add polling for Windows messages. GDK (GTk+) programs
* should *not* use this. (In fact, I can't think of any program that
* would want to use this, but it's here just for completeness's sake.
*/
void g_main_poll_win32_msg_add(gint priority,
GPollFD *fd,
guint hwnd);
 
/* An IO channel for Windows messages for window handle hwnd. */
GIOChannel *g_io_channel_win32_new_messages (guint hwnd);
 
/* An IO channel for an anonymous pipe as returned from the MSVCRT
* _pipe(), with no mechanism for the writer to tell the reader when
* there is data in the pipe.
*
* This is not really implemented yet.
*/
GIOChannel *g_io_channel_win32_new_pipe (int fd);
 
/* An IO channel for a pipe as returned from the MSVCRT _pipe(), with
* Windows user messages used to signal data in the pipe for the
* reader.
*
* fd is the file descriptor. For the write end, peer is the thread id
* of the reader, and peer_fd is his file descriptor for the read end
* of the pipe.
*
* This is used by the GIMP, and works.
*/
GIOChannel *g_io_channel_win32_new_pipe_with_wakeups (int fd,
guint peer,
int peer_fd);
 
void g_io_channel_win32_pipe_request_wakeups (GIOChannel *channel,
guint peer,
int peer_fd);
 
void g_io_channel_win32_pipe_readable (int fd,
guint offset);
 
/* Get the C runtime file descriptor of a channel. */
gint g_io_channel_win32_get_fd (GIOChannel *channel);
 
/* An IO channel for a SOCK_STREAM winsock socket. The parameter is
* actually a SOCKET.
*/
GIOChannel *g_io_channel_win32_new_stream_socket (int socket);
 
#endif
 
/* Windows emulation stubs for common Unix functions
*/
#ifdef NATIVE_WIN32
# define MAXPATHLEN 1024
# ifdef _MSC_VER
typedef int pid_t;
 
/* These POSIXish functions are available in the Microsoft C library
* prefixed with underscore (which of course technically speaking is
* the Right Thing, as they are non-ANSI. Not that being non-ANSI
* prevents Microsoft from practically requiring you to include
* <windows.h> every now and then...).
*
* You still need to include the appropriate headers to get the
* prototypes, <io.h> or <direct.h>.
*
* For some functions, we provide emulators in glib, which are prefixed
* with gwin_.
*/
# define getcwd _getcwd
# define getpid _getpid
# define access _access
# define open _open
# define read _read
# define write _write
# define lseek _lseek
# define close _close
# define pipe(phandles) _pipe (phandles, 4096, _O_BINARY)
# define popen _popen
# define pclose _pclose
# define fdopen _fdopen
# define ftruncate(fd, size) gwin_ftruncate (fd, size)
# define opendir gwin_opendir
# define readdir gwin_readdir
# define rewinddir gwin_rewinddir
# define closedir gwin_closedir
# define NAME_MAX 255
struct DIR
{
gchar *dir_name;
gboolean just_opened;
guint find_file_handle;
gpointer find_file_data;
};
typedef struct DIR DIR;
struct dirent
{
gchar d_name[NAME_MAX + 1];
};
/* emulation functions */
extern int gwin_ftruncate (gint f,
guint size);
DIR* gwin_opendir (const gchar *dirname);
struct dirent* gwin_readdir (DIR *dir);
void gwin_rewinddir (DIR *dir);
gint gwin_closedir (DIR *dir);
# endif /* _MSC_VER */
#endif /* NATIVE_WIN32 */
 
 
/* GLib Thread support
*/
typedef struct _GMutex GMutex;
typedef struct _GCond GCond;
typedef struct _GPrivate GPrivate;
typedef struct _GStaticPrivate GStaticPrivate;
typedef struct _GThreadFunctions GThreadFunctions;
struct _GThreadFunctions
{
GMutex* (*mutex_new) (void);
void (*mutex_lock) (GMutex *mutex);
gboolean (*mutex_trylock) (GMutex *mutex);
void (*mutex_unlock) (GMutex *mutex);
void (*mutex_free) (GMutex *mutex);
GCond* (*cond_new) (void);
void (*cond_signal) (GCond *cond);
void (*cond_broadcast) (GCond *cond);
void (*cond_wait) (GCond *cond,
GMutex *mutex);
gboolean (*cond_timed_wait) (GCond *cond,
GMutex *mutex,
GTimeVal *end_time);
void (*cond_free) (GCond *cond);
GPrivate* (*private_new) (GDestroyNotify destructor);
gpointer (*private_get) (GPrivate *private_key);
void (*private_set) (GPrivate *private_key,
gpointer data);
};
 
GUTILS_C_VAR GThreadFunctions g_thread_functions_for_glib_use;
GUTILS_C_VAR gboolean g_thread_use_default_impl;
GUTILS_C_VAR gboolean g_threads_got_initialized;
 
/* initializes the mutex/cond/private implementation for glib, might
* only be called once, and must not be called directly or indirectly
* from another glib-function, e.g. as a callback.
*/
void g_thread_init (GThreadFunctions *vtable);
 
/* internal function for fallback static mutex implementation */
GMutex* g_static_mutex_get_mutex_impl (GMutex **mutex);
 
/* shorthands for conditional and unconditional function calls */
#define G_THREAD_UF(name, arglist) \
(*g_thread_functions_for_glib_use . name) arglist
#define G_THREAD_CF(name, fail, arg) \
(g_thread_supported () ? G_THREAD_UF (name, arg) : (fail))
/* keep in mind, all those mutexes and static mutexes are not
* recursive in general, don't rely on that
*/
#define g_thread_supported() (g_threads_got_initialized)
#define g_mutex_new() G_THREAD_UF (mutex_new, ())
#define g_mutex_lock(mutex) G_THREAD_CF (mutex_lock, (void)0, (mutex))
#define g_mutex_trylock(mutex) G_THREAD_CF (mutex_trylock, TRUE, (mutex))
#define g_mutex_unlock(mutex) G_THREAD_CF (mutex_unlock, (void)0, (mutex))
#define g_mutex_free(mutex) G_THREAD_CF (mutex_free, (void)0, (mutex))
#define g_cond_new() G_THREAD_UF (cond_new, ())
#define g_cond_signal(cond) G_THREAD_CF (cond_signal, (void)0, (cond))
#define g_cond_broadcast(cond) G_THREAD_CF (cond_broadcast, (void)0, (cond))
#define g_cond_wait(cond, mutex) G_THREAD_CF (cond_wait, (void)0, (cond, \
mutex))
#define g_cond_free(cond) G_THREAD_CF (cond_free, (void)0, (cond))
#define g_cond_timed_wait(cond, mutex, abs_time) G_THREAD_CF (cond_timed_wait, \
TRUE, \
(cond, mutex, \
abs_time))
#define g_private_new(destructor) G_THREAD_UF (private_new, (destructor))
#define g_private_get(private_key) G_THREAD_CF (private_get, \
((gpointer)private_key), \
(private_key))
#define g_private_set(private_key, value) G_THREAD_CF (private_set, \
(void) (private_key = \
(GPrivate*) (value)), \
(private_key, value))
/* GStaticMutexes can be statically initialized with the value
* G_STATIC_MUTEX_INIT, and then they can directly be used, that is
* much easier, than having to explicitly allocate the mutex before
* use
*/
#define g_static_mutex_lock(mutex) \
g_mutex_lock (g_static_mutex_get_mutex (mutex))
#define g_static_mutex_trylock(mutex) \
g_mutex_trylock (g_static_mutex_get_mutex (mutex))
#define g_static_mutex_unlock(mutex) \
g_mutex_unlock (g_static_mutex_get_mutex (mutex))
struct _GStaticPrivate
{
guint index;
};
#define G_STATIC_PRIVATE_INIT { 0 }
gpointer g_static_private_get (GStaticPrivate *private_key);
void g_static_private_set (GStaticPrivate *private_key,
gpointer data,
GDestroyNotify notify);
 
/* these are some convenience macros that expand to nothing if GLib
* was configured with --disable-threads. for using StaticMutexes,
* you define them with G_LOCK_DEFINE_STATIC (name) or G_LOCK_DEFINE (name)
* if you need to export the mutex. With G_LOCK_EXTERN (name) you can
* declare such an globally defined lock. name is a unique identifier
* for the protected varibale or code portion. locking, testing and
* unlocking of such mutexes can be done with G_LOCK(), G_UNLOCK() and
* G_TRYLOCK() respectively.
*/
extern void glib_dummy_decl (void);
#define G_LOCK_NAME(name) (g__ ## name ## _lock)
#ifdef G_THREADS_ENABLED
# define G_LOCK_DEFINE_STATIC(name) static G_LOCK_DEFINE (name)
# define G_LOCK_DEFINE(name) \
GStaticMutex G_LOCK_NAME (name) = G_STATIC_MUTEX_INIT
# define G_LOCK_EXTERN(name) extern GStaticMutex G_LOCK_NAME (name)
 
# ifdef G_DEBUG_LOCKS
# define G_LOCK(name) G_STMT_START{ \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"file %s: line %d (%s): locking: %s ", \
__FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \
#name); \
g_static_mutex_lock (&G_LOCK_NAME (name)); \
}G_STMT_END
# define G_UNLOCK(name) G_STMT_START{ \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"file %s: line %d (%s): unlocking: %s ", \
__FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \
#name); \
g_static_mutex_unlock (&G_LOCK_NAME (name)); \
}G_STMT_END
# define G_TRYLOCK(name) G_STMT_START{ \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"file %s: line %d (%s): try locking: %s ", \
__FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \
#name); \
}G_STMT_END, g_static_mutex_trylock (&G_LOCK_NAME (name))
# else /* !G_DEBUG_LOCKS */
# define G_LOCK(name) g_static_mutex_lock (&G_LOCK_NAME (name))
# define G_UNLOCK(name) g_static_mutex_unlock (&G_LOCK_NAME (name))
# define G_TRYLOCK(name) g_static_mutex_trylock (&G_LOCK_NAME (name))
# endif /* !G_DEBUG_LOCKS */
#else /* !G_THREADS_ENABLED */
# define G_LOCK_DEFINE_STATIC(name) extern void glib_dummy_decl (void)
# define G_LOCK_DEFINE(name) extern void glib_dummy_decl (void)
# define G_LOCK_EXTERN(name) extern void glib_dummy_decl (void)
# define G_LOCK(name)
# define G_UNLOCK(name)
# define G_TRYLOCK(name) (FALSE)
#endif /* !G_THREADS_ENABLED */
 
#ifdef __cplusplus
}
#endif /* __cplusplus */
 
 
#endif /* __G_LIB_H__ */
/contrib/media/updf/include/glib/glibconfig.h
0,0 → 1,121
/* glibconfig.h
*
* This is a generated file. Please modify `configure.in'
*/
 
#ifndef GLIBCONFIG_H
#define GLIBCONFIG_H
 
#include <limits.h>
#include <float.h>
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
#define G_MINFLOAT FLT_MIN
#define G_MAXFLOAT FLT_MAX
#define G_MINDOUBLE DBL_MIN
#define G_MAXDOUBLE DBL_MAX
#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
 
typedef signed char gint8;
typedef unsigned char guint8;
typedef signed short gint16;
typedef unsigned short guint16;
typedef signed int gint32;
typedef unsigned int guint32;
 
#if defined (__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
# define G_GNUC_EXTENSION __extension__
#else
# define G_GNUC_EXTENSION
#endif
 
#define G_HAVE_GINT64 1
 
G_GNUC_EXTENSION typedef signed long long gint64;
G_GNUC_EXTENSION typedef unsigned long long guint64;
 
#define G_GINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##LL))
 
#define GPOINTER_TO_INT(p) ((gint) (p))
#define GPOINTER_TO_UINT(p) ((guint) (p))
 
#define GINT_TO_POINTER(i) ((gpointer) (i))
#define GUINT_TO_POINTER(u) ((gpointer) (u))
 
#ifdef NeXT /* @#%@! NeXTStep */
# define g_ATEXIT(proc) (!atexit (proc))
#else
# define g_ATEXIT(proc) (atexit (proc))
#endif
 
#define g_memmove(d,s,n) G_STMT_START { memmove ((d), (s), (n)); } G_STMT_END
 
#define GLIB_MAJOR_VERSION 1
#define GLIB_MINOR_VERSION 2
#define GLIB_MICRO_VERSION 10
 
 
#define G_VA_COPY va_copy
 
#ifdef __cplusplus
#define G_HAVE_INLINE 1
#else /* !__cplusplus */
#define G_HAVE_INLINE 1
#define G_HAVE___INLINE 1
#define G_HAVE___INLINE__ 1
#endif /* !__cplusplus */
 
#define G_THREADS_ENABLED
#define G_THREADS_IMPL_NONE
typedef struct _GMutex* GStaticMutex;
#define G_STATIC_MUTEX_INIT NULL
#define g_static_mutex_get_mutex(mutex) (g_static_mutex_get_mutex_impl (mutex))
 
#define GINT16_TO_LE(val) ((gint16) (val))
#define GUINT16_TO_LE(val) ((guint16) (val))
#define GINT16_TO_BE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
#define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val))
#define GINT32_TO_LE(val) ((gint32) (val))
#define GUINT32_TO_LE(val) ((guint32) (val))
#define GINT32_TO_BE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
#define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val))
#define GINT64_TO_LE(val) ((gint64) (val))
#define GUINT64_TO_LE(val) ((guint64) (val))
#define GINT64_TO_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
#define GUINT64_TO_BE(val) (GUINT64_SWAP_LE_BE (val))
#define GLONG_TO_LE(val) ((glong) GINT32_TO_LE (val))
#define GULONG_TO_LE(val) ((gulong) GUINT32_TO_LE (val))
#define GLONG_TO_BE(val) ((glong) GINT32_TO_BE (val))
#define GULONG_TO_BE(val) ((gulong) GUINT32_TO_BE (val))
#define GINT_TO_LE(val) ((gint) GINT32_TO_LE (val))
#define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val))
#define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val))
#define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val))
#define G_BYTE_ORDER G_LITTLE_ENDIAN
 
#define GLIB_SYSDEF_POLLIN =1
#define GLIB_SYSDEF_POLLOUT =4
#define GLIB_SYSDEF_POLLPRI =2
#define GLIB_SYSDEF_POLLERR =8
#define GLIB_SYSDEF_POLLHUP =16
#define GLIB_SYSDEF_POLLNVAL =32
 
 
#define G_HAVE_WCHAR_H 1
#define G_HAVE_WCTYPE_H 1
#define G_HAVE_BROKEN_WCTYPE 1
 
 
#ifdef __cplusplus
}
#endif /* __cplusplus */
 
#endif /* GLIBCONFIG_H */
/contrib/media/updf/include/glob.h
0,0 → 1,53
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_glob_h_
#define __dj_include_glob_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#include <sys/djtypes.h>
 
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
typedef struct {
size_t gl_pathc;
char **gl_pathv;
size_t gl_offs;
} glob_t;
 
#define GLOB_APPEND 0x01
#define GLOB_DOOFFS 0x02
#define GLOB_ERR 0x04
#define GLOB_MARK 0x08
#define GLOB_NOCHECK 0x10
#define GLOB_NOESCAPE 0x20
#define GLOB_NOSORT 0x40
 
#define GLOB_ABORTED 1
#define GLOB_NOMATCH 2
#define GLOB_NOSPACE 3
 
int glob(const char *_pattern, int _flags, int (*_errfunc)(const char *_epath, int _eerrno), glob_t *_pglob);
void globfree(glob_t *_pglob);
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_glob_h_ */
/contrib/media/updf/include/glview.h
0,0 → 1,196
/*******************************************************************************
/
/ File: GLView.h
/
/ Copyright 1993-98, Be Incorporated, All Rights Reserved.
/
*******************************************************************************/
 
#ifndef BGLVIEW_H
#define BGLVIEW_H
 
// added by Brian Paul:
#ifndef BGL_RGB
#define BGL_RGB 0
#define BGL_INDEX 1
#define BGL_SINGLE 0
#define BGL_DOUBLE 2
#define BGL_DIRECT 0
#define BGL_INDIRECT 4
#define BGL_ACCUM 8
#define BGL_ALPHA 16
#define BGL_DEPTH 32
#define BGL_OVERLAY 64
#define BGL_UNDERLAY 128
#define BGL_STENCIL 512
#endif
 
 
#include <GL/gl.h>
#include <AppKit.h>
#include <interface/Window.h>
#include <interface/View.h>
#include <interface/Bitmap.h>
#include <game/WindowScreen.h>
#include <game/DirectWindow.h>
 
class BGLView : public BView {
public:
 
BGLView(BRect rect, char *name,
ulong resizingMode, ulong mode,
ulong options);
virtual ~BGLView();
 
void LockGL();
void UnlockGL();
void SwapBuffers();
 
// Added for Mesa (can't be virtual!)
void CopySubBufferMESA(GLint x, GLint y, GLuint width, GLuint height);
 
BView * EmbeddedView();
status_t CopyPixelsOut(BPoint source, BBitmap *dest);
status_t CopyPixelsIn(BBitmap *source, BPoint dest);
 
virtual void ErrorCallback(GLenum errorCode);
virtual void Draw(BRect updateRect);
 
virtual void AttachedToWindow();
virtual void AllAttached();
virtual void DetachedFromWindow();
virtual void AllDetached();
virtual void FrameResized(float width, float height);
virtual status_t Perform(perform_code d, void *arg);
 
/* The public methods below, for the moment,
are just pass-throughs to BView */
 
virtual status_t Archive(BMessage *data, bool deep = true) const;
 
virtual void MessageReceived(BMessage *msg);
virtual void SetResizingMode(uint32 mode);
 
virtual void Show();
virtual void Hide();
 
virtual BHandler *ResolveSpecifier(BMessage *msg, int32 index,
BMessage *specifier, int32 form,
const char *property);
virtual status_t GetSupportedSuites(BMessage *data);
 
/* New public functions */
void DirectConnected( direct_buffer_info *info );
void EnableDirectMode( bool enabled );
 
private:
 
virtual void _ReservedGLView1();
virtual void _ReservedGLView2();
virtual void _ReservedGLView3();
virtual void _ReservedGLView4();
virtual void _ReservedGLView5();
virtual void _ReservedGLView6();
virtual void _ReservedGLView7();
virtual void _ReservedGLView8();
 
BGLView(const BGLView &);
BGLView &operator=(const BGLView &);
 
void dither_front();
bool confirm_dither();
void draw(BRect r);
void * m_gc;
uint32 m_options;
uint32 m_ditherCount;
BLocker m_drawLock;
BLocker m_displayLock;
#if OLD_GLVIEW
BView * m_embeddedFront;
BView * m_embeddedBack;
#else
void * m_clip_info;
void * _reserved1;
#endif
BBitmap * m_ditherMap;
BRect m_bounds;
int16 * m_errorBuffer[2];
uint64 _reserved[8];
 
/* Direct Window stuff */
private:
void drawScanline( int x1, int x2, int y, void *data );
static void scanlineHandler(struct rasStateRec *state, GLint x1, GLint x2);
void lock_draw();
void unlock_draw();
bool validateView();
};
 
 
 
class BGLScreen : public BWindowScreen {
public:
BGLScreen(char *name,
ulong screenMode, ulong options,
status_t *error, bool debug=false);
~BGLScreen();
 
void LockGL();
void UnlockGL();
void SwapBuffers();
virtual void ErrorCallback(GLenum errorCode);
 
virtual void ScreenConnected(bool connected);
virtual void FrameResized(float width, float height);
virtual status_t Perform(perform_code d, void *arg);
 
/* The public methods below, for the moment,
are just pass-throughs to BWindowScreen */
 
virtual status_t Archive(BMessage *data, bool deep = true) const;
virtual void MessageReceived(BMessage *msg);
 
virtual void Show();
virtual void Hide();
 
virtual BHandler *ResolveSpecifier(BMessage *msg,
int32 index,
BMessage *specifier,
int32 form,
const char *property);
virtual status_t GetSupportedSuites(BMessage *data);
 
private:
 
virtual void _ReservedGLScreen1();
virtual void _ReservedGLScreen2();
virtual void _ReservedGLScreen3();
virtual void _ReservedGLScreen4();
virtual void _ReservedGLScreen5();
virtual void _ReservedGLScreen6();
virtual void _ReservedGLScreen7();
virtual void _ReservedGLScreen8();
 
BGLScreen(const BGLScreen &);
BGLScreen &operator=(const BGLScreen &);
 
void * m_gc;
long m_options;
BLocker m_drawLock;
int32 m_colorSpace;
uint32 m_screen_mode;
uint64 _reserved[7];
};
 
 
#endif
 
 
 
 
 
/contrib/media/updf/include/gnu/stubs.h
0,0 → 1,54
/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_stubs_h__
#define __dj_include_libc_stubs_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* POSIX functions (for when compiling an ANSI function) */
 
/* DJGPP functions (for compiling POSIX or ANSI functions) */
#define crlf2nl __crlf2nl
#define dosmemget __dosmemget
#define dosmemput __dosmemput
#define filelength __filelength
#define findfirst __findfirst
#define findnext __findnext
#define fsync __fsync
#define getdisk __getdisk
#define getdtablesize __getdtablesize
#define getitimer __getitimer
#define gettimeofday __gettimeofday
#define modfl __modfl
#define movedata __movedata
#define pow10 __pow10
#define pow2 __pow2
#define putenv __putenv
#define sbrk __sbrk
#define setitimer __setitimer
#define setmode __setmode
#define spawnve __spawnve
#define spawnvpe __spawnvpe
#define stricmp __stricmp
#define sync __sync
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_libc_stubs_h__ */
/contrib/media/updf/include/gppconio.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_gppconio_h_
#define __dj_include_gppconio_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <conio.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_gppconio_h_ */
/contrib/media/updf/include/grower.h
0,0 → 1,295
/** \file grower.h Template class that implements dynamic growing arrays.
* Yacas implements its own growing array class to ensure correct behaviour
* on all platforms (stl was still in development and not supported on all
* platforms when development started).
*
* grower started 1998 ayal Pinkus
*
*/
#ifndef _GROWER_H_
#define _GROWER_H_
 
#include "yacasbase.h"
#include "lispassert.h"
 
 
 
// Default placement versions of operator new and delete, placed here because I do not want to include <new>
inline void* operator new(size_t, void* __p) throw() { return __p; }
inline void* operator new[](size_t, void* __p) throw() { return __p; }
inline void operator delete (void*, void*) throw() { }
inline void operator delete[](void*, void*) throw() { }
 
 
template <class T>
inline void constructAt(void * to_obj, const T * from_obj)
{
new (to_obj) T(*from_obj);
}
 
class ArrOps
{
public:
virtual bool isPOD() const { return false; }
virtual void construct(void * buffer) const = 0;
virtual void construct(void * to_obj, const void * from_obj) const = 0;
virtual void destruct(void * obj) const = 0;
virtual int granularity() const { return 8; }
static void resize(char** pArray, const ArrOps& opers, int& iSize, int& iCapacity, int aSize, int aItemSize, int ext);
static void remove(char** pArray, const ArrOps& opers, int& iSize, int aIndex, int aCount, int aItemSize);
static void reserve(char** pArray, int& iCapacity, int aSize, int aItemSize);
//static void* insert(char** pArray, const ArrOps& opers, int& iSize, void* aData, int aIndex, int aCount, int aSize, int aExtSize);
};
 
template <class T>
class ArrOpsCustomObj : public ArrOps
{
public:
ArrOpsCustomObj() {}
inline void construct(void * buffer) const
{ new (buffer) T; }
inline void construct(void * to_obj, const void * from_obj) const
{ constructAt(to_obj, static_cast<const T*>(from_obj)); }
inline void destruct(void * obj) const
{ /*obj;*/ static_cast<T*>(obj)->~T(); }
//inline int size() const { return sizeof(T); }
};
 
template <class T>
class ArrOpsPOD : public ArrOps
{
public:
ArrOpsPOD() {}
inline bool isPOD() const { return true; }
inline void construct(void * buffer) const {}
inline void construct(void * to_obj, const void * from_obj) const
{ *static_cast<T*>(to_obj) = *static_cast<const T*>(from_obj); }
inline void destruct(void * obj) const {}
//inline int size() const { return sizeof(T); }
};
 
template <class T>
class ArrOpsCustomPtr : public ArrOps
{
typedef T* TY;
public:
ArrOpsCustomPtr() {}
inline void construct(void * buffer) const
{ *static_cast<TY*>(buffer) = 0; }
inline void construct(void * to_obj, const void * from_obj) const
{ *static_cast<TY*>(to_obj) = *static_cast<const TY*>(from_obj); }
inline void destruct(void * obj) const {}
//inline int size() const { return sizeof(TY); }
inline int granularity() const { return 8; }
};
 
template <class T>
class ArrOpsDeletingObj {};
 
template <class T>
class ArrOpsDeletingPtr : public ArrOpsCustomPtr<T>
{
typedef T* TY;
public:
inline void destruct(void * obj) const
{ delete *static_cast<const TY*>(obj); }
};
 
/** template class useful for implementing a dynamic growing array
* for any arbitrary type of object. If using the array to maintain
* objects, please use pointers to the objects, and use the
* CDeletingArrayGrower to automatically delete the objects at destruction.
*/
template <class T, class TOps >
class CArrayGrower : public YacasBase
{
public:
/** ElementType can be used outside this class as the type of the
* object in the array. This is useful in templated functions that
* work on a CArrayGrower without being part of CArrayGrower
*/
typedef LispInt SizeType;
typedef T ElementType;
 
CArrayGrower()
: iArray(0)
, iSize(0)
, iCapacity(0)
, iArrayOwnedExternally(LispFalse)
{
}
virtual ~CArrayGrower()
{
Clear();
}
inline void Clear() // oddly, only *one* use outside destructor!?
{
if (iSize)
{
const TOps opers;
if(!opers.isPOD())
{
while (iSize)
opers.destruct(iArray + --iSize);
}
}
if (!iArrayOwnedExternally)
{
PlatFree(iArray);
}
iArray = 0;
iCapacity = iSize = 0;
iArrayOwnedExternally = LispFalse;
}
inline SizeType Size() const { return iSize; }
 
inline CArrayGrower(const CArrayGrower<T,TOps>& aOther)
: iArray(0)
, iSize(0)
, iCapacity(0)
, iArrayOwnedExternally(LispFalse)
{
// Make sure we're not accidentally copying a huge array. We want this system to stay efficient...
LISPASSERT(aOther.iSize == 0);
LISPASSERT(aOther.iArrayOwnedExternally == LispFalse);
}
 
inline const CArrayGrower<T,TOps>& operator=(const CArrayGrower<T,TOps>& aOther)
{
// Make sure we're not accidentally copying a huge array. We want this system to stay efficient...
LISPASSERT(iArray == 0);
LISPASSERT(iSize == 0);
LISPASSERT(iCapacity == 0);
LISPASSERT(iArrayOwnedExternally == LispFalse);
 
LISPASSERT(aOther.iSize == 0);
LISPASSERT(aOther.iArrayOwnedExternally == LispFalse);
return *this;
}
 
private:
 
void moreCapacity(SizeType aSize, int g) // almost independent of T
{
LISPASSERT(!iArrayOwnedExternally);
LISPASSERT(iCapacity >= 0);
// Compute a new iCapacity >= aSize, with iCapacity % g == 0.
// We assume g is a power of 2. (fwiw, in two's-complement, ~(g-1) == -g.
iCapacity = (aSize + g) & ~(g-1);
if (!iArray)
{
iArray = (ElementType*)PlatAlloc(iCapacity*sizeof(ElementType));
}
else
{
// we assume 'memcpy' suffices for moving the existing items.
iArray = (ElementType*)PlatReAlloc(iArray,iCapacity*sizeof(ElementType));
}
}
public:
inline void ResizeTo(SizeType aSize)
{
LISPASSERT(!iArrayOwnedExternally);
TOps opers;
if (aSize > iCapacity)
{
moreCapacity(aSize, opers.granularity());
}
if (!opers.isPOD())
{
if (iSize < aSize)
{
for (int ii = iSize; ii < aSize; ii++)
opers.construct(iArray + ii);
}
else
{
for (int ii = aSize; ii < iSize; ii++)
opers.destruct(iArray + ii);
}
}
iSize = aSize;
}
void Delete(SizeType aIndex, SizeType aCount=1)
{
LISPASSERT(aIndex>=0 && aIndex<iSize);
ArrOps::remove((char**)&iArray, TOps(), iSize, aIndex, aCount, sizeof(ElementType));
}
inline LispBoolean ArrayOwnedExternally()
{
return iArrayOwnedExternally;
}
public:
/// Access to an element in the array
inline ElementType& operator[](const SizeType aIndex) const
{
return iArray[aIndex];
}
 
/// Append an element to an array
template <class Type>
inline void Append(const Type& aVal)
{
if (iSize >= iCapacity) moreCapacity(iSize+1, TOps().granularity());
new ((void *)(iArray+iSize)) ElementType(aVal);
++iSize;
}
 
/// Insert object aObj at aIndex, aCount times.
inline void Insert(SizeType aIndex, const ElementType& aObj, SizeType aCount=1)
{
const SizeType oldItems = iSize;
LISPASSERT(aIndex <= oldItems && aCount >= 0);
ResizeTo(iSize+aCount);
ElementType * pOld = iArray+oldItems;
ElementType * pEnd = iArray+iSize;
int i = iSize - aIndex; // = (oldItems - aIndex) + aCount
for ( ; i > aCount; i--)
*--pEnd = *--pOld;
while (i-- > 0)
*--pEnd = aObj;
}
 
/** Set the array to an external array. This means the array will
* not be freed at destruction time
*/
inline void SetExternalArray(ElementType* aArray, SizeType aSize)
{
LISPASSERT(!iArray || iArrayOwnedExternally == LispTrue);
iArray = aArray;
iSize = aSize;
iArrayOwnedExternally = LispTrue;
iCapacity = -10000; // Setting iCapacity should not strictly be necessary, setting it to hugely negative number will hopefully force a fail.
}
 
/// Copy the array to another array
inline void CopyToExternalArray(ElementType * aArray)
{
PlatMemCopy(aArray,iArray,iSize*sizeof(ElementType));
}
 
protected:
inline ElementType * elements() const { return iArray; }
private:
ElementType * iArray;
SizeType iSize;
SizeType iCapacity;
LispBoolean iArrayOwnedExternally;
};
 
/** \class CDeletingArrayGrower calls delete on each element in the
* array at destruction time. This is useful if the array is a list
* of pointers to objects.
*/
 
template <class T, class TOps >
class CDeletingArrayGrower : public CArrayGrower<T, TOps >
{
public:
CDeletingArrayGrower() {}
};
 
#endif
 
 
/contrib/media/updf/include/grp.h
0,0 → 1,45
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_grp_h_
#define __dj_include_grp_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#include <sys/djtypes.h>
__DJ_gid_t
#undef __DJ_gid_t
#define __DJ_gid_t
 
struct group {
gid_t gr_gid;
char ** gr_mem;
char * gr_name;
};
 
struct group * getgrgid(gid_t _gid);
struct group * getgrnam(const char *_name);
 
#ifndef _POSIX_SOURCE
 
void endgrent(void);
struct group * getgrent(void);
struct group * fgetgrent(void *_f);
void setgrent(void);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_grp_h_ */
/contrib/media/updf/include/hash.h
0,0 → 1,35
/*
** hash.h
** hash manager for lua
** Luiz Henrique de Figueiredo - 17 Aug 90
** Modified by Waldemar Celes Filho
** 26 Apr 93
*/
 
#ifndef hash_h
#define hash_h
 
typedef struct node
{
Object ref;
Object val;
struct node *next;
} Node;
 
typedef struct Hash
{
char mark;
unsigned int nhash;
Node **list;
} Hash;
 
#define markarray(t) ((t)->mark)
 
Hash *lua_hashcreate (unsigned int nhash);
void lua_hashdelete (Hash *h);
Object *lua_hashdefine (Hash *t, Object *ref);
void lua_hashmark (Hash *h);
 
void lua_next (void);
 
#endif
/contrib/media/updf/include/hashsize.h
0,0 → 1,6
/*
* hashsize.h -- hash and token table constants
*/
 
#define CAPTABSIZE 495
#define HASHTABSIZE (495 * 2)
/contrib/media/updf/include/iAVLTree.h
0,0 → 1,67
/*
* iAVLTree.h: Header file for AVLTrees with long integer keys.
* Copyright (C) 1998 Michael H. Buselli
*
* 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
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* The author of this library can be reached at the following address:
* Michael H. Buselli
* 4334 N. Hazel St. #515
* Chicago, IL 60613-1456
*
* Or you can send email to <cosine@tezcat.com>.
* The official web page for this product is:
* http://www.tezcat.com/~cosine/pub/AVLTree/
*
* This is version 0.1.0 (alpha).
*/
 
#ifndef _IAVLTREE_H_
#define _IAVLTREE_H_
 
 
typedef struct _iAVLNode {
long key;
long depth;
void *item;
struct _iAVLNode *parent;
struct _iAVLNode *left;
struct _iAVLNode *right;
} iAVLNode;
 
 
typedef struct {
iAVLNode *top;
long count;
long (*getkey)(const void *item);
} iAVLTree;
 
 
typedef struct {
const iAVLTree *avltree;
const iAVLNode *curnode;
} iAVLCursor;
 
 
extern iAVLTree *iAVLAllocTree (long (*getkey)(void const *item));
extern void iAVLFreeTree (iAVLTree *avltree, void (freeitem)(void *item));
extern int iAVLInsert (iAVLTree *avltree, void *item);
extern void *iAVLSearch (iAVLTree const *avltree, long key);
extern int iAVLDelete (iAVLTree *avltree, long key);
extern void *iAVLFirst (iAVLCursor *avlcursor, iAVLTree const *avltree);
extern void *iAVLNext (iAVLCursor *avlcursor);
 
 
#endif
/contrib/media/updf/include/ieeefp.h
0,0 → 1,88
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_ieeefp_h_
#define __dj_include_ieeefp_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include <sys/cdefs.h>
 
/* #include <machine/ieeefp.h> */
#include <machine/endian.h>
#if BYTE_ORDER == LITTLE_ENDIAN
# define __IEEE_LITTLE_ENDIAN
#endif
 
/* FLOATING ROUNDING */
 
typedef int fp_rnd;
#define FP_RN 0 /* Round to nearest */
#define FP_RM 1 /* Round down */
#define FP_RP 2 /* Round up */
#define FP_RZ 3 /* Round to zero (truncate) */
 
fp_rnd _EXFUN(fpgetround,(void));
fp_rnd _EXFUN(fpsetround, (fp_rnd));
 
/* EXCEPTIONS */
 
typedef int fp_except;
#define FP_X_INV 0x10 /* Invalid operation */
#define FP_X_DX 0x80 /* Divide by zero */
#define FP_X_OFL 0x04 /* Overflow exception */
#define FP_X_UFL 0x02 /* Underflow exception */
#define FP_X_IMP 0x01 /* Imprecise exception */
 
fp_except _EXFUN(fpgetmask,(void));
fp_except _EXFUN(fpsetmask,(fp_except));
fp_except _EXFUN(fpgetsticky,(void));
fp_except _EXFUN(fpsetsticky, (fp_except));
 
/* INTEGER ROUNDING */
 
typedef int fp_rdi;
#define FP_RDI_TOZ 0 /* Round to Zero */
#define FP_RDI_RD 1 /* Follow float mode */
 
fp_rdi _EXFUN(fpgetroundtoi,(void));
fp_rdi _EXFUN(fpsetroundtoi,(fp_rdi));
 
int _EXFUN(isnan, (double));
int _EXFUN(isinf, (double));
int _EXFUN(finite, (double));
 
int _EXFUN(isnanf, (float));
int _EXFUN(isinff, (float));
int _EXFUN(finitef, (float));
 
#define __IEEE_DBL_EXPBIAS 1023
#define __IEEE_FLT_EXPBIAS 127
 
#define __IEEE_DBL_EXPLEN 11
#define __IEEE_FLT_EXPLEN 8
 
 
#define __IEEE_DBL_FRACLEN (64 - (__IEEE_DBL_EXPLEN + 1))
#define __IEEE_FLT_FRACLEN (32 - (__IEEE_FLT_EXPLEN + 1))
 
#define __IEEE_DBL_MAXPOWTWO ((double)(1L << 32 - 2) * (1L << (32-11) - 32 + 1))
#define __IEEE_FLT_MAXPOWTWO ((float)(1L << (32-8) - 1))
 
#define __IEEE_DBL_NAN_EXP 0x7ff
#define __IEEE_FLT_NAN_EXP 0xff
 
 
#define isnanf(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \
((*(long *)&(x) & 0x007fffffL)!=0000000000L))
 
#define isinff(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \
((*(long *)&(x) & 0x007fffffL)==0000000000L))
 
#define finitef(x) (((*(long *)&(x) & 0x7f800000L)!=0x7f800000L))
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_ieeefp_h_ */
/contrib/media/updf/include/image.h
0,0 → 1,48
/*
* Copyright (c) 2005, Hervé Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __IMAGE_H
#define __IMAGE_H
/**
@file image.h
@brief Implementation of operations on images (IMAGE)
 
The functions in IMAGE.C have for goal to realize operations on images.
*/
 
/** @defgroup IMAGE IMAGE - Implementation of operations on images */
/*@{*/
 
/**
Create an empty image
@todo this function should be removed
@return returns an empty image if successful, returns NULL otherwise
*/
opj_image_t* opj_image_create0(void);
 
/*@}*/
 
#endif /* __IMAGE_H */
 
/contrib/media/updf/include/infixparser.h
0,0 → 1,139
/** \file infixparser.h
* parsing and printing in the infix style.
*
*/
 
 
#ifndef __infixparser_h__
#define __infixparser_h__
 
#include "yacasbase.h"
#include "lispparser.h"
 
 
#define KMaxPrecedence 60000
 
class LispInFixOperator : public YacasBase
{
public:
inline LispInFixOperator(LispInt aPrecedence)
: iPrecedence(aPrecedence),
iLeftPrecedence(aPrecedence),
iRightPrecedence(aPrecedence),
iRightAssociative(0)
{};
inline void SetRightAssociative(void)
{
iRightAssociative = 1;
}
inline void SetLeftPrecedence(LispInt aPrecedence)
{
iLeftPrecedence = aPrecedence;
}
inline void SetRightPrecedence(LispInt aPrecedence)
{
iRightPrecedence = aPrecedence;
}
public:
LispInt iPrecedence;
LispInt iLeftPrecedence;
LispInt iRightPrecedence;
LispInt iRightAssociative;
};
 
class LispOperators : public LispAssociatedHash<LispInFixOperator>
{
public:
void SetOperator(LispInt aPrecedence,LispString * aString);
void SetRightAssociative(LispString * aString);
void SetLeftPrecedence(LispString * aString,LispInt aPrecedence);
void SetRightPrecedence(LispString * aString,LispInt aPrecedence);
};
 
class InfixParser : public LispParser
{
public:
InfixParser(LispTokenizer& aTokenizer, LispInput& aInput,
LispEnvironment& aEnvironment,
LispOperators& aPrefixOperators,
LispOperators& aInfixOperators,
LispOperators& aPostfixOperators,
LispOperators& aBodiedOperators);
~InfixParser();
virtual void Parse(LispPtr& aResult);
//private:
void ParseCont(LispPtr& aResult);
public:
LispOperators& iPrefixOperators;
LispOperators& iInfixOperators;
LispOperators& iPostfixOperators;
LispOperators& iBodiedOperators;
 
// LispEnvironment* iEnvironment;
};
 
class ParsedObject : public YacasBase
{
public:
ParsedObject(InfixParser& aParser)
: iParser(aParser),
iError(LispFalse),
iEndOfFile(LispFalse),
iLookAhead(NULL),iResult() {};
void Parse();
private:
void ReadToken();
void MatchToken(LispString * aToken);
void ReadExpression(LispInt depth);
void ReadAtom();
private:
void GetOtherSide(LispInt aNrArgsToCombine, LispInt depth);
void Combine(LispInt aNrArgsToCombine);
void InsertAtom(LispString * aString);
private:
void Fail(); // called when parsing fails, raising an exception
 
private:
InfixParser& iParser;
private:
LispBoolean iError;
LispBoolean iEndOfFile;
LispString * iLookAhead;
public:
LispPtr iResult;
};
 
 
class InfixPrinter : public LispPrinter
{
public:
InfixPrinter(LispOperators& aPrefixOperators,
LispOperators& aInfixOperators,
LispOperators& aPostfixOperators,
LispOperators& aBodiedOperators)
: iPrefixOperators(aPrefixOperators),
iInfixOperators(aInfixOperators),
iPostfixOperators(aPostfixOperators),
iBodiedOperators(aBodiedOperators),
iPrevLastChar(0),iCurrentEnvironment(NULL){}
 
virtual void Print(LispPtr& aExpression, LispOutput& aOutput,
LispEnvironment& aEnvironment);
virtual void RememberLastChar(LispChar aChar);
private:
void Print(LispPtr& aExpression, LispOutput& aOutput,
LispInt iPrecedence);
void WriteToken(LispOutput& aOutput,LispChar * aString);
private:
LispOperators& iPrefixOperators;
LispOperators& iInfixOperators;
LispOperators& iPostfixOperators;
LispOperators& iBodiedOperators;
LispChar iPrevLastChar;
LispEnvironment* iCurrentEnvironment;
};
 
 
#endif
 
/contrib/media/updf/include/inlines/ctype.ha
0,0 → 1,35
#ifndef __dj_include_inline_ctype_ha_
#define __dj_include_inline_ctype_ha_
 
#define __dj_ISALNUM 0x0001
#define __dj_ISALPHA 0x0002
#define __dj_ISCNTRL 0x0004
#define __dj_ISDIGIT 0x0008
#define __dj_ISGRAPH 0x0010
#define __dj_ISLOWER 0x0020
#define __dj_ISPRINT 0x0040
#define __dj_ISPUNCT 0x0080
#define __dj_ISSPACE 0x0100
#define __dj_ISUPPER 0x0200
#define __dj_ISXDIGIT 0x0400
 
extern unsigned short __dj_ctype_flags[];
extern unsigned char __dj_ctype_toupper[];
extern unsigned char __dj_ctype_tolower[];
 
#define isalnum(c) (__dj_ctype_flags[(int)(c)+1] & __dj_ISALNUM)
#define isalpha(c) (__dj_ctype_flags[(int)(c)+1] & __dj_ISALPHA)
#define iscntrl(c) (__dj_ctype_flags[(int)(c)+1] & __dj_ISCNTRL)
#define isdigit(c) (__dj_ctype_flags[(int)(c)+1] & __dj_ISDIGIT)
#define isgraph(c) (__dj_ctype_flags[(int)(c)+1] & __dj_ISGRAPH)
#define islower(c) (__dj_ctype_flags[(int)(c)+1] & __dj_ISLOWER)
#define isprint(c) (__dj_ctype_flags[(int)(c)+1] & __dj_ISPRINT)
#define ispunct(c) (__dj_ctype_flags[(int)(c)+1] & __dj_ISPUNCT)
#define isspace(c) (__dj_ctype_flags[(int)(c)+1] & __dj_ISSPACE)
#define isupper(c) (__dj_ctype_flags[(int)(c)+1] & __dj_ISUPPER)
#define isxdigit(c) (__dj_ctype_flags[(int)(c)+1] & __dj_ISXDIGIT)
 
#define tolower(c) (__dj_ctype_tolower[(int)(c)+1])
#define toupper(c) (__dj_ctype_toupper[(int)(c)+1])
 
#endif /* __dj_include_inline_ctype_hi_ */
/contrib/media/updf/include/inlines/ctype.hd
0,0 → 1,7
#ifndef __dj_include_inline_ctype_hd_
#define __dj_include_inline_ctype_hd_
 
#define isascii(c) (!((c)&(~0x7f)))
#define toascii(c) ((c)&0x7f)
 
#endif
/contrib/media/updf/include/inlines/pc.h
0,0 → 1,54
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_Inline_pc_h_
#define __dj_include_Inline_pc_h_
 
#ifdef __GNUC__
 
#ifdef __cplusplus
extern "C" {
#endif
 
extern __inline__ unsigned char inportb (unsigned short _port)
{
unsigned char __ret;
__asm__ __volatile__("inb %%dx,%%al":"=a"(__ret):"d"(_port));
return __ret;
}
 
extern __inline__ unsigned short inportw (unsigned short _port)
{
unsigned short __ret;
__asm__ __volatile__("inw %%dx,%%ax":"=a"(__ret):"d"(_port));
return __ret;
}
 
extern __inline__ unsigned long inportl (unsigned short _port)
{
unsigned long __ret;
__asm__ __volatile__("inl %%dx,%%eax":"=a"(__ret):"d"(_port));
return __ret;
}
 
extern __inline__ void outportb (unsigned short _port, unsigned char _data)
{
__asm__ __volatile__("outb %%al,%%dx"::"a"(_data),"d"(_port));
}
 
extern __inline__ void outportw (unsigned short _port, unsigned short _data)
{
__asm__ __volatile__("outw %%ax,%%dx"::"a"(_data),"d"(_port));
}
 
extern __inline__ void outportl (unsigned short _port, unsigned long _data)
{
__asm__ __volatile__("outl %%eax,%%dx"::"a"(_data),"d"(_port));
}
 
#ifdef __cplusplus
}
#endif
 
#endif
 
#endif
/contrib/media/updf/include/inout.h
0,0 → 1,24
/*
** inout.h
**
** Waldemar Celes Filho
** TeCGraf - PUC-Rio
** 11 May 93
*/
 
 
#ifndef inout_h
#define inout_h
 
extern int lua_linenumber;
extern int lua_debug;
extern int lua_debugline;
 
int lua_openfile (char *fn);
void lua_closefile (void);
int lua_openstring (char *s);
int lua_pushfunction (int file, int function);
void lua_popfunction (void);
void lua_reportbug (char *s);
 
#endif
/contrib/media/updf/include/int.h
0,0 → 1,119
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __INT_H
#define __INT_H
/**
@file int.h
@brief Implementation of operations on integers (INT)
 
The functions in INT.H have for goal to realize operations on integers.
*/
 
/** @defgroup INT INT - Implementation of operations on integers */
/*@{*/
 
/** @name Exported functions (see also openjpeg.h) */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Get the minimum of two integers
@return Returns a if a < b else b
*/
static INLINE int int_min(int a, int b) {
return a < b ? a : b;
}
/**
Get the maximum of two integers
@return Returns a if a > b else b
*/
static INLINE int int_max(int a, int b) {
return (a > b) ? a : b;
}
/**
Clamp an integer inside an interval
@return
<ul>
<li>Returns a if (min < a < max)
<li>Returns max if (a > max)
<li>Returns min if (a < min)
</ul>
*/
static INLINE int int_clamp(int a, int min, int max) {
if (a < min)
return min;
if (a > max)
return max;
return a;
}
/**
@return Get absolute value of integer
*/
static INLINE int int_abs(int a) {
return a < 0 ? -a : a;
}
/**
Divide an integer and round upwards
@return Returns a divided by b
*/
static INLINE int int_ceildiv(int a, int b) {
return (a + b - 1) / b;
}
/**
Divide an integer by a power of 2 and round upwards
@return Returns a divided by 2^b
*/
static INLINE int int_ceildivpow2(int a, int b) {
return (a + (1 << b) - 1) >> b;
}
/**
Divide an integer by a power of 2 and round downwards
@return Returns a divided by 2^b
*/
static INLINE int int_floordivpow2(int a, int b) {
return a >> b;
}
/**
Get logarithm of an integer and round downwards
@return Returns log2(a)
*/
static INLINE int int_floorlog2(int a) {
int l;
for (l = 0; a > 1; l++) {
a >>= 1;
}
return l;
}
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif
/contrib/media/updf/include/inttypes.h
0,0 → 1,251
#ifndef _INTTYPES_H
#define _INTTYPES_H
 
#include <sys/cdefs.h>
#include <endian.h>
 
__BEGIN_DECLS
 
# if __WORDSIZE == 64
# define __PRI64_PREFIX "l"
# define __PRIPTR_PREFIX "l"
# else
# define __PRI64_PREFIX "ll"
# define __PRIPTR_PREFIX
# endif
 
/* Macros for printing format specifiers. */
 
/* Decimal notation. */
# define PRId8 "d"
# define PRId16 "d"
# define PRId32 "d"
# define PRId64 __PRI64_PREFIX "d"
 
# define PRIdLEAST8 "d"
# define PRIdLEAST16 "d"
# define PRIdLEAST32 "d"
# define PRIdLEAST64 __PRI64_PREFIX "d"
 
# define PRIdFAST8 "d"
# define PRIdFAST16 "d"
# define PRIdFAST32 "d"
# define PRIdFAST64 __PRI64_PREFIX "d"
 
 
# define PRIi8 "i"
# define PRIi16 "i"
# define PRIi32 "i"
# define PRIi64 __PRI64_PREFIX "i"
 
# define PRIiLEAST8 "i"
# define PRIiLEAST16 "i"
# define PRIiLEAST32 "i"
# define PRIiLEAST64 __PRI64_PREFIX "i"
 
# define PRIiFAST8 "i"
# define PRIiFAST16 "i"
# define PRIiFAST32 "i"
# define PRIiFAST64 __PRI64_PREFIX "i"
 
/* Octal notation. */
# define PRIo8 "o"
# define PRIo16 "o"
# define PRIo32 "o"
# define PRIo64 __PRI64_PREFIX "o"
 
# define PRIoLEAST8 "o"
# define PRIoLEAST16 "o"
# define PRIoLEAST32 "o"
# define PRIoLEAST64 __PRI64_PREFIX "o"
 
# define PRIoFAST8 "o"
# define PRIoFAST16 "o"
# define PRIoFAST32 "o"
# define PRIoFAST64 __PRI64_PREFIX "o"
 
/* Unsigned integers. */
# define PRIu8 "u"
# define PRIu16 "u"
# define PRIu32 "u"
# define PRIu64 __PRI64_PREFIX "u"
 
# define PRIuLEAST8 "u"
# define PRIuLEAST16 "u"
# define PRIuLEAST32 "u"
# define PRIuLEAST64 __PRI64_PREFIX "u"
 
# define PRIuFAST8 "u"
# define PRIuFAST16 "u"
# define PRIuFAST32 "u"
# define PRIuFAST64 __PRI64_PREFIX "u"
 
/* lowercase hexadecimal notation. */
# define PRIx8 "x"
# define PRIx16 "x"
# define PRIx32 "x"
# define PRIx64 __PRI64_PREFIX "x"
 
# define PRIxLEAST8 "x"
# define PRIxLEAST16 "x"
# define PRIxLEAST32 "x"
# define PRIxLEAST64 __PRI64_PREFIX "x"
 
# define PRIxFAST8 "x"
# define PRIxFAST16 "x"
# define PRIxFAST32 "x"
# define PRIxFAST64 __PRI64_PREFIX "x"
 
/* UPPERCASE hexadecimal notation. */
# define PRIX8 "X"
# define PRIX16 "X"
# define PRIX32 "X"
# define PRIX64 __PRI64_PREFIX "X"
 
# define PRIXLEAST8 "X"
# define PRIXLEAST16 "X"
# define PRIXLEAST32 "X"
# define PRIXLEAST64 __PRI64_PREFIX "X"
 
# define PRIXFAST8 "X"
# define PRIXFAST16 "X"
# define PRIXFAST32 "X"
# define PRIXFAST64 __PRI64_PREFIX "X"
 
 
/* Macros for printing `intmax_t' and `uintmax_t'. */
# define PRIdMAX __PRI64_PREFIX "d"
# define PRIiMAX __PRI64_PREFIX "i"
# define PRIoMAX __PRI64_PREFIX "o"
# define PRIuMAX __PRI64_PREFIX "u"
# define PRIxMAX __PRI64_PREFIX "x"
# define PRIXMAX __PRI64_PREFIX "X"
 
 
/* Macros for printing `intptr_t' and `uintptr_t'. */
# define PRIdPTR __PRIPTR_PREFIX "d"
# define PRIiPTR __PRIPTR_PREFIX "i"
# define PRIoPTR __PRIPTR_PREFIX "o"
# define PRIuPTR __PRIPTR_PREFIX "u"
# define PRIxPTR __PRIPTR_PREFIX "x"
# define PRIXPTR __PRIPTR_PREFIX "X"
 
 
/* Macros for scanning format specifiers. */
 
/* Signed decimal notation. */
# define SCNd8 "hhd"
# define SCNd16 "hd"
# define SCNd32 "d"
# define SCNd64 __PRI64_PREFIX "d"
 
# define SCNdLEAST8 "hhd"
# define SCNdLEAST16 "hd"
# define SCNdLEAST32 "d"
# define SCNdLEAST64 __PRI64_PREFIX "d"
 
# define SCNdFAST8 "hhd"
# define SCNdFAST16 __PRIPTR_PREFIX "d"
# define SCNdFAST32 __PRIPTR_PREFIX "d"
# define SCNdFAST64 __PRI64_PREFIX "d"
 
/* Signed decimal notation. */
# define SCNi8 "hhi"
# define SCNi16 "hi"
# define SCNi32 "i"
# define SCNi64 __PRI64_PREFIX "i"
 
# define SCNiLEAST8 "hhi"
# define SCNiLEAST16 "hi"
# define SCNiLEAST32 "i"
# define SCNiLEAST64 __PRI64_PREFIX "i"
 
# define SCNiFAST8 "hhi"
# define SCNiFAST16 __PRIPTR_PREFIX "i"
# define SCNiFAST32 __PRIPTR_PREFIX "i"
# define SCNiFAST64 __PRI64_PREFIX "i"
 
/* Unsigned decimal notation. */
# define SCNu8 "hhu"
# define SCNu16 "hu"
# define SCNu32 "u"
# define SCNu64 __PRI64_PREFIX "u"
 
# define SCNuLEAST8 "hhu"
# define SCNuLEAST16 "hu"
# define SCNuLEAST32 "u"
# define SCNuLEAST64 __PRI64_PREFIX "u"
 
# define SCNuFAST8 "hhu"
# define SCNuFAST16 __PRIPTR_PREFIX "u"
# define SCNuFAST32 __PRIPTR_PREFIX "u"
# define SCNuFAST64 __PRI64_PREFIX "u"
 
/* Octal notation. */
# define SCNo8 "hho"
# define SCNo16 "ho"
# define SCNo32 "o"
# define SCNo64 __PRI64_PREFIX "o"
 
# define SCNoLEAST8 "hho"
# define SCNoLEAST16 "ho"
# define SCNoLEAST32 "o"
# define SCNoLEAST64 __PRI64_PREFIX "o"
 
# define SCNoFAST8 "hho"
# define SCNoFAST16 __PRIPTR_PREFIX "o"
# define SCNoFAST32 __PRIPTR_PREFIX "o"
# define SCNoFAST64 __PRI64_PREFIX "o"
 
/* Hexadecimal notation. */
# define SCNx8 "hhx"
# define SCNx16 "hx"
# define SCNx32 "x"
# define SCNx64 __PRI64_PREFIX "x"
 
# define SCNxLEAST8 "hhx"
# define SCNxLEAST16 "hx"
# define SCNxLEAST32 "x"
# define SCNxLEAST64 __PRI64_PREFIX "x"
 
# define SCNxFAST8 "hhx"
# define SCNxFAST16 __PRIPTR_PREFIX "x"
# define SCNxFAST32 __PRIPTR_PREFIX "x"
# define SCNxFAST64 __PRI64_PREFIX "x"
 
 
/* Macros for scanning `intmax_t' and `uintmax_t'. */
# define SCNdMAX __PRI64_PREFIX "d"
# define SCNiMAX __PRI64_PREFIX "i"
# define SCNoMAX __PRI64_PREFIX "o"
# define SCNuMAX __PRI64_PREFIX "u"
# define SCNxMAX __PRI64_PREFIX "x"
 
/* Macros for scanning `intptr_t' and `uintptr_t'. */
# define SCNdPTR __PRIPTR_PREFIX "d"
# define SCNiPTR __PRIPTR_PREFIX "i"
# define SCNoPTR __PRIPTR_PREFIX "o"
# define SCNuPTR __PRIPTR_PREFIX "u"
# define SCNxPTR __PRIPTR_PREFIX "x"
 
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
 
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
 
typedef signed long int intptr_t;
typedef unsigned long int uintptr_t;
 
#ifndef __STRICT_ANSI__
__extension__ typedef signed long long int64_t;
__extension__ typedef unsigned long long uint64_t;
__extension__ typedef signed long long int intmax_t;
__extension__ typedef unsigned long long int uintmax_t;
#endif
 
__END_DECLS
 
#endif
/contrib/media/updf/include/io.h
0,0 → 1,52
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_io_h_
#define __dj_include_io_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <sys/types.h>
#include <dos.h>
 
int chsize(int handle, long size);
int _close(int _fd);
int _creat(const char *_path, int _attrib);
int _creatnew(const char *_path, int _attrib, int _mode);
ssize_t crlf2nl(char *_buffer, ssize_t _length);
int _dos_lock(int _fd, long _offset, long _length);
long filelength(int _handle);
short _get_dev_info(int _arg);
int lock(int _fd, long _offset, long _length);
int _open(const char *_path, int _oflag);
ssize_t _read(int _fd, void *_buf, size_t _nbyte);
int setmode(int _fd, int _newmode);
off_t tell(int _fd);
int _dos_unlock(int _fd, long _offset, long _length);
int unlock(int _fd, long _offset, long _length);
ssize_t _write(int _fd, const void *_buf, size_t _nbyte);
int _chmod(const char *_path, int _func, ...);
void _flush_disk_cache(void);
 
#define sopen(path, access, shflag, mode) \
open((path), (access)|(shflag), (mode))
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_io_h_ */
/contrib/media/updf/include/iomanip
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_IOMANIP
#include <bits/std_iomanip.h>
#endif
/contrib/media/updf/include/ios
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_IOS
#include <bits/std_ios.h>
#endif
/contrib/media/updf/include/iosfwd
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_IOSFWD
#include <bits/std_iosfwd.h>
#endif
/contrib/media/updf/include/iostream
0,0 → 1,121
#ifndef _IOSTREAM_INCLUDED
#define _IOSTREAM_INCLUDED
#include <cstdio>
#include <string>
namespace std
{
class istream
{
public:
istream() {}
virtual ~istream() {}
virtual istream& operator>>(string& s)=0;
virtual operator bool() const=0;
virtual int getc()=0;
virtual unsigned tellg()=0;
virtual istream& seekg(unsigned off,ios::seek_dir dir)=0;
virtual istream& getline(char* s, unsigned n, char delim)=0;
};
class ifstream : public istream
{
FILE* f;
public:
void open(const char* s, /*ios::open_mode*/int mode=ios::in)
{f=fopen(s,(mode&ios::binary)?"rb":"r");}
ifstream():f(NULL){}
ifstream(const char* s, /*ios::open_mode*/int mode=ios::in)
{open(s,mode);}
~ifstream() {if (f) fclose(f);}
bool fail() const {return f==NULL?true:ferror(f)||feof(f);}
operator bool() const {return !fail();}
bool eof() const {return f==NULL?false:feof(f);}
virtual istream& seekg(unsigned off,ios::seek_dir dir)
{fseek(f,off,dir);return *this;}
ifstream& read(char* s, unsigned n)
{if (fread(s,1,n,f)!=n) f->_flag|=0200;return *this;}
virtual unsigned tellg() {return ftell(f);}
ifstream& getline(char* s, unsigned n)
{fgets(s,n,f);unsigned m=strlen(s);
if(m&&s[m-1]=='\n')s[m-1]=0;else f->_flag|=0200;return *this;}
istream& operator>>(string& s)
{char res[512];fscanf(f,"%s",res);s=res;return *this;}
virtual istream& getline(char* s, unsigned n, char delim)
{
int c;
unsigned pos=0;
for (;pos<n-1;)
{
c=fgetc(f);
if (c==EOF) break;
if (c==delim) break;
s[pos++]=c;
}
s[pos]=0;
return *this;
}
int getc(void)
{ return fgetc(f); }
};
inline istream& getline(istream& is, string& str, char delim='\n')
{
str.erase();
while (is)
{
int c = is.getc();
if (c == EOF || c == delim)
break;
str += c;
}
return is;
}
class istringstream : public istream
{
string s;
unsigned pos;
public:
istringstream(const char* str):s(str),pos(0) {}
istringstream(const string& str):s(str.c_str()),pos(0) {}
istringstream& operator>>(int& n)
{int x;sscanf(s.c_str()+pos,"%d%n",&n,&x);pos+=x;return *this;}
istream& operator>>(string& s)
{int x;char res[512];sscanf(s.c_str()+pos,"%s%n",res,&x);pos+=x;
s=res;return *this;}
virtual operator bool() const {return s.c_str()[pos]!=0;}
virtual int getc()
{
char c=s.c_str()[pos];
if (c==0)
return EOF;
pos++;
return c;
}
virtual unsigned tellg() {return pos;}
virtual istream& seekg(unsigned off,ios::seek_dir dir)
{
unsigned sz=s.size();
switch (dir)
{
case ios::beg: pos=off;break;
case ios::cur: pos+=off;break;
case ios::end: pos=sz-off;break;
}
if (pos>sz) pos=sz;
return *this;
}
virtual istream& getline(char* str, unsigned n, char delim)
{
int c;
unsigned p=0;
for (;p<n-1;)
{
c=s[pos++];
if (c==0) {pos--;break;}
if (c==delim) break;
str[p++]=c;
}
str[p]=0;
return *this;
}
};
}
#endif
/contrib/media/updf/include/istream
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_ISTREAM
#include <bits/std_istream.h>
#endif
/contrib/media/updf/include/itc.h
0,0 → 1,34
#ifndef __ITC_H
#define __ITC_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include<stdlib.h>
 
#define MSG_BUF_SZ 128
 
typedef struct __itc_msg_t
{
char msgbuf[MSG_BUF_SZ];
int sender_tid;
struct __itc_msg_t * next;
} itc_msg_t;
 
typedef struct
{
itc_msg_t * head;
int count;
} itc_msgq_t;
 
typedef struct
{
char * name;
int real_pid;
#ifdef __cplusplus
}
#endif
 
#endif
/contrib/media/updf/include/iterator
0,0 → 1,3
#ifndef _ITERATOR_INCLUDED
#define _ITERATOR_INCLUDED
#endif
/contrib/media/updf/include/j2k.h
0,0 → 1,446
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __J2K_H
#define __J2K_H
/**
@file j2k.h
@brief The JPEG-2000 Codestream Reader/Writer (J2K)
 
The functions in J2K.C have for goal to read/write the several parts of the codestream: markers and data.
*/
 
/** @defgroup J2K J2K - JPEG-2000 codestream reader/writer */
/*@{*/
 
#define J2K_CP_CSTY_PRT 0x01
#define J2K_CP_CSTY_SOP 0x02
#define J2K_CP_CSTY_EPH 0x04
#define J2K_CCP_CSTY_PRT 0x01
#define J2K_CCP_CBLKSTY_LAZY 0x01 /**< Selective arithmetic coding bypass */
#define J2K_CCP_CBLKSTY_RESET 0x02 /**< Reset context probabilities on coding pass boundaries */
#define J2K_CCP_CBLKSTY_TERMALL 0x04 /**< Termination on each coding pass */
#define J2K_CCP_CBLKSTY_VSC 0x08 /**< Vertically stripe causal context */
#define J2K_CCP_CBLKSTY_PTERM 0x10 /**< Predictable termination */
#define J2K_CCP_CBLKSTY_SEGSYM 0x20 /**< Segmentation symbols are used */
#define J2K_CCP_QNTSTY_NOQNT 0
#define J2K_CCP_QNTSTY_SIQNT 1
#define J2K_CCP_QNTSTY_SEQNT 2
 
/* ----------------------------------------------------------------------- */
 
#define J2K_MS_SOC 0xff4f /**< SOC marker value */
#define J2K_MS_SOT 0xff90 /**< SOT marker value */
#define J2K_MS_SOD 0xff93 /**< SOD marker value */
#define J2K_MS_EOC 0xffd9 /**< EOC marker value */
#define J2K_MS_SIZ 0xff51 /**< SIZ marker value */
#define J2K_MS_COD 0xff52 /**< COD marker value */
#define J2K_MS_COC 0xff53 /**< COC marker value */
#define J2K_MS_RGN 0xff5e /**< RGN marker value */
#define J2K_MS_QCD 0xff5c /**< QCD marker value */
#define J2K_MS_QCC 0xff5d /**< QCC marker value */
#define J2K_MS_POC 0xff5f /**< POC marker value */
#define J2K_MS_TLM 0xff55 /**< TLM marker value */
#define J2K_MS_PLM 0xff57 /**< PLM marker value */
#define J2K_MS_PLT 0xff58 /**< PLT marker value */
#define J2K_MS_PPM 0xff60 /**< PPM marker value */
#define J2K_MS_PPT 0xff61 /**< PPT marker value */
#define J2K_MS_SOP 0xff91 /**< SOP marker value */
#define J2K_MS_EPH 0xff92 /**< EPH marker value */
#define J2K_MS_CRG 0xff63 /**< CRG marker value */
#define J2K_MS_COM 0xff64 /**< COM marker value */
/* UniPG>> */
#ifdef USE_JPWL
#define J2K_MS_EPC 0xff68 /**< EPC marker value (Part 11: JPEG 2000 for Wireless) */
#define J2K_MS_EPB 0xff66 /**< EPB marker value (Part 11: JPEG 2000 for Wireless) */
#define J2K_MS_ESD 0xff67 /**< ESD marker value (Part 11: JPEG 2000 for Wireless) */
#define J2K_MS_RED 0xff69 /**< RED marker value (Part 11: JPEG 2000 for Wireless) */
#endif /* USE_JPWL */
#ifdef USE_JPSEC
#define J2K_MS_SEC 0xff65 /**< SEC marker value (Part 8: Secure JPEG 2000) */
#define J2K_MS_INSEC 0xff94 /**< INSEC marker value (Part 8: Secure JPEG 2000) */
#endif /* USE_JPSEC */
/* <<UniPG */
 
 
/* ----------------------------------------------------------------------- */
 
/**
Values that specify the status of the decoding process when decoding the main header.
These values may be combined with a | operator.
*/
typedef enum J2K_STATUS {
J2K_STATE_MHSOC = 0x0001, /**< a SOC marker is expected */
J2K_STATE_MHSIZ = 0x0002, /**< a SIZ marker is expected */
J2K_STATE_MH = 0x0004, /**< the decoding process is in the main header */
J2K_STATE_TPHSOT = 0x0008, /**< the decoding process is in a tile part header and expects a SOT marker */
J2K_STATE_TPH = 0x0010, /**< the decoding process is in a tile part header */
J2K_STATE_MT = 0x0020, /**< the EOC marker has just been read */
J2K_STATE_NEOC = 0x0040, /**< the decoding process must not expect a EOC marker because the codestream is truncated */
J2K_STATE_ERR = 0x0080 /**< the decoding process has encountered an error */
} J2K_STATUS;
 
/* ----------------------------------------------------------------------- */
 
/**
T2 encoding mode
*/
typedef enum T2_MODE {
THRESH_CALC = 0, /** Function called in Rate allocation process*/
FINAL_PASS = 1 /** Function called in Tier 2 process*/
}J2K_T2_MODE;
 
/**
Quantization stepsize
*/
typedef struct opj_stepsize {
/** exponent */
int expn;
/** mantissa */
int mant;
} opj_stepsize_t;
 
/**
Tile-component coding parameters
*/
typedef struct opj_tccp {
/** coding style */
int csty;
/** number of resolutions */
int numresolutions;
/** code-blocks width */
int cblkw;
/** code-blocks height */
int cblkh;
/** code-block coding style */
int cblksty;
/** discrete wavelet transform identifier */
int qmfbid;
/** quantisation style */
int qntsty;
/** stepsizes used for quantization */
opj_stepsize_t stepsizes[J2K_MAXBANDS];
/** number of guard bits */
int numgbits;
/** Region Of Interest shift */
int roishift;
/** precinct width */
int prcw[J2K_MAXRLVLS];
/** precinct height */
int prch[J2K_MAXRLVLS];
} opj_tccp_t;
 
/**
Tile coding parameters :
this structure is used to store coding/decoding parameters common to all
tiles (information like COD, COC in main header)
*/
typedef struct opj_tcp {
/** 1 : first part-tile of a tile */
int first;
/** coding style */
int csty;
/** progression order */
OPJ_PROG_ORDER prg;
/** number of layers */
int numlayers;
/** multi-component transform identifier */
int mct;
/** rates of layers */
float rates[100];
/** number of progression order changes */
int numpocs;
/** indicates if a POC marker has been used O:NO, 1:YES */
int POC;
/** progression order changes */
opj_poc_t pocs[32];
/** packet header store there for futur use in t2_decode_packet */
unsigned char *ppt_data;
/** pointer remaining on the first byte of the first header if ppt is used */
unsigned char *ppt_data_first;
/** If ppt == 1 --> there was a PPT marker for the present tile */
int ppt;
/** used in case of multiple marker PPT (number of info already stored) */
int ppt_store;
/** ppmbug1 */
int ppt_len;
/** add fixed_quality */
float distoratio[100];
/** tile-component coding parameters */
opj_tccp_t *tccps;
} opj_tcp_t;
 
/**
Coding parameters
*/
typedef struct opj_cp {
/** Digital cinema profile*/
OPJ_CINEMA_MODE cinema;
/** Maximum rate for each component. If == 0, component size limitation is not considered */
int max_comp_size;
/** Size of the image in bits*/
int img_size;
/** Rsiz*/
OPJ_RSIZ_CAPABILITIES rsiz;
/** Enabling Tile part generation*/
char tp_on;
/** Flag determining tile part generation*/
char tp_flag;
/** Position of tile part flag in progression order*/
int tp_pos;
/** allocation by rate/distortion */
int disto_alloc;
/** allocation by fixed layer */
int fixed_alloc;
/** add fixed_quality */
int fixed_quality;
/** if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, image is decoded to the full resolution */
int reduce;
/** if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */
int layer;
/** if == NO_LIMITATION, decode entire codestream; if == LIMIT_TO_MAIN_HEADER then only decode the main header */
OPJ_LIMIT_DECODING limit_decoding;
/** XTOsiz */
int tx0;
/** YTOsiz */
int ty0;
/** XTsiz */
int tdx;
/** YTsiz */
int tdy;
/** comment for coding */
char *comment;
/** number of tiles in width */
int tw;
/** number of tiles in heigth */
int th;
/** ID number of the tiles present in the codestream */
int *tileno;
/** size of the vector tileno */
int tileno_size;
/** packet header store there for futur use in t2_decode_packet */
unsigned char *ppm_data;
/** pointer remaining on the first byte of the first header if ppm is used */
unsigned char *ppm_data_first;
/** if ppm == 1 --> there was a PPM marker for the present tile */
int ppm;
/** use in case of multiple marker PPM (number of info already store) */
int ppm_store;
/** use in case of multiple marker PPM (case on non-finished previous info) */
int ppm_previous;
/** ppmbug1 */
int ppm_len;
/** tile coding parameters */
opj_tcp_t *tcps;
/** fixed layer */
int *matrice;
/* UniPG>> */
#ifdef USE_JPWL
/** enables writing of EPC in MH, thus activating JPWL */
bool epc_on;
/** enables writing of EPB, in case of activated JPWL */
bool epb_on;
/** enables writing of ESD, in case of activated JPWL */
bool esd_on;
/** enables writing of informative techniques of ESD, in case of activated JPWL */
bool info_on;
/** enables writing of RED, in case of activated JPWL */
bool red_on;
/** error protection method for MH (0,1,16,32,37-128) */
int hprot_MH;
/** tile number of header protection specification (>=0) */
int hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS];
/** error protection methods for TPHs (0,1,16,32,37-128) */
int hprot_TPH[JPWL_MAX_NO_TILESPECS];
/** tile number of packet protection specification (>=0) */
int pprot_tileno[JPWL_MAX_NO_PACKSPECS];
/** packet number of packet protection specification (>=0) */
int pprot_packno[JPWL_MAX_NO_PACKSPECS];
/** error protection methods for packets (0,1,16,32,37-128) */
int pprot[JPWL_MAX_NO_PACKSPECS];
/** enables writing of ESD, (0/2/4 bytes) */
int sens_size;
/** sensitivity addressing size (0=auto/2/4 bytes) */
int sens_addr;
/** sensitivity range (0-3) */
int sens_range;
/** sensitivity method for MH (-1,0-7) */
int sens_MH;
/** tile number of sensitivity specification (>=0) */
int sens_TPH_tileno[JPWL_MAX_NO_TILESPECS];
/** sensitivity methods for TPHs (-1,0-7) */
int sens_TPH[JPWL_MAX_NO_TILESPECS];
/** enables JPWL correction at the decoder */
bool correct;
/** expected number of components at the decoder */
int exp_comps;
/** maximum number of tiles at the decoder */
int max_tiles;
#endif /* USE_JPWL */
/* <<UniPG */
} opj_cp_t;
 
/**
JPEG-2000 codestream reader/writer
*/
typedef struct opj_j2k {
/** codec context */
opj_common_ptr cinfo;
 
/** locate in which part of the codestream the decoder is (main header, tile header, end) */
int state;
/** number of the tile curently concern by coding/decoding */
int curtileno;
/** Tile part number*/
int tp_num;
/** Tilepart number currently coding*/
int cur_tp_num;
/** Total number of tileparts of the current tile*/
int *cur_totnum_tp;
/**
locate the start position of the TLM marker
after encoding the tilepart, a jump (in j2k_write_sod) is done to the TLM marker to store the value of its length.
*/
int tlm_start;
/** Total num of tile parts in whole image = num tiles* num tileparts in each tile*/
/** used in TLMmarker*/
int totnum_tp;
/**
locate the position of the end of the tile in the codestream,
used to detect a truncated codestream (in j2k_read_sod)
*/
unsigned char *eot;
/**
locate the start position of the SOT marker of the current coded tile:
after encoding the tile, a jump (in j2k_write_sod) is done to the SOT marker to store the value of its length.
*/
int sot_start;
int sod_start;
/**
as the J2K-file is written in several parts during encoding,
it enables to make the right correction in position return by cio_tell
*/
int pos_correction;
/** array used to store the data of each tile */
unsigned char **tile_data;
/** array used to store the length of each tile */
int *tile_len;
/**
decompression only :
store decoding parameters common to all tiles (information like COD, COC in main header)
*/
opj_tcp_t *default_tcp;
/** pointer to the encoded / decoded image */
opj_image_t *image;
/** pointer to the coding parameters */
opj_cp_t *cp;
/** helper used to write the index file */
opj_codestream_info_t *cstr_info;
/** pointer to the byte i/o stream */
opj_cio_t *cio;
} opj_j2k_t;
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Creates a J2K decompression structure
@param cinfo Codec context info
@return Returns a handle to a J2K decompressor if successful, returns NULL otherwise
*/
opj_j2k_t* j2k_create_decompress(opj_common_ptr cinfo);
/**
Destroy a J2K decompressor handle
@param j2k J2K decompressor handle to destroy
*/
void j2k_destroy_decompress(opj_j2k_t *j2k);
/**
Setup the decoder decoding parameters using user parameters.
Decoding parameters are returned in j2k->cp.
@param j2k J2K decompressor handle
@param parameters decompression parameters
*/
void j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters);
/**
Decode an image from a JPEG-2000 codestream
@param j2k J2K decompressor handle
@param cio Input buffer stream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
/**
Decode an image form a JPT-stream (JPEG 2000, JPIP)
@param j2k J2K decompressor handle
@param cio Input buffer stream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
opj_image_t* j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
/**
Creates a J2K compression structure
@param cinfo Codec context info
@return Returns a handle to a J2K compressor if successful, returns NULL otherwise
*/
opj_j2k_t* j2k_create_compress(opj_common_ptr cinfo);
/**
Destroy a J2K compressor handle
@param j2k J2K compressor handle to destroy
*/
void j2k_destroy_compress(opj_j2k_t *j2k);
/**
Setup the encoder parameters using the current image and using user parameters.
Coding parameters are returned in j2k->cp.
@param j2k J2K compressor handle
@param parameters compression parameters
@param image input filled image
*/
void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_t *image);
/**
Converts an enum type progression order to string type
*/
char *j2k_convert_progression_order(OPJ_PROG_ORDER prg_order);
/**
Encode an image into a JPEG-2000 codestream
@param j2k J2K compressor handle
@param cio Output buffer stream
@param image Image to encode
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
 
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __J2K_H */
/contrib/media/updf/include/j2k_lib.h
0,0 → 1,54
/*
* Copyright (c) 2005, Hervé Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __J2K_LIB_H
#define __J2K_LIB_H
/**
@file j2k_lib.h
@brief Internal functions
 
The functions in J2K_LIB.C are internal utilities mainly used for timing.
*/
 
/** @defgroup MISC MISC - Miscellaneous internal functions */
/*@{*/
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
 
/**
Difference in successive opj_clock() calls tells you the elapsed time
@return Returns time in seconds
*/
double opj_clock(void);
 
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __J2K_LIB_H */
 
/contrib/media/updf/include/jbig2.h
0,0 → 1,135
/*
jbig2dec
 
Copyright (C) 2002-2005 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef _JBIG2_H
#define _JBIG2_H
 
/* warning levels */
typedef enum {
JBIG2_SEVERITY_DEBUG,
JBIG2_SEVERITY_INFO,
JBIG2_SEVERITY_WARNING,
JBIG2_SEVERITY_FATAL
} Jbig2Severity;
 
typedef enum {
JBIG2_OPTIONS_EMBEDDED = 1
} Jbig2Options;
 
/* forward public structure declarations */
typedef struct _Jbig2Allocator Jbig2Allocator;
typedef struct _Jbig2Ctx Jbig2Ctx;
typedef struct _Jbig2GlobalCtx Jbig2GlobalCtx;
typedef struct _Jbig2Segment Jbig2Segment;
typedef struct _Jbig2Image Jbig2Image;
 
/* private structures */
typedef struct _Jbig2Page Jbig2Page;
typedef struct _Jbig2SymbolDictionary Jbig2SymbolDictionary;
 
/*
this is the general image structure used by the jbig2dec library
images are 1 bpp, packed into rows a byte at a time. stride gives
the byte offset to the next row, while width and height define
the size of the image area in pixels.
*/
 
struct _Jbig2Image {
int width, height, stride;
uint8_t *data;
int refcount;
};
 
Jbig2Image* jbig2_image_new(Jbig2Ctx *ctx, int width, int height);
Jbig2Image* jbig2_image_clone(Jbig2Ctx *ctx, Jbig2Image *image);
void jbig2_image_release(Jbig2Ctx *ctx, Jbig2Image *image);
void jbig2_image_free(Jbig2Ctx *ctx, Jbig2Image *image);
void jbig2_image_clear(Jbig2Ctx *ctx, Jbig2Image *image, int value);
Jbig2Image *jbig2_image_resize(Jbig2Ctx *ctx, Jbig2Image *image,
int width, int height);
 
/* errors are returned from the library via a callback. If no callback
is provided (a NULL argument is passed ot jbig2_ctx_new) a default
handler is used which prints fatal errors to the stderr stream. */
 
/* error callback */
typedef int (*Jbig2ErrorCallback) (void *data,
const char *msg, Jbig2Severity severity,
int32_t seg_idx);
 
/* memory allocation is likewise done via a set of callbacks so that
clients can better control memory usage. If a NULL is passed for
this argumennt of jbig2_ctx_new, a default allocator based on malloc()
is used. */
 
/* dynamic memory callbacks */
struct _Jbig2Allocator {
void *(*alloc) (Jbig2Allocator *allocator, size_t size);
void (*free) (Jbig2Allocator *allocator, void *p);
void *(*realloc) (Jbig2Allocator *allocator, void *p, size_t size);
};
 
/* decoder context */
Jbig2Ctx *jbig2_ctx_new (Jbig2Allocator *allocator,
Jbig2Options options,
Jbig2GlobalCtx *global_ctx,
Jbig2ErrorCallback error_callback,
void *error_callback_data);
void jbig2_ctx_free (Jbig2Ctx *ctx);
 
/* global context for embedded streams */
Jbig2GlobalCtx *jbig2_make_global_ctx (Jbig2Ctx *ctx);
void jbig2_global_ctx_free (Jbig2GlobalCtx *global_ctx);
 
/* submit data to the decoder */
int jbig2_data_in (Jbig2Ctx *ctx, const unsigned char *data, size_t size);
 
/* get the next available decoded page image. NULL means there isn't one. */
Jbig2Image *jbig2_page_out (Jbig2Ctx *ctx);
/* mark a returned page image as no longer needed. */
int jbig2_release_page (Jbig2Ctx *ctx, Jbig2Image *image);
/* mark the current page as complete, simulating an end-of-page segment (for broken streams) */
int jbig2_complete_page (Jbig2Ctx *ctx);
 
 
/* segment header routines */
 
struct _Jbig2Segment {
uint32_t number;
uint8_t flags;
uint32_t page_association;
size_t data_length;
int referred_to_segment_count;
uint32_t *referred_to_segments;
void *result;
};
 
Jbig2Segment *jbig2_parse_segment_header (Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size,
size_t *p_header_size);
int jbig2_parse_segment (Jbig2Ctx *ctx, Jbig2Segment *segment,
const uint8_t *segment_data);
void jbig2_free_segment (Jbig2Ctx *ctx, Jbig2Segment *segment);
 
Jbig2Segment *jbig2_find_segment(Jbig2Ctx *ctx, uint32_t number);
 
#endif /* _JBIG2_H */
 
#ifdef __cplusplus
}
#endif
/contrib/media/updf/include/jbig2_arith.h
0,0 → 1,31
/*
jbig2dec
 
Copyright (C) 2001 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
typedef struct _Jbig2ArithState Jbig2ArithState;
 
/* An arithmetic coding context is stored as a single byte, with the
index in the low order 7 bits (actually only 6 are used), and the
MPS in the top bit. */
typedef unsigned char Jbig2ArithCx;
 
/* allocate and initialize a new arithmetic coding state */
Jbig2ArithState *
jbig2_arith_new (Jbig2Ctx *ctx, Jbig2WordStream *ws);
 
/* decode a bit */
bool
jbig2_arith_decode (Jbig2ArithState *as, Jbig2ArithCx *pcx);
 
 
/contrib/media/updf/include/jbig2_arith_iaid.h
0,0 → 1,26
/*
jbig2dec
 
Copyright (C) 2001 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
typedef struct _Jbig2ArithIaidCtx Jbig2ArithIaidCtx;
 
Jbig2ArithIaidCtx *
jbig2_arith_iaid_ctx_new(Jbig2Ctx *ctx, int SBSYMCODELEN);
 
int
jbig2_arith_iaid_decode(Jbig2ArithIaidCtx *ctx, Jbig2ArithState *as,
int32_t *p_result);
 
void
jbig2_arith_iaid_ctx_free(Jbig2Ctx *ctx, Jbig2ArithIaidCtx *iax);
/contrib/media/updf/include/jbig2_arith_int.h
0,0 → 1,26
/*
jbig2dec
 
Copyright (C) 2001 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
typedef struct _Jbig2ArithIntCtx Jbig2ArithIntCtx;
 
Jbig2ArithIntCtx *
jbig2_arith_int_ctx_new(Jbig2Ctx *ctx);
 
int
jbig2_arith_int_decode(Jbig2ArithIntCtx *ctx, Jbig2ArithState *as,
int32_t *p_result);
 
void
jbig2_arith_int_ctx_free(Jbig2Ctx *ctx, Jbig2ArithIntCtx *iax);
/contrib/media/updf/include/jbig2_generic.h
0,0 → 1,62
/*
jbig2dec
 
Copyright (C) 2002-2004 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
/**
* Headers for Generic and Generic Refinement region handling
**/
 
/* 6.4 Table 2 */
typedef struct {
bool MMR;
/* GBW */
/* GBH */
int GBTEMPLATE;
bool TPGDON;
bool USESKIP;
/* SKIP */
int8_t gbat[8];
} Jbig2GenericRegionParams;
 
/* return the appropriate context size for the given template */
int
jbig2_generic_stats_size(Jbig2Ctx *ctx, int template);
 
int
jbig2_decode_generic_region(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params,
Jbig2ArithState *as,
Jbig2Image *image,
Jbig2ArithCx *GB_stats);
 
 
/* 6.3 Table 6 */
typedef struct {
/* GRW */
/* GRH */
bool GRTEMPLATE;
Jbig2Image *reference;
int32_t DX, DY;
bool TPGRON;
int8_t grat[4];
} Jbig2RefinementRegionParams;
 
int
jbig2_decode_refinement_region(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2RefinementRegionParams *params,
Jbig2ArithState *as,
Jbig2Image *image,
Jbig2ArithCx *GB_stats);
/contrib/media/updf/include/jbig2_huffman.h
0,0 → 1,105
/*
jbig2dec
 
Copyright (C) 2001-2005 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
#ifndef JBIG2_HUFFMAN_H
#define JBIG2_HUFFMAN_H
 
/* Huffman coder interface */
 
typedef struct _Jbig2HuffmanEntry Jbig2HuffmanEntry;
typedef struct _Jbig2HuffmanState Jbig2HuffmanState;
typedef struct _Jbig2HuffmanTable Jbig2HuffmanTable;
typedef struct _Jbig2HuffmanParams Jbig2HuffmanParams;
 
struct _Jbig2HuffmanEntry {
union {
int32_t RANGELOW;
Jbig2HuffmanTable *ext_table;
} u;
byte PREFLEN;
byte RANGELEN;
byte flags;
};
 
struct _Jbig2HuffmanTable {
int log_table_size;
Jbig2HuffmanEntry *entries;
};
 
typedef struct _Jbig2HuffmanLine Jbig2HuffmanLine;
 
struct _Jbig2HuffmanLine {
int PREFLEN;
int RANGELEN;
int RANGELOW;
};
 
struct _Jbig2HuffmanParams {
bool HTOOB;
int n_lines;
const Jbig2HuffmanLine *lines;
};
 
Jbig2HuffmanState *
jbig2_huffman_new (Jbig2Ctx *ctx, Jbig2WordStream *ws);
 
void
jbig2_huffman_free (Jbig2Ctx *ctx, Jbig2HuffmanState *hs);
 
void
jbig2_huffman_skip(Jbig2HuffmanState *hs);
 
void jbig2_huffman_advance(Jbig2HuffmanState *hs, int offset);
 
int
jbig2_huffman_offset(Jbig2HuffmanState *hs);
 
int32_t
jbig2_huffman_get (Jbig2HuffmanState *hs,
const Jbig2HuffmanTable *table, bool *oob);
 
int32_t
jbig2_huffman_get_bits (Jbig2HuffmanState *hs, const int bits);
 
#ifdef JBIG2_DEBUG
void jbig2_dump_huffman_state(Jbig2HuffmanState *hs);
void jbig2_dump_huffman_binary(Jbig2HuffmanState *hs);
#endif
 
Jbig2HuffmanTable *
jbig2_build_huffman_table (Jbig2Ctx *ctx, const Jbig2HuffmanParams *params);
 
void
jbig2_release_huffman_table (Jbig2Ctx *ctx, Jbig2HuffmanTable *table);
 
/* standard Huffman templates defined by the specification */
extern const Jbig2HuffmanParams jbig2_huffman_params_A; /* Table B.1 */
extern const Jbig2HuffmanParams jbig2_huffman_params_B; /* Table B.2 */
extern const Jbig2HuffmanParams jbig2_huffman_params_C; /* Table B.3 */
extern const Jbig2HuffmanParams jbig2_huffman_params_D; /* Table B.4 */
extern const Jbig2HuffmanParams jbig2_huffman_params_E; /* Table B.5 */
extern const Jbig2HuffmanParams jbig2_huffman_params_F; /* Table B.6 */
extern const Jbig2HuffmanParams jbig2_huffman_params_G; /* Table B.7 */
extern const Jbig2HuffmanParams jbig2_huffman_params_H; /* Table B.8 */
extern const Jbig2HuffmanParams jbig2_huffman_params_I; /* Table B.9 */
extern const Jbig2HuffmanParams jbig2_huffman_params_J; /* Table B.10 */
extern const Jbig2HuffmanParams jbig2_huffman_params_K; /* Table B.11 */
extern const Jbig2HuffmanParams jbig2_huffman_params_L; /* Table B.12 */
extern const Jbig2HuffmanParams jbig2_huffman_params_M; /* Table B.13 */
extern const Jbig2HuffmanParams jbig2_huffman_params_N; /* Table B.14 */
extern const Jbig2HuffmanParams jbig2_huffman_params_O; /* Table B.15 */
 
 
#endif /* JBIG2_HUFFMAN_H */
/contrib/media/updf/include/jbig2_hufftab.h
0,0 → 1,335
/*
jbig2dec
 
Copyright (C) 2001-2005 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
/* predefined Huffman table definitions
-- See Annex B of the JBIG2 specification */
 
#ifndef JBIG2_HUFFTAB_H
#define JBIG2_HUFFTAB_H
 
/* types are in jbig2_huffman.h, you must include that first */
 
 
/* Table B.1 */
const Jbig2HuffmanLine
jbig2_huffman_lines_A[] = {
{ 1, 4, 0 },
{ 2, 8, 16 },
{ 3, 16, 272 },
{ 0, 32, -1 }, /* low */
{ 3, 32, 65808 } /* high */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_A = { FALSE, 5, jbig2_huffman_lines_A };
 
/* Table B.2 */
const Jbig2HuffmanLine
jbig2_huffman_lines_B[] = {
{ 1, 0, 0 },
{ 2, 0, 1 },
{ 3, 0, 2 },
{ 4, 3, 3 },
{ 5, 6, 11 },
{ 0, 32, -1 }, /* low */
{ 6, 32, 75 }, /* high */
{ 6, 0, 0 }
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_B = { TRUE, 8, jbig2_huffman_lines_B };
 
/* Table B.3 */
const Jbig2HuffmanLine
jbig2_huffman_lines_C[] = {
{ 8, 8, -256 },
{ 1, 0, 0 },
{ 2, 0, 1 },
{ 3, 0, 2 },
{ 4, 3, 3 },
{ 5, 6, 11 },
{ 8, 32, -257 }, /* low */
{ 7, 32, 75 }, /* high */
{ 6, 0, 0 } /* OOB */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_C = { TRUE, 9, jbig2_huffman_lines_C };
 
/* Table B.4 */
const Jbig2HuffmanLine
jbig2_huffman_lines_D[] = {
{ 1, 0, 1 },
{ 2, 0, 2 },
{ 3, 0, 3 },
{ 4, 3, 4 },
{ 5, 6, 12 },
{ 0, 32, -1 }, /* low */
{ 5, 32, 76 }, /* high */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_D = { FALSE, 7, jbig2_huffman_lines_D };
 
/* Table B.5 */
const Jbig2HuffmanLine
jbig2_huffman_lines_E[] = {
{7, 8, -255},
{1, 0, 1},
{2, 0, 2},
{3, 0, 3},
{4, 3, 4},
{5, 6, 12},
{7, 32, -256}, /* low */
{6, 32, 76} /* high */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_E = { FALSE, 8, jbig2_huffman_lines_E };
 
/* Table B.6 */
const Jbig2HuffmanLine
jbig2_huffman_lines_F[] = {
{5, 10, -2048},
{4, 9, -1024},
{4, 8, -512},
{4, 7, -256},
{5, 6, -128},
{5, 5, -64},
{4, 5, -32},
{2, 7, 0},
{3, 7, 128},
{3, 8, 256},
{4, 9, 512},
{4, 10, 1024},
{6, 32, -2049}, /* low */
{6, 32, 2048} /* high */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_F = { FALSE, 14, jbig2_huffman_lines_F };
 
/* Table B.7 */
const Jbig2HuffmanLine
jbig2_huffman_lines_G[] = {
{4, 9, -1024},
{3, 8, -512},
{4, 7, -256},
{5, 6, -128},
{5, 5, -64},
{4, 5, -32},
{4, 5, 0},
{5, 5, 32},
{5, 6, 64},
{4, 7, 128},
{3, 8, 256},
{3, 9, 512},
{3, 10, 1024},
{5, 32, -1025}, /* low */
{5, 32, 2048} /* high */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_G = { FALSE, 15, jbig2_huffman_lines_G };
 
/* Table B.8 */
const Jbig2HuffmanLine
jbig2_huffman_lines_H[] = {
{8, 3, -15},
{9, 1, -7},
{8, 1, -5},
{9, 0, -3},
{7, 0, -2},
{4, 0, -1},
{2, 1, 0},
{5, 0, 2},
{6, 0, 3},
{3, 4, 4},
{6, 1, 20},
{4, 4, 22},
{4, 5, 38},
{5, 6, 70},
{5, 7, 134},
{6, 7, 262},
{7, 8, 390},
{6, 10, 646},
{9, 32, -16}, /* low */
{9, 32, 1670}, /* high */
{2, 0, 0} /* OOB */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_H = { TRUE, 21, jbig2_huffman_lines_H };
 
/* Table B.9 */
const Jbig2HuffmanLine
jbig2_huffman_lines_I[] = {
{8, 4, -31},
{9, 2, -15},
{8, 2, -11},
{9, 1, -7},
{7, 1, -5},
{4, 1, -3},
{3, 1, -1},
{3, 1, 1},
{5, 1, 3},
{6, 1, 5},
{3, 5, 7},
{6, 2, 39},
{4, 5, 43},
{4, 6, 75},
{5, 7, 139},
{5, 8, 267},
{6, 8, 523},
{7, 9, 779},
{6, 11, 1291},
{9, 32, -32}, /* low */
{9, 32, 3339}, /* high */
{2, 0, 0} /* OOB */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_I = { TRUE, 22, jbig2_huffman_lines_I };
 
/* Table B.10 */
const Jbig2HuffmanLine
jbig2_huffman_lines_J[] = {
{7, 4, -21},
{8, 0, -5},
{7, 0, -4},
{5, 0, -3},
{2, 2, -2},
{5, 0, 2},
{6, 0, 3},
{7, 0, 4},
{8, 0, 5},
{2, 6, 6},
{5, 5, 70},
{6, 5, 102},
{6, 6, 134},
{6, 7, 198},
{6, 8, 326},
{6, 9, 582},
{6, 10, 1094},
{7, 11, 2118},
{8, 32, -22}, /* low */
{8, 32, 4166}, /* high */
{2, 0, 0} /* OOB */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_J = { TRUE, 21, jbig2_huffman_lines_J };
 
/* Table B.11 */
const Jbig2HuffmanLine
jbig2_huffman_lines_K[] = {
{1, 0, 1},
{2, 1, 2},
{4, 0, 3},
{4, 1, 5},
{5, 1, 7},
{5, 2, 9},
{6, 2, 13},
{7, 2, 17},
{7, 3, 21},
{7, 4, 29},
{7, 5, 45},
{7, 6, 77},
{7, 32, 141} /* high */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_K = { FALSE, 13, jbig2_huffman_lines_K };
 
/* Table B.12 */
const Jbig2HuffmanLine
jbig2_huffman_lines_L[] = {
{1, 0, 1},
{2, 0, 2},
{3, 1, 3},
{5, 0, 5},
{5, 1, 6},
{6, 1, 8},
{7, 0, 10},
{7, 1, 11},
{7, 2, 13},
{7, 3, 17},
{7, 4, 25},
{8, 5, 41},
{8, 32, 73}
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_L = { FALSE, 13, jbig2_huffman_lines_L };
 
 
/* Table B.13 */
const Jbig2HuffmanLine
jbig2_huffman_lines_M[] = {
{1, 0, 1},
{3, 0, 2},
{4, 0, 3},
{5, 0, 4},
{4, 1, 5},
{3, 3, 7},
{6, 1, 15},
{6, 2, 17},
{6, 3, 21},
{6, 4, 29},
{6, 5, 45},
{7, 6, 77},
{7, 32, 141} /* high */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_M = { FALSE, 13, jbig2_huffman_lines_M };
 
/* Table B.14 */
const Jbig2HuffmanLine
jbig2_huffman_lines_N[] = {
{ 3, 0, -2 },
{ 3, 0, -1 },
{ 1, 0, 0 },
{ 3, 3, 1 },
{ 3, 6, 2 },
{ 0, 32, -1 }, /* low */
{ 0, 32, 3 }, /* high */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_N = { FALSE, 7, jbig2_huffman_lines_N };
 
/* Table B.15 */
const Jbig2HuffmanLine
jbig2_huffman_lines_O[] = {
{7, 4, -24},
{6, 2, -8},
{5, 1, -4},
{4, 0, -2},
{3, 0, -1},
{1, 0, 0},
{3, 0, 1},
{4, 0, 2},
{5, 1, 3},
{6, 2, 5},
{7, 4, 9},
{7, 32, -25}, /* low */
{7, 32, 25} /* high */
};
 
const Jbig2HuffmanParams
jbig2_huffman_params_O = { FALSE, 13, jbig2_huffman_lines_O };
 
#endif /* JBIG2_HUFFTAB_H */
/contrib/media/updf/include/jbig2_image.h
0,0 → 1,38
/*
jbig2dec
 
Copyright (C) 2001-2002 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
 
#ifndef _JBIG2_IMAGE_H
#define _JBIG2_IMAGE_H
 
int jbig2_image_get_pixel(Jbig2Image *image, int x, int y);
int jbig2_image_set_pixel(Jbig2Image *image, int x, int y, int value);
 
/* routines for dumping the image data in various formats */
/* FIXME: should these be in the client instead? */
 
#include <stdio.h>
 
int jbig2_image_write_pbm_file(Jbig2Image *image, char *filename);
int jbig2_image_write_pbm(Jbig2Image *image, FILE *out);
Jbig2Image *jbig2_image_read_pbm_file(Jbig2Ctx *ctx, char *filename);
Jbig2Image *jbig2_image_read_pbm(Jbig2Ctx *ctx, FILE *in);
 
#ifdef HAVE_LIBPNG
int jbig2_image_write_png_file(Jbig2Image *image, char *filename);
int jbig2_image_write_png(Jbig2Image *image, FILE *out);
#endif
 
#endif /* _JBIG2_IMAGE_H */
/contrib/media/updf/include/jbig2_metadata.h
0,0 → 1,48
/*
jbig2dec
 
Copyright (C) 2003 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
 
#ifndef _JBIG2_METADATA_H
#define _JBIG2_METADATA_H
 
/* metadata from extension segments */
 
/* these bits should be moved to jbig2.h for public access */
typedef enum {
JBIG2_ENCODING_ASCII,
JBIG2_ENCODING_UCS16
} Jbig2Encoding;
 
typedef struct _Jbig2Metadata Jbig2Metadata;
 
Jbig2Metadata *jbig2_metadata_new(Jbig2Ctx *ctx, Jbig2Encoding encoding);
void jbig2_metadata_free(Jbig2Ctx *ctx, Jbig2Metadata *md);
int jbig2_metadata_add(Jbig2Ctx *ctx, Jbig2Metadata *md,
const char *key, const int key_length,
const char *value, const int value_length);
 
struct _Jbig2Metadata {
Jbig2Encoding encoding;
char **keys, **values;
int entries, max_entries;
};
 
/* these bits can go to jbig2_priv.h */
int jbig2_comment_ascii(Jbig2Ctx *ctx, Jbig2Segment *segment,
const uint8_t *segment_data);
int jbig2_comment_unicode(Jbig2Ctx *ctx, Jbig2Segment *segment,
const uint8_t *segment_data);
 
#endif /* _JBIG2_METADATA_H */
/contrib/media/updf/include/jbig2_mmr.h
0,0 → 1,22
/*
jbig2dec
 
Copyright (C) 2001 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
int
jbig2_decode_generic_mmr(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params,
const byte *data, size_t size,
Jbig2Image *image);
 
/contrib/media/updf/include/jbig2_priv.h
0,0 → 1,177
/*
jbig2dec
 
Copyright (C) 2002 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
/* library internals */
 
typedef uint8_t byte;
typedef int bool;
 
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
 
#ifndef NULL
#define NULL ((void*)0)
#endif
 
typedef enum {
JBIG2_FILE_HEADER,
JBIG2_FILE_SEQUENTIAL_HEADER,
JBIG2_FILE_SEQUENTIAL_BODY,
JBIG2_FILE_RANDOM_HEADERS,
JBIG2_FILE_RANDOM_BODIES,
JBIG2_FILE_EOF
} Jbig2FileState;
 
struct _Jbig2Ctx {
Jbig2Allocator *allocator;
Jbig2Options options;
const Jbig2Ctx *global_ctx;
Jbig2ErrorCallback error_callback;
void *error_callback_data;
 
byte *buf;
size_t buf_size;
unsigned int buf_rd_ix;
unsigned int buf_wr_ix;
 
Jbig2FileState state;
 
uint8_t file_header_flags;
int32_t n_pages;
 
int n_segments_max;
Jbig2Segment **segments;
int n_segments; /* index of last segment header parsed */
int segment_index; /* index of last segment body parsed */
 
/* list of decoded pages, including the one in progress,
currently stored as a contiguous, 0-indexed array. */
int current_page;
int max_page_index;
Jbig2Page *pages;
};
 
int32_t
jbig2_get_int32 (const byte *buf);
 
int16_t
jbig2_get_int16 (const byte *buf);
 
/* dynamic memory management */
void *
jbig2_alloc (Jbig2Allocator *allocator, size_t size);
 
void
jbig2_free (Jbig2Allocator *allocator, void *p);
 
void *
jbig2_realloc (Jbig2Allocator *allocator, void *p, size_t size);
 
#define jbig2_new(ctx, t, size) ((t *)jbig2_alloc(ctx->allocator, (size) * sizeof(t)))
 
#define jbig2_renew(ctx, p, t, size) ((t *)jbig2_realloc(ctx->allocator, (p), (size) * sizeof(t)))
 
int
jbig2_error (Jbig2Ctx *ctx, Jbig2Severity severity, int32_t seg_idx,
const char *fmt, ...);
 
/* the page structure handles decoded page
results. it's allocated by a 'page info'
segement and marked complete by an 'end of page'
segment.
*/
typedef enum {
JBIG2_PAGE_FREE,
JBIG2_PAGE_NEW,
JBIG2_PAGE_COMPLETE,
JBIG2_PAGE_RETURNED,
JBIG2_PAGE_RELEASED
} Jbig2PageState;
 
struct _Jbig2Page {
Jbig2PageState state;
uint32_t number;
uint32_t height, width; /* in pixels */
uint32_t x_resolution,
y_resolution; /* in pixels per meter */
uint16_t stripe_size;
bool striped;
int end_row;
uint8_t flags;
Jbig2Image *image;
};
 
int jbig2_page_info (Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);
int jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);
int jbig2_end_of_page(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);
int jbig2_extension_segment(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);
 
typedef enum {
JBIG2_COMPOSE_OR = 0,
JBIG2_COMPOSE_AND = 1,
JBIG2_COMPOSE_XOR = 2,
JBIG2_COMPOSE_XNOR = 3,
JBIG2_COMPOSE_REPLACE = 4
} Jbig2ComposeOp;
 
int jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src, int x, int y, Jbig2ComposeOp op);
int jbig2_page_add_result(Jbig2Ctx *ctx, Jbig2Page *page, Jbig2Image *src, int x, int y, Jbig2ComposeOp op);
 
/* region segment info */
 
typedef struct {
int32_t width;
int32_t height;
int32_t x;
int32_t y;
Jbig2ComposeOp op;
uint8_t flags;
} Jbig2RegionSegmentInfo;
 
void jbig2_get_region_segment_info(Jbig2RegionSegmentInfo *info, const uint8_t *segment_data);
int jbig2_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);
 
/* 7.4 */
int jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
const uint8_t *segment_data);
int jbig2_refinement_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
const byte *segment_data);
 
int jbig2_pattern_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,
const byte *segment_data);
int jbig2_halftone_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
const byte *segment_data);
 
 
/* The word stream design is a compromise between simplicity and
trying to amortize the number of method calls. Each ::get_next_word
invocation pulls 4 bytes from the stream, packed big-endian into a
32 bit word. The offset argument is provided as a convenience. It
begins at 0 and increments by 4 for each successive invocation. */
typedef struct _Jbig2WordStream Jbig2WordStream;
 
struct _Jbig2WordStream {
uint32_t (*get_next_word) (Jbig2WordStream *self, int offset);
};
 
Jbig2WordStream *
jbig2_word_stream_buf_new(Jbig2Ctx *ctx, const byte *data, size_t size);
 
void
jbig2_word_stream_buf_free(Jbig2Ctx *ctx, Jbig2WordStream *ws);
/contrib/media/updf/include/jbig2_symbol_dict.h
0,0 → 1,56
/*
jbig2dec
 
Copyright (C) 2001-2002 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
/* symbol dictionary header */
 
/* the results of decoding a symbol dictionary */
typedef struct {
int n_symbols;
Jbig2Image **glyphs;
} Jbig2SymbolDict;
 
/* decode a symbol dictionary segment and store the results */
int
jbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,
const byte *segment_data);
 
/* get a particular glyph by index */
Jbig2Image *
jbig2_sd_glyph(Jbig2SymbolDict *dict, unsigned int id);
 
/* return a new empty symbol dict */
Jbig2SymbolDict *
jbig2_sd_new(Jbig2Ctx *ctx, int n_symbols);
 
/* release the memory associated with a symbol dict */
void
jbig2_sd_release(Jbig2Ctx *ctx, Jbig2SymbolDict *dict);
 
/* generate a new symbol dictionary by concatenating a list of
existing dictionaries */
Jbig2SymbolDict *
jbig2_sd_cat(Jbig2Ctx *ctx, int n_dicts,
Jbig2SymbolDict **dicts);
 
/* count the number of dictionary segments referred
to by the given segment */
int
jbig2_sd_count_referred(Jbig2Ctx *ctx, Jbig2Segment *segment);
 
/* return an array of pointers to symbol dictionaries referred
to by a segment */
Jbig2SymbolDict **
jbig2_sd_list_referred(Jbig2Ctx *ctx, Jbig2Segment *segment);
 
/contrib/media/updf/include/jbig2_text.h
0,0 → 1,73
/*
jbig2dec
 
Copyright (C) 2002-2004 Artifex Software, Inc.
 
This software is distributed under license and may not
be copied, modified or distributed except as expressly
authorized under the terms of the license contained in
the file LICENSE in this distribution.
 
For further licensing information refer to http://artifex.com/ or
contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
 
/**
* Headers for Text region handling
**/
 
typedef enum {
JBIG2_CORNER_BOTTOMLEFT = 0,
JBIG2_CORNER_TOPLEFT = 1,
JBIG2_CORNER_BOTTOMRIGHT = 2,
JBIG2_CORNER_TOPRIGHT = 3
} Jbig2RefCorner;
 
typedef struct {
bool SBHUFF;
bool SBREFINE;
bool SBDEFPIXEL;
Jbig2ComposeOp SBCOMBOP;
bool TRANSPOSED;
Jbig2RefCorner REFCORNER;
int SBDSOFFSET;
/* int SBW; */
/* int SBH; */
uint32_t SBNUMINSTANCES;
int LOGSBSTRIPS;
int SBSTRIPS;
/* int SBNUMSYMS; */
/* SBSYMCODES */
/* SBSYMCODELEN */
/* SBSYMS */
Jbig2HuffmanTable *SBHUFFFS;
Jbig2HuffmanTable *SBHUFFDS;
Jbig2HuffmanTable *SBHUFFDT;
Jbig2HuffmanTable *SBHUFFRDW;
Jbig2HuffmanTable *SBHUFFRDH;
Jbig2HuffmanTable *SBHUFFRDX;
Jbig2HuffmanTable *SBHUFFRDY;
Jbig2HuffmanTable *SBHUFFRSIZE;
Jbig2ArithIntCtx *IADT;
Jbig2ArithIntCtx *IAFS;
Jbig2ArithIntCtx *IADS;
Jbig2ArithIntCtx *IAIT;
Jbig2ArithIaidCtx *IAID;
Jbig2ArithIntCtx *IARI;
Jbig2ArithIntCtx *IARDW;
Jbig2ArithIntCtx *IARDH;
Jbig2ArithIntCtx *IARDX;
Jbig2ArithIntCtx *IARDY;
bool SBRTEMPLATE;
int8_t sbrat[4];
} Jbig2TextRegionParams;
 
int
jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
const Jbig2TextRegionParams *params,
const Jbig2SymbolDict * const *dicts, const int n_dicts,
Jbig2Image *image,
const byte *data, const size_t size,
Jbig2ArithCx *GR_stats,
Jbig2ArithState *as, Jbig2WordStream *ws);
/contrib/media/updf/include/jconfig.h
0,0 → 1,38
/* jconfig.dj --- jconfig.h for DJGPP (Delorie's GNU C port) on MS-DOS. */
/* see jconfig.doc for explanations */
 
#define HAVE_PROTOTYPES
#define HAVE_UNSIGNED_CHAR
#define HAVE_UNSIGNED_SHORT
/* #define void char */
/* #define const */
#undef CHAR_IS_UNSIGNED
#define HAVE_STDDEF_H
#define HAVE_STDLIB_H
#undef NEED_BSD_STRINGS
#undef NEED_SYS_TYPES_H
#undef NEED_FAR_POINTERS /* DJGPP uses flat 32-bit addressing */
#undef NEED_SHORT_EXTERNAL_NAMES
#undef INCOMPLETE_TYPES_BROKEN
 
#ifdef JPEG_INTERNALS
 
#undef RIGHT_SHIFT_IS_UNSIGNED
 
#endif /* JPEG_INTERNALS */
 
#ifdef JPEG_CJPEG_DJPEG
 
#define BMP_SUPPORTED /* BMP image file format */
#define GIF_SUPPORTED /* GIF image file format */
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
#undef RLE_SUPPORTED /* Utah RLE image file format */
#define TARGA_SUPPORTED /* Targa image file format */
 
#undef TWO_FILE_COMMANDLINE /* optional */
#define USE_SETMODE /* Needed to make one-file style work in DJGPP */
#undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */
#undef DONT_USE_B_MODE
#undef PROGRESS_REPORT /* optional */
 
#endif /* JPEG_CJPEG_DJPEG */
/contrib/media/updf/include/jmorecfg.h
0,0 → 1,363
/*
* jmorecfg.h
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains additional configuration options that customize the
* JPEG software for special applications or support machine-dependent
* optimizations. Most users will not need to touch this file.
*/
 
 
/*
* Define BITS_IN_JSAMPLE as either
* 8 for 8-bit sample values (the usual setting)
* 12 for 12-bit sample values
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
* JPEG standard, and the IJG code does not support anything else!
* We do not support run-time selection of data precision, sorry.
*/
 
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
 
 
/*
* Maximum number of components (color channels) allowed in JPEG image.
* To meet the letter of the JPEG spec, set this to 255. However, darn
* few applications need more than 4 channels (maybe 5 for CMYK + alpha
* mask). We recommend 10 as a reasonable compromise; use 4 if you are
* really short on memory. (Each allowed component costs a hundred or so
* bytes of storage, whether actually used in an image or not.)
*/
 
#define MAX_COMPONENTS 10 /* maximum number of image components */
 
 
/*
* Basic data types.
* You may need to change these if you have a machine with unusual data
* type sizes; for example, "char" not 8 bits, "short" not 16 bits,
* or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
* but it had better be at least 16.
*/
 
/* Representation of a single sample (pixel element value).
* We frequently allocate large arrays of these, so it's important to keep
* them small. But if you have memory to burn and access to char or short
* arrays is very slow on your hardware, you might want to change these.
*/
 
#if BITS_IN_JSAMPLE == 8
/* JSAMPLE should be the smallest type that will hold the values 0..255.
* You can use a signed char by having GETJSAMPLE mask it with 0xFF.
*/
 
#ifdef HAVE_UNSIGNED_CHAR
 
typedef unsigned char JSAMPLE;
#define GETJSAMPLE(value) ((int) (value))
 
#else /* not HAVE_UNSIGNED_CHAR */
 
typedef char JSAMPLE;
#ifdef CHAR_IS_UNSIGNED
#define GETJSAMPLE(value) ((int) (value))
#else
#define GETJSAMPLE(value) ((int) (value) & 0xFF)
#endif /* CHAR_IS_UNSIGNED */
 
#endif /* HAVE_UNSIGNED_CHAR */
 
#define MAXJSAMPLE 255
#define CENTERJSAMPLE 128
 
#endif /* BITS_IN_JSAMPLE == 8 */
 
 
#if BITS_IN_JSAMPLE == 12
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
* On nearly all machines "short" will do nicely.
*/
 
typedef short JSAMPLE;
#define GETJSAMPLE(value) ((int) (value))
 
#define MAXJSAMPLE 4095
#define CENTERJSAMPLE 2048
 
#endif /* BITS_IN_JSAMPLE == 12 */
 
 
/* Representation of a DCT frequency coefficient.
* This should be a signed value of at least 16 bits; "short" is usually OK.
* Again, we allocate large arrays of these, but you can change to int
* if you have memory to burn and "short" is really slow.
*/
 
typedef short JCOEF;
 
 
/* Compressed datastreams are represented as arrays of JOCTET.
* These must be EXACTLY 8 bits wide, at least once they are written to
* external storage. Note that when using the stdio data source/destination
* managers, this is also the data type passed to fread/fwrite.
*/
 
#ifdef HAVE_UNSIGNED_CHAR
 
typedef unsigned char JOCTET;
#define GETJOCTET(value) (value)
 
#else /* not HAVE_UNSIGNED_CHAR */
 
typedef char JOCTET;
#ifdef CHAR_IS_UNSIGNED
#define GETJOCTET(value) (value)
#else
#define GETJOCTET(value) ((value) & 0xFF)
#endif /* CHAR_IS_UNSIGNED */
 
#endif /* HAVE_UNSIGNED_CHAR */
 
 
/* These typedefs are used for various table entries and so forth.
* They must be at least as wide as specified; but making them too big
* won't cost a huge amount of memory, so we don't provide special
* extraction code like we did for JSAMPLE. (In other words, these
* typedefs live at a different point on the speed/space tradeoff curve.)
*/
 
/* UINT8 must hold at least the values 0..255. */
 
#ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char UINT8;
#else /* not HAVE_UNSIGNED_CHAR */
#ifdef CHAR_IS_UNSIGNED
typedef char UINT8;
#else /* not CHAR_IS_UNSIGNED */
typedef short UINT8;
#endif /* CHAR_IS_UNSIGNED */
#endif /* HAVE_UNSIGNED_CHAR */
 
/* UINT16 must hold at least the values 0..65535. */
 
#ifdef HAVE_UNSIGNED_SHORT
typedef unsigned short UINT16;
#else /* not HAVE_UNSIGNED_SHORT */
typedef unsigned int UINT16;
#endif /* HAVE_UNSIGNED_SHORT */
 
/* INT16 must hold at least the values -32768..32767. */
 
#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
typedef short INT16;
#endif
 
/* INT32 must hold at least signed 32-bit values. */
 
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
typedef long INT32;
#endif
 
/* Datatype used for image dimensions. The JPEG standard only supports
* images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
* "unsigned int" is sufficient on all machines. However, if you need to
* handle larger images and you don't mind deviating from the spec, you
* can change this datatype.
*/
 
typedef unsigned int JDIMENSION;
 
#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
 
 
/* These macros are used in all function definitions and extern declarations.
* You could modify them if you need to change function linkage conventions;
* in particular, you'll need to do that to make the library a Windows DLL.
* Another application is to make all functions global for use with debuggers
* or code profilers that require it.
*/
 
/* a function called through method pointers: */
#define METHODDEF(type) static type
/* a function used only in its module: */
#define LOCAL(type) static type
/* a function referenced thru EXTERNs: */
#define GLOBAL(type) type
/* a reference to a GLOBAL function: */
#define EXTERN(type) extern type
 
 
/* This macro is used to declare a "method", that is, a function pointer.
* We want to supply prototype parameters if the compiler can cope.
* Note that the arglist parameter must be parenthesized!
* Again, you can customize this if you need special linkage keywords.
*/
 
#ifdef HAVE_PROTOTYPES
#define JMETHOD(type,methodname,arglist) type (*methodname) arglist
#else
#define JMETHOD(type,methodname,arglist) type (*methodname) ()
#endif
 
 
/* Here is the pseudo-keyword for declaring pointers that must be "far"
* on 80x86 machines. Most of the specialized coding for 80x86 is handled
* by just saying "FAR *" where such a pointer is needed. In a few places
* explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
*/
 
#ifdef NEED_FAR_POINTERS
#define FAR far
#else
#define FAR
#endif
 
 
/*
* On a few systems, type boolean and/or its values FALSE, TRUE may appear
* in standard header files. Or you may have conflicts with application-
* specific header files that you want to include together with these files.
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
*/
 
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
#ifndef FALSE /* in case these macros already exist */
#define FALSE 0 /* values of boolean */
#endif
#ifndef TRUE
#define TRUE 1
#endif
 
 
/*
* The remaining options affect code selection within the JPEG library,
* but they don't need to be visible to most applications using the library.
* To minimize application namespace pollution, the symbols won't be
* defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
*/
 
#ifdef JPEG_INTERNALS
#define JPEG_INTERNAL_OPTIONS
#endif
 
#ifdef JPEG_INTERNAL_OPTIONS
 
 
/*
* These defines indicate whether to include various optional functions.
* Undefining some of these symbols will produce a smaller but less capable
* library. Note that you can leave certain source files out of the
* compilation/linking process if you've #undef'd the corresponding symbols.
* (You may HAVE to do that if your compiler doesn't like null source files.)
*/
 
/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */
 
/* Capability options common to encoder and decoder: */
 
#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
 
/* Encoder capability options: */
 
#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
/* Note: if you selected 12-bit data precision, it is dangerous to turn off
* ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
* precision, so jchuff.c normally uses entropy optimization to compute
* usable tables for higher precision. If you don't want to do optimization,
* you'll have to supply different default Huffman tables.
* The exact same statements apply for progressive JPEG: the default tables
* don't work for progressive mode. (This may get fixed, however.)
*/
#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
 
/* Decoder capability options: */
 
#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
 
/* more capability options later, no doubt */
 
 
/*
* Ordering of RGB data in scanlines passed to or from the application.
* If your application wants to deal with data in the order B,G,R, just
* change these macros. You can also deal with formats such as R,G,B,X
* (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing
* the offsets will also change the order in which colormap data is organized.
* RESTRICTIONS:
* 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
* 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
* useful if you are using JPEG color spaces other than YCbCr or grayscale.
* 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
* is not 3 (they don't understand about dummy color components!). So you
* can't use color quantization if you change that value.
*/
 
#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
#define RGB_GREEN 1 /* Offset of Green */
#define RGB_BLUE 2 /* Offset of Blue */
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
 
 
/* Definitions for speed-related optimizations. */
 
 
/* If your compiler supports inline functions, define INLINE
* as the inline keyword; otherwise define it as empty.
*/
 
#ifndef INLINE
#ifdef __GNUC__ /* for instance, GNU C knows about inline */
#define INLINE __inline__
#endif
#ifndef INLINE
#define INLINE /* default is to define it as empty */
#endif
#endif
 
 
/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
* two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
* as short on such a machine. MULTIPLIER must be at least 16 bits wide.
*/
 
#ifndef MULTIPLIER
#define MULTIPLIER int /* type for fastest integer multiply */
#endif
 
 
/* FAST_FLOAT should be either float or double, whichever is done faster
* by your compiler. (Note that this type is only used in the floating point
* DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
* Typically, float is faster in ANSI C compilers, while double is faster in
* pre-ANSI compilers (because they insist on converting to double anyway).
* The code below therefore chooses float if we have ANSI-style prototypes.
*/
 
#ifndef FAST_FLOAT
#ifdef HAVE_PROTOTYPES
#define FAST_FLOAT float
#else
#define FAST_FLOAT double
#endif
#endif
 
#endif /* JPEG_INTERNAL_OPTIONS */
/contrib/media/updf/include/jp2.h
0,0 → 1,231
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __JP2_H
#define __JP2_H
/**
@file jp2.h
@brief The JPEG-2000 file format Reader/Writer (JP2)
 
*/
 
/** @defgroup JP2 JP2 - JPEG-2000 file format reader/writer */
/*@{*/
 
#define JPIP_JPIP 0x6a706970
 
#define JP2_JP 0x6a502020 /**< JPEG 2000 signature box */
#define JP2_FTYP 0x66747970 /**< File type box */
#define JP2_JP2H 0x6a703268 /**< JP2 header box */
#define JP2_IHDR 0x69686472 /**< Image header box */
#define JP2_COLR 0x636f6c72 /**< Colour specification box */
#define JP2_JP2C 0x6a703263 /**< Contiguous codestream box */
#define JP2_URL 0x75726c20 /**< URL box */
#define JP2_DTBL 0x6474626c /**< Data Reference box */
#define JP2_BPCC 0x62706363 /**< Bits per component box */
#define JP2_JP2 0x6a703220 /**< File type fields */
#define JP2_PCLR 0x70636c72 /**< Palette box */
#define JP2_CMAP 0x636d6170 /**< Component Mapping box */
#define JP2_CDEF 0x63646566 /**< Channel Definition box */
 
/* ----------------------------------------------------------------------- */
/**
Channel description: channel index, type, assocation
*/
typedef struct opj_jp2_cdef_info
{
unsigned short cn, typ, asoc;
} opj_jp2_cdef_info_t;
 
/**
Channel descriptions and number of descriptions
*/
typedef struct opj_jp2_cdef
{
opj_jp2_cdef_info_t *info;
unsigned short n;
} opj_jp2_cdef_t;
 
/**
Component mappings: channel index, mapping type, palette index
*/
typedef struct opj_jp2_cmap_comp
{
unsigned short cmp;
unsigned char mtyp, pcol;
} opj_jp2_cmap_comp_t;
 
/**
Palette data: table entries, palette columns
*/
typedef struct opj_jp2_pclr
{
unsigned int *entries;
unsigned char *channel_sign;
unsigned char *channel_size;
opj_jp2_cmap_comp_t *cmap;
unsigned short nr_entries, nr_channels;
} opj_jp2_pclr_t;
 
/**
Collector for ICC profile, palette, component mapping, channel description
*/
typedef struct opj_jp2_color
{
unsigned char *icc_profile_buf;
int icc_profile_len;
 
opj_jp2_cdef_t *jp2_cdef;
opj_jp2_pclr_t *jp2_pclr;
unsigned char jp2_has_colr;
} opj_jp2_color_t;
 
/**
JP2 component
*/
typedef struct opj_jp2_comps {
int depth;
int sgnd;
int bpcc;
} opj_jp2_comps_t;
 
/**
JPEG-2000 file format reader/writer
*/
typedef struct opj_jp2 {
/** codec context */
opj_common_ptr cinfo;
/** handle to the J2K codec */
opj_j2k_t *j2k;
unsigned int w;
unsigned int h;
unsigned int numcomps;
unsigned int bpc;
unsigned int C;
unsigned int UnkC;
unsigned int IPR;
unsigned int meth;
unsigned int approx;
unsigned int enumcs;
unsigned int precedence;
unsigned int brand;
unsigned int minversion;
unsigned int numcl;
unsigned int *cl;
opj_jp2_comps_t *comps;
unsigned int j2k_codestream_offset;
unsigned int j2k_codestream_length;
} opj_jp2_t;
 
/**
JP2 Box
*/
typedef struct opj_jp2_box {
int length;
int type;
int init_pos;
} opj_jp2_box_t;
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Write the JP2H box - JP2 Header box (used in MJ2)
@param jp2 JP2 handle
@param cio Output buffer stream
*/
void jp2_write_jp2h(opj_jp2_t *jp2, opj_cio_t *cio);
/**
Read the JP2H box - JP2 Header box (used in MJ2)
@param jp2 JP2 handle
@param cio Input buffer stream
@param ext Collector for profile, cdef and pclr data
@return Returns true if successful, returns false otherwise
*/
bool jp2_read_jp2h(opj_jp2_t *jp2, opj_cio_t *cio, opj_jp2_color_t *color);
/**
Creates a JP2 decompression structure
@param cinfo Codec context info
@return Returns a handle to a JP2 decompressor if successful, returns NULL otherwise
*/
opj_jp2_t* jp2_create_decompress(opj_common_ptr cinfo);
/**
Destroy a JP2 decompressor handle
@param jp2 JP2 decompressor handle to destroy
*/
void jp2_destroy_decompress(opj_jp2_t *jp2);
/**
Setup the decoder decoding parameters using user parameters.
Decoding parameters are returned in jp2->j2k->cp.
@param jp2 JP2 decompressor handle
@param parameters decompression parameters
*/
void jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters);
/**
Decode an image from a JPEG-2000 file stream
@param jp2 JP2 decompressor handle
@param cio Input buffer stream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
opj_image_t* jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
/**
Creates a JP2 compression structure
@param cinfo Codec context info
@return Returns a handle to a JP2 compressor if successful, returns NULL otherwise
*/
opj_jp2_t* jp2_create_compress(opj_common_ptr cinfo);
/**
Destroy a JP2 compressor handle
@param jp2 JP2 compressor handle to destroy
*/
void jp2_destroy_compress(opj_jp2_t *jp2);
/**
Setup the encoder parameters using the current image and using user parameters.
Coding parameters are returned in jp2->j2k->cp.
@param jp2 JP2 compressor handle
@param parameters compression parameters
@param image input filled image
*/
void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image);
/**
Encode an image into a JPEG-2000 file stream
@param jp2 JP2 compressor handle
@param cio Output buffer stream
@param image Image to encode
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
bool jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __JP2_H */
 
/contrib/media/updf/include/jpeglib.h
0,0 → 1,1096
/*
* jpeglib.h
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file defines the application interface for the JPEG library.
* Most applications using the library need only include this file,
* and perhaps jerror.h if they want to know the exact error codes.
*/
 
#ifndef JPEGLIB_H
#define JPEGLIB_H
 
/*
* First we include the configuration files that record how this
* installation of the JPEG library is set up. jconfig.h can be
* generated automatically for many systems. jmorecfg.h contains
* manual configuration options that most people need not worry about.
*/
 
#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */
#include "jconfig.h" /* widely used configuration options */
#endif
#include "jmorecfg.h" /* seldom changed options */
 
 
/* Version ID for the JPEG library.
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
*/
 
#define JPEG_LIB_VERSION 62 /* Version 6b */
 
 
/* Various constants determining the sizes of things.
* All of these are specified by the JPEG standard, so don't change them
* if you want to be compatible.
*/
 
#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */
#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */
#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */
#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */
#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */
#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */
#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */
/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
* the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
* If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
* to handle it. We even let you do this from the jconfig.h file. However,
* we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
* sometimes emits noncompliant files doesn't mean you should too.
*/
#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */
#ifndef D_MAX_BLOCKS_IN_MCU
#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */
#endif
 
 
/* Data structures for images (arrays of samples and of DCT coefficients).
* On 80x86 machines, the image arrays are too big for near pointers,
* but the pointer arrays can fit in near memory.
*/
 
typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */
typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
 
typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */
typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */
typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */
typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */
 
typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */
 
 
/* Types for JPEG compression parameters and working tables. */
 
 
/* DCT coefficient quantization tables. */
 
typedef struct {
/* This array gives the coefficient quantizers in natural array order
* (not the zigzag order in which they are stored in a JPEG DQT marker).
* CAUTION: IJG versions prior to v6a kept this array in zigzag order.
*/
UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */
/* This field is used only during compression. It's initialized FALSE when
* the table is created, and set TRUE when it's been output to the file.
* You could suppress output of a table by setting this to TRUE.
* (See jpeg_suppress_tables for an example.)
*/
boolean sent_table; /* TRUE when table has been output */
} JQUANT_TBL;
 
 
/* Huffman coding tables. */
 
typedef struct {
/* These two fields directly represent the contents of a JPEG DHT marker */
UINT8 bits[17]; /* bits[k] = # of symbols with codes of */
/* length k bits; bits[0] is unused */
UINT8 huffval[256]; /* The symbols, in order of incr code length */
/* This field is used only during compression. It's initialized FALSE when
* the table is created, and set TRUE when it's been output to the file.
* You could suppress output of a table by setting this to TRUE.
* (See jpeg_suppress_tables for an example.)
*/
boolean sent_table; /* TRUE when table has been output */
} JHUFF_TBL;
 
 
/* Basic info about one component (color channel). */
 
typedef struct {
/* These values are fixed over the whole image. */
/* For compression, they must be supplied by parameter setup; */
/* for decompression, they are read from the SOF marker. */
int component_id; /* identifier for this component (0..255) */
int component_index; /* its index in SOF or cinfo->comp_info[] */
int h_samp_factor; /* horizontal sampling factor (1..4) */
int v_samp_factor; /* vertical sampling factor (1..4) */
int quant_tbl_no; /* quantization table selector (0..3) */
/* These values may vary between scans. */
/* For compression, they must be supplied by parameter setup; */
/* for decompression, they are read from the SOS marker. */
/* The decompressor output side may not use these variables. */
int dc_tbl_no; /* DC entropy table selector (0..3) */
int ac_tbl_no; /* AC entropy table selector (0..3) */
/* Remaining fields should be treated as private by applications. */
/* These values are computed during compression or decompression startup: */
/* Component's size in DCT blocks.
* Any dummy blocks added to complete an MCU are not counted; therefore
* these values do not depend on whether a scan is interleaved or not.
*/
JDIMENSION width_in_blocks;
JDIMENSION height_in_blocks;
/* Size of a DCT block in samples. Always DCTSIZE for compression.
* For decompression this is the size of the output from one DCT block,
* reflecting any scaling we choose to apply during the IDCT step.
* Values of 1,2,4,8 are likely to be supported. Note that different
* components may receive different IDCT scalings.
*/
int DCT_scaled_size;
/* The downsampled dimensions are the component's actual, unpadded number
* of samples at the main buffer (preprocessing/compression interface), thus
* downsampled_width = ceil(image_width * Hi/Hmax)
* and similarly for height. For decompression, IDCT scaling is included, so
* downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE)
*/
JDIMENSION downsampled_width; /* actual width in samples */
JDIMENSION downsampled_height; /* actual height in samples */
/* This flag is used only for decompression. In cases where some of the
* components will be ignored (eg grayscale output from YCbCr image),
* we can skip most computations for the unused components.
*/
boolean component_needed; /* do we need the value of this component? */
 
/* These values are computed before starting a scan of the component. */
/* The decompressor output side may not use these variables. */
int MCU_width; /* number of blocks per MCU, horizontally */
int MCU_height; /* number of blocks per MCU, vertically */
int MCU_blocks; /* MCU_width * MCU_height */
int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_scaled_size */
int last_col_width; /* # of non-dummy blocks across in last MCU */
int last_row_height; /* # of non-dummy blocks down in last MCU */
 
/* Saved quantization table for component; NULL if none yet saved.
* See jdinput.c comments about the need for this information.
* This field is currently used only for decompression.
*/
JQUANT_TBL * quant_table;
 
/* Private per-component storage for DCT or IDCT subsystem. */
void * dct_table;
} jpeg_component_info;
 
 
/* The script for encoding a multiple-scan file is an array of these: */
 
typedef struct {
int comps_in_scan; /* number of components encoded in this scan */
int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
int Ss, Se; /* progressive JPEG spectral selection parms */
int Ah, Al; /* progressive JPEG successive approx. parms */
} jpeg_scan_info;
 
/* The decompressor can save APPn and COM markers in a list of these: */
 
typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;
 
struct jpeg_marker_struct {
jpeg_saved_marker_ptr next; /* next in list, or NULL */
UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */
unsigned int original_length; /* # bytes of data in the file */
unsigned int data_length; /* # bytes of data saved at data[] */
JOCTET FAR * data; /* the data contained in the marker */
/* the marker length word is not counted in data_length or original_length */
};
 
/* Known color spaces. */
 
typedef enum {
JCS_UNKNOWN, /* error/unspecified */
JCS_GRAYSCALE, /* monochrome */
JCS_RGB, /* red/green/blue */
JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
JCS_CMYK, /* C/M/Y/K */
JCS_YCCK /* Y/Cb/Cr/K */
} J_COLOR_SPACE;
 
/* DCT/IDCT algorithm options. */
 
typedef enum {
JDCT_ISLOW, /* slow but accurate integer algorithm */
JDCT_IFAST, /* faster, less accurate integer method */
JDCT_FLOAT /* floating-point: accurate, fast on fast HW */
} J_DCT_METHOD;
 
#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */
#define JDCT_DEFAULT JDCT_ISLOW
#endif
#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */
#define JDCT_FASTEST JDCT_IFAST
#endif
 
/* Dithering options for decompression. */
 
typedef enum {
JDITHER_NONE, /* no dithering */
JDITHER_ORDERED, /* simple ordered dither */
JDITHER_FS /* Floyd-Steinberg error diffusion dither */
} J_DITHER_MODE;
 
 
/* Common fields between JPEG compression and decompression master structs. */
 
#define jpeg_common_fields \
struct jpeg_error_mgr * err; /* Error handler module */\
struct jpeg_memory_mgr * mem; /* Memory manager module */\
struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
void * client_data; /* Available for use by application */\
boolean is_decompressor; /* So common code can tell which is which */\
int global_state /* For checking call sequence validity */
 
/* Routines that are to be used by both halves of the library are declared
* to receive a pointer to this structure. There are no actual instances of
* jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
*/
struct jpeg_common_struct {
jpeg_common_fields; /* Fields common to both master struct types */
/* Additional fields follow in an actual jpeg_compress_struct or
* jpeg_decompress_struct. All three structs must agree on these
* initial fields! (This would be a lot cleaner in C++.)
*/
};
 
typedef struct jpeg_common_struct * j_common_ptr;
typedef struct jpeg_compress_struct * j_compress_ptr;
typedef struct jpeg_decompress_struct * j_decompress_ptr;
 
 
/* Master record for a compression instance */
 
struct jpeg_compress_struct {
jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */
 
/* Destination for compressed data */
struct jpeg_destination_mgr * dest;
 
/* Description of source image --- these fields must be filled in by
* outer application before starting compression. in_color_space must
* be correct before you can even call jpeg_set_defaults().
*/
 
JDIMENSION image_width; /* input image width */
JDIMENSION image_height; /* input image height */
int input_components; /* # of color components in input image */
J_COLOR_SPACE in_color_space; /* colorspace of input image */
 
double input_gamma; /* image gamma of input image */
 
/* Compression parameters --- these fields must be set before calling
* jpeg_start_compress(). We recommend calling jpeg_set_defaults() to
* initialize everything to reasonable defaults, then changing anything
* the application specifically wants to change. That way you won't get
* burnt when new parameters are added. Also note that there are several
* helper routines to simplify changing parameters.
*/
 
int data_precision; /* bits of precision in image data */
 
int num_components; /* # of color components in JPEG image */
J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
 
jpeg_component_info * comp_info;
/* comp_info[i] describes component that appears i'th in SOF */
JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
/* ptrs to coefficient quantization tables, or NULL if not defined */
JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
/* ptrs to Huffman coding tables, or NULL if not defined */
UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
 
int num_scans; /* # of entries in scan_info array */
const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
/* The default value of scan_info is NULL, which causes a single-scan
* sequential JPEG file to be emitted. To create a multi-scan file,
* set num_scans and scan_info to point to an array of scan definitions.
*/
 
boolean raw_data_in; /* TRUE=caller supplies downsampled data */
boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
boolean optimize_coding; /* TRUE=optimize entropy encoding parms */
boolean CCIR601_sampling; /* TRUE=first samples are cosited */
int smoothing_factor; /* 1..100, or 0 for no input smoothing */
J_DCT_METHOD dct_method; /* DCT algorithm selector */
 
/* The restart interval can be specified in absolute MCUs by setting
* restart_interval, or in MCU rows by setting restart_in_rows
* (in which case the correct restart_interval will be figured
* for each scan).
*/
unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
int restart_in_rows; /* if > 0, MCU rows per restart interval */
 
/* Parameters controlling emission of special markers. */
 
boolean write_JFIF_header; /* should a JFIF marker be written? */
UINT8 JFIF_major_version; /* What to write for the JFIF version number */
UINT8 JFIF_minor_version;
/* These three values are not used by the JPEG code, merely copied */
/* into the JFIF APP0 marker. density_unit can be 0 for unknown, */
/* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */
/* ratio is defined by X_density/Y_density even when density_unit=0. */
UINT8 density_unit; /* JFIF code for pixel size units */
UINT16 X_density; /* Horizontal pixel density */
UINT16 Y_density; /* Vertical pixel density */
boolean write_Adobe_marker; /* should an Adobe marker be written? */
/* State variable: index of next scanline to be written to
* jpeg_write_scanlines(). Application may use this to control its
* processing loop, e.g., "while (next_scanline < image_height)".
*/
 
JDIMENSION next_scanline; /* 0 .. image_height-1 */
 
/* Remaining fields are known throughout compressor, but generally
* should not be touched by a surrounding application.
*/
 
/*
* These fields are computed during compression startup
*/
boolean progressive_mode; /* TRUE if scan script uses progressive mode */
int max_h_samp_factor; /* largest h_samp_factor */
int max_v_samp_factor; /* largest v_samp_factor */
 
JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
/* The coefficient controller receives data in units of MCU rows as defined
* for fully interleaved scans (whether the JPEG file is interleaved or not).
* There are v_samp_factor * DCTSIZE sample rows of each component in an
* "iMCU" (interleaved MCU) row.
*/
/*
* These fields are valid during any one scan.
* They describe the components and MCUs actually appearing in the scan.
*/
int comps_in_scan; /* # of JPEG components in this scan */
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
/* *cur_comp_info[i] describes component that appears i'th in SOS */
JDIMENSION MCUs_per_row; /* # of MCUs across the image */
JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
int blocks_in_MCU; /* # of DCT blocks per MCU */
int MCU_membership[C_MAX_BLOCKS_IN_MCU];
/* MCU_membership[i] is index in cur_comp_info of component owning */
/* i'th block in an MCU */
 
int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
 
/*
* Links to compression subobjects (methods and private variables of modules)
*/
struct jpeg_comp_master * master;
struct jpeg_c_main_controller * main;
struct jpeg_c_prep_controller * prep;
struct jpeg_c_coef_controller * coef;
struct jpeg_marker_writer * marker;
struct jpeg_color_converter * cconvert;
struct jpeg_downsampler * downsample;
struct jpeg_forward_dct * fdct;
struct jpeg_entropy_encoder * entropy;
jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */
int script_space_size;
};
 
 
/* Master record for a decompression instance */
 
struct jpeg_decompress_struct {
jpeg_common_fields; /* Fields shared with jpeg_compress_struct */
 
/* Source of compressed data */
struct jpeg_source_mgr * src;
 
/* Basic description of image --- filled in by jpeg_read_header(). */
/* Application may inspect these values to decide how to process image. */
 
JDIMENSION image_width; /* nominal image width (from SOF marker) */
JDIMENSION image_height; /* nominal image height */
int num_components; /* # of color components in JPEG image */
J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
 
/* Decompression processing parameters --- these fields must be set before
* calling jpeg_start_decompress(). Note that jpeg_read_header() initializes
* them to default values.
*/
 
J_COLOR_SPACE out_color_space; /* colorspace for output */
 
unsigned int scale_num, scale_denom; /* fraction by which to scale image */
 
double output_gamma; /* image gamma wanted in output */
 
boolean buffered_image; /* TRUE=multiple output passes */
boolean raw_data_out; /* TRUE=downsampled data wanted */
 
J_DCT_METHOD dct_method; /* IDCT algorithm selector */
boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */
boolean do_block_smoothing; /* TRUE=apply interblock smoothing */
 
boolean quantize_colors; /* TRUE=colormapped output wanted */
/* the following are ignored if not quantize_colors: */
J_DITHER_MODE dither_mode; /* type of color dithering to use */
boolean two_pass_quantize; /* TRUE=use two-pass color quantization */
int desired_number_of_colors; /* max # colors to use in created colormap */
/* these are significant only in buffered-image mode: */
boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */
boolean enable_external_quant;/* enable future use of external colormap */
boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */
 
/* Description of actual output image that will be returned to application.
* These fields are computed by jpeg_start_decompress().
* You can also use jpeg_calc_output_dimensions() to determine these values
* in advance of calling jpeg_start_decompress().
*/
 
JDIMENSION output_width; /* scaled image width */
JDIMENSION output_height; /* scaled image height */
int out_color_components; /* # of color components in out_color_space */
int output_components; /* # of color components returned */
/* output_components is 1 (a colormap index) when quantizing colors;
* otherwise it equals out_color_components.
*/
int rec_outbuf_height; /* min recommended height of scanline buffer */
/* If the buffer passed to jpeg_read_scanlines() is less than this many rows
* high, space and time will be wasted due to unnecessary data copying.
* Usually rec_outbuf_height will be 1 or 2, at most 4.
*/
 
/* When quantizing colors, the output colormap is described by these fields.
* The application can supply a colormap by setting colormap non-NULL before
* calling jpeg_start_decompress; otherwise a colormap is created during
* jpeg_start_decompress or jpeg_start_output.
* The map has out_color_components rows and actual_number_of_colors columns.
*/
int actual_number_of_colors; /* number of entries in use */
JSAMPARRAY colormap; /* The color map as a 2-D pixel array */
 
/* State variables: these variables indicate the progress of decompression.
* The application may examine these but must not modify them.
*/
 
/* Row index of next scanline to be read from jpeg_read_scanlines().
* Application may use this to control its processing loop, e.g.,
* "while (output_scanline < output_height)".
*/
JDIMENSION output_scanline; /* 0 .. output_height-1 */
 
/* Current input scan number and number of iMCU rows completed in scan.
* These indicate the progress of the decompressor input side.
*/
int input_scan_number; /* Number of SOS markers seen so far */
JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */
 
/* The "output scan number" is the notional scan being displayed by the
* output side. The decompressor will not allow output scan/row number
* to get ahead of input scan/row, but it can fall arbitrarily far behind.
*/
int output_scan_number; /* Nominal scan number being displayed */
JDIMENSION output_iMCU_row; /* Number of iMCU rows read */
 
/* Current progression status. coef_bits[c][i] indicates the precision
* with which component c's DCT coefficient i (in zigzag order) is known.
* It is -1 when no data has yet been received, otherwise it is the point
* transform (shift) value for the most recent scan of the coefficient
* (thus, 0 at completion of the progression).
* This pointer is NULL when reading a non-progressive file.
*/
int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */
 
/* Internal JPEG parameters --- the application usually need not look at
* these fields. Note that the decompressor output side may not use
* any parameters that can change between scans.
*/
 
/* Quantization and Huffman tables are carried forward across input
* datastreams when processing abbreviated JPEG datastreams.
*/
 
JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
/* ptrs to coefficient quantization tables, or NULL if not defined */
 
JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
/* ptrs to Huffman coding tables, or NULL if not defined */
 
/* These parameters are never carried across datastreams, since they
* are given in SOF/SOS markers or defined to be reset by SOI.
*/
 
int data_precision; /* bits of precision in image data */
 
jpeg_component_info * comp_info;
/* comp_info[i] describes component that appears i'th in SOF */
 
boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */
boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
 
UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
 
unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
 
/* These fields record data obtained from optional markers recognized by
* the JPEG library.
*/
boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */
/* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
UINT8 JFIF_major_version; /* JFIF version number */
UINT8 JFIF_minor_version;
UINT8 density_unit; /* JFIF code for pixel size units */
UINT16 X_density; /* Horizontal pixel density */
UINT16 Y_density; /* Vertical pixel density */
boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */
UINT8 Adobe_transform; /* Color transform code from Adobe marker */
 
boolean CCIR601_sampling; /* TRUE=first samples are cosited */
 
/* Aside from the specific data retained from APPn markers known to the
* library, the uninterpreted contents of any or all APPn and COM markers
* can be saved in a list for examination by the application.
*/
jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
 
/* Remaining fields are known throughout decompressor, but generally
* should not be touched by a surrounding application.
*/
 
/*
* These fields are computed during decompression startup
*/
int max_h_samp_factor; /* largest h_samp_factor */
int max_v_samp_factor; /* largest v_samp_factor */
 
int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */
 
JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */
/* The coefficient controller's input and output progress is measured in
* units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows
* in fully interleaved JPEG scans, but are used whether the scan is
* interleaved or not. We define an iMCU row as v_samp_factor DCT block
* rows of each component. Therefore, the IDCT output contains
* v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row.
*/
 
JSAMPLE * sample_range_limit; /* table for fast range-limiting */
 
/*
* These fields are valid during any one scan.
* They describe the components and MCUs actually appearing in the scan.
* Note that the decompressor output side must not use these fields.
*/
int comps_in_scan; /* # of JPEG components in this scan */
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
/* *cur_comp_info[i] describes component that appears i'th in SOS */
 
JDIMENSION MCUs_per_row; /* # of MCUs across the image */
JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
 
int blocks_in_MCU; /* # of DCT blocks per MCU */
int MCU_membership[D_MAX_BLOCKS_IN_MCU];
/* MCU_membership[i] is index in cur_comp_info of component owning */
/* i'th block in an MCU */
 
int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
 
/* This field is shared between entropy decoder and marker parser.
* It is either zero or the code of a JPEG marker that has been
* read from the data source, but has not yet been processed.
*/
int unread_marker;
 
/*
* Links to decompression subobjects (methods, private variables of modules)
*/
struct jpeg_decomp_master * master;
struct jpeg_d_main_controller * main;
struct jpeg_d_coef_controller * coef;
struct jpeg_d_post_controller * post;
struct jpeg_input_controller * inputctl;
struct jpeg_marker_reader * marker;
struct jpeg_entropy_decoder * entropy;
struct jpeg_inverse_dct * idct;
struct jpeg_upsampler * upsample;
struct jpeg_color_deconverter * cconvert;
struct jpeg_color_quantizer * cquantize;
};
 
 
/* "Object" declarations for JPEG modules that may be supplied or called
* directly by the surrounding application.
* As with all objects in the JPEG library, these structs only define the
* publicly visible methods and state variables of a module. Additional
* private fields may exist after the public ones.
*/
 
 
/* Error handler object */
 
struct jpeg_error_mgr {
/* Error exit handler: does not return to caller */
JMETHOD(void, error_exit, (j_common_ptr cinfo));
/* Conditionally emit a trace or warning message */
JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
/* Routine that actually outputs a trace or error message */
JMETHOD(void, output_message, (j_common_ptr cinfo));
/* Format a message string for the most recent JPEG error or message */
JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
/* Reset error state variables at start of a new image */
JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
/* The message ID code and any parameters are saved here.
* A message can have one string parameter or up to 8 int parameters.
*/
int msg_code;
#define JMSG_STR_PARM_MAX 80
union {
int i[8];
char s[JMSG_STR_PARM_MAX];
} msg_parm;
/* Standard state variables for error facility */
int trace_level; /* max msg_level that will be displayed */
/* For recoverable corrupt-data errors, we emit a warning message,
* but keep going unless emit_message chooses to abort. emit_message
* should count warnings in num_warnings. The surrounding application
* can check for bad data by seeing if num_warnings is nonzero at the
* end of processing.
*/
long num_warnings; /* number of corrupt-data warnings */
 
/* These fields point to the table(s) of error message strings.
* An application can change the table pointer to switch to a different
* message list (typically, to change the language in which errors are
* reported). Some applications may wish to add additional error codes
* that will be handled by the JPEG library error mechanism; the second
* table pointer is used for this purpose.
*
* First table includes all errors generated by JPEG library itself.
* Error code 0 is reserved for a "no such error string" message.
*/
const char * const * jpeg_message_table; /* Library errors */
int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */
/* Second table can be added by application (see cjpeg/djpeg for example).
* It contains strings numbered first_addon_message..last_addon_message.
*/
const char * const * addon_message_table; /* Non-library errors */
int first_addon_message; /* code for first string in addon table */
int last_addon_message; /* code for last string in addon table */
};
 
 
/* Progress monitor object */
 
struct jpeg_progress_mgr {
JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
 
long pass_counter; /* work units completed in this pass */
long pass_limit; /* total number of work units in this pass */
int completed_passes; /* passes completed so far */
int total_passes; /* total number of passes expected */
};
 
 
/* Data destination object for compression */
 
struct jpeg_destination_mgr {
JOCTET * next_output_byte; /* => next byte to write in buffer */
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
 
JMETHOD(void, init_destination, (j_compress_ptr cinfo));
JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
JMETHOD(void, term_destination, (j_compress_ptr cinfo));
};
 
 
/* Data source object for decompression */
 
struct jpeg_source_mgr {
const JOCTET * next_input_byte; /* => next byte to read from buffer */
size_t bytes_in_buffer; /* # of bytes remaining in buffer */
 
JMETHOD(void, init_source, (j_decompress_ptr cinfo));
JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
JMETHOD(void, term_source, (j_decompress_ptr cinfo));
};
 
 
/* Memory manager object.
* Allocates "small" objects (a few K total), "large" objects (tens of K),
* and "really big" objects (virtual arrays with backing store if needed).
* The memory manager does not allow individual objects to be freed; rather,
* each created object is assigned to a pool, and whole pools can be freed
* at once. This is faster and more convenient than remembering exactly what
* to free, especially where malloc()/free() are not too speedy.
* NB: alloc routines never return NULL. They exit to error_exit if not
* successful.
*/
 
#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */
#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */
#define JPOOL_NUMPOOLS 2
 
typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
typedef struct jvirt_barray_control * jvirt_barray_ptr;
 
 
struct jpeg_memory_mgr {
/* Method pointers */
JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
size_t sizeofobject));
JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,
size_t sizeofobject));
JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
JDIMENSION samplesperrow,
JDIMENSION numrows));
JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
JDIMENSION blocksperrow,
JDIMENSION numrows));
JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
int pool_id,
boolean pre_zero,
JDIMENSION samplesperrow,
JDIMENSION numrows,
JDIMENSION maxaccess));
JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
int pool_id,
boolean pre_zero,
JDIMENSION blocksperrow,
JDIMENSION numrows,
JDIMENSION maxaccess));
JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
jvirt_sarray_ptr ptr,
JDIMENSION start_row,
JDIMENSION num_rows,
boolean writable));
JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
jvirt_barray_ptr ptr,
JDIMENSION start_row,
JDIMENSION num_rows,
boolean writable));
JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
JMETHOD(void, self_destruct, (j_common_ptr cinfo));
 
/* Limit on memory allocation for this JPEG object. (Note that this is
* merely advisory, not a guaranteed maximum; it only affects the space
* used for virtual-array buffers.) May be changed by outer application
* after creating the JPEG object.
*/
long max_memory_to_use;
 
/* Maximum allocation request accepted by alloc_large. */
long max_alloc_chunk;
};
 
 
/* Routine signature for application-supplied marker processing methods.
* Need not pass marker code since it is stored in cinfo->unread_marker.
*/
typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
 
 
/* Declarations for routines called by application.
* The JPP macro hides prototype parameters from compilers that can't cope.
* Note JPP requires double parentheses.
*/
 
#ifdef HAVE_PROTOTYPES
#define JPP(arglist) arglist
#else
#define JPP(arglist) ()
#endif
 
 
/* Short forms of external names for systems with brain-damaged linkers.
* We shorten external names to be unique in the first six letters, which
* is good enough for all known systems.
* (If your compiler itself needs names to be unique in less than 15
* characters, you are out of luck. Get a better compiler.)
*/
 
#ifdef NEED_SHORT_EXTERNAL_NAMES
#define jpeg_std_error jStdError
#define jpeg_CreateCompress jCreaCompress
#define jpeg_CreateDecompress jCreaDecompress
#define jpeg_destroy_compress jDestCompress
#define jpeg_destroy_decompress jDestDecompress
#define jpeg_stdio_dest jStdDest
#define jpeg_stdio_src jStdSrc
#define jpeg_set_defaults jSetDefaults
#define jpeg_set_colorspace jSetColorspace
#define jpeg_default_colorspace jDefColorspace
#define jpeg_set_quality jSetQuality
#define jpeg_set_linear_quality jSetLQuality
#define jpeg_add_quant_table jAddQuantTable
#define jpeg_quality_scaling jQualityScaling
#define jpeg_simple_progression jSimProgress
#define jpeg_suppress_tables jSuppressTables
#define jpeg_alloc_quant_table jAlcQTable
#define jpeg_alloc_huff_table jAlcHTable
#define jpeg_start_compress jStrtCompress
#define jpeg_write_scanlines jWrtScanlines
#define jpeg_finish_compress jFinCompress
#define jpeg_write_raw_data jWrtRawData
#define jpeg_write_marker jWrtMarker
#define jpeg_write_m_header jWrtMHeader
#define jpeg_write_m_byte jWrtMByte
#define jpeg_write_tables jWrtTables
#define jpeg_read_header jReadHeader
#define jpeg_start_decompress jStrtDecompress
#define jpeg_read_scanlines jReadScanlines
#define jpeg_finish_decompress jFinDecompress
#define jpeg_read_raw_data jReadRawData
#define jpeg_has_multiple_scans jHasMultScn
#define jpeg_start_output jStrtOutput
#define jpeg_finish_output jFinOutput
#define jpeg_input_complete jInComplete
#define jpeg_new_colormap jNewCMap
#define jpeg_consume_input jConsumeInput
#define jpeg_calc_output_dimensions jCalcDimensions
#define jpeg_save_markers jSaveMarkers
#define jpeg_set_marker_processor jSetMarker
#define jpeg_read_coefficients jReadCoefs
#define jpeg_write_coefficients jWrtCoefs
#define jpeg_copy_critical_parameters jCopyCrit
#define jpeg_abort_compress jAbrtCompress
#define jpeg_abort_decompress jAbrtDecompress
#define jpeg_abort jAbort
#define jpeg_destroy jDestroy
#define jpeg_resync_to_restart jResyncRestart
#endif /* NEED_SHORT_EXTERNAL_NAMES */
 
 
/* Default error-management setup */
EXTERN(struct jpeg_error_mgr *) jpeg_std_error
JPP((struct jpeg_error_mgr * err));
 
/* Initialization of JPEG compression objects.
* jpeg_create_compress() and jpeg_create_decompress() are the exported
* names that applications should call. These expand to calls on
* jpeg_CreateCompress and jpeg_CreateDecompress with additional information
* passed for version mismatch checking.
* NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
*/
#define jpeg_create_compress(cinfo) \
jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
(size_t) sizeof(struct jpeg_compress_struct))
#define jpeg_create_decompress(cinfo) \
jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
(size_t) sizeof(struct jpeg_decompress_struct))
EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
int version, size_t structsize));
EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
int version, size_t structsize));
/* Destruction of JPEG compression objects */
EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
 
/* Standard data source and destination managers: stdio streams. */
/* Caller is responsible for opening the file before and closing after. */
EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));
EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));
 
/* Default parameter setup for compression */
EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
/* Compression parameter setup aids */
EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
J_COLOR_SPACE colorspace));
EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
boolean force_baseline));
EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
int scale_factor,
boolean force_baseline));
EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
const unsigned int *basic_table,
int scale_factor,
boolean force_baseline));
EXTERN(int) jpeg_quality_scaling JPP((int quality));
EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
boolean suppress));
EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
 
/* Main entry points for compression */
EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
boolean write_all_tables));
EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
JSAMPARRAY scanlines,
JDIMENSION num_lines));
EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
 
/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
JSAMPIMAGE data,
JDIMENSION num_lines));
 
/* Write a special marker. See libjpeg.doc concerning safe usage. */
EXTERN(void) jpeg_write_marker
JPP((j_compress_ptr cinfo, int marker,
const JOCTET * dataptr, unsigned int datalen));
/* Same, but piecemeal. */
EXTERN(void) jpeg_write_m_header
JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
EXTERN(void) jpeg_write_m_byte
JPP((j_compress_ptr cinfo, int val));
 
/* Alternate compression function: just write an abbreviated table file */
EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
 
/* Decompression startup: read start of JPEG datastream to see what's there */
EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
boolean require_image));
/* Return value is one of: */
#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
#define JPEG_HEADER_OK 1 /* Found valid image datastream */
#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */
/* If you pass require_image = TRUE (normal case), you need not check for
* a TABLES_ONLY return code; an abbreviated file will cause an error exit.
* JPEG_SUSPENDED is only possible if you use a data source module that can
* give a suspension return (the stdio source module doesn't).
*/
 
/* Main entry points for decompression */
EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
JSAMPARRAY scanlines,
JDIMENSION max_lines));
EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
 
/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
JSAMPIMAGE data,
JDIMENSION max_lines));
 
/* Additional entry points for buffered-image mode. */
EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
int scan_number));
EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
/* Return value is one of: */
/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */
#define JPEG_REACHED_SOS 1 /* Reached start of new scan */
#define JPEG_REACHED_EOI 2 /* Reached end of image */
#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */
#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */
 
/* Precalculate output dimensions for current decompression parameters. */
EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
 
/* Control saving of COM and APPn markers into marker_list. */
EXTERN(void) jpeg_save_markers
JPP((j_decompress_ptr cinfo, int marker_code,
unsigned int length_limit));
 
/* Install a special processing method for COM or APPn markers. */
EXTERN(void) jpeg_set_marker_processor
JPP((j_decompress_ptr cinfo, int marker_code,
jpeg_marker_parser_method routine));
 
/* Read or write raw DCT coefficients --- useful for lossless transcoding. */
EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
jvirt_barray_ptr * coef_arrays));
EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
j_compress_ptr dstinfo));
 
/* If you choose to abort compression or decompression before completing
* jpeg_finish_(de)compress, then you need to clean up to release memory,
* temporary files, etc. You can just call jpeg_destroy_(de)compress
* if you're done with the JPEG object, but if you want to clean it up and
* reuse it, call this:
*/
EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
 
/* Generic versions of jpeg_abort and jpeg_destroy that work on either
* flavor of JPEG object. These may be more convenient in some places.
*/
EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
 
/* Default restart-marker-resync procedure for use by data source modules */
EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
int desired));
 
 
/* These marker codes are exported since applications and data source modules
* are likely to want to use them.
*/
 
#define JPEG_RST0 0xD0 /* RST0 marker code */
#define JPEG_EOI 0xD9 /* EOI marker code */
#define JPEG_APP0 0xE0 /* APP0 marker code */
#define JPEG_COM 0xFE /* COM marker code */
 
 
/* If we have a brain-damaged compiler that emits warnings (or worse, errors)
* for structure definitions that are never filled in, keep it quiet by
* supplying dummy definitions for the various substructures.
*/
 
#ifdef INCOMPLETE_TYPES_BROKEN
#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */
struct jvirt_sarray_control { long dummy; };
struct jvirt_barray_control { long dummy; };
struct jpeg_comp_master { long dummy; };
struct jpeg_c_main_controller { long dummy; };
struct jpeg_c_prep_controller { long dummy; };
struct jpeg_c_coef_controller { long dummy; };
struct jpeg_marker_writer { long dummy; };
struct jpeg_color_converter { long dummy; };
struct jpeg_downsampler { long dummy; };
struct jpeg_forward_dct { long dummy; };
struct jpeg_entropy_encoder { long dummy; };
struct jpeg_decomp_master { long dummy; };
struct jpeg_d_main_controller { long dummy; };
struct jpeg_d_coef_controller { long dummy; };
struct jpeg_d_post_controller { long dummy; };
struct jpeg_input_controller { long dummy; };
struct jpeg_marker_reader { long dummy; };
struct jpeg_entropy_decoder { long dummy; };
struct jpeg_inverse_dct { long dummy; };
struct jpeg_upsampler { long dummy; };
struct jpeg_color_deconverter { long dummy; };
struct jpeg_color_quantizer { long dummy; };
#endif /* JPEG_INTERNALS */
#endif /* INCOMPLETE_TYPES_BROKEN */
 
 
/*
* The JPEG library modules define JPEG_INTERNALS before including this file.
* The internal structure declarations are read only when that is true.
* Applications using the library should not include jpegint.h, but may wish
* to include jerror.h.
*/
 
#ifdef JPEG_INTERNALS
#include "jpegint.h" /* fetch private declarations */
#include "jerror.h" /* fetch error codes too */
#endif
 
#endif /* JPEGLIB_H */
/contrib/media/updf/include/jpt.h
0,0 → 1,75
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __JPT_H
#define __JPT_H
/**
@file jpt.h
@brief JPT-stream reader (JPEG 2000, JPIP)
 
JPT-stream functions are implemented in J2K.C.
*/
 
/**
Message Header JPT stream structure
*/
typedef struct opj_jpt_msg_header {
/** In-class Identifier */
unsigned int Id;
/** Last byte information */
unsigned int last_byte;
/** Class Identifier */
unsigned int Class_Id;
/** CSn : index identifier */
unsigned int CSn_Id;
/** Message offset */
unsigned int Msg_offset;
/** Message length */
unsigned int Msg_length;
/** Auxiliary for JPP case */
unsigned int Layer_nb;
} opj_jpt_msg_header_t;
 
/* ----------------------------------------------------------------------- */
 
/**
Initialize the value of the message header structure
@param header Message header structure
*/
void jpt_init_msg_header(opj_jpt_msg_header_t * header);
 
/**
Read the message header for a JPP/JPT - stream
@param cinfo Codec context info
@param cio CIO handle
@param header Message header structure
*/
void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio, opj_jpt_msg_header_t *header);
 
#endif
/contrib/media/updf/include/keys.h
0,0 → 1,265
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_keys_h_
#define __dj_include_keys_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* Values as returned from getkey() and getxkey() */
 
#define K_Control_A 0x001
#define K_Control_B 0x002
#define K_Control_C 0x003
#define K_Control_D 0x004
#define K_Control_E 0x005
#define K_Control_F 0x006
#define K_Control_G 0x007
#define K_BackSpace 0x008
#define K_Control_H 0x008
#define K_Tab 0x009
#define K_Control_I 0x009
#define K_LineFeed 0x00a
#define K_Control_J 0x00a
#define K_Control_K 0x00b
#define K_Control_L 0x00c
#define K_Return 0x00d
#define K_Control_M 0x00d
#define K_Control_N 0x00e
#define K_Control_O 0x00f
#define K_Control_P 0x010
#define K_Control_Q 0x011
#define K_Control_R 0x012
#define K_Control_S 0x013
#define K_Control_T 0x014
#define K_Control_U 0x015
#define K_Control_V 0x016
#define K_Control_W 0x017
#define K_Control_X 0x018
#define K_Control_Y 0x019
#define K_Control_Z 0x01a
#define K_Control_LBracket 0x01b
#define K_Escape 0x01b
#define K_Control_BackSlash 0x01c
#define K_Control_RBracket 0x01d
#define K_Control_Caret 0x01e
#define K_Control_Underscore 0x01f
#define K_Space 0x020
#define K_ExclamationPoint 0x021
#define K_DoubleQuote 0x022
#define K_Hash 0x023
#define K_Dollar 0x024
#define K_Percent 0x025
#define K_Ampersand 0x026
#define K_Quote 0x027
#define K_LParen 0x028
#define K_RParen 0x029
#define K_Star 0x02a
#define K_Plus 0x02b
#define K_Comma 0x02c
#define K_Dash 0x02d
#define K_Period 0x02e
#define K_Slash 0x02f
#define K_Colon 0x03a
#define K_SemiColon 0x03b
#define K_LAngle 0x03c
#define K_Equals 0x03d
#define K_RAngle 0x03e
#define K_QuestionMark 0x03f
#define K_At 0x040
#define K_LBracket 0x05b
#define K_BackSlash 0x05c
#define K_RBracket 0x05d
#define K_Caret 0x05e
#define K_UnderScore 0x05f
#define K_BackQuote 0x060
#define K_LBrace 0x07b
#define K_Pipe 0x07c
#define K_RBrace 0x07d
#define K_Tilde 0x07e
#define K_Control_Backspace 0x07f
 
#define K_Alt_Escape 0x101
#define K_Control_At 0x103
#define K_Alt_Backspace 0x10e
#define K_BackTab 0x10f
#define K_Alt_Q 0x110
#define K_Alt_W 0x111
#define K_Alt_E 0x112
#define K_Alt_R 0x113
#define K_Alt_T 0x114
#define K_Alt_Y 0x115
#define K_Alt_U 0x116
#define K_Alt_I 0x117
#define K_Alt_O 0x118
#define K_Alt_P 0x119
#define K_Alt_LBracket 0x11a
#define K_Alt_RBracket 0x11b
#define K_Alt_Return 0x11c
#define K_Alt_A 0x11e
#define K_Alt_S 0x11f
#define K_Alt_D 0x120
#define K_Alt_F 0x121
#define K_Alt_G 0x122
#define K_Alt_H 0x123
#define K_Alt_J 0x124
#define K_Alt_K 0x125
#define K_Alt_L 0x126
#define K_Alt_Semicolon 0x127
#define K_Alt_Quote 0x128
#define K_Alt_Backquote 0x129
#define K_Alt_Backslash 0x12b
#define K_Alt_Z 0x12c
#define K_Alt_X 0x12d
#define K_Alt_C 0x12e
#define K_Alt_V 0x12f
#define K_Alt_B 0x130
#define K_Alt_N 0x131
#define K_Alt_M 0x132
#define K_Alt_Comma 0x133
#define K_Alt_Period 0x134
#define K_Alt_Slash 0x135
#define K_Alt_KPStar 0x137
#define K_F1 0x13b
#define K_F2 0x13c
#define K_F3 0x13d
#define K_F4 0x13e
#define K_F5 0x13f
#define K_F6 0x140
#define K_F7 0x141
#define K_F8 0x142
#define K_F9 0x143
#define K_F10 0x144
#define K_Home 0x147
#define K_Up 0x148
#define K_PageUp 0x149
#define K_Alt_KPMinus 0x14a
#define K_Left 0x14b
#define K_Center 0x14c
#define K_Right 0x14d
#define K_Alt_KPPlus 0x14e
#define K_End 0x14f
#define K_Down 0x150
#define K_PageDown 0x151
#define K_Insert 0x152
#define K_Delete 0x153
#define K_Shift_F1 0x154
#define K_Shift_F2 0x155
#define K_Shift_F3 0x156
#define K_Shift_F4 0x157
#define K_Shift_F5 0x158
#define K_Shift_F6 0x159
#define K_Shift_F7 0x15a
#define K_Shift_F8 0x15b
#define K_Shift_F9 0x15c
#define K_Shift_F10 0x15d
#define K_Control_F1 0x15e
#define K_Control_F2 0x15f
#define K_Control_F3 0x160
#define K_Control_F4 0x161
#define K_Control_F5 0x162
#define K_Control_F6 0x163
#define K_Control_F7 0x164
#define K_Control_F8 0x165
#define K_Control_F9 0x166
#define K_Control_F10 0x167
#define K_Alt_F1 0x168
#define K_Alt_F2 0x169
#define K_Alt_F3 0x16a
#define K_Alt_F4 0x16b
#define K_Alt_F5 0x16c
#define K_Alt_F6 0x16d
#define K_Alt_F7 0x16e
#define K_Alt_F8 0x16f
#define K_Alt_F9 0x170
#define K_Alt_F10 0x171
#define K_Control_Print 0x172
#define K_Control_Left 0x173
#define K_Control_Right 0x174
#define K_Control_End 0x175
#define K_Control_PageDown 0x176
#define K_Control_Home 0x177
#define K_Alt_1 0x178
#define K_Alt_2 0x179
#define K_Alt_3 0x17a
#define K_Alt_4 0x17b
#define K_Alt_5 0x17c
#define K_Alt_6 0x17d
#define K_Alt_7 0x17e
#define K_Alt_8 0x17f
#define K_Alt_9 0x180
#define K_Alt_0 0x181
#define K_Alt_Dash 0x182
#define K_Alt_Equals 0x183
#define K_Control_PageUp 0x184
#define K_F11 0x185
#define K_F12 0x186
#define K_Shift_F11 0x187
#define K_Shift_F12 0x188
#define K_Control_F11 0x189
#define K_Control_F12 0x18a
#define K_Alt_F11 0x18b
#define K_Alt_F12 0x18c
#define K_Control_Up 0x18d
#define K_Control_KPDash 0x18e
#define K_Control_Center 0x18f
#define K_Control_KPPlus 0x190
#define K_Control_Down 0x191
#define K_Control_Insert 0x192
#define K_Control_Delete 0x193
#define K_Control_KPSlash 0x195
#define K_Control_KPStar 0x196
#define K_Alt_EHome 0x197
#define K_Alt_EUp 0x198
#define K_Alt_EPageUp 0x199
#define K_Alt_ELeft 0x19b
#define K_Alt_ERight 0x19d
#define K_Alt_EEnd 0x19f
#define K_Alt_EDown 0x1a0
#define K_Alt_EPageDown 0x1a1
#define K_Alt_EInsert 0x1a2
#define K_Alt_EDelete 0x1a3
#define K_Alt_KPSlash 0x1a4
#define K_Alt_Tab 0x1a5
#define K_Alt_Enter 0x1a6
 
#define K_EHome 0x247
#define K_EUp 0x248
#define K_EPageUp 0x249
#define K_ELeft 0x24b
#define K_ERight 0x24d
#define K_EEnd 0x24f
#define K_EDown 0x250
#define K_EPageDown 0x251
#define K_EInsert 0x252
#define K_EDelete 0x253
#define K_Control_ELeft 0x273
#define K_Control_ERight 0x274
#define K_Control_EEnd 0x275
#define K_Control_EPageDown 0x276
#define K_Control_EHome 0x277
#define K_Control_EPageUp 0x284
#define K_Control_EUp 0x28d
#define K_Control_EDown 0x291
#define K_Control_EInsert 0x292
#define K_Control_EDelete 0x293
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_keys_h_ */
/contrib/media/updf/include/kolibri.h
0,0 → 1,92
 
#define NULL ((void*)0)
#define __attribute__(something) /* nothing */
#pragma pack(1)
 
typedef struct
{
unsigned p00 __attribute__((packed));
unsigned p04 __attribute__((packed));
unsigned p08 __attribute__((packed));
unsigned p12 __attribute__((packed));
unsigned p16 __attribute__((packed));
char p20 __attribute__((packed));
char *p21 __attribute__((packed));
} kol_struct70 __attribute__((packed));
 
 
typedef struct
{
unsigned p00 __attribute__((packed));
char p04 __attribute__((packed));
char p05[3] __attribute__((packed));
unsigned p08 __attribute__((packed));
unsigned p12 __attribute__((packed));
unsigned p16 __attribute__((packed));
unsigned p20 __attribute__((packed));
unsigned p24 __attribute__((packed));
unsigned p28 __attribute__((packed));
unsigned p32[2] __attribute__((packed));
unsigned p40 __attribute__((packed));
} kol_struct_BDVK __attribute__((packed));
 
typedef struct
{
char *name __attribute__((packed));
void *data __attribute__((packed));
} kol_struct_import __attribute__((packed));
 
 
__declspec(noreturn) void __cdecl kol_exit();
void __cdecl kol_sleep(unsigned d);
void __cdecl kol_wnd_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c);
void __cdecl kol_wnd_move(unsigned x, unsigned y);
void __cdecl kol_wnd_caption(char *s);
void __cdecl kol_event_mask(unsigned e);
unsigned __cdecl kol_event_wait();
unsigned __cdecl kol_event_wait_time(unsigned time);
unsigned __cdecl kol_event_check();
void __cdecl kol_paint_start();
void __cdecl kol_paint_end();
void __cdecl kol_paint_pixel(unsigned x, unsigned y, unsigned c);
void __cdecl kol_paint_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c);
void __cdecl kol_paint_line(unsigned x1, unsigned y1, unsigned x2, unsigned y2, unsigned c);
void __cdecl kol_paint_string(unsigned x, unsigned y, char *s, unsigned c);
void __cdecl kol_paint_image(unsigned x, unsigned y, unsigned w, unsigned h, char *d);
void __cdecl kol_paint_image_pal(unsigned x, unsigned y, unsigned w, unsigned h, char *d, unsigned *palette);
unsigned __cdecl kol_key_get();
unsigned __cdecl kol_key_control();
void __cdecl kol_key_lang_set(unsigned lang);
unsigned __cdecl kol_key_lang_get();
void __cdecl kol_key_mode_set(unsigned mode);
unsigned __cdecl kol_key_mode_get();
void __cdecl kol_btn_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned d, unsigned c);
unsigned __cdecl kol_btn_get();
void __cdecl kol_btn_type(unsigned t);
unsigned __cdecl kol_mouse_pos();
unsigned __cdecl kol_mouse_posw();
unsigned __cdecl kol_mouse_btn();
void __cdecl kol_board_putc(char c);
void __cdecl kol_board_puts(char *s);
void __cdecl kol_board_puti(int n);
int __declspec(noinline) __cdecl kol_file_70(kol_struct70 *k);
kol_struct_import* __fastcall kol_cofflib_load(char *name);
void* __cdecl kol_cofflib_procload (kol_struct_import *imp, char *name);
unsigned __cdecl kol_cofflib_procnum (kol_struct_import *imp);
void __cdecl kol_cofflib_procname (kol_struct_import *imp, char *name, unsigned n);
unsigned __fastcall kol_system_end(unsigned param);
unsigned __cdecl kol_system_cpufreq();
unsigned __fastcall kol_system_mem();
unsigned __fastcall kol_system_memfree();
unsigned __fastcall kol_system_time_get();
unsigned __fastcall kol_system_date_get();
void __cdecl kol_path_file2dir(char *dir, char *fname);
void __cdecl kol_path_full(char *full, char *fname);
void __cdecl kol_screen_wait_rr();
void __cdecl kol_screen_get_size(unsigned *w, unsigned *h);
unsigned __cdecl kol_skin_height();
unsigned __cdecl kol_thread_start(unsigned start, unsigned stack);
unsigned __cdecl kol_time_tick();
unsigned __cdecl kol_sound_speaker(char data[]);
unsigned __fastcall kol_process_info(unsigned slot, char buf1k[]);
int __fastcall kol_process_kill_pid(unsigned process);
/contrib/media/updf/include/lapi.h
0,0 → 1,24
/*
** $Id: lapi.h,v 2.7 2009/11/27 15:37:59 roberto Exp $
** Auxiliary functions from Lua API
** See Copyright Notice in lua.h
*/
 
#ifndef lapi_h
#define lapi_h
 
 
#include "llimits.h"
#include "lstate.h"
 
#define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \
"stack overflow");}
 
#define adjustresults(L,nres) \
{ if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; }
 
#define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \
"not enough elements in the stack")
 
 
#endif
/contrib/media/updf/include/lauxlib.h
0,0 → 1,175
/*
** $Id: lauxlib.h,v 1.113 2010/11/16 19:20:01 roberto Exp $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
 
 
#ifndef lauxlib_h
#define lauxlib_h
 
 
#include <stddef.h>
#include <stdio.h>
 
#include "lua.h"
 
 
 
/* extra error code for `luaL_load' */
#define LUA_ERRFILE (LUA_ERRERR+1)
 
 
typedef struct luaL_Reg {
const char *name;
lua_CFunction func;
} luaL_Reg;
 
 
LUALIB_API void (luaL_checkversion_) (lua_State *L, lua_Number ver);
#define luaL_checkversion(L) luaL_checkversion_(L, LUA_VERSION_NUM)
 
LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);
LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);
LUALIB_API const char *(luaL_tolstring) (lua_State *L, int idx, size_t *len);
LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg);
LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg,
size_t *l);
LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg,
const char *def, size_t *l);
LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg);
LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def);
 
LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg);
LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg,
lua_Integer def);
LUALIB_API lua_Unsigned (luaL_checkunsigned) (lua_State *L, int numArg);
LUALIB_API lua_Unsigned (luaL_optunsigned) (lua_State *L, int numArg,
lua_Unsigned def);
 
LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);
LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t);
LUALIB_API void (luaL_checkany) (lua_State *L, int narg);
 
LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname);
LUALIB_API void (luaL_setmetatable) (lua_State *L, const char *tname);
LUALIB_API void *(luaL_testudata) (lua_State *L, int ud, const char *tname);
LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
 
LUALIB_API void (luaL_where) (lua_State *L, int lvl);
LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
 
LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,
const char *const lst[]);
 
/* pre-defined references */
#define LUA_NOREF (-2)
#define LUA_REFNIL (-1)
 
LUALIB_API int (luaL_ref) (lua_State *L, int t);
LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
 
LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename);
LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz,
const char *name);
LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);
 
LUALIB_API lua_State *(luaL_newstate) (void);
 
LUALIB_API int (luaL_len) (lua_State *L, int idx);
 
LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
const char *r);
 
LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
 
LUALIB_API void (luaL_findtable) (lua_State *L, int idx, const char *fname);
 
LUALIB_API void (luaL_traceback) (lua_State *L, lua_State *L1,
const char *msg, int level);
 
LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname,
lua_CFunction openf, int glb);
 
/*
** ===============================================================
** some useful macros
** ===============================================================
*/
 
 
#define luaL_newlibtable(L,l) \
lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1)
 
#define luaL_newlib(L,l) (luaL_newlibtable(L,l), luaL_setfuncs(L,l,0))
 
#define luaL_argcheck(L, cond,numarg,extramsg) \
((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))
#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n)))
#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d)))
 
#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i)))
 
#define luaL_dofile(L, fn) \
(luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))
 
#define luaL_dostring(L, s) \
(luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))
 
#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
 
#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
 
 
/*
** {======================================================
** Generic Buffer manipulation
** =======================================================
*/
 
typedef struct luaL_Buffer {
char *b; /* buffer address */
size_t size; /* buffer size */
size_t n; /* number of characters in buffer */
lua_State *L;
char initb[LUAL_BUFFERSIZE]; /* initial buffer */
} luaL_Buffer;
 
 
#define luaL_addchar(B,c) \
((void)((B)->n < (B)->size || luaL_prepbuffsize((B), 1)), \
((B)->b[(B)->n++] = (c)))
 
#define luaL_addsize(B,s) ((B)->n += (s))
 
LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);
LUALIB_API char *(luaL_prepbuffsize) (luaL_Buffer *B, size_t sz);
LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);
LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);
LUALIB_API void (luaL_addvalue) (luaL_Buffer *B);
LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
LUALIB_API void (luaL_pushresultsize) (luaL_Buffer *B, size_t sz);
LUALIB_API char *(luaL_buffinitsize) (lua_State *L, luaL_Buffer *B, size_t sz);
 
#define luaL_prepbuffer(B) luaL_prepbuffsize(B, LUAL_BUFFERSIZE)
 
/* }====================================================== */
 
 
/* compatibility with old module system */
 
LUALIB_API void (luaL_pushmodule) (lua_State *L, const char *modname,
int sizehint);
LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname,
const luaL_Reg *l, int nup);
 
#define luaL_register(L,n,l) (luaL_openlib(L,(n),(l),0))
 
 
#endif
 
 
/contrib/media/updf/include/lcode.h
0,0 → 1,83
/*
** $Id: lcode.h,v 1.55 2010/07/02 20:42:40 roberto Exp $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
 
#ifndef lcode_h
#define lcode_h
 
#include "llex.h"
#include "lobject.h"
#include "lopcodes.h"
#include "lparser.h"
 
 
/*
** Marks the end of a patch list. It is an invalid value both as an absolute
** address, and as a list link (would link an element to itself).
*/
#define NO_JUMP (-1)
 
 
/*
** grep "ORDER OPR" if you change these enums (ORDER OP)
*/
typedef enum BinOpr {
OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW,
OPR_CONCAT,
OPR_EQ, OPR_LT, OPR_LE,
OPR_NE, OPR_GT, OPR_GE,
OPR_AND, OPR_OR,
OPR_NOBINOPR
} BinOpr;
 
 
typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr;
 
 
#define getcode(fs,e) ((fs)->f->code[(e)->u.info])
 
#define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx)
 
#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET)
 
#define luaK_jumpto(fs,t) luaK_patchlist(fs, luaK_jump(fs), t)
 
#define luaK_codek(fs,reg,k) luaK_codeABxX(fs, OP_LOADK, reg, k)
 
LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);
LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);
LUAI_FUNC int luaK_codeABxX (FuncState *fs, OpCode o, int reg, int k);
LUAI_FUNC void luaK_fixline (FuncState *fs, int line);
LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n);
LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n);
LUAI_FUNC void luaK_checkstack (FuncState *fs, int n);
LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s);
LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r);
LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e);
LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_exp2anyregup (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e);
LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key);
LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);
LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e);
LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults);
LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e);
LUAI_FUNC int luaK_jump (FuncState *fs);
LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret);
LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target);
LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list);
LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2);
LUAI_FUNC int luaK_getlabel (FuncState *fs);
LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v, int line);
LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v);
LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1,
expdesc *v2, int line);
LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore);
 
 
#endif
/contrib/media/updf/include/lctype.h
0,0 → 1,50
/*
** $Id: lctype.h,v 1.8 2009/11/19 19:06:52 roberto Exp $
** 'ctype' functions for Lua
** See Copyright Notice in lua.h
*/
 
#ifndef lctype_h
#define lctype_h
 
 
#include <limits.h>
 
#include "lua.h"
 
#include "llimits.h"
 
 
#define ALPHABIT 0
#define DIGITBIT 1
#define PRINTBIT 2
#define SPACEBIT 3
#define XDIGITBIT 4
#define UPPERBIT 5
 
 
#define MASK(B) (1 << (B))
 
 
/*
** add 1 to char to allow index -1 (EOZ)
*/
#define testprop(c,p) (luai_ctype_[(c)+1] & (p))
 
/*
** 'lalpha' (Lua alphabetic) and 'lalnum' (Lua alphanumeric) both include '_'
*/
#define lislalpha(c) testprop(c, MASK(ALPHABIT))
#define lislalnum(c) testprop(c, (MASK(ALPHABIT) | MASK(DIGITBIT)))
#define lisupper(c) testprop(c, MASK(UPPERBIT))
#define lisdigit(c) testprop(c, MASK(DIGITBIT))
#define lisspace(c) testprop(c, MASK(SPACEBIT))
#define lisprint(c) testprop(c, MASK(PRINTBIT))
#define lisxdigit(c) testprop(c, MASK(XDIGITBIT))
 
 
/* one more entry for 0 and one more for -1 (EOZ) */
LUAI_DDEC const lu_byte luai_ctype_[UCHAR_MAX + 2];
 
#endif
 
/contrib/media/updf/include/ldebug.h
0,0 → 1,31
/*
** $Id: ldebug.h,v 2.5 2009/06/10 16:57:53 roberto Exp $
** Auxiliary functions from Debug Interface module
** See Copyright Notice in lua.h
*/
 
#ifndef ldebug_h
#define ldebug_h
 
 
#include "lstate.h"
 
 
#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
 
#define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
 
#define resethookcount(L) (L->hookcount = L->basehookcount)
 
 
LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,
const char *opname);
LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2);
LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1,
const TValue *p2);
LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1,
const TValue *p2);
LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...);
LUAI_FUNC void luaG_errormsg (lua_State *L);
 
#endif
/contrib/media/updf/include/ldo.h
0,0 → 1,45
/*
** $Id: ldo.h,v 2.18 2009/12/17 12:28:57 roberto Exp $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
 
#ifndef ldo_h
#define ldo_h
 
 
#include "lobject.h"
#include "lstate.h"
#include "lzio.h"
 
 
#define luaD_checkstack(L,n) if (L->stack_last - L->top <= (n)) \
luaD_growstack(L, n); else condmovestack(L);
 
 
#define incr_top(L) {L->top++; luaD_checkstack(L,0);}
 
#define savestack(L,p) ((char *)(p) - (char *)L->stack)
#define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
 
 
/* type of protected functions, to be ran by `runprotected' */
typedef void (*Pfunc) (lua_State *L, void *ud);
 
LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);
LUAI_FUNC void luaD_hook (lua_State *L, int event, int line);
LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults,
int allowyield);
LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
ptrdiff_t oldtop, ptrdiff_t ef);
LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
LUAI_FUNC void luaD_growstack (lua_State *L, int n);
LUAI_FUNC void luaD_shrinkstack (lua_State *L);
 
LUAI_FUNC void luaD_throw (lua_State *L, int errcode);
LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
 
#endif
 
/contrib/media/updf/include/lfunc.h
0,0 → 1,34
/*
** $Id: lfunc.h,v 2.6 2010/06/04 13:06:15 roberto Exp $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
 
#ifndef lfunc_h
#define lfunc_h
 
 
#include "lobject.h"
 
 
#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \
cast(int, sizeof(TValue)*((n)-1)))
 
#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \
cast(int, sizeof(TValue *)*((n)-1)))
 
 
LUAI_FUNC Proto *luaF_newproto (lua_State *L);
LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems);
LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, Proto *p);
LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
LUAI_FUNC void luaF_close (lua_State *L, StkId level);
LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c);
LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
int pc);
 
 
#endif
/contrib/media/updf/include/lgc.h
0,0 → 1,144
/*
** $Id: lgc.h,v 2.44 2010/06/30 14:11:17 roberto Exp $
** Garbage Collector
** See Copyright Notice in lua.h
*/
 
#ifndef lgc_h
#define lgc_h
 
 
#include "lobject.h"
#include "lstate.h"
 
/*
** Collectable objects may have one of three colors: white, which
** means the object is not marked; gray, which means the
** object is marked, but its references may be not marked; and
** black, which means that the object and all its references are marked.
** The main invariant of the garbage collector, while marking objects,
** is that a black object can never point to a white one. Moreover,
** any gray object must be in a "gray list" (gray, grayagain, weak,
** allweak, ephemeron) so that it can be visited again before finishing
** the collection cycle. These lists have no meaning when the invariant
** is not being enforced (e.g., sweep phase).
*/
 
 
/*
** Possible states of the Garbage Collector
*/
#define GCSpropagate 0
#define GCSatomic 1
#define GCSsweepstring 2
#define GCSsweepudata 3
#define GCSsweep 4
#define GCSpause 5
 
 
#define issweepphase(g) \
(GCSsweepstring <= (g)->gcstate && (g)->gcstate <= GCSsweep)
 
#define isgenerational(g) ((g)->gckind == KGC_GEN)
 
/*
** macro to tell when main invariant (white objects cannot point to black
** ones) must be kept. During a non-generational collection, the sweep
** phase may break the invariant, as objects turned white may point to
** still-black objects. The invariant is restored when sweep ends and
** all objects are white again. During a generational collection, the
** invariant must be kept all times.
*/
#define keepinvariant(g) (isgenerational(g) || g->gcstate <= GCSatomic)
 
 
#define gcstopped(g) ((g)->GCdebt == MIN_LMEM)
#define stopgc(g) ((g)->GCdebt = MIN_LMEM)
 
 
/*
** some useful bit tricks
*/
#define resetbits(x,m) ((x) &= cast(lu_byte, ~(m)))
#define setbits(x,m) ((x) |= (m))
#define testbits(x,m) ((x) & (m))
#define bitmask(b) (1<<(b))
#define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2))
#define l_setbit(x,b) setbits(x, bitmask(b))
#define resetbit(x,b) resetbits(x, bitmask(b))
#define testbit(x,b) testbits(x, bitmask(b))
#define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2)))
#define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2)))
 
 
 
/* Layout for bit use in `marked' field: */
#define WHITE0BIT 0 /* object is white (type 0) */
#define WHITE1BIT 1 /* object is white (type 1) */
#define BLACKBIT 2 /* object is black */
#define FINALIZEDBIT 3 /* for userdata: has been finalized */
#define SEPARATED 4 /* " ": it's in 'udgc' list or in 'tobefnz' */
#define FIXEDBIT 5 /* object is fixed (should not be collected) */
#define OLDBIT 6 /* object is old (only in generational mode) */
/* bit 7 is currently used by tests (luaL_checkmemory) */
 
#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)
 
 
#define iswhite(x) testbits((x)->gch.marked, WHITEBITS)
#define isblack(x) testbit((x)->gch.marked, BLACKBIT)
#define isgray(x) /* neither white nor black */ \
(!testbits((x)->gch.marked, WHITEBITS | bitmask(BLACKBIT)))
 
#define isold(x) testbit((x)->gch.marked, OLDBIT)
 
/* MOVE OLD rule: whenever an object is moved to the beginning of
a GC list, its old bit must be cleared */
#define resetoldbit(o) resetbit((o)->gch.marked, OLDBIT)
 
#define otherwhite(g) (g->currentwhite ^ WHITEBITS)
#define isdeadm(ow,m) (!(((m) ^ WHITEBITS) & (ow)))
#define isdead(g,v) isdeadm(otherwhite(g), (v)->gch.marked)
 
#define changewhite(x) ((x)->gch.marked ^= WHITEBITS)
#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT)
 
#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x)))
 
#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS)
 
 
#define luaC_checkGC(L) {condchangemem(L); if (G(L)->GCdebt > 0) luaC_step(L);}
 
 
#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \
luaC_barrier_(L,obj2gco(p),gcvalue(v)); }
 
#define luaC_barrierback(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \
luaC_barrierback_(L,p); }
 
#define luaC_objbarrier(L,p,o) \
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
luaC_barrier_(L,obj2gco(p),obj2gco(o)); }
 
#define luaC_objbarrierback(L,p,o) \
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) luaC_barrierback_(L,p); }
 
#define luaC_barrierproto(L,p,c) \
{ if (isblack(obj2gco(p))) luaC_barrierproto_(L,p,c); }
 
LUAI_FUNC void luaC_separateudata (lua_State *L, int all);
LUAI_FUNC void luaC_freeallobjects (lua_State *L);
LUAI_FUNC void luaC_step (lua_State *L);
LUAI_FUNC void luaC_runtilstate (lua_State *L, int statesmask);
LUAI_FUNC void luaC_fullgc (lua_State *L, int isemergency);
LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz,
GCObject **list, int offset);
LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v);
LUAI_FUNC void luaC_barrierback_ (lua_State *L, GCObject *o);
LUAI_FUNC void luaC_barrierproto_ (lua_State *L, Proto *p, Closure *c);
LUAI_FUNC void luaC_checkfinalizer (lua_State *L, Udata *u);
LUAI_FUNC void luaC_checkupvalcolor (global_State *g, UpVal *uv);
LUAI_FUNC void luaC_changemode (lua_State *L, int mode);
 
#endif
/contrib/media/updf/include/libc/Makefile
0,0 → 1,12
all:
make -C linuxtools
make -C linuxtools install
make -C src
make -C stub
make -C programs
 
clean:
make -C src clean
make -C linuxtools clean
make -C stub clean
make -C programs clean
/contrib/media/updf/include/libc/asm.h
0,0 → 1,18
#ifndef __LIBC_ASM_H
#define __LIBC_ASM_H
 
#include __DEV_CONFIG_H
 
#ifndef NEEDS_UNDERSCORES
 
#define C_SYM(x) x
#else
 
#define C_SYM(x) _##x
 
#endif
 
#define MK_C_SYM(x) C_SYM(x) : ; \
.globl C_SYM(x)
 
#endif
/contrib/media/updf/include/libc/asmdefs.h
0,0 → 1,52
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_asmdefs_h__
#define __dj_include_libc_asmdefs_h__
 
.file __BASE_FILE__
 
#ifdef USE_EBX
#define PUSHL_EBX pushl %ebx;
#define POPL_EBX popl %ebx;
#else
#define PUSHL_EBX
#define POPL_EBX
#endif
 
#ifdef USE_ESI
#define PUSHL_ESI pushl %esi;
#define POPL_ESI popl %esi;
#else
#define PUSHL_ESI
#define POPL_ESI
#endif
 
#ifdef USE_EDI
#define PUSHL_EDI pushl %edi;
#define POPL_EDI popl %edi;
#else
#define PUSHL_EDI
#define POPL_EDI
#endif
 
#define FUNC(x) .globl x; \
x:
 
#define ENTER pushl %ebp; movl %esp,%ebp; PUSHL_EBX PUSHL_ESI PUSHL_EDI
 
#define LEAVE L_leave: POPL_EDI POPL_ESI POPL_EBX movl %ebp,%esp; popl %ebp; ret
#define LEAVEP(x) L_leave: x; POPL_EDI POPL_ESI POPL_EBX movl %ebp,%esp; popl %ebp; ret
 
#define RET jmp L_leave
 
#define ARG1 8(%ebp)
#define ARG1h 10(%ebp)
#define ARG2 12(%ebp)
#define ARG2h 14(%ebp)
#define ARG3 16(%ebp)
#define ARG4 20(%ebp)
#define ARG5 24(%ebp)
#define ARG6 28(%ebp)
#define ARG7 32(%ebp)
#define ARG8 36(%ebp)
 
#endif /* __dj_include_libc_asmdefs_h__ */
/contrib/media/updf/include/libc/atexit.h
0,0 → 1,34
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_atexit_h__
#define __dj_include_libc_atexit_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
struct __atexit {
struct __atexit *__next;
void (*__function)(void);
};
 
extern struct __atexit *__atexit_ptr;
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_libc_atexit_h__ */
/contrib/media/updf/include/libc/bss.h
0,0 → 1,34
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_bss_h_
#define __dj_include_bss_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* this gets *incremented* at startup, so that if a program dumps
itself (emacs) you still have a way of telling. Compare this value
with a static, and if it's different, you've been restarted.
First time through on a non-unexec'd program, it's greater than 0 */
 
extern int __bss_count;
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_bss_h_ */
/contrib/media/updf/include/libc/dosexec.h
0,0 → 1,38
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_dosexec_h__
#define __dj_include_libc_dosexec_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
extern char *__dosexec_find_on_path(const char *program, char *envp[], char *buf);
extern int __dosexec_in_system;
 
#define scan_ptr() \
const char **ptr; \
union { const char **ccpp; const char *ccp; } u; \
for (ptr = &argv0; *ptr; ptr++); \
u.ccp = *++ptr; \
ptr = u.ccpp;
 
extern int __dosexec_command_exec(const char *program, char **argv, char **envp);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_libc_dosexec_h__ */
/contrib/media/updf/include/libc/dosio.h
0,0 → 1,44
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_dosio_h__
#define __dj_include_libc_dosio_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* set to O_BINARY or O_TEXT */
extern char *__file_handle_modes;
extern void __file_handle_set(int fd, int mode);
 
int __doserr_to_errno(int doserr);
 
/* puts "path" in the transfer buffer, fixing
unix-allowed multi-slashes */
void _put_path(const char * );
void _put_path2(const char * , int);
 
/* Convenience functions for setting up transfers */
 
#define __tb_offset 0 /* (__tb & 15) Always paragraph aligned */
#define __tb_segment (_go32_info_block.linear_address_of_transfer_buffer / 16)
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_libc_dosio_h__ */
/contrib/media/updf/include/libc/environ.h
0,0 → 1,38
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_environ_h_
#define __dj_include_libc_environ_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* This starts at 1 and gets incremented every time some
variable in the environment is added, deleted, or changes
its value. It is meant to be used by functions that depend
on values of environment variables, but don't want to call
`getenv' unnecessarily (example: `__use_lfn').
 
To use this feature, define a static variable that is
initialized to zero, and compare its value with the value of
`__environ_changed': if they differ, you should call `getenv'
(and record the last value of `__environ_changed' you've seen). */
extern unsigned __environ_changed;
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_environ_h_ */
/contrib/media/updf/include/libc/farptrgs.h
0,0 → 1,249
/* special version for libc - uses %gs instead of %fs. Ignore comments */
 
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/* Copyright (c) 1995 DJ Delorie. Permission granted to use for any
purpose, provided this copyright remains attached and unmodified.
 
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º Far Pointer Simulation Functions º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
 
This file attempts to make up for the lack of a "far" keyword in GCC.
Although it doesn't provide access to far call APIs (like Windows), it
does allow you to do far pointer data access without the overhead of
movedata() or dosmemget/dosmemput().
 
You should *always* include this file when using these functions and
compile with optimization enabled. They don't exist as normal functions
in any library, and they compile down to only a few opcodes when used
this way. They are almost as fast as native pointer operations, and
about as fast as far pointers can get.
 
If you don't use optimization, this file becomes prototypes for
farptr.c, which generates real functions for these when not optimizing.
When optimizing, farptr.c compiles to nothing.
 
There are two types of functions here - standalone and invariant. The
standalone functions take a selector and offset. These are used when
you need only a few accesses, time isn't critical, or you don't know
what's in the %gs register. The invariant ones don't take a selector,
they only take an offset. These are used inside loops and in
time-critical accesses where the selector doesn't change. To specify
the selector, use the farsetsel() function. That selector is used for
all farns*() functions until changed. You can use _fargetsel() if you
want to temporary change the selector with _farsetsel() and restore
it afterwards.
 
The farpoke* and farpeek* take selectors.
 
The farnspoke* and farnspeek* don't (note the `ns' for `no selector').
 
Warning: These routines all use the %gs register for their accesses.
GCC normally uses only %ds and %es, and libc functions (movedata,
dosmemget, dosmemput) use %gs. Still, you should be careful about
assumptions concerning whether or not the value you put in %gs will be
preserved across calls to other functions. If you guess wrong, your
program will crash. Better safe than sorry.
 
*/
 
#ifndef __dj_include_sys_farptr_h_
#define __dj_include_sys_farptr_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
void _farpokeb(unsigned short, unsigned long, unsigned char);
void _farpokew(unsigned short, unsigned long, unsigned short);
void _farpokel(unsigned short, unsigned long, unsigned long);
unsigned char _farpeekb(unsigned short, unsigned long);
unsigned short _farpeekw(unsigned short, unsigned long);
unsigned long _farpeekl(unsigned short, unsigned long);
void _farsetsel(unsigned short);
unsigned short _fargetsel(void);
void _farnspokeb(unsigned long, unsigned char);
void _farnspokew(unsigned long, unsigned short);
void _farnspokel(unsigned long, unsigned long);
unsigned char _farnspeekb(unsigned long);
unsigned short _farnspeekw(unsigned long);
unsigned long _farnspeekl(unsigned long);
 
extern __inline__ void
_farpokeb(unsigned short selector,
unsigned long offset,
unsigned char value)
{
__asm__ __volatile__ ("movw %w0,%%gs\n"
" .byte 0x65 \n"
" movb %b1,(%k2)"
:
: "rm" (selector), "qi" (value), "r" (offset));
}
 
extern __inline__ void
_farpokew(unsigned short selector,
unsigned long offset,
unsigned short value)
{
__asm__ __volatile__ ("movw %w0,%%gs \n"
" .byte 0x65 \n"
" movw %w1,(%k2)"
:
: "rm" (selector), "ri" (value), "r" (offset));
}
 
extern __inline__ void
_farpokel(unsigned short selector,
unsigned long offset,
unsigned long value)
{
__asm__ __volatile__ ("movw %w0,%%gs \n"
" .byte 0x65 \n"
" movl %k1,(%k2)"
:
: "rm" (selector), "ri" (value), "r" (offset));
}
 
extern __inline__ unsigned char
_farpeekb(unsigned short selector,
unsigned long offset)
{
unsigned char result;
__asm__ __volatile__ ("movw %w1,%%gs \n"
" .byte 0x65 \n"
" movb (%k2),%b0"
: "=q" (result)
: "rm" (selector), "r" (offset));
return result;
}
 
extern __inline__ unsigned short
_farpeekw(unsigned short selector,
unsigned long offset)
{
unsigned short result;
__asm__ __volatile__ ("movw %w1, %%gs \n"
" .byte 0x65 \n"
" movw (%k2),%w0 \n"
: "=r" (result)
: "rm" (selector), "r" (offset));
return result;
}
 
extern __inline__ unsigned long
_farpeekl(unsigned short selector,
unsigned long offset)
{
unsigned long result;
__asm__ __volatile__ ("movw %w1,%%gs\n"
" .byte 0x65\n"
" movl (%k2),%k0"
: "=r" (result)
: "rm" (selector), "r" (offset));
return result;
}
 
extern __inline__ void
_farsetsel(unsigned short selector)
{
__asm__ __volatile__ ("movw %w0,%%gs"
:
: "rm" (selector));
}
 
extern __inline__ unsigned short
_fargetsel(void)
{
unsigned short selector;
__asm__ __volatile__ ("movw %%gs,%w0 \n"
: "=r" (selector)
: );
return selector;
}
 
extern __inline__ void
_farnspokeb(unsigned long offset,
unsigned char value)
{
__asm__ __volatile__ (".byte 0x65\n"
" movb %b0,(%k1)"
:
: "qi" (value), "r" (offset));
}
 
extern __inline__ void
_farnspokew(unsigned long offset,
unsigned short value)
{
__asm__ __volatile__ (".byte 0x65\n"
" movw %w0,(%k1)"
:
: "ri" (value), "r" (offset));
}
 
extern __inline__ void
_farnspokel(unsigned long offset,
unsigned long value)
{
__asm__ __volatile__ (".byte 0x65\n"
" movl %k0,(%k1)"
:
: "ri" (value), "r" (offset));
}
 
extern __inline__ unsigned char
_farnspeekb(unsigned long offset)
{
unsigned char result;
__asm__ __volatile__ (".byte 0x65\n"
" movb (%k1),%b0"
: "=q" (result)
: "r" (offset));
return result;
}
 
extern __inline__ unsigned short
_farnspeekw(unsigned long offset)
{
unsigned short result;
__asm__ __volatile__ (".byte 0x65\n"
" movw (%k1),%w0"
: "=r" (result)
: "r" (offset));
return result;
}
 
extern __inline__ unsigned long
_farnspeekl(unsigned long offset)
{
unsigned long result;
__asm__ __volatile__ (".byte 0x65\n"
" movl (%k1),%k0"
: "=r" (result)
: "r" (offset));
return result;
}
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_farptr_h_ */
/contrib/media/updf/include/libc/file.h
0,0 → 1,119
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_file_h__
#define __dj_include_libc_file_h__
 
#include <fcntl.h>
#include <libc/dosio.h>
#include <libc/ttyprvt.h>
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#define _IOREAD 000010
#define _IOWRT 000020
#define _IOMYBUF 000040
#define _IOEOF 000100
#define _IOERR 000200
#define _IOSTRG 000400
#define _IORW 001000
#define _IOAPPEND 002000
#define _IORMONCL 004000 /* remove on close, for temp files */
/* if _flag & _IORMONCL, ._name_to_remove needs freeing */
#define _IOUNGETC 010000 /* there is an ungetc'ed character in the buffer */
#define _IOTERM 020000 /* file's handle hooked by termios */
#define _IONTERM 040000 /* file's handle not hooked by termios */
 
int _flsbuf(int, FILE*);
int _filbuf(FILE *);
void _fwalk(void (*)(FILE *));
 
static __inline__ int __getc_raw(FILE *const p)
{
if(p->_cnt>0)
{
p->_cnt--;
return((unsigned char)*(p->_ptr++));
}
return(_filbuf(p));
}
 
static __inline__ int __putc_raw(int const x,FILE *const p)
{
if(p->_cnt>0)
{
p->_cnt--;
return((unsigned char)(*(p->_ptr++)=(unsigned char)x));
}
return(_flsbuf((unsigned char)x,p));
}
 
static __inline__ int __is_text_file(FILE *const p)
{
return(!((p)->_flag & (_IOSTRG | _IOTERM))
&& (__file_handle_modes[(p)->_file]&O_TEXT));
}
 
static __inline__ int __getc(FILE *const p)
{
int __c;
if (__libc_read_termios_hook
&& ((p)->_flag & (_IOTERM | _IONTERM)) == 0)
{
extern int __isatty(int);
/* first time we see this handle--see if termios hooked it */
if (!((p)->_flag & _IOSTRG) && __isatty((p)->_file))
(p)->_flag |= _IOTERM;
else
(p)->_flag |= _IONTERM;
}
__c = __getc_raw(p);
if (__c=='\r' && __is_text_file(p))
return __getc_raw(p);
return __c;
}
 
static __inline__ int __putc(const int x,FILE *const p)
{
if (__libc_write_termios_hook
&& ((p)->_flag & (_IOTERM | _IONTERM)) == 0)
{
extern int __isatty(int);
/* first time we see this handle--see if termios hooked it */
if (!((p)->_flag & _IOSTRG) && __isatty((p)->_file))
(p)->_flag |= _IOTERM;
else
(p)->_flag |= _IONTERM;
}
if(x=='\n' && __is_text_file(p))
__putc_raw('\r',p);
return __putc_raw(x,p);
}
 
#undef fileno
#define fileno(f) (f->_file)
#undef feof
#define feof(f) (((f)->_flag&_IOEOF)!=0)
#undef ferror
#define ferror(f) (((f)->_flag&_IOERR)!=0)
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_libc_file_h__ */
/contrib/media/updf/include/libc/ieee.h
0,0 → 1,46
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_ieee_h__
#define __dj_include_libc_ieee_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
typedef struct {
unsigned mantissa:23;
unsigned exponent:8;
unsigned sign:1;
} float_t;
 
typedef struct {
unsigned mantissal:32;
unsigned mantissah:20;
unsigned exponent:11;
unsigned sign:1;
} double_t;
 
typedef struct {
unsigned mantissal:32;
unsigned mantissah:32;
unsigned exponent:15;
unsigned sign:1;
} long_double_t;
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_libc_ieee_h__ */
/contrib/media/updf/include/libc/internal.h
0,0 → 1,26
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_internal_h__
#define __dj_include_libc_internal_h__
 
#ifdef __cplusplus
extern "C" {
#endif
void __crt1_startup(void);
void __main(void);
void _npxsetup(char *argv0);
void __emu387_exception_handler(void);
void __djgpp_exception_processor(void);
void __djgpp_exception_setup(void);
 
static inline int str_check_ptr(void * ptr)
{
unsigned long p=(unsigned long)ptr;
if(p<64 || p>(64*1024*1024)) return 0;
return 1;
}
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_libc_internal_h__ */
/contrib/media/updf/include/libc/local.h
0,0 → 1,39
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_local_h__
#define __dj_include_libc_local_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
FILE * __alloc_file(void);
 
/* A FILE* is considered "free" if its flag is zero. */
 
#define __FILE_REC_MAX 20
typedef struct __file_rec {
struct __file_rec *next;
int count;
FILE *files[__FILE_REC_MAX];
} __file_rec;
 
extern __file_rec *__file_rec_list;
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_libc_local_h__ */
/contrib/media/updf/include/libc/mkfargs.bat
0,0 → 1,5
@echo off
 
echo /* special version for libc - uses %%gs instead of %%fs. Ignore comments */> farptrgs.h
echo.>>farptrgs.h
sed -e 's/%%fs/%%gs/g' -e 's/0x64/0x65/g' < ..\sys\farptr.h >> farptrgs.h
/contrib/media/updf/include/libc/stdiohk.h
0,0 → 1,38
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_stdiohk_h__
#define __dj_include_libc_stdiohk_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* Force stdiohk.o to get linked in, and that module has the
code for the stdio flush/fclose stuff. That .o causes the
hook function to get initialized also. */
 
#include __DEV_CONFIG_H
 
#ifndef NEEDS_UNDERSCORES
__asm__(".long __stdio_cleanup_proc");
#else
__asm__(".long ___stdio_cleanup_proc");
#endif
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_libc_stdiohk_h__ */
/contrib/media/updf/include/libc/stubs.h
0,0 → 1,53
/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_stubs_h__
#define __dj_include_libc_stubs_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* POSIX functions (for when compiling an ANSI function) */
 
/* DJGPP functions (for compiling POSIX or ANSI functions) */
#define crlf2nl __crlf2nl
#define dosmemget __dosmemget
#define dosmemput __dosmemput
#define filelength __filelength
#define findfirst __findfirst
#define findnext __findnext
#define fsync __fsync
#define getdisk __getdisk
#define getdtablesize __getdtablesize
#define getitimer __getitimer
#define modfl __modfl
#define movedata __movedata
#define pow10 __pow10
#define pow2 __pow2
#define putenv __putenv
#define sbrk __sbrk
#define setitimer __setitimer
#define setmode __setmode
#define spawnve __spawnve
#define spawnvpe __spawnvpe
#define stricmp __stricmp
#define sync __sync
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_libc_stubs_h__ */
/contrib/media/updf/include/libc/ttyprvt.h
0,0 → 1,138
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_ttyprvt_h__
#define __dj_include_libc_ttyprvt_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <termios.h>
#include <unistd.h>
 
#define _TTY_CTRL(x) ((x) & 0x1f)
#define _TTY_QUEUE_SIZE 2048
#define _TTY_EDITLINE_SIZE ((_TTY_QUEUE_SIZE) / 2)
#define _TTY_EDITLINE_CTRL 0
#define _TTY_EDITLINE_SINGLE 1
#define _TTY_EDITLINE_INVALID -1
 
struct tty_queue
{
int size;
unsigned char *top;
unsigned char *bottom;
int count;
unsigned char *rpos;
unsigned char *wpos;
};
 
struct tty
{
struct termios __libc_termios;
struct tty_queue __libc_tty_queue;
int __libc_tty_status;
};
 
struct tty_editline
{
int col;
char flag[_TTY_EDITLINE_SIZE];
unsigned char buf[_TTY_EDITLINE_SIZE];
};
 
#if !defined (_POSIX_VDISABLE) || (_POSIX_VDISABLE == 0)
#error _POSIX_VDISABLE is undefine or zero.
#endif
 
#define TTYDEFAULT \
{ \
{ \
/* c_cc[] */ \
{ \
(cc_t) 0, /* pad */ \
(cc_t) _TTY_CTRL ('d'), /* VEOF */ \
(cc_t) _POSIX_VDISABLE, /* VEOL */ \
(cc_t) _TTY_CTRL ('h'), /* VERASE */ \
(cc_t) _TTY_CTRL ('c'), /* VINTR */ \
(cc_t) _TTY_CTRL ('u'), /* VKILL */ \
(cc_t) 1, /* VMIN */ \
(cc_t) _TTY_CTRL ('\\'),/* VQUIT */ \
(cc_t) _TTY_CTRL ('q'), /* VSTART */ \
(cc_t) _TTY_CTRL ('s'), /* VSTOP */ \
(cc_t) _TTY_CTRL ('z'), /* VSUSP */ \
(cc_t) 0, /* VTIME */ \
}, \
(tcflag_t) (CS8|CREAD|CLOCAL), /* c_cflag */ \
(tcflag_t) (BRKINT|ICRNL|IMAXBEL), /* c_iflag */ \
(tcflag_t) (ISIG|ICANON|ECHO|IEXTEN|ECHOE|ECHOKE|ECHOCTL), /* c_lflag */ \
(tcflag_t) (OPOST|ONLCR|ONOEOT), /* c_oflag */ \
(speed_t) (B9600), /* c_ispeed */ \
(speed_t) (B9600), /* c_ospeed */ \
}, \
/* struct tty_queue __libc_tty_queue */ \
{ \
_TTY_QUEUE_SIZE, \
__libc_tty_queue_buffer, \
__libc_tty_queue_buffer + _TTY_QUEUE_SIZE, \
0, \
__libc_tty_queue_buffer, \
__libc_tty_queue_buffer, \
}, \
/* __libc_tty_status */ \
0, \
}
 
#define t_termios __libc_termios
#define t_iflag __libc_termios.c_iflag
#define t_oflag __libc_termios.c_oflag
#define t_cflag __libc_termios.c_cflag
#define t_lflag __libc_termios.c_lflag
#define t_ispeed __libc_termios.c_ispeed
#define t_ospeed __libc_termios.c_ospeed
#define t_cc __libc_termios.c_cc
#define t_status __libc_tty_status
 
#define t_size __libc_tty_queue.size
#define t_top __libc_tty_queue.top
#define t_bottom __libc_tty_queue.bottom
#define t_count __libc_tty_queue.count
#define t_rpos __libc_tty_queue.rpos
#define t_wpos __libc_tty_queue.wpos
 
#define _TS_LNCH 0x01 /* next character is literal */
#define _CC_EQU(v,c) (((c) == (unsigned char) __libc_tty_p->t_cc[(v)]) \
&& ((c) != (unsigned char) _POSIX_VDISABLE))
#define _CC_NEQU(v,c) (((c) != (unsigned char)__libc_tty_p->t_cc[(v)]) \
&& ((c) != (unsigned char) _POSIX_VDISABLE))
 
/* internal buffers */
extern unsigned char __libc_tty_queue_buffer[];
extern struct tty __libc_tty_internal;
extern struct tty *__libc_tty_p;
extern struct tty_editline __libc_tty_editline;
 
/* termios hooks */
extern ssize_t (*__libc_read_termios_hook)(int handle, void *buffer, size_t count,
ssize_t *rv);
extern ssize_t (*__libc_write_termios_hook)(int handle, const void *buffer, size_t count,
ssize_t *rv);
extern int __libc_termios_hook_common_count;
 
/* functions */
void __libc_termios_init (void);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_libc_ttyprvt_h__ */
/contrib/media/updf/include/libc/unconst.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_libc_unconst_h__
#define __dj_include_libc_unconst_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#define unconst(__v, __t) __extension__ ({union { const __t __cp; __t __p; } __q; __q.__cp = __v; __q.__p;})
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_libc_unconst_h__ */
/contrib/media/updf/include/libc/version.h
0,0 → 1,7
/* This file is automatically generated by mkversion. */
/* Please do not modify it unless you know what you are doing. */
#define MENUET_LIBC_VERSION "0.2.9"
 
#ifdef INCLUDE_RCS_ID
static const char * ___menuet__libc_version_0_2_9="MenuetOS GNU C library port by Jarek Pelczar. This file is " __FILE__ ;
#endif
/contrib/media/updf/include/libelf/byteswap.h
0,0 → 1,75
/*
byteswap.h - C preprocessor macros for byte swapping.
Copyright (C) 1995, 1996 Michael Riepe <michael@stud.uni-hannover.de>
 
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
 
/* @(#) $Id: byteswap.h,v 1.2 1996/10/22 16:45:54 michael Exp $ */
 
#ifndef _BYTESWAP_H
#define _BYTESWAP_H
 
#define lu(from,i,s) (((long)((unsigned char*)(from))[i])<<(s))
#define li(from,i,s) (((long)((signed char*)(from))[i])<<(s))
 
#define __load_u16L(from) ((unsigned long)(lu(from,1,8)|lu(from,0,0)))
#define __load_u16M(from) ((unsigned long)(lu(from,0,8)|lu(from,1,0)))
#define __load_i16L(from) ((long)(li(from,1,8)|lu(from,0,0)))
#define __load_i16M(from) ((long)(li(from,0,8)|lu(from,1,0)))
 
#define __load_u32L(from) ((unsigned long)(lu(from,3,24)| \
lu(from,2,16)| \
lu(from,1,8)| \
lu(from,0,0)))
#define __load_u32M(from) ((unsigned long)(lu(from,0,24)| \
lu(from,1,16)| \
lu(from,2,8)| \
lu(from,3,0)))
#define __load_i32L(from) ((long)(li(from,3,24)| \
lu(from,2,16)| \
lu(from,1,8)| \
lu(from,0,0)))
#define __load_i32M(from) ((long)(li(from,0,24)| \
lu(from,1,16)| \
lu(from,2,8)| \
lu(from,3,0)))
 
#define su(to,i,v,s) (((char*)(to))[i]=((unsigned long)(v)>>(s)))
#define si(to,i,v,s) (((char*)(to))[i]=((long)(v)>>(s)))
 
#define __store_u16L(to,v) (su(to,1,v,8),su(to,0,v,0))
#define __store_u16M(to,v) (su(to,0,v,8),su(to,1,v,0))
#define __store_i16L(to,v) (si(to,1,v,8),si(to,0,v,0))
#define __store_i16M(to,v) (si(to,0,v,8),si(to,1,v,0))
 
#define __store_u32L(to,v) (su(to,3,v,24), \
su(to,2,v,16), \
su(to,1,v,8), \
su(to,0,v,0))
#define __store_u32M(to,v) (su(to,0,v,24), \
su(to,1,v,16), \
su(to,2,v,8), \
su(to,3,v,0))
#define __store_i32L(to,v) (si(to,3,v,24), \
si(to,2,v,16), \
si(to,1,v,8), \
si(to,0,v,0))
#define __store_i32M(to,v) (si(to,0,v,24), \
si(to,1,v,16), \
si(to,2,v,8), \
si(to,3,v,0))
 
#endif /* _BYTESWAP_H */
/contrib/media/updf/include/libelf/config.h
0,0 → 1,107
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
 
/* Define to empty if the keyword does not work. */
/* #undef const */
 
/* Define if you have a working `mmap' system call. */
/* #define HAVE_MMAP 1 */
 
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
 
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
 
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
 
/* Define if you want to include extra debugging code */
/* #undef ENABLE_DEBUG */
 
/* Define if memmove() does not copy overlapping arrays correctly */
/* #undef HAVE_BROKEN_MEMMOVE */
 
/* Define if you have the catgets function. */
/* #undef HAVE_CATGETS */
 
/* Define if you have the gettext function. */
/* #define HAVE_GETTEXT 1 */
 
/* Define if you have the memset function. */
#define HAVE_MEMSET 1
 
/* Define if struct nlist is declared in <elf.h> or <sys/elf.h> */
/* #undef HAVE_STRUCT_NLIST_DECLARATION */
 
/* Define if Elf32_Dyn is declared in <link.h> */
/* #undef NEED_LINK_H */
 
/* Define to `<elf.h>' or `<sys/elf.h>' if one of them is present */
#define __LIBELF_HEADER_ELF_H <elf.h>
 
/* Define if you want 64-bit support (and your system supports it) */
#define __LIBELF64 1
 
/* Define if you want 64-bit support, and are running IRIX */
/* #undef __LIBELF64_IRIX */
 
/* Define if you want 64-bit support, and are running Linux */
/* #undef __LIBELF64_LINUX */
 
/* Define to a 64-bit signed integer type if one exists */
#define __libelf_i64_t long long
 
/* Define to a 64-bit unsigned integer type if one exists */
#define __libelf_u64_t unsigned long long
 
/* Define to a 32-bit signed integer type if one exists */
#define __libelf_i32_t long
 
/* Define to a 32-bit unsigned integer type if one exists */
#define __libelf_u32_t unsigned long
 
/* Define to a 16-bit signed integer type if one exists */
#define __libelf_i16_t short
 
/* Define to a 16-bit unsigned integer type if one exists */
#define __libelf_u16_t unsigned short
 
/* The number of bytes in a int. */
#define SIZEOF_INT 4
 
/* The number of bytes in a long. */
#define SIZEOF_LONG 4
 
/* The number of bytes in a long long. */
#define SIZEOF_LONG_LONG 8
 
/* The number of bytes in a short. */
#define SIZEOF_SHORT 2
 
/* Define if you have the ftruncate function. */
/* #define HAVE_FTRUNCATE 1 */
 
/* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE 1
 
/* Define if you have the memcmp function. */
#define HAVE_MEMCMP 1
 
/* Define if you have the memcpy function. */
#define HAVE_MEMCPY 1
 
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
 
/* Define if you have the memset function. */
#define HAVE_MEMSET 1
 
/* Define if you have the <elf.h> header file. */
#define HAVE_ELF_H 1
 
/* Define if you have the <sys/elf.h> header file. */
#define HAVE_SYS_ELF_H 1
 
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/contrib/media/updf/include/libelf/elf_repl.h
0,0 → 1,460
/*
elf_repl.h - public header file for systems that lack it.
Copyright (C) 1995 - 1998 Michael Riepe <michael@stud.uni-hannover.de>
 
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
 
/* @(#) $Id: elf_repl.h,v 1.4 1998/06/04 17:14:01 michael Exp $ */
 
/*
* NEVER INCLUDE THIS FILE DIRECTLY - USE <libelf.h> INSTEAD!
*/
 
#ifndef _ELF_REPL_H
#define _ELF_REPL_H
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
/*
* Scalar data types
*/
typedef __libelf_u32_t Elf32_Addr;
typedef __libelf_u16_t Elf32_Half;
typedef __libelf_u32_t Elf32_Off;
typedef __libelf_i32_t Elf32_Sword;
typedef __libelf_u32_t Elf32_Word;
 
#define ELF32_FSZ_ADDR 4
#define ELF32_FSZ_HALF 2
#define ELF32_FSZ_OFF 4
#define ELF32_FSZ_SWORD 4
#define ELF32_FSZ_WORD 4
 
#if __LIBELF64
typedef __libelf_u64_t Elf64_Addr;
typedef __libelf_u16_t Elf64_Half;
typedef __libelf_u64_t Elf64_Off;
typedef __libelf_i32_t Elf64_Sword;
typedef __libelf_i64_t Elf64_Sxword;
typedef __libelf_u32_t Elf64_Word;
typedef __libelf_u64_t Elf64_Xword;
 
#define ELF64_FSZ_ADDR 8
#define ELF64_FSZ_HALF 2
#define ELF64_FSZ_OFF 8
#define ELF64_FSZ_SWORD 4
#define ELF64_FSZ_SXWORD 8
#define ELF64_FSZ_WORD 4
#define ELF64_FSZ_XWORD 8
#endif /* __LIBELF64 */
 
/*
* ELF header
*/
#define EI_NIDENT 16
 
typedef struct {
unsigned char e_ident[EI_NIDENT];
Elf32_Half e_type;
Elf32_Half e_machine;
Elf32_Word e_version;
Elf32_Addr e_entry;
Elf32_Off e_phoff;
Elf32_Off e_shoff;
Elf32_Word e_flags;
Elf32_Half e_ehsize;
Elf32_Half e_phentsize;
Elf32_Half e_phnum;
Elf32_Half e_shentsize;
Elf32_Half e_shnum;
Elf32_Half e_shstrndx;
} Elf32_Ehdr;
 
#if __LIBELF64
typedef struct {
unsigned char e_ident[EI_NIDENT];
Elf64_Half e_type;
Elf64_Half e_machine;
Elf64_Word e_version;
Elf64_Addr e_entry;
Elf64_Off e_phoff;
Elf64_Off e_shoff;
Elf64_Word e_flags;
Elf64_Half e_ehsize;
Elf64_Half e_phentsize;
Elf64_Half e_phnum;
Elf64_Half e_shentsize;
Elf64_Half e_shnum;
Elf64_Half e_shstrndx;
} Elf64_Ehdr;
#endif /* __LIBELF64 */
 
/*
* e-ident
*/
#define EI_MAG0 0
#define EI_MAG1 1
#define EI_MAG2 2
#define EI_MAG3 3
#define EI_CLASS 4
#define EI_DATA 5
#define EI_VERSION 6
#define EI_PAD 7
 
#define ELFMAG0 0x7f
#define ELFMAG1 'E'
#define ELFMAG2 'L'
#define ELFMAG3 'F'
#define ELFMAG "\177ELF"
#define SELFMAG 4
 
#define ELFCLASSNONE 0
#define ELFCLASS32 1
#define ELFCLASS64 2
#define ELFCLASSNUM 3
 
#define ELFDATANONE 0
#define ELFDATA2LSB 1
#define ELFDATA2MSB 2
#define ELFDATANUM 3
 
/*
* e_type
*/
#define ET_NONE 0
#define ET_REL 1
#define ET_EXEC 2
#define ET_DYN 3
#define ET_CORE 4
#define ET_NUM 5
#define ET_LOPROC 0xff00
#define ET_HIPROC 0xffff
 
/*
* e_machine
*/
#define EM_NONE 0
#define EM_M32 1 /* AT&T WE 32100 */
#define EM_SPARC 2 /* SPARC */
#define EM_386 3 /* Intel i386 */
#define EM_68K 4 /* Motorola 68000 */
#define EM_88K 5 /* Motorola 88000 */
#define EM_486 6 /* Intel i486 (do not use this one) */
#define EM_860 7 /* Intel i860 */
#define EM_MIPS 8 /* MIPS R3000 */
#define EM_NUM 9
 
/*
* e_ident[EI_VERSION], e_version
*/
#define EV_NONE 0
#define EV_CURRENT 1
#define EV_NUM 2
 
/*
* Section header
*/
typedef struct {
Elf32_Word sh_name;
Elf32_Word sh_type;
Elf32_Word sh_flags;
Elf32_Addr sh_addr;
Elf32_Off sh_offset;
Elf32_Word sh_size;
Elf32_Word sh_link;
Elf32_Word sh_info;
Elf32_Word sh_addralign;
Elf32_Word sh_entsize;
} Elf32_Shdr;
 
#if __LIBELF64
typedef struct {
Elf64_Word sh_name;
Elf64_Word sh_type;
Elf64_Xword sh_flags;
Elf64_Addr sh_addr;
Elf64_Off sh_offset;
Elf64_Xword sh_size;
Elf64_Word sh_link;
Elf64_Word sh_info;
Elf64_Xword sh_addralign;
Elf64_Xword sh_entsize;
} Elf64_Shdr;
#endif /* __LIBELF64 */
 
/*
* Special section indices
*/
#define SHN_UNDEF 0
#define SHN_LORESERVE 0xff00
#define SHN_LOPROC 0xff00
#define SHN_HIPROC 0xff1f
#define SHN_ABS 0xfff1
#define SHN_COMMON 0xfff2
#define SHN_HIRESERVE 0xffff
 
/*
* sh_type
*/
#define SHT_NULL 0
#define SHT_PROGBITS 1
#define SHT_SYMTAB 2
#define SHT_STRTAB 3
#define SHT_RELA 4
#define SHT_HASH 5
#define SHT_DYNAMIC 6
#define SHT_NOTE 7
#define SHT_NOBITS 8
#define SHT_REL 9
#define SHT_SHLIB 10
#define SHT_DYNSYM 11
#define SHT_NUM 12
#define SHT_LOPROC 0x70000000
#define SHT_HIPROC 0x7fffffff
#define SHT_LOUSER 0x80000000
#define SHT_HIUSER 0xffffffff
 
/*
* sh_flags
*/
#define SHF_WRITE 0x1
#define SHF_ALLOC 0x2
#define SHF_EXECINSTR 0x4
#define SHF_MASKPROC 0xf0000000
 
/*
* Symbol table
*/
typedef struct {
Elf32_Word st_name;
Elf32_Addr st_value;
Elf32_Word st_size;
unsigned char st_info;
unsigned char st_other;
Elf32_Half st_shndx;
} Elf32_Sym;
 
#if __LIBELF64
typedef struct {
Elf64_Word st_name;
unsigned char st_info;
unsigned char st_other;
Elf64_Half st_shndx;
Elf64_Addr st_value;
Elf64_Xword st_size;
} Elf64_Sym;
#endif /* __LIBELF64 */
 
/*
* Special symbol indices
*/
#define STN_UNDEF 0
 
/*
* Macros for manipulating st_info
*/
#define ELF32_ST_BIND(i) ((i)>>4)
#define ELF32_ST_TYPE(i) ((i)&0xf)
#define ELF32_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
 
/*
* Symbol binding
*/
#define STB_LOCAL 0
#define STB_GLOBAL 1
#define STB_WEAK 2
#define STB_NUM 3
#define STB_LOPROC 13
#define STB_HIPROC 15
 
/*
* Symbol types
*/
#define STT_NOTYPE 0
#define STT_OBJECT 1
#define STT_FUNC 2
#define STT_SECTION 3
#define STT_FILE 4
#define STT_NUM 5
#define STT_LOPROC 13
#define STT_HIPROC 15
 
/*
* Relocation
*/
typedef struct {
Elf32_Addr r_offset;
Elf32_Word r_info;
} Elf32_Rel;
 
typedef struct {
Elf32_Addr r_offset;
Elf32_Word r_info;
Elf32_Sword r_addend;
} Elf32_Rela;
 
#if __LIBELF64
typedef struct {
Elf64_Addr r_offset;
Elf64_Xword r_info;
} Elf64_Rel;
 
typedef struct {
Elf64_Addr r_offset;
Elf64_Xword r_info;
Elf64_Sxword r_addend;
} Elf64_Rela;
#endif /* __LIBELF64 */
 
/*
* Macros for manipulating r_info
*/
#define ELF32_R_SYM(i) ((i)>>8)
#define ELF32_R_TYPE(i) ((unsigned char)(i))
#define ELF32_R_INFO(s,t) (((s)<<8)+(unsigned char)(t))
 
/*
* Note entry header
*/
typedef struct {
Elf32_Word n_namesz; /* name size */
Elf32_Word n_descsz; /* descriptor size */
Elf32_Word n_type; /* descriptor type */
} Elf32_Nhdr;
 
#if __LIBELF64 && 0 /* I don't know if this is correct */
typedef struct {
Elf64_Word n_namesz; /* name size */
Elf64_Word n_descsz; /* descriptor size */
Elf64_Word n_type; /* descriptor type */
} Elf64_Nhdr;
#endif /* __LIBELF64 */
 
/*
* Well-known descriptor types for ET_CORE files
*/
#define NT_PRSTATUS 1
#define NT_PRFPREG 2
#define NT_PRPSINFO 3
 
/*
* Program header
*/
typedef struct {
Elf32_Word p_type;
Elf32_Off p_offset;
Elf32_Addr p_vaddr;
Elf32_Addr p_paddr;
Elf32_Word p_filesz;
Elf32_Word p_memsz;
Elf32_Word p_flags;
Elf32_Word p_align;
} Elf32_Phdr;
 
#if __LIBELF64
typedef struct {
Elf64_Word p_type;
Elf64_Word p_flags;
Elf64_Off p_offset;
Elf64_Addr p_vaddr;
Elf64_Addr p_paddr;
Elf64_Xword p_filesz;
Elf64_Xword p_memsz;
Elf64_Xword p_align;
} Elf64_Phdr;
#endif /* __LIBELF64 */
 
/*
* p_type
*/
#define PT_NULL 0
#define PT_LOAD 1
#define PT_DYNAMIC 2
#define PT_INTERP 3
#define PT_NOTE 4
#define PT_SHLIB 5
#define PT_PHDR 6
#define PT_NUM 7
#define PT_LOPROC 0x70000000
#define PT_HIPROC 0x7fffffff
 
/*
* p_flags
*/
#define PF_R 0x4
#define PF_W 0x2
#define PF_X 0x1
#define PF_MASKPROC 0xf0000000
 
/*
* Dynamic structure
*/
typedef struct {
Elf32_Sword d_tag;
union {
Elf32_Word d_val;
Elf32_Addr d_ptr;
} d_un;
} Elf32_Dyn;
 
#if __LIBELF64
typedef struct {
Elf64_Sxword d_tag;
union {
Elf64_Xword d_val;
Elf64_Addr d_ptr;
} d_un;
} Elf64_Dyn;
#endif /* __LIBELF64 */
 
/*
* Dynamic array tags
*/
#define DT_NULL 0
#define DT_NEEDED 1
#define DT_PLTRELSZ 2
#define DT_PLTGOT 3
#define DT_HASH 4
#define DT_STRTAB 5
#define DT_SYMTAB 6
#define DT_RELA 7
#define DT_RELASZ 8
#define DT_RELAENT 9
#define DT_STRSZ 10
#define DT_SYMENT 11
#define DT_INIT 12
#define DT_FINI 13
#define DT_SONAME 14
#define DT_RPATH 15
#define DT_SYMBOLIC 16
#define DT_REL 17
#define DT_RELSZ 18
#define DT_RELENT 19
#define DT_PLTREL 20
#define DT_DEBUG 21
#define DT_TEXTREL 22
#define DT_JMPREL 23
#define DT_NUM 24
#define DT_LOPROC 0x70000000
#define DT_HIPROC 0x7fffffff
 
#ifdef __cplusplus
}
#endif /* __cplusplus */
 
#endif /* _ELF_REPL_H */
/contrib/media/updf/include/libelf/errors.h
0,0 → 1,83
/*
errors.h - exhaustive list of all error codes and messages for libelf.
Copyright (C) 1995 - 1998 Michael Riepe <michael@stud.uni-hannover.de>
 
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
 
/* @(#) $Id: errors.h,v 1.4 1998/06/08 14:50:30 michael Exp $ */
 
/* dummy for xgettext */
#define _(str) str
 
__err__(ERROR_OK, _("no error"))
__err__(ERROR_UNKNOWN, _("unknown error"))
__err__(ERROR_INTERNAL, _("Internal error: unknown reason"))
__err__(ERROR_UNIMPLEMENTED, _("Internal error: not implemented"))
__err__(ERROR_WRONLY, _("Request error: cntl(ELF_C_FDREAD) on write-only file"))
__err__(ERROR_INVALID_CMD, _("Request error: invalid ELF_C_* argument"))
__err__(ERROR_FDDISABLED, _("Request error: file descriptor disabled"))
__err__(ERROR_NOTARCHIVE, _("Request error: not an archive"))
__err__(ERROR_BADOFF, _("Request error: offset out of range"))
__err__(ERROR_UNKNOWN_VERSION, _("Request error: unknown ELF version"))
__err__(ERROR_CMDMISMATCH, _("Request error: ELF_C_* argument does not match"))
__err__(ERROR_MEMBERWRITE, _("Request error: archive member begin() for writing"))
__err__(ERROR_FDMISMATCH, _("Request error: archive/member file descriptor mismatch"))
__err__(ERROR_NOTELF, _("Request error: not an ELF file"))
__err__(ERROR_CLASSMISMATCH, _("Request error: class file/memory mismatch"))
__err__(ERROR_UNKNOWN_TYPE, _("Request error: invalid ELF_T_* argument"))
__err__(ERROR_UNKNOWN_ENCODING, _("Request error: unknown data encoding"))
__err__(ERROR_DST2SMALL, _("Request error: destination buffer too small"))
__err__(ERROR_NULLBUF, _("Request error: d_buf is NULL"))
__err__(ERROR_UNKNOWN_CLASS, _("Request error: unknown ELF class"))
__err__(ERROR_ELFSCNMISMATCH, _("Request error: section does not belong to file"))
__err__(ERROR_NOSUCHSCN, _("Request error: no section at index"))
__err__(ERROR_NULLSCN, _("Request error: can't manipulate null section"))
__err__(ERROR_SCNDATAMISMATCH, _("Request error: data does not belong to section"))
__err__(ERROR_NOSTRTAB, _("Request error: no string table"))
__err__(ERROR_BADSTROFF, _("Request error: string table offset out of range"))
__err__(ERROR_RDONLY, _("Request error: update(ELF_C_WRITE) on read-only file"))
__err__(ERROR_IO_SEEK, _("I/O error: seek"))
__err__(ERROR_IO_2BIG, _("I/O error: file too big for memory"))
__err__(ERROR_IO_READ, _("I/O error: raw read"))
__err__(ERROR_IO_GETSIZE, _("I/O error: get file size"))
__err__(ERROR_IO_WRITE, _("I/O error: output write"))
__err__(ERROR_IO_TRUNC, _("I/O error: can't truncate output file"))
__err__(ERROR_VERSION_UNSET, _("Sequence error: must set ELF version first"))
__err__(ERROR_NOEHDR, _("Sequence error: must create ELF header first"))
__err__(ERROR_OUTSIDE, _("Format error: reference outside file"))
__err__(ERROR_TRUNC_ARHDR, _("Format error: archive header truncated"))
__err__(ERROR_ARFMAG, _("Format error: archive fmag"))
__err__(ERROR_ARHDR, _("Format error: archive header"))
__err__(ERROR_TRUNC_MEMBER, _("Format error: archive member truncated"))
__err__(ERROR_SIZE_ARSYMTAB, _("Format error: archive symbol table size"))
__err__(ERROR_ARSTRTAB, _("Format error: archive string table"))
__err__(ERROR_ARSPECIAL, _("Format error: archive special name unknown"))
__err__(ERROR_TRUNC_EHDR, _("Format error: ELF header truncated"))
__err__(ERROR_TRUNC_PHDR, _("Format error: program header table truncated"))
__err__(ERROR_TRUNC_SHDR, _("Format error: section header table truncated"))
__err__(ERROR_TRUNC_SCN, _("Format error: data region truncated"))
__err__(ERROR_SCN2SMALL, _("Format error: section size too small for data"))
__err__(ERROR_ALIGN_PHDR, _("Format error: program header table alignment"))
__err__(ERROR_ALIGN_SHDR, _("Format error: section header table alignment"))
__err__(ERROR_MEM_ELF, _("Memory error: elf descriptor"))
__err__(ERROR_MEM_ARSYMTAB, _("Memory error: archive symbol table"))
__err__(ERROR_MEM_ARHDR, _("Memory error: archive member header"))
__err__(ERROR_MEM_EHDR, _("Memory error: ELF header"))
__err__(ERROR_MEM_PHDR, _("Memory error: program header table"))
__err__(ERROR_MEM_SHDR, _("Memory error: section header table"))
__err__(ERROR_MEM_SCN, _("Memory error: section descriptor"))
__err__(ERROR_MEM_SCNDATA, _("Memory error: section data"))
__err__(ERROR_MEM_OUTBUF, _("Memory error: output file space"))
/contrib/media/updf/include/libelf/ext_types.h
0,0 → 1,236
/*
ext_types.h - external representation of ELF data types.
Copyright (C) 1995 - 1998 Michael Riepe <michael@stud.uni-hannover.de>
 
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
 
/* @(#) $Id: ext_types.h,v 1.3 1998/06/01 19:47:15 michael Exp $ */
 
#ifndef _EXT_TYPES_H
#define _EXT_TYPES_H
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
/*
* Scalar data types
*/
typedef unsigned char __ext_Elf32_Addr [ELF32_FSZ_ADDR];
typedef unsigned char __ext_Elf32_Half [ELF32_FSZ_HALF];
typedef unsigned char __ext_Elf32_Off [ELF32_FSZ_OFF];
typedef unsigned char __ext_Elf32_Sword [ELF32_FSZ_SWORD];
typedef unsigned char __ext_Elf32_Word [ELF32_FSZ_WORD];
 
#if __LIBELF64
typedef unsigned char __ext_Elf64_Addr [ELF64_FSZ_ADDR];
typedef unsigned char __ext_Elf64_Half [ELF64_FSZ_HALF];
typedef unsigned char __ext_Elf64_Off [ELF64_FSZ_OFF];
typedef unsigned char __ext_Elf64_Sword [ELF64_FSZ_SWORD];
typedef unsigned char __ext_Elf64_Sxword[ELF64_FSZ_SXWORD];
typedef unsigned char __ext_Elf64_Word [ELF64_FSZ_WORD];
typedef unsigned char __ext_Elf64_Xword [ELF64_FSZ_XWORD];
#endif /* __LIBELF64 */
 
/*
* ELF header
*/
typedef struct {
unsigned char e_ident[EI_NIDENT];
__ext_Elf32_Half e_type;
__ext_Elf32_Half e_machine;
__ext_Elf32_Word e_version;
__ext_Elf32_Addr e_entry;
__ext_Elf32_Off e_phoff;
__ext_Elf32_Off e_shoff;
__ext_Elf32_Word e_flags;
__ext_Elf32_Half e_ehsize;
__ext_Elf32_Half e_phentsize;
__ext_Elf32_Half e_phnum;
__ext_Elf32_Half e_shentsize;
__ext_Elf32_Half e_shnum;
__ext_Elf32_Half e_shstrndx;
} __ext_Elf32_Ehdr;
 
#if __LIBELF64
typedef struct {
unsigned char e_ident[EI_NIDENT];
__ext_Elf64_Half e_type;
__ext_Elf64_Half e_machine;
__ext_Elf64_Word e_version;
__ext_Elf64_Addr e_entry;
__ext_Elf64_Off e_phoff;
__ext_Elf64_Off e_shoff;
__ext_Elf64_Word e_flags;
__ext_Elf64_Half e_ehsize;
__ext_Elf64_Half e_phentsize;
__ext_Elf64_Half e_phnum;
__ext_Elf64_Half e_shentsize;
__ext_Elf64_Half e_shnum;
__ext_Elf64_Half e_shstrndx;
} __ext_Elf64_Ehdr;
#endif /* __LIBELF64 */
 
/*
* Section header
*/
typedef struct {
__ext_Elf32_Word sh_name;
__ext_Elf32_Word sh_type;
__ext_Elf32_Word sh_flags;
__ext_Elf32_Addr sh_addr;
__ext_Elf32_Off sh_offset;
__ext_Elf32_Word sh_size;
__ext_Elf32_Word sh_link;
__ext_Elf32_Word sh_info;
__ext_Elf32_Word sh_addralign;
__ext_Elf32_Word sh_entsize;
} __ext_Elf32_Shdr;
 
#if __LIBELF64
typedef struct {
__ext_Elf64_Word sh_name;
__ext_Elf64_Word sh_type;
__ext_Elf64_Xword sh_flags;
__ext_Elf64_Addr sh_addr;
__ext_Elf64_Off sh_offset;
__ext_Elf64_Xword sh_size;
__ext_Elf64_Word sh_link;
__ext_Elf64_Word sh_info;
__ext_Elf64_Xword sh_addralign;
__ext_Elf64_Xword sh_entsize;
} __ext_Elf64_Shdr;
#endif /* __LIBELF64 */
 
/*
* Symbol table
*/
typedef struct {
__ext_Elf32_Word st_name;
__ext_Elf32_Addr st_value;
__ext_Elf32_Word st_size;
unsigned char st_info;
unsigned char st_other;
__ext_Elf32_Half st_shndx;
} __ext_Elf32_Sym;
 
#if __LIBELF64
typedef struct {
__ext_Elf64_Word st_name;
unsigned char st_info;
unsigned char st_other;
__ext_Elf64_Half st_shndx;
__ext_Elf64_Addr st_value;
__ext_Elf64_Xword st_size;
} __ext_Elf64_Sym;
#endif /* __LIBELF64 */
 
/*
* Relocation
*/
typedef struct {
__ext_Elf32_Addr r_offset;
__ext_Elf32_Word r_info;
} __ext_Elf32_Rel;
 
typedef struct {
__ext_Elf32_Addr r_offset;
__ext_Elf32_Word r_info;
__ext_Elf32_Sword r_addend;
} __ext_Elf32_Rela;
 
#if __LIBELF64
typedef struct {
__ext_Elf64_Addr r_offset;
#if __LIBELF64_IRIX
__ext_Elf64_Word r_sym;
unsigned char r_ssym;
unsigned char r_type3;
unsigned char r_type2;
unsigned char r_type;
#else /* __LIBELF64_IRIX */
__ext_Elf64_Xword r_info;
#endif /* __LIBELF64_IRIX */
} __ext_Elf64_Rel;
 
typedef struct {
__ext_Elf64_Addr r_offset;
#if __LIBELF64_IRIX
__ext_Elf64_Word r_sym;
unsigned char r_ssym;
unsigned char r_type3;
unsigned char r_type2;
unsigned char r_type;
#else /* __LIBELF64_IRIX */
__ext_Elf64_Xword r_info;
#endif /* __LIBELF64_IRIX */
__ext_Elf64_Sxword r_addend;
} __ext_Elf64_Rela;
#endif /* __LIBELF64 */
 
/*
* Program header
*/
typedef struct {
__ext_Elf32_Word p_type;
__ext_Elf32_Off p_offset;
__ext_Elf32_Addr p_vaddr;
__ext_Elf32_Addr p_paddr;
__ext_Elf32_Word p_filesz;
__ext_Elf32_Word p_memsz;
__ext_Elf32_Word p_flags;
__ext_Elf32_Word p_align;
} __ext_Elf32_Phdr;
 
#if __LIBELF64
typedef struct {
__ext_Elf64_Word p_type;
__ext_Elf64_Word p_flags;
__ext_Elf64_Off p_offset;
__ext_Elf64_Addr p_vaddr;
__ext_Elf64_Addr p_paddr;
__ext_Elf64_Xword p_filesz;
__ext_Elf64_Xword p_memsz;
__ext_Elf64_Xword p_align;
} __ext_Elf64_Phdr;
#endif /* __LIBELF64 */
 
/*
* Dynamic structure
*/
typedef struct {
__ext_Elf32_Sword d_tag;
union {
__ext_Elf32_Word d_val;
__ext_Elf32_Addr d_ptr;
} d_un;
} __ext_Elf32_Dyn;
 
#if __LIBELF64
typedef struct {
__ext_Elf64_Sxword d_tag;
union {
__ext_Elf64_Xword d_val;
__ext_Elf64_Addr d_ptr;
} d_un;
} __ext_Elf64_Dyn;
#endif /* __LIBELF64 */
 
#ifdef __cplusplus
}
#endif /* __cplusplus */
 
#endif /* _EXT_TYPES_H */
/contrib/media/updf/include/libelf/libelf.h
0,0 → 1,232
/*
libelf.h - public header file for libelf.
Copyright (C) 1995 - 1998 Michael Riepe <michael@stud.uni-hannover.de>
 
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
 
/* @(#) $Id: libelf.h,v 1.5 1998/06/01 19:47:18 michael Exp $ */
 
#ifndef _LIBELF_H
#define _LIBELF_H
 
#include <sys/types.h>
 
#if __LIBELF_INTERNAL__
#include <sys_elf.h>
#else /* __LIBELF_INTERNAL__ */
#include <libelf/sys_elf.h>
#endif /* __LIBELF_INTERNAL__ */
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
#ifndef __P
# if __STDC__ || defined(__cplusplus)
# define __P(args) args
# else /* __STDC__ || defined(__cplusplus) */
# define __P(args) ()
# endif /* __STDC__ || defined(__cplusplus) */
#endif /* __P */
 
/*
* Commands
*/
typedef enum {
ELF_C_NULL = 0, /* must be first, 0 */
ELF_C_READ,
ELF_C_WRITE,
ELF_C_CLR,
ELF_C_SET,
ELF_C_FDDONE,
ELF_C_FDREAD,
ELF_C_RDWR,
ELF_C_NUM /* must be last */
} Elf_Cmd;
 
/*
* Flags
*/
#define ELF_F_DIRTY 0x1
#define ELF_F_LAYOUT 0x4
 
/*
* File types
*/
typedef enum {
ELF_K_NONE = 0, /* must be first, 0 */
ELF_K_AR,
ELF_K_COFF,
ELF_K_ELF,
ELF_K_NUM /* must be last */
} Elf_Kind;
 
/*
* Data types
*/
typedef enum {
ELF_T_BYTE = 0, /* must be first, 0 */
ELF_T_ADDR,
ELF_T_DYN,
ELF_T_EHDR,
ELF_T_HALF,
ELF_T_OFF,
ELF_T_PHDR,
ELF_T_RELA,
ELF_T_REL,
ELF_T_SHDR,
ELF_T_SWORD,
ELF_T_SYM,
ELF_T_WORD,
/*
* New stuff for 64-bit.
*
* Most implementations add ELF_T_SXWORD after ELF_T_SWORD
* which breaks binary compatibility with earlier versions.
* If this causes problems for you, contact me.
*/
ELF_T_SXWORD,
ELF_T_XWORD,
ELF_T_NUM /* must be last */
} Elf_Type;
 
/*
* Elf descriptor
*/
typedef struct Elf Elf;
 
/*
* Section descriptor
*/
typedef struct Elf_Scn Elf_Scn;
 
/*
* Archive member header
*/
typedef struct {
char* ar_name;
time_t ar_date;
long ar_uid;
long ar_gid;
unsigned long ar_mode;
off_t ar_size;
char* ar_rawname;
} Elf_Arhdr;
 
/*
* Archive symbol table
*/
typedef struct {
char* as_name;
size_t as_off;
unsigned long as_hash;
} Elf_Arsym;
 
/*
* Data descriptor
*/
typedef struct {
void* d_buf;
Elf_Type d_type;
size_t d_size;
off_t d_off;
size_t d_align;
unsigned d_version;
} Elf_Data;
 
/*
* Function declarations
*/
extern Elf *elf_begin __P((int __fd, Elf_Cmd __cmd, Elf *__ref));
extern Elf *elf_memory __P((char *__image, size_t __size));
extern int elf_cntl __P((Elf *__elf, Elf_Cmd __cmd));
extern int elf_end __P((Elf *__elf));
extern const char *elf_errmsg __P((int __err));
extern int elf_errno __P((void));
extern void elf_fill __P((int __fill));
extern unsigned elf_flagdata __P((Elf_Data *__data, Elf_Cmd __cmd,
unsigned __flags));
extern unsigned elf_flagehdr __P((Elf *__elf, Elf_Cmd __cmd,
unsigned __flags));
extern unsigned elf_flagelf __P((Elf *__elf, Elf_Cmd __cmd,
unsigned __flags));
extern unsigned elf_flagphdr __P((Elf *__elf, Elf_Cmd __cmd,
unsigned __flags));
extern unsigned elf_flagscn __P((Elf_Scn *__scn, Elf_Cmd __cmd,
unsigned __flags));
extern unsigned elf_flagshdr __P((Elf_Scn *__scn, Elf_Cmd __cmd,
unsigned __flags));
extern size_t elf32_fsize __P((Elf_Type __type, size_t __count,
unsigned __ver));
extern Elf_Arhdr *elf_getarhdr __P((Elf *__elf));
extern Elf_Arsym *elf_getarsym __P((Elf *__elf, size_t *__ptr));
extern off_t elf_getbase __P((Elf *__elf));
extern Elf_Data *elf_getdata __P((Elf_Scn *__scn, Elf_Data *__data));
extern Elf32_Ehdr *elf32_getehdr __P((Elf *__elf));
extern char *elf_getident __P((Elf *__elf, size_t *__ptr));
extern Elf32_Phdr *elf32_getphdr __P((Elf *__elf));
extern Elf_Scn *elf_getscn __P((Elf *__elf, size_t __index));
extern Elf32_Shdr *elf32_getshdr __P((Elf_Scn *__scn));
extern unsigned long elf_hash __P((const char *__name));
extern Elf_Kind elf_kind __P((Elf *__elf));
extern size_t elf_ndxscn __P((Elf_Scn *__scn));
extern Elf_Data *elf_newdata __P((Elf_Scn *__scn));
extern Elf32_Ehdr *elf32_newehdr __P((Elf *__elf));
extern Elf32_Phdr *elf32_newphdr __P((Elf *__elf, size_t __count));
extern Elf_Scn *elf_newscn __P((Elf *__elf));
extern Elf_Cmd elf_next __P((Elf *__elf));
extern Elf_Scn *elf_nextscn __P((Elf *__elf, Elf_Scn *__scn));
extern size_t elf_rand __P((Elf *__elf, size_t __offset));
extern Elf_Data *elf_rawdata __P((Elf_Scn *__scn, Elf_Data *__data));
extern char *elf_rawfile __P((Elf *__elf, size_t *__ptr));
extern char *elf_strptr __P((Elf *__elf, size_t __section, size_t __offset));
extern off_t elf_update __P((Elf *__elf, Elf_Cmd __cmd));
extern unsigned elf_version __P((unsigned __ver));
extern Elf_Data *elf32_xlatetof __P((Elf_Data *__dst, const Elf_Data *__src,
unsigned __encode));
extern Elf_Data *elf32_xlatetom __P((Elf_Data *__dst, const Elf_Data *__src,
unsigned __encode));
 
#if __LIBELF64
/*
* 64-bit ELF functions
* Not available on all platforms
*/
extern Elf64_Ehdr *elf64_getehdr __P((Elf *__elf));
extern Elf64_Ehdr *elf64_newehdr __P((Elf *__elf));
extern Elf64_Phdr *elf64_getphdr __P((Elf *__elf));
extern Elf64_Phdr *elf64_newphdr __P((Elf *__elf, size_t __count));
extern Elf64_Shdr *elf64_getshdr __P((Elf_Scn *__scn));
extern size_t elf64_fsize __P((Elf_Type __type, size_t __count,
unsigned __ver));
extern Elf_Data *elf64_xlatetof __P((Elf_Data *__dst, const Elf_Data *__src,
unsigned __encode));
extern Elf_Data *elf64_xlatetom __P((Elf_Data *__dst, const Elf_Data *__src,
unsigned __encode));
#endif /* __LIBELF64 */
 
/*
* More function declarations
* These functions are NOT available
* in the SYSV version of libelf!
*/
extern size_t elf_delscn __P((Elf *__elf, Elf_Scn *__scn));
 
#ifdef __cplusplus
}
#endif /* __cplusplus */
 
#endif /* _LIBELF_H */
/contrib/media/updf/include/libelf/nlist.h
0,0 → 1,48
/*
nlist.h - public header file for nlist(3).
Copyright (C) 1995 - 1998 Michael Riepe <michael@stud.uni-hannover.de>
 
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
 
/* @(#) $Id: nlist.h,v 1.3 1998/06/01 19:47:24 michael Exp $ */
 
#ifndef _NLIST_H
#define _NLIST_H
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
struct nlist {
char* n_name;
long n_value;
short n_scnum;
unsigned short n_type;
char n_sclass;
char n_numaux;
};
 
#if __STDC__ || defined(__cplusplus)
extern int nlist(const char *__filename, struct nlist *__nl);
#else /* __STDC__ || defined(__cplusplus) */
extern int nlist();
#endif /* __STDC__ || defined(__cplusplus) */
 
#ifdef __cplusplus
}
#endif /* __cplusplus */
 
#endif /* _NLIST_H */
/contrib/media/updf/include/libelf/private.h
0,0 → 1,360
/*
private.h - private definitions for libelf.
Copyright (C) 1995 - 1998 Michael Riepe <michael@stud.uni-hannover.de>
 
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
 
/* @(#) $Id: private.h,v 1.10 1998/11/27 21:25:19 michael Exp $ */
 
#ifndef _PRIVATE_H
#define _PRIVATE_H
 
#define __LIBELF_INTERNAL__ 1
 
#if HAVE_CONFIG_H
# include <config.h>
#endif /* HAVE_CONFIG_H */
 
#include <sys/types.h>
 
#if STDC_HEADERS
# include <stdlib.h>
# include <string.h>
#else /* STDC_HEADERS */
extern char *malloc(), *realloc();
extern void free(), bcopy();
extern int strcmp(), strncmp(), memcmp();
extern void *memcpy(), *memmove(), *memset();
#endif /* STDC_HEADERS */
 
#if HAVE_UNISTD_H
# include <unistd.h>
#else /* HAVE_UNISTD_H */
extern int read(), write();
extern off_t lseek();
#endif /* HAVE_UNISTD_H */
 
#if !HAVE_MEMCMP
# define memcmp strncmp
#endif /* !HAVE_MEMCMP */
#if !HAVE_MEMCPY
# define memcpy(d,s,n) bcopy(s,d,n)
#endif /* !HAVE_MEMCPY */
#if !HAVE_MEMMOVE
# define memmove(d,s,n) bcopy(s,d,n)
#endif /* !HAVE_MEMMOVE */
 
#if !HAVE_MEMSET
# define memset _elf_memset
extern void *_elf_memset();
#endif /* !HAVE_MEMSET */
 
#if HAVE_STRUCT_NLIST_DECLARATION
# define nlist __override_nlist_declaration
#endif /* HAVE_STRUCT_NLIST_DECLARATION */
 
#if NEED_LINK_H
# include <link.h>
#endif /* NEED_LINK_H */
 
#include <libelf.h>
 
#if HAVE_STRUCT_NLIST_DECLARATION
# undef nlist
#endif /* HAVE_STRUCT_NLIST_DECLARATION */
 
typedef struct Scn_Data Scn_Data;
 
/*
* ELF descriptor
*/
struct Elf {
/* common */
size_t e_size; /* file/member size */
size_t e_dsize; /* size of memory image */
Elf_Kind e_kind; /* kind of file */
char* e_data; /* file/member data */
char* e_rawdata; /* file/member raw data */
size_t e_idlen; /* identifier size */
int e_fd; /* file descriptor */
unsigned e_count; /* activation count */
/* archive members (still common) */
Elf* e_parent; /* NULL if not an archive member */
size_t e_next; /* 0 if not an archive member */
size_t e_base; /* 0 if not an archive member */
Elf* e_link; /* next archive member or NULL */
Elf_Arhdr* e_arhdr; /* archive member header or NULL */
/* archives */
size_t e_off; /* current member offset (for elf_begin) */
Elf* e_members; /* linked list of active archive members */
char* e_symtab; /* archive symbol table */
size_t e_symlen; /* length of archive symbol table */
char* e_strtab; /* archive string table */
size_t e_strlen; /* length of archive string table */
/* ELF files */
unsigned e_class; /* ELF class */
unsigned e_encoding; /* ELF data encoding */
unsigned e_version; /* ELF version */
char* e_ehdr; /* ELF header */
char* e_phdr; /* ELF program header table */
size_t e_phnum; /* size of program header table */
Elf_Scn* e_scn_1; /* first section */
Elf_Scn* e_scn_n; /* last section */
unsigned e_elf_flags; /* elf flags (ELF_F_*) */
unsigned e_ehdr_flags; /* ehdr flags (ELF_F_*) */
unsigned e_phdr_flags; /* phdr flags (ELF_F_*) */
/* misc flags */
unsigned e_readable : 1; /* file is readable */
unsigned e_writable : 1; /* file is writable */
unsigned e_disabled : 1; /* e_fd has been disabled */
unsigned e_cooked : 1; /* e_data was modified */
unsigned e_free_syms : 1; /* e_symtab is malloc'ed */
unsigned e_free_ehdr : 1; /* e_ehdr is malloc'ed */
unsigned e_free_phdr : 1; /* e_phdr is malloc'ed */
unsigned e_unmap_data : 1; /* e_data is mmap'ed */
unsigned e_memory : 1; /* created by elf_memory() */
/* magic number for debugging */
long e_magic;
};
 
#define ELF_MAGIC 0x012b649e
 
#define INIT_ELF {\
/* e_size */ 0,\
/* e_dsize */ 0,\
/* e_kind */ ELF_K_NONE,\
/* e_data */ NULL,\
/* e_rawdata */ NULL,\
/* e_idlen */ 0,\
/* e_fd */ -1,\
/* e_count */ 1,\
/* e_parent */ NULL,\
/* e_next */ 0,\
/* e_base */ 0,\
/* e_link */ NULL,\
/* e_arhdr */ NULL,\
/* e_off */ 0,\
/* e_members */ NULL,\
/* e_symtab */ NULL,\
/* e_symlen */ 0,\
/* e_strtab */ NULL,\
/* e_strlen */ 0,\
/* e_class */ ELFCLASSNONE,\
/* e_encoding */ ELFDATANONE,\
/* e_version */ EV_NONE,\
/* e_ehdr */ NULL,\
/* e_phdr */ NULL,\
/* e_phnum */ 0,\
/* e_scn_1 */ NULL,\
/* e_scn_n */ NULL,\
/* e_elf_flags */ 0,\
/* e_ehdr_flags */ 0,\
/* e_phdr_flags */ 0,\
/* e_readable */ 0,\
/* e_writable */ 0,\
/* e_disabled */ 0,\
/* e_cooked */ 0,\
/* e_free_syms */ 0,\
/* e_free_ehdr */ 0,\
/* e_free_phdr */ 0,\
/* e_unmap_data */ 0,\
/* e_memory */ 0,\
/* e_magic */ ELF_MAGIC\
}
 
/*
* Section descriptor
*/
struct Elf_Scn {
Elf_Scn* s_link; /* pointer to next Elf_Scn */
Elf* s_elf; /* pointer to elf descriptor */
size_t s_index; /* number of this section */
unsigned s_scn_flags; /* section flags (ELF_F_*) */
unsigned s_shdr_flags; /* shdr flags (ELF_F_*) */
Scn_Data* s_data_1; /* first data buffer */
Scn_Data* s_data_n; /* last data buffer */
Scn_Data* s_rawdata; /* raw data buffer */
/* data copied from shdr */
unsigned s_type; /* section type */
size_t s_offset; /* section offset */
size_t s_size; /* section size */
/* misc flags */
unsigned s_freeme : 1; /* this Elf_Scn was malloc'ed */
/* section header */
union {
#if __LIBELF64
Elf64_Shdr u_shdr64;
#endif /* __LIBELF64 */
Elf32_Shdr u_shdr32;
} s_uhdr;
/* magic number for debugging */
long s_magic;
};
#define s_shdr32 s_uhdr.u_shdr32
#define s_shdr64 s_uhdr.u_shdr64
 
#define SCN_MAGIC 0x012c747d
 
#define INIT_SCN {\
/* s_link */ NULL,\
/* s_elf */ NULL,\
/* s_index */ 0,\
/* s_scn_flags */ 0,\
/* s_shdr_flags */ 0,\
/* s_data_1 */ NULL,\
/* s_data_n */ NULL,\
/* s_rawdata */ NULL,\
/* s_type */ SHT_NULL,\
/* s_offset */ 0,\
/* s_size */ 0,\
/* s_freeme */ 0,\
/* s_uhdr */ {{0,}},\
/* s_magic */ SCN_MAGIC\
}
 
/*
* Data descriptor
*/
struct Scn_Data {
Elf_Data sd_data; /* must be first! */
Scn_Data* sd_link; /* pointer to next Scn_Data */
char* sd_memdata; /* memory image of section */
unsigned sd_data_flags; /* data flags (ELF_F_*) */
/* misc flags */
unsigned sd_freeme : 1; /* this Scn_Data was malloc'ed */
unsigned sd_free_data : 1; /* sd_memdata is malloc'ed */
/* magic number for debugging */
long sd_magic;
};
 
#define DATA_MAGIC 0x01072639
 
#define INIT_DATA {\
{\
/* d_buf */ NULL,\
/* d_type */ ELF_T_BYTE,\
/* d_size */ 0,\
/* d_off */ 0,\
/* d_align */ 0,\
/* d_version */ EV_NONE\
},\
/* sd_link */ NULL,\
/* sd_memdata */ NULL,\
/* sd_data_flags */ 0,\
/* sd_freeme */ 0,\
/* sd_free_data */ 0,\
/* sd_magic */ DATA_MAGIC\
}
 
/*
* Private status variables
*/
extern unsigned _elf_version;
extern int _elf_errno;
extern int _elf_fill;
 
/*
* Private functions
*/
extern void *_elf_read __P((Elf*, void*, size_t, size_t));
extern void *_elf_mmap __P((Elf*));
extern int _elf_cook __P((Elf*));
extern char *_elf_getehdr __P((Elf*, unsigned));
extern Elf_Data *_elf_xlatetom(const Elf*, Elf_Data*, const Elf_Data*);
 
/*
* Private data
*/
extern const Elf_Scn _elf_scn_init;
extern const Scn_Data _elf_data_init;
extern const Elf_Type _elf_scn_types[SHT_NUM];
extern const size_t _elf_fmsize[2][EV_CURRENT - EV_NONE][ELF_T_NUM][2];
 
/*
* Access macros for _elf_fmsize[]
*/
#define _fmsize(c,v,t,w) \
(_elf_fmsize[(c)-ELFCLASS32][(v)-EV_NONE-1][(t)-ELF_T_BYTE][(w)])
#define _fsize(c,v,t) _fmsize((c),(v),(t),1)
#define _msize(c,v,t) _fmsize((c),(v),(t),0)
 
/*
* Various checks
*/
#define valid_class(c) ((c) >= ELFCLASS32 && (c) <= ELFCLASS64)
#define valid_encoding(e) ((e) >= ELFDATA2LSB && (e) <= ELFDATA2MSB)
#define valid_version(v) ((v) > EV_NONE && (v) <= EV_CURRENT)
#define valid_type(t) ((t) >= ELF_T_BYTE && (t) < ELF_T_NUM)
#define valid_scntype(s) ((s) >= SHT_NULL && (s) < SHT_NUM)
 
/*
* Error codes
*/
enum {
#define __err__(a,b) a,
#include <errors.h> /* include constants from errors.h */
#undef __err__
ERROR_NUM
};
 
#define seterr(err) (_elf_errno = (err))
 
/*
* Sizes of data types (external representation)
* These definitions should be in <elf.h>, but...
*/
#ifndef ELF32_FSZ_ADDR
# define ELF32_FSZ_ADDR 4
# define ELF32_FSZ_HALF 2
# define ELF32_FSZ_OFF 4
# define ELF32_FSZ_SWORD 4
# define ELF32_FSZ_WORD 4
#endif /* ELF32_FSZ_ADDR */
#ifndef ELF64_FSZ_ADDR
# define ELF64_FSZ_ADDR 8
# define ELF64_FSZ_HALF 2
# define ELF64_FSZ_OFF 8
# define ELF64_FSZ_SWORD 4
# define ELF64_FSZ_SXWORD 8
# define ELF64_FSZ_WORD 4
# define ELF64_FSZ_XWORD 8
#endif /* ELF64_FSZ_ADDR */
 
/*
* Alignment
*/
#define _ELF32_ALIGN_PHDR 4
#define _ELF32_ALIGN_SHDR 4
#define _ELF64_ALIGN_PHDR 8
#define _ELF64_ALIGN_SHDR 8
 
/*
* Debugging
*/
#if ENABLE_DEBUG
# include <stdio.h>
# if __STDC__
# define elf_assert(x) ((void)((x)||__elf_assert(__FILE__,__LINE__,#x)))
# else /* __STDC__ */
# define elf_assert(x) ((void)((x)||__elf_assert(__FILE__,__LINE__,"x")))
# endif /* __STDC__ */
# define __elf_assert(f,l,x) (fprintf(stderr,\
"%s:%u: libelf assertion failure: %s\n",(f),(l),(x)),abort(),0)
#else /* ENABLE_DEBUG */
# define elf_assert(x) ((void)0)
#endif /* ENABLE_DEBUG */
 
#endif /* _PRIVATE_H */
/contrib/media/updf/include/libelf/sys_elf.h
0,0 → 1,81
/* lib/sys_elf.h. Generated automatically by configure. */
/*
sys_elf.h.in - configure template for private "switch" file.
Copyright (C) 1998 Michael Riepe <michael@stud.uni-hannover.de>
 
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
 
/* @(#) $Id: sys_elf.h.in,v 1.3 1998/06/04 15:26:48 michael Exp $ */
 
/*
* DO NOT USE THIS IN APPLICATIONS - #include <libelf.h> INSTEAD!
*/
 
/* Define to `<elf.h>' or `<sys/elf.h>' if one of them is present */
#define __LIBELF_HEADER_ELF_H <elf.h>
 
/* Define if you want 64-bit support (and your system supports it) */
#define __LIBELF64 1
 
/* Define if you want 64-bit support, and are running IRIX */
/* #undef __LIBELF64_IRIX */
 
/* Define if you want 64-bit support, and are running Linux */
/* #undef __LIBELF64_LINUX */
 
/* Define to a 64-bit signed integer type if one exists */
#define __libelf_i64_t long long
 
/* Define to a 64-bit unsigned integer type if one exists */
#define __libelf_u64_t unsigned long long
 
/* Define to a 32-bit signed integer type if one exists */
#define __libelf_i32_t long
 
/* Define to a 32-bit unsigned integer type if one exists */
#define __libelf_u32_t unsigned long
 
/* Define to a 16-bit signed integer type if one exists */
#define __libelf_i16_t short
 
/* Define to a 16-bit unsigned integer type if one exists */
#define __libelf_u16_t unsigned short
 
/*
* Ok, now get the correct instance of elf.h...
*/
#ifdef __LIBELF_HEADER_ELF_H
# include __LIBELF_HEADER_ELF_H
#else /* __LIBELF_HEADER_ELF_H */
# if __LIBELF_INTERNAL__
# include <elf_repl.h>
# else /* __LIBELF_INTERNAL__ */
# include <libelf/elf_repl.h>
# endif /* __LIBELF_INTERNAL__ */
#endif /* __LIBELF_HEADER_ELF_H */
 
/*
* Workaround for broken <elf.h> on Linux...
*/
#if __LIBELF64 && __LIBELF64_LINUX
typedef __libelf_u64_t Elf64_Addr;
typedef __libelf_u16_t Elf64_Half;
typedef __libelf_u64_t Elf64_Off;
typedef __libelf_i32_t Elf64_Sword;
typedef __libelf_i64_t Elf64_Sxword;
typedef __libelf_u32_t Elf64_Word;
typedef __libelf_u64_t Elf64_Xword;
#endif /* __LIBELF64 && __LIBELF64_LINUX */
/contrib/media/updf/include/libiberty.h
0,0 → 1,262
/* Function declarations for libiberty.
 
Copyright 2001 Free Software Foundation, Inc.
Note - certain prototypes declared in this header file are for
functions whoes implementation copyright does not belong to the
FSF. Those prototypes are present in this file for reference
purposes only and their presence in this file should not construed
as an indication of ownership by the FSF of the implementation of
those functions in any way or form whatsoever.
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
 
This program 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 General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Written by Cygnus Support, 1994.
 
The libiberty library provides a number of functions which are
missing on some operating systems. We do not declare those here,
to avoid conflicts with the system header files on operating
systems that do support those functions. In this file we only
declare those functions which are specific to libiberty. */
 
#ifndef LIBIBERTY_H
#define LIBIBERTY_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include "ansidecl.h"
 
#ifdef ANSI_PROTOTYPES
/* Get a definition for size_t. */
#include <stddef.h>
/* Get a definition for va_list. */
#include <stdarg.h>
#endif
 
/* Build an argument vector from a string. Allocates memory using
malloc. Use freeargv to free the vector. */
 
extern char **buildargv PARAMS ((char *)) ATTRIBUTE_MALLOC;
 
/* Free a vector returned by buildargv. */
 
extern void freeargv PARAMS ((char **));
 
/* Duplicate an argument vector. Allocates memory using malloc. Use
freeargv to free the vector. */
 
extern char **dupargv PARAMS ((char **)) ATTRIBUTE_MALLOC;
 
 
/* Return the last component of a path name. Note that we can't use a
prototype here because the parameter is declared inconsistently
across different systems, sometimes as "char *" and sometimes as
"const char *" */
 
/* HAVE_DECL_* is a three-state macro: undefined, 0 or 1. If it is
undefined, we haven't run the autoconf check so provide the
declaration without arguments. If it is 0, we checked and failed
to find the declaration so provide a fully prototyped one. If it
is 1, we found it so don't provide any declaration at all. */
#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || (defined (HAVE_DECL_BASENAME) && !HAVE_DECL_BASENAME)
extern char *basename PARAMS ((const char *));
#else
# if !defined (HAVE_DECL_BASENAME)
extern char *basename ();
# endif
#endif
 
/* A well-defined basename () that is always compiled in. */
 
extern char *lbasename PARAMS ((const char *));
 
/* Concatenate an arbitrary number of strings, up to (char *) NULL.
Allocates memory using xmalloc. */
 
extern char *concat PARAMS ((const char *, ...)) ATTRIBUTE_MALLOC;
 
/* Check whether two file descriptors refer to the same file. */
 
extern int fdmatch PARAMS ((int fd1, int fd2));
 
/* Get the working directory. The result is cached, so don't call
chdir() between calls to getpwd(). */
 
extern char * getpwd PARAMS ((void));
 
/* Get the amount of time the process has run, in microseconds. */
 
extern long get_run_time PARAMS ((void));
 
/* Choose a temporary directory to use for scratch files. */
 
extern char *choose_temp_base PARAMS ((void)) ATTRIBUTE_MALLOC;
 
/* Return a temporary file name or NULL if unable to create one. */
 
extern char *make_temp_file PARAMS ((const char *)) ATTRIBUTE_MALLOC;
 
/* Allocate memory filled with spaces. Allocates using malloc. */
 
extern const char *spaces PARAMS ((int count));
 
/* Return the maximum error number for which strerror will return a
string. */
 
extern int errno_max PARAMS ((void));
 
/* Return the name of an errno value (e.g., strerrno (EINVAL) returns
"EINVAL"). */
 
extern const char *strerrno PARAMS ((int));
 
/* Given the name of an errno value, return the value. */
 
extern int strtoerrno PARAMS ((const char *));
 
/* ANSI's strerror(), but more robust. */
 
extern char *xstrerror PARAMS ((int));
 
/* Return the maximum signal number for which strsignal will return a
string. */
 
extern int signo_max PARAMS ((void));
 
/* Return a signal message string for a signal number
(e.g., strsignal (SIGHUP) returns something like "Hangup"). */
/* This is commented out as it can conflict with one in system headers.
We still document its existence though. */
 
/*extern const char *strsignal PARAMS ((int));*/
 
/* Return the name of a signal number (e.g., strsigno (SIGHUP) returns
"SIGHUP"). */
 
extern const char *strsigno PARAMS ((int));
 
/* Given the name of a signal, return its number. */
 
extern int strtosigno PARAMS ((const char *));
 
/* Register a function to be run by xexit. Returns 0 on success. */
 
extern int xatexit PARAMS ((void (*fn) (void)));
 
/* Exit, calling all the functions registered with xatexit. */
 
extern void xexit PARAMS ((int status)) ATTRIBUTE_NORETURN;
 
/* Set the program name used by xmalloc. */
 
extern void xmalloc_set_program_name PARAMS ((const char *));
 
/* Report an allocation failure. */
extern void xmalloc_failed PARAMS ((size_t)) ATTRIBUTE_NORETURN;
 
/* Allocate memory without fail. If malloc fails, this will print a
message to stderr (using the name set by xmalloc_set_program_name,
if any) and then call xexit. */
 
extern PTR xmalloc PARAMS ((size_t)) ATTRIBUTE_MALLOC;
 
/* Reallocate memory without fail. This works like xmalloc. Note,
realloc type functions are not suitable for attribute malloc since
they may return the same address across multiple calls. */
 
extern PTR xrealloc PARAMS ((PTR, size_t));
 
/* Allocate memory without fail and set it to zero. This works like
xmalloc. */
 
extern PTR xcalloc PARAMS ((size_t, size_t)) ATTRIBUTE_MALLOC;
 
/* Copy a string into a memory buffer without fail. */
 
extern char *xstrdup PARAMS ((const char *)) ATTRIBUTE_MALLOC;
 
/* Copy an existing memory buffer to a new memory buffer without fail. */
 
extern PTR xmemdup PARAMS ((const PTR, size_t, size_t)) ATTRIBUTE_MALLOC;
 
/* hex character manipulation routines */
 
#define _hex_array_size 256
#define _hex_bad 99
extern char _hex_value[_hex_array_size];
extern void hex_init PARAMS ((void));
#define hex_p(c) (hex_value (c) != _hex_bad)
/* If you change this, note well: Some code relies on side effects in
the argument being performed exactly once. */
#define hex_value(c) (_hex_value[(unsigned char) (c)])
 
/* Definitions used by the pexecute routine. */
 
#define PEXECUTE_FIRST 1
#define PEXECUTE_LAST 2
#define PEXECUTE_ONE (PEXECUTE_FIRST + PEXECUTE_LAST)
#define PEXECUTE_SEARCH 4
#define PEXECUTE_VERBOSE 8
 
/* Execute a program. */
 
extern int pexecute PARAMS ((const char *, char * const *, const char *,
const char *, char **, char **, int));
 
/* Wait for pexecute to finish. */
 
extern int pwait PARAMS ((int, int *, int));
 
/* Like sprintf but provides a pointer to malloc'd storage, which must
be freed by the caller. */
 
extern int asprintf PARAMS ((char **, const char *, ...)) ATTRIBUTE_PRINTF_2;
 
/* Like vsprintf but provides a pointer to malloc'd storage, which
must be freed by the caller. */
 
extern int vasprintf PARAMS ((char **, const char *, va_list))
ATTRIBUTE_PRINTF(2,0);
 
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
/* Drastically simplified alloca configurator. If we're using GCC,
we use __builtin_alloca; otherwise we use the C alloca. The C
alloca is always available. You can override GCC by defining
USE_C_ALLOCA yourself. The canonical autoconf macro C_ALLOCA is
also set/unset as it is often used to indicate whether code needs
to call alloca(0). */
extern PTR C_alloca PARAMS((size_t));
#undef alloca
#if GCC_VERSION >= 2000 && !defined USE_C_ALLOCA
# define alloca(x) __builtin_alloca(x)
# undef C_ALLOCA
#else
# define alloca(x) C_alloca(x)
# undef USE_C_ALLOCA
# define USE_C_ALLOCA 1
# undef C_ALLOCA
# define C_ALLOCA 1
#endif
 
#ifdef __cplusplus
}
#endif
 
 
#endif /* ! defined (LIBIBERTY_H) */
/contrib/media/updf/include/libintl.h
--- libm/math.h (nonexistent)
+++ libm/math.h (revision 4680)
@@ -0,0 +1,315 @@
+/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+/* Provided by Cygnus Support (jtc@cygnus.com) */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * from: @(#)fdlibm.h 5.1 93/09/24
+ * $Id: math.h,v 1.3 1999/07/04 14:37:08 eliz Exp $
+ */
+
+#ifndef _MATH_H_
+#define _MATH_H_
+
+/*
+ * ANSI/POSIX
+ */
+typedef int __int32_t;
+typedef unsigned int __uint32_t;
+
+union __dmath
+{
+ __uint32_t i[2];
+ double d;
+};
+
+extern const union __dmath __infinity;
+#define HUGE_VAL (__infinity.d)
+
+/*
+ * XOPEN/SVID
+ */
+#if !defined(__STRICT_ANSI__) && !defined(_POSIX_SOURCE)
+#define M_E 2.7182818284590452354 /* e */
+#define M_LOG2E 1.4426950408889634074 /* log 2e */
+#define M_LOG10E 0.43429448190325182765 /* log 10e */
+#define M_LN2 0.693147180559945309417 /* log e2 */
+#define M_LN10 2.30258509299404568402 /* log e10 */
+#define M_PI 3.14159265358979323846 /* pi */
+#define M_TWOPI 6.28318530717958647692 /* 2*pi */
+#define M_PI_2 1.57079632679489661923 /* pi/2 */
+#define M_PI_4 0.78539816339744830962 /* pi/4 */
+#define M_3PI_4 2.3561944901923448370 /* 3/4 * pi */
+#define M_SQRTPI 1.77245385090551602792981 /* sqrt(pi) */
+#define M_1_PI 0.31830988618379067154 /* 1/pi */
+#define M_2_PI 0.63661977236758134308 /* 2/pi */
+#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
+#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
+#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
+#define M_LN2LO 1.9082149292705877000E-10 /* lower bits of log e2 */
+#define M_LN2HI 6.9314718036912381649E-1 /* log e2 */
+#define M_SQRT3 1.73205080756887719000 /* sqrt(3) */
+#define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */
+#define M_LOG2_E 0.693147180559945309417
+#define M_INVLN2 1.4426950408889633870E0 /* 1 / log e2 */
+
+extern int signgam;
+
+enum __fdlibm_version
+{
+ __fdlibm_ieee = -1,
+ __fdlibm_svid,
+ __fdlibm_xopen,
+ __fdlibm_posix
+};
+
+#define _LIB_VERSION_TYPE enum __fdlibm_version
+#define _LIB_VERSION __fdlib_version
+
+/* if global variable _LIB_VERSION is not desirable, one may
+ * change the following to be a constant by:
+ * #define _LIB_VERSION_TYPE const enum version
+ * In that case, after one initializes the value _LIB_VERSION (see
+ * s_lib_version.c) during compile time, it cannot be modified
+ * in the middle of a program
+ */
+extern _LIB_VERSION_TYPE _LIB_VERSION;
+
+#define _IEEE_ __fdlibm_ieee
+#define _SVID_ __fdlibm_svid
+#define _XOPEN_ __fdlibm_xopen
+#define _POSIX_ __fdlibm_posix
+
+/* The exception structure passed to the matherr routine. */
+
+#ifndef __cplusplus
+struct exception
+{
+ int type;
+ const char *name;
+ double arg1;
+ double arg2;
+ double retval;
+ int err;
+};
+#endif
+
+/*
+ * set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
+ * (one may replace the following line by "#include <values.h>")
+ */
+
+#define X_TLOSS 1.41484755040568800000e+16
+
+#define DOMAIN 1
+#define SING 2
+#define OVERFLOW 3
+#define UNDERFLOW 4
+#define TLOSS 5
+#define PLOSS 6
+
+#endif /* !__STRICT_ANSI__ && !_POSIX_SOURCE */
+
+
+#include <sys/cdefs.h>
+__BEGIN_DECLS
+
+/*
+ * ANSI/POSIX
+ */
+extern double acos __P((double));
+extern double asin __P((double));
+extern double atan __P((double));
+extern double atan2 __P((double, double));
+extern double cos __P((double));
+extern double sin __P((double));
+extern double tan __P((double));
+
+extern double cosh __P((double));
+extern double sinh __P((double));
+extern double tanh __P((double));
+
+extern double exp __P((double));
+extern double frexp __P((double, int *));
+extern double ldexp __P((double, int));
+extern double log __P((double));
+extern double log10 __P((double));
+extern double modf __P((double, double *));
+
+extern double pow __P((double, double));
+extern double sqrt __P((double));
+
+extern double ceil __P((double));
+extern double fabs __P((double));
+extern double floor __P((double));
+extern double fmod __P((double, double));
+
+#if !defined(__STRICT_ANSI__) && !defined(_POSIX_SOURCE)
+extern double erf __P((double));
+extern double erfc __P((double));
+extern double gamma __P((double));
+extern double hypot __P((double, double));
+extern double infinity __P((void));
+extern int isinf __P((double));
+extern int isnan __P((double));
+extern int finite __P((double));
+extern double j0 __P((double));
+extern double j1 __P((double));
+extern double jn __P((int, double));
+extern double lgamma __P((double));
+extern double nan __P((void));
+extern double y0 __P((double));
+extern double y1 __P((double));
+extern double yn __P((int, double));
+extern double log2 __P((double));
+
+#if !defined(_XOPEN_SOURCE)
+extern double acosh __P((double));
+extern double asinh __P((double));
+extern double atanh __P((double));
+extern double cbrt __P((double));
+extern double exp10 __P((double));
+extern double exp2 __P((double));
+extern double log1p __P((double));
+extern double logb __P((double));
+extern long double modfl __P((long double, long double *));
+extern double nextafter __P((double, double));
+extern double pow10 __P((double));
+extern double pow2 __P((double));
+extern double powi __P((double, int));
+extern void sincos __P((double *, double *, double));
+extern double remainder __P((double, double));
+extern double scalb __P((double, double));
+
+#ifndef __cplusplus
+extern int matherr __P((struct exception *));
+#endif
+
+/*
+ * IEEE Test Vector
+ */
+extern double significand __P((double));
+
+/*
+ * Functions callable from C, intended to support IEEE arithmetic.
+ */
+extern double copysign __P((double, double));
+extern int ilogb __P((double));
+extern double rint __P((double));
+extern double scalbn __P((double, int));
+
+/*
+ * BSD math library entry points
+ */
+extern double drem __P((double, double));
+extern double expm1 __P((double));
+extern double log1p __P((double));
+
+/*
+ * Reentrant version of gamma & lgamma; passes signgam back by reference
+ * as the second argument; user must allocate space for signgam.
+ */
+extern double gamma_r __P((double, int *));
+extern double lgamma_r __P((double, int *));
+
+
+/* float versions of ANSI/POSIX functions */
+extern float acosf __P((float));
+extern float asinf __P((float));
+extern float atanf __P((float));
+extern float atan2f __P((float, float));
+extern float cosf __P((float));
+extern float sinf __P((float));
+extern float tanf __P((float));
+
+extern float coshf __P((float));
+extern float sinhf __P((float));
+extern float tanhf __P((float));
+
+extern float expf __P((float));
+extern float frexpf __P((float, int *));
+extern float ldexpf __P((float, int));
+extern float logf __P((float));
+extern float log10f __P((float));
+extern float modff __P((float, float *));
+
+extern float powf __P((float, float));
+extern float sqrtf __P((float));
+
+extern float ceilf __P((float));
+extern float fabsf __P((float));
+extern float floorf __P((float));
+extern float fmodf __P((float, float));
+
+extern float erff __P((float));
+extern float erfcf __P((float));
+extern float gammaf __P((float));
+extern float hypotf __P((float, float));
+extern float infinityf __P((void));
+extern int isinff __P((float));
+extern int isnanf __P((float));
+extern int finitef __P((float));
+extern float j0f __P((float));
+extern float j1f __P((float));
+extern float jnf __P((int, float));
+extern float lgammaf __P((float));
+extern float nanf __P((void));
+extern float y0f __P((float));
+extern float y1f __P((float));
+extern float ynf __P((int, float));
+#define log2f(x) (logf (x) / (float) M_LOG2_E)
+
+extern float acoshf __P((float));
+extern float asinhf __P((float));
+extern float atanhf __P((float));
+extern float cbrtf __P((float));
+extern float logbf __P((float));
+extern float nextafterf __P((float, float));
+extern float remainderf __P((float, float));
+extern float scalbf __P((float, float));
+
+/*
+ * float version of IEEE Test Vector
+ */
+extern float significandf __P((float));
+
+/*
+ * Float versions of functions callable from C, intended to support
+ * IEEE arithmetic.
+ */
+extern float copysignf __P((float, float));
+extern int ilogbf __P((float));
+extern float rintf __P((float));
+extern float scalbnf __P((float, int));
+
+/*
+ * float versions of BSD math library entry points
+ */
+extern float dremf __P((float, float));
+extern float expm1f __P((float));
+extern float log1pf __P((float));
+
+/*
+ * Float versions of reentrant version of gamma & lgamma; passes
+ * signgam back by reference as the second argument; user must
+ * allocate space for signgam.
+ */
+extern float gammaf_r __P((float, int *));
+extern float lgammaf_r __P((float, int *));
+
+#endif /* !_XOPEN_SOURCE */
+#endif /* !__STRICT_ANSI__ && !_POSIX_SOURCE */
+
+__END_DECLS
+
+#endif /* _MATH_H_ */
/contrib/media/updf/include/libmgfx.h
0,0 → 1,48
#ifndef __LIBMGFX_H
#define __LIBMGFX_H
 
#include<menuet/os.h>
#include<stdlib.h>
#include<stdio.h>
/* #include<string.h> */
 
typedef unsigned char byte;
 
typedef struct {
int width,height;
int bpp;
byte * the_image;
byte * pal;
struct mgfx_image_format * fmt;
} mgfx_image_t;
 
struct mgfx_image_format {
char * format_name;
char * fmt_ext;
int (* load_fn)(FILE * f,mgfx_image_t *);
struct mgfx_image_format * next;
};
 
void register_image_format(struct mgfx_image_format * fmt);
struct mgfx_image_format * get_image_format(char * fname);
 
#define _PIC_OK 0
#define _PICERR_NOFILE -1
#define _PICERR_NOMEM -2
#define _PICERR_BADMAGIC -3
#define _PICERR_NOCOLOURMAP -4
#define _PICERR_NOIMAGE -5
#define _PICERR_UNSUPPORTED -6
#define _PICERR_CORRUPT -7
#define _PICERR_SHOWN_ALREADY -8
#define _PICERR_ISRLE -9
 
int load_image(char * fname,mgfx_image_t ** the_img);
void free_image(mgfx_image_t * img);
void paint_image(int x,int y,mgfx_image_t * img);
 
void mgfx_register_jpeg(void);
 
void init_mgfx_library(void);
 
#endif
/contrib/media/updf/include/limits
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_LIMITS
#include <bits/std_limits.h>
#endif
/contrib/media/updf/include/limits.h
0,0 → 1,88
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_limits_h_
#define __dj_include_limits_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#define CHAR_BIT 8
#define CHAR_MAX 127
#define CHAR_MIN (-128)
#define INT_MAX 2147483647
#define INT_MIN (-2147483647-1)
#define LONG_MAX 2147483647L
#define LONG_MIN (-2147483647L-1L)
#define MB_LEN_MAX 5
#define SCHAR_MAX 127
#define SCHAR_MIN (-128)
#define SHRT_MAX 32767
#define SHRT_MIN (-32768)
#define UCHAR_MAX 255
#define UINT_MAX 4294967295U
#define ULONG_MAX 4294967295UL
#define USHRT_MAX 65535
#define WCHAR_MIN 0
#define WCHAR_MAX 127
//#define WINT_MIN 0
//#define WINT_MAX 32767
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#define _POSIX_ARG_MAX 16384 /* but only for exec's to other djgpp programs */
#define _POSIX_CHILD_MAX 7 /* limited by memory; 7 for 386MAX */
#define _POSIX_LINK_MAX 1 /* POSIX says 8, but DOS says 1 */
#define _POSIX_MAX_CANON 126 /* POSIX says 255, but DOS says 126 */
#define _POSIX_MAX_INPUT 126 /* POSIX says 255, but DOS says 126 */
#define _POSIX_NAME_MAX 12 /* 8.3 */
#define _POSIX_NGROUPS_MAX 0
#define _POSIX_OPEN_MAX 20 /* can be bigger in DOS, but defaults to 20 */
#define _POSIX_PATH_MAX 256 /* 80 for canonical paths */
#define _POSIX_PIPE_BUF 512 /* but there aren't any pipes */
#define _POSIX_SSIZE_MAX 2147483647
#define _POSIX_STREAM_MAX 20 /* can be bigger in DOS */
#define _POSIX_TZNAME_MAX 5
 
#define NGROUPS_MAX 0
 
#define ARG_MAX 4096
#define CHILD_MAX 6
/* #define OPEN_MAX 20 - DOS can change this */
/* #define STREAM_MAX 20 - DOS can change this */
#define TZNAME_MAX 3
 
#define LINK_MAX 1
#define MAX_CANON 126
#define MAX_INPUT 126
#define NAME_MAX 12 /* 8.3 */
#define PATH_MAX 512 /* for future expansion */
#define PIPE_BUF 512 /* but there aren't any pipes */
 
#define SSIZE_MAX 2147483647
 
#ifndef _POSIX_SOURCE
 
/* constants used in Solaris */
#define LLONG_MIN (-9223372036854775807LL-1LL)
#define LLONG_MAX 9223372036854775807LL
#define ULLONG_MAX 18446744073709551615ULL
/* gnuc ones */
#define LONG_LONG_MIN LLONG_MIN
#define LONG_LONG_MAX LLONG_MAX
#define ULONG_LONG_MAX ULLONG_MAX
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_limits_h_ */
/contrib/media/updf/include/linux/byteorder/big_endian.h
0,0 → 1,68
#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H
#define _LINUX_BYTEORDER_BIG_ENDIAN_H
 
#ifndef __BIG_ENDIAN
#define __BIG_ENDIAN 4321
#endif
#ifndef __BIG_ENDIAN_BITFIELD
#define __BIG_ENDIAN_BITFIELD
#endif
 
#include <linux/byteorder/swab.h>
 
#define __constant_htonl(x) ((__u32)(x))
#define __constant_ntohl(x) ((__u32)(x))
#define __constant_htons(x) ((__u16)(x))
#define __constant_ntohs(x) ((__u16)(x))
#define __constant_cpu_to_le64(x) ___constant_swab64((x))
#define __constant_le64_to_cpu(x) ___constant_swab64((x))
#define __constant_cpu_to_le32(x) ___constant_swab32((x))
#define __constant_le32_to_cpu(x) ___constant_swab32((x))
#define __constant_cpu_to_le16(x) ___constant_swab16((x))
#define __constant_le16_to_cpu(x) ___constant_swab16((x))
#define __constant_cpu_to_be64(x) ((__u64)(x))
#define __constant_be64_to_cpu(x) ((__u64)(x))
#define __constant_cpu_to_be32(x) ((__u32)(x))
#define __constant_be32_to_cpu(x) ((__u32)(x))
#define __constant_cpu_to_be16(x) ((__u16)(x))
#define __constant_be16_to_cpu(x) ((__u16)(x))
#define __cpu_to_le64(x) __swab64((x))
#define __le64_to_cpu(x) __swab64((x))
#define __cpu_to_le32(x) __swab32((x))
#define __le32_to_cpu(x) __swab32((x))
#define __cpu_to_le16(x) __swab16((x))
#define __le16_to_cpu(x) __swab16((x))
#define __cpu_to_be64(x) ((__u64)(x))
#define __be64_to_cpu(x) ((__u64)(x))
#define __cpu_to_be32(x) ((__u32)(x))
#define __be32_to_cpu(x) ((__u32)(x))
#define __cpu_to_be16(x) ((__u16)(x))
#define __be16_to_cpu(x) ((__u16)(x))
#define __cpu_to_le64p(x) __swab64p((x))
#define __le64_to_cpup(x) __swab64p((x))
#define __cpu_to_le32p(x) __swab32p((x))
#define __le32_to_cpup(x) __swab32p((x))
#define __cpu_to_le16p(x) __swab16p((x))
#define __le16_to_cpup(x) __swab16p((x))
#define __cpu_to_be64p(x) (*(__u64*)(x))
#define __be64_to_cpup(x) (*(__u64*)(x))
#define __cpu_to_be32p(x) (*(__u32*)(x))
#define __be32_to_cpup(x) (*(__u32*)(x))
#define __cpu_to_be16p(x) (*(__u16*)(x))
#define __be16_to_cpup(x) (*(__u16*)(x))
#define __cpu_to_le64s(x) __swab64s((x))
#define __le64_to_cpus(x) __swab64s((x))
#define __cpu_to_le32s(x) __swab32s((x))
#define __le32_to_cpus(x) __swab32s((x))
#define __cpu_to_le16s(x) __swab16s((x))
#define __le16_to_cpus(x) __swab16s((x))
#define __cpu_to_be64s(x) do {} while (0)
#define __be64_to_cpus(x) do {} while (0)
#define __cpu_to_be32s(x) do {} while (0)
#define __be32_to_cpus(x) do {} while (0)
#define __cpu_to_be16s(x) do {} while (0)
#define __be16_to_cpus(x) do {} while (0)
 
#include <linux/byteorder/generic.h>
 
#endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */
/contrib/media/updf/include/linux/byteorder/generic.h
0,0 → 1,180
#ifndef _LINUX_BYTEORDER_GENERIC_H
#define _LINUX_BYTEORDER_GENERIC_H
 
/*
* linux/byteorder_generic.h
* Generic Byte-reordering support
*
* Francois-Rene Rideau <fare@tunes.org> 19970707
* gathered all the good ideas from all asm-foo/byteorder.h into one file,
* cleaned them up.
* I hope it is compliant with non-GCC compilers.
* I decided to put __BYTEORDER_HAS_U64__ in byteorder.h,
* because I wasn't sure it would be ok to put it in types.h
* Upgraded it to 2.1.43
* Francois-Rene Rideau <fare@tunes.org> 19971012
* Upgraded it to 2.1.57
* to please Linus T., replaced huge #ifdef's between little/big endian
* by nestedly #include'd files.
* Francois-Rene Rideau <fare@tunes.org> 19971205
* Made it to 2.1.71; now a facelift:
* Put files under include/linux/byteorder/
* Split swab from generic support.
*
* TODO:
* = Regular kernel maintainers could also replace all these manual
* byteswap macros that remain, disseminated among drivers,
* after some grep or the sources...
* = Linus might want to rename all these macros and files to fit his taste,
* to fit his personal naming scheme.
* = it seems that a few drivers would also appreciate
* nybble swapping support...
* = every architecture could add their byteswap macro in asm/byteorder.h
* see how some architectures already do (i386, alpha, ppc, etc)
* = cpu_to_beXX and beXX_to_cpu might some day need to be well
* distinguished throughout the kernel. This is not the case currently,
* since little endian, big endian, and pdp endian machines needn't it.
* But this might be the case for, say, a port of Linux to 20/21 bit
* architectures (and F21 Linux addict around?).
*/
 
/*
* The following macros are to be defined by <asm/byteorder.h>:
*
* Conversion of long and short int between network and host format
* ntohl(__u32 x)
* ntohs(__u16 x)
* htonl(__u32 x)
* htons(__u16 x)
* It seems that some programs (which? where? or perhaps a standard? POSIX?)
* might like the above to be functions, not macros (why?).
* if that's true, then detect them, and take measures.
* Anyway, the measure is: define only ___ntohl as a macro instead,
* and in a separate file, have
* unsigned long inline ntohl(x){return ___ntohl(x);}
*
* The same for constant arguments
* __constant_ntohl(__u32 x)
* __constant_ntohs(__u16 x)
* __constant_htonl(__u32 x)
* __constant_htons(__u16 x)
*
* Conversion of XX-bit integers (16- 32- or 64-)
* between native CPU format and little/big endian format
* 64-bit stuff only defined for proper architectures
* cpu_to_[bl]eXX(__uXX x)
* [bl]eXX_to_cpu(__uXX x)
*
* The same, but takes a pointer to the value to convert
* cpu_to_[bl]eXXp(__uXX x)
* [bl]eXX_to_cpup(__uXX x)
*
* The same, but change in situ
* cpu_to_[bl]eXXs(__uXX x)
* [bl]eXX_to_cpus(__uXX x)
*
* See asm-foo/byteorder.h for examples of how to provide
* architecture-optimized versions
*
*/
 
 
#if defined(__KERNEL__)
/*
* inside the kernel, we can use nicknames;
* outside of it, we must avoid POSIX namespace pollution...
*/
#define cpu_to_le64 __cpu_to_le64
#define le64_to_cpu __le64_to_cpu
#define cpu_to_le32 __cpu_to_le32
#define le32_to_cpu __le32_to_cpu
#define cpu_to_le16 __cpu_to_le16
#define le16_to_cpu __le16_to_cpu
#define cpu_to_be64 __cpu_to_be64
#define be64_to_cpu __be64_to_cpu
#define cpu_to_be32 __cpu_to_be32
#define be32_to_cpu __be32_to_cpu
#define cpu_to_be16 __cpu_to_be16
#define be16_to_cpu __be16_to_cpu
#define cpu_to_le64p __cpu_to_le64p
#define le64_to_cpup __le64_to_cpup
#define cpu_to_le32p __cpu_to_le32p
#define le32_to_cpup __le32_to_cpup
#define cpu_to_le16p __cpu_to_le16p
#define le16_to_cpup __le16_to_cpup
#define cpu_to_be64p __cpu_to_be64p
#define be64_to_cpup __be64_to_cpup
#define cpu_to_be32p __cpu_to_be32p
#define be32_to_cpup __be32_to_cpup
#define cpu_to_be16p __cpu_to_be16p
#define be16_to_cpup __be16_to_cpup
#define cpu_to_le64s __cpu_to_le64s
#define le64_to_cpus __le64_to_cpus
#define cpu_to_le32s __cpu_to_le32s
#define le32_to_cpus __le32_to_cpus
#define cpu_to_le16s __cpu_to_le16s
#define le16_to_cpus __le16_to_cpus
#define cpu_to_be64s __cpu_to_be64s
#define be64_to_cpus __be64_to_cpus
#define cpu_to_be32s __cpu_to_be32s
#define be32_to_cpus __be32_to_cpus
#define cpu_to_be16s __cpu_to_be16s
#define be16_to_cpus __be16_to_cpus
#endif
 
 
/*
* Handle ntohl and suches. These have various compatibility
* issues - like we want to give the prototype even though we
* also have a macro for them in case some strange program
* wants to take the address of the thing or something..
*
* Note that these used to return a "long" in libc5, even though
* long is often 64-bit these days.. Thus the casts.
*
* They have to be macros in order to do the constant folding
* correctly - if the argument passed into a inline function
* it is no longer constant according to gcc..
*/
 
#undef ntohl
#undef ntohs
#undef htonl
#undef htons
 
/*
* Do the prototypes. Somebody might want to take the
* address or some such sick thing..
*/
#if defined(__KERNEL__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
extern __u32 ntohl(__u32);
extern __u32 htonl(__u32);
#else
extern unsigned long int ntohl(unsigned long int);
extern unsigned long int htonl(unsigned long int);
#endif
extern unsigned short int ntohs(unsigned short int);
extern unsigned short int htons(unsigned short int);
 
 
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
 
#define ___htonl(x) __cpu_to_be32(x)
#define ___htons(x) __cpu_to_be16(x)
#define ___ntohl(x) __be32_to_cpu(x)
#define ___ntohs(x) __be16_to_cpu(x)
 
#if defined(__KERNEL__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
#define htonl(x) ___htonl(x)
#define ntohl(x) ___ntohl(x)
#else
#define htonl(x) ((unsigned long)___htonl(x))
#define ntohl(x) ((unsigned long)___ntohl(x))
#endif
#define htons(x) ___htons(x)
#define ntohs(x) ___ntohs(x)
 
#endif /* OPTIMIZE */
 
 
#endif /* _LINUX_BYTEORDER_GENERIC_H */
/contrib/media/updf/include/linux/byteorder/little_endian.h
0,0 → 1,68
#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H
#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
 
#ifndef __LITTLE_ENDIAN
#define __LITTLE_ENDIAN 1234
#endif
#ifndef __LITTLE_ENDIAN_BITFIELD
#define __LITTLE_ENDIAN_BITFIELD
#endif
 
#include <linux/byteorder/swab.h>
 
#define __constant_htonl(x) ___constant_swab32((x))
#define __constant_ntohl(x) ___constant_swab32((x))
#define __constant_htons(x) ___constant_swab16((x))
#define __constant_ntohs(x) ___constant_swab16((x))
#define __constant_cpu_to_le64(x) ((__u64)(x))
#define __constant_le64_to_cpu(x) ((__u64)(x))
#define __constant_cpu_to_le32(x) ((__u32)(x))
#define __constant_le32_to_cpu(x) ((__u32)(x))
#define __constant_cpu_to_le16(x) ((__u16)(x))
#define __constant_le16_to_cpu(x) ((__u16)(x))
#define __constant_cpu_to_be64(x) ___constant_swab64((x))
#define __constant_be64_to_cpu(x) ___constant_swab64((x))
#define __constant_cpu_to_be32(x) ___constant_swab32((x))
#define __constant_be32_to_cpu(x) ___constant_swab32((x))
#define __constant_cpu_to_be16(x) ___constant_swab16((x))
#define __constant_be16_to_cpu(x) ___constant_swab16((x))
#define __cpu_to_le64(x) ((__u64)(x))
#define __le64_to_cpu(x) ((__u64)(x))
#define __cpu_to_le32(x) ((__u32)(x))
#define __le32_to_cpu(x) ((__u32)(x))
#define __cpu_to_le16(x) ((__u16)(x))
#define __le16_to_cpu(x) ((__u16)(x))
#define __cpu_to_be64(x) __swab64((x))
#define __be64_to_cpu(x) __swab64((x))
#define __cpu_to_be32(x) __swab32((x))
#define __be32_to_cpu(x) __swab32((x))
#define __cpu_to_be16(x) __swab16((x))
#define __be16_to_cpu(x) __swab16((x))
#define __cpu_to_le64p(x) (*(__u64*)(x))
#define __le64_to_cpup(x) (*(__u64*)(x))
#define __cpu_to_le32p(x) (*(__u32*)(x))
#define __le32_to_cpup(x) (*(__u32*)(x))
#define __cpu_to_le16p(x) (*(__u16*)(x))
#define __le16_to_cpup(x) (*(__u16*)(x))
#define __cpu_to_be64p(x) __swab64p((x))
#define __be64_to_cpup(x) __swab64p((x))
#define __cpu_to_be32p(x) __swab32p((x))
#define __be32_to_cpup(x) __swab32p((x))
#define __cpu_to_be16p(x) __swab16p((x))
#define __be16_to_cpup(x) __swab16p((x))
#define __cpu_to_le64s(x) do {} while (0)
#define __le64_to_cpus(x) do {} while (0)
#define __cpu_to_le32s(x) do {} while (0)
#define __le32_to_cpus(x) do {} while (0)
#define __cpu_to_le16s(x) do {} while (0)
#define __le16_to_cpus(x) do {} while (0)
#define __cpu_to_be64s(x) __swab64s((x))
#define __be64_to_cpus(x) __swab64s((x))
#define __cpu_to_be32s(x) __swab32s((x))
#define __be32_to_cpus(x) __swab32s((x))
#define __cpu_to_be16s(x) __swab16s((x))
#define __be16_to_cpus(x) __swab16s((x))
 
#include <linux/byteorder/generic.h>
 
#endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */
/contrib/media/updf/include/linux/byteorder/pdp_endian.h
0,0 → 1,88
#ifndef _LINUX_BYTEORDER_PDP_ENDIAN_H
#define _LINUX_BYTEORDER_PDP_ENDIAN_H
 
/*
* Could have been named NUXI-endian, but we use the same name as in glibc.
* hopefully only the PDP and its evolutions (old VAXen in compatibility mode)
* should ever use this braindead byteorder.
* This file *should* work, but has not been tested.
*
* little-endian is 1234; big-endian is 4321; nuxi/pdp-endian is 3412
*
* I thought vaxen were NUXI-endian, but was told they were correct-endian
* (little-endian), though indeed there existed NUXI-endian machines
* (DEC PDP-11 and old VAXen in compatibility mode).
* This makes this file a bit useless, but as a proof-of-concept.
*
* But what does a __u64 look like: is it 34127856 or 78563412 ???
* I don't dare imagine! Hence, no 64-bit byteorder support yet.
* Hopefully, there 64-bit pdp-endian support shouldn't ever be required.
*
*/
 
#ifndef __PDP_ENDIAN
#define __PDP_ENDIAN 3412
#endif
#ifndef __PDP_ENDIAN_BITFIELD
#define __PDP_ENDIAN_BITFIELD
#endif
 
#include <linux/byteorder/swab.h>
#include <linux/byteorder/swabb.h>
 
#define __constant_htonl(x) ___constant_swahb32((x))
#define __constant_ntohl(x) ___constant_swahb32((x))
#define __constant_htons(x) ___constant_swab16((x))
#define __constant_ntohs(x) ___constant_swab16((x))
#define __constant_cpu_to_le64(x) I DON'T KNOW
#define __constant_le64_to_cpu(x) I DON'T KNOW
#define __constant_cpu_to_le32(x) ___constant_swahw32((x))
#define __constant_le32_to_cpu(x) ___constant_swahw32((x))
#define __constant_cpu_to_le16(x) ((__u16)(x)
#define __constant_le16_to_cpu(x) ((__u16)(x)
#define __constant_cpu_to_be64(x) I DON'T KNOW
#define __constant_be64_to_cpu(x) I DON'T KNOW
#define __constant_cpu_to_be32(x) ___constant_swahb32((x))
#define __constant_be32_to_cpu(x) ___constant_swahb32((x))
#define __constant_cpu_to_be16(x) ___constant_swab16((x))
#define __constant_be16_to_cpu(x) ___constant_swab16((x))
#define __cpu_to_le64(x) I DON'T KNOW
#define __le64_to_cpu(x) I DON'T KNOW
#define __cpu_to_le32(x) ___swahw32((x))
#define __le32_to_cpu(x) ___swahw32((x))
#define __cpu_to_le16(x) ((__u16)(x)
#define __le16_to_cpu(x) ((__u16)(x)
#define __cpu_to_be64(x) I DON'T KNOW
#define __be64_to_cpu(x) I DON'T KNOW
#define __cpu_to_be32(x) __swahb32((x))
#define __be32_to_cpu(x) __swahb32((x))
#define __cpu_to_be16(x) __swab16((x))
#define __be16_to_cpu(x) __swab16((x))
#define __cpu_to_le64p(x) I DON'T KNOW
#define __le64_to_cpup(x) I DON'T KNOW
#define __cpu_to_le32p(x) ___swahw32p((x))
#define __le32_to_cpup(x) ___swahw32p((x))
#define __cpu_to_le16p(x) (*(__u16*)(x))
#define __le16_to_cpup(x) (*(__u16*)(x))
#define __cpu_to_be64p(x) I DON'T KNOW
#define __be64_to_cpup(x) I DON'T KNOW
#define __cpu_to_be32p(x) __swahb32p((x))
#define __be32_to_cpup(x) __swahb32p((x))
#define __cpu_to_be16p(x) __swab16p((x))
#define __be16_to_cpup(x) __swab16p((x))
#define __cpu_to_le64s(x) I DON'T KNOW
#define __le64_to_cpus(x) I DON'T KNOW
#define __cpu_to_le32s(x) ___swahw32s((x))
#define __le32_to_cpus(x) ___swahw32s((x))
#define __cpu_to_le16s(x) do {} while (0)
#define __le16_to_cpus(x) do {} while (0)
#define __cpu_to_be64s(x) I DON'T KNOW
#define __be64_to_cpus(x) I DON'T KNOW
#define __cpu_to_be32s(x) __swahb32s((x))
#define __be32_to_cpus(x) __swahb32s((x))
#define __cpu_to_be16s(x) __swab16s((x))
#define __be16_to_cpus(x) __swab16s((x))
 
#include <linux/byteorder/generic.h>
 
#endif /* _LINUX_BYTEORDER_PDP_ENDIAN_H */
/contrib/media/updf/include/linux/byteorder/swab.h
0,0 → 1,190
#ifndef _LINUX_BYTEORDER_SWAB_H
#define _LINUX_BYTEORDER_SWAB_H
 
/*
* linux/byteorder/swab.h
* Byte-swapping, independently from CPU endianness
* swabXX[ps]?(foo)
*
* Francois-Rene Rideau <fare@tunes.org> 19971205
* separated swab functions from cpu_to_XX,
* to clean up support for bizarre-endian architectures.
*
* See asm-i386/byteorder.h and suches for examples of how to provide
* architecture-dependent optimized versions
*
*/
 
/* casts are necessary for constants, because we never know how for sure
* how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
*/
#define ___swab16(x) \
({ \
__u16 __x = (x); \
((__u16)( \
(((__u16)(__x) & (__u16)0x00ffU) << 8) | \
(((__u16)(__x) & (__u16)0xff00U) >> 8) )); \
})
 
#define ___swab32(x) \
({ \
__u32 __x = (x); \
((__u32)( \
(((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \
(((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | \
(((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | \
(((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \
})
 
#define ___swab64(x) \
({ \
__u64 __x = (x); \
((__u64)( \
(__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
(__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
(__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
(__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | \
(__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | \
(__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
(__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
(__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
})
 
#define ___constant_swab16(x) \
((__u16)( \
(((__u16)(x) & (__u16)0x00ffU) << 8) | \
(((__u16)(x) & (__u16)0xff00U) >> 8) ))
#define ___constant_swab32(x) \
((__u32)( \
(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
(((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
#define ___constant_swab64(x) \
((__u64)( \
(__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
(__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
(__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
(__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
(__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
(__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
(__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
(__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
 
/*
* provide defaults when no architecture-specific optimization is detected
*/
#ifndef __arch__swab16
# define __arch__swab16(x) ({ __u16 __tmp = (x) ; ___swab16(__tmp); })
#endif
#ifndef __arch__swab32
# define __arch__swab32(x) ({ __u32 __tmp = (x) ; ___swab32(__tmp); })
#endif
#ifndef __arch__swab64
# define __arch__swab64(x) ({ __u64 __tmp = (x) ; ___swab64(__tmp); })
#endif
 
#ifndef __arch__swab16p
# define __arch__swab16p(x) __arch__swab16(*(x))
#endif
#ifndef __arch__swab32p
# define __arch__swab32p(x) __arch__swab32(*(x))
#endif
#ifndef __arch__swab64p
# define __arch__swab64p(x) __arch__swab64(*(x))
#endif
 
#ifndef __arch__swab16s
# define __arch__swab16s(x) do { *(x) = __arch__swab16p((x)); } while (0)
#endif
#ifndef __arch__swab32s
# define __arch__swab32s(x) do { *(x) = __arch__swab32p((x)); } while (0)
#endif
#ifndef __arch__swab64s
# define __arch__swab64s(x) do { *(x) = __arch__swab64p((x)); } while (0)
#endif
 
 
/*
* Allow constant folding
*/
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
# define __swab16(x) \
(__builtin_constant_p((__u16)(x)) ? \
___swab16((x)) : \
__fswab16((x)))
# define __swab32(x) \
(__builtin_constant_p((__u32)(x)) ? \
___swab32((x)) : \
__fswab32((x)))
# define __swab64(x) \
(__builtin_constant_p((__u64)(x)) ? \
___swab64((x)) : \
__fswab64((x)))
#else
# define __swab16(x) __fswab16(x)
# define __swab32(x) __fswab32(x)
# define __swab64(x) __fswab64(x)
#endif /* OPTIMIZE */
 
 
static __inline__ __const__ __u16 __fswab16(__u16 x)
{
return __arch__swab16(x);
}
static __inline__ __u16 __swab16p(__u16 *x)
{
return __arch__swab16p(x);
}
static __inline__ void __swab16s(__u16 *addr)
{
__arch__swab16s(addr);
}
 
static __inline__ __const__ __u32 __fswab32(__u32 x)
{
return __arch__swab32(x);
}
static __inline__ __u32 __swab32p(__u32 *x)
{
return __arch__swab32p(x);
}
static __inline__ void __swab32s(__u32 *addr)
{
__arch__swab32s(addr);
}
 
#ifdef __BYTEORDER_HAS_U64__
static __inline__ const __u64 __fswab64(__u64 x)
{
# ifdef __SWAB_64_THRU_32__
__u32 h = x >> 32;
__u32 l = x & ((1ULL<<32)-1);
return (((__u64)__swab32(l)) << 32) | ((__u64)(__swab32(h)));
# else
return __arch__swab64(x);
# endif
}
static __inline__ __u64 __swab64p(__u64 *x)
{
return __arch__swab64p(x);
}
static __inline__ void __swab64s(__u64 *addr)
{
__arch__swab64s(addr);
}
#endif /* __BYTEORDER_HAS_U64__ */
 
#if defined(__KERNEL__)
#define swab16 __swab16
#define swab32 __swab32
#define swab64 __swab64
#define swab16p __swab16p
#define swab32p __swab32p
#define swab64p __swab64p
#define swab16s __swab16s
#define swab32s __swab32s
#define swab64s __swab64s
#endif
 
#endif /* _LINUX_BYTEORDER_SWAB_H */
/contrib/media/updf/include/linux/byteorder/swabb.h
0,0 → 1,137
#ifndef _LINUX_BYTEORDER_SWABB_H
#define _LINUX_BYTEORDER_SWABB_H
 
/*
* linux/byteorder/swabb.h
* SWAp Bytes Bizarrely
* swaHHXX[ps]?(foo)
*
* Support for obNUXIous pdp-endian and other bizarre architectures.
* Will Linux ever run on such ancient beasts? if not, this file
* will be but a programming pearl. Still, it's a reminder that we
* shouldn't be making too many assumptions when trying to be portable.
*
*/
 
/*
* Meaning of the names I chose (vaxlinux people feel free to correct them):
* swahw32 swap 16-bit half-words in a 32-bit word
* swahb32 swap 8-bit halves of each 16-bit half-word in a 32-bit word
*
* No 64-bit support yet. I don't know NUXI conventions for long longs.
* I guarantee it will be a mess when it's there, though :->
* It will be even worse if there are conflicting 64-bit conventions.
* Hopefully, no one ever used 64-bit objects on NUXI machines.
*
*/
 
#define ___swahw32(x) \
({ \
__u32 __x = (x); \
((__u32)( \
(((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | \
(((__u32)(__x) & (__u32)0xffff0000UL) >> 16) )); \
})
#define ___swahb32(x) \
({ \
__u32 __x = (x); \
((__u32)( \
(((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | \
(((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) )); \
})
 
#define ___constant_swahw32(x) \
((__u32)( \
(((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \
(((__u32)(x) & (__u32)0xffff0000UL) >> 16) ))
#define ___constant_swahb32(x) \
((__u32)( \
(((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
(((__u32)(x) & (__u32)0xff00ff00UL) >> 8) ))
 
/*
* provide defaults when no architecture-specific optimization is detected
*/
#ifndef __arch__swahw32
# define __arch__swahw32(x) ___swahw32(x)
#endif
#ifndef __arch__swahb32
# define __arch__swahb32(x) ___swahb32(x)
#endif
 
#ifndef __arch__swahw32p
# define __arch__swahw32p(x) __swahw32(*(x))
#endif
#ifndef __arch__swahb32p
# define __arch__swahb32p(x) __swahb32(*(x))
#endif
 
#ifndef __arch__swahw32s
# define __arch__swahw32s(x) do { *(x) = __swahw32p((x)); } while (0)
#endif
#ifndef __arch__swahb32s
# define __arch__swahb32s(x) do { *(x) = __swahb32p((x)); } while (0)
#endif
 
 
/*
* Allow constant folding
*/
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
# define __swahw32(x) \
(__builtin_constant_p((__u32)(x)) ? \
___swahw32((x)) : \
__fswahw32((x)))
# define __swahb32(x) \
(__builtin_constant_p((__u32)(x)) ? \
___swahb32((x)) : \
__fswahb32((x)))
#else
# define __swahw32(x) __fswahw32(x)
# define __swahb32(x) __fswahb32(x)
#endif /* OPTIMIZE */
 
 
static __inline__ __const__ __u32 __fswahw32(__u32 x)
{
return __arch__swahw32(x);
}
static __inline__ __u32 __swahw32p(__u32 *x)
{
return __arch__swahw32p(x);
}
static __inline__ void __swahw32s(__u32 *addr)
{
__arch__swahw32s(addr);
}
 
 
static __inline__ __const__ __u32 __fswahb32(__u32 x)
{
return __arch__swahb32(x);
}
static __inline__ __u32 __swahb32p(__u32 *x)
{
return __arch__swahb32p(x);
}
static __inline__ void __swahb32s(__u32 *addr)
{
__arch__swahb32s(addr);
}
 
#ifdef __BYTEORDER_HAS_U64__
/*
* Not supported yet
*/
#endif /* __BYTEORDER_HAS_U64__ */
 
#if defined(__KERNEL__)
#define swahw32 __swahw32
#define swahb32 __swahb32
#define swahw32p __swahw32p
#define swahb32p __swahb32p
#define swahw32s __swahw32s
#define swahb32s __swahb32s
#endif
 
#endif /* _LINUX_BYTEORDER_SWABB_H */
/contrib/media/updf/include/lispassert.h
0,0 → 1,16
 
#ifndef __lispassert_h__
#define __lispassert_h__
 
 
#include "choices.h"
 
#ifdef USE_ASSERT
#include <assert.h>
#define LISPASSERT(x) assert(x)
#else
#define LISPASSERT(x)
#endif
 
#endif
 
/contrib/media/updf/include/lispatom.h
0,0 → 1,135
/** \file lispatom.h
* implementation of the standard lisp elements: atom and sublist.
*
* class LispAtom. This class implements one atom, which is a
* reference to a string it represents, and a pointer to the next
* lisp atom if it is in a list.
* It also has a pointer to the annotation object.
* The local class LispPtr implements automatic garbage collection
* through reference counting.
*
* The class LispNumber inherits from LispAtom and holds a numeric atom
* in the string representation and in the numeric representation (BigNumber).
* The string representation is converted to BigNumber (using the current precision for floats) when a numeric
* operation is first requested on the atom. The BigNumber representation is
* converted to the string representation whenever the number needs to be printed i.e. LispAtom::String() method is requested.
* The string is held in the number (to avoid repeated conversions) and also cached in the string cache (this caching will eventually be abandoned).
* When LispNumber is constructed from BigNumber, no string representation is available.
* Conversion from string to BigNumber is done only if no BigNumber object is present.
*/
 
#ifndef __lispatom_h__
#define __lispatom_h__
 
#include "yacasbase.h"
#include "lispobject.h"
#include "lispstring.h"
#include "numbers.h" // RefPtr<BigNumber> needs definition of BigNumber
 
/// This should be used whenever constants 2, 10 mean binary and decimal.
// maybe move somewhere else?
#define BASE10 10
#define BASE2 2
 
// Flags used for atom types. These are not strictly necessary, but
// do speed up certain evaluations by avoiding a lot of overhead.
#define KFlagIsNumeric 0x01 // Quoted (after executing the args for
// a LispLambda, or for a LispSetQuoted)
 
class LispEnvironment;
 
class LispAtom : public ObjectHelper<LispAtom>
{
public:
static LispObject* New(LispEnvironment& aEnvironment, const LispChar * aString);
virtual ~LispAtom();
virtual LispString * String();
virtual LispObject* Copy() { return NEW LispAtom(*this); }
private:
LispAtom(LispString * aString);
LispAtom& operator=(const LispAtom& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
public:
LispAtom(const LispAtom& other);
private:
LispString * iString;
};
 
//------------------------------------------------------------------------------
// LispSublist
 
class LispSubList : public ObjectHelper<LispSubList>
{
public:
static LispSubList* New(LispObject* aSubList);
virtual ~LispSubList();
virtual LispPtr* SubList() { return &iSubList; }
virtual LispObject* Copy() { return NEW LispSubList(*this); }
private:
// Constructor is private -- use New() instead
LispSubList(LispObject* aSubList) : iSubList(aSubList) {} // iSubList's constructor is messed up (it's a LispPtr, duh)
public:
LispSubList(const LispSubList& other) : ASuper(other), iSubList(other.iSubList) {}
private:
LispPtr iSubList;
};
 
 
//------------------------------------------------------------------------------
// LispGenericClass
 
class LispGenericClass : public ObjectHelper<LispGenericClass>
{
public:
static LispGenericClass* New(GenericClass* aClass);
virtual ~LispGenericClass();
virtual GenericClass* Generic();
virtual LispObject* Copy() { return NEW LispGenericClass(*this); }
private:
// Constructor is private -- use New() instead
LispGenericClass(GenericClass* aClass);
public:
LispGenericClass(const LispGenericClass& other) : ASuper(other), iClass(other.iClass) { iClass->iReferenceCount++; }
private:
LispGenericClass& operator=(const LispGenericClass& other)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
private:
GenericClass* iClass;
};
 
class LispHashTable;
class LispNumber : public ObjectHelper<LispNumber>
{
public:
/// constructors:
/// construct from another LispNumber
LispNumber(BigNumber* aNumber, LispString * aString = NULL) : iNumber(aNumber), iString(aString) {}
LispNumber(const LispNumber& other) : ASuper(other), iNumber(other.iNumber), iString(other.iString) {}
/// construct from a decimal string representation (also create a number object) and use aBasePrecision decimal digits
LispNumber(LispString * aString, LispInt aBasePrecision) : iNumber(NULL), iString(aString) { Number(aBasePrecision); }
 
virtual ~LispNumber() {}
virtual LispObject* Copy() { return NEW LispNumber(*this); }
/// return a string representation in decimal with maximum decimal precision allowed by the inherent accuracy of the number
virtual LispString * String();
/// give access to the BigNumber object; if necessary, will create a BigNumber object out of the stored string, at given precision (in decimal?)
virtual BigNumber* Number(LispInt aPrecision);
private:
/// number object; NULL if not yet converted from string
RefPtr<BigNumber> iNumber;
/// string representation in decimal; NULL if not yet converted from BigNumber
RefPtr<LispString> iString;
};
 
 
#endif
 
 
/contrib/media/updf/include/lispcleanupstack.h
0,0 → 1,76
 
/** \file lispcleanupstack.h
* Implementation of a cleanup stack for exception handling on platforms
* that don't clean up the stack automatically after an exception
* occurs. The macro's SAFEPUSH and SAFEPOP as defined in
* plat/<plat>/lisptype.h define which cleanup handler
* to use, so it can be configured differently for different platforms.
*
*/
 
#ifndef __lispcleanupstack_h__
#define __lispcleanupstack_h__
 
#include "yacasbase.h"
#include "grower.h"
 
/** Base class that specifies one pure abstract method Delete.
* Only classes derived from this one can be pushed onto
* a cleanup stack. This in order to assure the cleanup code
* knows where to find the destructor.
*
* Typical candidates for cleanup include places in the code that
* have temporal global side effects that need to be finalized on,
* Like opening a file for reading, reading and then closing. If
* reading prematurely finishes through an exception, the file
* should be closed.
*/
class LispBase : public YacasBase
{
public:
virtual void Delete()=0;
virtual ~LispBase(){};
};
 
/** Clean up stack that doesn't actually delete objects itself.
* Use this clean up stack if the compiler generates
* cleanup code itself (particularly for newer c++ compilers).
* Alternatively SAFEPUSH and SAFEPOP can then be defined to do nothing.
*/
class LispCleanup : public YacasBase
{
public:
inline LispCleanup() : iObjects() {}
virtual ~LispCleanup();
/// Push an object onto the cleanup stack for guarding
virtual void Push(LispBase& aObject);
/// Pop an object from the cleanup stack (the system is finished using it)
virtual void Pop();
/// Exception occurred: delete all objects on the stack, back to front.
virtual void Delete();
/** For testing purposes, verify that all places that pushed an object
* popped it too.
*/
void CheckStackEmpty();
 
protected:
CArrayGrower<LispBase*, ArrOpsCustomPtr<LispBase> > iObjects;
};
 
/** Clean up stack that deletes objects itself when needed.
* Use this clean up stack if the compiler doesn't generate
* cleanup code itself (particularly for older c++ compilers).
*/
class DeletingLispCleanup : public LispCleanup
{
public:
virtual ~DeletingLispCleanup();
virtual void Push(LispBase& aObject);
virtual void Pop();
virtual void Delete();
};
 
 
#endif
 
 
/contrib/media/updf/include/lispenvironment.h
0,0 → 1,709
/** \file lispenvironment.h
* General environment access.
*
*/
 
 
#ifndef __lispenvironment_h__
#define __lispenvironment_h__
 
#include "yacasbase.h"
#include "lispobject.h"
#include "lisphash.h"
#include "lispevalhash.h"
#include "lispcleanupstack.h"
#include "deffile.h"
#include "lispio.h"
#include "stringio.h"
#include "lispglobals.h"
#include "xmltokenizer.h"
#include "errors.h"
 
class CCompressedArchive; /* defined in archiver.h */
 
class LispDefFiles;
class InputDirectories : public CDeletingArrayGrower<LispString *, ArrOpsDeletingPtr<LispString> >
{
};
 
class LispInput;
class LispOutput;
class LispPrinter;
class LispOperators;
class LispUserFunctions;
class LispUserFunction;
class LispMultiUserFunction;
class LispEvaluatorBase;
class BasicEvaluator;
class DefaultDebugger;
class LispEnvironment;
 
 
/// The Lisp environment.
/// This huge class is the central class of the Yacas program. It
/// implements a dialect of Lisp.
 
class LispEnvironment : public YacasBase
{
public:
/// \name Constructor and destructor
//@{
LispEnvironment(YacasCoreCommands &aCoreCommands,
LispUserFunctions& aUserFunctions,
LispGlobal& aGlobals,
LispHashTable& aHashTable,
LispOutput* aOutput,
LispPrinter& aPrinter,
LispOperators &aPreFixOperators,
LispOperators &aInFixOperators,
LispOperators &aPostFixOperators,
LispOperators &aBodiedOperators,
LispInput* aCurrentInput,
LispInt aStackSize);
~LispEnvironment();
//@}
 
public:
/// \name Lisp variables
//@{
 
/// Assign a value to a Lisp variable.
/// \param aString name of the variable
/// \param aValue value to be assigned to \a aString
///
/// If there is a local variable with the name \a aString, the
/// object \a aValue is assigned to it. Otherwise, a
/// LispGlobalVariable is constructed, and it is associated with
/// \a aValue in #iGlobals.
/// \sa FindLocal
void SetVariable(LispString * aString, LispPtr& aValue, LispBoolean aGlobalLazyVariable);
 
/// In debug mode, DebugModeVerifySettingGlobalVariables raises a warning if a global variable is set.
void DebugModeVerifySettingGlobalVariables(LispPtr & aVariable, LispBoolean aGlobalLazyVariable);
 
/// Get the value assigned to a variable.
/// \param aVariable name of the variable
/// \param aResult (on exit) value of \a aVariable
///
/// - If there is a local variable with the name \a aString,
/// \a aResult is set to point to the value assigned to this local
/// variable.
/// - If there is a global variable \a aString and its
/// #iEvalBeforeReturn is false, its value is returned via
/// \a aResult.
/// - If there is a global variable \a aString and its
/// #iEvalBeforeReturn is true, its value is evaluated. The
/// result is assigned back to the variable, its
/// #iEvalBeforeReturn is set to false, and a copy of the result
/// is returned in \a aResult.
/// - Otherwise, \a aResult is set to #NULL.
void GetVariable(LispString * aVariable,LispPtr& aResult);
 
void UnsetVariable(LispString * aString);
void PushLocalFrame(LispBoolean aFenced);
void PopLocalFrame();
void NewLocal(LispString * aVariable,LispObject* aValue);
void CurrentLocals(LispPtr& aResult);
//@}
 
public:
/// \name Lisp functions
//@{
 
/// Return the #iCoreCommands attribute.
inline YacasCoreCommands& CoreCommands();
 
/// Add a command to the list of core commands.
/// \param aEvaluatorFunc C function evaluating the core command
/// \param aString name of the command
/// \param aNrArgs number of arguments
/// \param aFlags flags, see YacasEvaluator::FunctionFlags
void SetCommand(YacasEvalCaller aEvaluatorFunc, LispChar * aString,LispInt aNrArgs,LispInt aFlags);
 
void RemoveCommand(LispChar * aString);
void RemoveCoreCommand(LispChar * aString);
 
inline LispHashTable& HashTable();
LispUserFunction* UserFunction(LispPtr& aArguments);
LispUserFunction* UserFunction(LispString * aName,LispInt aArity);
 
/// Return LispMultiUserFunction with given name.
/// \param aArguments name of the multi user function
///
/// The table of user functions, #iUserFunctions, is consulted. If
/// a user function with the given name exists, it is returned.
/// Otherwise, a new LispMultiUserFunction is constructed, added
/// to #iUserFunctions, and returned.
LispMultiUserFunction* MultiUserFunction(LispString * aArguments);
 
LispDefFiles& DefFiles();
void DeclareRuleBase(LispString * aOperator, LispPtr& aParameters,
LispInt aListed);
void DeclareMacroRuleBase(LispString * aOperator, LispPtr& aParameters,
LispInt aListed);
void DefineRule(LispString * aOperator,LispInt aArity,
LispInt aPrecedence, LispPtr& aPredicate,
LispPtr& aBody);
void DefineRulePattern(LispString * aOperator,LispInt aArity,
LispInt aPrecedence, LispPtr& aPredicate,
LispPtr& aBody);
 
 
void UnFenceRule(LispString * aOperator,LispInt aArity);
void Retract(LispString * aOperator,LispInt aArity);
void HoldArgument(LispString * aOperator,LispString * aVariable);
//@}
 
LispString * FindCachedFile(LispChar * aFileName);
 
public:
/// \name Precision
//@{
 
/// set precision to a given number of decimal digits
void SetPrecision(LispInt aPrecision);
inline LispInt Precision(void) const;
inline LispInt BinaryPrecision(void) const;
//@}
 
public:
inline void SetPrettyPrinter(LispString * aPrettyPrinter);
inline LispString * PrettyPrinter(void);
 
inline void SetPrettyReader(LispString * aPrettyReader);
inline LispString * PrettyReader(void);
 
public:
LispInt GetUniqueId();
public:
LispPrinter& CurrentPrinter();
 
public:
/// \name Operators
//@{
LispOperators& PreFix();
LispOperators& InFix();
LispOperators& PostFix();
LispOperators& Bodied();
//@}
 
public:
/// \name Input and output
//@{
LispInput* CurrentInput();
void SetCurrentInput(LispInput* aInput);
public:
LispOutput* CurrentOutput();
void SetCurrentOutput(LispOutput* aOutput);
public:
void SetUserError(LispChar * aErrorString);
LispChar * ErrorString(LispInt aError);
//@}
 
protected:
/// current precision for user interaction, in decimal and in binary
LispInt iPrecision;
LispInt iBinaryPrecision;
public:
InputDirectories iInputDirectories;
DeletingLispCleanup iCleanup;
LispInt iEvalDepth;
LispInt iMaxEvalDepth;
CCompressedArchive *iArchive;
LispEvaluatorBase* iEvaluator;
 
public: // Error information when some error occurs.
InputStatus iInputStatus;
LispInt iSecure;
public: // pre-found
RefPtr<LispObject> iTrue;
RefPtr<LispObject> iFalse;
 
RefPtr<LispObject> iEndOfFile;
RefPtr<LispObject> iEndStatement;
RefPtr<LispObject> iProgOpen;
RefPtr<LispObject> iProgClose;
RefPtr<LispObject> iNth;
RefPtr<LispObject> iBracketOpen;
RefPtr<LispObject> iBracketClose;
RefPtr<LispObject> iListOpen;
RefPtr<LispObject> iListClose;
RefPtr<LispObject> iComma;
RefPtr<LispObject> iList;
RefPtr<LispObject> iProg;
 
LispInt iLastUniqueId;
 
public: // Error reporting
LispString iError;
StringOutput iErrorOutput;
DefaultDebugger* iDebugger;
 
private:
LispPtr *FindLocal(LispString * aVariable);
 
private:
 
class LispLocalVariable : public YacasBase
{
public:
LispLocalVariable(LispString * aVariable,
LispObject* aValue)
: iNext(NULL), iVariable(aVariable),iValue(aValue)
{
++aVariable->iReferenceCount;
};
~LispLocalVariable()
{
--iVariable->iReferenceCount;
}
private:
LispLocalVariable(const LispLocalVariable& aOther) : iNext(NULL), iVariable(NULL),iValue(NULL)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
LispLocalVariable& operator=(const LispLocalVariable& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
 
public:
LispLocalVariable* iNext;
LispString * iVariable;
LispPtr iValue;
};
class LocalVariableFrame : public YacasBase
{
public:
LocalVariableFrame(LocalVariableFrame *aNext,
LispLocalVariable* aFirst)
: iNext(aNext), iFirst(aFirst), iLast(aFirst) { }
void Add(LispLocalVariable* aNew)
{
aNew->iNext = iFirst;
iFirst = aNew;
}
~LocalVariableFrame()
{
LispLocalVariable* t = iFirst;
LispLocalVariable* next;
while (t != iLast)
{
next = t->iNext;
delete t;
t = next;
}
}
 
private:
LocalVariableFrame(const LocalVariableFrame& aOther) : iNext(NULL),iFirst(NULL),iLast(NULL)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
LocalVariableFrame& operator=(const LocalVariableFrame& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
public:
LocalVariableFrame *iNext;
LispLocalVariable* iFirst;
LispLocalVariable* iLast;
};
public: //Well... only because I want to be able to show the stack to the outside world...
LocalVariableFrame *iLocalsList;
LispOutput* iInitialOutput;
private:
 
/// Hash of core commands with associated YacasEvaluator
YacasCoreCommands& iCoreCommands;
 
LispUserFunctions& iUserFunctions;
LispHashTable& iHashTable;
LispDefFiles iDefFiles;
LispPrinter& iPrinter;
LispOutput* iCurrentOutput;
 
/// Hash of global variables with their values
LispGlobal& iGlobals;
 
LispOperators& iPreFixOperators;
LispOperators& iInFixOperators;
LispOperators& iPostFixOperators;
LispOperators& iBodiedOperators;
 
LispInput* iCurrentInput;
 
LispChar * theUserError;
 
LispString * iPrettyReader;
LispString * iPrettyPrinter;
public:
LispTokenizer iDefaultTokenizer;
CommonLispTokenizer iCommonLispTokenizer;
XmlTokenizer iXmlTokenizer;
LispTokenizer* iCurrentTokenizer;
 
public:
/** YacasArgStack implements a stack of pointers to objects that can be used to pass
* arguments to functions, and receive results back.
*/
class YacasArgStack
{
public:
YacasArgStack(LispInt aStackSize) : iStack(),iStackCnt(0)
{
iStack.ResizeTo( aStackSize );
}
inline LispInt GetStackTop() const {return iStackCnt;}
inline void RaiseStackOverflowError() const
{
RaiseError("Argument stack reached maximum. Please extend argument stack with --stack argument on the command line.");
}
inline void PushArgOnStack(LispObject* aObject)
{
if (iStackCnt >= iStack.Size())
{
RaiseStackOverflowError();
}
//LISPASSERT(iStackCnt>=0 /*&& iStackCnt<iStack.Size()*/);
iStack[iStackCnt] = (aObject);
iStackCnt++;
}
inline void PushNulls(LispInt aNr)
{
LispInt aStackCnt = iStackCnt + aNr;
if (aStackCnt > iStack.Size() || aStackCnt < 0)
{
RaiseStackOverflowError();
}
iStackCnt = aStackCnt;
}
inline LispPtr& GetElement(LispInt aPos)
{
LISPASSERT(0<=aPos && aPos<iStackCnt);
//LISPASSERT(aPos>=0 && aPos<iStack.Size());
return iStack[aPos];
}
inline void PopTo(LispInt aTop)
{
LISPASSERT(0<=aTop && aTop<=iStackCnt);
while (iStackCnt>aTop)
{
iStackCnt--;
iStack[iStackCnt] = (NULL);
}
}
protected:
// Invariants:
// 0 <= iStackCnt <= iStack.Size()
// iStack[iStackCnt..iStack.Size()-1] = NULL
LispPtrArray iStack;
LispInt iStackCnt; // number of items on the stack
};
YacasArgStack iStack;
 
private:
inline LispEnvironment(const LispEnvironment& aOther)
:
iPrecision(0), // default user precision of 10 decimal digits
iBinaryPrecision(0), // same as 34 bits
iInputDirectories(),
iCleanup(),
iEvalDepth(0),
iMaxEvalDepth(0),
iArchive(NULL),
iEvaluator(NULL),
iInputStatus(),
iSecure(0),
iTrue(),
iFalse(),
iEndOfFile(),
iEndStatement(),
iProgOpen(),
iProgClose(),
iNth(),
iBracketOpen(),
iBracketClose(),
iListOpen(),
iListClose(),
iComma(),
iList(),
iProg(),
iLastUniqueId(0),
iError(),
iErrorOutput(aOther.iErrorOutput),
iDebugger(NULL),
iLocalsList(NULL),
iInitialOutput(aOther.iInitialOutput),
iCoreCommands(aOther.iCoreCommands),
iUserFunctions(aOther.iUserFunctions),
iHashTable(aOther.iHashTable),
iDefFiles(),
iPrinter(aOther.iPrinter),
iCurrentOutput(aOther.iCurrentOutput),
iGlobals(aOther.iGlobals),
iPreFixOperators(aOther.iPreFixOperators),
iInFixOperators(aOther.iInFixOperators),
iPostFixOperators(aOther.iPostFixOperators),
iBodiedOperators(aOther.iBodiedOperators),
iCurrentInput(aOther.iCurrentInput),
theUserError(NULL),
iPrettyReader(NULL),
iPrettyPrinter(NULL),
iDefaultTokenizer(),
iCommonLispTokenizer(),
iXmlTokenizer(),
iCurrentTokenizer(NULL),
iStack(0)
{
// copy constructor has not been made yet, hence the assert
LISPASSERT(0);
}
LispEnvironment& operator=(const LispEnvironment& aOther)
{
// copy constructor has not been made yet, hence the assert
LISPASSERT(0);
return *this;
}
 
};
 
inline LispInt LispEnvironment::Precision(void) const
{
return iPrecision;
}
 
inline LispInt LispEnvironment::BinaryPrecision(void) const
{
return iBinaryPrecision;
}
 
 
 
inline YacasCoreCommands& LispEnvironment::CoreCommands()
{
return iCoreCommands;
}
 
 
inline LispHashTable& LispEnvironment::HashTable()
{
return iHashTable;
}
 
 
 
// Local lisp stack, unwindable by the exception handler
class LispLocalFrame : public LispBase
{
public:
LispLocalFrame(LispEnvironment& aEnvironment, LispBoolean aFenced)
: iEnvironment(aEnvironment)
{
iEnvironment.PushLocalFrame(aFenced);
SAFEPUSH(iEnvironment,*this);
};
virtual ~LispLocalFrame()
{
SAFEPOP(iEnvironment);
Delete();
};
virtual void Delete();
private:
LispEnvironment& iEnvironment;
};
 
 
 
class LispSecureFrame : public LispBase
{
public:
LispSecureFrame(LispEnvironment& aEnvironment)
: iEnvironment(aEnvironment),iPreviousSecure(aEnvironment.iSecure)
{
iEnvironment.iSecure = 1;
SAFEPUSH(iEnvironment,*this);
};
virtual ~LispSecureFrame()
{
SAFEPOP(iEnvironment);
Delete();
};
virtual void Delete();
private:
LispEnvironment& iEnvironment;
LispInt iPreviousSecure;
};
 
 
// LispLocalInput takes ownership over the LispInput class
class LispLocalInput : public LispBase
{
public:
LispLocalInput(LispEnvironment& aEnvironment, LispInput* aInput)
: iEnvironment(aEnvironment),iPreviousInput(iEnvironment.CurrentInput())
{
iEnvironment.SetCurrentInput(aInput);
SAFEPUSH(iEnvironment,*this);
};
virtual ~LispLocalInput()
{
SAFEPOP(iEnvironment);
Delete();
};
virtual void Delete();
private:
LispLocalInput(const LispLocalInput& aOther): iEnvironment(aOther.iEnvironment),iPreviousInput(iEnvironment.CurrentInput())
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
};
LispLocalInput& operator=(const LispLocalInput& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
};
 
private:
LispEnvironment& iEnvironment;
LispInput* iPreviousInput;
};
 
 
// LispLocalInput takes ownership over the LispInput class
class LispLocalOutput : public LispBase
{
public:
LispLocalOutput(LispEnvironment& aEnvironment, LispOutput* aOutput)
: iEnvironment(aEnvironment), iPreviousOutput(iEnvironment.CurrentOutput())
{
iPreviousOutput = iEnvironment.CurrentOutput();
iEnvironment.SetCurrentOutput(aOutput);
SAFEPUSH(iEnvironment,*this);
};
virtual ~LispLocalOutput()
{
SAFEPOP(iEnvironment);
Delete();
};
virtual void Delete();
private:
LispLocalOutput(const LispLocalOutput& aOther): iEnvironment(aOther.iEnvironment), iPreviousOutput(iEnvironment.CurrentOutput())
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
LispLocalOutput& operator=(const LispLocalOutput& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
private:
LispEnvironment& iEnvironment;
LispOutput* iPreviousOutput;
};
 
 
class LispLocalEvaluator : public YacasBase
{
public:
LispLocalEvaluator(LispEnvironment& aEnvironment,LispEvaluatorBase* aNewEvaluator);
~LispLocalEvaluator();
 
private:
LispLocalEvaluator(const LispLocalEvaluator& aOther) : iPreviousEvaluator(NULL), iEnvironment(aOther.iEnvironment)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
LispLocalEvaluator& operator=(const LispLocalEvaluator& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
 
private:
LispEvaluatorBase* iPreviousEvaluator;
LispEnvironment& iEnvironment;
};
 
class LispLocalTrace : public YacasBase
{
public:
LispLocalTrace(LispUserFunction* aUserFunc);
~LispLocalTrace();
private:
LispLocalTrace(const LispLocalTrace& aOther) : iUserFunc(NULL)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
LispLocalTrace& operator=(const LispLocalTrace& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
private:
LispUserFunction* iUserFunc;
};
 
class LocalArgs : public YacasBase
{
public:
LocalArgs(LispPtr* aPtrs) : iPtrs(aPtrs) {};
~LocalArgs()
{
if (iPtrs)
delete[] iPtrs;
}
private:
LocalArgs(const LocalArgs& aOther) : iPtrs(NULL)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
LocalArgs& operator=(const LocalArgs& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
private:
LispPtr* iPtrs;
};
 
 
 
inline void LispEnvironment::SetPrettyReader(LispString * aPrettyReader)
{
iPrettyReader = aPrettyReader;
}
inline LispString * LispEnvironment::PrettyReader(void)
{
return iPrettyReader;
}
 
inline void LispEnvironment::SetPrettyPrinter(LispString * aPrettyPrinter)
{
iPrettyPrinter = aPrettyPrinter;
}
inline LispString * LispEnvironment::PrettyPrinter(void)
{
return iPrettyPrinter;
}
 
 
#endif
 
 
/contrib/media/updf/include/lisperror.h
0,0 → 1,68
 
#ifndef __lisperror_h__
#define __lisperror_h__
 
#include "lisptype.h"
#include "lispstring.h"
 
#include "choices.h"
 
 
enum ErrorCodes
{
KLispErrNone = 0,
KLispErrInvalidArg ,
KLispErrWrongNumberOfArgs ,
KLispErrNotList ,
KLispErrListNotLongEnough ,
KLispErrInvalidStack ,
KQuitting ,
KLispErrNotEnoughMemory ,
KInvalidToken ,
KLispErrInvalidExpression ,
KLispErrUnprintableToken ,
KLispErrFileNotFound ,
KLispErrReadingFile ,
KLispErrCreatingUserFunction,
KLispErrCreatingRule ,
KLispErrArityAlreadyDefined ,
KLispErrCommentToEndOfFile ,
KLispErrNotString ,
KLispErrNotInteger ,
KLispErrParsingInput ,
KLispErrMaxRecurseDepthReached,
KLispErrDefFileAlreadyChosen ,
KLispErrDivideByZero ,
KLispErrNotAnInFixOperator ,
KLispErrUser ,
KLispErrIsNotInFix ,
KLispErrSecurityBreach ,
KLispErrLibraryNotFound ,
KLispErrUserInterrupt ,
KLispErrNonBooleanPredicateInPattern,
KLispErrGenericFormat,
KLispNrErrors
};
 
 
template<typename T>
inline void Check(T hastobetrue, LispInt aError)
{
if (!hastobetrue)
LispThrow(aError);
}
 
 
#ifdef YACAS_DEBUG
#define DBG_printf printf
#define DBG_(xxx) xxx
#else
namespace{void inline noop(...) {}}
// could change 'noop' to 'sizeof' below, but we get 'left-hand operand of comma has no effect' from g++
#define DBG_printf while (0) noop
#define DBG_(xxx) /*xxx*/
#endif
 
 
#endif
 
/contrib/media/updf/include/lispeval.h
0,0 → 1,184
/** \file lispeval.h
* Evaluation of expressions.
*
*/
 
#ifndef __lispeval_h__
#define __lispeval_h__
 
#include "yacasbase.h"
#include "lispobject.h"
#include "lispenvironment.h"
 
/*
void InternalEval(LispEnvironment& aEnvironment, LispPtr& aResult, LispPtr& aExpression);
*/
 
 
class UserStackInformation : public YacasBase
{
public:
UserStackInformation()
: iOperator(),iExpression(),iRulePrecedence(-1),iSide(0)
#ifdef YACAS_DEBUG
, iFileName("(no file)"),iLine(0)
#endif // YACAS_DEBUG
{
}
LispPtr iOperator;
LispPtr iExpression;
LispInt iRulePrecedence;
LispInt iSide; // 0=pattern, 1=body
DBG_( LispChar * iFileName; )
DBG_( LispInt iLine; )
};
 
/// Abstract evaluator for Lisp expressions.
/// Eval() is a pure virtual function, to be provided by the derived class.
/// The other functions are stubs.
 
class LispEvaluatorBase : public YacasBase
{
public:
LispEvaluatorBase() : iBasicInfo() {}
virtual ~LispEvaluatorBase();
virtual void Eval(LispEnvironment& aEnvironment, LispPtr& aResult, LispPtr& aExpression)=0;
virtual void ResetStack();
virtual UserStackInformation& StackInformation();
virtual void ShowStack(LispEnvironment& aEnvironment, LispOutput& aOutput);
private:
UserStackInformation iBasicInfo;
};
 
/// The basic evaluator for Lisp expressions.
 
class BasicEvaluator : public LispEvaluatorBase
{
public:
/// Evaluate a Lisp expression
/// \param aEnvironment the Lisp environment, in which the
/// evaluation should take place.
/// \param aResult the result of the evaluation.
/// \param aExpression the expression to evaluate.
///
/// First, the evaluation depth is checked. An error is raised if
/// the maximum evaluation depth is exceeded.
///
/// The next step is the actual evaluation. \a aExpression is a
/// LispObject, so we can distinguish three cases.
/// - If \a aExpression is a string starting with \c " , it is
/// simply copied in \a aResult. If it starts with another
/// character (this includes the case where it represents a
/// number), the environment is checked to see whether a
/// variable with this name exists. If it does, its value is
/// copied in \a aResult, otherwise \a aExpression is copied.
/// - If \a aExpression is a list, the head of the list is
/// examined. If the head is not a string. InternalApplyPure()
/// is called. If the head is a string, it is checked against
/// the core commands; if there is a check, the corresponding
/// evaluator is called. Then it is checked agaist the list of
/// user function with GetUserFunction() . Again, the
/// corresponding evaluator is called if there is a check. If
/// all fails, ReturnUnEvaluated() is called.
/// - Otherwise (ie. if \a aExpression is a generic object), it is
/// copied in \a aResult.
///
/// \note The result of this operation must be a unique (copied)
/// element! Eg. its Next might be set...
///
/// The LispPtr it can be stored in to is passed in as argument, so it
/// does not need to be constructed by the calling environment.
virtual void Eval(LispEnvironment& aEnvironment, LispPtr& aResult, LispPtr& aExpression);
virtual ~BasicEvaluator();
};
 
class TracedEvaluator : public BasicEvaluator
{
public:
TracedEvaluator() : BasicEvaluator(),errorStr(),errorOutput(errorStr){}
virtual void Eval(LispEnvironment& aEnvironment, LispPtr& aResult, LispPtr& aExpression);
protected:
LispString errorStr;
StringOutput errorOutput;
};
 
 
class TracedStackEvaluator : public BasicEvaluator
{
public:
TracedStackEvaluator() : objs() {}
virtual ~TracedStackEvaluator();
virtual void Eval(LispEnvironment& aEnvironment, LispPtr& aResult, LispPtr& aExpression);
virtual void ResetStack();
virtual UserStackInformation& StackInformation();
virtual void ShowStack(LispEnvironment& aEnvironment, LispOutput& aOutput);
private:
void PushFrame();
void PopFrame();
private:
CArrayGrower<UserStackInformation*, ArrOpsCustomPtr<UserStackInformation> > objs;
};
 
 
 
/* GetUserFunction : get user function, possibly loading the required
files to read in the function definition */
LispUserFunction* GetUserFunction(LispEnvironment& aEnvironment,
LispPtr* subList);
 
 
/* Tracing functions */
void TraceShowEnter(LispEnvironment& aEnvironment,
LispPtr& aExpression);
void TraceShowLeave(LispEnvironment& aEnvironment, LispPtr& aResult,
LispPtr& aExpression);
void TraceShowArg(LispEnvironment& aEnvironment,LispPtr& aParam,
LispPtr& aValue);
 
 
void ShowExpression(LispString& outString, LispEnvironment& aEnvironment,
LispPtr& aExpression);
 
 
class YacasDebuggerBase : public YacasBase
{
public:
virtual ~YacasDebuggerBase();
virtual void Start() = 0;
virtual void Finish() = 0;
virtual void Enter(LispEnvironment& aEnvironment,
LispPtr& aExpression) = 0;
virtual void Leave(LispEnvironment& aEnvironment, LispPtr& aResult,
LispPtr& aExpression) = 0;
virtual void Error(LispEnvironment& aEnvironment) = 0;
virtual LispBoolean Stopped() = 0;
};
 
class DefaultDebugger : public YacasDebuggerBase
{
public:
inline DefaultDebugger(LispPtr& aEnter, LispPtr& aLeave, LispPtr& aError)
: iEnter(aEnter), iLeave(aLeave), iError(aError), iTopExpr(),iTopResult(),iStopped(LispFalse),defaultEval() {};
virtual void Start();
virtual void Finish();
virtual void Enter(LispEnvironment& aEnvironment,
LispPtr& aExpression);
virtual void Leave(LispEnvironment& aEnvironment, LispPtr& aResult,
LispPtr& aExpression);
virtual void Error(LispEnvironment& aEnvironment);
virtual LispBoolean Stopped();
LispPtr iEnter;
LispPtr iLeave;
LispPtr iError;
LispPtr iTopExpr;
LispPtr iTopResult;
LispBoolean iStopped;
protected:
BasicEvaluator defaultEval;
};
 
 
#endif
 
 
 
/contrib/media/updf/include/lispevalhash.h
0,0 → 1,46
/** \file lispevalhash.h
* Storage of executable commands
*
*/
 
#ifndef __lispevalhash_h__
#define __lispevalhash_h__
 
#include "yacasbase.h"
#include "lispobject.h"
#include "lisphash.h"
#include "evalfunc.h"
 
 
// new-style evaluator, passing arguments onto the stack in LispEnvironment
typedef void (*YacasEvalCaller)(LispEnvironment& aEnvironment,LispInt aStackTop);
class YacasEvaluator : public EvalFuncBase
{
public:
// FunctionFlags can be orred when passed to the constructor of this function
enum FunctionFlags
{
Function=0, // Function: evaluate arguments
Macro=1, // Function: don't evaluate arguments
Fixed = 0, // fixed number of arguments
Variable = 2 // variable number of arguments
};
YacasEvaluator(YacasEvalCaller aCaller,LispInt aNrArgs, LispInt aFlags)
: iCaller(aCaller), iNrArgs(aNrArgs), iFlags(aFlags)
{
}
virtual void Evaluate(LispPtr& aResult,LispEnvironment& aEnvironment,
LispPtr& aArguments);
private:
YacasEvalCaller iCaller;
LispInt iNrArgs;
LispInt iFlags;
};
 
class YacasCoreCommands : public LispAssociatedHash<YacasEvaluator>
{
};
 
 
 
#endif
/contrib/media/updf/include/lispglobals.h
0,0 → 1,61
 
/** \file lispglobals.h
* Storage of globals in a associated hash
*
*/
 
#ifndef __lispglobals_h__
#define __lispglobals_h__
 
#include "yacasbase.h"
#include "lispobject.h"
#include "lisphash.h"
 
 
/// Value of a Lisp global variable.
/// The only special feature of this class is the attribute
/// #iEvalBeforeReturn, which defaults to #LispFalse. If this
/// attribute is set to #LispTrue, the value in #iValue needs to be
/// evaluated to get the value of the Lisp variable.
/// \sa LispEnvironment::GetVariable()
 
class LispGlobalVariable : public YacasBase
{
public:
inline LispGlobalVariable(const LispGlobalVariable& aOther);
LispGlobalVariable(LispPtr& aValue): iValue(aValue), iEvalBeforeReturn(LispFalse) {}
inline LispGlobalVariable& operator=(const LispGlobalVariable& aOther);
 
inline void SetEvalBeforeReturn(LispBoolean aEval);
LispPtr iValue;
LispBoolean iEvalBeforeReturn;
};
 
/// Associated hash of LispGlobalVariable objects
 
class LispGlobal : public LispAssociatedHash<LispGlobalVariable>
{
};
 
 
 
 
inline LispGlobalVariable::LispGlobalVariable(const LispGlobalVariable& aOther) : iValue(aOther.iValue), iEvalBeforeReturn(LispFalse)
{
}
 
inline void LispGlobalVariable::SetEvalBeforeReturn(LispBoolean aEval)
{
iEvalBeforeReturn = aEval;
}
 
 
inline LispGlobalVariable& LispGlobalVariable::operator=(const LispGlobalVariable& aOther)
{
iValue = (aOther.iValue);
return *this;
}
 
 
#endif
 
/contrib/media/updf/include/lisphash.h
0,0 → 1,101
/** \file lisphash.h
* hashing of strings. Each string will exist only once in the
* hash table, and have an unique id.
*/
 
 
#ifndef __lisphash_h__
#define __lisphash_h__
 
#include "yacasbase.h"
#include "grower.h"
#include "lispstring.h"
 
 
const LispInt KSymTableSize = 211;
LispInt LispHash( const char *s );
LispInt LispHashCounted( const char *s, LispInt length );
LispInt LispHashStringify( const char *s );
LispInt LispHashUnStringify( const char *s );
LispInt LispHashPtr(const LispString * aString); // hash the *address*!
 
/**
* This is the symbol table, implemented as a hash table for fast
* lookup. It is meant to store any string just once, have fast
* searching for strings and return a reference to the string.
* This also allows fast comparison of two strings (two strings
* are equal iff the pointers to the strings are equal).
*/
class LispHashTable : public YacasBase
{
public:
LispHashTable() {}
~LispHashTable();
// If string not yet in table, insert. Afterwards return the string.
LispString * LookUp(const LispChar * aString, LispBoolean aStringOwnedExternally=LispFalse);
/// LookUp that takes ownership of the string
LispString * LookUp(LispString * aString);
LispString * LookUpCounted(LispChar * aString,LispInt aLength);
LispString * LookUpStringify(LispChar * aString, LispBoolean aStringOwnedExternally=LispFalse);
LispString * LookUpUnStringify(LispChar * aString, LispBoolean aStringOwnedExternally=LispFalse);
void GarbageCollect();
private:
void AppendString(LispInt bin,LispString * result);
private:
CArrayGrower<LispStringSmartPtr, ArrOpsCustomObj<LispStringSmartPtr> > iHashTable[KSymTableSize];
};
 
 
 
 
 
/** VoidGrow is a helper class for LispAssociatedHash
*/
class VoidGrow : public CArrayGrower<void*, ArrOpsCustomPtr<void> >
{
};
 
/** LispAssociatedHash allows you to associate arbitrary
* information with a string in the above hash table. You can
* specify what type of information to link to the string, and
* this class then stores that information for a string. It is
* in a sense a way to extend the string object without modifying
* the string class itself. This class does not own the strings it
* points to, but instead relies on the fact that the strings
* are maintained in a hash table (like LispHashTable above).
*/
template<class T>
class LispAssociatedHash : public YacasBase
{
public:
/// Find the data associated to \a aString.
/// If \a aString is not stored in the hash table, this function
/// returns #NULL.
inline T* LookUp(LispString * aString);
 
/// Add an association to the hash table.
/// If \a aString is already stored in the hash table, its
/// association is changed to \a aData. Otherwise, a new
/// association is added.
inline void SetAssociation(const T& aData, LispString * aString);
 
/// Delete an association from the hash table.
inline void Release(LispString * aString);
 
protected:
/** The destructor is made protected because we do not want the outside world to directly
* call this destructor. The alternative would be to make the destructor virtual.
*/
inline ~LispAssociatedHash();
 
private:
// The next array is in fact an array of arrays of type LAssoc<T>
VoidGrow iHashTable[KSymTableSize];
};
 
 
 
#include "lisphash.inl"
 
 
#endif
/contrib/media/updf/include/lispio.h
0,0 → 1,109
/** \file lispio.h
* definitions of pure input output classes.
*/
 
 
#ifndef __lispio_h__
#define __lispio_h__
 
#include "yacasbase.h"
 
// Hope this forward declaration doesn't screw us over...
class InputDirectories;
class InputStatus : public YacasBase
{
public:
InputStatus() : iFileName("none") , iLineNumber(-1) {};
~InputStatus();
void SetTo(LispChar * aFileName);
void RestoreFrom(InputStatus& aPreviousStatus);
inline LispInt LineNumber();
inline LispChar * FileName();
inline void NextLine();
 
inline InputStatus(const InputStatus& aOther) : iFileName(aOther.iFileName) , iLineNumber(aOther.iLineNumber)
{
}
 
inline InputStatus& operator=(const InputStatus& aOther)
{
iFileName = aOther.iFileName;
iLineNumber = aOther.iLineNumber;
return *this;
}
 
private:
LispChar * iFileName;
LispInt iLineNumber;
};
 
inline LispInt InputStatus::LineNumber()
{
return iLineNumber;
}
inline LispChar * InputStatus::FileName()
{
return iFileName;
}
inline void InputStatus::NextLine()
{
iLineNumber++;
}
 
/** \class LispInput : pure abstract class declaring the interface
* that needs to be implemented by a file (something that expressions
* can be read from).
*/
class LispInput : public YacasBase
{
public:
/** Constructor with InputStatus. InputStatus retains the information
* needed when an error occurred, and the file has already been
* closed.
*/
LispInput(InputStatus& aStatus) : iStatus(aStatus) {};
virtual ~LispInput();
 
/// Return the next character in the file
virtual LispChar Next() = 0;
 
/** Peek at the next character in the file, without advancing the file
* pointer.
*/
virtual LispChar Peek() = 0;
 
virtual InputStatus& Status() const {return iStatus;};
 
/// Check if the file position is past the end of the file.
virtual LispBoolean EndOfStream() = 0;
/** StartPtr returns the start of a buffer, if there is one.
* Implementations of this class can keep the file in memory
* as a whole, and return the start pointer and current position.
* Especially the parsing code requires this, because it can then
* efficiently look up a symbol in the hash table without having to
* first create a buffer to hold the symbol in. If StartPtr is supported,
* the whole file should be in memory for the whole period the file
* is being read.
*/
virtual LispChar * StartPtr() = 0;
virtual LispInt Position() = 0;
virtual void SetPosition(LispInt aPosition) = 0;
protected:
InputStatus& iStatus;
};
 
/** \class LispOutput : interface an output object should adhere to.
*/
class LispOutput : public YacasBase
{
public:
virtual ~LispOutput();
/// Write out one character.
virtual void PutChar(LispChar aChar) = 0;
 
public:
void Write(const LispChar * aString);
};
 
#endif
 
/contrib/media/updf/include/lispobject.h
0,0 → 1,234
/** \file lispobject.h
* Implementation of basic LispObject, which is the base class for
* anything that can be put in a linked list.
*
* class LispObject. This class implements one lisp object, which is a
* abstract class containing reference counting and a next pointer.
* derive from this to implement specific types of list elements.
* The local class LispPtr implements automatic garbage collection
* through reference counting.
*
*/
 
#ifndef __lispobject_h__
#define __lispobject_h__
 
#include "yacasbase.h"
#include "refcount.h"
#include "lispstring.h"
#include "genericobject.h"
 
#ifdef YACAS_DEBUG
#define DBG_(xxx) xxx
#else
#define DBG_(xxx) /*xxx*/
#endif
 
class LispObject;
class BigNumber;
 
 
/** class LispPtr. A LispPtr is a smart pointer to a LispObject.
* It does the reference counting, and consequent destruction if needed.
* LispPtr is used in LispObject as a pointer to the next object; and
* LispPtr::GoNext() advances one step in this LispObject::Nixed() chain.
* Diverse built-in functions use LispPtr to hold temporary values.
*/
typedef RefPtr<LispObject> LispPtr;
 
/** \class LispPtrArray is similar to LispPtr, but implements an array
* of pointers to objects.
*/
typedef CArrayGrower<LispPtr, ArrOpsCustomObj<LispPtr> > LispPtrArray;
 
 
#ifdef YACAS_DEBUG
void IncNrObjects();
void DecNrObjects();
#else
#define IncNrObjects()
#define DecNrObjects()
#endif
 
// Should we DecNrObjects by the delete, or in the destructor?
// Put a DecNrObjects_xxx() macro in both places, and CHOOSE here.
#define DecNrObjects_delete() DECNROBJECTS_CHOOSE(DecNrObjects(),)
#define DecNrObjects_destructor() DECNROBJECTS_CHOOSE(,DecNrObjects())
#define DECNROBJECTS_CHOOSE(bydelete,bydestructor) bydestructor
 
 
template <int> struct Undefined;
template <> struct Undefined<1>{};
 
 
/** class LispObject is the base object class that can be put in
* linked lists. It either has a pointer to a string, obtained through
* String(), or it is a holder for a sublist, obtainable through SubList(),
* or it is a generic object, in which case Generic() returns non-NULL.
* Only one of these three functions should return a non-NULL value.
* It is a reference-counted object. LispPtr handles the reference counting.
*/
class LispObject : public YacasBase
{
public:
inline LispPtr& Nixed();
 
public: //Derivables
virtual ~LispObject();
 
/** Return string representation, or NULL if the object doesn't have one.
* the string representation is only relevant if the object is a
* simple atom. This method returns NULL by default.
*/
virtual LispString * String() { return NULL; }
/** If this object is a list, return a pointer to it.
* Default behaviour is to return NULL.
*/
virtual LispPtr* SubList() { return NULL; }
virtual GenericClass* Generic() { return NULL; }
 
/** If this is a number, return a BigNumber representation
*/
virtual BigNumber* Number(LispInt aPrecision) { return NULL; }
 
virtual LispObject* Copy() = 0;
 
/** Return a pointer to extra info. This allows for annotating
* an object. Returns NULL by default.
* LispObject's implementation of this handles almost all derived classes.
*/
virtual LispObject* ExtraInfo() { return NULL; }
virtual LispObject* SetExtraInfo(LispObject* aData) = 0;
public:
LispInt Equal(LispObject& aOther);
inline LispInt operator==(LispObject& aOther);
inline LispInt operator!=(LispObject& aOther);
DBG_( LispChar * iFileName; )
DBG_( LispInt iLine; )
inline void SetFileAndLine(LispChar * aFileName, LispInt aLine)
{
DBG_( iFileName = aFileName; )
DBG_( iLine = aLine; )
}
protected:
inline LispObject() :
#ifdef YACAS_DEBUG
iFileName(NULL),iLine(0),
#endif // YACAS_DEBUG
iNext(),iReferenceCount()
{
IncNrObjects();
DBG_( iFileName = NULL; )
DBG_( iLine = 0; )
}
inline LispObject(const LispObject& other) :
#ifdef YACAS_DEBUG
iFileName(other.iFileName),iLine(other.iLine),
#endif // YACAS_DEBUG
iNext(),iReferenceCount()
{
IncNrObjects();
}
 
inline LispObject& operator=(const LispObject& other)
{
#ifdef YACAS_DEBUG
iFileName = other.iFileName;
iLine = other.iLine;
#endif // YACAS_DEBUG
IncNrObjects();
return *this;
}
 
 
private:
LispPtr iNext;
public:
ReferenceCount iReferenceCount;
};
 
 
template <class T>
class WithExtraInfo : public T
{
public:
WithExtraInfo(T& aT, LispObject* aData = 0) : T(aT), iExtraInfo(aData) {}
WithExtraInfo(const WithExtraInfo& other) : T(other), iExtraInfo(other.iExtraInfo) {}
virtual LispObject* ExtraInfo() { return iExtraInfo; }
virtual LispObject* SetExtraInfo(LispObject* aData) { iExtraInfo = aData; return this; }
virtual LispObject* Copy()
{
if (!iExtraInfo.ptr()) return T::Copy();
return NEW WithExtraInfo(*this, iExtraInfo->Copy());
}
private:
LispPtr iExtraInfo;
};
 
 
template <class T, class U = LispObject>
class ObjectHelper : public U
{
protected:
typedef ObjectHelper ASuper; // for use by the derived class
ObjectHelper() {}
ObjectHelper(const ObjectHelper& other) : U(other) {}
virtual ~ObjectHelper() = 0; // so we're abstract
virtual LispObject* SetExtraInfo(LispObject* aData)
{
if (!aData) return this;
//T * pT = dynamic_cast<T*>(this); LISPASSERT(pT);
LispObject * pObject = NEW WithExtraInfo<T>(*static_cast<T*>(this), aData);
return pObject;
}
};
 
template <typename T, class U>
inline ObjectHelper<T,U>::~ObjectHelper() {}
 
 
/**
* class LispIterator works almost like LispPtr, but doesn't enforce
* reference counting, so it should be faster. Use LispIterator
* (instead of LispPtr) to traverse a lisp expression non-destructively.
*/
class LispIterator : public YacasBase
{
public:
// ala TEMPLATE CLASS iterator
//typedef forward_iterator_tag iterator_category;
typedef LispPtr value_type;
typedef int /*ptrdiff_t*/ difference_type;
typedef LispPtr* pointer;
typedef LispPtr& reference;
public:
LispIterator() : _Ptr(0) {} // construct with null node pointer
LispIterator(pointer ptr) : _Ptr(ptr) {} // construct with node pointer
/*non-standard*/ LispIterator(reference ref) : _Ptr(&ref) {} // construct with node reference
reference operator*() const { return (*(_Ptr)); } // return designated value
pointer operator->() const { return (_Ptr); } // return pointer to class object
inline LispIterator& operator++() // preincrement
{
//precondition: _Ptr != NULL
LISPASSERT(_Ptr != NULL);
//expand: _Ptr = _Nextnode(_Ptr);
LispObject * pObj = _Ptr->operator->();
_Ptr = pObj ? &(pObj->Nixed()) : NULL;
return (*this);
}
LispIterator operator++(int) { LispIterator _Tmp = *this; ++*this; return (_Tmp); } // postincrement
bool operator==(const LispIterator& other) const { return (_Ptr == other._Ptr); } // test for iterator equality
bool operator!=(const LispIterator& other) const { return (!(*this == other)); } // test for iterator inequality
// The following operators are not used yet, and would need to be tested before used.
//LispIterator& operator--() { _Ptr = _Prevnode(_Ptr); return (*this); } // predecrement
//LispIterator operator--(int) { LispIterator _Tmp = *this; --*this; return (_Tmp); } // postdecrement
protected:
pointer _Ptr; // pointer to node
public:
inline LispObject* getObj() const { return (*_Ptr).operator->(); }
};
 
#include "lispobject.inl"
 
 
#endif
/contrib/media/updf/include/lispparser.h
0,0 → 1,51
/** \file lispparser.h
* parsing and printing in the old-fashioned lisp style
*
*/
 
#ifndef __lispparser_h__
#define __lispparser_h__
 
#include "yacasbase.h"
#include "lispobject.h"
#include "tokenizer.h"
#include "lispio.h"
#include "lisphash.h"
#include "evalfunc.h"
class LispParser : public YacasBase
{
public:
LispParser(LispTokenizer& aTokenizer, LispInput& aInput,
LispEnvironment& aEnvironment);
virtual ~LispParser();
virtual void Parse(LispPtr& aResult );
protected:
void ParseList(LispPtr& aResult);
void ParseAtom(LispPtr& aResult,LispString * aToken);
 
public:
LispTokenizer& iTokenizer;
LispInput& iInput;
LispEnvironment& iEnvironment;
LispInt iListed;
};
 
 
 
 
class LispPrinter : public YacasBase
{
public:
virtual ~LispPrinter();
virtual void Print(LispPtr& aExpression, LispOutput& aOutput, LispEnvironment& aEnvironment);
virtual void RememberLastChar(LispChar aChar);
private:
void PrintExpression(LispPtr& aExpression, LispOutput& aOutput,
LispEnvironment& aEnvironment,
LispInt aDepth=0);
 
void Indent(LispOutput& aOutput, LispInt aDepth);
};
 
 
#endif
/contrib/media/updf/include/lispstring.h
0,0 → 1,117
/** \file lispstring.h
* Defining a string class.
*/
 
 
#ifndef __lispstring_h__
#define __lispstring_h__
 
#include "yacasbase.h"
#include "grower.h"
#include "refcount.h"
 
class LispStringSmartPtr;
 
 
/** \class LispString : zero-terminated byte-counted string.
* Also keeps a reference count for any one interested.
* LispString is derived from CArrayGrower, so the function
* Size returns the length of the buffer. Since the string
* is also zero-terminated (for better interfacing with the normal
* c functions), the string length is Size()-1.
*
* This class also allows the string to point to a buffer which is owned
* by another part of the system, in which case it cannot be resized.
* The array will then not be freed by this class.
*/
class LispString : public CArrayGrower<LispChar,ArrOpsPOD<LispChar> >
{
public:
// Constructors
// The constructors allow the caller to specify whether the storage is owned externally.
// Use the assignment operators to set the string after this.
inline LispString(LispBoolean aStringOwnedExternally=LispFalse);
inline LispString(LispString &aString, LispBoolean aStringOwnedExternally=LispFalse);
inline LispString(LispChar * aString, LispBoolean aStringOwnedExternally);
inline LispString(const LispChar * aString);
 
// Assignment
// This assignment abides by earlier functions setting the string as owned externally.
inline LispString& operator=(LispChar * aString);
 
// Assignments (with modifications). This string cannot be owned externally.
// Set string by taking part of another string.
void SetStringCounted(const LispChar * aString, LispInt aLength);
// Set string from other string, adding quotes around the string.
void SetStringUnStringified(const LispChar * aString);
// Set string from other string, removing quotes around the string.
void SetStringStringified(const LispChar * aString);
 
// Access
inline LispChar * c_str() const; // pointer to asciz 'C-string'
 
// Comparison
// If the string is in the hash table it is faster to compare the pointers to the strings
// (instead of calling this routine), since in that case if they
// are equal they should in fact be literally the same object.
LispInt operator==(const LispString& aString);
 
~LispString();
private:
inline void SetString(LispChar * aString, LispBoolean aStringOwnedExternally);
void SetString(const LispChar * aString);
public:
ReferenceCount iReferenceCount;
};
 
 
/** \class LispStringSmartPtr for managing strings outside
of normal objects. This is the equivalent of LispPtr, maintaining
a reference count for the string object.
*/
class LispStringSmartPtr
{
public:
// Default constructor (not explicit, so it auto-initializes)
LispStringSmartPtr() : iString(NULL) {}
 
// Construct from pointer to LispString
LispStringSmartPtr(LispString * aString) : iString(NULL)
{
this->operator=(aString);
}
 
// Copy constructor
LispStringSmartPtr(const LispStringSmartPtr& aOther) : iString()
{
this->operator=(aOther.iString);
}
 
// Destructor
~LispStringSmartPtr();
 
// Assignment from pointer. (PDG - new method)
// (we return void, not *this).
LispStringSmartPtr& operator=(LispString * aString);
 
// Assignment from another (the *default* simply assigns members, not what we want).
// (we return void, not *this).
LispStringSmartPtr& operator=(const LispStringSmartPtr &aOther) { this->operator=(aOther.iString); return *this; }
 
// Expected pointer behavior.
operator LispString*() const { return iString; } // implicit conversion to pointer to T
LispString *operator->() const { return iString; } // so (smartPtr->member) accesses T's member
// Operators below are not used yet, so they are commented out. If you want to use them you need to test if they work.
//LispString &operator*() const { return *iString; } // so (*smartPtr) is a reference to T
//LispString *ptr() const { return iString; } // so (smartPtr.ptr()) returns the pointer to T (boost calls this method 'get')
//bool operator!() const { return !iString; } // is null pointer
 
private:
LispString * iString;
};
 
#include "lispstring.inl"
#endif
 
 
/contrib/media/updf/include/lispuserfunc.h
0,0 → 1,127
 
 
#ifndef __lispuserfunc_h__
#define __lispuserfunc_h__
 
#include "yacasbase.h"
#include "lispobject.h"
#include "lispenvironment.h"
#include "lisphash.h"
#include "grower.h"
#include "evalfunc.h"
 
/// Abstract class providing the basic user function API.
/// Instances of this class are associated to the name of the function
/// via an associated hash table. When obtained, they can be used to
/// evaluate the function with some arguments.
 
class LispUserFunction : public EvalFuncBase
{
public:
LispUserFunction() : iFenced(LispTrue),iTraced(LispFalse) {};
virtual ~LispUserFunction();
virtual void Evaluate(LispPtr& aResult,LispEnvironment& aEnvironment,
LispPtr& aArguments)=0;
virtual void HoldArgument(LispString * aVariable) = 0;
virtual void DeclareRule(LispInt aPrecedence, LispPtr& aPredicate,
LispPtr& aBody) = 0;
virtual void DeclareRule(LispInt aPrecedence, LispPtr& aBody) = 0;
virtual void DeclarePattern(LispInt aPrecedence, LispPtr& aPredicate,
LispPtr& aBody) = 0;
virtual LispPtr& ArgList() = 0;
 
public: //unfencing
inline void UnFence() {iFenced = LispFalse;};
inline LispBoolean Fenced() {return iFenced;};
public: //tracing
inline void Trace() {iTraced = LispTrue;};
inline void UnTrace() {iTraced = LispFalse;};
inline LispBoolean Traced() {return iTraced;};
private:
LispBoolean iFenced;
LispBoolean iTraced;
};
 
 
/// User function with a specific arity.
/// This is still an abstract class, but the arity (number of
/// arguments) of the function is now fixed.
 
class LispArityUserFunction : public LispUserFunction
{
public:
virtual LispInt Arity() const = 0;
virtual LispInt IsArity(LispInt aArity) const = 0;
};
 
 
class LispDefFile;
 
 
/// Set of LispArityUserFunction's.
/// By using this class, you can associate multiple functions (with
/// different arities) to one name. A specific LispArityUserFunction
/// can be selected by providing its name. Additionally, the name of
/// the file in which the function is defined, can be specified.
 
class LispMultiUserFunction : public YacasBase
{
public:
/// Constructor.
LispMultiUserFunction() : iFunctions(),iFileToOpen(NULL) {};
 
/** When adding a multi-user function to the association hash table, the copy constructor is used.
* We should at least make sure that iFunctions is empty, so there is no copying needed (for efficiency).
* Casually having a copy-constructor on CDeletingArrayGrower should be avoided, to make sure it is
* not used accidentally.
*/
inline LispMultiUserFunction(const LispMultiUserFunction& aOther) : iFunctions(), iFileToOpen(NULL)
{
LISPASSERT(aOther.iFileToOpen == 0);
LISPASSERT(aOther.iFunctions.Size() == 0);
}
inline LispMultiUserFunction& operator=(const LispMultiUserFunction& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(aOther.iFileToOpen == 0);
LISPASSERT(aOther.iFunctions.Size() == 0);
 
LISPASSERT(iFileToOpen == 0);
LISPASSERT(iFunctions.Size() == 0);
return *this;
}
 
/// Return user function with given arity.
LispUserFunction* UserFunc(LispInt aArity);
 
/// Destructor.
virtual ~LispMultiUserFunction();
 
/// Specify that some argument should be held.
virtual void HoldArgument(LispString * aVariable);
 
/// Add another LispArityUserFunction to #iFunctions.
virtual void DefineRuleBase(LispArityUserFunction* aNewFunction);
 
/// Delete tuser function with given arity.
virtual void DeleteBase(LispInt aArity);
 
private:
/// Set of LispArityUserFunction's provided by this LispMultiUserFunction.
CDeletingArrayGrower<LispArityUserFunction*, ArrOpsDeletingPtr<LispArityUserFunction> > iFunctions;
 
public:
/// File to read for the definition of this function.
LispDefFile* iFileToOpen;
};
 
 
/// Associated hash of LispMultiUserFunction objects.
 
class LispUserFunctions : public LispAssociatedHash<LispMultiUserFunction>
{
};
 
 
#endif
 
/contrib/media/updf/include/list
0,0 → 1,192
#ifndef _LIST_INCLUDED
#define _LIST_INCLUDED
#include <stdlib.h>
namespace std
{
struct __list_node_base
{
__list_node_base* prev;
__list_node_base* next;
};
template <class T> struct __list_node : __list_node_base
{
T data;
__list_node(const T& d):data(d){}
};
template <class T> class list
{
__list_node_base head; // head.prev = end, head.next = start
unsigned _size;
public:
list():_size(0) {head.prev=head.next=&head;}
~list() {clear();}
void clear()
{
__list_node<T>* a =
static_cast<__list_node<T>*>(head.next);
while (a!=&head)
{
__list_node<T>* b =
static_cast<__list_node<T>*>(a->next);
delete a;
a = b;
}
head.prev = head.next = &head;
_size = 0;
}
class iterator
{
public:
__list_node_base* cur;
friend class list;
iterator(){}
iterator(__list_node_base*c):cur(c){}
iterator(const iterator& it):cur(it.cur){}
iterator& operator++()
{cur=cur->next;return *this;}
iterator operator++(int)
{iterator tmp(*this);cur=cur->next;return tmp;}
iterator& operator--()
{cur=cur->prev;return *this;}
iterator operator--(int)
{iterator tmp(*this);cur=cur->prev;return tmp;}
bool operator!=(const iterator& it)
{return cur!=it.cur;}
bool operator==(const iterator& it)
{return cur==it.cur;}
T& operator*()
{return static_cast<__list_node<T>*>(cur)->data;}
T* operator->() {return &**this;}
};
class const_iterator
{
const __list_node_base* cur;
friend class list;
public:
const_iterator(){}
const_iterator(const __list_node_base*c):cur(c){}
const_iterator(const const_iterator& it):cur(it.cur){}
const_iterator(const iterator& it):cur(it.cur){}
const_iterator& operator++()
{cur=cur->next;return *this;}
const_iterator operator++(int)
{const_iterator tmp(*this);cur=cur->next;return tmp;}
const_iterator& operator--()
{cur=cur->prev;return *this;}
const_iterator operator--(int)
{const_iterator tmp(*this);cur=cur->prev;return tmp;}
bool operator!=(const const_iterator& it)
{return cur!=it.cur;}
bool operator==(const const_iterator& it)
{return cur==it.cur;}
const T& operator*()
{return static_cast<const __list_node<T>*>(cur)->data;}
const T* operator->() {return &**this;}
};
iterator erase(iterator it)
{
if (it==end()) return it;
it.cur->prev->next = it.cur->next;
it.cur->next->prev = it.cur->prev;
iterator res(it.cur->next);
delete static_cast<__list_node<T>*>(it.cur);
--_size;
return res;
}
iterator erase(iterator first, iterator last)
{
while (first!=last)
first=erase(first);
return first;
}
void pop_front(void) {erase(begin());}
class reverse_iterator
{
__list_node_base* cur;
friend class list;
public:
reverse_iterator(){}
reverse_iterator(__list_node_base*c):cur(c){}
reverse_iterator(const reverse_iterator& it):
cur(it.cur){}
reverse_iterator& operator++()
{cur=cur->prev;return *this;}
reverse_iterator operator++(int)
{reverse_iterator tmp(*this);
cur=cur->prev;return tmp;}
bool operator!=(const reverse_iterator& it)
{return cur!=it.cur;}
bool operator==(const reverse_iterator& it)
{return cur==it.cur;}
T& operator*()
{return static_cast<__list_node<T>*>(cur)->data;}
};
class const_reverse_iterator
{
const __list_node_base* cur;
friend class list;
public:
const_reverse_iterator(){}
const_reverse_iterator(const __list_node_base*c):cur(c){}
const_reverse_iterator(const const_reverse_iterator& it):
cur(it.cur){}
const_reverse_iterator& operator++()
{cur=cur->prev;return *this;}
const_reverse_iterator operator++(int)
{const_reverse_iterator tmp(*this);
cur=cur->prev;return tmp;}
bool operator!=(const const_reverse_iterator& it)
{return cur!=it.cur;}
bool operator==(const const_reverse_iterator& it)
{return cur==it.cur;}
const T& operator*()
{return static_cast<__list_node<T>*>(cur)->data;}
};
void push_front(const T& x)
{
__list_node<T>* a = new __list_node<T>(x);
a->next = head.next;
a->prev = &head;
head.next = a;
a->next->prev = a;
++_size;
}
void push_back(const T& x)
{
__list_node<T>* a = new __list_node<T>(x);
a->next = &head;
a->prev = head.prev;
head.prev = a;
a->prev->next = a;
++_size;
}
iterator begin() {return iterator(head.next);}
const_iterator begin() const {return const_iterator(head.next);}
iterator end() {return iterator(&head);}
const_iterator end() const {return const_iterator(&head);}
reverse_iterator rbegin()
{return reverse_iterator(head.prev);}
reverse_iterator rend() {return reverse_iterator(&head);}
void remove(const T& x)
{
__list_node<T>* a =
static_cast<__list_node<T>*>(head.next);
while (a!=&head)
{
__list_node<T>* b =
static_cast<__list_node<T>*>(a->next);
if (a->data==x)
{
a->prev->next = a->next;
a->next->prev = a->prev;
delete a;
--_size;
}
a=b;
}
}
unsigned size() const {return _size;}
bool empty() const {return _size==0;}
};
}
#endif
/contrib/media/updf/include/llex.h
0,0 → 1,78
/*
** $Id: llex.h,v 1.65 2010/04/05 16:35:37 roberto Exp $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
 
#ifndef llex_h
#define llex_h
 
#include "lobject.h"
#include "lzio.h"
 
 
#define FIRST_RESERVED 257
 
/* maximum length of a reserved word */
#define TOKEN_LEN (sizeof("function")/sizeof(char))
 
 
/*
* WARNING: if you change the order of this enumeration,
* grep "ORDER RESERVED"
*/
enum RESERVED {
/* terminal symbols denoted by reserved words */
TK_AND = FIRST_RESERVED, TK_BREAK,
TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION,
TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT,
TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE,
/* other terminal symbols */
TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_EOS,
TK_NUMBER, TK_NAME, TK_STRING
};
 
/* number of reserved words */
#define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1))
 
 
typedef union {
lua_Number r;
TString *ts;
} SemInfo; /* semantics information */
 
 
typedef struct Token {
int token;
SemInfo seminfo;
} Token;
 
 
typedef struct LexState {
int current; /* current character (charint) */
int linenumber; /* input line counter */
int lastline; /* line of last token `consumed' */
Token t; /* current token */
Token lookahead; /* look ahead token */
struct FuncState *fs; /* `FuncState' is private to the parser */
struct lua_State *L;
ZIO *z; /* input stream */
Mbuffer *buff; /* buffer for tokens */
struct Varlist *varl; /* list of all active local variables */
TString *source; /* current source name */
TString *envn; /* environment variable name */
char decpoint; /* locale decimal point */
} LexState;
 
 
LUAI_FUNC void luaX_init (lua_State *L);
LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z,
TString *source);
LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l);
LUAI_FUNC void luaX_next (LexState *ls);
LUAI_FUNC int luaX_lookahead (LexState *ls);
LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s);
LUAI_FUNC const char *luaX_token2str (LexState *ls, int token);
 
 
#endif
/contrib/media/updf/include/llimits.h
0,0 → 1,281
/*
** $Id: llimits.h,v 1.84 2010/11/08 16:33:20 roberto Exp $
** Limits, basic types, and some other `installation-dependent' definitions
** See Copyright Notice in lua.h
*/
 
#ifndef llimits_h
#define llimits_h
 
 
#include <limits.h>
#include <stddef.h>
 
 
#include "lua.h"
 
 
typedef unsigned LUA_INT32 lu_int32;
 
typedef LUAI_UMEM lu_mem;
 
typedef LUAI_MEM l_mem;
 
 
 
/* chars used as small naturals (so that `char' is reserved for characters) */
typedef unsigned char lu_byte;
 
 
#define MAX_SIZET ((size_t)(~(size_t)0)-2)
 
#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2)
#define MIN_LMEM ((l_mem)~((~(lu_mem)0)>>1))
 
 
#define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */
 
/*
** conversion of pointer to integer
** this is for hashing only; there is no problem if the integer
** cannot hold the whole pointer value
*/
#define IntPoint(p) ((unsigned int)(lu_mem)(p))
 
 
 
/* type to ensure maximum alignment */
#if !defined(LUAI_USER_ALIGNMENT_T)
#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; }
#endif
 
typedef LUAI_USER_ALIGNMENT_T L_Umaxalign;
 
 
/* result of a `usual argument conversion' over lua_Number */
typedef LUAI_UACNUMBER l_uacNumber;
 
 
/* internal assertions for in-house debugging */
#if defined(lua_assert)
#define check_exp(c,e) (lua_assert(c), (e))
#else
#define lua_assert(c) /* empty */
#define check_exp(c,e) (e)
#endif
 
/*
** assertion for checking API calls
*/
#if defined(LUA_USE_APICHECK)
#include <assert.h>
#define luai_apicheck(L,e) { (void)L; assert(e); }
#elif !defined(luai_apicheck)
#define luai_apicheck(L,e) lua_assert(e)
#endif
 
#define api_check(l,e,msg) luai_apicheck(l,(e) && msg)
 
 
#if !defined(UNUSED)
#define UNUSED(x) ((void)(x)) /* to avoid warnings */
#endif
 
 
#define cast(t, exp) ((t)(exp))
 
#define cast_byte(i) cast(lu_byte, (i))
#define cast_num(i) cast(lua_Number, (i))
#define cast_int(i) cast(int, (i))
 
 
/*
** maximum depth for nested C calls and syntactical nested non-terminals
** in a program. (Value must fit in an unsigned short int.)
*/
#if !defined(LUAI_MAXCCALLS)
#define LUAI_MAXCCALLS 200
#endif
 
/*
** maximum number of upvalues in a closure (both C and Lua). (Value
** must fit in an unsigned char.)
*/
#define MAXUPVAL UCHAR_MAX
 
 
/*
** type for virtual-machine instructions
** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h)
*/
typedef lu_int32 Instruction;
 
 
 
/* maximum stack for a Lua function */
#define MAXSTACK 250
 
 
 
/* minimum size for the string table (must be power of 2) */
#if !defined(MINSTRTABSIZE)
#define MINSTRTABSIZE 32
#endif
 
 
/* minimum size for string buffer */
#if !defined(LUA_MINBUFFER)
#define LUA_MINBUFFER 32
#endif
 
 
#if !defined(lua_lock)
#define lua_lock(L) ((void) 0)
#define lua_unlock(L) ((void) 0)
#endif
 
#if !defined(luai_threadyield)
#define luai_threadyield(L) {lua_unlock(L); lua_lock(L);}
#endif
 
 
/*
** these macros allow user-specific actions on threads when you defined
** LUAI_EXTRASPACE and need to do something extra when a thread is
** created/deleted/resumed/yielded.
*/
#if !defined(luai_userstateopen)
#define luai_userstateopen(L) ((void)L)
#endif
 
#if !defined(luai_userstateclose)
#define luai_userstateclose(L) ((void)L)
#endif
 
#if !defined(luai_userstatethread)
#define luai_userstatethread(L,L1) ((void)L)
#endif
 
#if !defined(luai_userstatefree)
#define luai_userstatefree(L,L1) ((void)L)
#endif
 
#if !defined(luai_userstateresume)
#define luai_userstateresume(L,n) ((void)L)
#endif
 
#if !defined(luai_userstateyield)
#define luai_userstateyield(L,n) ((void)L)
#endif
 
/*
** lua_number2int is a macro to convert lua_Number to int.
** lua_number2integer is a macro to convert lua_Number to lua_Integer.
** lua_number2unsigned is a macro to convert a lua_Number to a lua_Unsigned.
** lua_unsigned2number is a macro to convert a lua_Unsigned to a lua_Number.
*/
 
#if defined(MS_ASMTRICK) /* { */
/* trick with Microsoft assembler for X86 */
 
#define lua_number2int(i,n) __asm {__asm fld n __asm fistp i}
#define lua_number2integer(i,n) lua_number2int(i, n)
#define lua_number2unsigned(i,n) \
{__int64 l; __asm {__asm fld n __asm fistp l} i = (unsigned int)l;}
 
 
#elif defined(LUA_IEEE754TRICK) /* }{ */
/* the next trick should work on any machine using IEEE754 with
a 32-bit integer type */
 
union luai_Cast { double l_d; LUA_INT32 l_p[2]; };
 
#if !defined(LUA_IEEEENDIAN) /* { */
#define LUAI_EXTRAIEEE \
static const union luai_Cast ieeeendian = {-(33.0 + 6755399441055744.0)};
#define LUA_IEEEENDIAN (ieeeendian.l_p[1] == 33)
#else
#define LUAI_EXTRAIEEE /* empty */
#endif /* } */
 
#define lua_number2int32(i,n,t) \
{ LUAI_EXTRAIEEE \
volatile union luai_Cast u; u.l_d = (n) + 6755399441055744.0; \
(i) = (t)u.l_p[LUA_IEEEENDIAN]; }
 
#define lua_number2int(i,n) lua_number2int32(i, n, int)
#define lua_number2integer(i,n) lua_number2int32(i, n, lua_Integer)
#define lua_number2unsigned(i,n) lua_number2int32(i, n, lua_Unsigned)
 
#endif /* } */
 
 
/* the following definitions always work, but may be slow */
 
#if !defined(lua_number2int)
#define lua_number2int(i,n) ((i)=(int)(n))
#endif
 
#if !defined(lua_number2integer)
#define lua_number2integer(i,n) ((i)=(lua_Integer)(n))
#endif
 
#if !defined(lua_number2unsigned) /* { */
/* the following definition assures proper modulo behavior */
#if defined(LUA_NUMBER_DOUBLE)
#include <math.h>
#define SUPUNSIGNED ((lua_Number)(~(lua_Unsigned)0) + 1)
#define lua_number2unsigned(i,n) \
((i)=(lua_Unsigned)((n) - floor((n)/SUPUNSIGNED)*SUPUNSIGNED))
#else
#define lua_number2unsigned(i,n) ((i)=(lua_Unsigned)(n))
#endif
#endif /* } */
 
 
#if !defined(lua_unsigned2number)
/* on several machines, coercion from unsigned to double is slow,
so it may be worth to avoid */
#define lua_unsigned2number(u) \
(((u) <= (lua_Unsigned)INT_MAX) ? (lua_Number)(int)(u) : (lua_Number)(u))
#endif
 
 
/*
** luai_hashnum is a macro do hash a lua_Number value into an integer.
** The hash must be deterministic and give reasonable values for
** both small and large values (outside the range of integers).
** It is used only in ltable.c.
*/
 
#if !defined(luai_hashnum) /* { */
 
#include <float.h>
#include <math.h>
 
#define luai_hashnum(i,n) { int e; \
n = frexp(n, &e) * (lua_Number)(INT_MAX - DBL_MAX_EXP); \
lua_number2int(i, n); i += e; }
 
#endif /* } */
 
 
 
/*
** macro to control inclusion of some hard tests on stack reallocation
*/
#if !defined(HARDSTACKTESTS)
#define condmovestack(L) ((void)0)
#else
/* realloc stack keeping its size */
#define condmovestack(L) luaD_reallocstack((L), (L)->stacksize)
#endif
 
#if !defined(HARDMEMTESTS)
#define condchangemem(L) condmovestack(L)
#else
#define condchangemem(L) \
((void)(gcstopped(G(L)) || (luaC_fullgc(L, 0), 1)))
#endif
 
#endif
/contrib/media/updf/include/lmem.h
0,0 → 1,50
/*
** $Id: lmem.h,v 1.36 2010/04/08 17:16:46 roberto Exp $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
 
#ifndef lmem_h
#define lmem_h
 
 
#include <stddef.h>
 
#include "llimits.h"
#include "lua.h"
 
 
#define luaM_reallocv(L,b,on,n,e) \
((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \
luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
luaM_toobig(L))
 
#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
#define luaM_freearray(L, b, n) luaM_reallocv(L, (b), n, 0, sizeof((b)[0]))
 
#define luaM_malloc(L,s) luaM_realloc_(L, NULL, 0, (s))
#define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t)))
#define luaM_newvector(L,n,t) \
cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
 
#define luaM_newobject(L,tag,s) luaM_realloc_(L, NULL, tag, (s))
 
#define luaM_growvector(L,v,nelems,size,t,limit,e) \
if ((nelems)+1 > (size)) \
((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e)))
 
#define luaM_reallocvector(L, v,oldn,n,t) \
((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))
 
LUAI_FUNC void *luaM_toobig (lua_State *L);
 
/* not to be called directly */
LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,
size_t size);
LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size,
size_t size_elem, int limit,
const char *what);
 
#endif
 
/contrib/media/updf/include/lobject.h
0,0 → 1,419
/*
** $Id: lobject.h,v 2.42 2010/07/26 15:53:23 roberto Exp $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
 
 
#ifndef lobject_h
#define lobject_h
 
 
#include <stdarg.h>
 
 
#include "llimits.h"
#include "lua.h"
 
 
/*
** Extra tags for non-values
*/
#define LUA_TPROTO LUA_NUMTAGS
#define LUA_TUPVAL (LUA_NUMTAGS+1)
#define LUA_TDEADKEY (LUA_NUMTAGS+2)
 
 
/*
** Variant tag for light C functions (negative to be considered
** non collectable by 'iscollectable')
*/
#define LUA_TLCF (~0x0F | LUA_TFUNCTION)
 
/*
** Union of all collectable objects
*/
typedef union GCObject GCObject;
 
 
/*
** Common Header for all collectable objects (in macro form, to be
** included in other objects)
*/
#define CommonHeader GCObject *next; lu_byte tt; lu_byte marked
 
 
/*
** Common header in struct form
*/
typedef struct GCheader {
CommonHeader;
} GCheader;
 
 
 
/*
** Union of all Lua values
*/
typedef union {
GCObject *gc; /* collectable objects */
void *p; /* light userdata */
lua_Number n; /* numbers */
int b; /* booleans */
lua_CFunction f; /* light C functions */
} Value;
 
 
 
/*
** Tagged Values. This is the basic representation of values in Lua,
** an actual value plus a tag with its type.
*/
 
#define TValuefields Value value_; int tt_
 
typedef struct lua_TValue {
TValuefields;
} TValue;
 
 
/* macro defining a nil value */
#define NILCONSTANT {NULL}, LUA_TNIL
 
 
/*
** type tag of a TValue
*/
#define ttype(o) ((o)->tt_)
 
 
/*
** type tag of a TValue with no variants
*/
#define ttypenv(o) (ttype(o) & 0x0F)
 
 
/* Macros to test type */
#define ttisnil(o) (ttype(o) == LUA_TNIL)
#define ttisnumber(o) (ttype(o) == LUA_TNUMBER)
#define ttisstring(o) (ttype(o) == LUA_TSTRING)
#define ttistable(o) (ttype(o) == LUA_TTABLE)
#define ttisfunction(o) (ttypenv(o) == LUA_TFUNCTION)
#define ttisclosure(o) (ttype(o) == LUA_TFUNCTION)
#define ttislcf(o) (ttype(o) == LUA_TLCF)
#define ttisboolean(o) (ttype(o) == LUA_TBOOLEAN)
#define ttisuserdata(o) (ttype(o) == LUA_TUSERDATA)
#define ttisthread(o) (ttype(o) == LUA_TTHREAD)
#define ttislightuserdata(o) (ttype(o) == LUA_TLIGHTUSERDATA)
#define ttisdeadkey(o) (ttype(o) == LUA_TDEADKEY)
 
/* Macros to access values */
#define gcvalue(o) check_exp(iscollectable(o), (o)->value_.gc)
#define pvalue(o) check_exp(ttislightuserdata(o), (o)->value_.p)
#define nvalue(o) check_exp(ttisnumber(o), (o)->value_.n)
#define rawtsvalue(o) check_exp(ttisstring(o), &(o)->value_.gc->ts)
#define tsvalue(o) (&rawtsvalue(o)->tsv)
#define rawuvalue(o) check_exp(ttisuserdata(o), &(o)->value_.gc->u)
#define uvalue(o) (&rawuvalue(o)->uv)
#define clvalue(o) check_exp(ttisclosure(o), &(o)->value_.gc->cl)
#define fvalue(o) check_exp(ttislcf(o), (o)->value_.f)
#define hvalue(o) check_exp(ttistable(o), &(o)->value_.gc->h)
#define bvalue(o) check_exp(ttisboolean(o), (o)->value_.b)
#define thvalue(o) check_exp(ttisthread(o), &(o)->value_.gc->th)
 
#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))
 
 
#define iscollectable(o) (ttype(o) >= LUA_TSTRING)
 
 
/* Macros for internal tests */
#define righttt(obj) (ttype(obj) == gcvalue(obj)->gch.tt)
 
#define checkconsistency(obj) lua_assert(!iscollectable(obj) || righttt(obj))
 
#define checkliveness(g,obj) \
lua_assert(!iscollectable(obj) || (righttt(obj) && !isdead(g,gcvalue(obj))))
 
 
/* Macros to set values */
#define setnilvalue(obj) ((obj)->tt_=LUA_TNIL)
 
#define setnvalue(obj,x) \
{ TValue *i_o=(obj); i_o->value_.n=(x); i_o->tt_=LUA_TNUMBER; }
 
#define setfvalue(obj,x) \
{ TValue *i_o=(obj); i_o->value_.f=(x); i_o->tt_=LUA_TLCF; }
 
#define changenvalue(o,x) check_exp((o)->tt_==LUA_TNUMBER, (o)->value_.n=(x))
 
#define setpvalue(obj,x) \
{ TValue *i_o=(obj); i_o->value_.p=(x); i_o->tt_=LUA_TLIGHTUSERDATA; }
 
#define setbvalue(obj,x) \
{ TValue *i_o=(obj); i_o->value_.b=(x); i_o->tt_=LUA_TBOOLEAN; }
 
#define setsvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value_.gc=cast(GCObject *, (x)); i_o->tt_=LUA_TSTRING; \
checkliveness(G(L),i_o); }
 
#define setuvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value_.gc=cast(GCObject *, (x)); i_o->tt_=LUA_TUSERDATA; \
checkliveness(G(L),i_o); }
 
#define setthvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value_.gc=cast(GCObject *, (x)); i_o->tt_=LUA_TTHREAD; \
checkliveness(G(L),i_o); }
 
#define setclvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value_.gc=cast(GCObject *, (x)); i_o->tt_=LUA_TFUNCTION; \
checkliveness(G(L),i_o); }
 
#define sethvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value_.gc=cast(GCObject *, (x)); i_o->tt_=LUA_TTABLE; \
checkliveness(G(L),i_o); }
 
#define setptvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value_.gc=cast(GCObject *, (x)); i_o->tt_=LUA_TPROTO; \
checkliveness(G(L),i_o); }
 
#define setdeadvalue(obj) ((obj)->tt_=LUA_TDEADKEY)
 
 
 
#define setobj(L,obj1,obj2) \
{ const TValue *o2=(obj2); TValue *o1=(obj1); \
o1->value_ = o2->value_; o1->tt_=o2->tt_; \
checkliveness(G(L),o1); }
 
 
/*
** different types of assignments, according to destination
*/
 
/* from stack to (same) stack */
#define setobjs2s setobj
/* to stack (not from same stack) */
#define setobj2s setobj
#define setsvalue2s setsvalue
#define sethvalue2s sethvalue
#define setptvalue2s setptvalue
/* from table to same table */
#define setobjt2t setobj
/* to table */
#define setobj2t setobj
/* to new object */
#define setobj2n setobj
#define setsvalue2n setsvalue
 
 
 
typedef TValue *StkId; /* index to stack elements */
 
 
/*
** Header for string value; string bytes follow the end of this structure
*/
typedef union TString {
L_Umaxalign dummy; /* ensures maximum alignment for strings */
struct {
CommonHeader;
lu_byte reserved;
unsigned int hash;
size_t len;
} tsv;
} TString;
 
 
/* get the actual string (array of bytes) from a TString */
#define getstr(ts) cast(const char *, (ts) + 1)
 
/* get the actual string (array of bytes) from a Lua value */
#define svalue(o) getstr(rawtsvalue(o))
 
 
/*
** Header for userdata; memory area follows the end of this structure
*/
typedef union Udata {
L_Umaxalign dummy; /* ensures maximum alignment for `local' udata */
struct {
CommonHeader;
struct Table *metatable;
struct Table *env;
size_t len;
} uv;
} Udata;
 
 
 
/*
** Description of an upvalue for function prototypes
*/
typedef struct Upvaldesc {
TString *name; /* upvalue name (for debug information) */
lu_byte instack; /* whether it is in stack */
lu_byte idx; /* index of upvalue (in stack or in outer function's list) */
} Upvaldesc;
 
 
/*
** Description of a local variable for function prototypes
** (used for debug information)
*/
typedef struct LocVar {
TString *varname;
int startpc; /* first point where variable is active */
int endpc; /* first point where variable is dead */
} LocVar;
 
 
/*
** Function Prototypes
*/
typedef struct Proto {
CommonHeader;
TValue *k; /* constants used by the function */
Instruction *code;
struct Proto **p; /* functions defined inside the function */
int *lineinfo; /* map from opcodes to source lines */
LocVar *locvars; /* information about local variables */
Upvaldesc *upvalues; /* upvalue information */
union Closure *cache; /* last created closure with this prototype */
TString *source;
int sizeupvalues; /* size of 'upvalues' */
int sizek; /* size of `k' */
int sizecode;
int sizelineinfo;
int sizep; /* size of `p' */
int sizelocvars;
int linedefined;
int lastlinedefined;
GCObject *gclist;
lu_byte numparams; /* number of fixed parameters */
lu_byte is_vararg;
lu_byte maxstacksize; /* maximum stack used by this function */
} Proto;
 
 
 
/*
** Lua Upvalues
*/
typedef struct UpVal {
CommonHeader;
TValue *v; /* points to stack or to its own value */
union {
TValue value; /* the value (when closed) */
struct { /* double linked list (when open) */
struct UpVal *prev;
struct UpVal *next;
} l;
} u;
} UpVal;
 
 
/*
** Closures
*/
 
#define ClosureHeader \
CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist
 
typedef struct CClosure {
ClosureHeader;
lua_CFunction f;
TValue upvalue[1]; /* list of upvalues */
} CClosure;
 
 
typedef struct LClosure {
ClosureHeader;
struct Proto *p;
UpVal *upvals[1]; /* list of upvalues */
} LClosure;
 
 
typedef union Closure {
CClosure c;
LClosure l;
} Closure;
 
 
#define isLfunction(o) (ttisclosure(o) && !clvalue(o)->c.isC)
 
#define getproto(o) (clvalue(o)->l.p)
 
 
/*
** Tables
*/
 
typedef union TKey {
struct {
TValuefields;
struct Node *next; /* for chaining */
} nk;
TValue tvk;
} TKey;
 
 
typedef struct Node {
TValue i_val;
TKey i_key;
} Node;
 
 
typedef struct Table {
CommonHeader;
lu_byte flags; /* 1<<p means tagmethod(p) is not present */
lu_byte lsizenode; /* log2 of size of `node' array */
struct Table *metatable;
TValue *array; /* array part */
Node *node;
Node *lastfree; /* any free position is before this position */
GCObject *gclist;
int sizearray; /* size of `array' array */
} Table;
 
 
 
/*
** `module' operation for hashing (size is always a power of 2)
*/
#define lmod(s,size) \
(check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1)))))
 
 
#define twoto(x) (1<<(x))
#define sizenode(t) (twoto((t)->lsizenode))
 
 
/*
** (address of) a fixed nil value
*/
#define luaO_nilobject (&luaO_nilobject_)
 
 
LUAI_DDEC const TValue luaO_nilobject_;
 
LUAI_FUNC int luaO_int2fb (unsigned int x);
LUAI_FUNC int luaO_fb2int (int x);
LUAI_FUNC int luaO_ceillog2 (lu_int32 x);
LUAI_FUNC lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2);
LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2);
LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result);
LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt,
va_list argp);
LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...);
LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len);
 
 
#endif
 
/contrib/media/updf/include/locale
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_LOCALE
#include <bits/std_locale.h>
#endif
/contrib/media/updf/include/locale.h
0,0 → 1,59
/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_locale_h_
#define __dj_include_locale_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#define LC_ALL 0x1f
#define LC_COLLATE 0x01
#define LC_CTYPE 0x02
#define LC_MONETARY 0x04
#define LC_NUMERIC 0x08
#define LC_TIME 0x10
#define NULL 0
 
struct lconv {
char *currency_symbol;
char *decimal_point;
char *grouping;
char *int_curr_symbol;
char *mon_decimal_point;
char *mon_grouping;
char *mon_thousands_sep;
char *negative_sign;
char *positive_sign;
char *thousands_sep;
char frac_digits;
char int_frac_digits;
char n_cs_precedes;
char n_sep_by_space;
char n_sign_posn;
char p_cs_precedes;
char p_sep_by_space;
char p_sign_posn;
};
 
struct lconv * localeconv(void);
char * setlocale(int _category, const char *_locale);
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_locale_h_ */
/contrib/media/updf/include/log.h
0,0 → 1,37
 
#ifndef __log_h__
#define __log_h__
 
#ifdef YACAS_LOGGING // DEBUG
#include <stdarg.h>
#include <stdio.h>
#endif
 
inline void LogPrintf(char* str,...)
{
#ifdef YACAS_LOGGING // DEBUG
va_list arg;
char buf[256];
va_start (arg, str);
vsprintf (buf, str, arg);
va_end (arg);
printf(buf);
#endif
}
 
inline void LogErrorPrintf(char* str,...)
{
#ifdef YACAS_LOGGING // DEBUG
printf("ERROR: ");
va_list arg;
char buf[256];
va_start (arg, str);
vsprintf (buf, str, arg);
va_end (arg);
printf(buf);
exit(0);
#endif
}
 
 
#endif
/contrib/media/updf/include/lopcodes.h
0,0 → 1,289
/*
** $Id: lopcodes.h,v 1.137 2010/10/25 12:24:55 roberto Exp $
** Opcodes for Lua virtual machine
** See Copyright Notice in lua.h
*/
 
#ifndef lopcodes_h
#define lopcodes_h
 
#include "llimits.h"
 
 
/*===========================================================================
We assume that instructions are unsigned numbers.
All instructions have an opcode in the first 6 bits.
Instructions can have the following fields:
`A' : 8 bits
`B' : 9 bits
`C' : 9 bits
'Ax' : 26 bits ('A', 'B', and 'C' together)
`Bx' : 18 bits (`B' and `C' together)
`sBx' : signed Bx
 
A signed argument is represented in excess K; that is, the number
value is the unsigned value minus K. K is exactly the maximum value
for that argument (so that -max is represented by 0, and +max is
represented by 2*max), which is half the maximum for the corresponding
unsigned argument.
===========================================================================*/
 
 
enum OpMode {iABC, iABx, iAsBx, iAx}; /* basic instruction format */
 
 
/*
** size and position of opcode arguments.
*/
#define SIZE_C 9
#define SIZE_B 9
#define SIZE_Bx (SIZE_C + SIZE_B)
#define SIZE_A 8
#define SIZE_Ax (SIZE_C + SIZE_B + SIZE_A)
 
#define SIZE_OP 6
 
#define POS_OP 0
#define POS_A (POS_OP + SIZE_OP)
#define POS_C (POS_A + SIZE_A)
#define POS_B (POS_C + SIZE_C)
#define POS_Bx POS_C
#define POS_Ax POS_A
 
 
/*
** limits for opcode arguments.
** we use (signed) int to manipulate most arguments,
** so they must fit in LUAI_BITSINT-1 bits (-1 for sign)
*/
#if SIZE_Bx < LUAI_BITSINT-1
#define MAXARG_Bx ((1<<SIZE_Bx)-1)
#define MAXARG_sBx (MAXARG_Bx>>1) /* `sBx' is signed */
#else
#define MAXARG_Bx MAX_INT
#define MAXARG_sBx MAX_INT
#endif
 
#if SIZE_Ax < LUAI_BITSINT-1
#define MAXARG_Ax ((1<<SIZE_Ax)-1)
#else
#define MAXARG_Ax MAX_INT
#endif
 
 
#define MAXARG_A ((1<<SIZE_A)-1)
#define MAXARG_B ((1<<SIZE_B)-1)
#define MAXARG_C ((1<<SIZE_C)-1)
 
 
/* creates a mask with `n' 1 bits at position `p' */
#define MASK1(n,p) ((~((~(Instruction)0)<<(n)))<<(p))
 
/* creates a mask with `n' 0 bits at position `p' */
#define MASK0(n,p) (~MASK1(n,p))
 
/*
** the following macros help to manipulate instructions
*/
 
#define GET_OPCODE(i) (cast(OpCode, ((i)>>POS_OP) & MASK1(SIZE_OP,0)))
#define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
((cast(Instruction, o)<<POS_OP)&MASK1(SIZE_OP,POS_OP))))
 
#define getarg(i,pos,size) (cast(int, ((i)>>pos) & MASK1(size,0)))
#define setarg(i,v,pos,size) ((i) = (((i)&MASK0(size,pos)) | \
((cast(Instruction, v)<<pos)&MASK1(size,pos))))
 
#define GETARG_A(i) getarg(i, POS_A, SIZE_A)
#define SETARG_A(i,v) setarg(i, v, POS_A, SIZE_A)
 
#define GETARG_B(i) getarg(i, POS_B, SIZE_B)
#define SETARG_B(i,v) setarg(i, v, POS_B, SIZE_B)
 
#define GETARG_C(i) getarg(i, POS_C, SIZE_C)
#define SETARG_C(i,v) setarg(i, v, POS_C, SIZE_C)
 
#define GETARG_Bx(i) getarg(i, POS_Bx, SIZE_Bx)
#define SETARG_Bx(i,v) setarg(i, v, POS_Bx, SIZE_Bx)
 
#define GETARG_Ax(i) getarg(i, POS_Ax, SIZE_Ax)
#define SETARG_Ax(i,v) setarg(i, v, POS_Ax, SIZE_Ax)
 
#define GETARG_sBx(i) (GETARG_Bx(i)-MAXARG_sBx)
#define SETARG_sBx(i,b) SETARG_Bx((i),cast(unsigned int, (b)+MAXARG_sBx))
 
 
#define CREATE_ABC(o,a,b,c) ((cast(Instruction, o)<<POS_OP) \
| (cast(Instruction, a)<<POS_A) \
| (cast(Instruction, b)<<POS_B) \
| (cast(Instruction, c)<<POS_C))
 
#define CREATE_ABx(o,a,bc) ((cast(Instruction, o)<<POS_OP) \
| (cast(Instruction, a)<<POS_A) \
| (cast(Instruction, bc)<<POS_Bx))
 
#define CREATE_Ax(o,a) ((cast(Instruction, o)<<POS_OP) \
| (cast(Instruction, a)<<POS_Ax))
 
 
/*
** Macros to operate RK indices
*/
 
/* this bit 1 means constant (0 means register) */
#define BITRK (1 << (SIZE_B - 1))
 
/* test whether value is a constant */
#define ISK(x) ((x) & BITRK)
 
/* gets the index of the constant */
#define INDEXK(r) ((int)(r) & ~BITRK)
 
#define MAXINDEXRK (BITRK - 1)
 
/* code a constant index as a RK value */
#define RKASK(x) ((x) | BITRK)
 
 
/*
** invalid register that fits in 8 bits
*/
#define NO_REG MAXARG_A
 
 
/*
** R(x) - register
** Kst(x) - constant (in constant table)
** RK(x) == if ISK(x) then Kst(INDEXK(x)) else R(x)
*/
 
 
/*
** grep "ORDER OP" if you change these enums
*/
 
typedef enum {
/*----------------------------------------------------------------------
name args description
------------------------------------------------------------------------*/
OP_MOVE,/* A B R(A) := R(B) */
OP_LOADK,/* A Bx R(A) := Kst(Bx - 1) */
OP_LOADBOOL,/* A B C R(A) := (Bool)B; if (C) pc++ */
OP_LOADNIL,/* A B R(A) := ... := R(B) := nil */
OP_GETUPVAL,/* A B R(A) := UpValue[B] */
 
OP_GETTABUP,/* A B C R(A) := UpValue[B][RK(C)] */
OP_GETTABLE,/* A B C R(A) := R(B)[RK(C)] */
 
OP_SETTABUP,/* A B C UpValue[A][RK(B)] := RK(C) */
OP_SETUPVAL,/* A B UpValue[B] := R(A) */
OP_SETTABLE,/* A B C R(A)[RK(B)] := RK(C) */
 
OP_NEWTABLE,/* A B C R(A) := {} (size = B,C) */
 
OP_SELF,/* A B C R(A+1) := R(B); R(A) := R(B)[RK(C)] */
 
OP_ADD,/* A B C R(A) := RK(B) + RK(C) */
OP_SUB,/* A B C R(A) := RK(B) - RK(C) */
OP_MUL,/* A B C R(A) := RK(B) * RK(C) */
OP_DIV,/* A B C R(A) := RK(B) / RK(C) */
OP_MOD,/* A B C R(A) := RK(B) % RK(C) */
OP_POW,/* A B C R(A) := RK(B) ^ RK(C) */
OP_UNM,/* A B R(A) := -R(B) */
OP_NOT,/* A B R(A) := not R(B) */
OP_LEN,/* A B R(A) := length of R(B) */
 
OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */
 
OP_JMP,/* sBx pc+=sBx */
 
OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */
OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */
OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */
 
OP_TEST,/* A C if not (R(A) <=> C) then pc++ */
OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */
 
OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */
OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */
OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */
 
OP_FORLOOP,/* A sBx R(A)+=R(A+2);
if R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/
OP_FORPREP,/* A sBx R(A)-=R(A+2); pc+=sBx */
 
OP_TFORCALL,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2)); */
OP_TFORLOOP,/* A sBx if R(A+1) ~= nil then { R(A)=R(A+1); pc += sBx }*/
 
OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */
 
OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/
OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx]) */
 
OP_VARARG,/* A B R(A), R(A+1), ..., R(A+B-2) = vararg */
 
OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */
} OpCode;
 
 
#define NUM_OPCODES (cast(int, OP_EXTRAARG) + 1)
 
 
 
/*===========================================================================
Notes:
(*) In OP_CALL, if (B == 0) then B = top. If (C == 0), then `top' is
set to last_result+1, so next open instruction (OP_CALL, OP_RETURN,
OP_SETLIST) may use `top'.
 
(*) In OP_VARARG, if (B == 0) then use actual number of varargs and
set top (like in OP_CALL with C == 0).
 
(*) In OP_RETURN, if (B == 0) then return up to `top'.
 
(*) In OP_SETLIST, if (B == 0) then B = `top'; if (C == 0) then next
'instruction' is EXTRAARG(real C).
 
(*) In OP_LOADK, if (Bx == 0) then next 'instruction' is EXTRAARG(real Bx).
 
(*) For comparisons, A specifies what condition the test should accept
(true or false).
 
(*) All `skips' (pc++) assume that next instruction is a jump.
 
===========================================================================*/
 
 
/*
** masks for instruction properties. The format is:
** bits 0-1: op mode
** bits 2-3: C arg mode
** bits 4-5: B arg mode
** bit 6: instruction set register A
** bit 7: operator is a test (next instruction must be a jump)
*/
 
enum OpArgMask {
OpArgN, /* argument is not used */
OpArgU, /* argument is used */
OpArgR, /* argument is a register or a jump offset */
OpArgK /* argument is a constant or register/constant */
};
 
LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES];
 
#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3))
#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))
#define getCMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3))
#define testAMode(m) (luaP_opmodes[m] & (1 << 6))
#define testTMode(m) (luaP_opmodes[m] & (1 << 7))
 
 
LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */
 
 
/* number of list items to accumulate before a SETLIST instruction */
#define LFIELDS_PER_FLUSH 50
 
 
#endif
/contrib/media/updf/include/lparser.h
0,0 → 1,97
/*
** $Id: lparser.h,v 1.65 2010/07/07 16:27:29 roberto Exp $
** Lua Parser
** See Copyright Notice in lua.h
*/
 
#ifndef lparser_h
#define lparser_h
 
#include "llimits.h"
#include "lobject.h"
#include "lzio.h"
 
 
/*
** Expression descriptor
*/
 
typedef enum {
VVOID, /* no value */
VNIL,
VTRUE,
VFALSE,
VK, /* info = index of constant in `k' */
VKNUM, /* nval = numerical value */
VNONRELOC, /* info = result register */
VLOCAL, /* info = local register */
VUPVAL, /* info = index of upvalue in 'upvalues' */
VINDEXED, /* t = table register/upvalue; idx = index R/K */
VJMP, /* info = instruction pc */
VRELOCABLE, /* info = instruction pc */
VCALL, /* info = instruction pc */
VVARARG /* info = instruction pc */
} expkind;
 
 
#define vkisvar(k) (VLOCAL <= (k) && (k) <= VINDEXED)
#define vkisinreg(k) ((k) == VNONRELOC || (k) == VLOCAL)
 
typedef struct expdesc {
expkind k;
union {
struct { /* for indexed variables (VINDEXED) */
short idx; /* index (R/K) */
lu_byte t; /* table (register or upvalue) */
lu_byte vt; /* whether 't' is register (VLOCAL) or upvalue (VUPVAL) */
} ind;
int info; /* for generic use */
lua_Number nval; /* for VKNUM */
} u;
int t; /* patch list of `exit when true' */
int f; /* patch list of `exit when false' */
} expdesc;
 
 
typedef struct vardesc {
unsigned short idx;
} vardesc;
 
 
/* list of all active local variables */
typedef struct Varlist {
vardesc *actvar;
int nactvar;
int actvarsize;
} Varlist;
 
 
struct BlockCnt; /* defined in lparser.c */
 
 
/* state needed to generate code for a given function */
typedef struct FuncState {
Proto *f; /* current function header */
Table *h; /* table to find (and reuse) elements in `k' */
struct FuncState *prev; /* enclosing function */
struct LexState *ls; /* lexical state */
struct lua_State *L; /* copy of the Lua state */
struct BlockCnt *bl; /* chain of current blocks */
int pc; /* next position to code (equivalent to `ncode') */
int lasttarget; /* `pc' of last `jump target' */
int jpc; /* list of pending jumps to `pc' */
int freereg; /* first free register */
int nk; /* number of elements in `k' */
int np; /* number of elements in `p' */
int firstlocal; /* index of first local var of this function */
short nlocvars; /* number of elements in `locvars' */
lu_byte nactvar; /* number of active local variables */
lu_byte nups; /* number of upvalues */
} FuncState;
 
 
LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
Varlist *varl, const char *name);
 
 
#endif
/contrib/media/updf/include/lstate.h
0,0 → 1,218
/*
** $Id: lstate.h,v 2.68 2010/10/29 17:52:46 roberto Exp $
** Global State
** See Copyright Notice in lua.h
*/
 
#ifndef lstate_h
#define lstate_h
 
#include "lua.h"
 
#include "lobject.h"
#include "ltm.h"
#include "lzio.h"
 
 
/*
 
** Some notes about garbage-collected objects: All objects in Lua must
** be kept somehow accessible until being freed.
**
** Lua keeps most objects linked in list g->allgc. The link uses field
** 'next' of the CommonHeader.
**
** Strings are kept in several lists headed by the array g->strt.hash.
**
** Open upvalues are not subject to independent garbage collection. They
** are collected together with their respective threads. Lua keeps a
** double-linked list with all open upvalues (g->uvhead) so that it can
** mark objects referred by them. (They are always gray, so they must
** be remarked in the atomic step. Usually their contents would be marked
** when traversing the respective threads, but the thread may already be
** dead, while the upvalue is still accessible through closures.)
**
** Userdata with finalizers are kept in the list g->udgc.
**
** The list g->tobefnz links all userdata being finalized.
 
*/
 
 
struct lua_longjmp; /* defined in ldo.c */
 
 
 
/* extra stack space to handle TM calls and some other extras */
#define EXTRA_STACK 5
 
 
#define BASIC_CI_SIZE 8
 
#define BASIC_STACK_SIZE (2*LUA_MINSTACK)
 
 
/* kinds of Garbage Collection */
#define KGC_NORMAL 0
#define KGC_EMERGENCY 1 /* gc was forced by an allocation failure */
#define KGC_GEN 2 /* generational collection */
 
 
typedef struct stringtable {
GCObject **hash;
lu_int32 nuse; /* number of elements */
int size;
} stringtable;
 
 
/*
** information about a call
*/
typedef struct CallInfo {
StkId func; /* function index in the stack */
StkId top; /* top for this function */
struct CallInfo *previous, *next; /* dynamic call link */
short nresults; /* expected number of results from this function */
lu_byte callstatus;
union {
struct { /* only for Lua functions */
StkId base; /* base for this function */
const Instruction *savedpc;
} l;
struct { /* only for C functions */
int ctx; /* context info. in case of yields */
lua_CFunction k; /* continuation in case of yields */
ptrdiff_t old_errfunc;
ptrdiff_t extra;
lu_byte old_allowhook;
lu_byte status;
} c;
} u;
} CallInfo;
 
 
/*
** Bits in CallInfo status
*/
#define CIST_LUA (1<<0) /* call is running a Lua function */
#define CIST_HOOKED (1<<1) /* call is running a debug hook */
#define CIST_REENTRY (1<<2) /* call is running on same invocation of
luaV_execute of previous call */
#define CIST_YIELDED (1<<3) /* call reentered after suspension */
#define CIST_YPCALL (1<<4) /* call is a yieldable protected call */
#define CIST_STAT (1<<5) /* call has an error status (pcall) */
#define CIST_TAIL (1<<6) /* call was tail called */
 
 
#define ci_func(ci) (clvalue((ci)->func))
#define isLua(ci) ((ci)->callstatus & CIST_LUA)
 
 
/*
** `global state', shared by all threads of this state
*/
typedef struct global_State {
lua_Alloc frealloc; /* function to reallocate memory */
void *ud; /* auxiliary data to `frealloc' */
lu_mem totalbytes; /* number of bytes currently allocated */
l_mem GCdebt; /* when positive, run a GC step */
lu_mem lastmajormem; /* memory in use after last major collection */
stringtable strt; /* hash table for strings */
TValue l_registry;
unsigned short nCcalls; /* number of nested C calls */
lu_byte currentwhite;
lu_byte gcstate; /* state of garbage collector */
lu_byte gckind; /* kind of GC running */
int sweepstrgc; /* position of sweep in `strt' */
GCObject *allgc; /* list of all collectable objects */
GCObject *udgc; /* list of collectable userdata with finalizers */
GCObject **sweepgc; /* current position of sweep */
GCObject *gray; /* list of gray objects */
GCObject *grayagain; /* list of objects to be traversed atomically */
GCObject *weak; /* list of tables with weak values */
GCObject *ephemeron; /* list of ephemeron tables (weak keys) */
GCObject *allweak; /* list of all-weak tables */
GCObject *tobefnz; /* list of userdata to be GC */
UpVal uvhead; /* head of double-linked list of all open upvalues */
Mbuffer buff; /* temporary buffer for string concatenation */
int gcpause; /* size of pause between successive GCs */
int gcmajorinc; /* how much to wait for a major GC (only in gen. mode) */
int gcstepmul; /* GC `granularity' */
lua_CFunction panic; /* to be called in unprotected errors */
struct lua_State *mainthread;
const lua_Number *version; /* pointer to version number */
TString *memerrmsg; /* memory-error message */
TString *tmname[TM_N]; /* array with tag-method names */
struct Table *mt[LUA_NUMTAGS]; /* metatables for basic types */
} global_State;
 
 
/*
** `per thread' state
*/
struct lua_State {
CommonHeader;
lu_byte status;
StkId top; /* first free slot in the stack */
global_State *l_G;
CallInfo *ci; /* call info for current function */
const Instruction *oldpc; /* last pc traced */
StkId stack_last; /* last free slot in the stack */
StkId stack; /* stack base */
int stacksize;
unsigned short nny; /* number of non-yieldable calls in stack */
lu_byte hookmask;
lu_byte allowhook;
int basehookcount;
int hookcount;
lua_Hook hook;
GCObject *openupval; /* list of open upvalues in this stack */
GCObject *gclist;
struct lua_longjmp *errorJmp; /* current error recover point */
ptrdiff_t errfunc; /* current error handling function (stack index) */
CallInfo base_ci; /* CallInfo for first level (C calling Lua) */
};
 
 
#define G(L) (L->l_G)
 
 
/*
** Union of all collectable objects
*/
union GCObject {
GCheader gch; /* common header */
union TString ts;
union Udata u;
union Closure cl;
struct Table h;
struct Proto p;
struct UpVal uv;
struct lua_State th; /* thread */
};
 
 
#define gch(o) (&(o)->gch)
 
/* macros to convert a GCObject into a specific value */
#define rawgco2ts(o) check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts))
#define gco2ts(o) (&rawgco2ts(o)->tsv)
#define rawgco2u(o) check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))
#define gco2u(o) (&rawgco2u(o)->uv)
#define gco2cl(o) check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl))
#define gco2t(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))
#define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p))
#define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))
#define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th))
 
/* macro to convert any Lua object into a GCObject */
#define obj2gco(v) (cast(GCObject *, (v)))
 
 
LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);
LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L);
LUAI_FUNC void luaE_freeCI (lua_State *L);
 
 
#endif
 
/contrib/media/updf/include/lstring.h
0,0 → 1,37
/*
** $Id: lstring.h,v 1.46 2010/04/05 16:26:37 roberto Exp $
** String table (keep all strings handled by Lua)
** See Copyright Notice in lua.h
*/
 
#ifndef lstring_h
#define lstring_h
 
#include "lgc.h"
#include "lobject.h"
#include "lstate.h"
 
 
#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
 
#define sizeudata(u) (sizeof(union Udata)+(u)->len)
 
#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
(sizeof(s)/sizeof(char))-1))
 
#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
 
 
/*
** as all string are internalized, string equality becomes
** pointer equality
*/
#define eqstr(a,b) ((a) == (b))
 
LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
LUAI_FUNC TString *luaS_new (lua_State *L, const char *str);
 
 
#endif
/contrib/media/updf/include/ltable.h
0,0 → 1,39
/*
** $Id: ltable.h,v 2.14 2010/06/25 12:18:10 roberto Exp $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/
 
#ifndef ltable_h
#define ltable_h
 
#include "lobject.h"
 
 
#define gnode(t,i) (&(t)->node[i])
#define gkey(n) (&(n)->i_key.tvk)
#define gval(n) (&(n)->i_val)
#define gnext(n) ((n)->i_key.nk.next)
 
 
LUAI_FUNC const TValue *luaH_getint (Table *t, int key);
LUAI_FUNC TValue *luaH_setint (lua_State *L, Table *t, int key);
LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
LUAI_FUNC Table *luaH_new (lua_State *L);
LUAI_FUNC void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize);
LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
LUAI_FUNC void luaH_free (lua_State *L, Table *t);
LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
LUAI_FUNC int luaH_getn (Table *t);
 
 
#if defined(LUA_DEBUG)
LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
LUAI_FUNC int luaH_isdummy (Node *n);
#endif
 
 
#endif
/contrib/media/updf/include/ltm.h
0,0 → 1,57
/*
** $Id: ltm.h,v 2.10 2010/04/13 20:48:12 roberto Exp $
** Tag methods
** See Copyright Notice in lua.h
*/
 
#ifndef ltm_h
#define ltm_h
 
 
#include "lobject.h"
 
 
/*
* WARNING: if you change the order of this enumeration,
* grep "ORDER TM"
*/
typedef enum {
TM_INDEX,
TM_NEWINDEX,
TM_GC,
TM_MODE,
TM_LEN,
TM_EQ, /* last tag method with `fast' access */
TM_ADD,
TM_SUB,
TM_MUL,
TM_DIV,
TM_MOD,
TM_POW,
TM_UNM,
TM_LT,
TM_LE,
TM_CONCAT,
TM_CALL,
TM_N /* number of elements in the enum */
} TMS;
 
 
 
#define gfasttm(g,et,e) ((et) == NULL ? NULL : \
((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
 
#define fasttm(l,et,e) gfasttm(G(l), et, e)
 
#define ttypename(x) luaT_typenames_[(x) + 1]
#define objtypename(x) ttypename(ttypenv(x))
 
LUAI_DDEC const char *const luaT_typenames_[];
 
 
LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
TMS event);
LUAI_FUNC void luaT_init (lua_State *L);
 
#endif
/contrib/media/updf/include/lua.h
0,0 → 1,441
/*
** $Id: lua.h,v 1.276 2010/10/26 19:32:19 roberto Exp $
** Lua - A Scripting Language
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
** See Copyright Notice at the end of this file
*/
 
 
#ifndef lua_h
#define lua_h
 
#include <stdarg.h>
#include <stddef.h>
 
 
#include "luaconf.h"
 
 
#define LUA_VERSION_MAJOR "5"
#define LUA_VERSION_MINOR "2"
#define LUA_VERSION_RELEASE "0" " (alpha)"
 
#define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
#define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE
#define LUA_VERSION_NUM 502
#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2010 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
 
 
/* mark for precompiled code ('<esc>Lua') */
#define LUA_SIGNATURE "\033Lua"
 
/* option for multiple returns in 'lua_pcall' and 'lua_call' */
#define LUA_MULTRET (-1)
 
 
/*
** pseudo-indices
*/
#define LUA_REGISTRYINDEX LUAI_FIRSTPSEUDOIDX
#define lua_upvalueindex(i) (LUA_REGISTRYINDEX - (i))
 
 
/* thread status */
#define LUA_OK 0
#define LUA_YIELD 1
#define LUA_ERRRUN 2
#define LUA_ERRSYNTAX 3
#define LUA_ERRMEM 4
#define LUA_ERRGCMM 5
#define LUA_ERRERR 6
 
 
typedef struct lua_State lua_State;
 
typedef int (*lua_CFunction) (lua_State *L);
 
 
/*
** functions that read/write blocks when loading/dumping Lua chunks
*/
typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz);
 
typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud);
 
 
/*
** prototype for memory-allocation functions
*/
typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
 
 
/*
** basic types
*/
#define LUA_TNONE (-1)
 
#define LUA_TNIL 0
#define LUA_TBOOLEAN 1
#define LUA_TLIGHTUSERDATA 2
#define LUA_TNUMBER 3
#define LUA_TSTRING 4
#define LUA_TTABLE 5
#define LUA_TFUNCTION 6
#define LUA_TUSERDATA 7
#define LUA_TTHREAD 8
 
#define LUA_NUMTAGS 9
 
 
 
/* minimum Lua stack available to a C function */
#define LUA_MINSTACK 20
 
 
/* predefined values in the registry */
#define LUA_RIDX_MAINTHREAD 1
#define LUA_RIDX_GLOBALS 2
#define LUA_RIDX_LAST LUA_RIDX_GLOBALS
 
 
/* type of numbers in Lua */
typedef LUA_NUMBER lua_Number;
 
 
/* type for integer functions */
typedef LUA_INTEGER lua_Integer;
 
/* unsigned integer type */
typedef LUA_UNSIGNED lua_Unsigned;
 
 
 
/*
** generic extra include file
*/
#if defined(LUA_USER_H)
#include LUA_USER_H
#endif
 
 
 
/*
** state manipulation
*/
LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
LUA_API void (lua_close) (lua_State *L);
LUA_API lua_State *(lua_newthread) (lua_State *L);
 
LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
 
 
LUA_API const lua_Number *(lua_version) (lua_State *L);
 
 
/*
** basic stack manipulation
*/
LUA_API int (lua_absindex) (lua_State *L, int idx);
LUA_API int (lua_gettop) (lua_State *L);
LUA_API void (lua_settop) (lua_State *L, int idx);
LUA_API void (lua_pushvalue) (lua_State *L, int idx);
LUA_API void (lua_remove) (lua_State *L, int idx);
LUA_API void (lua_insert) (lua_State *L, int idx);
LUA_API void (lua_replace) (lua_State *L, int idx);
LUA_API void (lua_copy) (lua_State *L, int fromidx, int toidx);
LUA_API int (lua_checkstack) (lua_State *L, int sz);
 
LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n);
 
 
/*
** access functions (stack -> C)
*/
 
LUA_API int (lua_isnumber) (lua_State *L, int idx);
LUA_API int (lua_isstring) (lua_State *L, int idx);
LUA_API int (lua_iscfunction) (lua_State *L, int idx);
LUA_API int (lua_isuserdata) (lua_State *L, int idx);
LUA_API int (lua_type) (lua_State *L, int idx);
LUA_API const char *(lua_typename) (lua_State *L, int tp);
 
LUA_API lua_Number (lua_tonumberx) (lua_State *L, int idx, int *isnum);
LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum);
LUA_API lua_Unsigned (lua_tounsignedx) (lua_State *L, int idx, int *isnum);
LUA_API int (lua_toboolean) (lua_State *L, int idx);
LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len);
LUA_API size_t (lua_rawlen) (lua_State *L, int idx);
LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx);
LUA_API void *(lua_touserdata) (lua_State *L, int idx);
LUA_API lua_State *(lua_tothread) (lua_State *L, int idx);
LUA_API const void *(lua_topointer) (lua_State *L, int idx);
 
 
/*
** Comparison and arithmetic functions
*/
 
#define LUA_OPADD 0 /* ORDER TM */
#define LUA_OPSUB 1
#define LUA_OPMUL 2
#define LUA_OPDIV 3
#define LUA_OPMOD 4
#define LUA_OPPOW 5
#define LUA_OPUNM 6
 
LUA_API void (lua_arith) (lua_State *L, int op);
 
#define LUA_OPEQ 0
#define LUA_OPLT 1
#define LUA_OPLE 2
 
LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2);
LUA_API int (lua_compare) (lua_State *L, int idx1, int idx2, int op);
 
 
/*
** push functions (C -> stack)
*/
LUA_API void (lua_pushnil) (lua_State *L);
LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n);
LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n);
LUA_API void (lua_pushunsigned) (lua_State *L, lua_Unsigned n);
LUA_API const char *(lua_pushlstring) (lua_State *L, const char *s, size_t l);
LUA_API const char *(lua_pushstring) (lua_State *L, const char *s);
LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
va_list argp);
LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);
LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
LUA_API void (lua_pushboolean) (lua_State *L, int b);
LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p);
LUA_API int (lua_pushthread) (lua_State *L);
 
 
/*
** get functions (Lua -> stack)
*/
LUA_API void (lua_gettable) (lua_State *L, int idx);
LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k);
LUA_API void (lua_rawget) (lua_State *L, int idx);
LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n);
LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);
LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);
LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
LUA_API void (lua_getuservalue) (lua_State *L, int idx);
 
 
/*
** set functions (stack -> Lua)
*/
LUA_API void (lua_settable) (lua_State *L, int idx);
LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k);
LUA_API void (lua_rawset) (lua_State *L, int idx);
LUA_API void (lua_rawseti) (lua_State *L, int idx, int n);
LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
LUA_API void (lua_setuservalue) (lua_State *L, int idx);
 
 
/*
** 'load' and 'call' functions (load and run Lua code)
*/
LUA_API void (lua_callk) (lua_State *L, int nargs, int nresults, int ctx,
lua_CFunction k);
#define lua_call(L,n,r) lua_callk(L, (n), (r), 0, NULL)
 
LUA_API int (lua_getctx) (lua_State *L, int *ctx);
 
LUA_API int (lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
int ctx, lua_CFunction k);
#define lua_pcall(L,n,r,f) lua_pcallk(L, (n), (r), (f), 0, NULL)
 
LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt,
const char *chunkname);
 
LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data);
 
 
/*
** coroutine functions
*/
LUA_API int (lua_yieldk) (lua_State *L, int nresults, int ctx,
lua_CFunction k);
#define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL)
LUA_API int (lua_resume) (lua_State *L, int narg);
LUA_API int (lua_status) (lua_State *L);
 
/*
** garbage-collection function and options
*/
 
#define LUA_GCSTOP 0
#define LUA_GCRESTART 1
#define LUA_GCCOLLECT 2
#define LUA_GCCOUNT 3
#define LUA_GCCOUNTB 4
#define LUA_GCSTEP 5
#define LUA_GCSETPAUSE 6
#define LUA_GCSETSTEPMUL 7
#define LUA_GCSETMAJORINC 8
#define LUA_GCISRUNNING 9
#define LUA_GCGEN 10
#define LUA_GCINC 11
 
LUA_API int (lua_gc) (lua_State *L, int what, int data);
 
 
/*
** miscellaneous functions
*/
 
LUA_API int (lua_error) (lua_State *L);
 
LUA_API int (lua_next) (lua_State *L, int idx);
 
LUA_API void (lua_concat) (lua_State *L, int n);
LUA_API void (lua_len) (lua_State *L, int idx);
 
LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);
LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
 
 
 
/*
** ===============================================================
** some useful macros
** ===============================================================
*/
 
#define lua_tonumber(L,i) lua_tonumberx(L,i,NULL)
#define lua_tointeger(L,i) lua_tointegerx(L,i,NULL)
#define lua_tounsigned(L,i) lua_tounsignedx(L,i,NULL)
 
#define lua_pop(L,n) lua_settop(L, -(n)-1)
 
#define lua_newtable(L) lua_createtable(L, 0, 0)
 
#define lua_setglobal(L,s) \
(lua_pushglobaltable(L), lua_pushvalue(L, -2), \
lua_setfield(L, -2, (s)), lua_pop(L, 2))
 
#define lua_getglobal(L,s) \
(lua_pushglobaltable(L), lua_getfield(L, -1, (s)), lua_remove(L, -2))
 
#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))
 
#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
 
#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION)
#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE)
#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA)
#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL)
#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN)
#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD)
#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE)
#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0)
 
#define lua_pushliteral(L, s) \
lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1)
 
#define lua_pushglobaltable(L) \
lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS)
 
#define lua_tostring(L,i) lua_tolstring(L, (i), NULL)
 
 
 
/*
** {======================================================================
** Debug API
** =======================================================================
*/
 
 
/*
** Event codes
*/
#define LUA_HOOKCALL 0
#define LUA_HOOKRET 1
#define LUA_HOOKLINE 2
#define LUA_HOOKCOUNT 3
#define LUA_HOOKTAILCALL 4
 
 
/*
** Event masks
*/
#define LUA_MASKCALL (1 << LUA_HOOKCALL)
#define LUA_MASKRET (1 << LUA_HOOKRET)
#define LUA_MASKLINE (1 << LUA_HOOKLINE)
#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT)
 
typedef struct lua_Debug lua_Debug; /* activation record */
 
 
/* Functions to be called by the debugger in specific events */
typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
 
 
LUA_API int (lua_getstack) (lua_State *L, int level, lua_Debug *ar);
LUA_API int (lua_getinfo) (lua_State *L, const char *what, lua_Debug *ar);
LUA_API const char *(lua_getlocal) (lua_State *L, const lua_Debug *ar, int n);
LUA_API const char *(lua_setlocal) (lua_State *L, const lua_Debug *ar, int n);
LUA_API const char *(lua_getupvalue) (lua_State *L, int funcindex, int n);
LUA_API const char *(lua_setupvalue) (lua_State *L, int funcindex, int n);
 
LUA_API void *(lua_upvalueid) (lua_State *L, int fidx, int n);
LUA_API void (lua_upvaluejoin) (lua_State *L, int fidx1, int n1,
int fidx2, int n2);
 
LUA_API int (lua_sethook) (lua_State *L, lua_Hook func, int mask, int count);
LUA_API lua_Hook (lua_gethook) (lua_State *L);
LUA_API int (lua_gethookmask) (lua_State *L);
LUA_API int (lua_gethookcount) (lua_State *L);
 
 
struct lua_Debug {
int event;
const char *name; /* (n) */
const char *namewhat; /* (n) 'global', 'local', 'field', 'method' */
const char *what; /* (S) 'Lua', 'C', 'main', 'tail' */
const char *source; /* (S) */
int currentline; /* (l) */
int linedefined; /* (S) */
int lastlinedefined; /* (S) */
unsigned char nups; /* (u) number of upvalues */
unsigned char nparams;/* (u) number of parameters */
char isvararg; /* (u) */
char istailcall; /* (t) */
char short_src[LUA_IDSIZE]; /* (S) */
/* private part */
struct CallInfo *i_ci; /* active function */
};
 
/* }====================================================================== */
 
 
/******************************************************************************
* Copyright (C) 1994-2010 Lua.org, PUC-Rio. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************************/
 
 
#endif
/contrib/media/updf/include/luaconf.h
0,0 → 1,473
/*
** $Id: luaconf.h,v 1.151 2010/11/12 15:48:30 roberto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
 
 
#ifndef lconfig_h
#define lconfig_h
 
#include <limits.h>
#include <stddef.h>
 
 
/*
** ==================================================================
** Search for "@@" to find all configurable definitions.
** ===================================================================
*/
 
 
/*
@@ LUA_ANSI controls the use of non-ansi features.
** CHANGE it (define it) if you want Lua to avoid the use of any
** non-ansi feature or library.
*/
#if !defined(LUA_ANSI) && defined(__STRICT_ANSI__)
#define LUA_ANSI
#endif
 
 
#if !defined(LUA_ANSI) && defined(_WIN32)
#define LUA_WIN
#endif
 
#if defined(LUA_WIN)
#define LUA_DL_DLL
#endif
 
 
 
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
#define LUA_USE_READLINE /* needs some extra libraries */
#endif
 
#if defined(LUA_USE_MACOSX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* does not need -ldl */
#define LUA_USE_READLINE /* needs an extra library: -lreadline */
#endif
 
 
 
/*
@@ LUA_USE_POSIX includes all functionality listed as X/Open System
@* Interfaces Extension (XSI).
** CHANGE it (define it) if your system is XSI compatible.
*/
#if defined(LUA_USE_POSIX)
#define LUA_USE_MKSTEMP
#define LUA_USE_ISATTY
#define LUA_USE_POPEN
#define LUA_USE_ULONGJMP
#endif
 
 
 
/*
@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
@* Lua libraries.
@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
@* C libraries.
** CHANGE them if your machine has a non-conventional directory
** hierarchy or if you want to install your libraries in
** non-conventional directories.
*/
#if defined(_WIN32) /* { */
/*
** In Windows, any exclamation mark ('!') in the path is replaced by the
** path of the directory of the executable file of the current process.
*/
#define LUA_LDIR "!\\lua\\"
#define LUA_CDIR "!\\"
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" ".\\?.lua"
#define LUA_CPATH_DEFAULT \
LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll;" ".\\?.dll"
 
#else /* }{ */
 
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
#define LUA_ROOT "/usr/local/"
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" "./?.lua"
#define LUA_CPATH_DEFAULT \
LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
#endif /* } */
 
 
/*
@@ LUA_DIRSEP is the directory separator (for submodules).
** CHANGE it if your machine does not use "/" as the directory separator
** and is not Windows. (On Windows Lua automatically uses "\".)
*/
#if defined(_WIN32)
#define LUA_DIRSEP "\\"
#else
#define LUA_DIRSEP "/"
#endif
 
 
/*
@@ LUA_ENV is the name of the variable that holds the current
@@ environment, used to access global names.
** CHANGE it if you do not like this name.
*/
#define LUA_ENV "_ENV"
 
 
/*
@@ LUA_API is a mark for all core API functions.
@@ LUALIB_API is a mark for all auxiliary library functions.
@@ LUAMOD_API is a mark for all standard library opening functions.
** CHANGE them if you need to define those functions in some special way.
** For instance, if you want to create one Windows DLL with the core and
** the libraries, you may want to use the following definition (define
** LUA_BUILD_AS_DLL to get it).
*/
#if defined(LUA_BUILD_AS_DLL) /* { */
 
#if defined(LUA_CORE) || defined(LUA_LIB) /* { */
#define LUA_API __declspec(dllexport)
#else /* }{ */
#define LUA_API __declspec(dllimport)
#endif /* } */
 
#else /* }{ */
 
#define LUA_API extern
 
#endif /* } */
 
 
/* more often than not the libs go together with the core */
#define LUALIB_API LUA_API
#define LUAMOD_API LUALIB_API
 
 
/*
@@ LUAI_FUNC is a mark for all extern functions that are not to be
@* exported to outside modules.
@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables
@* that are not to be exported to outside modules (LUAI_DDEF for
@* definitions and LUAI_DDEC for declarations).
** CHANGE them if you need to mark them in some special way. Elf/gcc
** (versions 3.2 and later) mark them as "hidden" to optimize access
** when Lua is compiled as a shared library. Not all elf targets support
** this attribute. Unfortunately, gcc does not offer a way to check
** whether the target offers that support, and those without support
** give a warning about it. To avoid these warnings, change to the
** default definition.
*/
#if defined(luaall_c) /* { */
#define LUAI_FUNC static
#define LUAI_DDEC static
#define LUAI_DDEF static
 
#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
defined(__ELF__)
#define LUAI_FUNC __attribute__((visibility("hidden"))) extern
#define LUAI_DDEC LUAI_FUNC
#define LUAI_DDEF /* empty */
 
#else /* }{ */
#define LUAI_FUNC extern
#define LUAI_DDEC extern
#define LUAI_DDEF /* empty */
#endif /* } */
 
 
 
/*
@@ LUA_QL describes how error messages quote program elements.
** CHANGE it if you want a different appearance.
*/
#define LUA_QL(x) "'" x "'"
#define LUA_QS LUA_QL("%s")
 
 
/*
@@ LUA_IDSIZE gives the maximum size for the description of the source
@* of a function in debug information.
** CHANGE it if you want a different size.
*/
#define LUA_IDSIZE 60
 
 
/*
@@ luai_writestring defines how 'print' prints its results.
*/
#include <stdio.h>
#define luai_writestring(s,l) fwrite((s), sizeof(char), (l), stdout)
 
/*
@@ luai_writestringerror defines how to print error messages.
** (A format string with one argument is enough for Lua...)
*/
#define luai_writestringerror(s,p) \
(fprintf(stderr, (s), (p)), fflush(stderr))
 
 
 
 
 
/*
** {==================================================================
** Compatibility with previous versions
** ===================================================================
*/
 
/*
@@ LUA_COMPAT_ALL controls all compatibility options.
** You can define it to get all options, or change specific options
** to fit your specific needs.
*/
#if defined(LUA_COMPAT_ALL) /* { */
 
/*
@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'.
** You can replace it with 'table.unpack'.
*/
#define LUA_COMPAT_UNPACK
 
/*
@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall.
** You can call your C function directly (with light C functions).
*/
#define lua_cpcall(L,f,u) \
(lua_pushcfunction(L, (f)), \
lua_pushlightuserdata(L,(u)), \
lua_pcall(L,1,0,0))
 
 
/*
@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library.
** You can rewrite 'log10(x)' as 'log(x, 10)'.
*/
#define LUA_COMPAT_LOG10
 
/*
@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library.
*/
#define LUA_COMPAT_MAXN
 
/*
@@ The following macros supply trivial compatibility for some
** changes in the API. The macros themselves document how to
** change your code to avoid using them.
*/
#define lua_strlen(L,i) lua_rawlen(L, (i))
 
#define lua_objlen(L,i) lua_rawlen(L, (i))
 
#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ)
#define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT)
 
/*
@@ LUA_COMPAT_MODULE controls compatibility with previous
** module functions 'module' (Lua) and 'luaL_register' (C).
*/
#define LUA_COMPAT_MODULE
 
#endif /* } */
 
/* }================================================================== */
 
 
 
/*
@@ LUAI_BITSINT defines the number of bits in an int.
** CHANGE here if Lua cannot automatically detect the number of bits of
** your machine. Probably you do not need to change this.
*/
/* avoid overflows in comparison */
#if INT_MAX-20 < 32760 /* { */
#define LUAI_BITSINT 16
#elif INT_MAX > 2147483640L /* }{ */
/* int has at least 32 bits */
#define LUAI_BITSINT 32
#else /* }{ */
#error "you must define LUA_BITSINT with number of bits in an integer"
#endif /* } */
 
 
/*
@@ LUA_INT32 is an signed integer with exactly 32 bits.
@@ LUAI_UMEM is an unsigned integer big enough to count the total
@* memory used by Lua.
@@ LUAI_MEM is a signed integer big enough to count the total memory
@* used by Lua.
** CHANGE here if for some weird reason the default definitions are not
** good enough for your machine. Probably you do not need to change
** this.
*/
#if LUAI_BITSINT >= 32 /* { */
#define LUA_INT32 int
#define LUAI_UMEM size_t
#define LUAI_MEM ptrdiff_t
#else /* }{ */
/* 16-bit ints */
#define LUA_INT32 long
#define LUAI_UMEM unsigned long
#define LUAI_MEM long
#endif /* } */
 
 
/*
@@ LUAI_MAXSTACK limits the size of the Lua stack.
** CHANGE it if you need a different limit. This limit is arbitrary;
** its only purpose is to stop Lua to consume unlimited stack
** space (and to reserve some numbers for pseudo-indices).
*/
#if LUAI_BITSINT >= 32
#define LUAI_MAXSTACK 1000000
#else
#define LUAI_MAXSTACK 15000
#endif
 
/* reserve some space for error handling */
#define LUAI_FIRSTPSEUDOIDX (-LUAI_MAXSTACK - 1000)
 
 
 
 
/*
@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
** CHANGE it if it uses too much C-stack space.
*/
#define LUAL_BUFFERSIZE BUFSIZ
 
 
 
 
/*
** {==================================================================
@@ LUA_NUMBER is the type of numbers in Lua.
** CHANGE the following definitions only if you want to build Lua
** with a number type different from double. You may also need to
** change lua_number2int & lua_number2integer.
** ===================================================================
*/
 
#define LUA_NUMBER_DOUBLE
#define LUA_NUMBER double
 
/*
@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
@* over a number.
*/
#define LUAI_UACNUMBER double
 
 
/*
@@ LUA_NUMBER_SCAN is the format for reading numbers.
@@ LUA_NUMBER_FMT is the format for writing numbers.
@@ lua_number2str converts a number to a string.
@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion.
@@ lua_str2number converts a string to a number.
*/
#define LUA_NUMBER_SCAN "%lf"
#define LUA_NUMBER_FMT "%.14g"
#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n))
#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */
#define lua_str2number(s,p) strtod((s), (p))
 
 
/*
@@ The luai_num* macros define the primitive operations over numbers.
*/
 
/* the following operations need the math library */
#if defined(lobject_c) || defined(lvm_c) || defined(luaall_c)
#include <math.h>
#define luai_nummod(L,a,b) ((a) - floor((a)/(b))*(b))
#define luai_numpow(L,a,b) (pow(a,b))
#endif
 
/* these are quite standard operations */
#if defined(LUA_CORE)
#define luai_numadd(L,a,b) ((a)+(b))
#define luai_numsub(L,a,b) ((a)-(b))
#define luai_nummul(L,a,b) ((a)*(b))
#define luai_numdiv(L,a,b) ((a)/(b))
#define luai_numunm(L,a) (-(a))
#define luai_numeq(a,b) ((a)==(b))
#define luai_numlt(L,a,b) ((a)<(b))
#define luai_numle(L,a,b) ((a)<=(b))
#define luai_numisnan(L,a) (!luai_numeq((a), (a)))
#endif
 
 
 
/*
@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger.
** CHANGE that if ptrdiff_t is not adequate on your machine. (On most
** machines, ptrdiff_t gives a good choice between int or long.)
*/
#define LUA_INTEGER ptrdiff_t
 
/*
@@ LUA_UNSIGNED is the integral type used by lua_pushunsigned/lua_tounsigned.
** It must have at least 32 bits.
*/
#define LUA_UNSIGNED unsigned LUA_INT32
 
 
#if defined(LUA_CORE) /* { */
 
#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) /* { */
 
/* On a Microsoft compiler on a Pentium, use assembler to avoid clashes
with a DirectX idiosyncrasy */
#if defined(_MSC_VER) && defined(M_IX86) /* { */
 
#define MS_ASMTRICK
 
#else /* }{ */
/* the next definition uses a trick that should work on any machine
using IEEE754 with a 32-bit integer type */
 
#define LUA_IEEE754TRICK
 
/*
@@ LUA_IEEEENDIAN is the endianness of doubles in your machine
@@ (0 for little endian, 1 for big endian); if not defined, Lua will
@@ check it dynamically.
*/
/* check for known architectures */
#if defined(__i386__) || defined(__i386) || defined(i386) || \
defined (__x86_64)
#define LUA_IEEEENDIAN 0
#elif defined(__POWERPC__) || defined(__ppc__)
#define LUA_IEEEENDIAN 1
#endif
 
#endif /* } */
 
#endif /* } */
 
#endif /* } */
 
/* }================================================================== */
 
 
 
 
/* =================================================================== */
 
/*
** Local configuration. You can use this space to add your redefinitions
** without modifying the main part of the file.
*/
 
 
 
#endif
 
/contrib/media/updf/include/lualib.h
0,0 → 1,58
/*
** $Id: lualib.h,v 1.41 2010/10/25 14:32:36 roberto Exp $
** Lua standard libraries
** See Copyright Notice in lua.h
*/
 
 
#ifndef lualib_h
#define lualib_h
 
#include "lua.h"
 
 
/* Key to file-handle type */
#define LUA_FILEHANDLE "FILE*"
 
 
LUAMOD_API int (luaopen_base) (lua_State *L);
 
#define LUA_COLIBNAME "coroutine"
LUAMOD_API int (luaopen_coroutine) (lua_State *L);
 
#define LUA_TABLIBNAME "table"
LUAMOD_API int (luaopen_table) (lua_State *L);
 
#define LUA_IOLIBNAME "io"
LUAMOD_API int (luaopen_io) (lua_State *L);
 
#define LUA_OSLIBNAME "os"
LUAMOD_API int (luaopen_os) (lua_State *L);
 
#define LUA_STRLIBNAME "string"
LUAMOD_API int (luaopen_string) (lua_State *L);
 
#define LUA_BITLIBNAME "bit32"
LUAMOD_API int (luaopen_bit32) (lua_State *L);
 
#define LUA_MATHLIBNAME "math"
LUAMOD_API int (luaopen_math) (lua_State *L);
 
#define LUA_DBLIBNAME "debug"
LUAMOD_API int (luaopen_debug) (lua_State *L);
 
#define LUA_LOADLIBNAME "package"
LUAMOD_API int (luaopen_package) (lua_State *L);
 
 
/* open all previous libraries */
LUALIB_API void (luaL_openlibs) (lua_State *L);
 
 
 
#ifndef lua_assert
#define lua_assert(x) ((void)0)
#endif
 
 
#endif
/contrib/media/updf/include/lundump.h
0,0 → 1,25
/*
** $Id: lundump.h,v 1.43 2010/10/26 00:23:46 lhf Exp $
** load precompiled Lua chunks
** See Copyright Notice in lua.h
*/
 
#ifndef lundump_h
#define lundump_h
 
#include "lobject.h"
#include "lzio.h"
 
/* load one chunk; from lundump.c */
LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name);
 
/* make header; from lundump.c */
LUAI_FUNC void luaU_header (char* h);
 
/* dump one chunk; from ldump.c */
LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
 
/* size of header of binary files */
#define LUAC_HEADERSIZE 18
 
#endif
/contrib/media/updf/include/lvm.h
0,0 → 1,42
/*
** $Id: lvm.h,v 2.14 2009/12/17 16:20:01 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
 
#ifndef lvm_h
#define lvm_h
 
 
#include "ldo.h"
#include "lobject.h"
#include "ltm.h"
 
 
#define tostring(L,o) (ttisstring(o) || (luaV_tostring(L, o)))
 
#define tonumber(o,n) (ttisnumber(o) || (((o) = luaV_tonumber(o,n)) != NULL))
 
#define equalobj(L,o1,o2) \
(ttype(o1) == ttype(o2) && luaV_equalval_(L, o1, o2))
 
 
/* not to called directly */
LUAI_FUNC int luaV_equalval_ (lua_State *L, const TValue *t1, const TValue *t2);
 
LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);
LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r);
LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n);
LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj);
LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key,
StkId val);
LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key,
StkId val);
LUAI_FUNC void luaV_finishOp (lua_State *L);
LUAI_FUNC void luaV_execute (lua_State *L);
LUAI_FUNC void luaV_concat (lua_State *L, int total);
LUAI_FUNC void luaV_arith (lua_State *L, StkId ra, const TValue *rb,
const TValue *rc, TMS op);
LUAI_FUNC void luaV_objlen (lua_State *L, StkId ra, const TValue *rb);
 
#endif
/contrib/media/updf/include/lzio.h
0,0 → 1,70
/*
** $Id: lzio.h,v 1.22 2009/05/18 17:26:25 roberto Exp $
** Buffered streams
** See Copyright Notice in lua.h
*/
 
 
#ifndef lzio_h
#define lzio_h
 
#include "lua.h"
 
#include "lmem.h"
 
 
#define EOZ (-1) /* end of stream */
 
typedef struct Zio ZIO;
 
#define char2int(c) cast(int, cast(unsigned char, (c)))
 
#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
 
#define zungetc(z) ((z)->n++, (z)->p--)
 
 
typedef struct Mbuffer {
char *buffer;
size_t n;
size_t buffsize;
} Mbuffer;
 
#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0)
 
#define luaZ_buffer(buff) ((buff)->buffer)
#define luaZ_sizebuffer(buff) ((buff)->buffsize)
#define luaZ_bufflen(buff) ((buff)->n)
 
#define luaZ_resetbuffer(buff) ((buff)->n = 0)
 
 
#define luaZ_resizebuffer(L, buff, size) \
(luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
(buff)->buffsize = size)
 
#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)
 
 
LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
void *data);
LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
LUAI_FUNC int luaZ_lookahead (ZIO *z);
 
 
 
/* --------- Private Part ------------------ */
 
struct Zio {
size_t n; /* bytes still unread */
const char *p; /* current position in buffer */
lua_Reader reader;
void* data; /* additional data */
lua_State *L; /* Lua state (for reader) */
};
 
 
LUAI_FUNC int luaZ_fill (ZIO *z);
 
#endif
/contrib/media/updf/include/lzoconf.h
0,0 → 1,386
/* lzoconf.h -- configuration for the LZO real-time data compression library
 
This file is part of the LZO real-time data compression library.
 
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
 
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
 
The LZO 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 General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
Markus F.X.J. Oberhumer
<markus.oberhumer@jk.uni-linz.ac.at>
http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html
*/
 
 
#ifndef __LZOCONF_H
#define __LZOCONF_H
 
#define LZO_VERSION 0x1070
#define LZO_VERSION_STRING "1.07"
#define LZO_VERSION_DATE "Oct 18 2000"
 
/* internal Autoconf configuration file - only used when building LZO */
#if defined(LZO_HAVE_CONFIG_H)
# include <config.h>
#endif
#include <limits.h>
 
#ifdef __cplusplus
extern "C" {
#endif
 
 
/***********************************************************************
// LZO requires a conforming <limits.h>
************************************************************************/
 
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
# error "invalid CHAR_BIT"
#endif
#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
# error "check your compiler installation"
#endif
#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
# error "your limits.h macros are broken"
#endif
 
/* workaround a cpp bug under hpux 10.20 */
#define LZO_0xffffffffL 4294967295ul
 
 
/***********************************************************************
// architecture defines
************************************************************************/
 
#if !defined(__LZO_WIN) && !defined(__LZO_DOS) && !defined(__LZO_OS2)
# if defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
# define __LZO_WIN
# elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
# define __LZO_WIN
# elif defined(__NT__) || defined(__NT_DLL__) || defined(__WINDOWS_386__)
# define __LZO_WIN
# elif defined(__DOS__) || defined(__MSDOS__) || defined(MSDOS)
# define __LZO_DOS
# elif defined(__OS2__) || defined(__OS2V2__) || defined(OS2)
# define __LZO_OS2
# elif defined(__palmos__)
# define __LZO_PALMOS
# elif defined(__TOS__) || defined(__atarist__)
# define __LZO_TOS
# endif
#endif
 
#if (UINT_MAX < LZO_0xffffffffL)
# if defined(__LZO_WIN)
# define __LZO_WIN16
# elif defined(__LZO_DOS)
# define __LZO_DOS16
# elif defined(__LZO_PALMOS)
# define __LZO_PALMOS16
# elif defined(__LZO_TOS)
# define __LZO_TOS16
# elif defined(__C166__)
# else
# error "16-bit target not supported - contact me for porting hints"
# endif
#endif
 
#if !defined(__LZO_i386)
# if defined(__LZO_DOS) || defined(__LZO_WIN16)
# define __LZO_i386
# elif defined(__i386__) || defined(__386__) || defined(_M_IX86)
# define __LZO_i386
# endif
#endif
 
#if defined(__LZO_STRICT_16BIT)
# if (UINT_MAX < LZO_0xffffffffL)
# include <lzo16bit.h>
# endif
#endif
 
/* memory checkers */
#if !defined(__LZO_CHECKER)
# if defined(__BOUNDS_CHECKING_ON)
# define __LZO_CHECKER
# elif defined(__CHECKER__)
# define __LZO_CHECKER
# elif defined(__INSURE__)
# define __LZO_CHECKER
# elif defined(__PURIFY__)
# define __LZO_CHECKER
# endif
#endif
 
 
/***********************************************************************
// integral and pointer types
************************************************************************/
 
/* Integral types with 32 bits or more */
#if !defined(LZO_UINT32_MAX)
# if (UINT_MAX >= LZO_0xffffffffL)
typedef unsigned int lzo_uint32;
typedef int lzo_int32;
# define LZO_UINT32_MAX UINT_MAX
# define LZO_INT32_MAX INT_MAX
# define LZO_INT32_MIN INT_MIN
# elif (ULONG_MAX >= LZO_0xffffffffL)
typedef unsigned long lzo_uint32;
typedef long lzo_int32;
# define LZO_UINT32_MAX ULONG_MAX
# define LZO_INT32_MAX LONG_MAX
# define LZO_INT32_MIN LONG_MIN
# else
# error "lzo_uint32"
# endif
#endif
 
/* lzo_uint is used like size_t */
#if !defined(LZO_UINT_MAX)
# if (UINT_MAX >= LZO_0xffffffffL)
typedef unsigned int lzo_uint;
typedef int lzo_int;
# define LZO_UINT_MAX UINT_MAX
# define LZO_INT_MAX INT_MAX
# define LZO_INT_MIN INT_MIN
# elif (ULONG_MAX >= LZO_0xffffffffL)
typedef unsigned long lzo_uint;
typedef long lzo_int;
# define LZO_UINT_MAX ULONG_MAX
# define LZO_INT_MAX LONG_MAX
# define LZO_INT_MIN LONG_MIN
# else
# error "lzo_uint"
# endif
#endif
 
 
/* Memory model that allows to access memory at offsets of lzo_uint. */
#if !defined(__LZO_MMODEL)
# if (LZO_UINT_MAX <= UINT_MAX)
# define __LZO_MMODEL
# elif defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define __LZO_MMODEL __huge
# define LZO_999_UNSUPPORTED
# elif defined(__LZO_PALMOS16) || defined(__LZO_TOS16)
# define __LZO_MMODEL
# else
# error "__LZO_MMODEL"
# endif
#endif
 
/* no typedef here because of const-pointer issues */
#define lzo_byte unsigned char __LZO_MMODEL
#define lzo_bytep unsigned char __LZO_MMODEL *
#define lzo_charp char __LZO_MMODEL *
#define lzo_voidp void __LZO_MMODEL *
#define lzo_shortp short __LZO_MMODEL *
#define lzo_ushortp unsigned short __LZO_MMODEL *
#define lzo_uint32p lzo_uint32 __LZO_MMODEL *
#define lzo_int32p lzo_int32 __LZO_MMODEL *
#define lzo_uintp lzo_uint __LZO_MMODEL *
#define lzo_intp lzo_int __LZO_MMODEL *
#define lzo_voidpp lzo_voidp __LZO_MMODEL *
#define lzo_bytepp lzo_bytep __LZO_MMODEL *
 
typedef int lzo_bool;
 
#ifndef lzo_sizeof_dict_t
# define lzo_sizeof_dict_t sizeof(lzo_bytep)
#endif
 
 
/***********************************************************************
// function types
************************************************************************/
 
/* linkage */
#if !defined(__LZO_EXTERN_C)
# ifdef __cplusplus
# define __LZO_EXTERN_C extern "C"
# else
# define __LZO_EXTERN_C extern
# endif
#endif
 
/* calling conventions */
#if !defined(__LZO_CDECL)
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
# define __LZO_CDECL __far __cdecl
# elif defined(__LZO_i386) && defined(_MSC_VER)
# define __LZO_CDECL __cdecl
# elif defined(__LZO_i386) && defined(__WATCOMC__)
# define __LZO_CDECL __near __cdecl
# else
# define __LZO_CDECL
# endif
#endif
#if !defined(__LZO_ENTRY)
# define __LZO_ENTRY __LZO_CDECL
#endif
 
/* DLL export information */
#if !defined(__LZO_EXPORT1)
# define __LZO_EXPORT1
#endif
#if !defined(__LZO_EXPORT2)
# define __LZO_EXPORT2
#endif
 
/* calling convention for C functions */
#if !defined(LZO_PUBLIC)
# define LZO_PUBLIC(_rettype) __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_ENTRY
#endif
#if !defined(LZO_EXTERN)
# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype)
#endif
#if !defined(LZO_PRIVATE)
# define LZO_PRIVATE(_rettype) static _rettype __LZO_ENTRY
#endif
 
/* cdecl calling convention for assembler functions */
#if !defined(LZO_PUBLIC_CDECL)
# define LZO_PUBLIC_CDECL(_rettype) \
__LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
#endif
#if !defined(LZO_EXTERN_CDECL)
# define LZO_EXTERN_CDECL(_rettype) __LZO_EXTERN_C LZO_PUBLIC_CDECL(_rettype)
#endif
 
 
typedef int
(__LZO_ENTRY *lzo_compress_t) ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uint *dst_len,
lzo_voidp wrkmem );
 
typedef int
(__LZO_ENTRY *lzo_decompress_t) ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uint *dst_len,
lzo_voidp wrkmem );
 
typedef int
(__LZO_ENTRY *lzo_optimize_t) ( lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uint *dst_len,
lzo_voidp wrkmem );
 
typedef int
(__LZO_ENTRY *lzo_compress_dict_t)(const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uint *dst_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
 
typedef int
(__LZO_ENTRY *lzo_decompress_dict_t)(const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uint *dst_len,
lzo_voidp wrkmem,
const lzo_byte *dict, lzo_uint dict_len );
 
 
/* a progress indicator callback function */
typedef void (__LZO_ENTRY *lzo_progress_callback_t) (lzo_uint, lzo_uint);
 
 
/***********************************************************************
// error codes and prototypes
************************************************************************/
 
/* Error codes for the compression/decompression functions. Negative
* values are errors, positive values will be used for special but
* normal events.
*/
#define LZO_E_OK 0
#define LZO_E_ERROR (-1)
#define LZO_E_OUT_OF_MEMORY (-2) /* not used right now */
#define LZO_E_NOT_COMPRESSIBLE (-3) /* not used right now */
#define LZO_E_INPUT_OVERRUN (-4)
#define LZO_E_OUTPUT_OVERRUN (-5)
#define LZO_E_LOOKBEHIND_OVERRUN (-6)
#define LZO_E_EOF_NOT_FOUND (-7)
#define LZO_E_INPUT_NOT_CONSUMED (-8)
 
 
/* lzo_init() should be the first function you call.
* Check the return code !
*
* lzo_init() is a macro to allow checking that the library and the
* compiler's view of various types are consistent.
*/
#define lzo_init() __lzo_init2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
(int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
(int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
(int)sizeof(lzo_compress_t))
LZO_EXTERN(int) __lzo_init2(unsigned,int,int,int,int,int,int,int,int,int);
 
/* version functions (useful for shared libraries) */
LZO_EXTERN(unsigned) lzo_version(void);
LZO_EXTERN(const char *) lzo_version_string(void);
LZO_EXTERN(const char *) lzo_version_date(void);
LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
 
/* string functions */
LZO_EXTERN(int)
lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
LZO_EXTERN(lzo_voidp)
lzo_memset(lzo_voidp _s, int _c, lzo_uint _len);
 
/* checksum functions */
LZO_EXTERN(lzo_uint32)
lzo_adler32(lzo_uint32 _adler, const lzo_byte *_buf, lzo_uint _len);
LZO_EXTERN(lzo_uint32)
lzo_crc32(lzo_uint32 _c, const lzo_byte *_buf, lzo_uint _len);
 
/* memory allocation functions */
LZO_EXTERN(lzo_bytep) lzo_alloc(lzo_uint _nelems, lzo_uint _size);
LZO_EXTERN(lzo_bytep) lzo_malloc(lzo_uint _size);
LZO_EXTERN(void) lzo_free(lzo_voidp _ptr);
 
typedef lzo_bytep (__LZO_ENTRY *lzo_alloc_hook_t) (lzo_uint, lzo_uint);
typedef void (__LZO_ENTRY *lzo_free_hook_t) (lzo_voidp);
 
extern lzo_alloc_hook_t lzo_alloc_hook;
extern lzo_free_hook_t lzo_free_hook;
 
/* misc. */
LZO_EXTERN(lzo_bool) lzo_assert(int _expr);
LZO_EXTERN(int) _lzo_config_check(void);
typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
 
/* align a char pointer on a boundary that is a multiple of `size' */
LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size);
#define LZO_PTR_ALIGN_UP(_ptr,_size) \
((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size)))
 
/* deprecated - only for backward compatibility */
#define LZO_ALIGN(_ptr,_size) LZO_PTR_ALIGN_UP(_ptr,_size)
 
 
#ifdef __cplusplus
} /* extern "C" */
#endif
 
#endif /* already included */
 
/contrib/media/updf/include/machine/asm.h
0,0 → 1,66
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: @(#)asm.h 5.5 (Berkeley) 5/7/91
*/
 
#ifndef _MACHINE_ASM_H_
#define _MACHINE_ASM_H_
 
#ifdef __STDC__
# define _C_LABEL(x) _ ## x
#else
# define _C_LABEL(x) _/**/x
#endif
#define _ASM_LABEL(x) x
 
#define _ENTRY(x) \
.text; .align 2; .globl x; x:
 
#ifdef PROF
# define _PROF_PROLOGUE /* XXX */
#else
# define _PROF_PROLOGUE
#endif
 
#define ENTRY(y) _ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
 
#define ASMSTR .asciz
 
#define RCSID(x) .text; .asciz x
 
#endif /* !_MACHINE_ASM_H_ */
/contrib/media/updf/include/machine/endian.h
0,0 → 1,67
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* Copyright (c) 1987, 1991 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: @(#)endian.h 7.8 (Berkeley) 4/3/91
*/
 
#ifndef _MACHINE_ENDIAN_H_
#define _MACHINE_ENDIAN_H_
 
/*
* Definitions for byte order, according to byte significance from low
* address to high.
*/
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
 
#define BYTE_ORDER LITTLE_ENDIAN
 
#include <sys/cdefs.h>
 
__BEGIN_DECLS
unsigned long htonl __P((unsigned long));
unsigned short htons __P((unsigned short));
unsigned long ntohl __P((unsigned long));
unsigned short ntohs __P((unsigned short));
__END_DECLS
 
/*
* Macros for network/external number representation conversion.
*/
#define NTOHL(x) (x) = ntohl((unsigned long)(x))
#define NTOHS(x) (x) = ntohs((unsigned short)(x))
#define HTONL(x) (x) = htonl((unsigned long)(x))
#define HTONS(x) (x) = htons((unsigned short)(x))
 
#endif /* _MACHINE_ENDIAN_H_ */
/contrib/media/updf/include/malloc.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_malloc_h_
#define __dj_include_malloc_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <stdlib.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_malloc_h_ */
/contrib/media/updf/include/map
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_MAP
#include <bits/std_map.h>
#endif
/contrib/media/updf/include/math.h
0,0 → 1,191
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_math_h_
#define __dj_include_math_h_
 
#ifdef _USE_LIBM_MATH_H
#include <libm/math.h>
#else
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
extern double __dj_huge_val;
#define HUGE_VAL __dj_huge_val
 
double acos(double _x);
double asin(double _x);
double atan(double _x);
double atan2(double _y, double _x);
double ceil(double _x);
double cos(double _x);
double cosh(double _x);
double exp(double _x);
double fabs(double _x);
double floor(double _x);
double fmod(double _x, double _y);
double frexp(double _x, int *_pexp);
double ldexp(double _x, int _exp);
double log(double _y);
double log10(double _x);
double modf(double _x, double *_pint);
double pow(double _x, double _y);
double sin(double _x);
double sinh(double _x);
double sqrt(double _x);
double tan(double _x);
double tanh(double _x);
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#define M_E 2.7182818284590452354
#define M_LOG2E 1.4426950408889634074
#define M_LOG10E 0.43429448190325182765
#define M_LN2 0.69314718055994530942
#define M_LN10 2.30258509299404568402
#define M_PI 3.14159265358979323846
#define M_PI_2 1.57079632679489661923
#define M_PI_4 0.78539816339744830962
#define M_1_PI 0.31830988618379067154
#define M_2_PI 0.63661977236758134308
#define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880
#define M_SQRT1_2 0.70710678118654752440
#define PI M_PI
#define PI2 M_PI_2
 
double acosh(double);
double asinh(double);
double atanh(double);
double cbrt(double);
double exp10(double _x);
double exp2(double _x);
double expm1(double);
double hypot(double, double);
double log1p(double);
double log2(double _x);
long double modfl(long double _x, long double *_pint);
double pow10(double _x);
double pow2(double _x);
double powi(double, int);
void sincos(double *, double *, double);
 
/* These are in libm.a (Cygnus). You must link -lm to get these */
/* See libm/math.h for comments */
 
#ifndef __cplusplus
struct exception {
int type;
const char *name;
double arg1;
double arg2;
double retval;
int err;
};
#endif
 
extern double erf(double);
extern double erfc(double);
extern double gamma(double);
extern int isinf(double);
extern int isnan(double);
extern int finite(double);
extern double j0(double);
extern double j1(double);
extern double jn(int, double);
extern double lgamma(double);
extern double nan(void);
extern double y0(double);
extern double y1(double);
extern double yn(int, double);
extern double logb(double);
extern double nextafter(double, double);
extern double remainder(double, double);
extern double scalb(double, double);
#ifndef __cplusplus
extern int matherr(struct exception *);
#endif
extern double significand(double);
extern double copysign(double, double);
extern int ilogb(double);
extern double rint(double);
extern double scalbn(double, int);
extern double drem(double, double);
extern double gamma_r(double, int *);
extern double lgamma_r(double, int *);
extern float acosf(float);
extern float asinf(float);
extern float atanf(float);
extern float atan2f(float, float);
extern float cosf(float);
extern float sinf(float);
extern float tanf(float);
extern float coshf(float);
extern float sinhf(float);
extern float tanhf(float);
extern float expf(float);
extern float frexpf(float, int *);
extern float ldexpf(float, int);
extern float logf(float);
extern float log10f(float);
extern float modff(float, float *);
extern float powf(float, float);
extern float sqrtf(float);
extern float ceilf(float);
extern float fabsf(float);
extern float floorf(float);
extern float fmodf(float, float);
extern float erff(float);
extern float erfcf(float);
extern float gammaf(float);
extern float hypotf(float, float);
extern int isinff(float);
extern int isnanf(float);
extern int finitef(float);
extern float j0f(float);
extern float j1f(float);
extern float jnf(int, float);
extern float lgammaf(float);
extern float nanf(void);
extern float y0f(float);
extern float y1f(float);
extern float ynf(int, float);
extern float acoshf(float);
extern float asinhf(float);
extern float atanhf(float);
extern float cbrtf(float);
extern float logbf(float);
extern float nextafterf(float, float);
extern float remainderf(float, float);
extern float scalbf(float, float);
extern float significandf(float);
extern float copysignf(float, float);
extern int ilogbf(float);
extern float rintf(float);
extern float scalbnf(float, int);
extern float dremf(float, float);
extern float expm1f(float);
extern float log1pf(float);
extern float gammaf_r(float, int *);
extern float lgammaf_r(float, int *);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* _USE_LIBM_MATH_H */
 
#endif /* !__dj_include_math_h_ */
/contrib/media/updf/include/mathcommands.h
0,0 → 1,23
 
#ifndef __mathcommands_h__
#define __mathcommands_h__
 
#include "yacasbase.h"
#include "lispenvironment.h"
#include "lispevalhash.h"
#include "lispobject.h"
#include "lispglobals.h"
 
 
//#define CORE_FUNCTION(NAME) void NAME(LispEnvironment& aEnvironment, LispPtr& aResult, LispPtr& aArguments);
 
#define CORE_KERNEL_FUNCTION(iname,fname,nrargs,flags) void fname(LispEnvironment& aEnvironment, LispInt aStackTop);
#define CORE_KERNEL_FUNCTION_ALIAS(iname,fname,nrargs,flags) int JimDummyFunction();
#define OPERATOR(kind, prec, yacas_name) int JimDummyFunction();
 
#include "corefunctions.h"
#undef CORE_KERNEL_FUNCTION
#undef CORE_KERNEL_FUNCTION_ALIAS
#undef OPERATOR
 
#endif
/contrib/media/updf/include/mathenvironment.h
0,0 → 1,17
/** \file mathenvironment.h
* math language specific version of environment. Currently experimental.
*
*/
 
#ifndef __mathenvironment_h__
#define __mathenvironment_h__
 
#include "yacasbase.h"
#include "lispenvironment.h"
#include "lispevalhash.h"
#include "lispobject.h"
#include "lispatom.h"
#include "lispglobals.h"
 
#endif
 
/contrib/media/updf/include/mathuserfunc.h
0,0 → 1,238
 
#ifndef __mathuserfunc_h__
#define __mathuserfunc_h__
 
#include "yacasbase.h"
#include "lispuserfunc.h"
#include "grower.h"
 
#include "patternclass.h"
 
/// A mathematical function defined by several rules.
/// This is the basic class which implements functions in Yacas.
/// Evaluation is done by consulting a set of rewriting rules. The
/// body of the first rule that matches, is evaluated and this gives
/// the result of evaluating the function.
 
class BranchingUserFunction : public LispArityUserFunction
{
public:
/// Structure containing name of parameter and whether it is put on hold.
class BranchParameter : public YacasBase
{
public:
BranchParameter(LispString * aParameter = NULL, LispInt aHold=LispFalse)
: iParameter(aParameter), iHold(aHold) {}
LispString * iParameter;
LispInt iHold;
};
 
/// Abstract base class for rules.
class BranchRuleBase : public YacasBase
{
public:
virtual ~BranchRuleBase();
virtual LispBoolean Matches(LispEnvironment& aEnvironment, LispPtr* aArguments) = 0;
virtual LispInt Precedence() const = 0;
virtual LispPtr& Body() = 0;
};
 
/// A rule with a predicate.
/// This rule matches if the predicate evaluates to #LispTrue.
class BranchRule : public BranchRuleBase
{
public:
virtual ~BranchRule();
BranchRule(LispInt aPrecedence,LispPtr& aPredicate,LispPtr& aBody) : iPrecedence(aPrecedence),iBody(aBody),iPredicate(aPredicate)
{
}
 
/// Return true if the rule matches.
/// #iPredicate is evaluated in \a Environment. If the result
/// IsTrue(), this function returns true.
virtual LispBoolean Matches(LispEnvironment& aEnvironment, LispPtr* aArguments);
 
/// Access #iPrecedence.
virtual LispInt Precedence() const;
 
/// Access #iBody.
virtual LispPtr& Body();
protected:
BranchRule() : iPrecedence(0),iBody(),iPredicate() {};
protected:
LispInt iPrecedence;
LispPtr iBody;
LispPtr iPredicate;
};
 
/// A rule that always matches.
class BranchRuleTruePredicate : public BranchRule
{
public:
BranchRuleTruePredicate(LispInt aPrecedence,LispPtr& aBody)
{
iPrecedence = aPrecedence;
iBody = (aBody);
}
/// Return #LispTrue, always.
virtual LispBoolean Matches(LispEnvironment& aEnvironment, LispPtr* aArguments);
};
 
/// A rule which matches if the corresponding PatternClass matches.
class BranchPattern : public BranchRuleBase
{
public:
/// Destructor.
/// This function contains no code.
virtual ~BranchPattern();
 
/// Constructor.
/// \param aPrecedence precedence of the rule
/// \param aPredicate generic object of type \c Pattern
/// \param aBody body of the rule
BranchPattern(LispInt aPrecedence,LispPtr& aPredicate,LispPtr& aBody) : iPrecedence(aPrecedence),iBody(aBody),iPredicate(aPredicate),iPatternClass(NULL)
{
GenericClass *gen = aPredicate->Generic();
DYNCAST(PatternClass,"\"Pattern\"",pat,gen)
Check(pat,KLispErrInvalidArg);
iPatternClass = pat;
}
 
/// Return true if the corresponding pattern matches.
virtual LispBoolean Matches(LispEnvironment& aEnvironment, LispPtr* aArguments);
 
/// Access #iPrecedence
virtual LispInt Precedence() const;
 
/// Access #iBody
virtual LispPtr& Body();
 
private:
BranchPattern(const BranchPattern& aOther) : iPrecedence(0),iBody(),iPredicate(),iPatternClass(NULL)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
BranchPattern& operator=(const BranchPattern& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
 
protected:
/// The precedence of this rule.
LispInt iPrecedence;
 
/// The body of this rule.
LispPtr iBody;
 
/// Generic object of type \c Pattern containing #iPatternClass
LispPtr iPredicate;
 
/// The pattern that decides whether this rule matches.
PatternClass *iPatternClass;
};
 
/// Constructor.
/// \param aParameters linked list constaining the names of the arguments
///
/// #iParamList and #iParameters are set from \a aParameters.
BranchingUserFunction(LispPtr& aParameters);
 
/// Destructor.
/// There is no code inside this function.
virtual ~BranchingUserFunction();
 
/// Evaluate the function on given arguments.
/// \param aResult (on output) the result of the evaluation
/// \param aEnvironment the underlying Lisp environment
/// \param aArguments the arguments to the function
///
/// First, all arguments are evaluated by the evaluator associated
/// to \a aEnvironment, unless the \c iHold flag of the
/// corresponding parameter is true. Then a new LispLocalFrame is
/// constructed, in which the actual arguments are assigned to the
/// names of the formal arguments, as stored in \c iParameter. Then
/// all rules in #iRules are tried one by one. The body of the
/// first rule that matches is evaluated, and the result is put in
/// \a aResult. If no rule matches, \a aResult will recieve a new
/// expression with evaluated arguments.
virtual void Evaluate(LispPtr& aResult,LispEnvironment& aEnvironment, LispPtr& aArguments);
 
/// Put an argument on hold.
/// \param aVariable name of argument to put un hold
///
/// The \c iHold flag of the corresponding argument is set. This
/// implies that this argument is not evaluated by Evaluate().
virtual void HoldArgument(LispString * aVariable);
 
/// Return true if the arity of the function equals \a aArity.
virtual LispInt IsArity(LispInt aArity) const;
 
/// Return the arity (number of arguments) of the function.
LispInt Arity() const;
 
/// Add a BranchRule to the list of rules.
/// \sa InsertRule()
virtual void DeclareRule(LispInt aPrecedence, LispPtr& aPredicate, LispPtr& aBody);
 
/// Add a BranchRuleTruePredicate to the list of rules.
/// \sa InsertRule()
virtual void DeclareRule(LispInt aPrecedence, LispPtr& aBody);
 
/// Add a BranchPattern to the list of rules.
/// \sa InsertRule()
void DeclarePattern(LispInt aPrecedence, LispPtr& aPredicate, LispPtr& aBody);
 
/// Insert any BranchRuleBase object in the list of rules.
/// This function does the real work for DeclareRule() and
/// DeclarePattern(): it inserts the rule in #iRules, while
/// keeping it sorted. The algorithm is \f$O(\log n)\f$, where
/// \f$n\f$ denotes the number of rules.
void InsertRule(LispInt aPrecedence,BranchRuleBase* newRule);
 
/// Return the argument list, stored in #iParamList
virtual LispPtr& ArgList();
 
protected:
/// List of arguments, with corresponding \c iHold property.
CArrayGrower<BranchParameter, ArrOpsPOD<BranchParameter> > iParameters;
 
/// List of rules, sorted on precedence.
CDeletingArrayGrower<BranchRuleBase*, ArrOpsDeletingPtr<BranchRuleBase> > iRules;
 
/// List of arguments
LispPtr iParamList;
};
 
class ListedBranchingUserFunction : public BranchingUserFunction
{
public:
ListedBranchingUserFunction(LispPtr& aParameters);
virtual LispInt IsArity(LispInt aArity) const;
virtual void Evaluate(LispPtr& aResult,LispEnvironment& aEnvironment, LispPtr& aArguments);
};
 
 
class MacroUserFunction : public BranchingUserFunction
{
public:
MacroUserFunction(LispPtr& aParameters);
virtual void Evaluate(LispPtr& aResult,LispEnvironment& aEnvironment, LispPtr& aArguments);
};
 
 
class ListedMacroUserFunction : public MacroUserFunction
{
public:
ListedMacroUserFunction(LispPtr& aParameters);
virtual LispInt IsArity(LispInt aArity) const;
virtual void Evaluate(LispPtr& aResult,LispEnvironment& aEnvironment, LispPtr& aArguments);
};
 
 
 
 
#endif
 
/contrib/media/updf/include/mathutil.h
0,0 → 1,8
 
#ifndef __mathutil_h__
#define __mathutil_h__
 
LispInt PlatAsciiToInt(LispChar * aString);
 
#endif
 
/contrib/media/updf/include/mcoff/_coff.h
0,0 → 1,315
#ifndef __MENUET_COFF_H
#define __MENUET_COFF_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
/********************** FILE HEADER **********************/
 
struct external_filehdr {
unsigned short f_magic; /* magic number */
unsigned short f_nscns; /* number of sections */
unsigned long f_timdat; /* time & date stamp */
unsigned long f_symptr; /* file pointer to symtab */
unsigned long f_nsyms; /* number of symtab entries */
unsigned short f_opthdr; /* sizeof(optional hdr) */
unsigned short f_flags; /* flags */
};
 
/* Bits for f_flags:
* F_RELFLG relocation info stripped from file
* F_EXEC file is executable (no unresolved external references)
* F_LNNO line numbers stripped from file
* F_LSYMS local symbols stripped from file
* F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax)
*/
 
#define F_RELFLG (0x0001)
#define F_EXEC (0x0002)
#define F_LNNO (0x0004)
#define F_LSYMS (0x0008)
 
#define I386MAGIC 0x14c
#define I386AIXMAGIC 0x175
#define I386BADMAG(x) (((x).f_magic!=I386MAGIC) && (x).f_magic!=I386AIXMAGIC)
 
#define FILHDR struct external_filehdr
#define FILHSZ sizeof(FILHDR)
 
/********************** AOUT "OPTIONAL HEADER" **********************/
 
typedef struct
{
unsigned short magic; /* type of file */
unsigned short vstamp; /* version stamp */
unsigned long tsize; /* text size in bytes, padded to FW bdry*/
unsigned long dsize; /* initialized data " " */
unsigned long bsize; /* uninitialized data " " */
unsigned long entry; /* entry pt. */
unsigned long text_start; /* base of text used for this file */
unsigned long data_start; /* base of data used for this file */
} AOUTHDR;
 
typedef struct gnu_aout {
unsigned long info;
unsigned long tsize;
unsigned long dsize;
unsigned long bsize;
unsigned long symsize;
unsigned long entry;
unsigned long txrel;
unsigned long dtrel;
} GNU_AOUT;
 
#define AOUTSZ (sizeof(AOUTHDR))
 
#define OMAGIC 0404 /* object files, eg as output */
#define ZMAGIC 0413 /* demand load format, eg normal ld output */
#define STMAGIC 0401 /* target shlib */
#define SHMAGIC 0443 /* host shlib */
 
 
/********************** SECTION HEADER **********************/
 
struct external_scnhdr {
char s_name[8]; /* section name */
unsigned long s_paddr; /* physical address, aliased s_nlib */
unsigned long s_vaddr; /* virtual address */
unsigned long s_size; /* section size */
unsigned long s_scnptr; /* file ptr to raw data for section */
unsigned long s_relptr; /* file ptr to relocation */
unsigned long s_lnnoptr; /* file ptr to line numbers */
unsigned short s_nreloc; /* number of relocation entries */
unsigned short s_nlnno; /* number of line number entries*/
unsigned long s_flags; /* flags */
};
 
#define SCNHDR struct external_scnhdr
#define SCNHSZ sizeof(SCNHDR)
 
/*
* names of "special" sections
*/
#define _TEXT ".text"
#define _DATA ".data"
#define _BSS ".bss"
#define _COMMENT ".comment"
#define _LIB ".lib"
 
/*
* s_flags "type"
*/
#define STYP_TEXT (0x0020) /* section contains text only */
#define STYP_DATA (0x0040) /* section contains data only */
#define STYP_BSS (0x0080) /* section contains bss only */
 
/********************** LINE NUMBERS **********************/
 
/* 1 line number entry for every "breakpointable" source line in a section.
* Line numbers are grouped on a per function basis; first entry in a function
* grouping will have l_lnno = 0 and in place of physical address will be the
* symbol table index of the function name.
*/
struct external_lineno {
union {
unsigned long l_symndx __attribute__((packed)); /* function name symbol index, iff l_lnno == 0 */
unsigned long l_paddr __attribute__((packed)); /* (physical) address of line number */
} l_addr;
unsigned short l_lnno; /* line number */
};
 
 
#define LINENO struct external_lineno
#define LINESZ sizeof(LINENO)
 
 
/********************** SYMBOLS **********************/
 
#define E_SYMNMLEN 8 /* # characters in a symbol name */
#define E_FILNMLEN 14 /* # characters in a file name */
#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
 
struct external_syment
{
union {
char e_name[E_SYMNMLEN];
struct {
unsigned long e_zeroes __attribute__((packed));
unsigned long e_offset __attribute__((packed));
} e;
} e;
unsigned long e_value __attribute__((packed));
short e_scnum;
unsigned short e_type;
unsigned char e_sclass;
unsigned char e_numaux;
} __attribute__((packed));
 
#define N_BTMASK (0xf)
#define N_TMASK (0x30)
#define N_BTSHFT (4)
#define N_TSHIFT (2)
union external_auxent
{
struct
{
unsigned long x_tagndx __attribute__((packed)); /* str, un, or enum tag indx */
union
{
struct
{
unsigned short x_lnno; /* declaration line number */
unsigned short x_size; /* str/union/array size */
} x_lnsz;
unsigned long x_fsize __attribute__((packed)); /* size of function */
} x_misc;
union
{
struct
{ /* if ISFCN, tag, or .bb */
unsigned long x_lnnoptr __attribute__((packed)); /* ptr to fcn line # */
unsigned long x_endndx __attribute__((packed)); /* entry ndx past block end */
} x_fcn;
struct { /* if ISARY, up to 4 dimen. */
unsigned short x_dimen[E_DIMNUM];
} x_ary;
} x_fcnary;
unsigned short x_tvndx; /* tv index */
} x_sym;
union
{
char x_fname[E_FILNMLEN];
struct
{
unsigned long x_zeroes __attribute__((packed));
unsigned long x_offset __attribute__((packed));
} x_n;
} x_file;
struct
{
unsigned long x_scnlen __attribute__((packed)); /* section length */
unsigned short x_nreloc; /* # relocation entries */
unsigned short x_nlinno; /* # line numbers */
} x_scn;
struct
{
unsigned long x_tvfill __attribute__((packed)); /* tv fill value */
unsigned short x_tvlen; /* length of .tv */
unsigned short x_tvran[2]; /* tv range */
} x_tv; /* info about .tv section (in auxent of symbol .tv)) */
};
 
#define SYMENT struct external_syment
#define SYMESZ sizeof(SYMENT)
#define AUXENT union external_auxent
#define AUXESZ sizeof(AUXENT)
 
#define _ETEXT "etext"
 
/* Relocatable symbols have number of the section in which they are defined,
or one of the following: */
 
#define N_UNDEF ((short)0) /* undefined symbol */
#define N_ABS ((short)-1) /* value of symbol is absolute */
#define N_DEBUG ((short)-2) /* debugging symbol -- value is meaningless */
#define N_TV ((short)-3) /* indicates symbol needs preload transfer vector */
#define P_TV ((short)-4) /* indicates symbol needs postload transfer vector*/
 
/*
* Type of a symbol, in low N bits of the word
*/
#define T_NULL 0
#define T_VOID 1 /* function argument (only used by compiler) */
#define T_CHAR 2 /* character */
#define T_SHORT 3 /* short integer */
#define T_INT 4 /* integer */
#define T_LONG 5 /* long integer */
#define T_FLOAT 6 /* floating point */
#define T_DOUBLE 7 /* double word */
#define T_STRUCT 8 /* structure */
#define T_UNION 9 /* union */
#define T_ENUM 10 /* enumeration */
#define T_MOE 11 /* member of enumeration*/
#define T_UCHAR 12 /* unsigned character */
#define T_USHORT 13 /* unsigned short */
#define T_UINT 14 /* unsigned integer */
#define T_ULONG 15 /* unsigned long */
#define T_LNGDBL 16 /* long double */
 
/*
* derived types, in n_type
*/
#define DT_NON (0) /* no derived type */
#define DT_PTR (1) /* pointer */
#define DT_FCN (2) /* function */
#define DT_ARY (3) /* array */
 
#define BTYPE(x) ((x) & N_BTMASK)
 
#define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
#define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
#define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
#define ISTAG(x) ((x)==C_STRTAG||(x)==C_UNTAG||(x)==C_ENTAG)
#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
 
/********************** STORAGE CLASSES **********************/
 
/* This used to be defined as -1, but now n_sclass is unsigned. */
#define C_EFCN 0xff /* physical end of function */
#define C_NULL 0
#define C_AUTO 1 /* automatic variable */
#define C_EXT 2 /* external symbol */
#define C_STAT 3 /* static */
#define C_REG 4 /* register variable */
#define C_EXTDEF 5 /* external definition */
#define C_LABEL 6 /* label */
#define C_ULABEL 7 /* undefined label */
#define C_MOS 8 /* member of structure */
#define C_ARG 9 /* function argument */
#define C_STRTAG 10 /* structure tag */
#define C_MOU 11 /* member of union */
#define C_UNTAG 12 /* union tag */
#define C_TPDEF 13 /* type definition */
#define C_USTATIC 14 /* undefined static */
#define C_ENTAG 15 /* enumeration tag */
#define C_MOE 16 /* member of enumeration */
#define C_REGPARM 17 /* register parameter */
#define C_FIELD 18 /* bit field */
#define C_AUTOARG 19 /* auto argument */
#define C_LASTENT 20 /* dummy entry (end of block) */
#define C_BLOCK 100 /* ".bb" or ".eb" */
#define C_FCN 101 /* ".bf" or ".ef" */
#define C_EOS 102 /* end of structure */
#define C_FILE 103 /* file name */
#define C_LINE 104 /* line # reformatted as symbol table entry */
#define C_ALIAS 105 /* duplicate tag */
#define C_HIDDEN 106 /* ext symbol in dmert public lib */
 
/********************** RELOCATION DIRECTIVES **********************/
 
struct external_reloc {
unsigned long r_vaddr __attribute__((packed));
unsigned long r_symndx __attribute__((packed));
unsigned short r_type;
};
 
 
#define RELOC struct external_reloc
#define RELSZ sizeof(RELOC)
 
#define RELOC_REL32 20 /* 32-bit PC-relative address */
#define RELOC_ADDR32 6 /* 32-bit absolute address */
 
#define DEFAULT_DATA_SECTION_ALIGNMENT 4
#define DEFAULT_BSS_SECTION_ALIGNMENT 4
#define DEFAULT_TEXT_SECTION_ALIGNMENT 4
/* For new sections we havn't heard of before */
#define DEFAULT_SECTION_ALIGNMENT 4
 
#ifdef __cplusplus
}
#endif
 
#endif
/contrib/media/updf/include/mcoff/mcoff.h
0,0 → 1,64
#ifndef __MENUETOS_MCOFF_H
#define __MENUETOS_MCOFF_H
 
#include"_coff.h"
 
typedef struct {
char * co_loadptr;
unsigned long co_loadaddr;
unsigned long co_filesize;
FILHDR * co_filehdr;
SCNHDR * co_sections;
SYMENT * co_symtab;
char * co_strtab;
char * co_bssptr;
unsigned long co_bssaddr;
unsigned long co_bsssize;
unsigned long co_bsssectnum;
} coffobj_t;
 
coffobj_t * mcoff_load_file(char * fname);
void unload_coff_file(coffobj_t * obj);
SCNHDR * find_section(char * name,coffobj_t * obj);
int read_section_data(coffobj_t * obj,SCNHDR * hdr,void ** readp);
SYMENT * find_coff_symbol(coffobj_t * obj,char * objname);
 
typedef int (* symlookupfn_t)(coffobj_t *,unsigned long *,unsigned long *,int);
int relocate_coff_file(coffobj_t * obj,symlookupfn_t lookupfn);
int mcoff_std_symlookupfn(coffobj_t * obj,unsigned long * sym_val,
unsigned long * sym_sect,int index);
unsigned long mcoff_get_ref(coffobj_t * obj,char * symname);
 
/*
Your lookup function can be similar to this:
 
int mcoff_std_symlookupfn(coffobj_t * obj,unsigned long * sym_val,
unsigned long * sym_sect,int index)
{
SYMENT * symtab,* lookup;
char xname[9];
char * symnamep;
symtab=obj->co_symtab+index;
*sym_sect=(unsigned long)symtab->e_scnum;
if(symtab->e_scnum>0)
{
*sym_val=symtab->e_value;
return 0;
}
if(symtab->e.e.e_zeroes==0)
{
symnamep=(char *)(((long)obj->co_strtab)+symtab->e.e.e_offset);
} else {
symnamep=(char *)symtab->e.e_name;
memset(xname,0,9);
memcpy(xname,symnamep,8);
symnamep=xname;
}
lookup=find_coff_symbol(obj,symnamep);
if(!lookup) return -1;
*sym_val=lookup->e_value+obj->co_sections[lookup->e_scnum-1].s_scnptr+obj->co_loadaddr;
return 0;
}
*/
 
#endif
/contrib/media/updf/include/mct.h
0,0 → 1,98
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __MCT_H
#define __MCT_H
/**
@file mct.h
@brief Implementation of a multi-component transforms (MCT)
 
The functions in MCT.C have for goal to realize reversible and irreversible multicomponent
transform. The functions in MCT.C are used by some function in TCD.C.
*/
 
/** @defgroup MCT MCT - Implementation of a multi-component transform */
/*@{*/
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Apply a reversible multi-component transform to an image
@param c0 Samples for red component
@param c1 Samples for green component
@param c2 Samples blue component
@param n Number of samples for each component
*/
void mct_encode(int *c0, int *c1, int *c2, int n);
/**
Apply a reversible multi-component inverse transform to an image
@param c0 Samples for luminance component
@param c1 Samples for red chrominance component
@param c2 Samples for blue chrominance component
@param n Number of samples for each component
*/
void mct_decode(int *c0, int *c1, int *c2, int n);
/**
Get norm of the basis function used for the reversible multi-component transform
@param compno Number of the component (0->Y, 1->U, 2->V)
@return
*/
double mct_getnorm(int compno);
 
/**
Apply an irreversible multi-component transform to an image
@param c0 Samples for red component
@param c1 Samples for green component
@param c2 Samples blue component
@param n Number of samples for each component
*/
void mct_encode_real(int *c0, int *c1, int *c2, int n);
/**
Apply an irreversible multi-component inverse transform to an image
@param c0 Samples for luminance component
@param c1 Samples for red chrominance component
@param c2 Samples for blue chrominance component
@param n Number of samples for each component
*/
void mct_decode_real(float* c0, float* c1, float* c2, int n);
/**
Get norm of the basis function used for the irreversible multi-component transform
@param compno Number of the component (0->Y, 1->U, 2->V)
@return
*/
double mct_getnorm_real(int compno);
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __MCT_H */
/contrib/media/updf/include/mem.h
0,0 → 1,5
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/* DO NOT USE THIS IN NEW CODE. It is here only
to allow old code to compile. */
 
#include <memory.h>
/contrib/media/updf/include/memory
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_MEMORY
#include <bits/std_memory.h>
#endif
/contrib/media/updf/include/memory.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_memory_h_
#define __dj_include_memory_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <stdlib.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_memory_h_ */
/contrib/media/updf/include/menu.h
0,0 → 1,250
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************
* Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1995,1997 *
****************************************************************************/
 
#ifndef ETI_MENU
#define ETI_MENU
 
#include <curses.h>
#include <eti.h>
 
#ifdef __cplusplus
extern "C" {
#endif
 
typedef int Menu_Options;
typedef int Item_Options;
 
/* Menu options: */
#define O_ONEVALUE (0x01)
#define O_SHOWDESC (0x02)
#define O_ROWMAJOR (0x04)
#define O_IGNORECASE (0x08)
#define O_SHOWMATCH (0x10)
#define O_NONCYCLIC (0x20)
 
/* Item options: */
#define O_SELECTABLE (0x01)
 
typedef struct
{
const char* str;
unsigned short length;
} TEXT;
 
typedef struct tagITEM
{
TEXT name; /* name of menu item */
TEXT description; /* description of item, optional in display */
struct tagMENU *imenu; /* Pointer to parent menu */
void *userptr; /* Pointer to user defined per item data */
Item_Options opt; /* Item options */
short index; /* Item number if connected to a menu */
short y; /* y and x location of item in menu */
short x;
bool value; /* Selection value */
struct tagITEM *left; /* neighbour items */
struct tagITEM *right;
struct tagITEM *up;
struct tagITEM *down;
 
} ITEM;
 
typedef void (*Menu_Hook)(struct tagMENU *);
 
typedef struct tagMENU
{
short height; /* Nr. of chars high */
short width; /* Nr. of chars wide */
short rows; /* Nr. of items high */
short cols; /* Nr. of items wide */
short frows; /* Nr. of formatted items high */
short fcols; /* Nr. of formatted items wide */
short arows; /* Nr. of items high (actual) */
short namelen; /* Max. name length */
short desclen; /* Max. description length */
short marklen; /* Length of mark, if any */
short itemlen; /* Length of one item */
short spc_desc; /* Spacing for descriptor */
short spc_cols; /* Spacing for columns */
short spc_rows; /* Spacing for rows */
char *pattern; /* Buffer to store match chars */
short pindex; /* Index into pattern buffer */
WINDOW *win; /* Window containing menu */
WINDOW *sub; /* Subwindow for menu display */
WINDOW *userwin; /* User's window */
WINDOW *usersub; /* User's subwindow */
ITEM **items; /* array of items */
short nitems; /* Nr. of items in menu */
ITEM *curitem; /* Current item */
short toprow; /* Top row of menu */
chtype fore; /* Selection attribute */
chtype back; /* Nonselection attribute */
chtype grey; /* Inactive attribute */
unsigned char pad; /* Pad character */
 
Menu_Hook menuinit; /* User hooks */
Menu_Hook menuterm;
Menu_Hook iteminit;
Menu_Hook itemterm;
 
void *userptr; /* Pointer to menus user data */
char *mark; /* Pointer to marker string */
 
Menu_Options opt; /* Menu options */
unsigned short status; /* Internal state of menu */
 
} MENU;
 
 
/* Define keys */
 
#define REQ_LEFT_ITEM (KEY_MAX + 1)
#define REQ_RIGHT_ITEM (KEY_MAX + 2)
#define REQ_UP_ITEM (KEY_MAX + 3)
#define REQ_DOWN_ITEM (KEY_MAX + 4)
#define REQ_SCR_ULINE (KEY_MAX + 5)
#define REQ_SCR_DLINE (KEY_MAX + 6)
#define REQ_SCR_DPAGE (KEY_MAX + 7)
#define REQ_SCR_UPAGE (KEY_MAX + 8)
#define REQ_FIRST_ITEM (KEY_MAX + 9)
#define REQ_LAST_ITEM (KEY_MAX + 10)
#define REQ_NEXT_ITEM (KEY_MAX + 11)
#define REQ_PREV_ITEM (KEY_MAX + 12)
#define REQ_TOGGLE_ITEM (KEY_MAX + 13)
#define REQ_CLEAR_PATTERN (KEY_MAX + 14)
#define REQ_BACK_PATTERN (KEY_MAX + 15)
#define REQ_NEXT_MATCH (KEY_MAX + 16)
#define REQ_PREV_MATCH (KEY_MAX + 17)
 
#define MIN_MENU_COMMAND (KEY_MAX + 1)
#define MAX_MENU_COMMAND (KEY_MAX + 17)
 
/*
* Some AT&T code expects MAX_COMMAND to be out-of-band not
* just for menu commands but for forms ones as well.
*/
#if defined(MAX_COMMAND)
# if (MAX_MENU_COMMAND > MAX_COMMAND)
# error Something is wrong -- MAX_MENU_COMMAND is greater than MAX_COMMAND
# elif (MAX_COMMAND != (KEY_MAX + 128))
# error Something is wrong -- MAX_COMMAND is already inconsistently defined.
# endif
#else
# define MAX_COMMAND (KEY_MAX + 128)
#endif
 
 
/* --------- prototypes for libmenu functions ----------------------------- */
 
extern ITEM **menu_items(const MENU *),
*current_item(const MENU *),
*new_item(const char *,const char *);
 
extern MENU *new_menu(ITEM **);
 
extern Item_Options item_opts(const ITEM *);
extern Menu_Options menu_opts(const MENU *);
 
Menu_Hook item_init(const MENU *),
item_term(const MENU *),
menu_init(const MENU *),
menu_term(const MENU *);
 
extern WINDOW *menu_sub(const MENU *),
*menu_win(const MENU *);
 
extern const char *item_description(const ITEM *),
*item_name(const ITEM *),
*menu_mark(const MENU *),
*menu_request_name(int);
 
extern char *menu_pattern(const MENU *);
 
extern void *menu_userptr(const MENU *),
*item_userptr(const ITEM *);
 
extern chtype menu_back(const MENU *),
menu_fore(const MENU *),
menu_grey(const MENU *);
 
extern int free_item(ITEM *),
free_menu(MENU *),
item_count(const MENU *),
item_index(const ITEM *),
item_opts_off(ITEM *,Item_Options),
item_opts_on(ITEM *,Item_Options),
menu_driver(MENU *,int),
menu_opts_off(MENU *,Menu_Options),
menu_opts_on(MENU *,Menu_Options),
menu_pad(const MENU *),
pos_menu_cursor(const MENU *),
post_menu(MENU *),
scale_menu(const MENU *,int *,int *),
set_current_item(MENU *menu,ITEM *item),
set_item_init(MENU *,void(*)(MENU *)),
set_item_opts(ITEM *,Item_Options),
set_item_term(MENU *,void(*)(MENU *)),
set_item_userptr(ITEM *, void *),
set_item_value(ITEM *,bool),
set_menu_back(MENU *,chtype),
set_menu_fore(MENU *,chtype),
set_menu_format(MENU *,int,int),
set_menu_grey(MENU *,chtype),
set_menu_init(MENU *,void(*)(MENU *)),
set_menu_items(MENU *,ITEM **),
set_menu_mark(MENU *, const char *),
set_menu_opts(MENU *,Menu_Options),
set_menu_pad(MENU *,int),
set_menu_pattern(MENU *,const char *),
set_menu_sub(MENU *,WINDOW *),
set_menu_term(MENU *,void(*)(MENU *)),
set_menu_userptr(MENU *,void *),
set_menu_win(MENU *,WINDOW *),
set_top_row(MENU *,int),
top_row(const MENU *),
unpost_menu(MENU *),
menu_request_by_name(const char *),
set_menu_spacing(MENU *,int,int,int),
menu_spacing(const MENU *,int *,int *,int *);
 
 
extern bool item_value(const ITEM *),
item_visible(const ITEM *);
 
void menu_format(const MENU *,int *,int *);
 
#ifdef __cplusplus
}
#endif
 
#endif /* ETI_MENU */
/contrib/media/updf/include/menuet/console.h
0,0 → 1,25
#ifndef __GLIBC__MENUET_CONSOLE_H
#define __GLIBC__MENUET_CONSOLE_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include<menuet/os.h>
 
extern const unsigned char font_8x8[];
extern void __menuet__redraw_console(void);
extern void __menuet__show_text_cursor(void);
extern void __menuet__hide_text_cursor(void);
extern void __menuet__init_console(int x,int y);
extern void __menuet__clrscr(void);
extern void __menuet__putch(char c);
extern void __menuet__gotoxy(int x,int y);
extern void __menuet__outtextxy(int x,int y,char c);
extern void __menuet__getxy(int * x,int * y);
 
#ifdef __cplusplus
}
#endif
 
#endif
/contrib/media/updf/include/menuet/font8x8.h
0,0 → 1,262
/* font characters */
/* from www.freetype.org */
const unsigned char font_8x8[2048] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E,
0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E,
0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00,
0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x10, 0x00,
0x38, 0x7C, 0x38, 0xFE, 0xFE, 0x92, 0x10, 0x7C,
0x00, 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x7C,
0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00,
0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF,
0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00,
0xFF, 0xC3, 0x99, 0xBD, 0xBD, 0x99, 0xC3, 0xFF,
0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78,
0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18,
0x3F, 0x33, 0x3F, 0x30, 0x30, 0x70, 0xF0, 0xE0,
0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0,
0x99, 0x5A, 0x3C, 0xE7, 0xE7, 0x3C, 0x5A, 0x99,
0x80, 0xE0, 0xF8, 0xFE, 0xF8, 0xE0, 0x80, 0x00,
0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00,
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18,
0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x00,
0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00,
0x3E, 0x63, 0x38, 0x6C, 0x6C, 0x38, 0x86, 0xFC,
0x00, 0x00, 0x00, 0x00, 0x7E, 0x7E, 0x7E, 0x00,
0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF,
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00,
0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00,
0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00,
0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00,
0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xFE, 0x00, 0x00,
0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00,
0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00,
0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00,
0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00,
0x18, 0x7E, 0xC0, 0x7C, 0x06, 0xFC, 0x18, 0x00,
0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00,
0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00,
0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, 0x00,
0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00,
0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00,
0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30,
0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00,
0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00,
0x7C, 0xCE, 0xDE, 0xF6, 0xE6, 0xC6, 0x7C, 0x00,
0x30, 0x70, 0x30, 0x30, 0x30, 0x30, 0xFC, 0x00,
0x78, 0xCC, 0x0C, 0x38, 0x60, 0xCC, 0xFC, 0x00,
0x78, 0xCC, 0x0C, 0x38, 0x0C, 0xCC, 0x78, 0x00,
0x1C, 0x3C, 0x6C, 0xCC, 0xFE, 0x0C, 0x1E, 0x00,
0xFC, 0xC0, 0xF8, 0x0C, 0x0C, 0xCC, 0x78, 0x00,
0x38, 0x60, 0xC0, 0xF8, 0xCC, 0xCC, 0x78, 0x00,
0xFC, 0xCC, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00,
0x78, 0xCC, 0xCC, 0x78, 0xCC, 0xCC, 0x78, 0x00,
0x78, 0xCC, 0xCC, 0x7C, 0x0C, 0x18, 0x70, 0x00,
0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00,
0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30,
0x18, 0x30, 0x60, 0xC0, 0x60, 0x30, 0x18, 0x00,
0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00,
0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00,
0x3C, 0x66, 0x0C, 0x18, 0x18, 0x00, 0x18, 0x00,
0x7C, 0xC6, 0xDE, 0xDE, 0xDC, 0xC0, 0x7C, 0x00,
0x30, 0x78, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0x00,
0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00,
0x3C, 0x66, 0xC0, 0xC0, 0xC0, 0x66, 0x3C, 0x00,
0xF8, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00,
0xFE, 0x62, 0x68, 0x78, 0x68, 0x62, 0xFE, 0x00,
0xFE, 0x62, 0x68, 0x78, 0x68, 0x60, 0xF0, 0x00,
0x3C, 0x66, 0xC0, 0xC0, 0xCE, 0x66, 0x3A, 0x00,
0xCC, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0xCC, 0x00,
0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00,
0x1E, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00,
0xE6, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0xE6, 0x00,
0xF0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xFE, 0x00,
0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00,
0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00,
0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00,
0xFC, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00,
0x7C, 0xC6, 0xC6, 0xC6, 0xD6, 0x7C, 0x0E, 0x00,
0xFC, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0xE6, 0x00,
0x7C, 0xC6, 0xE0, 0x78, 0x0E, 0xC6, 0x7C, 0x00,
0xFC, 0xB4, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00,
0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xFC, 0x00,
0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00,
0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xFE, 0x6C, 0x00,
0xC6, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0xC6, 0x00,
0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x30, 0x78, 0x00,
0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00,
0x78, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x00,
0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00,
0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00,
0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00,
0xE0, 0x60, 0x60, 0x7C, 0x66, 0x66, 0xDC, 0x00,
0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00,
0x1C, 0x0C, 0x0C, 0x7C, 0xCC, 0xCC, 0x76, 0x00,
0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
0x38, 0x6C, 0x64, 0xF0, 0x60, 0x60, 0xF0, 0x00,
0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8,
0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00,
0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
0x0C, 0x00, 0x1C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78,
0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00,
0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00,
0x00, 0x00, 0xCC, 0xFE, 0xFE, 0xD6, 0xD6, 0x00,
0x00, 0x00, 0xB8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00,
0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00,
0x00, 0x00, 0xDC, 0x66, 0x66, 0x7C, 0x60, 0xF0,
0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E,
0x00, 0x00, 0xDC, 0x76, 0x62, 0x60, 0xF0, 0x00,
0x00, 0x00, 0x7C, 0xC0, 0x70, 0x1C, 0xF8, 0x00,
0x10, 0x30, 0xFC, 0x30, 0x30, 0x34, 0x18, 0x00,
0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00,
0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00,
0x00, 0x00, 0xC6, 0xC6, 0xD6, 0xFE, 0x6C, 0x00,
0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00,
0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8,
0x00, 0x00, 0xFC, 0x98, 0x30, 0x64, 0xFC, 0x00,
0x1C, 0x30, 0x30, 0xE0, 0x30, 0x30, 0x1C, 0x00,
0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00,
0xE0, 0x30, 0x30, 0x1C, 0x30, 0x30, 0xE0, 0x00,
0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00,
0x7C, 0xC6, 0xC0, 0xC6, 0x7C, 0x0C, 0x06, 0x7C,
0x00, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00,
0x1C, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
0x7E, 0x81, 0x3C, 0x06, 0x3E, 0x66, 0x3B, 0x00,
0xCC, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00,
0xE0, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00,
0x30, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00,
0x00, 0x00, 0x7C, 0xC6, 0xC0, 0x78, 0x0C, 0x38,
0x7E, 0x81, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00,
0xCC, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
0xE0, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00,
0xCC, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
0x7C, 0x82, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00,
0xE0, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
0xC6, 0x10, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00,
0x30, 0x30, 0x00, 0x78, 0xCC, 0xFC, 0xCC, 0x00,
0x1C, 0x00, 0xFC, 0x60, 0x78, 0x60, 0xFC, 0x00,
0x00, 0x00, 0x7F, 0x0C, 0x7F, 0xCC, 0x7F, 0x00,
0x3E, 0x6C, 0xCC, 0xFE, 0xCC, 0xCC, 0xCE, 0x00,
0x78, 0x84, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00,
0x00, 0xCC, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00,
0x00, 0xE0, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00,
0x78, 0x84, 0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00,
0x00, 0xE0, 0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00,
0x00, 0xCC, 0x00, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8,
0xC3, 0x18, 0x3C, 0x66, 0x66, 0x3C, 0x18, 0x00,
0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x00,
0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18,
0x38, 0x6C, 0x64, 0xF0, 0x60, 0xE6, 0xFC, 0x00,
0xCC, 0xCC, 0x78, 0x30, 0xFC, 0x30, 0xFC, 0x30,
0xF8, 0xCC, 0xCC, 0xFA, 0xC6, 0xCF, 0xC6, 0xC3,
0x0E, 0x1B, 0x18, 0x3C, 0x18, 0x18, 0xD8, 0x70,
0x1C, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00,
0x38, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
0x00, 0x1C, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00,
0x00, 0x1C, 0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00,
0x00, 0xF8, 0x00, 0xB8, 0xCC, 0xCC, 0xCC, 0x00,
0xFC, 0x00, 0xCC, 0xEC, 0xFC, 0xDC, 0xCC, 0x00,
0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00, 0x00,
0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00,
0x18, 0x00, 0x18, 0x18, 0x30, 0x66, 0x3C, 0x00,
0x00, 0x00, 0x00, 0xFC, 0xC0, 0xC0, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFC, 0x0C, 0x0C, 0x00, 0x00,
0xC6, 0xCC, 0xD8, 0x36, 0x6B, 0xC2, 0x84, 0x0F,
0xC3, 0xC6, 0xCC, 0xDB, 0x37, 0x6D, 0xCF, 0x03,
0x18, 0x00, 0x18, 0x18, 0x3C, 0x3C, 0x18, 0x00,
0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00,
0x00, 0xCC, 0x66, 0x33, 0x66, 0xCC, 0x00, 0x00,
0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88,
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
0xDB, 0xF6, 0xDB, 0x6F, 0xDB, 0x7E, 0xD7, 0xED,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18,
0x18, 0x18, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18,
0x36, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36,
0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36,
0x00, 0x00, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18,
0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
0x00, 0x00, 0xFE, 0x06, 0xF6, 0x36, 0x36, 0x36,
0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00,
0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00,
0x18, 0x18, 0xF8, 0x18, 0xF8, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00,
0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00,
0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18,
0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18,
0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36,
0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36,
0x36, 0x36, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36,
0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36,
0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00,
0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36,
0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00,
0x36, 0x36, 0x36, 0x36, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0x3F, 0x00, 0x00, 0x00,
0x18, 0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18,
0x00, 0x00, 0x00, 0x00, 0x3F, 0x36, 0x36, 0x36,
0x36, 0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36,
0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0xF8, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x76, 0xDC, 0xC8, 0xDC, 0x76, 0x00,
0x00, 0x78, 0xCC, 0xF8, 0xCC, 0xF8, 0xC0, 0xC0,
0x00, 0xFC, 0xCC, 0xC0, 0xC0, 0xC0, 0xC0, 0x00,
0x00, 0x00, 0xFE, 0x6C, 0x6C, 0x6C, 0x6C, 0x00,
0xFC, 0xCC, 0x60, 0x30, 0x60, 0xCC, 0xFC, 0x00,
0x00, 0x00, 0x7E, 0xD8, 0xD8, 0xD8, 0x70, 0x00,
0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0xC0,
0x00, 0x76, 0xDC, 0x18, 0x18, 0x18, 0x18, 0x00,
0xFC, 0x30, 0x78, 0xCC, 0xCC, 0x78, 0x30, 0xFC,
0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x6C, 0x38, 0x00,
0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x6C, 0xEE, 0x00,
0x1C, 0x30, 0x18, 0x7C, 0xCC, 0xCC, 0x78, 0x00,
0x00, 0x00, 0x7E, 0xDB, 0xDB, 0x7E, 0x00, 0x00,
0x06, 0x0C, 0x7E, 0xDB, 0xDB, 0x7E, 0x60, 0xC0,
0x38, 0x60, 0xC0, 0xF8, 0xC0, 0x60, 0x38, 0x00,
0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x00,
0x00, 0x7E, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00,
0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x7E, 0x00,
0x60, 0x30, 0x18, 0x30, 0x60, 0x00, 0xFC, 0x00,
0x18, 0x30, 0x60, 0x30, 0x18, 0x00, 0xFC, 0x00,
0x0E, 0x1B, 0x1B, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0x70,
0x18, 0x18, 0x00, 0x7E, 0x00, 0x18, 0x18, 0x00,
0x00, 0x76, 0xDC, 0x00, 0x76, 0xDC, 0x00, 0x00,
0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
0x0F, 0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x3C, 0x1C,
0x58, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00,
0x70, 0x98, 0x30, 0x60, 0xF8, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
 
/contrib/media/updf/include/menuet/gui.h
0,0 → 1,111
#ifndef __GUI_H
#define __GUI_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include<menuet/os.h>
 
#define GUI_DX 10
#define GUI_DY 20
 
typedef struct __button_t
{
int id;
char * txt;
int x,y;
int xsz,ysz;
void (* press_proc)(void);
} button_t;
 
typedef struct
{
int x,y;
int max_len;
__u32 back_color,text_color;
int current;
__u8 * buffer;
} input_line_t;
 
static inline void draw_button(button_t * b)
{
int l;
l=strlen(b->txt)<<3;
l=(b->xsz-l)>>1;
__menuet__make_button(b->x-2+10,b->y-2+20,b->xsz,b->ysz,b->id,0x808080);
__menuet__write_text(b->x+l+10,b->y+((b->ysz-8)>>1)+20,0,b->txt,strlen(b->txt));
}
 
static inline void repaint_button_group(button_t * bt,int nr)
{
int i;
for(i=0;i<nr;i++) draw_button(&bt[i]);
}
 
static inline void check_button_click(button_t * bt,int nr,int clicked)
{
int i;
for(i=0;i<nr;i++)
if(bt[i].id==clicked)
{
if(bt[i].press_proc) bt[i].press_proc();
return;
}
}
 
static inline void draw_input_line(input_line_t * k)
{
__menuet__bar(k->x+GUI_DX,k->y+GUI_DY,(k->max_len<<3)+10,8+5,k->back_color);
if(k->current)
__menuet__write_text(k->x+GUI_DX,k->y+GUI_DY,k->text_color,k->buffer,k->current);
}
 
static inline void handle_input_line(input_line_t * l)
{
for(;;)
{
int k=__menuet__wait_for_event();
switch(k)
{
case 1:
WINDOW_PAINT_PROC();
continue;
case 2:
k=__menuet__getkey();
break;
case 3:
if(__menuet__get_button_id()==1) __menuet__sys_exit();
continue;
}
if(!k) continue;
if(k==13) return;
if(k=='\b')
{
if(l->current) l->current--;
l->buffer[l->current]='\0';
} else {
if(l->current>=l->max_len) continue;
l->buffer[l->current]=(__u8)k;
l->current++;
l->buffer[l->current]='\0';
}
draw_input_line(l);
}
}
 
static inline void outtextxy(int x,int y,__u32 tcol,__u32 bcol,char * txt)
{
int l,m;
m=l=strlen(txt);
l<<=3;
l+=4;
__menuet__bar(GUI_DX+x,GUI_DY+y,l,10,bcol);
__menuet__write_text(GUI_DX+x,GUI_DY+y,tcol,txt,m);
}
 
#ifdef __cplusplus
}
#endif
 
#endif
/contrib/media/updf/include/menuet/ipc.h
0,0 → 1,21
#ifndef __MENUETOS_IPC_H
#define __MENUETOS_IPC_H
 
typedef struct {
volatile unsigned long lock;
unsigned long free_ptr;
char __mem[0];
} ipc_hdr_t;
 
typedef struct {
unsigned long sender_pid;
unsigned long msg_length;
char message[0];
} ipc_msg_t;
 
ipc_hdr_t * create_ipc(unsigned long size);
void register_ipc_mem(ipc_hdr_t * hdr);
void ipc_send_message(int dst_pid,ipc_msg_t * msg);
extern inline int ipc_messages_avail(ipc_hdr_t * hdr);
 
#endif
/contrib/media/updf/include/menuet/mash.h
0,0 → 1,19
#ifndef __MENUET_MASH_H
#define __MENUET_MASH_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include<menuet/os.h>
 
extern void __mash__puts(char * str);
extern void __mash__gets(char * str,int len);
 
extern char mash_args[];
 
#ifdef __cplusplus
}
#endif
 
#endif
/contrib/media/updf/include/menuet/net.h
0,0 → 1,73
#ifndef __MENUET_NET_H
#define __MENUET_NET_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include<menuet/os.h>
 
#define __NET_stack_rd_cfg_word 0
#define __NET_stack_get_ip 1
#define __NET_stack_wr_cfg_word 2
#define __NET_stack_put_ip 3
 
#define __NET_sock_open_UDP 0
#define __NET_sock_open_TCP 5
#define __NET_sock_close_UDP 1
#define __NET_sock_close_TCP 8
#define __NET_sock_poll 2
#define __NET_sock_read 3
#define __NET_sock_write_UDP 4
#define __NET_sock_get_status 6
#define __NET_sock_write_TCP 7
#define __NET_sock_check_port 9
 
#define __NET_socket 53
#define __NET_stack 52
 
int __menuet__get_stack_config_word(void);
__u32 __menuet__get_my_IP(void);
void __menuet__set_stack_config_word(int cfg);
void __menuet__set_my_IP(__u32 my_IP);
 
__u32 __menuet__open_UDP_socket(__u32 local_port,__u32 remote_port,__u32 remote_ip);
__u32 __menuet__open_TCP_socket(__u32 local_port,__u32 remote_port,__u32 remote_ip,int mode);
int __menuet__close_UDP_socket(int socket);
int __menuet__close_TCP_socket(int socket);
int __menuet__poll_socket(int sock);
int __menuet__read_socket(int sock,__u8 * return_data);
int __menuet__get_TCP_socket_status(int sock);
int __menuet__write_UDP_socket(int sock,int count,void * buffer);
int __menuet__write_TCP_socket(int sock,int count,void * buffer);
int __menuet__check_net_port_availability(int port);
 
/* Values returned by __menuet__check_net_port_availability */
#define PORT_AVAILABLE (1)
#define PORT_UNAVAILABLE (0)
 
#define NET_OP_OK ((int)(0))
#define NET_OP_ERR ((int)(-1))
 
/* These are socket modes */
#define SOCKET_PASSIVE 0
#define SOCKET_ACTIVE 1
 
/* These belong to socket status */
#define TCB_LISTEN 1
#define TCB_SYN_SENT 2
#define TCB_SYN_RECEIVED 3
#define TCB_ESTABLISHED 4
#define TCB_FIN_WAIT_1 5
#define TCB_FIN_WAIT_2 6
#define TCB_CLOSE_WAIT 7
#define TCB_CLOSING 8
#define TCB_LAST_ACK 9
#define TCB_TIME_AWAIT 10
#define TCB_CLOSED 11
 
#ifdef __cplusplus
}
#endif
 
#endif
/contrib/media/updf/include/menuet/network.hpp
0,0 → 1,33
#ifndef __MENUET_NETWORK_HPP__
#define __MENUET_NETWORK_HPP__
 
#include<menuet/net.h>
 
class IP_Address
{
public:
unsigned long this_ip_inet_fmt;
IP_Address(unsigned long);
IP_Address(__u8,__u8,__u8,__u8);
~IP_Address();
unsigned long operator = (IP_Address&);
IP_Address& operator = (unsigned long);
};
 
class UDP_Socket
{
public:
UDP_Socket(__u32 local_port,__u32 remote_port,__u32 remote_ip,bool close_on_delete);
virtual ~UDP_Socket();
virtual int Open();
virtual int Close();
virtual int Read(__u8 * data);
virtual int Write(int count,void * data);
virtual int Poll();
protected:
unsigned long p[3];
bool f;
int sock;
};
 
#endif
/contrib/media/updf/include/menuet/os.h
0,0 → 1,224
#ifndef __GLIBC__MENUET_OS_H
#define __GLIBC__MENUET_OS_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
typedef unsigned char __u8;
typedef unsigned short __u16;
typedef unsigned long __u32;
 
#pragma pack(push,1)
 
void __menuet__define_window(__u16 x1,__u16 y1,__u16 xsize,__u16 ysize,
__u32 body_color,__u32 grab_color,__u32 frame_color);
void __menuet__window_redraw(int status);
void __menuet__putpixel(__u32 x,__u32 y,__u32 color);
int __menuet__getkey(void);
__u32 __menuet__getsystemclock(void);
void __menuet__write_text(__u16 x,__u16 y,__u32 color,char * text,int len);
void __menuet__delay100(int m);
__u32 __menuet__open(char * name,char * data);
void __menuet__save(char * name,char * data,__u32 count);
void __menuet__putimage(__u16 x1,__u16 y1,__u16 xsize,__u16 ysize,char * image);
void __menuet__make_button(__u16 x1,__u16 y1,__u16 xsize,__u16 ysize, int id,__u32 color);
int __menuet__get_button_id(void);
int __menuet__wait_for_event(void);
int __menuet__check_for_event(void);
void __menuet__bar(__u16 x1,__u16 y1,__u16 xsize,__u16 ysize,__u32 color);
void __menuet__sys_exit(void);
void * __menuet__exec_thread(void (* func_ptr)(void),__u32 stack_size,int * retp);
void __menuet__idle(void);
 
void __menuet__exec_ramdisk(char * filename,char * args,...);
void __menuet__exec_hd(char * filename,char * args,...);
 
struct process_table_entry
{
__u32 cpu_usage;
__u16 pos_in_windowing_stack;
__u16 win_stack_val_at_ecx;
__u16 reserved1;
char name[12];
__u32 memstart;
__u32 memused;
__u32 pid;
__u32 winx_start,winy_start;
__u32 winx_size,winy_size;
__u16 thread_state;
__u16 reserved2;
__u32 client_left,client_top,client_width,client_height;
__u8 window_state;
__u8 reserved3[1024-71];
};
 
#define PID_WHOAMI (-1)
 
int __menuet__get_process_table(struct process_table_entry * proctab,int pid);
void __menuet__get_screen_max(__u16 * x,__u16 * y);
 
#define BTYPE_TILE 1
#define BTYPE_STRETCH 2
 
void __menuet__set_background_size(__u32 xsz,__u32 ysz);
void __menuet__write_background_mem(__u32 pos,__u32 color);
void __menuet__draw_background(void);
void __menuet__set_background_draw_type(int type);
void __menuet__background_blockmove(char * src_ptr,__u32 bgr_dst,__u32 count);
 
void __menuet__reset_mpu401(void);
void __menuet__write_mpu401(__u8 d);
 
__u32 __menuet__get_date(void);
 
void __menuet__line(__u16 x1,__u16 y1,__u16 x2,__u16 y2,__u32 color);
 
void __menuet__set_bitfield_for_wanted_events(__u16 ev);
 
#define EVENT_REDRAW 0x00000001
#define EVENT_KEY 0x00000002
#define EVENT_BUTTON 0x00000004
#define EVENT_END_REQUEST 0x00000008
#define EVENT_DESKTOP_BACK_DRAW 0x00000010
#define EVENT_MOUSE_CHANGE 0x00000020
#define EVENT_IPC 0x00000040
#define EVENT_GET_IRQS_MASK 0xFFFF0000
#define EVENT_GET_IRQ(e) (((e)>>16)&0xFFFF)
 
__u32 __menuet__get_irq_owner(__u32 irq);
int __menuet__get_data_read_by_irq(__u32 irq,__u32 * num_bytes_in_buf,__u8 * data);
int __menuet__send_data_to_device(__u16 port,__u8 val);
void __menuet__program_irq(void * intr_table,__u32 irq_num);
int __menuet__reserve_irq(int irqno);
int __menuet__free_irq(int irqno);
int __menuet__reserve_port_area(__u32 start,__u32 end);
int __menuet__free_port_area(__u32 start,__u32 end);
 
 
#define NAME_LEN 512
 
#define STC_READ 0
#define STC_WRITE 1
#define STC_APPEND 2
 
struct systree_info
{
__u32 command;
__u32 file_offset_low;
__u32 file_offset_high;
__u32 size;
__u32 data_pointer;
char _zero;
const char* nameptr;
};
 
struct systree_info2
{
__u32 command;
__u32 file_offset_low;
__u32 file_offset_high;
__u32 size;
__u32 data_pointer;
char name[NAME_LEN];
};
 
struct bdfe_time
{
__u8 seconds;
__u8 minutes;
__u8 hours;
__u8 reserved;
};
struct bdfe_date
{
__u8 day;
__u8 month;
__u16 year;
};
struct bdfe_item
{
__u32 attr;
__u8 nametype;
__u8 reserved[3];
struct bdfe_time ctime;
struct bdfe_date cdate;
struct bdfe_time atime;
struct bdfe_date adate;
struct bdfe_time mtime;
struct bdfe_date mdate;
__u32 filesize_low;
__u32 filesize_high;
};
 
int __kolibri__system_tree_access(struct systree_info * info);
int __kolibri__system_tree_access2(struct systree_info2 * info);
 
int __fslayer_open(char * name,int flags);
int __fslayer_close(int fd);
int __fslayer_lseek(int fd,int pos,int seek_type);
int __fslayer_tell(int fd);
int __fslayer_read(int fd,void * buffer,__u32 count);
int __fslayer_write(int fd,void * buffer,__u32 count);
 
typedef struct
{
__u8 lock;
__u8 resvd[3];
__u32 ptr_to_fmsg_pos;
/* Below is for message */
__u32 sender_pid;
__u32 msg_length;
} msgrcva_t /*__attribute__((packed))*/;
 
void send_message(int pid,void * msg_ptr,int message_size);
void define_receive_area(msgrcva_t * rcva_ptr,int size);
 
void __menuet__sound_load_block(char * blockptr);
void __menuet__sound_play_block(void);
 
void __menuet__dga_get_caps(int * xres,int * yres,int * bpp,int * bpscan);
 
void get_pci_version(__u8 * major,__u8 * minor);
void pci_get_last_bus(__u8 * last_bus);
void get_pci_access_mechanism(__u8 * mechanism);
 
void pci_write_config_byte(__u8 bus,__u8 dev,__u8 fn,__u8 reg,__u8 val);
void pci_write_config_word(__u8 bus,__u8 dev,__u8 fn,__u8 reg,__u16 val);
void pci_write_config_dword(__u8 bus,__u8 dev,__u8 fn,__u8 reg,__u32 val);
__u8 pci_read_config_byte(__u8 bus,__u8 dev,__u8 fn,__u8 reg);
__u16 pci_read_config_word(__u8 bus,__u8 dev,__u8 fn,__u8 reg);
__u32 pci_read_config_dword(__u8 bus,__u8 dev,__u8 fn,__u8 reg);
 
typedef struct{
char* name;
void* pointer;
} IMP_ENTRY;
typedef const IMP_ENTRY* IMP_TABLE;
IMP_TABLE __kolibri__cofflib_load(const char*);
__u32 __kolibri__cofflib_getproc(IMP_TABLE, const char*);
 
 
static __inline__ void __menuet__debug_out_byte(const char ch){
__asm__ __volatile__ ("int $0x40"::"a"(63L),"b"(1L),"c"((__u8)ch));
}
 
static __inline__ __u32 __menuet__wtf(void){
__u32 __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(26),"b"(9));
return __ret;
}
 
void __menuet__debug_out(const char* str);
 
#define TIME_GETH(x) ((x)&0x000000FF)
#define TIME_GETM(x) ((((x)&0x00FF00)>>8)&0xFF)
#define TIME_GETS(x) ((((x)&0xFF0000)>>16)&0xFF)
 
#pragma pack(pop)
 
#ifdef __cplusplus
}
#endif
 
#endif
/contrib/media/updf/include/menuet/sem.h
0,0 → 1,143
#ifndef __MENUETOS_SEM_H
#define __MENUETOS_SEM_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
typedef volatile struct {
unsigned long s_magic;
volatile unsigned long s_value;
volatile unsigned long s_lock;
} semaphore_t;
 
#define SEM_MAGIC 0x1BAD2E20
 
#define SEM_INIT { SEM_MAGIC , 0 , 0 }
 
static inline semaphore_t * get_sem_init(void)
{
static semaphore_t __ret=SEM_INIT;
return &__ret;
}
 
static inline void fill_empty_sem(semaphore_t * sem)
{
if(sem)
{
//memcpy((void *)sem,(const void *)get_sem_init(),sizeof(semaphore_t));
}
}
#define DECLARE_SEMAPHORE(name) semaphore_t name = SEM_INIT ;
#define DECLARE_STATIC_SEM(name) static semaphore_t name = SEM_INIT ;
#define DECLARE_SEMAPHORE_S(name) semaphore_t name
 
#define check_sem_magic(s) ((s)->s_magic==SEM_MAGIC)
 
#define SEM_VAL(s) (s)->s_value
#define SEM_LOCK(s) (s)->s_lock
 
#define sem_lock_acquire(sem) \
{ \
LOCKED: \
if(check_sem_magic(sem)) \
{ \
if(SEM_LOCK(sem)) \
{ \
__menuet__delay100(1); \
goto LOCKED; \
} \
} \
}
#define sem_lock(sem) \
{ \
if(check_sem_magic(sem)) \
{ \
sem_lock_acquire(sem); \
SEM_LOCK(sem)++; \
} \
}
#define sem_unlock(sem) \
{ \
if(check_sem_magic(sem)) \
{ \
if(SEM_LOCK(sem)) SEM_LOCK(sem)--; \
} \
}
#define sem_read(sem) \
({ \
volatile unsigned long __ret; \
if(check_sem_magic(sem)) \
{ \
sem_lock(sem); \
__ret=SEM_VAL(sem); \
sem_unlock(sem); \
} else { \
__ret=0; \
} \
__ret; \
})
 
#define sem_write(sem,val) \
{ \
if(check_sem_magic(sem)) \
{ \
sem_lock(sem); \
SEM_VAL(sem)=(val); \
sem_unlock(sem); \
} \
}
#define sem_up(sem) \
{ \
if(check_sem_magic(sem)) \
{ \
sem_lock(sem); \
SEM_VAL(sem)++; \
sem_unlock(sem); \
} \
}
#define sem_down(sem) \
{ \
if(check_sem_magic(sem)) \
{ \
sem_lock(sem); \
if(SEM_VAL(sem)) SEM_VAL(sem)--; \
sem_unlock(sem); \
} \
}
#define sem_isup(sem) \
{ \
int __ret; \
if(check_sem_magic(sem)) \
{ \
sem_lock(sem); \
__ret=SEM_VAL(sem) ? 1 : 0; \
sem_unlock(sem); \
} \
__ret; \
}
#define sem_isdown(sem) \
{ \
int __ret; \
if(check_sem_magic(sem)) \
{ \
sem_lock(sem); \
__ret=SEM_VAL(sem) ? 0 : 1; \
sem_unlock(sem); \
} \
__ret; \
}
 
#ifdef __cplusplus
}
#endif
#endif
/contrib/media/updf/include/menuet/textcon.h
0,0 → 1,91
#ifndef __TEXTCON_H
#define __TEXTCON_H
 
#include<menuet/sem.h>
 
#define COLOR_CONV_B_2_D { \
0x000000, \
0x000080, \
0x800000, \
0x008080, \
0x800000, \
0x808000, \
0x404040, \
0x808080, \
0x606060, \
0x0000FF, \
0x00FF00, \
0x00FFFF, \
0xFF0000, \
0xFFFF00, \
0x00FFFF, \
0xFFFFFF, \
}
 
#define CHAR_SIZE_X 5
#define CHAR_SIZE_Y 8
 
#define NR_CHARS_X 80
#define NR_CHARS_Y 25
 
#define CON_AT_X 10
#define CON_AT_Y 25
 
typedef struct
{
unsigned char c_char;
unsigned char c_back;
unsigned char c_color;
} char_info_t;
 
typedef struct
{
int esc[4];
} esc_info_t;
 
typedef struct
{
unsigned char text_color,back_color;
char_info_t char_table[NR_CHARS_X][NR_CHARS_Y];
int id;
int cur_x,cur_y;
int cur_visible;
unsigned char cur_color;
esc_info_t esc_seq;
DECLARE_SEMAPHORE_S(io_lock);
} console_t;
 
#define MAX_CONSOLES 4
 
extern console_t * consoles[MAX_CONSOLES];
extern console_t * visible_console;
 
void init_consoles(void);
void lcon_clrscr(console_t * con);
void lcon_flush_console(console_t * con);
void lcon_flushxy(console_t * con,int x,int y);
void lcon_scroll(console_t * con,int update);
void lcon_putch(console_t * con,char c);
void lcon_gotoxy(console_t * con,int x,int y);
void lcon_set_text_color(console_t * con,int color);
void lcon_set_back_color(console_t * con,int color);
void lcon_switch_to_console(int i);
unsigned char lcon_getcxy(console_t * con,int x,int y);
void lcon_putcxy(console_t * con,int x,int y,unsigned char c);
 
#define _lcon_clrscr() lcon_clrscr(visible_console)
#define _lcon_flush_console() lcon_flush_console(visible_console)
#define _lcon_flushxy(x,y) lcon_flushxy(visible_console,(x),(y))
#define _lcon_scroll() lcon_scroll(visible_console,1)
#define _lcon_putch(c) lcon_putch(visible_console,(char)(c))
#define _lcon_gotoxy(x,y) lcon_gotoxy(visible_console,(x),(y))
#define _lcon_set_text_color(c) lcon_set_text_color(visible_console,(c)&(1+2+4+8))
#define _lcon_set_back_color(c) lcon_set_back_color(visible_console,(c)&(1+2+4+8))
#define _lcon_switch(i) lcon_switch_to_console((i))
#define _lcon_getcxy(x,y) lcon_getcxy(visible_console,(x),(y))
#define _lcon_putcxy(x,y,c) lcon_putcxy(visible_console,(x),(y),(c))
 
console_t * create_private_console(void);
void free_private_console(console_t * con);
 
#endif
/contrib/media/updf/include/menuet/thread.h
0,0 → 1,13
#ifndef __MENUET_THREAD_H
#define __MENUET_THREAD_H
 
#define THR_ATEXIT 0x00000001
#define THR_KILLER 0x00000002
 
void init_threads(void);
int get_thread_pid(int tid);
int get_thread_tid(int pid);
int create_thread(void (* fn)(void),int stacksize,int flags,void ** rstackp);
void kill_thread(int tid);
 
#endif
/contrib/media/updf/include/mf_common.h
0,0 → 1,93
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************
* Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1995,1997 *
****************************************************************************/
 
/* Common internal header for menu and form library */
 
#if HAVE_CONFIG_H
# include <ncurses_cfg.h>
#endif
 
#include <stdlib.h>
#include <sys/types.h>
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
 
#if DECL_ERRNO
extern int errno;
#endif
 
/* in case of debug version we ignore the suppression of assertions */
#ifdef TRACE
# ifdef NDEBUG
# undef NDEBUG
# endif
#endif
 
#include <nc_alloc.h>
 
#ifdef USE_RCS_IDS
#define MODULE_ID(id) static const char Ident[] = id;
#else
#define MODULE_ID(id) /*nothing*/
#endif
 
 
/* Maximum regular 8-bit character code */
#define MAX_REGULAR_CHARACTER (0xff)
 
#define SET_ERROR(code) (errno=(code))
#define GET_ERROR() (errno)
#define RETURN(code) return( SET_ERROR(code) )
 
/* The few common values in the status fields for menus and forms */
#define _POSTED (0x01) /* menu or form is posted */
#define _IN_DRIVER (0x02) /* menu or form is processing hook routine */
 
/* Call object hook */
#define Call_Hook( object, handler ) \
if ( (object) && ((object)->handler) )\
{\
(object)->status |= _IN_DRIVER;\
(object)->handler(object);\
(object)->status &= ~_IN_DRIVER;\
}
 
#define INLINE
 
#ifndef TRACE
# if CC_HAS_INLINE_FUNCS
# undef INLINE
# define INLINE inline
# endif
#endif
/contrib/media/updf/include/mgtk/app.h
0,0 → 1,22
#ifndef __MGTK_APP_H
#define __MGTK_APP_H
 
#include<mgtk/widget.h>
 
class GApplication: public GGroup
{
public:
GApplication(GRect *);
virtual ~GApplication();
virtual void SetCaption(char *);
virtual void Init();
virtual void Run();
virtual void Done();
virtual void DrawWidget();
private:
char * Caption;
GPoint priv_origin,priv_size;
unsigned long body,grab,frame;
};
 
#endif
/contrib/media/updf/include/mgtk/bitmap.h
0,0 → 1,38
#ifndef __MGTK_BITMAP_H
#define __MGTK_BITMAP_H
 
#include<mgtk/widget.h>
#include<stdio.h>
extern "C" {
#include<libmgfx.h>
}
 
/* Image is 24-bit RGB bitmap */
class GImagePool: public GWidget
{
public:
GImagePool(GRect *);
virtual ~GImagePool();
virtual void DrawWidget();
virtual void Write(unsigned long,unsigned long,char *);
virtual void Load(FILE *);
virtual void Save(FILE *);
virtual void PutPixel(int,int,unsigned long);
GImagePool * Duplicate(GImagePool * Img);
private:
char * image_data;
unsigned long scan_size,image_size;
};
 
class GPicture: public GWidget
{
public:
GPicture(GRect * r,char * filename);
virtual ~GPicture();
virtual void DrawWidget();
virtual bool Load(char *);
private:
mgfx_image_t * img;
};
#endif
/contrib/media/updf/include/mgtk/button.h
0,0 → 1,99
#ifndef __MGTK_BUTTON_H
#define __MGTK_BUTTON_H
 
#include<mgtk/widget.h>
#include<mgtk/pen.h>
 
#define bs_Normal 0
#define bs_DontDraw 1
 
class GTextButton;
 
class GButton: public GWidget
{
friend class GTextButton;
public:
GButton(GRect *,int flags,unsigned long color,int cmd);
virtual ~GButton(void);
virtual void HandleEvent(GEvent *);
virtual void DrawWidget();
virtual void ClickProc();
virtual void SetCommand(int);
private:
int bId;
int bFlags;
int bCmd;
unsigned long bColor;
};
 
class GRadioButton;
 
class GCheckBox: public GWidget
{
friend class GRadioButton;
public:
GCheckBox(GRect *,bool);
virtual ~GCheckBox();
virtual void DrawWidget();
virtual void HandleEvent(GEvent *);
bool Checked();
void Check(bool);
private:
bool state;
};
 
class GRadioButton: public GCheckBox
{
public:
GRadioButton(GRect *,bool);
virtual ~GRadioButton();
virtual void DrawWidget();
};
 
class GRadioGroup: public GGroup
{
public:
GRadioGroup(GRect *,int);
virtual ~GRadioGroup();
virtual void HandleEvent(GEvent *);
virtual int ActualButton();
private:
int actual;
GRadioButton * _current_click;
};
 
class GTextButton: public GButton
{
public:
GTextButton(GRect *,char *,int);
virtual ~GTextButton();
virtual void DrawWidget();
private:
char * txt;
};
 
class GButtonAllocator
{
public:
GButtonAllocator(int max);
virtual ~GButtonAllocator();
int New();
void Del(int);
private:
unsigned char * gbutton_bitmap;
int nr_buttons;
};
 
extern GButtonAllocator * OSButtonAlloc;
 
class GImageButton: public GButton
{
public:
GImageButton(GRect *,struct GImageData *,int);
virtual ~GImageButton();
virtual void DrawWidget();
private:
struct GImageData * data;
};
 
#endif
/contrib/media/updf/include/mgtk/editor.h
0,0 → 1,58
#ifndef __MGTK_EDITOR_H
#define __MGTK_EDITOR_H
 
#include<mgtk/widget.h>
#include<mgtk/slider.h>
 
class GClipboard
{
public:
typedef enum {
CL_EMPTY=0,
CL_BINARY=1,
CL_IMAGE=2,
CL_TEXT=3,
} clip_data_type_t;
GClipboard();
virtual ~GClipboard();
virtual void * GetData();
virtual clip_data_type_t GetDataType();
virtual unsigned long GetDataSize();
virtual void SetClipData(clip_data_type_t type,void * ptr,unsigned long size);
virtual void Empty();
private:
void * buf_location;
unsigned long size;
clip_data_type_t data_type;
};
 
#define INVALID_EDITOR_OFFSET 0xffffffff
 
class GEditorCore
{
public:
GEditorCore(unsigned long SizeLim);
virtual ~GEditorCore();
virtual int ExpandBuffer(int delta);
virtual void Delete(unsigned long offset,unsigned long size);
virtual void Cut(unsigned long offset,unsigned long size,
GClipboard * Clip);
virtual void Copy(unsigned long offset,unsigned long size,
GClipboard * Clip);
virtual void Paste(unsigned long offset,GClipboard * Clip);
virtual unsigned long Search(unsigned long from_off,char * keyword,int name_len);
virtual int Replace(unsigned long from_off,char * keyword,char * replace_to,
int kword_len,int rt_len,bool ReplaceAll);
virtual unsigned long GetTextSize();
virtual char * GetTextBuffer();
virtual void Empty();
virtual bool IsEmpty();
virtual void SetCaseSensitive(bool);
virtual void InsertCharAt(unsigned long off,char c);
private:
char * text_buffer;
unsigned long text_size,buffer_size,size_limit;
bool case_sensitive;
};
 
#endif
/contrib/media/updf/include/mgtk/event.h
0,0 → 1,49
#ifndef __MGTK_EVENT_H
#define __MGTK_EVENT_H
 
typedef struct {
int evType;
union {
struct {
int evCommand;
int evMessage;
void * info;
unsigned long info_long;
unsigned char info_char;
} command;
struct {
int xMouse;
int yMouse;
int bMouse;
} mouse;
struct {
int keyId;
} key;
struct {
int butId;
} button;
} type;
} GEvent;
 
#define GEVENT_NOTHING 0
#define GEVENT_COMMAND 1
#define GEVENT_MOUSE 2
#define GEVENT_CLICK 3
#define GEVENT_KEYBOARD 4
#define GEVENT_IDLE 5
#define GEVENT_BUTTON 6
 
#define cm_Ignore 0
#define cm_Disable 1
#define cm_Enable 2
#define cm_Click 3
#define cm_Paint 4
#define cm_Quit 5
#define cm_Clicked 6
#define cm_Scroll 7
#define cm_Radio 8
#define cm_Scrollup 9
#define cm_Scrolldown 10
#define cm_KillMenu 11
 
#endif
/contrib/media/updf/include/mgtk/mgtk.h
0,0 → 1,15
#ifndef __MGTK_H
#define __MGTK_H
 
#include"app.h"
#include"bitmap.h"
#include"button.h"
#include"event.h"
#include"pen.h"
#include"slider.h"
#include"text.h"
#include"types.h"
#include"widget.h"
#include"terminal.h"
 
#endif
/contrib/media/updf/include/mgtk/pen.h
0,0 → 1,32
#ifndef __MGTK_PEN_H
#define __MGTK_PEN_H
 
#include<mgtk/widget.h>
 
struct GImageData {
int w,h;
unsigned char * data;
};
 
class GPen
{
public:
GPen(GWidget *);
virtual ~GPen();
void PutPixel(int,int,unsigned long);
void Line(int,int,int,int,unsigned long);
void FillRect(int,int,int,int,unsigned long);
void DrawLines(GPoint *,int nr_point,unsigned long color);
void WriteText(int,int,char *,int,unsigned long);
void Rect(int,int,int,int,unsigned long);
void Rect3d(int x,int y,int w,int h,unsigned long color);
void FillRect2(int,int,int,int,unsigned long);
void Line2(int,int,int,int,unsigned long);
void PutImage(int,int,int,int,char *);
void PutImage(int,int,struct GImageData *);
private:
int _dx,_dy;
int _lx,_ly;
};
 
#endif
/contrib/media/updf/include/mgtk/slider.h
0,0 → 1,55
#ifndef __MGTK_SLIDER_H
#define __MGTK_SLIDER_H
 
#include<mgtk/widget.h>
#include<mgtk/button.h>
 
#define slider_Horizontal 0
#define slider_Vertical 1
#define slider_Solid 2
 
class GSlider: public GWidget
{
public:
GSlider(GRect * r,int mode,unsigned long min,unsigned long max,unsigned long cur);
virtual ~GSlider();
virtual void DrawWidget();
virtual void HandleEvent(GEvent *);
virtual void VSetMin(unsigned long);
virtual void VSetMax(unsigned long);
virtual void VSetCur(unsigned long);
virtual void SetMin(unsigned long);
virtual void SetMax(unsigned long);
virtual void SetCur(unsigned long);
virtual unsigned long GetCur();
virtual unsigned long GetMin();
virtual unsigned long GetMax();
private:
unsigned long SMode,SMin,SMax,SCur;
};
 
class GPercentSlider: public GSlider
{
public:
GPercentSlider(GRect * r,int percent);
virtual ~GPercentSlider();
virtual void DrawWidget();
virtual void HandleEvent(GEvent *);
private:
char _txt[10]; /* xxx % */
};
 
class GScroll: public GGroup
{
public:
GScroll(GRect * r,int mode,unsigned long min,unsigned long max,unsigned long cur,
unsigned long _delta);
virtual ~GScroll();
virtual void HandleEvent(GEvent *);
private:
GButton * b1,* b2;
GSlider * slider;
unsigned long delta;
};
 
#endif
/contrib/media/updf/include/mgtk/string.h
0,0 → 1,20
#ifndef __MGTK_STRING_H
#define __MGTK_STRING_H
 
class GString
{
public:
GString(char *);
GString(const char *);
GString(GString&);
~GString();
int Length();
char * operator = (GString&);
GString& operator = (char *);
void Truncate(int AtPos);
private:
char * __str;
int __len;
};
 
#endif
/contrib/media/updf/include/mgtk/terminal.h
0,0 → 1,30
#ifndef __MGTK_TERMINAL_H
#define __MGTK_TERMINAL_H
 
#include<mgtk/widget.h>
#include<mgtk/pen.h>
 
class GTerminal: public GWidget
{
public:
GTerminal(GRect * r,int cursor_vis,unsigned long TextColor=0x00FF00,
unsigned long BackgrColor=0);
virtual ~GTerminal();
virtual void DrawWidget();
virtual void Putch(char);
virtual void ClrScr();
virtual void Idle();
virtual void Scroll();
inline void Puts(char * s)
{
for(;*s;s++) Putch(*s);
}
private:
int cx,cy;
char * screen_buf;
int xchars,ychars;
unsigned long _tcolor,_bcolor;
void LocalUpdate();
};
 
#endif
/contrib/media/updf/include/mgtk/text.h
0,0 → 1,49
#ifndef __MGTK_TEXT_H
#define __MGTK_TEXT_H
 
#include<mgtk/widget.h>
 
#define BIG_FONT_XSZ 7
#define BIG_FONT_YSZ 9
#define SMALL_FONT_XSZ 5
#define SMALL_FONT_YSZ 7
 
class GStaticText: public GWidget
{
public:
GStaticText(GRect *,char *,unsigned long);
virtual ~GStaticText();
virtual void DrawWidget();
private:
unsigned long color;
char * text;
int tlen;
};
 
class GInputLine: public GWidget
{
public:
GInputLine(GRect *,char *);
virtual ~GInputLine();
virtual void DrawWidget();
virtual void HandleEvent(GEvent * ev);
virtual void Idle();
char * GetData();
private:
int cur_pos,max_len;
char * text_buffer;
bool vis;
int blink_cnt;
};
 
class GLine: public GWidget
{
public:
GLine(GRect *,int is_vertical);
virtual ~GLine();
virtual void DrawWidget();
private:
int vert;
};
 
#endif
/contrib/media/updf/include/mgtk/types.h
0,0 → 1,22
#ifndef __MGTK_TYPES_H
#define __MGTK_TYPES_H
 
typedef struct {
int x,y;
} GPoint;
 
typedef struct {
int x,y;
int w,h;
inline void Assign(int _x,int _y,int _w,int _h)
{
x=_x;
y=_y;
w=_w;
h=_h;
}
} GRect;
 
#define RGB(r,g,b) (((b)&0xff)|(((g)&0x00ff)<<8)|(((r)&0x0000ff)<<16))
 
#endif
/contrib/media/updf/include/mgtk/widget.h
0,0 → 1,63
#ifndef __MGTK_WIDGET_H
#define __MGTK_WIDGET_H
 
#include<mgtk/event.h>
#include<mgtk/types.h>
 
#define wf_Visible 0x00000001
#define wf_Disabled 0x00000002
#define wf_Focused 0x00000004
#define wf_Selected 0x00000008
 
class GGroup;
 
class GWidget
{
public:
GGroup * Parent;
GPoint Origin;
GPoint Size;
GWidget * WNext;
GWidget * WPrev;
unsigned long Flags;
GWidget();
virtual ~GWidget();
virtual void HandleEvent(GEvent *);
void Draw(void);
virtual void DrawWidget();
virtual void ToGlobal(GPoint *);
virtual void ToLocal(GPoint *);
virtual void Idle();
virtual void SetBounds(GRect *);
int MouseInWidget(int,int);
void ClearEvent(GEvent *);
virtual void Show();
virtual void Hide();
virtual void Select(bool);
virtual bool IsGroup();
inline bool IsDisabled() { return Flags&wf_Disabled; }
};
 
class GGroup: public GWidget
{
public:
GRect Clip;
GWidget * WFirst;
GWidget * WSelect;
GGroup();
virtual ~GGroup();
virtual void HandleEvent(GEvent *);
virtual void DrawWidget();
virtual void Insert(GWidget *);
virtual void Remove(GWidget *);
virtual void ForEach(void (*fn)(GGroup *,GWidget *,void *),void *);
virtual void Show();
virtual void Hide();
virtual void Select(GWidget *,bool);
virtual GWidget * Select();
virtual bool IsGroup();
virtual void BroadcastEvent(GEvent *);
virtual void RepaintWhole();
};
 
#endif
/contrib/media/updf/include/minilzo.h
0,0 → 1,97
/* minilzo.h -- mini subset of the LZO real-time data compression library
 
This file is part of the LZO real-time data compression library.
 
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
 
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
 
The LZO 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 General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
Markus F.X.J. Oberhumer
<markus.oberhumer@jk.uni-linz.ac.at>
http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html
*/
 
/*
* NOTE:
* the full LZO package can be found at
* http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html
*/
 
 
#ifndef __MINILZO_H
#define __MINILZO_H
 
#define MINILZO_VERSION 0x1070
 
#ifdef __LZOCONF_H
# error "you cannot use both LZO and miniLZO"
#endif
 
#undef LZO_HAVE_CONFIG_H
#include "lzoconf.h"
 
#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
# error "version mismatch in header files"
#endif
 
 
#ifdef __cplusplus
extern "C" {
#endif
 
 
/***********************************************************************
//
************************************************************************/
 
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
 
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1X_MEM_DECOMPRESS (0)
 
 
/* compression */
LZO_EXTERN(int)
lzo1x_1_compress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uint *dst_len,
lzo_voidp wrkmem );
 
/* decompression */
LZO_EXTERN(int)
lzo1x_decompress ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uint *dst_len,
lzo_voidp wrkmem /* NOT USED */ );
 
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1x_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
lzo_byte *dst, lzo_uint *dst_len,
lzo_voidp wrkmem /* NOT USED */ );
 
 
#ifdef __cplusplus
} /* extern "C" */
#endif
 
#endif /* already included */
 
/contrib/media/updf/include/mntent.h
0,0 → 1,49
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_mntent_h_
#define __dj_include_mntent_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <stdio.h>
 
#define MNT_MNTTAB "/etc/mnttab"
 
struct mntent
{
char *mnt_fsname;
char *mnt_dir;
char *mnt_type;
char *mnt_opts;
int mnt_freq;
int mnt_passno;
long mnt_time;
};
 
extern FILE * setmntent(char *,char *);
extern struct mntent * getmntent(FILE *);
extern int addmntent(FILE *,struct mntent *);
extern char * hasmntopt(struct mntent *,char *);
extern int endmntent(FILE *);
 
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_mntent_h_ */
/contrib/media/updf/include/mpeg.h
0,0 → 1,119
/* ----------------------------- MNI Header -----------------------------------
@NAME : mpeg.h
@INPUT :
@OUTPUT :
@RETURNS :
@DESCRIPTION: Types and function prototypes needed for applications to
use the Berkely MPEG decoding engine via the MNI front
end.
@METHOD :
@GLOBALS : Types defined:
ImageDesc - structure giving height, width, etc.
DitherEnum - the different dither types supported by
the decoding engine
@CALLS :
@CREATED : Greg Ward, 94/6/16.
@MODIFIED : Greg Ward, 94/9/12 (based on John Cristy's fixes): made
more amenable to use with other libraries that also
happen to define TRUE, FALSE, [Bb]oolean, and added
PROTO macro
---------------------------------------------------------------------------- */
 
#ifndef __MPEG_H
#define __MPEG_H
 
#include <stdio.h>
 
/* An attempt at a portable and integrable boolean type... */
 
#if (!defined(TRUE) || !defined(FALSE))
# define TRUE 1
# define FALSE 0
#endif
 
#if (!defined (BOOLEAN_TYPE_EXISTS))
typedef unsigned int Boolean;
#endif
 
typedef struct
{
short red, green, blue;
} ColormapEntry;
 
typedef struct
{
int Height; /* in pixels */
int Width;
int Depth; /* image depth (bits) */
int PixelSize; /* bits actually stored per pixel */
int Size; /* bytes for whole image */
int BitmapPad; /* "quantum" of a scanline -- each scanline */
/* starts on an even interval of this */
/* many bits */
int PictureRate; /* required number of frames/sec [?] */
int BitRate; /* ??? */
int ColormapSize;
ColormapEntry *Colormap; /* an array of ColormapSize entries */
} ImageDesc;
 
typedef enum
{
HYBRID_DITHER,
HYBRID2_DITHER,
FS4_DITHER,
FS2_DITHER,
FS2FAST_DITHER,
Twox2_DITHER,
GRAY_DITHER,
FULL_COLOR_DITHER,
NO_DITHER,
ORDERED_DITHER,
MONO_DITHER,
MONO_THRESHOLD,
ORDERED2_DITHER,
MBORDERED_DITHER
} DitherEnum;
 
 
typedef enum
{
MPEG_DITHER,
MPEG_QUIET,
MPEG_LUM_RANGE,
MPEG_CR_RANGE,
MPEG_CB_RANGE,
MPEG_CMAP_INDEX
} MPEGOptionEnum;
 
#ifdef __cplusplus
extern "C" {
#endif
 
/*
* Kludge so we can compile under ANSI or K&R. (This only means
* that programs that *use* mpeg_lib can be compiled with K&R;
* the library itself must be compiled with an ANSI compiler.
* Mixing and matching compilers, BTW, is not a good idea...)
*/
#undef PROTO
#if __STDC__ || __cplusplus
#define PROTO(formal_parameters) formal_parameters
#else
#define const
#define PROTO(formal_parameters) ()
#endif
 
/* Function prototypes (all are defined in wrapper.c) */
 
Boolean OpenMPEG PROTO((FILE *MPEGfile, ImageDesc *ImgInfo));
void CloseMPEG PROTO((void));
Boolean RewindMPEG PROTO((FILE *MPEGfile, ImageDesc *Image));
void SetMPEGOption PROTO((MPEGOptionEnum Option, int value));
Boolean GetMPEGFrame PROTO((char *Frame));
 
#ifdef __cplusplus
}
#endif
 
#endif /* __MPEG_H */
/contrib/media/updf/include/mqc.h
0,0 → 1,200
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __MQC_H
#define __MQC_H
/**
@file mqc.h
@brief Implementation of an MQ-Coder (MQC)
 
The functions in MQC.C have for goal to realize the MQ-coder operations. The functions
in MQC.C are used by some function in T1.C.
*/
 
/** @defgroup MQC MQC - Implementation of an MQ-Coder */
/*@{*/
 
/**
This struct defines the state of a context.
*/
typedef struct opj_mqc_state {
/** the probability of the Least Probable Symbol (0.75->0x8000, 1.5->0xffff) */
unsigned int qeval;
/** the Most Probable Symbol (0 or 1) */
int mps;
/** next state if the next encoded symbol is the MPS */
struct opj_mqc_state *nmps;
/** next state if the next encoded symbol is the LPS */
struct opj_mqc_state *nlps;
} opj_mqc_state_t;
 
#define MQC_NUMCTXS 19
 
/**
MQ coder
*/
typedef struct opj_mqc {
unsigned int c;
unsigned int a;
unsigned int ct;
unsigned char *bp;
unsigned char *start;
unsigned char *end;
opj_mqc_state_t *ctxs[MQC_NUMCTXS];
opj_mqc_state_t **curctx;
#ifdef MQC_PERF_OPT
unsigned char *buffer;
#endif
} opj_mqc_t;
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Create a new MQC handle
@return Returns a new MQC handle if successful, returns NULL otherwise
*/
opj_mqc_t* mqc_create(void);
/**
Destroy a previously created MQC handle
@param mqc MQC handle to destroy
*/
void mqc_destroy(opj_mqc_t *mqc);
/**
Return the number of bytes written/read since initialisation
@param mqc MQC handle
@return Returns the number of bytes already encoded
*/
int mqc_numbytes(opj_mqc_t *mqc);
/**
Reset the states of all the context of the coder/decoder
(each context is set to a state where 0 and 1 are more or less equiprobable)
@param mqc MQC handle
*/
void mqc_resetstates(opj_mqc_t *mqc);
/**
Set the state of a particular context
@param mqc MQC handle
@param ctxno Number that identifies the context
@param msb The MSB of the new state of the context
@param prob Number that identifies the probability of the symbols for the new state of the context
*/
void mqc_setstate(opj_mqc_t *mqc, int ctxno, int msb, int prob);
/**
Initialize the encoder
@param mqc MQC handle
@param bp Pointer to the start of the buffer where the bytes will be written
*/
void mqc_init_enc(opj_mqc_t *mqc, unsigned char *bp);
/**
Set the current context used for coding/decoding
@param mqc MQC handle
@param ctxno Number that identifies the context
*/
#define mqc_setcurctx(mqc, ctxno) (mqc)->curctx = &(mqc)->ctxs[(int)(ctxno)]
/**
Encode a symbol using the MQ-coder
@param mqc MQC handle
@param d The symbol to be encoded (0 or 1)
*/
void mqc_encode(opj_mqc_t *mqc, int d);
/**
Flush the encoder, so that all remaining data is written
@param mqc MQC handle
*/
void mqc_flush(opj_mqc_t *mqc);
/**
BYPASS mode switch, initialization operation.
JPEG 2000 p 505.
<h2>Not fully implemented and tested !!</h2>
@param mqc MQC handle
*/
void mqc_bypass_init_enc(opj_mqc_t *mqc);
/**
BYPASS mode switch, coding operation.
JPEG 2000 p 505.
<h2>Not fully implemented and tested !!</h2>
@param mqc MQC handle
@param d The symbol to be encoded (0 or 1)
*/
void mqc_bypass_enc(opj_mqc_t *mqc, int d);
/**
BYPASS mode switch, flush operation
<h2>Not fully implemented and tested !!</h2>
@param mqc MQC handle
@return Returns 1 (always)
*/
int mqc_bypass_flush_enc(opj_mqc_t *mqc);
/**
RESET mode switch
@param mqc MQC handle
*/
void mqc_reset_enc(opj_mqc_t *mqc);
/**
RESTART mode switch (TERMALL)
@param mqc MQC handle
@return Returns 1 (always)
*/
int mqc_restart_enc(opj_mqc_t *mqc);
/**
RESTART mode switch (TERMALL) reinitialisation
@param mqc MQC handle
*/
void mqc_restart_init_enc(opj_mqc_t *mqc);
/**
ERTERM mode switch (PTERM)
@param mqc MQC handle
*/
void mqc_erterm_enc(opj_mqc_t *mqc);
/**
SEGMARK mode switch (SEGSYM)
@param mqc MQC handle
*/
void mqc_segmark_enc(opj_mqc_t *mqc);
/**
Initialize the decoder
@param mqc MQC handle
@param bp Pointer to the start of the buffer from which the bytes will be read
@param len Length of the input buffer
*/
void mqc_init_dec(opj_mqc_t *mqc, unsigned char *bp, int len);
/**
Decode a symbol
@param mqc MQC handle
@return Returns the decoded symbol (0 or 1)
*/
int mqc_decode(opj_mqc_t *const mqc);
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __MQC_H */
/contrib/media/updf/include/mystring.h
0,0 → 1,510
#ifndef _I386_STRING_H_
#define _I386_STRING_H_
 
#ifndef STATIC
#define STATIC static
#endif
 
#ifndef INLINE
#define INLINE inline
#endif
 
#include<stdlib.h>
 
#define __HAVE_ARCH_STRCPY
STATIC INLINE char * strcpy(char * dest,const char *src)
{
int d0, d1, d2;
__asm__ __volatile__(
"1:\tlodsb\n\t"
"stosb\n\t"
"testb %%al,%%al\n\t"
"jne 1b"
: "=&S" (d0), "=&D" (d1), "=&a" (d2)
:"0" (src),"1" (dest) : "memory");
return dest;
}
 
#define __HAVE_ARCH_STRNCPY
STATIC INLINE char * strncpy(char * dest,const char *src,size_t count)
{
int d0, d1, d2, d3;
__asm__ __volatile__(
"1:\tdecl %2\n\t"
"js 2f\n\t"
"lodsb\n\t"
"stosb\n\t"
"testb %%al,%%al\n\t"
"jne 1b\n\t"
"rep\n\t"
"stosb\n"
"2:"
: "=&S" (d0), "=&D" (d1), "=&c" (d2), "=&a" (d3)
:"0" (src),"1" (dest),"2" (count) : "memory");
return dest;
}
 
#define __HAVE_ARCH_STRCAT
STATIC INLINE char * strcat(char * dest,const char * src)
{
int d0, d1, d2, d3;
__asm__ __volatile__(
"repne\n\t"
"scasb\n\t"
"decl %1\n"
"1:\tlodsb\n\t"
"stosb\n\t"
"testb %%al,%%al\n\t"
"jne 1b"
: "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
: "0" (src), "1" (dest), "2" (0), "3" (0xffffffff):"memory");
return dest;
}
 
#define __HAVE_ARCH_STRNCAT
STATIC INLINE char * strncat(char * dest,const char * src,size_t count)
{
int d0, d1, d2, d3;
__asm__ __volatile__(
"repne\n\t"
"scasb\n\t"
"decl %1\n\t"
"movl %8,%3\n"
"1:\tdecl %3\n\t"
"js 2f\n\t"
"lodsb\n\t"
"stosb\n\t"
"testb %%al,%%al\n\t"
"jne 1b\n"
"2:\txorl %2,%2\n\t"
"stosb"
: "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
: "0" (src),"1" (dest),"2" (0),"3" (0xffffffff), "g" (count)
: "memory");
return dest;
}
 
#define __HAVE_ARCH_STRCMP
STATIC INLINE int strcmp(const char * cs,const char * ct)
{
int d0, d1;
register int __res;
__asm__ __volatile__(
"1:\tlodsb\n\t"
"scasb\n\t"
"jne 2f\n\t"
"testb %%al,%%al\n\t"
"jne 1b\n\t"
"xorl %%eax,%%eax\n\t"
"jmp 3f\n"
"2:\tsbbl %%eax,%%eax\n\t"
"orb $1,%%al\n"
"3:"
:"=a" (__res), "=&S" (d0), "=&D" (d1)
:"1" (cs),"2" (ct));
return __res;
}
 
#define __HAVE_ARCH_STRNCMP
STATIC INLINE int strncmp(const char * cs,const char * ct,size_t count)
{
register int __res;
int d0, d1, d2;
__asm__ __volatile__(
"1:\tdecl %3\n\t"
"js 2f\n\t"
"lodsb\n\t"
"scasb\n\t"
"jne 3f\n\t"
"testb %%al,%%al\n\t"
"jne 1b\n"
"2:\txorl %%eax,%%eax\n\t"
"jmp 4f\n"
"3:\tsbbl %%eax,%%eax\n\t"
"orb $1,%%al\n"
"4:"
:"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
:"1" (cs),"2" (ct),"3" (count));
return __res;
}
 
#define __HAVE_ARCH_STRCHR
STATIC INLINE char * strchr(const char * s, int c)
{
int d0;
register char * __res;
__asm__ __volatile__(
"movb %%al,%%ah\n"
"1:\tlodsb\n\t"
"cmpb %%ah,%%al\n\t"
"je 2f\n\t"
"testb %%al,%%al\n\t"
"jne 1b\n\t"
"movl $1,%1\n"
"2:\tmovl %1,%0\n\t"
"decl %0"
:"=a" (__res), "=&S" (d0) : "1" (s),"0" (c));
return __res;
}
 
#define __HAVE_ARCH_STRRCHR
STATIC INLINE char * strrchr(const char * s, int c)
{
int d0, d1;
register char * __res;
__asm__ __volatile__(
"movb %%al,%%ah\n"
"1:\tlodsb\n\t"
"cmpb %%ah,%%al\n\t"
"jne 2f\n\t"
"leal -1(%%esi),%0\n"
"2:\ttestb %%al,%%al\n\t"
"jne 1b"
:"=g" (__res), "=&S" (d0), "=&a" (d1) :"0" (0),"1" (s),"2" (c));
return __res;
}
 
#define __HAVE_ARCH_STRLEN
STATIC INLINE size_t strlen(const char * s)
{
int d0;
register int __res;
__asm__ __volatile__(
"repne\n\t"
"scasb\n\t"
"notl %0\n\t"
"decl %0"
:"=c" (__res), "=&D" (d0) :"1" (s),"a" (0), "0" (0xffffffff));
return __res;
}
 
static inline void * __memcpy(void * to, const void * from, size_t n)
{
int d0, d1, d2;
__asm__ __volatile__(
"rep ; movsl\n\t"
"testb $2,%b4\n\t"
"je 1f\n\t"
"movsw\n"
"1:\ttestb $1,%b4\n\t"
"je 2f\n\t"
"movsb\n"
"2:"
: "=&c" (d0), "=&D" (d1), "=&S" (d2)
:"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from)
: "memory");
return (to);
}
 
/*
* This looks horribly ugly, but the compiler can optimize it totally,
* as the count is constant.
*/
static inline void * __constant_memcpy(void * to, const void * from, size_t n)
{
switch (n) {
case 0:
return to;
case 1:
*(unsigned char *)to = *(const unsigned char *)from;
return to;
case 2:
*(unsigned short *)to = *(const unsigned short *)from;
return to;
case 3:
*(unsigned short *)to = *(const unsigned short *)from;
*(2+(unsigned char *)to) = *(2+(const unsigned char *)from);
return to;
case 4:
*(unsigned long *)to = *(const unsigned long *)from;
return to;
case 6: /* for Ethernet addresses */
*(unsigned long *)to = *(const unsigned long *)from;
*(2+(unsigned short *)to) = *(2+(const unsigned short *)from);
return to;
case 8:
*(unsigned long *)to = *(const unsigned long *)from;
*(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
return to;
case 12:
*(unsigned long *)to = *(const unsigned long *)from;
*(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
*(2+(unsigned long *)to) = *(2+(const unsigned long *)from);
return to;
case 16:
*(unsigned long *)to = *(const unsigned long *)from;
*(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
*(2+(unsigned long *)to) = *(2+(const unsigned long *)from);
*(3+(unsigned long *)to) = *(3+(const unsigned long *)from);
return to;
case 20:
*(unsigned long *)to = *(const unsigned long *)from;
*(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
*(2+(unsigned long *)to) = *(2+(const unsigned long *)from);
*(3+(unsigned long *)to) = *(3+(const unsigned long *)from);
*(4+(unsigned long *)to) = *(4+(const unsigned long *)from);
return to;
}
#define COMMON(x) \
__asm__ __volatile__( \
"rep ; movsl" \
x \
: "=&c" (d0), "=&D" (d1), "=&S" (d2) \
: "0" (n/4),"1" ((long) to),"2" ((long) from) \
: "memory");
{
int d0, d1, d2;
switch (n % 4) {
case 0: COMMON(""); return to;
case 1: COMMON("\n\tmovsb"); return to;
case 2: COMMON("\n\tmovsw"); return to;
default: COMMON("\n\tmovsw\n\tmovsb"); return to;
}
}
#undef COMMON
}
 
#define __HAVE_ARCH_MEMCPY
 
#ifdef CONFIG_X86_USE_3DNOW
 
#include <asm/mmx.h>
 
/*
* This CPU favours 3DNow strongly (eg AMD Athlon)
*/
 
static inline void * __constant_memcpy3d(void * to, const void * from, size_t len)
{
if (len < 512)
return __constant_memcpy(to, from, len);
return _mmx_memcpy(to, from, len);
}
 
static inline void *__memcpy3d(void *to, const void *from, size_t len)
{
if (len < 512)
return __memcpy(to, from, len);
return _mmx_memcpy(to, from, len);
}
 
#define memcpy(t, f, n) \
(__builtin_constant_p(n) ? \
__constant_memcpy3d((t),(f),(n)) : \
__memcpy3d((t),(f),(n)))
 
#else
 
/*
* No 3D Now!
*/
#define memcpy(t, f, n) \
(__builtin_constant_p(n) ? \
__constant_memcpy((t),(f),(n)) : \
__memcpy((t),(f),(n)))
 
#endif
 
/*
* struct_cpy(x,y), copy structure *x into (matching structure) *y.
*
* We get link-time errors if the structure sizes do not match.
* There is no runtime overhead, it's all optimized away at
* compile time.
*/
extern void __struct_cpy_bug (void);
 
#define struct_cpy(x,y) \
({ \
if (sizeof(*(x)) != sizeof(*(y))) \
__struct_cpy_bug; \
memcpy(x, y, sizeof(*(x))); \
})
 
#define __HAVE_ARCH_MEMMOVE
STATIC INLINE void * memmove(void * dest,const void * src, size_t n)
{
int d0, d1, d2;
if (dest<src)
__asm__ __volatile__(
"rep\n\t"
"movsb"
: "=&c" (d0), "=&S" (d1), "=&D" (d2)
:"0" (n),"1" (src),"2" (dest)
: "memory");
else
__asm__ __volatile__(
"std\n\t"
"rep\n\t"
"movsb\n\t"
"cld"
: "=&c" (d0), "=&S" (d1), "=&D" (d2)
:"0" (n),
"1" (n-1+(const char *)src),
"2" (n-1+(char *)dest)
:"memory");
return dest;
}
 
#define memcmp __builtin_memcmp
 
#define __HAVE_ARCH_MEMCHR
STATIC INLINE void * memchr(const void * cs,int c,size_t count)
{
int d0;
register void * __res;
if (!count)
return NULL;
__asm__ __volatile__(
"repne\n\t"
"scasb\n\t"
"je 1f\n\t"
"movl $1,%0\n"
"1:\tdecl %0"
:"=D" (__res), "=&c" (d0) : "a" (c),"0" (cs),"1" (count));
return __res;
}
 
static inline void * __memset_generic(void * s, char c,size_t count)
{
int d0, d1;
__asm__ __volatile__(
"rep\n\t"
"stosb"
: "=&c" (d0), "=&D" (d1)
:"a" (c),"1" (s),"0" (count)
:"memory");
return s;
}
 
/* we might want to write optimized versions of these later */
#define __constant_count_memset(s,c,count) __memset_generic((s),(c),(count))
 
/*
* memset(x,0,y) is a reasonably common thing to do, so we want to fill
* things 32 bits at a time even when we don't know the size of the
* area at compile-time..
*/
static inline void * __constant_c_memset(void * s, unsigned long c, size_t count)
{
int d0, d1;
__asm__ __volatile__(
"rep ; stosl\n\t"
"testb $2,%b3\n\t"
"je 1f\n\t"
"stosw\n"
"1:\ttestb $1,%b3\n\t"
"je 2f\n\t"
"stosb\n"
"2:"
: "=&c" (d0), "=&D" (d1)
:"a" (c), "q" (count), "0" (count/4), "1" ((long) s)
:"memory");
return (s);
}
 
/* Added by Gertjan van Wingerde to make minix and sysv module work */
#define __HAVE_ARCH_STRNLEN
STATIC INLINE size_t strnlen(const char * s, size_t count)
{
int d0;
register int __res;
__asm__ __volatile__(
"movl %2,%0\n\t"
"jmp 2f\n"
"1:\tcmpb $0,(%0)\n\t"
"je 3f\n\t"
"incl %0\n"
"2:\tdecl %1\n\t"
"cmpl $-1,%1\n\t"
"jne 1b\n"
"3:\tsubl %2,%0"
:"=a" (__res), "=&d" (d0)
:"c" (s),"1" (count));
return __res;
}
/* end of additional stuff */
 
#define __HAVE_ARCH_STRSTR
 
extern char *strstr(const char *cs, const char *ct);
 
/*
* This looks horribly ugly, but the compiler can optimize it totally,
* as we by now know that both pattern and count is constant..
*/
static inline void * __constant_c_and_count_memset(void * s, unsigned long pattern, size_t count)
{
switch (count) {
case 0:
return s;
case 1:
*(unsigned char *)s = pattern;
return s;
case 2:
*(unsigned short *)s = pattern;
return s;
case 3:
*(unsigned short *)s = pattern;
*(2+(unsigned char *)s) = pattern;
return s;
case 4:
*(unsigned long *)s = pattern;
return s;
}
#define COMMON(x) \
__asm__ __volatile__( \
"rep ; stosl" \
x \
: "=&c" (d0), "=&D" (d1) \
: "a" (pattern),"0" (count/4),"1" ((long) s) \
: "memory")
{
int d0, d1;
switch (count % 4) {
case 0: COMMON(""); return s;
case 1: COMMON("\n\tstosb"); return s;
case 2: COMMON("\n\tstosw"); return s;
default: COMMON("\n\tstosw\n\tstosb"); return s;
}
}
#undef COMMON
}
 
#define __constant_c_x_memset(s, c, count) \
(__builtin_constant_p(count) ? \
__constant_c_and_count_memset((s),(c),(count)) : \
__constant_c_memset((s),(c),(count)))
 
#define __memset(s, c, count) \
(__builtin_constant_p(count) ? \
__constant_count_memset((s),(c),(count)) : \
__memset_generic((s),(c),(count)))
 
#define __HAVE_ARCH_MEMSET
#define memset(s, c, count) \
(__builtin_constant_p(c) ? \
__constant_c_x_memset((s),(0x01010101UL*(unsigned char)(c)),(count)) : \
__memset((s),(c),(count)))
 
/*
* find the first occurrence of byte 'c', or 1 past the area if none
*/
#define __HAVE_ARCH_MEMSCAN
STATIC INLINE void * memscan(void * addr, int c, size_t size)
{
if (!size)
return addr;
__asm__("repnz; scasb\n\t"
"jnz 1f\n\t"
"dec %%edi\n"
"1:"
: "=D" (addr), "=c" (size)
: "0" (addr), "1" (size), "a" (c));
return addr;
}
 
#endif
/contrib/media/updf/include/nc_alloc.h
0,0 → 1,72
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************
* Author: Thomas E. Dickey <dickey@clark.net> 1996,1997 *
****************************************************************************/
/* $Id: nc_alloc.h,v 1.5 1998/02/11 12:13:45 tom Exp $ */
 
#ifndef NC_ALLOC_included
#define NC_ALLOC_included 1
 
#if HAVE_LIBDMALLOC
#include <dmalloc.h> /* Gray Watson's library */
#else
#undef HAVE_LIBDMALLOC
#define HAVE_LIBDMALLOC 0
#endif
 
#if HAVE_LIBDBMALLOC
#include <dbmalloc.h> /* Conor Cahill's library */
#else
#undef HAVE_LIBDBMALLOC
#define HAVE_LIBDBMALLOC 0
#endif
 
#ifndef NO_LEAKS
#define NO_LEAKS 0
#endif
 
#ifndef HAVE_NC_FREEALL
#define HAVE_NC_FREEALL 0
#endif
 
#if HAVE_LIBDBMALLOC || HAVE_LIBDMALLOC || NO_LEAKS || HAVE_NC_FREEALL
struct termtype;
extern void _nc_free_and_exit(int) GCC_NORETURN;
extern void _nc_free_tparm(void);
extern void _nc_leaks_dump_entry(void);
extern void _nc_free_termtype(struct termtype *, int);
#define ExitProgram(code) _nc_free_and_exit(code)
#endif
 
#ifndef ExitProgram
#define ExitProgram(code) return code
#endif
 
#endif /* NC_ALLOC_included */
/contrib/media/updf/include/nc_panel.h
0,0 → 1,66
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
****************************************************************************/
 
 
/*
* $Id: nc_panel.h,v 1.2 1998/02/11 12:13:45 tom Exp $
*
* nc_panel.h
*
* Headerfile to provide an interface for the panel layer into
* the SCREEN structure of the ncurses core.
*/
 
#ifndef NC_PANEL_H
#define NC_PANEL_H 1
 
#ifdef __cplusplus
extern "C" {
#endif
 
struct panel; /* Forward Declaration */
 
struct panelhook {
struct panel* top_panel;
struct panel* bottom_panel;
struct panel* stdscr_pseudo_panel;
};
 
/* Retrieve the panelhook of the current screen */
extern struct panelhook* _nc_panelhook(void);
 
#ifdef __cplusplus
}
#endif
 
#endif /* NC_PANEL_H */
/contrib/media/updf/include/ncurses_cfg.h
0,0 → 1,124
/* include/ncurses_cfg.h. Generated automatically by configure. */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************
* Author: Thomas E. Dickey <dickey@clark.net> 1997 *
****************************************************************************/
/*
* $Id: ncurses_cfg.hin,v 1.2 1998/02/11 12:13:46 tom Exp $
*
* This is a template-file used to generate the "ncurses_cfg.h" file.
*
* Rather than list every definition, the configuration script substitutes
* the definitions that it finds using 'sed'. You need a patch (971222)
* to autoconf 2.12 to do this.
*/
#ifndef NC_CONFIG_H
#define NC_CONFIG_H
 
#define CC_HAS_INLINE_FUNCS 1
#define GCC_NORETURN __attribute__((noreturn))
#define GCC_PRINTF 1
#define GCC_SCANF 1
#define GCC_UNUSED __attribute__((unused))
#define GOOD_SELECT 1
#define HAVE_DIRENT_H 1
#define HAVE_ERRNO 1
#define HAVE_FCNTL_H 1
#define HAVE_FORM_H 1
#define HAVE_GETOPT_H 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GETTTYNAM 1
#define HAVE_ISASCII 1
#define HAVE_LIBFORM 1
#define HAVE_LIBMENU 1
#define HAVE_LIBPANEL 1
#define HAVE_LIMITS_H 1
#define HAVE_LINK 1
#define HAVE_LOCALE_H 1
#define HAVE_LONG_FILE_NAMES 1
#define HAVE_MEMCCPY 1
#define HAVE_MENU_H 1
#define HAVE_NANOSLEEP 1
#define HAVE_NC_ALLOC_H 1
#define HAVE_PANEL_H 1
#define HAVE_POLL 1
#define HAVE_POLL_H 1
#define HAVE_REGEX_H_FUNCS 1
#define HAVE_REMOVE 1
#define HAVE_SELECT 1
#define HAVE_SETBUF 1
#define HAVE_SETBUFFER 1
#define HAVE_SETVBUF 1
#define HAVE_SIGACTION 1
#define HAVE_SIGVEC 1
#define HAVE_SIZECHANGE 1
#define HAVE_STRDUP 1
#define HAVE_SYMLINK 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_STROPTS_H 1
#define HAVE_SYS_TIMES_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIME_SELECT 1
#define HAVE_TCGETATTR 1
#define HAVE_TERMIOS_H 1
#define HAVE_TERMIO_H 1
#define HAVE_TIMES 1
#define HAVE_TTYENT_H 1
#define HAVE_TYPEINFO 1
#define HAVE_UNISTD_H 1
#define HAVE_USLEEP 1
#define HAVE_VALUES_H 1
#define HAVE_VFSCANF 1
#define HAVE_VSNPRINTF 1
#define HAVE_VSSCANF 1
#define NCURSES_EXT_FUNCS 1
#define NDEBUG 1
#define PURE_TERMINFO 1
#define RETSIGTYPE void
#define STDC_HEADERS 1
#define SYSTEM_NAME "linux-gnu"
#define TYPEOF_CHTYPE long
#define USE_DATABASE 1
#define USE_SCROLL_HINTS 1
 
/* The C compiler may not treat these properly but C++ has to */
#ifdef __cplusplus
#undef const
#undef inline
#else
#if defined(lint) || defined(TRACE)
#undef inline
#define inline /* nothing */
#endif
#endif
 
#endif /* NC_CONFIG_H */
/contrib/media/updf/include/net/if.h
0,0 → 1,106
#ifndef _NET_IF_H
#define _NET_IF_H
 
#include <sys/cdefs.h>
#include <sys/socket.h>
 
__BEGIN_DECLS
 
/* Standard interface flags. */
#define IFF_UP 0x1 /* interface is up */
#define IFF_BROADCAST 0x2 /* broadcast address valid */
#define IFF_DEBUG 0x4 /* turn on debugging */
#define IFF_LOOPBACK 0x8 /* is a loopback net */
#define IFF_POINTOPOINT 0x10 /* interface is has p-p link */
#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */
#define IFF_RUNNING 0x40 /* resources allocated */
#define IFF_NOARP 0x80 /* no ARP protocol */
#define IFF_PROMISC 0x100 /* receive all packets */
#define IFF_ALLMULTI 0x200 /* receive all multicast packets*/
 
#define IFF_MASTER 0x400 /* master of a load balancer */
#define IFF_SLAVE 0x800 /* slave of a load balancer */
 
#define IFF_MULTICAST 0x1000 /* Supports multicast */
 
#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_MASTER|IFF_SLAVE|IFF_RUNNING)
 
#define IFF_PORTSEL 0x2000 /* can set media type */
#define IFF_AUTOMEDIA 0x4000 /* auto media select active */
#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/
 
struct ifmap {
unsigned long mem_start;
unsigned long mem_end;
unsigned short base_addr;
unsigned char irq;
unsigned char dma;
unsigned char port;
/* 3 bytes spare */
};
 
struct ifreq {
#define IFHWADDRLEN 6
#define IFNAMSIZ 16
union
{
char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
} ifr_ifrn;
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
struct sockaddr ifru_broadaddr;
struct sockaddr ifru_netmask;
struct sockaddr ifru_hwaddr;
short ifru_flags;
int ifru_ivalue;
int ifru_mtu;
struct ifmap ifru_map;
char ifru_slave[IFNAMSIZ]; /* Just fits the size */
char ifru_newname[IFNAMSIZ];
char* ifru_data;
} ifr_ifru;
};
 
#define ifr_name ifr_ifrn.ifrn_name /* interface name */
#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
#define ifr_addr ifr_ifru.ifru_addr /* address */
#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
#define ifr_flags ifr_ifru.ifru_flags /* flags */
#define ifr_metric ifr_ifru.ifru_ivalue /* metric */
#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
#define ifr_map ifr_ifru.ifru_map /* device map */
#define ifr_slave ifr_ifru.ifru_slave /* slave device */
#define ifr_data ifr_ifru.ifru_data /* for use by interface */
#define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
#define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
#define ifr_qlen ifr_ifru.ifru_ivalue /* Queue length */
#define ifr_newname ifr_ifru.ifru_newname /* New name */
 
struct ifconf {
int ifc_len; /* size of buffer */
union {
char * ifcu_buf;
struct ifreq *ifcu_req;
} ifc_ifcu;
};
 
#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
#define ifc_req ifc_ifcu.ifcu_req /* array of structures */
 
unsigned int if_nametoindex (const char *ifname) __THROW;
char *if_indextoname (unsigned int ifindex, char *ifname) __THROW;
 
struct if_nameindex {
unsigned int if_index;
char *if_name;
};
 
struct if_nameindex* if_nameindex(void) __THROW;
void if_freenameindex(struct if_nameindex* ptr) __THROW;
 
__END_DECLS
 
#endif
/contrib/media/updf/include/net/if_arp.h
0,0 → 1,118
#ifndef _NET_IF_ARP_H
#define _NET_IF_ARP_H
 
#include <sys/socket.h>
 
__BEGIN_DECLS
 
#define MAX_ADDR_LEN 7
 
/* ARP protocol HARDWARE identifiers. */
#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */
#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */
#define ARPHRD_EETHER 2 /* Experimental Ethernet */
#define ARPHRD_AX25 3 /* AX.25 Level 2 */
#define ARPHRD_PRONET 4 /* PROnet token ring */
#define ARPHRD_CHAOS 5 /* Chaosnet */
#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */
#define ARPHRD_ARCNET 7 /* ARCnet */
#define ARPHRD_APPLETLK 8 /* APPLEtalk */
#define ARPHRD_DLCI 15 /* Frame Relay DLCI */
#define ARPHRD_ATM 19 /* ATM */
#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */
 
/* Dummy types for non ARP hardware */
#define ARPHRD_SLIP 256
#define ARPHRD_CSLIP 257
#define ARPHRD_SLIP6 258
#define ARPHRD_CSLIP6 259
#define ARPHRD_RSRVD 260 /* Notional KISS type */
#define ARPHRD_ADAPT 264
#define ARPHRD_ROSE 270
#define ARPHRD_X25 271 /* CCITT X.25 */
#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */
#define ARPHRD_PPP 512
#define ARPHRD_CISCO 513 /* Cisco HDLC */
#define ARPHRD_HDLC ARPHRD_CISCO
#define ARPHRD_LAPB 516 /* LAPB */
#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */
#define ARPHRD_RAWHDLC 518 /* Raw HDLC */
 
#define ARPHRD_TUNNEL 768 /* IPIP tunnel */
#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel */
#define ARPHRD_FRAD 770 /* Frame Relay Access Device */
#define ARPHRD_SKIP 771 /* SKIP vif */
#define ARPHRD_LOOPBACK 772 /* Loopback device */
#define ARPHRD_LOCALTLK 773 /* Localtalk device */
#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */
#define ARPHRD_BIF 775 /* AP1000 BIF */
#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */
#define ARPHRD_IPDDP 777 /* IP over DDP tunneller */
#define ARPHRD_IPGRE 778 /* GRE over IP */
#define ARPHRD_PIMREG 779 /* PIMSM register interface */
#define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */
#define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */
#define ARPHRD_ECONET 782 /* Acorn Econet */
#define ARPHRD_IRDA 783 /* Linux-IrDA */
/* ARP works differently on different FC media .. so */
#define ARPHRD_FCPP 784 /* Point to point fibrechannel */
#define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */
#define ARPHRD_FCPL 786 /* Fibrechannel public loop */
#define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */
/* 787->799 reserved for fibrechannel media types */
#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */
#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
 
#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
 
/* ARP protocol opcodes. */
#define ARPOP_REQUEST 1 /* ARP request */
#define ARPOP_REPLY 2 /* ARP reply */
#define ARPOP_RREQUEST 3 /* RARP request */
#define ARPOP_RREPLY 4 /* RARP reply */
#define ARPOP_InREQUEST 8 /* InARP request */
#define ARPOP_InREPLY 9 /* InARP reply */
#define ARPOP_NAK 10 /* (ATM)ARP NAK */
 
 
/* ARP ioctl request. */
struct arpreq {
struct sockaddr arp_pa; /* protocol address */
struct sockaddr arp_ha; /* hardware address */
int arp_flags; /* flags */
struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
char arp_dev[16];
};
 
struct arpreq_old {
struct sockaddr arp_pa; /* protocol address */
struct sockaddr arp_ha; /* hardware address */
int arp_flags; /* flags */
struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
};
 
/* ARP Flag values. */
#define ATF_COM 0x02 /* completed entry (ha valid) */
#define ATF_PERM 0x04 /* permanent entry */
#define ATF_PUBL 0x08 /* publish entry */
#define ATF_USETRAILERS 0x10 /* has requested trailers */
#define ATF_NETMASK 0x20 /* want to use a netmask (only
for proxy entries) */
#define ATF_DONTPUB 0x40 /* don't answer this addresses */
 
/*
* This structure defines an ethernet arp header.
*/
 
struct arphdr
{
unsigned short ar_hrd; /* format of hardware address */
unsigned short ar_pro; /* format of protocol address */
unsigned char ar_hln; /* length of hardware address */
unsigned char ar_pln; /* length of protocol address */
unsigned short ar_op; /* ARP opcode (command) */
};
 
__END_DECLS
 
#endif
/contrib/media/updf/include/net/if_ether.h
0,0 → 1,80
#ifndef _NET_IF_ETHER_H
#define _NET_IF_ETHER_H
 
#include <sys/cdefs.h>
 
__BEGIN_DECLS
 
/* taken from <linux/if_ether.h> */
 
#define ETH_ALEN 6 /* Octets in one ethernet addr */
#define ETH_HLEN 14 /* Total octets in header. */
#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
 
/*
* These are the defined Ethernet Protocol ID's.
*/
 
#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
#define ETH_P_IP 0x0800 /* Internet Protocol packet */
#define ETH_P_X25 0x0805 /* CCITT X.25 */
#define ETH_P_ARP 0x0806 /* Address Resolution packet */
#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
#define ETH_P_LAT 0x6004 /* DEC LAT */
#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
#define ETH_P_CUST 0x6006 /* DEC Customer use */
#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
#define ETH_P_ATALK 0x809B /* Appletalk DDP */
#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
#define ETH_P_IPX 0x8137 /* IPX over DIX */
#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport over Ethernet */
 
/*
* Non DIX types. Won't clash for 1500 types.
*/
 
#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
#define ETH_P_802_2 0x0004 /* 802.2 frames */
#define ETH_P_SNAP 0x0005 /* Internal only */
#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
#define ETH_P_ECONET 0x0018 /* Acorn Econet */
 
/*
* This is an Ethernet frame header.
*/
 
struct ethhdr {
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
unsigned short h_proto; /* packet type ID field */
};
 
__END_DECLS
 
#endif
/contrib/media/updf/include/net/route.h
0,0 → 1,54
#ifndef _NET_ROUTE_H
#define _NET_ROUTE_H
 
#include <inttypes.h>
#include <netinet/in.h>
 
__BEGIN_DECLS
 
/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
struct rtentry {
unsigned long rt_pad1;
struct sockaddr rt_dst; /* target address */
struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */
struct sockaddr rt_genmask; /* target network mask (IP) */
unsigned short rt_flags;
short rt_pad2;
unsigned long rt_pad3;
void *rt_pad4;
short rt_metric; /* +1 for binary compatibility! */
char *rt_dev; /* forcing the device at add */
unsigned long rt_mtu; /* per route MTU/Window */
#define rt_mss rt_mtu /* Compatibility :-( */
unsigned long rt_window; /* Window clamping */
unsigned short rt_irtt; /* Initial RTT */
};
 
#define RTF_UP 0x0001 /* route usable */
#define RTF_GATEWAY 0x0002 /* destination is a gateway */
#define RTF_HOST 0x0004 /* host entry (net otherwise) */
#define RTF_REINSTATE 0x0008 /* reinstate route after tmout */
#define RTF_DYNAMIC 0x0010 /* created dyn. (by redirect) */
#define RTF_MODIFIED 0x0020 /* modified dyn. (by redirect) */
#define RTF_MTU 0x0040 /* specific MTU for this route */
#define RTF_MSS RTF_MTU /* Compatibility :-( */
#define RTF_WINDOW 0x0080 /* per route window clamping */
#define RTF_IRTT 0x0100 /* Initial round trip time */
#define RTF_REJECT 0x0200 /* Reject route */
 
struct in6_rtmsg {
struct in6_addr rtmsg_dst;
struct in6_addr rtmsg_src;
struct in6_addr rtmsg_gateway;
uint32_t rtmsg_type;
uint16_t rtmsg_dst_len;
uint16_t rtmsg_src_len;
uint32_t rtmsg_metric;
unsigned long int rtmsg_info;
uint32_t rtmsg_flags;
int rtmsg_ifindex;
};
 
__END_DECLS
 
#endif
/contrib/media/updf/include/netdb.h
0,0 → 1,128
#ifndef _NETDB_H
#define _NETDB_H
 
#include <sys/cdefs.h>
#include <sys/types.h>
 
__BEGIN_DECLS
 
/* Absolute file name for network data base files. */
#define _PATH_HEQUIV "/etc/hosts.equiv"
#define _PATH_HOSTS "/etc/hosts"
#define _PATH_NETWORKS "/etc/networks"
#define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf"
#define _PATH_PROTOCOLS "/etc/protocols"
#define _PATH_SERVICES "/etc/services"
 
/* Description of data base entry for a single service. */
struct servent {
char *s_name; /* Official service name. */
char **s_aliases; /* Alias list. */
int s_port; /* Port number. */
char *s_proto; /* Protocol to use. */
};
 
extern void endservent (void) ;
extern void setservent(int stayopen) ;
 
extern int getservent_r(struct servent *res, char *buf, size_t buflen,
struct servent **res_sig) ;
extern int getservbyname_r(const char* name,const char* proto,
struct servent *res, char *buf, size_t buflen,
struct servent **res_sig) ;
extern int getservbyport_r(int port,const char* proto,
struct servent *res, char *buf, size_t buflen,
struct servent **res_sig) ;
 
extern struct servent *getservent(void) ;
extern struct servent *getservbyname (const char *__name,
const char *__proto) ;
extern struct servent *getservbyport (int __port, const char *__proto)
;
 
struct hostent {
char *h_name; /* Official name of host. */
char **h_aliases; /* Alias list. */
int h_addrtype; /* Host address type. */
socklen_t h_length; /* Length of address. */
char **h_addr_list; /* List of addresses from name server. */
#define h_addr h_addr_list[0] /* Address, for backward compatibility. */
};
 
extern void endhostent (void) ;
extern struct hostent *gethostent (void) ;
extern struct hostent *gethostent_r (char* buf,int len) ;
extern struct hostent *gethostbyaddr (const void *__addr, socklen_t __len,
int __type) ;
extern struct hostent *gethostbyname (const char *__name) ;
extern struct hostent *gethostbyname2 (const char *__name, int __af) ;
 
/* this glibc "invention" is so ugly, I'm going to throw up any minute
* now */
extern int gethostbyname_r(const char* NAME, struct hostent* RESULT_BUF,char* BUF,
size_t BUFLEN, struct hostent** RESULT,
int* H_ERRNOP) ;
 
#define HOST_NOT_FOUND 1
#define TRY_AGAIN 2
#define NO_RECOVERY 3
#define NO_ADDRESS 4
#define NO_DATA 5
 
extern int gethostbyaddr_r(const char* addr, size_t length, int format,
struct hostent* result, char *buf, size_t buflen,
struct hostent **RESULT, int *h_errnop) ;
 
int gethostbyname2_r(const char* name, int AF, struct hostent* result,
char *buf, size_t buflen,
struct hostent **RESULT, int *h_errnop) ;
 
struct protoent {
char *p_name; /* official protocol name */
char **p_aliases; /* alias list */
int p_proto; /* protocol number */
};
 
struct protoent *getprotoent(void) ;
struct protoent *getprotobyname(const char *name) ;
struct protoent *getprotobynumber(int proto) ;
void setprotoent(int stayopen) ;
void endprotoent(void) ;
 
int getprotoent_r(struct protoent *res, char *buf, size_t buflen,
struct protoent **res_sig) ;
int getprotobyname_r(const char* name,
struct protoent *res, char *buf, size_t buflen,
struct protoent **res_sig) ;
int getprotobynumber_r(int proto,
struct protoent *res, char *buf, size_t buflen,
struct protoent **res_sig) ;
 
 
void sethostent(int stayopen) ;
 
/* dummy */
extern int h_errno;
 
struct netent {
char *n_name; /* official network name */
char **n_aliases; /* alias list */
int n_addrtype; /* net address type */
unsigned long int n_net; /* network number */
};
 
struct netent *getnetbyaddr(unsigned long net, int type) ;
void endnetent(void) ;
void setnetent(int stayopen) ;
struct netent *getnetbyname(const char *name) ;
struct netent *getnetent(void) ;
 
extern const char *hstrerror (int err_num) ;
void herror(const char *s) ;
 
#define NI_MAXHOST 1025
#define NI_MAXSERV 32
 
__END_DECLS
 
#endif
/contrib/media/updf/include/netinet/in.h
0,0 → 1,428
#ifndef _NETINET_IN_H
#define _NETINET_IN_H
 
#include <sys/types.h>
#include <sys/socket.h>
#include <endian.h>
 
__BEGIN_DECLS
 
/* Standard well-defined IP protocols. */
enum {
IPPROTO_IP = 0, /* Dummy protocol for TCP */
#define IPPROTO_IP IPPROTO_IP
IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
#define IPPROTO_ICMP IPPROTO_ICMP
IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
#define IPPROTO_IGMP IPPROTO_IGMP
IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
#define IPPROTO_IPIP IPPROTO_IPIP
IPPROTO_TCP = 6, /* Transmission Control Protocol */
#define IPPROTO_TCP IPPROTO_TCP
IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
#define IPPROTO_EGP IPPROTO_EGP
IPPROTO_PUP = 12, /* PUP protocol */
#define IPPROTO_PUP IPPROTO_PUP
IPPROTO_UDP = 17, /* User Datagram Protocol */
#define IPPROTO_UDP IPPROTO_UDP
IPPROTO_IDP = 22, /* XNS IDP protocol */
#define IPPROTO_IDP IPPROTO_IDP
IPPROTO_RSVP = 46, /* RSVP protocol */
#define IPPROTO_RSVP IPPROTO_RSVP
IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
#define IPPROTO_GRE IPPROTO_GRE
IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
#define IPPROTO_IPV6 IPPROTO_IPV6
IPPROTO_PIM = 103, /* Protocol Independent Multicast */
#define IPPROTO_PIM IPPROTO_PIM
IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
#define IPPROTO_ESP IPPROTO_ESP
IPPROTO_AH = 51, /* Authentication Header protocol */
#define IPPROTO_AH IPPROTO_AH
IPPROTO_COMP = 108, /* Compression Header protocol */
#define IPPROTO_COMP IPPROTO_COMP
IPPROTO_RAW = 255, /* Raw IP packets */
#define IPPROTO_RAW IPPROTO_RAW
IPPROTO_MAX
};
 
#define IP_TOS 1
#define IP_TTL 2
#define IP_HDRINCL 3
#define IP_OPTIONS 4
#define IP_ROUTER_ALERT 5
#define IP_RECVOPTS 6
#define IP_RETOPTS 7
#define IP_PKTINFO 8
#define IP_PKTOPTIONS 9
#define IP_MTU_DISCOVER 10
#define IP_RECVERR 11
#define IP_RECVTTL 12
#define IP_RECVTOS 13
#define IP_MTU 14
#define IP_FREEBIND 15
 
/* BSD compatibility */
#define IP_RECVRETOPTS IP_RETOPTS
 
/* IP_MTU_DISCOVER values */
#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
#define IP_PMTUDISC_WANT 1 /* Use per route hints */
#define IP_PMTUDISC_DO 2 /* Always DF */
 
#define IP_MULTICAST_IF 32
#define IP_MULTICAST_TTL 33
#define IP_MULTICAST_LOOP 34
#define IP_ADD_MEMBERSHIP 35
#define IP_DROP_MEMBERSHIP 36
 
/* These need to appear somewhere around here */
#define IP_DEFAULT_MULTICAST_TTL 1
#define IP_DEFAULT_MULTICAST_LOOP 1
 
#define IN6ADDR_ANY_INIT {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}}
#define IN6ADDR_LOOPBACK_INIT {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }}}
extern const struct in6_addr in6addr_any;
extern const struct in6_addr in6addr_loopback;
 
typedef uint16_t in_port_t;
typedef uint32_t in_addr_t;
 
struct in_addr {
in_addr_t s_addr;
};
 
struct ip_mreq {
struct in_addr imr_multiaddr; /* IP multicast address of group */
struct in_addr imr_interface; /* local IP address of interface */
};
 
struct ip_mreqn {
struct in_addr imr_multiaddr; /* IP multicast address of group */
struct in_addr imr_address; /* local IP address of interface */
int imr_ifindex; /* Interface index */
};
 
struct in_pktinfo {
int ipi_ifindex;
struct in_addr ipi_spec_dst;
struct in_addr ipi_addr;
};
 
/* Structure describing an Internet (IP) socket address. */
#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
struct sockaddr_in {
sa_family_t sin_family; /* Address family */
in_port_t sin_port; /* Port number */
struct in_addr sin_addr; /* Internet address */
/* Pad to size of `struct sockaddr'. */
unsigned char sin_zero[__SOCK_SIZE__ - sizeof(short int) -
sizeof(unsigned short int) - sizeof(struct in_addr)];
};
 
 
/*
* Definitions of the bits in an Internet address integer.
* On subnets, host and network parts are found according
* to the subnet mask, not these masks.
*/
#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
#define IN_CLASSA_NET 0xff000000
#define IN_CLASSA_NSHIFT 24
#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
#define IN_CLASSA_MAX 128
 
#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
#define IN_CLASSB_NET 0xffff0000
#define IN_CLASSB_NSHIFT 16
#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
#define IN_CLASSB_MAX 65536
 
#define IN_CLASSC(a) ((((long int) (a)) & 0xe0000000) == 0xc0000000)
#define IN_CLASSC_NET 0xffffff00
#define IN_CLASSC_NSHIFT 8
#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
 
#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
#define IN_MULTICAST(a) IN_CLASSD(a)
#define IN_MULTICAST_NET 0xF0000000
 
#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
 
/* Address to accept any incoming messages. */
#define INADDR_ANY ((unsigned long int) 0x00000000)
 
/* Address to send to all hosts. */
#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
 
/* Address indicating an error return. */
#define INADDR_NONE ((unsigned long int) 0xffffffff)
 
/* Network number for local host loopback. */
#define IN_LOOPBACKNET 127
 
/* Address to loopback in software to local host. */
#define INADDR_LOOPBACK 0x7f000001 /* 127.0.0.1 */
#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)
 
/* Defines for Multicast INADDR */
#define INADDR_UNSPEC_GROUP 0xe0000000U /* 224.0.0.0 */
#define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */
#define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */
#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU /* 224.0.0.255 */
 
struct in6_addr {
union {
uint8_t u6_addr8[16];
uint16_t u6_addr16[8];
uint32_t u6_addr32[4];
} in6_u;
#define s6_addr in6_u.u6_addr8
#define s6_addr16 in6_u.u6_addr16
#define s6_addr32 in6_u.u6_addr32
};
 
struct sockaddr_in6 {
unsigned short int sin6_family; /* AF_INET6 */
uint16_t sin6_port; /* Transport layer port # */
uint32_t sin6_flowinfo; /* IPv6 flow information */
struct in6_addr sin6_addr; /* IPv6 address */
uint32_t sin6_scope_id; /* scope id (new in RFC2553) */
};
 
struct sockaddr_in_pad {
sa_family_t sin_family; /* Address family */
in_port_t sin_port; /* Port number */
struct in_addr sin_addr; /* Internet address */
/* Pad to size of `struct sockaddr_in6'. */
unsigned char sin_zero[sizeof(struct sockaddr_in6) - sizeof(short int) -
sizeof(unsigned short int) - sizeof(struct in_addr)];
};
 
struct ipv6_mreq {
/* IPv6 multicast address of group */
struct in6_addr ipv6mr_multiaddr;
/* local IPv6 address of interface */
int ipv6mr_interface;
};
 
struct in6_flowlabel_req {
struct in6_addr flr_dst;
uint32_t flr_label;
uint8_t flr_action;
uint8_t flr_share;
uint16_t flr_flags;
uint16_t flr_expires;
uint16_t flr_linger;
uint32_t __flr_pad;
/* Options in format of IPV6_PKTOPTIONS */
};
 
#define IPV6_FL_A_GET 0
#define IPV6_FL_A_PUT 1
#define IPV6_FL_A_RENEW 2
 
#define IPV6_FL_F_CREATE 1
#define IPV6_FL_F_EXCL 2
 
#define IPV6_FL_S_NONE 0
#define IPV6_FL_S_EXCL 1
#define IPV6_FL_S_PROCESS 2
#define IPV6_FL_S_USER 3
#define IPV6_FL_S_ANY 255
 
#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
 
/*
* IPV6 extension headers
*/
#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */
#define IPPROTO_ROUTING 43 /* IPv6 routing header */
#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */
#define IPPROTO_ICMPV6 58 /* ICMPv6 */
#define IPPROTO_NONE 59 /* IPv6 no next header */
#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
 
/* IPv6 TLV options. */
#define IPV6_TLV_PAD0 0
#define IPV6_TLV_PADN 1
#define IPV6_TLV_ROUTERALERT 5
#define IPV6_TLV_JUMBO 194
 
/* IPV6 socket options. */
#define IPV6_ADDRFORM 1
#define IPV6_PKTINFO 2
#define IPV6_HOPOPTS 3
#define IPV6_DSTOPTS 4
#define IPV6_RTHDR 5
#define IPV6_PKTOPTIONS 6
#define IPV6_CHECKSUM 7
#define IPV6_HOPLIMIT 8
#define IPV6_NEXTHOP 9
#define IPV6_AUTHHDR 10
#define IPV6_FLOWINFO 11
 
#define IPV6_UNICAST_HOPS 16
#define IPV6_MULTICAST_IF 17
#define IPV6_MULTICAST_HOPS 18
#define IPV6_MULTICAST_LOOP 19
#define IPV6_ADD_MEMBERSHIP 20
#define IPV6_DROP_MEMBERSHIP 21
#define IPV6_ROUTER_ALERT 22
#define IPV6_MTU_DISCOVER 23
#define IPV6_MTU 24
#define IPV6_RECVERR 25
 
/* IPV6_MTU_DISCOVER values */
#define IPV6_PMTUDISC_DONT 0
#define IPV6_PMTUDISC_WANT 1
#define IPV6_PMTUDISC_DO 2
 
/* Flowlabel */
#define IPV6_FLOWLABEL_MGR 32
#define IPV6_FLOWINFO_SEND 33
 
#define IPV6_MIN_MTU 1280
 
struct in6_pktinfo {
struct in6_addr ipi6_addr;
int ipi6_ifindex;
};
 
struct in6_ifreq {
struct in6_addr ifr6_addr;
uint32_t ifr6_prefixlen;
int ifr6_ifindex;
};
 
#define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */
#define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */
 
/* routing header */
struct ipv6_rt_hdr {
uint8_t nexthdr;
uint8_t hdrlen;
uint8_t type;
uint8_t segments_left;
/* type specific data, variable length field */
};
 
struct ipv6_opt_hdr {
uint8_t nexthdr;
uint8_t hdrlen;
/* TLV encoded option data follows. */
};
 
#define ipv6_destopt_hdr ipv6_opt_hdr
#define ipv6_hopopt_hdr ipv6_opt_hdr
 
/* routing header type 0 (used in cmsghdr struct) */
 
#ifndef __STRICT_ANSI__
struct rt0_hdr {
struct ipv6_rt_hdr rt_hdr;
uint32_t bitmap; /* strict/loose bit map */
struct in6_addr addr[0];
#define rt0_type rt_hdr.type;
};
#endif
 
struct ipv6hdr {
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned int flow_lbl:20,
priority:8,
version:4;
#else
unsigned int version:4,
priority:8,
flow_lbl:20;
#endif
 
uint16_t payload_len;
uint8_t nexthdr;
uint8_t hop_limit;
 
struct in6_addr saddr;
struct in6_addr daddr;
};
/* fnord */
 
#define IPPORT_RESERVED 1024
#define INET6_ADDRSTRLEN 46
 
#undef htonl
#undef htons
#undef ntohl
#undef ntohs
uint32_t htonl(uint32_t hostlong);
uint16_t htons(uint16_t hostshort);
uint32_t ntohl(uint32_t netlong);
uint16_t ntohs(uint16_t netshort);
 
#define IN6_IS_ADDR_UNSPECIFIED(a) \
(((__const uint32_t *) (a))[0] == 0 \
&& ((__const uint32_t *) (a))[1] == 0 \
&& ((__const uint32_t *) (a))[2] == 0 \
&& ((__const uint32_t *) (a))[3] == 0)
 
#define IN6_IS_ADDR_LOOPBACK(a) \
(((__const uint32_t *) (a))[0] == 0 \
&& ((__const uint32_t *) (a))[1] == 0 \
&& ((__const uint32_t *) (a))[2] == 0 \
&& ((__const uint32_t *) (a))[3] == htonl (1))
 
#define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
 
#define IN6_IS_ADDR_LINKLOCAL(a) \
((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \
== htonl (0xfe800000))
 
#define IN6_IS_ADDR_SITELOCAL(a) \
((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \
== htonl (0xfec00000))
 
#define IN6_IS_ADDR_V4MAPPED(a) \
((((__const uint32_t *) (a))[0] == 0) \
&& (((__const uint32_t *) (a))[1] == 0) \
&& (((__const uint32_t *) (a))[2] == htonl (0xffff)))
 
#define IN6_IS_ADDR_V4COMPAT(a) \
((((__const uint32_t *) (a))[0] == 0) \
&& (((__const uint32_t *) (a))[1] == 0) \
&& (((__const uint32_t *) (a))[2] == 0) \
&& (ntohl (((__const uint32_t *) (a))[3]) > 1))
 
#define IN6_ARE_ADDR_EQUAL(a,b) \
((((__const uint32_t *) (a))[0] == ((__const uint32_t *) (b))[0]) \
&& (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1]) \
&& (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \
&& (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3]))
 
/* old legacy bullshit */
int bindresvport(int sd, struct sockaddr_in* _sin);
 
#define IN6_IS_ADDR_MC_NODELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) \
&& ((((__const uint8_t *) (a))[1] & 0xf) == 0x1))
 
#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) \
&& ((((__const uint8_t *) (a))[1] & 0xf) == 0x2))
 
#define IN6_IS_ADDR_MC_SITELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) \
&& ((((__const uint8_t *) (a))[1] & 0xf) == 0x5))
 
#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) \
&& ((((__const uint8_t *) (a))[1] & 0xf) == 0x8))
 
#define IN6_IS_ADDR_MC_GLOBAL(a) \
(IN6_IS_ADDR_MULTICAST(a) \
&& ((((__const uint8_t *) (a))[1] & 0xf) == 0xe))
 
__END_DECLS
 
#endif
/contrib/media/updf/include/netinet/in_systm.h
--- netinet/ip.h (nonexistent)
+++ netinet/ip.h (revision 4680)
@@ -0,0 +1,125 @@
+#ifndef _NETINET_IP_H
+#define _NETINET_IP_H
+
+#include <inttypes.h>
+#include <endian.h>
+#include <netinet/in.h>
+
+__BEGIN_DECLS
+
+#define IPVERSION 4 /* IP version number */
+#define IP_MAXPACKET 65535 /* maximum packet size */
+
+#define IPTOS_TOS_MASK 0x1E
+#define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK)
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IPTOS_MINCOST 0x02
+#define IPTOS_LOWCOST IPTOS_MINCOST
+
+#define IPTOS_PREC_MASK 0xE0
+#define IPTOS_PREC(tos) ((tos)&IPTOS_PREC_MASK)
+#define IPTOS_PREC_NETCONTROL 0xe0
+#define IPTOS_PREC_INTERNETCONTROL 0xc0
+#define IPTOS_PREC_CRITIC_ECP 0xa0
+#define IPTOS_PREC_FLASHOVERRIDE 0x80
+#define IPTOS_PREC_FLASH 0x60
+#define IPTOS_PREC_IMMEDIATE 0x40
+#define IPTOS_PREC_PRIORITY 0x20
+#define IPTOS_PREC_ROUTINE 0x00
+
+
+/* IP options */
+#define IPOPT_COPY 0x80
+#define IPOPT_CLASS_MASK 0x60
+#define IPOPT_NUMBER_MASK 0x1f
+
+#define IPOPT_COPIED(o) ((o)&IPOPT_COPY)
+#define IPOPT_CLASS(o) ((o)&IPOPT_CLASS_MASK)
+#define IPOPT_NUMBER(o) ((o)&IPOPT_NUMBER_MASK)
+
+#define IPOPT_CONTROL 0x00
+#define IPOPT_RESERVED1 0x20
+#define IPOPT_MEASUREMENT 0x40
+#define IPOPT_RESERVED2 0x60
+
+#define IPOPT_END (0 |IPOPT_CONTROL)
+#define IPOPT_NOOP (1 |IPOPT_CONTROL)
+#define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT)
+#define IPOPT_RR (7 |IPOPT_CONTROL)
+#define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_RA (20|IPOPT_CONTROL|IPOPT_COPY)
+
+#define IPVERSION 4
+#define MAXTTL 255
+#define IPDEFTTL 64
+
+/* struct timestamp, struct route and MAX_ROUTES are removed.
+
+ REASONS: it is clear that nobody used them because:
+ - MAX_ROUTES value was wrong.
+ - "struct route" was wrong.
+ - "struct timestamp" had fatally misaligned bitfields and was completely unusable.
+ */
+
+#define IPOPT_OPTVAL 0
+#define IPOPT_OLEN 1
+#define IPOPT_OFFSET 2
+#define IPOPT_MINOFF 4
+#define MAX_IPOPTLEN 40
+#define IPOPT_NOP IPOPT_NOOP
+#define IPOPT_EOL IPOPT_END
+#define IPOPT_TS IPOPT_TIMESTAMP
+
+#define IPOPT_TS_TSONLY 0 /* timestamps only */
+#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
+#define IPOPT_TS_PRESPEC 3 /* specified modules only */
+
+struct iphdr { /* size 20/0x14 */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int ihl:4, version:4; /* offset 0; version=ip version (4) */
+#else
+ unsigned int version:4, ihl:4; /* offset 0; ihl=ip header length, measured in words (5) */
+#endif
+ unsigned char tos; /* offset 1 */
+ unsigned short tot_len; /* offset 2; total bytes in packet in network byte order */
+ unsigned short id; /* offset 4 */
+ unsigned short frag_off; /* offset 6 */
+ unsigned char ttl; /* offset 8 */
+ unsigned char protocol; /* offset 9; 1=ICMP, 6=TCP, 17=UDP (see netinet/in.h) */
+ unsigned short check; /* offset 10/0xa */
+ unsigned int saddr; /* offset 12/0xc */
+ unsigned int daddr; /* offset 16/0x10 */
+ /*The options start here. */
+};
+
+struct ip {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int ip_hl:4; /* header length */
+ unsigned int ip_v:4; /* version */
+#endif
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int ip_v:4; /* version */
+ unsigned int ip_hl:4; /* header length */
+#endif
+ unsigned char ip_tos; /* type of service */
+ unsigned short ip_len; /* total length */
+ unsigned short ip_id; /* identification */
+ unsigned short ip_off; /* fragment offset field */
+#define IP_RF 0x8000 /* reserved fragment flag */
+#define IP_DF 0x4000 /* dont fragment flag */
+#define IP_MF 0x2000 /* more fragments flag */
+#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
+ unsigned char ip_ttl; /* time to live */
+ unsigned char ip_p; /* protocol */
+ unsigned short ip_sum; /* checksum */
+ struct in_addr ip_src, ip_dst; /* source and dest address */
+};
+
+__END_DECLS
+
+#endif
/contrib/media/updf/include/netinet/ip_icmp.h
0,0 → 1,149
#ifndef NETINET_IP_ICMP_H
#define NETINET_IP_ICMP_H
 
#include <sys/cdefs.h>
#include <inttypes.h>
#include <netinet/ip.h>
 
__BEGIN_DECLS
 
struct icmphdr {
uint8_t type; /* message type */
uint8_t code; /* type sub-code */
uint16_t checksum;
union {
struct {
uint16_t id;
uint16_t sequence;
} echo; /* echo datagram */
uint32_t gateway; /* gateway address */
struct {
uint16_t __unused;
uint16_t mtu;
} frag; /* path mtu discovery */
} un;
};
 
#define ICMP_ECHOREPLY 0 /* Echo Reply */
#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
#define ICMP_SOURCE_QUENCH 4 /* Source Quench */
#define ICMP_REDIRECT 5 /* Redirect (change route) */
#define ICMP_ECHO 8 /* Echo Request */
#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
#define ICMP_PARAMETERPROB 12 /* Parameter Problem */
#define ICMP_TIMESTAMP 13 /* Timestamp Request */
#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
#define ICMP_INFO_REQUEST 15 /* Information Request */
#define ICMP_INFO_REPLY 16 /* Information Reply */
#define ICMP_ADDRESS 17 /* Address Mask Request */
#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
#define NR_ICMP_TYPES 18
 
 
/* Codes for UNREACH. */
#define ICMP_NET_UNREACH 0 /* Network Unreachable */
#define ICMP_HOST_UNREACH 1 /* Host Unreachable */
#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */
#define ICMP_PORT_UNREACH 3 /* Port Unreachable */
#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */
#define ICMP_SR_FAILED 5 /* Source Route failed */
#define ICMP_NET_UNKNOWN 6
#define ICMP_HOST_UNKNOWN 7
#define ICMP_HOST_ISOLATED 8
#define ICMP_NET_ANO 9
#define ICMP_HOST_ANO 10
#define ICMP_NET_UNR_TOS 11
#define ICMP_HOST_UNR_TOS 12
#define ICMP_PKT_FILTERED 13 /* Packet filtered */
#define ICMP_PREC_VIOLATION 14 /* Precedence violation */
#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */
#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */
 
/* Codes for REDIRECT. */
#define ICMP_REDIR_NET 0 /* Redirect Net */
#define ICMP_REDIR_HOST 1 /* Redirect Host */
#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */
#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */
 
/* Codes for TIME_EXCEEDED. */
#define ICMP_EXC_TTL 0 /* TTL count exceeded */
#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
 
/*
* Lower bounds on packet lengths for various types.
* For the error advice packets must first insure that the
* packet is large enough to contain the returned ip header.
* Only then can we do the check to see if 64 bits of packet
* data have been returned, since we need to check the returned
* ip header length.
*/
#define ICMP_MINLEN 8 /* abs minimum */
#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
#define ICMP_MASKLEN 12 /* address mask */
#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
#ifndef _IP_VHL
#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
/* N.B.: must separately check that ip_hl >= 5 */
#else
#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
/* N.B.: must separately check that header length >= 5 */
#endif
 
/* Definition of type and code fields. */
/* defined above: ICMP_ECHOREPLY, ICMP_REDIRECT, ICMP_ECHO */
#define ICMP_UNREACH 3 /* dest unreachable, codes: */
#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
#define ICMP_ROUTERADVERT 9 /* router advertisement */
#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
#define ICMP_TIMXCEED 11 /* time exceeded, code: */
#define ICMP_PARAMPROB 12 /* ip header bad */
#define ICMP_TSTAMP 13 /* timestamp request */
#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
#define ICMP_IREQ 15 /* information request */
#define ICMP_IREQREPLY 16 /* information reply */
#define ICMP_MASKREQ 17 /* address mask request */
#define ICMP_MASKREPLY 18 /* address mask reply */
 
#define ICMP_MAXTYPE 18
 
/* UNREACH codes */
#define ICMP_UNREACH_NET 0 /* bad net */
#define ICMP_UNREACH_HOST 1 /* bad host */
#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
#define ICMP_UNREACH_PORT 3 /* bad port */
#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
#define ICMP_UNREACH_NET_PROHIB 9 /* net denied */
#define ICMP_UNREACH_HOST_PROHIB 10 /* host denied */
#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
 
/* REDIRECT codes */
#define ICMP_REDIRECT_NET 0 /* for network */
#define ICMP_REDIRECT_HOST 1 /* for host */
#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
 
/* TIMEXCEED codes */
#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
 
/* PARAMPROB code */
#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
 
#define ICMP_INFOTYPE(type) \
((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
(type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
(type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
(type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
(type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
 
__END_DECLS
 
#endif
/contrib/media/updf/include/netinet/tcp.h
0,0 → 1,168
#ifndef _NETINET_TCP_H
#define _NETINET_TCP_H
 
#include <inttypes.h>
#include <endian.h>
 
__BEGIN_DECLS
 
struct tcphdr { /* size 20/0x14 40/0x28 with IP header */
uint16_t source; /* offset 0 20/0x14 */
uint16_t dest; /* offset 2 22/0x16 */
uint32_t seq; /* offset 4 24/0x18 */
uint32_t ack_seq; /* offset 8 28/0x1c */
#if __BYTE_ORDER == __LITTLE_ENDIAN
uint16_t res1:4, doff:4, fin:1, syn:1, rst:1, psh:1, ack:1, urg:1, ece:1, cwr:1;
#else
uint16_t doff:4, res1:4, cwr:1, ece:1, urg:1, ack:1, psh:1, rst:1, syn:1, fin:1;
#endif
/* offset 12/0xc 32/0x20 */
uint16_t window; /* offset 14/0xe 34/0x22 */
uint16_t check; /* offset 16/0x10 36/0x24 */
uint16_t urg_ptr; /* offset 18/0x12 38/0x26 */
};
 
 
enum {
TCP_ESTABLISHED = 1,
TCP_SYN_SENT,
TCP_SYN_RECV,
TCP_FIN_WAIT1,
TCP_FIN_WAIT2,
TCP_TIME_WAIT,
TCP_CLOSE,
TCP_CLOSE_WAIT,
TCP_LAST_ACK,
TCP_LISTEN,
TCP_CLOSING, /* now a valid state */
 
TCP_MAX_STATES /* Leave at the end! */
};
 
#define TCP_STATE_MASK 0xF
#define TCP_ACTION_FIN (1 << 7)
 
enum {
TCPF_ESTABLISHED = (1 << 1),
TCPF_SYN_SENT = (1 << 2),
TCPF_SYN_RECV = (1 << 3),
TCPF_FIN_WAIT1 = (1 << 4),
TCPF_FIN_WAIT2 = (1 << 5),
TCPF_TIME_WAIT = (1 << 6),
TCPF_CLOSE = (1 << 7),
TCPF_CLOSE_WAIT = (1 << 8),
TCPF_LAST_ACK = (1 << 9),
TCPF_LISTEN = (1 << 10),
TCPF_CLOSING = (1 << 11)
};
 
/*
* The union cast uses a gcc extension to avoid aliasing problems
* (union is compatible to any of its members)
* This means this part of the code is -fstrict-aliasing safe now.
*/
union tcp_word_hdr {
struct tcphdr hdr;
uint32_t words[5];
};
 
#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
 
enum {
#if __BYTE_ORDER == __LITTLE_ENDIAN
TCP_FLAG_CWR = 0x00008000,
TCP_FLAG_ECE = 0x00004000,
TCP_FLAG_URG = 0x00002000,
TCP_FLAG_ACK = 0x00001000,
TCP_FLAG_PSH = 0x00000800,
TCP_FLAG_RST = 0x00000400,
TCP_FLAG_SYN = 0x00000200,
TCP_FLAG_FIN = 0x00000100,
TCP_RESERVED_BITS = 0x0000C00F,
TCP_DATA_OFFSET = 0x000000F0
#else
TCP_FLAG_CWR = 0x00800000,
TCP_FLAG_ECE = 0x00400000,
TCP_FLAG_URG = 0x00200000,
TCP_FLAG_ACK = 0x00100000,
TCP_FLAG_PSH = 0x00080000,
TCP_FLAG_RST = 0x00040000,
TCP_FLAG_SYN = 0x00020000,
TCP_FLAG_FIN = 0x00010000,
TCP_RESERVED_BITS = 0x0FC00000,
TCP_DATA_OFFSET = 0xF0000000
#endif
};
 
/* TCP socket options */
#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */
#define TCP_MAXSEG 2 /* Limit MSS */
#define TCP_CORK 3 /* Never send partially complete segments */
#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
#define TCP_KEEPINTVL 5 /* Interval between keepalives */
#define TCP_KEEPCNT 6 /* Number of keepalives before death */
#define TCP_SYNCNT 7 /* Number of SYN retransmits */
#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
#define TCP_INFO 11 /* Information about this connection. */
#define TCP_QUICKACK 12 /* Block/reenable quick acks */
 
#define TCPI_OPT_TIMESTAMPS 1
#define TCPI_OPT_SACK 2
#define TCPI_OPT_WSCALE 4
#define TCPI_OPT_ECN 8
 
enum tcp_ca_state {
TCP_CA_Open = 0,
#define TCPF_CA_Open (1<<TCP_CA_Open)
TCP_CA_Disorder = 1,
#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
TCP_CA_CWR = 2,
#define TCPF_CA_CWR (1<<TCP_CA_CWR)
TCP_CA_Recovery = 3,
#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
TCP_CA_Loss = 4
#define TCPF_CA_Loss (1<<TCP_CA_Loss)
};
 
struct tcp_info {
uint8_t tcpi_state;
uint8_t tcpi_ca_state;
uint8_t tcpi_retransmits;
uint8_t tcpi_probes;
uint8_t tcpi_backoff;
uint8_t tcpi_options;
uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
 
uint32_t tcpi_rto;
uint32_t tcpi_ato;
uint32_t tcpi_snd_mss;
uint32_t tcpi_rcv_mss;
 
uint32_t tcpi_unacked;
uint32_t tcpi_sacked;
uint32_t tcpi_lost;
uint32_t tcpi_retrans;
uint32_t tcpi_fackets;
 
/* Times. */
uint32_t tcpi_last_data_sent;
uint32_t tcpi_last_ack_sent; /* Not remembered, sorry. */
uint32_t tcpi_last_data_recv;
uint32_t tcpi_last_ack_recv;
 
/* Metrics. */
uint32_t tcpi_pmtu;
uint32_t tcpi_rcv_ssthresh;
uint32_t tcpi_rtt;
uint32_t tcpi_rttvar;
uint32_t tcpi_snd_ssthresh;
uint32_t tcpi_snd_cwnd;
uint32_t tcpi_advmss;
uint32_t tcpi_reordering;
};
 
__END_DECLS
 
#endif
/contrib/media/updf/include/netinet/udp.h
0,0 → 1,20
#ifndef _NETINET_UDP_H
#define _NETINET_UDP_H
 
#include <sys/cdefs.h>
#include <sys/types.h>
 
__BEGIN_DECLS
 
struct udphdr { /* size 8 28/0x1c with IP header */
uint16_t source; /* offset 0 20/0x14 */
uint16_t dest; /* offset 2 22/0x16 */
uint16_t len; /* offset 4 24/0x18 */
uint16_t check; /* offset 6 26/0x1a */
};
 
#define SOL_UDP 17 /* sockopt level for UDP */
 
__END_DECLS
 
#endif
/contrib/media/updf/include/netpacket/packet.h
0,0 → 1,47
#ifndef __NETPACKET_PACKET_H
#define __NETPACKET_PACKET_H
 
#include <sys/cdefs.h>
 
__BEGIN_DECLS
 
struct sockaddr_ll {
unsigned short int sll_family;
unsigned short int sll_protocol;
int sll_ifindex;
unsigned short int sll_hatype;
unsigned char sll_pkttype;
unsigned char sll_halen;
unsigned char sll_addr[8];
};
 
#define PACKET_HOST 0 /* To us. */
#define PACKET_BROADCAST 1 /* To all. */
#define PACKET_MULTICAST 2 /* To group. */
#define PACKET_OTHERHOST 3 /* To someone else. */
#define PACKET_OUTGOING 4 /* Originated by us. */
#define PACKET_LOOPBACK 5
#define PACKET_FASTROUTE 6
 
/* Packet socket options. */
 
#define PACKET_ADD_MEMBERSHIP 1
#define PACKET_DROP_MEMBERSHIP 2
#define PACKET_RECV_OUTPUT 3
#define PACKET_RX_RING 5
#define PACKET_STATISTICS 6
 
struct packet_mreq {
int mr_ifindex;
unsigned short int mr_type;
unsigned short int mr_alen;
unsigned char mr_address[8];
};
 
#define PACKET_MR_MULTICAST 0
#define PACKET_MR_PROMISC 1
#define PACKET_MR_ALLMULTI 2
 
__END_DECLS
 
#endif
/contrib/media/updf/include/nomacros.h
0,0 → 1,113
#undef addch
#undef addchnstr
#undef addchstr
#undef addnstr
#undef addstr
#undef attroff
#undef attron
#undef attrset
#undef attr_get
#undef attr_off
#undef attr_on
#undef attr_set
#undef bkgd
#undef bkgdset
#undef border
#undef box
#undef chgat
#undef clear
#undef clrtobot
#undef clrtoeol
#undef COLOR_PAIR
#undef delch
#undef deleteln
#undef echochar
#undef getbkgd
#undef getch
#undef getnstr
#undef getstr
#undef hline
#undef inch
#undef inchnstr
#undef inchstr
#undef innstr
#undef insch
#undef insdelln
#undef insertln
#undef insnstr
#undef insstr
#undef instr
#undef move
#undef mvaddch
#undef mvaddchnstr
#undef mvaddchstr
#undef mvaddnstr
#undef mvaddstr
#undef mvchgat
#undef mvdelch
#undef mvgetch
#undef mvgetnstr
#undef mvgetstr
#undef mvhline
#undef mvinch
#undef mvinchnstr
#undef mvinchstr
#undef mvinnstr
#undef mvinsch
#undef mvinsnstr
#undef mvinsstr
#undef mvinstr
#undef mvvline
#undef mvwaddch
#undef mvwaddchnstr
#undef mvwaddchstr
#undef mvwaddnstr
#undef mvwaddstr
#undef mvwchgat
#undef mvwdelch
#undef mvwgetch
#undef mvwgetnstr
#undef mvwgetstr
#undef mvwhline
#undef mvwinch
#undef mvwinchnstr
#undef mvwinchstr
#undef mvwinnstr
#undef mvwinsch
#undef mvwinsnstr
#undef mvwinsstr
#undef mvwinstr
#undef mvwvline
#undef PAIR_NUMBER
#undef redrawwin
#undef refresh
#undef scrl
#undef scroll
#undef setscrreg
#undef slk_attr_off
#undef slk_attr_on
#undef slk_attr_set
#undef standout
#undef standend
#undef timeout
#undef untouchwin
#undef vid_attr
#undef vline
#undef vw_printw
#undef vw_scanw
#undef waddchstr
#undef waddstr
#undef wattron
#undef wattroff
#undef wattrset
#undef wattr_get
#undef wattr_set
#undef wdeleteln
#undef wgetstr
#undef winch
#undef winchstr
#undef winsertln
#undef winsstr
#undef winstr
#undef wstandout
#undef wstandend
/contrib/media/updf/include/numbers.h
0,0 → 1,181
 
#ifndef __numbers_h__
#define __numbers_h__
 
#include "lispenvironment.h"
#include "yacasbase.h"
 
 
 
/// Whether the numeric library supports 1.0E-10 and such.
LispInt NumericSupportForMantissa();
 
LispObject* GcdInteger(LispObject* int1, LispObject* int2, LispEnvironment& aEnvironment);
 
LispObject* SinFloat(LispObject* int1, LispEnvironment& aEnvironment,LispInt aPrecision);
LispObject* CosFloat(LispObject* int1, LispEnvironment& aEnvironment,LispInt aPrecision);
LispObject* TanFloat(LispObject* int1, LispEnvironment& aEnvironment,LispInt aPrecision);
LispObject* ArcSinFloat(LispObject* int1, LispEnvironment& aEnvironment,LispInt aPrecision);
LispObject* ExpFloat(LispObject* int1, LispEnvironment& aEnvironment,LispInt aPrecision);
LispObject* LnFloat(LispObject* int1, LispEnvironment& aEnvironment,LispInt aPrecision);
 
LispObject* SqrtFloat(LispObject* int1, LispEnvironment& aEnvironment,LispInt aPrecision);
LispObject* ModFloat( LispObject* int1, LispObject* int2, LispEnvironment& aEnvironment,
LispInt aPrecision);
 
LispObject* PowerFloat(LispObject* int1, LispObject* int2,
LispEnvironment& aEnvironment,LispInt aPrecision);
LispObject* ShiftLeft( LispObject* int1, LispObject* int2, LispEnvironment& aEnvironment,LispInt aPrecision);
LispObject* ShiftRight( LispObject* int1, LispObject* int2, LispEnvironment& aEnvironment,LispInt aPrecision);
LispObject* LispFactorial(LispObject* int1, LispEnvironment& aEnvironment,LispInt aPrecision);
 
 
 
// methods generally useful for all numeric libraries
const unsigned GUARD_BITS = 8; // we leave this many guard bits untruncated in various situations when we need to truncate precision by hand
 
template<class T> inline T MAX(T x, T y) { if (x<y) return y; else return x; }
template<class T> inline T MIN(T x, T y) { if (x>y) return y; else return x; }
 
const long DIST_BITS = 1; // at least this many bits of difference - used in precision tracking
 
/// DIST(x, y) returns 1 if abs(x-y) >= DIST_BITS. See documentation for precision tracking.
template<class T> inline T DIST(T x, T y) { return (x>=y+DIST_BITS || y>=x+DIST_BITS) ? 0 : 1; }
 
 
/** Base number class.
*/
 
class ANumber;
 
 
/// Main class for multiple-precision arithmetic.
/// All calculations are done at given precision. Integers grow as needed, floats don't grow beyond given precision.
class BigNumber : public YacasBase
{
public: //constructors
BigNumber(const LispChar * aString,LispInt aPrecision,LispInt aBase=10);
/// copy constructor
BigNumber(const BigNumber& aOther);
// no constructors from int or double to avoid automatic conversions
BigNumber(LispInt aPrecision = 20);
~BigNumber();
// assign from another number
void SetTo(const BigNumber& aOther);
// assign from string, precision in base digits
void SetTo(const LispChar * aString,LispInt aPrecision,LispInt aBase=10);
// assign from a platform type
void SetTo(long value);
inline void SetTo(LispInt value) { SetTo(long(value)); };
void SetTo(double value);
public: // Convert back to other types
/// ToString : return string representation of number in aResult to given precision (base digits)
void ToString(LispString& aResult, LispInt aPrecision, LispInt aBase=10) const;
/// Give approximate representation as a double number
double Double() const;
 
public://basic object manipulation
LispBoolean Equals(const BigNumber& aOther) const;
LispBoolean IsInt() const;
LispBoolean IsIntValue() const;
LispBoolean IsSmall() const;
void BecomeInt();
void BecomeFloat(LispInt aPrecision=0);
LispBoolean LessThan(const BigNumber& aOther) const;
public://arithmetic
/// Multiply two numbers at given precision and put result in *this
void Multiply(const BigNumber& aX, const BigNumber& aY, LispInt aPrecision);
/** Multiply two numbers, and add to *this (this is useful and generally efficient to implement).
* This is most likely going to be used by internal functions only, using aResult as an accumulator.
*/
void MultiplyAdd(const BigNumber& aX, const BigNumber& aY, LispInt aPrecision);
/// Add two numbers at given precision and return result in *this
void Add(const BigNumber& aX, const BigNumber& aY, LispInt aPrecision);
/// Negate the given number, return result in *this
void Negate(const BigNumber& aX);
/// Divide two numbers and return result in *this. Note: if the two arguments are integer, it should return an integer result!
void Divide(const BigNumber& aX, const BigNumber& aY, LispInt aPrecision);
 
/// integer operation: *this = y mod z
void Mod(const BigNumber& aY, const BigNumber& aZ);
 
/// For debugging purposes, dump internal state of this object into a string
void DumpDebugInfo();
 
public:
/// assign self to Floor(aX) if possible
void Floor(const BigNumber& aX);
/// set precision (in bits)
void Precision(LispInt aPrecision);
 
public:/// Bitwise operations, return result in *this.
void ShiftLeft( const BigNumber& aX, LispInt aNrToShift);
void ShiftRight( const BigNumber& aX, LispInt aNrToShift);
void BitAnd(const BigNumber& aX, const BigNumber& aY);
void BitOr(const BigNumber& aX, const BigNumber& aY);
void BitXor(const BigNumber& aX, const BigNumber& aY);
void BitNot(const BigNumber& aX);
/// Bit count operation: return the number of significant bits if integer, return the binary exponent if float (shortcut for binary logarithm)
/// give bit count as a platform integer
signed long BitCount() const;
/// Give sign (-1, 0, 1)
LispInt Sign() const;
 
public:
inline LispInt GetPrecision() const {return iPrecision;};
 
private:
BigNumber& operator=(const BigNumber& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
public:
ReferenceCount iReferenceCount;
private:
LispInt iPrecision;
 
public:
/// Internal library wrapper starts here.
inline void SetIsInteger(LispBoolean aIsInteger) {iType = (aIsInteger ? KInt : KFloat);}
enum ENumType
{
KInt = 0,
KFloat
};
ENumType iType;
ANumber* iNumber;
/// Internal library wrapper ends here.
};
 
/// bits_to_digits and digits_to_bits, utility functions
/// to convert the number of digits in some base (usually 10) to bits and back
 
// lookup table for Ln(n)/Ln(2). This works whether or not we have math.h.
// table range is from 2 to this value:
unsigned log2_table_range();
// convert the number of digits in given base to the number of bits, and back.
// need to round the number of digits.
// These functions only work for aBase inside the allowed table range.
unsigned long digits_to_bits(unsigned long aDigits, unsigned aBase);
unsigned long bits_to_digits(unsigned long abits, unsigned aBase);
 
 
#endif
 
 
 
 
 
 
 
 
 
 
 
 
 
/contrib/media/updf/include/numeric
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_NUMERIC
#include <bits/std_numeric.h>
#endif
/contrib/media/updf/include/opcode.h
0,0 → 1,144
/*
** opcode.h
** TeCGraf - PUC-Rio
** 16 Apr 92
*/
 
#ifndef opcode_h
#define opcode_h
 
#ifndef STACKGAP
#define STACKGAP 128
#endif
 
#ifndef real
#define real float
#endif
 
typedef unsigned char Byte;
 
typedef unsigned short Word;
 
typedef enum
{
NOP,
PUSHNIL,
PUSH0, PUSH1, PUSH2,
PUSHBYTE,
PUSHWORD,
PUSHFLOAT,
PUSHSTRING,
PUSHLOCAL0, PUSHLOCAL1, PUSHLOCAL2, PUSHLOCAL3, PUSHLOCAL4,
PUSHLOCAL5, PUSHLOCAL6, PUSHLOCAL7, PUSHLOCAL8, PUSHLOCAL9,
PUSHLOCAL,
PUSHGLOBAL,
PUSHINDEXED,
PUSHMARK,
PUSHOBJECT,
STORELOCAL0, STORELOCAL1, STORELOCAL2, STORELOCAL3, STORELOCAL4,
STORELOCAL5, STORELOCAL6, STORELOCAL7, STORELOCAL8, STORELOCAL9,
STORELOCAL,
STOREGLOBAL,
STOREINDEXED0,
STOREINDEXED,
STOREFIELD,
ADJUST,
CREATEARRAY,
EQOP,
LTOP,
LEOP,
ADDOP,
SUBOP,
MULTOP,
DIVOP,
CONCOP,
MINUSOP,
NOTOP,
ONTJMP,
ONFJMP,
JMP,
UPJMP,
IFFJMP,
IFFUPJMP,
POP,
CALLFUNC,
RETCODE,
HALT,
SETFUNCTION,
SETLINE,
RESET
} OpCode;
 
typedef enum
{
T_MARK,
T_NIL,
T_NUMBER,
T_STRING,
T_ARRAY,
T_FUNCTION,
T_CFUNCTION,
T_USERDATA
} Type;
 
typedef void (*Cfunction) (void);
typedef int (*Input) (void);
typedef void (*Unput) (int );
 
typedef union
{
Cfunction f;
real n;
char *s;
Byte *b;
struct Hash *a;
void *u;
} Value;
 
typedef struct Object
{
Type tag;
Value value;
} Object;
 
typedef struct
{
char *name;
Object object;
} Symbol;
 
/* Macros to access structure members */
#define tag(o) ((o)->tag)
#define nvalue(o) ((o)->value.n)
#define svalue(o) ((o)->value.s)
#define bvalue(o) ((o)->value.b)
#define avalue(o) ((o)->value.a)
#define fvalue(o) ((o)->value.f)
#define uvalue(o) ((o)->value.u)
 
/* Macros to access symbol table */
#define s_name(i) (lua_table[i].name)
#define s_object(i) (lua_table[i].object)
#define s_tag(i) (tag(&s_object(i)))
#define s_nvalue(i) (nvalue(&s_object(i)))
#define s_svalue(i) (svalue(&s_object(i)))
#define s_bvalue(i) (bvalue(&s_object(i)))
#define s_avalue(i) (avalue(&s_object(i)))
#define s_fvalue(i) (fvalue(&s_object(i)))
#define s_uvalue(i) (uvalue(&s_object(i)))
 
 
/* Exported functions */
int lua_execute (Byte *pc);
void lua_markstack (void);
char *lua_strdup (char *l);
 
void lua_setinput (Input fn); /* from "lua.lex" module */
void lua_setunput (Unput fn); /* from "lua.lex" module */
char *lua_lasttext (void); /* from "lua.lex" module */
int lua_parse (void); /* from "lua.stx" module */
void lua_type (void);
void lua_obj2number (void);
void lua_print (void);
 
#endif
/contrib/media/updf/include/openjpeg.h
0,0 → 1,915
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef OPENJPEG_H
#define OPENJPEG_H
 
 
/*
==========================================================
Compiler directives
==========================================================
*/
 
#if defined(OPJ_STATIC) || !defined(_WIN32)
#define OPJ_API
#define OPJ_CALLCONV
#else
#define OPJ_CALLCONV __stdcall
/*
The following ifdef block is the standard way of creating macros which make exporting
from a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS
symbol defined on the command line. this symbol should not be defined on any project
that uses this DLL. This way any other project whose source files include this file see
OPJ_API functions as being imported from a DLL, wheras this DLL sees symbols
defined with this macro as being exported.
*/
#if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)
#define OPJ_API __declspec(dllexport)
#else
#define OPJ_API __declspec(dllimport)
#endif /* OPJ_EXPORTS */
#endif /* !OPJ_STATIC || !_WIN32 */
 
#ifndef __cplusplus
#if defined(HAVE_STDBOOL_H)
/*
The C language implementation does correctly provide the standard header
file "stdbool.h".
*/
#include <stdbool.h>
#else
/*
The C language implementation does not provide the standard header file
"stdbool.h" as required by ISO/IEC 9899:1999. Try to compensate for this
braindamage below.
*/
#if !defined(bool)
#define bool int
#endif
#if !defined(true)
#define true 1
#endif
#if !defined(false)
#define false 0
#endif
#endif
#endif /* __cplusplus */
 
/*
==========================================================
Useful constant definitions
==========================================================
*/
 
#define OPJ_PATH_LEN 4096 /**< Maximum allowed size for filenames */
 
#define J2K_MAXRLVLS 33 /**< Number of maximum resolution level authorized */
#define J2K_MAXBANDS (3*J2K_MAXRLVLS-2) /**< Number of maximum sub-band linked to number of resolution level */
 
/* UniPG>> */
#define JPWL_MAX_NO_TILESPECS 16 /**< Maximum number of tile parts expected by JPWL: increase at your will */
#define JPWL_MAX_NO_PACKSPECS 16 /**< Maximum number of packet parts expected by JPWL: increase at your will */
#define JPWL_MAX_NO_MARKERS 512 /**< Maximum number of JPWL markers: increase at your will */
#define JPWL_PRIVATEINDEX_NAME "jpwl_index_privatefilename" /**< index file name used when JPWL is on */
#define JPWL_EXPECTED_COMPONENTS 3 /**< Expect this number of components, so you'll find better the first EPB */
#define JPWL_MAXIMUM_TILES 8192 /**< Expect this maximum number of tiles, to avoid some crashes */
#define JPWL_MAXIMUM_HAMMING 2 /**< Expect this maximum number of bit errors in marker id's */
#define JPWL_MAXIMUM_EPB_ROOM 65450 /**< Expect this maximum number of bytes for composition of EPBs */
/* <<UniPG */
 
/*
==========================================================
enum definitions
==========================================================
*/
/**
Rsiz Capabilities
*/
typedef enum RSIZ_CAPABILITIES {
STD_RSIZ = 0, /** Standard JPEG2000 profile*/
CINEMA2K = 3, /** Profile name for a 2K image*/
CINEMA4K = 4 /** Profile name for a 4K image*/
} OPJ_RSIZ_CAPABILITIES;
 
/**
Digital cinema operation mode
*/
typedef enum CINEMA_MODE {
OFF = 0, /** Not Digital Cinema*/
CINEMA2K_24 = 1, /** 2K Digital Cinema at 24 fps*/
CINEMA2K_48 = 2, /** 2K Digital Cinema at 48 fps*/
CINEMA4K_24 = 3 /** 4K Digital Cinema at 24 fps*/
}OPJ_CINEMA_MODE;
 
/**
Progression order
*/
typedef enum PROG_ORDER {
PROG_UNKNOWN = -1, /**< place-holder */
LRCP = 0, /**< layer-resolution-component-precinct order */
RLCP = 1, /**< resolution-layer-component-precinct order */
RPCL = 2, /**< resolution-precinct-component-layer order */
PCRL = 3, /**< precinct-component-resolution-layer order */
CPRL = 4 /**< component-precinct-resolution-layer order */
} OPJ_PROG_ORDER;
 
/**
Supported image color spaces
*/
typedef enum COLOR_SPACE {
CLRSPC_UNKNOWN = -1, /**< not supported by the library */
CLRSPC_UNSPECIFIED = 0, /**< not specified in the codestream */
CLRSPC_SRGB = 1, /**< sRGB */
CLRSPC_GRAY = 2, /**< grayscale */
CLRSPC_SYCC = 3 /**< YUV */
} OPJ_COLOR_SPACE;
 
/**
Supported codec
*/
typedef enum CODEC_FORMAT {
CODEC_UNKNOWN = -1, /**< place-holder */
CODEC_J2K = 0, /**< JPEG-2000 codestream : read/write */
CODEC_JPT = 1, /**< JPT-stream (JPEG 2000, JPIP) : read only */
CODEC_JP2 = 2 /**< JPEG-2000 file format : read/write */
} OPJ_CODEC_FORMAT;
 
/**
Limit decoding to certain portions of the codestream.
*/
typedef enum LIMIT_DECODING {
NO_LIMITATION = 0, /**< No limitation for the decoding. The entire codestream will de decoded */
LIMIT_TO_MAIN_HEADER = 1, /**< The decoding is limited to the Main Header */
DECODE_ALL_BUT_PACKETS = 2 /**< Decode everything except the JPEG 2000 packets */
} OPJ_LIMIT_DECODING;
 
/*
==========================================================
event manager typedef definitions
==========================================================
*/
 
/**
Callback function prototype for events
@param msg Event message
@param client_data
*/
typedef void (*opj_msg_callback) (const char *msg, void *client_data);
 
/**
Message handler object
used for
<ul>
<li>Error messages
<li>Warning messages
<li>Debugging messages
</ul>
*/
typedef struct opj_event_mgr {
/** Error message callback if available, NULL otherwise */
opj_msg_callback error_handler;
/** Warning message callback if available, NULL otherwise */
opj_msg_callback warning_handler;
/** Debug message callback if available, NULL otherwise */
opj_msg_callback info_handler;
} opj_event_mgr_t;
 
 
/*
==========================================================
codec typedef definitions
==========================================================
*/
 
/**
Progression order changes
*/
typedef struct opj_poc {
/** Resolution num start, Component num start, given by POC */
int resno0, compno0;
/** Layer num end,Resolution num end, Component num end, given by POC */
int layno1, resno1, compno1;
/** Layer num start,Precinct num start, Precinct num end */
int layno0, precno0, precno1;
/** Progression order enum*/
OPJ_PROG_ORDER prg1,prg;
/** Progression order string*/
char progorder[5];
/** Tile number */
int tile;
/** Start and end values for Tile width and height*/
int tx0,tx1,ty0,ty1;
/** Start value, initialised in pi_initialise_encode*/
int layS, resS, compS, prcS;
/** End value, initialised in pi_initialise_encode */
int layE, resE, compE, prcE;
/** Start and end values of Tile width and height, initialised in pi_initialise_encode*/
int txS,txE,tyS,tyE,dx,dy;
/** Temporary values for Tile parts, initialised in pi_create_encode */
int lay_t, res_t, comp_t, prc_t,tx0_t,ty0_t;
} opj_poc_t;
 
/**
Compression parameters
*/
typedef struct opj_cparameters {
/** size of tile: tile_size_on = false (not in argument) or = true (in argument) */
bool tile_size_on;
/** XTOsiz */
int cp_tx0;
/** YTOsiz */
int cp_ty0;
/** XTsiz */
int cp_tdx;
/** YTsiz */
int cp_tdy;
/** allocation by rate/distortion */
int cp_disto_alloc;
/** allocation by fixed layer */
int cp_fixed_alloc;
/** add fixed_quality */
int cp_fixed_quality;
/** fixed layer */
int *cp_matrice;
/** comment for coding */
char *cp_comment;
/** csty : coding style */
int csty;
/** progression order (default LRCP) */
OPJ_PROG_ORDER prog_order;
/** progression order changes */
opj_poc_t POC[32];
/** number of progression order changes (POC), default to 0 */
int numpocs;
/** number of layers */
int tcp_numlayers;
/** rates of layers */
float tcp_rates[100];
/** different psnr for successive layers */
float tcp_distoratio[100];
/** number of resolutions */
int numresolution;
/** initial code block width, default to 64 */
int cblockw_init;
/** initial code block height, default to 64 */
int cblockh_init;
/** mode switch (cblk_style) */
int mode;
/** 1 : use the irreversible DWT 9-7, 0 : use lossless compression (default) */
int irreversible;
/** region of interest: affected component in [0..3], -1 means no ROI */
int roi_compno;
/** region of interest: upshift value */
int roi_shift;
/* number of precinct size specifications */
int res_spec;
/** initial precinct width */
int prcw_init[J2K_MAXRLVLS];
/** initial precinct height */
int prch_init[J2K_MAXRLVLS];
 
/**@name command line encoder parameters (not used inside the library) */
/*@{*/
/** input file name */
char infile[OPJ_PATH_LEN];
/** output file name */
char outfile[OPJ_PATH_LEN];
/** DEPRECATED. Index generation is now handeld with the opj_encode_with_info() function. Set to NULL */
int index_on;
/** DEPRECATED. Index generation is now handeld with the opj_encode_with_info() function. Set to NULL */
char index[OPJ_PATH_LEN];
/** subimage encoding: origin image offset in x direction */
int image_offset_x0;
/** subimage encoding: origin image offset in y direction */
int image_offset_y0;
/** subsampling value for dx */
int subsampling_dx;
/** subsampling value for dy */
int subsampling_dy;
/** input file format 0: PGX, 1: PxM, 2: BMP 3:TIF*/
int decod_format;
/** output file format 0: J2K, 1: JP2, 2: JPT */
int cod_format;
/*@}*/
 
/* UniPG>> */
/**@name JPWL encoding parameters */
/*@{*/
/** enables writing of EPC in MH, thus activating JPWL */
bool jpwl_epc_on;
/** error protection method for MH (0,1,16,32,37-128) */
int jpwl_hprot_MH;
/** tile number of header protection specification (>=0) */
int jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS];
/** error protection methods for TPHs (0,1,16,32,37-128) */
int jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS];
/** tile number of packet protection specification (>=0) */
int jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS];
/** packet number of packet protection specification (>=0) */
int jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS];
/** error protection methods for packets (0,1,16,32,37-128) */
int jpwl_pprot[JPWL_MAX_NO_PACKSPECS];
/** enables writing of ESD, (0=no/1/2 bytes) */
int jpwl_sens_size;
/** sensitivity addressing size (0=auto/2/4 bytes) */
int jpwl_sens_addr;
/** sensitivity range (0-3) */
int jpwl_sens_range;
/** sensitivity method for MH (-1=no,0-7) */
int jpwl_sens_MH;
/** tile number of sensitivity specification (>=0) */
int jpwl_sens_TPH_tileno[JPWL_MAX_NO_TILESPECS];
/** sensitivity methods for TPHs (-1=no,0-7) */
int jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS];
/*@}*/
/* <<UniPG */
 
/** Digital Cinema compliance 0-not compliant, 1-compliant*/
OPJ_CINEMA_MODE cp_cinema;
/** Maximum rate for each component. If == 0, component size limitation is not considered */
int max_comp_size;
/** Profile name*/
OPJ_RSIZ_CAPABILITIES cp_rsiz;
/** Tile part generation*/
char tp_on;
/** Flag for Tile part generation*/
char tp_flag;
/** MCT (multiple component transform) */
char tcp_mct;
} opj_cparameters_t;
 
/**
Decompression parameters
*/
typedef struct opj_dparameters {
/**
Set the number of highest resolution levels to be discarded.
The image resolution is effectively divided by 2 to the power of the number of discarded levels.
The reduce factor is limited by the smallest total number of decomposition levels among tiles.
if != 0, then original dimension divided by 2^(reduce);
if == 0 or not used, image is decoded to the full resolution
*/
int cp_reduce;
/**
Set the maximum number of quality layers to decode.
If there are less quality layers than the specified number, all the quality layers are decoded.
if != 0, then only the first "layer" layers are decoded;
if == 0 or not used, all the quality layers are decoded
*/
int cp_layer;
 
/**@name command line encoder parameters (not used inside the library) */
/*@{*/
/** input file name */
char infile[OPJ_PATH_LEN];
/** output file name */
char outfile[OPJ_PATH_LEN];
/** input file format 0: J2K, 1: JP2, 2: JPT */
int decod_format;
/** output file format 0: PGX, 1: PxM, 2: BMP */
int cod_format;
/*@}*/
 
/* UniPG>> */
/**@name JPWL decoding parameters */
/*@{*/
/** activates the JPWL correction capabilities */
bool jpwl_correct;
/** expected number of components */
int jpwl_exp_comps;
/** maximum number of tiles */
int jpwl_max_tiles;
/*@}*/
/* <<UniPG */
 
/**
Specify whether the decoding should be done on the entire codestream, or be limited to the main header
Limiting the decoding to the main header makes it possible to extract the characteristics of the codestream
if == NO_LIMITATION, the entire codestream is decoded;
if == LIMIT_TO_MAIN_HEADER, only the main header is decoded;
*/
OPJ_LIMIT_DECODING cp_limit_decoding;
 
} opj_dparameters_t;
 
/** Common fields between JPEG-2000 compression and decompression master structs. */
 
#define opj_common_fields \
opj_event_mgr_t *event_mgr; /**< pointer to the event manager */\
void * client_data; /**< Available for use by application */\
bool is_decompressor; /**< So common code can tell which is which */\
OPJ_CODEC_FORMAT codec_format; /**< selected codec */\
void *j2k_handle; /**< pointer to the J2K codec */\
void *jp2_handle; /**< pointer to the JP2 codec */\
void *mj2_handle /**< pointer to the MJ2 codec */
/* Routines that are to be used by both halves of the library are declared
* to receive a pointer to this structure. There are no actual instances of
* opj_common_struct_t, only of opj_cinfo_t and opj_dinfo_t.
*/
typedef struct opj_common_struct {
opj_common_fields; /* Fields common to both master struct types */
/* Additional fields follow in an actual opj_cinfo_t or
* opj_dinfo_t. All three structs must agree on these
* initial fields! (This would be a lot cleaner in C++.)
*/
} opj_common_struct_t;
 
typedef opj_common_struct_t * opj_common_ptr;
 
/**
Compression context info
*/
typedef struct opj_cinfo {
/** Fields shared with opj_dinfo_t */
opj_common_fields;
/* other specific fields go here */
} opj_cinfo_t;
 
/**
Decompression context info
*/
typedef struct opj_dinfo {
/** Fields shared with opj_cinfo_t */
opj_common_fields;
/* other specific fields go here */
} opj_dinfo_t;
 
/*
==========================================================
I/O stream typedef definitions
==========================================================
*/
 
/*
* Stream open flags.
*/
/** The stream was opened for reading. */
#define OPJ_STREAM_READ 0x0001
/** The stream was opened for writing. */
#define OPJ_STREAM_WRITE 0x0002
 
/**
Byte input-output stream (CIO)
*/
typedef struct opj_cio {
/** codec context */
opj_common_ptr cinfo;
 
/** open mode (read/write) either OPJ_STREAM_READ or OPJ_STREAM_WRITE */
int openmode;
/** pointer to the start of the buffer */
unsigned char *buffer;
/** buffer size in bytes */
int length;
 
/** pointer to the start of the stream */
unsigned char *start;
/** pointer to the end of the stream */
unsigned char *end;
/** pointer to the current position */
unsigned char *bp;
} opj_cio_t;
 
/*
==========================================================
image typedef definitions
==========================================================
*/
 
/**
Defines a single image component
*/
typedef struct opj_image_comp {
/** XRsiz: horizontal separation of a sample of ith component with respect to the reference grid */
int dx;
/** YRsiz: vertical separation of a sample of ith component with respect to the reference grid */
int dy;
/** data width */
int w;
/** data height */
int h;
/** x component offset compared to the whole image */
int x0;
/** y component offset compared to the whole image */
int y0;
/** precision */
int prec;
/** image depth in bits */
int bpp;
/** signed (1) / unsigned (0) */
int sgnd;
/** number of decoded resolution */
int resno_decoded;
/** number of division by 2 of the out image compared to the original size of image */
int factor;
/** image component data */
int *data;
} opj_image_comp_t;
 
/**
Defines image data and characteristics
*/
typedef struct opj_image {
/** XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area */
int x0;
/** YOsiz: vertical offset from the origin of the reference grid to the top side of the image area */
int y0;
/** Xsiz: width of the reference grid */
int x1;
/** Ysiz: height of the reference grid */
int y1;
/** number of components in the image */
int numcomps;
/** color space: sRGB, Greyscale or YUV */
OPJ_COLOR_SPACE color_space;
/** image components */
opj_image_comp_t *comps;
/** 'restricted' ICC profile */
unsigned char *icc_profile_buf;
/** size of ICC profile */
int icc_profile_len;
} opj_image_t;
 
/**
Component parameters structure used by the opj_image_create function
*/
typedef struct opj_image_comptparm {
/** XRsiz: horizontal separation of a sample of ith component with respect to the reference grid */
int dx;
/** YRsiz: vertical separation of a sample of ith component with respect to the reference grid */
int dy;
/** data width */
int w;
/** data height */
int h;
/** x component offset compared to the whole image */
int x0;
/** y component offset compared to the whole image */
int y0;
/** precision */
int prec;
/** image depth in bits */
int bpp;
/** signed (1) / unsigned (0) */
int sgnd;
} opj_image_cmptparm_t;
 
/*
==========================================================
Information on the JPEG 2000 codestream
==========================================================
*/
 
/**
Index structure : Information concerning a packet inside tile
*/
typedef struct opj_packet_info {
/** packet start position (including SOP marker if it exists) */
int start_pos;
/** end of packet header position (including EPH marker if it exists)*/
int end_ph_pos;
/** packet end position */
int end_pos;
/** packet distorsion */
double disto;
} opj_packet_info_t;
 
/**
Index structure : Information concerning tile-parts
*/
typedef struct opj_tp_info {
/** start position of tile part */
int tp_start_pos;
/** end position of tile part header */
int tp_end_header;
/** end position of tile part */
int tp_end_pos;
/** start packet of tile part */
int tp_start_pack;
/** number of packets of tile part */
int tp_numpacks;
} opj_tp_info_t;
 
/**
Index structure : information regarding tiles
*/
typedef struct opj_tile_info {
/** value of thresh for each layer by tile cfr. Marcela */
double *thresh;
/** number of tile */
int tileno;
/** start position */
int start_pos;
/** end position of the header */
int end_header;
/** end position */
int end_pos;
/** precinct number for each resolution level (width) */
int pw[33];
/** precinct number for each resolution level (height) */
int ph[33];
/** precinct size (in power of 2), in X for each resolution level */
int pdx[33];
/** precinct size (in power of 2), in Y for each resolution level */
int pdy[33];
/** information concerning packets inside tile */
opj_packet_info_t *packet;
/** add fixed_quality */
int numpix;
/** add fixed_quality */
double distotile;
/** number of tile parts */
int num_tps;
/** information concerning tile parts */
opj_tp_info_t *tp;
} opj_tile_info_t;
 
/* UniPG>> */
/**
Marker structure
*/
typedef struct opj_marker_info_t {
/** marker type */
unsigned short int type;
/** position in codestream */
int pos;
/** length, marker val included */
int len;
} opj_marker_info_t;
/* <<UniPG */
 
/**
Index structure of the codestream
*/
typedef struct opj_codestream_info {
/** maximum distortion reduction on the whole image (add for Marcela) */
double D_max;
/** packet number */
int packno;
/** writing the packet in the index with t2_encode_packets */
int index_write;
/** image width */
int image_w;
/** image height */
int image_h;
/** progression order */
OPJ_PROG_ORDER prog;
/** tile size in x */
int tile_x;
/** tile size in y */
int tile_y;
/** */
int tile_Ox;
/** */
int tile_Oy;
/** number of tiles in X */
int tw;
/** number of tiles in Y */
int th;
/** component numbers */
int numcomps;
/** number of layer */
int numlayers;
/** number of decomposition for each component */
int *numdecompos;
/* UniPG>> */
/** number of markers */
int marknum;
/** list of markers */
opj_marker_info_t *marker;
/** actual size of markers array */
int maxmarknum;
/* <<UniPG */
/** main header position */
int main_head_start;
/** main header position */
int main_head_end;
/** codestream's size */
int codestream_size;
/** information regarding tiles inside image */
opj_tile_info_t *tile;
} opj_codestream_info_t;
 
#ifdef __cplusplus
extern "C" {
#endif
 
 
/*
==========================================================
openjpeg version
==========================================================
*/
 
OPJ_API const char * OPJ_CALLCONV opj_version(void);
 
/*
==========================================================
image functions definitions
==========================================================
*/
 
/**
Create an image
@param numcmpts number of components
@param cmptparms components parameters
@param clrspc image color space
@return returns a new image structure if successful, returns NULL otherwise
*/
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(int numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
 
/**
Deallocate any resources associated with an image
@param image image to be destroyed
*/
OPJ_API void OPJ_CALLCONV opj_image_destroy(opj_image_t *image);
 
/*
==========================================================
stream functions definitions
==========================================================
*/
 
/**
Open and allocate a memory stream for read / write.
On reading, the user must provide a buffer containing encoded data. The buffer will be
wrapped by the returned CIO handle.
On writing, buffer parameters must be set to 0: a buffer will be allocated by the library
to contain encoded data.
@param cinfo Codec context info
@param buffer Reading: buffer address. Writing: NULL
@param length Reading: buffer length. Writing: 0
@return Returns a CIO handle if successful, returns NULL otherwise
*/
OPJ_API opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length);
 
/**
Close and free a CIO handle
@param cio CIO handle to free
*/
OPJ_API void OPJ_CALLCONV opj_cio_close(opj_cio_t *cio);
 
/**
Get position in byte stream
@param cio CIO handle
@return Returns the position in bytes
*/
OPJ_API int OPJ_CALLCONV cio_tell(opj_cio_t *cio);
/**
Set position in byte stream
@param cio CIO handle
@param pos Position, in number of bytes, from the beginning of the stream
*/
OPJ_API void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos);
 
/*
==========================================================
event manager functions definitions
==========================================================
*/
 
OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context);
 
/*
==========================================================
codec functions definitions
==========================================================
*/
/**
Creates a J2K/JPT/JP2 decompression structure
@param format Decoder to select
@return Returns a handle to a decompressor if successful, returns NULL otherwise
*/
OPJ_API opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format);
/**
Destroy a decompressor handle
@param dinfo decompressor handle to destroy
*/
OPJ_API void OPJ_CALLCONV opj_destroy_decompress(opj_dinfo_t *dinfo);
/**
Set decoding parameters to default values
@param parameters Decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters);
/**
Setup the decoder decoding parameters using user parameters.
Decoding parameters are returned in j2k->cp.
@param dinfo decompressor handle
@param parameters decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters);
/**
Decode an image from a JPEG-2000 codestream
@param dinfo decompressor handle
@param cio Input buffer stream
@return Returns a decoded image if successful, returns NULL otherwise
*/
OPJ_API opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio);
 
/**
Decode an image from a JPEG-2000 codestream and extract the codestream information
@param dinfo decompressor handle
@param cio Input buffer stream
@param cstr_info Codestream information structure if needed afterwards, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
OPJ_API opj_image_t* OPJ_CALLCONV opj_decode_with_info(opj_dinfo_t *dinfo, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
/**
Creates a J2K/JP2 compression structure
@param format Coder to select
@return Returns a handle to a compressor if successful, returns NULL otherwise
*/
OPJ_API opj_cinfo_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format);
/**
Destroy a compressor handle
@param cinfo compressor handle to destroy
*/
OPJ_API void OPJ_CALLCONV opj_destroy_compress(opj_cinfo_t *cinfo);
/**
Set encoding parameters to default values, that means :
<ul>
<li>Lossless
<li>1 tile
<li>Size of precinct : 2^15 x 2^15 (means 1 precinct)
<li>Size of code-block : 64 x 64
<li>Number of resolutions: 6
<li>No SOP marker in the codestream
<li>No EPH marker in the codestream
<li>No sub-sampling in x or y direction
<li>No mode switch activated
<li>Progression order: LRCP
<li>No index file
<li>No ROI upshifted
<li>No offset of the origin of the image
<li>No offset of the origin of the tiles
<li>Reversible DWT 5-3
</ul>
@param parameters Compression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters);
/**
Setup the encoder parameters using the current image and using user parameters.
@param cinfo Compressor handle
@param parameters Compression parameters
@param image Input filled image
*/
OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image);
/**
Encode an image into a JPEG-2000 codestream
@param cinfo compressor handle
@param cio Output buffer stream
@param image Image to encode
@param index Depreacted -> Set to NULL. To extract index, used opj_encode_wci()
@return Returns true if successful, returns false otherwise
*/
OPJ_API bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, char *index);
/**
Encode an image into a JPEG-2000 codestream and extract the codestream information
@param cinfo compressor handle
@param cio Output buffer stream
@param image Image to encode
@param cstr_info Codestream information structure if needed afterwards, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
OPJ_API bool OPJ_CALLCONV opj_encode_with_info(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
/**
Destroy Codestream information after compression or decompression
@param cstr_info Codestream information structure
*/
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_t *cstr_info);
 
#ifdef __cplusplus
}
#endif
 
#endif /* OPENJPEG_H */
/contrib/media/updf/include/opj_includes.h
0,0 → 1,136
/*
* Copyright (c) 2005, Hervé Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef OPJ_INCLUDES_H
#define OPJ_INCLUDES_H
 
/*
==========================================================
Standard includes used by the library
==========================================================
*/
#include <memory.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <time.h>
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
 
/*
==========================================================
OpenJPEG interface
==========================================================
*/
#include "openjpeg.h"
 
/*
==========================================================
OpenJPEG modules
==========================================================
*/
 
/* Ignore GCC attributes if this is not GCC */
#ifndef __GNUC__
#define __attribute__(x) /* __attribute__(x) */
#endif
 
/*
The inline keyword is supported by C99 but not by C90.
Most compilers implement their own version of this keyword ...
*/
#ifndef INLINE
#if defined(_MSC_VER)
#define INLINE __forceinline
#elif defined(__GNUC__)
#define INLINE __inline__
#elif defined(__MWERKS__)
#define INLINE inline
#else
/* add other compilers here ... */
#define INLINE
#endif /* defined(<Compiler>) */
#endif /* INLINE */
 
/* Are restricted pointers available? (C99) */
#if (__STDC_VERSION__ != 199901L)
/* Not a C99 compiler */
#ifdef __GNUC__
#define restrict __restrict__
#else
#define restrict /* restrict */
#endif
#endif
 
/* MSVC and Borland C do not have lrintf */
#if defined(_MSC_VER) || defined(__BORLANDC__)
static INLINE long lrintf(float f){
#ifdef _M_X64
return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f));
#else
int i;
_asm{
fld f
fistp i
};
return i;
#endif
}
#endif
 
#include "j2k_lib.h"
#include "opj_malloc.h"
#include "event.h"
#include "cio.h"
 
#include "image.h"
#include "j2k.h"
#include "jp2.h"
#include "jpt.h"
 
#include "mqc.h"
#include "raw.h"
#include "bio.h"
#include "tgt.h"
#include "pi.h"
#include "tcd.h"
#include "t1.h"
#include "dwt.h"
#include "t2.h"
#include "mct.h"
#include "int.h"
#include "fix.h"
 
/* JPWL>> */
#ifdef USE_JPWL
#include "../jpwl/jpwl.h"
#endif /* USE_JPWL */
/* <<JPWL */
 
#endif /* OPJ_INCLUDES_H */
/contrib/media/updf/include/opj_malloc.h
0,0 → 1,163
/*
* Copyright (c) 2005, Hervé Drolon, FreeImage Team
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __OPJ_MALLOC_H
#define __OPJ_MALLOC_H
/**
@file opj_malloc.h
@brief Internal functions
 
The functions in opj_malloc.h are internal utilities used for memory management.
*/
 
/** @defgroup MISC MISC - Miscellaneous internal functions */
/*@{*/
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
 
/**
Allocate an uninitialized memory block
@param size Bytes to allocate
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
*/
#ifdef ALLOC_PERF_OPT
void * OPJ_CALLCONV opj_malloc(size_t size);
#else
#define opj_malloc(size) malloc(size)
#endif
 
/**
Allocate a memory block with elements initialized to 0
@param num Blocks to allocate
@param size Bytes per block to allocate
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
*/
#ifdef ALLOC_PERF_OPT
void * OPJ_CALLCONV opj_calloc(size_t _NumOfElements, size_t _SizeOfElements);
#else
#define opj_calloc(num, size) calloc(num, size)
#endif
 
/**
Allocate memory aligned to a 16 byte boundry
@param size Bytes to allocate
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
*/
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */
#ifdef _WIN32
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */
#ifdef __GNUC__
#include <mm_malloc.h>
#define HAVE_MM_MALLOC
#else /* MSVC, Intel C++ */
#include <malloc.h>
#ifdef _mm_malloc
#define HAVE_MM_MALLOC
#endif
#endif
#else /* Not _WIN32 */
#if defined(__sun)
#define HAVE_MEMALIGN
/* Linux x86_64 and OSX always align allocations to 16 bytes */
#elif !defined(__amd64__) && !defined(__APPLE__)
#define HAVE_MEMALIGN
#include <malloc.h>
#endif
#endif
 
#define opj_aligned_malloc(size) malloc(size)
#define opj_aligned_free(m) free(m)
 
#ifdef HAVE_MM_MALLOC
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) _mm_malloc(size, 16)
#undef opj_aligned_free
#define opj_aligned_free(m) _mm_free(m)
#endif
 
#ifdef HAVE_MEMALIGN
extern void* memalign(size_t, size_t);
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) memalign(16, (size))
#undef opj_aligned_free
#define opj_aligned_free(m) free(m)
#endif
 
#ifdef HAVE_POSIX_MEMALIGN
#undef opj_aligned_malloc
extern int posix_memalign(void**, size_t, size_t);
 
static INLINE void* __attribute__ ((malloc)) opj_aligned_malloc(size_t size){
void* mem = NULL;
posix_memalign(&mem, 16, size);
return mem;
}
#undef opj_aligned_free
#define opj_aligned_free(m) free(m)
#endif
 
#ifdef ALLOC_PERF_OPT
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) opj_malloc(size)
#undef opj_aligned_free
#define opj_aligned_free(m) opj_free(m)
#endif
 
/**
Reallocate memory blocks.
@param m Pointer to previously allocated memory block
@param s New size in bytes
@return Returns a void pointer to the reallocated (and possibly moved) memory block
*/
#ifdef ALLOC_PERF_OPT
void * OPJ_CALLCONV opj_realloc(void * m, size_t s);
#else
#define opj_realloc(m, s) realloc(m, s)
#endif
 
/**
Deallocates or frees a memory block.
@param m Previously allocated memory block to be freed
*/
#ifdef ALLOC_PERF_OPT
void OPJ_CALLCONV opj_free(void * m);
#else
#define opj_free(m) free(m)
#endif
 
#ifdef __GNUC__
#pragma GCC poison malloc calloc realloc free
#endif
 
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __OPJ_MALLOC_H */
 
/contrib/media/updf/include/os_layer/os_layer.h
0,0 → 1,122
#ifndef __OS_LAYER_OS_LAYER_H
#define __OS_LAYER_OS_LAYER_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include<menuet/os.h>
#include<stdio.h>
#include<stdlib.h>
 
#define __FSEMU_FLAG_USED 0x00000001
#define __FSEMU_FLAG_DIRECTORY 0x00000002
#define __FSEMU_FLAG_DEVICE 0x00000004
#define __FSEMU_FLAG_READ 0x00000008
#define __FSEMU_FLAG_WRITE 0x00000010
#define __FSEMU_FLAG_SEEK 0x00000020
#define __FSEMU_FLAG_STDIO 0x00000040
 
#define __FSF(x) __FSEMU_FLAG_##x
 
#define T_FSF(x,f) ((x)&__FSF(f))
 
#define __FSEMU_BLOCK_SIZE 512
 
struct __fsemu_io_t;
 
typedef struct
{
int (* putc)(int dev,int c);
int (* getc)(int dev,int * c);
int (* read)(struct __fsemu_io_t *,int blkno,int blkcount,char *);
int (* write)(struct __fsemu_io_t *,int blkno,int blkcount,char *);
} __fsemu_stdio_t;
 
typedef struct __fsemu_io_t
{
char * filename;
char * filebuffer;
int handle;
int pos;
int size;
int flags;
char * systree_buf;
struct systree_info * st_info;
__fsemu_stdio_t * special_ops;
} __fsemu_io_t;
 
#define __FSEMU_MAX_FILES 64
 
extern __fsemu_stdio_t __fsemu_stdin_ops,
__fsemu_stdout_ops,
__fsemu_stderr_ops,
__fsemu_stdprn_ops,
__fsemu_stdaux_ops;
#define __FSEMU_f_STDIN { "stdin",NULL,0,0,0,__FSF(USED)|__FSF(READ) \
|__FSF(DEVICE)|__FSF(STDIO), NULL,NULL,&__fsemu_stdin_ops }
#define __FSEMU_f_STDOUT { "stdout",NULL,1,0,0,__FSF(USED)|__FSF(WRITE) \
|__FSF(DEVICE)|__FSF(STDIO), NULL,NULL,&__fsemu_stdout_ops }
#define __FSEMU_f_STDERR { "stderr",NULL,2,0,0,__FSF(USED)|__FSF(WRITE) \
|__FSF(DEVICE)|__FSF(STDIO), NULL,NULL,&__fsemu_stderr_ops }
#define __FSEMU_f_STDPRN { "stdprn",NULL,3,0,0,__FSF(USED)|__FSF(WRITE) \
|__FSF(DEVICE)|__FSF(STDIO), NULL,NULL,&__fsemu_stdprn_ops }
#define __FSEMU_f_STDAUX { "stdaux",NULL,4,0,0,__FSF(USED)|__FSF(WRITE) \
|__FSF(DEVICE)|__FSF(STDIO)|__FSF(READ), NULL,NULL,&__fsemu_stdaux_ops }
 
#define __FSEMU_STDIO_DECLS \
static __fsemu_io_t __fsemu_io_stdin=__FSEMU_f_STDIN; \
static __fsemu_io_t __fsemu_io_stdout=__FSEMU_f_STDOUT; \
static __fsemu_io_t __fsemu_io_stderr=__FSEMU_f_STDERR; \
static __fsemu_io_t __fsemu_io_stdprn=__FSEMU_f_STDPRN; \
static __fsemu_io_t __fsemu_io_stdaux=__FSEMU_f_STDAUX;
 
#define __FSEMU_STDIO_TABLE_DECLS \
&__fsemu_io_stdin, \
&__fsemu_io_stdout, \
&__fsemu_io_stderr, \
&__fsemu_io_stdprn, \
&__fsemu_io_stdaux
 
 
extern __fsemu_stdio_t __fsemu_rd1_ops,
__fsemu_hd1_ops,
__fsemu_hd2_ops,
__fsemu_hd3_ops,
__fsemu_hd4_ops;
 
#define __FSEMU_f_RD1 { "/RD/1",NULL,5,0,0,__FSF(USED)|__FSF(READ)| \
__FSF(WRITE)|__FSF(DEVICE),NULL,NULL,&__fsemu_rd1_ops }
#define __FSEMU_f_HD1 { "/HD/1",NULL,6,0,0,__FSF(USED)|__FSF(READ)| \
__FSF(DEVICE),NULL,NULL,&__fsemu_hd1_ops }
#define __FSEMU_f_HD2 { "/HD/2",NULL,7,0,0,__FSF(USED)|__FSF(READ)| \
__FSF(DEVICE),NULL,NULL,&__fsemu_hd2_ops }
#define __FSEMU_f_HD3 { "/HD/3",NULL,8,0,0,__FSF(USED)|__FSF(READ)| \
__FSF(DEVICE),NULL,NULL,&__fsemu_hd3_ops }
#define __FSEMU_f_HD4 { "/HD/4",NULL,9,0,0,__FSF(USED)|__FSF(READ)| \
__FSF(DEVICE),NULL,NULL,&__fsemu_hd4_ops }
#define __FSEMU_DEV_DECLS \
static __fsemu_io_t __fsemu_io_rd1=__FSEMU_f_RD1; \
static __fsemu_io_t __fsemu_io_hd1=__FSEMU_f_HD1; \
static __fsemu_io_t __fsemu_io_hd2=__FSEMU_f_HD2; \
static __fsemu_io_t __fsemu_io_hd3=__FSEMU_f_HD3; \
static __fsemu_io_t __fsemu_io_hd4=__FSEMU_f_HD4;
 
#define __FSEMU_DEV_TABLE_DECLS \
&__fsemu_io_rd1, \
&__fsemu_io_hd1, \
&__fsemu_io_hd2, \
&__fsemu_io_hd3, \
&__fsemu_io_hd4
#define __F_READABLE(x) T_FSF(x,READ)
#define __F_WRITABLE(x) T_FSF(x,WRITE)
#define __F_SEEKABLE(x) T_FSF(x,SEEK)
 
#ifdef __cplusplus
}
#endif
#endif
/contrib/media/updf/include/os_layer/queue.h
0,0 → 1,44
#ifndef __QUEUE_H
#define __QUEUE_H
 
#include<menuet/os.h>
#include<menuet/sem.h>
 
typedef struct
{
int in_ptr,out_ptr,size;
unsigned char * databuf;
DECLARE_SEMAPHORE_S(q_lock);
} __oe_queue_t;
 
#define DECL_EMPTY_Q(n,sz,buf) __oe_queue_t n = {0,0,sz,buf,SEM_INIT}
 
#define __OE_QUEUE_INQ(x,c) \
({ \
register int __ret,temp; \
sem_lock(&(x)->q_lock); \
temp=(x)->in_ptr+1; \
if(temp>=(x)->size) temp=0; \
if(temp==(x)->out_ptr) { __ret=-1; goto __OEQI_D; } \
(x)->databuf[(x)->in_ptr]=(c)&0xFF; \
(x)->in_ptr=temp; \
__ret=0; \
__OEQI_D: \
sem_unlock(&(x)->q_lock); \
__ret; })
#define __OE_QUEUE_DEQ(x,c) \
({ \
register int __ret; \
register unsigned char __tmp; \
sem_lock(&(x)->q_lock); \
if((x)->out_ptr==(x)->in_ptr) { __ret=-1; goto __OEQD_D; } \
__tmp=(x)->databuf[(x)->out_ptr++]; \
if((x)->out_ptr>=(x)->size) (x)->out_ptr=0; \
__ret=0; \
(c)=__tmp; \
__OEQD_D: \
sem_unlock(&(x)->q_lock); \
__ret; })
#endif
/contrib/media/updf/include/osfcn.h
0,0 → 1,30
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_osfcn_h_
#define __dj_include_osfcn_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <unistd.h>
#include <time.h>
#include <sys/resource.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_osfcn_h_ */
/contrib/media/updf/include/ostream
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_OSTREAM
#include <bits/std_ostream.h>
#endif
/contrib/media/updf/include/panel.h
0,0 → 1,65
/*
***************************************************************************
* This file comprises part of PDCurses. PDCurses is Public Domain software.
* You may use this code for whatever purposes you desire. This software
* is provided AS IS with NO WARRANTY whatsoever.
* Should this software be used in another application, an acknowledgement
* that PDCurses code is used would be appreciated, but is not mandatory.
*
* Any changes which you make to this software which may improve or enhance
* it, should be forwarded to the current maintainer for the benefit of
* other users.
*
* The only restriction placed on this code is that no distribution of
* modified PDCurses code be made under the PDCurses name, by anyone
* other than the current maintainer.
*
* See the file maintain.er for details of the current maintainer.
***************************************************************************
*/
/*
$Id
*/
/*
*----------------------------------------------------------------------
* Panels for PDCurses
*----------------------------------------------------------------------
*/
 
#include <curses.h>
 
typedef struct panelobs
{
struct panelobs *above;
struct panel *pan;
} PANELOBS;
 
typedef struct panel
{
WINDOW *win;
int wstarty;
int wendy;
int wstartx;
int wendx;
struct panel *below;
struct panel *above;
char *user;
struct panelobs *obscure;
} PANEL;
 
WINDOW *panel_window(PANEL *pan);
void update_panels(void );
int hide_panel(PANEL *pan);
int show_panel(PANEL *pan);
int del_panel(PANEL *pan);
int top_panel(PANEL *pan);
int bottom_panel(PANEL *pan);
PANEL *new_panel(WINDOW *win);
PANEL *panel_above(PANEL *pan);
PANEL *panel_below(PANEL *pan);
int set_panel_userptr(PANEL *pan,char *uptr);
char *panel_userptr(PANEL *pan);
int move_panel(PANEL *pan,int starty,int startx);
int replace_panel(PANEL *pan,WINDOW *win);
 
/* end of panel.h */
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/media/updf/include/parametrized.h
0,0 → 1,609
/*
* parametrized.h --- is a termcap capability parametrized?
*
* Note: this file is generated using parametrized.sh, do not edit by hand.
* A value of -1 in the table means suppress both pad and % translations.
* A value of 0 in the table means do pad but not % translations.
* A value of 1 in the table means do both pad and % translations.
*/
 
static short const parametrized[] = {
0, /* cbt */
0, /* bel */
0, /* cr */
1, /* csr */
0, /* tbc */
0, /* clear */
0, /* el */
0, /* ed */
1, /* hpa */
0, /* cmdch */
1, /* cup */
0, /* cud1 */
0, /* home */
0, /* civis */
0, /* cub1 */
0, /* mrcup */
0, /* cnorm */
0, /* cuf1 */
0, /* ll */
0, /* cuu1 */
0, /* cvvis */
0, /* dch1 */
0, /* dl1 */
0, /* dsl */
0, /* hd */
0, /* smacs */
0, /* blink */
0, /* bold */
0, /* smcup */
0, /* smdc */
0, /* dim */
0, /* smir */
0, /* invis */
0, /* prot */
0, /* rev */
0, /* smso */
0, /* smul */
1, /* ech */
0, /* rmacs */
0, /* sgr0 */
0, /* rmcup */
0, /* rmdc */
0, /* rmir */
0, /* rmso */
0, /* rmul */
0, /* flash */
0, /* ff */
0, /* fsl */
0, /* is1 */
0, /* is2 */
0, /* is3 */
0, /* if */
0, /* ich1 */
0, /* il1 */
0, /* ip */
0, /* kbs */
0, /* ktbc */
0, /* kclr */
0, /* kctab */
0, /* kdch1 */
0, /* kdl1 */
0, /* kcud1 */
0, /* krmir */
0, /* kel */
0, /* ked */
0, /* kf0 */
0, /* kf1 */
0, /* kf10 */
0, /* kf2 */
0, /* kf3 */
0, /* kf4 */
0, /* kf5 */
0, /* kf6 */
0, /* kf7 */
0, /* kf8 */
0, /* kf9 */
0, /* khome */
0, /* kich1 */
0, /* kil1 */
0, /* kcub1 */
0, /* kll */
0, /* knp */
0, /* kpp */
0, /* kcuf1 */
0, /* kind */
0, /* kri */
0, /* khts */
0, /* kcuu1 */
0, /* rmkx */
0, /* smkx */
0, /* lf0 */
0, /* lf1 */
0, /* lf10 */
0, /* lf2 */
0, /* lf3 */
0, /* lf4 */
0, /* lf5 */
0, /* lf6 */
0, /* lf7 */
0, /* lf8 */
0, /* lf9 */
0, /* rmm */
0, /* smm */
0, /* nel */
0, /* pad */
1, /* dch */
1, /* dl */
1, /* cud */
1, /* ich */
1, /* indn */
1, /* il */
1, /* cub */
1, /* cuf */
1, /* rin */
1, /* cuu */
1, /* pfkey */
1, /* pfloc */
1, /* pfx */
0, /* mc0 */
0, /* mc4 */
0, /* mc5 */
1, /* rep */
0, /* rs1 */
0, /* rs2 */
0, /* rs3 */
0, /* rf */
0, /* rc */
1, /* vpa */
0, /* sc */
0, /* ind */
0, /* ri */
1, /* sgr */
0, /* hts */
1, /* wind */
0, /* ht */
0, /* tsl */
0, /* uc */
0, /* hu */
0, /* iprog */
0, /* ka1 */
0, /* ka3 */
0, /* kb2 */
0, /* kc1 */
0, /* kc3 */
1, /* mc5p */
0, /* rmp */
-1, /* acsc */
1, /* pln */
0, /* kcbt */
0, /* smxon */
0, /* rmxon */
0, /* smam */
0, /* rmam */
0, /* xonc */
0, /* xoffc */
0, /* enacs */
0, /* smln */
0, /* rmln */
0, /* kbeg */
0, /* kcan */
0, /* kclo */
0, /* kcmd */
0, /* kcpy */
0, /* kcrt */
0, /* kend */
0, /* kent */
0, /* kext */
0, /* kfnd */
0, /* khlp */
0, /* kmrk */
0, /* kmsg */
0, /* kmov */
0, /* knxt */
0, /* kopn */
0, /* kopt */
0, /* kprv */
0, /* kprt */
0, /* krdo */
0, /* kref */
0, /* krfr */
0, /* krpl */
0, /* krst */
0, /* kres */
0, /* ksav */
0, /* kspd */
0, /* kund */
0, /* kBEG */
0, /* kCAN */
0, /* kCMD */
0, /* kCPY */
0, /* kCRT */
0, /* kDC */
0, /* kDL */
0, /* kslt */
0, /* kEND */
0, /* kEOL */
0, /* kEXT */
0, /* kFND */
1, /* kHLP */
1, /* kHOM */
1, /* kIC */
1, /* kLFT */
0, /* kMSG */
0, /* kMOV */
0, /* kNXT */
0, /* kOPT */
0, /* kPRV */
0, /* kPRT */
0, /* kRDO */
0, /* kRPL */
0, /* kRIT */
0, /* kRES */
0, /* kSAV */
0, /* kSPD */
0, /* kUND */
0, /* rfi */
0, /* kf11 */
0, /* kf12 */
0, /* kf13 */
0, /* kf14 */
0, /* kf15 */
0, /* kf16 */
0, /* kf17 */
0, /* kf18 */
0, /* kf19 */
0, /* kf20 */
0, /* kf21 */
0, /* kf22 */
0, /* kf23 */
0, /* kf24 */
0, /* kf25 */
0, /* kf26 */
0, /* kf27 */
0, /* kf28 */
0, /* kf29 */
0, /* kf30 */
0, /* kf31 */
0, /* kf32 */
0, /* kf33 */
0, /* kf34 */
0, /* kf35 */
0, /* kf36 */
0, /* kf37 */
0, /* kf38 */
0, /* kf39 */
0, /* kf40 */
0, /* kf41 */
0, /* kf42 */
0, /* kf43 */
0, /* kf44 */
0, /* kf45 */
0, /* kf46 */
0, /* kf47 */
0, /* kf48 */
0, /* kf49 */
0, /* kf50 */
0, /* kf51 */
0, /* kf52 */
0, /* kf53 */
0, /* kf54 */
0, /* kf55 */
0, /* kf56 */
0, /* kf57 */
0, /* kf58 */
0, /* kf59 */
0, /* kf60 */
0, /* kf61 */
0, /* kf62 */
0, /* kf63 */
0, /* el1 */
0, /* mgc */
0, /* smgl */
0, /* smgr */
0, /* fln */
1, /* sclk */
1, /* dclk */
0, /* rmclk */
1, /* cwin */
1, /* wingo */
0, /* hup */
1, /* dial */
1, /* qdial */
0, /* tone */
0, /* pulse */
0, /* hook */
0, /* pause */
0, /* wait */
1, /* u0 */
1, /* u1 */
1, /* u2 */
1, /* u3 */
1, /* u4 */
1, /* u5 */
1, /* u6 */
1, /* u7 */
1, /* u8 */
1, /* u9 */
0, /* op */
0, /* oc */
1, /* initc */
1, /* initp */
1, /* scp */
1, /* setf */
1, /* setb */
0, /* cpi */
0, /* lpi */
0, /* chr */
0, /* cvr */
0, /* defc */
0, /* swidm */
0, /* sdrfq */
0, /* sitm */
0, /* slm */
0, /* smicm */
0, /* snlq */
0, /* snrmq */
0, /* sshm */
0, /* ssubm */
0, /* ssupm */
0, /* sum */
0, /* rwidm */
0, /* ritm */
0, /* rlm */
0, /* rmicm */
0, /* rshm */
0, /* rsubm */
0, /* rsupm */
0, /* rum */
0, /* mhpa */
0, /* mcud1 */
0, /* mcub1 */
0, /* mcuf1 */
0, /* mvpa */
0, /* mcuu1 */
0, /* porder */
0, /* mcud */
0, /* mcub */
0, /* mcuf */
0, /* mcuu */
0, /* scs */
0, /* smgb */
1, /* smgbp */
1, /* smglp */
1, /* smgrp */
0, /* smgt */
1, /* smgtp */
0, /* sbim */
0, /* scsd */
0, /* rbim */
0, /* rcsd */
0, /* subcs */
0, /* supcs */
0, /* docr */
0, /* zerom */
0, /* csnm */
0, /* kmous */
0, /* minfo */
0, /* reqmp */
0, /* getm */
0, /* setaf */
0, /* setab */
1, /* pfxl */
0, /* devt */
0, /* csin */
0, /* s0ds */
0, /* s1ds */
0, /* s2ds */
0, /* s3ds */
1, /* smglr */
1, /* smgtb */
1, /* birep */
0, /* binel */
0, /* bicr */
1, /* colornm */
0, /* defbi */
0, /* endbi */
1, /* setcolor */
1, /* slines */
0, /* dispc */
0, /* smpch */
0, /* rmpch */
0, /* smsc */
0, /* rmsc */
0, /* pctrm */
0, /* scesc */
0, /* scesa */
0, /* ehhlm */
0, /* elhlm */
0, /* elohlm */
0, /* erhlm */
0, /* ethlm */
0, /* evhlm */
0, /* OTi2 */
0, /* OTrs */
0, /* OTnl */
0, /* OTbc */
0, /* OTko */
0, /* OTma */
-1, /* OTG2 */
-1, /* OTG3 */
-1, /* OTG1 */
-1, /* OTG4 */
-1, /* OTGR */
-1, /* OTGL */
-1, /* OTGU */
-1, /* OTGD */
-1, /* OTGH */
-1, /* OTGV */
-1, /* OTGC */
0, /* meml */
0, /* memu */
1, /* pln */
0, /* smln */
0, /* rmln */
0, /* kf11 */
0, /* kf12 */
0, /* kf13 */
0, /* kf14 */
0, /* kf15 */
0, /* kf16 */
0, /* kf17 */
0, /* kf18 */
0, /* kf19 */
0, /* kf20 */
0, /* kf21 */
0, /* kf22 */
0, /* kf23 */
0, /* kf24 */
0, /* kf25 */
0, /* kf26 */
0, /* kf27 */
0, /* kf28 */
0, /* kf29 */
0, /* kf30 */
0, /* kf31 */
0, /* kf32 */
0, /* kf33 */
0, /* kf34 */
0, /* kf35 */
0, /* kf36 */
0, /* kf37 */
0, /* kf38 */
0, /* kf39 */
0, /* kf40 */
0, /* kf41 */
0, /* kf42 */
0, /* kf43 */
0, /* kf44 */
0, /* kf45 */
0, /* kf46 */
0, /* kf47 */
0, /* kf48 */
0, /* kf49 */
0, /* kf50 */
0, /* kf51 */
0, /* kf52 */
0, /* kf53 */
0, /* kf54 */
0, /* kf55 */
0, /* kf56 */
0, /* kf57 */
0, /* kf58 */
0, /* kf59 */
0, /* kf60 */
0, /* kf61 */
0, /* kf62 */
0, /* kf63 */
0, /* box1 */
0, /* box2 */
0, /* batt1 */
0, /* batt2 */
0, /* colb0 */
0, /* colb1 */
0, /* colb2 */
0, /* colb3 */
0, /* colb4 */
0, /* colb5 */
0, /* colb6 */
0, /* colb7 */
0, /* colf0 */
0, /* colf1 */
0, /* colf2 */
0, /* colf3 */
0, /* colf4 */
0, /* colf5 */
0, /* colf6 */
0, /* colf7 */
0, /* font0 */
0, /* font1 */
0, /* font2 */
0, /* font3 */
0, /* font4 */
0, /* font5 */
0, /* font6 */
0, /* font7 */
0, /* kbtab */
0, /* kdo */
0, /* kcmd */
0, /* kcpn */
0, /* kend */
0, /* khlp */
0, /* knl */
0, /* knpn */
0, /* kppn */
0, /* kppn */
0, /* kquit */
0, /* ksel */
0, /* kscl */
0, /* kscr */
0, /* ktab */
0, /* kmpf1 */
0, /* kmpt1 */
0, /* kmpf2 */
0, /* kmpt2 */
0, /* kmpf3 */
0, /* kmpt3 */
0, /* kmpf4 */
0, /* kmpt4 */
0, /* kmpf5 */
0, /* kmpt5 */
0, /* apstr */
0, /* kmpf6 */
0, /* kmpt6 */
0, /* kmpf7 */
0, /* kmpt7 */
0, /* kmpf8 */
0, /* kmpt8 */
0, /* kmpf9 */
0, /* kmpt9 */
0, /* ksf1 */
0, /* ksf2 */
0, /* ksf3 */
0, /* ksf4 */
0, /* ksf5 */
0, /* ksf6 */
0, /* ksf7 */
0, /* ksf8 */
0, /* ksf9 */
0, /* ksf10 */
0, /* kf11 */
0, /* kf12 */
0, /* kf13 */
0, /* kf14 */
0, /* kf15 */
0, /* kf16 */
0, /* kf17 */
0, /* kf18 */
0, /* kf19 */
0, /* kf20 */
0, /* kf21 */
0, /* kf22 */
0, /* kf23 */
0, /* kf24 */
0, /* kf25 */
0, /* kf26 */
0, /* kf26 */
0, /* kf28 */
0, /* kf29 */
0, /* kf30 */
0, /* kf31 */
0, /* kf31 */
0, /* kf33 */
0, /* kf34 */
0, /* kf35 */
0, /* kf36 */
0, /* kf37 */
0, /* kf38 */
0, /* kf39 */
0, /* kf40 */
0, /* kf41 */
0, /* kf42 */
0, /* kf43 */
0, /* kf44 */
0, /* kf45 */
0, /* kf46 */
0, /* kf47 */
0, /* kf48 */
0, /* kf49 */
0, /* kf50 */
0, /* kf51 */
0, /* kf52 */
0, /* kf53 */
0, /* kf54 */
0, /* kf55 */
0, /* kf56 */
0, /* kf57 */
0, /* kf58 */
0, /* kf59 */
0, /* kf60 */
0, /* kf61 */
0, /* kf62 */
0, /* kf63 */
0, /* kact */
0, /* topl */
0, /* btml */
0, /* rvert */
0, /* lvert */
} /* 597 entries */;
 
/contrib/media/updf/include/patcher.h
0,0 → 1,10
 
 
#ifndef __patcher_h__
#define __patcher_h__
 
void PatchLoad(LispChar * aFileContent, LispOutput& aOutput,
LispEnvironment& aEnvironment);
 
#endif
 
/contrib/media/updf/include/patternclass.h
0,0 → 1,47
 
#ifndef __patternclass_h__
#define __patternclass_h__
 
#include "lisptype.h"
#include "lispobject.h"
#include "genericobject.h"
#include "patterns.h"
 
/// Wrapper for YacasPatternPredicateBase.
/// This class allows a YacasPatternPredicateBase to be put in a
/// LispGenericObject.
class PatternClass : public GenericClass
{
public:
PatternClass(YacasPatternPredicateBase* aPatternMatcher);
~PatternClass();
 
LispBoolean Matches(LispEnvironment& aEnvironment,
LispPtr& aArguments);
LispBoolean Matches(LispEnvironment& aEnvironment,
LispPtr* aArguments);
public: //From GenericClass
virtual LispChar * Send(LispArgList& aArgList);
virtual LispChar * TypeName();
 
private:
PatternClass(const PatternClass& aOther): iPatternMatcher(NULL)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
PatternClass& operator=(const PatternClass& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
protected:
YacasPatternPredicateBase* iPatternMatcher;
};
 
 
 
 
#endif
 
/contrib/media/updf/include/patterns.h
0,0 → 1,216
 
#ifndef __patterns_h__
#define __patterns_h__
 
/// \file
/// Pattern matching code.
///
/// General idea: have a class that can match function parameters
/// to a pattern, check for predicates on the arguments, and return
/// whether there was a match.
///
/// First the pattern is mapped onto the arguments. Then local variables
/// are set. Then the predicates are called. If they all return true,
/// Then the pattern matches, and the locals can stay (the body is expected
/// to use these variables).
 
 
#include "yacasbase.h"
#include "lisptype.h"
#include "grower.h"
#include "lispenvironment.h"
 
 
/// Abstract class for matching one argument to a pattern.
class YacasParamMatcherBase : public YacasBase
{
public:
/// Destructor.
/// This function contains no code.
virtual ~YacasParamMatcherBase();
 
/// Check whether some expression matches to the pattern.
/// \param aEnvironment the underlying Lisp environment.
/// \param aExpression the expression to test.
/// \param arguments (input/output) actual values of the pattern
/// variables for \a aExpression.
virtual LispBoolean ArgumentMatches(LispEnvironment& aEnvironment,
LispPtr& aExpression,
LispPtr* arguments)=0;
};
 
/// Class for matching an expression to a given atom.
class MatchAtom : public YacasParamMatcherBase
{
public:
MatchAtom(LispString * aString);
virtual LispBoolean ArgumentMatches(LispEnvironment& aEnvironment,
LispPtr& aExpression,
LispPtr* arguments);
protected:
LispString * iString;
};
 
/// Class for matching an expression to a given number.
class MatchNumber : public YacasParamMatcherBase
{
public:
MatchNumber(BigNumber* aNumber);
virtual LispBoolean ArgumentMatches(LispEnvironment& aEnvironment,
LispPtr& aExpression,
LispPtr* arguments);
protected:
RefPtr<BigNumber> iNumber;
};
 
/// Class for matching against a list of YacasParamMatcherBase objects.
class MatchSubList : public YacasParamMatcherBase
{
public:
MatchSubList(YacasParamMatcherBase** aMatchers, LispInt aNrMatchers);
~MatchSubList();
virtual LispBoolean ArgumentMatches(LispEnvironment& aEnvironment,
LispPtr& aExpression,
LispPtr* arguments);
private:
MatchSubList(const MatchSubList& aOther) : iMatchers(NULL),iNrMatchers(0)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
MatchSubList& operator=(const MatchSubList& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
protected:
YacasParamMatcherBase** iMatchers;
LispInt iNrMatchers;
};
 
/// Class for matching against a pattern variable.
class MatchVariable : public YacasParamMatcherBase
{
public:
MatchVariable(LispInt aVarIndex);
 
/// Matches an expression against the pattern variable.
/// \param aEnvironment the underlying Lisp environment.
/// \param aExpression the expression to test.
/// \param arguments (input/output) actual values of the pattern
/// variables for \a aExpression.
///
/// If entry #iVarIndex in \a arguments is still empty, the
/// pattern matches and \a aExpression is stored in this
/// entry. Otherwise, the pattern only matches if the entry equals
/// \a aExpression.
virtual LispBoolean ArgumentMatches(LispEnvironment& aEnvironment,
LispPtr& aExpression,
LispPtr* arguments);
protected:
/// Index of variable in YacasPatternPredicateBase::iVariables.
LispInt iVarIndex;
};
 
 
/// Class that matches function arguments to a pattern.
/// This class (specifically, the Matches() member function) can match
/// function parameters to a pattern, check for predicates on the
/// arguments, and return whether there was a match.
 
class YacasPatternPredicateBase : public YacasBase
{
public:
/// Constructor.
/// \param aEnvironment the underlying Lisp environment
/// \param aPattern Lisp expression containing the pattern
/// \param aPostPredicate Lisp expression containing the
/// postpredicate
///
/// The function MakePatternMatcher() is called for every argument
/// in \a aPattern, and the resulting pattern matchers are
/// collected in #iParamMatchers. Additionally, \a aPostPredicate
/// is copied, and the copy is added to #iPredicates.
YacasPatternPredicateBase(LispEnvironment& aEnvironment,
LispPtr& aPattern,
LispPtr& aPostPredicate);
 
/// Destructor.
/// This function contains no code.
~YacasPatternPredicateBase();
 
/// Try to match the pattern against \a aArguments.
/// First, every argument in \a aArguments is matched against the
/// corresponding YacasParamMatcherBase in #iParamMatches. If any
/// match fails, Matches() returns false. Otherwise, a temporary
/// LispLocalFrame is constructed, then SetPatternVariables() and
/// CheckPredicates() are called, and then the LispLocalFrame is
/// immediately deleted. If CheckPredicates() returns false, this
/// function also returns false. Otherwise, SetPatternVariables()
/// is called again, but now in the current LispLocalFrame, and
/// this function returns true.
LispBoolean Matches(LispEnvironment& aEnvironment,
LispPtr& aArguments);
 
/// Try to match the pattern against \a aArguments.
/// This function does the same as Matches(LispEnvironment&,LispPtr&),
/// but differs in the type of the arguments.
LispBoolean Matches(LispEnvironment& aEnvironment,
LispPtr* aArguments);
 
protected:
/// Construct a pattern matcher out of a Lisp expression.
/// The result of this function depends on the value of \a aPattern:
/// - If \a aPattern is a number, the corresponding MatchNumber is
/// constructed and returned.
/// - If \a aPattern is an atom, the corresponding MatchAtom is
/// constructed and returned.
/// - If \a aPattern is a list of the form <tt>( _ var )<tt>,
/// where \c var is an atom, LookUp() is called on \c var. Then
/// the correspoding MatchVariable is constructed and returned.
/// - If \a aPattern is a list of the form <tt>( _ var expr )<tt>,
/// where \c var is an atom, LookUp() is called on \c var. Then,
/// \a expr is appended to #iPredicates. Finally, the
/// correspoding MatchVariable is constructed and returned.
/// - If \a aPattern is a list of another form, this function
/// calls itself on any of the entries in this list. The
/// resulting YacasParamMatcherBase objects are collected in a
/// MatchSubList, which is returned.
/// - Otherwise, this function returns #NULL.
YacasParamMatcherBase* MakeParamMatcher(LispEnvironment& aEnvironment, LispObject* aPattern);
 
/// Look up a variable name in #iVariables
/// \returns index in #iVariables array where \a aVariable
/// appears.
///
/// If \a aVariable is not in #iVariables, it is added.
LispInt LookUp(LispString * aVariable);
 
protected:
/// Set local variables corresponding to the pattern variables.
/// This function goes through the #iVariables array. A local
/// variable is made for every entry in the array, and the
/// corresponding argument is assigned to it.
void SetPatternVariables(LispEnvironment& aEnvironment, LispPtr* arguments);
 
/// Check whether all predicates are true.
/// This function goes through all predicates in #iPredicates, and
/// evaluates them. It returns #LispFalse if at least one
/// of these results IsFalse(). An error is raised if any result
/// neither IsTrue() nor IsFalse().
LispBoolean CheckPredicates(LispEnvironment& aEnvironment);
 
protected:
/// List of parameter matches, one for every parameter.
CDeletingArrayGrower<YacasParamMatcherBase*, ArrOpsDeletingPtr<YacasParamMatcherBase> > iParamMatchers;
 
/// List of variables appearing in the pattern.
CArrayGrower<LispString *, ArrOpsCustomPtr<LispString> > iVariables;
 
/// List of predicates which need to be true for a match.
CArrayGrower<LispPtr, ArrOpsCustomObj<LispPtr> > iPredicates;
};
 
 
#endif
/contrib/media/updf/include/pc.h
0,0 → 1,80
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_pc_h_
#define __dj_include_pc_h_
 
#ifdef __GNUC__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
unsigned char inportb (unsigned short _port);
unsigned short inportw (unsigned short _port);
unsigned long inportl (unsigned short _port);
void inportsb (unsigned short _port, unsigned char *_buf, unsigned _len);
void inportsw (unsigned short _port, unsigned short *_buf, unsigned _len);
void inportsl (unsigned short _port, unsigned long *_buf, unsigned _len);
void outportb (unsigned short _port, unsigned char _data);
void outportw (unsigned short _port, unsigned short _data);
void outportl (unsigned short _port, unsigned long _data);
void outportsb(unsigned short _port, const unsigned char *_buf, unsigned _len);
void outportsw(unsigned short _port, const unsigned short *_buf, unsigned _len);
void outportsl(unsigned short _port, const unsigned long *_buf, unsigned _len);
 
unsigned char inp(unsigned short _port);
unsigned short inpw(unsigned short _port);
void outp(unsigned short _port, unsigned char _data);
void outpw(unsigned short _port, unsigned short _data);
#ifndef kbhit
int kbhit(void);
#endif
int getkey(void); /* ALT's have 0x100 set */
int getxkey(void); /* ALT's have 0x100 set, 0xe0 sets 0x200 */
 
// void sound(int _frequency);
#define nosound() sound(0)
 
extern unsigned char ScreenAttrib;
 
#define ScreenPrimary _go32_info_block.linear_address_of_primary_screen
#define ScreenSecondary _go32_info_block.linear_address_of_secondary_screen
 
//int ScreenMode(void);
int ScreenRows(void);
int ScreenCols(void);
void ScreenPutChar(int _ch, int _attr, int _x, int _y);
void ScreenGetChar(int *_ch, int *_attr, int _x, int _y);
void ScreenPutString(const char *_ch, int _attr, int _x, int _y);
void ScreenSetCursor(int _row, int _col);
void ScreenGetCursor(int *_row, int *_col);
void ScreenClear(void);
void ScreenUpdate(void *_virtual_screen);
void ScreenUpdateLine(const void *_virtual_screen_line, int _row);
void ScreenRetrieve(void *_virtual_screen);
void ScreenVisualBell(void);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
 
#include <inlines/pc.h>
 
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif
 
#endif /* !__dj_include_pc_h_ */
/contrib/media/updf/include/pi.h
0,0 → 1,156
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __PI_H
#define __PI_H
/**
@file pi.h
@brief Implementation of a packet iterator (PI)
 
The functions in PI.C have for goal to realize a packet iterator that permits to get the next
packet following the progression order and change of it. The functions in PI.C are used
by some function in T2.C.
*/
 
/** @defgroup PI PI - Implementation of a packet iterator */
/*@{*/
 
/**
FIXME: documentation
*/
typedef struct opj_pi_resolution {
int pdx, pdy;
int pw, ph;
} opj_pi_resolution_t;
 
/**
FIXME: documentation
*/
typedef struct opj_pi_comp {
int dx, dy;
/** number of resolution levels */
int numresolutions;
opj_pi_resolution_t *resolutions;
} opj_pi_comp_t;
 
/**
Packet iterator
*/
typedef struct opj_pi_iterator {
/** Enabling Tile part generation*/
char tp_on;
/** precise if the packet has been already used (usefull for progression order change) */
short int *include;
/** layer step used to localize the packet in the include vector */
int step_l;
/** resolution step used to localize the packet in the include vector */
int step_r;
/** component step used to localize the packet in the include vector */
int step_c;
/** precinct step used to localize the packet in the include vector */
int step_p;
/** component that identify the packet */
int compno;
/** resolution that identify the packet */
int resno;
/** precinct that identify the packet */
int precno;
/** layer that identify the packet */
int layno;
/** 0 if the first packet */
int first;
/** progression order change information */
opj_poc_t poc;
/** number of components in the image */
int numcomps;
/** Components*/
opj_pi_comp_t *comps;
int tx0, ty0, tx1, ty1;
int x, y, dx, dy;
} opj_pi_iterator_t;
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Create a packet iterator for Encoder
@param image Raw image for which the packets will be listed
@param cp Coding parameters
@param tileno Number that identifies the tile for which to list the packets
@param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
@return Returns a packet iterator that points to the first packet of the tile
@see pi_destroy
*/
opj_pi_iterator_t *pi_initialise_encode(opj_image_t *image, opj_cp_t *cp, int tileno,J2K_T2_MODE t2_mode);
/**
Modify the packet iterator for enabling tile part generation
@param pi Handle to the packet iterator generated in pi_initialise_encode
@param cp Coding parameters
@param tileno Number that identifies the tile for which to list the packets
@param pino Iterator index for pi
@param tpnum Tile part number of the current tile
@param tppos The position of the tile part flag in the progression order
@param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
@param cur_totnum_tp The total number of tile parts in the current tile
@return Returns true if an error is detected
*/
bool pi_create_encode(opj_pi_iterator_t *pi, opj_cp_t *cp,int tileno, int pino,int tpnum, int tppos, J2K_T2_MODE t2_mode,int cur_totnum_tp);
/**
Create a packet iterator for Decoder
@param image Raw image for which the packets will be listed
@param cp Coding parameters
@param tileno Number that identifies the tile for which to list the packets
@return Returns a packet iterator that points to the first packet of the tile
@see pi_destroy
*/
opj_pi_iterator_t *pi_create_decode(opj_image_t * image, opj_cp_t * cp, int tileno);
 
/**
Destroy a packet iterator
@param pi Previously created packet iterator
@param cp Coding parameters
@param tileno Number that identifies the tile for which the packets were listed
@see pi_create
*/
void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno);
 
/**
Modify the packet iterator to point to the next packet
@param pi Packet iterator to modify
@return Returns false if pi pointed to the last packet or else returns true
*/
bool pi_next(opj_pi_iterator_t * pi);
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __PI_H */
/contrib/media/updf/include/platmath.h
0,0 → 1,24
 
#ifndef __platmath_h__
#define __platmath_h__
 
// Beware the use of these functions! They cannot be guaranteed to be
// supported on any platform.
double GetDouble(LispObject* aInteger);
LispObject* Double(LispEnvironment& aEnvironment,double aValue);
 
LispObject* PlatArcSin(LispEnvironment& aEnvironment,LispObject* int1, LispInt aPrecision);
LispObject* PlatLn(LispEnvironment& aEnvironment,LispObject* int1, LispInt aPrecision);
LispObject* PlatPower(LispEnvironment& aEnvironment,LispObject* int1, LispObject* int2,
LispInt aPrecision);
 
LispObject* PlatDiv(LispEnvironment& aEnvironment,LispObject* int1, LispObject* int2,LispInt aPrecision);
 
LispObject* PlatIsPrime(LispEnvironment& aEnvironment,LispObject* int1, LispInt aPrecision);
 
// table lookup for small prime numbers
unsigned primes_table_check(unsigned long p);
unsigned primes_table_range();
 
#endif
 
/contrib/media/updf/include/png.h
0,0 → 1,2280
 
/* png.h - header file for PNG reference library
*
* libpng version 1.5.1 - February 3, 2011
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* This code is released under the libpng license (See LICENSE, below)
*
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.5.1 - February 3, 2011: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
*
* Due to various miscommunications, unforeseen code incompatibilities
* and occasional factors outside the authors' control, version numbering
* on the library has not always been consistent and straightforward.
* The following table summarizes matters since version 0.89c, which was
* the first widely used release:
*
* source png.h png.h shared-lib
* version string int version
* ------- ------ ----- ----------
* 0.89c "1.0 beta 3" 0.89 89 1.0.89
* 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90]
* 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95]
* 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96]
* 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97]
* 0.97c 0.97 97 2.0.97
* 0.98 0.98 98 2.0.98
* 0.99 0.99 98 2.0.99
* 0.99a-m 0.99 99 2.0.99
* 1.00 1.00 100 2.1.0 [100 should be 10000]
* 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000]
* 1.0.1 png.h string is 10001 2.1.0
* 1.0.1a-e identical to the 10002 from here on, the shared library
* 1.0.2 source version) 10002 is 2.V where V is the source code
* 1.0.2a-b 10003 version, except as noted.
* 1.0.3 10003
* 1.0.3a-d 10004
* 1.0.4 10004
* 1.0.4a-f 10005
* 1.0.5 (+ 2 patches) 10005
* 1.0.5a-d 10006
* 1.0.5e-r 10100 (not source compatible)
* 1.0.5s-v 10006 (not binary compatible)
* 1.0.6 (+ 3 patches) 10006 (still binary incompatible)
* 1.0.6d-f 10007 (still binary incompatible)
* 1.0.6g 10007
* 1.0.6h 10007 10.6h (testing xy.z so-numbering)
* 1.0.6i 10007 10.6i
* 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0)
* 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible)
* 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible)
* 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible)
* 1.0.7 1 10007 (still compatible)
* 1.0.8beta1-4 1 10008 2.1.0.8beta1-4
* 1.0.8rc1 1 10008 2.1.0.8rc1
* 1.0.8 1 10008 2.1.0.8
* 1.0.9beta1-6 1 10009 2.1.0.9beta1-6
* 1.0.9rc1 1 10009 2.1.0.9rc1
* 1.0.9beta7-10 1 10009 2.1.0.9beta7-10
* 1.0.9rc2 1 10009 2.1.0.9rc2
* 1.0.9 1 10009 2.1.0.9
* 1.0.10beta1 1 10010 2.1.0.10beta1
* 1.0.10rc1 1 10010 2.1.0.10rc1
* 1.0.10 1 10010 2.1.0.10
* 1.0.11beta1-3 1 10011 2.1.0.11beta1-3
* 1.0.11rc1 1 10011 2.1.0.11rc1
* 1.0.11 1 10011 2.1.0.11
* 1.0.12beta1-2 2 10012 2.1.0.12beta1-2
* 1.0.12rc1 2 10012 2.1.0.12rc1
* 1.0.12 2 10012 2.1.0.12
* 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned)
* 1.2.0beta1-2 2 10200 2.1.2.0beta1-2
* 1.2.0beta3-5 3 10200 3.1.2.0beta3-5
* 1.2.0rc1 3 10200 3.1.2.0rc1
* 1.2.0 3 10200 3.1.2.0
* 1.2.1beta1-4 3 10201 3.1.2.1beta1-4
* 1.2.1rc1-2 3 10201 3.1.2.1rc1-2
* 1.2.1 3 10201 3.1.2.1
* 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6
* 1.0.13beta1 10 10013 10.so.0.1.0.13beta1
* 1.0.13rc1 10 10013 10.so.0.1.0.13rc1
* 1.2.2rc1 12 10202 12.so.0.1.2.2rc1
* 1.0.13 10 10013 10.so.0.1.0.13
* 1.2.2 12 10202 12.so.0.1.2.2
* 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6
* 1.2.3 12 10203 12.so.0.1.2.3
* 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3
* 1.0.14rc1 13 10014 10.so.0.1.0.14rc1
* 1.2.4rc1 13 10204 12.so.0.1.2.4rc1
* 1.0.14 10 10014 10.so.0.1.0.14
* 1.2.4 13 10204 12.so.0.1.2.4
* 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2
* 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3
* 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3
* 1.0.15 10 10015 10.so.0.1.0.15
* 1.2.5 13 10205 12.so.0.1.2.5
* 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4
* 1.0.16 10 10016 10.so.0.1.0.16
* 1.2.6 13 10206 12.so.0.1.2.6
* 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2
* 1.0.17rc1 10 10017 12.so.0.1.0.17rc1
* 1.2.7rc1 13 10207 12.so.0.1.2.7rc1
* 1.0.17 10 10017 12.so.0.1.0.17
* 1.2.7 13 10207 12.so.0.1.2.7
* 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5
* 1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5
* 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5
* 1.0.18 10 10018 12.so.0.1.0.18
* 1.2.8 13 10208 12.so.0.1.2.8
* 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3
* 1.2.9beta4-11 13 10209 12.so.0.9[.0]
* 1.2.9rc1 13 10209 12.so.0.9[.0]
* 1.2.9 13 10209 12.so.0.9[.0]
* 1.2.10beta1-7 13 10210 12.so.0.10[.0]
* 1.2.10rc1-2 13 10210 12.so.0.10[.0]
* 1.2.10 13 10210 12.so.0.10[.0]
* 1.4.0beta1-5 14 10400 14.so.0.0[.0]
* 1.2.11beta1-4 13 10211 12.so.0.11[.0]
* 1.4.0beta7-8 14 10400 14.so.0.0[.0]
* 1.2.11 13 10211 12.so.0.11[.0]
* 1.2.12 13 10212 12.so.0.12[.0]
* 1.4.0beta9-14 14 10400 14.so.0.0[.0]
* 1.2.13 13 10213 12.so.0.13[.0]
* 1.4.0beta15-36 14 10400 14.so.0.0[.0]
* 1.4.0beta37-87 14 10400 14.so.14.0[.0]
* 1.4.0rc01 14 10400 14.so.14.0[.0]
* 1.4.0beta88-109 14 10400 14.so.14.0[.0]
* 1.4.0rc02-08 14 10400 14.so.14.0[.0]
* 1.4.0 14 10400 14.so.14.0[.0]
* 1.4.1beta01-03 14 10401 14.so.14.1[.0]
* 1.4.1rc01 14 10401 14.so.14.1[.0]
* 1.4.1beta04-12 14 10401 14.so.14.1[.0]
* 1.4.1 14 10401 14.so.14.1[.0]
* 1.4.2 14 10402 14.so.14.2[.0]
* 1.4.3 14 10403 14.so.14.3[.0]
* 1.4.4 14 10404 14.so.14.4[.0]
* 1.5.0beta01-58 15 10500 15.so.15.0[.0]
* 1.5.0rc01-07 15 10500 15.so.15.0[.0]
* 1.5.0 15 10500 15.so.15.0[.0]
* 1.5.1beta01-11 15 10501 15.so.15.1[.0]
* 1.5.1rc01-02 15 10501 15.so.15.1[.0]
* 1.5.1 15 10501 15.so.15.1[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
* used for changes in backward compatibility, as it is intended. The
* PNG_LIBPNG_VER macro, which is not used within libpng but is available
* for applications, is an unsigned integer of the form xyyzz corresponding
* to the source version x.y.z (leading zeros in y and z). Beta versions
* were given the previous public release number plus a letter, until
* version 1.0.6j; from then on they were given the upcoming public
* release number plus "betaNN" or "rcN".
*
* Binary incompatibility exists only when applications make direct access
* to the info_ptr or png_ptr members through png.h, and the compiled
* application is loaded with a different version of the library.
*
* DLLNUM will change each time there are forward or backward changes
* in binary compatibility (e.g., when a new feature is added).
*
* See libpng-manual.txt or libpng.3 for more information. The PNG
* specification is available as a W3C Recommendation and as an ISO
* Specification, <http://www.w3.org/TR/2003/REC-PNG-20031110/
*/
 
/*
* COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
*
* If you modify libpng you may insert additional notices immediately following
* this sentence.
*
* This code is released under the libpng license.
*
* libpng versions 1.2.6, August 15, 2004, through 1.5.1, February 3, 2011, are
* Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
*
* Cosmin Truta
*
* libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
* Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.0.6
* with the following individuals added to the list of Contributing Authors:
*
* Simon-Pierre Cadieux
* Eric S. Raymond
* Gilles Vollant
*
* and with the following additions to the disclaimer:
*
* There is no warranty against interference with your enjoyment of the
* library or against infringement. There is no warranty that our
* efforts or the library will fulfill any of your particular purposes
* or needs. This library is provided with all faults, and the entire
* risk of satisfactory quality, performance, accuracy, and effort is with
* the user.
*
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-0.96,
* with the following individuals added to the list of Contributing Authors:
*
* Tom Lane
* Glenn Randers-Pehrson
* Willem van Schaik
*
* libpng versions 0.89, June 1996, through 0.96, May 1997, are
* Copyright (c) 1996, 1997 Andreas Dilger
* Distributed according to the same disclaimer and license as libpng-0.88,
* with the following individuals added to the list of Contributing Authors:
*
* John Bowler
* Kevin Bracey
* Sam Bushell
* Magnus Holmgren
* Greg Roelofs
* Tom Tanner
*
* libpng versions 0.5, May 1995, through 0.88, January 1996, are
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
*
* For the purposes of this copyright and license, "Contributing Authors"
* is defined as the following set of individuals:
*
* Andreas Dilger
* Dave Martindale
* Guy Eric Schalnat
* Paul Schmidt
* Tim Wegner
*
* The PNG Reference Library is supplied "AS IS". The Contributing Authors
* and Group 42, Inc. disclaim all warranties, expressed or implied,
* including, without limitation, the warranties of merchantability and of
* fitness for any purpose. The Contributing Authors and Group 42, Inc.
* assume no liability for direct, indirect, incidental, special, exemplary,
* or consequential damages, which may result from the use of the PNG
* Reference Library, even if advised of the possibility of such damage.
*
* Permission is hereby granted to use, copy, modify, and distribute this
* source code, or portions hereof, for any purpose, without fee, subject
* to the following restrictions:
*
* 1. The origin of this source code must not be misrepresented.
*
* 2. Altered versions must be plainly marked as such and must not
* be misrepresented as being the original source.
*
* 3. This Copyright notice may not be removed or altered from
* any source or altered source distribution.
*
* The Contributing Authors and Group 42, Inc. specifically permit, without
* fee, and encourage the use of this source code as a component to
* supporting the PNG file format in commercial products. If you use this
* source code in a product, acknowledgment is not required but would be
* appreciated.
*/
 
/*
* A "png_get_copyright" function is available, for convenient use in "about"
* boxes and the like:
*
* printf("%s", png_get_copyright(NULL));
*
* Also, the PNG logo (in PNG format, of course) is supplied in the
* files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
*/
 
/*
* Libpng is OSI Certified Open Source Software. OSI Certified is a
* certification mark of the Open Source Initiative.
*/
 
/*
* The contributing authors would like to thank all those who helped
* with testing, bug fixes, and patience. This wouldn't have been
* possible without all of you.
*
* Thanks to Frank J. T. Wojcik for helping with the documentation.
*/
 
/*
* Y2K compliance in libpng:
* =========================
*
* February 3, 2011
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.5.1 are Y2K compliant. It is my belief that
* earlier versions were also Y2K compliant.
*
* Libpng only has three year fields. One is a 2-byte unsigned integer
* that will hold years up to 65535. The other two hold the date in text
* format, and will hold years up to 9999.
*
* The integer is
* "png_uint_16 year" in png_time_struct.
*
* The strings are
* "png_charp time_buffer" in png_struct and
* "near_time_buffer", which is a local character string in png.c.
*
* There are seven time-related functions:
* png.c: png_convert_to_rfc_1123() in png.c
* (formerly png_convert_to_rfc_1152() in error)
* png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
* png_convert_from_time_t() in pngwrite.c
* png_get_tIME() in pngget.c
* png_handle_tIME() in pngrutil.c, called in pngread.c
* png_set_tIME() in pngset.c
* png_write_tIME() in pngwutil.c, called in pngwrite.c
*
* All handle dates properly in a Y2K environment. The
* png_convert_from_time_t() function calls gmtime() to convert from system
* clock time, which returns (year - 1900), which we properly convert to
* the full 4-digit year. There is a possibility that applications using
* libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
* function, or that they are incorrectly passing only a 2-digit year
* instead of "year - 1900" into the png_convert_from_struct_tm() function,
* but this is not under our control. The libpng documentation has always
* stated that it works with 4-digit years, and the APIs have been
* documented as such.
*
* The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned
* integer to hold the year, and can hold years as large as 65535.
*
* zlib, upon which libpng depends, is also Y2K compliant. It contains
* no date-related code.
*
* Glenn Randers-Pehrson
* libpng maintainer
* PNG Development Group
*/
 
#ifndef PNG_H
#define PNG_H
 
/* This is not the place to learn how to use libpng. The file libpng-manual.txt
* describes how to use libpng, and the file example.c summarizes it
* with some code on which to build. This file is useful for looking
* at the actual function definitions and structure components.
*/
 
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.5.1"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.5.1 - February 3, 2011\n"
 
#define PNG_LIBPNG_VER_SONUM 15
#define PNG_LIBPNG_VER_DLLNUM 15
 
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 5
#define PNG_LIBPNG_VER_RELEASE 1
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/
 
#define PNG_LIBPNG_VER_BUILD 0
 
/* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1
#define PNG_LIBPNG_BUILD_BETA 2
#define PNG_LIBPNG_BUILD_RC 3
#define PNG_LIBPNG_BUILD_STABLE 4
#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
 
/* Release-Specific Flags */
#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with
PNG_LIBPNG_BUILD_STABLE only */
#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with
PNG_LIBPNG_BUILD_SPECIAL */
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
PNG_LIBPNG_BUILD_PRIVATE */
 
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_BETA
 
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
* We must not include leading zeros.
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/
#define PNG_LIBPNG_VER 10501 /* 1.5.1 */
 
/* Library configuration: these options cannot be changed after
* the library has been built.
*/
#ifndef PNGLCONF_H
/* If pnglibconf.h is missing, you can
* copy scripts/pnglibconf.h.prebuilt to pnglibconf.h
*/
# include "pnglibconf.h"
#endif
 
#ifndef PNG_VERSION_INFO_ONLY
/* Standard header files (not needed for the version info) */
# ifdef PNG_SETJMP_SUPPORTED
# include <setjmp.h>
# endif
 
/* Need the time information for converting tIME chunks, it
* defines struct tm:
*/
#ifdef PNG_CONVERT_tIME_SUPPORTED
/* "time.h" functions are not supported on all operating systems */
# include <time.h>
#endif
 
/* Machine specific configuration. */
# include "pngconf.h"
#endif
 
/*
* Added at libpng-1.2.8
*
* Ref MSDN: Private as priority over Special
* VS_FF_PRIVATEBUILD File *was not* built using standard release
* procedures. If this value is given, the StringFileInfo block must
* contain a PrivateBuild string.
*
* VS_FF_SPECIALBUILD File *was* built by the original company using
* standard release procedures but is a variation of the standard
* file of the same version number. If this value is given, the
* StringFileInfo block must contain a SpecialBuild string.
*/
 
#ifdef PNG_USER_PRIVATEBUILD /* From pnglibconf.h */
# define PNG_LIBPNG_BUILD_TYPE \
(PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)
#else
# ifdef PNG_LIBPNG_SPECIALBUILD
# define PNG_LIBPNG_BUILD_TYPE \
(PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)
# else
# define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)
# endif
#endif
 
#ifndef PNG_VERSION_INFO_ONLY
 
/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
/* Version information for C files, stored in png.c. This had better match
* the version above.
*/
#define png_libpng_ver png_get_header_ver(NULL)
 
/* This file is arranged in several sections:
*
* 1. Any configuration options that can be specified by for the application
* code when it is built. (Build time configuration is in pnglibconf.h)
* 2. Type definitions (base types are defined in pngconf.h), structure
* definitions.
* 3. Exported library functions.
*
* The library source code has additional files (principally pngpriv.h) that
* allow configuration of the library.
*/
/* Section 1: run time configuration
* See pnglibconf.h for build time configuration
*
* Run time configuration allows the application to choose between
* implementations of certain arithmetic APIs. The default is set
* at build time and recorded in pnglibconf.h, but it is safe to
* override these (and only these) settings. Note that this won't
* change what the library does, only application code, and the
* settings can (and probably should) be made on a per-file basis
* by setting the #defines before including png.h
*
* Use macros to read integers from PNG data or use the exported
* functions?
* PNG_USE_READ_MACROS: use the macros (see below) Note that
* the macros evaluate their argument multiple times.
* PNG_NO_USE_READ_MACROS: call the relevant library function.
*
* Use the alternative algorithm for compositing alpha samples that
* does not use division?
* PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division'
* algorithm.
* PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm.
*
* How to handle benign errors if PNG_ALLOW_BENIGN_ERRORS is
* false?
* PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error
* APIs to png_warning.
* Otherwise the calls are mapped to png_error.
*/
 
/* Section 2: type definitions, including structures and compile time
* constants.
* See pngconf.h for base types that vary by machine/system
*/
 
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef char* png_libpng_version_1_5_1;
 
/* Three color definitions. The order of the red, green, and blue, (and the
* exact size) is not important, although the size of the fields need to
* be png_byte or png_uint_16 (as defined below).
*/
typedef struct png_color_struct
{
png_byte red;
png_byte green;
png_byte blue;
} png_color;
typedef png_color FAR * png_colorp;
typedef PNG_CONST png_color FAR * png_const_colorp;
typedef png_color FAR * FAR * png_colorpp;
 
typedef struct png_color_16_struct
{
png_byte index; /* used for palette files */
png_uint_16 red; /* for use in red green blue files */
png_uint_16 green;
png_uint_16 blue;
png_uint_16 gray; /* for use in grayscale files */
} png_color_16;
typedef png_color_16 FAR * png_color_16p;
typedef PNG_CONST png_color_16 FAR * png_const_color_16p;
typedef png_color_16 FAR * FAR * png_color_16pp;
 
typedef struct png_color_8_struct
{
png_byte red; /* for use in red green blue files */
png_byte green;
png_byte blue;
png_byte gray; /* for use in grayscale files */
png_byte alpha; /* for alpha channel files */
} png_color_8;
typedef png_color_8 FAR * png_color_8p;
typedef PNG_CONST png_color_8 FAR * png_const_color_8p;
typedef png_color_8 FAR * FAR * png_color_8pp;
 
/*
* The following two structures are used for the in-core representation
* of sPLT chunks.
*/
typedef struct png_sPLT_entry_struct
{
png_uint_16 red;
png_uint_16 green;
png_uint_16 blue;
png_uint_16 alpha;
png_uint_16 frequency;
} png_sPLT_entry;
typedef png_sPLT_entry FAR * png_sPLT_entryp;
typedef PNG_CONST png_sPLT_entry FAR * png_const_sPLT_entryp;
typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp;
 
/* When the depth of the sPLT palette is 8 bits, the color and alpha samples
* occupy the LSB of their respective members, and the MSB of each member
* is zero-filled. The frequency member always occupies the full 16 bits.
*/
 
typedef struct png_sPLT_struct
{
png_charp name; /* palette name */
png_byte depth; /* depth of palette samples */
png_sPLT_entryp entries; /* palette entries */
png_int_32 nentries; /* number of palette entries */
} png_sPLT_t;
typedef png_sPLT_t FAR * png_sPLT_tp;
typedef PNG_CONST png_sPLT_t FAR * png_const_sPLT_tp;
typedef png_sPLT_t FAR * FAR * png_sPLT_tpp;
 
#ifdef PNG_TEXT_SUPPORTED
/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file,
* and whether that contents is compressed or not. The "key" field
* points to a regular zero-terminated C string. The "text", "lang", and
* "lang_key" fields can be regular C strings, empty strings, or NULL pointers.
* However, the * structure returned by png_get_text() will always contain
* regular zero-terminated C strings (possibly empty), never NULL pointers,
* so they can be safely used in printf() and other string-handling functions.
*/
typedef struct png_text_struct
{
int compression; /* compression value:
-1: tEXt, none
0: zTXt, deflate
1: iTXt, none
2: iTXt, deflate */
png_charp key; /* keyword, 1-79 character description of "text" */
png_charp text; /* comment, may be an empty string (ie "")
or a NULL pointer */
png_size_t text_length; /* length of the text string */
png_size_t itxt_length; /* length of the itxt string */
png_charp lang; /* language code, 0-79 characters
or a NULL pointer */
png_charp lang_key; /* keyword translated UTF-8 string, 0 or more
chars or a NULL pointer */
} png_text;
typedef png_text FAR * png_textp;
typedef PNG_CONST png_text FAR * png_const_textp;
typedef png_text FAR * FAR * png_textpp;
#endif
 
/* Supported compression types for text in PNG files (tEXt, and zTXt).
* The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */
#define PNG_TEXT_COMPRESSION_NONE_WR -3
#define PNG_TEXT_COMPRESSION_zTXt_WR -2
#define PNG_TEXT_COMPRESSION_NONE -1
#define PNG_TEXT_COMPRESSION_zTXt 0
#define PNG_ITXT_COMPRESSION_NONE 1
#define PNG_ITXT_COMPRESSION_zTXt 2
#define PNG_TEXT_COMPRESSION_LAST 3 /* Not a valid value */
 
/* png_time is a way to hold the time in an machine independent way.
* Two conversions are provided, both from time_t and struct tm. There
* is no portable way to convert to either of these structures, as far
* as I know. If you know of a portable way, send it to me. As a side
* note - PNG has always been Year 2000 compliant!
*/
typedef struct png_time_struct
{
png_uint_16 year; /* full year, as in, 1995 */
png_byte month; /* month of year, 1 - 12 */
png_byte day; /* day of month, 1 - 31 */
png_byte hour; /* hour of day, 0 - 23 */
png_byte minute; /* minute of hour, 0 - 59 */
png_byte second; /* second of minute, 0 - 60 (for leap seconds) */
} png_time;
typedef png_time FAR * png_timep;
typedef PNG_CONST png_time FAR * png_const_timep;
typedef png_time FAR * FAR * png_timepp;
 
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \
defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
/* png_unknown_chunk is a structure to hold queued chunks for which there is
* no specific support. The idea is that we can use this to queue
* up private chunks for output even though the library doesn't actually
* know about their semantics.
*/
typedef struct png_unknown_chunk_t
{
png_byte name[5];
png_byte *data;
png_size_t size;
 
/* libpng-using applications should NOT directly modify this byte. */
png_byte location; /* mode of operation at read time */
}
png_unknown_chunk;
typedef png_unknown_chunk FAR * png_unknown_chunkp;
typedef PNG_CONST png_unknown_chunk FAR * png_const_unknown_chunkp;
typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp;
#endif
 
typedef struct png_info_def png_info;
typedef png_info FAR * png_infop;
typedef PNG_CONST png_info FAR * png_const_infop;
typedef png_info FAR * FAR * png_infopp;
 
/* Maximum positive integer used in PNG is (2^31)-1 */
#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)
#define PNG_UINT_32_MAX ((png_uint_32)(-1))
#define PNG_SIZE_MAX ((png_size_t)(-1))
 
/* These are constants for fixed point values encoded in the
* PNG specification manner (x100000)
*/
#define PNG_FP_1 100000
#define PNG_FP_HALF 50000
 
/* These describe the color_type field in png_info. */
/* color type masks */
#define PNG_COLOR_MASK_PALETTE 1
#define PNG_COLOR_MASK_COLOR 2
#define PNG_COLOR_MASK_ALPHA 4
 
/* color types. Note that not all combinations are legal */
#define PNG_COLOR_TYPE_GRAY 0
#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)
#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR)
#define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)
#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)
/* aliases */
#define PNG_COLOR_TYPE_RGBA PNG_COLOR_TYPE_RGB_ALPHA
#define PNG_COLOR_TYPE_GA PNG_COLOR_TYPE_GRAY_ALPHA
 
/* This is for compression type. PNG 1.0-1.2 only define the single type. */
#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */
#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE
 
/* This is for filter type. PNG 1.0-1.2 only define the single type. */
#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */
#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */
#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE
 
/* These are for the interlacing type. These values should NOT be changed. */
#define PNG_INTERLACE_NONE 0 /* Non-interlaced image */
#define PNG_INTERLACE_ADAM7 1 /* Adam7 interlacing */
#define PNG_INTERLACE_LAST 2 /* Not a valid value */
 
/* These are for the oFFs chunk. These values should NOT be changed. */
#define PNG_OFFSET_PIXEL 0 /* Offset in pixels */
#define PNG_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */
#define PNG_OFFSET_LAST 2 /* Not a valid value */
 
/* These are for the pCAL chunk. These values should NOT be changed. */
#define PNG_EQUATION_LINEAR 0 /* Linear transformation */
#define PNG_EQUATION_BASE_E 1 /* Exponential base e transform */
#define PNG_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */
#define PNG_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */
#define PNG_EQUATION_LAST 4 /* Not a valid value */
 
/* These are for the sCAL chunk. These values should NOT be changed. */
#define PNG_SCALE_UNKNOWN 0 /* unknown unit (image scale) */
#define PNG_SCALE_METER 1 /* meters per pixel */
#define PNG_SCALE_RADIAN 2 /* radians per pixel */
#define PNG_SCALE_LAST 3 /* Not a valid value */
 
/* These are for the pHYs chunk. These values should NOT be changed. */
#define PNG_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */
#define PNG_RESOLUTION_METER 1 /* pixels/meter */
#define PNG_RESOLUTION_LAST 2 /* Not a valid value */
 
/* These are for the sRGB chunk. These values should NOT be changed. */
#define PNG_sRGB_INTENT_PERCEPTUAL 0
#define PNG_sRGB_INTENT_RELATIVE 1
#define PNG_sRGB_INTENT_SATURATION 2
#define PNG_sRGB_INTENT_ABSOLUTE 3
#define PNG_sRGB_INTENT_LAST 4 /* Not a valid value */
 
/* This is for text chunks */
#define PNG_KEYWORD_MAX_LENGTH 79
 
/* Maximum number of entries in PLTE/sPLT/tRNS arrays */
#define PNG_MAX_PALETTE_LENGTH 256
 
/* These determine if an ancillary chunk's data has been successfully read
* from the PNG header, or if the application has filled in the corresponding
* data in the info_struct to be written into the output file. The values
* of the PNG_INFO_<chunk> defines should NOT be changed.
*/
#define PNG_INFO_gAMA 0x0001
#define PNG_INFO_sBIT 0x0002
#define PNG_INFO_cHRM 0x0004
#define PNG_INFO_PLTE 0x0008
#define PNG_INFO_tRNS 0x0010
#define PNG_INFO_bKGD 0x0020
#define PNG_INFO_hIST 0x0040
#define PNG_INFO_pHYs 0x0080
#define PNG_INFO_oFFs 0x0100
#define PNG_INFO_tIME 0x0200
#define PNG_INFO_pCAL 0x0400
#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */
#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */
#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */
#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */
#define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */
 
/* This is used for the transformation routines, as some of them
* change these values for the row. It also should enable using
* the routines for other purposes.
*/
typedef struct png_row_info_struct
{
png_uint_32 width; /* width of row */
png_size_t rowbytes; /* number of bytes in row */
png_byte color_type; /* color type of row */
png_byte bit_depth; /* bit depth of row */
png_byte channels; /* number of channels (1, 2, 3, or 4) */
png_byte pixel_depth; /* bits per pixel (depth * channels) */
} png_row_info;
 
typedef png_row_info FAR * png_row_infop;
typedef png_row_info FAR * FAR * png_row_infopp;
 
/* These are the function types for the I/O functions and for the functions
* that allow the user to override the default I/O functions with his or her
* own. The png_error_ptr type should match that of user-supplied warning
* and error functions, while the png_rw_ptr type should match that of the
* user read/write data functions. Note that the 'write' function must not
* modify the buffer it is passed. The 'read' function, on the other hand, is
* expected to return the read data in the buffer.
*/
typedef struct png_struct_def png_struct;
typedef PNG_CONST png_struct FAR * png_const_structp;
typedef png_struct FAR * png_structp;
 
typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp), );
typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t), );
typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp), );
typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32,
int), );
typedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32,
int), );
 
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
typedef PNG_CALLBACK(void, *png_progressive_info_ptr,
(png_structp, png_infop), );
typedef PNG_CALLBACK(void, *png_progressive_end_ptr,
(png_structp, png_infop), );
typedef PNG_CALLBACK(void, *png_progressive_row_ptr,
(png_structp, png_bytep, png_uint_32, int), );
#endif
 
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
typedef PNG_CALLBACK(void, *png_user_transform_ptr,
(png_structp, png_row_infop, png_bytep), );
#endif
 
#ifdef PNG_USER_CHUNKS_SUPPORTED
typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp,
png_unknown_chunkp), );
#endif
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp), );
#endif
 
#ifdef PNG_SETJMP_SUPPORTED
/* This must match the function definition in <setjmp.h>, and the
* application must include this before png.h to obtain the definition
* of jmp_buf. The function is required to be PNG_NORETURN. (Note that
* PNG_PTR_NORETURN is used here because current versions of the Microsoft
* C compiler do not support the PNG_NORETURN attribute on a pointer.)
*
* If you get a type warning from the compiler when linking against this line
* then your compiler has 'longjmp' that does not match the requirements of the
* compiler that built libpng. You will have to write a wrapper function for
* your compiler's longjmp and call png_set_longjmp_fn directly (not via the
* png_jmpbuf macro.)
*
* If you get a warning here while building the library you will need to make
* changes to ensure that pnglibconf.h records the calling convention used by
* your compiler. This may be very difficult - try using a different compiler
* to build the library!
*/
typedef PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)),
PNG_PTR_NORETURN);
#endif
 
/* Transform masks for the high-level interface */
#define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */
#define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */
#define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */
#define PNG_TRANSFORM_PACKING 0x0004 /* read and write */
#define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */
#define PNG_TRANSFORM_EXPAND 0x0010 /* read only */
#define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */
#define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */
#define PNG_TRANSFORM_BGR 0x0080 /* read and write */
#define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */
#define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */
#define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */
#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* write only */
/* Added to libpng-1.2.34 */
#define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER
#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */
/* Added to libpng-1.4.0 */
#define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */
 
/* Flags for MNG supported features */
#define PNG_FLAG_MNG_EMPTY_PLTE 0x01
#define PNG_FLAG_MNG_FILTER_64 0x04
#define PNG_ALL_MNG_FEATURES 0x05
 
/* NOTE: prior to 1.5 these functions had no 'API' style declaration,
* this allowed the zlib default functions to be used on Windows
* platforms. In 1.5 the zlib default malloc (which just calls malloc and
* ignores the first argument) should be completely compatible with the
* following.
*/
typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp,
png_alloc_size_t), );
typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp), );
 
typedef png_struct FAR * FAR * png_structpp;
 
/* Section 3: exported functions
* Here are the function definitions most commonly used. This is not
* the place to find out how to use libpng. See libpng-manual.txt for the
* full explanation, see example.c for the summary. This just provides
* a simple one line description of the use of each function.
*
* The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in
* pngconf.h and in the *.dfn files in the scripts directory.
*
* PNG_EXPORT(ordinal, type, name, (args));
*
* ordinal: ordinal that is used while building
* *.def files. The ordinal value is only
* relevant when preprocessing png.h with
* the *.dfn files for building symbol table
* entries, and are removed by pngconf.h.
* type: return type of the function
* name: function name
* args: function arguments, with types
*
* When we wish to append attributes to a function prototype we use
* the PNG_EXPORTA() macro instead.
*
* PNG_EXPORTA(ordinal, type, name, (args), attributes);
*
* ordinal, type, name, and args: same as in PNG_EXPORT().
* attributes: function attributes
*/
 
/* Returns the version number of the library */
PNG_EXPORT(1, png_uint_32, png_access_version_number, (void));
 
/* Tell lib we have already handled the first <num_bytes> magic bytes.
* Handling more than 8 bytes from the beginning of the file is an error.
*/
PNG_EXPORT(2, void, png_set_sig_bytes, (png_structp png_ptr, int num_bytes));
 
/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a
* PNG file. Returns zero if the supplied bytes match the 8-byte PNG
* signature, and non-zero otherwise. Having num_to_check == 0 or
* start > 7 will always fail (ie return non-zero).
*/
PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start,
png_size_t num_to_check));
 
/* Simple signature checking function. This is the same as calling
* png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
*/
#define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n))
 
/* Allocate and initialize png_ptr struct for reading, and any other memory. */
PNG_EXPORTA(4, png_structp, png_create_read_struct,
(png_const_charp user_png_ver, png_voidp error_ptr,
png_error_ptr error_fn, png_error_ptr warn_fn),
PNG_ALLOCATED);
 
/* Allocate and initialize png_ptr struct for writing, and any other memory */
PNG_EXPORTA(5, png_structp, png_create_write_struct,
(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
png_error_ptr warn_fn),
PNG_ALLOCATED);
 
PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size,
(png_const_structp png_ptr));
 
PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structp png_ptr,
png_size_t size));
 
/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp
* match up.
*/
#ifdef PNG_SETJMP_SUPPORTED
/* This function returns the jmp_buf built in to *png_ptr. It must be
* supplied with an appropriate 'longjmp' function to use on that jmp_buf
* unless the default error function is overridden in which case NULL is
* acceptable. The size of the jmp_buf is checked against the actual size
* allocated by the library - the call will return NULL on a mismatch
* indicating an ABI mismatch.
*/
PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structp png_ptr,
png_longjmp_ptr longjmp_fn, size_t jmp_buf_size));
# define png_jmpbuf(png_ptr) \
(*png_set_longjmp_fn((png_ptr), longjmp, sizeof (jmp_buf)))
#else
# define png_jmpbuf(png_ptr) \
(LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP)
#endif
/* This function should be used by libpng applications in place of
* longjmp(png_ptr->jmpbuf, val). If longjmp_fn() has been set, it
* will use it; otherwise it will call PNG_ABORT(). This function was
* added in libpng-1.5.0.
*/
PNG_EXPORTA(9, void, png_longjmp, (png_structp png_ptr, int val),
PNG_NORETURN);
 
#ifdef PNG_READ_SUPPORTED
/* Reset the compression stream */
PNG_EXPORT(10, int, png_reset_zstream, (png_structp png_ptr));
#endif
 
/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */
#ifdef PNG_USER_MEM_SUPPORTED
PNG_EXPORTA(11, png_structp, png_create_read_struct_2,
(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
png_error_ptr warn_fn,
png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),
PNG_ALLOCATED);
PNG_EXPORTA(12, png_structp, png_create_write_struct_2,
(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
png_error_ptr warn_fn,
png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),
PNG_ALLOCATED);
#endif
 
/* Write the PNG file signature. */
PNG_EXPORT(13, void, png_write_sig, (png_structp png_ptr));
 
/* Write a PNG chunk - size, type, (optional) data, CRC. */
PNG_EXPORT(14, void, png_write_chunk, (png_structp png_ptr, png_const_bytep
chunk_name, png_const_bytep data, png_size_t length));
 
/* Write the start of a PNG chunk - length and chunk name. */
PNG_EXPORT(15, void, png_write_chunk_start, (png_structp png_ptr,
png_const_bytep chunk_name, png_uint_32 length));
 
/* Write the data of a PNG chunk started with png_write_chunk_start(). */
PNG_EXPORT(16, void, png_write_chunk_data, (png_structp png_ptr,
png_const_bytep data, png_size_t length));
 
/* Finish a chunk started with png_write_chunk_start() (includes CRC). */
PNG_EXPORT(17, void, png_write_chunk_end, (png_structp png_ptr));
 
/* Allocate and initialize the info structure */
PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_structp png_ptr),
PNG_ALLOCATED);
 
PNG_EXPORT(19, void, png_info_init_3, (png_infopp info_ptr,
png_size_t png_info_struct_size));
 
/* Writes all the PNG information before the image. */
PNG_EXPORT(20, void, png_write_info_before_PLTE,
(png_structp png_ptr, png_infop info_ptr));
PNG_EXPORT(21, void, png_write_info,
(png_structp png_ptr, png_infop info_ptr));
 
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
/* Read the information before the actual image data. */
PNG_EXPORT(22, void, png_read_info,
(png_structp png_ptr, png_infop info_ptr));
#endif
 
#ifdef PNG_TIME_RFC1123_SUPPORTED
PNG_EXPORT(23, png_const_charp, png_convert_to_rfc1123,
(png_structp png_ptr,
png_const_timep ptime));
#endif
 
#ifdef PNG_CONVERT_tIME_SUPPORTED
/* Convert from a struct tm to png_time */
PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime,
PNG_CONST struct tm FAR * ttime));
 
/* Convert from time_t to png_time. Uses gmtime() */
PNG_EXPORT(25, void, png_convert_from_time_t,
(png_timep ptime, time_t ttime));
#endif /* PNG_CONVERT_tIME_SUPPORTED */
 
#ifdef PNG_READ_EXPAND_SUPPORTED
/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */
PNG_EXPORT(26, void, png_set_expand, (png_structp png_ptr));
PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structp png_ptr));
PNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structp png_ptr));
PNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structp png_ptr));
#endif
 
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
/* Use blue, green, red order for pixels. */
PNG_EXPORT(30, void, png_set_bgr, (png_structp png_ptr));
#endif
 
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
/* Expand the grayscale to 24-bit RGB if necessary. */
PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structp png_ptr));
#endif
 
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
/* Reduce RGB to grayscale. */
PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structp png_ptr,
int error_action, double red, double green));
PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structp png_ptr,
int error_action, png_fixed_point red, png_fixed_point green));
 
PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structp
png_ptr));
#endif
 
PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,
png_colorp palette));
 
#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
PNG_EXPORT(36, void, png_set_strip_alpha, (png_structp png_ptr));
#endif
 
#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \
defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
PNG_EXPORT(37, void, png_set_swap_alpha, (png_structp png_ptr));
#endif
 
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
PNG_EXPORT(38, void, png_set_invert_alpha, (png_structp png_ptr));
#endif
 
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */
PNG_EXPORT(39, void, png_set_filler, (png_structp png_ptr, png_uint_32 filler,
int flags));
/* The values of the PNG_FILLER_ defines should NOT be changed */
# define PNG_FILLER_BEFORE 0
# define PNG_FILLER_AFTER 1
/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */
PNG_EXPORT(40, void, png_set_add_alpha,
(png_structp png_ptr, png_uint_32 filler,
int flags));
#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */
 
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
/* Swap bytes in 16-bit depth files. */
PNG_EXPORT(41, void, png_set_swap, (png_structp png_ptr));
#endif
 
#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */
PNG_EXPORT(42, void, png_set_packing, (png_structp png_ptr));
#endif
 
#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \
defined(PNG_WRITE_PACKSWAP_SUPPORTED)
/* Swap packing order of pixels in bytes. */
PNG_EXPORT(43, void, png_set_packswap, (png_structp png_ptr));
#endif
 
#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
/* Converts files to legal bit depths. */
PNG_EXPORT(44, void, png_set_shift, (png_structp png_ptr, png_const_color_8p
true_bits));
#endif
 
#if defined(PNG_READ_INTERLACING_SUPPORTED) || \
defined(PNG_WRITE_INTERLACING_SUPPORTED)
/* Have the code handle the interlacing. Returns the number of passes.
* MUST be called before png_read_update_info or png_start_read_image,
* otherwise it will not have the desired effect. Note that it is still
* necessary to call png_read_row or png_read_rows png_get_image_height
* times for each pass.
*/
PNG_EXPORT(45, int, png_set_interlace_handling, (png_structp png_ptr));
#endif
 
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
/* Invert monochrome files */
PNG_EXPORT(46, void, png_set_invert_mono, (png_structp png_ptr));
#endif
 
#ifdef PNG_READ_BACKGROUND_SUPPORTED
/* Handle alpha and tRNS by replacing with a background color. */
PNG_FP_EXPORT(47, void, png_set_background, (png_structp png_ptr,
png_const_color_16p background_color, int background_gamma_code,
int need_expand, double background_gamma));
PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structp png_ptr,
png_const_color_16p background_color, int background_gamma_code,
int need_expand, png_fixed_point background_gamma));
#endif
#ifdef PNG_READ_BACKGROUND_SUPPORTED
# define PNG_BACKGROUND_GAMMA_UNKNOWN 0
# define PNG_BACKGROUND_GAMMA_SCREEN 1
# define PNG_BACKGROUND_GAMMA_FILE 2
# define PNG_BACKGROUND_GAMMA_UNIQUE 3
#endif
 
#ifdef PNG_READ_16_TO_8_SUPPORTED
/* Strip the second byte of information from a 16-bit depth file. */
PNG_EXPORT(48, void, png_set_strip_16, (png_structp png_ptr));
#endif
 
#ifdef PNG_READ_QUANTIZE_SUPPORTED
/* Turn on quantizing, and reduce the palette to the number of colors
* available.
*/
PNG_EXPORT(49, void, png_set_quantize,
(png_structp png_ptr, png_colorp palette,
int num_palette, int maximum_colors, png_const_uint_16p histogram,
int full_quantize));
#endif
 
#ifdef PNG_READ_GAMMA_SUPPORTED
/* The threshold on gamma processing is configurable but hard-wired into the
* library. The following is the floating point variant.
*/
#define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001)
 
/* Handle gamma correction. Screen_gamma=(display_exponent) */
PNG_FP_EXPORT(50, void, png_set_gamma,
(png_structp png_ptr, double screen_gamma,
double default_file_gamma));
PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structp png_ptr,
png_fixed_point screen_gamma, png_fixed_point default_file_gamma));
#endif
 
#ifdef PNG_WRITE_FLUSH_SUPPORTED
/* Set how many lines between output flushes - 0 for no flushing */
PNG_EXPORT(51, void, png_set_flush, (png_structp png_ptr, int nrows));
/* Flush the current PNG output buffer */
PNG_EXPORT(52, void, png_write_flush, (png_structp png_ptr));
#endif
 
/* Optional update palette with requested transformations */
PNG_EXPORT(53, void, png_start_read_image, (png_structp png_ptr));
 
/* Optional call to update the users info structure */
PNG_EXPORT(54, void, png_read_update_info,
(png_structp png_ptr, png_infop info_ptr));
 
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
/* Read one or more rows of image data. */
PNG_EXPORT(55, void, png_read_rows, (png_structp png_ptr, png_bytepp row,
png_bytepp display_row, png_uint_32 num_rows));
#endif
 
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
/* Read a row of data. */
PNG_EXPORT(56, void, png_read_row, (png_structp png_ptr, png_bytep row,
png_bytep display_row));
#endif
 
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
/* Read the whole image into memory at once. */
PNG_EXPORT(57, void, png_read_image, (png_structp png_ptr, png_bytepp image));
#endif
 
/* Write a row of image data */
PNG_EXPORT(58, void, png_write_row,
(png_structp png_ptr, png_const_bytep row));
 
/* Write a few rows of image data: (*row) is not written; however, the type
* is declared as writeable to maintain compatibility with previous versions
* of libpng and to allow the 'display_row' array from read_rows to be passed
* unchanged to write_rows.
*/
PNG_EXPORT(59, void, png_write_rows, (png_structp png_ptr, png_bytepp row,
png_uint_32 num_rows));
 
/* Write the image data */
PNG_EXPORT(60, void, png_write_image,
(png_structp png_ptr, png_bytepp image));
 
/* Write the end of the PNG file. */
PNG_EXPORT(61, void, png_write_end,
(png_structp png_ptr, png_infop info_ptr));
 
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
/* Read the end of the PNG file. */
PNG_EXPORT(62, void, png_read_end, (png_structp png_ptr, png_infop info_ptr));
#endif
 
/* Free any memory associated with the png_info_struct */
PNG_EXPORT(63, void, png_destroy_info_struct, (png_structp png_ptr,
png_infopp info_ptr_ptr));
 
/* Free any memory associated with the png_struct and the png_info_structs */
PNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr,
png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));
 
/* Free any memory associated with the png_struct and the png_info_structs */
PNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr,
png_infopp info_ptr_ptr));
 
/* Set the libpng method of handling chunk CRC errors */
PNG_EXPORT(66, void, png_set_crc_action,
(png_structp png_ptr, int crit_action, int ancil_action));
 
/* Values for png_set_crc_action() say how to handle CRC errors in
* ancillary and critical chunks, and whether to use the data contained
* therein. Note that it is impossible to "discard" data in a critical
* chunk. For versions prior to 0.90, the action was always error/quit,
* whereas in version 0.90 and later, the action for CRC errors in ancillary
* chunks is warn/discard. These values should NOT be changed.
*
* value action:critical action:ancillary
*/
#define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */
#define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */
#define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */
#define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */
#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */
#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */
 
/* These functions give the user control over the scan-line filtering in
* libpng and the compression methods used by zlib. These functions are
* mainly useful for testing, as the defaults should work with most users.
* Those users who are tight on memory or want faster performance at the
* expense of compression can modify them. See the compression library
* header file (zlib.h) for an explination of the compression functions.
*/
 
/* Set the filtering method(s) used by libpng. Currently, the only valid
* value for "method" is 0.
*/
PNG_EXPORT(67, void, png_set_filter,
(png_structp png_ptr, int method, int filters));
 
/* Flags for png_set_filter() to say which filters to use. The flags
* are chosen so that they don't conflict with real filter types
* below, in case they are supplied instead of the #defined constants.
* These values should NOT be changed.
*/
#define PNG_NO_FILTERS 0x00
#define PNG_FILTER_NONE 0x08
#define PNG_FILTER_SUB 0x10
#define PNG_FILTER_UP 0x20
#define PNG_FILTER_AVG 0x40
#define PNG_FILTER_PAETH 0x80
#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \
PNG_FILTER_AVG | PNG_FILTER_PAETH)
 
/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now.
* These defines should NOT be changed.
*/
#define PNG_FILTER_VALUE_NONE 0
#define PNG_FILTER_VALUE_SUB 1
#define PNG_FILTER_VALUE_UP 2
#define PNG_FILTER_VALUE_AVG 3
#define PNG_FILTER_VALUE_PAETH 4
#define PNG_FILTER_VALUE_LAST 5
 
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */
/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_
* defines, either the default (minimum-sum-of-absolute-differences), or
* the experimental method (weighted-minimum-sum-of-absolute-differences).
*
* Weights are factors >= 1.0, indicating how important it is to keep the
* filter type consistent between rows. Larger numbers mean the current
* filter is that many times as likely to be the same as the "num_weights"
* previous filters. This is cumulative for each previous row with a weight.
* There needs to be "num_weights" values in "filter_weights", or it can be
* NULL if the weights aren't being specified. Weights have no influence on
* the selection of the first row filter. Well chosen weights can (in theory)
* improve the compression for a given image.
*
* Costs are factors >= 1.0 indicating the relative decoding costs of a
* filter type. Higher costs indicate more decoding expense, and are
* therefore less likely to be selected over a filter with lower computational
* costs. There needs to be a value in "filter_costs" for each valid filter
* type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't
* setting the costs. Costs try to improve the speed of decompression without
* unduly increasing the compressed image size.
*
* A negative weight or cost indicates the default value is to be used, and
* values in the range [0.0, 1.0) indicate the value is to remain unchanged.
* The default values for both weights and costs are currently 1.0, but may
* change if good general weighting/cost heuristics can be found. If both
* the weights and costs are set to 1.0, this degenerates the WEIGHTED method
* to the UNWEIGHTED method, but with added encoding time/computation.
*/
PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structp png_ptr,
int heuristic_method, int num_weights, png_const_doublep filter_weights,
png_const_doublep filter_costs));
PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
(png_structp png_ptr,
int heuristic_method, int num_weights, png_const_fixed_point_p
filter_weights, png_const_fixed_point_p filter_costs));
#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
 
/* Heuristic used for row filter selection. These defines should NOT be
* changed.
*/
#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */
#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */
#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */
#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */
 
/* Set the library compression level. Currently, valid values range from
* 0 - 9, corresponding directly to the zlib compression levels 0 - 9
* (0 - no compression, 9 - "maximal" compression). Note that tests have
* shown that zlib compression levels 3-6 usually perform as well as level 9
* for PNG images, and do considerably fewer caclulations. In the future,
* these values may not correspond directly to the zlib compression levels.
*/
PNG_EXPORT(69, void, png_set_compression_level,
(png_structp png_ptr, int level));
 
PNG_EXPORT(70, void, png_set_compression_mem_level, (png_structp png_ptr,
int mem_level));
 
PNG_EXPORT(71, void, png_set_compression_strategy, (png_structp png_ptr,
int strategy));
 
PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structp png_ptr,
int window_bits));
 
PNG_EXPORT(73, void, png_set_compression_method, (png_structp png_ptr,
int method));
 
/* These next functions are called for input/output, memory, and error
* handling. They are in the file pngrio.c, pngwio.c, and pngerror.c,
* and call standard C I/O routines such as fread(), fwrite(), and
* fprintf(). These functions can be made to use other I/O routines
* at run time for those applications that need to handle I/O in a
* different manner by calling png_set_???_fn(). See libpng-manual.txt for
* more information.
*/
 
#ifdef PNG_STDIO_SUPPORTED
/* Initialize the input/output for the PNG file to the default functions. */
PNG_EXPORT(74, void, png_init_io, (png_structp png_ptr, png_FILE_p fp));
#endif
 
/* Replace the (error and abort), and warning functions with user
* supplied functions. If no messages are to be printed you must still
* write and use replacement functions. The replacement error_fn should
* still do a longjmp to the last setjmp location if you are using this
* method of error handling. If error_fn or warning_fn is NULL, the
* default function will be used.
*/
 
PNG_EXPORT(75, void, png_set_error_fn,
(png_structp png_ptr, png_voidp error_ptr,
png_error_ptr error_fn, png_error_ptr warning_fn));
 
/* Return the user pointer associated with the error functions */
PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structp png_ptr));
 
/* Replace the default data output functions with a user supplied one(s).
* If buffered output is not used, then output_flush_fn can be set to NULL.
* If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time
* output_flush_fn will be ignored (and thus can be NULL).
* It is probably a mistake to use NULL for output_flush_fn if
* write_data_fn is not also NULL unless you have built libpng with
* PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's
* default flush function, which uses the standard *FILE structure, will
* be used.
*/
PNG_EXPORT(77, void, png_set_write_fn, (png_structp png_ptr, png_voidp io_ptr,
png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));
 
/* Replace the default data input function with a user supplied one. */
PNG_EXPORT(78, void, png_set_read_fn, (png_structp png_ptr, png_voidp io_ptr,
png_rw_ptr read_data_fn));
 
/* Return the user pointer associated with the I/O functions */
PNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_structp png_ptr));
 
PNG_EXPORT(80, void, png_set_read_status_fn, (png_structp png_ptr,
png_read_status_ptr read_row_fn));
 
PNG_EXPORT(81, void, png_set_write_status_fn, (png_structp png_ptr,
png_write_status_ptr write_row_fn));
 
#ifdef PNG_USER_MEM_SUPPORTED
/* Replace the default memory allocation functions with user supplied one(s). */
PNG_EXPORT(82, void, png_set_mem_fn, (png_structp png_ptr, png_voidp mem_ptr,
png_malloc_ptr malloc_fn, png_free_ptr free_fn));
/* Return the user pointer associated with the memory functions */
PNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structp png_ptr));
#endif
 
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
PNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structp png_ptr,
png_user_transform_ptr read_user_transform_fn));
#endif
 
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
PNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structp png_ptr,
png_user_transform_ptr write_user_transform_fn));
#endif
 
#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
PNG_EXPORT(86, void, png_set_user_transform_info, (png_structp png_ptr,
png_voidp user_transform_ptr, int user_transform_depth,
int user_transform_channels));
/* Return the user pointer associated with the user transform functions */
PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr,
(png_const_structp png_ptr));
#endif
 
#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED
/* Return information about the row currently being processed. Note that these
* APIs do not fail but will return unexpected results if called outside a user
* transform callback. Also note that when transforming an interlaced image the
* row number is still the row in the final, de-interlaced, image but the row
* only contains the data of the current pass - consult png_row_info for the
* actual width of the row!
*/
PNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structp));
PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structp));
#endif
 
#ifdef PNG_USER_CHUNKS_SUPPORTED
PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structp png_ptr,
png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));
PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structp png_ptr));
#endif
 
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
/* Sets the function callbacks for the push reader, and a pointer to a
* user-defined structure available to the callback functions.
*/
PNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structp png_ptr,
png_voidp progressive_ptr, png_progressive_info_ptr info_fn,
png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn));
 
/* Returns the user pointer associated with the push read functions */
PNG_EXPORT(91, png_voidp, png_get_progressive_ptr, (png_const_structp png_ptr));
 
/* Function to be called when data becomes available */
PNG_EXPORT(92, void, png_process_data,
(png_structp png_ptr, png_infop info_ptr,
png_bytep buffer, png_size_t buffer_size));
 
/* A function which may be called *only* within png_process_data to stop the
* processing of any more data. The function returns the number of bytes
* remaining, excluding any that libpng has cached internally. A subsequent
* call to png_process_data must supply these bytes again. If the argument
* 'save' is set to true the routine will first save all the pending data and
* will always return 0.
*/
PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structp, int save));
 
/* A function which may be called *only* outside (after) a call to
* png_process_data. It returns the number of bytes of data to skip in the
* input. Normally it will return 0, but if it returns a non-zero value the
* application must skip than number of bytes of input data and pass the
* following data to the next call to png_process_data.
*/
PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structp));
 
/* Function that combines rows. 'new_row' is a flag that should come from
* the callback and be non-NULL if anything needs to be done; the library
* stores its own version of the new data internally and ignores the passed
* in value.
*/
PNG_EXPORT(93, void, png_progressive_combine_row, (png_structp png_ptr,
png_bytep old_row, png_const_bytep new_row));
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 
PNG_EXPORTA(94, png_voidp, png_malloc,
(png_structp png_ptr, png_alloc_size_t size),
PNG_ALLOCATED);
/* Added at libpng version 1.4.0 */
PNG_EXPORTA(95, png_voidp, png_calloc,
(png_structp png_ptr, png_alloc_size_t size),
PNG_ALLOCATED);
 
/* Added at libpng version 1.2.4 */
PNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_structp png_ptr,
png_alloc_size_t size), PNG_ALLOCATED);
 
/* Frees a pointer allocated by png_malloc() */
PNG_EXPORT(97, void, png_free, (png_structp png_ptr, png_voidp ptr));
 
/* Free data that was allocated internally */
PNG_EXPORT(98, void, png_free_data,
(png_structp png_ptr, png_infop info_ptr, png_uint_32 free_me, int num));
 
/* Reassign responsibility for freeing existing data, whether allocated
* by libpng or by the application */
PNG_EXPORT(99, void, png_data_freer,
(png_structp png_ptr, png_infop info_ptr, int freer, png_uint_32 mask));
 
/* Assignments for png_data_freer */
#define PNG_DESTROY_WILL_FREE_DATA 1
#define PNG_SET_WILL_FREE_DATA 1
#define PNG_USER_WILL_FREE_DATA 2
/* Flags for png_ptr->free_me and info_ptr->free_me */
#define PNG_FREE_HIST 0x0008
#define PNG_FREE_ICCP 0x0010
#define PNG_FREE_SPLT 0x0020
#define PNG_FREE_ROWS 0x0040
#define PNG_FREE_PCAL 0x0080
#define PNG_FREE_SCAL 0x0100
#define PNG_FREE_UNKN 0x0200
#define PNG_FREE_LIST 0x0400
#define PNG_FREE_PLTE 0x1000
#define PNG_FREE_TRNS 0x2000
#define PNG_FREE_TEXT 0x4000
#define PNG_FREE_ALL 0x7fff
#define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
 
#ifdef PNG_USER_MEM_SUPPORTED
PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_structp png_ptr,
png_alloc_size_t size), PNG_ALLOCATED);
PNG_EXPORT(101, void, png_free_default, (png_structp png_ptr, png_voidp ptr));
#endif
 
#ifdef PNG_ERROR_TEXT_SUPPORTED
/* Fatal error in PNG image of libpng - can't continue */
PNG_EXPORTA(102, void, png_error,
(png_structp png_ptr, png_const_charp error_message),
PNG_NORETURN);
 
/* The same, but the chunk name is prepended to the error string. */
PNG_EXPORTA(103, void, png_chunk_error, (png_structp png_ptr,
png_const_charp error_message), PNG_NORETURN);
 
#else
/* Fatal error in PNG image of libpng - can't continue */
PNG_EXPORTA(104, void, png_err, (png_structp png_ptr), PNG_NORETURN);
#endif
 
/* Non-fatal error in libpng. Can continue, but may have a problem. */
PNG_EXPORT(105, void, png_warning, (png_structp png_ptr,
png_const_charp warning_message));
 
/* Non-fatal error in libpng, chunk name is prepended to message. */
PNG_EXPORT(106, void, png_chunk_warning, (png_structp png_ptr,
png_const_charp warning_message));
 
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
/* Benign error in libpng. Can continue, but may have a problem.
* User can choose whether to handle as a fatal error or as a warning. */
# undef png_benign_error
PNG_EXPORT(107, void, png_benign_error, (png_structp png_ptr,
png_const_charp warning_message));
 
/* Same, chunk name is prepended to message. */
# undef png_chunk_benign_error
PNG_EXPORT(108, void, png_chunk_benign_error, (png_structp png_ptr,
png_const_charp warning_message));
 
PNG_EXPORT(109, void, png_set_benign_errors,
(png_structp png_ptr, int allowed));
#else
# ifdef PNG_ALLOW_BENIGN_ERRORS
# define png_benign_error png_warning
# define png_chunk_benign_error png_chunk_warning
# else
# define png_benign_error png_error
# define png_chunk_benign_error png_chunk_error
# endif
#endif
 
/* The png_set_<chunk> functions are for storing values in the png_info_struct.
* Similarly, the png_get_<chunk> calls are used to read values from the
* png_info_struct, either storing the parameters in the passed variables, or
* setting pointers into the png_info_struct where the data is stored. The
* png_get_<chunk> functions return a non-zero value if the data was available
* in info_ptr, or return zero and do not change any of the parameters if the
* data was not available.
*
* These functions should be used instead of directly accessing png_info
* to avoid problems with future changes in the size and internal layout of
* png_info_struct.
*/
/* Returns "flag" if chunk data is valid in info_ptr. */
PNG_EXPORT(110, png_uint_32, png_get_valid,
(png_const_structp png_ptr, png_const_infop info_ptr,
png_uint_32 flag));
 
/* Returns number of bytes needed to hold a transformed row. */
PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structp png_ptr,
png_const_infop info_ptr));
 
#ifdef PNG_INFO_IMAGE_SUPPORTED
/* Returns row_pointers, which is an array of pointers to scanlines that was
* returned from png_read_png().
*/
PNG_EXPORT(112, png_bytepp, png_get_rows,
(png_const_structp png_ptr, png_const_infop info_ptr));
/* Set row_pointers, which is an array of pointers to scanlines for use
* by png_write_png().
*/
PNG_EXPORT(113, void, png_set_rows, (png_structp png_ptr,
png_infop info_ptr, png_bytepp row_pointers));
#endif
 
/* Returns number of color channels in image. */
PNG_EXPORT(114, png_byte, png_get_channels,
(png_const_structp png_ptr, png_const_infop info_ptr));
 
#ifdef PNG_EASY_ACCESS_SUPPORTED
/* Returns image width in pixels. */
PNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structp png_ptr,
png_const_infop info_ptr));
 
/* Returns image height in pixels. */
PNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structp png_ptr,
png_const_infop info_ptr));
 
/* Returns image bit_depth. */
PNG_EXPORT(117, png_byte, png_get_bit_depth,
(png_const_structp png_ptr, png_const_infop info_ptr));
 
/* Returns image color_type. */
PNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structp png_ptr,
png_const_infop info_ptr));
 
/* Returns image filter_type. */
PNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structp png_ptr,
png_const_infop info_ptr));
 
/* Returns image interlace_type. */
PNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structp png_ptr,
png_const_infop info_ptr));
 
/* Returns image compression_type. */
PNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structp png_ptr,
png_const_infop info_ptr));
 
/* Returns image resolution in pixels per meter, from pHYs chunk data. */
PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter,
(png_const_structp png_ptr, png_const_infop info_ptr));
PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter,
(png_const_structp png_ptr, png_const_infop info_ptr));
PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter,
(png_const_structp png_ptr, png_const_infop info_ptr));
 
/* Returns pixel aspect ratio, computed from pHYs chunk data. */
PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio,
(png_const_structp png_ptr, png_const_infop info_ptr));
PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed,
(png_const_structp png_ptr, png_const_infop info_ptr));
 
/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels,
(png_const_structp png_ptr, png_const_infop info_ptr));
PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels,
(png_const_structp png_ptr, png_const_infop info_ptr));
PNG_EXPORT(128, png_int_32, png_get_x_offset_microns,
(png_const_structp png_ptr, png_const_infop info_ptr));
PNG_EXPORT(129, png_int_32, png_get_y_offset_microns,
(png_const_structp png_ptr, png_const_infop info_ptr));
 
#endif /* PNG_EASY_ACCESS_SUPPORTED */
 
/* Returns pointer to signature string read from PNG header */
PNG_EXPORT(130, png_const_bytep, png_get_signature,
(png_const_structp png_ptr, png_infop info_ptr));
 
#ifdef PNG_bKGD_SUPPORTED
PNG_EXPORT(131, png_uint_32, png_get_bKGD,
(png_const_structp png_ptr, png_infop info_ptr,
png_color_16p *background));
#endif
 
#ifdef PNG_bKGD_SUPPORTED
PNG_EXPORT(132, void, png_set_bKGD, (png_structp png_ptr, png_infop info_ptr,
png_const_color_16p background));
#endif
 
#ifdef PNG_cHRM_SUPPORTED
PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structp png_ptr,
png_const_infop info_ptr, double *white_x, double *white_y, double *red_x,
double *red_y, double *green_x, double *green_y, double *blue_x,
double *blue_y));
#ifdef PNG_FIXED_POINT_SUPPORTED /* Otherwise not implemented */
PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed,
(png_const_structp png_ptr,
png_const_infop info_ptr, png_fixed_point *int_white_x,
png_fixed_point *int_white_y, png_fixed_point *int_red_x,
png_fixed_point *int_red_y, png_fixed_point *int_green_x,
png_fixed_point *int_green_y, png_fixed_point *int_blue_x,
png_fixed_point *int_blue_y));
#endif
#endif
 
#ifdef PNG_cHRM_SUPPORTED
PNG_FP_EXPORT(135, void, png_set_cHRM,
(png_structp png_ptr, png_infop info_ptr,
double white_x, double white_y, double red_x, double red_y, double green_x,
double green_y, double blue_x, double blue_y));
PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_structp png_ptr,
png_infop info_ptr, png_fixed_point int_white_x,
png_fixed_point int_white_y, png_fixed_point int_red_x,
png_fixed_point int_red_y, png_fixed_point int_green_x,
png_fixed_point int_green_y, png_fixed_point int_blue_x,
png_fixed_point int_blue_y));
#endif
 
#ifdef PNG_gAMA_SUPPORTED
PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA,
(png_const_structp png_ptr, png_const_infop info_ptr,
double *file_gamma));
PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed,
(png_const_structp png_ptr, png_const_infop info_ptr,
png_fixed_point *int_file_gamma));
#endif
 
#ifdef PNG_gAMA_SUPPORTED
PNG_FP_EXPORT(139, void, png_set_gAMA, (png_structp png_ptr,
png_infop info_ptr, double file_gamma));
PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_structp png_ptr,
png_infop info_ptr, png_fixed_point int_file_gamma));
#endif
 
#ifdef PNG_hIST_SUPPORTED
PNG_EXPORT(141, png_uint_32, png_get_hIST,
(png_const_structp png_ptr, png_const_infop info_ptr,
png_uint_16p *hist));
#endif
 
#ifdef PNG_hIST_SUPPORTED
PNG_EXPORT(142, void, png_set_hIST, (png_structp png_ptr,
png_infop info_ptr, png_const_uint_16p hist));
#endif
 
PNG_EXPORT(143, png_uint_32, png_get_IHDR,
(png_structp png_ptr, png_infop info_ptr,
png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type,
int *interlace_method, int *compression_method, int *filter_method));
 
PNG_EXPORT(144, void, png_set_IHDR,
(png_structp png_ptr, png_infop info_ptr,
png_uint_32 width, png_uint_32 height, int bit_depth, int color_type,
int interlace_method, int compression_method, int filter_method));
 
#ifdef PNG_oFFs_SUPPORTED
PNG_EXPORT(145, png_uint_32, png_get_oFFs,
(png_const_structp png_ptr, png_const_infop info_ptr,
png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type));
#endif
 
#ifdef PNG_oFFs_SUPPORTED
PNG_EXPORT(146, void, png_set_oFFs,
(png_structp png_ptr, png_infop info_ptr,
png_int_32 offset_x, png_int_32 offset_y, int unit_type));
#endif
 
#ifdef PNG_pCAL_SUPPORTED
PNG_EXPORT(147, png_uint_32, png_get_pCAL,
(png_const_structp png_ptr, png_const_infop info_ptr,
png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type,
int *nparams,
png_charp *units, png_charpp *params));
#endif
 
#ifdef PNG_pCAL_SUPPORTED
PNG_EXPORT(148, void, png_set_pCAL, (png_structp png_ptr,
png_infop info_ptr,
png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type,
int nparams, png_const_charp units, png_charpp params));
#endif
 
#ifdef PNG_pHYs_SUPPORTED
PNG_EXPORT(149, png_uint_32, png_get_pHYs,
(png_const_structp png_ptr, png_const_infop info_ptr,
png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
#endif
 
#ifdef PNG_pHYs_SUPPORTED
PNG_EXPORT(150, void, png_set_pHYs,
(png_structp png_ptr, png_infop info_ptr,
png_uint_32 res_x, png_uint_32 res_y, int unit_type));
#endif
 
PNG_EXPORT(151, png_uint_32, png_get_PLTE,
(png_const_structp png_ptr, png_const_infop info_ptr,
png_colorp *palette, int *num_palette));
 
PNG_EXPORT(152, void, png_set_PLTE,
(png_structp png_ptr, png_infop info_ptr,
png_const_colorp palette, int num_palette));
 
#ifdef PNG_sBIT_SUPPORTED
PNG_EXPORT(153, png_uint_32, png_get_sBIT,
(png_const_structp png_ptr, png_infop info_ptr,
png_color_8p *sig_bit));
#endif
 
#ifdef PNG_sBIT_SUPPORTED
PNG_EXPORT(154, void, png_set_sBIT,
(png_structp png_ptr, png_infop info_ptr, png_const_color_8p sig_bit));
#endif
 
#ifdef PNG_sRGB_SUPPORTED
PNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structp png_ptr,
png_const_infop info_ptr, int *file_srgb_intent));
#endif
 
#ifdef PNG_sRGB_SUPPORTED
PNG_EXPORT(156, void, png_set_sRGB,
(png_structp png_ptr, png_infop info_ptr, int srgb_intent));
PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_structp png_ptr,
png_infop info_ptr, int srgb_intent));
#endif
 
#ifdef PNG_iCCP_SUPPORTED
PNG_EXPORT(158, png_uint_32, png_get_iCCP,
(png_const_structp png_ptr, png_const_infop info_ptr,
png_charpp name, int *compression_type, png_bytepp profile,
png_uint_32 *proflen));
#endif
 
#ifdef PNG_iCCP_SUPPORTED
PNG_EXPORT(159, void, png_set_iCCP,
(png_structp png_ptr, png_infop info_ptr,
png_const_charp name, int compression_type, png_const_bytep profile,
png_uint_32 proflen));
#endif
 
#ifdef PNG_sPLT_SUPPORTED
PNG_EXPORT(160, png_uint_32, png_get_sPLT,
(png_const_structp png_ptr, png_const_infop info_ptr,
png_sPLT_tpp entries));
#endif
 
#ifdef PNG_sPLT_SUPPORTED
PNG_EXPORT(161, void, png_set_sPLT,
(png_structp png_ptr, png_infop info_ptr,
png_const_sPLT_tp entries, int nentries));
#endif
 
#ifdef PNG_TEXT_SUPPORTED
/* png_get_text also returns the number of text chunks in *num_text */
PNG_EXPORT(162, png_uint_32, png_get_text,
(png_const_structp png_ptr, png_const_infop info_ptr,
png_textp *text_ptr, int *num_text));
#endif
 
/* Note while png_set_text() will accept a structure whose text,
* language, and translated keywords are NULL pointers, the structure
* returned by png_get_text will always contain regular
* zero-terminated C strings. They might be empty strings but
* they will never be NULL pointers.
*/
 
#ifdef PNG_TEXT_SUPPORTED
PNG_EXPORT(163, void, png_set_text,
(png_structp png_ptr, png_infop info_ptr,
png_const_textp text_ptr, int num_text));
#endif
 
#ifdef PNG_tIME_SUPPORTED
PNG_EXPORT(164, png_uint_32, png_get_tIME,
(png_const_structp png_ptr, png_infop info_ptr, png_timep *mod_time));
#endif
 
#ifdef PNG_tIME_SUPPORTED
PNG_EXPORT(165, void, png_set_tIME,
(png_structp png_ptr, png_infop info_ptr, png_const_timep mod_time));
#endif
 
#ifdef PNG_tRNS_SUPPORTED
PNG_EXPORT(166, png_uint_32, png_get_tRNS,
(png_const_structp png_ptr, png_infop info_ptr,
png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color));
#endif
 
#ifdef PNG_tRNS_SUPPORTED
PNG_EXPORT(167, void, png_set_tRNS,
(png_structp png_ptr, png_infop info_ptr,
png_const_bytep trans_alpha, int num_trans,
png_const_color_16p trans_color));
#endif
 
#ifdef PNG_sCAL_SUPPORTED
PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL,
(png_const_structp png_ptr, png_const_infop info_ptr,
int *unit, double *width, double *height));
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
/* NOTE: this API is currently implemented using floating point arithmetic,
* consequently it can only be used on systems with floating point support.
* In any case the range of values supported by png_fixed_point is small and it
* is highly recommended that png_get_sCAL_s be used instead.
*/
PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed,
(png_structp png_ptr, png_const_infop info_ptr, int *unit,
png_fixed_point *width,
png_fixed_point *height));
#endif
PNG_EXPORT(169, png_uint_32, png_get_sCAL_s,
(png_const_structp png_ptr, png_const_infop info_ptr,
int *unit, png_charpp swidth, png_charpp sheight));
 
PNG_FP_EXPORT(170, void, png_set_sCAL,
(png_structp png_ptr, png_infop info_ptr,
int unit, double width, double height));
PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_structp png_ptr,
png_infop info_ptr, int unit, png_fixed_point width,
png_fixed_point height));
PNG_EXPORT(171, void, png_set_sCAL_s,
(png_structp png_ptr, png_infop info_ptr,
int unit, png_const_charp swidth, png_const_charp sheight));
#endif /* PNG_sCAL_SUPPORTED */
 
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
/* Provide a list of chunks and how they are to be handled, if the built-in
handling or default unknown chunk handling is not desired. Any chunks not
listed will be handled in the default manner. The IHDR and IEND chunks
must not be listed.
keep = 0: follow default behaviour
= 1: do not keep
= 2: keep only if safe-to-copy
= 3: keep even if unsafe-to-copy
*/
PNG_EXPORT(172, void, png_set_keep_unknown_chunks,
(png_structp png_ptr, int keep,
png_const_bytep chunk_list, int num_chunks));
PNG_EXPORT(173, int, png_handle_as_unknown, (png_structp png_ptr,
png_const_bytep chunk_name));
#endif
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
PNG_EXPORT(174, void, png_set_unknown_chunks, (png_structp png_ptr,
png_infop info_ptr, png_const_unknown_chunkp unknowns,
int num_unknowns));
PNG_EXPORT(175, void, png_set_unknown_chunk_location,
(png_structp png_ptr, png_infop info_ptr, int chunk, int location));
PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structp png_ptr,
png_const_infop info_ptr, png_unknown_chunkpp entries));
#endif
 
/* Png_free_data() will turn off the "valid" flag for anything it frees.
* If you need to turn it off for a chunk that your application has freed,
* you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);
*/
PNG_EXPORT(177, void, png_set_invalid,
(png_structp png_ptr, png_infop info_ptr, int mask));
 
#ifdef PNG_INFO_IMAGE_SUPPORTED
/* The "params" pointer is currently not used and is for future expansion. */
PNG_EXPORT(178, void, png_read_png, (png_structp png_ptr, png_infop info_ptr,
int transforms, png_voidp params));
PNG_EXPORT(179, void, png_write_png, (png_structp png_ptr, png_infop info_ptr,
int transforms, png_voidp params));
#endif
 
PNG_EXPORT(180, png_const_charp, png_get_copyright,
(png_const_structp png_ptr));
PNG_EXPORT(181, png_const_charp, png_get_header_ver,
(png_const_structp png_ptr));
PNG_EXPORT(182, png_const_charp, png_get_header_version,
(png_const_structp png_ptr));
PNG_EXPORT(183, png_const_charp, png_get_libpng_ver,
(png_const_structp png_ptr));
 
#ifdef PNG_MNG_FEATURES_SUPPORTED
PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structp png_ptr,
png_uint_32 mng_features_permitted));
#endif
 
/* For use in png_set_keep_unknown, added to version 1.2.6 */
#define PNG_HANDLE_CHUNK_AS_DEFAULT 0
#define PNG_HANDLE_CHUNK_NEVER 1
#define PNG_HANDLE_CHUNK_IF_SAFE 2
#define PNG_HANDLE_CHUNK_ALWAYS 3
 
/* Strip the prepended error numbers ("#nnn ") from error and warning
* messages before passing them to the error or warning handler.
*/
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
PNG_EXPORT(185, void, png_set_strip_error_numbers,
(png_structp png_ptr,
png_uint_32 strip_mode));
#endif
 
/* Added in libpng-1.2.6 */
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
PNG_EXPORT(186, void, png_set_user_limits, (png_structp png_ptr,
png_uint_32 user_width_max, png_uint_32 user_height_max));
PNG_EXPORT(187, png_uint_32, png_get_user_width_max,
(png_const_structp png_ptr));
PNG_EXPORT(188, png_uint_32, png_get_user_height_max,
(png_const_structp png_ptr));
/* Added in libpng-1.4.0 */
PNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structp png_ptr,
png_uint_32 user_chunk_cache_max));
PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max,
(png_const_structp png_ptr));
/* Added in libpng-1.4.1 */
PNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structp png_ptr,
png_alloc_size_t user_chunk_cache_max));
PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max,
(png_const_structp png_ptr));
#endif
 
#if defined(PNG_INCH_CONVERSIONS_SUPPORTED)
PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch,
(png_const_structp png_ptr, png_const_infop info_ptr));
 
PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch,
(png_const_structp png_ptr, png_const_infop info_ptr));
 
PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch,
(png_const_structp png_ptr, png_const_infop info_ptr));
 
PNG_FP_EXPORT(196, float, png_get_x_offset_inches,
(png_const_structp png_ptr, png_const_infop info_ptr));
#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */
PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed,
(png_structp png_ptr, png_const_infop info_ptr));
#endif
 
PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structp png_ptr,
png_const_infop info_ptr));
#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */
PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed,
(png_structp png_ptr, png_const_infop info_ptr));
#endif
 
# ifdef PNG_pHYs_SUPPORTED
PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structp png_ptr,
png_const_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,
int *unit_type));
# endif /* PNG_pHYs_SUPPORTED */
#endif /* PNG_INCH_CONVERSIONS_SUPPORTED */
 
/* Added in libpng-1.4.0 */
#ifdef PNG_IO_STATE_SUPPORTED
PNG_EXPORT(199, png_uint_32, png_get_io_state, (png_structp png_ptr));
 
PNG_EXPORTA(200, png_const_bytep, png_get_io_chunk_name,
(png_structp png_ptr), PNG_DEPRECATED);
PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,
(png_const_structp png_ptr));
 
/* The flags returned by png_get_io_state() are the following: */
# define PNG_IO_NONE 0x0000 /* no I/O at this moment */
# define PNG_IO_READING 0x0001 /* currently reading */
# define PNG_IO_WRITING 0x0002 /* currently writing */
# define PNG_IO_SIGNATURE 0x0010 /* currently at the file signature */
# define PNG_IO_CHUNK_HDR 0x0020 /* currently at the chunk header */
# define PNG_IO_CHUNK_DATA 0x0040 /* currently at the chunk data */
# define PNG_IO_CHUNK_CRC 0x0080 /* currently at the chunk crc */
# define PNG_IO_MASK_OP 0x000f /* current operation: reading/writing */
# define PNG_IO_MASK_LOC 0x00f0 /* current location: sig/hdr/data/crc */
#endif /* ?PNG_IO_STATE_SUPPORTED */
 
/* Interlace support. The following macros are always defined so that if
* libpng interlace handling is turned off the macros may be used to handle
* interlaced images within the application.
*/
#define PNG_INTERLACE_ADAM7_PASSES 7
 
/* Two macros to return the first row and first column of the original,
* full, image which appears in a given pass. 'pass' is in the range 0
* to 6 and the result is in the range 0 to 7.
*/
#define PNG_PASS_START_ROW(pass) (((1U&~(pass))<<(3-((pass)>>1)))&7)
#define PNG_PASS_START_COL(pass) (((1U& (pass))<<(3-(((pass)+1)>>1)))&7)
 
/* Two macros to help evaluate the number of rows or columns in each
* pass. This is expressed as a shift - effectively log2 of the number or
* rows or columns in each 8x8 tile of the original image.
*/
#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3)
#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3)
 
/* Hence two macros to determine the number of rows or columns in a given
* pass of an image given its height or width. In fact these macros may
* return non-zero even though the sub-image is empty, because the other
* dimension may be empty for a small image.
*/
#define PNG_PASS_ROWS(height, pass) (((height)+(((1<<PNG_PASS_ROW_SHIFT(pass))\
-1)-PNG_PASS_START_ROW(pass)))>>PNG_PASS_ROW_SHIFT(pass))
#define PNG_PASS_COLS(width, pass) (((width)+(((1<<PNG_PASS_COL_SHIFT(pass))\
-1)-PNG_PASS_START_COL(pass)))>>PNG_PASS_COL_SHIFT(pass))
 
/* For the progressive reader it is necessary to find the row in the output
* image given a row in an interlaced image, so two more macros:
*/
#define PNG_ROW_FROM_PASS_ROW(yIn, pass) \
(((yIn)<<PNG_PASS_ROW_SHIFT(pass))+PNG_PASS_START_ROW(pass))
#define PNG_COL_FROM_PASS_COL(xIn, pass) \
(((xIn)<<PNG_PASS_COL_SHIFT(pass))+PNG_PASS_START_COL(pass))
 
/* Two macros which return a boolean (0 or 1) saying whether the given row
* or column is in a particular pass. These use a common utility macro that
* returns a mask for a given pass - the offset 'off' selects the row or
* column version. The mask has the appropriate bit set for each column in
* the tile.
*/
#define PNG_PASS_MASK(pass,off) ( \
((0x110145AFU>>(((7-(off))-(pass))<<2)) & 0xFU) | \
((0x01145AF0U>>(((7-(off))-(pass))<<2)) & 0xF0U))
 
#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \
((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1)
#define PNG_COL_IN_INTERLACE_PASS(x, pass) \
((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1)
 
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
/* With these routines we avoid an integer divide, which will be slower on
* most machines. However, it does take more operations than the corresponding
* divide method, so it may be slower on a few RISC systems. There are two
* shifts (by 8 or 16 bits) and an addition, versus a single integer divide.
*
* Note that the rounding factors are NOT supposed to be the same! 128 and
* 32768 are correct for the NODIV code; 127 and 32767 are correct for the
* standard method.
*
* [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ]
*/
 
/* fg and bg should be in `gamma 1.0' space; alpha is the opacity */
 
# define png_composite(composite, fg, alpha, bg) \
{ png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \
* (png_uint_16)(alpha) \
+ (png_uint_16)(bg)*(png_uint_16)(255 \
- (png_uint_16)(alpha)) + (png_uint_16)128); \
(composite) = (png_byte)((temp + (temp >> 8)) >> 8); }
 
# define png_composite_16(composite, fg, alpha, bg) \
{ png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \
* (png_uint_32)(alpha) \
+ (png_uint_32)(bg)*(png_uint_32)(65535L \
- (png_uint_32)(alpha)) + (png_uint_32)32768L); \
(composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }
 
#else /* Standard method using integer division */
 
# define png_composite(composite, fg, alpha, bg) \
(composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \
(png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \
(png_uint_16)127) / 255)
 
# define png_composite_16(composite, fg, alpha, bg) \
(composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \
(png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) + \
(png_uint_32)32767) / (png_uint_32)65535L)
#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */
 
#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED
PNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf));
PNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf));
PNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf));
#endif
 
PNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_structp png_ptr,
png_const_bytep buf));
/* No png_get_int_16 -- may be added if there's a real need for it. */
 
/* Place a 32-bit number into a buffer in PNG byte order (big-endian). */
#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED
PNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i));
#endif
#ifdef PNG_SAVE_INT_32_SUPPORTED
PNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i));
#endif
 
/* Place a 16-bit number into a buffer in PNG byte order.
* The parameter is declared unsigned int, not png_uint_16,
* just to avoid potential problems on pre-ANSI C compilers.
*/
#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED
PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
/* No png_save_int_16 -- may be added if there's a real need for it. */
#endif
 
#ifdef PNG_USE_READ_MACROS
/* Inline macros to do direct reads of bytes from the input buffer.
* The png_get_int_32() routine assumes we are using two's complement
* format for negative values, which is almost certainly true.
*/
# define png_get_uint_32(buf) \
(((png_uint_32)(*(buf)) << 24) + \
((png_uint_32)(*((buf) + 1)) << 16) + \
((png_uint_32)(*((buf) + 2)) << 8) + \
((png_uint_32)(*((buf) + 3))))
 
/* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
* function) incorrectly returned a value of type png_uint_32.
*/
# define png_get_uint_16(buf) \
((png_uint_16) \
(((unsigned int)(*(buf)) << 8) + \
((unsigned int)(*((buf) + 1)))))
 
# define png_get_int_32(buf) \
((png_int_32)((*(buf) & 0x80) \
? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \
: (png_int_32)png_get_uint_32(buf)))
#endif
 
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project
* defs
*/
 
/* The last ordinal number (this is the *last* one already used; the next
* one to use is one more than this.) Maintainer, remember to add an entry to
* scripts/symbols.def as well.
*/
#ifdef PNG_EXPORT_LAST_ORDINAL
PNG_EXPORT_LAST_ORDINAL(220);
#endif
 
#ifdef __cplusplus
}
#endif
 
#endif /* PNG_VERSION_INFO_ONLY */
/* Do not put anything past this line */
#endif /* PNG_H */
/contrib/media/updf/include/pngconf.h
0,0 → 1,632
 
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.5.1 - February 3, 2011
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
*/
 
/* Any machine specific code is near the front of this file, so if you
* are configuring libpng for a machine, you may want to read the section
* starting here down to where it starts to typedef png_color, png_text,
* and png_info.
*/
 
#ifndef PNGCONF_H
#define PNGCONF_H
 
/* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
* definition file for machine specific limits, this may impact the
* correctness of the definitons below (see uses of INT_MAX).
*/
#ifndef PNG_NO_LIMITS_H
# include <limits.h>
#endif
 
/* For the memory copy APIs (i.e. the standard definitions of these),
* because this file defines png_memcpy and so on the base APIs must
* be defined here.
*/
#ifdef BSD
# include <strings.h>
#else
# include <string.h>
#endif
 
/* For png_FILE_p - this provides the standard definition of a
* FILE
*/
#ifdef PNG_STDIO_SUPPORTED
# include <stdio.h>
#endif
 
/* This controls optimization of the reading of 16 and 32 bit values
* from PNG files. It can be set on a per-app-file basis - it
* just changes whether a macro is used to the function is called.
* The library builder sets the default, if read functions are not
* built into the library the macro implementation is forced on.
*/
#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
# define PNG_USE_READ_MACROS
#endif
#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
# if PNG_DEFAULT_READ_MACROS
# define PNG_USE_READ_MACROS
# endif
#endif
 
/* COMPILER SPECIFIC OPTIONS.
*
* These options are provided so that a variety of difficult compilers
* can be used. Some are fixed at build time (e.g. PNG_API_RULE
* below) but still have compiler specific implementations, others
* may be changed on a per-file basis when compiling against libpng.
*/
 
/* The PNGARG macro protects us against machines that don't have function
* prototypes (ie K&R style headers). If your compiler does not handle
* function prototypes, define this macro and use the included ansi2knr.
* I've always been able to use _NO_PROTO as the indicator, but you may
* need to drag the empty declaration out in front of here, or change the
* ifdef to suit your own needs.
*/
#ifndef PNGARG
 
# ifdef OF /* zlib prototype munger */
# define PNGARG(arglist) OF(arglist)
# else
 
# ifdef _NO_PROTO
# define PNGARG(arglist) ()
# else
# define PNGARG(arglist) arglist
# endif /* _NO_PROTO */
 
# endif /* OF */
 
#endif /* PNGARG */
 
/* Function calling conventions.
* =============================
* Normally it is not necessary to specify to the compiler how to call
* a function - it just does it - however on x86 systems derived from
* Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems
* and some others) there are multiple ways to call a function and the
* default can be changed on the compiler command line. For this reason
* libpng specifies the calling convention of every exported function and
* every function called via a user supplied function pointer. This is
* done in this file by defining the following macros:
*
* PNGAPI Calling convention for exported functions.
* PNGCBAPI Calling convention for user provided (callback) functions.
* PNGCAPI Calling convention used by the ANSI-C library (required
* for longjmp callbacks and sometimes used internally to
* specify the calling convention for zlib).
*
* These macros should never be overridden. If it is necessary to
* change calling convention in a private build this can be done
* by setting PNG_API_RULE (which defaults to 0) to one of the values
* below to select the correct 'API' variants.
*
* PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.
* This is correct in every known environment.
* PNG_API_RULE=1 Use the operating system convention for PNGAPI and
* the 'C' calling convention (from PNGCAPI) for
* callbacks (PNGCBAPI). This is no longer required
* in any known environment - if it has to be used
* please post an explanation of the problem to the
* libpng mailing list.
*
* These cases only differ if the operating system does not use the C
* calling convention, at present this just means the above cases
* (x86 DOS/Windows sytems) and, even then, this does not apply to
* Cygwin running on those systems.
*
* Note that the value must be defined in pnglibconf.h so that what
* the application uses to call the library matches the conventions
* set when building the library.
*/
 
/* Symbol export
* =============
* When building a shared library it is almost always necessary to tell
* the compiler which symbols to export. The png.h macro 'PNG_EXPORT'
* is used to mark the symbols. On some systems these symbols can be
* extracted at link time and need no special processing by the compiler,
* on other systems the symbols are flagged by the compiler and just
* the declaration requires a special tag applied (unfortunately) in a
* compiler dependent way. Some systems can do either.
*
* A small number of older systems also require a symbol from a DLL to
* be flagged to the program that calls it. This is a problem because
* we do not know in the header file included by application code that
* the symbol will come from a shared library, as opposed to a statically
* linked one. For this reason the application must tell us by setting
* the magic flag PNG_USE_DLL to turn on the special processing before
* it includes png.h.
*
* Four additional macros are used to make this happen:
*
* PNG_IMPEXP The magic (if any) to cause a symbol to be exported from
* the build or imported if PNG_USE_DLL is set - compiler
* and system specific.
*
* PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to
* 'type', compiler specific.
*
* PNG_DLL_EXPORT Set to the magic to use during a libpng build to
* make a symbol exported from the DLL.
*
* PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come
* from a DLL - used to define PNG_IMPEXP when
* PNG_USE_DLL is set.
*/
 
/* System specific discovery.
* ==========================
* This code is used at build time to find PNG_IMPEXP, the API settings
* and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
* import processing is possible. On Windows/x86 systems it also sets
* compiler-specific macros to the values required to change the calling
* conventions of the various functions.
*/
#if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) ) &&\
( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\
defined(_M_X64) || defined(_M_IA64) )
/* Windows system (DOS doesn't support DLLs) running on x86/x64. Includes
* builds under Cygwin or MinGW. Also includes Watcom builds but these need
* special treatment because they are not compatible with GCC or Visual C
* because of different calling conventions.
*/
# if PNG_API_RULE == 2
/* If this line results in an error, either because __watcall is not
* understood or because of a redefine just below you cannot use *this*
* build of the library with the compiler you are using. *This* build was
* build using Watcom and applications must also be built using Watcom!
*/
# define PNGCAPI __watcall
# endif
 
# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
# define PNGCAPI __cdecl
# if PNG_API_RULE == 1
# define PNGAPI __stdcall
# endif
# else
/* An older compiler, or one not detected (erroneously) above,
* if necessary override on the command line to get the correct
* variants for the compiler.
*/
# ifndef PNGCAPI
# define PNGCAPI _cdecl
# endif
# if PNG_API_RULE == 1 && !defined(PNGAPI)
# define PNGAPI _stdcall
# endif
# endif /* compiler/api */
/* NOTE: PNGCBAPI always defaults to PNGCAPI. */
 
# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
ERROR: PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
# endif
 
# if (defined(_MSC_VER) && _MSC_VER < 800) ||\
(defined(__BORLANDC__) && __BORLANDC__ < 0x500)
/* older Borland and MSC
* compilers used '__export' and required this to be after
* the type.
*/
# ifndef PNG_EXPORT_TYPE
# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
# endif
# define PNG_DLL_EXPORT __export
# else /* newer compiler */
# define PNG_DLL_EXPORT __declspec(dllexport)
# ifndef PNG_DLL_IMPORT
# define PNG_DLL_IMPORT __declspec(dllimport)
# endif
# endif /* compiler */
 
#else /* !Windows/x86 */
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
# define PNGAPI _System
# else /* !Windows/x86 && !OS/2 */
/* Use the defaults, or define PNG*API on the command line (but
* this will have to be done for every compile!)
*/
# endif /* other system, !OS/2 */
#endif /* !Windows/x86 */
 
/* Now do all the defaulting . */
#ifndef PNGCAPI
# define PNGCAPI
#endif
#ifndef PNGCBAPI
# define PNGCBAPI PNGCAPI
#endif
#ifndef PNGAPI
# define PNGAPI PNGCAPI
#endif
 
/* The default for PNG_IMPEXP depends on whether the library is
* being built or used.
*/
#ifndef PNG_IMPEXP
# ifdef PNGLIB_BUILD
/* Building the library */
# if (defined(DLL_EXPORT)/*from libtool*/ ||\
defined(_WINDLL) || defined(_DLL) || defined(__DLL__) ||\
defined(_USRDLL) ||\
defined(PNG_BUILD_DLL)) && defined(PNG_DLL_EXPORT)
/* Building a DLL. */
# define PNG_IMPEXP PNG_DLL_EXPORT
# endif /* DLL */
# else
/* Using the library */
# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
/* This forces use of a DLL, disallowing static linking */
# define PNG_IMPEXP PNG_DLL_IMPORT
# endif
# endif
 
# ifndef PNG_IMPEXP
# define PNG_IMPEXP
# endif
#endif
 
/* THe following complexity is concerned with getting the 'attributes' of the
* declared function in the correct place. This potentially requires a separate
* PNG_EXPORT function for every compiler.
*/
#ifndef PNG_FUNCTION
# ifdef __GNUC__
# define PNG_FUNCTION(type, name, args, attributes)\
attributes type name args
# else /* !GNUC */
# ifdef _MSC_VER
# define PNG_FUNCTION(type, name, args, attributes)\
attributes type name args
# else /* !MSC */
# define PNG_FUNCTION(type, name, args, attributes)\
type name args
# endif
# endif
#endif
 
#ifndef PNG_EXPORT_TYPE
# define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
#endif
 
/* The ordinal value is only relevant when preprocessing png.h for symbol
* table entries, so we discard it here. See the .dfn files in the
* scripts directory.
*/
#ifndef PNG_EXPORTA
# define PNG_EXPORTA(ordinal, type, name, args, attributes)\
extern PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args),\
attributes)
#endif
 
#define PNG_EXPORT(ordinal, type, name, args)\
PNG_EXPORTA(ordinal, type, name, args, )
 
/* Use PNG_REMOVED to comment out a removed interface. */
#ifndef PNG_REMOVED
# define PNG_REMOVED(ordinal, type, name, args, attributes)
#endif
 
#ifndef PNG_CALLBACK
# define PNG_CALLBACK(type, name, args, attributes)\
type (PNGCBAPI name) PNGARG(args) attributes
#endif
 
/* Support for compiler specific function attributes. These are used
* so that where compiler support is available incorrect use of API
* functions in png.h will generate compiler warnings.
*
* Added at libpng-1.2.41.
*/
 
#ifndef PNG_NO_PEDANTIC_WARNINGS
# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
# define PNG_PEDANTIC_WARNINGS_SUPPORTED
# endif
#endif
 
#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
/* Support for compiler specific function attributes. These are used
* so that where compiler support is available incorrect use of API
* functions in png.h will generate compiler warnings. Added at libpng
* version 1.2.41.
*/
# ifdef __GNUC__
# ifndef PNG_USE_RESULT
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
# endif
# ifndef PNG_NORETURN
# define PNG_NORETURN __attribute__((__noreturn__))
# endif
# ifndef PNG_PTR_NORETURN
# define PNG_PTR_NORETURN __attribute__((__noreturn__))
# endif
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __attribute__((__malloc__))
# endif
 
/* This specifically protects structure members that should only be
* accessed from within the library, therefore should be empty during
* a library build.
*/
# ifndef PNGLIB_BUILD
# ifndef PNG_DEPRECATED
# define PNG_DEPRECATED __attribute__((__deprecated__))
# endif
# ifndef PNG_DEPSTRUCT
# define PNG_DEPSTRUCT __attribute__((__deprecated__))
# endif
# ifndef PNG_PRIVATE
# if 0 /* Doesn't work so we use deprecated instead*/
# define PNG_PRIVATE \
__attribute__((warning("This function is not exported by libpng.")))
# else
# define PNG_PRIVATE \
__attribute__((__deprecated__))
# endif
# endif /* PNG_PRIVATE */
# endif /* PNGLIB_BUILD */
# endif /* __GNUC__ */
# ifdef _MSC_VER /* may need to check value */
# ifndef PNG_USE_RESULT
# define PNG_USE_RESULT /*not supported*/
# endif
# ifndef PNG_NORETURN
# define PNG_NORETURN __declspec(noreturn)
# endif
# ifndef PNG_PTR_NORETURN
# define PNG_PTR_NORETURN /*not supported*/
# endif
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __declspec(restrict)
# endif
 
/* This specifically protects structure members that should only be
* accessed from within the library, therefore should be empty during
* a library build.
*/
# ifndef PNGLIB_BUILD
# ifndef PNG_DEPRECATED
# define PNG_DEPRECATED __declspec(deprecated)
# endif
# ifndef PNG_DEPSTRUCT
# define PNG_DEPSTRUCT __declspec(deprecated)
# endif
# ifndef PNG_PRIVATE
# define PNG_PRIVATE __declspec(deprecated)
# endif /* PNG_PRIVATE */
# endif /* PNGLIB_BUILD */
# endif /* __GNUC__ */
#endif /* PNG_PEDANTIC_WARNINGS */
 
#ifndef PNG_DEPRECATED
# define PNG_DEPRECATED /* Use of this function is deprecated */
#endif
#ifndef PNG_USE_RESULT
# define PNG_USE_RESULT /* The result of this function must be checked */
#endif
#ifndef PNG_NORETURN
# define PNG_NORETURN /* This function does not return */
#endif
#ifndef PNG_ALLOCATED
# define PNG_ALLOCATED /* The result of the function is new memory */
#endif
#ifndef PNG_DEPSTRUCT
# define PNG_DEPSTRUCT /* Access to this struct member is deprecated */
#endif
#ifndef PNG_PRIVATE
# define PNG_PRIVATE /* This is a private libpng function */
#endif
#ifndef PNG_FP_EXPORT /* A floating point API. */
# ifdef PNG_FLOATING_POINT_SUPPORTED
# define PNG_FP_EXPORT(ordinal, type, name, args)\
PNG_EXPORT(ordinal, type, name, args)
# else /* No floating point APIs */
# define PNG_FP_EXPORT(ordinal, type, name, args)
# endif
#endif
#ifndef PNG_FIXED_EXPORT /* A fixed point API. */
# ifdef PNG_FIXED_POINT_SUPPORTED
# define PNG_FIXED_EXPORT(ordinal, type, name, args)\
PNG_EXPORT(ordinal, type, name, args)
# else /* No fixed point APIs */
# define PNG_FIXED_EXPORT(ordinal, type, name, args)
# endif
#endif
 
/* The following uses const char * instead of char * for error
* and warning message functions, so some compilers won't complain.
* If you do not want to use const, define PNG_NO_CONST here.
*
* This should not change how the APIs are called, so it can be done
* on a per-file basis in the application.
*/
#ifndef PNG_CONST
# ifndef PNG_NO_CONST
# define PNG_CONST const
# else
# define PNG_CONST
# endif
#endif
 
/* Some typedefs to get us started. These should be safe on most of the
* common platforms. The typedefs should be at least as large as the
* numbers suggest (a png_uint_32 must be at least 32 bits long), but they
* don't have to be exactly that size. Some compilers dislike passing
* unsigned shorts as function parameters, so you may be better off using
* unsigned int for png_uint_16.
*/
 
#if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL)
typedef unsigned int png_uint_32;
typedef int png_int_32;
#else
typedef unsigned long png_uint_32;
typedef long png_int_32;
#endif
typedef unsigned short png_uint_16;
typedef short png_int_16;
typedef unsigned char png_byte;
 
#ifdef PNG_NO_SIZE_T
typedef unsigned int png_size_t;
#else
typedef size_t png_size_t;
#endif
#define png_sizeof(x) (sizeof (x))
 
/* The following is needed for medium model support. It cannot be in the
* pngpriv.h header. Needs modification for other compilers besides
* MSC. Model independent support declares all arrays and pointers to be
* large using the far keyword. The zlib version used must also support
* model independent data. As of version zlib 1.0.4, the necessary changes
* have been made in zlib. The USE_FAR_KEYWORD define triggers other
* changes that are needed. (Tim Wegner)
*/
 
/* Separate compiler dependencies (problem here is that zlib.h always
* defines FAR. (SJT)
*/
#ifdef __BORLANDC__
# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
# define LDATA 1
# else
# define LDATA 0
# endif
/* GRR: why is Cygwin in here? Cygwin is not Borland C... */
# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
# define PNG_MAX_MALLOC_64K /* only used in build */
# if (LDATA != 1)
# ifndef FAR
# define FAR __far
# endif
# define USE_FAR_KEYWORD
# endif /* LDATA != 1 */
/* Possibly useful for moving data out of default segment.
* Uncomment it if you want. Could also define FARDATA as
* const if your compiler supports it. (SJT)
# define FARDATA FAR
*/
# endif /* __WIN32__, __FLAT__, __CYGWIN__ */
#endif /* __BORLANDC__ */
 
 
/* Suggest testing for specific compiler first before testing for
* FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
* making reliance oncertain keywords suspect. (SJT)
*/
 
/* MSC Medium model */
#ifdef FAR
# ifdef M_I86MM
# define USE_FAR_KEYWORD
# define FARDATA FAR
# include <dos.h>
# endif
#endif
 
/* SJT: default case */
#ifndef FAR
# define FAR
#endif
 
/* At this point FAR is always defined */
#ifndef FARDATA
# define FARDATA
#endif
 
/* Typedef for floating-point numbers that are converted
* to fixed-point with a multiple of 100,000, e.g., gamma
*/
typedef png_int_32 png_fixed_point;
 
/* Add typedefs for pointers */
typedef void FAR * png_voidp;
typedef PNG_CONST void FAR * png_const_voidp;
typedef png_byte FAR * png_bytep;
typedef PNG_CONST png_byte FAR * png_const_bytep;
typedef png_uint_32 FAR * png_uint_32p;
typedef PNG_CONST png_uint_32 FAR * png_const_uint_32p;
typedef png_int_32 FAR * png_int_32p;
typedef PNG_CONST png_int_32 FAR * png_const_int_32p;
typedef png_uint_16 FAR * png_uint_16p;
typedef PNG_CONST png_uint_16 FAR * png_const_uint_16p;
typedef png_int_16 FAR * png_int_16p;
typedef PNG_CONST png_int_16 FAR * png_const_int_16p;
typedef char FAR * png_charp;
typedef PNG_CONST char FAR * png_const_charp;
typedef png_fixed_point FAR * png_fixed_point_p;
typedef PNG_CONST png_fixed_point FAR * png_const_fixed_point_p;
typedef png_size_t FAR * png_size_tp;
typedef PNG_CONST png_size_t FAR * png_const_size_tp;
 
#ifdef PNG_STDIO_SUPPORTED
typedef FILE * png_FILE_p;
#endif
 
#ifdef PNG_FLOATING_POINT_SUPPORTED
typedef double FAR * png_doublep;
typedef PNG_CONST double FAR * png_const_doublep;
#endif
 
/* Pointers to pointers; i.e. arrays */
typedef png_byte FAR * FAR * png_bytepp;
typedef png_uint_32 FAR * FAR * png_uint_32pp;
typedef png_int_32 FAR * FAR * png_int_32pp;
typedef png_uint_16 FAR * FAR * png_uint_16pp;
typedef png_int_16 FAR * FAR * png_int_16pp;
typedef PNG_CONST char FAR * FAR * png_const_charpp;
typedef char FAR * FAR * png_charpp;
typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
#ifdef PNG_FLOATING_POINT_SUPPORTED
typedef double FAR * FAR * png_doublepp;
#endif
 
/* Pointers to pointers to pointers; i.e., pointer to array */
typedef char FAR * FAR * FAR * png_charppp;
 
/* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
* and no smaller than png_uint_32. Casts from png_size_t or png_uint_32
* to png_alloc_size_t are not necessary; in fact, it is recommended
* not to use them at all so that the compiler can complain when something
* turns out to be problematic.
* Casts in the other direction (from png_alloc_size_t to png_size_t or
* png_uint_32) should be explicitly applied; however, we do not expect
* to encounter practical situations that require such conversions.
*/
#if defined(__TURBOC__) && !defined(__FLAT__)
typedef unsigned long png_alloc_size_t;
#else
# if defined(_MSC_VER) && defined(MAXSEG_64K)
typedef unsigned long png_alloc_size_t;
# else
/* This is an attempt to detect an old Windows system where (int) is
* actually 16 bits, in that case png_malloc must have an argument with a
* bigger size to accomodate the requirements of the library.
*/
# if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
(!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
typedef DWORD png_alloc_size_t;
# else
typedef png_size_t png_alloc_size_t;
# endif
# endif
#endif
 
#endif /* PNGCONF_H */
/contrib/media/updf/include/pngdebug.h
0,0 → 1,157
 
/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Last changed in libpng 1.5.0 [January 6, 2011]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
 
/* Define PNG_DEBUG at compile time for debugging information. Higher
* numbers for PNG_DEBUG mean more debugging information. This has
* only been added since version 0.95 so it is not implemented throughout
* libpng yet, but more support will be added as needed.
*
* png_debug[1-2]?(level, message ,arg{0-2})
* Expands to a statement (either a simple expression or a compound
* do..while(0) statement) that outputs a message with parameter
* substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG
* is undefined, 0 or 1 every png_debug expands to a simple expression
* (actually ((void)0)).
*
* level: level of detail of message, starting at 0. A level 'n'
* message is preceded by 'n' tab characters (not implemented
* on Microsoft compilers unless PNG_DEBUG_FILE is also
* defined, to allow debug DLL compilation with no standard IO).
* message: a printf(3) style text string. A trailing '\n' is added
* to the message.
* arg: 0 to 2 arguments for printf(3) style substitution in message.
*/
#ifndef PNGDEBUG_H
#define PNGDEBUG_H
/* These settings control the formatting of messages in png.c and pngerror.c */
/* Moved to pngdebug.h at 1.5.0 */
# ifndef PNG_LITERAL_SHARP
# define PNG_LITERAL_SHARP 0x23
# endif
# ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET
# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b
# endif
# ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET
# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d
# endif
# ifndef PNG_STRING_NEWLINE
# define PNG_STRING_NEWLINE "\n"
# endif
 
#ifdef PNG_DEBUG
# if (PNG_DEBUG > 0)
# if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)
# include <crtdbg.h>
# if (PNG_DEBUG > 1)
# ifndef _DEBUG
# define _DEBUG
# endif
# ifndef png_debug
# define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
_RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2)
# endif
# endif
# else /* PNG_DEBUG_FILE || !_MSC_VER */
# ifndef PNG_STDIO_SUPPORTED
# include <stdio.h> /* not included yet */
# endif
# ifndef PNG_DEBUG_FILE
# define PNG_DEBUG_FILE stderr
# endif /* PNG_DEBUG_FILE */
 
# if (PNG_DEBUG > 1)
/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on
* non-ISO compilers
*/
# ifdef __STDC__
# ifndef png_debug
# define png_debug(l,m) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
} while (0)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
} while (0)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
} while (0)
# endif
# else /* __STDC __ */
# ifndef png_debug
# define png_debug(l,m) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format); \
} while (0)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format,p1); \
} while (0)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format,p1,p2); \
} while (0)
# endif
# endif /* __STDC __ */
# endif /* (PNG_DEBUG > 1) */
 
# endif /* _MSC_VER */
# endif /* (PNG_DEBUG > 0) */
#endif /* PNG_DEBUG */
#ifndef png_debug
# define png_debug(l, m) ((void)0)
#endif
#ifndef png_debug1
# define png_debug1(l, m, p1) ((void)0)
#endif
#ifndef png_debug2
# define png_debug2(l, m, p1, p2) ((void)0)
#endif
#endif /* PNGDEBUG_H */
/contrib/media/updf/include/pnginfo.h
0,0 → 1,270
 
/* pnginfo.h - header file for PNG reference library
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Last changed in libpng 1.5.0 [January 6, 2011]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
 
/* png_info is a structure that holds the information in a PNG file so
* that the application can find out the characteristics of the image.
* If you are reading the file, this structure will tell you what is
* in the PNG file. If you are writing the file, fill in the information
* you want to put into the PNG file, using png_set_*() functions, then
* call png_write_info().
*
* The names chosen should be very close to the PNG specification, so
* consult that document for information about the meaning of each field.
*
* With libpng < 0.95, it was only possible to directly set and read the
* the values in the png_info_struct, which meant that the contents and
* order of the values had to remain fixed. With libpng 0.95 and later,
* however, there are now functions that abstract the contents of
* png_info_struct from the application, so this makes it easier to use
* libpng with dynamic libraries, and even makes it possible to use
* libraries that don't have all of the libpng ancillary chunk-handing
* functionality. In libpng-1.5.0 this was moved into a separate private
* file that is not visible to applications.
*
* The following members may have allocated storage attached that should be
* cleaned up before the structure is discarded: palette, trans, text,
* pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile,
* splt_palettes, scal_unit, row_pointers, and unknowns. By default, these
* are automatically freed when the info structure is deallocated, if they were
* allocated internally by libpng. This behavior can be changed by means
* of the png_data_freer() function.
*
* More allocation details: all the chunk-reading functions that
* change these members go through the corresponding png_set_*
* functions. A function to clear these members is available: see
* png_free_data(). The png_set_* functions do not depend on being
* able to point info structure members to any of the storage they are
* passed (they make their own copies), EXCEPT that the png_set_text
* functions use the same storage passed to them in the text_ptr or
* itxt_ptr structure argument, and the png_set_rows and png_set_unknowns
* functions do not make their own copies.
*/
#ifndef PNGINFO_H
#define PNGINFO_H
 
struct png_info_def
{
/* the following are necessary for every PNG file */
png_uint_32 width; /* width of image in pixels (from IHDR) */
png_uint_32 height; /* height of image in pixels (from IHDR) */
png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */
png_size_t rowbytes; /* bytes needed to hold an untransformed row */
png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */
png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */
png_uint_16 num_trans; /* number of transparent palette color (tRNS) */
png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */
png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */
/* The following three should have been named *_method not *_type */
png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */
png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */
png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
 
/* The following is informational only on read, and not used on writes. */
png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */
png_byte pixel_depth; /* number of bits per pixel */
png_byte spare_byte; /* to align the data, and for future use */
png_byte signature[8]; /* magic bytes read by libpng from start of file */
 
/* The rest of the data is optional. If you are reading, check the
* valid field to see if the information in these are valid. If you
* are writing, set the valid field to those chunks you want written,
* and initialize the appropriate fields below.
*/
 
#if defined(PNG_gAMA_SUPPORTED)
/* The gAMA chunk describes the gamma characteristics of the system
* on which the image was created, normally in the range [1.0, 2.5].
* Data is valid if (valid & PNG_INFO_gAMA) is non-zero.
*/
png_fixed_point gamma;
#endif
 
#ifdef PNG_sRGB_SUPPORTED
/* GR-P, 0.96a */
/* Data valid if (valid & PNG_INFO_sRGB) non-zero. */
png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */
#endif
 
#ifdef PNG_TEXT_SUPPORTED
/* The tEXt, and zTXt chunks contain human-readable textual data in
* uncompressed, compressed, and optionally compressed forms, respectively.
* The data in "text" is an array of pointers to uncompressed,
* null-terminated C strings. Each chunk has a keyword that describes the
* textual data contained in that chunk. Keywords are not required to be
* unique, and the text string may be empty. Any number of text chunks may
* be in an image.
*/
int num_text; /* number of comments read or comments to write */
int max_text; /* current size of text array */
png_textp text; /* array of comments read or comments to write */
#endif /* PNG_TEXT_SUPPORTED */
 
#ifdef PNG_tIME_SUPPORTED
/* The tIME chunk holds the last time the displayed image data was
* modified. See the png_time struct for the contents of this struct.
*/
png_time mod_time;
#endif
 
#ifdef PNG_sBIT_SUPPORTED
/* The sBIT chunk specifies the number of significant high-order bits
* in the pixel data. Values are in the range [1, bit_depth], and are
* only specified for the channels in the pixel data. The contents of
* the low-order bits is not specified. Data is valid if
* (valid & PNG_INFO_sBIT) is non-zero.
*/
png_color_8 sig_bit; /* significant bits in color channels */
#endif
 
#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \
defined(PNG_READ_BACKGROUND_SUPPORTED)
/* The tRNS chunk supplies transparency data for paletted images and
* other image types that don't need a full alpha channel. There are
* "num_trans" transparency values for a paletted image, stored in the
* same order as the palette colors, starting from index 0. Values
* for the data are in the range [0, 255], ranging from fully transparent
* to fully opaque, respectively. For non-paletted images, there is a
* single color specified that should be treated as fully transparent.
* Data is valid if (valid & PNG_INFO_tRNS) is non-zero.
*/
png_bytep trans; /* alpha values for paletted image */
png_bytep trans_alpha; /* alpha values for paletted image */
png_color_16 trans_color; /* transparent color for non-palette image */
#endif
 
#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
/* The bKGD chunk gives the suggested image background color if the
* display program does not have its own background color and the image
* is needs to composited onto a background before display. The colors
* in "background" are normally in the same color space/depth as the
* pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero.
*/
png_color_16 background;
#endif
 
#ifdef PNG_oFFs_SUPPORTED
/* The oFFs chunk gives the offset in "offset_unit_type" units rightwards
* and downwards from the top-left corner of the display, page, or other
* application-specific co-ordinate space. See the PNG_OFFSET_ defines
* below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero.
*/
png_int_32 x_offset; /* x offset on page */
png_int_32 y_offset; /* y offset on page */
png_byte offset_unit_type; /* offset units type */
#endif
 
#ifdef PNG_pHYs_SUPPORTED
/* The pHYs chunk gives the physical pixel density of the image for
* display or printing in "phys_unit_type" units (see PNG_RESOLUTION_
* defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero.
*/
png_uint_32 x_pixels_per_unit; /* horizontal pixel density */
png_uint_32 y_pixels_per_unit; /* vertical pixel density */
png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */
#endif
 
#ifdef PNG_hIST_SUPPORTED
/* The hIST chunk contains the relative frequency or importance of the
* various palette entries, so that a viewer can intelligently select a
* reduced-color palette, if required. Data is an array of "num_palette"
* values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST)
* is non-zero.
*/
png_uint_16p hist;
#endif
 
#ifdef PNG_cHRM_SUPPORTED
/* The cHRM chunk describes the CIE color characteristics of the monitor
* on which the PNG was created. This data allows the viewer to do gamut
* mapping of the input image to ensure that the viewer sees the same
* colors in the image as the creator. Values are in the range
* [0.0, 0.8]. Data valid if (valid & PNG_INFO_cHRM) non-zero.
*/
png_fixed_point x_white;
png_fixed_point y_white;
png_fixed_point x_red;
png_fixed_point y_red;
png_fixed_point x_green;
png_fixed_point y_green;
png_fixed_point x_blue;
png_fixed_point y_blue;
#endif
 
#ifdef PNG_pCAL_SUPPORTED
/* The pCAL chunk describes a transformation between the stored pixel
* values and original physical data values used to create the image.
* The integer range [0, 2^bit_depth - 1] maps to the floating-point
* range given by [pcal_X0, pcal_X1], and are further transformed by a
* (possibly non-linear) transformation function given by "pcal_type"
* and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_
* defines below, and the PNG-Group's PNG extensions document for a
* complete description of the transformations and how they should be
* implemented, and for a description of the ASCII parameter strings.
* Data values are valid if (valid & PNG_INFO_pCAL) non-zero.
*/
png_charp pcal_purpose; /* pCAL chunk description string */
png_int_32 pcal_X0; /* minimum value */
png_int_32 pcal_X1; /* maximum value */
png_charp pcal_units; /* Latin-1 string giving physical units */
png_charpp pcal_params; /* ASCII strings containing parameter values */
png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */
png_byte pcal_nparams; /* number of parameters given in pcal_params */
#endif
 
/* New members added in libpng-1.0.6 */
png_uint_32 free_me; /* flags items libpng is responsible for freeing */
 
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \
defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
/* Storage for unknown chunks that the library doesn't recognize. */
png_unknown_chunkp unknown_chunks;
int unknown_chunks_num;
#endif
 
#ifdef PNG_iCCP_SUPPORTED
/* iCCP chunk data. */
png_charp iccp_name; /* profile name */
png_bytep iccp_profile; /* International Color Consortium profile data */
png_uint_32 iccp_proflen; /* ICC profile data length */
png_byte iccp_compression; /* Always zero */
#endif
 
#ifdef PNG_sPLT_SUPPORTED
/* Data on sPLT chunks (there may be more than one). */
png_sPLT_tp splt_palettes;
png_uint_32 splt_palettes_num;
#endif
 
#ifdef PNG_sCAL_SUPPORTED
/* The sCAL chunk describes the actual physical dimensions of the
* subject matter of the graphic. The chunk contains a unit specification
* a byte value, and two ASCII strings representing floating-point
* values. The values are width and height corresponsing to one pixel
* in the image. Data values are valid if (valid & PNG_INFO_sCAL) is
* non-zero.
*/
png_byte scal_unit; /* unit of physical scale */
png_charp scal_s_width; /* string containing height */
png_charp scal_s_height; /* string containing width */
#endif
 
#ifdef PNG_INFO_IMAGE_SUPPORTED
/* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS)
non-zero */
/* Data valid if (valid & PNG_INFO_IDAT) non-zero */
png_bytepp row_pointers; /* the image bits */
#endif
 
};
#endif /* PNGINFO_H */
/contrib/media/updf/include/pnglibconf.h
0,0 → 1,173
/* pnglibconf.h - library build configuration */
 
/* libpng version 1.5.0 - January 6, 2011 */
 
/* Copyright (c) 1998-2011 Glenn Randers-Pehrson */
 
/* This code is released under the libpng license. */
/* For conditions of distribution and use, see the disclaimer */
/* and license in png.h */
 
/* pnglibconf.h */
/* Machine generated file: DO NOT EDIT */
/* Derived from: scripts/pnglibconf.dfa */
#ifndef PNGLCONF_H
#define PNGLCONF_H
/* settings */
#define PNG_MAX_GAMMA_8 11
#define PNG_CALLOC_SUPPORTED
#define PNG_QUANTIZE_RED_BITS 5
#define PNG_USER_WIDTH_MAX 1000000L
#define PNG_QUANTIZE_GREEN_BITS 5
#define PNG_API_RULE 0
#define PNG_QUANTIZE_BLUE_BITS 5
#define PNG_USER_CHUNK_CACHE_MAX 0
#define PNG_USER_HEIGHT_MAX 1000000L
#define PNG_sCAL_PRECISION 5
#define PNG_COST_SHIFT 3
#define PNG_WEIGHT_SHIFT 8
#define PNG_USER_CHUNK_MALLOC_MAX 0
#define PNG_DEFAULT_READ_MACROS 1
#define PNG_ZBUF_SIZE 8192
#define PNG_GAMMA_THRESHOLD_FIXED 5000
/* end of settings */
/* options */
#define PNG_INFO_IMAGE_SUPPORTED
#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
#define PNG_POINTER_INDEXING_SUPPORTED
#define PNG_WARNINGS_SUPPORTED
#define PNG_FLOATING_ARITHMETIC_SUPPORTED
#define PNG_WRITE_SUPPORTED
#define PNG_WRITE_INTERLACING_SUPPORTED
#define PNG_WRITE_16BIT_SUPPORTED
#define PNG_EASY_ACCESS_SUPPORTED
#define PNG_ALIGN_MEMORY_SUPPORTED
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_USER_LIMITS_SUPPORTED
#define PNG_FIXED_POINT_SUPPORTED
#define PNG_ERROR_NUMBERS_SUPPORTED
#define PNG_ERROR_TEXT_SUPPORTED
#define PNG_READ_SUPPORTED
/*#undef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED*/
#define PNG_BENIGN_ERRORS_SUPPORTED
#define PNG_SETJMP_SUPPORTED
#define PNG_WRITE_FLUSH_SUPPORTED
#define PNG_MNG_FEATURES_SUPPORTED
#define PNG_FLOATING_POINT_SUPPORTED
#define PNG_INCH_CONVERSIONS_SUPPORTED
#define PNG_STDIO_SUPPORTED
#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_USER_MEM_SUPPORTED
#define PNG_IO_STATE_SUPPORTED
#define PNG_SET_USER_LIMITS_SUPPORTED
#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
#define PNG_WRITE_FILTER_SUPPORTED
#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
#define PNG_WRITE_iCCP_SUPPORTED
#define PNG_READ_TRANSFORMS_SUPPORTED
#define PNG_READ_GAMMA_SUPPORTED
#define PNG_READ_bKGD_SUPPORTED
#define PNG_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_READ_sCAL_SUPPORTED
#define PNG_WRITE_hIST_SUPPORTED
#define PNG_READ_OPT_PLTE_SUPPORTED
#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
#define PNG_WRITE_gAMA_SUPPORTED
#define PNG_READ_GRAY_TO_RGB_SUPPORTED
#define PNG_WRITE_pCAL_SUPPORTED
#define PNG_READ_INVERT_ALPHA_SUPPORTED
#define PNG_WRITE_TRANSFORMS_SUPPORTED
#define PNG_READ_sBIT_SUPPORTED
#define PNG_READ_PACK_SUPPORTED
#define PNG_WRITE_SWAP_SUPPORTED
#define PNG_READ_cHRM_SUPPORTED
#define PNG_WRITE_tIME_SUPPORTED
#define PNG_READ_INTERLACING_SUPPORTED
#define PNG_READ_tRNS_SUPPORTED
#define PNG_WRITE_pHYs_SUPPORTED
#define PNG_WRITE_INVERT_SUPPORTED
#define PNG_READ_RGB_TO_GRAY_SUPPORTED
#define PNG_WRITE_sRGB_SUPPORTED
#define PNG_READ_oFFs_SUPPORTED
#define PNG_WRITE_FILLER_SUPPORTED
#define PNG_WRITE_TEXT_SUPPORTED
#define PNG_WRITE_SHIFT_SUPPORTED
#define PNG_PROGRESSIVE_READ_SUPPORTED
#define PNG_READ_SHIFT_SUPPORTED
#define PNG_CONVERT_tIME_SUPPORTED
#define PNG_READ_USER_TRANSFORM_SUPPORTED
#define PNG_READ_INT_FUNCTIONS_SUPPORTED
#define PNG_READ_USER_CHUNKS_SUPPORTED
#define PNG_READ_hIST_SUPPORTED
#define PNG_READ_16BIT_SUPPORTED
#define PNG_READ_SWAP_ALPHA_SUPPORTED
#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
#define PNG_SEQUENTIAL_READ_SUPPORTED
#define PNG_READ_BACKGROUND_SUPPORTED
#define PNG_READ_QUANTIZE_SUPPORTED
#define PNG_READ_iCCP_SUPPORTED
#define PNG_READ_STRIP_ALPHA_SUPPORTED
#define PNG_READ_PACKSWAP_SUPPORTED
#define PNG_READ_sRGB_SUPPORTED
#define PNG_WRITE_tEXt_SUPPORTED
#define PNG_READ_gAMA_SUPPORTED
#define PNG_READ_pCAL_SUPPORTED
#define PNG_READ_EXPAND_SUPPORTED
#define PNG_WRITE_sPLT_SUPPORTED
#define PNG_READ_SWAP_SUPPORTED
#define PNG_READ_tIME_SUPPORTED
#define PNG_READ_pHYs_SUPPORTED
#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
#define PNG_TIME_RFC1123_SUPPORTED
#define PNG_READ_TEXT_SUPPORTED
#define PNG_WRITE_BGR_SUPPORTED
#define PNG_USER_CHUNKS_SUPPORTED
#define PNG_CONSOLE_IO_SUPPORTED
#define PNG_WRITE_PACK_SUPPORTED
#define PNG_READ_FILLER_SUPPORTED
#define PNG_WRITE_bKGD_SUPPORTED
#define PNG_WRITE_tRNS_SUPPORTED
#define PNG_READ_sPLT_SUPPORTED
#define PNG_WRITE_sCAL_SUPPORTED
#define PNG_WRITE_oFFs_SUPPORTED
#define PNG_READ_tEXt_SUPPORTED
#define PNG_WRITE_sBIT_SUPPORTED
#define PNG_READ_INVERT_SUPPORTED
#define PNG_READ_16_TO_8_SUPPORTED
#define PNG_WRITE_cHRM_SUPPORTED
#define PNG_16BIT_SUPPORTED
#define PNG_WRITE_USER_TRANSFORM_SUPPORTED
#define PNG_READ_BGR_SUPPORTED
#define PNG_WRITE_PACKSWAP_SUPPORTED
#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
#define PNG_sCAL_SUPPORTED
#define PNG_WRITE_zTXt_SUPPORTED
#define PNG_USER_TRANSFORM_INFO_SUPPORTED
#define PNG_sBIT_SUPPORTED
#define PNG_cHRM_SUPPORTED
#define PNG_bKGD_SUPPORTED
#define PNG_tRNS_SUPPORTED
#define PNG_WRITE_iTXt_SUPPORTED
#define PNG_oFFs_SUPPORTED
#define PNG_USER_TRANSFORM_PTR_SUPPORTED
#define PNG_hIST_SUPPORTED
#define PNG_iCCP_SUPPORTED
#define PNG_sRGB_SUPPORTED
#define PNG_READ_zTXt_SUPPORTED
#define PNG_gAMA_SUPPORTED
#define PNG_pCAL_SUPPORTED
#define PNG_CHECK_cHRM_SUPPORTED
#define PNG_tIME_SUPPORTED
#define PNG_pHYs_SUPPORTED
#define PNG_READ_iTXt_SUPPORTED
#define PNG_TEXT_SUPPORTED
#define PNG_SAVE_INT_32_SUPPORTED
#define PNG_sPLT_SUPPORTED
#define PNG_tEXt_SUPPORTED
#define PNG_zTXt_SUPPORTED
#define PNG_iTXt_SUPPORTED
/* end of options */
#endif /* PNGLCONF_H */
/contrib/media/updf/include/pngpriv.h
0,0 → 1,1235
 
/* pngpriv.h - private declarations for use inside libpng
*
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Last changed in libpng 1.5.0 [January 6, 2011]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
 
/* The symbols declared in this file (including the functions declared
* as PNG_EXTERN) are PRIVATE. They are not part of the libpng public
* interface, and are not recommended for use by regular applications.
* Some of them may become public in the future; others may stay private,
* change in an incompatible way, or even disappear.
* Although the libpng users are not forbidden to include this header,
* they should be well aware of the issues that may arise from doing so.
*/
 
#ifndef PNGPRIV_H
#define PNGPRIV_H
 
/* This is required for the definition of abort(), used as a last ditch
* error handler when all else fails.
*/
#include <stdlib.h>
 
#define PNGLIB_BUILD
#ifdef PNG_USER_CONFIG
# include "pngusr.h"
/* These should have been defined in pngusr.h */
# ifndef PNG_USER_PRIVATEBUILD
# define PNG_USER_PRIVATEBUILD "Custom libpng build"
# endif
# ifndef PNG_USER_DLLFNAME_POSTFIX
# define PNG_USER_DLLFNAME_POSTFIX "Cb"
# endif
#endif
#include "png.h"
#include "pnginfo.h"
#include "pngstruct.h"
 
/* This is used for 16 bit gamma tables - only the top level pointers are const,
* this could be changed:
*/
typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
 
/* Added at libpng-1.2.9 */
/* Moved to pngpriv.h at libpng-1.5.0 */
 
/* config.h is created by and PNG_CONFIGURE_LIBPNG is set by the "configure"
* script. We may need it here to get the correct configuration on things
* like limits.
*/
#ifdef PNG_CONFIGURE_LIBPNG
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
#endif
 
/* Moved to pngpriv.h at libpng-1.5.0 */
/* NOTE: some of these may have been used in external applications as
* these definitions were exposed in pngconf.h prior to 1.5.
*/
 
/* If you are running on a machine where you cannot allocate more
* than 64K of memory at once, uncomment this. While libpng will not
* normally need that much memory in a chunk (unless you load up a very
* large file), zlib needs to know how big of a chunk it can use, and
* libpng thus makes sure to check any memory allocation to verify it
* will fit into memory.
*
* zlib provides 'MAXSEG_64K' which, if defined, indicates the
* same limit and pngconf.h (already included) sets the limit
* if certain operating systems are detected.
*/
#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
# define PNG_MAX_MALLOC_64K
#endif
 
/* Unused formal parameter warnings are silenced using the following macro
* which is expected to have no bad effects on performance (optimizing
* compilers will probably remove it entirely). Note that if you replace
* it with something other than whitespace, you must include the terminating
* semicolon.
*/
#define PNG_UNUSED(param) (void)param;
 
/* Just a little check that someone hasn't tried to define something
* contradictory.
*/
#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
# undef PNG_ZBUF_SIZE
# define PNG_ZBUF_SIZE 65536L
#endif
 
/* If warnings or errors are turned off the code is disabled
* or redirected here.
*/
#ifndef PNG_WARNINGS_SUPPORTED
# define png_warning(s1,s2) ((void)0)
# define png_chunk_warning(s1,s2) ((void)0)
#endif
#ifndef PNG_ERROR_TEXT_SUPPORTED
# define png_error(s1,s2) png_err(s1)
# define png_chunk_error(s1,s2) png_err(s1)
# define png_fixed_error(s1,s2) png_err(s1)
#endif
 
#ifndef PNG_EXTERN
/* The functions exported by PNG_EXTERN are internal functions, which
* aren't usually used outside the library (as far as I know), so it is
* debatable if they should be exported at all. In the future, when it
* is possible to have run-time registry of chunk-handling functions,
* some of these might be made available again.
# define PNG_EXTERN extern
*/
# define PNG_EXTERN
#endif
 
/* Some fixed point APIs are still required even if not exported because
* they get used by the corresponding floating point APIs. This magic
* deals with this:
*/
#ifdef PNG_FIXED_POINT_SUPPORTED
# define PNGFAPI PNGAPI
#else
# define PNGFAPI /* PRIVATE */
#endif
 
/* Other defines specific to compilers can go here. Try to keep
* them inside an appropriate ifdef/endif pair for portability.
*/
#if defined(PNG_FLOATING_POINT_SUPPORTED) ||\
defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
/* png.c requires the following ANSI-C constants if the conversion of
* floating point to ASCII is implemented therein:
*
* DBL_DIG Maximum number of decimal digits (can be set to any constant)
* DBL_MIN Smallest normalized fp number (can be set to an arbitrary value)
* DBL_MAX Maximum floating point number (can be set to an arbitrary value)
*/
# include <float.h>
 
# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
/* We need to check that <math.h> hasn't already been included earlier
* as it seems it doesn't agree with <fp.h>, yet we should really use
* <fp.h> if possible.
*/
# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
# include <fp.h>
# endif
# else
# include <math.h>
# endif
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881
*/
# include <m68881.h>
# endif
#endif
 
/* This provides the non-ANSI (far) memory allocation routines. */
#if defined(__TURBOC__) && defined(__MSDOS__)
# include <mem.h>
# include <alloc.h>
#endif
 
 
/* Moved here around 1.5.0beta36 from pngconf.h */
/* Users may want to use these so they are not private. Any library
* functions that are passed far data must be model-independent.
*/
 
/* Memory model/platform independent fns */
#ifndef PNG_ABORT
# ifdef _WINDOWS_
# define PNG_ABORT() ExitProcess(0)
# else
# define PNG_ABORT() abort()
# endif
#endif
 
#ifdef USE_FAR_KEYWORD
/* Use this to make far-to-near assignments */
# define CHECK 1
# define NOCHECK 0
# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
# define png_strcpy _fstrcpy
# define png_strncpy _fstrncpy /* Added to v 1.2.6 */
# define png_strlen _fstrlen
# define png_memcmp _fmemcmp /* SJT: added */
# define png_memcpy _fmemcpy
# define png_memset _fmemset
# define png_sprintf sprintf
#else
# ifdef _WINDOWS_ /* Favor Windows over C runtime fns */
# define CVT_PTR(ptr) (ptr)
# define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_strcpy lstrcpyA
# define png_strncpy lstrcpynA
# define png_strlen lstrlenA
# define png_memcmp memcmp
# define png_memcpy CopyMemory
# define png_memset memset
# define png_sprintf wsprintfA
# else
# define CVT_PTR(ptr) (ptr)
# define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_strcpy strcpy
# define png_strncpy strncpy /* Added to v 1.2.6 */
# define png_strlen strlen
# define png_memcmp memcmp /* SJT: added */
# define png_memcpy memcpy
# define png_memset memset
# define png_sprintf sprintf
# endif
#endif
/* End of memory model/platform independent support */
 
#ifndef PNG_NO_SNPRINTF
# ifdef _MSC_VER
# define png_snprintf _snprintf /* Added to v 1.2.19 */
# define png_snprintf2 _snprintf
# define png_snprintf6 _snprintf
# else
# define png_snprintf snprintf /* Added to v 1.2.19 */
# define png_snprintf2 snprintf
# define png_snprintf6 snprintf
# endif
#else
/* You don't have or don't want to use snprintf(). Caution: Using
* sprintf instead of snprintf exposes your application to accidental
* or malevolent buffer overflows. If you don't have snprintf()
* as a general rule you should provide one (you can get one from
* Portable OpenSSH).
*/
# define png_snprintf(s1,n,fmt,x1) png_sprintf(s1,fmt,x1)
# define png_snprintf2(s1,n,fmt,x1,x2) png_sprintf(s1,fmt,x1,x2)
# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
png_sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
#endif
/* End of 1.5.0beta36 move from pngconf.h */
 
/* CONSTANTS and UTILITY MACROS
* These are used internally by libpng and not exposed in the API
*/
 
/* Various modes of operation. Note that after an init, mode is set to
* zero automatically when the structure is created.
*/
#define PNG_HAVE_IHDR 0x01
#define PNG_HAVE_PLTE 0x02
#define PNG_HAVE_IDAT 0x04
#define PNG_AFTER_IDAT 0x08 /* Have complete zlib datastream */
#define PNG_HAVE_IEND 0x10
#define PNG_HAVE_gAMA 0x20
#define PNG_HAVE_cHRM 0x40
#define PNG_HAVE_sRGB 0x80
#define PNG_HAVE_CHUNK_HEADER 0x100
#define PNG_WROTE_tIME 0x200
#define PNG_WROTE_INFO_BEFORE_PLTE 0x400
#define PNG_BACKGROUND_IS_GRAY 0x800
#define PNG_HAVE_PNG_SIGNATURE 0x1000
#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
 
/* Flags for the transformations the PNG library does on the image data */
#define PNG_BGR 0x0001
#define PNG_INTERLACE 0x0002
#define PNG_PACK 0x0004
#define PNG_SHIFT 0x0008
#define PNG_SWAP_BYTES 0x0010
#define PNG_INVERT_MONO 0x0020
#define PNG_QUANTIZE 0x0040
#define PNG_BACKGROUND 0x0080
#define PNG_BACKGROUND_EXPAND 0x0100
/* 0x0200 unused */
#define PNG_16_TO_8 0x0400
#define PNG_RGBA 0x0800
#define PNG_EXPAND 0x1000
#define PNG_GAMMA 0x2000
#define PNG_GRAY_TO_RGB 0x4000
#define PNG_FILLER 0x8000L
#define PNG_PACKSWAP 0x10000L
#define PNG_SWAP_ALPHA 0x20000L
#define PNG_STRIP_ALPHA 0x40000L
#define PNG_INVERT_ALPHA 0x80000L
#define PNG_USER_TRANSFORM 0x100000L
#define PNG_RGB_TO_GRAY_ERR 0x200000L
#define PNG_RGB_TO_GRAY_WARN 0x400000L
#define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */
/* 0x800000L Unused */
#define PNG_ADD_ALPHA 0x1000000L /* Added to libpng-1.2.7 */
#define PNG_EXPAND_tRNS 0x2000000L /* Added to libpng-1.2.9 */
/* 0x4000000L unused */
/* 0x8000000L unused */
/* 0x10000000L unused */
/* 0x20000000L unused */
/* 0x40000000L unused */
 
/* Flags for png_create_struct */
#define PNG_STRUCT_PNG 0x0001
#define PNG_STRUCT_INFO 0x0002
 
/* Scaling factor for filter heuristic weighting calculations */
#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT))
#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT))
 
/* Flags for the png_ptr->flags rather than declaring a byte for each one */
#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001
#define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002
#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL 0x0004
#define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS 0x0008
#define PNG_FLAG_ZLIB_CUSTOM_METHOD 0x0010
#define PNG_FLAG_ZLIB_FINISHED 0x0020
#define PNG_FLAG_ROW_INIT 0x0040
#define PNG_FLAG_FILLER_AFTER 0x0080
#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100
#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200
#define PNG_FLAG_CRC_CRITICAL_USE 0x0400
#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800
/* 0x1000 unused */
/* 0x2000 unused */
/* 0x4000 unused */
#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L
#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L
#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L
#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L
#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L
#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L
#define PNG_FLAG_ADD_ALPHA 0x200000L /* Added to libpng-1.2.8 */
#define PNG_FLAG_STRIP_ALPHA 0x400000L /* Added to libpng-1.2.8 */
#define PNG_FLAG_BENIGN_ERRORS_WARN 0x800000L /* Added to libpng-1.4.0 */
/* 0x1000000L unused */
/* 0x2000000L unused */
/* 0x4000000L unused */
/* 0x8000000L unused */
/* 0x10000000L unused */
/* 0x20000000L unused */
/* 0x40000000L unused */
 
#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
PNG_FLAG_CRC_ANCILLARY_NOWARN)
 
#define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \
PNG_FLAG_CRC_CRITICAL_IGNORE)
 
#define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \
PNG_FLAG_CRC_CRITICAL_MASK)
 
/* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib
* can handle at once. This type need be no larger than 16 bits (so maximum of
* 65535), this define allows us to discover how big it is, but limited by the
* maximuum for png_size_t. The value can be overriden in a library build
* (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably
* lower value (e.g. 255 works). A lower value may help memory usage (slightly)
* and may even improve performance on some systems (and degrade it on others.)
*/
#ifndef ZLIB_IO_MAX
# define ZLIB_IO_MAX ((uInt)-1)
#endif
 
/* Save typing and make code easier to understand */
 
#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
abs((int)((c1).green) - (int)((c2).green)) + \
abs((int)((c1).blue) - (int)((c2).blue)))
 
/* Added to libpng-1.2.6 JB */
#define PNG_ROWBYTES(pixel_bits, width) \
((pixel_bits) >= 8 ? \
((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \
(( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) )
 
/* PNG_OUT_OF_RANGE returns true if value is outside the range
* ideal-delta..ideal+delta. Each argument is evaluated twice.
* "ideal" and "delta" should be constants, normally simple
* integers, "value" a variable. Added to libpng-1.2.6 JB
*/
#define PNG_OUT_OF_RANGE(value, ideal, delta) \
( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) )
 
/* Conversions between fixed and floating point, only defined if
* required (to make sure the code doesn't accidentally use float
* when it is supposedly disabled.)
*/
#ifdef PNG_FLOATING_POINT_SUPPORTED
/* The floating point conversion can't overflow, though it can and
* does lose accuracy relative to the original fixed point value.
* In practice this doesn't matter because png_fixed_point only
* stores numbers with very low precision. The png_ptr and s
* arguments are unused by default but are there in case error
* checking becomes a requirement.
*/
#define png_float(png_ptr, fixed, s) (.00001 * (fixed))
 
/* The fixed point conversion performs range checking and evaluates
* its argument multiple times, so must be used with care. The
* range checking uses the PNG specification values for a signed
* 32 bit fixed point value except that the values are deliberately
* rounded-to-zero to an integral value - 21474 (21474.83 is roughly
* (2^31-1) * 100000). 's' is a string that describes the value being
* converted.
*
* NOTE: this macro will raise a png_error if the range check fails,
* therefore it is normally only appropriate to use this on values
* that come from API calls or other sources where an out of range
* error indicates a programming error, not a data error!
*
* NOTE: by default this is off - the macro is not used - because the
* function call saves a lot of code.
*/
#ifdef PNG_FIXED_POINT_MACRO_SUPPORTED
#define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\
((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0))
#else
PNG_EXTERN png_fixed_point png_fixed PNGARG((png_structp png_ptr, double fp,
png_const_charp text));
#endif
#endif
 
/* Constant strings for known chunk types. If you need to add a chunk,
* define the name here, and add an invocation of the macro wherever it's
* needed.
*/
#define PNG_IHDR PNG_CONST png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'}
#define PNG_IDAT PNG_CONST png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'}
#define PNG_IEND PNG_CONST png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'}
#define PNG_PLTE PNG_CONST png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'}
#define PNG_bKGD PNG_CONST png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'}
#define PNG_cHRM PNG_CONST png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'}
#define PNG_gAMA PNG_CONST png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'}
#define PNG_hIST PNG_CONST png_byte png_hIST[5] = {104, 73, 83, 84, '\0'}
#define PNG_iCCP PNG_CONST png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'}
#define PNG_iTXt PNG_CONST png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'}
#define PNG_oFFs PNG_CONST png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'}
#define PNG_pCAL PNG_CONST png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'}
#define PNG_sCAL PNG_CONST png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'}
#define PNG_pHYs PNG_CONST png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'}
#define PNG_sBIT PNG_CONST png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'}
#define PNG_sPLT PNG_CONST png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'}
#define PNG_sRGB PNG_CONST png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'}
#define PNG_sTER PNG_CONST png_byte png_sTER[5] = {115, 84, 69, 82, '\0'}
#define PNG_tEXt PNG_CONST png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'}
#define PNG_tIME PNG_CONST png_byte png_tIME[5] = {116, 73, 77, 69, '\0'}
#define PNG_tRNS PNG_CONST png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'}
#define PNG_zTXt PNG_CONST png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'}
 
 
/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
/* These functions are used internally in the code. They generally
* shouldn't be used unless you are writing code to add or replace some
* functionality in libpng. More information about most functions can
* be found in the files where the functions are located.
*/
 
/* Allocate memory for an internal libpng struct */
PNG_EXTERN PNG_FUNCTION(png_voidp,png_create_struct,PNGARG((int type)),
PNG_ALLOCATED);
 
/* Free memory from internal libpng struct */
PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr));
 
PNG_EXTERN PNG_FUNCTION(png_voidp,png_create_struct_2,
PNGARG((int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)),
PNG_ALLOCATED);
PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr,
png_free_ptr free_fn, png_voidp mem_ptr));
 
/* Free any memory that info_ptr points to and reset struct. */
PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
png_infop info_ptr));
 
/* Function to allocate memory for zlib. PNGAPI is disallowed. */
PNG_EXTERN PNG_FUNCTION(voidpf,png_zalloc,PNGARG((voidpf png_ptr, uInt items,
uInt size)),PNG_ALLOCATED);
 
/* Function to free memory for zlib. PNGAPI is disallowed. */
PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr));
 
/* Next four functions are used internally as callbacks. PNGCBAPI is required
* but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3, changed to
* PNGCBAPI at 1.5.0
*/
 
PNG_EXTERN void PNGCBAPI png_default_read_data PNGARG((png_structp png_ptr,
png_bytep data, png_size_t length));
 
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
PNG_EXTERN void PNGCBAPI png_push_fill_buffer PNGARG((png_structp png_ptr,
png_bytep buffer, png_size_t length));
#endif
 
PNG_EXTERN void PNGCBAPI png_default_write_data PNGARG((png_structp png_ptr,
png_bytep data, png_size_t length));
 
#ifdef PNG_WRITE_FLUSH_SUPPORTED
# ifdef PNG_STDIO_SUPPORTED
PNG_EXTERN void PNGCBAPI png_default_flush PNGARG((png_structp png_ptr));
# endif
#endif
 
/* Reset the CRC variable */
PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
 
/* Write the "data" buffer to whatever output you are using */
PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr,
png_const_bytep data, png_size_t length));
 
/* Read and check the PNG file signature */
PNG_EXTERN void png_read_sig PNGARG((png_structp png_ptr, png_infop info_ptr));
 
/* Read the chunk header (length + type name) */
PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr));
 
/* Read data from whatever input you are using into the "data" buffer */
PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data,
png_size_t length));
 
/* Read bytes into buf, and update png_ptr->crc */
PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf,
png_size_t length));
 
/* Decompress data in a chunk that uses compression */
#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \
defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED)
PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr,
int comp_type, png_size_t chunklength, png_size_t prefix_length,
png_size_t *data_length));
#endif
 
/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */
PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip));
 
/* Read the CRC from the file and compare it to the libpng calculated CRC */
PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr));
 
/* Calculate the CRC over a section of data. Note that we are only
* passing a maximum of 64K on systems that have this as a memory limit,
* since this is the maximum buffer size we can specify.
*/
PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr,
png_const_bytep ptr, png_size_t length));
 
#ifdef PNG_WRITE_FLUSH_SUPPORTED
PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
#endif
 
/* Write various chunks */
 
/* Write the IHDR chunk, and update the png_struct with the necessary
* information.
*/
PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width,
png_uint_32 height,
int bit_depth, int color_type, int compression_method, int filter_method,
int interlace_method));
 
PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr,
png_const_colorp palette, png_uint_32 num_pal));
 
PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data,
png_size_t length));
 
PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr));
 
#ifdef PNG_WRITE_gAMA_SUPPORTED
# ifdef PNG_FLOATING_POINT_SUPPORTED
PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma));
# endif
# ifdef PNG_FIXED_POINT_SUPPORTED
PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr,
png_fixed_point file_gamma));
# endif
#endif
 
#ifdef PNG_WRITE_sBIT_SUPPORTED
PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr,
png_const_color_8p sbit, int color_type));
#endif
 
#ifdef PNG_WRITE_cHRM_SUPPORTED
# ifdef PNG_FLOATING_POINT_SUPPORTED
PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr,
double white_x, double white_y,
double red_x, double red_y, double green_x, double green_y,
double blue_x, double blue_y));
# endif
PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr,
png_fixed_point int_white_x, png_fixed_point int_white_y,
png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
png_fixed_point int_blue_y));
#endif
 
#ifdef PNG_WRITE_sRGB_SUPPORTED
PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr,
int intent));
#endif
 
#ifdef PNG_WRITE_iCCP_SUPPORTED
PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr,
png_const_charp name, int compression_type,
png_const_charp profile, int proflen));
/* Note to maintainer: profile should be png_bytep */
#endif
 
#ifdef PNG_WRITE_sPLT_SUPPORTED
PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr,
png_const_sPLT_tp palette));
#endif
 
#ifdef PNG_WRITE_tRNS_SUPPORTED
PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr,
png_const_bytep trans, png_const_color_16p values, int number,
int color_type));
#endif
 
#ifdef PNG_WRITE_bKGD_SUPPORTED
PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr,
png_const_color_16p values, int color_type));
#endif
 
#ifdef PNG_WRITE_hIST_SUPPORTED
PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr,
png_const_uint_16p hist, int num_hist));
#endif
 
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr,
png_const_charp key, png_charpp new_key));
#endif
 
#ifdef PNG_WRITE_tEXt_SUPPORTED
PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_const_charp key,
png_const_charp text, png_size_t text_len));
#endif
 
#ifdef PNG_WRITE_zTXt_SUPPORTED
PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_const_charp key,
png_const_charp text, png_size_t text_len, int compression));
#endif
 
#ifdef PNG_WRITE_iTXt_SUPPORTED
PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr,
int compression, png_const_charp key, png_const_charp lang,
png_const_charp lang_key, png_const_charp text));
#endif
 
#ifdef PNG_TEXT_SUPPORTED /* Added at version 1.0.14 and 1.2.4 */
PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr,
png_infop info_ptr, png_const_textp text_ptr, int num_text));
#endif
 
#ifdef PNG_WRITE_oFFs_SUPPORTED
PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
png_int_32 x_offset, png_int_32 y_offset, int unit_type));
#endif
 
#ifdef PNG_WRITE_pCAL_SUPPORTED
PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose,
png_int_32 X0, png_int_32 X1, int type, int nparams,
png_const_charp units, png_charpp params));
#endif
 
#ifdef PNG_WRITE_pHYs_SUPPORTED
PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr,
png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit,
int unit_type));
#endif
 
#ifdef PNG_WRITE_tIME_SUPPORTED
PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr,
png_const_timep mod_time));
#endif
 
#ifdef PNG_WRITE_sCAL_SUPPORTED
PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr,
int unit, png_const_charp width, png_const_charp height));
#endif
 
/* Called when finished processing a row of data */
PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr));
 
/* Internal use only. Called before first row of data */
PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr));
 
/* Combine a row of data, dealing with alpha, etc. if requested */
PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row,
int mask));
 
#ifdef PNG_READ_INTERLACING_SUPPORTED
/* Expand an interlaced row */
/* OLD pre-1.0.9 interface:
PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info,
png_bytep row, int pass, png_uint_32 transformations));
*/
PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr));
#endif
 
/* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */
 
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
/* Grab pixels out of a row for an interlaced pass */
PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info,
png_bytep row, int pass));
#endif
 
/* Unfilter a row */
PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr,
png_row_infop row_info, png_bytep row, png_const_bytep prev_row,
int filter));
 
/* Choose the best filter to use and filter the row data */
PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr,
png_row_infop row_info));
 
/* Write out the filtered row. */
PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr,
png_bytep filtered_row));
/* Finish a row while reading, dealing with interlacing passes, etc. */
PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr));
 
/* Initialize the row buffers, etc. */
PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr));
/* Optional call to update the users info structure */
PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr,
png_infop info_ptr));
 
/* These are the functions that do the transformations */
#ifdef PNG_READ_FILLER_SUPPORTED
PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info,
png_bytep row, png_uint_32 filler, png_uint_32 flags));
#endif
 
#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info,
png_bytep row));
#endif
 
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info,
png_bytep row));
#endif
 
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info,
png_bytep row));
#endif
 
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info,
png_bytep row));
#endif
 
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info,
png_bytep row, png_uint_32 flags));
#endif
 
#ifdef PNG_16BIT_SUPPORTED
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info,
png_bytep row));
#endif
#endif
 
#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \
defined(PNG_WRITE_PACKSWAP_SUPPORTED)
PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info,
png_bytep row));
#endif
 
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr,
png_row_infop row_info, png_bytep row));
#endif
 
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info,
png_bytep row));
#endif
 
#ifdef PNG_READ_PACK_SUPPORTED
PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info,
png_bytep row));
#endif
 
#ifdef PNG_READ_SHIFT_SUPPORTED
PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info,
png_bytep row, png_const_color_8p sig_bits));
#endif
 
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info,
png_bytep row));
#endif
 
#ifdef PNG_READ_16_TO_8_SUPPORTED
PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info,
png_bytep row));
#endif
 
#ifdef PNG_READ_QUANTIZE_SUPPORTED
PNG_EXTERN void png_do_quantize PNGARG((png_row_infop row_info,
png_bytep row, png_const_bytep palette_lookup,
png_const_bytep quantize_lookup));
 
# ifdef PNG_CORRECT_PALETTE_SUPPORTED
PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr,
png_colorp palette, int num_palette));
# endif
#endif
 
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info,
png_bytep row));
#endif
 
#ifdef PNG_WRITE_PACK_SUPPORTED
PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info,
png_bytep row, png_uint_32 bit_depth));
#endif
 
#ifdef PNG_WRITE_SHIFT_SUPPORTED
PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info,
png_bytep row, png_const_color_8p bit_depth));
#endif
 
#ifdef PNG_READ_BACKGROUND_SUPPORTED
# ifdef PNG_READ_GAMMA_SUPPORTED
PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info,
png_bytep row, png_const_color_16p trans_color,
png_const_color_16p background, png_const_color_16p background_1,
png_const_bytep gamma_table, png_const_bytep gamma_from_1,
png_const_bytep gamma_to_1, png_const_uint_16pp gamma_16,
png_const_uint_16pp gamma_16_from_1, png_const_uint_16pp gamma_16_to_1,
int gamma_shift));
# else
PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info,
png_bytep row, png_const_color_16p trans_color,
png_const_color_16p background));
# endif
#endif
 
#ifdef PNG_READ_GAMMA_SUPPORTED
PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info,
png_bytep row, png_const_bytep gamma_table,
png_const_uint_16pp gamma_16_table, int gamma_shift));
#endif
 
#ifdef PNG_READ_EXPAND_SUPPORTED
PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info,
png_bytep row, png_const_colorp palette, png_const_bytep trans,
int num_trans));
PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info,
png_bytep row, png_const_color_16p trans_color));
#endif
 
/* The following decodes the appropriate chunks, and does error correction,
* then calls the appropriate callback for the chunk if it is valid.
*/
 
/* Decode the IHDR chunk */
PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
 
#ifdef PNG_READ_bKGD_SUPPORTED
PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_cHRM_SUPPORTED
PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_gAMA_SUPPORTED
PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_hIST_SUPPORTED
PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_iCCP_SUPPORTED
PNG_EXTERN void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif /* PNG_READ_iCCP_SUPPORTED */
 
#ifdef PNG_READ_iTXt_SUPPORTED
PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_oFFs_SUPPORTED
PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_pCAL_SUPPORTED
PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_pHYs_SUPPORTED
PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_sBIT_SUPPORTED
PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_sCAL_SUPPORTED
PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_sPLT_SUPPORTED
PNG_EXTERN void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif /* PNG_READ_sPLT_SUPPORTED */
 
#ifdef PNG_READ_sRGB_SUPPORTED
PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_tEXt_SUPPORTED
PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_tIME_SUPPORTED
PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_tRNS_SUPPORTED
PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
#ifdef PNG_READ_zTXt_SUPPORTED
PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
 
PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
png_infop info_ptr, png_uint_32 length));
 
PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr,
png_const_bytep chunk_name));
 
/* Handle the transformations for reading and writing */
PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr));
PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr));
 
PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr));
 
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr,
png_infop info_ptr));
PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr,
png_infop info_ptr));
PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr));
PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr,
png_uint_32 length));
PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr));
PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr,
png_bytep buffer, png_size_t buffer_length));
PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr));
PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr,
png_bytep buffer, png_size_t buffer_length));
PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr));
PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr,
png_infop info_ptr, png_uint_32 length));
PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr,
png_infop info_ptr));
PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr,
png_infop info_ptr));
PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row));
PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr,
png_infop info_ptr));
PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr,
png_infop info_ptr));
PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr));
# ifdef PNG_READ_tEXt_SUPPORTED
PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr,
png_infop info_ptr, png_uint_32 length));
PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr,
png_infop info_ptr));
# endif
# ifdef PNG_READ_zTXt_SUPPORTED
PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr,
png_infop info_ptr, png_uint_32 length));
PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr,
png_infop info_ptr));
# endif
# ifdef PNG_READ_iTXt_SUPPORTED
PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr,
png_infop info_ptr, png_uint_32 length));
PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr,
png_infop info_ptr));
# endif
 
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 
#ifdef PNG_MNG_FEATURES_SUPPORTED
PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info,
png_bytep row));
PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info,
png_bytep row));
#endif
 
/* Added at libpng version 1.4.0 */
#ifdef PNG_CHECK_cHRM_SUPPORTED
PNG_EXTERN int png_check_cHRM_fixed PNGARG((png_structp png_ptr,
png_fixed_point int_white_x, png_fixed_point int_white_y,
png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
png_fixed_point int_blue_y));
#endif
 
#ifdef PNG_CHECK_cHRM_SUPPORTED
/* Added at libpng version 1.2.34 and 1.4.0 */
/* Currently only used by png_check_cHRM_fixed */
PNG_EXTERN void png_64bit_product PNGARG((long v1, long v2,
unsigned long *hi_product, unsigned long *lo_product));
#endif
 
/* Added at libpng version 1.4.0 */
PNG_EXTERN void png_check_IHDR PNGARG((png_structp png_ptr,
png_uint_32 width, png_uint_32 height, int bit_depth,
int color_type, int interlace_type, int compression_type,
int filter_type));
 
/* Free all memory used by the read (old method - NOT DLL EXPORTED) */
PNG_EXTERN void png_read_destroy PNGARG((png_structp png_ptr,
png_infop info_ptr, png_infop end_info_ptr));
 
/* Free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
PNG_EXTERN void png_write_destroy PNGARG((png_structp png_ptr));
 
#ifdef USE_FAR_KEYWORD /* memory model conversion function */
PNG_EXTERN void *png_far_to_near PNGARG((png_structp png_ptr, png_voidp ptr,
int check));
#endif /* USE_FAR_KEYWORD */
 
#if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
PNG_EXTERN PNG_FUNCTION(void, png_fixed_error, (png_structp png_ptr,
png_const_charp name),PNG_NORETURN);
#endif
 
/* ASCII to FP interfaces, currently only implemented if sCAL
* support is required.
*/
#if defined(PNG_READ_sCAL_SUPPORTED)
/* MAX_DIGITS is actually the maximum number of characters in an sCAL
* width or height, derived from the precision (number of significant
* digits - a build time settable option) and assumpitions about the
* maximum ridiculous exponent.
*/
#define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/)
 
#ifdef PNG_FLOATING_POINT_SUPPORTED
PNG_EXTERN void png_ascii_from_fp PNGARG((png_structp png_ptr, png_charp ascii,
png_size_t size, double fp, unsigned int precision));
#endif /* FLOATING_POINT */
 
#ifdef PNG_FIXED_POINT_SUPPORTED
PNG_EXTERN void png_ascii_from_fixed PNGARG((png_structp png_ptr,
png_charp ascii, png_size_t size, png_fixed_point fp));
#endif /* FIXED_POINT */
#endif /* READ_sCAL */
 
#if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED)
/* An internal API to validate the format of a floating point number.
* The result is the index of the next character. If the number is
* not valid it will be the index of a character in the supposed number.
*
* The format of a number is defined in the PNG extensions specification
* and this API is strictly conformant to that spec, not anyone elses!
*
* The format as a regular expression is:
*
* [+-]?[0-9]+.?([Ee][+-]?[0-9]+)?
*
* or:
*
* [+-]?.[0-9]+(.[0-9]+)?([Ee][+-]?[0-9]+)?
*
* The complexity is that either integer or fraction must be present and the
* fraction is permitted to have no digits only if the integer is present.
*
* NOTE: The dangling E problem.
* There is a PNG valid floating point number in the following:
*
* PNG floating point numb1.ers are not greedy.
*
* Working this out requires *TWO* character lookahead (because of the
* sign), the parser does not do this - it will fail at the 'r' - this
* doesn't matter for PNG sCAL chunk values, but it requires more care
* if the value were ever to be embedded in something more complex. Use
* ANSI-C strtod if you need the lookahead.
*/
/* State table for the parser. */
#define PNG_FP_INTEGER 0 /* before or in integer */
#define PNG_FP_FRACTION 1 /* before or in fraction */
#define PNG_FP_EXPONENT 2 /* before or in exponent */
#define PNG_FP_STATE 3 /* mask for the above */
#define PNG_FP_SAW_SIGN 4 /* Saw +/- in current state */
#define PNG_FP_SAW_DIGIT 8 /* Saw a digit in current state */
#define PNG_FP_SAW_DOT 16 /* Saw a dot in current state */
#define PNG_FP_SAW_E 32 /* Saw an E (or e) in current state */
#define PNG_FP_SAW_ANY 60 /* Saw any of the above 4 */
#define PNG_FP_WAS_VALID 64 /* Preceding substring is a valid fp number */
#define PNG_FP_INVALID 128 /* Available for callers as a distinct value */
 
/* Result codes for the parser (boolean - true meants ok, false means
* not ok yet.)
*/
#define PNG_FP_MAYBE 0 /* The number may be valid in the future */
#define PNG_FP_OK 1 /* The number is valid */
 
/* The actual parser. This can be called repeatedly, it updates
* the index into the string and the state variable (which must
* be initialzed to 0). It returns a result code, as above. There
* is no point calling the parser any more if it fails to advance to
* the end of the string - it is stuck on an invalid character (or
* terminated by '\0').
*
* Note that the pointer will consume an E or even an E+ then leave
* a 'maybe' state even though a preceding integer.fraction is valid.
* The PNG_FP_WAS_VALID flag indicates that a preceding substring was
* a valid number. It's possible to recover from this by calling
* the parser again (from the start, with state 0) but with a string
* that omits the last character (i.e. set the size to the index of
* the problem character.) This has not been tested within libpng.
*/
PNG_EXTERN int png_check_fp_number PNGARG((png_const_charp string,
png_size_t size, int *statep, png_size_tp whereami));
 
/* This is the same but it checks a complete string and returns true
* only if it just contains a floating point number.
*/
PNG_EXTERN int png_check_fp_string PNGARG((png_const_charp string,
png_size_t size));
#endif /* pCAL || sCAL */
 
#if defined(PNG_READ_GAMMA_SUPPORTED) ||\
defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED)
/* Added at libpng version 1.5.0 */
/* This is a utility to provide a*times/div (rounded) and indicate
* if there is an overflow. The result is a boolean - false (0)
* for overflow, true (1) if no overflow, in which case *res
* holds the result.
*/
PNG_EXTERN int png_muldiv PNGARG((png_fixed_point_p res, png_fixed_point a,
png_int_32 times, png_int_32 div));
#endif
 
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
/* Same deal, but issue a warning on overflow and return 0. */
PNG_EXTERN png_fixed_point png_muldiv_warn PNGARG((png_structp png_ptr,
png_fixed_point a, png_int_32 times, png_int_32 div));
#endif
 
#ifdef PNG_READ_GAMMA_SUPPORTED
/* Calculate a reciprocal - used for gamma values. This returns
* 0 if the argument is 0 in order to maintain an undefined value,
* there are no warnings.
*/
PNG_EXTERN png_fixed_point png_reciprocal PNGARG((png_fixed_point a));
 
/* The same but gives a reciprocal of the product of two fixed point
* values. Accuracy is suitable for gamma calculations but this is
* not exact - use png_muldiv for that.
*/
PNG_EXTERN png_fixed_point png_reciprocal2 PNGARG((png_fixed_point a,
png_fixed_point b));
#endif
 
#ifdef PNG_READ_GAMMA_SUPPORTED
/* Internal fixed point gamma correction. These APIs are called as
* required to convert single values - they don't need to be fast,
* they are not used when processing image pixel values.
*
* While the input is an 'unsigned' value it must actually be the
* correct bit value - 0..255 or 0..65535 as required.
*/
PNG_EXTERN png_uint_16 png_gamma_correct PNGARG((png_structp png_ptr,
unsigned int value, png_fixed_point gamma));
PNG_EXTERN int png_gamma_significant PNGARG((png_fixed_point gamma));
PNG_EXTERN png_uint_16 png_gamma_16bit_correct PNGARG((unsigned int value,
png_fixed_point gamma));
PNG_EXTERN png_byte png_gamma_8bit_correct PNGARG((unsigned int value,
png_fixed_point gamma));
PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr,
int bit_depth));
#endif
 
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
 
 
#include "pngdebug.h"
 
#ifdef __cplusplus
}
#endif
 
#endif /* PNGPRIV_H */
/contrib/media/updf/include/pngstruct.h
0,0 → 1,308
 
/* pngstruct.h - header file for PNG reference library
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Last changed in libpng 1.5.0 [January 6, 2011]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
 
/* The structure that holds the information to read and write PNG files.
* The only people who need to care about what is inside of this are the
* people who will be modifying the library for their own special needs.
* It should NOT be accessed directly by an application.
*/
 
#ifndef PNGSTRUCT_H
#define PNGSTRUCT_H
/* zlib.h defines the structure z_stream, an instance of which is included
* in this structure and is required for decompressing the LZ compressed
* data in PNG files.
*/
#include "zlib.h"
 
struct png_struct_def
{
#ifdef PNG_SETJMP_SUPPORTED
jmp_buf png_jmpbuf; /* used in png_error */
png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */
#endif
png_error_ptr error_fn; /* function for printing errors and aborting */
png_error_ptr warning_fn; /* function for printing warnings */
png_voidp error_ptr; /* user supplied struct for error functions */
png_rw_ptr write_data_fn; /* function for writing output data */
png_rw_ptr read_data_fn; /* function for reading input data */
png_voidp io_ptr; /* ptr to application struct for I/O functions */
 
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
png_user_transform_ptr read_user_transform_fn; /* user read transform */
#endif
 
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
png_user_transform_ptr write_user_transform_fn; /* user write transform */
#endif
 
/* These were added in libpng-1.0.2 */
#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
png_voidp user_transform_ptr; /* user supplied struct for user transform */
png_byte user_transform_depth; /* bit depth of user transformed pixels */
png_byte user_transform_channels; /* channels in user transformed pixels */
#endif
#endif
 
png_uint_32 mode; /* tells us where we are in the PNG file */
png_uint_32 flags; /* flags indicating various things to libpng */
png_uint_32 transformations; /* which transformations to perform */
 
z_stream zstream; /* pointer to decompression structure (below) */
png_bytep zbuf; /* buffer for zlib */
uInt zbuf_size; /* size of zbuf (typically 65536) */
int zlib_level; /* holds zlib compression level */
int zlib_method; /* holds zlib compression method */
int zlib_window_bits; /* holds zlib compression window bits */
int zlib_mem_level; /* holds zlib compression memory level */
int zlib_strategy; /* holds zlib compression strategy */
 
png_uint_32 width; /* width of image in pixels */
png_uint_32 height; /* height of image in pixels */
png_uint_32 num_rows; /* number of rows in current pass */
png_uint_32 usr_width; /* width of row at start of write */
png_size_t rowbytes; /* size of row in bytes */
png_uint_32 iwidth; /* width of current interlaced row in pixels */
png_uint_32 row_number; /* current row in interlace pass */
png_bytep prev_row; /* buffer to save previous (unfiltered) row */
png_bytep row_buf; /* buffer to save current (unfiltered) row */
png_bytep sub_row; /* buffer to save "sub" row when filtering */
png_bytep up_row; /* buffer to save "up" row when filtering */
png_bytep avg_row; /* buffer to save "avg" row when filtering */
png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */
png_row_info row_info; /* used for transformation routines */
 
png_uint_32 idat_size; /* current IDAT size for read */
png_uint_32 crc; /* current chunk CRC value */
png_colorp palette; /* palette from the input file */
png_uint_16 num_palette; /* number of color entries in palette */
png_uint_16 num_trans; /* number of transparency values */
png_byte chunk_name[5]; /* null-terminated name of current chunk */
png_byte compression; /* file compression type (always 0) */
png_byte filter; /* file filter type (always 0) */
png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
png_byte pass; /* current interlace pass (0 - 6) */
png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */
png_byte color_type; /* color type of file */
png_byte bit_depth; /* bit depth of file */
png_byte usr_bit_depth; /* bit depth of users row */
png_byte pixel_depth; /* number of bits per pixel */
png_byte channels; /* number of channels in file */
png_byte usr_channels; /* channels at start of write */
png_byte sig_bytes; /* magic bytes read/written from start of file */
 
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
png_uint_16 filler; /* filler bytes for pixel expansion */
#endif
 
#ifdef PNG_bKGD_SUPPORTED
png_byte background_gamma_type;
png_fixed_point background_gamma;
png_color_16 background; /* background color in screen gamma space */
#ifdef PNG_READ_GAMMA_SUPPORTED
png_color_16 background_1; /* background normalized to gamma 1.0 */
#endif
#endif /* PNG_bKGD_SUPPORTED */
 
#ifdef PNG_WRITE_FLUSH_SUPPORTED
png_flush_ptr output_flush_fn; /* Function for flushing output */
png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */
png_uint_32 flush_rows; /* number of rows written since last flush */
#endif
 
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */
png_fixed_point gamma; /* file gamma value */
png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */
#endif
 
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
png_bytep gamma_table; /* gamma table for 8-bit depth files */
png_bytep gamma_from_1; /* converts from 1.0 to screen */
png_bytep gamma_to_1; /* converts from file to 1.0 */
png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */
png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */
png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */
#endif
 
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED)
png_color_8 sig_bit; /* significant bits in each available channel */
#endif
 
#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
png_color_8 shift; /* shift for significant bit tranformation */
#endif
 
#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \
|| defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
png_bytep trans_alpha; /* alpha values for paletted files */
png_color_16 trans_color; /* transparent color for non-paletted files */
#endif
 
png_read_status_ptr read_row_fn; /* called after each row is decoded */
png_write_status_ptr write_row_fn; /* called after each row is encoded */
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
png_progressive_info_ptr info_fn; /* called after header data fully read */
png_progressive_row_ptr row_fn; /* called after a prog. row is decoded */
png_progressive_end_ptr end_fn; /* called after image is complete */
png_bytep save_buffer_ptr; /* current location in save_buffer */
png_bytep save_buffer; /* buffer for previously read data */
png_bytep current_buffer_ptr; /* current location in current_buffer */
png_bytep current_buffer; /* buffer for recently used data */
png_uint_32 push_length; /* size of current input chunk */
png_uint_32 skip_length; /* bytes to skip in input data */
png_size_t save_buffer_size; /* amount of data now in save_buffer */
png_size_t save_buffer_max; /* total size of save_buffer */
png_size_t buffer_size; /* total amount of available input data */
png_size_t current_buffer_size; /* amount of data now in current_buffer */
int process_mode; /* what push library is currently doing */
int cur_palette; /* current push library palette index */
 
# ifdef PNG_TEXT_SUPPORTED
png_size_t current_text_size; /* current size of text input data */
png_size_t current_text_left; /* how much text left to read in input */
png_charp current_text; /* current text chunk buffer */
png_charp current_text_ptr; /* current location in current_text */
# endif /* PNG_PROGRESSIVE_READ_SUPPORTED && PNG_TEXT_SUPPORTED */
 
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
/* For the Borland special 64K segment handler */
png_bytepp offset_table_ptr;
png_bytep offset_table;
png_uint_16 offset_table_number;
png_uint_16 offset_table_count;
png_uint_16 offset_table_count_free;
#endif
 
#ifdef PNG_READ_QUANTIZE_SUPPORTED
png_bytep palette_lookup; /* lookup table for quantizing */
png_bytep quantize_index; /* index translation for palette files */
#endif
 
#if defined(PNG_READ_QUANTIZE_SUPPORTED) || defined(PNG_hIST_SUPPORTED)
png_uint_16p hist; /* histogram */
#endif
 
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
png_byte heuristic_method; /* heuristic for row filter selection */
png_byte num_prev_filters; /* number of weights for previous rows */
png_bytep prev_filters; /* filter type(s) of previous row(s) */
png_uint_16p filter_weights; /* weight(s) for previous line(s) */
png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */
png_uint_16p filter_costs; /* relative filter calculation cost */
png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */
#endif
 
#ifdef PNG_TIME_RFC1123_SUPPORTED
png_charp time_buffer; /* String to hold RFC 1123 time text */
#endif
 
/* New members added in libpng-1.0.6 */
 
png_uint_32 free_me; /* flags items libpng is responsible for freeing */
 
#ifdef PNG_USER_CHUNKS_SUPPORTED
png_voidp user_chunk_ptr;
png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */
#endif
 
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
int num_chunk_list;
png_bytep chunk_list;
#endif
 
/* New members added in libpng-1.0.3 */
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
png_byte rgb_to_gray_status;
/* These were changed from png_byte in libpng-1.0.6 */
png_uint_16 rgb_to_gray_red_coeff;
png_uint_16 rgb_to_gray_green_coeff;
png_uint_16 rgb_to_gray_blue_coeff;
#endif
 
/* New member added in libpng-1.0.4 (renamed in 1.0.9) */
#if defined(PNG_MNG_FEATURES_SUPPORTED) || \
defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
/* Changed from png_byte to png_uint_32 at version 1.2.0 */
png_uint_32 mng_features_permitted;
#endif
 
/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */
#ifdef PNG_MNG_FEATURES_SUPPORTED
png_byte filter_type;
#endif
 
/* New members added in libpng-1.2.0 */
 
/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */
#ifdef PNG_USER_MEM_SUPPORTED
png_voidp mem_ptr; /* user supplied struct for mem functions */
png_malloc_ptr malloc_fn; /* function for allocating memory */
png_free_ptr free_fn; /* function for freeing memory */
#endif
 
/* New member added in libpng-1.0.13 and 1.2.0 */
png_bytep big_row_buf; /* buffer to save current (unfiltered) row */
 
#ifdef PNG_READ_QUANTIZE_SUPPORTED
/* The following three members were added at version 1.0.14 and 1.2.4 */
png_bytep quantize_sort; /* working sort array */
png_bytep index_to_palette; /* where the original index currently is
in the palette */
png_bytep palette_to_index; /* which original index points to this
palette color */
#endif
 
/* New members added in libpng-1.0.16 and 1.2.6 */
png_byte compression_type;
 
#ifdef PNG_USER_LIMITS_SUPPORTED
png_uint_32 user_width_max;
png_uint_32 user_height_max;
 
/* Added in libpng-1.4.0: Total number of sPLT, text, and unknown
* chunks that can be stored (0 means unlimited).
*/
png_uint_32 user_chunk_cache_max;
 
/* Total memory that a zTXt, sPLT, iTXt, iCCP, or unknown chunk
* can occupy when decompressed. 0 means unlimited.
*/
png_alloc_size_t user_chunk_malloc_max;
#endif
 
/* New member added in libpng-1.0.25 and 1.2.17 */
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
/* Storage for unknown chunk that the library doesn't recognize. */
png_unknown_chunk unknown_chunk;
#endif
 
/* New members added in libpng-1.2.26 */
png_size_t old_big_row_buf_size;
png_size_t old_prev_row_size;
 
/* New member added in libpng-1.2.30 */
png_charp chunkdata; /* buffer for reading chunk data */
 
#ifdef PNG_IO_STATE_SUPPORTED
/* New member added in libpng-1.4.0 */
png_uint_32 io_state;
#endif
};
#endif /* PNGSTRUCT_H */
/contrib/media/updf/include/process.h
0,0 → 1,52
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_process_h_
#define __dj_include_process_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
int _dos_exec(const char *program, const char *args, char *const _envp[]);
 
int execl(const char *_path, const char *_argv0, ...);
int execle(const char *_path, const char *_argv0, ... /*, char *const _envp[] */);
int execlp(const char *_path, const char *_argv0, ...);
int execlpe(const char *_path, const char *_argv0, ... /*, char *const _envp[] */);
 
int execv(const char *_path, char *const _argv[]);
int execve(const char *_path, char *const _argv[], char *const _envp[]);
int execvp(const char *_path, char *const _argv[]);
int execvpe(const char *_path, char *const _argv[], char *const _envp[]);
 
int spawnl(int _mode, const char *_path, const char *_argv0, ...);
int spawnle(int _mode, const char *_path, const char *_argv0, ... /*, char *const _envp[] */);
int spawnlp(int _mode, const char *_path, const char *_argv0, ...);
int spawnlpe(int _mode, const char *_path, const char *_argv0, ... /*, char *const _envp[] */);
 
int spawnv(int _mode, const char *_path, char *const _argv[]);
int spawnve(int _mode, const char *_path, char *const _argv[], char *const _envp[]);
int spawnvp(int _mode, const char *_path, char *const _argv[]);
int spawnvpe(int _mode, const char *_path, char *const _argv[], char *const _envp[]);
 
#define P_WAIT 1
#define P_NOWAIT 2 /* always generates error */
#define P_OVERLAY 3
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_process_h_ */
/contrib/media/updf/include/prototypes.h
0,0 → 1,27
 
/// ===========================================================
 
int file_check(char file[]);
int dir_check(char dir[]);
void dir_truncate(char dir[]);
int iswhite(char c);
void trim(char string[]);
void execute();
void __cdecl kol_main();
 
int executable_run(char cmd[], char args[]);
 
void command_execute();
void command_get();
int command_get_cmd(char cmd[]);
 
int script_check(char file[]);
int script_run(char exec[], char args[]);
 
int aliases_check(char alias[]);
int alias_search(char alias[]);
int alias_add(char alias[]);
int alias_split (char alias[], char s1[], char s2[]);
void alias_list();
 
/// ===========================================================
/contrib/media/updf/include/pwd.h
0,0 → 1,50
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_pwd_h_
#define __dj_include_pwd_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#include <sys/djtypes.h>
 
__DJ_gid_t
#undef __DJ_gid_t
#define __DJ_gid_t
__DJ_uid_t
#undef __DJ_uid_t
#define __DJ_uid_t
 
struct passwd {
char * pw_name;
uid_t pw_uid;
gid_t pw_gid;
char * pw_dir;
char * pw_shell;
};
struct passwd * getpwuid(uid_t _uid);
struct passwd * getpwnam(const char *_name);
 
#ifndef _POSIX_SOURCE
 
struct passwd *getpwent(void);
void setpwent(void);
void endpwent(void);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_pwd_h_ */
/contrib/media/updf/include/queue
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_QUEUE
#include <bits/std_queue.h>
#endif
/contrib/media/updf/include/random.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_random_h_
#define __dj_include_random_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <stdlib.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_random_h_ */
/contrib/media/updf/include/raw.h
0,0 → 1,100
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __RAW_H
#define __RAW_H
/**
@file raw.h
@brief Implementation of operations for raw encoding (RAW)
 
The functions in RAW.C have for goal to realize the operation of raw encoding linked
with the corresponding mode switch.
*/
 
/** @defgroup RAW RAW - Implementation of operations for raw encoding */
/*@{*/
 
/**
RAW encoding operations
*/
typedef struct opj_raw {
/** temporary buffer where bits are coded or decoded */
unsigned char c;
/** number of bits already read or free to write */
unsigned int ct;
/** maximum length to decode */
unsigned int lenmax;
/** length decoded */
unsigned int len;
/** pointer to the current position in the buffer */
unsigned char *bp;
/** pointer to the start of the buffer */
unsigned char *start;
/** pointer to the end of the buffer */
unsigned char *end;
} opj_raw_t;
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Create a new RAW handle
@return Returns a new RAW handle if successful, returns NULL otherwise
*/
opj_raw_t* raw_create(void);
/**
Destroy a previously created RAW handle
@param raw RAW handle to destroy
*/
void raw_destroy(opj_raw_t *raw);
/**
Return the number of bytes written/read since initialisation
@param raw RAW handle to destroy
@return Returns the number of bytes already encoded
*/
int raw_numbytes(opj_raw_t *raw);
/**
Initialize the decoder
@param raw RAW handle
@param bp Pointer to the start of the buffer from which the bytes will be read
@param len Length of the input buffer
*/
void raw_init_dec(opj_raw_t *raw, unsigned char *bp, int len);
/**
Decode a symbol using raw-decoder. Cfr p.506 TAUBMAN
@param raw RAW handle
@return Returns the decoded symbol (0 or 1)
*/
int raw_decode(opj_raw_t *raw);
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __RAW_H */
/contrib/media/updf/include/refcount.h
0,0 → 1,74
#ifndef __refcount_h__
#define __refcount_h__
 
#include "lispassert.h"
#include "yacasbase.h"
 
//------------------------------------------------------------------------------
// RefPtr - Smart pointer for (intrusive) reference counting.
// Simply, an object's reference count is the number of RefPtrs refering to it.
// The RefPtr will delete the referenced object when the count reaches zero.
 
/*TODO: this might be improved a little by having RefPtr wrap the object being
pointed to so the user of RefPtr does not need to add ReferenceCount explicitly.
One can use RefPtr on any arbitrary object from that moment on.
*/
 
typedef ReferenceType ReferenceCount;
 
template<class T>
class RefPtr : public YacasBase // derived, so we can 'NEW LispPtr[nnn]'
{
public:
// Default constructor (not explicit, so it auto-initializes)
inline RefPtr() : iPtr(NULL) {}
// Construct from pointer to T
explicit RefPtr(T *ptr) : iPtr(ptr) { if (ptr) { ptr->iReferenceCount++; } }
// Copy constructor
RefPtr(const RefPtr &refPtr) : iPtr(refPtr.ptr()) { if (iPtr) { iPtr->iReferenceCount++; } }
// Destructor
~RefPtr()
{
if (iPtr)
{
iPtr->iReferenceCount--;
if (iPtr->iReferenceCount == 0)
{
delete iPtr;
}
}
}
// Assignment from pointer
RefPtr &operator=(T *ptr)
{
if (ptr)
{
ptr->iReferenceCount++;
}
if (iPtr)
{
iPtr->iReferenceCount--;
if (iPtr->iReferenceCount == 0)
{
delete iPtr;
}
}
iPtr = ptr;
return *this;
}
// Assignment from another
RefPtr &operator=(const RefPtr &refPtr) { return this->operator=(refPtr.ptr()); }
 
operator T*() const { return iPtr; } // implicit conversion to pointer to T
T &operator*() const { return *iPtr; } // so (*refPtr) is a reference to T
T *operator->() const { return iPtr; } // so (refPtr->member) accesses T's member
T *ptr() const { return iPtr; } // so (refPtr.ptr()) returns the pointer to T (boost calls this method 'get')
bool operator!() const { return !iPtr; } // is null pointer
 
private:
T *iPtr;
};
 
 
#endif
 
/contrib/media/updf/include/regex.h
0,0 → 1,91
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_regex_h_
#define __dj_include_regex_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#define _POSIX2_RE_DUP_MAX 256
 
typedef off_t regoff_t;
typedef struct {
int re_magic;
size_t re_nsub; /* number of parenthesized subexpressions */
const char *re_endp; /* end pointer for REG_PEND */
struct re_guts *re_g; /* none of your business :-) */
} regex_t;
typedef struct {
regoff_t rm_so; /* start of match */
regoff_t rm_eo; /* end of match */
} regmatch_t;
 
 
 
extern int regcomp(regex_t *, const char *, int);
#define REG_BASIC 0000
#define REG_EXTENDED 0001
#define REG_ICASE 0002
#define REG_NOSUB 0004
#define REG_NEWLINE 0010
#define REG_NOSPEC 0020
#define REG_PEND 0040
#define REG_DUMP 0200
 
 
 
#define REG_OKAY 0
#define REG_NOMATCH 1
#define REG_BADPAT 2
#define REG_ECOLLATE 3
#define REG_ECTYPE 4
#define REG_EESCAPE 5
#define REG_ESUBREG 6
#define REG_EBRACK 7
#define REG_EPAREN 8
#define REG_EBRACE 9
#define REG_BADBR 10
#define REG_ERANGE 11
#define REG_ESPACE 12
#define REG_BADRPT 13
#define REG_EMPTY 14
#define REG_ASSERT 15
#define REG_INVARG 16
#define REG_ATOI 255 /* convert name to number (!) */
#define REG_ITOA 0400 /* convert number to name (!) */
extern size_t regerror(int, const regex_t *, char *, size_t);
 
 
 
extern int regexec(const regex_t *, const char *, size_t, regmatch_t [], int);
#define REG_NOTBOL 00001
#define REG_NOTEOL 00002
#define REG_STARTEND 00004
#define REG_TRACE 00400 /* tracing of execution */
#define REG_LARGE 01000 /* force large representation */
#define REG_BACKR 02000 /* force use of backref code */
 
 
 
extern void regfree(regex_t *);
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_regex_h_ */
/contrib/media/updf/include/ring.h
0,0 → 1,100
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ring.h 8.1 (Berkeley) 6/6/93
*/
 
#if defined(P)
# undef P
#endif
 
#if defined(__STDC__) || defined(LINT_ARGS)
# define P(x) x
#else
# define P(x) ()
#endif
 
/*
* This defines a structure for a ring buffer.
*
* The circular buffer has two parts:
*(((
* full: [consume, supply)
* empty: [supply, consume)
*]]]
*
*/
typedef struct {
unsigned char *consume, /* where data comes out of */
*supply, /* where data comes in to */
*bottom, /* lowest address in buffer */
*top, /* highest address+1 in buffer */
*mark; /* marker (user defined) */
#ifdef ENCRYPTION
unsigned char *clearto; /* Data to this point is clear text */
unsigned char *encryyptedto; /* Data is encrypted to here */
#endif /* ENCRYPTION */
int size; /* size in bytes of buffer */
u_long consumetime, /* help us keep straight full, empty, etc. */
supplytime;
} Ring;
 
/* Here are some functions and macros to deal with the ring buffer */
 
/* Initialization routine */
extern int
ring_init P((Ring *ring, unsigned char *buffer, int count));
 
/* Data movement routines */
extern void
ring_supply_data P((Ring *ring, unsigned char *buffer, int count));
#ifdef notdef
extern void
ring_consume_data P((Ring *ring, unsigned char *buffer, int count));
#endif
 
/* Buffer state transition routines */
extern void
ring_supplied P((Ring *ring, int count)),
ring_consumed P((Ring *ring, int count));
 
/* Buffer state query routines */
extern int
ring_empty_count P((Ring *ring)),
ring_empty_consecutive P((Ring *ring)),
ring_full_count P((Ring *ring)),
ring_full_consecutive P((Ring *ring));
 
#ifdef ENCRYPTION
extern void
ring_encrypt P((Ring *ring, void (*func)())),
ring_clearto P((Ring *ring));
#endif /* ENCRYPTION */
 
extern void ring_clear_mark P ((Ring *));
extern void ring_mark P ((Ring *));
/contrib/media/updf/include/rpc/auth.h
0,0 → 1,214
/* @(#)auth.h 2.3 88/08/07 4.0 RPCSRC; from 1.17 88/02/08 SMI */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
 
/*
* auth.h, Authentication interface.
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*
* The data structures are completely opaque to the client. The client
* is required to pass a AUTH * to routines that create rpc
* "sessions".
*/
 
#ifndef _RPC_AUTH_H
 
#define _RPC_AUTH_H 1
#include <sys/cdefs.h>
#include <sys/socket.h>
#include <rpc/xdr.h>
 
__BEGIN_DECLS
 
#define MAX_AUTH_BYTES 400
#define MAXNETNAMELEN 255 /* maximum length of network user's name */
 
/*
* Status returned from authentication check
*/
enum auth_stat {
AUTH_OK=0,
/*
* failed at remote end
*/
AUTH_BADCRED=1, /* bogus credentials (seal broken) */
AUTH_REJECTEDCRED=2, /* client should begin new session */
AUTH_BADVERF=3, /* bogus verifier (seal broken) */
AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */
AUTH_TOOWEAK=5, /* rejected due to security reasons */
/*
* failed locally
*/
AUTH_INVALIDRESP=6, /* bogus response verifier */
AUTH_FAILED=7 /* some unknown reason */
};
 
union des_block {
struct {
uint32_t high;
uint32_t low;
} key;
char c[8];
};
typedef union des_block des_block;
extern bool_t xdr_des_block (XDR *__xdrs, des_block *__blkp) __THROW;
 
/*
* Authentication info. Opaque to client.
*/
struct opaque_auth {
enum_t oa_flavor; /* flavor of auth */
char* oa_base; /* address of more auth stuff */
unsigned int oa_length; /* not to exceed MAX_AUTH_BYTES */
};
 
/*
* Auth handle, interface to client side authenticators.
*/
typedef struct AUTH AUTH;
struct AUTH {
struct opaque_auth ah_cred;
struct opaque_auth ah_verf;
union des_block ah_key;
struct auth_ops {
void (*ah_nextverf) (AUTH *);
int (*ah_marshal) (AUTH *, XDR *); /* nextverf & serialize */
int (*ah_validate) (AUTH *, struct opaque_auth *);
/* validate verifier */
int (*ah_refresh) (AUTH *); /* refresh credentials */
void (*ah_destroy) (AUTH *); /* destroy this structure */
} *ah_ops;
char* ah_private;
};
 
 
/*
* Authentication ops.
* The ops and the auth handle provide the interface to the authenticators.
*
* AUTH *auth;
* XDR *xdrs;
* struct opaque_auth verf;
*/
#define AUTH_NEXTVERF(auth) \
((*((auth)->ah_ops->ah_nextverf))(auth))
#define auth_nextverf(auth) \
((*((auth)->ah_ops->ah_nextverf))(auth))
 
#define AUTH_MARSHALL(auth, xdrs) \
((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
#define auth_marshall(auth, xdrs) \
((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
 
#define AUTH_VALIDATE(auth, verfp) \
((*((auth)->ah_ops->ah_validate))((auth), verfp))
#define auth_validate(auth, verfp) \
((*((auth)->ah_ops->ah_validate))((auth), verfp))
 
#define AUTH_REFRESH(auth) \
((*((auth)->ah_ops->ah_refresh))(auth))
#define auth_refresh(auth) \
((*((auth)->ah_ops->ah_refresh))(auth))
 
#define AUTH_DESTROY(auth) \
((*((auth)->ah_ops->ah_destroy))(auth))
#define auth_destroy(auth) \
((*((auth)->ah_ops->ah_destroy))(auth))
 
 
extern struct opaque_auth _null_auth;
 
 
/*
* These are the various implementations of client side authenticators.
*/
 
/*
* Unix style authentication
* AUTH *authunix_create(machname, uid, gid, len, aup_gids)
* char *machname;
* int uid;
* int gid;
* int len;
* int *aup_gids;
*/
extern AUTH *authunix_create (char *__machname,uid_t __uid, gid_t __gid,
int __len, gid_t *__aup_gids) __THROW;
extern AUTH *authunix_create_default (void) __THROW;
extern AUTH *authnone_create (void) __THROW;
extern AUTH *authdes_create (const char *__servername, unsigned int __window,
struct sockaddr *__syncaddr, des_block *__ckey)
__THROW;
extern AUTH *authdes_pk_create (const char *, netobj *, unsigned int,
struct sockaddr *, des_block *) __THROW;
 
 
#define AUTH_NONE 0 /* no authentication */
#define AUTH_NULL 0 /* backward compatibility */
#define AUTH_SYS 1 /* unix style (uid, gids) */
#define AUTH_UNIX AUTH_SYS
#define AUTH_SHORT 2 /* short hand unix style */
#define AUTH_DES 3 /* des style (encrypted timestamps) */
#define AUTH_DH AUTH_DES /* Diffie-Hellman (this is DES) */
#define AUTH_KERB 4 /* kerberos style */
 
/*
* Netname manipulating functions
*
*/
extern int getnetname (char *) __THROW;
extern int host2netname (char *, const char *, const char *) __THROW;
extern int user2netname (char *, const uid_t, const char *) __THROW;
extern int netname2user (const char *, uid_t *, gid_t *, int *, gid_t *)
__THROW;
extern int netname2host (const char *, char *, const int) __THROW;
 
/*
*
* These routines interface to the keyserv daemon
*
*/
extern int key_decryptsession (char *, des_block *) __THROW;
extern int key_decryptsession_pk (char *, netobj *, des_block *) __THROW;
extern int key_encryptsession (char *, des_block *) __THROW;
extern int key_encryptsession_pk (char *, netobj *, des_block *) __THROW;
extern int key_gendes (des_block *) __THROW;
extern int key_setsecret (char *) __THROW;
extern int key_secretkey_is_set (void) __THROW;
extern int key_get_conv (char *, des_block *) __THROW;
 
/*
* XDR an opaque authentication struct.
*/
extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *) __THROW;
 
__END_DECLS
 
#endif /* rpc/auth.h */
/contrib/media/updf/include/rpc/auth_des.h
0,0 → 1,112
/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
 
The GNU C 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.
 
The GNU C 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 the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
 
#ifndef _RPC_AUTH_DES_H
#define _RPC_AUTH_DES_H 1
 
#include <sys/cdefs.h>
#include <rpc/auth.h>
 
__BEGIN_DECLS
 
/* There are two kinds of "names": fullnames and nicknames */
enum authdes_namekind
{
ADN_FULLNAME,
ADN_NICKNAME
};
 
/* A fullname contains the network name of the client,
a conversation key and the window */
struct authdes_fullname
{
char *name; /* network name of client, up to MAXNETNAMELEN */
des_block key; /* conversation key */
uint32_t window; /* associated window */
};
 
/* A credential */
struct authdes_cred
{
enum authdes_namekind adc_namekind;
struct authdes_fullname adc_fullname;
uint32_t adc_nickname;
};
 
/* A timeval replacement for !32bit platforms */
struct rpc_timeval
{
uint32_t tv_sec; /* Seconds. */
uint32_t tv_usec; /* Microseconds. */
};
 
/* A des authentication verifier */
struct authdes_verf
{
union
{
struct rpc_timeval adv_ctime; /* clear time */
des_block adv_xtime; /* crypt time */
}
adv_time_u;
uint32_t adv_int_u;
};
 
/* des authentication verifier: client variety
 
adv_timestamp is the current time.
adv_winverf is the credential window + 1.
Both are encrypted using the conversation key. */
#define adv_timestamp adv_time_u.adv_ctime
#define adv_xtimestamp adv_time_u.adv_xtime
#define adv_winverf adv_int_u
 
/* des authentication verifier: server variety
 
adv_timeverf is the client's timestamp + client's window
adv_nickname is the server's nickname for the client.
adv_timeverf is encrypted using the conversation key. */
#define adv_timeverf adv_time_u.adv_ctime
#define adv_xtimeverf adv_time_u.adv_xtime
#define adv_nickname adv_int_u
 
/* Map a des credential into a unix cred. */
extern int authdes_getucred (const struct authdes_cred * __adc,
uid_t * __uid, gid_t * __gid,
short *__grouplen, gid_t * __groups) __THROW;
 
/* Get the public key for NAME and place it in KEY. NAME can only be
up to MAXNETNAMELEN bytes long and the destination buffer KEY should
have HEXKEYBYTES + 1 bytes long to fit all characters from the key. */
extern int getpublickey (const char *__name, char *__key) __THROW;
 
/* Get the secret key for NAME and place it in KEY. PASSWD is used to
decrypt the encrypted key stored in the database. NAME can only be
up to MAXNETNAMELEN bytes long and the destination buffer KEY
should have HEXKEYBYTES + 1 bytes long to fit all characters from
the key. */
extern int getsecretkey (const char *__name, char *__key,
const char *__passwd) __THROW;
 
extern int rtime (struct sockaddr_in *__addrp, struct rpc_timeval *__timep,
struct rpc_timeval *__timeout) __THROW;
 
__END_DECLS
 
 
#endif /* rpc/auth_des.h */
/contrib/media/updf/include/rpc/auth_unix.h
0,0 → 1,90
/* @(#)auth_unix.h 2.2 88/07/29 4.0 RPCSRC; from 1.8 88/02/08 SMI */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
/* @(#)auth_unix.h 1.5 86/07/16 SMI */
 
/*
* auth_unix.h, Protocol for UNIX style authentication parameters for RPC
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
 
/*
* The system is very weak. The client uses no encryption for it
* credentials and only sends null verifiers. The server sends backs
* null verifiers or optionally a verifier that suggests a new short hand
* for the credentials.
*/
 
#ifndef _RPC_AUTH_UNIX_H
#define _RPC_AUTH_UNIX_H 1
 
#include <sys/cdefs.h>
#include <sys/types.h>
#include <rpc/types.h>
#include <rpc/auth.h>
#include <rpc/xdr.h>
 
__BEGIN_DECLS
 
/* The machine name is part of a credential; it may not exceed 255 bytes */
#define MAX_MACHINE_NAME 255
 
/* gids compose part of a credential; there may not be more than 16 of them */
#define NGRPS 16
 
/*
* Unix style credentials.
*/
struct authunix_parms
{
unsigned long aup_time;
char *aup_machname;
uid_t aup_uid;
gid_t aup_gid;
unsigned int aup_len;
gid_t *aup_gids;
};
 
extern bool_t xdr_authunix_parms (XDR *__xdrs, struct authunix_parms *__p)
__THROW;
 
/*
* If a response verifier has flavor AUTH_SHORT,
* then the body of the response verifier encapsulates the following structure;
* again it is serialized in the obvious fashion.
*/
struct short_hand_verf
{
struct opaque_auth new_cred;
};
 
__END_DECLS
 
#endif /* rpc/auth_unix.h */
/contrib/media/updf/include/rpc/clnt.h
0,0 → 1,421
/* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
 
/*
* clnt.h - Client side remote procedure call interface.
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
 
#ifndef _RPC_CLNT_H
#define _RPC_CLNT_H 1
 
#include <sys/cdefs.h>
#include <sys/types.h>
#include <rpc/types.h>
#include <rpc/auth.h>
#include <sys/un.h>
 
__BEGIN_DECLS
 
/*
* Rpc calls return an enum clnt_stat. This should be looked at more,
* since each implementation is required to live with this (implementation
* independent) list of errors.
*/
enum clnt_stat {
RPC_SUCCESS=0, /* call succeeded */
/*
* local errors
*/
RPC_CANTENCODEARGS=1, /* can't encode arguments */
RPC_CANTDECODERES=2, /* can't decode results */
RPC_CANTSEND=3, /* failure in sending call */
RPC_CANTRECV=4, /* failure in receiving result */
RPC_TIMEDOUT=5, /* call timed out */
/*
* remote errors
*/
RPC_VERSMISMATCH=6, /* rpc versions not compatible */
RPC_AUTHERROR=7, /* authentication error */
RPC_PROGUNAVAIL=8, /* program not available */
RPC_PROGVERSMISMATCH=9, /* program version mismatched */
RPC_PROCUNAVAIL=10, /* procedure unavailable */
RPC_CANTDECODEARGS=11, /* decode arguments error */
RPC_SYSTEMERROR=12, /* generic "other problem" */
RPC_NOBROADCAST = 21, /* Broadcasting not supported */
/*
* callrpc & clnt_create errors
*/
RPC_UNKNOWNHOST=13, /* unknown host name */
RPC_UNKNOWNPROTO=17, /* unknown protocol */
RPC_UNKNOWNADDR = 19, /* Remote address unknown */
 
/*
* rpcbind errors
*/
RPC_RPCBFAILURE=14, /* portmapper failed in its call */
#define RPC_PMAPFAILURE RPC_RPCBFAILURE
RPC_PROGNOTREGISTERED=15, /* remote program is not registered */
RPC_N2AXLATEFAILURE = 22, /* Name to addr translation failed */
/*
* unspecified error
*/
RPC_FAILED=16,
RPC_INTR=18,
RPC_TLIERROR=20,
RPC_UDERROR=23,
/*
* asynchronous errors
*/
RPC_INPROGRESS = 24,
RPC_STALERACHANDLE = 25
};
 
 
/*
* Error info.
*/
struct rpc_err {
enum clnt_stat re_status;
union {
int RE_errno; /* related system error */
enum auth_stat RE_why; /* why the auth error occurred */
struct {
unsigned long low; /* lowest verion supported */
unsigned long high; /* highest verion supported */
} RE_vers;
struct { /* maybe meaningful if RPC_FAILED */
long s1;
long s2;
} RE_lb; /* life boot & debugging only */
} ru;
#define re_errno ru.RE_errno
#define re_why ru.RE_why
#define re_vers ru.RE_vers
#define re_lb ru.RE_lb
};
 
 
/*
* Client rpc handle.
* Created by individual implementations, see e.g. rpc_udp.c.
* Client is responsible for initializing auth, see e.g. auth_none.c.
*/
typedef struct CLIENT CLIENT;
struct CLIENT {
AUTH *cl_auth; /* authenticator */
struct clnt_ops {
enum clnt_stat (*cl_call) (CLIENT *, unsigned long, xdrproc_t, char*, xdrproc_t,
char*, struct timeval);
/* call remote procedure */
void (*cl_abort) (void); /* abort a call */
void (*cl_geterr) (CLIENT *, struct rpc_err *);
/* get specific error code */
bool_t (*cl_freeres) (CLIENT *, xdrproc_t, char*);
/* frees results */
void (*cl_destroy) (CLIENT *); /* destroy this structure */
bool_t (*cl_control) (CLIENT *, int, char *);
/* the ioctl() of rpc */
} *cl_ops;
char* cl_private; /* private stuff */
};
 
 
/*
* client side rpc interface ops
*
* Parameter types are:
*
*/
 
/*
* enum clnt_stat
* CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
* CLIENT *rh;
* unsigned long proc;
* xdrproc_t xargs;
* char* argsp;
* xdrproc_t xres;
* char* resp;
* struct timeval timeout;
*/
#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
 
/*
* void
* CLNT_ABORT(rh);
* CLIENT *rh;
*/
#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh))
#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh))
 
/*
* struct rpc_err
* CLNT_GETERR(rh);
* CLIENT *rh;
*/
#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
 
 
/*
* bool_t
* CLNT_FREERES(rh, xres, resp);
* CLIENT *rh;
* xdrproc_t xres;
* char* resp;
*/
#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
 
/*
* bool_t
* CLNT_CONTROL(cl, request, info)
* CLIENT *cl;
* unsigned int request;
* char *info;
*/
#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
 
/*
* control operations that apply to all transports
*
* Note: options marked XXX are no-ops in this implementation of RPC.
* The are present in TI-RPC but can't be implemented here since they
* depend on the presence of STREAMS/TLI, which we don't have.
*/
#define CLSET_TIMEOUT 1 /* set timeout (timeval) */
#define CLGET_TIMEOUT 2 /* get timeout (timeval) */
#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */
#define CLGET_FD 6 /* get connections file descriptor */
#define CLGET_SVC_ADDR 7 /* get server's address (netbuf) XXX */
#define CLSET_FD_CLOSE 8 /* close fd while clnt_destroy */
#define CLSET_FD_NCLOSE 9 /* Do not close fd while clnt_destroy*/
#define CLGET_XID 10 /* Get xid */
#define CLSET_XID 11 /* Set xid */
#define CLGET_VERS 12 /* Get version number */
#define CLSET_VERS 13 /* Set version number */
#define CLGET_PROG 14 /* Get program number */
#define CLSET_PROG 15 /* Set program number */
#define CLSET_SVC_ADDR 16 /* get server's address (netbuf) XXX */
#define CLSET_PUSH_TIMOD 17 /* push timod if not already present XXX */
#define CLSET_POP_TIMOD 18 /* pop timod XXX */
/*
* Connectionless only control operations
*/
#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */
#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */
 
/*
* void
* CLNT_DESTROY(rh);
* CLIENT *rh;
*/
#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
 
 
/*
* RPCTEST is a test program which is accessible on every rpc
* transport/port. It is used for testing, performance evaluation,
* and network administration.
*/
 
#define RPCTEST_PROGRAM ((unsigned long)1)
#define RPCTEST_VERSION ((unsigned long)1)
#define RPCTEST_NULL_PROC ((unsigned long)2)
#define RPCTEST_NULL_BATCH_PROC ((unsigned long)3)
 
/*
* By convention, procedure 0 takes null arguments and returns them
*/
 
#define NULLPROC ((unsigned long)0)
 
/*
* Below are the client handle creation routines for the various
* implementations of client side rpc. They can return NULL if a
* creation failure occurs.
*/
 
/*
* Memory based rpc (for speed check and testing)
* CLIENT *
* clntraw_create(prog, vers)
* unsigned long prog;
* unsigned long vers;
*/
extern CLIENT *clntraw_create (const unsigned long __prog, const unsigned long __vers)
__THROW;
 
 
/*
* Generic client creation routine. Supported protocols are "udp", "tcp" and
* "unix"
* CLIENT *
* clnt_create(host, prog, vers, prot)
* char *host; -- hostname
* unsigned long prog; -- program number
* u_ong vers; -- version number
* char *prot; -- protocol
*/
extern CLIENT *clnt_create (const char *__host, const unsigned long __prog,
const unsigned long __vers, const char *__prot)
__THROW;
 
 
/*
* TCP based rpc
* CLIENT *
* clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
* struct sockaddr_in *raddr;
* unsigned long prog;
* unsigned long version;
* register int *sockp;
* unsigned int sendsz;
* unsigned int recvsz;
*/
extern CLIENT *clnttcp_create (struct sockaddr_in *__raddr, unsigned long __prog,
unsigned long __version, int *__sockp, unsigned int __sendsz,
unsigned int __recvsz) __THROW;
 
/*
* UDP based rpc.
* CLIENT *
* clntudp_create(raddr, program, version, wait, sockp)
* struct sockaddr_in *raddr;
* unsigned long program;
* unsigned long version;
* struct timeval wait_resend;
* int *sockp;
*
* Same as above, but you specify max packet sizes.
* CLIENT *
* clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
* struct sockaddr_in *raddr;
* unsigned long program;
* unsigned long version;
* struct timeval wait_resend;
* int *sockp;
* unsigned int sendsz;
* unsigned int recvsz;
*/
extern CLIENT *clntudp_create (struct sockaddr_in *__raddr, unsigned long __program,
unsigned long __version, struct timeval __wait_resend,
int *__sockp) __THROW;
extern CLIENT *clntudp_bufcreate (struct sockaddr_in *__raddr,
unsigned long __program, unsigned long __version,
struct timeval __wait_resend, int *__sockp,
unsigned int __sendsz, unsigned int __recvsz) __THROW;
 
 
 
 
/*
* AF_UNIX based rpc
* CLIENT *
* clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
* struct sockaddr_un *raddr;
* unsigned long prog;
* unsigned long version;
* register int *sockp;
* unsigned int sendsz;
* unsigned int recvsz;
*/
extern CLIENT *clntunix_create (struct sockaddr_un *__raddr, unsigned long __program,
unsigned long __version, int *__sockp,
unsigned int __sendsz, unsigned int __recvsz) __THROW;
 
 
extern int callrpc (const char *__host, const unsigned long __prognum,
const unsigned long __versnum, const unsigned long __procnum,
const xdrproc_t __inproc, const char *__in,
const xdrproc_t __outproc, char *__out) __THROW;
extern int _rpc_dtablesize (void) __THROW;
 
/*
* Print why creation failed
*/
extern void clnt_pcreateerror (const char *__msg) __THROW; /* stderr */
extern char *clnt_spcreateerror(const char *__msg) __THROW; /* string */
 
/*
* Like clnt_perror(), but is more verbose in its output
*/
extern void clnt_perrno (enum clnt_stat __num) __THROW; /* stderr */
 
/*
* Print an English error message, given the client error code
*/
extern void clnt_perror (CLIENT *__clnt, const char *__msg) __THROW;
/* stderr */
extern char *clnt_sperror (CLIENT *__clnt, const char *__msg) __THROW;
/* string */
 
/*
* If a creation fails, the following allows the user to figure out why.
*/
struct rpc_createerr {
enum clnt_stat cf_stat;
struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
};
 
extern struct rpc_createerr rpc_createerr;
 
 
 
/*
* Copy error message to buffer.
*/
extern char *clnt_sperrno (enum clnt_stat __num) __THROW; /* string */
 
/*
* get the port number on the host for the rpc program,version and proto
*/
extern int getrpcport (const char * __host, unsigned long __prognum,
unsigned long __versnum, unsigned int proto) __THROW;
 
/*
* get the local host's IP address without consulting
* name service library functions
*/
extern void get_myaddress (struct sockaddr_in *) __THROW;
 
#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */
 
__END_DECLS
 
#endif /* rpc/clnt.h */
/contrib/media/updf/include/rpc/des_crypt.h
0,0 → 1,97
/*
* @(#)des_crypt.h 2.1 88/08/11 4.0 RPCSRC; from 1.4 88/02/08 (C) 1986 SMI
*
* des_crypt.h, des library routine interface
* Copyright (C) 1986, Sun Microsystems, Inc.
*/
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
 
#ifndef __DES_CRYPT_H__
#define __DES_CRYPT_H__ 1
 
#include <features.h>
 
__BEGIN_DECLS
 
#define DES_MAXDATA 8192 /* max bytes encrypted in one call */
#define DES_DIRMASK (1 << 0)
#define DES_ENCRYPT (0*DES_DIRMASK) /* Encrypt */
#define DES_DECRYPT (1*DES_DIRMASK) /* Decrypt */
 
 
#define DES_DEVMASK (1 << 1)
#define DES_HW (0*DES_DEVMASK) /* Use hardware device */
#define DES_SW (1*DES_DEVMASK) /* Use software device */
 
 
#define DESERR_NONE 0 /* succeeded */
#define DESERR_NOHWDEVICE 1 /* succeeded, but hw device not available */
#define DESERR_HWERROR 2 /* failed, hardware/driver error */
#define DESERR_BADPARAM 3 /* failed, bad parameter to call */
 
#define DES_FAILED(err) \
((err) > DESERR_NOHWDEVICE)
 
/*
* cbc_crypt()
* ecb_crypt()
*
* Encrypt (or decrypt) len bytes of a buffer buf.
* The length must be a multiple of eight.
* The key should have odd parity in the low bit of each byte.
* ivec is the input vector, and is updated to the new one (cbc only).
* The mode is created by oring together the appropriate parameters.
* DESERR_NOHWDEVICE is returned if DES_HW was specified but
* there was no hardware to do it on (the data will still be
* encrypted though, in software).
*/
 
 
/*
* Cipher Block Chaining mode
*/
extern int cbc_crypt (char *__key, char *__buf, unsigned __len,
unsigned __mode, char *__ivec) __THROW;
 
/*
* Electronic Code Book mode
*/
extern int ecb_crypt (char *__key, char *__buf, unsigned __len,
unsigned __mode) __THROW;
 
/*
* Set des parity for a key.
* DES parity is odd and in the low bit of each byte
*/
extern void des_setparity (char *__key) __THROW;
 
__END_DECLS
 
#endif
/contrib/media/updf/include/rpc/key_prot.h
0,0 → 1,346
/*
* Please do not edit this file.
* It was generated using rpcgen.
*/
 
#ifndef _KEY_PROT_H_RPCGEN
#define _KEY_PROT_H_RPCGEN
 
#include <rpc/rpc.h>
 
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
#if 0
#pragma ident "@(#)key_prot.x 1.7 94/04/29 SMI"
#endif
/* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */
 
/*
* Compiled from key_prot.x using rpcgen.
* DO NOT EDIT THIS FILE!
* This is NOT source code!
*/
#define PROOT 3
#define HEXMODULUS "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b"
#define HEXKEYBYTES 48
#define KEYSIZE 192
#define KEYBYTES 24
#define KEYCHECKSUMSIZE 16
 
enum keystatus {
KEY_SUCCESS = 0,
KEY_NOSECRET = 1,
KEY_UNKNOWN = 2,
KEY_SYSTEMERR = 3,
};
typedef enum keystatus keystatus;
#ifdef __cplusplus
extern "C" bool_t xdr_keystatus(XDR *, keystatus*);
#elif __STDC__
extern bool_t xdr_keystatus(XDR *, keystatus*);
#else /* Old Style C */
bool_t xdr_keystatus();
#endif /* Old Style C */
 
 
typedef char keybuf[HEXKEYBYTES];
#ifdef __cplusplus
extern "C" bool_t xdr_keybuf(XDR *, keybuf);
#elif __STDC__
extern bool_t xdr_keybuf(XDR *, keybuf);
#else /* Old Style C */
bool_t xdr_keybuf();
#endif /* Old Style C */
 
 
typedef char *netnamestr;
#ifdef __cplusplus
extern "C" bool_t xdr_netnamestr(XDR *, netnamestr*);
#elif __STDC__
extern bool_t xdr_netnamestr(XDR *, netnamestr*);
#else /* Old Style C */
bool_t xdr_netnamestr();
#endif /* Old Style C */
 
 
struct cryptkeyarg {
netnamestr remotename;
des_block deskey;
};
typedef struct cryptkeyarg cryptkeyarg;
#ifdef __cplusplus
extern "C" bool_t xdr_cryptkeyarg(XDR *, cryptkeyarg*);
#elif __STDC__
extern bool_t xdr_cryptkeyarg(XDR *, cryptkeyarg*);
#else /* Old Style C */
bool_t xdr_cryptkeyarg();
#endif /* Old Style C */
 
 
struct cryptkeyarg2 {
netnamestr remotename;
netobj remotekey;
des_block deskey;
};
typedef struct cryptkeyarg2 cryptkeyarg2;
#ifdef __cplusplus
extern "C" bool_t xdr_cryptkeyarg2(XDR *, cryptkeyarg2*);
#elif __STDC__
extern bool_t xdr_cryptkeyarg2(XDR *, cryptkeyarg2*);
#else /* Old Style C */
bool_t xdr_cryptkeyarg2();
#endif /* Old Style C */
 
 
struct cryptkeyres {
keystatus status;
union {
des_block deskey;
} cryptkeyres_u;
};
typedef struct cryptkeyres cryptkeyres;
#ifdef __cplusplus
extern "C" bool_t xdr_cryptkeyres(XDR *, cryptkeyres*);
#elif __STDC__
extern bool_t xdr_cryptkeyres(XDR *, cryptkeyres*);
#else /* Old Style C */
bool_t xdr_cryptkeyres();
#endif /* Old Style C */
 
#define MAXGIDS 16
 
struct unixcred {
unsigned int uid;
unsigned int gid;
struct {
unsigned int gids_len;
unsigned int *gids_val;
} gids;
};
typedef struct unixcred unixcred;
#ifdef __cplusplus
extern "C" bool_t xdr_unixcred(XDR *, unixcred*);
#elif __STDC__
extern bool_t xdr_unixcred(XDR *, unixcred*);
#else /* Old Style C */
bool_t xdr_unixcred();
#endif /* Old Style C */
 
 
struct getcredres {
keystatus status;
union {
unixcred cred;
} getcredres_u;
};
typedef struct getcredres getcredres;
#ifdef __cplusplus
extern "C" bool_t xdr_getcredres(XDR *, getcredres*);
#elif __STDC__
extern bool_t xdr_getcredres(XDR *, getcredres*);
#else /* Old Style C */
bool_t xdr_getcredres();
#endif /* Old Style C */
 
 
struct key_netstarg {
keybuf st_priv_key;
keybuf st_pub_key;
netnamestr st_netname;
};
typedef struct key_netstarg key_netstarg;
#ifdef __cplusplus
extern "C" bool_t xdr_key_netstarg(XDR *, key_netstarg*);
#elif __STDC__
extern bool_t xdr_key_netstarg(XDR *, key_netstarg*);
#else /* Old Style C */
bool_t xdr_key_netstarg();
#endif /* Old Style C */
 
 
struct key_netstres {
keystatus status;
union {
key_netstarg knet;
} key_netstres_u;
};
typedef struct key_netstres key_netstres;
#ifdef __cplusplus
extern "C" bool_t xdr_key_netstres(XDR *, key_netstres*);
#elif __STDC__
extern bool_t xdr_key_netstres(XDR *, key_netstres*);
#else /* Old Style C */
bool_t xdr_key_netstres();
#endif /* Old Style C */
 
 
#ifndef opaque
#define opaque char
#endif
 
 
#define KEY_PROG ((unsigned long)100029)
#define KEY_VERS ((unsigned long)1)
 
#ifdef __cplusplus
#define KEY_SET ((unsigned long)1)
extern "C" keystatus * key_set_1(opaque *, CLIENT *);
extern "C" keystatus * key_set_1_svc(opaque *, struct svc_req *);
#define KEY_ENCRYPT ((unsigned long)2)
extern "C" cryptkeyres * key_encrypt_1(cryptkeyarg *, CLIENT *);
extern "C" cryptkeyres * key_encrypt_1_svc(cryptkeyarg *, struct svc_req *);
#define KEY_DECRYPT ((unsigned long)3)
extern "C" cryptkeyres * key_decrypt_1(cryptkeyarg *, CLIENT *);
extern "C" cryptkeyres * key_decrypt_1_svc(cryptkeyarg *, struct svc_req *);
#define KEY_GEN ((unsigned long)4)
extern "C" des_block * key_gen_1(void *, CLIENT *);
extern "C" des_block * key_gen_1_svc(void *, struct svc_req *);
#define KEY_GETCRED ((unsigned long)5)
extern "C" getcredres * key_getcred_1(netnamestr *, CLIENT *);
extern "C" getcredres * key_getcred_1_svc(netnamestr *, struct svc_req *);
 
#elif __STDC__
#define KEY_SET ((unsigned long)1)
extern keystatus * key_set_1(opaque *, CLIENT *);
extern keystatus * key_set_1_svc(opaque *, struct svc_req *);
#define KEY_ENCRYPT ((unsigned long)2)
extern cryptkeyres * key_encrypt_1(cryptkeyarg *, CLIENT *);
extern cryptkeyres * key_encrypt_1_svc(cryptkeyarg *, struct svc_req *);
#define KEY_DECRYPT ((unsigned long)3)
extern cryptkeyres * key_decrypt_1(cryptkeyarg *, CLIENT *);
extern cryptkeyres * key_decrypt_1_svc(cryptkeyarg *, struct svc_req *);
#define KEY_GEN ((unsigned long)4)
extern des_block * key_gen_1(void *, CLIENT *);
extern des_block * key_gen_1_svc(void *, struct svc_req *);
#define KEY_GETCRED ((unsigned long)5)
extern getcredres * key_getcred_1(netnamestr *, CLIENT *);
extern getcredres * key_getcred_1_svc(netnamestr *, struct svc_req *);
 
#else /* Old Style C */
#define KEY_SET ((unsigned long)1)
extern keystatus * key_set_1();
extern keystatus * key_set_1_svc();
#define KEY_ENCRYPT ((unsigned long)2)
extern cryptkeyres * key_encrypt_1();
extern cryptkeyres * key_encrypt_1_svc();
#define KEY_DECRYPT ((unsigned long)3)
extern cryptkeyres * key_decrypt_1();
extern cryptkeyres * key_decrypt_1_svc();
#define KEY_GEN ((unsigned long)4)
extern des_block * key_gen_1();
extern des_block * key_gen_1_svc();
#define KEY_GETCRED ((unsigned long)5)
extern getcredres * key_getcred_1();
extern getcredres * key_getcred_1_svc();
#endif /* Old Style C */
#define KEY_VERS2 ((unsigned long)2)
 
#ifdef __cplusplus
extern "C" keystatus * key_set_2(opaque *, CLIENT *);
extern "C" keystatus * key_set_2_svc(opaque *, struct svc_req *);
extern "C" cryptkeyres * key_encrypt_2(cryptkeyarg *, CLIENT *);
extern "C" cryptkeyres * key_encrypt_2_svc(cryptkeyarg *, struct svc_req *);
extern "C" cryptkeyres * key_decrypt_2(cryptkeyarg *, CLIENT *);
extern "C" cryptkeyres * key_decrypt_2_svc(cryptkeyarg *, struct svc_req *);
extern "C" des_block * key_gen_2(void *, CLIENT *);
extern "C" des_block * key_gen_2_svc(void *, struct svc_req *);
extern "C" getcredres * key_getcred_2(netnamestr *, CLIENT *);
extern "C" getcredres * key_getcred_2_svc(netnamestr *, struct svc_req *);
#define KEY_ENCRYPT_PK ((unsigned long)6)
extern "C" cryptkeyres * key_encrypt_pk_2(cryptkeyarg2 *, CLIENT *);
extern "C" cryptkeyres * key_encrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
#define KEY_DECRYPT_PK ((unsigned long)7)
extern "C" cryptkeyres * key_decrypt_pk_2(cryptkeyarg2 *, CLIENT *);
extern "C" cryptkeyres * key_decrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
#define KEY_NET_PUT ((unsigned long)8)
extern "C" keystatus * key_net_put_2(key_netstarg *, CLIENT *);
extern "C" keystatus * key_net_put_2_svc(key_netstarg *, struct svc_req *);
#define KEY_NET_GET ((unsigned long)9)
extern "C" key_netstres * key_net_get_2(void *, CLIENT *);
extern "C" key_netstres * key_net_get_2_svc(void *, struct svc_req *);
#define KEY_GET_CONV ((unsigned long)10)
extern "C" cryptkeyres * key_get_conv_2(opaque *, CLIENT *);
extern "C" cryptkeyres * key_get_conv_2_svc(opaque *, struct svc_req *);
 
#elif __STDC__
extern keystatus * key_set_2(opaque *, CLIENT *);
extern keystatus * key_set_2_svc(opaque *, struct svc_req *);
extern cryptkeyres * key_encrypt_2(cryptkeyarg *, CLIENT *);
extern cryptkeyres * key_encrypt_2_svc(cryptkeyarg *, struct svc_req *);
extern cryptkeyres * key_decrypt_2(cryptkeyarg *, CLIENT *);
extern cryptkeyres * key_decrypt_2_svc(cryptkeyarg *, struct svc_req *);
extern des_block * key_gen_2(void *, CLIENT *);
extern des_block * key_gen_2_svc(void *, struct svc_req *);
extern getcredres * key_getcred_2(netnamestr *, CLIENT *);
extern getcredres * key_getcred_2_svc(netnamestr *, struct svc_req *);
#define KEY_ENCRYPT_PK ((unsigned long)6)
extern cryptkeyres * key_encrypt_pk_2(cryptkeyarg2 *, CLIENT *);
extern cryptkeyres * key_encrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
#define KEY_DECRYPT_PK ((unsigned long)7)
extern cryptkeyres * key_decrypt_pk_2(cryptkeyarg2 *, CLIENT *);
extern cryptkeyres * key_decrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
#define KEY_NET_PUT ((unsigned long)8)
extern keystatus * key_net_put_2(key_netstarg *, CLIENT *);
extern keystatus * key_net_put_2_svc(key_netstarg *, struct svc_req *);
#define KEY_NET_GET ((unsigned long)9)
extern key_netstres * key_net_get_2(void *, CLIENT *);
extern key_netstres * key_net_get_2_svc(void *, struct svc_req *);
#define KEY_GET_CONV ((unsigned long)10)
extern cryptkeyres * key_get_conv_2(opaque *, CLIENT *);
extern cryptkeyres * key_get_conv_2_svc(opaque *, struct svc_req *);
 
#else /* Old Style C */
extern keystatus * key_set_2();
extern keystatus * key_set_2_svc();
extern cryptkeyres * key_encrypt_2();
extern cryptkeyres * key_encrypt_2_svc();
extern cryptkeyres * key_decrypt_2();
extern cryptkeyres * key_decrypt_2_svc();
extern des_block * key_gen_2();
extern des_block * key_gen_2_svc();
extern getcredres * key_getcred_2();
extern getcredres * key_getcred_2_svc();
#define KEY_ENCRYPT_PK ((unsigned long)6)
extern cryptkeyres * key_encrypt_pk_2();
extern cryptkeyres * key_encrypt_pk_2_svc();
#define KEY_DECRYPT_PK ((unsigned long)7)
extern cryptkeyres * key_decrypt_pk_2();
extern cryptkeyres * key_decrypt_pk_2_svc();
#define KEY_NET_PUT ((unsigned long)8)
extern keystatus * key_net_put_2();
extern keystatus * key_net_put_2_svc();
#define KEY_NET_GET ((unsigned long)9)
extern key_netstres * key_net_get_2();
extern key_netstres * key_net_get_2_svc();
#define KEY_GET_CONV ((unsigned long)10)
extern cryptkeyres * key_get_conv_2();
extern cryptkeyres * key_get_conv_2_svc();
#endif /* Old Style C */
 
#endif /* !_KEY_PROT_H_RPCGEN */
/contrib/media/updf/include/rpc/netdb.h
0,0 → 1,74
/* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
/* @(#)rpc.h 1.8 87/07/24 SMI */
 
/* Cleaned up for GNU C library roland@gnu.ai.mit.edu:
added multiple inclusion protection and use of <sys/cdefs.h>.
In GNU this file is #include'd by <netdb.h>. */
 
#ifndef _RPC_NETDB_H
#define _RPC_NETDB_H 1
 
#include <sys/cdefs.h>
 
#define __need_size_t
#include <stddef.h>
 
__BEGIN_DECLS
 
struct rpcent
{
char *r_name; /* Name of server for this rpc program. */
char **r_aliases; /* Alias list. */
int r_number; /* RPC program number. */
};
 
extern void setrpcent (int __stayopen) __THROW;
extern void endrpcent (void) __THROW;
extern struct rpcent *getrpcbyname (const char *__name) __THROW;
extern struct rpcent *getrpcbynumber (int __number) __THROW;
extern struct rpcent *getrpcent (void) __THROW;
 
#ifdef __USE_MISC
extern int getrpcbyname_r (const char *__name, struct rpcent *__result_buf,
char *__buffer, size_t __buflen,
struct rpcent **__result) __THROW;
 
extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf,
char *__buffer, size_t __buflen,
struct rpcent **__result) __THROW;
 
extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer,
size_t __buflen, struct rpcent **__result) __THROW;
#endif
 
__END_DECLS
 
#endif /* rpc/netdb.h */
/contrib/media/updf/include/rpc/pmap_clnt.h
0,0 → 1,98
/* @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.11 88/02/08 SMI */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
 
/*
* pmap_clnt.h
* Supplies C routines to get to portmap services.
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
 
#ifndef _RPC_PMAP_CLNT_H
#define _RPC_PMAP_CLNT_H 1
 
#include <sys/cdefs.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/clnt.h>
 
__BEGIN_DECLS
 
typedef bool_t (*resultproc_t) (char* resp, struct sockaddr_in *raddr);
 
/*
* Usage:
* success = pmap_set(program, version, protocol, port);
* success = pmap_unset(program, version);
* port = pmap_getport(address, program, version, protocol);
* head = pmap_getmaps(address);
* clnt_stat = pmap_rmtcall(address, program, version, procedure,
* xdrargs, argsp, xdrres, resp, tout, port_ptr)
* (works for udp only.)
* clnt_stat = clnt_broadcast(program, version, procedure,
* xdrargs, argsp, xdrres, resp, eachresult)
* (like pmap_rmtcall, except the call is broadcasted to all
* locally connected nets. For each valid response received,
* the procedure eachresult is called. Its form is:
* done = eachresult(resp, raddr)
* bool_t done;
* char* resp;
* struct sockaddr_in raddr;
* where resp points to the results of the call and raddr is the
* address if the responder to the broadcast.
*/
 
extern bool_t pmap_set (const unsigned long __program, const unsigned long __vers,
int __protocol, unsigned short __port) __THROW;
extern bool_t pmap_unset (const unsigned long __program, const unsigned long __vers)
__THROW;
extern struct pmaplist *pmap_getmaps (struct sockaddr_in *__address) __THROW;
extern enum clnt_stat pmap_rmtcall (struct sockaddr_in *__addr,
const unsigned long __prog,
const unsigned long __vers,
const unsigned long __proc,
xdrproc_t __xdrargs,
char* __argsp, xdrproc_t __xdrres,
char* __resp, struct timeval __tout,
unsigned long *__port_ptr) __THROW;
extern enum clnt_stat clnt_broadcast (const unsigned long __prog,
const unsigned long __vers,
const unsigned long __proc, xdrproc_t __xargs,
char* __argsp, xdrproc_t __xresults,
char* __resultsp,
resultproc_t __eachresult) __THROW;
extern unsigned short pmap_getport (struct sockaddr_in *__address,
const unsigned long __program,
const unsigned long __version, unsigned int __protocol)
__THROW;
 
__END_DECLS
 
#endif /* rpc/pmap_clnt.h */
/contrib/media/updf/include/rpc/pmap_prot.h
0,0 → 1,108
/* @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC; from 1.14 88/02/08 SMI */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
 
/*
* pmap_prot.h
* Protocol for the local binder service, or pmap.
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
 
#ifndef _RPC_PMAP_PROT_H
#define _RPC_PMAP_PROT_H 1
 
#include <sys/cdefs.h>
 
#include <rpc/xdr.h>
 
__BEGIN_DECLS
 
/* The following procedures are supported by the protocol:
*
* PMAPPROC_NULL() returns ()
* takes nothing, returns nothing
*
* PMAPPROC_SET(struct pmap) returns (bool_t)
* TRUE is success, FALSE is failure. Registers the tuple
* [prog, vers, prot, port].
*
* PMAPPROC_UNSET(struct pmap) returns (bool_t)
* TRUE is success, FALSE is failure. Un-registers pair
* [prog, vers]. prot and port are ignored.
*
* PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
* 0 is failure. Otherwise returns the port number where the pair
* [prog, vers] is registered. It may lie!
*
* PMAPPROC_DUMP() RETURNS (struct pmaplist *)
*
* PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
* RETURNS (port, string<>);
* usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
* Calls the procedure on the local machine. If it is not registered,
* this procedure is quite; ie it does not return error information!!!
* This procedure only is supported on rpc/udp and calls via
* rpc/udp. This routine only passes null authentication parameters.
* This file has no interface to xdr routines for PMAPPROC_CALLIT.
*
* The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
*/
 
#define PMAPPORT ((unsigned short)111)
#define PMAPPROG ((unsigned long)100000)
#define PMAPVERS ((unsigned long)2)
#define PMAPVERS_PROTO ((unsigned long)2)
#define PMAPVERS_ORIG ((unsigned long)1)
#define PMAPPROC_NULL ((unsigned long)0)
#define PMAPPROC_SET ((unsigned long)1)
#define PMAPPROC_UNSET ((unsigned long)2)
#define PMAPPROC_GETPORT ((unsigned long)3)
#define PMAPPROC_DUMP ((unsigned long)4)
#define PMAPPROC_CALLIT ((unsigned long)5)
 
struct pmap {
long unsigned pm_prog;
long unsigned pm_vers;
long unsigned pm_prot;
long unsigned pm_port;
};
 
extern bool_t xdr_pmap (XDR *__xdrs, struct pmap *__regs) __THROW;
 
struct pmaplist {
struct pmap pml_map;
struct pmaplist *pml_next;
};
 
extern bool_t xdr_pmaplist (XDR *__xdrs, struct pmaplist **__rp) __THROW;
 
__END_DECLS
 
#endif /* rpc/pmap_prot.h */
/contrib/media/updf/include/rpc/pmap_rmt.h
0,0 → 1,68
/* @(#)pmap_rmt.h 2.1 88/07/29 4.0 RPCSRC; from 1.2 88/02/08 SMI */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
 
/*
* Structures and XDR routines for parameters to and replies from
* the portmapper remote-call-service.
*
* Copyright (C) 1986, Sun Microsystems, Inc.
*/
 
#ifndef _RPC_PMAP_RMT_H
#define _RPC_PMAP_RMT_H 1
 
#include <sys/cdefs.h>
#include <sys/types.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
 
__BEGIN_DECLS
 
struct rmtcallargs {
unsigned long prog, vers, proc, arglen;
char* args_ptr;
xdrproc_t xdr_args;
};
 
extern bool_t xdr_rmtcall_args (XDR *__xdrs, struct rmtcallargs *__crp)
__THROW;
 
struct rmtcallres {
unsigned long *port_ptr;
unsigned long resultslen;
char* results_ptr;
xdrproc_t xdr_results;
};
 
extern bool_t xdr_rmtcallres (XDR *__xdrs, struct rmtcallres *__crp) __THROW;
 
__END_DECLS
 
#endif /* rpc/pmap_rmt.h */
/contrib/media/updf/include/rpc/rpc.h
0,0 → 1,70
/* @(#)rpc.h 2.3 88/08/10 4.0 RPCSRC; from 1.9 88/02/08 SMI */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
 
/*
* rpc.h, Just includes the billions of rpc header files necessary to
* do remote procedure calling.
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
 
#ifndef _RPC_RPC_H
#define _RPC_RPC_H 1
 
#include <rpc/types.h> /* some typedefs */
#include <netinet/in.h>
 
/* external data representation interfaces */
#include <rpc/xdr.h> /* generic (de)serializer */
 
/* Client side only authentication */
#include <rpc/auth.h> /* generic authenticator (client side) */
 
/* Client side (mostly) remote procedure call */
#include <rpc/clnt.h> /* generic rpc stuff */
 
/* semi-private protocol headers */
#include <rpc/rpc_msg.h> /* protocol for rpc messages */
#include <rpc/auth_unix.h> /* protocol for unix style cred */
#include <rpc/auth_des.h> /* protocol for des style cred */
 
/* Server side only remote procedure callee */
#include <rpc/svc.h> /* service manager and multiplexer */
#include <rpc/svc_auth.h> /* service side authenticator */
 
/*
* COMMENT OUT THE NEXT INCLUDE IF RUNNING ON SUN OS OR ON A VERSION
* OF UNIX BASED ON NFSSRC. These systems will already have the structures
* defined by <rpc/netdb.h> included in <netdb.h>.
*/
/* routines for parsing /etc/rpc */
#include <rpc/netdb.h> /* structures and routines to parse /etc/rpc */
 
#endif /* rpc/rpc.h */
/contrib/media/updf/include/rpc/rpc_des.h
0,0 → 1,76
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
/*
* Generic DES driver interface
* Keep this file hardware independent!
* Copyright (c) 1986 by Sun Microsystems, Inc.
*/
 
#ifndef _DES_H
#define _DES_H
 
#include <sys/types.h>
 
__BEGIN_DECLS
 
#define DES_MAXLEN 65536 /* maximum # of bytes to encrypt */
#define DES_QUICKLEN 16 /* maximum # of bytes to encrypt quickly */
 
enum desdir
{
ENCRYPT, DECRYPT
};
enum desmode
{
CBC, ECB
};
 
/*
* parameters to ioctl call
*/
struct desparams
{
u_char des_key[8]; /* key (with low bit parity) */
enum desdir des_dir; /* direction */
enum desmode des_mode; /* mode */
u_char des_ivec[8]; /* input vector */
unsigned des_len; /* number of bytes to crypt */
union
{
u_char UDES_data[DES_QUICKLEN];
u_char *UDES_buf;
}
UDES;
#define des_data UDES.UDES_data /* direct data here if quick */
#define des_buf UDES.UDES_buf /* otherwise, pointer to data */
};
 
__END_DECLS
 
#endif
/contrib/media/updf/include/rpc/rpc_msg.h
0,0 → 1,202
/* @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
/* @(#)rpc_msg.h 1.7 86/07/16 SMI */
 
#ifndef _RPC_MSG_H
#define _RPC_MSG_H 1
 
#include <sys/cdefs.h>
 
#include <rpc/xdr.h>
#include <rpc/clnt.h>
 
/*
* rpc_msg.h
* rpc message definition
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
 
#define RPC_MSG_VERSION ((unsigned long) 2)
#define RPC_SERVICE_PORT ((unsigned short) 2048)
 
__BEGIN_DECLS
 
/*
* Bottom up definition of an rpc message.
* NOTE: call and reply use the same overall struct but
* different parts of unions within it.
*/
 
enum msg_type {
CALL=0,
REPLY=1
};
 
enum reply_stat {
MSG_ACCEPTED=0,
MSG_DENIED=1
};
 
enum accept_stat {
SUCCESS=0,
PROG_UNAVAIL=1,
PROG_MISMATCH=2,
PROC_UNAVAIL=3,
GARBAGE_ARGS=4,
SYSTEM_ERR=5
};
 
enum reject_stat {
RPC_MISMATCH=0,
AUTH_ERROR=1
};
 
/*
* Reply part of an rpc exchange
*/
 
/*
* Reply to an rpc request that was accepted by the server.
* Note: there could be an error even though the request was
* accepted.
*/
struct accepted_reply {
struct opaque_auth ar_verf;
enum accept_stat ar_stat;
union {
struct {
unsigned long low;
unsigned long high;
} AR_versions;
struct {
char* where;
xdrproc_t proc;
} AR_results;
/* and many other null cases */
} ru;
#define ar_results ru.AR_results
#define ar_vers ru.AR_versions
};
 
/*
* Reply to an rpc request that was rejected by the server.
*/
struct rejected_reply {
enum reject_stat rj_stat;
union {
struct {
unsigned long low;
unsigned long high;
} RJ_versions;
enum auth_stat RJ_why; /* why authentication did not work */
} ru;
#define rj_vers ru.RJ_versions
#define rj_why ru.RJ_why
};
 
/*
* Body of a reply to an rpc request.
*/
struct reply_body {
enum reply_stat rp_stat;
union {
struct accepted_reply RP_ar;
struct rejected_reply RP_dr;
} ru;
#define rp_acpt ru.RP_ar
#define rp_rjct ru.RP_dr
};
 
/*
* Body of an rpc request call.
*/
struct call_body {
unsigned long cb_rpcvers; /* must be equal to two */
unsigned long cb_prog;
unsigned long cb_vers;
unsigned long cb_proc;
struct opaque_auth cb_cred;
struct opaque_auth cb_verf; /* protocol specific - provided by client */
};
 
/*
* The rpc message
*/
struct rpc_msg {
unsigned long rm_xid;
enum msg_type rm_direction;
union {
struct call_body RM_cmb;
struct reply_body RM_rmb;
} ru;
#define rm_call ru.RM_cmb
#define rm_reply ru.RM_rmb
};
#define acpted_rply ru.RM_rmb.ru.RP_ar
#define rjcted_rply ru.RM_rmb.ru.RP_dr
 
 
/*
* XDR routine to handle a rpc message.
* xdr_callmsg(xdrs, cmsg)
* XDR *xdrs;
* struct rpc_msg *cmsg;
*/
extern bool_t xdr_callmsg (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW;
 
/*
* XDR routine to pre-serialize the static part of a rpc message.
* xdr_callhdr(xdrs, cmsg)
* XDR *xdrs;
* struct rpc_msg *cmsg;
*/
extern bool_t xdr_callhdr (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW;
 
/*
* XDR routine to handle a rpc reply.
* xdr_replymsg(xdrs, rmsg)
* XDR *xdrs;
* struct rpc_msg *rmsg;
*/
extern bool_t xdr_replymsg (XDR *__xdrs, struct rpc_msg *__rmsg) __THROW;
 
/*
* Fills in the error part of a reply message.
* _seterr_reply(msg, error)
* struct rpc_msg *msg;
* struct rpc_err *error;
*/
extern void _seterr_reply (struct rpc_msg *__msg, struct rpc_err *__error)
__THROW;
 
__END_DECLS
 
#endif /* rpc/rpc_msg.h */
/contrib/media/updf/include/rpc/svc.h
0,0 → 1,316
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
 
/*
* svc.h, Server-side remote procedure call interface.
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
 
#ifndef _RPC_SVC_H
#define _RPC_SVC_H 1
 
#include <sys/cdefs.h>
#include <rpc/rpc_msg.h>
 
__BEGIN_DECLS
 
/*
* This interface must manage two items concerning remote procedure calling:
*
* 1) An arbitrary number of transport connections upon which rpc requests
* are received. The two most notable transports are TCP and UDP; they are
* created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
* they in turn call xprt_register and xprt_unregister.
*
* 2) An arbitrary number of locally registered services. Services are
* described by the following four data: program number, version number,
* "service dispatch" function, a transport handle, and a boolean that
* indicates whether or not the exported program should be registered with a
* local binder service; if true the program's number and version and the
* port number from the transport handle are registered with the binder.
* These data are registered with the rpc svc system via svc_register.
*
* A service's dispatch function is called whenever an rpc request comes in
* on a transport. The request's program and version numbers must match
* those of the registered service. The dispatch function is passed two
* parameters, struct svc_req * and SVCXPRT *, defined below.
*/
 
enum xprt_stat {
XPRT_DIED,
XPRT_MOREREQS,
XPRT_IDLE
};
 
/*
* Server side transport handle
*/
typedef struct SVCXPRT SVCXPRT;
struct SVCXPRT {
int xp_sock;
unsigned short xp_port; /* associated port number */
const struct xp_ops {
bool_t (*xp_recv) (SVCXPRT *__xprt, struct rpc_msg *__msg);
/* receive incoming requests */
enum xprt_stat (*xp_stat) (SVCXPRT *__xprt);
/* get transport status */
bool_t (*xp_getargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args,
char* args_ptr); /* get arguments */
bool_t (*xp_reply) (SVCXPRT *__xprt, struct rpc_msg *__msg);
/* send reply */
bool_t (*xp_freeargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args,
char* args_ptr);
/* free mem allocated for args */
void (*xp_destroy) (SVCXPRT *__xprt);
/* destroy this struct */
} *xp_ops;
int xp_addrlen; /* length of remote address */
struct sockaddr_in xp_raddr; /* remote address */
struct opaque_auth xp_verf; /* raw response verifier */
char* xp_p1; /* private */
char* xp_p2; /* private */
char xp_pad [256]; /* padding, internal use */
};
 
/*
* Approved way of getting address of caller
*/
#define svc_getcaller(x) (&(x)->xp_raddr)
 
/*
* Operations defined on an SVCXPRT handle
*
* SVCXPRT *xprt;
* struct rpc_msg *msg;
* xdrproc_t xargs;
* char* argsp;
*/
#define SVC_RECV(xprt, msg) \
(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
#define svc_recv(xprt, msg) \
(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
 
#define SVC_STAT(xprt) \
(*(xprt)->xp_ops->xp_stat)(xprt)
#define svc_stat(xprt) \
(*(xprt)->xp_ops->xp_stat)(xprt)
 
#define SVC_GETARGS(xprt, xargs, argsp) \
(*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
#define svc_getargs(xprt, xargs, argsp) \
(*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
 
#define SVC_REPLY(xprt, msg) \
(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
#define svc_reply(xprt, msg) \
(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
 
#define SVC_FREEARGS(xprt, xargs, argsp) \
(*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
#define svc_freeargs(xprt, xargs, argsp) \
(*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
 
#define SVC_DESTROY(xprt) \
(*(xprt)->xp_ops->xp_destroy)(xprt)
#define svc_destroy(xprt) \
(*(xprt)->xp_ops->xp_destroy)(xprt)
 
 
/*
* Service request
*/
struct svc_req {
rpcprog_t rq_prog; /* service program number */
rpcvers_t rq_vers; /* service protocol version */
rpcproc_t rq_proc; /* the desired procedure */
struct opaque_auth rq_cred; /* raw creds from the wire */
char* rq_clntcred; /* read only cooked cred */
SVCXPRT *rq_xprt; /* associated transport */
};
 
#ifndef __DISPATCH_FN_T
#define __DISPATCH_FN_T
typedef void (*__dispatch_fn_t) (struct svc_req*, SVCXPRT*);
#endif
 
/*
* Service registration
*
* svc_register(xprt, prog, vers, dispatch, protocol)
* SVCXPRT *xprt;
* rpcprog_t prog;
* rpcvers_t vers;
* void (*dispatch)(struct svc_req*, SVCXPRT*);
* rpcprot_t protocol; like TCP or UDP, zero means do not register
*/
extern bool_t svc_register (SVCXPRT *__xprt, rpcprog_t __prog,
rpcvers_t __vers, __dispatch_fn_t __dispatch,
rpcprot_t __protocol) __THROW;
 
/*
* Service un-registration
*
* svc_unregister(prog, vers)
* rpcprog_t prog;
* rpcvers_t vers;
*/
extern void svc_unregister (rpcprog_t __prog, rpcvers_t __vers) __THROW;
 
/*
* Transport registration.
*
* xprt_register(xprt)
* SVCXPRT *xprt;
*/
extern void xprt_register (SVCXPRT *__xprt) __THROW;
 
/*
* Transport un-register
*
* xprt_unregister(xprt)
* SVCXPRT *xprt;
*/
extern void xprt_unregister (SVCXPRT *__xprt) __THROW;
 
 
/*
* When the service routine is called, it must first check to see if it
* knows about the procedure; if not, it should call svcerr_noproc
* and return. If so, it should deserialize its arguments via
* SVC_GETARGS (defined above). If the deserialization does not work,
* svcerr_decode should be called followed by a return. Successful
* decoding of the arguments should be followed the execution of the
* procedure's code and a call to svc_sendreply.
*
* Also, if the service refuses to execute the procedure due to too-
* weak authentication parameters, svcerr_weakauth should be called.
* Note: do not confuse access-control failure with weak authentication!
*
* NB: In pure implementations of rpc, the caller always waits for a reply
* msg. This message is sent when svc_sendreply is called.
* Therefore pure service implementations should always call
* svc_sendreply even if the function logically returns void; use
* xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows
* for the abuse of pure rpc via batched calling or pipelining. In the
* case of a batched call, svc_sendreply should NOT be called since
* this would send a return message, which is what batching tries to avoid.
* It is the service/protocol writer's responsibility to know which calls are
* batched and which are not. Warning: responding to batch calls may
* deadlock the caller and server processes!
*/
 
extern bool_t svc_sendreply (SVCXPRT *xprt, xdrproc_t __xdr_results,
char* __xdr_location) __THROW;
 
extern void svcerr_decode (SVCXPRT *__xprt) __THROW;
 
extern void svcerr_weakauth (SVCXPRT *__xprt) __THROW;
 
extern void svcerr_noproc (SVCXPRT *__xprt) __THROW;
 
extern void svcerr_progvers (SVCXPRT *__xprt, rpcvers_t __low_vers,
rpcvers_t __high_vers) __THROW;
 
extern void svcerr_auth (SVCXPRT *__xprt, enum auth_stat __why) __THROW;
 
extern void svcerr_noprog (SVCXPRT *__xprt) __THROW;
 
extern void svcerr_systemerr (SVCXPRT *__xprt) __THROW;
 
/*
* Lowest level dispatching -OR- who owns this process anyway.
* Somebody has to wait for incoming requests and then call the correct
* service routine. The routine svc_run does infinite waiting; i.e.,
* svc_run never returns.
* Since another (coexistent) package may wish to selectively wait for
* incoming calls or other events outside of the rpc architecture, the
* routine svc_getreq is provided. It must be passed readfds, the
* "in-place" results of a select system call (see select, section 2).
*/
 
/*
* Global keeper of rpc service descriptors in use
* dynamic; must be inspected before each call to select
*/
 
extern struct pollfd *svc_pollfd;
extern int svc_max_pollfd;
extern fd_set svc_fdset;
#define svc_fds svc_fdset.fds_bits[0] /* compatibility */
 
/*
* a small program implemented by the svc_rpc implementation itself;
* also see clnt.h for protocol numbers.
*/
extern void svc_getreq (int __rdfds) __THROW;
extern void svc_getreq_common (const int __fd) __THROW;
extern void svc_getreqset (fd_set *__readfds) __THROW;
extern void svc_getreq_poll (struct pollfd *, const int) __THROW;
extern void svc_exit (void) __THROW;
extern void svc_run (void) __THROW;
 
/*
* Socket to use on svcxxx_create call to get default socket
*/
#define RPC_ANYSOCK -1
 
/*
* These are the existing service side transport implementations
*/
 
/*
* Memory based rpc for testing and timing.
*/
extern SVCXPRT *svcraw_create (void) __THROW;
 
/*
* Udp based rpc.
*/
extern SVCXPRT *svcudp_create (int __sock) __THROW;
extern SVCXPRT *svcudp_bufcreate (int __sock, unsigned int __sendsz, unsigned int __recvsz)
__THROW;
 
/*
* Tcp based rpc.
*/
extern SVCXPRT *svctcp_create (int __sock, unsigned int __sendsize, unsigned int __recvsize)
__THROW;
 
 
/*
* Unix based rpc.
*/
extern SVCXPRT *svcunix_create (int __sock, unsigned int __sendsize, unsigned int __recvsize,
char *__path) __THROW;
 
 
__END_DECLS
 
#endif /* rpc/svc.h */
/contrib/media/updf/include/rpc/svc_auth.h
0,0 → 1,54
/* @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
/* @(#)svc_auth.h 1.6 86/07/16 SMI */
 
/*
* svc_auth.h, Service side of rpc authentication.
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
 
#ifndef _RPC_SVC_AUTH_H
#define _RPC_SVC_AUTH_H 1
 
#include <sys/cdefs.h>
#include <rpc/svc.h>
 
__BEGIN_DECLS
 
/*
* Server side authenticator
*/
extern enum auth_stat _authenticate (struct svc_req *__rqst,
struct rpc_msg *__msg) __THROW;
 
__END_DECLS
 
#endif /* rpc/svc_auth.h */
/contrib/media/updf/include/rpc/types.h
0,0 → 1,80
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
/* fixincludes should not add extern "C" to this file */
/*
* Rpc additions to <sys/types.h>
*/
#ifndef _RPC_TYPES_H
#define _RPC_TYPES_H 1
 
#include <sys/cdefs.h>
 
__BEGIN_DECLS
 
typedef int bool_t;
typedef int enum_t;
/* This needs to be changed to uint32_t in the future */
typedef unsigned long rpcprog_t;
typedef unsigned long rpcvers_t;
typedef unsigned long rpcproc_t;
typedef unsigned long rpcprot_t;
typedef unsigned long rpcport_t;
 
#define __dontcare__ -1
 
#ifndef FALSE
# define FALSE (0)
#endif
 
#ifndef TRUE
# define TRUE (1)
#endif
 
#include <stdlib.h> /* For malloc decl. */
#define mem_alloc(bsize) malloc(bsize)
#define mem_free(ptr, bsize) free(ptr)
 
#ifndef makedev /* ie, we haven't already included it */
#include <sys/types.h>
#endif
#include <sys/time.h>
#include <sys/param.h>
 
#include <netinet/in.h>
 
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK 0x7F000001UL
#endif
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
#endif
 
__END_DECLS
 
#endif /* rpc/types.h */
/contrib/media/updf/include/rpc/xdr.h
0,0 → 1,379
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
*
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
 
/*
* xdr.h, External Data Representation Serialization Routines.
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
 
#ifndef _RPC_XDR_H
#define _RPC_XDR_H 1
 
#include <sys/cdefs.h>
#include <sys/types.h>
#include <rpc/types.h>
 
/* We need FILE. */
#include <stdio.h>
 
__BEGIN_DECLS
 
/*
* XDR provides a conventional way for converting between C data
* types and an external bit-string representation. Library supplied
* routines provide for the conversion on built-in C data types. These
* routines and utility routines defined here are used to help implement
* a type encode/decode routine for each user-defined type.
*
* Each data type provides a single procedure which takes two arguments:
*
* bool_t
* xdrproc(xdrs, argresp)
* XDR *xdrs;
* <type> *argresp;
*
* xdrs is an instance of a XDR handle, to which or from which the data
* type is to be converted. argresp is a pointer to the structure to be
* converted. The XDR handle contains an operation field which indicates
* which of the operations (ENCODE, DECODE * or FREE) is to be performed.
*
* XDR_DECODE may allocate space if the pointer argresp is null. This
* data can be freed with the XDR_FREE operation.
*
* We write only one procedure per data type to make it easy
* to keep the encode and decode procedures for a data type consistent.
* In many cases the same code performs all operations on a user defined type,
* because all the hard work is done in the component type routines.
* decode as a series of calls on the nested data types.
*/
 
/*
* Xdr operations. XDR_ENCODE causes the type to be encoded into the
* stream. XDR_DECODE causes the type to be extracted from the stream.
* XDR_FREE can be used to release the space allocated by an XDR_DECODE
* request.
*/
enum xdr_op {
XDR_ENCODE = 0,
XDR_DECODE = 1,
XDR_FREE = 2
};
 
/*
* This is the number of bytes per unit of external data.
*/
#define BYTES_PER_XDR_UNIT (4)
/*
* This only works if the above is a power of 2. But it's defined to be
* 4 by the appropriate RFCs. So it will work. And it's normally quicker
* than the old routine.
*/
#if 1
#define RNDUP(x) (((x) + BYTES_PER_XDR_UNIT - 1) & ~(BYTES_PER_XDR_UNIT - 1))
#else /* this is the old routine */
#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \
* BYTES_PER_XDR_UNIT)
#endif
 
/*
* The XDR handle.
* Contains operation which is being applied to the stream,
* an operations vector for the particular implementation (e.g. see xdr_mem.c),
* and two private fields for the use of the particular implementation.
*/
typedef struct XDR XDR;
struct XDR
{
enum xdr_op x_op; /* operation; fast additional param */
struct xdr_ops
{
bool_t (*x_getlong) (XDR *__xdrs, long *__lp);
/* get a long from underlying stream */
bool_t (*x_putlong) (XDR *__xdrs, const long *__lp);
/* put a long to " */
bool_t (*x_getbytes) (XDR *__xdrs, char* __addr, unsigned int __len);
/* get some bytes from " */
bool_t (*x_putbytes) (XDR *__xdrs, const char *__addr, unsigned int __len);
/* put some bytes to " */
unsigned int (*x_getpostn) (const XDR *__xdrs);
/* returns bytes off from beginning */
bool_t (*x_setpostn) (XDR *__xdrs, unsigned int __pos);
/* lets you reposition the stream */
int32_t *(*x_inline) (XDR *__xdrs, unsigned int __len);
/* buf quick ptr to buffered data */
void (*x_destroy) (XDR *__xdrs);
/* free privates of this xdr_stream */
bool_t (*x_getint32) (XDR *__xdrs, int32_t *__ip);
/* get a int from underlying stream */
bool_t (*x_putint32) (XDR *__xdrs, const int32_t *__ip);
/* put a int to " */
}
*x_ops;
char* x_public; /* users' data */
char* x_private; /* pointer to private data */
char* x_base; /* private used for position info */
unsigned int x_handy; /* extra private word */
};
 
/*
* A xdrproc_t exists for each data type which is to be encoded or decoded.
*
* The second argument to the xdrproc_t is a pointer to an opaque pointer.
* The opaque pointer generally points to a structure of the data type
* to be decoded. If this pointer is 0, then the type routines should
* allocate dynamic storage of the appropriate size and return it.
* bool_t (*xdrproc_t)(XDR *, char* *);
*/
typedef bool_t (*xdrproc_t) (XDR *, void *,...);
 
 
/*
* Operations defined on a XDR handle
*
* XDR *xdrs;
* int32_t *int32p;
* long *longp;
* char* addr;
* unsigned int len;
* unsigned int pos;
*/
#define XDR_GETINT32(xdrs, int32p) \
(*(xdrs)->x_ops->x_getint32)(xdrs, int32p)
#define xdr_getint32(xdrs, int32p) \
(*(xdrs)->x_ops->x_getint32)(xdrs, int32p)
 
#define XDR_PUTINT32(xdrs, int32p) \
(*(xdrs)->x_ops->x_putint32)(xdrs, int32p)
#define xdr_putint32(xdrs, int32p) \
(*(xdrs)->x_ops->x_putint32)(xdrs, int32p)
 
#define XDR_GETLONG(xdrs, longp) \
(*(xdrs)->x_ops->x_getlong)(xdrs, longp)
#define xdr_getlong(xdrs, longp) \
(*(xdrs)->x_ops->x_getlong)(xdrs, longp)
 
#define XDR_PUTLONG(xdrs, longp) \
(*(xdrs)->x_ops->x_putlong)(xdrs, longp)
#define xdr_putlong(xdrs, longp) \
(*(xdrs)->x_ops->x_putlong)(xdrs, longp)
 
#define XDR_GETBYTES(xdrs, addr, len) \
(*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
#define xdr_getbytes(xdrs, addr, len) \
(*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
 
#define XDR_PUTBYTES(xdrs, addr, len) \
(*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
#define xdr_putbytes(xdrs, addr, len) \
(*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
 
#define XDR_GETPOS(xdrs) \
(*(xdrs)->x_ops->x_getpostn)(xdrs)
#define xdr_getpos(xdrs) \
(*(xdrs)->x_ops->x_getpostn)(xdrs)
 
#define XDR_SETPOS(xdrs, pos) \
(*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
#define xdr_setpos(xdrs, pos) \
(*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
 
#define XDR_INLINE(xdrs, len) \
(*(xdrs)->x_ops->x_inline)(xdrs, len)
#define xdr_inline(xdrs, len) \
(*(xdrs)->x_ops->x_inline)(xdrs, len)
 
#define XDR_DESTROY(xdrs) \
do { \
if ((xdrs)->x_ops->x_destroy) \
(*(xdrs)->x_ops->x_destroy)(xdrs); \
} while (0)
#define xdr_destroy(xdrs) \
do { \
if ((xdrs)->x_ops->x_destroy) \
(*(xdrs)->x_ops->x_destroy)(xdrs); \
} while (0)
 
/*
* Support struct for discriminated unions.
* You create an array of xdrdiscrim structures, terminated with
* a entry with a null procedure pointer. The xdr_union routine gets
* the discriminant value and then searches the array of structures
* for a matching value. If a match is found the associated xdr routine
* is called to handle that part of the union. If there is
* no match, then a default routine may be called.
* If there is no match and no default routine it is an error.
*/
#define NULL_xdrproc_t ((xdrproc_t)0)
struct xdr_discrim
{
int value;
xdrproc_t proc;
};
 
/*
* Inline routines for fast encode/decode of primitive data types.
* Caveat emptor: these use single memory cycles to get the
* data from the underlying buffer, and will fail to operate
* properly if the data is not aligned. The standard way to use these
* is to say:
* if ((buf = XDR_INLINE(xdrs, count)) == NULL)
* return (FALSE);
* <<< macro calls >>>
* where ``count'' is the number of bytes of data occupied
* by the primitive data types.
*
* N.B. and frozen for all time: each data type here uses 4 bytes
* of external representation.
*/
 
#define IXDR_GET_INT32(buf) ((int32_t)ntohl((uint32_t)*(buf)++))
#define IXDR_PUT_INT32(buf, v) (*(buf)++ = (int32_t)htonl((uint32_t)(v)))
#define IXDR_GET_U_INT32(buf) ((uint32_t)IXDR_GET_INT32(buf))
#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32(buf, (int32_t)(v))
 
/* WARNING: The IXDR_*_LONG defines are removed by Sun for new platforms
* and shouldn't be used any longer. Code which use this defines or longs
* in the RPC code will not work on 64bit Solaris platforms !
*/
#define IXDR_GET_LONG(buf) \
((long)ntohl((unsigned long)*__extension__((uint32_t*)(buf))++))
#define IXDR_PUT_LONG(buf, v) \
(*__extension__((uint32_t*)(buf))++ = (long)htonl((unsigned long)(v)))
#define IXDR_GET_U_LONG(buf) ((unsigned long)IXDR_GET_LONG(buf))
#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v))
 
 
#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf))
#define IXDR_GET_U_SHORT(buf) ((unsigned short)IXDR_GET_LONG(buf))
 
#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG(buf, (long)(v))
#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG(buf, (long)(v))
#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG(buf, (long)(v))
#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG(buf, (long)(v))
 
/*
* These are the "generic" xdr routines.
* None of these can have const applied because it's not possible to
* know whether the call is a read or a write to the passed parameter
* also, the XDR structure is always updated by some of these calls.
*/
extern bool_t xdr_void (void) __THROW;
extern bool_t xdr_short (XDR *__xdrs, short *__sp) __THROW;
extern bool_t xdr_u_short (XDR *__xdrs, unsigned short *__usp) __THROW;
extern bool_t xdr_int (XDR *__xdrs, int *__ip) __THROW;
extern bool_t xdr_u_int (XDR *__xdrs, unsigned int *__up) __THROW;
extern bool_t xdr_long (XDR *__xdrs, long *__lp) __THROW;
extern bool_t xdr_u_long (XDR *__xdrs, unsigned long *__ulp) __THROW;
extern bool_t xdr_hyper (XDR *__xdrs, int64_t *__llp) __THROW;
extern bool_t xdr_u_hyper (XDR *__xdrs, uint64_t *__ullp) __THROW;
extern bool_t xdr_longlong_t (XDR *__xdrs, int64_t *__llp) __THROW;
extern bool_t xdr_u_longlong_t (XDR *__xdrs, uint64_t *__ullp) __THROW;
extern bool_t xdr_int8_t (XDR *__xdrs, int8_t *__ip) __THROW;
extern bool_t xdr_uint8_t (XDR *__xdrs, uint8_t *__up) __THROW;
extern bool_t xdr_int16_t (XDR *__xdrs, int16_t *__ip) __THROW;
extern bool_t xdr_uint16_t (XDR *__xdrs, uint16_t *__up) __THROW;
extern bool_t xdr_int32_t (XDR *__xdrs, int32_t *__ip) __THROW;
extern bool_t xdr_uint32_t (XDR *__xdrs, uint32_t *__up) __THROW;
extern bool_t xdr_int64_t (XDR *__xdrs, int64_t *__ip) __THROW;
extern bool_t xdr_uint64_t (XDR *__xdrs, uint64_t *__up) __THROW;
extern bool_t xdr_bool (XDR *__xdrs, bool_t *__bp) __THROW;
extern bool_t xdr_enum (XDR *__xdrs, enum_t *__ep) __THROW;
extern bool_t xdr_array (XDR * _xdrs, char* *__addrp, unsigned int *__sizep,
unsigned int __maxsize, unsigned int __elsize, xdrproc_t __elproc)
__THROW;
extern bool_t xdr_bytes (XDR *__xdrs, char **__cpp, unsigned int *__sizep,
unsigned int __maxsize) __THROW;
extern bool_t xdr_opaque (XDR *__xdrs, char* __cp, unsigned int __cnt) __THROW;
extern bool_t xdr_string (XDR *__xdrs, char **__cpp, unsigned int __maxsize) __THROW;
extern bool_t xdr_union (XDR *__xdrs, enum_t *__dscmp, char *__unp,
const struct xdr_discrim *__choices,
xdrproc_t dfault) __THROW;
extern bool_t xdr_char (XDR *__xdrs, char *__cp) __THROW;
extern bool_t xdr_u_char (XDR *__xdrs, unsigned char *__cp) __THROW;
extern bool_t xdr_vector (XDR *__xdrs, char *__basep, unsigned int __nelem,
unsigned int __elemsize, xdrproc_t __xdr_elem) __THROW;
extern bool_t xdr_float (XDR *__xdrs, float *__fp) __THROW;
extern bool_t xdr_double (XDR *__xdrs, double *__dp) __THROW;
extern bool_t xdr_reference (XDR *__xdrs, char* *__xpp, unsigned int __size,
xdrproc_t __proc) __THROW;
extern bool_t xdr_pointer (XDR *__xdrs, char **__objpp,
unsigned int __obj_size, xdrproc_t __xdr_obj) __THROW;
extern bool_t xdr_wrapstring (XDR *__xdrs, char **__cpp) __THROW;
extern unsigned long xdr_sizeof (xdrproc_t, void *) __THROW;
 
/*
* Common opaque bytes objects used by many rpc protocols;
* declared here due to commonality.
*/
#define MAX_NETOBJ_SZ 1024
struct netobj
{
unsigned int n_len;
char *n_bytes;
};
typedef struct netobj netobj;
extern bool_t xdr_netobj (XDR *__xdrs, struct netobj *__np) __THROW;
 
/*
* These are the public routines for the various implementations of
* xdr streams.
*/
 
/* XDR using memory buffers */
extern void xdrmem_create (XDR *__xdrs, const char* __addr,
unsigned int __size, enum xdr_op __xop) __THROW;
 
/* XDR using stdio library */
extern void xdrstdio_create (XDR *__xdrs, FILE *__file, enum xdr_op __xop)
__THROW;
 
/* XDR pseudo records for tcp */
extern void xdrrec_create (XDR *__xdrs, unsigned int __sendsize,
unsigned int __recvsize, char* __tcp_handle,
int (*__readit) (char *, char *, int),
int (*__writeit) (char *, char *, int)) __THROW;
 
/* make end of xdr record */
extern bool_t xdrrec_endofrecord (XDR *__xdrs, bool_t __sendnow) __THROW;
 
/* move to beginning of next record */
extern bool_t xdrrec_skiprecord (XDR *__xdrs) __THROW;
 
/* true if no more input */
extern bool_t xdrrec_eof (XDR *__xdrs) __THROW;
 
/* free memory buffers for xdr */
extern void xdr_free (xdrproc_t __proc, char *__objp) __THROW;
 
__END_DECLS
 
#endif /* rpc/xdr.h */
/contrib/media/updf/include/scripts/menuetos_app_v01.ld
0,0 → 1,52
/*OUTPUT_FORMAT("binary")*/
ENTRY("start")
SECTIONS
{
.text 0x000000 :
{
code = . ; _code = . ;
*(.text)
*(.fixup)
*(.gnu.warning)
*(.gnu.linkonce.t*)
*(.const)
*(.ro*)
*(.gnu.linkonce.r*)
ecode = . ; _ecode = . ;
}
.rdata :
{
}
.data :
{
djgpp_first_ctor = . ;
*(.ctor)
*(.ctors)
djgpp_last_ctor = . ;
djgpp_first_dtor = . ;
*(.dtor)
*(.dtors)
djgpp_last_dtor = . ;
*(.gcc_exc*)
__EH_FRAME_BEGIN__ = . ;
*(.eh_fram*)
__EH_FRAME_END__ = . ;
LONG(0);
*(.gnu.linkonce.d*)
*(.rodata)
*(.rodata.*)
*(.data)
edata = . ; _edata = . ;
bss = . ;
}
.bss :
{
*(.bss)
*(.note.gnu.build-id);
}
end = . ; _end = . ;
 
}
 
 
/contrib/media/updf/include/scripts/menuetos_dll.ld
0,0 → 1,41
OUTPUT_FORMAT("coff-go32")
SECTIONS
{
.text 0x000000 :
{
code = . ;
*(.text)
*(.fixup)
*(.gnu.warning)
*(.gnu.linkonce.t*)
*(.const)
*(.ro*)
*(.gnu.linkonce.r*)
ecode = . ; _ecode = . ;
}
.data :
{
djgpp_first_ctor = . ;
*(.ctor)
djgpp_last_ctor = . ;
djgpp_first_dtor = . ;
*(.dtor)
djgpp_last_dtor = . ;
*(.gcc_exc*)
__EH_FRAME_BEGIN__ = . ;
*(.eh_fram*)
__EH_FRAME_END__ = . ;
LONG(0);
*(.gnu.linkonce.d*)
*(.rodata)
*(.rodata.*)
*(.data)
edata = . ; _edata = . ;
bss = . ;
}
.bss :
{
*(.bss)
}
end = . ; _end = . ;
}
/contrib/media/updf/include/search.h
0,0 → 1,36
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_search_h_
#define __dj_include_search_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
typedef struct qelem {
struct qelem *q_forw;
struct qelem *q_back;
char q_data[0];
} qelem;
 
void insque(struct qelem *_elem, struct qelem *_pred);
void remque(struct qelem *_elem);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_search_h_ */
/contrib/media/updf/include/set
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_SET
#include <bits/std_set.h>
#endif
/contrib/media/updf/include/setjmp.h
0,0 → 1,48
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_setjmp_h_
#define __dj_include_setjmp_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
typedef struct __jmp_buf {
unsigned long __eax, __ebx, __ecx, __edx, __esi;
unsigned long __edi, __ebp, __esp, __eip, __eflags;
unsigned short __cs, __ds, __es, __fs, __gs, __ss;
unsigned long __sigmask; /* for POSIX signals only */
unsigned long __signum; /* for expansion */
unsigned long __exception_ptr; /* pointer to previous exception */
unsigned char __fpu_state[108]; /* for future use */
} jmp_buf[1];
 
void longjmp(jmp_buf env, int val);
int setjmp(jmp_buf env);
 
#define _longjmp longjmp
#define _setjmp setjmp
 
#ifndef __STRICT_ANSI__
 
typedef jmp_buf sigjmp_buf;
 
int sigsetjmp(sigjmp_buf env, int savemask);
int siglongjmp(sigjmp_buf env, int val);
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_setjmp_h_ */
/contrib/media/updf/include/share.h
0,0 → 1,5
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/* DO NOT USE THIS IN NEW CODE. It is here only
to allow old code to compile. */
 
#include <fcntl.h>
/contrib/media/updf/include/sigc++/adaptor.h
0,0 → 1,43
// -*- c++ -*-
/*
* Copyright 1999 Karl Nelson <kenelson@ece.ucdavis.edu>
*
* 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 _SIGC_ADAPTOR_H_
#define _SIGC_ADAPTOR_H_
#include <sigc++/slot.h>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
struct LIBSIGC_API AdaptorNode : public SlotNode
{
Callback_ data_;
};
 
struct LIBSIGC_API AdaptorSlot_
{
static void copy_callback(SlotData* sdata,AdaptorNode* node);
};
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#endif
 
/contrib/media/updf/include/sigc++/basic_signal.h
0,0 → 1,1185
// -*- c++ -*-
/* This is a generated file, do not edit. Generated from ../sigc++/macros/basic_signal.h.m4 */
 
#ifndef SIGCXX_BASIC_SIGNAL_H
#define SIGCXX_BASIC_SIGNAL_H
#include <sigc++/marshal.h>
#include <sigc++/slot.h>
 
// Qt steals a method name.
#ifdef SIGC_QT
#undef emit
#endif
 
#ifdef emit
#define SIGC_QT
#undef emit
#endif
 
 
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
/****************************************************************
***** Signals (build by macros)
****************************************************************/
 
// common part to all signals
class LIBSIGC_API Signal_
{
private:
Signal_(const Signal_&);
 
protected:
typedef ScopeList List;
struct LIBSIGC_API Impl
{
typedef ScopeList List;
List incoming_;
List outgoing_;
Impl();
~Impl();
};
 
Impl *impl;
 
SlotData* in_connect();
SlotData* out_connect(SlotData *s);
 
Signal_();
~Signal_();
 
public:
bool empty() const;
void clear();
};
 
 
/****************************************************************
***** Signal 0
****************************************************************/
 
template <class R,typename Marsh=class Marshal<R> >
class Signal0:public Signal_
{
public:
typedef Slot0<R> InSlotType;
typedef Slot0<typename Marsh::OutType> OutSlotType;
 
private:
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef typename Marsh::OutType SType;
typedef R RType;
#else
typedef Trait<typename Marsh::OutType>::type SType;
typedef Trait<R>::type RType;
#endif
typedef typename InSlotType::Callback Callback;
typedef Signal0<R,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static SType callback(void* d)
{
CallData* data=(CallData*)d;
return data->obj->emit();
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=(typename OutSlotType::Func)callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
SType emit();
SType operator()()
{return emit();}
 
Signal0() {}
Signal0(const InSlotType &s) {connect(s);}
~Signal0() {}
};
 
 
// emit
template <class R,class Marsh>
typename Signal0<R,Marsh>::SType Signal0<R,Marsh>::
emit()
{
if (!impl||impl->outgoing_.empty()) return Marsh::default_value();
List &out=impl->outgoing_;
Marsh rc;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
if (rc.marshal(s.call())) return rc.value();
}
return rc.value();
}
 
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class Marsh>
class Signal0<void,Marsh>
:public Signal_
{
public:
typedef Slot0<void> InSlotType;
typedef Slot0<void> OutSlotType;
private:
typedef InSlotType::Callback Callback;
typedef Signal0<void,Marsh> Self;
typedef CallDataObj2<OutSlotType::Func,Self> CallData;
 
static void callback(void* d)
{
CallData* data=(CallData*)d;
data->obj->emit();
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData& data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
void emit();
void operator()()
{emit();}
 
Signal0() {}
Signal0(const InSlotType &s) {connect(s);}
~Signal0() {}
};
 
 
// emit
template <class Marsh>
void Signal0<void,Marsh>::
emit()
{
if (!impl||impl->outgoing_.empty()) return;
List &out=impl->outgoing_;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
s.call();
}
}
 
#endif
 
 
/****************************************************************
***** Signal 1
****************************************************************/
 
template <class R,class P1,typename Marsh=class Marshal<R> >
class Signal1:public Signal_
{
public:
typedef Slot1<R,P1> InSlotType;
typedef Slot1<typename Marsh::OutType,P1> OutSlotType;
 
private:
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef typename Marsh::OutType SType;
typedef R RType;
#else
typedef Trait<typename Marsh::OutType>::type SType;
typedef Trait<R>::type RType;
#endif
typedef typename InSlotType::Callback Callback;
typedef Signal1<R,P1,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static SType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
return data->obj->emit(p1);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=(typename OutSlotType::Func)callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
SType emit(typename Trait<P1>::ref p1);
SType operator()(typename Trait<P1>::ref p1)
{return emit(p1);}
 
Signal1() {}
Signal1(const InSlotType &s) {connect(s);}
~Signal1() {}
};
 
 
// emit
template <class R,class P1,class Marsh>
typename Signal1<R,P1,Marsh>::SType Signal1<R,P1,Marsh>::
emit(typename Trait<P1>::ref p1)
{
if (!impl||impl->outgoing_.empty()) return Marsh::default_value();
List &out=impl->outgoing_;
Marsh rc;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
if (rc.marshal(s.call(p1))) return rc.value();
}
return rc.value();
}
 
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class Marsh>
class Signal1<void,P1,Marsh>
:public Signal_
{
public:
typedef Slot1<void,P1> InSlotType;
typedef Slot1<void,P1> OutSlotType;
private:
typedef typename InSlotType::Callback Callback;
typedef Signal1<void,P1,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static void callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
data->obj->emit(p1);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData& data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
void emit(typename Trait<P1>::ref p1);
void operator()(typename Trait<P1>::ref p1)
{emit(p1);}
 
Signal1() {}
Signal1(const InSlotType &s) {connect(s);}
~Signal1() {}
};
 
 
// emit
template <class P1,class Marsh>
void Signal1<void,P1,Marsh>::
emit(typename Trait<P1>::ref p1)
{
if (!impl||impl->outgoing_.empty()) return;
List &out=impl->outgoing_;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
s.call(p1);
}
}
 
#endif
 
 
/****************************************************************
***** Signal 2
****************************************************************/
 
template <class R,class P1,class P2,typename Marsh=class Marshal<R> >
class Signal2:public Signal_
{
public:
typedef Slot2<R,P1,P2> InSlotType;
typedef Slot2<typename Marsh::OutType,P1,P2> OutSlotType;
 
private:
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef typename Marsh::OutType SType;
typedef R RType;
#else
typedef Trait<typename Marsh::OutType>::type SType;
typedef Trait<R>::type RType;
#endif
typedef typename InSlotType::Callback Callback;
typedef Signal2<R,P1,P2,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static SType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
return data->obj->emit(p1,p2);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=(typename OutSlotType::Func)callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
SType emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2);
SType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{return emit(p1,p2);}
 
Signal2() {}
Signal2(const InSlotType &s) {connect(s);}
~Signal2() {}
};
 
 
// emit
template <class R,class P1,class P2,class Marsh>
typename Signal2<R,P1,P2,Marsh>::SType Signal2<R,P1,P2,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{
if (!impl||impl->outgoing_.empty()) return Marsh::default_value();
List &out=impl->outgoing_;
Marsh rc;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
if (rc.marshal(s.call(p1,p2))) return rc.value();
}
return rc.value();
}
 
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class Marsh>
class Signal2<void,P1,P2,Marsh>
:public Signal_
{
public:
typedef Slot2<void,P1,P2> InSlotType;
typedef Slot2<void,P1,P2> OutSlotType;
private:
typedef typename InSlotType::Callback Callback;
typedef Signal2<void,P1,P2,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static void callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
data->obj->emit(p1,p2);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData& data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
void emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2);
void operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{emit(p1,p2);}
 
Signal2() {}
Signal2(const InSlotType &s) {connect(s);}
~Signal2() {}
};
 
 
// emit
template <class P1,class P2,class Marsh>
void Signal2<void,P1,P2,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{
if (!impl||impl->outgoing_.empty()) return;
List &out=impl->outgoing_;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
s.call(p1,p2);
}
}
 
#endif
 
 
/****************************************************************
***** Signal 3
****************************************************************/
 
template <class R,class P1,class P2,class P3,typename Marsh=class Marshal<R> >
class Signal3:public Signal_
{
public:
typedef Slot3<R,P1,P2,P3> InSlotType;
typedef Slot3<typename Marsh::OutType,P1,P2,P3> OutSlotType;
 
private:
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef typename Marsh::OutType SType;
typedef R RType;
#else
typedef Trait<typename Marsh::OutType>::type SType;
typedef Trait<R>::type RType;
#endif
typedef typename InSlotType::Callback Callback;
typedef Signal3<R,P1,P2,P3,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static SType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
return data->obj->emit(p1,p2,p3);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=(typename OutSlotType::Func)callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
SType emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3);
SType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{return emit(p1,p2,p3);}
 
Signal3() {}
Signal3(const InSlotType &s) {connect(s);}
~Signal3() {}
};
 
 
// emit
template <class R,class P1,class P2,class P3,class Marsh>
typename Signal3<R,P1,P2,P3,Marsh>::SType Signal3<R,P1,P2,P3,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{
if (!impl||impl->outgoing_.empty()) return Marsh::default_value();
List &out=impl->outgoing_;
Marsh rc;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
if (rc.marshal(s.call(p1,p2,p3))) return rc.value();
}
return rc.value();
}
 
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class Marsh>
class Signal3<void,P1,P2,P3,Marsh>
:public Signal_
{
public:
typedef Slot3<void,P1,P2,P3> InSlotType;
typedef Slot3<void,P1,P2,P3> OutSlotType;
private:
typedef typename InSlotType::Callback Callback;
typedef Signal3<void,P1,P2,P3,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static void callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
data->obj->emit(p1,p2,p3);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData& data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
void emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3);
void operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{emit(p1,p2,p3);}
 
Signal3() {}
Signal3(const InSlotType &s) {connect(s);}
~Signal3() {}
};
 
 
// emit
template <class P1,class P2,class P3,class Marsh>
void Signal3<void,P1,P2,P3,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{
if (!impl||impl->outgoing_.empty()) return;
List &out=impl->outgoing_;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
s.call(p1,p2,p3);
}
}
 
#endif
 
 
/****************************************************************
***** Signal 4
****************************************************************/
 
template <class R,class P1,class P2,class P3,class P4,typename Marsh=class Marshal<R> >
class Signal4:public Signal_
{
public:
typedef Slot4<R,P1,P2,P3,P4> InSlotType;
typedef Slot4<typename Marsh::OutType,P1,P2,P3,P4> OutSlotType;
 
private:
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef typename Marsh::OutType SType;
typedef R RType;
#else
typedef Trait<typename Marsh::OutType>::type SType;
typedef Trait<R>::type RType;
#endif
typedef typename InSlotType::Callback Callback;
typedef Signal4<R,P1,P2,P3,P4,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static SType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
return data->obj->emit(p1,p2,p3,p4);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=(typename OutSlotType::Func)callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
SType emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4);
SType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{return emit(p1,p2,p3,p4);}
 
Signal4() {}
Signal4(const InSlotType &s) {connect(s);}
~Signal4() {}
};
 
 
// emit
template <class R,class P1,class P2,class P3,class P4,class Marsh>
typename Signal4<R,P1,P2,P3,P4,Marsh>::SType Signal4<R,P1,P2,P3,P4,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{
if (!impl||impl->outgoing_.empty()) return Marsh::default_value();
List &out=impl->outgoing_;
Marsh rc;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
if (rc.marshal(s.call(p1,p2,p3,p4))) return rc.value();
}
return rc.value();
}
 
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class Marsh>
class Signal4<void,P1,P2,P3,P4,Marsh>
:public Signal_
{
public:
typedef Slot4<void,P1,P2,P3,P4> InSlotType;
typedef Slot4<void,P1,P2,P3,P4> OutSlotType;
private:
typedef typename InSlotType::Callback Callback;
typedef Signal4<void,P1,P2,P3,P4,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static void callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
data->obj->emit(p1,p2,p3,p4);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData& data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
void emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4);
void operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{emit(p1,p2,p3,p4);}
 
Signal4() {}
Signal4(const InSlotType &s) {connect(s);}
~Signal4() {}
};
 
 
// emit
template <class P1,class P2,class P3,class P4,class Marsh>
void Signal4<void,P1,P2,P3,P4,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{
if (!impl||impl->outgoing_.empty()) return;
List &out=impl->outgoing_;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
s.call(p1,p2,p3,p4);
}
}
 
#endif
 
 
/****************************************************************
***** Signal 5
****************************************************************/
 
template <class R,class P1,class P2,class P3,class P4,class P5,typename Marsh=class Marshal<R> >
class Signal5:public Signal_
{
public:
typedef Slot5<R,P1,P2,P3,P4,P5> InSlotType;
typedef Slot5<typename Marsh::OutType,P1,P2,P3,P4,P5> OutSlotType;
 
private:
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef typename Marsh::OutType SType;
typedef R RType;
#else
typedef Trait<typename Marsh::OutType>::type SType;
typedef Trait<R>::type RType;
#endif
typedef typename InSlotType::Callback Callback;
typedef Signal5<R,P1,P2,P3,P4,P5,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static SType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
return data->obj->emit(p1,p2,p3,p4,p5);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=(typename OutSlotType::Func)callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
SType emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5);
SType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{return emit(p1,p2,p3,p4,p5);}
 
Signal5() {}
Signal5(const InSlotType &s) {connect(s);}
~Signal5() {}
};
 
 
// emit
template <class R,class P1,class P2,class P3,class P4,class P5,class Marsh>
typename Signal5<R,P1,P2,P3,P4,P5,Marsh>::SType Signal5<R,P1,P2,P3,P4,P5,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{
if (!impl||impl->outgoing_.empty()) return Marsh::default_value();
List &out=impl->outgoing_;
Marsh rc;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
if (rc.marshal(s.call(p1,p2,p3,p4,p5))) return rc.value();
}
return rc.value();
}
 
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,class Marsh>
class Signal5<void,P1,P2,P3,P4,P5,Marsh>
:public Signal_
{
public:
typedef Slot5<void,P1,P2,P3,P4,P5> InSlotType;
typedef Slot5<void,P1,P2,P3,P4,P5> OutSlotType;
private:
typedef typename InSlotType::Callback Callback;
typedef Signal5<void,P1,P2,P3,P4,P5,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static void callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
data->obj->emit(p1,p2,p3,p4,p5);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData& data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
void emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5);
void operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{emit(p1,p2,p3,p4,p5);}
 
Signal5() {}
Signal5(const InSlotType &s) {connect(s);}
~Signal5() {}
};
 
 
// emit
template <class P1,class P2,class P3,class P4,class P5,class Marsh>
void Signal5<void,P1,P2,P3,P4,P5,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{
if (!impl||impl->outgoing_.empty()) return;
List &out=impl->outgoing_;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
s.call(p1,p2,p3,p4,p5);
}
}
 
#endif
 
 
/****************************************************************
***** Signal 6
****************************************************************/
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,typename Marsh=class Marshal<R> >
class Signal6:public Signal_
{
public:
typedef Slot6<R,P1,P2,P3,P4,P5,P6> InSlotType;
typedef Slot6<typename Marsh::OutType,P1,P2,P3,P4,P5,P6> OutSlotType;
 
private:
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef typename Marsh::OutType SType;
typedef R RType;
#else
typedef Trait<typename Marsh::OutType>::type SType;
typedef Trait<R>::type RType;
#endif
typedef typename InSlotType::Callback Callback;
typedef Signal6<R,P1,P2,P3,P4,P5,P6,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static SType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
return data->obj->emit(p1,p2,p3,p4,p5,p6);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=(typename OutSlotType::Func)callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
SType emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6);
SType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{return emit(p1,p2,p3,p4,p5,p6);}
 
Signal6() {}
Signal6(const InSlotType &s) {connect(s);}
~Signal6() {}
};
 
 
// emit
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class Marsh>
typename Signal6<R,P1,P2,P3,P4,P5,P6,Marsh>::SType Signal6<R,P1,P2,P3,P4,P5,P6,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{
if (!impl||impl->outgoing_.empty()) return Marsh::default_value();
List &out=impl->outgoing_;
Marsh rc;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
if (rc.marshal(s.call(p1,p2,p3,p4,p5,p6))) return rc.value();
}
return rc.value();
}
 
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,class P6,class Marsh>
class Signal6<void,P1,P2,P3,P4,P5,P6,Marsh>
:public Signal_
{
public:
typedef Slot6<void,P1,P2,P3,P4,P5,P6> InSlotType;
typedef Slot6<void,P1,P2,P3,P4,P5,P6> OutSlotType;
private:
typedef typename InSlotType::Callback Callback;
typedef Signal6<void,P1,P2,P3,P4,P5,P6,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static void callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
data->obj->emit(p1,p2,p3,p4,p5,p6);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData& data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
void emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6);
void operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{emit(p1,p2,p3,p4,p5,p6);}
 
Signal6() {}
Signal6(const InSlotType &s) {connect(s);}
~Signal6() {}
};
 
 
// emit
template <class P1,class P2,class P3,class P4,class P5,class P6,class Marsh>
void Signal6<void,P1,P2,P3,P4,P5,P6,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{
if (!impl||impl->outgoing_.empty()) return;
List &out=impl->outgoing_;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
s.call(p1,p2,p3,p4,p5,p6);
}
}
 
#endif
 
 
/****************************************************************
***** Signal 7
****************************************************************/
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,typename Marsh=class Marshal<R> >
class Signal7:public Signal_
{
public:
typedef Slot7<R,P1,P2,P3,P4,P5,P6,P7> InSlotType;
typedef Slot7<typename Marsh::OutType,P1,P2,P3,P4,P5,P6,P7> OutSlotType;
 
private:
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef typename Marsh::OutType SType;
typedef R RType;
#else
typedef Trait<typename Marsh::OutType>::type SType;
typedef Trait<R>::type RType;
#endif
typedef typename InSlotType::Callback Callback;
typedef Signal7<R,P1,P2,P3,P4,P5,P6,P7,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static SType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
CallData* data=(CallData*)d;
return data->obj->emit(p1,p2,p3,p4,p5,p6,p7);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=(typename OutSlotType::Func)callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
SType emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7);
SType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{return emit(p1,p2,p3,p4,p5,p6,p7);}
 
Signal7() {}
Signal7(const InSlotType &s) {connect(s);}
~Signal7() {}
};
 
 
// emit
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class Marsh>
typename Signal7<R,P1,P2,P3,P4,P5,P6,P7,Marsh>::SType Signal7<R,P1,P2,P3,P4,P5,P6,P7,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{
if (!impl||impl->outgoing_.empty()) return Marsh::default_value();
List &out=impl->outgoing_;
Marsh rc;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
if (rc.marshal(s.call(p1,p2,p3,p4,p5,p6,p7))) return rc.value();
}
return rc.value();
}
 
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,class P6,class P7,class Marsh>
class Signal7<void,P1,P2,P3,P4,P5,P6,P7,Marsh>
:public Signal_
{
public:
typedef Slot7<void,P1,P2,P3,P4,P5,P6,P7> InSlotType;
typedef Slot7<void,P1,P2,P3,P4,P5,P6,P7> OutSlotType;
private:
typedef typename InSlotType::Callback Callback;
typedef Signal7<void,P1,P2,P3,P4,P5,P6,P7,Marsh> Self;
typedef CallDataObj2<typename OutSlotType::Func,Self> CallData;
 
static void callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
CallData* data=(CallData*)d;
data->obj->emit(p1,p2,p3,p4,p5,p6,p7);
}
 
public:
OutSlotType slot()
{
SlotData* tmp=in_connect();
CallData& data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=callback;
data.obj=this;
return tmp;
}
 
Connection connect(const InSlotType &s)
{
return out_connect(s.data());
}
 
void emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7);
void operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{emit(p1,p2,p3,p4,p5,p6,p7);}
 
Signal7() {}
Signal7(const InSlotType &s) {connect(s);}
~Signal7() {}
};
 
 
// emit
template <class P1,class P2,class P3,class P4,class P5,class P6,class P7,class Marsh>
void Signal7<void,P1,P2,P3,P4,P5,P6,P7,Marsh>::
emit(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{
if (!impl||impl->outgoing_.empty()) return;
List &out=impl->outgoing_;
SlotData *data;
List::Iterator i=out.begin();
while (i!=out.end())
{
data=((SlotDependent*)(i.node()))->parent();
++i;
Callback& s=(Callback&)(data->callback());
s.call(p1,p2,p3,p4,p5,p6,p7);
}
}
 
#endif
 
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#ifdef SIGC_QT
#define emit
#endif
 
 
#endif // SIGCXX_BASIC_SIGNAL_H
 
/contrib/media/updf/include/sigc++/bind.h
0,0 → 1,1429
// -*- c++ -*-
/* This is a generated file, do not edit. Generated from ../sigc++/macros/bind.h.m4 */
 
#ifndef SIGCXX_BIND_H
#define SIGCXX_BIND_H
 
/*
SigC::bind
-------------
bind() alters a Slot by fixing arguments to certain values.
 
Argument fixing starts from the last argument. The slot is
destroyed in the process and a new one is created, so references
holding onto the slot will no longer be valid.
 
Up to two arguments can be bound at a time with the default
header.
 
Simple Sample usage:
 
void f(int,int);
Slot2<void,int,int> s1=slot(f);
 
Slot1<void,int> s2=bind(s1,1); // s1 is invalid
s2(2); // call f with arguments 2,1
 
Multibinding usage:
 
void f(int,int);
Slot2<void,int,int> s1=slot(f);
Slot0<void> s2=bind(s1,1,2); // s1 is invalid
s2(); // call f with arguments 1,2
 
Type specified usage:
struct A {};
struct B :public A {};
B* b;
Slot0<void, A*> s1;
 
Slot0<void> s2=bind(s1, b); // B* converted to A*
*/
 
#include <sigc++/adaptor.h>
#include <sigc++/scope.h>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
 
 
 
 
 
 
 
 
 
 
 
/****************************************************************
***** Adaptor Bind Slot 0 arguments, 1 hidden arguments
****************************************************************/
template <class R,
class C1>
struct AdaptorBindSlot0_1: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot0<R> SlotType;
typedef Slot1<R,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <
class C1>
struct AdaptorBindSlot0_1
<void,
C1> : public AdaptorSlot_
{
typedef void RType;
typedef Slot0<void> SlotType;
typedef Slot1<void,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,
class R,
class C1>
inline
Slot0<R>
bind(const Slot1<R,C1> &s,
A1 a1)
{return AdaptorBindSlot0_1<R,
C1>::create(s.data(),a1);
}
 
 
/****************************************************************
***** Adaptor Bind Slot 1 arguments, 1 hidden arguments
****************************************************************/
template <class R,
class P1,
class C1>
struct AdaptorBindSlot1_1: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot1<R,P1> SlotType;
typedef Slot2<R,P1,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(p1,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,
class C1>
struct AdaptorBindSlot1_1
<void,P1,
C1> : public AdaptorSlot_
{
typedef void RType;
typedef Slot1<void,P1> SlotType;
typedef Slot2<void,P1,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,
class R,
class P1,
class C1>
inline
Slot1<R,P1>
bind(const Slot2<R,P1,C1> &s,
A1 a1)
{return AdaptorBindSlot1_1<R,
P1,
C1>::create(s.data(),a1);
}
 
 
/****************************************************************
***** Adaptor Bind Slot 2 arguments, 1 hidden arguments
****************************************************************/
template <class R,
class P1,class P2,
class C1>
struct AdaptorBindSlot2_1: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot2<R,P1,P2> SlotType;
typedef Slot3<R,P1,P2,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(p1,p2,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,
class C1>
struct AdaptorBindSlot2_1
<void,P1,P2,
C1> : public AdaptorSlot_
{
typedef void RType;
typedef Slot2<void,P1,P2> SlotType;
typedef Slot3<void,P1,P2,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,
class R,
class P1,class P2,
class C1>
inline
Slot2<R,P1,P2>
bind(const Slot3<R,P1,P2,C1> &s,
A1 a1)
{return AdaptorBindSlot2_1<R,
P1,P2,
C1>::create(s.data(),a1);
}
 
 
/****************************************************************
***** Adaptor Bind Slot 3 arguments, 1 hidden arguments
****************************************************************/
template <class R,
class P1,class P2,class P3,
class C1>
struct AdaptorBindSlot3_1: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot3<R,P1,P2,P3> SlotType;
typedef Slot4<R,P1,P2,P3,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,
class C1>
struct AdaptorBindSlot3_1
<void,P1,P2,P3,
C1> : public AdaptorSlot_
{
typedef void RType;
typedef Slot3<void,P1,P2,P3> SlotType;
typedef Slot4<void,P1,P2,P3,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,
class R,
class P1,class P2,class P3,
class C1>
inline
Slot3<R,P1,P2,P3>
bind(const Slot4<R,P1,P2,P3,C1> &s,
A1 a1)
{return AdaptorBindSlot3_1<R,
P1,P2,P3,
C1>::create(s.data(),a1);
}
 
 
/****************************************************************
***** Adaptor Bind Slot 4 arguments, 1 hidden arguments
****************************************************************/
template <class R,
class P1,class P2,class P3,class P4,
class C1>
struct AdaptorBindSlot4_1: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot4<R,P1,P2,P3,P4> SlotType;
typedef Slot5<R,P1,P2,P3,P4,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,
class C1>
struct AdaptorBindSlot4_1
<void,P1,P2,P3,P4,
C1> : public AdaptorSlot_
{
typedef void RType;
typedef Slot4<void,P1,P2,P3,P4> SlotType;
typedef Slot5<void,P1,P2,P3,P4,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,
class R,
class P1,class P2,class P3,class P4,
class C1>
inline
Slot4<R,P1,P2,P3,P4>
bind(const Slot5<R,P1,P2,P3,P4,C1> &s,
A1 a1)
{return AdaptorBindSlot4_1<R,
P1,P2,P3,P4,
C1>::create(s.data(),a1);
}
 
 
/****************************************************************
***** Adaptor Bind Slot 5 arguments, 1 hidden arguments
****************************************************************/
template <class R,
class P1,class P2,class P3,class P4,class P5,
class C1>
struct AdaptorBindSlot5_1: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot5<R,P1,P2,P3,P4,P5> SlotType;
typedef Slot6<R,P1,P2,P3,P4,P5,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,
class C1>
struct AdaptorBindSlot5_1
<void,P1,P2,P3,P4,P5,
C1> : public AdaptorSlot_
{
typedef void RType;
typedef Slot5<void,P1,P2,P3,P4,P5> SlotType;
typedef Slot6<void,P1,P2,P3,P4,P5,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,
class R,
class P1,class P2,class P3,class P4,class P5,
class C1>
inline
Slot5<R,P1,P2,P3,P4,P5>
bind(const Slot6<R,P1,P2,P3,P4,P5,C1> &s,
A1 a1)
{return AdaptorBindSlot5_1<R,
P1,P2,P3,P4,P5,
C1>::create(s.data(),a1);
}
 
 
/****************************************************************
***** Adaptor Bind Slot 6 arguments, 1 hidden arguments
****************************************************************/
template <class R,
class P1,class P2,class P3,class P4,class P5,class P6,
class C1>
struct AdaptorBindSlot6_1: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot6<R,P1,P2,P3,P4,P5,P6> SlotType;
typedef Slot7<R,P1,P2,P3,P4,P5,P6,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,class P6,
class C1>
struct AdaptorBindSlot6_1
<void,P1,P2,P3,P4,P5,P6,
C1> : public AdaptorSlot_
{
typedef void RType;
typedef Slot6<void,P1,P2,P3,P4,P5,P6> SlotType;
typedef Slot7<void,P1,P2,P3,P4,P5,P6,C1> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
 
Node(C1 c1)
: c1_(c1)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6,
node->c1_);
}
static SlotData* create(SlotData *s,C1 c1)
{
Node *node=new Node(c1);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,
class R,
class P1,class P2,class P3,class P4,class P5,class P6,
class C1>
inline
Slot6<R,P1,P2,P3,P4,P5,P6>
bind(const Slot7<R,P1,P2,P3,P4,P5,P6,C1> &s,
A1 a1)
{return AdaptorBindSlot6_1<R,
P1,P2,P3,P4,P5,P6,
C1>::create(s.data(),a1);
}
 
 
 
/****************************************************************
***** Adaptor Bind Slot 0 arguments, 2 hidden arguments
****************************************************************/
template <class R,
class C1,class C2>
struct AdaptorBindSlot0_2: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot0<R> SlotType;
typedef Slot2<R,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <
class C1,class C2>
struct AdaptorBindSlot0_2
<void,
C1,C2> : public AdaptorSlot_
{
typedef void RType;
typedef Slot0<void> SlotType;
typedef Slot2<void,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,class A2,
class R,
class C1,class C2>
inline
Slot0<R>
bind(const Slot2<R,C1,C2> &s,
A1 a1,A2 a2)
{return AdaptorBindSlot0_2<R,
C1,C2>::create(s.data(),a1,a2);
}
 
 
/****************************************************************
***** Adaptor Bind Slot 1 arguments, 2 hidden arguments
****************************************************************/
template <class R,
class P1,
class C1,class C2>
struct AdaptorBindSlot1_2: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot1<R,P1> SlotType;
typedef Slot3<R,P1,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(p1,
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,
class C1,class C2>
struct AdaptorBindSlot1_2
<void,P1,
C1,C2> : public AdaptorSlot_
{
typedef void RType;
typedef Slot1<void,P1> SlotType;
typedef Slot3<void,P1,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,class A2,
class R,
class P1,
class C1,class C2>
inline
Slot1<R,P1>
bind(const Slot3<R,P1,C1,C2> &s,
A1 a1,A2 a2)
{return AdaptorBindSlot1_2<R,
P1,
C1,C2>::create(s.data(),a1,a2);
}
 
 
/****************************************************************
***** Adaptor Bind Slot 2 arguments, 2 hidden arguments
****************************************************************/
template <class R,
class P1,class P2,
class C1,class C2>
struct AdaptorBindSlot2_2: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot2<R,P1,P2> SlotType;
typedef Slot4<R,P1,P2,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(p1,p2,
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,
class C1,class C2>
struct AdaptorBindSlot2_2
<void,P1,P2,
C1,C2> : public AdaptorSlot_
{
typedef void RType;
typedef Slot2<void,P1,P2> SlotType;
typedef Slot4<void,P1,P2,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,class A2,
class R,
class P1,class P2,
class C1,class C2>
inline
Slot2<R,P1,P2>
bind(const Slot4<R,P1,P2,C1,C2> &s,
A1 a1,A2 a2)
{return AdaptorBindSlot2_2<R,
P1,P2,
C1,C2>::create(s.data(),a1,a2);
}
 
 
/****************************************************************
***** Adaptor Bind Slot 3 arguments, 2 hidden arguments
****************************************************************/
template <class R,
class P1,class P2,class P3,
class C1,class C2>
struct AdaptorBindSlot3_2: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot3<R,P1,P2,P3> SlotType;
typedef Slot5<R,P1,P2,P3,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,
class C1,class C2>
struct AdaptorBindSlot3_2
<void,P1,P2,P3,
C1,C2> : public AdaptorSlot_
{
typedef void RType;
typedef Slot3<void,P1,P2,P3> SlotType;
typedef Slot5<void,P1,P2,P3,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,class A2,
class R,
class P1,class P2,class P3,
class C1,class C2>
inline
Slot3<R,P1,P2,P3>
bind(const Slot5<R,P1,P2,P3,C1,C2> &s,
A1 a1,A2 a2)
{return AdaptorBindSlot3_2<R,
P1,P2,P3,
C1,C2>::create(s.data(),a1,a2);
}
 
 
/****************************************************************
***** Adaptor Bind Slot 4 arguments, 2 hidden arguments
****************************************************************/
template <class R,
class P1,class P2,class P3,class P4,
class C1,class C2>
struct AdaptorBindSlot4_2: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot4<R,P1,P2,P3,P4> SlotType;
typedef Slot6<R,P1,P2,P3,P4,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,
class C1,class C2>
struct AdaptorBindSlot4_2
<void,P1,P2,P3,P4,
C1,C2> : public AdaptorSlot_
{
typedef void RType;
typedef Slot4<void,P1,P2,P3,P4> SlotType;
typedef Slot6<void,P1,P2,P3,P4,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,class A2,
class R,
class P1,class P2,class P3,class P4,
class C1,class C2>
inline
Slot4<R,P1,P2,P3,P4>
bind(const Slot6<R,P1,P2,P3,P4,C1,C2> &s,
A1 a1,A2 a2)
{return AdaptorBindSlot4_2<R,
P1,P2,P3,P4,
C1,C2>::create(s.data(),a1,a2);
}
 
 
/****************************************************************
***** Adaptor Bind Slot 5 arguments, 2 hidden arguments
****************************************************************/
template <class R,
class P1,class P2,class P3,class P4,class P5,
class C1,class C2>
struct AdaptorBindSlot5_2: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef Slot5<R,P1,P2,P3,P4,P5> SlotType;
typedef Slot7<R,P1,P2,P3,P4,P5,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return ((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,
class C1,class C2>
struct AdaptorBindSlot5_2
<void,P1,P2,P3,P4,P5,
C1,C2> : public AdaptorSlot_
{
typedef void RType;
typedef Slot5<void,P1,P2,P3,P4,P5> SlotType;
typedef Slot7<void,P1,P2,P3,P4,P5,C1,C2> InSlotType;
 
struct Node:public AdaptorNode
{
C1 c1_;
C2 c2_;
 
Node(C1 c1,C2 c2)
: c1_(c1),c2_(c2)
{ }
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,
node->c1_,node->c2_);
}
static SlotData* create(SlotData *s,C1 c1,C2 c2)
{
Node *node=new Node(c1,c2);
copy_callback(s,node);
CallData &data=reinterpret_cast<CallData&>(s->data_);
data.callback=&callback;
data.obj=node;
return s;
}
};
 
#endif
#endif
 
template <class A1,class A2,
class R,
class P1,class P2,class P3,class P4,class P5,
class C1,class C2>
inline
Slot5<R,P1,P2,P3,P4,P5>
bind(const Slot7<R,P1,P2,P3,P4,P5,C1,C2> &s,
A1 a1,A2 a2)
{return AdaptorBindSlot5_2<R,
P1,P2,P3,P4,P5,
C1,C2>::create(s.data(),a1,a2);
}
 
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#endif
/contrib/media/updf/include/sigc++/class_slot.h
0,0 → 1,318
// -*- c++ -*-
/* This is a generated file, do not edit. Generated from ../sigc++/macros/class_slot.h.m4 */
 
#ifndef SIGCXX_CLASS_SLOT_H
#define SIGCXX_CLASS_SLOT_H
 
/*
SigC::slot_class() (class)
-----------------------
slot_class() can be applied to a class method to form a Slot with a
profile equivelent to the method. At the same time an instance
of that class must be specified. This is an unsafe interface.
 
This does NOT require that the class be derived from SigC::Object.
However, the object should be static with regards to the signal system.
(allocated within the global scope.) If it is not and a connected
slot is call it will result in a seg fault. If the object must
be destroyed before the connected slots, all connections must
be disconnected by hand.
 
Sample usage:
 
struct A
{
void foo(int,int);
} a;
 
Slot2<void,int,int> s=slot_class(a,&A::foo);
 
*/
 
 
#include <sigc++/object_slot.h>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
 
/****************************************************************
***** Class Slot 0
****************************************************************/
template <class R,class Obj>
struct ClassSlot0_:public ObjectSlot0_<R,Obj>
{
typedef ObjectSlot0_<R,Obj> Base;
typedef typename Base::InFunc InFunc;
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
return tmp;
}
};
 
template <class R,class Obj>
Slot0<R>
slot_class(Obj &obj,R (Obj::*func)())
{return ClassSlot0_<R,Obj>::create(&obj,func);
}
 
template <class R,class Obj>
Slot0<R>
slot_class(Obj *obj,R (Obj::*func)())
{return ClassSlot0_<R,Obj>::create(obj,func);
}
 
 
/****************************************************************
***** Class Slot 1
****************************************************************/
template <class R,class P1,class Obj>
struct ClassSlot1_:public ObjectSlot1_<R,P1,Obj>
{
typedef ObjectSlot1_<R,P1,Obj> Base;
typedef typename Base::InFunc InFunc;
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
return tmp;
}
};
 
template <class R,class P1,class Obj>
Slot1<R,P1>
slot_class(Obj &obj,R (Obj::*func)(P1))
{return ClassSlot1_<R,P1,Obj>::create(&obj,func);
}
 
template <class R,class P1,class Obj>
Slot1<R,P1>
slot_class(Obj *obj,R (Obj::*func)(P1))
{return ClassSlot1_<R,P1,Obj>::create(obj,func);
}
 
 
/****************************************************************
***** Class Slot 2
****************************************************************/
template <class R,class P1,class P2,class Obj>
struct ClassSlot2_:public ObjectSlot2_<R,P1,P2,Obj>
{
typedef ObjectSlot2_<R,P1,P2,Obj> Base;
typedef typename Base::InFunc InFunc;
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
return tmp;
}
};
 
template <class R,class P1,class P2,class Obj>
Slot2<R,P1,P2>
slot_class(Obj &obj,R (Obj::*func)(P1,P2))
{return ClassSlot2_<R,P1,P2,Obj>::create(&obj,func);
}
 
template <class R,class P1,class P2,class Obj>
Slot2<R,P1,P2>
slot_class(Obj *obj,R (Obj::*func)(P1,P2))
{return ClassSlot2_<R,P1,P2,Obj>::create(obj,func);
}
 
 
/****************************************************************
***** Class Slot 3
****************************************************************/
template <class R,class P1,class P2,class P3,class Obj>
struct ClassSlot3_:public ObjectSlot3_<R,P1,P2,P3,Obj>
{
typedef ObjectSlot3_<R,P1,P2,P3,Obj> Base;
typedef typename Base::InFunc InFunc;
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
return tmp;
}
};
 
template <class R,class P1,class P2,class P3,class Obj>
Slot3<R,P1,P2,P3>
slot_class(Obj &obj,R (Obj::*func)(P1,P2,P3))
{return ClassSlot3_<R,P1,P2,P3,Obj>::create(&obj,func);
}
 
template <class R,class P1,class P2,class P3,class Obj>
Slot3<R,P1,P2,P3>
slot_class(Obj *obj,R (Obj::*func)(P1,P2,P3))
{return ClassSlot3_<R,P1,P2,P3,Obj>::create(obj,func);
}
 
 
/****************************************************************
***** Class Slot 4
****************************************************************/
template <class R,class P1,class P2,class P3,class P4,class Obj>
struct ClassSlot4_:public ObjectSlot4_<R,P1,P2,P3,P4,Obj>
{
typedef ObjectSlot4_<R,P1,P2,P3,P4,Obj> Base;
typedef typename Base::InFunc InFunc;
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
return tmp;
}
};
 
template <class R,class P1,class P2,class P3,class P4,class Obj>
Slot4<R,P1,P2,P3,P4>
slot_class(Obj &obj,R (Obj::*func)(P1,P2,P3,P4))
{return ClassSlot4_<R,P1,P2,P3,P4,Obj>::create(&obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class Obj>
Slot4<R,P1,P2,P3,P4>
slot_class(Obj *obj,R (Obj::*func)(P1,P2,P3,P4))
{return ClassSlot4_<R,P1,P2,P3,P4,Obj>::create(obj,func);
}
 
 
/****************************************************************
***** Class Slot 5
****************************************************************/
template <class R,class P1,class P2,class P3,class P4,class P5,class Obj>
struct ClassSlot5_:public ObjectSlot5_<R,P1,P2,P3,P4,P5,Obj>
{
typedef ObjectSlot5_<R,P1,P2,P3,P4,P5,Obj> Base;
typedef typename Base::InFunc InFunc;
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
return tmp;
}
};
 
template <class R,class P1,class P2,class P3,class P4,class P5,class Obj>
Slot5<R,P1,P2,P3,P4,P5>
slot_class(Obj &obj,R (Obj::*func)(P1,P2,P3,P4,P5))
{return ClassSlot5_<R,P1,P2,P3,P4,P5,Obj>::create(&obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class P5,class Obj>
Slot5<R,P1,P2,P3,P4,P5>
slot_class(Obj *obj,R (Obj::*func)(P1,P2,P3,P4,P5))
{return ClassSlot5_<R,P1,P2,P3,P4,P5,Obj>::create(obj,func);
}
 
 
/****************************************************************
***** Class Slot 6
****************************************************************/
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class Obj>
struct ClassSlot6_:public ObjectSlot6_<R,P1,P2,P3,P4,P5,P6,Obj>
{
typedef ObjectSlot6_<R,P1,P2,P3,P4,P5,P6,Obj> Base;
typedef typename Base::InFunc InFunc;
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
return tmp;
}
};
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class Obj>
Slot6<R,P1,P2,P3,P4,P5,P6>
slot_class(Obj &obj,R (Obj::*func)(P1,P2,P3,P4,P5,P6))
{return ClassSlot6_<R,P1,P2,P3,P4,P5,P6,Obj>::create(&obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class Obj>
Slot6<R,P1,P2,P3,P4,P5,P6>
slot_class(Obj *obj,R (Obj::*func)(P1,P2,P3,P4,P5,P6))
{return ClassSlot6_<R,P1,P2,P3,P4,P5,P6,Obj>::create(obj,func);
}
 
 
/****************************************************************
***** Class Slot 7
****************************************************************/
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class Obj>
struct ClassSlot7_:public ObjectSlot7_<R,P1,P2,P3,P4,P5,P6,P7,Obj>
{
typedef ObjectSlot7_<R,P1,P2,P3,P4,P5,P6,P7,Obj> Base;
typedef typename Base::InFunc InFunc;
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
return tmp;
}
};
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class Obj>
Slot7<R,P1,P2,P3,P4,P5,P6,P7>
slot_class(Obj &obj,R (Obj::*func)(P1,P2,P3,P4,P5,P6,P7))
{return ClassSlot7_<R,P1,P2,P3,P4,P5,P6,P7,Obj>::create(&obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class Obj>
Slot7<R,P1,P2,P3,P4,P5,P6,P7>
slot_class(Obj *obj,R (Obj::*func)(P1,P2,P3,P4,P5,P6,P7))
{return ClassSlot7_<R,P1,P2,P3,P4,P5,P6,P7,Obj>::create(obj,func);
}
 
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#endif
/contrib/media/updf/include/sigc++/convert.h
0,0 → 1,671
// -*- c++ -*-
/* This is a generated file, do not edit. Generated from ../sigc++/macros/convert.h.m4 */
 
#ifndef SIGCXX_CONVERT_H
#define SIGCXX_CONVERT_H
 
/*
SigC::convert
-------------
convert() alters a Slot by assigning a conversion function
which can completely alter the parameter types of a slot.
 
Only convert functions for changing with same number of
arguments is compiled by default. See examples/custom_convert.h.m4
for details on how to build non standard ones.
 
Sample usage:
int my_string_to_char(Callback1<int,const char*> *d,const string &s)
int f(const char*);
string s=hello;
 
 
Slot1<int,const string &> s2=convert(slot(f),my_string_to_char);
s2(s);
 
*/
#include <sigc++/adaptor.h>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
 
 
/****************************************************************
***** Adaptor Convert Slot 1
****************************************************************/
template <class R1,class P1,
class R2,class Q1>
struct AdaptorConvertSlot1_1: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot1<R1,P1> SlotType;
typedef Slot1<R2,Q1> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1);
typedef R1 (*InFunc)(Callback*,P1);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
return (data->func)(data->obj,p1);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,
class R2,class Q1>
struct AdaptorConvertSlot1_1
<void,P1,
R2,Q1>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot1<void,P1> SlotType;
typedef Slot1<R2,Q1> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1);
typedef void (*InFunc)(Callback*,P1);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
(data->func)(data->obj,p1);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
#endif
#endif
 
template <class R1,class P1,
class R2,class Q1>
Slot1<R1,P1>
convert(const Slot1<R2,Q1> &s,
R1 (*func)(Callback1<R2,Q1>*,P1))
{return AdaptorConvertSlot1_1<R1,P1,
R2,Q1>::create(s.obj(),func);
}
 
 
/****************************************************************
***** Adaptor Convert Slot 2
****************************************************************/
template <class R1,class P1,class P2,
class R2,class Q1,class Q2>
struct AdaptorConvertSlot2_2: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot2<R1,P1,P2> SlotType;
typedef Slot2<R2,Q1,Q2> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2);
typedef R1 (*InFunc)(Callback*,P1,P2);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
return (data->func)(data->obj,p1,p2);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,
class R2,class Q1,class Q2>
struct AdaptorConvertSlot2_2
<void,P1,P2,
R2,Q1,Q2>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot2<void,P1,P2> SlotType;
typedef Slot2<R2,Q1,Q2> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2);
typedef void (*InFunc)(Callback*,P1,P2);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
(data->func)(data->obj,p1,p2);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
#endif
#endif
 
template <class R1,class P1,class P2,
class R2,class Q1,class Q2>
Slot2<R1,P1,P2>
convert(const Slot2<R2,Q1,Q2> &s,
R1 (*func)(Callback2<R2,Q1,Q2>*,P1,P2))
{return AdaptorConvertSlot2_2<R1,P1,P2,
R2,Q1,Q2>::create(s.obj(),func);
}
 
 
/****************************************************************
***** Adaptor Convert Slot 3
****************************************************************/
template <class R1,class P1,class P2,class P3,
class R2,class Q1,class Q2,class Q3>
struct AdaptorConvertSlot3_3: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot3<R1,P1,P2,P3> SlotType;
typedef Slot3<R2,Q1,Q2,Q3> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2,P3);
typedef R1 (*InFunc)(Callback*,P1,P2,P3);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
return (data->func)(data->obj,p1,p2,p3);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,
class R2,class Q1,class Q2,class Q3>
struct AdaptorConvertSlot3_3
<void,P1,P2,P3,
R2,Q1,Q2,Q3>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot3<void,P1,P2,P3> SlotType;
typedef Slot3<R2,Q1,Q2,Q3> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2,P3);
typedef void (*InFunc)(Callback*,P1,P2,P3);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
(data->func)(data->obj,p1,p2,p3);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
#endif
#endif
 
template <class R1,class P1,class P2,class P3,
class R2,class Q1,class Q2,class Q3>
Slot3<R1,P1,P2,P3>
convert(const Slot3<R2,Q1,Q2,Q3> &s,
R1 (*func)(Callback3<R2,Q1,Q2,Q3>*,P1,P2,P3))
{return AdaptorConvertSlot3_3<R1,P1,P2,P3,
R2,Q1,Q2,Q3>::create(s.obj(),func);
}
 
 
/****************************************************************
***** Adaptor Convert Slot 4
****************************************************************/
template <class R1,class P1,class P2,class P3,class P4,
class R2,class Q1,class Q2,class Q3,class Q4>
struct AdaptorConvertSlot4_4: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot4<R1,P1,P2,P3,P4> SlotType;
typedef Slot4<R2,Q1,Q2,Q3,Q4> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2,P3,P4);
typedef R1 (*InFunc)(Callback*,P1,P2,P3,P4);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
return (data->func)(data->obj,p1,p2,p3,p4);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,
class R2,class Q1,class Q2,class Q3,class Q4>
struct AdaptorConvertSlot4_4
<void,P1,P2,P3,P4,
R2,Q1,Q2,Q3,Q4>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot4<void,P1,P2,P3,P4> SlotType;
typedef Slot4<R2,Q1,Q2,Q3,Q4> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2,P3,P4);
typedef void (*InFunc)(Callback*,P1,P2,P3,P4);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
(data->func)(data->obj,p1,p2,p3,p4);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
#endif
#endif
 
template <class R1,class P1,class P2,class P3,class P4,
class R2,class Q1,class Q2,class Q3,class Q4>
Slot4<R1,P1,P2,P3,P4>
convert(const Slot4<R2,Q1,Q2,Q3,Q4> &s,
R1 (*func)(Callback4<R2,Q1,Q2,Q3,Q4>*,P1,P2,P3,P4))
{return AdaptorConvertSlot4_4<R1,P1,P2,P3,P4,
R2,Q1,Q2,Q3,Q4>::create(s.obj(),func);
}
 
 
/****************************************************************
***** Adaptor Convert Slot 5
****************************************************************/
template <class R1,class P1,class P2,class P3,class P4,class P5,
class R2,class Q1,class Q2,class Q3,class Q4,class Q5>
struct AdaptorConvertSlot5_5: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot5<R1,P1,P2,P3,P4,P5> SlotType;
typedef Slot5<R2,Q1,Q2,Q3,Q4,Q5> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2,P3,P4,P5);
typedef R1 (*InFunc)(Callback*,P1,P2,P3,P4,P5);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
return (data->func)(data->obj,p1,p2,p3,p4,p5);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,
class R2,class Q1,class Q2,class Q3,class Q4,class Q5>
struct AdaptorConvertSlot5_5
<void,P1,P2,P3,P4,P5,
R2,Q1,Q2,Q3,Q4,Q5>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot5<void,P1,P2,P3,P4,P5> SlotType;
typedef Slot5<R2,Q1,Q2,Q3,Q4,Q5> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2,P3,P4,P5);
typedef void (*InFunc)(Callback*,P1,P2,P3,P4,P5);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
(data->func)(data->obj,p1,p2,p3,p4,p5);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
#endif
#endif
 
template <class R1,class P1,class P2,class P3,class P4,class P5,
class R2,class Q1,class Q2,class Q3,class Q4,class Q5>
Slot5<R1,P1,P2,P3,P4,P5>
convert(const Slot5<R2,Q1,Q2,Q3,Q4,Q5> &s,
R1 (*func)(Callback5<R2,Q1,Q2,Q3,Q4,Q5>*,P1,P2,P3,P4,P5))
{return AdaptorConvertSlot5_5<R1,P1,P2,P3,P4,P5,
R2,Q1,Q2,Q3,Q4,Q5>::create(s.obj(),func);
}
 
 
/****************************************************************
***** Adaptor Convert Slot 6
****************************************************************/
template <class R1,class P1,class P2,class P3,class P4,class P5,class P6,
class R2,class Q1,class Q2,class Q3,class Q4,class Q5,class Q6>
struct AdaptorConvertSlot6_6: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot6<R1,P1,P2,P3,P4,P5,P6> SlotType;
typedef Slot6<R2,Q1,Q2,Q3,Q4,Q5,Q6> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2,P3,P4,P5,P6);
typedef R1 (*InFunc)(Callback*,P1,P2,P3,P4,P5,P6);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
return (data->func)(data->obj,p1,p2,p3,p4,p5,p6);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,class P6,
class R2,class Q1,class Q2,class Q3,class Q4,class Q5,class Q6>
struct AdaptorConvertSlot6_6
<void,P1,P2,P3,P4,P5,P6,
R2,Q1,Q2,Q3,Q4,Q5,Q6>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot6<void,P1,P2,P3,P4,P5,P6> SlotType;
typedef Slot6<R2,Q1,Q2,Q3,Q4,Q5,Q6> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2,P3,P4,P5,P6);
typedef void (*InFunc)(Callback*,P1,P2,P3,P4,P5,P6);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
(data->func)(data->obj,p1,p2,p3,p4,p5,p6);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
#endif
#endif
 
template <class R1,class P1,class P2,class P3,class P4,class P5,class P6,
class R2,class Q1,class Q2,class Q3,class Q4,class Q5,class Q6>
Slot6<R1,P1,P2,P3,P4,P5,P6>
convert(const Slot6<R2,Q1,Q2,Q3,Q4,Q5,Q6> &s,
R1 (*func)(Callback6<R2,Q1,Q2,Q3,Q4,Q5,Q6>*,P1,P2,P3,P4,P5,P6))
{return AdaptorConvertSlot6_6<R1,P1,P2,P3,P4,P5,P6,
R2,Q1,Q2,Q3,Q4,Q5,Q6>::create(s.obj(),func);
}
 
 
/****************************************************************
***** Adaptor Convert Slot 7
****************************************************************/
template <class R1,class P1,class P2,class P3,class P4,class P5,class P6,class P7,
class R2,class Q1,class Q2,class Q3,class Q4,class Q5,class Q6,class Q7>
struct AdaptorConvertSlot7_7: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot7<R1,P1,P2,P3,P4,P5,P6,P7> SlotType;
typedef Slot7<R2,Q1,Q2,Q3,Q4,Q5,Q6,Q7> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2,P3,P4,P5,P6,P7);
typedef R1 (*InFunc)(Callback*,P1,P2,P3,P4,P5,P6,P7);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
CallData* data=(CallData*)d;
return (data->func)(data->obj,p1,p2,p3,p4,p5,p6,p7);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,class P6,class P7,
class R2,class Q1,class Q2,class Q3,class Q4,class Q5,class Q6,class Q7>
struct AdaptorConvertSlot7_7
<void,P1,P2,P3,P4,P5,P6,P7,
R2,Q1,Q2,Q3,Q4,Q5,Q6,Q7>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot7<void,P1,P2,P3,P4,P5,P6,P7> SlotType;
typedef Slot7<R2,Q1,Q2,Q3,Q4,Q5,Q6,Q7> InSlotType;
typedef typename InSlotType::Callback Callback;
typedef RType (*Func) (Callback*,P1,P2,P3,P4,P5,P6,P7);
typedef void (*InFunc)(Callback*,P1,P2,P3,P4,P5,P6,P7);
typedef CallDataObj3<typename SlotType::Func,Callback,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
CallData* data=(CallData*)d;
(data->func)(data->obj,p1,p2,p3,p4,p5,p6,p7);
}
 
static SlotData* create(SlotData *s,InFunc func)
{
SlotData* tmp=(SlotData*)s;
AdaptorNode *node=new AdaptorNode();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
data.obj=(Callback*)&(node->data_);
return tmp;
}
};
 
 
#endif
#endif
 
template <class R1,class P1,class P2,class P3,class P4,class P5,class P6,class P7,
class R2,class Q1,class Q2,class Q3,class Q4,class Q5,class Q6,class Q7>
Slot7<R1,P1,P2,P3,P4,P5,P6,P7>
convert(const Slot7<R2,Q1,Q2,Q3,Q4,Q5,Q6,Q7> &s,
R1 (*func)(Callback7<R2,Q1,Q2,Q3,Q4,Q5,Q6,Q7>*,P1,P2,P3,P4,P5,P6,P7))
{return AdaptorConvertSlot7_7<R1,P1,P2,P3,P4,P5,P6,P7,
R2,Q1,Q2,Q3,Q4,Q5,Q6,Q7>::create(s.obj(),func);
}
 
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#endif
/contrib/media/updf/include/sigc++/func_slot.h
0,0 → 1,606
// -*- c++ -*-
/* This is a generated file, do not edit. Generated from ../sigc++/macros/func_slot.h.m4 */
 
#ifndef SIGCXX_FUNC_SLOT_H
#define SIGCXX_FUNC_SLOT_H
#include <sigc++/slot.h>
 
/*
SigC::slot() (function)
-----------------------
slot() can be applied to a function to form a Slot with a
profile equivelent to the function. To avoid warns be
sure to pass the address of the function.
 
Sample usage:
 
void foo(int,int);
 
Slot2<void,int,int> s=slot(&foo);
 
*/
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
// From which we build specific Slots and a set of
// functions for creating a slot of this type
 
 
 
/****************************************************************
***** Function Slot 0
****************************************************************/
template <class R>
struct FuncSlot0_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (*InFunc)();
typedef RType (*Func)();
typedef Slot0<R> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data)
{
return (((CallData*)data)->func)();
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <>
struct FuncSlot0_<void>
{
typedef void RType;
typedef void (*InFunc)();
typedef RType (*Func)();
typedef Slot0<void> SlotType;
 
typedef CallDataFunc<SlotType::Func,Func> CallData;
 
static RType callback(void* data)
{
(((CallData*)data)->func)();
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
#endif
#endif
 
template <class R>
inline Slot0<R>
slot(R (*func)())
{
return FuncSlot0_<R>::create(func);
}
 
 
/****************************************************************
***** Function Slot 1
****************************************************************/
template <class R,class P1>
struct FuncSlot1_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (*InFunc)(P1);
typedef RType (*Func)(P1);
typedef Slot1<R,P1> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1)
{
return (((CallData*)data)->func)(p1);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1>
struct FuncSlot1_<void,P1>
{
typedef void RType;
typedef void (*InFunc)(P1);
typedef RType (*Func)(P1);
typedef Slot1<void,P1> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1)
{
(((CallData*)data)->func)(p1);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
#endif
#endif
 
template <class R,class P1>
inline Slot1<R,P1>
slot(R (*func)(P1))
{
return FuncSlot1_<R,P1>::create(func);
}
 
 
/****************************************************************
***** Function Slot 2
****************************************************************/
template <class R,class P1,class P2>
struct FuncSlot2_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (*InFunc)(P1,P2);
typedef RType (*Func)(P1,P2);
typedef Slot2<R,P1,P2> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2)
{
return (((CallData*)data)->func)(p1,p2);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2>
struct FuncSlot2_<void,P1,P2>
{
typedef void RType;
typedef void (*InFunc)(P1,P2);
typedef RType (*Func)(P1,P2);
typedef Slot2<void,P1,P2> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2)
{
(((CallData*)data)->func)(p1,p2);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
#endif
#endif
 
template <class R,class P1,class P2>
inline Slot2<R,P1,P2>
slot(R (*func)(P1,P2))
{
return FuncSlot2_<R,P1,P2>::create(func);
}
 
 
/****************************************************************
***** Function Slot 3
****************************************************************/
template <class R,class P1,class P2,class P3>
struct FuncSlot3_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (*InFunc)(P1,P2,P3);
typedef RType (*Func)(P1,P2,P3);
typedef Slot3<R,P1,P2,P3> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2,P3 p3)
{
return (((CallData*)data)->func)(p1,p2,p3);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3>
struct FuncSlot3_<void,P1,P2,P3>
{
typedef void RType;
typedef void (*InFunc)(P1,P2,P3);
typedef RType (*Func)(P1,P2,P3);
typedef Slot3<void,P1,P2,P3> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2,P3 p3)
{
(((CallData*)data)->func)(p1,p2,p3);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
#endif
#endif
 
template <class R,class P1,class P2,class P3>
inline Slot3<R,P1,P2,P3>
slot(R (*func)(P1,P2,P3))
{
return FuncSlot3_<R,P1,P2,P3>::create(func);
}
 
 
/****************************************************************
***** Function Slot 4
****************************************************************/
template <class R,class P1,class P2,class P3,class P4>
struct FuncSlot4_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (*InFunc)(P1,P2,P3,P4);
typedef RType (*Func)(P1,P2,P3,P4);
typedef Slot4<R,P1,P2,P3,P4> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4)
{
return (((CallData*)data)->func)(p1,p2,p3,p4);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4>
struct FuncSlot4_<void,P1,P2,P3,P4>
{
typedef void RType;
typedef void (*InFunc)(P1,P2,P3,P4);
typedef RType (*Func)(P1,P2,P3,P4);
typedef Slot4<void,P1,P2,P3,P4> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4)
{
(((CallData*)data)->func)(p1,p2,p3,p4);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
#endif
#endif
 
template <class R,class P1,class P2,class P3,class P4>
inline Slot4<R,P1,P2,P3,P4>
slot(R (*func)(P1,P2,P3,P4))
{
return FuncSlot4_<R,P1,P2,P3,P4>::create(func);
}
 
 
/****************************************************************
***** Function Slot 5
****************************************************************/
template <class R,class P1,class P2,class P3,class P4,class P5>
struct FuncSlot5_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (*InFunc)(P1,P2,P3,P4,P5);
typedef RType (*Func)(P1,P2,P3,P4,P5);
typedef Slot5<R,P1,P2,P3,P4,P5> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
return (((CallData*)data)->func)(p1,p2,p3,p4,p5);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5>
struct FuncSlot5_<void,P1,P2,P3,P4,P5>
{
typedef void RType;
typedef void (*InFunc)(P1,P2,P3,P4,P5);
typedef RType (*Func)(P1,P2,P3,P4,P5);
typedef Slot5<void,P1,P2,P3,P4,P5> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
(((CallData*)data)->func)(p1,p2,p3,p4,p5);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
#endif
#endif
 
template <class R,class P1,class P2,class P3,class P4,class P5>
inline Slot5<R,P1,P2,P3,P4,P5>
slot(R (*func)(P1,P2,P3,P4,P5))
{
return FuncSlot5_<R,P1,P2,P3,P4,P5>::create(func);
}
 
 
/****************************************************************
***** Function Slot 6
****************************************************************/
template <class R,class P1,class P2,class P3,class P4,class P5,class P6>
struct FuncSlot6_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (*InFunc)(P1,P2,P3,P4,P5,P6);
typedef RType (*Func)(P1,P2,P3,P4,P5,P6);
typedef Slot6<R,P1,P2,P3,P4,P5,P6> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
return (((CallData*)data)->func)(p1,p2,p3,p4,p5,p6);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,class P6>
struct FuncSlot6_<void,P1,P2,P3,P4,P5,P6>
{
typedef void RType;
typedef void (*InFunc)(P1,P2,P3,P4,P5,P6);
typedef RType (*Func)(P1,P2,P3,P4,P5,P6);
typedef Slot6<void,P1,P2,P3,P4,P5,P6> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
(((CallData*)data)->func)(p1,p2,p3,p4,p5,p6);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
#endif
#endif
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6>
inline Slot6<R,P1,P2,P3,P4,P5,P6>
slot(R (*func)(P1,P2,P3,P4,P5,P6))
{
return FuncSlot6_<R,P1,P2,P3,P4,P5,P6>::create(func);
}
 
 
/****************************************************************
***** Function Slot 7
****************************************************************/
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7>
struct FuncSlot7_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (*InFunc)(P1,P2,P3,P4,P5,P6,P7);
typedef RType (*Func)(P1,P2,P3,P4,P5,P6,P7);
typedef Slot7<R,P1,P2,P3,P4,P5,P6,P7> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
return (((CallData*)data)->func)(p1,p2,p3,p4,p5,p6,p7);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,class P6,class P7>
struct FuncSlot7_<void,P1,P2,P3,P4,P5,P6,P7>
{
typedef void RType;
typedef void (*InFunc)(P1,P2,P3,P4,P5,P6,P7);
typedef RType (*Func)(P1,P2,P3,P4,P5,P6,P7);
typedef Slot7<void,P1,P2,P3,P4,P5,P6,P7> SlotType;
 
typedef CallDataFunc<typename SlotType::Func,Func> CallData;
 
static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
(((CallData*)data)->func)(p1,p2,p3,p4,p5,p6,p7);
}
 
static SlotData* create(InFunc func)
{
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.func=(Func)func;
return tmp;
}
};
 
#endif
#endif
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7>
inline Slot7<R,P1,P2,P3,P4,P5,P6,P7>
slot(R (*func)(P1,P2,P3,P4,P5,P6,P7))
{
return FuncSlot7_<R,P1,P2,P3,P4,P5,P6,P7>::create(func);
}
 
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#endif // SIGCXX_FUNC_SLOT_H
/contrib/media/updf/include/sigc++/generator.h
0,0 → 1,159
#ifndef SIGCXX_GENERATOR_H
#define SIGCXX_GENERATOR_H
#include <sigc++config.h>
#include <new>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
 
// 0
template <class T>
T* gen()
{return manage(new T());}
 
// 1
template <class T,class P1>
T* gen(const P1& p1)
{return manage(new T(p1));}
 
template <class T,class P1>
T* gen(P1& p1)
{return manage(new T(p1));}
 
// 2
template <class T,class P1,class P2>
T* gen(const P1& p1,const P2& p2)
{return manage(new T(p1,p2));}
 
template <class T,class P1,class P2>
T* gen(P1& p1,const P2& p2)
{return manage(new T(p1,p2));}
 
template <class T,class P1,class P2>
T* gen(const P1& p1,P2& p2)
{return manage(new T(p1,p2));}
 
template <class T,class P1,class P2>
T* gen(P1& p1,P2& p2)
{return manage(new T(p1,p2));}
 
// 3
template <class T,class P1,class P2,class P3>
T* gen(const P1& p1,const P2& p2,const P3& p3)
{return manage(new T(p1,p2,p3));}
 
template <class T,class P1,class P2,class P3>
T* gen(P1& p1,const P2& p2,const P3& p3)
{return manage(new T(p1,p2,p3));}
 
template <class T,class P1,class P2,class P3>
T* gen(const P1& p1,P2& p2,const P3& p3)
{return manage(new T(p1,p2,p3));}
 
template <class T,class P1,class P2,class P3>
T* gen(const P1& p1,const P2& p2,P3& p3)
{return manage(new T(p1,p2,p3));}
 
template <class T,class P1,class P2,class P3>
T* gen(const P1& p1,P2& p2,P3& p3)
{return manage(new T(p1,p2,p3));}
 
template <class T,class P1,class P2,class P3>
T* gen(P1& p1,const P2& p2,P3& p3)
{return manage(new T(p1,p2,p3));}
 
template <class T,class P1,class P2,class P3>
T* gen(P1& p1,P2& p2,const P3& p3)
{return manage(new T(p1,p2,p3));}
 
template <class T,class P1,class P2,class P3>
T* gen(P1& p1,P2& p2,P3& p3)
{return manage(new T(p1,p2,p3));}
 
// 4
template <class T,class P1,class P2,class P3,class P4>
T* gen(const P1& p1,const P2& p2,const P3& p3,const P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(P1& p1,const P2& p2,const P3& p3,const P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(const P1& p1,P2& p2,const P3& p3,const P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(const P1& p1,const P2& p2,P3& p3,const P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(const P1& p1,const P2& p2,const P3& p3,P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(const P1& p1,P2& p2,P3& p3,P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(P1& p1,const P2& p2,P3& p3,P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(P1& p1,P2& p2,const P3& p3,P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(P1& p1,P2& p2,P3& p3,const P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(const P1& p1,const P2& p2,P3& p3,P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(const P1& p1,P2& p2,const P3& p3,P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(const P1& p1,P2& p2,P3& p3,const P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(P1& p1,const P2& p2,const P3& p3,P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(P1& p1,const P2& p2,P3& p3,const P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(P1& p1,P2& p2,const P3& p3,const P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
template <class T,class P1,class P2,class P3,class P4>
T* gen(P1& p1,P2& p2,P3& p3,P4& p4)
{return manage(new T(p1,p2,p3,p4));}
 
//From here one we will just generate warnings
template <class T,class P1,class P2,class P3,class P4,class P5>
T* gen(P1& p1,P2& p2,P3& p3,P4& p4,P5& p5)
{return manage(new T(p1,p2,p3,p4,p5));}
 
template <class T,class P1,class P2,class P3,class P4,class P5,class P6>
T* gen(P1& p1,P2& p2,P3& p3,P4& p4,P5& p5,P6& p6)
{return manage(new T(p1,p2,p3,p4,p5,p6));}
 
template <class T,class P1,class P2,class P3,class P4,class P5,class P6,class P7>
T* gen(P1& p1,P2& p2,P3& p3,P4& p4,P5& p5,P6& p6,P7& p7)
{return manage(new T(p1,p2,p3,p4,p5,p6,p7));}
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace sigc
#endif
 
#endif
 
/contrib/media/updf/include/sigc++/handle.h
0,0 → 1,113
#ifndef SIGCXX_HANDLE_H
#define SIGCXX_HANDLE_H
#include <sigc++config.h>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
// Signiture for Handles
template <class Obj,class Scope_>
class Handle
{
protected:
Scope_ scope_;
public:
// access
Obj* obj()
{
return static_cast<Obj*>(scope_.cache());
}
Obj* obj() const
{
return static_cast<Obj*>(scope_.cache());
}
 
bool connected() const
{return (scope_.object()!=0);}
operator Obj*()
{return (obj());}
operator Obj*() const
{return (obj());}
 
Obj& operator*() const
{return *(obj());}
Obj* operator->() const
{return (obj());}
 
Scope_& scope()
{return scope_;}
const Scope_& scope() const
{return scope_;}
 
void disconnect()
{scope_.disconnect(0);}
 
// copy
Handle& operator =(Obj* obj)
{scope_.set(obj,obj,true); return *this;}
Handle& operator =(Obj& obj)
{scope_.set(&obj,&obj,false); return *this;}
#ifndef SIGC_CXX_TEMPLATE_CCTOR
Handle& operator =(const Handle& handle)
{
Obj *o=handle.obj();
scope_.set(o,o,false);
return *this;
}
#endif
template <class Obj2,class Scope2>
Handle& operator = (const Handle<Obj2,Scope2>& handle)
{
Obj *o=handle.obj();
scope_.set(o,o,false);
return *this;
}
 
// construct
Handle():scope_() {}
Handle(Obj *obj):scope_() {scope_.set(obj,obj,true);}
Handle(Obj &obj):scope_() {scope_.set(&obj,&obj,false);}
#ifndef SIGC_CXX_TEMPLATE_CCTOR
Handle(const Handle& handle)
:scope_()
{
Obj *o=handle.obj();
scope_.set(o,o,false);
}
#endif
template <class Obj2,class Scope2>
Handle(const Handle<Obj2,Scope2>& handle)
:scope_()
{
Obj *o=handle.obj();
scope_.set(o,o,false);
}
};
 
#define HANDLE_CTORS(X,T,P) \
public: \
X(T *t):Handle<T,P>(t) {} \
X(T &t):Handle<T,P>(t) {} \
template <class T2,class P2> \
X(const Handle<T2,P2> &h):Handle<T,P>(h) {} \
X& operator =(T *t) \
{return Handle<T,P>::operator=(t);} \
X& operator =(T &t) \
{return Handle<T,P>::operator=(t);} \
template <class T2,class P2> \
X& operator =(const Handle<T2,P2> &t) \
{return Handle<T,P>::operator=(t);}
 
//template <class T>
// class Ref:public Handle<T,Scopes::RefCount>
// {
// HANDLE_CTORS(Ref,T,Scopes::RefCount)
// };
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#endif
/contrib/media/updf/include/sigc++/handle_system.h
0,0 → 1,4
 
#include <sigc++/object.h>
#include <sigc++/scope.h>
#include <sigc++/handle.h>
/contrib/media/updf/include/sigc++/marshal.h
0,0 → 1,205
#ifndef SIGCXX_MARSHALLER_H
#define SIGCXX_MARSHALLER_H
#include <sigc++config.h>
 
#ifndef SIGC_CXX_PARTIAL_SPEC
#include <sigc++/slot.h>
#endif
 
#ifdef SIGC_PTHREADS
#include <sigc++/thread.h>
#endif
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
/*
 
All classes used to marshal return values should have the following
 
class SomeMarshal
{
// both typedefs must be defined.
typedef Type1 InType;
typedef Type2 OutType;
 
public:
// Return final return code.
OutType value();
 
// Captures return codes and returns TRUE to stop emittion.
bool marshal(const InType&);
 
SomeMarshal();
};
 
It is not necessary for the InType to match the OutType.
This is to allow for things like list capturing.
 
*/
 
/*******************************************************************
***** Marshal
*******************************************************************/
 
// A struct that holds an flag for determining
// if the return value is to be ignored.
class LIBSIGC_API RetCode
{
public:
static int check_ignore();
static void ignore();
};
 
// Basic Marshal class.
template <typename R>
class Marshal
{
public:
typedef R OutType;
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R InType;
protected:
typedef OutType OutType_;
#else
typedef Trait<R>::type InType;
protected:
typedef InType OutType_;
#endif
OutType_ value_;
public:
OutType_& value() {return value_;}
 
static OutType_ default_value()
#ifdef SIGC_CXX_INT_CTOR
{return OutType_();}
#else
{OutType_ r; new (&r) OutType_(); return r;}
#endif
 
// This captures return values. Return TRUE to stop emittion process.
bool marshal(const InType& newval)
{
if (!RetCode::check_ignore()) value_=newval;
return 0; // continue emittion process
};
Marshal()
#ifdef SIGC_CXX_INT_CTOR
:value_()
{RetCode::check_ignore();}
#else
{
RetCode::check_ignore();
new (&value_) OutType_();
}
#endif
};
 
#ifdef SIGC_CXX_SPECIALIZE_REFERENCES
// Basic Marshal class.
template <typename R>
class Marshal<R&>
{
public:
typedef R& OutType;
typedef R& InType;
R* value_;
OutType value() {return value_;}
static OutType default_value() {return Default;}
static R Default;
 
// This captures return values. Return TRUE to stop emittion process.
bool marshal(InType newval)
{
if (!RetCode::check_ignore()) value_=&newval;
return 0; // continue emittion process
};
Marshal()
:value_(&Default)
{RetCode::check_ignore();}
~Marshal()
{}
};
 
template <typename T> T Marshal<T&>::Default;
#endif
 
#ifdef SIGC_CXX_PARTIAL_SPEC
// dummy marshaller for void type.
template <>
class Marshal<void>
{
public:
Marshal()
{}
~Marshal()
{}
};
#endif
 
 
// starts with a fixed value
template <class R,R initial>
class FixedMarshal
{
public:
typedef R OutType;
typedef R InType;
R value_;
OutType& value() {return value_;}
static OutType default_value() { return initial; }
 
bool marshal(const InType& newval)
{
if (!RetCode::check_ignore()) value_=newval;
return 0; // continue emittion process
};
 
FixedMarshal()
:value_(initial)
{RetCode::check_ignore();}
~FixedMarshal()
{}
};
 
template <class R>
struct FastMarshal
{
typedef R OutType;
typedef R InType;
 
R value_;
OutType& value() {return value_;}
static OutType default_value()
#ifdef SIGC_CXX_INT_CTOR
{return R();}
#else
{R r; new (&r) R(); return r;}
#endif
 
bool marshal(const InType& newval)
{
value_=newval;
return 0; // continue emittion process
};
 
FastMarshal()
#ifdef SIGC_CXX_INT_CTOR
:value_()
{}
#else
{new (&value_) R();}
#endif
~FastMarshal()
{}
};
 
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace sigc
#endif
 
#endif
/contrib/media/updf/include/sigc++/object.h
0,0 → 1,153
// -*- c++ -*-
/*
* Copyright 1999 Karl Nelson <kenelson@ece.ucdavis.edu>
*
* 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 SIGCXX_OBJECT_H
#define SIGCXX_OBJECT_H
#include <sigc++config.h>
#include <sigc++/scope.h>
 
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
extern int sigc_micro_version;
extern int sigc_minor_version;
extern int sigc_major_version;
 
class Invalid_;
class LIBSIGC_API ObjectReferenced
{
friend class Reference;
friend class Scope;
friend class Invalid_;
 
#ifdef SIGC_CXX_FRIEND_TEMPLATES
template <class T>
friend T* manage(T*);
#endif
 
protected:
// count of current references
unsigned int obj_count_ :24;
 
// indicates object generated through an interface that marks dynamic
unsigned int obj_dynamic_ :1;
 
// indicates the pointed to scope is the owner
unsigned int obj_owned_ :1;
 
// indicates object not will delete when count reachs zero
unsigned int obj_floating_ :1;
 
// indicates the owned scope is surrendering ownership
unsigned int obj_transfer_ :1;
 
// indicates the object is doing a list clean up
unsigned int obj_invalid_ :1;
 
// indicates the object been destroyed
unsigned int obj_destroyed_ :1;
 
// indicates there is a weak reference
unsigned int obj_weak_ :1;
 
 
/*************************************************************/
#ifdef SIGC_CXX_FRIEND_TEMPLATES
protected:
#else
public:
#endif
// For the controller and scope
virtual void set_dynamic();
inline void set_sink() {obj_floating_=0;}
 
protected:
 
inline void register_ref(Reference *)
{
if (obj_transfer_)
{
obj_transfer_=0;
obj_owned_=0;
}
}
public:
virtual void reference();
virtual void unreference();
 
inline bool is_dynamic() {return obj_dynamic_;}
inline bool is_floating() {return obj_floating_;}
 
ObjectReferenced();
virtual ~ObjectReferenced();
};
 
 
class LIBSIGC_API ObjectScoped :public ObjectReferenced
{
friend class Scope;
typedef ScopeList List_;
 
private:
mutable List_ list_;
 
// interface for scopes
void register_scope(Scope *scope,const Scope *parent=0);
void unregister_scope(Scope *scope);
 
protected:
// This sets a very weak reference which is removed at next invalid
void set_weak();
 
public:
void register_data(ScopeNode* data);
 
// inform connections that object wishs to delete
void invalid(bool destroy=0);
 
ObjectScoped();
virtual ~ObjectScoped();
};
 
 
// There can only be one Scope_Object per any object
class LIBSIGC_API Object: public virtual ObjectScoped
{
public:
Object() {}
virtual ~Object();
};
 
// mark this a managable object
template <class T>
inline T* manage(T* t)
{
if (t) t->set_dynamic();
return t;
}
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#endif
/contrib/media/updf/include/sigc++/object_slot.h
0,0 → 1,818
// -*- c++ -*-
/* This is a generated file, do not edit. Generated from ../sigc++/macros/object_slot.h.m4 */
 
#ifndef SIGCXX_OBJECT_SLOT_H
#define SIGCXX_OBJECT_SLOT_H
 
/*
SigC::slot() (obj)
-----------------------
slot() can be applied to a object method to form a Slot with a
profile equivelent to the method. At the same time an instance
of that object must be specified. The object must be derived
from SigC::Object.
 
Sample usage:
 
struct A: public SigC::Object
{
void foo(int,int);
} a;
 
Slot2<void,int,int> s=slot(a,&A::foo);
 
*/
 
 
#include <sigc++/slot.h>
#include <sigc++/scope.h>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
 
 
/****************************************************************
***** Object Slot 0
****************************************************************/
template <class R,class Obj>
struct ObjectSlot0_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (Obj::*InFunc)();
typedef RType (Obj::*Func)();
typedef Slot0<R> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d)
{
CallData* data=(CallData*)d;
return ((data->obj)->*(data->func))();
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class Obj>
struct ObjectSlot0_<void,Obj>
{
typedef void RType;
typedef void (Obj::*InFunc)();
typedef RType (Obj::*Func)();
typedef Slot0<void> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d)
{
CallData* data=(CallData*)d;
((data->obj)->*(data->func))();
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
#endif
#endif
 
template <class R,class O,class O2>
inline Slot0<R>
slot(O* &obj,R (O2::*func)())
{
return ObjectSlot0_<R,O2>
::create(obj,func);
}
 
template <class R,class O,class O2>
inline Slot0<R>
slot(O* const &obj,R (O2::*func)())
{
return ObjectSlot0_<R,O2>
::create(obj,func);
}
 
template <class R,class O,class O2>
inline Slot0<R>
slot(O &obj,R (O2::*func)())
{
return ObjectSlot0_<R,O2>
::create(&obj,func);
}
 
 
 
/****************************************************************
***** Object Slot 1
****************************************************************/
template <class R,class P1,class Obj>
struct ObjectSlot1_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (Obj::*InFunc)(P1);
typedef RType (Obj::*Func)(P1);
typedef Slot1<R,P1> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
return ((data->obj)->*(data->func))(p1);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class Obj>
struct ObjectSlot1_<void,P1,Obj>
{
typedef void RType;
typedef void (Obj::*InFunc)(P1);
typedef RType (Obj::*Func)(P1);
typedef Slot1<void,P1> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
((data->obj)->*(data->func))(p1);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
#endif
#endif
 
template <class R,class P1,class O,class O2>
inline Slot1<R,P1>
slot(O* &obj,R (O2::*func)(P1))
{
return ObjectSlot1_<R,P1,O2>
::create(obj,func);
}
 
template <class R,class P1,class O,class O2>
inline Slot1<R,P1>
slot(O* const &obj,R (O2::*func)(P1))
{
return ObjectSlot1_<R,P1,O2>
::create(obj,func);
}
 
template <class R,class P1,class O,class O2>
inline Slot1<R,P1>
slot(O &obj,R (O2::*func)(P1))
{
return ObjectSlot1_<R,P1,O2>
::create(&obj,func);
}
 
 
 
/****************************************************************
***** Object Slot 2
****************************************************************/
template <class R,class P1,class P2,class Obj>
struct ObjectSlot2_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (Obj::*InFunc)(P1,P2);
typedef RType (Obj::*Func)(P1,P2);
typedef Slot2<R,P1,P2> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
return ((data->obj)->*(data->func))(p1,p2);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class Obj>
struct ObjectSlot2_<void,P1,P2,Obj>
{
typedef void RType;
typedef void (Obj::*InFunc)(P1,P2);
typedef RType (Obj::*Func)(P1,P2);
typedef Slot2<void,P1,P2> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
((data->obj)->*(data->func))(p1,p2);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
#endif
#endif
 
template <class R,class P1,class P2,class O,class O2>
inline Slot2<R,P1,P2>
slot(O* &obj,R (O2::*func)(P1,P2))
{
return ObjectSlot2_<R,P1,P2,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class O,class O2>
inline Slot2<R,P1,P2>
slot(O* const &obj,R (O2::*func)(P1,P2))
{
return ObjectSlot2_<R,P1,P2,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class O,class O2>
inline Slot2<R,P1,P2>
slot(O &obj,R (O2::*func)(P1,P2))
{
return ObjectSlot2_<R,P1,P2,O2>
::create(&obj,func);
}
 
 
 
/****************************************************************
***** Object Slot 3
****************************************************************/
template <class R,class P1,class P2,class P3,class Obj>
struct ObjectSlot3_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (Obj::*InFunc)(P1,P2,P3);
typedef RType (Obj::*Func)(P1,P2,P3);
typedef Slot3<R,P1,P2,P3> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
return ((data->obj)->*(data->func))(p1,p2,p3);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class Obj>
struct ObjectSlot3_<void,P1,P2,P3,Obj>
{
typedef void RType;
typedef void (Obj::*InFunc)(P1,P2,P3);
typedef RType (Obj::*Func)(P1,P2,P3);
typedef Slot3<void,P1,P2,P3> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
((data->obj)->*(data->func))(p1,p2,p3);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
#endif
#endif
 
template <class R,class P1,class P2,class P3,class O,class O2>
inline Slot3<R,P1,P2,P3>
slot(O* &obj,R (O2::*func)(P1,P2,P3))
{
return ObjectSlot3_<R,P1,P2,P3,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class P3,class O,class O2>
inline Slot3<R,P1,P2,P3>
slot(O* const &obj,R (O2::*func)(P1,P2,P3))
{
return ObjectSlot3_<R,P1,P2,P3,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class P3,class O,class O2>
inline Slot3<R,P1,P2,P3>
slot(O &obj,R (O2::*func)(P1,P2,P3))
{
return ObjectSlot3_<R,P1,P2,P3,O2>
::create(&obj,func);
}
 
 
 
/****************************************************************
***** Object Slot 4
****************************************************************/
template <class R,class P1,class P2,class P3,class P4,class Obj>
struct ObjectSlot4_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (Obj::*InFunc)(P1,P2,P3,P4);
typedef RType (Obj::*Func)(P1,P2,P3,P4);
typedef Slot4<R,P1,P2,P3,P4> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
return ((data->obj)->*(data->func))(p1,p2,p3,p4);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class Obj>
struct ObjectSlot4_<void,P1,P2,P3,P4,Obj>
{
typedef void RType;
typedef void (Obj::*InFunc)(P1,P2,P3,P4);
typedef RType (Obj::*Func)(P1,P2,P3,P4);
typedef Slot4<void,P1,P2,P3,P4> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
((data->obj)->*(data->func))(p1,p2,p3,p4);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
#endif
#endif
 
template <class R,class P1,class P2,class P3,class P4,class O,class O2>
inline Slot4<R,P1,P2,P3,P4>
slot(O* &obj,R (O2::*func)(P1,P2,P3,P4))
{
return ObjectSlot4_<R,P1,P2,P3,P4,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class O,class O2>
inline Slot4<R,P1,P2,P3,P4>
slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4))
{
return ObjectSlot4_<R,P1,P2,P3,P4,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class O,class O2>
inline Slot4<R,P1,P2,P3,P4>
slot(O &obj,R (O2::*func)(P1,P2,P3,P4))
{
return ObjectSlot4_<R,P1,P2,P3,P4,O2>
::create(&obj,func);
}
 
 
 
/****************************************************************
***** Object Slot 5
****************************************************************/
template <class R,class P1,class P2,class P3,class P4,class P5,class Obj>
struct ObjectSlot5_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (Obj::*InFunc)(P1,P2,P3,P4,P5);
typedef RType (Obj::*Func)(P1,P2,P3,P4,P5);
typedef Slot5<R,P1,P2,P3,P4,P5> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
return ((data->obj)->*(data->func))(p1,p2,p3,p4,p5);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,class Obj>
struct ObjectSlot5_<void,P1,P2,P3,P4,P5,Obj>
{
typedef void RType;
typedef void (Obj::*InFunc)(P1,P2,P3,P4,P5);
typedef RType (Obj::*Func)(P1,P2,P3,P4,P5);
typedef Slot5<void,P1,P2,P3,P4,P5> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
((data->obj)->*(data->func))(p1,p2,p3,p4,p5);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
#endif
#endif
 
template <class R,class P1,class P2,class P3,class P4,class P5,class O,class O2>
inline Slot5<R,P1,P2,P3,P4,P5>
slot(O* &obj,R (O2::*func)(P1,P2,P3,P4,P5))
{
return ObjectSlot5_<R,P1,P2,P3,P4,P5,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class P5,class O,class O2>
inline Slot5<R,P1,P2,P3,P4,P5>
slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4,P5))
{
return ObjectSlot5_<R,P1,P2,P3,P4,P5,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class P5,class O,class O2>
inline Slot5<R,P1,P2,P3,P4,P5>
slot(O &obj,R (O2::*func)(P1,P2,P3,P4,P5))
{
return ObjectSlot5_<R,P1,P2,P3,P4,P5,O2>
::create(&obj,func);
}
 
 
 
/****************************************************************
***** Object Slot 6
****************************************************************/
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class Obj>
struct ObjectSlot6_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (Obj::*InFunc)(P1,P2,P3,P4,P5,P6);
typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6);
typedef Slot6<R,P1,P2,P3,P4,P5,P6> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
return ((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,class P6,class Obj>
struct ObjectSlot6_<void,P1,P2,P3,P4,P5,P6,Obj>
{
typedef void RType;
typedef void (Obj::*InFunc)(P1,P2,P3,P4,P5,P6);
typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6);
typedef Slot6<void,P1,P2,P3,P4,P5,P6> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
#endif
#endif
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class O,class O2>
inline Slot6<R,P1,P2,P3,P4,P5,P6>
slot(O* &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6))
{
return ObjectSlot6_<R,P1,P2,P3,P4,P5,P6,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class O,class O2>
inline Slot6<R,P1,P2,P3,P4,P5,P6>
slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6))
{
return ObjectSlot6_<R,P1,P2,P3,P4,P5,P6,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class O,class O2>
inline Slot6<R,P1,P2,P3,P4,P5,P6>
slot(O &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6))
{
return ObjectSlot6_<R,P1,P2,P3,P4,P5,P6,O2>
::create(&obj,func);
}
 
 
 
/****************************************************************
***** Object Slot 7
****************************************************************/
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class Obj>
struct ObjectSlot7_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef typename Trait<R>::type RType;
#endif
typedef R (Obj::*InFunc)(P1,P2,P3,P4,P5,P6,P7);
typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6,P7);
typedef Slot7<R,P1,P2,P3,P4,P5,P6,P7> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
CallData* data=(CallData*)d;
return ((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6,p7);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class P1,class P2,class P3,class P4,class P5,class P6,class P7,class Obj>
struct ObjectSlot7_<void,P1,P2,P3,P4,P5,P6,P7,Obj>
{
typedef void RType;
typedef void (Obj::*InFunc)(P1,P2,P3,P4,P5,P6,P7);
typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6,P7);
typedef Slot7<void,P1,P2,P3,P4,P5,P6,P7> SlotType;
typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
CallData* data=(CallData*)d;
((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6,p7);
}
 
static SlotData* create(Obj* obj,InFunc func)
{
if (!obj) return 0;
SlotData* tmp=manage(new SlotData());
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=obj;
data.func=(Func)func;
obj->register_data(tmp->receiver());
return tmp;
}
};
 
 
#endif
#endif
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class O,class O2>
inline Slot7<R,P1,P2,P3,P4,P5,P6,P7>
slot(O* &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6,P7))
{
return ObjectSlot7_<R,P1,P2,P3,P4,P5,P6,P7,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class O,class O2>
inline Slot7<R,P1,P2,P3,P4,P5,P6,P7>
slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6,P7))
{
return ObjectSlot7_<R,P1,P2,P3,P4,P5,P6,P7,O2>
::create(obj,func);
}
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class O,class O2>
inline Slot7<R,P1,P2,P3,P4,P5,P6,P7>
slot(O &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6,P7))
{
return ObjectSlot7_<R,P1,P2,P3,P4,P5,P6,P7,O2>
::create(&obj,func);
}
 
 
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#endif
/contrib/media/updf/include/sigc++/retbind.h
0,0 → 1,848
// -*- c++ -*-
/* This is a generated file, do not edit. Generated from ../sigc++/macros/retbind.h.m4 */
/* This was also shamelessly copied, hacked, munched, and carefully
* tweaked from KNelson's original bind.h.m4
* CJN 3.22.00
*/
 
#ifndef SIGCXX_RETBIND_H
#define SIGCXX_RETBIND_H
 
/*
SigC::retbind
-------------
retbind() alters a Slot by fixing the return value to certain values
 
Return value fixing ignores any slot return value. The slot is
destroyed in the process and a new one is created, so references
holding onto the slot will no longer be valid.
 
Typecasting may be necessary to match arguments between the
slot and the binding return value. Types must be an exact match.
To insure the proper type, the type can be explicitly specified
on template instantation.
 
Simple Sample usage:
 
void f(int,int);
Slot2<void,int,int> s1=slot(f);
 
Slot1<int,int,int> s2=retbind(s1,1); // s1 is invalid
cout << "s2: " << s2(2,1) << endl;
 
Type specified usage:
struct A {};
struct B :public A {};
B* b;
Slot1<void> s1;
 
Slot0<A*> s2=retbind<A*>(s1,b); // B* must be told to match A*
*/
 
#include <sigc++/adaptor.h>
#include <sigc++/scope.h>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
 
 
 
/****************************************************************
***** Adaptor RetBind Slot 0 arguments
****************************************************************/
template <class Ret,class R>
struct AdaptorRetBindSlot0: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot0<Ret> SlotType;
typedef Slot0<R> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))();
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class Ret>
struct AdaptorRetBindSlot0
<Ret,void> : public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot0<Ret> SlotType;
typedef Slot0<void> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))();
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
template <class Ret,
class R>
Slot0<Ret>
retbind(const Slot0<R> &s,
Ret ret)
{return AdaptorRetBindSlot0<Ret,R>::create(s.data(),ret);
}
 
 
/****************************************************************
***** Adaptor RetBind Slot 1 arguments
****************************************************************/
template <class Ret,class R,
class P1>
struct AdaptorRetBindSlot1: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot1<Ret,P1> SlotType;
typedef Slot1<R,P1> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class Ret,class P1>
struct AdaptorRetBindSlot1
<Ret,void,
P1> : public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot1<Ret,P1> SlotType;
typedef Slot1<void,P1> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
template <class Ret,
class R,
class P1>
Slot1<Ret,P1>
retbind(const Slot1<R,P1> &s,
Ret ret)
{return AdaptorRetBindSlot1<Ret,R,
P1>::create(s.data(),ret);
}
 
 
/****************************************************************
***** Adaptor RetBind Slot 2 arguments
****************************************************************/
template <class Ret,class R,
class P1,class P2>
struct AdaptorRetBindSlot2: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot2<Ret,P1,P2> SlotType;
typedef Slot2<R,P1,P2> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class Ret,class P1,class P2>
struct AdaptorRetBindSlot2
<Ret,void,
P1,P2> : public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot2<Ret,P1,P2> SlotType;
typedef Slot2<void,P1,P2> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
template <class Ret,
class R,
class P1,class P2>
Slot2<Ret,P1,P2>
retbind(const Slot2<R,P1,P2> &s,
Ret ret)
{return AdaptorRetBindSlot2<Ret,R,
P1,P2>::create(s.data(),ret);
}
 
 
/****************************************************************
***** Adaptor RetBind Slot 3 arguments
****************************************************************/
template <class Ret,class R,
class P1,class P2,class P3>
struct AdaptorRetBindSlot3: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot3<Ret,P1,P2,P3> SlotType;
typedef Slot3<R,P1,P2,P3> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class Ret,class P1,class P2,class P3>
struct AdaptorRetBindSlot3
<Ret,void,
P1,P2,P3> : public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot3<Ret,P1,P2,P3> SlotType;
typedef Slot3<void,P1,P2,P3> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
template <class Ret,
class R,
class P1,class P2,class P3>
Slot3<Ret,P1,P2,P3>
retbind(const Slot3<R,P1,P2,P3> &s,
Ret ret)
{return AdaptorRetBindSlot3<Ret,R,
P1,P2,P3>::create(s.data(),ret);
}
 
 
/****************************************************************
***** Adaptor RetBind Slot 4 arguments
****************************************************************/
template <class Ret,class R,
class P1,class P2,class P3,class P4>
struct AdaptorRetBindSlot4: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot4<Ret,P1,P2,P3,P4> SlotType;
typedef Slot4<R,P1,P2,P3,P4> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class Ret,class P1,class P2,class P3,class P4>
struct AdaptorRetBindSlot4
<Ret,void,
P1,P2,P3,P4> : public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot4<Ret,P1,P2,P3,P4> SlotType;
typedef Slot4<void,P1,P2,P3,P4> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
template <class Ret,
class R,
class P1,class P2,class P3,class P4>
Slot4<Ret,P1,P2,P3,P4>
retbind(const Slot4<R,P1,P2,P3,P4> &s,
Ret ret)
{return AdaptorRetBindSlot4<Ret,R,
P1,P2,P3,P4>::create(s.data(),ret);
}
 
 
/****************************************************************
***** Adaptor RetBind Slot 5 arguments
****************************************************************/
template <class Ret,class R,
class P1,class P2,class P3,class P4,class P5>
struct AdaptorRetBindSlot5: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot5<Ret,P1,P2,P3,P4,P5> SlotType;
typedef Slot5<R,P1,P2,P3,P4,P5> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class Ret,class P1,class P2,class P3,class P4,class P5>
struct AdaptorRetBindSlot5
<Ret,void,
P1,P2,P3,P4,P5> : public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot5<Ret,P1,P2,P3,P4,P5> SlotType;
typedef Slot5<void,P1,P2,P3,P4,P5> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
template <class Ret,
class R,
class P1,class P2,class P3,class P4,class P5>
Slot5<Ret,P1,P2,P3,P4,P5>
retbind(const Slot5<R,P1,P2,P3,P4,P5> &s,
Ret ret)
{return AdaptorRetBindSlot5<Ret,R,
P1,P2,P3,P4,P5>::create(s.data(),ret);
}
 
 
/****************************************************************
***** Adaptor RetBind Slot 6 arguments
****************************************************************/
template <class Ret,class R,
class P1,class P2,class P3,class P4,class P5,class P6>
struct AdaptorRetBindSlot6: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot6<Ret,P1,P2,P3,P4,P5,P6> SlotType;
typedef Slot6<R,P1,P2,P3,P4,P5,P6> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class Ret,class P1,class P2,class P3,class P4,class P5,class P6>
struct AdaptorRetBindSlot6
<Ret,void,
P1,P2,P3,P4,P5,P6> : public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot6<Ret,P1,P2,P3,P4,P5,P6> SlotType;
typedef Slot6<void,P1,P2,P3,P4,P5,P6> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
template <class Ret,
class R,
class P1,class P2,class P3,class P4,class P5,class P6>
Slot6<Ret,P1,P2,P3,P4,P5,P6>
retbind(const Slot6<R,P1,P2,P3,P4,P5,P6> &s,
Ret ret)
{return AdaptorRetBindSlot6<Ret,R,
P1,P2,P3,P4,P5,P6>::create(s.data(),ret);
}
 
 
/****************************************************************
***** Adaptor RetBind Slot 7 arguments
****************************************************************/
template <class Ret,class R,
class P1,class P2,class P3,class P4,class P5,class P6,class P7>
struct AdaptorRetBindSlot7: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot7<Ret,P1,P2,P3,P4,P5,P6,P7> SlotType;
typedef Slot7<R,P1,P2,P3,P4,P5,P6,P7> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6,p7);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <class Ret,class P1,class P2,class P3,class P4,class P5,class P6,class P7>
struct AdaptorRetBindSlot7
<Ret,void,
P1,P2,P3,P4,P5,P6,P7> : public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef Ret RType;
#else
typedef typename Trait<Ret>::type RType;
#endif
typedef Slot7<Ret,P1,P2,P3,P4,P5,P6,P7> SlotType;
typedef Slot7<void,P1,P2,P3,P4,P5,P6,P7> InSlotType;
 
struct Node:public AdaptorNode
{
Ret ret_;
};
 
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6,p7);
return node->ret_;
}
static SlotData* create(SlotData *s,Ret ret)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
node->ret_ = ret;
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
template <class Ret,
class R,
class P1,class P2,class P3,class P4,class P5,class P6,class P7>
Slot7<Ret,P1,P2,P3,P4,P5,P6,P7>
retbind(const Slot7<R,P1,P2,P3,P4,P5,P6,P7> &s,
Ret ret)
{return AdaptorRetBindSlot7<Ret,R,
P1,P2,P3,P4,P5,P6,P7>::create(s.data(),ret);
}
 
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#endif
/contrib/media/updf/include/sigc++/rettype.h
0,0 → 1,715
// -*- c++ -*-
/* This is a generated file, do not edit. Generated from ../sigc++/macros/rettype.h.m4 */
 
#ifndef SIGCXX_RETTYPE_H
#define SIGCXX_RETTYPE_H
 
/*
SigC::rettype
-------------
rettype() alters a Slot by changing the return type.
 
Only allowed conversions or conversions to void can properly
be implemented. The type must always be specified as a
template parameter.
 
Simple Sample usage:
 
int f(int);
 
Slot1<void,int> s1=rettype<void>(slot(&f));
Slot1<float,int> s2=rettype<float>(slot(&f));
 
*/
 
#include <sigc++/adaptor.h>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
 
 
 
 
 
 
 
 
 
 
/****************************************************************
***** Adaptor Rettype Slot 0
****************************************************************/
template <class R1,
class R2>
struct AdaptorRettypeSlot0_
: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot0<R1> SlotType;
typedef Slot0<R2> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return RType(((typename InSlotType::Callback&)(node->data_))());
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <
class R2>
struct AdaptorRettypeSlot0_
<void,
R2>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot0<void> SlotType;
typedef Slot0<R2> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))();
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
 
template <class R1,class R2>
Slot0<R1>
rettype(const Slot0<R2> &s)
{return AdaptorRettypeSlot0_<R1,R2>::create(s.obj());
}
 
/****************************************************************
***** Adaptor Rettype Slot 1
****************************************************************/
template <class R1,
class P1,
class R2>
struct AdaptorRettypeSlot1_
: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot1<R1,P1> SlotType;
typedef Slot1<R2,P1> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return RType(((typename InSlotType::Callback&)(node->data_))(p1));
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <
class P1,
class R2>
struct AdaptorRettypeSlot1_
<void,
P1,
R2>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot1<void,P1> SlotType;
typedef Slot1<R2,P1> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1);
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
 
template <class R1,class R2,class P1>
Slot1<R1,P1>
rettype(const Slot1<R2,P1> &s)
{return AdaptorRettypeSlot1_<R1,
P1,R2>::create(s.obj());
}
 
/****************************************************************
***** Adaptor Rettype Slot 2
****************************************************************/
template <class R1,
class P1,class P2,
class R2>
struct AdaptorRettypeSlot2_
: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot2<R1,P1,P2> SlotType;
typedef Slot2<R2,P1,P2> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return RType(((typename InSlotType::Callback&)(node->data_))(p1,p2));
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <
class P1,class P2,
class R2>
struct AdaptorRettypeSlot2_
<void,
P1,P2,
R2>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot2<void,P1,P2> SlotType;
typedef Slot2<R2,P1,P2> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2);
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
 
template <class R1,class R2,class P1,class P2>
Slot2<R1,P1,P2>
rettype(const Slot2<R2,P1,P2> &s)
{return AdaptorRettypeSlot2_<R1,
P1,P2,R2>::create(s.obj());
}
 
/****************************************************************
***** Adaptor Rettype Slot 3
****************************************************************/
template <class R1,
class P1,class P2,class P3,
class R2>
struct AdaptorRettypeSlot3_
: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot3<R1,P1,P2,P3> SlotType;
typedef Slot3<R2,P1,P2,P3> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return RType(((typename InSlotType::Callback&)(node->data_))(p1,p2,p3));
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <
class P1,class P2,class P3,
class R2>
struct AdaptorRettypeSlot3_
<void,
P1,P2,P3,
R2>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot3<void,P1,P2,P3> SlotType;
typedef Slot3<R2,P1,P2,P3> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3);
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
 
template <class R1,class R2,class P1,class P2,class P3>
Slot3<R1,P1,P2,P3>
rettype(const Slot3<R2,P1,P2,P3> &s)
{return AdaptorRettypeSlot3_<R1,
P1,P2,P3,R2>::create(s.obj());
}
 
/****************************************************************
***** Adaptor Rettype Slot 4
****************************************************************/
template <class R1,
class P1,class P2,class P3,class P4,
class R2>
struct AdaptorRettypeSlot4_
: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot4<R1,P1,P2,P3,P4> SlotType;
typedef Slot4<R2,P1,P2,P3,P4> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return RType(((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4));
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <
class P1,class P2,class P3,class P4,
class R2>
struct AdaptorRettypeSlot4_
<void,
P1,P2,P3,P4,
R2>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot4<void,P1,P2,P3,P4> SlotType;
typedef Slot4<R2,P1,P2,P3,P4> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4);
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
 
template <class R1,class R2,class P1,class P2,class P3,class P4>
Slot4<R1,P1,P2,P3,P4>
rettype(const Slot4<R2,P1,P2,P3,P4> &s)
{return AdaptorRettypeSlot4_<R1,
P1,P2,P3,P4,R2>::create(s.obj());
}
 
/****************************************************************
***** Adaptor Rettype Slot 5
****************************************************************/
template <class R1,
class P1,class P2,class P3,class P4,class P5,
class R2>
struct AdaptorRettypeSlot5_
: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot5<R1,P1,P2,P3,P4,P5> SlotType;
typedef Slot5<R2,P1,P2,P3,P4,P5> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return RType(((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5));
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <
class P1,class P2,class P3,class P4,class P5,
class R2>
struct AdaptorRettypeSlot5_
<void,
P1,P2,P3,P4,P5,
R2>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot5<void,P1,P2,P3,P4,P5> SlotType;
typedef Slot5<R2,P1,P2,P3,P4,P5> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5);
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
 
template <class R1,class R2,class P1,class P2,class P3,class P4,class P5>
Slot5<R1,P1,P2,P3,P4,P5>
rettype(const Slot5<R2,P1,P2,P3,P4,P5> &s)
{return AdaptorRettypeSlot5_<R1,
P1,P2,P3,P4,P5,R2>::create(s.obj());
}
 
/****************************************************************
***** Adaptor Rettype Slot 6
****************************************************************/
template <class R1,
class P1,class P2,class P3,class P4,class P5,class P6,
class R2>
struct AdaptorRettypeSlot6_
: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot6<R1,P1,P2,P3,P4,P5,P6> SlotType;
typedef Slot6<R2,P1,P2,P3,P4,P5,P6> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return RType(((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6));
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <
class P1,class P2,class P3,class P4,class P5,class P6,
class R2>
struct AdaptorRettypeSlot6_
<void,
P1,P2,P3,P4,P5,P6,
R2>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot6<void,P1,P2,P3,P4,P5,P6> SlotType;
typedef Slot6<R2,P1,P2,P3,P4,P5,P6> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6);
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
 
template <class R1,class R2,class P1,class P2,class P3,class P4,class P5,class P6>
Slot6<R1,P1,P2,P3,P4,P5,P6>
rettype(const Slot6<R2,P1,P2,P3,P4,P5,P6> &s)
{return AdaptorRettypeSlot6_<R1,
P1,P2,P3,P4,P5,P6,R2>::create(s.obj());
}
 
/****************************************************************
***** Adaptor Rettype Slot 7
****************************************************************/
template <class R1,
class P1,class P2,class P3,class P4,class P5,class P6,class P7,
class R2>
struct AdaptorRettypeSlot7_
: public AdaptorSlot_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R1 RType;
#else
typedef typename Trait<R1>::type RType;
#endif
typedef Slot7<R1,P1,P2,P3,P4,P5,P6,P7> SlotType;
typedef Slot7<R2,P1,P2,P3,P4,P5,P6,P7> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
return RType(((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6,p7));
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
template <
class P1,class P2,class P3,class P4,class P5,class P6,class P7,
class R2>
struct AdaptorRettypeSlot7_
<void,
P1,P2,P3,P4,P5,P6,P7,
R2>
: public AdaptorSlot_
{
typedef void RType;
typedef Slot7<void,P1,P2,P3,P4,P5,P6,P7> SlotType;
typedef Slot7<R2,P1,P2,P3,P4,P5,P6,P7> InSlotType;
typedef AdaptorNode Node;
typedef CallDataObj2<typename SlotType::Func,Node> CallData;
 
static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
CallData* data=(CallData*)d;
Node* node=data->obj;
((typename InSlotType::Callback&)(node->data_))(p1,p2,p3,p4,p5,p6,p7);
}
static SlotData* create(SlotData *s)
{
SlotData* tmp=(SlotData*)s;
Node *node=new Node();
copy_callback(tmp,node);
CallData &data=reinterpret_cast<CallData&>(tmp->data_);
data.callback=&callback;
data.obj=node;
return tmp;
}
};
 
#endif
#endif
 
 
template <class R1,class R2,class P1,class P2,class P3,class P4,class P5,class P6,class P7>
Slot7<R1,P1,P2,P3,P4,P5,P6,P7>
rettype(const Slot7<R2,P1,P2,P3,P4,P5,P6,P7> &s)
{return AdaptorRettypeSlot7_<R1,
P1,P2,P3,P4,P5,P6,P7,R2>::create(s.obj());
}
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#endif
/contrib/media/updf/include/sigc++/scope.h
0,0 → 1,292
// -*- c++ -*-
/*
* Copyright 1999 Karl Nelson <kenelson@ece.ucdavis.edu>
*
* 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 SIGCXX_SCOPE_H
#define SIGCXX_SCOPE_H
#include <sigc++config.h>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
 
struct LIBSIGC_API ScopeNode
{
mutable ScopeNode *prev_;
mutable ScopeNode *next_;
 
// removes self from list
void remove_self();
 
// Called to inform the item that it is erased
virtual void erase();
 
// inform scopes that invalid requested.
virtual void disconnect(bool destroy=0);
 
ScopeNode()
#ifdef LIBSIGC_WIN32
{prev_=next_=this;}
#else
:prev_(this),next_(this) {}
#endif
 
virtual ~ScopeNode();
 
private:
ScopeNode& operator=(const ScopeNode&);
ScopeNode(const ScopeNode&);
};
 
struct LIBSIGC_API DataNode: public ScopeNode
{
virtual void erase();
virtual ~DataNode();
};
 
/*******************************************************************
***** Basis Scope
*******************************************************************/
class ObjectScoped;
class ObjectReferenced;
class Object;
class Scope;
 
class LIBSIGC_API Reference
{
protected:
mutable ObjectReferenced* obj_;
mutable void* cache_;
 
public:
void set_sink();
 
void init(ObjectReferenced* obj);
void set(ObjectReferenced* obj,void* cache=0,bool ptr=false);
 
Reference& operator=(ObjectReferenced *obj) { set(obj); return *this; }
Reference& operator=(ObjectReferenced &obj) { set(&obj); return *this; }
Reference& operator=(const Reference& ref) { set(ref.obj_); return *this; };
 
ObjectReferenced* object() const {return obj_;}
void* cache() const {return cache_;}
 
Reference():obj_(0) {}
Reference(ObjectReferenced &obj)
{init(&obj);}
Reference(const Reference& ref)
{init(ref.obj_);}
~Reference();
};
class LIBSIGC_API Scope:public ScopeNode
{
friend class ObjectScoped;
 
Scope& operator=(const Scope& scope);
Scope(const Scope& scope);
 
protected:
void set(ObjectScoped* obj,void* cache,bool ptr);
mutable ObjectScoped* obj_;
mutable void* cache_;
 
virtual void on_connect()=0;
virtual void erase();
 
void register_scope(ObjectScoped *);
void register_scope(const Scope *parent=0);
void unregister_scope();
 
public:
 
void reference();
void unreference();
void set_sink();
 
ObjectScoped* object() const {return (ObjectScoped*)(obj_);}
void* cache() const {return cache_;}
 
// Inform object it should invalidate its list.
void invalid();
 
Scope():obj_(0),cache_(0) {}
virtual ~Scope();
};
 
 
/******************************************************
**** Common Scopes
*******************************************************
Available Scopes:
Uncounted - non-reference
Limit - Limits the lifetime of object to this scope
Sinks object.
Extend - Extends the lifetime of the object to this scope
Sinks object.
LimitOwned - Conditionally limits the lifetime of object
Sinks object.
FuncRef - Extends the lifetime, without sink
(intended for functions)
Reference - Extends the lifetime, with sink
AutoPtr - Shorthand for auto_ptr like scope.
RefCount - Shorthand for ref_ptr like scope.
******************************************************/
struct Scopes
{
 
class LIBSIGC_API Uncounted:public Scope
{
Uncounted& operator=(const Uncounted&);
Uncounted(const Uncounted&);
public:
virtual void disconnect(bool level=0);
Uncounted():Scope() {}
virtual ~Uncounted();
};
 
class LIBSIGC_API Extend:public Scope
{
public:
Extend& operator=(const Extend&);
Extend(const Extend&);
protected:
virtual void on_connect();
virtual void erase();
public:
virtual void disconnect(bool level=0);
void set(ObjectScoped* obj,void* cache,bool ptr);
Extend():Scope() {}
virtual ~Extend();
};
 
class LIBSIGC_API Limit:public Scope
{
Limit& operator=(const Limit&);
Limit(const Limit&);
protected:
virtual void on_connect();
virtual void erase();
public:
virtual void disconnect(bool level=0);
void set(ObjectScoped* obj,void* cache,bool ptr);
Limit():Scope() {}
virtual ~Limit();
};
 
typedef Extend RefCount;
typedef Reference Lock;
};
 
/*************************************************************
***** Lists
*************************************************************/
// Stub for building polylists
 
 
// Iterator skeleton
struct LIBSIGC_API ScopeIterator_
{
typedef ScopeNode NodeType;
private:
NodeType *node_;
public:
 
inline NodeType* node() {return node_;}
inline const NodeType* node() const {return node_;}
 
inline NodeType& operator*()
{return *node_;
}
inline const NodeType& operator*() const
{return *node_;
}
inline bool operator==(const ScopeIterator_& i) const
{return node_==i.node_;
}
inline bool operator!=(const ScopeIterator_& i) const
{return node_!=i.node_;
}
 
inline ScopeIterator_& operator++()
{
if (node_)
node_=(NodeType*)node_->next_;
return *this;
}
 
ScopeIterator_ operator++(int)
{
ScopeIterator_ tmp=*this;
++*this;
return tmp;
}
 
ScopeIterator_& operator= (const ScopeIterator_& i)
{
node_=i.node_;
return *this;
}
 
ScopeIterator_(const ScopeIterator_ &n):node_(n.node_) {}
ScopeIterator_(NodeType *n):node_(n) {}
ScopeIterator_():node_(0) {}
};
 
class LIBSIGC_API ScopeList
{
public:
typedef ScopeNode NodeType;
typedef ScopeIterator_ Iterator;
 
ScopeNode node_;
 
inline Iterator begin() {return Iterator(node_.next_);}
inline Iterator end() {return Iterator(&node_);}
 
// insert item directly on list
Iterator insert_direct(Iterator pos,NodeType *n);
 
Iterator erase(Iterator pos);
void erase(Iterator start,Iterator stop)
{ while (start!=stop) start=erase(start); }
void swap_elements(Iterator p1,Iterator p2);
 
void clear()
{ erase(begin(),end()); }
 
bool empty() const {return node_.next_==&node_;}
ScopeList():node_() {}
~ScopeList() { clear(); }
 
private:
ScopeList(const ScopeList&);
};
 
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace sigc
#endif
 
#endif
/contrib/media/updf/include/sigc++/sigc++config.h
0,0 → 1,15
#ifndef _SIGC_CONFIG_H_
#define _SIGC_CONFIG_H_
 
#define SIGC_MAJOR_VERSION 0
#define SIGC_MINOR_VERSION 8
#define SIGC_MICRO_VERSION 2
 
#define SIGC_CXX_PARTIAL_SPEC 1 /**/
#define SIGC_CXX_MEMBER_FUNC_TEMPLATES 1 /**/
#define SIGC_CXX_MEMBER_CLASS_TEMPLATES 1 /**/
#define SIGC_CXX_MUTABLE 1 /**/
#define SIGC_CXX_TEMPLATE_CCTOR 1
#define LIBSIGC_API
#endif
/contrib/media/updf/include/sigc++/signal_system.h
0,0 → 1,36
/*************************************************************************
***** A Signal Framework for C++
**************************************************************************
Copyright 1998-1999 Karl Nelson <kenelson@ece.ucdavis.edu>
Based off of ideas from Gtk-- signal system by Tero Pulkkinen.
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 SIGCXX_SIGNAL_SYSTEM_H
#define SIGCXX_SIGNAL_SYSTEM_H
 
#include <sigc++/slot.h>
#include <sigc++/object_slot.h>
#include <sigc++/func_slot.h>
#include <sigc++/basic_signal.h>
#if 0
#include <sigc++/signals.h>
#endif
#endif
/contrib/media/updf/include/sigc++/slot.h
0,0 → 1,1036
// -*- c++ -*-
/* This is a generated file, do not edit. Generated from ../sigc++/macros/slot.h.m4 */
 
 
#ifndef SIGCXX_SLOT_H
#define SIGCXX_SLOT_H
 
/*
 
This file just gives the basic definition of Slots.
 
Callback# is the 4 byte data necessary for representing all
callback types.
 
CallData is a specific interpretation of the Callback data.
 
Slot_ is a pimple on SlotData containing an Object for
holding its referencees, a Dependency that removes the slot
when its caller or receiver die, and a Callback.
 
Slot is a handle to a Slot_.
 
*/
 
#include <sigc++config.h>
#include <sigc++/type.h>
#include <sigc++/object.h>
#include <sigc++/handle.h>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
// Base node for a polymorphic list of "extra" data needed
// by various slots.
struct LIBSIGC_API SlotNode
{
void *next_;
SlotNode();
virtual ~SlotNode()=0;
};
 
struct LIBSIGC_API SlotIterator_
{
typedef SlotNode NodeType;
typedef SlotIterator_ Iterator;
NodeType *node_;
 
NodeType* node() {return node_;}
const NodeType* node() const {return node_;}
 
NodeType& operator*()
{return *node_;
}
const NodeType& operator*() const
{return *node_;
}
 
bool operator==(const Iterator& i) const
{return node_==i.node_;
}
bool operator!=(const Iterator& i) const
{return node_!=i.node_;
}
 
Iterator& operator++()
{
if (node_)
node_=(NodeType*)node_->next_;
return *this;
}
 
Iterator operator++(int)
{Iterator tmp=*this;
++*this;
return tmp;
}
 
Iterator& operator= (const Iterator& i)
{
node_=i.node_;
return *this;
}
 
SlotIterator_():node_(0) {}
SlotIterator_(NodeType *node):node_(node) {}
};
 
// This is a list for storing internal data for slots
struct LIBSIGC_API SlotList_
{
typedef SlotNode NodeType;
typedef SlotIterator_ Iterator;
NodeType* head_;
 
Iterator begin() {return ((NodeType*)head_);}
Iterator end() {return Iterator();}
const Iterator begin() const {return ((NodeType*)head_);}
const Iterator end() const {return Iterator();}
 
// this is best used at the begining of list.
Iterator insert_direct(Iterator pos,NodeType *n);
 
void clear();
bool empty() const {return head_==0;}
 
SlotList_():head_(0)
{}
~SlotList_()
{clear();}
 
private:
SlotList_(const SlotList_&);
};
 
 
struct SlotData;
 
// SlotDependent is an internal of SlotData used to unreference the
// Slot when either the sender or receiver have gone away
struct LIBSIGC_API SlotDependent:public ScopeNode
{
struct LIBSIGC_API Dep: public ScopeNode
{
SlotData *parent;
virtual void erase();
Dep() {}
virtual ~Dep();
} dep;
 
ScopeNode* receiver() {return &dep;}
ScopeNode* sender() {return this;}
SlotData* parent() {return dep.parent;}
 
bool connected()
{return (next_!=this);}
 
virtual void erase();
 
void set_parent(SlotData *s)
{dep.parent=s;}
 
SlotDependent(SlotData &s)
{dep.parent=&s;}
 
SlotDependent()
{}
 
virtual ~SlotDependent();
};
 
// common data to all callbacks.
struct Callback_
{
// callback function
void* (*func_)(void*);
 
struct O;
struct C1
{
void* (*f1)(void*);
};
struct C2
{
O* o;
void (O::*v)(void);
};
 
// Object pointer or function pointer
union {C1 a1; C2 a2;};
};
 
// All slots have the same base
struct LIBSIGC_API SlotData:public ObjectScoped
{
typedef SlotList_ List;
 
SlotDependent dep_;
 
ScopeNode* receiver() {return dep_.receiver();}
ScopeNode* sender() {return dep_.sender();}
 
// Called from signals to tell slot object it is connected
// invalidates list and sets weak reference
void connect();
 
List list_;
Callback_ data_;
 
Callback_& callback() {return data_;}
 
SlotData()
{dep_.set_parent(this);}
virtual ~SlotData();
};
 
 
typedef Scopes::Extend SlotExtend;
#ifdef LIBSIGC_MSC
#pragma warning(disable: 4231)
LIBSIGC_TMPL template class LIBSIGC_API Handle<SlotData,SlotExtend>;
#endif
class LIBSIGC_API Connection:protected Handle<SlotData,SlotExtend>
{
typedef Handle<SlotData,SlotExtend> Base;
public:
// hides virtual method
void disconnect() {if (obj()) obj()->invalid();}
bool connected() {return Base::connected ();}
 
Connection():Base() {}
Connection(SlotData *s):Base(s) {}
Connection(const Connection& s):Base(s) { }
~Connection() {}
};
 
// possible casts of Callback
template <class C,class F>
struct CallDataFunc
{
C callback;
F func;
};
 
template <class C,class O>
struct CallDataObj2
{
C callback;
O *obj;
};
 
template <class C,class O,class F>
struct CallDataObj3
{
C callback;
O* obj;
F func;
};
 
// from Abstract_Slots we build abstract slots
// with various lengths of arguments
// A slot is not concrete til it has a call
 
 
 
/****************************************************************
***** Abstract Slot 0
****************************************************************/
 
template <class R>
struct Callback0:public Callback_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef Trait<R>::type RType;
#endif
typedef RType (*Func)(void*);
inline RType call()
{return ((Func)(func_))((void*)this);}
inline RType operator()()
{return ((Func)(func_))((void*)this);}
};
 
template <class R>
class Slot0
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback0<R> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot0() {}
Slot0(SlotData *s):Base(s) {}
Slot0(const Slot0& s):Base(s.obj()) {}
 
inline RType call()
{
if (connected())
return ((Callback&)(data()->callback())).call();
return RType();
}
inline RType operator()()
{
if (connected())
return ((Callback&)(data()->callback())).call();
return RType();
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
 
template <>
struct Callback0<void>:public Callback_
{
typedef void RType;
typedef RType (*Func)(void*);
inline RType call()
{((Func)(func_))((void*)this);}
inline RType operator()()
{((Func)(func_))((void*)this);}
};
 
template <>
class Slot0<void>
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback0<void> Callback;
typedef Callback::RType RType;
typedef RType (*Func)(void*);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot0() {}
Slot0(SlotData *s):Base(s) {}
Slot0(const Slot0& s):Base(s.obj()) {}
 
inline RType call()
{
if (connected())
 
((Callback&)(data()->callback())).call();
}
inline RType operator()()
{
if (connected())
 
((Callback&)(data()->callback())).call();
}
};
 
#endif
#endif
 
 
/****************************************************************
***** Abstract Slot 1
****************************************************************/
 
template <class R,class P1>
struct Callback1:public Callback_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef Trait<R>::type RType;
#endif
typedef RType (*Func)(void*,P1);
inline RType call(typename Trait<P1>::ref p1)
{return ((Func)(func_))((void*)this,p1);}
inline RType operator()(typename Trait<P1>::ref p1)
{return ((Func)(func_))((void*)this,p1);}
};
 
template <class R,class P1>
class Slot1
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback1<R,P1> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot1() {}
Slot1(SlotData *s):Base(s) {}
Slot1(const Slot1& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1);
return RType();
}
inline RType operator()(typename Trait<P1>::ref p1)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1);
return RType();
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
 
template <class P1>
struct Callback1<void,P1>:public Callback_
{
typedef void RType;
typedef RType (*Func)(void*,P1);
inline RType call(typename Trait<P1>::ref p1)
{((Func)(func_))((void*)this,p1);}
inline RType operator()(typename Trait<P1>::ref p1)
{((Func)(func_))((void*)this,p1);}
};
 
template <class P1>
class Slot1<void,P1>
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback1<void,P1> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot1() {}
Slot1(SlotData *s):Base(s) {}
Slot1(const Slot1& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1);
}
inline RType operator()(typename Trait<P1>::ref p1)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1);
}
};
 
#endif
#endif
 
 
/****************************************************************
***** Abstract Slot 2
****************************************************************/
 
template <class R,class P1,class P2>
struct Callback2:public Callback_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef Trait<R>::type RType;
#endif
typedef RType (*Func)(void*,P1,P2);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{return ((Func)(func_))((void*)this,p1,p2);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{return ((Func)(func_))((void*)this,p1,p2);}
};
 
template <class R,class P1,class P2>
class Slot2
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback2<R,P1,P2> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot2() {}
Slot2(SlotData *s):Base(s) {}
Slot2(const Slot2& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2);
return RType();
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2);
return RType();
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
 
template <class P1,class P2>
struct Callback2<void,P1,P2>:public Callback_
{
typedef void RType;
typedef RType (*Func)(void*,P1,P2);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{((Func)(func_))((void*)this,p1,p2);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{((Func)(func_))((void*)this,p1,p2);}
};
 
template <class P1,class P2>
class Slot2<void,P1,P2>
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback2<void,P1,P2> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot2() {}
Slot2(SlotData *s):Base(s) {}
Slot2(const Slot2& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2);
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2);
}
};
 
#endif
#endif
 
 
/****************************************************************
***** Abstract Slot 3
****************************************************************/
 
template <class R,class P1,class P2,class P3>
struct Callback3:public Callback_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef Trait<R>::type RType;
#endif
typedef RType (*Func)(void*,P1,P2,P3);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{return ((Func)(func_))((void*)this,p1,p2,p3);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{return ((Func)(func_))((void*)this,p1,p2,p3);}
};
 
template <class R,class P1,class P2,class P3>
class Slot3
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback3<R,P1,P2,P3> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2,P3);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot3() {}
Slot3(SlotData *s):Base(s) {}
Slot3(const Slot3& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2,p3);
return RType();
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2,p3);
return RType();
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
 
template <class P1,class P2,class P3>
struct Callback3<void,P1,P2,P3>:public Callback_
{
typedef void RType;
typedef RType (*Func)(void*,P1,P2,P3);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{((Func)(func_))((void*)this,p1,p2,p3);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{((Func)(func_))((void*)this,p1,p2,p3);}
};
 
template <class P1,class P2,class P3>
class Slot3<void,P1,P2,P3>
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback3<void,P1,P2,P3> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2,P3);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot3() {}
Slot3(SlotData *s):Base(s) {}
Slot3(const Slot3& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2,p3);
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2,p3);
}
};
 
#endif
#endif
 
 
/****************************************************************
***** Abstract Slot 4
****************************************************************/
 
template <class R,class P1,class P2,class P3,class P4>
struct Callback4:public Callback_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef Trait<R>::type RType;
#endif
typedef RType (*Func)(void*,P1,P2,P3,P4);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{return ((Func)(func_))((void*)this,p1,p2,p3,p4);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{return ((Func)(func_))((void*)this,p1,p2,p3,p4);}
};
 
template <class R,class P1,class P2,class P3,class P4>
class Slot4
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback4<R,P1,P2,P3,P4> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2,P3,P4);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot4() {}
Slot4(SlotData *s):Base(s) {}
Slot4(const Slot4& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2,p3,p4);
return RType();
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2,p3,p4);
return RType();
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
 
template <class P1,class P2,class P3,class P4>
struct Callback4<void,P1,P2,P3,P4>:public Callback_
{
typedef void RType;
typedef RType (*Func)(void*,P1,P2,P3,P4);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{((Func)(func_))((void*)this,p1,p2,p3,p4);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{((Func)(func_))((void*)this,p1,p2,p3,p4);}
};
 
template <class P1,class P2,class P3,class P4>
class Slot4<void,P1,P2,P3,P4>
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback4<void,P1,P2,P3,P4> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2,P3,P4);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot4() {}
Slot4(SlotData *s):Base(s) {}
Slot4(const Slot4& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2,p3,p4);
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2,p3,p4);
}
};
 
#endif
#endif
 
 
/****************************************************************
***** Abstract Slot 5
****************************************************************/
 
template <class R,class P1,class P2,class P3,class P4,class P5>
struct Callback5:public Callback_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef Trait<R>::type RType;
#endif
typedef RType (*Func)(void*,P1,P2,P3,P4,P5);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5);}
};
 
template <class R,class P1,class P2,class P3,class P4,class P5>
class Slot5
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback5<R,P1,P2,P3,P4,P5> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2,P3,P4,P5);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot5() {}
Slot5(SlotData *s):Base(s) {}
Slot5(const Slot5& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5);
return RType();
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5);
return RType();
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
 
template <class P1,class P2,class P3,class P4,class P5>
struct Callback5<void,P1,P2,P3,P4,P5>:public Callback_
{
typedef void RType;
typedef RType (*Func)(void*,P1,P2,P3,P4,P5);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{((Func)(func_))((void*)this,p1,p2,p3,p4,p5);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{((Func)(func_))((void*)this,p1,p2,p3,p4,p5);}
};
 
template <class P1,class P2,class P3,class P4,class P5>
class Slot5<void,P1,P2,P3,P4,P5>
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback5<void,P1,P2,P3,P4,P5> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2,P3,P4,P5);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot5() {}
Slot5(SlotData *s):Base(s) {}
Slot5(const Slot5& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5);
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5);
}
};
 
#endif
#endif
 
 
/****************************************************************
***** Abstract Slot 6
****************************************************************/
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6>
struct Callback6:public Callback_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef Trait<R>::type RType;
#endif
typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6);}
};
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6>
class Slot6
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback6<R,P1,P2,P3,P4,P5,P6> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot6() {}
Slot6(SlotData *s):Base(s) {}
Slot6(const Slot6& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6);
return RType();
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6);
return RType();
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
 
template <class P1,class P2,class P3,class P4,class P5,class P6>
struct Callback6<void,P1,P2,P3,P4,P5,P6>:public Callback_
{
typedef void RType;
typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6);}
};
 
template <class P1,class P2,class P3,class P4,class P5,class P6>
class Slot6<void,P1,P2,P3,P4,P5,P6>
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback6<void,P1,P2,P3,P4,P5,P6> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot6() {}
Slot6(SlotData *s):Base(s) {}
Slot6(const Slot6& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6);
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6);
}
};
 
#endif
#endif
 
 
/****************************************************************
***** Abstract Slot 7
****************************************************************/
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7>
struct Callback7:public Callback_
{
#ifdef SIGC_CXX_PARTIAL_SPEC
typedef R RType;
#else
typedef Trait<R>::type RType;
#endif
typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6,P7);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6,p7);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{return ((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6,p7);}
};
 
template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7>
class Slot7
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback7<R,P1,P2,P3,P4,P5,P6,P7> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6,P7);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot7() {}
Slot7(SlotData *s):Base(s) {}
Slot7(const Slot7& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6,p7);
return RType();
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{
if (connected())
return ((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6,p7);
return RType();
}
};
 
 
#ifndef SIGC_CXX_VOID_RETURN
#ifdef SIGC_CXX_PARTIAL_SPEC
 
template <class P1,class P2,class P3,class P4,class P5,class P6,class P7>
struct Callback7<void,P1,P2,P3,P4,P5,P6,P7>:public Callback_
{
typedef void RType;
typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6,P7);
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6,p7);}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{((Func)(func_))((void*)this,p1,p2,p3,p4,p5,p6,p7);}
};
 
template <class P1,class P2,class P3,class P4,class P5,class P6,class P7>
class Slot7<void,P1,P2,P3,P4,P5,P6,P7>
:public Handle<SlotData,SlotExtend>
{
public:
typedef Handle<SlotData,SlotExtend> Base;
typedef Callback7<void,P1,P2,P3,P4,P5,P6,P7> Callback;
typedef typename Callback::RType RType;
typedef RType (*Func)(void*,P1,P2,P3,P4,P5,P6,P7);
 
SlotData* data() const {return (SlotData*)(scope_.object());}
 
Slot7() {}
Slot7(SlotData *s):Base(s) {}
Slot7(const Slot7& s):Base(s.obj()) {}
 
inline RType call(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6,p7);
}
inline RType operator()(typename Trait<P1>::ref p1,typename Trait<P2>::ref p2,typename Trait<P3>::ref p3,typename Trait<P4>::ref p4,typename Trait<P5>::ref p5,typename Trait<P6>::ref p6,typename Trait<P7>::ref p7)
{
if (connected())
 
((Callback&)(data()->callback())).call(p1,p2,p3,p4,p5,p6,p7);
}
};
 
#endif
#endif
 
 
 
#ifdef SIGC_CXX_NAMESPACES
} // namespace
#endif
 
#endif // SIGCXX_SLOT_H
/contrib/media/updf/include/sigc++/thread.h
0,0 → 1,242
// -*- c++ -*-
/*
* Copyright 1999 Karl Nelson <kenelson@ece.ucdavis.edu>
*
* 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 SIGCXX_THREAD_H
#define SIGCXX_THREAD_H
#include <sigc++config.h>
 
#ifdef SIGC_PTHREADS
 
#ifdef SIGC_THREAD_IMPL
#include <pthread.h>
#else
#include <time.h>
#endif
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
namespace Threads
{
#else
#define Threads
#endif
 
#ifdef SIGC_THREAD_IMPL
#ifdef SIGC_PTHREAD_DCE
struct CondAttr { pthread_condattr_t impl_;};
struct MutexAttr { pthread_mutexattr_t impl_;};
struct ThreadAttr { pthread_attr_t impl_;};
#else
struct CondAttr { pthread_condattr_t* impl_;};
struct MutexAttr { pthread_mutexattr_t* impl_;};
struct ThreadAttr { pthread_attr_t* impl_;};
#endif
typedef pthread_mutex_t MutexImpl;
typedef pthread_cond_t CondImpl;
typedef pthread_key_t KeyImpl;
typedef pthread_t ThreadImpl;
#else
class CondAttr {unsigned char dummy[SIGC_PTHREAD_COND_ATTR];};
class CondImpl {unsigned char dummy[SIGC_PTHREAD_COND_IMPL];};
class MutexAttr {unsigned char dummy[SIGC_PTHREAD_MUTEX_ATTR];};
class MutexImpl {unsigned char dummy[SIGC_PTHREAD_MUTEX_IMPL];};
class ThreadAttr {unsigned char dummy[SIGC_PTHREAD_THREAD_ATTR];};
class ThreadImpl {unsigned char dummy[SIGC_PTHREAD_THREAD_IMPL];};
class KeyImpl {unsigned char dummy[SIGC_PTHREAD_KEY_IMPL];};
#endif
 
// Mutual Exclusion
class Mutex
{
typedef MutexImpl Impl;
private:
Impl mutex_;
int destroy();
 
public:
static MutexAttr Default;
#ifdef SIGC_THREAD_IMPL
operator Impl* () {return (Impl*)(&mutex_);}
#endif
 
Mutex(const MutexAttr attr=Default);
 
// (needs work)
~Mutex();
 
int lock();
int trylock();
int unlock();
};
 
// A lazy way to unlock at end of scope
struct MLock
{
Mutex &mutex_;
MLock(Mutex& mutex):mutex_(mutex) {mutex_.lock();}
~MLock() {mutex_.unlock();}
};
 
// Condition Variable
struct Condition
{
typedef CondImpl Impl;
private:
Impl cond_;
 
int destroy();
public:
static CondAttr Default;
#ifdef SIGC_THREAD_IMPL
operator Impl* () {return (Impl*)(&cond_);}
#endif
 
Condition(const CondAttr &attr=Default);
~Condition();
 
// restarts exactly one thread hung on condition
int signal();
 
// restarts all threads waiting on condition
int broadcast();
 
// unlocks a mutex while waiting on a condition, then reaquires lock.
int wait(Mutex &m);
 
// unlocks a mutex while waiting on a condition, then reaquires lock
// with a fixed maximum duration.
int wait(Mutex &m,struct timespec* spec);
 
};
 
// Integer Semaphore
struct Semaphore
{
int value_;
Condition sig_;
Mutex access_;
 
void up();
void down();
Semaphore(int value=1);
~Semaphore();
};
 
struct Private_
{
KeyImpl key_;
void* get();
void set(void *value);
void create(void (*dtor)(void*));
void destroy();
};
 
// Private is a thread split static.
template <class T>
class Private : private Private_
{
private:
static void dtor(void* v)
{
T* obj=(T*)v;
delete obj;
}
 
public:
 
T& operator =(const T& t)
{return (((T&)*this)=t);}
 
operator T& ()
{
T *value=(T*)get();
if (!value)
set((void*)(value=new T()));
return *(value);
}
 
Private() { create(&dtor); }
~Private() { destroy(); }
};
 
// int needs to initialized
template <>
class Private<int> : private Private_
{
private:
static void dtor(void* v)
{
int* obj=(int*)v;
delete obj;
}
 
public:
int& operator =(const int& t)
{return (((int&)*this)=t);}
 
operator int& ()
{
int *value=(int*)get();
if (!value)
set((void*)(value=new int(0)));
return *(value);
}
 
Private() { create(&dtor); }
~Private() { destroy(); }
};
 
struct Thread
{
protected:
typedef ThreadImpl Impl;
Impl thread_;
void* arg_;
ThreadAttr attr_;
 
static void* call_main_(void* obj);
 
public:
#ifdef SIGC_THREAD_IMPL
operator Impl* () {return &thread_;}
#endif
 
virtual void* main(void*)=0;
int detach();
 
static ThreadAttr Default;
 
// arg is for passing extra data to main, but never pass a
// local variable or address of local variable. Arg must
// be available throughout life of program.
int start(void* arg=0);
Thread(const ThreadAttr &attr=Default);
virtual ~Thread();
};
 
 
#ifdef SIGC_CXX_NAMESPACES
} /* namespace Threads */
} /* namespace SigC */
#endif
 
#endif /* SIGC_PTHREADS */
#endif /* SIGCXX_THREAD_H */
/contrib/media/updf/include/sigc++/type.h
0,0 → 1,63
// -*- c++ -*-
/*
* Copyright 1999 Karl Nelson <kenelson@ece.ucdavis.edu>
*
* 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 SIGCXX_TYPE_H
#define SIGCXX_TYPE_H
 
#include <sigc++config.h>
 
#ifdef SIGC_CXX_NAMESPACES
namespace SigC
{
#endif
 
/* some classes for making parameter passing easier */
 
#ifdef SIGC_CXX_SPECIALIZE_REFERENCES
template <typename T>
struct Trait
{
typedef const T& ref;
typedef T type;
};
 
template <typename T>
struct Trait<T&>
{
typedef T& ref;
typedef T& type;
};
#else
template <typename T>
struct Trait
{
typedef T ref; // VC++ does not support reference typedef
typedef T type;
};
#endif
 
template <>
struct Trait<void>:public Trait<int>
{};
 
 
#ifdef SIGC_CXX_NAMESPACES
}
#endif
 
#endif
/contrib/media/updf/include/signal.h
0,0 → 1,22
/*---------------------------------------------------------------------------*/
/* signal.h - signal header file */
/*---------------------------------------------------------------------------*/
#define SIGINT 1
#define SIGILL 2
#define SIGFPE 3
#define SIGSEGV 4
#define SIGTERM 5
#define SIGBREAK 6
#define SIGABRT 7
 
typedef void (* PFSIG)(int);
 
#define SIG_DFL ((PFSIG)0)
#define SIG_IGN ((PFSIG)1)
#define SIG_ERR ((PFSIG)-1)
 
/*---------------------------------------------------------------------------*/
/* function prototypes */
/*---------------------------------------------------------------------------*/
int raise(int sig);
PFSIG signal(int, PFSIG);
/contrib/media/updf/include/sstream
0,0 → 1,6
#ifndef _SSTREAM_INCLUDED
#define _SSTREAM_INCLUDED
/*namespace std
{
}*/
#endif
/contrib/media/updf/include/stack
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_STACK
#include <bits/std_stack.h>
#endif
/contrib/media/updf/include/standard.h
0,0 → 1,92
 
#ifndef __standard_h__
#define __standard_h__
 
#include "yacasbase.h"
#include "lispobject.h"
#include "lispenvironment.h"
#include "lisphash.h"
#include "lispatom.h"
#include "numbers.h"
 
// Prototypes
class LispHashTable;
 
LispBoolean InternalIsList(LispPtr& aPtr);
LispBoolean InternalIsString(LispString * aOriginal);
void InternalUnstringify(LispString& aResult, LispString * aOriginal);
void InternalStringify(LispString& aResult, LispString * aOriginal);
void InternalIntToAscii(LispChar * aTrg,LispInt aInt);
LispInt InternalAsciiToInt(LispString * aString);
LispBoolean IsNumber(const LispChar * ptr,LispBoolean aAllowFloat);
 
void InternalNth(LispPtr& aResult, LispPtr& aArg, LispInt n);
void InternalTail(LispPtr& aResult, LispPtr& aArg);
void InternalAssociate(LispPtr& aResult, LispPtr& aKey,
LispPtr& aAssociationList);
 
void InternalReverseList(LispPtr& aResult, LispPtr& aOriginal);
void InternalFlatCopy(LispPtr& aResult, LispPtr& aOriginal);
LispInt InternalListLength(LispPtr& aOriginal);
 
LispBoolean InternalEquals(LispEnvironment& aEnvironment,
LispPtr& aExpression1,
LispPtr& aExpression2);
 
 
inline LispPtr& Argument(LispPtr& cur, LispInt n);
 
inline void InternalTrue(LispEnvironment& aEnvironment, LispPtr& aResult);
inline void InternalFalse(LispEnvironment& aEnvironment, LispPtr& aResult);
inline void InternalBoolean(LispEnvironment& aEnvironment, LispPtr& aResult,
LispBoolean aValue);
inline LispBoolean IsTrue(LispEnvironment& aEnvironment, LispPtr& aExpression);
inline LispBoolean IsFalse(LispEnvironment& aEnvironment, LispPtr& aExpression);
inline void InternalNot(LispPtr& aResult, LispEnvironment& aEnvironment, LispPtr& aExpression);
 
void DoInternalLoad(LispEnvironment& aEnvironment,LispInput* aInput);
void InternalLoad(LispEnvironment& aEnvironment,LispString * aFileName);
void InternalUse(LispEnvironment& aEnvironment,LispString * aFileName);
void InternalApplyString(LispEnvironment& aEnvironment, LispPtr& aResult,
LispString * aOperator,LispPtr& aArgs);
void InternalApplyPure(LispPtr& oper,LispPtr& args2,LispPtr& aResult,LispEnvironment& aEnvironment);
 
void InternalEvalString(LispEnvironment& aEnvironment, LispPtr& aResult,
LispChar * aString);
 
#define ATOML(_s) LispAtom::New(aEnvironment,_s)
#define LIST(_c) LispSubList::New(_c)
class LispObjectAdder : public YacasBase
{
public:
LispObjectAdder(LispObject* aPtr)
: iPtr(aPtr) {};
LispObject* iPtr;
};
#define LA(_o) LispObjectAdder(_o)
 
LispObject* operator+(const LispObjectAdder& left, const LispObjectAdder& right);
 
#define PARSE(_r,_s) ParseExpression(_r,_s,aEnvironment)
void ParseExpression(LispPtr& aResult,LispChar * aString,LispEnvironment& aEnvironment);
 
void ReturnUnEvaluated(LispPtr& aResult,LispPtr& aArguments,
LispEnvironment& aEnvironment);
 
/** PrintExpression : print an expression into a string,
limiting it to a maximum number of characters. If aMaxChars
is less than zero, the result is not truncated.
*/
void PrintExpression(LispString& aResult, LispPtr& aExpression,
LispEnvironment& aEnvironment,
LispInt aMaxChars);
 
LispString * SymbolName(LispEnvironment& aEnvironment,LispChar * aSymbol);
 
 
 
 
#include "standard.inl"
 
 
#endif
/contrib/media/updf/include/std/algorithm
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_ALGORITHM
#include <bits/std_algorithm.h>
#endif
/contrib/media/updf/include/std/bitset
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_BITSET
#include <bits/std_bitset.h>
#endif
/contrib/media/updf/include/std/cassert
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
// This one should not have include guards.
#include <bits/std_cassert.h>
 
/contrib/media/updf/include/std/cctype
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CCTYPE
#include <bits/std_cctype.h>
#endif
/contrib/media/updf/include/std/cerrno
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CERRNO
#include <bits/std_cerrno.h>
#endif
/contrib/media/updf/include/std/cfloat
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CFLOAT
#include <bits/std_cfloat.h>
#endif
/contrib/media/updf/include/std/ciso646
0,0 → 1,28
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/contrib/media/updf/include/std/climits
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CLIMITS
#include <bits/std_climits.h>
#endif
/contrib/media/updf/include/std/clocale
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CLOCALE
#include <bits/std_clocale.h>
#endif
/contrib/media/updf/include/std/cmath
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CMATH
#include <bits/std_cmath.h>
#endif
/contrib/media/updf/include/std/complex
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_COMPLEX
#include <bits/std_complex.h>
#endif
/contrib/media/updf/include/std/csetjmp
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSETJMP
#include <bits/std_csetjmp.h>
#endif
/contrib/media/updf/include/std/csignal
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSIGNAL
#include <bits/std_csignal.h>
#endif
/contrib/media/updf/include/std/cstdarg
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSTDARG
#include <bits/std_cstdarg.h>
#endif
/contrib/media/updf/include/std/cstddef
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSTDDEF
#include <bits/std_cstddef.h>
#endif
/contrib/media/updf/include/std/cstdio
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSTDIO
#include <bits/std_cstdio.h>
#endif
/contrib/media/updf/include/std/cstdlib
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSTDLIB
#include <bits/std_cstdlib.h>
#endif
/contrib/media/updf/include/std/cstring
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CSTRING
#include <bits/std_cstring.h>
#endif
/contrib/media/updf/include/std/ctime
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CTIME
#include <bits/std_ctime.h>
#endif
/contrib/media/updf/include/std/cwchar
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CWCHAR
#include <bits/std_cwchar.h>
#endif
/contrib/media/updf/include/std/cwctype
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_CWCTYPE
#include <bits/std_cwctype.h>
#endif
/contrib/media/updf/include/std/deque
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_DEQUE
#include <bits/std_deque.h>
#endif
/contrib/media/updf/include/std/fstream
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_FSTREAM
#include <bits/std_fstream.h>
#endif
/contrib/media/updf/include/std/functional
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_FUNCTIONAL
#include <bits/std_functional.h>
#endif
/contrib/media/updf/include/std/iomanip
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_IOMANIP
#include <bits/std_iomanip.h>
#endif
/contrib/media/updf/include/std/ios
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_IOS
#include <bits/std_ios.h>
#endif
/contrib/media/updf/include/std/iosfwd
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_IOSFWD
#include <bits/std_iosfwd.h>
#endif
/contrib/media/updf/include/std/iostream
0,0 → 1,34
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_IOSTREAM
#include <bits/std_iostream.h>
#endif
 
 
/contrib/media/updf/include/std/istream
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_ISTREAM
#include <bits/std_istream.h>
#endif
/contrib/media/updf/include/std/iterator
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_ITERATOR
#include <bits/std_iterator.h>
#endif
/contrib/media/updf/include/std/limits
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_LIMITS
#include <bits/std_limits.h>
#endif
/contrib/media/updf/include/std/list
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_LIST
#include <bits/std_list.h>
#endif
/contrib/media/updf/include/std/locale
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_LOCALE
#include <bits/std_locale.h>
#endif
/contrib/media/updf/include/std/map
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_MAP
#include <bits/std_map.h>
#endif
/contrib/media/updf/include/std/memory
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_MEMORY
#include <bits/std_memory.h>
#endif
/contrib/media/updf/include/std/numeric
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_NUMERIC
#include <bits/std_numeric.h>
#endif
/contrib/media/updf/include/std/ostream
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_OSTREAM
#include <bits/std_ostream.h>
#endif
/contrib/media/updf/include/std/queue
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_QUEUE
#include <bits/std_queue.h>
#endif
/contrib/media/updf/include/std/set
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_SET
#include <bits/std_set.h>
#endif
/contrib/media/updf/include/std/sstream
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_SSTREAM
#include <bits/std_sstream.h>
#endif
/contrib/media/updf/include/std/stack
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_STACK
#include <bits/std_stack.h>
#endif
/contrib/media/updf/include/std/stdexcept
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_STDEXCEPT
#include <bits/std_stdexcept.h>
#endif
/contrib/media/updf/include/std/streambuf
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_STREAMBUF
#include <bits/std_streambuf.h>
#endif
/contrib/media/updf/include/std/string
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_STRING
#include <bits/std_string.h>
#endif
/contrib/media/updf/include/std/utility
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_UTILITY
#include <bits/std_utility.h>
#endif
/contrib/media/updf/include/std/valarray
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_VALARRAY
#include <bits/std_valarray.h>
#endif
/contrib/media/updf/include/std/vector
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_VECTOR
#include <bits/std_vector.h>
#endif
/contrib/media/updf/include/std.h
0,0 → 1,30
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_std_h_
#define __dj_include_std_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_std_h_ */
/contrib/media/updf/include/stdarg.h
0,0 → 1,54
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_stdarg_h_
#define __dj_include_stdarg_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifdef __dj_include_varargs_h_
#error stdarg.h and varargs.h are mutually exclusive
#endif
 
#include <sys/djtypes.h>
 
__DJ_va_list
#undef __DJ_va_list
#define __DJ_va_list
#define __dj_va_rounded_size(T) \
(((sizeof (T) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
 
#define va_arg(ap, T) \
(ap = (va_list) ((char *) (ap) + __dj_va_rounded_size (T)), \
*((T *) (void *) ((char *) (ap) - __dj_va_rounded_size (T))))
 
#define va_end(ap)
 
#ifdef __GNUC__
#define va_start(ap, last_arg) \
(ap = ((va_list) __builtin_next_arg (last_arg)))
#else
#define va_start(ap, last_arg) \
(ap = (va_list) ((char*) &(last_arg) + __dj_va_rounded_size (last_arg)))
#endif
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_stdarg_h_ */
/contrib/media/updf/include/stdbool.h
0,0 → 1,13
#ifndef _STDBOOL_H
#define _STDBOOL_H
 
/* believe it or not but the Single Unix Specification actually
* specifies this header, see
* http://www.opengroup.org/onlinepubs/007904975/basedefs/stdbool.h.html */
 
#define bool int
#define true 1
#define false 0
#define __bool_true_false_are_defined 1
 
#endif
/contrib/media/updf/include/stdcommandline.h
0,0 → 1,36
 
#ifndef __stdcommandline_h__
#define __stdcommandline_h__
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <signal.h>
#ifndef WIN32
# include <unistd.h>
# include <termios.h>
#endif
#include <time.h>
 
#include "yacasbase.h"
#include "commandline.h"
/** Simple no-frills implementation of CCommandLine, using stdlibc-functions
* only, and no ansi characters. No history is supported either.
*/
class CStdCommandLine : public CCommandLine
{
public:
CStdCommandLine();
~CStdCommandLine();
virtual void ReadLine(LispChar * prompt);
public:
virtual LispInt GetKey();
virtual void NewLine();
virtual void ShowLine(LispChar * prompt,LispInt promptlen,LispInt cursor);
virtual void Pause();
};
 
 
#endif
 
/contrib/media/updf/include/stddef.h
0,0 → 1,39
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_stddef_h_
#define __dj_include_stddef_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include <sys/djtypes.h>
#define NULL 0
#define offsetof(s_type, mbr) ((size_t) &((s_type *)0)->mbr)
typedef int ptrdiff_t;
 
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
__DJ_wchar_t
#undef __DJ_wchar_t
#define __DJ_wchar_t
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_stddef_h_ */
/contrib/media/updf/include/stdexcept
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_STDEXCEPT
#include <bits/std_stdexcept.h>
#endif
/contrib/media/updf/include/stdfileio.h
0,0 → 1,18
/** \file stdfileioio.h
* definitions of input output classes that read and write from file.
*/
 
 
#ifndef __stdfileio_h__
#define __stdfileio_h__
 
#include "yacasbase.h"
#include "lispio.h"
#include "lispenvironment.h"
 
 
#include "platfileio.h"
 
 
#endif
 
/contrib/media/updf/include/stdint.h
0,0 → 1,312
/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
 
The GNU C 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.1 of the License, or (at your option) any later version.
 
The GNU C 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 the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
 
/*
* ISO C99: 7.18 Integer types <stdint.h>
*/
 
#ifndef _STDINT_H
#define _STDINT_H 1
 
#include <features.h>
#include <bits/wchar.h>
#include <bits/wordsize.h>
 
/* Exact integral types. */
 
/* Signed. */
 
/* There is some amount of overlap with <sys/types.h> as known by inet code */
#ifndef __int8_t_defined
#define __int8_t_defined
typedef signed char int8_t;
typedef short int int16_t;
typedef int int32_t;
# if __WORDSIZE == 64
typedef long int int64_t;
# else
typedef long long int int64_t;
# endif
#endif
 
/* Unsigned. */
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
# define __uint32_t_defined
#endif
#if __WORDSIZE == 64
typedef unsigned long int uint64_t;
#else
typedef unsigned long long int uint64_t;
#endif
 
 
/* Small types. */
 
/* Signed. */
typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef int int_least32_t;
#if __WORDSIZE == 64
typedef long int int_least64_t;
#else
typedef long long int int_least64_t;
#endif
 
/* Unsigned. */
typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;
#if __WORDSIZE == 64
typedef unsigned long int uint_least64_t;
#else
typedef unsigned long long int uint_least64_t;
#endif
 
 
/* Fast types. */
 
/* Signed. */
typedef signed char int_fast8_t;
#if __WORDSIZE == 64
typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
#else
typedef int int_fast16_t;
typedef int int_fast32_t;
typedef long long int int_fast64_t;
#endif
 
/* Unsigned. */
typedef unsigned char uint_fast8_t;
#if __WORDSIZE == 64
typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
#else
typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
typedef unsigned long long int uint_fast64_t;
#endif
 
 
/* Types for `void *' pointers. */
#if __WORDSIZE == 64
# ifndef __intptr_t_defined
typedef long int intptr_t;
# define __intptr_t_defined
# endif
typedef unsigned long int uintptr_t;
#else
# ifndef __intptr_t_defined
typedef int intptr_t;
# define __intptr_t_defined
# endif
typedef unsigned int uintptr_t;
#endif
 
 
/* Largest integral types. */
#if __WORDSIZE == 64
typedef long int intmax_t;
typedef unsigned long int uintmax_t;
#else
typedef long long int intmax_t;
typedef unsigned long long int uintmax_t;
#endif
 
 
/* The ISO C99 standard specifies that in C++ implementations these
macros should only be defined if explicitly requested. */
#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
 
# if __WORDSIZE == 64
# define __INT64_C(c) c ## L
# define __UINT64_C(c) c ## UL
# else
# define __INT64_C(c) c ## LL
# define __UINT64_C(c) c ## ULL
# endif
 
/* Limits of integral types. */
 
/* Minimum of signed integral types. */
# define INT8_MIN (-128)
# define INT16_MIN (-32767-1)
# define INT32_MIN (-2147483647-1)
# define INT64_MIN (-__INT64_C(9223372036854775807)-1)
/* Maximum of signed integral types. */
# define INT8_MAX (127)
# define INT16_MAX (32767)
# define INT32_MAX (2147483647)
# define INT64_MAX (__INT64_C(9223372036854775807))
 
/* Maximum of unsigned integral types. */
# define UINT8_MAX (255)
# define UINT16_MAX (65535)
# define UINT32_MAX (4294967295U)
# define UINT64_MAX (__UINT64_C(18446744073709551615))
 
 
/* Minimum of signed integral types having a minimum size. */
# define INT_LEAST8_MIN (-128)
# define INT_LEAST16_MIN (-32767-1)
# define INT_LEAST32_MIN (-2147483647-1)
# define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1)
/* Maximum of signed integral types having a minimum size. */
# define INT_LEAST8_MAX (127)
# define INT_LEAST16_MAX (32767)
# define INT_LEAST32_MAX (2147483647)
# define INT_LEAST64_MAX (__INT64_C(9223372036854775807))
 
/* Maximum of unsigned integral types having a minimum size. */
# define UINT_LEAST8_MAX (255)
# define UINT_LEAST16_MAX (65535)
# define UINT_LEAST32_MAX (4294967295U)
# define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615))
 
 
/* Minimum of fast signed integral types having a minimum size. */
# define INT_FAST8_MIN (-128)
# if __WORDSIZE == 64
# define INT_FAST16_MIN (-9223372036854775807L-1)
# define INT_FAST32_MIN (-9223372036854775807L-1)
# else
# define INT_FAST16_MIN (-2147483647-1)
# define INT_FAST32_MIN (-2147483647-1)
# endif
# define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1)
/* Maximum of fast signed integral types having a minimum size. */
# define INT_FAST8_MAX (127)
# if __WORDSIZE == 64
# define INT_FAST16_MAX (9223372036854775807L)
# define INT_FAST32_MAX (9223372036854775807L)
# else
# define INT_FAST16_MAX (2147483647)
# define INT_FAST32_MAX (2147483647)
# endif
# define INT_FAST64_MAX (__INT64_C(9223372036854775807))
 
/* Maximum of fast unsigned integral types having a minimum size. */
# define UINT_FAST8_MAX (255)
# if __WORDSIZE == 64
# define UINT_FAST16_MAX (18446744073709551615UL)
# define UINT_FAST32_MAX (18446744073709551615UL)
# else
# define UINT_FAST16_MAX (4294967295U)
# define UINT_FAST32_MAX (4294967295U)
# endif
# define UINT_FAST64_MAX (__UINT64_C(18446744073709551615))
 
 
/* Values to test for integral types holding `void *' pointer. */
# if __WORDSIZE == 64
# define INTPTR_MIN (-9223372036854775807L-1)
# define INTPTR_MAX (9223372036854775807L)
# define UINTPTR_MAX (18446744073709551615UL)
# else
# define INTPTR_MIN (-2147483647-1)
# define INTPTR_MAX (2147483647)
# define UINTPTR_MAX (4294967295U)
# endif
 
 
/* Minimum for largest signed integral type. */
# define INTMAX_MIN (-__INT64_C(9223372036854775807)-1)
/* Maximum for largest signed integral type. */
# define INTMAX_MAX (__INT64_C(9223372036854775807))
 
/* Maximum for largest unsigned integral type. */
# define UINTMAX_MAX (__UINT64_C(18446744073709551615))
 
 
/* Limits of other integer types. */
 
/* Limits of `ptrdiff_t' type. */
# if __WORDSIZE == 64
# define PTRDIFF_MIN (-9223372036854775807L-1)
# define PTRDIFF_MAX (9223372036854775807L)
# else
# define PTRDIFF_MIN (-2147483647-1)
# define PTRDIFF_MAX (2147483647)
# endif
 
/* Limits of `sig_atomic_t'. */
# define SIG_ATOMIC_MIN (-2147483647-1)
# define SIG_ATOMIC_MAX (2147483647)
 
/* Limit of `size_t' type. */
# if __WORDSIZE == 64
# define SIZE_MAX (18446744073709551615UL)
# else
# define SIZE_MAX (4294967295U)
# endif
 
/* Limits of `wchar_t'. */
# ifndef WCHAR_MIN
/* These constants might also be defined in <wchar.h>. */
# define WCHAR_MIN __WCHAR_MIN
# define WCHAR_MAX __WCHAR_MAX
# endif
 
/* Limits of `wint_t'. */
# define WINT_MIN (0u)
# define WINT_MAX (4294967295u)
 
#endif /* C++ && limit macros */
 
 
/* The ISO C99 standard specifies that in C++ implementations these
should only be defined if explicitly requested. */
#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
 
/* Signed. */
# define INT8_C(c) c
# define INT16_C(c) c
# define INT32_C(c) c
# if __WORDSIZE == 64
# define INT64_C(c) c ## L
# else
# define INT64_C(c) c ## LL
# endif
 
/* Unsigned. */
# define UINT8_C(c) c ## U
# define UINT16_C(c) c ## U
# define UINT32_C(c) c ## U
# if __WORDSIZE == 64
# define UINT64_C(c) c ## UL
# else
# define UINT64_C(c) c ## ULL
# endif
 
/* Maximal type. */
# if __WORDSIZE == 64
# define INTMAX_C(c) c ## L
# define UINTMAX_C(c) c ## UL
# else
# define INTMAX_C(c) c ## LL
# define UINTMAX_C(c) c ## ULL
# endif
 
#endif /* C++ && constant macros */
 
#endif /* stdint.h */
/contrib/media/updf/include/stdio.h
0,0 → 1,164
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
#ifndef __dj_include_stdio_h_
#define __dj_include_stdio_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include<menuet/os.h>
 
#include<stdarg.h>
 
typedef struct __FILE FILE;
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
 
#include <sys/version.h>
#include <sys/djtypes.h>
#include <dos.h>
 
#define _IOFBF 00001
#define _IONBF 00002
#define _IOLBF 00004
 
/* Some programs think they know better... */
#undef NULL
 
#define BUFSIZ 16384
#define EOF (-1)
#define FILENAME_MAX 260
#define FOPEN_MAX 20
#define L_tmpnam 260
#define NULL 0
#define TMP_MAX 999999
 
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
 
__DJ_va_list
#undef __DJ_va_list
#define __DJ_va_list
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
 
/* Note that the definitions of these fields are NOT guaranteed! They
may change with any release without notice! The fact that they
are here at all is to comply with ANSI specifictions. */
 
#include<bits/stdio.h>
struct __FILE {
int _cnt;
char *_ptr;
char *_base;
int _bufsiz;
int _flag;
int _file;
char *_name_to_remove;
int _fillsize;
struct file_stream_ops * std_ops;
};
 
typedef unsigned long fpos_t;
 
extern FILE __dj_stdin, __dj_stdout, __dj_stderr;
#define stdin (&__dj_stdin)
#define stdout (&__dj_stdout)
#define stderr (&__dj_stderr)
 
void clearerr(FILE *_stream);
int fclose(FILE *_stream);
int feof(FILE *_stream);
int ferror(FILE *_stream);
int fflush(FILE *_stream);
int fgetc(FILE *_stream);
int fgetpos(FILE *_stream, fpos_t *_pos);
char * fgets(char *_s, int _n, FILE *_stream);
FILE * fopen(const char *_filename, const char *_mode);
int fprintf(FILE *_stream, const char *_format, ...);
int fputc(int _c, FILE *_stream);
int fputs(const char *_s, FILE *_stream);
size_t fread(void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
FILE * freopen(const char *_filename, const char *_mode, FILE *_stream);
int fscanf(FILE *_stream, const char *_format, ...);
int fseek(FILE *_stream, long _offset, int _mode);
int fsetpos(FILE *_stream, const fpos_t *_pos);
long ftell(FILE *_stream);
size_t fwrite(const void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
int getc(FILE *_stream);
int getchar(void);
//char * gets(char *_s);
void perror(const char *_s);
//int printf(const char *_format, ...);
int putc(int _c, FILE *_stream);
int putchar(int _c);
int puts(const char *_s);
int remove(const char *_filename);
int rename(const char *_old, const char *_new);
void rewind(FILE *_stream);
int scanf(const char *_format, ...);
void setbuf(FILE *_stream, char *_buf);
int setvbuf(FILE *_stream, char *_buf, int _mode, size_t _size);
int sprintf(char *_s, const char *_format, ...);
int sscanf(const char *_s, const char *_format, ...);
FILE * tmpfile(void);
char * tmpnam(char *_s);
int ungetc(int _c, FILE *_stream);
int vfprintf(FILE *_stream, const char *_format, va_list _ap);
int vprintf(const char *_format, va_list _ap);
int vsprintf(char *_s, const char *_format, va_list _ap);
 
#ifndef __STRICT_ANSI__
 
#define L_ctermid
#define L_cusrid
/* #define STREAM_MAX 20 - DOS can change this */
 
int fileno(FILE *_stream);
FILE * fdopen(int _fildes, const char *_type);
int pclose(FILE *_pf);
FILE * popen(const char *_command, const char *_mode);
 
#ifndef _POSIX_SOURCE
 
extern FILE __dj_stdprn, __dj_stdaux;
#define stdprn (&__dj_stdprn)
#define stdaux (&__dj_stdaux)
 
#define P_tmpdir "c:/"
 
void _djstat_describe_lossage(FILE *_to_where);
int _doprnt(const char *_fmt, va_list _args, FILE *_f);
int _doscan(FILE *_f, const char *_fmt, va_list _argp);
int _doscan_low(FILE *, int (*)(FILE *_get), int (*_unget)(int, FILE *), const char *_fmt, va_list _argp);
int fpurge(FILE *_f);
int getw(FILE *_f);
int mkstemp(char *_template);
char * mktemp(char *_template);
int putw(int _v, FILE *_f);
void setbuffer(FILE *_f, void *_buf, int _size);
void setlinebuf(FILE *_f);
char * tempnam(const char *_dir, const char *_prefix);
int _rename(const char *_old, const char *_new); /* Simple (no directory) */
int vfscanf(FILE *_stream, const char *_format, va_list _ap);
int vscanf(const char *_format, va_list _ap);
int vsscanf(const char *_s, const char *_format, va_list _ap);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_stdio_h_ */
/contrib/media/updf/include/stdio_.h
0,0 → 1,161
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
#ifndef __dj_include_stdio_h_
#define __dj_include_stdio_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include<menuet/os.h>
typedef struct __FILE FILE;
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
 
#include <sys/version.h>
#include <sys/djtypes.h>
#include <dos.h>
 
#define _IOFBF 00001
#define _IONBF 00002
#define _IOLBF 00004
 
/* Some programs think they know better... */
#undef NULL
 
#define BUFSIZ 16384
#define EOF (-1)
#define FILENAME_MAX 260
#define FOPEN_MAX 20
#define L_tmpnam 260
#define NULL 0
#define TMP_MAX 999999
 
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
 
__DJ_va_list
#undef __DJ_va_list
#define __DJ_va_list
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
 
/* Note that the definitions of these fields are NOT guaranteed! They
may change with any release without notice! The fact that they
are here at all is to comply with ANSI specifictions. */
 
#include<bits/stdio.h>
struct __FILE {
int _cnt;
char *_ptr;
char *_base;
int _bufsiz;
int _flag;
int _file;
char *_name_to_remove;
int _fillsize;
struct file_stream_ops * std_ops;
};
 
typedef unsigned long fpos_t;
 
extern FILE __dj_stdin, __dj_stdout, __dj_stderr;
#define stdin (&__dj_stdin)
#define stdout (&__dj_stdout)
#define stderr (&__dj_stderr)
 
void clearerr(FILE *_stream);
int fclose(FILE *_stream);
int feof(FILE *_stream);
int ferror(FILE *_stream);
int fflush(FILE *_stream);
int fgetc(FILE *_stream);
int fgetpos(FILE *_stream, fpos_t *_pos);
char * fgets(char *_s, int _n, FILE *_stream);
FILE * fopen(const char *_filename, const char *_mode);
int fprintf(FILE *_stream, const char *_format, ...);
int fputc(int _c, FILE *_stream);
int fputs(const char *_s, FILE *_stream);
size_t fread(void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
FILE * freopen(const char *_filename, const char *_mode, FILE *_stream);
int fscanf(FILE *_stream, const char *_format, ...);
int fseek(FILE *_stream, long _offset, int _mode);
int fsetpos(FILE *_stream, const fpos_t *_pos);
long ftell(FILE *_stream);
size_t fwrite(const void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
int getc(FILE *_stream);
int getchar(void);
char * gets(char *_s);
void perror(const char *_s);
int printf(const char *_format, ...);
int putc(int _c, FILE *_stream);
int putchar(int _c);
int puts(const char *_s);
int remove(const char *_filename);
int rename(const char *_old, const char *_new);
void rewind(FILE *_stream);
int scanf(const char *_format, ...);
void setbuf(FILE *_stream, char *_buf);
int setvbuf(FILE *_stream, char *_buf, int _mode, size_t _size);
int sprintf(char *_s, const char *_format, ...);
int sscanf(const char *_s, const char *_format, ...);
FILE * tmpfile(void);
char * tmpnam(char *_s);
int ungetc(int _c, FILE *_stream);
int vfprintf(FILE *_stream, const char *_format, va_list _ap);
int vprintf(const char *_format, va_list _ap);
int vsprintf(char *_s, const char *_format, va_list _ap);
 
#ifndef __STRICT_ANSI__
 
#define L_ctermid
#define L_cusrid
/* #define STREAM_MAX 20 - DOS can change this */
 
int fileno(FILE *_stream);
FILE * fdopen(int _fildes, const char *_type);
int pclose(FILE *_pf);
FILE * popen(const char *_command, const char *_mode);
 
#ifndef _POSIX_SOURCE
 
extern FILE __dj_stdprn, __dj_stdaux;
#define stdprn (&__dj_stdprn)
#define stdaux (&__dj_stdaux)
 
#define P_tmpdir "c:/"
 
void _djstat_describe_lossage(FILE *_to_where);
int _doprnt(const char *_fmt, va_list _args, FILE *_f);
int _doscan(FILE *_f, const char *_fmt, va_list _argp);
int _doscan_low(FILE *, int (*)(FILE *_get), int (*_unget)(int, FILE *), const char *_fmt, va_list _argp);
int fpurge(FILE *_f);
int getw(FILE *_f);
int mkstemp(char *_template);
char * mktemp(char *_template);
int putw(int _v, FILE *_f);
void setbuffer(FILE *_f, void *_buf, int _size);
void setlinebuf(FILE *_f);
char * tempnam(const char *_dir, const char *_prefix);
int _rename(const char *_old, const char *_new); /* Simple (no directory) */
int vfscanf(FILE *_stream, const char *_format, va_list _ap);
int vscanf(const char *_format, va_list _ap);
int vsscanf(const char *_s, const char *_format, va_list _ap);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_stdio_h_ */
/contrib/media/updf/include/stdlib.h
0,0 → 1,154
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_stdlib_h_
#define __dj_include_stdlib_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#include <sys/djtypes.h>
#include <dos.h>
 
/* Some programs think they know better... */
#undef NULL
 
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#define MB_CUR_MAX __dj_mb_cur_max
#define NULL 0
#define RAND_MAX 2147483647
 
extern int __dj_mb_cur_max;
 
typedef struct {
int quot;
int rem;
} div_t;
 
typedef struct {
long quot;
long rem;
} ldiv_t;
 
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
__DJ_wchar_t
#undef __DJ_wchar_t
#define __DJ_wchar_t
 
void abort(void) __attribute__((noreturn));
int abs(int _i);
int atexit(void (*_func)(void));
double atof(const char *_s);
int atoi(const char *_s);
long atol(const char *_s);
void * bsearch(const void *_key, const void *_base, size_t _nelem,
size_t _size, int (*_cmp)(const void *_ck, const void *_ce));
void * calloc(size_t _nelem, size_t _size);
div_t div(int _numer, int _denom);
void exit(int _status) __attribute__((noreturn));
void free(void *_ptr);
char * getenv(const char *_name);
long labs(long _i);
ldiv_t ldiv(long _numer, long _denom);
void * malloc(size_t _size);
int mblen(const char *_s, size_t _n);
size_t mbstowcs(wchar_t *_wcs, const char *_s, size_t _n);
int mbtowc(wchar_t *_pwc, const char *_s, size_t _n);
void qsort(void *_base, size_t _nelem, size_t _size,
int (*_cmp)(const void *_e1, const void *_e2));
int rand(void);
void * realloc(void *_ptr, size_t _size);
void srand(unsigned _seed);
double strtod(const char *_s, char **_endptr);
long strtol(const char *_s, char **_endptr, int _base);
unsigned long strtoul(const char *_s, char **_endptr, int _base);
int system(const char *_s);
size_t wcstombs(char *_s, const wchar_t *_wcs, size_t _n);
int wctomb(char *_s, wchar_t _wchar);
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
typedef struct {
long long quot;
long long rem;
} lldiv_t;
 
void * alloca(size_t _size);
long double _atold(const char *_s);
long long atoll(const char *_s);
void cfree(void *_ptr);
double drand48(void);
char * ecvtbuf(double _val, int _nd, int *_dp, int *_sn, char *_bf);
char * ecvt(double _val, int _nd, int *_dp, int *_sn);
double erand48(unsigned short state[3]);
char * fcvtbuf(double _val, int _nd, int *_dp, int *_sn, char *_bf);
char * fcvt(double _val, int _nd, int *_dp, int *_sn);
char * gcvt(double _val, int _nd, char *_buf);
char * getpass(const char *_prompt);
int getlongpass(const char *_prompt, char *_buffer, int _max_len);
char * itoa(int value, char *buffer, int radix);
long jrand48(unsigned short state[3]);
long long llabs(long long _i);
lldiv_t lldiv(long long _numer, long long _denom);
void lcong48(unsigned short param[7]);
unsigned long lrand48(void);
long mrand48(void);
unsigned long nrand48(unsigned short state[3]);
int putenv(const char *_val);
unsigned short *seed48(unsigned short state_seed[3]);
int setenv(const char *_var, const char *_val, int _replace);
void srand48(long seedval);
int stackavail(void);
long double _strtold(const char *_s, char **_endptr);
long long strtoll(const char *_s, char **_endptr, int _base);
unsigned long long strtoull(const char *_s, char **_endptr, int _base);
void swab(const void *from, void *to, int nbytes);
 
#ifndef alloca
#define alloca __builtin_alloca
#endif
 
/* BSD Random Number Generator */
char * initstate (unsigned _seed, char *_arg_state, int _n);
char * setstate(char *_arg_state);
long random(void);
int srandom(int _seed);
 
/* These vary in expected prototype, so we just don't prototype them.
void xfree(void *_ptr);
void * xmalloc(size_t _size);
void * xrealloc(void *ptr, size_t _size);
*/
 
#define __system_redirect 0x0001 /* redirect internally */
#define __system_call_cmdproc 0x0002 /* always call COMMAND/$SHELL */
#define __system_use_shell 0x0004 /* use $SHELL if set */
#define __system_allow_multiple_cmds 0x0008 /* allow `cmd1; cmd2; ...' */
#define __system_allow_long_cmds 0x0010 /* handle commands > 126 chars */
#define __system_emulate_command 0x0020 /* try to emulate the shell */
#define __system_handle_null_commands 0x1000 /* ignore cmds with no effect */
#define __system_ignore_chdir 0x2000 /* make `cd' be a null command */
#define __system_emulate_chdir 0x4000 /* handle `cd' internally */
 
extern int __system_flags;
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_stdlib_h_ */
/contrib/media/updf/include/streambuf
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_STREAMBUF
#include <bits/std_streambuf.h>
#endif
/contrib/media/updf/include/string
0,0 → 1,253
#ifndef _STRING_INCLUDED
#define _STRING_INCLUDED
#include <stdlib.h>
#include <string.h>
namespace std
{
class string
{
char* data;
public:
string() {data=(char*)malloc(1);data[0]=0;}
string(const char* a)
{
int len=strlen(a)+1;
data=(char*)malloc(len);
memcpy(data,a,len);
}
string(char c)
{
data=(char*)malloc(2);
data[0]=c;data[1]=0;
}
string(const string& s)
{
unsigned sz = s.size()+1;
data=(char*)malloc(sz);
memcpy(data,s.c_str(),sz);
}
~string() {free(data);}
string& operator=(const char* s)
{free(data);unsigned len=strlen(s)+1;data=(char*)malloc(len);
memcpy(data,s,len);return *this;}
string& operator=(const string& s)
{free(data);unsigned len=s.size()+1;data=(char*)malloc(len);
memcpy(data,s.c_str(),len);return *this;}
const char* c_str() const {return data;}
char& operator[](unsigned pos) {return data[pos];}
char operator[](unsigned pos) const {return data[pos];}
unsigned size() const {return strlen(data);}
unsigned length() const {return size();}
bool operator==(const char* str2) const {return !strcmp(data,str2);}
bool operator==(const string& str2) const {return !strcmp(data,str2.data);}
int compare(const char* str2) {return strcmp(data,str2);}
bool operator!=(const char* str2) const {return (bool)strcmp(data,str2);}
string& replace(unsigned p0,unsigned n0,const string& str)
{
unsigned sz = str.size();
char* newdata=(char*)malloc(size()+1+sz-n0);
memcpy(newdata,data,p0);
memcpy(newdata+p0,str.c_str(),sz);
memcpy(newdata+p0+sz,data+p0+n0,size()+1-p0-n0);
free(data);
data=newdata;
return *this;
}
string& insert(size_t posl,const string& str)
{ return replace(posl,0,str); }
string& operator+=(char c)
{
unsigned sz=size();
data=(char*)realloc(data,sz+2);
data[sz]=c;data[sz+1]=0;
return *this;
}
string& operator+=(const string& s)
{
unsigned mysz=size();
unsigned ssz=s.size();
data=(char*)realloc(data,mysz+1+ssz);
memcpy(data+mysz,s.c_str(),ssz+1);
return *this;
}
// friend string operator+(const string& s1, const char* s2);
// friend string operator+(const char* s1, const string& s2);
string& assign(const string& str, unsigned pos, unsigned n)
{
unsigned len=strlen(str.data);
if (pos>len)
pos=len;
if (n>len||pos+n>len)
n=len-pos;
char* d=(char*)malloc(n+1);
memcpy(d,str.c_str()+pos,n);
d[n]=0;
free(data);
data=d;
return *this;
}
string& assign(const char* s)
{
free(data);
unsigned sz=strlen(s)+1;
data=(char*)malloc(sz);
memcpy(data,s,sz);
return *this;
}
string& assign(const string& str)
{ return assign(str.data); }
size_t find_first_of(const char* str, size_t pos=0) const
{
const char* p = data;
while (pos)
{
if (!*p)
return npos;
p++;
pos--;
}
while (*p)
{
if (strchr(str,*p))
return p-data;
p++;
}
return npos;
}
size_t find_first_of(const string& str, size_t pos=0) const
{ return find_first_of(str.data, pos); }
size_t find_first_not_of(const char* str, size_t pos=0) const
{
const char* p = data;
while (pos)
{
if (!*p)
return npos;
p++;
pos--;
}
while (*p)
{
if (!strchr(str,*p))
return p-data;
p++;
}
return npos;
}
size_t find_first_not_of(const string& str, size_t pos=0) const
{ return find_first_not_of(str.data, pos); }
size_t find_last_not_of(const char* str, size_t pos=npos) const
{
const char* p = data;
while (pos)
{
if (!*p)
{
p--;
break;
}
p++;
pos--;
}
for (;;)
{
if (p<data)
return npos;
if (!strchr(str,*p))
return p-data;
p--;
}
}
size_t find_last_not_of(const string& str, size_t pos=npos) const
{ return find_last_not_of(str.data, pos); }
class iterator
{
char* cur;
public:
iterator(char* c):cur(c) {}
iterator(const iterator& i):cur(i.cur) {}
iterator& operator++() {++cur;return *this;}
iterator operator++(int) {iterator tmp(*this);++cur;return tmp;}
bool operator==(iterator it) {return cur==it.cur;}
bool operator!=(iterator it) {return cur!=it.cur;}
char& operator*() {return *cur;}
};
iterator begin() {return iterator(data);}
iterator end() {return iterator(data+strlen(data));}
// void erase() {free(data);data=(char*)malloc(1);data[0]=0;}
string& erase(unsigned p0=0, unsigned n=(unsigned)-1)
{
unsigned sz=size();
if (n>sz-p0) n=sz-p0;
char* d=(char*)malloc(sz+1-n);
memcpy(d,data,p0);
memcpy(d+p0,data+p0+n,sz+1-n-p0);
free(data);
data=d;
return *this;
}
typedef unsigned size_type;
static const size_type npos=(size_type)-1;
size_type find(const char* s, size_type pos=0) const
{
char* p=strstr(data+pos,s);
if (!p) return npos;
return p-data;
}
size_type find(char c, size_type pos=0) const
{
char* p=strchr(data+pos,c);
if (!p) return npos;
return p-data;
}
size_type rfind(char c, size_type pos=npos) const
{
size_type len=strlen(data);
if (pos>len)
pos=len;
while (pos--)
if (data[pos]==c)
return pos;
return npos;
}
string substr(unsigned pos=0,unsigned n=npos)
{
string res(data+pos);
if (n<res.size()) res.erase(n);
return res;
}
void clear(void)
{
data[0]=0;
}
bool empty(void) const
{
return (data[0]==0);
}
void _toupper(void)
{ strupr(data); }
void _tolower(void)
{ strlwr(data); }
};
}
 
inline std::string operator+(const std::string& s1, const char* s2)
{
std::string res(s1);
res += s2;
return res;
}
inline std::string operator+(const char* s1, const std::string& s2)
{
std::string res(s1);
res += s2;
return res;
}
inline std::string operator+(const std::string& s1, const std::string& s2)
{
std::string res(s1);
res += s2;
return res;
}
 
#endif
/contrib/media/updf/include/string.h
0,0 → 1,80
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_string_h_
#define __dj_include_string_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#include <sys/djtypes.h>
/* Some programs think they know better... */
#undef NULL
 
#define NULL 0
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
 
void * memchr(const void *_s, int _c, size_t _n);
int memcmp(const void *_s1, const void *_s2, size_t _n);
void * memcpy(void *_dest, const void *_src, size_t _n);
void * memmove(void *_s1, const void *_s2, size_t _n);
void * memset(void *_s, int _c, size_t _n);
char * strcat(char *_s1, const char *_s2);
char * strchr(const char *_s, int _c);
int strcmp(const char *_s1, const char *_s2);
int strcoll(const char *_s1, const char *_s2);
char * strcpy(char *_s1, const char *_s2);
size_t strcspn(const char *_s1, const char *_s2);
char * strerror(int _errcode);
size_t strlen(const char *_s);
char * strncat(char *_s1, const char *_s2, size_t _n);
int strncmp(const char *_s1, const char *_s2, size_t _n);
char * strncpy(char *_s1, const char *_s2, size_t _n);
char * strpbrk(const char *_s1, const char *_s2);
char * strrchr(const char *_s, int _c);
size_t strspn(const char *_s1, const char *_s2);
char * strstr(const char *_s1, const char *_s2);
char * strtok(char *_s1, const char *_s2);
size_t strxfrm(char *_s1, const char *_s2, size_t _n);
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <sys/movedata.h>
 
int bcmp(const void *_ptr1, const void *_ptr2, int _length);
void * bcopy(const void *_a, void *_b, size_t _len);
void * bzero(void *ptr, size_t _len);
int ffs(int _mask);
char * index(const char *_string, int _c);
void * memccpy(void *_to, const void *_from, int c, size_t n);
int memicmp(const void *_s1, const void *_s2, size_t _n);
char * rindex(const char *_string, int _c);
char * stpcpy(char *_dest, const char *_src);
char * strdup(const char *_s);
char * strlwr(char *_s);
int strcasecmp(const char *_s1, const char *_s2);
int stricmp(const char *_s1, const char *_s2);
int strncasecmp(const char *_s1, const char *_s2, size_t _n);
int strnicmp(const char *_s1, const char *_s2, size_t _n);
char * strsep(char **_stringp, const char *_delim);
char * strupr(char *_s);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_string_h_ */
/contrib/media/updf/include/stringio.h
0,0 → 1,41
/** \file stringio.h
* definitions of input output classes that read and write from string.
*/
 
 
#ifndef __stringio_h__
#define __stringio_h__
 
#include "yacasbase.h"
#include "lispio.h"
#include "lispstring.h"
 
class StringInput : public LispInput
{
public:
StringInput(LispString& aString,InputStatus& aStatus);
virtual LispChar Next();
virtual LispChar Peek();
virtual LispBoolean EndOfStream();
virtual LispChar * StartPtr();
virtual LispInt Position();
virtual void SetPosition(LispInt aPosition);
protected:
LispString iString;
LispInt iCurrent;
};
 
class StringOutput : public LispOutput
{
public:
StringOutput(LispString& aString);
virtual ~StringOutput();
virtual void PutChar(LispChar aChar);
public:
LispString& iString;
};
 
 
 
#endif
 
/contrib/media/updf/include/strings.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_strings_h_
#define __dj_include_strings_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <string.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_strings_h_ */
/contrib/media/updf/include/stubs.h
0,0 → 1,70
 
/** \file stubs.h interface to platform-dependent functions
*/
 
#ifndef __stubs_h__
#define __stubs_h__
 
#include "lisptype.h"
 
/** Simple function that determines if two strings are equal,
should be defined in stubs.inl */
//inline LispInt StrEqual(const LispChar * ptr1, const LispChar * ptr2);
 
#ifdef NO_GLOBALS
#define PlatAlloc malloc
#define PlatReAlloc realloc
#define PlatFree free
#define NEW new
#define CHECKPTR(ptr)
#else // NO_GLOBALS -- goes almost to EOF
void *PlatObAlloc(size_t nbytes);
void PlatObFree(void *p);
void *PlatObReAlloc(void *p, size_t nbytes);
 
#ifdef YACAS_DEBUG
#include "debugmem.h"
#define PlatAlloc(nr) YacasMallocPrivate((size_t)nr,__FILE__,__LINE__)
#define PlatReAlloc(orig,nr) YacasReAllocPrivate(orig,(size_t)nr,__FILE__,__LINE__)
#define PlatFree(orig) YacasFreePrivate(orig)
#define NEW new (__FILE__,__LINE__)
#define CHECKPTR(ptr) CheckPtr(ptr,__FILE__,__LINE__)
#else // YACAS_DEBUG
#define PlatAlloc(nr) PlatObAlloc((size_t)nr)
#define PlatReAlloc(orig,nr) PlatObReAlloc(orig,(size_t)nr)
#define PlatFree(orig) PlatObFree(orig)
#define NEW new
#define CHECKPTR(ptr)
#endif // YACAS_DEBUG
 
template <class T>
inline T * PlatAllocN(LispInt aSize) { return (T*)PlatAlloc(aSize*sizeof(T)); }
 
 
#ifdef YACAS_DEBUG // goes almost to EOF
 
/* Operators new and delete are only defined globally here in debug mode. This is because
* the global new and delete operators should not be used. So the debug version makes sure
* the executable crashes if one of these are called.
*/
 
#define NEW_THROWER throw ()//(std::bad_alloc)
#define DELETE_THROWER throw ()
 
// TODO: why doesn't MSC itself have this problem? Perhaps wrong signature of these new and delete operators?
#if defined(_MSC_VER) && _MSC_VER <= 1310 // getting C4290 warnings? slowly increase number.
#pragma warning( disable : 4290 ) // C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
 
void* operator new(size_t size) NEW_THROWER;
void* operator new[](size_t size) NEW_THROWER;
void operator delete(void* object) DELETE_THROWER;
void operator delete[](void* object) DELETE_THROWER;
 
#endif // YACAS_DEBUG
 
#endif // NO_GLOBALS
 
#include "stubs.inl"
 
#endif // __stubs_h__
/contrib/media/updf/include/substitute.h
0,0 → 1,78
 
#ifndef __substitute_h__
#define __substitute_h__
 
#include "yacasbase.h"
#include "lispobject.h"
#include "lispenvironment.h"
 
 
/** Behaviour for substituting sub-expressions.
*/
class SubstBehaviourBase : public YacasBase
{
public:
virtual ~SubstBehaviourBase();
virtual LispBoolean Matches(LispPtr& aResult, LispPtr& aElement) = 0;
};
 
/** main routine that can perform substituting of expressions
*/
void InternalSubstitute(LispPtr& aTarget, LispPtr& aSource,
SubstBehaviourBase& aBehaviour);
 
 
/** Substing one expression for another. The simplest form
* of substitution
*/
class SubstBehaviour : public SubstBehaviourBase
{
public:
SubstBehaviour(LispEnvironment& aEnvironment,LispPtr& aToMatch,
LispPtr& aToReplaceWith);
virtual LispBoolean Matches(LispPtr& aResult, LispPtr& aElement);
private:
LispEnvironment& iEnvironment;
LispPtr& iToMatch;
LispPtr& iToReplaceWith;
};
 
/** subst behaviour for changing the local variables to have unique
* names.
*/
class LocalSymbolBehaviour : public SubstBehaviourBase
{
public:
LocalSymbolBehaviour(LispEnvironment& aEnvironment,
LispString ** aOriginalNames,
LispString ** aNewNames, LispInt aNrNames);
virtual LispBoolean Matches(LispPtr& aResult, LispPtr& aElement);
private:
LispEnvironment& iEnvironment;
LispString ** iOriginalNames;
LispString ** iNewNames;
LispInt iNrNames;
};
 
/** subst behaviour for backquote mechanism as in LISP.
* When typing `(...) all occurrences of @a will be
* replaced with:
* 1) a evaluated if a is an atom
* 2) function call with function name replaced by evaluated
* head of function if a is a function. For instance, if
* a is f(x) and f is g, then f(x) gets replaced by g(x)
*/
class BackQuoteBehaviour : public SubstBehaviourBase
{
public:
BackQuoteBehaviour(LispEnvironment& aEnvironment)
: iEnvironment(aEnvironment) {};
virtual LispBoolean Matches(LispPtr& aResult, LispPtr& aElement);
LispEnvironment& iEnvironment;
};
 
 
 
 
#endif
 
/contrib/media/updf/include/sys/bitypes.h
0,0 → 1,92
/*
* bitypes.h,v 1.4 1995/08/24 01:58:54 hjl Exp
*/
 
/*
* ++Copyright++ 1993
* -
* Copyright (c) 1993 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* -
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
* -
* --Copyright--
*/
 
/*
#ifdef __USE_BSD
*/
 
#ifndef __BIT_TYPES_DEFINED__
# if (defined(BSD) && (BSD >= 199306)) || \
(defined(_BSDI_VERSION) && (_BSDI_VERSION >= 199312))
# define __BIT_TYPES_DEFINED__
# endif
#endif
 
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
 
/*
* Basic integral types. Omit the typedef if
* not possible for a machine/compiler combination.
*/
typedef /*signed*/ char int8_t;
typedef unsigned char u_int8_t;
typedef short int16_t;
typedef unsigned short u_int16_t;
typedef int int32_t;
typedef unsigned int u_int32_t;
 
# if __GNUC__ >= 2
typedef long long int64_t;
typedef unsigned long long u_int64_t;
# endif
 
#endif /* __BIT_TYPES_DEFINED__ */
 
/* #endif __USE_BSD */
/contrib/media/updf/include/sys/cdefs.h
0,0 → 1,38
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#undef __P
#if defined(__STDC__) || defined(__cplusplus)
#define __P(p) p
#else
#define __P(p)
#endif
#define _PTR void *
#define _AND ,
#define _NOARGS void
#define _CONST const
#define _VOLATILE volatile
#define _SIGNED signed
#define _DOTS , ...
#define _VOID void
#define _EXFUN(name, proto) name proto
#define _DEFUN(name, arglist, args) name(args)
#define _DEFUN_VOID(name) name(_NOARGS)
#define _CAST_VOID (void)
#ifndef _LONG_DOUBLE
#define _LONG_DOUBLE long double
#endif
#ifndef _PARAMS
#define _PARAMS(paramlist) paramlist
#endif
 
/* Support gcc's __attribute__ facility. */
 
#define _ATTRIBUTE(attrs) __attribute__ ((attrs))
 
#if defined(__cplusplus)
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
#else
#define __BEGIN_DECLS
#define __END_DECLS
#endif
/contrib/media/updf/include/sys/config.h
0,0 → 1,612
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_config_h_
#define __dj_include_sys_config_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* config.h for DJGPP.
 
This is usually generated automatically from config.h.in by the
configure script. However, it is very hard to run that script under
MS-DOS, because of its extensive use of Unix shell features. This
header file is provided so you can skip the autoconfigure step
altogether and go directly to the compilation step (after copying
Makefile.in to Makefile and setting the defaults there).
 
There are several parts in this header file, which closely follow the
GNU Autoconf procedures.
 
The first part checks for things which depend on the specific programs
from your programming environment which you use to compile a package.
 
The second part mentions all the header files in the include hierarchy,
even those which every C installation must have. The only headers
files which are omitted are those which are specific to the PC
architecture or to DJGPP, because no GNU package should ever look for
those. (Some header files which DJGPP includes only for compatibility,
and which could cause a conflict with the mainstream header file, are
also excluded.)
 
The third part mentions all the library functions which aren't included
in every C library. Obviously, it isn't practical to mention every
library function here, so this part has somewhat ad-hoc nature in that
the macros which should go there were assembled by actually porting
some GNU packages.
 
The fourth part defines macros which are related to the header files,
like definitions of some structures and specific member fields in some
structures.
 
The fifth part deals with some typedefs which aren't standardized
enough between different systems, or might be missing from your header
files.
 
The sixth part defines some macros necessary to deal with differences
between compiler and architectural characteristics of various systems.
 
In the seventh part, some system services which might be required by
some packages, are mentioned.
 
The last part includes all kinds if miscellaneous macros required by
some GNU packages to be successfully compiled under DJGPP.
 
Prepared by Eli Zaretskii <eliz@is.elta.co.il>
with help from Morten Welinder <terra@diku.dk>
and using some information from GNU Autoconf package.
*/
 
/* ---------------------------------------------------------------------
Program-related stuff.
--------------------------------------------------------------------- */
 
/* Define if `yytext' is a `char *' instead of a `char []'. This is
true if you use Flex. */
#undef YYTEXT_POINTER
#define YYTEXT_POINTER 1
 
/* ---------------------------------------------------------------------
Header files.
--------------------------------------------------------------------- */
 
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
#define STDC_HEADERS 1
 
/* Define if you have the <ar.h> header file. */
#undef HAVE_AR_H
#define HAVE_AR_H 1
 
/* Define if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
#define HAVE_ASSERT_H 1
 
/* Define if you have the <coff.h> header file. */
#undef HAVE_COFF_H
#define HAVE_COFF_H 1
 
/* Define if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
#define HAVE_CTYPE_H 1
 
/* Define if you have the <dirent.h> header file. */
#undef DIRENT
#define DIRENT 1
 
#undef HAVE_DIRENT_H
#define HAVE_DIRENT_H 1
 
/* Define if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
#define HAVE_ERRNO_H 1
 
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
#define HAVE_FCNTL_H 1
 
/* Define if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
#define HAVE_FLOAT_H 1
 
/* Define if you have the <fnmatch.h> header file. */
#undef HAVE_FNMATCH_H
#define HAVE_FNMATCH_H 1
 
/* Define if you have the <ftw.h> header file. */
#undef HAVE_FTW_H
#define HAVE_FTW_H 1
 
/* Define if you have the <glob.h> header file. */
#undef HAVE_GLOB_H
#define HAVE_GLOB_H 1
 
/* Define if you have the <grp.h> header file. */
#undef HAVE_GRP_H
#define HAVE_GRP_H 1
 
/* Define if you have the <io.h> header file. */
#undef HAVE_IO_H
#define HAVE_IO_H 1
 
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
#define HAVE_LIMITS_H 1
 
/* Define if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
#define HAVE_LOCALE_H 1
 
/* Define if you have the <math.h> header file. */
#undef HAVE_MATH_H
#define HAVE_MATH_H 1
 
/* Define if you have the <mntent.h> header file. */
#undef HAVE_MNTENT_H
#define HAVE_MNTENT_H 1
 
/* Define if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
#define HAVE_PWD_H 1
 
/* Define if you have the <search.h> header file. */
#undef HAVE_SEARCH_H
#define HAVE_SEARCH_H 1
 
/* Define if you have the <setjmp.h> header file. */
#undef HAVE_SETJMP_H
#define HAVE_SETJMP_H 1
 
/* Define if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
#define HAVE_SIGNAL_H 1
 
#undef HAVE_SYS_SIGLIST
#define HAVE_SYS_SIGLIST 1
 
/* Define if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
#define HAVE_STDARG_H 1
 
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
#define HAVE_STDDEF_H 1
 
/* Define if you have the <stdio.h> header file (is there ANY C
installation that doesn't??). */
#undef HAVE_STDIO_H
#define HAVE_STDIO_H 1
 
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
#define HAVE_STDLIB_H 1
 
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
#define HAVE_STRING_H 1
 
/* Define if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H /* we have, but the functions aren't implemented */
/* #define HAVE_TERMIOS_H 1 */
 
/* Define if you have the <time.h> header file. */
#undef HAVE_TIME_H
#define HAVE_TIME_H 1
 
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
#define HAVE_SYS_TIME_H 1
 
/* Define this if your <time.h> and <sys/time.h> can both be
included with no conflicts. */
#undef TIME_WITH_SYS_TIME
#define TIME_WITH_SYS_TIME 1
 
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
#define HAVE_UNISTD_H 1
 
/* Define if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
#define HAVE_UTIME_H 1
 
/* Define if you have the values.h header file. */
#undef HAVE_VALUES_H
#define HAVE_VALUES_H 1
 
/* Define if you have the <varargs.h> header file. */
#undef HAVE_VARARGS_H
#define HAVE_VARARGS_H 1
 
/* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
#define HAVE_NETINET_IN_H 1
 
/* Define if you have the <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H
#define HAVE_SYS_FILE_H 1
 
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
#define HAVE_SYS_IOCTL_H 1
 
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
#define HAVE_SYS_PARAM_H 1
 
/* Define if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
#define HAVE_SYS_RESOURCE_H 1
 
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
#define HAVE_SYS_STAT_H 1
 
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
#define HAVE_SYS_TIME_H 1
 
/* Define if you have the <sys/timeb.h> header file. */
#undef HAVE_SYS_TIMEB_H
#define HAVE_SYS_TIMEB_H 1
 
/* Define if you have the <sys/times.h> header file. */
#undef HAVE_SYS_TIMES_H
#define HAVE_SYS_TIMES_H 1
 
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
#define HAVE_SYS_TYPES_H 1
 
/* Define if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H
#define HAVE_SYS_UTSNAME_H 1
 
/* Define if you have the <sys/vfs.h> header file. */
#undef HAVE_SYS_VFS_H
#define HAVE_SYS_VFS_H 1
 
/* Define if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
#define HAVE_SYS_WAIT_H 1
 
 
/* ---------------------------------------------------------------------
Library functions and related stuff.
--------------------------------------------------------------------- */
 
/* Define if using alloca.c. */
#undef C_ALLOCA
 
/* Define if you have bcmp() and bcopy() library functions. */
#undef HAVE_BCMP
#define HAVE_BCMP 1
#undef HAVE_BCOPY
#define HAVE_BCOPY 1
 
/* Define if you have closedir() function in your library. */
#undef HAVE_CLOSEDIR
#define HAVE_CLOSEDIR 1
 
/* Define if you have dup2() library function. */
#undef HAVE_DUP2
#define HAVE_DUP2 1
 
/* Define if you have the endgrent function. */
#undef HAVE_ENDGRENT
#define HAVE_ENDGRENT 1
 
/* Define if you have the endpwent function. */
#undef HAVE_ENDPWENT
#define HAVE_ENDPWENT 1
 
/* Define if you have fnmatch() function in your library. */
#undef HAVE_FNMATCH
#define HAVE_FNMATCH 1
 
/* Define if you have frexp() function in your library. */
#undef HAVE_FREXP
#define HAVE_FREXP 1
 
/* Define if you have ftime() function in your library. */
#undef HAVE_FTIME
#define HAVE_FTIME 1
 
/* Define if you have the the ftruncate() library function. */
#undef HAVE_FTRUNCATE
#define HAVE_FTRUNCATE 1
 
/* Define if you have ftw() function in your library. */
#undef HAVE_FTW
#define HAVE_FTW 1
 
/* Define if you have getcwd() function in your library. */
#undef HAVE_GETCWD
#define HAVE_GETCWD 1
 
/* Define if you have getdtablesize() function in your library. */
#undef HAVE_GETDTABLESIZE
#define HAVE_GETDTABLESIZE 1
 
/* Define if you have the getgroups function. */
#undef HAVE_GETGROUPS
#define HAVE_GETGROUPS 1
 
/* Define if you have gethostname() function in your library. */
#undef HAVE_GETHOSTNAME
#define HAVE_GETHOSTNAME 1
 
/* Define if you have getmntent() function in your library. */
#undef HAVE_GETMNTENT
#define HAVE_GETMNTENT 1
 
/* Define if you have getpagesize() function in your library. */
#undef HAVE_GETPAGESIZE
#define HAVE_GETPAGESIZE 1
 
/* Define this if your getpgrp() function takes no argument (the
POSIX.1 version). */
#undef GETPGRP_VOID
#define GETPGRP_VOID 1
 
/* Define if your getmntent() function accepts one argument. */
#undef MOUNTED_GETMNTENT1
#define MOUNTED_GETMNTENT1 1
 
/* Define if you have gettimeofday() function in your library. */
#undef HAVE_GETTIMEOFDAY
#define HAVE_GETTIMEOFDAY 1
 
/* Define if you have the glob() function in your library. */
#undef HAVE_GLOB
#define HAVE_GLOB 1
 
/* Define if you have the isascii function. */
#undef HAVE_ISASCII
#define HAVE_ISASCII 1
 
/* Define if you have memchr() in your library. */
#undef HAVE_MEMCHR
#define HAVE_MEMCHR 1
 
/* Define if you have the memcpy function. */
#undef HAVE_MEMCPY
#define HAVE_MEMCPY 1
 
/* Define if you have mkdir() function in your library. */
#undef HAVE_MKDIR
#define HAVE_MKDIR 1
 
/* Define if you have the mkfifo function. */
#undef HAVE_MKFIFO
#define HAVE_MKFIFO 1
 
/* Define if you have mktime() function in your library. */
#undef HAVE_MKTIME
#define HAVE_MKTIME 1
 
/* Define if you have the pow function. */
#undef HAVE_POW
#define HAVE_POW 1
 
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
#define HAVE_PUTENV 1
 
/* Define if you have random() function in your library. */
#undef HAVE_RANDOM
#define HAVE_RANDOM 1
 
/* Define if you have rename() function in your library. */
#undef HAVE_RENAME
#define HAVE_RENAME 1
 
/* Define if you have rmdir() function in your library. */
#undef HAVE_RMDIR
#define HAVE_RMDIR 1
 
/* Define if you have the setenv function. */
#undef HAVE_SETENV
#define HAVE_SETENV 1
 
/* Define if you have setlinebuf() function in your library. */
#undef HAVE_SETLINEBUF
#define HAVE_SETLINEBUF 1
 
/* Define if you have the setlocale function. */
#undef HAVE_SETLOCALE
#define HAVE_SETLOCALE 1
 
/* Define if you have sigaction() function in your library. */
#undef HAVE_SIGACTION
#define HAVE_SIGACTION 1
 
/* Define if your statfs() function accepts 2 arguments and
struct statfs has f_bsize field. */
#undef STAT_STATFS2_BSIZE
#define STAT_STATFS2_BSIZE 1
 
/* Define if you have the stpcpy function. */
#undef HAVE_STPCPY
#define HAVE_STPCPY 1
 
/* Define if you have strcasecmp() function in your library. */
#undef HAVE_STRCASECMP
#define HAVE_STRCASECMP 1
 
/* Define if you have strchr() function in your library. */
#undef HAVE_STRCHR
#define HAVE_STRCHR 1
 
/* Define if you have strrchr() function in your library. */
#undef HAVE_STRRCHR
#define HAVE_STRRCHR 1
 
/* Define if you have strcoll() function in your library. */
#undef HAVE_STRCOLL
#define HAVE_STRCOLL 1
 
/* Define if you have strdup() function in your library. */
#undef HAVE_STRDUP
#define HAVE_STRDUP 1
 
/* Define if you have strftime() function in your library. */
#undef HAVE_STRFTIME
#define HAVE_STRFTIME 1
 
/* Define if you have strerror. */
#undef HAVE_STRERROR
#define HAVE_STRERROR 1
 
/* Define if your utime() library function accepts NULL as its second
argument (meaning use current time). */
#undef HAVE_UTIME_NULL
#define HAVE_UTIME_NULL 1
 
/* Define vfork as fork if vfork() does not work. */
#undef vfork
#define vfork fork
 
/* Define if you have the vprintf() library function. */
#undef HAVE_VPRINTF
#define HAVE_VPRINTF 1
 
/* Define if you have waitpid. */
#undef HAVE_WAITPID /* we do, but it always fails :-( */
 
/* ---------------------------------------------------------------------
Structures
--------------------------------------------------------------------- */
 
/* Define if your struct stat has st_blksize. */
#undef HAVE_ST_BLKSIZE
#define HAVE_ST_BLKSIZE 1
 
/* Define if your struct stat has st_blocks. */
#undef HAVE_ST_BLOCKS
 
/* Define if your struct stat has st_rdev member. */
#undef HAVE_ST_RDEV
#define HAVE_ST_RDEV 1
 
/* Define if you have `struct utimbuf' declared in <utime.h>. */
#undef HAVE_STRUCT_UTIMBUF
#define HAVE_STRUCT_UTIMBUF 1
 
/* Define if you have struct timeval defined in your <time.h> header file. */
#undef HAVE_TIMEVAL
#define HAVE_TIMEVAL 1
 
/* Define if you have tm_zone field in your struct tm definition (in
<time.h> header file). */
#undef HAVE_TM_ZONE
#define HAVE_TM_ZONE 1
 
/* ---------------------------------------------------------------------
Typedefs
--------------------------------------------------------------------- */
 
/* Define to the type of elements in the array set by `getgroups'.
Usually this is either `int' or `gid_t'. */
#undef GETGROUPS_T
#define GETGROUPS_T gid_t
 
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
#define RETSIGTYPE void
 
 
/* ---------------------------------------------------------------------
Compiler Characteristics
--------------------------------------------------------------------- */
 
/* Define `inline' to `__inline__' if your compiler accepts it. */
#undef inline
#define inline __inline__
 
/* Define this if the C compiler supports the `long double' type. */
#undef HAVE_LONG_DOUBLE
#define HAVE_LONG_DOUBLE 1
 
/* Sizes of built-in types and pointers known to the compiler. */
#define SIZEOF_CHAR 1
#define SIZEOF_CHAR_P 4
#define SIZEOF_SHORT 2
#define SIZEOF_SHORT_P 4
#define SIZEOF_INT 4
#define SIZEOF_INT_P 4
#define SIZEOF_LONG 4
#define SIZEOF_LONG_P 4
#define SIZEOF_LONG_LONG 8
#define SIZEOF_LONG_LONG_P 4
#define SIZEOF_FLOAT 4
#define SIZEOF_FLOAT_P 4
#define SIZEOF_DOUBLE 8
#define SIZEOF_DOUBLE_P 4
#define SIZEOF_LONG_DOUBLE 10
#define SIZEOF_LONG_DOUBLE_P 4
#define SIZEOF_VOID_P 4
 
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
 
/* Define to empty if the `const' keyword does not work. */
#undef const
 
/* ---------------------------------------------------------------------
System Services
--------------------------------------------------------------------- */
 
/* Define this to be the name of your NULL device. */
#undef NULL_DEVICE
#define NULL_DEVICE "nul"
 
/* Do we have long filenames? */
#undef HAVE_LONG_FILE_NAMES /* not yet, but Win95 might have them... */
 
/* ---------------------------------------------------------------------
Misc definitions
--------------------------------------------------------------------- */
 
/* Define both _LIBC and __GNU_LIBRARY__ if you use GNU C library,
but want link in the version of getopt, regex, fnmatch (and other
routines which are part of GNU C library) which came with the
package. Define _LIBC alone if you use non-GNU C library which
might be incompatible with GNU (e.g., getopt()). Define __GNU_LIBRARY__
alone if you want the code for the above functions to be effectively
commented out, so you will get the code from the GNU C library.
*/
#undef _LIBC
#undef __GNU_LIBRARY__
/* #define _LIBC 1 */
/* #define __GNU_LIBRARY__ 1 */
 
 
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_config_h_ */
/contrib/media/updf/include/sys/dir.h
0,0 → 1,32
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_dir_h_
#define __dj_include_sys_dir_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* WARNING! This file is obsolete! Use <dirent.h> */
 
#define dirent direct
#include <dirent.h>
#undef dirent
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_dir_h_ */
/contrib/media/updf/include/sys/djtypes.h
0,0 → 1,34
/* Copyright (C) 2002 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#ifndef __DJ_sys_djtypes_h_
#define __DJ_sys_djtypes_h_
 
#define __DJ_clock_t typedef int clock_t;
#define __DJ_gid_t typedef int gid_t;
#define __DJ_off_t typedef int off_t;
#define __DJ_pid_t typedef int pid_t;
#define __DJ_size_t typedef unsigned int size_t;
#define __DJ_ssize_t typedef int ssize_t;
#define __DJ_time_t typedef unsigned int time_t;
#define __DJ_uid_t typedef int uid_t;
 
/* For GCC 3.00 or later we use its builtin va_list. */
#if __GNUC__ >= 3
#define __DJ_va_list typedef __builtin_va_list va_list;
#else
#define __DJ_va_list typedef void *va_list;
#endif
 
#if defined(__cplusplus) && ( (__GNUC_MINOR__ >= 8 && __GNUC__ == 2 ) || __GNUC__ >= 3 || defined(_MSC_VER))
/* wchar_t is now a keyword in C++ */
#define __DJ_wchar_t
#else
/* but remains a typedef in C */
#define __DJ_wchar_t typedef unsigned short wchar_t;
#endif
 
#define __DJ_wint_t typedef int wint_t;
 
#endif
/contrib/media/updf/include/sys/dxe.h
0,0 → 1,24
/* Copyright (C) 1995 Charles Sandmann (sandmann@clio.rice.edu)
This software may be freely distributed with above copyright, no warranty.
Based on code by DJ Delorie, it's really his, enhanced, bugs fixed. */
 
typedef struct {
long magic;
long symbol_offset;
long element_size;
long nrelocs;
} dxe_header;
 
#define DXE_MAGIC 0x31455844
 
/* data stored after dxe_header in file; then relocs, 4 bytes each */
 
#ifdef __cplusplus
extern "C" {
#endif
 
void *_dxe_load(char *filename);
 
#ifdef __cplusplus
}
#endif
/contrib/media/updf/include/sys/errno.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_errno_h_
#define __dj_include_sys_errno_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <errno.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_errno_h_ */
/contrib/media/updf/include/sys/exceptn.h
0,0 → 1,77
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_exceptn_h__
#define __dj_include_sys_exceptn_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#ifdef __dj_include_setjmp_h_
extern jmp_buf *__djgpp_exception_state_ptr; /* Must include setjmp.h first */
#define __djgpp_exception_state (*__djgpp_exception_state_ptr)
#endif
 
extern unsigned short __djgpp_our_DS;
extern unsigned short __djgpp_app_DS; /* Data selector invalidated by HW ints */
extern unsigned short __djgpp_ds_alias; /* Data selector always valid */
extern unsigned short __djgpp_dos_sel; /* Linear mem selector copy in locked mem */
/* Hardware Interrupt Flags:
 
1 = Disable INTR and QUIT keys (Ctrl-C and Ctrl-\);
2 = Count Ctrl-Break (don't kill);
4 = IRET from our timer interrupt handler, don't chain */
extern unsigned short __djgpp_hwint_flags;
extern unsigned __djgpp_cbrk_count; /* Count of CTRL-BREAK hits */
extern int __djgpp_exception_inprog; /* Nested exception count */
 
extern unsigned short __djgpp_sigint_key; /* key that raises SIGINT */
extern unsigned short __djgpp_sigquit_key; /* key that raises SIGQUIT */
extern unsigned short __djgpp_sigint_mask; /* kb mask for SIGINT key */
extern unsigned short __djgpp_sigquit_mask;/* kb mask for SIGQUIT key */
 
void __djgpp_exception_toggle(void);
int __djgpp_set_ctrl_c(int __enable); /* On by default */
int __djgpp_set_sigint_key(int new_key); /* Set key which raises SIGINT */
int __djgpp_set_sigquit_key(int new_key); /* Set key which raises SIGQUIT */
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_exceptn_h__ */
/contrib/media/updf/include/sys/farptr.h
0,0 → 1,247
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/* Copyright (c) 1995 DJ Delorie. Permission granted to use for any
purpose, provided this copyright remains attached and unmodified.
 
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º Far Pointer Simulation Functions º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
 
This file attempts to make up for the lack of a "far" keyword in GCC.
Although it doesn't provide access to far call APIs (like Windows), it
does allow you to do far pointer data access without the overhead of
movedata() or dosmemget/dosmemput().
 
You should *always* include this file when using these functions and
compile with optimization enabled. They don't exist as normal functions
in any library, and they compile down to only a few opcodes when used
this way. They are almost as fast as native pointer operations, and
about as fast as far pointers can get.
 
If you don't use optimization, this file becomes prototypes for
farptr.c, which generates real functions for these when not optimizing.
When optimizing, farptr.c compiles to nothing.
 
There are two types of functions here - standalone and invariant. The
standalone functions take a selector and offset. These are used when
you need only a few accesses, time isn't critical, or you don't know
what's in the %fs register. The invariant ones don't take a selector,
they only take an offset. These are used inside loops and in
time-critical accesses where the selector doesn't change. To specify
the selector, use the farsetsel() function. That selector is used for
all farns*() functions until changed. You can use _fargetsel() if you
want to temporary change the selector with _farsetsel() and restore
it afterwards.
 
The farpoke* and farpeek* take selectors.
 
The farnspoke* and farnspeek* don't (note the `ns' for `no selector').
 
Warning: These routines all use the %fs register for their accesses.
GCC normally uses only %ds and %es, and libc functions (movedata,
dosmemget, dosmemput) use %gs. Still, you should be careful about
assumptions concerning whether or not the value you put in %fs will be
preserved across calls to other functions. If you guess wrong, your
program will crash. Better safe than sorry.
 
*/
 
#ifndef __dj_include_sys_farptr_h_
#define __dj_include_sys_farptr_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
void _farpokeb(unsigned short, unsigned long, unsigned char);
void _farpokew(unsigned short, unsigned long, unsigned short);
void _farpokel(unsigned short, unsigned long, unsigned long);
unsigned char _farpeekb(unsigned short, unsigned long);
unsigned short _farpeekw(unsigned short, unsigned long);
unsigned long _farpeekl(unsigned short, unsigned long);
void _farsetsel(unsigned short);
unsigned short _fargetsel(void);
void _farnspokeb(unsigned long, unsigned char);
void _farnspokew(unsigned long, unsigned short);
void _farnspokel(unsigned long, unsigned long);
unsigned char _farnspeekb(unsigned long);
unsigned short _farnspeekw(unsigned long);
unsigned long _farnspeekl(unsigned long);
 
extern __inline__ void
_farpokeb(unsigned short selector,
unsigned long offset,
unsigned char value)
{
__asm__ __volatile__ ("movw %w0,%%fs\n"
" .byte 0x64 \n"
" movb %b1,(%k2)"
:
: "rm" (selector), "qi" (value), "r" (offset));
}
 
extern __inline__ void
_farpokew(unsigned short selector,
unsigned long offset,
unsigned short value)
{
__asm__ __volatile__ ("movw %w0,%%fs \n"
" .byte 0x64 \n"
" movw %w1,(%k2)"
:
: "rm" (selector), "ri" (value), "r" (offset));
}
 
extern __inline__ void
_farpokel(unsigned short selector,
unsigned long offset,
unsigned long value)
{
__asm__ __volatile__ ("movw %w0,%%fs \n"
" .byte 0x64 \n"
" movl %k1,(%k2)"
:
: "rm" (selector), "ri" (value), "r" (offset));
}
 
extern __inline__ unsigned char
_farpeekb(unsigned short selector,
unsigned long offset)
{
unsigned char result;
__asm__ __volatile__ ("movw %w1,%%fs \n"
" .byte 0x64 \n"
" movb (%k2),%b0"
: "=q" (result)
: "rm" (selector), "r" (offset));
return result;
}
 
extern __inline__ unsigned short
_farpeekw(unsigned short selector,
unsigned long offset)
{
unsigned short result;
__asm__ __volatile__ ("movw %w1, %%fs \n"
" .byte 0x64 \n"
" movw (%k2),%w0 \n"
: "=r" (result)
: "rm" (selector), "r" (offset));
return result;
}
 
extern __inline__ unsigned long
_farpeekl(unsigned short selector,
unsigned long offset)
{
unsigned long result;
__asm__ __volatile__ ("movw %w1,%%fs\n"
" .byte 0x64\n"
" movl (%k2),%k0"
: "=r" (result)
: "rm" (selector), "r" (offset));
return result;
}
 
extern __inline__ void
_farsetsel(unsigned short selector)
{
__asm__ __volatile__ ("movw %w0,%%fs"
:
: "rm" (selector));
}
 
extern __inline__ unsigned short
_fargetsel(void)
{
unsigned short selector;
__asm__ __volatile__ ("movw %%fs,%w0 \n"
: "=r" (selector)
: );
return selector;
}
 
extern __inline__ void
_farnspokeb(unsigned long offset,
unsigned char value)
{
__asm__ __volatile__ (".byte 0x64\n"
" movb %b0,(%k1)"
:
: "qi" (value), "r" (offset));
}
 
extern __inline__ void
_farnspokew(unsigned long offset,
unsigned short value)
{
__asm__ __volatile__ (".byte 0x64\n"
" movw %w0,(%k1)"
:
: "ri" (value), "r" (offset));
}
 
extern __inline__ void
_farnspokel(unsigned long offset,
unsigned long value)
{
__asm__ __volatile__ (".byte 0x64\n"
" movl %k0,(%k1)"
:
: "ri" (value), "r" (offset));
}
 
extern __inline__ unsigned char
_farnspeekb(unsigned long offset)
{
unsigned char result;
__asm__ __volatile__ (".byte 0x64\n"
" movb (%k1),%b0"
: "=q" (result)
: "r" (offset));
return result;
}
 
extern __inline__ unsigned short
_farnspeekw(unsigned long offset)
{
unsigned short result;
__asm__ __volatile__ (".byte 0x64\n"
" movw (%k1),%w0"
: "=r" (result)
: "r" (offset));
return result;
}
 
extern __inline__ unsigned long
_farnspeekl(unsigned long offset)
{
unsigned long result;
__asm__ __volatile__ (".byte 0x64\n"
" movl (%k1),%k0"
: "=r" (result)
: "r" (offset));
return result;
}
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_farptr_h_ */
/contrib/media/updf/include/sys/fcntl.h
0,0 → 1,28
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_fcntl_h_
#define __dj_include_sys_fcntl_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <fcntl.h>
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_fcntl_h_ */
/contrib/media/updf/include/sys/file.h
0,0 → 1,33
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_file_h_
#define __dj_include_sys_file_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#include <fcntl.h>
#include <unistd.h>
#define L_SET 0
#define L_CURR 1
#define L_INCR 1
#define L_XTND 2
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_file_h_ */
/contrib/media/updf/include/sys/fsext.h
0,0 → 1,69
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_fsext_h_
#define __dj_include_sys_fsext_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <stdarg.h>
 
typedef enum {
__FSEXT_nop,
__FSEXT_open,
__FSEXT_creat,
__FSEXT_read,
__FSEXT_write,
__FSEXT_ready,
__FSEXT_close,
__FSEXT_fcntl,
__FSEXT_ioctl,
__FSEXT_lseek,
__FSEXT_link,
__FSEXT_unlink,
__FSEXT_dup,
__FSEXT_dup2,
__FSEXT_fstat,
__FSEXT_stat
} __FSEXT_Fnumber;
 
/* _ready gets passed a fd and should return a mask of these,
as if we were emulating "int ready(int fd)" */
#define __FSEXT_ready_read 1
#define __FSEXT_ready_write 2
#define __FSEXT_ready_error 4
 
/* The return value is nonzero if the function has overridden the
caller's functionality. */
typedef int (__FSEXT_Function)(__FSEXT_Fnumber _function_number,
int *_rv, /*va_list*/void* _args);
 
int __FSEXT_alloc_fd(__FSEXT_Function *_function);
int __FSEXT_set_function(int _fd, __FSEXT_Function *_function);
__FSEXT_Function *__FSEXT_get_function(int _fd);
void *__FSEXT_set_data(int _fd, void *_data);
void *__FSEXT_get_data(int _fd);
 
int __FSEXT_add_open_handler(__FSEXT_Function *_function);
int __FSEXT_call_open_handlers(__FSEXT_Fnumber _function_number,
int *rv, /*va_list*/void* _args);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_fsext_h_ */
/contrib/media/updf/include/sys/ioctl.h
0,0 → 1,361
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_ioctl_h_
#define __dj_include_sys_ioctl_h_
 
#ifdef __cplusplus
extern "C"{
#endif
 
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
/*
** plain ioctl functions. Do not use them.
** Never. Really _N_E_V_E_R_. Unless you really know what
** you are doing.
**
*/
#define DOS_PLAIN_GETDEVDATA 0x00
#define DOS_PLAIN_SETDEVDATA 0x01
#define DOS_PLAIN_RCVDATA 0x02
#define DOS_PLAIN_SNDDATA 0x03
#define DOS_PLAIN_RCVCTLDATA 0x04
#define DOS_PLAIN_SNDCTLDATA 0x05
#define DOS_PLAIN_CHKINSTAT 0x06
#define DOS_PLAIN_CHKOUTSTAT 0x07
#define DOS_PLAIN_ISCHANGEABLE 0x08
#define DOS_PLAIN_ISREDIRBLK 0x09
#define DOS_PLAIN_ISREDIRHND 0x0a
#define DOS_PLAIN_SETRETRY 0x0b
#define DOS_PLAIN_GENCHARREQ 0x0c
#define DOS_PLAIN_GENBLKREQ 0x0d
#define DOS_PLAIN_GLDRVMAP 0x0e
#define DOS_PLAIN_SLDRVMAP 0x0f
#define DOS_PLAIN_QGIOCTLCAPH 0x10
#define DOS_PLAIN_QGIOCTLCAPD 0x11
/*
** Flags for DOS commands
*/
#define DOS_XFER 0x8000 /* use xfer buffer */
#define DOS_RETMASK 0x7000 /* Here we put the bits to tell */
/* what to return. 8 possible values */
#define DOS_BRAINDEAD 0x0400 /* CX does not hold the number of */
/* bytes to transfer */
 
#define DOS_XINARGS(a) ((a & 3)<<12) /* How many extra args we expect. */
#define DOS_RETAX 0x1000 /* return AX as result */
#define DOS_RETDX 0x2000 /* return DX as result */
#define DOS_RETDISI 0x3000 /* return DI SI as result */
/*
** DOS ioctls we support:
*/
#define DOS_GETDEVDATA (DOS_PLAIN_GETDEVDATA| DOS_RETDX|DOS_XINARGS(0))
#define DOS_SETDEVDATA (DOS_PLAIN_SETDEVDATA| DOS_XINARGS(1))
#define DOS_RCVDATA (DOS_PLAIN_RCVDATA |DOS_XFER|DOS_RETAX|DOS_XINARGS(1))
#define DOS_SNDDATA (DOS_PLAIN_SNDDATA |DOS_XFER|DOS_RETAX|DOS_XINARGS(1))
#define DOS_RCVCTLDATA (DOS_PLAIN_RCVCTLDATA|DOS_XFER|DOS_RETAX|DOS_XINARGS(1))
#define DOS_SNDCTLDATA (DOS_PLAIN_SNDCTLDATA|DOS_XFER|DOS_RETAX|DOS_XINARGS(1))
#define DOS_CHKINSTAT (DOS_PLAIN_CHKINSTAT | DOS_RETAX)
#define DOS_CHKOUTSTAT (DOS_PLAIN_CHKOUTSTAT| DOS_RETAX)
#define DOS_ISCHANGEABLE (DOS_PLAIN_ISCHANGEABLE| DOS_RETAX)
#define DOS_ISREDIRBLK (DOS_PLAIN_ISREDIRBLK| DOS_RETDX)
#define DOS_ISREDIRHND (DOS_PLAIN_ISREDIRHND| DOS_RETDX)
#define DOS_SETRETRY (DOS_PLAIN_SETRETRY| DOS_XINARGS(1))
/*
These ones do not fit into my scheme, because they _DO_NOT_ put the size
of the xfer buffer in CX. Aaaaargh
*/
#define DOS_GENCHARREQ (DOS_PLAIN_GENCHARREQ|DOS_BRAINDEAD|DOS_RETDISI)
#define DOS_GENBLKREQ (DOS_PLAIN_GENBLKREQ |DOS_BRAINDEAD|DOS_RETAX)
#define DOS_GLDRVMAP (DOS_PLAIN_GLDRVMAP| DOS_RETAX)
#define DOS_SLDRVMAP (DOS_PLAIN_SLDRVMAP| DOS_RETAX)
#define DOS_QGIOCTLCAPH (DOS_PLAIN_QGIOCTLCAPH| DOS_RETAX)
#define DOS_QGIOCTLCAPD (DOS_PLAIN_QGIOCTLCAPD| DOS_RETAX)
 
 
#define __IS_UNIX_IOCTL(a) ((a) & 0xd0000000U)
#if 0
/*
** UNIX stuff
**
** This is subject to major changes in the near future.
** Do not use it yet.
*/
 
/*
** __WARNING__ :
** This ifdef works for DJGPP, because its io.h
** defines __djgpp_include_io_h_
*/
#ifndef _IO
/*
* Ioctl's have the command encoded in the lower word,
* and the size of any in or out parameters in the upper
* word. The high 2 bits of the upper word are used
* to encode the in/out status of the parameter; for now
* we restrict parameters to at most 128 bytes.
*/
#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */
#define IOC_VOID 0x20000000 /* no parameters */
#define IOC_OUT 0x40000000 /* copy out parameters */
#define IOC_IN 0x80000000 /* copy in parameters */
#define IOC_INOUT (IOC_IN|IOC_OUT)
/* the 0x20000000 is so we can distinguish new ioctl's from old */
#define _IO(x,y) (IOC_VOID|(x<<8)|y)
#define _IOR(x,y,t) (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
#define _IOW(x,y,t) (IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
/* this should be _IORW, but stdio got there first */
#define _IOWR(x,y,t) (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
#endif /* _IO */
/* Common ioctl's for all disciplines which are handled in ttiocom */
enum tty_ioctl {
TXISATTY = ('X'<<8), /* quick path for isatty */
TXTTYNAME, /* quick path for ttyname */
TXGETLD, /* get line discipline */
TXSETLD, /* set line discipline */
TXGETCD, /* get control disciplines */
TXADDCD, /* add control discipline */
TXDELCD, /* delete control discipline */
TXSBAUD, /* set integer baud rate */
TXGBAUD, /* get integer baud rate */
TXSETIHOG, /* set the input buffer limit */
TXSETOHOG, /* set the output buffer limit */
TXGPGRP, /* get p grp with posix security */
TXSPGRP /* set p grp with posix security */
};
 
#define TTNAMEMAX 32 /* used with TXGETLD, et al */
 
union txname { /* used with TXGETCD */
int tx_which; /* which name to get -- inbound */
char tx_name[TTNAMEMAX];/* the name -- outbound */
};
 
/*
* window size structure used with TXSETWIN and TXGETWIN. This is
* exactly the same as the Berkeley structure and can be used with
* TIOCSWINSZ and TIOCGWINSZ -- in fact they are defined to be the
* same.
*/
struct winsize {
unsigned short ws_row; /* rows, in characters */
unsigned short ws_col; /* columns, in characters */
unsigned short ws_xpixel; /* horizontal size, pixels */
unsigned short ws_ypixel; /* vertical size, pixels */
};
 
struct tchars {
char t_intrc; /* interrupt */
char t_quitc; /* quit */
char t_startc; /* start output */
char t_stopc; /* stop output */
char t_eofc; /* end-of-file */
char t_brkc; /* input delimiter (like nl) */
};
struct ltchars {
char t_suspc; /* stop process signal */
char t_dsuspc; /* delayed stop process signal */
char t_rprntc; /* reprint line */
char t_flushc; /* flush output (toggles) */
char t_werasc; /* word erase */
char t_lnextc; /* literal next character */
};
 
/*
* Structure for TIOCGETP and TIOCSETP ioctls.
*/
 
struct sgttyb {
char sg_ispeed; /* input speed */
char sg_ospeed; /* output speed */
char sg_erase; /* erase character */
char sg_kill; /* kill character */
short sg_flags; /* mode flags */
};
 
/*
* Pun for SUN.
*/
struct ttysize {
unsigned short ts_lines;
unsigned short ts_cols;
unsigned short ts_xxx;
unsigned short ts_yyy;
};
#define TIOCGSIZE TIOCGWINSZ
#define TIOCSSIZE TIOCSWINSZ
 
 
 
 
 
#define TIOCGETD _IOR('t', 0, int) /* get line discipline */
#define TIOCSETD _IOW('t', 1, int) /* set line discipline */
#define TIOCHPCL _IO('t', 2) /* hang up on last close */
#define TIOCMODG _IOR('t', 3, int) /* get modem control state */
#define TIOCMODS _IOW('t', 4, int) /* set modem control state */
#define TIOCM_LE 0001 /* line enable */
#define TIOCM_DTR 0002 /* data terminal ready */
#define TIOCM_RTS 0004 /* request to send */
#define TIOCM_ST 0010 /* secondary transmit */
#define TIOCM_SR 0020 /* secondary receive */
#define TIOCM_CTS 0040 /* clear to send */
#define TIOCM_CAR 0100 /* carrier detect */
#define TIOCM_CD TIOCM_CAR
#define TIOCM_RNG 0200 /* ring */
#define TIOCM_RI TIOCM_RNG
#define TIOCM_DSR 0400 /* data set ready */
#define TIOCGETP _IOR('t', 8,struct sgttyb) /* get parameters -- gtty */
#define TIOCSETP _IOW('t', 9,struct sgttyb) /* set parameters -- stty */
#define TIOCSETN _IOW('t',10,struct sgttyb) /* as above, but no flushtty */
#define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */
#define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */
#define TIOCFLUSH _IOW('t', 16, int) /* flush buffers */
#define TIOCSETC _IOW('t',17,struct tchars) /* set special characters */
#define TIOCGETC _IOR('t',18,struct tchars) /* get special characters */
#define TANDEM 0x00000001 /* send stopc on out q full */
#define CBREAK 0x00000002 /* half-cooked mode */
#define LCASE 0x00000004 /* simulate lower case */
#define ECHO 0x00000008 /* echo input */
#define CRMOD 0x00000010 /* map \r to \r\n on output */
#define RAW 0x00000020 /* no i/o processing */
#define ODDP 0x00000040 /* get/send odd parity */
#define EVENP 0x00000080 /* get/send even parity */
#define ANYP 0x000000c0 /* get any parity/send none */
#define CRDELAY 0x00000300 /* \r delay */
#define CR0 0x00000000
#define CR1 0x00000100 /* tn 300 */
#define CR2 0x00000200 /* tty 37 */
#define CR3 0x00000300 /* concept 100 */
#define TBDELAY 0x00000c00 /* horizontal tab delay */
#define TAB0 0x00000000
#define TAB1 0x00000400 /* tty 37 */
#define TAB2 0x00000800
#define XTABS 0x00000c00 /* expand tabs on output */
#define BSDELAY 0x00001000 /* \b delay */
#define BS0 0x00000000
#define BS1 0x00001000
#define VTDELAY 0x00002000 /* vertical tab delay */
#define FF0 0x00000000
#define FF1 0x00002000 /* tty 37 */
#define NLDELAY 0x0000c000 /* \n delay */
#define NL0 0x00000000
#define NL1 0x00004000 /* tty 37 */
#define NL2 0x00008000 /* vt05 */
#define NL3 0x0000c000
#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
#define TOSTOP 0x00010000 /* SIGSTOP on bckgnd output */
#define PRTERA 0x00020000 /* \ ... / erase */
#define CRTERA 0x00040000 /* " \b " to wipe out char */
#define TILDE 0x00080000 /* hazeltine tilde kludge */
#define FLUSHO 0x00100000 /* flush output to terminal */
#define LITOUT 0x00200000 /* literal output */
#define CRTBS 0x00400000 /* do backspacing for crt */
#define MDMBUF 0x00800000 /* dtr pacing */
#define NOHANG 0x01000000 /* no SIGHUP on carrier drop */
#define L001000 0x02000000
#define CRTKIL 0x04000000 /* kill line with " \b " */
#define PASS8 0x08000000
#define CTLECH 0x10000000 /* echo control chars as ^X */
#define PENDIN 0x20000000 /* tp->t_rawq needs reread */
#define DECCTQ 0x40000000 /* only ^Q starts after ^S */
#define NOFLUSH 0x80000000 /* no output flush on signal */
#define TIOCCONS _IOW('t', 98, int) /* become virtual console */
#ifdef _BSD_INCLUDES
/*
* Added for 4.3 BSD.
*/
#define NOFLSH NOFLUSH /* no output flush on signal */
#endif /* _BSD_INCLUDES */
 
/* locals, from 127 down */
#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */
#define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */
#define TIOCLSET _IOW('t', 125, int) /* set entire mode word */
#define TIOCLGET _IOR('t', 124, int) /* get local modes */
#define LCRTBS (CRTBS>>16)
#define LPRTERA (PRTERA>>16)
#define LCRTERA (CRTERA>>16)
#define LTILDE (TILDE>>16)
#define LMDMBUF (MDMBUF>>16)
#define LLITOUT (LITOUT>>16)
#define LTOSTOP (TOSTOP>>16)
#define LFLUSHO (FLUSHO>>16)
#define LNOHANG (NOHANG>>16)
#define LCRTKIL (CRTKIL>>16)
#define LPASS8 (PASS8>>16)
#define LCTLECH (CTLECH>>16)
#define LPENDIN (PENDIN>>16)
#define LDECCTQ (DECCTQ>>16)
#define LNOFLSH (NOFLUSH>>16)
#define TIOCSBRK _IO('t', 123) /* set break bit */
#define TIOCCBRK _IO('t', 122) /* clear break bit */
#define TIOCSDTR _IO('t', 121) /* set data terminal ready */
#define TIOCCDTR _IO('t', 120) /* clear data terminal ready */
#define TIOCGPGRP _IOR('t', 119, int) /* get process group */
#define TIOCSPGRP _IOW('t', 118, int) /* set process gorup */
#define TIOCSLTC _IOW('t',117,struct ltchars) /* set local special chars */
#define TIOCGLTC _IOR('t',116,struct ltchars) /* get local special chars */
#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
#define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */
#define TIOCNOTTY _IO('t', 113) /* void tty association */
#define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */
#define TIOCPKT_DATA 0x00 /* data packet */
#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
#define TIOCPKT_STOP 0x04 /* stop output */
#define TIOCPKT_START 0x08 /* start output */
#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
#define TIOCMSET _IOW('t', 109, int) /* set all modem bits */
#define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */
#define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */
#define TIOCMGET _IOR('t', 106, int) /* get all modem bits */
#define TIOCREMOTE _IOW('t', 105, int) /* remote input editing */
#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
#define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */
#define UIOCCMD(n) _IO('u', n) /* usr cntl op "n" */
 
#define OTTYDISC 0 /* old, v7 std tty driver */
#define NETLDISC 1 /* line discip for berk net */
#define NTTYDISC 2 /* new tty discipline */
#define TABLDISC 3 /* tablet discipline */
#define SLIPDISC 4 /* serial IP discipline */
 
#define FIOCLEX _IO('f', 1) /* set exclusive use on fd */
#define FIONCLEX _IO('f', 2) /* remove exclusive use */
/* another local */
 
#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */
#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */
#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */
 
#define FIOSETOWN _IOW('f', 124, int) /* set owner */
#define FIOGETOWN _IOR('f', 123, int) /* get owner */
 
 
#endif /* 0 */
 
int ioctl( int fd, int cmd, ...);
 
 
#endif /* ! _POSIX_SOURCE */
#endif /* ! __STRICT_ANSI__ */
#endif /* ! __dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_ioctl_h_ */
 
/contrib/media/updf/include/sys/mman.h
0,0 → 1,34
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_mman_h_
#define __dj_include_sys_mman_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* protections are chosen from these bits, or-ed together */
#define PROT_NONE 0 /* no access to these pages */
#define PROT_READ 0x1 /* pages can be read */
#define PROT_WRITE 0x2 /* pages can be written */
#define PROT_EXEC 0 /* pages can be executed - not used */
 
extern int mprotect(void *addr, size_t len, int prot);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_mman_h_ */
/contrib/media/updf/include/sys/mono.h
0,0 → 1,30
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_mono_h_
#define __dj_include_sys_mono_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
void _mono_clear(void);
void _mono_printf(const char *fmt, ...) __attribute__((format(printf,1,2)));
void _mono_putc(int c);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_mono_h_ */
/contrib/media/updf/include/sys/movedata.h
0,0 → 1,60
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_movedata_h_
#define __dj_include_sys_movedata_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <sys/djtypes.h>
 
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
 
/* This header is intended to be included only by other
headers, like <go32.h> and <string.h>. You may
include this directly, but it will be non-portable. */
 
/* These lengths are in bytes, optimized for speed */
void dosmemget(unsigned long _offset, size_t _length, void *_buffer);
void dosmemput(const void *_buffer, size_t _length, unsigned long _offset);
 
/* The lengths here are in TRANSFERS, not bytes! */
void _dosmemgetb(unsigned long _offset, size_t _xfers, void *_buffer);
void _dosmemgetw(unsigned long _offset, size_t _xfers, void *_buffer);
void _dosmemgetl(unsigned long _offset, size_t _xfers, void *_buffer);
void _dosmemputb(const void *_buffer, size_t _xfers, unsigned long _offset);
void _dosmemputw(const void *_buffer, size_t _xfers, unsigned long _offset);
void _dosmemputl(const void *_buffer, size_t _xfers, unsigned long _offset);
 
 
/* This length is in bytes, optimized for speed */
void movedata(unsigned _source_selector, unsigned _source_offset,
unsigned _dest_selector, unsigned _dest_offset,
size_t _length);
 
/* The lengths here are in TRANSFERS, not bytes! */
void _movedatab(unsigned, unsigned, unsigned, unsigned, size_t);
void _movedataw(unsigned, unsigned, unsigned, unsigned, size_t);
void _movedatal(unsigned, unsigned, unsigned, unsigned, size_t);
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_movedata_h_ */
/contrib/media/updf/include/sys/nearptr.h
0,0 → 1,37
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_nearptr_h_
#define __dj_include_sys_nearptr_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/* Functions to enable "near" pointer access to DOS memory under DPMI
CW Sandmann 7-95 NO WARRANTY: WARNING, since these functions disable
memory protection, they MAY DESTROY EVERYTHING ON YOUR COMPUTER! */
 
int __djgpp_nearptr_enable(void); /* Returns 0 if feature not avail */
void __djgpp_nearptr_disable(void); /* Enables protection */
extern int __djgpp_selector_limit; /* Limit on CS and on DS if prot */
extern int __djgpp_base_address; /* Used in calculation below */
 
#define __djgpp_conventional_base (-__djgpp_base_address)
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_nearptr_h_ */
/contrib/media/updf/include/sys/param.h
0,0 → 1,31
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_param_h_
#define __dj_include_sys_param_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <limits.h>
 
#define MAXPATHLEN PATH_MAX
#define MAXGETHOSTNAME 128
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_param_h_ */
/contrib/media/updf/include/sys/poll.h
0,0 → 1,74
/* Compatibility definitions for System V `poll' interface.
Copyright (C) 1994,1996-2001,2004,2005,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
 
The GNU C 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.1 of the License, or (at your option) any later version.
 
The GNU C 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 the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
 
#ifndef _SYS_POLL_H
#define _SYS_POLL_H 1
 
#include <features.h>
 
/* Get the platform dependent bits of `poll'. */
#include <bits/poll.h>
#ifdef __USE_GNU
/* Get the __sigset_t definition. */
# include <bits/sigset.h>
/* Get the timespec definition. */
# define __need_timespec
# include <time.h>
#endif
 
 
/* Type used for the number of file descriptors. */
typedef unsigned long int nfds_t;
 
/* Data structure describing a polling request. */
struct pollfd
{
int fd; /* File descriptor to poll. */
short int events; /* Types of events poller cares about. */
short int revents; /* Types of events that actually occurred. */
};
 
 
__BEGIN_DECLS
 
/* Poll the file descriptors described by the NFDS structures starting at
FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
an event to occur; if TIMEOUT is -1, block until an event occurs.
Returns the number of file descriptors with events, zero if timed out,
or -1 for errors.
 
This function is a cancellation point and therefore not marked with
__THROW. */
extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout);
 
#ifdef __USE_GNU
/* Like poll, but before waiting the threads signal mask is replaced
with that specified in the fourth parameter. For better usability,
the timeout value is specified using a TIMESPEC object.
 
This function is a cancellation point and therefore not marked with
__THROW. */
extern int ppoll (struct pollfd *__fds, nfds_t __nfds,
__const struct timespec *__timeout,
__const __sigset_t *__ss);
#endif
 
__END_DECLS
 
#endif /* sys/poll.h */
/contrib/media/updf/include/sys/resource.h
0,0 → 1,73
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_resource_h_
#define __dj_include_sys_resource_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <time.h>
 
#define RUSAGE_SELF 0 /* calling process */
#define RUSAGE_CHILDREN -1 /* terminated child processes */
 
struct rusage {
struct timeval ru_utime; /* user time used */
struct timeval ru_stime; /* system time used */
long ru_maxrss; /* integral max resident set size */
long ru_ixrss; /* integral shared text memory size */
long ru_idrss; /* integral unshared data size */
long ru_isrss; /* integral unshared stack size */
long ru_minflt; /* page reclaims */
long ru_majflt; /* page faults */
long ru_nswap; /* swaps */
long ru_inblock; /* block input operations */
long ru_oublock; /* block output operations */
long ru_msgsnd; /* messages sent */
long ru_msgrcv; /* messages received */
long ru_nsignals; /* signals received */
long ru_nvcsw; /* voluntary context switches */
long ru_nivcsw; /* involuntary context switches */
};
 
#define RLIMIT_CPU 0 /* cpu time in milliseconds */
#define RLIMIT_FSIZE 1 /* maximum file size */
#define RLIMIT_DATA 2 /* data size */
#define RLIMIT_STACK 3 /* stack size */
#define RLIMIT_CORE 4 /* core file size */
#define RLIMIT_RSS 5 /* resident set size */
#define RLIMIT_MEMLOCK 6 /* locked-in-memory address space */
#define RLIMIT_NPROC 7 /* number of processes */
#define RLIMIT_NOFILE 8 /* number of open files */
 
#define RLIM_NLIMITS 9 /* number of resource limits */
#define RLIM_INFINITY ((long) ((1UL << 31) - 1UL))
 
struct rlimit {
long rlim_cur; /* current (soft) limit */
long rlim_max; /* maximum value for rlim_cur */
};
 
int getrusage(int _who, struct rusage *_rusage);
int getrlimit(int _rltype, struct rlimit *_rlimit);
int setrlimit(int _rltype, const struct rlimit *_rlimit);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_resource_h_ */
/contrib/media/updf/include/sys/segments.h
0,0 → 1,52
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_segments_h_
#define __dj_include_sys_segments_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
static __inline__ int
_my_cs(void)
{
unsigned short result;
__asm__("movw %%cs,%0" : "=r" (result));
return result;
}
 
static __inline__ int
_my_ds(void)
{
unsigned short result;
__asm__("movw %%ds,%0" : "=r" (result));
return result;
}
 
static __inline__ int
_my_ss(void)
{
unsigned short result;
__asm__("movw %%ss,%0" : "=r" (result));
return result;
}
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_segment_h_ */
/contrib/media/updf/include/sys/socket.h
0,0 → 1,410
#ifndef _SYS_SOCKET_H
#define _SYS_SOCKET_H
 
#include <sys/cdefs.h>
#include <sys/types.h>
#include <inttypes.h>
 
__BEGIN_DECLS
 
#define SOL_SOCKET 1
 
#define SO_DEBUG 1
#define SO_REUSEADDR 2
#define SO_TYPE 3
#define SO_ERROR 4
#define SO_DONTROUTE 5
#define SO_BROADCAST 6
#define SO_SNDBUF 7
#define SO_RCVBUF 8
#define SO_KEEPALIVE 9
#define SO_OOBINLINE 10
#define SO_NO_CHECK 11
#define SO_PRIORITY 12
#define SO_LINGER 13
#define SO_BSDCOMPAT 14
/* To add :#define SO_REUSEPORT 15 */
#define SO_PASSCRED 16
#define SO_PEERCRED 17
#define SO_RCVLOWAT 18
#define SO_SNDLOWAT 19
#define SO_RCVTIMEO 20
#define SO_SNDTIMEO 21
#define SO_ACCEPTCONN 30
 
/* Security levels - as per NRL IPv6 - don't actually do anything */
#define SO_SECURITY_AUTHENTICATION 22
#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
#define SO_SECURITY_ENCRYPTION_NETWORK 24
 
#define SO_BINDTODEVICE 25
 
/* Socket filtering */
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
 
#define SO_PEERNAME 28
#define SO_TIMESTAMP 29
#define SCM_TIMESTAMP SO_TIMESTAMP
 
/* Socket types. */
#define SOCK_STREAM 1 /* stream (connection) socket */
#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
#define SOCK_RAW 3 /* raw socket */
#define SOCK_RDM 4 /* reliably-delivered message */
#define SOCK_SEQPACKET 5 /* sequential packet socket */
#define SOCK_PACKET 10 /* linux specific way of */
/* getting packets at the dev */
/* level. For writing rarp and */
/* other similar things on the */
/* user level. */
 
struct sockaddr {
sa_family_t sa_family;
char sa_data[14];
};
 
struct linger {
int l_onoff;
int l_linger;
};
 
struct iovec {
void* iov_base; /* BSD uses caddr_t (1003.1g requires void *) */
size_t iov_len; /* Must be size_t (1003.1g) */
};
 
struct msghdr {
void* msg_name; /* Socket name */
int msg_namelen; /* Length of name */
struct iovec* msg_iov; /* Data blocks */
size_t msg_iovlen; /* Number of blocks */
void* msg_control; /* Per protocol magic (eg BSD file descriptor passing) */
size_t msg_controllen; /* Length of cmsg list */
unsigned msg_flags;
};
 
struct cmsghdr {
size_t cmsg_len; /* data byte count, including hdr */
int cmsg_level; /* originating protocol */
int cmsg_type; /* protocol-specific type */
};
 
#define UIO_FASTIOV 8
#define UIO_MAXIOV 1024
 
/* "Socket"-level control message types: */
 
#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */
#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */
#define SCM_CONNECT 0x03 /* rw: struct scm_connect */
 
struct ucred {
unsigned int pid;
unsigned int uid;
unsigned int gid;
};
 
/* Supported address families. */
#define AF_UNSPEC 0
#define AF_UNIX 1 /* Unix domain sockets */
#define AF_LOCAL 1 /* POSIX name for AF_UNIX */
#define AF_INET 2 /* Internet IP Protocol */
#define AF_AX25 3 /* Amateur Radio AX.25 */
#define AF_IPX 4 /* Novell IPX */
#define AF_APPLETALK 5 /* AppleTalk DDP */
#define AF_NETROM 6 /* Amateur Radio NET/ROM */
#define AF_BRIDGE 7 /* Multiprotocol bridge */
#define AF_ATMPVC 8 /* ATM PVCs */
#define AF_X25 9 /* Reserved for X.25 project */
#define AF_INET6 10 /* IP version 6 */
#define AF_ROSE 11 /* Amateur Radio X.25 PLP */
#define AF_DECnet 12 /* Reserved for DECnet project */
#define AF_NETBEUI 13 /* Reserved for 802.2LLC project*/
#define AF_SECURITY 14 /* Security callback pseudo AF */
#define AF_KEY 15 /* PF_KEY key management API */
#define AF_NETLINK 16
#define AF_ROUTE AF_NETLINK /* Alias to emulate 4.4BSD */
#define AF_PACKET 17 /* Packet family */
#define AF_ASH 18 /* Ash */
#define AF_ECONET 19 /* Acorn Econet */
#define AF_ATMSVC 20 /* ATM SVCs */
#define AF_SNA 22 /* Linux SNA Project (nutters!) */
#define AF_IRDA 23 /* IRDA sockets */
#define AF_PPPOX 24 /* PPPoX sockets */
#define AF_WANPIPE 25 /* Wanpipe API Sockets */
#define AF_MAX 32 /* For now.. */
 
/* Protocol families, same as address families. */
#define PF_UNSPEC AF_UNSPEC
#define PF_UNIX AF_UNIX
#define PF_LOCAL AF_LOCAL
#define PF_INET AF_INET
#define PF_AX25 AF_AX25
#define PF_IPX AF_IPX
#define PF_APPLETALK AF_APPLETALK
#define PF_NETROM AF_NETROM
#define PF_BRIDGE AF_BRIDGE
#define PF_ATMPVC AF_ATMPVC
#define PF_X25 AF_X25
#define PF_INET6 AF_INET6
#define PF_ROSE AF_ROSE
#define PF_DECnet AF_DECnet
#define PF_NETBEUI AF_NETBEUI
#define PF_SECURITY AF_SECURITY
#define PF_KEY AF_KEY
#define PF_NETLINK AF_NETLINK
#define PF_ROUTE AF_ROUTE
#define PF_PACKET AF_PACKET
#define PF_ASH AF_ASH
#define PF_ECONET AF_ECONET
#define PF_ATMSVC AF_ATMSVC
#define PF_SNA AF_SNA
#define PF_IRDA AF_IRDA
#define PF_PPPOX AF_PPPOX
#define PF_WANPIPE AF_WANPIPE
#define PF_MAX AF_MAX
 
/* Maximum queue length specifiable by listen. */
#define SOMAXCONN 128
 
/* Flags we can use with send/ and recv.
Added those for 1003.1g not all are supported yet */
#define MSG_OOB 1
#define MSG_PEEK 2
#define MSG_DONTROUTE 4
#define MSG_TRYHARD 4 /* Synonym for MSG_DONTROUTE for DECnet */
#define MSG_CTRUNC 8
#define MSG_PROBE 0x10 /* Do not send. Only probe path f.e. for MTU */
#define MSG_TRUNC 0x20
#define MSG_DONTWAIT 0x40 /* Nonblocking io */
#define MSG_EOR 0x80 /* End of record */
#define MSG_WAITALL 0x100 /* Wait for a full request */
#define MSG_FIN 0x200
#define MSG_EOF MSG_FIN
#define MSG_SYN 0x400
#define MSG_CONFIRM 0x800 /* Confirm path validity */
#define MSG_RST 0x1000
#define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */
#define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
#define MSG_MORE 0x8000 /* Sender will send more */
 
/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
#define SOL_IP 0
/* #define SOL_ICMP 1 No-no-no! Due to Linux :-) we cannot use SOL_ICMP=1 */
#define SOL_TCP 6
#define SOL_UDP 17
#define SOL_IPV6 41
#define SOL_ICMPV6 58
#define SOL_RAW 255
#define SOL_IPX 256
#define SOL_AX25 257
#define SOL_ATALK 258
#define SOL_NETROM 259
#define SOL_ROSE 260
#define SOL_DECNET 261
#define SOL_X25 262
#define SOL_PACKET 263
#define SOL_ATM 264 /* ATM layer (cell level) */
#define SOL_AAL 265 /* ATM Adaption Layer (packet level) */
#define SOL_IRDA 266
 
/* IPX options */
#define IPX_TYPE 1
 
#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
#define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg))
#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
 
static inline struct cmsghdr* __cmsg_nxthdr(void *__ctl, size_t __size, struct cmsghdr *__cmsg)
{
struct cmsghdr * __ptr;
__ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len));
if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
return (struct cmsghdr *)0;
return __ptr;
}
 
static inline struct cmsghdr* cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
{
return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
}
 
#define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
 
#define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ? \
(struct cmsghdr *)(ctl) : \
(struct cmsghdr *)NULL)
#define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
 
struct sockaddr_storage {
sa_family_t ss_family;
uint32_t __ss_align;
char __ss_padding[(128 - (2 * sizeof (uint32_t ))) ];
};
 
#ifndef SOCK_DGRAM
/* the Linux kernel headers suck really badly on non-x86 */
#define SOCK_STREAM 1 /* stream (connection) socket */
#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
#define SOCK_RAW 3 /* raw socket */
#define SOCK_RDM 4 /* reliably-delivered message */
#define SOCK_SEQPACKET 5 /* sequential packet socket */
#define SOCK_PACKET 10 /* linux specific way of */
#endif
 
int socket(int domain, int type, int protocol) ;
int accept(int s, struct sockaddr *addr, socklen_t *addrlen) ;
int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) ;
int bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen) ;
int recv(int s, void *buf, size_t len, int flags) ;
int recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen) ;
int recvmsg(int s, struct msghdr *msg, int flags) ;
int send(int s, const void *msg, size_t len, int flags) ;
int sendto(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) ;
int sendmsg(int s, const struct msghdr *msg, int flags) ;
 
int getpeername(int s, struct sockaddr *name, socklen_t *namelen) ;
int getsockname(int s , struct sockaddr * name , socklen_t * namelen) ;
 
int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) ;
int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen) ;
 
int listen(int s, int backlog) ;
 
#define SHUT_RD 0
#define SHUT_WR 1
#define SHUT_RDWR 2
int shutdown(int s, int how) ;
 
int socketpair(int d, int type, int protocol, int sv[2]);
 
/* currently not supported: */
#define NI_NOFQDN 1
 
#define NI_NUMERICHOST 2
#define NI_NAMEREQD 4
#define NI_NUMERICSERV 8
#define NI_DGRAM 16
 
struct addrinfo {
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
size_t ai_addrlen;
struct sockaddr *ai_addr;
char *ai_canonname;
struct addrinfo *ai_next;
};
 
int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
size_t hostlen, char *serv, size_t servlen, int flags) ;
int getaddrinfo(const char *node, const char *service, const struct
addrinfo *hints, struct addrinfo **res) ;
void freeaddrinfo(struct addrinfo *res) ;
const char *gai_strerror(int errcode) ;
 
#define EAI_FAMILY -1
#define EAI_SOCKTYPE -2
#define EAI_BADFLAGS -3
#define EAI_NONAME -4
#define EAI_SERVICE -5
#define EAI_ADDRFAMILY -6
#define EAI_NODATA -7
#define EAI_MEMORY -8
#define EAI_FAIL -9
#define EAI_AGAIN -10
#define EAI_SYSTEM -11
 
#define AI_NUMERICHOST 1
#define AI_CANONNAME 2
#define AI_PASSIVE 4
 
/* Linux-specific socket ioctls */
#define SIOCINQ FIONREAD
#define SIOCOUTQ TIOCOUTQ
 
/* Routing table calls. */
#define SIOCADDRT 0x890B /* add routing table entry */
#define SIOCDELRT 0x890C /* delete routing table entry */
#define SIOCRTMSG 0x890D /* call to routing system */
 
/* Socket configuration controls. */
#define SIOCGIFNAME 0x8910 /* get iface name */
#define SIOCSIFLINK 0x8911 /* set iface channel */
#define SIOCGIFCONF 0x8912 /* get iface list */
#define SIOCGIFFLAGS 0x8913 /* get flags */
#define SIOCSIFFLAGS 0x8914 /* set flags */
#define SIOCGIFADDR 0x8915 /* get PA address */
#define SIOCSIFADDR 0x8916 /* set PA address */
#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
#define SIOCGIFNETMASK 0x891b /* get network PA mask */
#define SIOCSIFNETMASK 0x891c /* set network PA mask */
#define SIOCGIFMETRIC 0x891d /* get metric */
#define SIOCSIFMETRIC 0x891e /* set metric */
#define SIOCGIFMEM 0x891f /* get memory address (BSD) */
#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
#define SIOCGIFMTU 0x8921 /* get MTU size */
#define SIOCSIFMTU 0x8922 /* set MTU size */
#define SIOCSIFNAME 0x8923 /* set interface name */
#define SIOCSIFHWADDR 0x8924 /* set hardware address */
#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
#define SIOCSIFENCAP 0x8926
#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
#define SIOCSIFSLAVE 0x8930
#define SIOCADDMULTI 0x8931 /* Multicast address lists */
#define SIOCDELMULTI 0x8932
#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
#define SIOCGIFPFLAGS 0x8935
#define SIOCDIFADDR 0x8936 /* delete PA address */
#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
#define SIOCGIFCOUNT 0x8938 /* get number of devices */
 
#define SIOCGIFBR 0x8940 /* Bridging support */
#define SIOCSIFBR 0x8941 /* Set bridging options */
 
#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
 
#define SIOCGIFDIVERT 0x8944 /* Frame diversion support */
#define SIOCSIFDIVERT 0x8945 /* Set frame diversion options */
 
#define SIOCETHTOOL 0x8946 /* Ethtool interface */
 
/* ARP cache control calls. */
/* 0x8950 - 0x8952 * obsolete calls, don't re-use */
#define SIOCDARP 0x8953 /* delete ARP table entry */
#define SIOCGARP 0x8954 /* get ARP table entry */
#define SIOCSARP 0x8955 /* set ARP table entry */
 
/* RARP cache control calls. */
#define SIOCDRARP 0x8960 /* delete RARP table entry */
#define SIOCGRARP 0x8961 /* get RARP table entry */
#define SIOCSRARP 0x8962 /* set RARP table entry */
 
/* Driver configuration calls */
 
#define SIOCGIFMAP 0x8970 /* Get device parameters */
#define SIOCSIFMAP 0x8971 /* Set device parameters */
 
/* DLCI configuration calls */
 
#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
 
#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
 
#define _LINUX_SOCKET_H
 
__END_DECLS
 
#endif
/contrib/media/updf/include/sys/stat.h
0,0 → 1,128
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_stat_h_
#define __dj_include_sys_stat_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#define S_ISBLK(m) (((m) & 0xf000) == 0x1000)
#define S_ISCHR(m) (((m) & 0xf000) == 0x2000)
#define S_ISDIR(m) (((m) & 0xf000) == 0x3000)
#define S_ISFIFO(m) (((m) & 0xf000) == 0x4000)
#define S_ISREG(m) (((m) & 0xf000) == 0x0000)
 
#define S_ISUID 0x80000000
#define S_ISGID 0x40000000
 
#define S_IRUSR 00400
#define S_IRGRP 00040
#define S_IROTH 00004
#define S_IWUSR 00200
#define S_IWGRP 00020
#define S_IWOTH 00002
#define S_IXUSR 00100
#define S_IXGRP 00010
#define S_IXOTH 00001
#define S_IRWXU 00700
#define S_IRWXG 00070
#define S_IRWXO 00007
 
#include <sys/types.h>
#include <sys/djtypes.h>
__DJ_time_t
#undef __DJ_time_t
#define __DJ_time_t
 
struct stat {
time_t st_atime;
time_t st_ctime;
dev_t st_dev;
gid_t st_gid;
ino_t st_ino;
mode_t st_mode;
time_t st_mtime;
nlink_t st_nlink;
off_t st_size;
off_t st_blksize;
uid_t st_uid;
dev_t st_rdev; /* unused */
int st_blocks;
};
 
int chmod(const char *_path, mode_t _mode);
int fstat(int _fildes, struct stat *_buf);
int mkdir(const char *_path, mode_t _mode);
int mkfifo(const char *_path, mode_t _mode);
int stat(const char *_path, struct stat *_buf);
mode_t umask(mode_t _cmask);
 
#ifndef _POSIX_SOURCE
 
/* POSIX.1 doesn't mention these at all */
 
#define S_IFMT 0xf000
 
#define S_IFREG 0x0000
#define S_IFBLK 0x1000
#define S_IFCHR 0x2000
#define S_IFDIR 0x3000
#define S_IFIFO 0x4000
#define S_IFFIFO S_IFIFO
 
#define S_IFLABEL 0x5000
#define S_ISLABEL(m) (((m) & 0xf000) == 0x5000)
 
void _fixpath(const char *, char *);
unsigned short _get_magic(const char *, int);
int _is_executable(const char *, int, const char *);
int mknod(const char *_path, mode_t _mode, dev_t _dev);
char * _truename(const char *, char *);
 
/* Bit-mapped variable _djstat_flags describes what expensive
f?stat() features our application needs. If you don't need a
feature, set its bit in the variable. By default, all the
bits are cleared (i.e., you get the most expensive code). */
#define _STAT_INODE 1 /* should we bother getting inode numbers? */
#define _STAT_EXEC_EXT 2 /* get execute bits from file extension? */
#define _STAT_EXEC_MAGIC 4 /* get execute bits from magic signature? */
#define _STAT_DIRSIZE 8 /* compute directory size? */
#define _STAT_ROOT_TIME 0x10 /* try to get root dir time stamp? */
#define _STAT_WRITEBIT 0x20 /* fstat() needs write bit? */
 
extern unsigned short _djstat_flags;
 
/* Bit-mapped variable _djstat_fail_bits describes which individual
undocumented features f?stat() failed to use. To get a human-
readable description of the bits, call _djstat_describe_lossage(). */
#define _STFAIL_SDA 1 /* Get SDA call failed */
#define _STFAIL_OSVER 2 /* Unsupported DOS version */
#define _STFAIL_BADSDA 4 /* Bad pointer to SDA */
#define _STFAIL_TRUENAME 8 /* _truename() failed */
#define _STFAIL_HASH 0x10 /* inode defaults to hashing */
#define _STFAIL_LABEL 0x20 /* Root dir, but no volume label */
#define _STFAIL_DCOUNT 0x40 /* dirent_count ridiculously large */
#define _STFAIL_WRITEBIT 0x80 /* fstat() failed to get write access bit */
#define _STFAIL_DEVNO 0x100 /* fstat() failed to get device number */
#define _STFAIL_BADSFT 0x200 /* SFT entry found, but can't be trusted */
#define _STFAIL_SFTIDX 0x400 /* bad SFT index in JFT */
#define _STFAIL_SFTNF 0x800 /* file entry not found in SFT array */
 
extern unsigned short _djstat_fail_bits;
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_stat_h_ */
/contrib/media/updf/include/sys/sysmacros.h
0,0 → 1,31
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_sysmacros_h_
#define __dj_include_sys_sysmacros_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#define major(x) ((int)(((unsigned)(x) >> 8) & 0xff))
#define minor(x) ((int)((x) & 0xff))
 
#define makedev(x,y) ((dev_t)(((x) << 8) | (y)))
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_sysmacros_h_ */
/contrib/media/updf/include/sys/system.h
0,0 → 1,74
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_system_h__
#define __dj_include_sys_system_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
extern int _shell_command (const char *_prog, const char *_cmdline);
extern int _is_unixy_shell (const char *_prog);
extern int _is_dos_shell (const char *_prog);
 
/* Checking for special executable formats */
 
typedef struct {
char magic[16];
int struct_length;
char go32[16];
unsigned char buffer[0];
} _v1_stubinfo;
 
 
typedef struct {
union {
unsigned version:8; /* The version of DJGPP created that COFF exe */
struct {
unsigned minor:4; /* The minor version of DJGPP */
unsigned major:4; /* The major version of DJGPP */
} v;
} version;
 
unsigned object_format:4; /* What an object format */
# define _V2_OBJECT_FORMAT_UNKNOWN 0x00
# define _V2_OBJECT_FORMAT_COFF 0x01
 
unsigned exec_format:4; /* What an executable format */
# define _V2_EXEC_FORMAT_UNKNOWN 0x00
# define _V2_EXEC_FORMAT_COFF 0x01
# define _V2_EXEC_FORMAT_STUBCOFF 0x02
# define _V2_EXEC_FORMAT_EXE 0x03
# define _V2_EXEC_FORMAT_UNIXSCRIPT 0x04
 
unsigned valid:1; /* Only when nonzero all the information is valid */
 
unsigned has_stubinfo:1; /* When nonzero the stubinfo info is valid */
 
unsigned unused:14;
 
_v1_stubinfo *stubinfo;
} _v2_prog_type;
 
/* When program == NULL you have to pass a valid file handle
in fd, otherwise the file is opened and closed by the function */
const _v2_prog_type *_check_v2_prog(const char *program, int fd);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_sys_system_h__ */
/contrib/media/updf/include/sys/time.h
0,0 → 1,47
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_time_h_
#define __dj_include_sys_time_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <time.h>
 
#define ITIMER_REAL 0
#define ITIMER_PROF 1
 
struct itimerval {
struct timeval it_interval; /* timer interval */
struct timeval it_value; /* current value */
};
 
/* Applications should set this to the number of microseconds between
timer ticks if they reprogram the system clock. By default, it is
set to -1, which causes setitimer to use the default 54.925 msec
clock granularity. */
extern long __djgpp_clock_tick_interval;
 
int getitimer(int _which, struct itimerval *_value);
int setitimer(int _which, struct itimerval *_value, struct itimerval *_ovalue);
int utimes(const char *_file, struct timeval _tvp[2]);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_time_h_ */
/contrib/media/updf/include/sys/timeb.h
0,0 → 1,42
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_timeb_h_
#define __dj_include_sys_timeb_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#include <sys/djtypes.h>
 
__DJ_time_t
#undef __DJ_time_t
#define __DJ_time_t
 
struct timeb
{
time_t time; /* Seconds since the epoch */
unsigned short millitm;
short timezone;
short dstflag;
};
 
extern int ftime(struct timeb *);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_timeb_h_ */
/contrib/media/updf/include/sys/times.h
0,0 → 1,40
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_times_h_
#define __dj_include_sys_times_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#include <sys/djtypes.h>
__DJ_clock_t
#undef __DJ_clock_t
#define __DJ_clock_t
 
struct tms {
clock_t tms_utime;
clock_t tms_cstime;
clock_t tms_cutime;
clock_t tms_stime;
};
 
clock_t times(struct tms *buffer);
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_times_h_ */
/contrib/media/updf/include/sys/types.h
0,0 → 1,63
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_types_h_
#define __dj_include_sys_types_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include <sys/djtypes.h>
typedef int dev_t;
typedef int ino_t;
typedef int mode_t;
typedef int nlink_t;
 
__DJ_gid_t
#undef __DJ_gid_t
#define __DJ_gid_t
__DJ_off_t
#undef __DJ_off_t
#define __DJ_off_t
__DJ_pid_t
#undef __DJ_pid_t
#define __DJ_pid_t
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
__DJ_ssize_t
#undef __DJ_ssize_t
#define __DJ_ssize_t
__DJ_uid_t
#undef __DJ_uid_t
#define __DJ_uid_t
 
/* Allow including program to override. */
#ifndef FD_SETSIZE
#define FD_SETSIZE 256
#endif
 
typedef struct fd_set {
unsigned char fd_bits [((FD_SETSIZE) + 7) / 8];
} fd_set;
 
#define FD_SET(n, p) ((p)->fd_bits[(n) / 8] |= (1 << ((n) & 7)))
#define FD_CLR(n, p) ((p)->fd_bits[(n) / 8] &= ~(1 << ((n) & 7)))
#define FD_ISSET(n, p) ((p)->fd_bits[(n) / 8] & (1 << ((n) & 7)))
#define FD_ZERO(p) memset ((void *)(p), 0, sizeof (*(p)))
 
__DJ_time_t
#undef __DJ_time_t
#define __DJ_time_t
 
#define __socklen_t_defined
typedef unsigned int socklen_t;
typedef unsigned short sa_family_t;
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_types_h_ */
/contrib/media/updf/include/sys/user.h
0,0 → 1,103
/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
 
The GNU C 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.1 of the License, or (at your option) any later version.
 
The GNU C 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 the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
 
#ifndef _SYS_USER_H
#define _SYS_USER_H 1
 
/* The whole purpose of this file is for GDB and GDB only. Don't read
too much into it. Don't use it for anything other than GDB unless
you know what you are doing. */
 
struct user_fpregs_struct
{
long int cwd;
long int swd;
long int twd;
long int fip;
long int fcs;
long int foo;
long int fos;
long int st_space [20];
};
 
struct user_fpxregs_struct
{
unsigned short int cwd;
unsigned short int swd;
unsigned short int twd;
unsigned short int fop;
long int fip;
long int fcs;
long int foo;
long int fos;
long int mxcsr;
long int reserved;
long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
long int padding[56];
};
 
struct user_regs_struct
{
long int ebx;
long int ecx;
long int edx;
long int esi;
long int edi;
long int ebp;
long int eax;
long int xds;
long int xes;
long int xfs;
long int xgs;
long int orig_eax;
long int eip;
long int xcs;
long int eflags;
long int esp;
long int xss;
};
 
struct user
{
struct user_regs_struct regs;
int u_fpvalid;
struct user_fpregs_struct i387;
unsigned long int u_tsize;
unsigned long int u_dsize;
unsigned long int u_ssize;
unsigned long start_code;
unsigned long start_stack;
long int signal;
int reserved;
struct user_regs_struct* u_ar0;
struct user_fpregs_struct* u_fpstate;
unsigned long int magic;
char u_comm [32];
int u_debugreg [8];
};
 
#define PAGE_SHIFT 12
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#define NBPG PAGE_SIZE
#define UPAGES 1
#define HOST_TEXT_START_ADDR (u.start_code)
#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
 
#endif /* _SYS_USER_H */
/contrib/media/updf/include/sys/utsname.h
0,0 → 1,36
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_utsname_h_
#define __dj_include_sys_utsname_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
struct utsname {
char machine[9];
char nodename[32];
char release[9];
char sysname[9];
char version[9];
};
 
int uname(struct utsname *name);
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_utsname_h_ */
/contrib/media/updf/include/sys/version.h
0,0 → 1,19
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
 
#undef DJGPP
#undef __DJGPP
#undef __DJGPP__
 
#define DJGPP 2
#define __DJGPP 2
#define __DJGPP__ 2
 
#undef DJGPP_MINOR
#undef __DJGPP_MINOR
#undef __DJGPP_MINOR__
 
#define DJGPP_MINOR 3
#define __DJGPP_MINOR 3
#define __DJGPP_MINOR__ 3
 
/contrib/media/updf/include/sys/vfs.h
0,0 → 1,50
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_vfs_h_
#define __dj_include_sys_vfs_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
typedef long fsid_t[2];
 
#define MOUNT_UFS 0
#define MOUNT_NFS 1 /* Not possible on DOS */
#define MOUNT_CDFS 2 /* Not possible on DOS */
 
#define FS_MAGIC 0x11954 /* Taken from HP-UX */
 
struct statfs
{
long f_type;
long f_bsize;
long f_blocks;
long f_bfree;
long f_bavail;
long f_files;
long f_ffree;
fsid_t f_fsid;
long f_magic;
};
 
extern int statfs(const char *, struct statfs *);
extern int fstatfs(int, struct statfs *);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_vfs_h_ */
/contrib/media/updf/include/sys/wait.h
0,0 → 1,45
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_wait_h_
#define __dj_include_sys_wait_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#include <sys/djtypes.h>
 
#define WEXITSTATUS(stat_val) ( (stat_val) & 0x000ff)
#define WIFEXITED(stat_val) (!((stat_val) & 0x3ff00))
#define WIFSIGNALED(stat_val) ( ((stat_val) & 0x3ff00))
#define WIFSTOPPED(stat_val) 0
#define WNOHANG 1
#define WSTOPSIG(stat_val) 0
#define WTERMSIG(stat_val) ( ((stat_val) >> 8 ) & 0x3ff)
#define WUNTRACED 0
 
__DJ_pid_t
#undef __DJ_pid_t
#define __DJ_pid_t
 
pid_t wait(int *stat_loc);
pid_t waitpid(pid_t pid, int *stat_loc, int options);
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_wait_h_ */
/contrib/media/updf/include/t1.h
0,0 → 1,147
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __T1_H
#define __T1_H
/**
@file t1.h
@brief Implementation of the tier-1 coding (coding of code-block coefficients) (T1)
 
The functions in T1.C have for goal to realize the tier-1 coding operation. The functions
in T1.C are used by some function in TCD.C.
*/
 
/** @defgroup T1 T1 - Implementation of the tier-1 coding */
/*@{*/
 
/* ----------------------------------------------------------------------- */
#define T1_NMSEDEC_BITS 7
 
#define T1_SIG_NE 0x0001 /**< Context orientation : North-East direction */
#define T1_SIG_SE 0x0002 /**< Context orientation : South-East direction */
#define T1_SIG_SW 0x0004 /**< Context orientation : South-West direction */
#define T1_SIG_NW 0x0008 /**< Context orientation : North-West direction */
#define T1_SIG_N 0x0010 /**< Context orientation : North direction */
#define T1_SIG_E 0x0020 /**< Context orientation : East direction */
#define T1_SIG_S 0x0040 /**< Context orientation : South direction */
#define T1_SIG_W 0x0080 /**< Context orientation : West direction */
#define T1_SIG_OTH (T1_SIG_N|T1_SIG_NE|T1_SIG_E|T1_SIG_SE|T1_SIG_S|T1_SIG_SW|T1_SIG_W|T1_SIG_NW)
#define T1_SIG_PRIM (T1_SIG_N|T1_SIG_E|T1_SIG_S|T1_SIG_W)
 
#define T1_SGN_N 0x0100
#define T1_SGN_E 0x0200
#define T1_SGN_S 0x0400
#define T1_SGN_W 0x0800
#define T1_SGN (T1_SGN_N|T1_SGN_E|T1_SGN_S|T1_SGN_W)
 
#define T1_SIG 0x1000
#define T1_REFINE 0x2000
#define T1_VISIT 0x4000
 
#define T1_NUMCTXS_ZC 9
#define T1_NUMCTXS_SC 5
#define T1_NUMCTXS_MAG 3
#define T1_NUMCTXS_AGG 1
#define T1_NUMCTXS_UNI 1
 
#define T1_CTXNO_ZC 0
#define T1_CTXNO_SC (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
#define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
#define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)
#define T1_CTXNO_UNI (T1_CTXNO_AGG+T1_NUMCTXS_AGG)
#define T1_NUMCTXS (T1_CTXNO_UNI+T1_NUMCTXS_UNI)
 
#define T1_NMSEDEC_FRACBITS (T1_NMSEDEC_BITS-1)
 
#define T1_TYPE_MQ 0 /**< Normal coding using entropy coder */
#define T1_TYPE_RAW 1 /**< No encoding the information is store under raw format in codestream (mode switch RAW)*/
 
/* ----------------------------------------------------------------------- */
 
typedef short flag_t;
 
/**
Tier-1 coding (coding of code-block coefficients)
*/
typedef struct opj_t1 {
/** codec context */
opj_common_ptr cinfo;
 
/** MQC component */
opj_mqc_t *mqc;
/** RAW component */
opj_raw_t *raw;
 
int *data;
flag_t *flags;
int w;
int h;
int datasize;
int flagssize;
int flags_stride;
} opj_t1_t;
 
#define MACRO_t1_flags(x,y) t1->flags[((x)*(t1->flags_stride))+(y)]
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Create a new T1 handle
and initialize the look-up tables of the Tier-1 coder/decoder
@return Returns a new T1 handle if successful, returns NULL otherwise
@see t1_init_luts
*/
opj_t1_t* t1_create(opj_common_ptr cinfo);
/**
Destroy a previously created T1 handle
@param t1 T1 handle to destroy
*/
void t1_destroy(opj_t1_t *t1);
/**
Encode the code-blocks of a tile
@param t1 T1 handle
@param tile The tile to encode
@param tcp Tile coding parameters
*/
void t1_encode_cblks(opj_t1_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp);
/**
Decode the code-blocks of a tile
@param t1 T1 handle
@param tilec The tile to decode
@param tccp Tile coding parameters
*/
void t1_decode_cblks(opj_t1_t* t1, opj_tcd_tilecomp_t* tilec, opj_tccp_t* tccp);
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __T1_H */
/contrib/media/updf/include/t1_luts.h
0,0 → 1,143
/* This file was automatically generated by t1_generate_luts.c */
 
static char lut_ctxno_zc[1024] = {
0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
0, 3, 3, 6, 3, 6, 6, 8, 3, 6, 6, 8, 6, 8, 8, 8, 1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8,
1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8,
2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8
};
 
static char lut_ctxno_sc[256] = {
0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xd, 0xc, 0xd, 0xd, 0xd, 0xd, 0xd,
0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xb, 0xc, 0xb, 0xd, 0xc, 0xd, 0xc,
0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xd, 0x9, 0xa, 0xd, 0xd, 0xa, 0xa,
0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xb, 0x9, 0xa, 0xd, 0xc, 0xa, 0x9,
0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xd, 0xc, 0xd, 0xb, 0xc, 0xb, 0xc,
0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xb, 0xc, 0xb, 0xb, 0xb, 0xb, 0xb,
0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xd, 0x9, 0xa, 0xb, 0xc, 0xa, 0x9,
0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xb, 0x9, 0xa, 0xb, 0xb, 0xa, 0xa,
0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xb, 0x9, 0xa, 0xb, 0xb, 0xa, 0xa,
0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xd, 0x9, 0xa, 0xb, 0xc, 0xa, 0x9,
0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xb, 0xc, 0xb, 0xb, 0xb, 0xb, 0xb,
0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xd, 0xc, 0xd, 0xb, 0xc, 0xb, 0xc,
0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xb, 0x9, 0xa, 0xd, 0xc, 0xa, 0x9,
0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xd, 0x9, 0xa, 0xd, 0xd, 0xa, 0xa,
0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xb, 0xc, 0xb, 0xd, 0xc, 0xd, 0xc,
0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xd, 0xc, 0xd, 0xd, 0xd, 0xd, 0xd
};
 
static char lut_spb[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0,
0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1,
0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};
 
static short lut_nmsedec_sig[1 << T1_NMSEDEC_BITS] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0180, 0x0300, 0x0480, 0x0600, 0x0780, 0x0900, 0x0a80,
0x0c00, 0x0d80, 0x0f00, 0x1080, 0x1200, 0x1380, 0x1500, 0x1680,
0x1800, 0x1980, 0x1b00, 0x1c80, 0x1e00, 0x1f80, 0x2100, 0x2280,
0x2400, 0x2580, 0x2700, 0x2880, 0x2a00, 0x2b80, 0x2d00, 0x2e80,
0x3000, 0x3180, 0x3300, 0x3480, 0x3600, 0x3780, 0x3900, 0x3a80,
0x3c00, 0x3d80, 0x3f00, 0x4080, 0x4200, 0x4380, 0x4500, 0x4680,
0x4800, 0x4980, 0x4b00, 0x4c80, 0x4e00, 0x4f80, 0x5100, 0x5280,
0x5400, 0x5580, 0x5700, 0x5880, 0x5a00, 0x5b80, 0x5d00, 0x5e80,
0x6000, 0x6180, 0x6300, 0x6480, 0x6600, 0x6780, 0x6900, 0x6a80,
0x6c00, 0x6d80, 0x6f00, 0x7080, 0x7200, 0x7380, 0x7500, 0x7680
};
 
static short lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0080, 0x0080,
0x0080, 0x0080, 0x0100, 0x0100, 0x0100, 0x0180, 0x0180, 0x0200,
0x0200, 0x0280, 0x0280, 0x0300, 0x0300, 0x0380, 0x0400, 0x0400,
0x0480, 0x0500, 0x0580, 0x0580, 0x0600, 0x0680, 0x0700, 0x0780,
0x0800, 0x0880, 0x0900, 0x0980, 0x0a00, 0x0a80, 0x0b80, 0x0c00,
0x0c80, 0x0d00, 0x0e00, 0x0e80, 0x0f00, 0x1000, 0x1080, 0x1180,
0x1200, 0x1300, 0x1380, 0x1480, 0x1500, 0x1600, 0x1700, 0x1780,
0x1880, 0x1980, 0x1a80, 0x1b00, 0x1c00, 0x1d00, 0x1e00, 0x1f00,
0x2000, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2680, 0x2780,
0x2880, 0x2980, 0x2b00, 0x2c00, 0x2d00, 0x2e80, 0x2f80, 0x3100,
0x3200, 0x3380, 0x3480, 0x3600, 0x3700, 0x3880, 0x3a00, 0x3b00,
0x3c80, 0x3e00, 0x3f80, 0x4080, 0x4200, 0x4380, 0x4500, 0x4680,
0x4800, 0x4980, 0x4b00, 0x4c80, 0x4e00, 0x4f80, 0x5180, 0x5300,
0x5480, 0x5600, 0x5800, 0x5980, 0x5b00, 0x5d00, 0x5e80, 0x6080,
0x6200, 0x6400, 0x6580, 0x6780, 0x6900, 0x6b00, 0x6d00, 0x6e80,
0x7080, 0x7280, 0x7480, 0x7600, 0x7800, 0x7a00, 0x7c00, 0x7e00
};
 
static short lut_nmsedec_ref[1 << T1_NMSEDEC_BITS] = {
0x1800, 0x1780, 0x1700, 0x1680, 0x1600, 0x1580, 0x1500, 0x1480,
0x1400, 0x1380, 0x1300, 0x1280, 0x1200, 0x1180, 0x1100, 0x1080,
0x1000, 0x0f80, 0x0f00, 0x0e80, 0x0e00, 0x0d80, 0x0d00, 0x0c80,
0x0c00, 0x0b80, 0x0b00, 0x0a80, 0x0a00, 0x0980, 0x0900, 0x0880,
0x0800, 0x0780, 0x0700, 0x0680, 0x0600, 0x0580, 0x0500, 0x0480,
0x0400, 0x0380, 0x0300, 0x0280, 0x0200, 0x0180, 0x0100, 0x0080,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0080, 0x0100, 0x0180, 0x0200, 0x0280, 0x0300, 0x0380,
0x0400, 0x0480, 0x0500, 0x0580, 0x0600, 0x0680, 0x0700, 0x0780,
0x0800, 0x0880, 0x0900, 0x0980, 0x0a00, 0x0a80, 0x0b00, 0x0b80,
0x0c00, 0x0c80, 0x0d00, 0x0d80, 0x0e00, 0x0e80, 0x0f00, 0x0f80,
0x1000, 0x1080, 0x1100, 0x1180, 0x1200, 0x1280, 0x1300, 0x1380,
0x1400, 0x1480, 0x1500, 0x1580, 0x1600, 0x1680, 0x1700, 0x1780
};
 
static short lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS] = {
0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x1b00, 0x1a80, 0x1980,
0x1880, 0x1780, 0x1700, 0x1600, 0x1500, 0x1480, 0x1380, 0x1300,
0x1200, 0x1180, 0x1080, 0x1000, 0x0f00, 0x0e80, 0x0e00, 0x0d00,
0x0c80, 0x0c00, 0x0b80, 0x0a80, 0x0a00, 0x0980, 0x0900, 0x0880,
0x0800, 0x0780, 0x0700, 0x0680, 0x0600, 0x0580, 0x0580, 0x0500,
0x0480, 0x0400, 0x0400, 0x0380, 0x0300, 0x0300, 0x0280, 0x0280,
0x0200, 0x0200, 0x0180, 0x0180, 0x0100, 0x0100, 0x0100, 0x0080,
0x0080, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0080, 0x0080,
0x0080, 0x0080, 0x0100, 0x0100, 0x0100, 0x0180, 0x0180, 0x0200,
0x0200, 0x0280, 0x0280, 0x0300, 0x0300, 0x0380, 0x0400, 0x0400,
0x0480, 0x0500, 0x0580, 0x0580, 0x0600, 0x0680, 0x0700, 0x0780,
0x0800, 0x0880, 0x0900, 0x0980, 0x0a00, 0x0a80, 0x0b80, 0x0c00,
0x0c80, 0x0d00, 0x0e00, 0x0e80, 0x0f00, 0x1000, 0x1080, 0x1180,
0x1200, 0x1300, 0x1380, 0x1480, 0x1500, 0x1600, 0x1700, 0x1780,
0x1880, 0x1980, 0x1a80, 0x1b00, 0x1c00, 0x1d00, 0x1e00, 0x1f00
};
 
/contrib/media/updf/include/t2.h
0,0 → 1,105
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __T2_H
#define __T2_H
/**
@file t2.h
@brief Implementation of a tier-2 coding (packetization of code-block data) (T2)
 
*/
 
/** @defgroup T2 T2 - Implementation of a tier-2 coding */
/*@{*/
 
/**
Tier-2 coding
*/
typedef struct opj_t2 {
/** codec context */
opj_common_ptr cinfo;
 
/** Encoding: pointer to the src image. Decoding: pointer to the dst image. */
opj_image_t *image;
/** pointer to the image coding parameters */
opj_cp_t *cp;
} opj_t2_t;
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
 
/**
Encode the packets of a tile to a destination buffer
@param t2 T2 handle
@param tileno number of the tile encoded
@param tile the tile for which to write the packets
@param maxlayers maximum number of layers
@param dest the destination buffer
@param len the length of the destination buffer
@param cstr_info Codestream information structure
@param tpnum Tile part number of the current tile
@param tppos The position of the tile part flag in the progression order
@param pino
@param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
@param cur_totnum_tp The total number of tile parts in the current tile
*/
int t2_encode_packets(opj_t2_t* t2,int tileno, opj_tcd_tile_t *tile, int maxlayers, unsigned char *dest, int len, opj_codestream_info_t *cstr_info,int tpnum, int tppos,int pino,J2K_T2_MODE t2_mode,int cur_totnum_tp);
/**
Decode the packets of a tile from a source buffer
@param t2 T2 handle
@param src the source buffer
@param len length of the source buffer
@param tileno number that identifies the tile for which to decode the packets
@param tile tile for which to decode the packets
@param cstr_info Codestream information structure
*/
int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj_tcd_tile_t *tile, opj_codestream_info_t *cstr_info);
 
/**
Create a T2 handle
@param cinfo Codec context info
@param image Source or destination image
@param cp Image coding parameters
@return Returns a new T2 handle if successful, returns NULL otherwise
*/
opj_t2_t* t2_create(opj_common_ptr cinfo, opj_image_t *image, opj_cp_t *cp);
/**
Destroy a T2 handle
@param t2 T2 handle to destroy
*/
void t2_destroy(opj_t2_t *t2);
 
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __T2_H */
/contrib/media/updf/include/table.h
0,0 → 1,39
/*
** table.c
** Module to control static tables
** TeCGraf - PUC-Rio
** 11 May 93
*/
 
#ifndef table_h
#define table_h
 
extern Symbol *lua_table;
extern Word lua_ntable;
 
extern char **lua_constant;
extern Word lua_nconstant;
 
extern char **lua_string;
extern Word lua_nstring;
 
extern Hash **lua_array;
extern Word lua_narray;
 
extern char *lua_file[];
extern int lua_nfile;
 
#define lua_markstring(s) (*((s)-1))
 
 
int lua_findsymbol (char *s);
int lua_findenclosedconstant (char *s);
int lua_findconstant (char *s);
void lua_markobject (Object *o);
char *lua_createstring (char *s);
void *lua_createarray (void *a);
int lua_addfile (char *fn);
char *lua_filename (void);
void lua_nextvar (void);
 
#endif
/contrib/media/updf/include/tcd.h
0,0 → 1,286
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __TCD_H
#define __TCD_H
/**
@file tcd.h
@brief Implementation of a tile coder/decoder (TCD)
 
The functions in TCD.C have for goal to encode or decode each tile independently from
each other. The functions in TCD.C are used by some function in J2K.C.
*/
 
/** @defgroup TCD TCD - Implementation of a tile coder/decoder */
/*@{*/
 
/**
FIXME: documentation
*/
typedef struct opj_tcd_seg {
unsigned char** data;
int dataindex;
int numpasses;
int len;
int maxpasses;
int numnewpasses;
int newlen;
} opj_tcd_seg_t;
 
/**
FIXME: documentation
*/
typedef struct opj_tcd_pass {
int rate;
double distortiondec;
int term, len;
} opj_tcd_pass_t;
 
/**
FIXME: documentation
*/
typedef struct opj_tcd_layer {
int numpasses; /* Number of passes in the layer */
int len; /* len of information */
double disto; /* add for index (Cfr. Marcela) */
unsigned char *data; /* data */
} opj_tcd_layer_t;
 
/**
FIXME: documentation
*/
typedef struct opj_tcd_cblk_enc {
unsigned char* data; /* Data */
opj_tcd_layer_t* layers; /* layer information */
opj_tcd_pass_t* passes; /* information about the passes */
int x0, y0, x1, y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
int numbps;
int numlenbits;
int numpasses; /* number of pass already done for the code-blocks */
int numpassesinlayers; /* number of passes in the layer */
int totalpasses; /* total number of passes */
} opj_tcd_cblk_enc_t;
 
typedef struct opj_tcd_cblk_dec {
unsigned char* data; /* Data */
opj_tcd_seg_t* segs; /* segments informations */
int x0, y0, x1, y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
int numbps;
int numlenbits;
int len; /* length */
int numnewpasses; /* number of pass added to the code-blocks */
int numsegs; /* number of segments */
} opj_tcd_cblk_dec_t;
 
/**
FIXME: documentation
*/
typedef struct opj_tcd_precinct {
int x0, y0, x1, y1; /* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */
int cw, ch; /* number of precinct in width and heigth */
union{ /* code-blocks informations */
opj_tcd_cblk_enc_t* enc;
opj_tcd_cblk_dec_t* dec;
} cblks;
opj_tgt_tree_t *incltree; /* inclusion tree */
opj_tgt_tree_t *imsbtree; /* IMSB tree */
} opj_tcd_precinct_t;
 
/**
FIXME: documentation
*/
typedef struct opj_tcd_band {
int x0, y0, x1, y1; /* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */
int bandno;
opj_tcd_precinct_t *precincts; /* precinct information */
int numbps;
float stepsize;
} opj_tcd_band_t;
 
/**
FIXME: documentation
*/
typedef struct opj_tcd_resolution {
int x0, y0, x1, y1; /* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */
int pw, ph;
int numbands; /* number sub-band for the resolution level */
opj_tcd_band_t bands[3]; /* subband information */
} opj_tcd_resolution_t;
 
/**
FIXME: documentation
*/
typedef struct opj_tcd_tilecomp {
int x0, y0, x1, y1; /* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */
int numresolutions; /* number of resolutions level */
opj_tcd_resolution_t *resolutions; /* resolutions information */
int *data; /* data of the component */
int numpix; /* add fixed_quality */
} opj_tcd_tilecomp_t;
 
/**
FIXME: documentation
*/
typedef struct opj_tcd_tile {
int x0, y0, x1, y1; /* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */
int numcomps; /* number of components in tile */
opj_tcd_tilecomp_t *comps; /* Components information */
int numpix; /* add fixed_quality */
double distotile; /* add fixed_quality */
double distolayer[100]; /* add fixed_quality */
/** packet number */
int packno;
} opj_tcd_tile_t;
 
/**
FIXME: documentation
*/
typedef struct opj_tcd_image {
int tw, th; /* number of tiles in width and heigth */
opj_tcd_tile_t *tiles; /* Tiles information */
} opj_tcd_image_t;
 
/**
Tile coder/decoder
*/
typedef struct opj_tcd {
/** Position of the tilepart flag in Progression order*/
int tp_pos;
/** Tile part number*/
int tp_num;
/** Current tile part number*/
int cur_tp_num;
/** Total number of tileparts of the current tile*/
int cur_totnum_tp;
/** Current Packet iterator number */
int cur_pino;
/** codec context */
opj_common_ptr cinfo;
 
/** info on each image tile */
opj_tcd_image_t *tcd_image;
/** image */
opj_image_t *image;
/** coding parameters */
opj_cp_t *cp;
/** pointer to the current encoded/decoded tile */
opj_tcd_tile_t *tcd_tile;
/** coding/decoding parameters common to all tiles */
opj_tcp_t *tcp;
/** current encoded/decoded tile */
int tcd_tileno;
/** Time taken to encode a tile*/
double encoding_time;
} opj_tcd_t;
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
 
/**
Dump the content of a tcd structure
*/
void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img);
/**
Create a new TCD handle
@param cinfo Codec context info
@return Returns a new TCD handle if successful returns NULL otherwise
*/
opj_tcd_t* tcd_create(opj_common_ptr cinfo);
/**
Destroy a previously created TCD handle
@param tcd TCD handle to destroy
*/
void tcd_destroy(opj_tcd_t *tcd);
/**
Initialize the tile coder (allocate the memory)
@param tcd TCD handle
@param image Raw image
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_malloc_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
/**
Free the memory allocated for encoding
@param tcd TCD handle
*/
void tcd_free_encode(opj_tcd_t *tcd);
/**
Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)
@param tcd TCD handle
@param image Raw image
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_init_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
/**
Initialize the tile decoder
@param tcd TCD handle
@param image Raw image
@param cp Coding parameters
*/
void tcd_malloc_decode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp);
void tcd_malloc_decode_tile(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int tileno, opj_codestream_info_t *cstr_info);
void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final);
void tcd_rateallocate_fixed(opj_tcd_t *tcd);
void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final);
bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info);
/**
Encode a tile from the raw image into a buffer
@param tcd TCD handle
@param tileno Number that identifies one of the tiles to be encoded
@param dest Destination buffer
@param len Length of destination buffer
@param cstr_info Codestream information structure
@return
*/
int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_codestream_info_t *cstr_info);
/**
Decode a tile from a buffer into a raw image
@param tcd TCD handle
@param src Source buffer
@param len Length of source buffer
@param tileno Number that identifies one of the tiles to be decoded
@param cstr_info Codestream information structure
*/
bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno, opj_codestream_info_t *cstr_info);
/**
Free the memory allocated for decoding
@param tcd TCD handle
*/
void tcd_free_decode(opj_tcd_t *tcd);
void tcd_free_decode_tile(opj_tcd_t *tcd, int tileno);
 
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __TCD_H */
/contrib/media/updf/include/term.h
0,0 → 1,731
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* ), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************/
/* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 */
/* and: Eric S. Raymond <esr@snark.thyrsus.com> */
/****************************************************************************/
 
/* $Id: MKterm.h.awk.in,v 1.23 1998/02/11 12:13:46 tom Exp $ */
 
/*
** term.h -- Definition of struct term
*/
 
#ifndef _TERM_H
#define _TERM_H
 
#undef NCURSES_VERSION
#define NCURSES_VERSION "4.2"
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H
* and BROKEN_LINKER definition (based on the system for which this was configured).
*/
 
#ifndef HAVE_TERMIOS_H
#define HAVE_TERMIOS_H 1
#endif
 
#ifndef HAVE_TERMIO_H
#define HAVE_TERMIO_H 1
#endif
 
#ifndef HAVE_TCGETATTR
#define HAVE_TCGETATTR 1
#endif
 
#ifndef BROKEN_LINKER
#define BROKEN_LINKER 0
#endif
 
#ifndef NCURSES_CONST
#define NCURSES_CONST /*nothing*/
#endif
 
/* Assume Posix termio if we have the header and function */
#if HAVE_TERMIOS_H && HAVE_TCGETATTR
#ifndef TERMIOS
#define TERMIOS 1
#endif
#include <termios.h>
#define TTY struct termios
 
#else /* !HAVE_TERMIOS_H */
 
#if HAVE_TERMIO_H
#ifndef TERMIOS
#define TERMIOS 1
#endif
#include <termio.h>
#define TTY struct termio
#define TCSANOW TCSETA
#define TCSADRAIN TCSETAW
#define TCSAFLUSH TCSETAF
#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
#define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg)
#define cfgetospeed(t) ((t)->c_cflag & CBAUD)
#define TCIFLUSH 0
#define TCOFLUSH 1
#define TCIOFLUSH 2
#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
 
#else /* !HAVE_TERMIO_H */
 
#undef TERMIOS
#include <sgtty.h>
#include <sys/ioctl.h>
#define TTY struct sgttyb
 
#endif /* HAVE_TERMIO_H */
 
#endif /* HAVE_TERMIOS_H */
 
#ifdef TERMIOS
#define GET_TTY(fd, buf) tcgetattr(fd, buf)
#define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)
#else
#define GET_TTY(fd, buf) gtty(fd, buf)
#define SET_TTY(fd, buf) stty(fd, buf)
#endif
 
extern char ttytype[];
#define NAMESIZE 256
 
#define CUR cur_term->type.
 
#define auto_left_margin CUR Booleans[0]
#define auto_right_margin CUR Booleans[1]
#define no_esc_ctlc CUR Booleans[2]
#define ceol_standout_glitch CUR Booleans[3]
#define eat_newline_glitch CUR Booleans[4]
#define erase_overstrike CUR Booleans[5]
#define generic_type CUR Booleans[6]
#define hard_copy CUR Booleans[7]
#define has_meta_key CUR Booleans[8]
#define has_status_line CUR Booleans[9]
#define insert_null_glitch CUR Booleans[10]
#define memory_above CUR Booleans[11]
#define memory_below CUR Booleans[12]
#define move_insert_mode CUR Booleans[13]
#define move_standout_mode CUR Booleans[14]
#define over_strike CUR Booleans[15]
#define status_line_esc_ok CUR Booleans[16]
#define dest_tabs_magic_smso CUR Booleans[17]
#define tilde_glitch CUR Booleans[18]
#define transparent_underline CUR Booleans[19]
#define xon_xoff CUR Booleans[20]
#define needs_xon_xoff CUR Booleans[21]
#define prtr_silent CUR Booleans[22]
#define hard_cursor CUR Booleans[23]
#define non_rev_rmcup CUR Booleans[24]
#define no_pad_char CUR Booleans[25]
#define non_dest_scroll_region CUR Booleans[26]
#define can_change CUR Booleans[27]
#define back_color_erase CUR Booleans[28]
#define hue_lightness_saturation CUR Booleans[29]
#define col_addr_glitch CUR Booleans[30]
#define cr_cancels_micro_mode CUR Booleans[31]
#define has_print_wheel CUR Booleans[32]
#define row_addr_glitch CUR Booleans[33]
#define semi_auto_right_margin CUR Booleans[34]
#define cpi_changes_res CUR Booleans[35]
#define lpi_changes_res CUR Booleans[36]
#define columns CUR Numbers[0]
#define init_tabs CUR Numbers[1]
#define lines CUR Numbers[2]
#define lines_of_memory CUR Numbers[3]
#define magic_cookie_glitch CUR Numbers[4]
#define padding_baud_rate CUR Numbers[5]
#define virtual_terminal CUR Numbers[6]
#define width_status_line CUR Numbers[7]
#define num_labels CUR Numbers[8]
#define label_height CUR Numbers[9]
#define label_width CUR Numbers[10]
#define max_attributes CUR Numbers[11]
#define maximum_windows CUR Numbers[12]
#define max_colors CUR Numbers[13]
#define max_pairs CUR Numbers[14]
#define no_color_video CUR Numbers[15]
#define buffer_capacity CUR Numbers[16]
#define dot_vert_spacing CUR Numbers[17]
#define dot_horz_spacing CUR Numbers[18]
#define max_micro_address CUR Numbers[19]
#define max_micro_jump CUR Numbers[20]
#define micro_char_size CUR Numbers[21]
#define micro_line_size CUR Numbers[22]
#define number_of_pins CUR Numbers[23]
#define output_res_char CUR Numbers[24]
#define output_res_line CUR Numbers[25]
#define output_res_horz_inch CUR Numbers[26]
#define output_res_vert_inch CUR Numbers[27]
#define print_rate CUR Numbers[28]
#define wide_char_size CUR Numbers[29]
#define buttons CUR Numbers[30]
#define bit_image_entwining CUR Numbers[31]
#define bit_image_type CUR Numbers[32]
#define back_tab CUR Strings[0]
#define bell CUR Strings[1]
#define carriage_return CUR Strings[2]
#define change_scroll_region CUR Strings[3]
#define clear_all_tabs CUR Strings[4]
#define clear_screen CUR Strings[5]
#define clr_eol CUR Strings[6]
#define clr_eos CUR Strings[7]
#define column_address CUR Strings[8]
#define command_character CUR Strings[9]
#define cursor_address CUR Strings[10]
#define cursor_down CUR Strings[11]
#define cursor_home CUR Strings[12]
#define cursor_invisible CUR Strings[13]
#define cursor_left CUR Strings[14]
#define cursor_mem_address CUR Strings[15]
#define cursor_normal CUR Strings[16]
#define cursor_right CUR Strings[17]
#define cursor_to_ll CUR Strings[18]
#define cursor_up CUR Strings[19]
#define cursor_visible CUR Strings[20]
#define delete_character CUR Strings[21]
#define delete_line CUR Strings[22]
#define dis_status_line CUR Strings[23]
#define down_half_line CUR Strings[24]
#define enter_alt_charset_mode CUR Strings[25]
#define enter_blink_mode CUR Strings[26]
#define enter_bold_mode CUR Strings[27]
#define enter_ca_mode CUR Strings[28]
#define enter_delete_mode CUR Strings[29]
#define enter_dim_mode CUR Strings[30]
#define enter_insert_mode CUR Strings[31]
#define enter_secure_mode CUR Strings[32]
#define enter_protected_mode CUR Strings[33]
#define enter_reverse_mode CUR Strings[34]
#define enter_standout_mode CUR Strings[35]
#define enter_underline_mode CUR Strings[36]
#define erase_chars CUR Strings[37]
#define exit_alt_charset_mode CUR Strings[38]
#define exit_attribute_mode CUR Strings[39]
#define exit_ca_mode CUR Strings[40]
#define exit_delete_mode CUR Strings[41]
#define exit_insert_mode CUR Strings[42]
#define exit_standout_mode CUR Strings[43]
#define exit_underline_mode CUR Strings[44]
#define flash_screen CUR Strings[45]
#define form_feed CUR Strings[46]
#define from_status_line CUR Strings[47]
#define init_1string CUR Strings[48]
#define init_2string CUR Strings[49]
#define init_3string CUR Strings[50]
#define init_file CUR Strings[51]
#define insert_character CUR Strings[52]
#define insert_line CUR Strings[53]
#define insert_padding CUR Strings[54]
#define key_backspace CUR Strings[55]
#define key_catab CUR Strings[56]
#define key_clear CUR Strings[57]
#define key_ctab CUR Strings[58]
#define key_dc CUR Strings[59]
#define key_dl CUR Strings[60]
#define key_down CUR Strings[61]
#define key_eic CUR Strings[62]
#define key_eol CUR Strings[63]
#define key_eos CUR Strings[64]
#define key_f0 CUR Strings[65]
#define key_f1 CUR Strings[66]
#define key_f10 CUR Strings[67]
#define key_f2 CUR Strings[68]
#define key_f3 CUR Strings[69]
#define key_f4 CUR Strings[70]
#define key_f5 CUR Strings[71]
#define key_f6 CUR Strings[72]
#define key_f7 CUR Strings[73]
#define key_f8 CUR Strings[74]
#define key_f9 CUR Strings[75]
#define key_home CUR Strings[76]
#define key_ic CUR Strings[77]
#define key_il CUR Strings[78]
#define key_left CUR Strings[79]
#define key_ll CUR Strings[80]
#define key_npage CUR Strings[81]
#define key_ppage CUR Strings[82]
#define key_right CUR Strings[83]
#define key_sf CUR Strings[84]
#define key_sr CUR Strings[85]
#define key_stab CUR Strings[86]
#define key_up CUR Strings[87]
#define keypad_local CUR Strings[88]
#define keypad_xmit CUR Strings[89]
#define lab_f0 CUR Strings[90]
#define lab_f1 CUR Strings[91]
#define lab_f10 CUR Strings[92]
#define lab_f2 CUR Strings[93]
#define lab_f3 CUR Strings[94]
#define lab_f4 CUR Strings[95]
#define lab_f5 CUR Strings[96]
#define lab_f6 CUR Strings[97]
#define lab_f7 CUR Strings[98]
#define lab_f8 CUR Strings[99]
#define lab_f9 CUR Strings[100]
#define meta_off CUR Strings[101]
#define meta_on CUR Strings[102]
#define newline CUR Strings[103]
#define pad_char CUR Strings[104]
#define parm_dch CUR Strings[105]
#define parm_delete_line CUR Strings[106]
#define parm_down_cursor CUR Strings[107]
#define parm_ich CUR Strings[108]
#define parm_index CUR Strings[109]
#define parm_insert_line CUR Strings[110]
#define parm_left_cursor CUR Strings[111]
#define parm_right_cursor CUR Strings[112]
#define parm_rindex CUR Strings[113]
#define parm_up_cursor CUR Strings[114]
#define pkey_key CUR Strings[115]
#define pkey_local CUR Strings[116]
#define pkey_xmit CUR Strings[117]
#define print_screen CUR Strings[118]
#define prtr_off CUR Strings[119]
#define prtr_on CUR Strings[120]
#define repeat_char CUR Strings[121]
#define reset_1string CUR Strings[122]
#define reset_2string CUR Strings[123]
#define reset_3string CUR Strings[124]
#define reset_file CUR Strings[125]
#define restore_cursor CUR Strings[126]
#define row_address CUR Strings[127]
#define save_cursor CUR Strings[128]
#define scroll_forward CUR Strings[129]
#define scroll_reverse CUR Strings[130]
#define set_attributes CUR Strings[131]
#define set_tab CUR Strings[132]
#define set_window CUR Strings[133]
#define tab CUR Strings[134]
#define to_status_line CUR Strings[135]
#define underline_char CUR Strings[136]
#define up_half_line CUR Strings[137]
#define init_prog CUR Strings[138]
#define key_a1 CUR Strings[139]
#define key_a3 CUR Strings[140]
#define key_b2 CUR Strings[141]
#define key_c1 CUR Strings[142]
#define key_c3 CUR Strings[143]
#define prtr_non CUR Strings[144]
#define char_padding CUR Strings[145]
#define acs_chars CUR Strings[146]
#define plab_norm CUR Strings[147]
#define key_btab CUR Strings[148]
#define enter_xon_mode CUR Strings[149]
#define exit_xon_mode CUR Strings[150]
#define enter_am_mode CUR Strings[151]
#define exit_am_mode CUR Strings[152]
#define xon_character CUR Strings[153]
#define xoff_character CUR Strings[154]
#define ena_acs CUR Strings[155]
#define label_on CUR Strings[156]
#define label_off CUR Strings[157]
#define key_beg CUR Strings[158]
#define key_cancel CUR Strings[159]
#define key_close CUR Strings[160]
#define key_command CUR Strings[161]
#define key_copy CUR Strings[162]
#define key_create CUR Strings[163]
#define key_end CUR Strings[164]
#define key_enter CUR Strings[165]
#define key_exit CUR Strings[166]
#define key_find CUR Strings[167]
#define key_help CUR Strings[168]
#define key_mark CUR Strings[169]
#define key_message CUR Strings[170]
#define key_move CUR Strings[171]
#define key_next CUR Strings[172]
#define key_open CUR Strings[173]
#define key_options CUR Strings[174]
#define key_previous CUR Strings[175]
#define key_print CUR Strings[176]
#define key_redo CUR Strings[177]
#define key_reference CUR Strings[178]
#define key_refresh CUR Strings[179]
#define key_replace CUR Strings[180]
#define key_restart CUR Strings[181]
#define key_resume CUR Strings[182]
#define key_save CUR Strings[183]
#define key_suspend CUR Strings[184]
#define key_undo CUR Strings[185]
#define key_sbeg CUR Strings[186]
#define key_scancel CUR Strings[187]
#define key_scommand CUR Strings[188]
#define key_scopy CUR Strings[189]
#define key_screate CUR Strings[190]
#define key_sdc CUR Strings[191]
#define key_sdl CUR Strings[192]
#define key_select CUR Strings[193]
#define key_send CUR Strings[194]
#define key_seol CUR Strings[195]
#define key_sexit CUR Strings[196]
#define key_sfind CUR Strings[197]
#define key_shelp CUR Strings[198]
#define key_shome CUR Strings[199]
#define key_sic CUR Strings[200]
#define key_sleft CUR Strings[201]
#define key_smessage CUR Strings[202]
#define key_smove CUR Strings[203]
#define key_snext CUR Strings[204]
#define key_soptions CUR Strings[205]
#define key_sprevious CUR Strings[206]
#define key_sprint CUR Strings[207]
#define key_sredo CUR Strings[208]
#define key_sreplace CUR Strings[209]
#define key_sright CUR Strings[210]
#define key_srsume CUR Strings[211]
#define key_ssave CUR Strings[212]
#define key_ssuspend CUR Strings[213]
#define key_sundo CUR Strings[214]
#define req_for_input CUR Strings[215]
#define key_f11 CUR Strings[216]
#define key_f12 CUR Strings[217]
#define key_f13 CUR Strings[218]
#define key_f14 CUR Strings[219]
#define key_f15 CUR Strings[220]
#define key_f16 CUR Strings[221]
#define key_f17 CUR Strings[222]
#define key_f18 CUR Strings[223]
#define key_f19 CUR Strings[224]
#define key_f20 CUR Strings[225]
#define key_f21 CUR Strings[226]
#define key_f22 CUR Strings[227]
#define key_f23 CUR Strings[228]
#define key_f24 CUR Strings[229]
#define key_f25 CUR Strings[230]
#define key_f26 CUR Strings[231]
#define key_f27 CUR Strings[232]
#define key_f28 CUR Strings[233]
#define key_f29 CUR Strings[234]
#define key_f30 CUR Strings[235]
#define key_f31 CUR Strings[236]
#define key_f32 CUR Strings[237]
#define key_f33 CUR Strings[238]
#define key_f34 CUR Strings[239]
#define key_f35 CUR Strings[240]
#define key_f36 CUR Strings[241]
#define key_f37 CUR Strings[242]
#define key_f38 CUR Strings[243]
#define key_f39 CUR Strings[244]
#define key_f40 CUR Strings[245]
#define key_f41 CUR Strings[246]
#define key_f42 CUR Strings[247]
#define key_f43 CUR Strings[248]
#define key_f44 CUR Strings[249]
#define key_f45 CUR Strings[250]
#define key_f46 CUR Strings[251]
#define key_f47 CUR Strings[252]
#define key_f48 CUR Strings[253]
#define key_f49 CUR Strings[254]
#define key_f50 CUR Strings[255]
#define key_f51 CUR Strings[256]
#define key_f52 CUR Strings[257]
#define key_f53 CUR Strings[258]
#define key_f54 CUR Strings[259]
#define key_f55 CUR Strings[260]
#define key_f56 CUR Strings[261]
#define key_f57 CUR Strings[262]
#define key_f58 CUR Strings[263]
#define key_f59 CUR Strings[264]
#define key_f60 CUR Strings[265]
#define key_f61 CUR Strings[266]
#define key_f62 CUR Strings[267]
#define key_f63 CUR Strings[268]
#define clr_bol CUR Strings[269]
#define clear_margins CUR Strings[270]
#define set_left_margin CUR Strings[271]
#define set_right_margin CUR Strings[272]
#define label_format CUR Strings[273]
#define set_clock CUR Strings[274]
#define display_clock CUR Strings[275]
#define remove_clock CUR Strings[276]
#define create_window CUR Strings[277]
#define goto_window CUR Strings[278]
#define hangup CUR Strings[279]
#define dial_phone CUR Strings[280]
#define quick_dial CUR Strings[281]
#define tone CUR Strings[282]
#define pulse CUR Strings[283]
#define flash_hook CUR Strings[284]
#define fixed_pause CUR Strings[285]
#define wait_tone CUR Strings[286]
#define user0 CUR Strings[287]
#define user1 CUR Strings[288]
#define user2 CUR Strings[289]
#define user3 CUR Strings[290]
#define user4 CUR Strings[291]
#define user5 CUR Strings[292]
#define user6 CUR Strings[293]
#define user7 CUR Strings[294]
#define user8 CUR Strings[295]
#define user9 CUR Strings[296]
#define orig_pair CUR Strings[297]
#define orig_colors CUR Strings[298]
#define initialize_color CUR Strings[299]
#define initialize_pair CUR Strings[300]
#define set_color_pair CUR Strings[301]
#define set_foreground CUR Strings[302]
#define set_background CUR Strings[303]
#define change_char_pitch CUR Strings[304]
#define change_line_pitch CUR Strings[305]
#define change_res_horz CUR Strings[306]
#define change_res_vert CUR Strings[307]
#define define_char CUR Strings[308]
#define enter_doublewide_mode CUR Strings[309]
#define enter_draft_quality CUR Strings[310]
#define enter_italics_mode CUR Strings[311]
#define enter_leftward_mode CUR Strings[312]
#define enter_micro_mode CUR Strings[313]
#define enter_near_letter_quality CUR Strings[314]
#define enter_normal_quality CUR Strings[315]
#define enter_shadow_mode CUR Strings[316]
#define enter_subscript_mode CUR Strings[317]
#define enter_superscript_mode CUR Strings[318]
#define enter_upward_mode CUR Strings[319]
#define exit_doublewide_mode CUR Strings[320]
#define exit_italics_mode CUR Strings[321]
#define exit_leftward_mode CUR Strings[322]
#define exit_micro_mode CUR Strings[323]
#define exit_shadow_mode CUR Strings[324]
#define exit_subscript_mode CUR Strings[325]
#define exit_superscript_mode CUR Strings[326]
#define exit_upward_mode CUR Strings[327]
#define micro_column_address CUR Strings[328]
#define micro_down CUR Strings[329]
#define micro_left CUR Strings[330]
#define micro_right CUR Strings[331]
#define micro_row_address CUR Strings[332]
#define micro_up CUR Strings[333]
#define order_of_pins CUR Strings[334]
#define parm_down_micro CUR Strings[335]
#define parm_left_micro CUR Strings[336]
#define parm_right_micro CUR Strings[337]
#define parm_up_micro CUR Strings[338]
#define select_char_set CUR Strings[339]
#define set_bottom_margin CUR Strings[340]
#define set_bottom_margin_parm CUR Strings[341]
#define set_left_margin_parm CUR Strings[342]
#define set_right_margin_parm CUR Strings[343]
#define set_top_margin CUR Strings[344]
#define set_top_margin_parm CUR Strings[345]
#define start_bit_image CUR Strings[346]
#define start_char_set_def CUR Strings[347]
#define stop_bit_image CUR Strings[348]
#define stop_char_set_def CUR Strings[349]
#define subscript_characters CUR Strings[350]
#define superscript_characters CUR Strings[351]
#define these_cause_cr CUR Strings[352]
#define zero_motion CUR Strings[353]
#define char_set_names CUR Strings[354]
#define key_mouse CUR Strings[355]
#define mouse_info CUR Strings[356]
#define req_mouse_pos CUR Strings[357]
#define get_mouse CUR Strings[358]
#define set_a_foreground CUR Strings[359]
#define set_a_background CUR Strings[360]
#define pkey_plab CUR Strings[361]
#define device_type CUR Strings[362]
#define code_set_init CUR Strings[363]
#define set0_des_seq CUR Strings[364]
#define set1_des_seq CUR Strings[365]
#define set2_des_seq CUR Strings[366]
#define set3_des_seq CUR Strings[367]
#define set_lr_margin CUR Strings[368]
#define set_tb_margin CUR Strings[369]
#define bit_image_repeat CUR Strings[370]
#define bit_image_newline CUR Strings[371]
#define bit_image_carriage_return CUR Strings[372]
#define color_names CUR Strings[373]
#define define_bit_image_region CUR Strings[374]
#define end_bit_image_region CUR Strings[375]
#define set_color_band CUR Strings[376]
#define set_page_length CUR Strings[377]
#define display_pc_char CUR Strings[378]
#define enter_pc_charset_mode CUR Strings[379]
#define exit_pc_charset_mode CUR Strings[380]
#define enter_scancode_mode CUR Strings[381]
#define exit_scancode_mode CUR Strings[382]
#define pc_term_options CUR Strings[383]
#define scancode_escape CUR Strings[384]
#define alt_scancode_esc CUR Strings[385]
#define enter_horizontal_hl_mode CUR Strings[386]
#define enter_left_hl_mode CUR Strings[387]
#define enter_low_hl_mode CUR Strings[388]
#define enter_right_hl_mode CUR Strings[389]
#define enter_top_hl_mode CUR Strings[390]
#define enter_vertical_hl_mode CUR Strings[391]
 
#define BOOLWRITE 37
#define NUMWRITE 33
#define STRWRITE 392
 
/* older synonyms for some capabilities */
#define beehive_glitch no_esc_ctlc
#define teleray_glitch dest_tabs_magic_smso
 
/* XSI synonyms */
#define micro_col_size micro_char_size
 
#ifdef __INTERNAL_CAPS_VISIBLE
#define termcap_init2 CUR Strings[392]
#define termcap_reset CUR Strings[393]
#define magic_cookie_glitch_ul CUR Numbers[33]
#define backspaces_with_bs CUR Booleans[37]
#define crt_no_scrolling CUR Booleans[38]
#define no_correctly_working_cr CUR Booleans[39]
#define carriage_return_delay CUR Numbers[34]
#define new_line_delay CUR Numbers[35]
#define linefeed_if_not_lf CUR Strings[394]
#define backspace_if_not_bs CUR Strings[395]
#define gnu_has_meta_key CUR Booleans[40]
#define linefeed_is_newline CUR Booleans[41]
#define backspace_delay CUR Numbers[36]
#define horizontal_tab_delay CUR Numbers[37]
#define number_of_function_keys CUR Numbers[38]
#define other_non_function_keys CUR Strings[396]
#define arrow_key_map CUR Strings[397]
#define has_hardware_tabs CUR Booleans[42]
#define return_does_clr_eol CUR Booleans[43]
#define acs_ulcorner CUR Strings[398]
#define acs_llcorner CUR Strings[399]
#define acs_urcorner CUR Strings[400]
#define acs_lrcorner CUR Strings[401]
#define acs_ltee CUR Strings[402]
#define acs_rtee CUR Strings[403]
#define acs_btee CUR Strings[404]
#define acs_ttee CUR Strings[405]
#define acs_hline CUR Strings[406]
#define acs_vline CUR Strings[407]
#define acs_plus CUR Strings[408]
#define memory_lock CUR Strings[409]
#define memory_unlock CUR Strings[410]
#define box_chars_1 CUR Strings[411]
#endif /* __INTERNAL_CAPS_VISIBLE */
 
 
#define BOOLCOUNT 44
#define NUMCOUNT 39
#define STRCOUNT 412
 
typedef struct termtype { /* in-core form of terminfo data */
char *term_names; /* str_table offset of term names */
char *str_table; /* pointer to string table */
char Booleans[BOOLCOUNT]; /* array of values */
short Numbers[NUMCOUNT]; /* array of values */
char *Strings[STRCOUNT]; /* array of string offsets */
} TERMTYPE;
 
typedef struct term { /* describe an actual terminal */
TERMTYPE type; /* terminal type description */
short Filedes; /* file description being written to */
TTY Ottyb, /* original state of the terminal */
Nttyb; /* current state of the terminal */
int _baudrate; /* used to compute padding */
} TERMINAL;
 
extern TERMINAL *cur_term;
 
 
#if BROKEN_LINKER
#define boolnames _nc_boolnames()
#define boolcodes _nc_boolcodes()
#define boolfnames _nc_boolfnames()
#define numnames _nc_numnames()
#define numcodes _nc_numcodes()
#define numfnames _nc_numfnames()
#define strnames _nc_strnames()
#define strcodes _nc_strcodes()
#define strfnames _nc_strfnames()
 
extern NCURSES_CONST char * const *_nc_boolnames(void);
extern NCURSES_CONST char * const *_nc_boolcodes(void);
extern NCURSES_CONST char * const *_nc_boolfnames(void);
extern NCURSES_CONST char * const *_nc_numnames(void);
extern NCURSES_CONST char * const *_nc_numcodes(void);
extern NCURSES_CONST char * const *_nc_numfnames(void);
extern NCURSES_CONST char * const *_nc_strnames(void);
extern NCURSES_CONST char * const *_nc_strcodes(void);
extern NCURSES_CONST char * const *_nc_strfnames(void);
 
#else
 
extern NCURSES_CONST char *const boolnames[];
extern NCURSES_CONST char *const boolcodes[];
extern NCURSES_CONST char *const boolfnames[];
extern NCURSES_CONST char *const numnames[];
extern NCURSES_CONST char *const numcodes[];
extern NCURSES_CONST char *const numfnames[];
extern NCURSES_CONST char *const strnames[];
extern NCURSES_CONST char *const strcodes[];
extern NCURSES_CONST char *const strfnames[];
 
#endif
 
/* internals */
extern int _nc_set_curterm(TTY *buf);
extern int _nc_get_curterm(TTY *buf);
extern int _nc_read_entry(const char * const, char * const, TERMTYPE *const);
extern int _nc_read_file_entry(const char *const, TERMTYPE *);
extern char *_nc_first_name(const char *const);
extern int _nc_name_match(const char *const, const char *const, const char *const);
extern int _nc_read_termcap_entry(const char *const, TERMTYPE *const);
extern const TERMTYPE *_nc_fallback(const char *);
 
/* entry points */
extern TERMINAL *set_curterm(TERMINAL *);
extern int del_curterm(TERMINAL *);
 
/* miscellaneous entry points */
extern int putp(const char *);
extern int restartterm(const char *, int, int *);
extern int setupterm(const char *,int,int *);
extern int tputs(const char *, int, int (*)(int));
 
/* terminfo entry points */
extern int tigetflag(const char *);
extern int tigetnum(const char *);
extern char *tigetstr(const char *);
extern char *tparm(const char *, ...);
 
/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */
extern int tgetent(char *, const char *);
extern int tgetflag(const char *);
extern int tgetnum(const char *);
extern char *tgetstr(const char *, char **);
extern char *tgoto(const char *, int, int);
 
#ifdef __cplusplus
}
#endif
 
#endif /* TERM_H */
/contrib/media/updf/include/term_entry.h
0,0 → 1,89
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
****************************************************************************/
 
 
/*
* term_entry.h -- interface to entry-manipulation code
*/
 
#ifndef _TERM_ENTRY_H
#define _TERM_ENTRY_H
 
#define MAX_USES 32
 
typedef struct entry {
TERMTYPE tterm;
int nuses;
struct
{
void *parent; /* (char *) or (ENTRY *) */
long line;
}
uses[MAX_USES];
long cstart, cend;
long startline;
struct entry *next;
struct entry *last;
}
ENTRY;
 
extern ENTRY *_nc_head, *_nc_tail;
#define for_entry_list(qp) for (qp = _nc_head; qp; qp = qp->next)
 
#define MAX_LINE 132
 
#define NULLHOOK (bool(*)(ENTRY *))0
 
/* alloc_entry.c: elementary allocation code */
extern void _nc_init_entry(TERMTYPE *const);
extern char *_nc_save_str(const char *const);
extern void _nc_merge_entry(TERMTYPE *const, TERMTYPE *const);
extern void _nc_wrap_entry(ENTRY *const);
 
/* parse_entry.c: entry-parsing code */
extern int _nc_parse_entry(ENTRY *, int, bool);
extern int _nc_capcmp(const char *, const char *);
 
/* write_entry.c: writing an entry to the file system */
extern void _nc_set_writedir(char *);
extern void _nc_write_entry(TERMTYPE *const);
 
/* comp_parse.c: entry list handling */
extern void _nc_read_entry_source(FILE*, char*, int, bool, bool (*)(ENTRY*));
extern bool _nc_entry_match(char *, char *);
extern int _nc_resolve_uses(void);
extern void _nc_free_entries(ENTRY *);
 
#endif /* _TERM_ENTRY_H */
 
/* term_entry.h ends here */
/contrib/media/updf/include/termcap.h
0,0 → 1,67
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
****************************************************************************/
 
/* $Id: termcap.h.in,v 1.5 1998/02/11 12:13:45 tom Exp $ */
 
#ifndef _TERMCAP_H
#define _TERMCAP_H 1
 
#undef NCURSES_VERSION
#define NCURSES_VERSION "4.2"
 
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
 
#include <sys/types.h>
 
extern char PC;
extern char *UP;
extern char *BC;
extern short ospeed;
 
extern int tgetent(char *, const char *);
extern int tgetflag(const char *);
extern int tgetnum(const char *);
extern char *tgetstr(const char *, char **);
 
extern int tputs(const char *, int, int (*)(int));
 
extern char *tgoto(const char *, int, int);
 
#ifdef __cplusplus
}
#endif
 
#endif /* _TERMCAP_H */
/contrib/media/updf/include/termios.h
0,0 → 1,146
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_termios_h_
#define __dj_include_sys_termios_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#define B0 0x00000000
#define B50 0x00000001
#define B75 0x00000002
#define B110 0x00000003
#define B134 0x00000004
#define B150 0x00000005
#define B200 0x00000006
#define B300 0x00000007
#define B600 0x00000008
#define B1200 0x00000009
#define B1800 0x0000000a
#define B2400 0x0000000b
#define B4800 0x0000000c
#define B9600 0x0000000d
#define B19200 0x0000000e
#define B38400 0x0000000f
 
#define BRKINT 0x00000100
#define ICRNL 0x00000200
#define IGNBRK 0x00000400
#define IGNCR 0x00000800
#define IGNPAR 0x00001000
#define INLCR 0x00002000
#define INPCK 0x00004000
#define ISTRIP 0x00008000
#define IXOFF 0x00010000
#define IXON 0x00020000
#define PARMRK 0x00040000
 
#define OPOST 0x00000100
 
#define CLOCAL 0x00000100
#define CREAD 0x00000200
#define CS5 0x00000000
#define CS6 0x00000400
#define CS7 0x00000800
#define CS8 0x00000c00
#define CSIZE 0x00000c00
#define CSTOPB 0x00001000
#define HUPCL 0x00002000
#define PARENB 0x00004000
#define PARODD 0x00008000
 
#define ECHO 0x00000100
#define ECHOE 0x00000200
#define ECHOK 0x00000400
#define ECHONL 0x00000800
#define ICANON 0x00001000
#define IEXTEN 0x00002000
#define ISIG 0x00004000
#define NOFLSH 0x00008000
#define TOSTOP 0x00010000
 
#define TCIFLUSH 1
#define TCOFLUSH 2
#define TCIOFLUSH 3
#define TCOOFF 1
#define TCOON 2
#define TCIOFF 3
#define TCION 4
 
#define TCSADRAIN 1
#define TCSAFLUSH 2
#define TCSANOW 3
 
#define VEOF 1
#define VEOL 2
#define VERASE 3
#define VINTR 4
#define VKILL 5
#define VMIN 6
#define VQUIT 7
#define VSTART 8
#define VSTOP 9
#define VSUSP 10
#define VTIME 11
#define NCCS 12
 
typedef unsigned cc_t;
typedef unsigned speed_t;
typedef unsigned tcflag_t;
 
struct termios {
cc_t c_cc[NCCS];
tcflag_t c_cflag;
tcflag_t c_iflag;
tcflag_t c_lflag;
tcflag_t c_oflag;
speed_t c_ispeed;
speed_t c_ospeed;
};
 
speed_t cfgetispeed(const struct termios *_termios_p);
speed_t cfgetospeed(const struct termios *_termios_p);
int cfsetispeed(struct termios *_termios_p, speed_t _speed);
int cfsetospeed(struct termios *_termios_p, speed_t _speed);
int tcdrain(int _fildes);
int tcflow(int _fildes, int _action);
int tcflush(int _fildes, int _queue_selector);
int tcgetattr(int _fildes, struct termios *_termios_p);
int tcsendbreak(int _fildes, int _duration);
int tcsetattr(int _fildes, int _optional_actions, const struct termios *_termios_p);
 
#ifndef _POSIX_SOURCE
 
/* Input flags */
#define IMAXBEL 0x01000000 /* ring bell on input queue full */
 
/* Local flags */
#define ECHOKE 0x01000000 /* visual erase for line kill */
#define ECHOCTL 0x02000000 /* echo control chars as ^x */
 
/* Output flags */
#define ONLCR 0x00000200 /* map NL to CRNL */
#define OCRNL 0x00000400 /* map CR to NL */
#define ONOEOT 0x00000800 /* discard EOT's (^D) on output */
 
/* for compatibility */
void cfmakeraw(struct termios *_termios_p);
int cfsetspeed(struct termios *_termios_p, speed_t _speed);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_sys_termios_h_ */
/contrib/media/updf/include/tgt.h
0,0 → 1,114
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __TGT_H
#define __TGT_H
/**
@file tgt.h
@brief Implementation of a tag-tree coder (TGT)
 
The functions in TGT.C have for goal to realize a tag-tree coder. The functions in TGT.C
are used by some function in T2.C.
*/
 
/** @defgroup TGT TGT - Implementation of a tag-tree coder */
/*@{*/
 
/**
Tag node
*/
typedef struct opj_tgt_node {
struct opj_tgt_node *parent;
int value;
int low;
int known;
} opj_tgt_node_t;
 
/**
Tag tree
*/
typedef struct opj_tgt_tree {
int numleafsh;
int numleafsv;
int numnodes;
opj_tgt_node_t *nodes;
} opj_tgt_tree_t;
 
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Create a tag-tree
@param numleafsh Width of the array of leafs of the tree
@param numleafsv Height of the array of leafs of the tree
@return Returns a new tag-tree if successful, returns NULL otherwise
*/
opj_tgt_tree_t *tgt_create(int numleafsh, int numleafsv);
/**
Destroy a tag-tree, liberating memory
@param tree Tag-tree to destroy
*/
void tgt_destroy(opj_tgt_tree_t *tree);
/**
Reset a tag-tree (set all leaves to 0)
@param tree Tag-tree to reset
*/
void tgt_reset(opj_tgt_tree_t *tree);
/**
Set the value of a leaf of a tag-tree
@param tree Tag-tree to modify
@param leafno Number that identifies the leaf to modify
@param value New value of the leaf
*/
void tgt_setvalue(opj_tgt_tree_t *tree, int leafno, int value);
/**
Encode the value of a leaf of the tag-tree up to a given threshold
@param bio Pointer to a BIO handle
@param tree Tag-tree to modify
@param leafno Number that identifies the leaf to encode
@param threshold Threshold to use when encoding value of the leaf
*/
void tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno, int threshold);
/**
Decode the value of a leaf of the tag-tree up to a given threshold
@param bio Pointer to a BIO handle
@param tree Tag-tree to decode
@param leafno Number that identifies the leaf to decode
@param threshold Threshold to use when decoding value of the leaf
@return Returns 1 if the node's value < threshold, returns 0 otherwise
*/
int tgt_decode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno, int threshold);
/* ----------------------------------------------------------------------- */
/*@}*/
 
/*@}*/
 
#endif /* __TGT_H */
/contrib/media/updf/include/tic.h
0,0 → 1,245
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
****************************************************************************/
 
/*
* tic.h - Global variables and structures for the terminfo
* compiler.
*
*/
 
#ifndef __TIC_H
#define __TIC_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include <curses.h> /* for the _tracef() prototype, ERR/OK, bool defs */
 
/*
** The format of compiled terminfo files is as follows:
**
** Header (12 bytes), containing information given below
** Names Section, containing the names of the terminal
** Boolean Section, containing the values of all of the
** boolean capabilities
** A null byte may be inserted here to make
** sure that the Number Section begins on an
** even word boundary.
** Number Section, containing the values of all of the numeric
** capabilities, each as a short integer
** String Section, containing short integer offsets into the
** String Table, one per string capability
** String Table, containing the actual characters of the string
** capabilities.
**
** NOTE that all short integers in the file are stored using VAX/PDP-style
** byte-order, i.e., least-significant byte first.
**
** There is no structure definition here because it would only confuse
** matters. Terminfo format is a raw byte layout, not a structure
** dump. If you happen to be on a little-endian machine with 16-bit
** shorts that requires no padding between short members in a struct,
** then there is a natural C structure that captures the header, but
** not very helpfully.
*/
 
#define MAGIC 0432 /* first two bytes of a compiled entry */
 
/*
* The "maximum" here is misleading; XSI guarantees minimum values, which a
* given implementation may exceed.
*/
#define MAX_NAME_SIZE 512 /* maximum legal name field size (XSI:127) */
#define MAX_ENTRY_SIZE 4096 /* maximum legal entry size */
 
/* The maximum size of individual name or alias is guaranteed in XSI to
* be 14, since that corresponds to the older filename lengths. Newer
* systems allow longer aliases, though not many terminal descriptions
* are written to use them.
*/
#if HAVE_LONG_FILE_NAMES
#define MAX_ALIAS 32 /* POSIX minimum for PATH_MAX */
#else
#define MAX_ALIAS 14 /* SVr3 filename length */
#endif
 
/* location of user's personal info directory */
#define PRIVATE_INFO "%s/.terminfo" /* plug getenv("HOME") into %s */
 
#define DEBUG(n, a) if (_nc_tracing & (1 << (n - 1))) _tracef a
extern unsigned _nc_tracing;
extern void _nc_tracef(char *, ...) GCC_PRINTFLIKE(1,2);
extern const char *_nc_visbuf(const char *);
 
/*
* These are the types of tokens returned by the scanner. The first
* three are also used in the hash table of capability names. The scanner
* returns one of these values after loading the specifics into the global
* structure curr_token.
*/
 
#define BOOLEAN 0 /* Boolean capability */
#define NUMBER 1 /* Numeric capability */
#define STRING 2 /* String-valued capability */
#define CANCEL 3 /* Capability to be cancelled in following tc's */
#define NAMES 4 /* The names for a terminal type */
#define UNDEF 5 /* Undefined */
 
#define NO_PUSHBACK -1 /* used in pushtype to indicate no pushback */
 
/*
* The global structure in which the specific parts of a
* scanned token are returned.
*
*/
 
struct token
{
char *tk_name; /* name of capability */
int tk_valnumber; /* value of capability (if a number) */
char *tk_valstring; /* value of capability (if a string) */
};
 
extern struct token _nc_curr_token;
 
/*
* The file comp_captab.c contains an array of these structures, one
* per possible capability. These are indexed by a hash table array of
* pointers to the same structures for use by the parser.
*/
 
struct name_table_entry
{
const char *nte_name; /* name to hash on */
int nte_type; /* BOOLEAN, NUMBER or STRING */
short nte_index; /* index of associated variable in its array */
short nte_link; /* index in table of next hash, or -1 */
};
 
struct alias
{
const char *from;
const char *to;
const char *source;
};
 
extern const struct name_table_entry * const _nc_info_hash_table[];
extern const struct name_table_entry * const _nc_cap_hash_table[];
 
extern const struct alias _nc_capalias_table[];
extern const struct alias _nc_infoalias_table[];
 
extern const struct name_table_entry *_nc_get_table(bool);
 
#define NOTFOUND ((struct name_table_entry *) 0)
 
/* out-of-band values for representing absent capabilities */
#define ABSENT_BOOLEAN -1
#define ABSENT_NUMERIC -1
#define ABSENT_STRING (char *)0
 
/* out-of-band values for representing cancels */
#define CANCELLED_BOOLEAN (char)(-2)
#define CANCELLED_NUMERIC -2
#define CANCELLED_STRING (char *)-1
 
#define VALID_STRING(s) ((s) != CANCELLED_STRING && (s) != ABSENT_STRING)
 
/* termcap entries longer than this may break old binaries */
#define MAX_TERMCAP_LENGTH 1023
 
/* this is a documented limitation of terminfo */
#define MAX_TERMINFO_LENGTH 4096
 
#ifndef TERMINFO
#define TERMINFO "/usr/share/terminfo"
#endif
 
/* comp_hash.c: name lookup */
struct name_table_entry const *_nc_find_entry(const char *,
const struct name_table_entry *const *);
struct name_table_entry const *_nc_find_type_entry(const char *,
int,
const struct name_table_entry *);
 
/* comp_scan.c: lexical analysis */
extern int _nc_get_token(void);
extern void _nc_push_token(int);
extern void _nc_reset_input(FILE *, char *);
extern void _nc_panic_mode(char);
extern int _nc_curr_line;
extern int _nc_curr_col;
extern long _nc_curr_file_pos;
extern long _nc_comment_start, _nc_comment_end;
extern int _nc_syntax;
extern long _nc_start_line;
#define SYN_TERMINFO 0
#define SYN_TERMCAP 1
 
/* comp_error.c: warning & abort messages */
extern void _nc_set_source(const char *const name);
extern void _nc_get_type(char *name);
extern void _nc_set_type(const char *const name);
extern void _nc_syserr_abort(const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
extern void _nc_err_abort(const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
extern void _nc_warning(const char *const,...) GCC_PRINTFLIKE(1,2);
extern bool _nc_suppress_warnings;
 
/* comp_expand.c: expand string into readable form */
extern char *_nc_tic_expand(const char *, bool);
 
/* comp_scan.c: decode string from readable form */
extern char _nc_trans_string(char *);
 
/* captoinfo.c: capability conversion */
extern char *_nc_captoinfo(const char *, const char *, int const);
extern char *_nc_infotocap(const char *, const char *, int const);
 
/* lib_tputs.c */
extern int _nc_nulls_sent; /* Add one for every null sent */
 
/* comp_main.c: compiler main */
extern const char *_nc_progname;
 
/* read_entry.c */
extern const char *_nc_tic_dir(const char *);
 
/* write_entry.c */
extern int _nc_tic_written(void);
 
#ifdef __cplusplus
}
#endif
 
#endif /* __TIC_H */
/contrib/media/updf/include/time.h
0,0 → 1,104
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_time_h_
#define __dj_include_time_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
/* 65536(tics/hour) / 3600(sec/hour) * 5(scale) = 91.02
The 5 is to make it a whole number (18.2*5=91) so that
floating point ops aren't required to use it. */
#define CLOCKS_PER_SEC 91
 
#include <sys/djtypes.h>
/* Some programs think they know better... */
#undef NULL
 
#define NULL 0
__DJ_clock_t
#undef __DJ_clock_t
#define __DJ_clock_t
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
__DJ_time_t
#undef __DJ_time_t
#define __DJ_time_t
 
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
char *__tm_zone;
int __tm_gmtoff;
};
 
char * asctime(const struct tm *_tptr);
clock_t clock(void);
char * ctime(const time_t *_cal);
double difftime(time_t _t1, time_t _t0);
struct tm * gmtime(const time_t *_tod);
struct tm * localtime(const time_t *_tod);
time_t mktime(struct tm *_tptr);
size_t strftime(char *_s, size_t _n, const char *_format, const struct tm *_tptr);
time_t time(time_t *_tod);
 
#ifndef __STRICT_ANSI__
 
#define CLK_TCK CLOCKS_PER_SEC
 
extern char *tzname[2];
 
void tzset(void);
 
#ifndef _POSIX_SOURCE
 
#define tm_zone __tm_zone
#define tm_gmtoff __tm_gmtoff
 
struct timeval {
time_t tv_sec;
long tv_usec;
};
 
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
 
#include <sys/types.h>
 
typedef long long uclock_t;
#define UCLOCKS_PER_SEC 1193180
 
int gettimeofday(struct timeval *_tp, struct timezone *_tzp);
unsigned long rawclock(void);
int select(int _nfds, fd_set *_readfds, fd_set *_writefds, fd_set *_exceptfds, struct timeval *_timeout);
int settimeofday(struct timeval *_tp, ...);
void tzsetwall(void);
uclock_t uclock(void);
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_time_h_ */
/contrib/media/updf/include/tokenizer.h
0,0 → 1,44
/** \file tokenizer.h
* definitions of input output classes that read and write from string.
*/
 
 
#ifndef __tokenizer_h__
#define __tokenizer_h__
 
#include "yacasbase.h"
#include "lispstring.h"
#include "lispio.h"
#include "lisphash.h"
class LispTokenizer : public YacasBase
{
public:
LispTokenizer() : iToken() {}
/// NextToken returns a string representing the next token,
/// or an empty list.
virtual LispString * NextToken(LispInput& aInput,
LispHashTable& aHashTable);
virtual ~LispTokenizer(){}
protected:
LispString iToken; //Can be used as a token container.
};
 
class CommonLispTokenizer : public LispTokenizer
{
public:
virtual LispString * NextToken(LispInput& aInput,
LispHashTable& aHashTable);
};
 
 
// utility functions
LispBoolean IsDigit(LispChar c);
LispBoolean IsAlpha(LispChar c);
LispBoolean IsAlNum(LispChar c);
LispBoolean IsSymbolic(LispChar c);
 
 
 
#endif
 
 
/contrib/media/updf/include/types.h
0,0 → 1,48
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)types.h 8.1 (Berkeley) 6/6/93
*/
 
typedef struct {
char *modedescriptions;
char modetype;
} Modelist;
 
extern Modelist modelist[];
 
typedef struct {
int
system, /* what the current time is */
echotoggle, /* last time user entered echo character */
modenegotiated, /* last time operating mode negotiated */
didnetreceive, /* last time we read data from network */
gotDM; /* when did we last see a data mark */
} Clocks;
 
extern Clocks clocks;
/contrib/media/updf/include/tzfile.h
0,0 → 1,160
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_tzfile_h__
#define __dj_include_tzfile_h__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Arthur David Olson of the National Cancer Institute.
*
* Redistribution and use in source and binary forms are permitted provided
* that: (1) source distributions retain this entire copyright notice and
* comment, and (2) distributions including binaries display the following
* acknowledgement: ``This product includes software developed by the
* University of California, Berkeley and its contributors'' in the
* documentation or other materials provided with the distribution and in
* all advertising materials mentioning features or use of this software.
* Neither the name of the University nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* @(#)tzfile.h 5.9 (Berkeley) 6/11/90
*/
 
/*
** Information about time zone files.
*/
 
/* Time zone object file directory */
#define TZDIR "/hd/1/menuetos/zoneinfo"
#define TZDEFAULT "/hd/1/menuetos/localtim"
#define TZDEFRULES "posixrul"
 
/*
** Each file begins with. . .
*/
 
struct tzhead {
char tzh_reserved[24]; /* reserved for future use */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
char tzh_charcnt[4]; /* coded number of abbr. chars */
};
 
/*
** . . .followed by. . .
**
** tzh_timecnt (char [4])s coded transition times a la time(2)
** tzh_timecnt (unsigned char)s types of local time starting at above
** tzh_typecnt repetitions of
** one (char [4]) coded GMT offset in seconds
** one (unsigned char) used to set tm_isdst
** one (unsigned char) that's an abbreviation list index
** tzh_charcnt (char)s '\0'-terminated zone abbreviations
** tzh_leapcnt repetitions of
** one (char [4]) coded leap second transition times
** one (char [4]) total correction after above
** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
** time is standard time, if FALSE,
** transition time is wall clock time
** if absent, transition times are
** assumed to be wall clock time
*/
 
/*
** In the current implementation, "tzset()" refuses to deal with files that
** exceed any of the limits below.
*/
 
/*
** The TZ_MAX_TIMES value below is enough to handle a bit more than a
** year's worth of solar time (corrected daily to the nearest second) or
** 138 years of Pacific Presidential Election time
** (where there are three time zone transitions every fourth year).
*/
#define TZ_MAX_TIMES 370
 
#define NOSOLAR /* 4BSD doesn't currently handle solar time */
 
#ifndef NOSOLAR
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
#else
#define TZ_MAX_TYPES 10 /* Maximum number of local time types */
#endif
 
#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
 
#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
 
#define SECSPERMIN 60
#define MINSPERHOUR 60
#define HOURSPERDAY 24
#define DAYSPERWEEK 7
#define DAYSPERNYEAR 365
#define DAYSPERLYEAR 366
#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY)
#define MONSPERYEAR 12
 
#define TM_SUNDAY 0
#define TM_MONDAY 1
#define TM_TUESDAY 2
#define TM_WEDNESDAY 3
#define TM_THURSDAY 4
#define TM_FRIDAY 5
#define TM_SATURDAY 6
 
#define TM_JANUARY 0
#define TM_FEBRUARY 1
#define TM_MARCH 2
#define TM_APRIL 3
#define TM_MAY 4
#define TM_JUNE 5
#define TM_JULY 6
#define TM_AUGUST 7
#define TM_SEPTEMBER 8
#define TM_OCTOBER 9
#define TM_NOVEMBER 10
#define TM_DECEMBER 11
 
#define TM_YEAR_BASE 1900
 
#define EPOCH_YEAR 1970
#define EPOCH_WDAY TM_THURSDAY
 
/*
** Accurate only for the past couple of centuries;
** that will probably do.
*/
 
#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* __dj_include_tzfile_h__ */
/contrib/media/updf/include/unctrl.h
0,0 → 1,63
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
 
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
****************************************************************************/
 
/*
* unctrl.h
*
* Display a printable version of a control character.
* Control characters are displayed in caret notation (^x), DELETE is displayed
* as ^?. Printable characters are displayed as is.
*/
 
/* $Id: unctrl.h.in,v 1.8 1998/02/11 12:13:45 tom Exp $ */
 
#ifndef _UNCTRL_H
#define _UNCTRL_H 1
 
#undef NCURSES_VERSION
#define NCURSES_VERSION "4.2"
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include <curses.h>
 
#undef unctrl
extern NCURSES_CONST char *unctrl(chtype);
 
#ifdef __cplusplus
}
#endif
 
#endif /* _UNCTRL_H */
/contrib/media/updf/include/unistd.h
0,0 → 1,164
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_unistd_h_
#define __dj_include_unistd_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#include <sys/types.h> /* NOT POSIX but you can't include just unistd.h without it */
#include <sys/djtypes.h>
 
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
/* Some programs think they know better... */
#undef NULL
 
#define NULL 0
 
#define F_OK 0x01
#define R_OK 0x02
#define W_OK 0x04
#define X_OK 0x08
 
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
 
#define _PC_CHOWN_RESTRICTED 1
#define _PC_LINK_MAX 2
#define _PC_MAX_CANON 3
#define _PC_MAX_INPUT 4
#define _PC_NAME_MAX 5
#define _PC_NO_TRUNC 6
#define _PC_PATH_MAX 7
#define _PC_PIPE_BUF 8
#define _PC_VDISABLE 9
 
#define _POSIX_CHOWN_RESTRICTED 0
#undef _POSIX_JOB_CONTROL
#define _POSIX_NO_TRUNC 0
#undef _POSIX_SAVED_IDS
#define _POSIX_VDISABLE -1
#define _POSIX_VERSION 199009L
 
#define _SC_ARG_MAX 1
#define _SC_CHILD_MAX 2
#define _SC_CLK_TCK 3
#define _SC_JOB_CONTROL 4
#define _SC_NGROUPS_MAX 5
#define _SC_OPEN_MAX 6
#define _SC_SAVED_IDS 7
#define _SC_STREAM_MAX 8
#define _SC_TZNAME_MAX 9
#define _SC_VERSION 10
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
__DJ_ssize_t
#undef __DJ_ssize_t
#define __DJ_ssize_t
 
extern char *optarg;
extern int optind, opterr, optopt;
 
#ifdef _MSC_VER
void __declspec(noreturn) __exit(int _status);
void __declspec(noreturn) _exit(int _status);
#else
void __exit(int _status) __attribute__((noreturn));
void _exit(int _status) __attribute__((noreturn));
#endif
int access(const char *_path, int _amode);
unsigned int alarm(unsigned int _seconds);
int chdir(const char *_path);
int chown(const char *_path, uid_t _owner, gid_t _group);
int close(int _fildes);
char * ctermid(char *_s);
int dup(int _fildes);
int dup2(int _fildes, int _fildes2);
int execl(const char *_path, const char *_arg, ...);
int execle(const char *_path, const char *_arg, ...);
int execlp(const char *_file, const char *_arg, ...);
int execv(const char *_path, char *const _argv[]);
int execve(const char *_path, char *const _argv[], char *const _envp[]);
int execvp(const char *_file, char *const _argv[]);
pid_t fork(void);
long fpathconf(int _fildes, int _name);
char * getcwd(char *_buf, size_t _size);
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
int getgroups(int _gidsetsize, gid_t *_grouplist);
char * getlogin(void);
int getopt(int _argc, char *const _argv[], const char *_optstring);
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getppid(void);
uid_t getuid(void);
int isatty(int _fildes);
int link(const char *_existing, const char *_new);
off_t lseek(int _fildes, off_t _offset, int _whence);
long pathconf(const char *_path, int _name);
int pause(void);
int pipe(int _fildes[2]);
ssize_t read(int _fildes, void *_buf, size_t _nbyte);
int rmdir(const char *_path);
int setgid(gid_t _gid);
int setpgid(pid_t _pid, pid_t _pgid);
pid_t setsid(void);
int setuid(uid_t uid);
unsigned int sleep(unsigned int _seconds);
long sysconf(int _name);
pid_t tcgetpgrp(int _fildes);
int tcsetpgrp(int _fildes, pid_t _pgrp_id);
char * ttyname(int _fildes);
int unlink(const char *_path);
ssize_t write(int _fildes, const void *_buf, size_t _nbyte);
 
#ifndef _POSIX_SOURCE
 
/* additional access() checks */
#define D_OK 0x10
 
char * basename(const char *);
/*int brk(void *_heaptop);*/
char * dirname(const char *_fn);
int __file_exists(const char *_fn);
int fsync(int _fd);
int ftruncate(int, off_t);
int getdtablesize(void);
int gethostname(char *buf, int size);
int getpagesize(void);
char * getwd(char *__buffer);
int nice(int _increment);
void * sbrk(int _delta);
int symlink (const char *, const char *);
int sync(void);
int truncate(const char*, off_t);
unsigned int usleep(unsigned int _useconds);
#ifndef vfork
pid_t vfork(void);
#endif
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_unistd_h_ */
/contrib/media/updf/include/unixcommandline.h
0,0 → 1,40
 
#ifndef __unixcommandline_h__
#define __unixcommandline_h__
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <signal.h>
#include <unistd.h>
#include <termios.h>
#include <time.h>
 
#include "yacasbase.h"
#include "commandline.h"
 
/** Unix command line class, using assorted termios functionality
* and sending ansi character sequences to the console.
*/
class CUnixCommandLine : public CCommandLine
{
public:
CUnixCommandLine();
~CUnixCommandLine();
public:
virtual LispInt GetKey();
virtual void NewLine();
virtual void ShowLine(LispChar * prompt,LispInt promptlen,LispInt cursor);
virtual void Pause();
virtual void MaxHistoryLinesSaved(LispInt aNrLines);
private:
unsigned char term_chars[NCCS];
struct termios orig_termio, rl_termio;
public:
LispInt iMaxLines;
};
 
 
#endif
 
/contrib/media/updf/include/utility
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_UTILITY
#include <bits/std_utility.h>
#endif
/contrib/media/updf/include/utime.h
0,0 → 1,38
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_utime_h_
#define __dj_include_utime_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#include <sys/djtypes.h>
__DJ_time_t
#undef __DJ_time_t
#define __DJ_time_t
 
struct utimbuf {
time_t actime;
time_t modtime;
};
 
int utime(const char *_path, const struct utimbuf *_times);
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_utime_h_ */
/contrib/media/updf/include/valarray
0,0 → 1,32
// -*- C++ -*- std header.
 
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, 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 General Public License for more details.
 
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
 
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
 
#ifndef _CPP_VALARRAY
#include <bits/std_valarray.h>
#endif
/contrib/media/updf/include/values.h
0,0 → 1,57
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_values_h_
#define __dj_include_values_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#define BITSPERBYTE 8
 
#define CHARBITS 8
#define SHORTBITS 16
#define INTBITS 32
#define LONGBITS 32
#define PTRBITS 32
#define DOUBLEBITS 64
#define FLOATBITS 32
 
#define MINSHORT ((short)0x8000)
#define MININT ((int)0x80000000L)
#define MINLONG ((long)0x80000000L)
 
#define MAXSHORT ((short)0x7fff)
#define MAXINT ((int)0x7fffffff)
#define MAXLONG ((long)0x7fffffff)
 
#define MAXDOUBLE 1.79769313486231570e+308
#define MAXFLOAT ((float)3.40282346638528860e+38)
#define MINDOUBLE 2.22507385850720140e-308
#define MINFLOAT ((float)1.17549435082228750e-38)
#define _IEEE 0
#define _DEXPLEN 11
#define _FEXPLEN 8
#define _HIDDENBIT 1
#define DMAXEXP ((1 << _DEXPLEN - 1) - 1 + _IEEE)
#define FMAXEXP ((1 << _FEXPLEN - 1) - 1 + _IEEE)
#define DMINEXP (-DMAXEXP)
#define FMINEXP (-FMAXEXP)
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_values_h_ */
/contrib/media/updf/include/varargs.h
0,0 → 1,51
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_vararg_h_
#define __dj_include_vararg_h_
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifdef __dj_include_stdarg_h_
#error varargs.h and stdarg.h are mutually exclusive
#endif
 
#include <sys/djtypes.h>
 
__DJ_va_list
#undef __DJ_va_list
#define __DJ_va_list
 
#define va_alist __dj_last_arg
 
#define va_dcl int __dj_last_arg;
 
#define __dj_va_rounded_size(T) \
(((sizeof (T) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
 
#define va_arg(ap, T) \
(ap = (va_list) ((char *) (ap) + __dj_va_rounded_size (T)), \
*((T *) (void *) ((char *) (ap) - __dj_va_rounded_size (T))))
 
#define va_end(ap)
 
#define va_start(ap) (ap=(char *)(&__dj_last_arg))
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_varargs_h_ */
/contrib/media/updf/include/vector
0,0 → 1,135
#ifndef _VECTOR_INCLUDED
#define _VECTOR_INCLUDED
#include <stdlib.h>
#include <string.h>
extern void *__cdecl operator new(size_t);
inline void *__cdecl operator new(size_t, void *_P)
{ return (_P); }
namespace std
{
template<class T> class vector
{
unsigned length;
unsigned allocated;
T* data;
public:
typedef unsigned size_type;
typedef T* iterator;
vector():length(0),allocated(0),data(NULL) {}
~vector() {for (unsigned i=length;i--;)data[i].~T();free(data);}
unsigned size() const {return length;}
void clear() {length=0;}
T& operator[](unsigned pos) {return data[pos];}
T* begin() {return data;}
T* end() {return data+length;}
void push_back(const T& x)
{
if (length==allocated)
{
allocated+=16;
data=(T*)realloc(data,allocated*sizeof(T));
}
new (data+length++) T(x);
}
bool empty() const {return length==0;}
void pop_back() {data[--length].~T();}
T& back() {return data[length-1];}
iterator erase(iterator it)
{
T* a=it;
while (++a != data+length)
{
a[-1] = *a;
}
length--;
return it;
}
/*iterator*/T* insert(iterator where, const T& what = T())
{
int z=where-data;
if (length==allocated)
{
allocated+=16;
data=(T*)realloc(data,allocated*sizeof(T));
}
T* a=data+length;
T* b=data+z;
length++;
while (a != b)
{
*a = a[-1];
--a;
}
*a = what;
return /*iterator*/a;
}
};
struct _generic_vector
{
unsigned length;
unsigned allocated;
void** data;
};
inline void _generic_pointer_push_back(_generic_vector* v, void* a)
{
if (v->length==v->allocated)
{
v->allocated+=16;
v->data=(void**)realloc(v->data,v->allocated*sizeof(void*));
}
v->data[v->length++]=a;
}
inline void _generic_pointer_erase(_generic_vector* v, void** a)
{
while (++a != v->data+v->length)
{
a[-1] = *a;
}
v->length--;
}
inline void** _generic_pointer_insert(_generic_vector* v, void** where, void* what)
{
int z=where-v->data;
if (v->length==v->allocated)
{
v->allocated+=16;
v->data=(void**)realloc(v->data,v->allocated*sizeof(void*));
}
void** a=v->data+v->length;
void** b=v->data+z;
v->length++;
while (a != b)
{
*a = a[-1];
--a;
}
*a = what;
return a;
}
template<class T> class vector<T*>
{
unsigned length;
unsigned allocated;
T** data;
public:
typedef unsigned size_type;
typedef T** iterator;
vector():length(0),allocated(0),data(NULL) {}
~vector() {free(data);}
unsigned size() const {return length;}
void clear() {length=0;}
T*& operator[](unsigned pos) {return data[pos];}
iterator begin() {return iterator(data);}
iterator end() {return iterator(data+length);}
void push_back(T* const& x)
{ _generic_pointer_push_back((_generic_vector*)this, (void*)x); }
bool empty() const {return length==0;}
void pop_back() {--length;}
T*& back() {return data[length-1];}
iterator erase(iterator it)
{ _generic_pointer_erase((_generic_vector*)this, (void**)it); return it; }
iterator insert(iterator where, T* const& what)
{ return (T**)_generic_pointer_insert((_generic_vector*)this, (void**)where, what); }
};
}
#endif
/contrib/media/updf/include/version.h
0,0 → 1,0
#define VERSION "1.2.2"
/contrib/media/updf/include/wchar.h
0,0 → 1,45
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_wchar_h_
#define __dj_include_wchar_h_
 
/* Bare bones header to satisfy SGI STL's basic_string<> */
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#include <stddef.h>
 
__DJ_wint_t
#undef __DJ_wint_t
#define __DJ_wint_t
 
#ifndef WEOF
#define WEOF ((wint_t)(-1))
#endif
 
typedef struct
{
int shift_state;
} mbstate_t;
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_wchar_h_ */
 
/contrib/media/updf/include/wctype.h
0,0 → 1,47
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_wctype_h_
#define __dj_include_wctype_h_
 
/* Bare bones header to satisfy SGI STL's basic_string<> */
 
#ifdef __cplusplus
extern "C" {
#endif
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#include <sys/djtypes.h>
 
__DJ_wchar_t
#undef __DJ_wchar_t
#define __DJ_wchar_t
__DJ_wint_t
#undef __DJ_wint_t
#define __DJ_wint_t
 
#ifndef WEOF
#define WEOF ((wint_t)(-1))
#endif
 
/* Implementation defined types */
typedef unsigned short wctype_t;
typedef const unsigned char *wctrans_t;
 
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
#ifdef __cplusplus
}
#endif
 
#endif /* !__dj_include_wctype_h_ */
 
/contrib/media/updf/include/xmltokenizer.h
0,0 → 1,20
 
#ifndef _xmltokenizer_h_
#define _xmltokenizer_h_
 
#include "yacasbase.h"
#include "tokenizer.h"
 
class XmlTokenizer : public LispTokenizer
{
public:
XmlTokenizer() {}
/// NextToken returns a string representing the next token,
/// or an empty list.
virtual LispString * NextToken(LispInput& aInput,
LispHashTable& aHashTable);
virtual ~XmlTokenizer();
};
 
#endif
 
/contrib/media/updf/include/y_tab.h
0,0 → 1,35
 
typedef union
{
int vInt;
long vLong;
float vFloat;
Word vWord;
Byte *pByte;
} YYSTYPE;
extern YYSTYPE yylval;
# define NIL 257
# define IF 258
# define THEN 259
# define ELSE 260
# define ELSEIF 261
# define WHILE 262
# define DO 263
# define REPEAT 264
# define UNTIL 265
# define END 266
# define RETURN 267
# define LOCAL 268
# define NUMBER 269
# define FUNCTION 270
# define NAME 271
# define STRING 272
# define DEBUG 273
# define NOT 274
# define AND 275
# define OR 276
# define NE 277
# define LE 278
# define GE 279
# define CONC 280
# define UNARY 281
/contrib/media/updf/include/yacas.h
0,0 → 1,145
/// \file
/// Definitions of DefaultYacasEnvironment and CYacas.
 
#ifndef __yacas_h__
#define __yacas_h__
 
#include "yacasbase.h"
#include "lispstring.h"
#include "stringio.h"
#include "tokenizer.h"
#include "lisphash.h"
#include "lispevalhash.h"
#include "infixparser.h"
#include "stdfileio.h"
#include "lispatom.h"
#include "lispeval.h"
#include "mathenvironment.h"
#include "lispglobals.h"
#include "lisperror.h"
#include "lispuserfunc.h"
 
 
/// The default environment for a Yacas session.
/// This class constructs a LispEnvironment (to be found in
/// #iEnvironment), and defines the Yacas core functions. The core
/// functions are listed in corefunctions.h . Examples of core
/// functions are \c Head, \c Set and \c Eval.
 
class DefaultYacasEnvironment : public YacasBase
{
public:
DefaultYacasEnvironment();
DefaultYacasEnvironment(LispOutput* aOutput, LispInt aStackSize);
virtual ~DefaultYacasEnvironment();
LispEnvironment& getEnv() {return iEnvironment;}
 
private:
DefaultYacasEnvironment(const DefaultYacasEnvironment& aOther)
: output(NULL),hash(),printer(),coreCommands(),globals(),prefixoperators(),infixoperators(),postfixoperators(),bodiedoperators(),infixprinter(aOther.infixprinter),userFunctions(),
iEnvironment(coreCommands,userFunctions,
globals,hash,output,infixprinter,
prefixoperators,infixoperators,
postfixoperators,bodiedoperators,&input,0),
input(aOther.input.Status())
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
}
DefaultYacasEnvironment& operator=(const DefaultYacasEnvironment& aOther)
{
// copy constructor not written yet, hence the assert
LISPASSERT(0);
return *this;
}
 
private:
LispOutput* output;
LispHashTable hash;
LispPrinter printer;
 
YacasCoreCommands coreCommands;
LispGlobal globals;
 
//Define the default operators.
LispOperators prefixoperators;
LispOperators infixoperators;
LispOperators postfixoperators;
LispOperators bodiedoperators;
InfixPrinter infixprinter;
 
LispUserFunctions userFunctions;
 
LispEnvironment iEnvironment;
 
public:
CachedStdUserInput input;
};
 
 
/// The Yacas engine.
/// This is the only class that applications need to use. It can
/// evaluate Yacas expressions. Every instance has its own Yacas
/// environment, in which the expressions are evaluated.
 
 
 
class CYacas : public YacasBase
{
public:
 
/// Pseudo-constructor.
/// \return A new instance of CYacas, with output connected to \p aOutput.
/// If aOutput is NULL, connect to a new instance of StdUserOutput.
LISPIMPORT static CYacas* NewL(LispOutput* aOutput=0, LispInt aStackSize=50000);
 
/// Destructor.
LISPIMPORT virtual ~CYacas();
 
/// Return the underlying Yacas environment.
inline DefaultYacasEnvironment& getDefEnv() {return environment;}
 
/// Evaluate a Yacas expression.
/// First, \p aExpression is parsed by an InfixParser. Then it is
/// evaluated in the underlying Lisp environment. Finally, the
/// result is printed to #iResultOutput via the pretty printer or,
/// if this is not defined, via an InfixPrinter.
virtual void Evaluate(const LispChar * aExpression);
 
/// Return the result of the expression.
/// This is stored in #iResult.
virtual LispChar * Result();
 
/// Return the error message produced by the last evaluation.
/// The error is retrieved from #environment.
virtual LispChar * Error();
 
/// Whether an error occured during the last evaluation.
inline LispBoolean IsError();
 
private:
/// Constructor.
/// The output of #environment is directed to \p aOutput.
CYacas(LispOutput* aOutput,LispInt aStackSize);
 
private:
 
/// The underlying Yacas environment
DefaultYacasEnvironment environment;
 
/// String containing the result of the last evaluation
LispString iResult;
 
/// Stream pointing to #iResult.
StringOutput iResultOutput;
};
 
inline LispBoolean CYacas::IsError()
{
return (Error()[0] != '\0');
}
 
#endif
 
 
/contrib/media/updf/include/yacasbase.h
0,0 → 1,58
#ifndef __yacasbase_h__
#define __yacasbase_h__
#include "yacasprivate.h"
 
/* /class YacasBase. All other objects should derive from YacasBase so that they use the correct
* operators new and delete. This ensures a Yacas-specific memory manager is used.
*/
 
class YacasBase
{
public:
inline YacasBase() {};
#ifdef YACAS_DEBUG
// New operators with additional debug arguments need to be handled differently
static inline void* operator new(size_t size, char* aFile, int aLine)
{ return YacasMallocPrivate(size,aFile,aLine); }
static inline void* operator new[](size_t size, char* aFile, int aLine)
{ return YacasMallocPrivate(size,aFile,aLine); }
#else
// Normal versions of operator new
static inline void* operator new(size_t size)
{ return PlatAlloc(size); }
static inline void* operator new[](size_t size)
{ return PlatAlloc(size); }
#endif
/* Operators delete are shared, they behave the same whether in debug or release (as
PlatFree is mapped to the debug version of freeing memory any way)
*/
static inline void operator delete(void* object)
{ PlatFree(object); }
static inline void operator delete[](void* object)
{ PlatFree(object); }
// Placement form of new and delete.
static inline void* operator new(size_t, void* where) { return where; }
static inline void operator delete(void*, void*) {}
/** If we don't want to force vtables, we can make the destructor inline and protected.
* The following might cause a little bit of overhead but has the advantage that even
* the compiler can see that this is safe (thus no unnecessary warnings). Preferrably
* though this class has a protected inline destructor.
*
* When I use Xcode on the MacOSX, I would prefer to not see the warnings that the
* destructor of this class is not virtual, and speed is not the primary concern in
* that build (as that build is used mostly for debugging).
*
* HIDE_UNIMPORTANT_COMPILER_WARNINGS can be defined in case one wants to get rid of
* compiler warnings, as opposed to having maximum running speed.
*/
protected:
#ifdef HIDE_UNIMPORTANT_COMPILER_WARNINGS
virtual
#else // HIDE_UNIMPORTANT_COMPILER_WARNINGS
inline
#endif // HIDE_UNIMPORTANT_COMPILER_WARNINGS
~YacasBase() {};
};
 
#endif
/contrib/media/updf/include/yacasprivate.h
0,0 → 1,13
 
#ifndef __yacasprivate_h__
#define __yacasprivate_h__
 
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
 
#include "lisptype.h"
#include "stubs.h"
 
#endif
 
/contrib/media/updf/include/zAVLTree.h
0,0 → 1,67
/*
* zAVLTree.h: Header file for AVLTrees with string keys.
* Copyright (C) 1998 Michael H. Buselli
*
* 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
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* The author of this library can be reached at the following address:
* Michael H. Buselli
* 4334 N. Hazel St. #515
* Chicago, IL 60613-1456
*
* Or you can send email to <cosine@tezcat.com>.
* The official web page for this product is:
* http://www.tezcat.com/~cosine/pub/AVLTree/
*
* This is version 0.1.0 (alpha).
*/
 
#ifndef _ZAVLTREE_H_
#define _ZAVLTREE_H_
 
 
typedef struct _zAVLNode {
const char *key;
long depth;
void *item;
struct _zAVLNode *parent;
struct _zAVLNode *left;
struct _zAVLNode *right;
} zAVLNode;
 
 
typedef struct {
zAVLNode *top;
long count;
const char *(*getkey)(const void *item);
} zAVLTree;
 
 
typedef struct {
const zAVLTree *avltree;
const zAVLNode *curnode;
} zAVLCursor;
 
 
extern zAVLTree *zAVLAllocTree (const char *(*getkey)(void const *item));
extern void zAVLFreeTree (zAVLTree *avltree, void (freeitem)(void *item));
extern int zAVLInsert (zAVLTree *avltree, void *item);
extern void *zAVLSearch (zAVLTree const *avltree, const char *key);
extern int zAVLDelete (zAVLTree *avltree, const char *key);
extern void *zAVLFirst (zAVLCursor *avlcursor, zAVLTree const *avltree);
extern void *zAVLNext (zAVLCursor *avlcursor);
 
 
#endif
/contrib/media/updf/include/zconf.h
0,0 → 1,279
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-1998 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
 
/* @(#) $Id$ */
 
#ifndef _ZCONF_H
#define _ZCONF_H
 
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
*/
#ifdef Z_PREFIX
# define deflateInit_ z_deflateInit_
# define deflate z_deflate
# define deflateEnd z_deflateEnd
# define inflateInit_ z_inflateInit_
# define inflate z_inflate
# define inflateEnd z_inflateEnd
# define deflateInit2_ z_deflateInit2_
# define deflateSetDictionary z_deflateSetDictionary
# define deflateCopy z_deflateCopy
# define deflateReset z_deflateReset
# define deflateParams z_deflateParams
# define inflateInit2_ z_inflateInit2_
# define inflateSetDictionary z_inflateSetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateReset z_inflateReset
# define compress z_compress
# define compress2 z_compress2
# define uncompress z_uncompress
# define adler32 z_adler32
# define crc32 z_crc32
# define get_crc_table z_get_crc_table
 
# define Byte z_Byte
# define uInt z_uInt
# define uLong z_uLong
# define Bytef z_Bytef
# define charf z_charf
# define intf z_intf
# define uIntf z_uIntf
# define uLongf z_uLongf
# define voidpf z_voidpf
# define voidp z_voidp
#endif
 
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
# define WIN32
#endif
#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
# ifndef __32BIT__
# define __32BIT__
# endif
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS
#endif
 
/*
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int).
*/
#if defined(MSDOS) && !defined(__32BIT__)
# define MAXSEG_64K
#endif
#ifdef MSDOS
# define UNALIGNED_OK
#endif
 
#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
# define STDC
#endif
#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
# ifndef STDC
# define STDC
# endif
#endif
 
#ifndef STDC
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
# define const
# endif
#endif
 
/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
# define NO_DUMMY_DECL
#endif
 
/* Old Borland C incorrectly complains about missing returns: */
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
# define NEED_DUMMY_RETURN
#endif
 
 
/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K
# define MAX_MEM_LEVEL 8
# else
# define MAX_MEM_LEVEL 9
# endif
#endif
 
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
* created by gzip. (Files created by minigzip can still be extracted by
* gzip.)
*/
#ifndef MAX_WBITS
# define MAX_WBITS 15 /* 32K LZ77 window */
#endif
 
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
Of course this will generally degrade compression (there's no free lunch).
 
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.
*/
 
/* Type declarations */
 
#ifndef OF /* function prototypes */
# ifdef STDC
# define OF(args) args
# else
# define OF(args) ()
# endif
#endif
 
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
* just define FAR to be empty.
*/
#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
/* MSC small or medium model */
# define SMALL_MEDIUM
# ifdef _MSC_VER
# define FAR _far
# else
# define FAR far
# endif
#endif
#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
# ifndef __32BIT__
# define SMALL_MEDIUM
# define FAR _far
# endif
#endif
 
/* Compile with -DZLIB_DLL for Windows DLL support */
#if defined(ZLIB_DLL)
# if defined(_WINDOWS) || defined(WINDOWS)
# ifdef FAR
# undef FAR
# endif
# include <windows.h>
# define ZEXPORT WINAPI
# ifdef WIN32
# define ZEXPORTVA WINAPIV
# else
# define ZEXPORTVA FAR _cdecl _export
# endif
# endif
# if defined (__BORLANDC__)
# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
# include <windows.h>
# define ZEXPORT __declspec(dllexport) WINAPI
# define ZEXPORTRVA __declspec(dllexport) WINAPIV
# else
# if defined (_Windows) && defined (__DLL__)
# define ZEXPORT _export
# define ZEXPORTVA _export
# endif
# endif
# endif
#endif
 
#if defined (__BEOS__)
# if defined (ZLIB_DLL)
# define ZEXTERN extern __declspec(dllexport)
# else
# define ZEXTERN extern __declspec(dllimport)
# endif
#endif
 
#ifndef ZEXPORT
# define ZEXPORT
#endif
#ifndef ZEXPORTVA
# define ZEXPORTVA
#endif
#ifndef ZEXTERN
# define ZEXTERN extern
#endif
 
#ifndef FAR
# define FAR
#endif
 
#if !defined(MACOS) && !defined(TARGET_OS_MAC)
typedef unsigned char Byte; /* 8 bits */
#endif
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
 
#ifdef SMALL_MEDIUM
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
typedef Byte FAR Bytef;
#endif
typedef char FAR charf;
typedef int FAR intf;
typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
 
#ifdef STDC
typedef void FAR *voidpf;
typedef void *voidp;
#else
typedef Byte FAR *voidpf;
typedef Byte *voidp;
#endif
 
#ifdef HAVE_UNISTD_H
# include <sys/types.h> /* for off_t */
# include <unistd.h> /* for SEEK_* and off_t */
# define z_off_t off_t
#endif
#ifndef SEEK_SET
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
# define z_off_t long
#endif
 
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
# pragma map(deflateInit_,"DEIN")
# pragma map(deflateInit2_,"DEIN2")
# pragma map(deflateEnd,"DEEND")
# pragma map(inflateInit_,"ININ")
# pragma map(inflateInit2_,"ININ2")
# pragma map(inflateEnd,"INEND")
# pragma map(inflateSync,"INSY")
# pragma map(inflateSetDictionary,"INSEDI")
# pragma map(inflate_blocks,"INBL")
# pragma map(inflate_blocks_new,"INBLNE")
# pragma map(inflate_blocks_free,"INBLFR")
# pragma map(inflate_blocks_reset,"INBLRE")
# pragma map(inflate_codes_free,"INCOFR")
# pragma map(inflate_codes,"INCO")
# pragma map(inflate_fast,"INFA")
# pragma map(inflate_flush,"INFLU")
# pragma map(inflate_mask,"INMA")
# pragma map(inflate_set_dictionary,"INSEDI2")
# pragma map(inflate_copyright,"INCOPY")
# pragma map(inflate_trees_bits,"INTRBI")
# pragma map(inflate_trees_dynamic,"INTRDY")
# pragma map(inflate_trees_fixed,"INTRFI")
# pragma map(inflate_trees_free,"INTRFR")
#endif
 
#endif /* _ZCONF_H */
/contrib/media/updf/include/zlib.h
0,0 → 1,893
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.1.3, July 9th, 1998
 
Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
 
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
 
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
 
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
 
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
 
 
The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
*/
 
#ifndef _ZLIB_H
#define _ZLIB_H
 
#include "zconf.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
#define ZLIB_VERSION "1.1.3"
 
/*
The 'zlib' compression library provides in-memory compression and
decompression functions, including integrity checks of the uncompressed
data. This version of the library supports only one compression method
(deflation) but other algorithms will be added later and will have the same
stream interface.
 
Compression can be done in a single step if the buffers are large
enough (for example if an input file is mmap'ed), or can be done by
repeated calls of the compression function. In the latter case, the
application must provide more input and/or consume the output
(providing more output space) before each call.
 
The library also supports reading and writing files in gzip (.gz) format
with an interface similar to that of stdio.
 
The library does not install any signal handler. The decoder checks
the consistency of the compressed data, so the library should never
crash even in case of corrupted input.
*/
 
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
typedef void (*free_func) OF((voidpf opaque, voidpf address));
 
struct internal_state;
 
typedef struct z_stream_s {
Bytef *next_in; /* next input byte */
uInt avail_in; /* number of bytes available at next_in */
uLong total_in; /* total nb of input bytes read so far */
 
Bytef *next_out; /* next output byte should be put there */
uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total nb of bytes output so far */
 
char *msg; /* last error message, NULL if no error */
struct internal_state FAR *state; /* not visible by applications */
 
alloc_func zalloc; /* used to allocate the internal state */
free_func zfree; /* used to free the internal state */
voidpf opaque; /* private data object passed to zalloc and zfree */
 
int data_type; /* best guess about the data type: ascii or binary */
uLong adler; /* adler32 value of the uncompressed data */
uLong reserved; /* reserved for future use */
} z_stream;
 
typedef z_stream FAR *z_streamp;
 
/*
The application must update next_in and avail_in when avail_in has
dropped to zero. It must update next_out and avail_out when avail_out
has dropped to zero. The application must initialize zalloc, zfree and
opaque before calling the init function. All other fields are set by the
compression library and must not be updated by the application.
 
The opaque value provided by the application will be passed as the first
parameter for calls of zalloc and zfree. This can be useful for custom
memory management. The compression library attaches no meaning to the
opaque value.
 
zalloc must return Z_NULL if there is not enough memory for the object.
If zlib is used in a multi-threaded application, zalloc and zfree must be
thread safe.
 
On 16-bit systems, the functions zalloc and zfree must be able to allocate
exactly 65536 bytes, but will not be required to allocate more than this
if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
pointers returned by zalloc for objects of exactly 65536 bytes *must*
have their offset normalized to zero. The default allocation function
provided by this library ensures this (see zutil.c). To reduce memory
requirements and avoid any allocation of 64K objects, at the expense of
compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
 
The fields total_in and total_out can be used for statistics or
progress reports. After compression, total_in holds the total size of
the uncompressed data and may be saved for use in the decompressor
(particularly if the decompressor wants to decompress everything in
a single step).
*/
 
/* constants */
 
#define Z_NO_FLUSH 0
#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
#define Z_SYNC_FLUSH 2
#define Z_FULL_FLUSH 3
#define Z_FINISH 4
/* Allowed flush values; see deflate() below for details */
 
#define Z_OK 0
#define Z_STREAM_END 1
#define Z_NEED_DICT 2
#define Z_ERRNO (-1)
#define Z_STREAM_ERROR (-2)
#define Z_DATA_ERROR (-3)
#define Z_MEM_ERROR (-4)
#define Z_BUF_ERROR (-5)
#define Z_VERSION_ERROR (-6)
/* Return codes for the compression/decompression functions. Negative
* values are errors, positive values are used for special but normal events.
*/
 
#define Z_NO_COMPRESSION 0
#define Z_BEST_SPEED 1
#define Z_BEST_COMPRESSION 9
#define Z_DEFAULT_COMPRESSION (-1)
/* compression levels */
 
#define Z_FILTERED 1
#define Z_HUFFMAN_ONLY 2
#define Z_DEFAULT_STRATEGY 0
/* compression strategy; see deflateInit2() below for details */
 
#define Z_BINARY 0
#define Z_ASCII 1
#define Z_UNKNOWN 2
/* Possible values of the data_type field */
 
#define Z_DEFLATED 8
/* The deflate compression method (the only one supported in this version) */
 
#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
 
#define zlib_version zlibVersion()
/* for compatibility with versions < 1.0.2 */
 
/* basic functions */
 
ZEXTERN const char * ZEXPORT zlibVersion OF((void));
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
If the first character differs, the library code actually used is
not compatible with the zlib.h header file used by the application.
This check is automatically made by deflateInit and inflateInit.
*/
 
/*
ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
 
Initializes the internal stream state for compression. The fields
zalloc, zfree and opaque must be initialized before by the caller.
If zalloc and zfree are set to Z_NULL, deflateInit updates them to
use default allocation functions.
 
The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
1 gives best speed, 9 gives best compression, 0 gives no compression at
all (the input data is simply copied a block at a time).
Z_DEFAULT_COMPRESSION requests a default compromise between speed and
compression (currently equivalent to level 6).
 
deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if level is not a valid compression level,
Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
with the version assumed by the caller (ZLIB_VERSION).
msg is set to null if there is no error message. deflateInit does not
perform any compression: this will be done by deflate().
*/
 
 
ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
/*
deflate compresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce some
output latency (reading input without producing any output) except when
forced to flush.
 
The detailed semantics are as follows. deflate performs one or both of the
following actions:
 
- Compress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in and avail_in are updated and
processing will resume at this point for the next call of deflate().
 
- Provide more output starting at next_out and update next_out and avail_out
accordingly. This action is forced if the parameter flush is non zero.
Forcing flush frequently degrades the compression ratio, so this parameter
should be set only when necessary (in interactive applications).
Some output may be provided even if flush is not set.
 
Before the call of deflate(), the application should ensure that at least
one of the actions is possible, by providing more input and/or consuming
more output, and updating avail_in or avail_out accordingly; avail_out
should never be zero before the call. The application can consume the
compressed output when it wants, for example when the output buffer is full
(avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
and with zero avail_out, it must be called again after making room in the
output buffer because there might be more output pending.
 
If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
flushed to the output buffer and the output is aligned on a byte boundary, so
that the decompressor can get all input data available so far. (In particular
avail_in is zero after the call if enough output space has been provided
before the call.) Flushing may degrade compression for some compression
algorithms and so it should be used only when necessary.
 
If flush is set to Z_FULL_FLUSH, all output is flushed as with
Z_SYNC_FLUSH, and the compression state is reset so that decompression can
restart from this point if previous compressed data has been damaged or if
random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
the compression.
 
If deflate returns with avail_out == 0, this function must be called again
with the same value of the flush parameter and more output space (updated
avail_out), until the flush is complete (deflate returns with non-zero
avail_out).
 
If the parameter flush is set to Z_FINISH, pending input is processed,
pending output is flushed and deflate returns with Z_STREAM_END if there
was enough output space; if deflate returns with Z_OK, this function must be
called again with Z_FINISH and more output space (updated avail_out) but no
more input data, until it returns with Z_STREAM_END or an error. After
deflate has returned Z_STREAM_END, the only possible operations on the
stream are deflateReset or deflateEnd.
Z_FINISH can be used immediately after deflateInit if all the compression
is to be done in a single step. In this case, avail_out must be at least
0.1% larger than avail_in plus 12 bytes. If deflate does not return
Z_STREAM_END, then it must be called again as described above.
 
deflate() sets strm->adler to the adler32 checksum of all input read
so far (that is, total_in bytes).
 
deflate() may update data_type if it can make a good guess about
the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
binary. This field is only for information purposes and does not affect
the compression algorithm in any manner.
 
deflate() returns Z_OK if some progress has been made (more input
processed or more output produced), Z_STREAM_END if all input has been
consumed and all output has been produced (only when flush is set to
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
(for example avail_in or avail_out was zero).
*/
 
 
ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any
pending output.
 
deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
stream state was inconsistent, Z_DATA_ERROR if the stream was freed
prematurely (some input or output was discarded). In the error case,
msg may be set but then points to a static string (which must not be
deallocated).
*/
 
 
/*
ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
 
Initializes the internal stream state for decompression. The fields
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
value depends on the compression method), inflateInit determines the
compression method from the zlib header and allocates all data structures
accordingly; otherwise the allocation will be deferred to the first call of
inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
use default allocation functions.
 
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
version assumed by the caller. msg is set to null if there is no error
message. inflateInit does not perform any decompression apart from reading
the zlib header if present: this will be done by inflate(). (So next_in and
avail_in may be modified, but next_out and avail_out are unchanged.)
*/
 
 
ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
/*
inflate decompresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may some
introduce some output latency (reading input without producing any output)
except when forced to flush.
 
The detailed semantics are as follows. inflate performs one or both of the
following actions:
 
- Decompress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in is updated and processing
will resume at this point for the next call of inflate().
 
- Provide more output starting at next_out and update next_out and avail_out
accordingly. inflate() provides as much output as possible, until there
is no more input data or no more space in the output buffer (see below
about the flush parameter).
 
Before the call of inflate(), the application should ensure that at least
one of the actions is possible, by providing more input and/or consuming
more output, and updating the next_* and avail_* values accordingly.
The application can consume the uncompressed output when it wants, for
example when the output buffer is full (avail_out == 0), or after each
call of inflate(). If inflate returns Z_OK and with zero avail_out, it
must be called again after making room in the output buffer because there
might be more output pending.
 
If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
output as possible to the output buffer. The flushing behavior of inflate is
not specified for values of the flush parameter other than Z_SYNC_FLUSH
and Z_FINISH, but the current implementation actually flushes as much output
as possible anyway.
 
inflate() should normally be called until it returns Z_STREAM_END or an
error. However if all decompression is to be performed in a single step
(a single call of inflate), the parameter flush should be set to
Z_FINISH. In this case all pending input is processed and all pending
output is flushed; avail_out must be large enough to hold all the
uncompressed data. (The size of the uncompressed data may have been saved
by the compressor for this purpose.) The next operation on this stream must
be inflateEnd to deallocate the decompression state. The use of Z_FINISH
is never required, but can be used to inform inflate that a faster routine
may be used for the single inflate() call.
 
If a preset dictionary is needed at this point (see inflateSetDictionary
below), inflate sets strm-adler to the adler32 checksum of the
dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
it sets strm->adler to the adler32 checksum of all output produced
so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
an error code as described below. At the end of the stream, inflate()
checks that its computed adler32 checksum is equal to that saved by the
compressor and returns Z_STREAM_END only if the checksum is correct.
 
inflate() returns Z_OK if some progress has been made (more input processed
or more output produced), Z_STREAM_END if the end of the compressed data has
been reached and all uncompressed output has been produced, Z_NEED_DICT if a
preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
corrupted (input stream not conforming to the zlib format or incorrect
adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
(for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if no progress is possible or if there was not
enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
case, the application may then call inflateSync to look for a good
compression block.
*/
 
 
ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any
pending output.
 
inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
was inconsistent. In the error case, msg may be set but then points to a
static string (which must not be deallocated).
*/
 
/* Advanced functions */
 
/*
The following functions are needed only in some special applications.
*/
 
/*
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
int level,
int method,
int windowBits,
int memLevel,
int strategy));
 
This is another version of deflateInit with more compression options. The
fields next_in, zalloc, zfree and opaque must be initialized before by
the caller.
 
The method parameter is the compression method. It must be Z_DEFLATED in
this version of the library.
 
The windowBits parameter is the base two logarithm of the window size
(the size of the history buffer). It should be in the range 8..15 for this
version of the library. Larger values of this parameter result in better
compression at the expense of memory usage. The default value is 15 if
deflateInit is used instead.
 
The memLevel parameter specifies how much memory should be allocated
for the internal compression state. memLevel=1 uses minimum memory but
is slow and reduces compression ratio; memLevel=9 uses maximum memory
for optimal speed. The default value is 8. See zconf.h for total memory
usage as a function of windowBits and memLevel.
 
The strategy parameter is used to tune the compression algorithm. Use the
value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
string match). Filtered data consists mostly of small values with a
somewhat random distribution. In this case, the compression algorithm is
tuned to compress them better. The effect of Z_FILTERED is to force more
Huffman coding and less string matching; it is somewhat intermediate
between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
the compression ratio but not the correctness of the compressed output even
if it is not set appropriately.
 
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
method). msg is set to null if there is no error message. deflateInit2 does
not perform any compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
const Bytef *dictionary,
uInt dictLength));
/*
Initializes the compression dictionary from the given byte sequence
without producing any compressed output. This function must be called
immediately after deflateInit, deflateInit2 or deflateReset, before any
call of deflate. The compressor and decompressor must use exactly the same
dictionary (see inflateSetDictionary).
 
The dictionary should consist of strings (byte sequences) that are likely
to be encountered later in the data to be compressed, with the most commonly
used strings preferably put towards the end of the dictionary. Using a
dictionary is most useful when the data to be compressed is short and can be
predicted with good accuracy; the data can then be compressed better than
with the default empty dictionary.
 
Depending on the size of the compression data structures selected by
deflateInit or deflateInit2, a part of the dictionary may in effect be
discarded, for example if the dictionary is larger than the window size in
deflate or deflate2. Thus the strings most likely to be useful should be
put at the end of the dictionary, not at the front.
 
Upon return of this function, strm->adler is set to the Adler32 value
of the dictionary; the decompressor may later use this value to determine
which dictionary has been used by the compressor. (The Adler32 value
applies to the whole dictionary even if only a subset of the dictionary is
actually used by the compressor.)
 
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
parameter is invalid (such as NULL dictionary) or the stream state is
inconsistent (for example if deflate has already been called for this stream
or if the compression method is bsort). deflateSetDictionary does not
perform any compression: this will be done by deflate().
*/
 
ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
z_streamp source));
/*
Sets the destination stream as a complete copy of the source stream.
 
This function can be useful when several compression strategies will be
tried, for example when there are several ways of pre-processing the input
data with a filter. The streams that will be discarded should then be freed
by calling deflateEnd. Note that deflateCopy duplicates the internal
compression state which can be quite large, so this strategy is slow and
can consume lots of memory.
 
deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
(such as zalloc being NULL). msg is left unchanged in both source and
destination.
*/
 
ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
/*
This function is equivalent to deflateEnd followed by deflateInit,
but does not free and reallocate all the internal compression state.
The stream will keep the same compression level and any other attributes
that may have been set by deflateInit2.
 
deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being NULL).
*/
 
ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
int level,
int strategy));
/*
Dynamically update the compression level and compression strategy. The
interpretation of level and strategy is as in deflateInit2. This can be
used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different
strategy. If the compression level is changed, the input available so far
is compressed with the old level (and may be flushed); the new level will
take effect only at the next call of deflate().
 
Before the call of deflateParams, the stream state must be set as for
a call of deflate(), since the currently available input may have to
be compressed and flushed. In particular, strm->avail_out must be non-zero.
 
deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
if strm->avail_out was zero.
*/
 
/*
ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
int windowBits));
 
This is another version of inflateInit with an extra parameter. The
fields next_in, avail_in, zalloc, zfree and opaque must be initialized
before by the caller.
 
The windowBits parameter is the base two logarithm of the maximum window
size (the size of the history buffer). It should be in the range 8..15 for
this version of the library. The default value is 15 if inflateInit is used
instead. If a compressed stream with a larger window size is given as
input, inflate() will return with the error code Z_DATA_ERROR instead of
trying to allocate a larger window.
 
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
memLevel). msg is set to null if there is no error message. inflateInit2
does not perform any decompression apart from reading the zlib header if
present: this will be done by inflate(). (So next_in and avail_in may be
modified, but next_out and avail_out are unchanged.)
*/
 
ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
const Bytef *dictionary,
uInt dictLength));
/*
Initializes the decompression dictionary from the given uncompressed byte
sequence. This function must be called immediately after a call of inflate
if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
can be determined from the Adler32 value returned by this call of
inflate. The compressor and decompressor must use exactly the same
dictionary (see deflateSetDictionary).
 
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
parameter is invalid (such as NULL dictionary) or the stream state is
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
expected one (incorrect Adler32 value). inflateSetDictionary does not
perform any decompression: this will be done by subsequent calls of
inflate().
*/
 
ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
/*
Skips invalid compressed data until a full flush point (see above the
description of deflate with Z_FULL_FLUSH) can be found, or until all
available input is skipped. No output is provided.
 
inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
if no more input was provided, Z_DATA_ERROR if no flush point has been found,
or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
case, the application may save the current current value of total_in which
indicates where valid compressed data was found. In the error case, the
application may repeatedly call inflateSync, providing more input each time,
until success or end of the input data.
*/
 
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
/*
This function is equivalent to inflateEnd followed by inflateInit,
but does not free and reallocate all the internal decompression state.
The stream will keep attributes that may have been set by inflateInit2.
 
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being NULL).
*/
 
 
/* utility functions */
 
/*
The following utility functions are implemented on top of the
basic stream-oriented functions. To simplify the interface, some
default options are assumed (compression level and memory usage,
standard memory allocation functions). The source code of these
utility functions can easily be modified if you need special options.
*/
 
ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen));
/*
Compresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total
size of the destination buffer, which must be at least 0.1% larger than
sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
compressed buffer.
This function can be used to compress a whole file at once if the
input file is mmap'ed.
compress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer.
*/
 
ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen,
int level));
/*
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
length of the source buffer. Upon entry, destLen is the total size of the
destination buffer, which must be at least 0.1% larger than sourceLen plus
12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
 
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
 
ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen));
/*
Decompresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total
size of the destination buffer, which must be large enough to hold the
entire uncompressed data. (The size of the uncompressed data must have
been saved previously by the compressor and transmitted to the decompressor
by some mechanism outside the scope of this compression library.)
Upon exit, destLen is the actual size of the compressed buffer.
This function can be used to decompress a whole file at once if the
input file is mmap'ed.
 
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer, or Z_DATA_ERROR if the input data was corrupted.
*/
 
 
typedef voidp gzFile;
 
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
/*
Opens a gzip (.gz) file for reading or writing. The mode parameter
is as in fopen ("rb" or "wb") but can also include a compression level
("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
Huffman only compression as in "wb1h". (See the description
of deflateInit2 for more information about the strategy parameter.)
 
gzopen can be used to read a file which is not in gzip format; in this
case gzread will directly read from the file without decompression.
 
gzopen returns NULL if the file could not be opened or if there was
insufficient memory to allocate the (de)compression state; errno
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR). */
 
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
/*
gzdopen() associates a gzFile with the file descriptor fd. File
descriptors are obtained from calls like open, dup, creat, pipe or
fileno (in the file has been previously opened with fopen).
The mode parameter is as in gzopen.
The next call of gzclose on the returned gzFile will also close the
file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
gzdopen returns NULL if there was insufficient memory to allocate
the (de)compression state.
*/
 
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
/*
Dynamically update the compression level or strategy. See the description
of deflateInit2 for the meaning of these parameters.
gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
opened for writing.
*/
 
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
/*
Reads the given number of uncompressed bytes from the compressed file.
If the input file was not in gzip format, gzread copies the given number
of bytes into the buffer.
gzread returns the number of uncompressed bytes actually read (0 for
end of file, -1 for error). */
 
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
const voidp buf, unsigned len));
/*
Writes the given number of uncompressed bytes into the compressed file.
gzwrite returns the number of uncompressed bytes actually written
(0 in case of error).
*/
 
ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
/*
Converts, formats, and writes the args to the compressed file under
control of the format string, as in fprintf. gzprintf returns the number of
uncompressed bytes actually written (0 in case of error).
*/
 
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
/*
Writes the given null-terminated string to the compressed file, excluding
the terminating null character.
gzputs returns the number of characters written, or -1 in case of error.
*/
 
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
/*
Reads bytes from the compressed file until len-1 characters are read, or
a newline character is read and transferred to buf, or an end-of-file
condition is encountered. The string is then terminated with a null
character.
gzgets returns buf, or Z_NULL in case of error.
*/
 
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
/*
Writes c, converted to an unsigned char, into the compressed file.
gzputc returns the value that was written, or -1 in case of error.
*/
 
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
/*
Reads one byte from the compressed file. gzgetc returns this byte
or -1 in case of end of file or error.
*/
 
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
/*
Flushes all pending output into the compressed file. The parameter
flush is as in the deflate() function. The return value is the zlib
error number (see function gzerror below). gzflush returns Z_OK if
the flush parameter is Z_FINISH and all output could be flushed.
gzflush should be called only when strictly necessary because it can
degrade compression.
*/
 
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
z_off_t offset, int whence));
/*
Sets the starting position for the next gzread or gzwrite on the
given compressed file. The offset represents a number of bytes in the
uncompressed data stream. The whence parameter is defined as in lseek(2);
the value SEEK_END is not supported.
If the file is opened for reading, this function is emulated but can be
extremely slow. If the file is opened for writing, only forward seeks are
supported; gzseek then compresses a sequence of zeroes up to the new
starting position.
 
gzseek returns the resulting offset location as measured in bytes from
the beginning of the uncompressed stream, or -1 in case of error, in
particular if the file is opened for writing and the new starting position
would be before the current position.
*/
 
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
/*
Rewinds the given file. This function is supported only for reading.
 
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
*/
 
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
/*
Returns the starting position for the next gzread or gzwrite on the
given compressed file. This position represents a number of bytes in the
uncompressed data stream.
 
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
*/
 
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
/*
Returns 1 when EOF has previously been detected reading the given
input stream, otherwise zero.
*/
 
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
/*
Flushes all pending output if necessary, closes the compressed file
and deallocates all the (de)compression state. The return value is the zlib
error number (see function gzerror below).
*/
 
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
/*
Returns the error message for the last error which occurred on the
given compressed file. errnum is set to zlib error number. If an
error occurred in the file system and not in the compression library,
errnum is set to Z_ERRNO and the application may consult errno
to get the exact error code.
*/
 
/* checksum functions */
 
/*
These functions are not related to compression but are exported
anyway because they might be useful in applications using the
compression library.
*/
 
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
 
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
return the updated checksum. If buf is NULL, this function returns
the required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
much faster. Usage example:
 
uLong adler = adler32(0L, Z_NULL, 0);
 
while (read_buffer(buffer, length) != EOF) {
adler = adler32(adler, buffer, length);
}
if (adler != original_adler) error();
*/
 
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/*
Update a running crc with the bytes buf[0..len-1] and return the updated
crc. If buf is NULL, this function returns the required initial value
for the crc. Pre- and post-conditioning (one's complement) is performed
within this function so it shouldn't be done by the application.
Usage example:
 
uLong crc = crc32(0L, Z_NULL, 0);
 
while (read_buffer(buffer, length) != EOF) {
crc = crc32(crc, buffer, length);
}
if (crc != original_crc) error();
*/
 
 
/* various hacks, don't look :) */
 
/* deflateInit and inflateInit are macros to allow checking the zlib version
* and the compiler's view of z_stream:
*/
ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
const char *version, int stream_size));
ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
const char *version, int stream_size));
ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
int windowBits, int memLevel,
int strategy, const char *version,
int stream_size));
ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
const char *version, int stream_size));
#define deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
#define inflateInit(strm) \
inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
(strategy), ZLIB_VERSION, sizeof(z_stream))
#define inflateInit2(strm, windowBits) \
inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
 
 
#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
struct internal_state {int dummy;}; /* hack for buggy compilers */
#endif
 
ZEXTERN const char * ZEXPORT zError OF((int err));
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
 
#ifdef __cplusplus
}
#endif
 
#endif /* _ZLIB_H */