uPDF 1.01: do not use `me` folder, add grayscale function, fix rotate

git-svn-id: svn://kolibrios.org@5497 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2015-03-05 16:28:48 +00:00
parent a41d9a6449
commit e687adb27e
1007 changed files with 21 additions and 221715 deletions

View File

@ -9,7 +9,6 @@ rm build/kos_main.o
rm build/mupdf
echo "${red}Building updf...${reset}"
export MENUETDEV=me
make
echo "${red}Converting to KolibriOS binnary...${reset}"

View File

@ -29,7 +29,7 @@ endif
CC_CMD = $(QUIET_CC) $(CC) $(CFLAGS) -o $@ -c $<
AR_CMD = $(QUIET_AR) $(AR) cru $@ $^
LINK_CMD = $(QUIET_LINK) ld $(LDFLAGS) -o $@ $(MENUETDEV)/stub/crt0.o $^ build/snprintf.o $(LIBS)
LINK_CMD = $(QUIET_LINK) ld $(LDFLAGS) -o $@ include/stub/crt0.o $^ build/snprintf.o $(LIBS)
MKDIR_CMD = $(QUIET_MKDIR) mkdir -p $@
# --- Rules ---

View File

@ -102,6 +102,7 @@ const char *help[] = {
"+/- - zoom in/out",
"[ or l - rotate page 90 deg to the left",
"] or r - rotate page 90 deg to the right",
"g - greyscale on/off",
" ",
"Press Escape to hide help",
0
@ -274,8 +275,9 @@ int main (void)
if (key==ASCII_KEY_PGUP) pdfapp_onkey(&gapp, '[');
if (key==ASCII_KEY_HOME) pdfapp_onkey(&gapp, 'g');
if (key==ASCII_KEY_END ) pdfapp_onkey(&gapp, 'G');
if ((key=='[' ) || (key=='l')) pdfapp_onkey(&gapp, 'L');
if ((key==']' ) || (key=='r')) pdfapp_onkey(&gapp, 'R');
if (key=='g' ) pdfapp_onkey(&gapp, 'c');
if ((key=='[' ) || (key=='l')) PageRotateLeft();
if ((key==']' ) || (key=='r')) PageRotateRight();
if (key==ASCII_KEY_DOWN ) PageScrollDown();
if (key==ASCII_KEY_UP ) PageScrollUp();
if (key=='-') PageZoomOut();
@ -291,16 +293,14 @@ int main (void)
if(butt==13) //show help
{
__menuet__bar(0, TOOLBAR_HEIGHT, Form.client_width, Form.client_height - TOOLBAR_HEIGHT, 0xF2F2F2);
__menuet__write_text(20, TOOLBAR_HEIGHT + 20 , 0x90000000, "uPDF for KolibriOS v1.0", 0);
__menuet__write_text(21, TOOLBAR_HEIGHT + 20 , 0x90000000, "uPDF for KolibriOS v1.0", 0);
__menuet__write_text(20, TOOLBAR_HEIGHT + 20 , 0x90000000, "uPDF for KolibriOS v1.01", 0);
__menuet__write_text(21, TOOLBAR_HEIGHT + 20 , 0x90000000, "uPDF for KolibriOS v1.01", 0);
for (ii=0; help[ii]!=0; ii++) {
__menuet__write_text(20, TOOLBAR_HEIGHT + 60 + ii * 15, 0x80000000, help[ii], 0);
}
}
if(butt==14) pdfapp_onkey(&gapp, '['); //previous page
if(butt==15) pdfapp_onkey(&gapp, ']'); //next page
//if(butt==8) pdfapp_onkey(&gapp, 'j'); //move up
//if(butt==9) pdfapp_onkey(&gapp, 'k'); //move down
break;
case evMouse:
@ -374,6 +374,7 @@ void DrawToolbarButton(int x, int y, int w, int h, char image_id)
void PageScrollDown(void)
{
//pdfapp_onkey(&gapp, 'k'); //move down
if (gapp.image->h - gapp.pany - SCROLL_H < Form.client_height - TOOLBAR_HEIGHT)
{
pdfapp_onkey(&gapp, '.');
@ -387,12 +388,13 @@ void PageScrollDown(void)
void PageScrollUp(void)
{
//pdfapp_onkey(&gapp, 'j'); //move up
if (gapp.pany >= SCROLL_H) {
gapp.pany -= SCROLL_H;
winblit(&gapp);
}
else {
//need to avoid double repaint in future
//not very nice way of using do_not_blit, but it simple
if (gapp.pageno == 1) return;
do_not_blit = 1;
pdfapp_onkey(&gapp, ',');
@ -419,4 +421,15 @@ void PageZoomOut(void)
DrawPageSides();
}
void PageRotateLeft(void)
{
pdfapp_onkey(&gapp, 'L');
DrawPageSides();
}
void PageRotateRight(void)
{
pdfapp_onkey(&gapp, 'R');
DrawPageSides();
}

View File

@ -1,128 +0,0 @@
13.03.2010 - diamond (version 0.2.9)
- fix structure for sysfn 9
- mgcc options changed to size optimization
- stack size increased from 16K to 128K
- include files are compatible with VC now
- correct return status of linuxtools/*; make stops on error
- compatibility with gcc4
- compatibility with 64-bit host systems
28.08.2007 - vectoroc
- added:
__menuet__debug_out_byte
__menuet__debug_out
__kolibri__cofflib_getproc
__kolibri__cofflib_load
- Now execution of any program starts at 'main' function (not 'app_main'!)
27.08.2007
- access() for root directory works now
- some bugfixes
05.03.2007
- Implemented fstat()
- fopen(...,"w") works as it must work
- malloc/realloc use dynamic memory when static one is over
23.02.2007
- Added: remove/unlink, ftruncate/chsize, stupid implementation of rename
xx.02.2007 - diamond (here and in the future)
- Modifications for KolibriOS
- Build on linux, cygwin, mingw
7.05.2004 (version 0.2.8)
- Many bugfixes
- SDL 1.2.7 fixes
18.04.2004
- Again bugfixes
- SDL 1.2.7
07.09.2003
- Removed dpmi.h and go32.h (they were wasting space)
- Moved libmcoff to main library distribution
05.09.2003
- Fixed bug in sbrk
17.08.2003 (version 0.2.6a)
- OS (Linux and DJGPP) independent compilation process
- Library can be extracted to any other directory than / (in Linux) or
drive where DJGPP is (in DOS).
- MENUETDEV library tells where is library extracted (look @ README.first).
02.08.2003 (version 0.2.6)
- Fixed exit() and crt1.c (returning from app_main caused fault)
- Added transparent paths (so e.g. chdir("/hd/1/menuetos");
f=fopen("../xyz","rb"); works)
- Fixed getcwd
- Fixed chdir
- Changed TODO
- SDL didn't have much bugs. C library was buggy and caused SDL to fault ;)
Now most things work.
01.08.2003
- Fixed clock and date support so gettimeofday (and functions that use
it work, too)
- Fixed some assembly code in menuetos support
- Changed assert and unimp to dump error to debug board
- Changed abort to dump error to debug board
- Added __libclog_printf and __libclog_vprintf functions which allow
writing to debug board
- I've got libSDL,freetype,libSDLimage,libSDLdraw,libz,libjpg and libpng
working ;) SDL needs more fixes and speedups (due to slow code in MenuetOS
support. Ok, but it works.)
26.04.2003
- Bugfix in malloc
- Finally got filesystem working
- Fixed putimage function (arguments to interrupt were in wrong order)
- This is stable release !!!! (finally I got libjpeg working :)
25.12.2002
- Some bugfixes
- Added some math functions
- Networking stuff rewritten
28.11.2002
- Fixed and added some stuff
- New app: binary clock
- Removed all inport*,outport*,etc. since they are not needed, because
Menuet will kill app which is trying to do I/O using, e.g. inb %dx,%al
- Ported libAVLTree,libmpeg,libjpeg,libelf (but they have to be downloaded
separately).
15.11.2002
- Modifed compilation engine to better
So there are many small makefiles instead of big one.
- Modified .s files and assembly blocks to declare (and call)
symbols with or without underscores (depends on /menuetos/config.h)
- Added networking stuff (what Menuet supports now)
11.10.2002
- Fixed some lines in I/O stuff
- Modified fflush to flush file to disk
- Added support for syscalls: sound and direct screen access
- Final stable release 0.2.2
10.10.2002:
- Added DOS I/O stuff, so you can use fopen/fclose/fread/fwrite/etc. now !!!
(At last GCC and many other GNU tools can be ported !).
- Fixed some bugs
- Added command line argument support
- Added makefile for .a library and makefile for C++ applications
- Added some more examples
24.8.2002:
- Modified some src/libc/ansi/stdio/f*.c
- Ported libz and libpng
22.8.2002 :
- Modified to compile in Linux. You can't use DJGPP anymore.
- Created some linuxtools mgcc,mld,mgcc which execute gcc,ld and g++
with specific parameters for applications.
- Moved console stuff to libcon.a not to mess code
??? -
I don't remember when I created it :))))

View File

@ -1,28 +0,0 @@
include ./osrules.mak
all: genconfig
@echo Building library for $(VERSION_OS)
gcc mkversion.c -o mkversion$(EXESUFFIX)
ifdef ON_MINGW
mkversion$(EXESUFFIX) < version > include/libc/version.h
else
./mkversion$(EXESUFFIX) < version > include/libc/version.h
endif
make -C linuxtools
make -C src depend
make -C src
make -C stub
make -C programs
genconfig:
ifdef ON_MINGW
@echo #$(NEED_UNDERSCORES) NEEDS_UNDERSCORES> config.h
else
@echo "#$(NEED_UNDERSCORES) NEEDS_UNDERSCORES" > config.h
endif
clean:
make -C src clean
make -C linuxtools clean
make -C stub clean
make -C programs clean
$(RM) mkversion$(EXESUFFIX)

View File

@ -1 +0,0 @@
#undef NEEDS_UNDERSCORES

View File

@ -1,481 +0,0 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -1,262 +0,0 @@
# 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:

View File

@ -1,29 +0,0 @@
# 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

View File

@ -1,262 +0,0 @@
# 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:

View File

@ -1,32 +0,0 @@
/* 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

View File

@ -1,31 +0,0 @@
/* 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

View File

@ -1,136 +0,0 @@
/* 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

View File

@ -1,476 +0,0 @@
/* 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

View File

@ -1,56 +0,0 @@
/* 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

View File

@ -1,56 +0,0 @@
/* 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

View File

@ -1,27 +0,0 @@
/* 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

View File

@ -1,164 +0,0 @@
/* 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

View File

@ -1,193 +0,0 @@
/* 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

View File

@ -1,27 +0,0 @@
/* 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

View File

@ -1,23 +0,0 @@
#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

View File

@ -1,97 +0,0 @@
/*
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 */

View File

@ -1,60 +0,0 @@
/*
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 */

View File

@ -1,60 +0,0 @@
/*
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 */

View File

@ -1,260 +0,0 @@
/*
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 */

View File

@ -1,120 +0,0 @@
/*
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

View File

@ -1,52 +0,0 @@
/*
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 */

View File

@ -1,52 +0,0 @@
/*
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 */

View File

@ -1,175 +0,0 @@
/*
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 */

View File

@ -1,27 +0,0 @@
/*
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

View File

@ -1,78 +0,0 @@
/*
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 */

View File

@ -1,114 +0,0 @@
/*!
\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 */

View File

@ -1,138 +0,0 @@
/*
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 */

View File

@ -1,62 +0,0 @@
/*
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 */

View File

@ -1,335 +0,0 @@
/*
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 */

View File

@ -1,102 +0,0 @@
/*
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

View File

@ -1,30 +0,0 @@
/* 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 */

View File

@ -1,93 +0,0 @@
/*
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 */

View File

@ -1,171 +0,0 @@
/*
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 */

View File

@ -1,124 +0,0 @@
/*
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 */

View File

@ -1,315 +0,0 @@
/*
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 */

View File

@ -1,76 +0,0 @@
/*
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 */

View File

@ -1,97 +0,0 @@
/*
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 */

View File

@ -1,97 +0,0 @@
/*
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 */

View File

@ -1,235 +0,0 @@
/*
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_ */

View File

@ -1,136 +0,0 @@
/*
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 */

View File

@ -1,163 +0,0 @@
/*
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 */

View File

@ -1,11 +0,0 @@
#ifndef _SDLname_h_
#define _SDLname_h_
#if defined(__STDC__) || defined(__cplusplus)
#define NeedFunctionPrototypes 1
#endif
#define SDL_NAME(X) SDL_##X
#endif /* _SDLname_h_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +0,0 @@
/*
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 */

View File

@ -1,113 +0,0 @@
/*
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 */

View File

@ -1,165 +0,0 @@
/*
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 */

View File

@ -1,165 +0,0 @@
/*
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 */

View File

@ -1,79 +0,0 @@
/*
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 */

View File

@ -1,118 +0,0 @@
/*
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 */

View File

@ -1,176 +0,0 @@
/*
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 */

View File

@ -1,87 +0,0 @@
/*
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

View File

@ -1,90 +0,0 @@
/*
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 */

View File

@ -1,891 +0,0 @@
/*
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 */

View File

@ -1,91 +0,0 @@
/*
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

View File

@ -1,91 +0,0 @@
/*
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

View File

@ -1,36 +0,0 @@
/*
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 */

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +0,0 @@
/// ===========================================================
#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"
/// ===========================================================

View File

@ -1,251 +0,0 @@
/* 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 */

View File

@ -1,102 +0,0 @@
#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

View File

@ -1,20 +0,0 @@
/* 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

View File

@ -1,16 +0,0 @@
#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__

View File

@ -1,47 +0,0 @@
#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

View File

@ -1,109 +0,0 @@
/*
* 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 */

View File

@ -1,24 +0,0 @@
#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

View File

@ -1,258 +0,0 @@
#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

View File

@ -1,319 +0,0 @@
/*
* 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 */

View File

@ -1,80 +0,0 @@
/*
* 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 */

View File

@ -1,27 +0,0 @@
#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

View File

@ -1,43 +0,0 @@
#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 */

View File

@ -1,4 +0,0 @@
#ifndef _I386_TYPES_H
#define _I386_TYPES_H
#endif

View File

@ -1,31 +0,0 @@
/* 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 */

View File

@ -1,640 +0,0 @@
/* Copyright (C) 2007 Garrett A. Kajmowicz
This file is part of the uClibc++ Library.
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
*/
#include<memory>
#include<utility>
#include<iterator>
#include<functional>
#include<list>
#ifndef __STD_HEADER_ASSOCIATIVE_BASE
#define __STD_HEADER_ASSOCIATIVE_BASE
#pragma GCC visibility push(default)
namespace std{
/*
* The basic premise here is that most of the code used by map, multimap, set and
* multiset is really common. There are a number of interface additions, and
* considerations about how to address multiple entries with the same key.
* The goal is that the tree/storage code should be here, and managing
* single or multiple counts will be left to subclasses.
* Yes, inheritence for the purpose of code sharing is usually a bad idea.
* However, since our goal is to reduce the total amount of code written
* and the overall binary size, this seems to be the best approach possible.
*/
template<class Key, class ValueType, class Compare = less<Key>, class Allocator = allocator<ValueType> > class __base_associative;
template<class ValueType, class Compare, class Allocator> class _associative_iter;
template<class ValueType, class Compare, class Allocator> class _associative_citer;
template<class Key, class ValueType, class Compare = less<Key>, class Allocator = allocator<ValueType> > class __single_associative;
template<class Key, class ValueType, class Compare = less<Key>, class Allocator = allocator<ValueType> > class __multi_associative;
template<class Key, class ValueType, class Compare, class Allocator> class _UCXXEXPORT __base_associative{
protected:
public:
typedef Key key_type;
typedef ValueType value_type;
typedef Compare key_compare;
typedef Allocator allocator_type;
typedef typename Allocator::reference reference;
typedef typename Allocator::const_reference const_reference;
typedef typename Allocator::size_type size_type;
typedef typename Allocator::difference_type difference_type;
typedef typename Allocator::pointer pointer;
typedef typename Allocator::const_pointer const_pointer;
typedef __base_associative<Key, ValueType, Compare, Allocator> associative_type;
typedef _associative_iter<value_type, Compare, Allocator> iterator;
typedef _associative_citer<value_type, Compare, Allocator> const_iterator;
typedef typename std::reverse_iterator<iterator> reverse_iterator;
typedef typename std::reverse_iterator<const_iterator> const_reverse_iterator;
explicit __base_associative(const Compare& comp, const Allocator& A, const key_type (*v_to_k)(const value_type))
: c(comp), value_to_key(v_to_k) { }
protected:
__base_associative(const associative_type& x)
: c(x.c), backing(x.backing), value_to_key(x.value_to_key) { }
public:
~__base_associative(){
}
bool empty() const{
return backing.empty();
}
size_type size() const{
return backing.size();
}
size_type max_size() const{
return backing.max_size();
}
iterator begin(){
return iterator(backing.begin());
}
const_iterator begin() const{
return const_iterator(backing.begin());
}
iterator end() {
return iterator(backing.end());
}
const_iterator end() const{
return const_iterator(backing.end());
}
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());
}
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<iterator, iterator> retval;
retval.first = lower_bound(x);
retval.second = retval.first;
while(retval.second != end() && !c(x, value_to_key(*retval.second))){
++retval.second;
}
return retval;
}
pair<const_iterator,const_iterator> equal_range(const key_type& x) const{
pair<const_iterator, const_iterator> retval;
retval.first = lower_bound(x);
retval.second = retval.first;
while(retval.second != end() && !c(x, value_to_key(*retval.second))){
++retval.second;
}
return retval;
}
iterator find(const key_type& x){
iterator retval = lower_bound(x);
if(retval == end()){
return retval;
}
if(c(x, value_to_key(*retval))){
return end();
}
return retval;
}
const_iterator find(const key_type& x) const{
const_iterator retval = lower_bound(x);
if(retval == end()){
return retval;
}
if(c(x, value_to_key(*retval))){
return end();
}
return retval;
}
size_type count(const key_type& x) const{
size_type retval(0);
const_iterator first = lower_bound(x);
while(first != end() && !c(x, value_to_key(*first))){
++retval;
++first;
}
return retval;
}
void clear(){
backing.clear();
}
void erase(iterator pos){
backing.erase(pos.base_iterator());
}
size_type erase(const key_type& x){
size_type count(0);
iterator start = lower_bound(x);
iterator end = upper_bound(x);
while(start != end){
start = backing.erase(start.base_iterator());
++count;
}
return count;
}
void erase(iterator first, iterator last){
while(first != last){
backing.erase(first.base_iterator());
++first;
}
}
key_compare key_comp() const{
return c;
}
__base_associative &operator=(const __base_associative & x){
c = x.c;
backing = x.backing;
value_to_key = x.value_to_key;
return *this;
}
bool operator==(const __base_associative & x){
return x.backing == backing;
}
bool operator!=(const __base_associative & x){
return !(x.backing == backing);
}
protected:
void swap(__base_associative & x);
Compare c;
std::list<value_type> backing;
const key_type (*value_to_key)(const value_type);
};
/*
* Tree iterators for the base associative class
*/
template<class ValueType, class Compare, class Allocator> class _associative_citer
: public std::iterator<
bidirectional_iterator_tag,
ValueType,
typename Allocator::difference_type,
ValueType*,
ValueType&
>
{
protected:
typedef std::list<ValueType> listtype;
typename listtype::const_iterator base_iter;
friend class _associative_iter<ValueType, Compare, Allocator>;
public:
_associative_citer() { }
_associative_citer(const _associative_citer & m)
: base_iter(m.base_iter) { }
_associative_citer(const typename listtype::const_iterator & m)
: base_iter(m) { }
~_associative_citer() { }
ValueType operator*() const{
return *base_iter;
}
const ValueType * operator->() const{
return &(*base_iter);
}
_associative_citer & operator=(const _associative_citer & m){
base_iter = m.base_iter;
return *this;
}
bool operator==(const _associative_citer & m) const{
return m.base_iter == base_iter;
}
bool operator!=(const _associative_citer & m) const{
return m.base_iter != base_iter;
}
_associative_citer & operator++(){
++base_iter;
return *this;
}
_associative_citer operator++(int){
//The following approach ensures that we only need to
//provide code for ++ in one place (above)
_associative_citer temp(base_iter);
++base_iter;
return temp;
}
_associative_citer & operator--(){
--base_iter;
return *this;
}
_associative_citer operator--(int){
//The following approach ensures that we only need to
//provide code for -- in one place (above)
_associative_citer temp(base_iter);
--base_iter;
return temp;
}
//This is an implementation-defined function designed to make internals work correctly
typename listtype::const_iterator base_iterator(){
return base_iter;
}
};
template<class ValueType, class Compare, class Allocator> class _associative_iter
: public std::iterator<
bidirectional_iterator_tag,
ValueType,
typename Allocator::difference_type,
ValueType*,
ValueType&
>
{
protected:
typedef std::list<ValueType> listtype;
typename listtype::iterator base_iter;
typedef _associative_citer<ValueType, Compare, Allocator> __associative_citer;
public:
_associative_iter() { }
_associative_iter(const _associative_iter & m)
: base_iter(m.base_iter) { }
_associative_iter(const typename listtype::iterator & m)
: base_iter(m) { }
~_associative_iter() { }
const ValueType & operator*() const{
return *base_iter;
}
ValueType & operator*(){
return *base_iter;
}
ValueType * operator->(){
return &(*base_iter);
}
const ValueType * operator->() const{
return &(*base_iter);
}
_associative_iter & operator=(const _associative_iter & m){
base_iter = m.base_iter;
return *this;
}
bool operator==(const _associative_iter & m) const{
return m.base_iter == base_iter;
}
bool operator==(const __associative_citer & m) const{
return m.base_iter == base_iter;
}
bool operator!=(const _associative_iter & m) const{
return m.base_iter != base_iter;
}
bool operator!=(const __associative_citer & m) const{
return m.base_iter != base_iter;
}
_associative_iter & operator++(){
++base_iter;
return *this;
}
_associative_iter operator++(int){
//The following approach ensures that we only need to
//provide code for ++ in one place (above)
_associative_iter temp(base_iter);
++base_iter;
return temp;
}
_associative_iter & operator--(){
--base_iter;
return *this;
}
_associative_iter operator--(int){
//The following approach ensures that we only need to
//provide code for -- in one place (above)
_associative_iter temp(base_iter);
--base_iter;
return temp;
}
operator __associative_citer() const{
return __associative_citer(base_iter);
}
typename listtype::iterator base_iterator(){
return base_iter;
}
const typename listtype::iterator base_iterator() const{
return base_iter;
}
};
// The lower_bound code is really crappy linear search. However, it is a dead
// simple implementation (easy to audit). It can also be easily replaced.
template <class Key, class ValueType, class Compare, class Allocator>
typename __base_associative<Key, ValueType, Compare, Allocator>::iterator
__base_associative<Key, ValueType, Compare, Allocator>::lower_bound(const key_type &x)
{
iterator retval = begin();
while(retval != end() && c(value_to_key(*retval), x)){
++retval;
}
return retval;
}
template <class Key, class ValueType, class Compare, class Allocator>
typename __base_associative<Key, ValueType, Compare, Allocator>::const_iterator
__base_associative<Key, ValueType, Compare, Allocator>::lower_bound(const key_type &x) const
{
const_iterator retval = begin();
while(retval != end() && c(value_to_key(*retval), x)){
++retval;
}
return retval;
}
// Upper bound search is linear from the point of lower_bound. This is likely the best solution
// in all but the most pathological of cases.
template <class Key, class ValueType, class Compare, class Allocator>
typename __base_associative<Key, ValueType, Compare, Allocator>::iterator
__base_associative<Key, ValueType, Compare, Allocator>::upper_bound(const key_type &x)
{
iterator retval = lower_bound(x);
while(retval != end() && !c(x, value_to_key(*retval))){
++retval;
}
return retval;
}
template <class Key, class ValueType, class Compare, class Allocator>
typename __base_associative<Key, ValueType, Compare, Allocator>::const_iterator
__base_associative<Key, ValueType, Compare, Allocator>::upper_bound(const key_type &x) const
{
const_iterator retval = begin();
while(retval != end() && !c(x, value_to_key(*retval))){
++retval;
}
return retval;
}
template <class Key, class ValueType, class Compare, class Allocator>
void __base_associative<Key, ValueType, Compare, Allocator>::swap(__base_associative<Key, ValueType, Compare, Allocator>& m)
{
Compare n = c;
c = m.c;
m.c = n;
m.backing.swap(backing);
}
template<class Key, class ValueType, class Compare, class Allocator> class _UCXXEXPORT __single_associative :
public __base_associative<Key, ValueType, Compare, Allocator>
{
protected:
typedef __base_associative<Key, ValueType, Compare, Allocator> base;
using base::backing;
using base::c;
public:
typedef typename base::key_type key_type;
typedef typename base::value_type value_type;
typedef typename base::key_compare key_compare;
typedef typename base::allocator_type allocator_type;
typedef typename base::reference reference;
typedef typename base::const_reference const_reference;
typedef typename base::iterator iterator;
typedef typename base::const_iterator const_iterator;
typedef typename base::size_type size_type;
typedef typename base::difference_type difference_type;
typedef typename base::pointer pointer;
typedef typename base::const_pointer const_pointer;
typedef typename base::reverse_iterator reverse_iterator;
typedef typename base::const_reverse_iterator const_reverse_iterator;
using base::begin;
using base::end;
using base::rbegin;
using base::rend;
using base::empty;
using base::size;
using base::max_size;
using base::find;
using base::count;
using base::lower_bound;
using base::upper_bound;
using base::equal_range;
using base::operator=;
using base::operator==;
using base::operator!=;
explicit __single_associative(const Compare& comp, const Allocator& A, const key_type (*v_to_k)(const value_type))
: base(comp, A, v_to_k) { }
template <class InputIterator> __single_associative(
InputIterator first,
InputIterator last,
const Compare& comp,
const Allocator& A,
const key_type (*v_to_k)(const value_type)
) : base(comp, A, v_to_k) {
insert(first, last);
}
pair<iterator, bool> insert(const value_type& x){
pair<iterator, bool> retval;
iterator location = lower_bound(this->value_to_key(x));
retval.second = true;
//Empty list or need to insert at end
if(end() == location){
backing.push_back(x);
retval.first = --(end());
return retval;
}
//Something in the list
if(c(this->value_to_key(x), this->value_to_key(*location))){
location = backing.insert(location.base_iterator(), x);
retval.first = location;
}else{
retval.second = false;
retval.first = location;
}
return retval;
}
iterator insert(iterator position, const value_type& x){
// FIXME - this is cheating and probably should be more efficient since we are
// now log(n) to find for inserts
return insert(x).first;
}
template <class InputIterator> void insert(InputIterator first, InputIterator last){
while(first != last){
insert(*first);
++first;
}
}
};
template<class Key, class ValueType, class Compare, class Allocator> class _UCXXEXPORT __multi_associative :
public __base_associative<Key, ValueType, Compare, Allocator>
{
protected:
typedef __base_associative<Key, ValueType, Compare, Allocator> base;
using base::backing;
using base::c;
public:
typedef typename base::key_type key_type;
typedef typename base::value_type value_type;
typedef typename base::key_compare key_compare;
typedef typename base::allocator_type allocator_type;
typedef typename base::reference reference;
typedef typename base::const_reference const_reference;
typedef typename base::iterator iterator;
typedef typename base::const_iterator const_iterator;
typedef typename base::size_type size_type;
typedef typename base::difference_type difference_type;
typedef typename base::pointer pointer;
typedef typename base::const_pointer const_pointer;
typedef typename base::reverse_iterator reverse_iterator;
typedef typename base::const_reverse_iterator const_reverse_iterator;
using base::begin;
using base::end;
using base::rbegin;
using base::rend;
using base::empty;
using base::size;
using base::max_size;
using base::find;
using base::count;
using base::lower_bound;
using base::upper_bound;
using base::equal_range;
using base::operator=;
using base::operator==;
explicit __multi_associative(const Compare& comp, const Allocator& A, const key_type (*v_to_k)(const value_type))
: base(comp, A, v_to_k) { }
template <class InputIterator> __multi_associative(
InputIterator first,
InputIterator last,
const Compare& comp,
const Allocator& A,
const key_type (*v_to_k)(const value_type)
) : base(comp, A, v_to_k) {
insert(first, last);
}
iterator insert(const value_type& x){
iterator location = lower_bound(this->value_to_key(x));
if(location == begin()){
backing.push_front(x);
location = begin();
}else{
location = backing.insert(location.base_iterator(), x);
}
return location;
}
iterator insert(iterator position, const value_type& x){
// FIXME - this is cheating and probably should be more efficient since we are
// now log(n) to find for inserts
return insert(x);
}
template <class InputIterator> void insert(InputIterator first, InputIterator last){
while(first != last){
insert(*first);
++first;
}
}
};
}
#pragma GCC visibility pop
#endif //__STD_HEADER_ASSOCIATIVE_BASE

View File

@ -1,112 +0,0 @@
/*
*
* 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:

View File

@ -1,60 +0,0 @@
/*
*
* 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:

View File

@ -1,36 +0,0 @@
/*
* 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:

View File

@ -1,38 +0,0 @@
// 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

View File

@ -1,42 +0,0 @@
/*
*
* 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:

View File

@ -1,43 +0,0 @@
// 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:

View File

@ -1,88 +0,0 @@
/*
*
* 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 */

View File

@ -1,41 +0,0 @@
/*
*
* 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:

View File

@ -1,52 +0,0 @@
// 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:

View File

@ -1,98 +0,0 @@
/*
*
* 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:

View File

@ -1,43 +0,0 @@
/*
* 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:

View File

@ -1,40 +0,0 @@
/*
* 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 */

View File

@ -1,47 +0,0 @@
/*
* 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:

View File

@ -1,42 +0,0 @@
/*
*
* 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:

View File

@ -1,70 +0,0 @@
// 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:

View File

@ -1,60 +0,0 @@
// 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:

Some files were not shown because too many files have changed in this diff Show More