mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
Tcc: Compile to executable
git-svn-id: svn://ultimatepp.org/upp/trunk@1500 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
02532e0cf6
commit
94bedda349
131 changed files with 65696 additions and 0 deletions
21
bazaar/Tcc/Copying
Normal file
21
bazaar/Tcc/Copying
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
Copyright 1998-2008 Koldo Ramirez contributed to U++ Project 'Bazaar'. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE U++ PROJECT ``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 FREEBSD PROJECT 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.
|
||||||
222
bazaar/Tcc/Tcc.cpp
Normal file
222
bazaar/Tcc/Tcc.cpp
Normal file
|
|
@ -0,0 +1,222 @@
|
||||||
|
#include <Core/Core.h>
|
||||||
|
|
||||||
|
using namespace Upp;
|
||||||
|
|
||||||
|
#include "Tcc.h"
|
||||||
|
|
||||||
|
#if __unix__
|
||||||
|
#define T_tcc_new tcc_new
|
||||||
|
#define T_tcc_delete tcc_delete
|
||||||
|
#define T_tcc_set_output_type tcc_set_output_type
|
||||||
|
#define T_tcc_set_error_func tcc_set_error_func
|
||||||
|
#define T_tcc_get_symbol tcc_get_symbol
|
||||||
|
#define T_tcc_add_symbol tcc_add_symbol
|
||||||
|
#define T_tcc_relocate tcc_relocate
|
||||||
|
#define T_tcc_compile_string tcc_compile_string
|
||||||
|
#define T_tcc_add_include_path tcc_add_include_path
|
||||||
|
#define T_tcc_add_library_path tcc_add_library_path
|
||||||
|
#define T_tcc_output_file tcc_output_file
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(PLATFORM_WIN32)
|
||||||
|
Tcc::Tcc(const char *dllName)
|
||||||
|
#else
|
||||||
|
Tcc::Tcc()
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
#if defined(PLATFORM_WIN32)
|
||||||
|
hinstLib = LoadLibrary(TEXT(dllName));
|
||||||
|
if (hinstLib == NULL)
|
||||||
|
throw Exc(t_("Tcc library not found"));
|
||||||
|
|
||||||
|
T_tcc_new = (TCCState *(*)(void))GetProcAddress(hinstLib, "tcc_new");
|
||||||
|
if (T_tcc_new == NULL) {
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
throw Exc(Format(t_("Tcc function %s not found"), "tcc_new"));
|
||||||
|
}
|
||||||
|
T_tcc_delete = (void (*)(TCCState *))GetProcAddress(hinstLib, "tcc_delete");
|
||||||
|
if (T_tcc_delete == NULL) {
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
throw Exc(Format(t_("Tcc function %s not found"), "tcc_delete"));
|
||||||
|
}
|
||||||
|
T_tcc_set_output_type = (int (*)(TCCState *s, int output_type))GetProcAddress(hinstLib,
|
||||||
|
"tcc_set_output_type");
|
||||||
|
if (T_tcc_set_output_type == NULL) {
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
throw Exc(Format(t_("Tcc function %s not found"), "tcc_set_output_type"));
|
||||||
|
}
|
||||||
|
T_tcc_set_error_func = (void (*)(TCCState *s, void *error_opaque, void (*error_func)
|
||||||
|
(void *opaque, const char *msg)))GetProcAddress(hinstLib, "tcc_set_error_func");
|
||||||
|
if (T_tcc_set_error_func == NULL) {
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
throw Exc(Format(t_("Tcc function %s not found"), "tcc_set_error_func"));
|
||||||
|
}
|
||||||
|
T_tcc_get_symbol = (int (*)(TCCState *s, unsigned long *pval, const char *name))
|
||||||
|
GetProcAddress(hinstLib, "tcc_get_symbol");
|
||||||
|
if (T_tcc_get_symbol == NULL) {
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
throw Exc(Format(t_("Tcc function %s not found"), "tcc_get_symbol"));
|
||||||
|
}
|
||||||
|
T_tcc_add_symbol = (int (*)(TCCState *s, const char *name, unsigned long val))
|
||||||
|
GetProcAddress(hinstLib, "tcc_add_symbol");
|
||||||
|
if (T_tcc_add_symbol == NULL) {
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
throw Exc(Format(t_("Tcc function %s not found"), "tcc_add_symbol"));
|
||||||
|
}
|
||||||
|
T_tcc_relocate = (int (*)(TCCState *s))GetProcAddress(hinstLib, "tcc_relocate");
|
||||||
|
if (T_tcc_relocate == NULL) {
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
throw Exc(Format(t_("Tcc function %s not found"), "tcc_relocate"));
|
||||||
|
}
|
||||||
|
T_tcc_compile_string = (int (*)(TCCState *s, const char *buf))GetProcAddress(hinstLib,
|
||||||
|
"tcc_compile_string");
|
||||||
|
if (T_tcc_compile_string == NULL) {
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
throw Exc(Format(t_("Tcc function %s not found"), "tcc_compile_string"));
|
||||||
|
}
|
||||||
|
T_tcc_add_include_path = (int (*)(TCCState *s, const char *buf))GetProcAddress(hinstLib,
|
||||||
|
"tcc_add_include_path");
|
||||||
|
if (T_tcc_add_include_path == NULL) {
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
throw Exc(Format(t_("Tcc function %s not found"), "tcc_add_include_path"));
|
||||||
|
}
|
||||||
|
T_tcc_add_library_path = (int (*)(TCCState *s, const char *buf))GetProcAddress(hinstLib,
|
||||||
|
"tcc_add_library_path");
|
||||||
|
if (T_tcc_add_library_path == NULL) {
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
throw Exc(Format(t_("Tcc function %s not found"), "tcc_add_library_path"));
|
||||||
|
}
|
||||||
|
T_tcc_output_file = (int (*)(TCCState *s, const char *buf))GetProcAddress(hinstLib,
|
||||||
|
"tcc_output_file");
|
||||||
|
if (T_tcc_output_file == NULL) {
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
throw Exc(Format(t_("Tcc function %s not found"), "tcc_output_file"));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
stateTcc = T_tcc_new();
|
||||||
|
if (!stateTcc)
|
||||||
|
throw Exc("Tcc can not initialize");
|
||||||
|
|
||||||
|
T_tcc_set_error_func(stateTcc, NULL, Tcc::DefaultErrorHandler);
|
||||||
|
errorMsg = "";
|
||||||
|
|
||||||
|
SetOutputMemory();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tcc::SetOutputExe()
|
||||||
|
{
|
||||||
|
T_tcc_set_output_type(stateTcc, TCC_OUTPUT_EXE);
|
||||||
|
outputMemory = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
void Tcc::SetOutputMemory()
|
||||||
|
{
|
||||||
|
T_tcc_set_output_type(stateTcc, TCC_OUTPUT_MEMORY);
|
||||||
|
outputMemory = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
String Tcc::errorMsg = "";
|
||||||
|
int Tcc::initialProgramLines;
|
||||||
|
|
||||||
|
void Tcc::DefaultErrorHandler(void* opaque, const char* msg)
|
||||||
|
{
|
||||||
|
if (!errorMsg.IsEmpty())
|
||||||
|
errorMsg.Cat('\n'); // When calling Relocate this handle can get more than one error
|
||||||
|
String message = msg;
|
||||||
|
int linePos = sizeof("Line ")-1;
|
||||||
|
if (message.Left(linePos) == "Line ") { // Fix the line number in the error message
|
||||||
|
int endLinePos = message.Find(':', linePos+1);
|
||||||
|
int line = atoi(message.Mid(linePos, endLinePos-linePos));
|
||||||
|
message = message.Left(linePos) + FormatInt(line-initialProgramLines) + message.Mid(endLinePos);
|
||||||
|
}
|
||||||
|
errorMsg.Cat(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
Tcc::~Tcc()
|
||||||
|
{
|
||||||
|
T_tcc_delete(stateTcc);
|
||||||
|
#if defined(PLATFORM_WIN32)
|
||||||
|
FreeLibrary(hinstLib);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void tcc_throw(char *str)
|
||||||
|
{
|
||||||
|
throw Exc(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tcc::Compile(const char *my_program)
|
||||||
|
{
|
||||||
|
program << "// Basic declarations\n"
|
||||||
|
"typedef int bool;\n"
|
||||||
|
"#define true 1\n"
|
||||||
|
"#define false 0\n"
|
||||||
|
"#define M_PI 3.1415926535897932\n" // It does not seem to be in math.h
|
||||||
|
"\n"
|
||||||
|
"void throw(char *str);\n"
|
||||||
|
"\n";
|
||||||
|
initialProgramLines = 0;
|
||||||
|
int pos = 0;
|
||||||
|
while((pos = program.Find('\n', pos)) >= 0) {
|
||||||
|
initialProgramLines++;
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
program << my_program;
|
||||||
|
|
||||||
|
if (T_tcc_compile_string(stateTcc, program) != 0)
|
||||||
|
throw Exc(errorMsg);
|
||||||
|
if (outputMemory)
|
||||||
|
AddSymbol("throw", (void *)&tcc_throw);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tcc::AddSymbol(const char *funName, void *fun)
|
||||||
|
{
|
||||||
|
if (!outputMemory)
|
||||||
|
throw Exc(t_("Not possible to add symbols if output to file is defined"));
|
||||||
|
T_tcc_add_symbol(stateTcc, funName, (unsigned long)fun);
|
||||||
|
if (!errorMsg.IsEmpty())
|
||||||
|
throw Exc(errorMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tcc::Link(const char *fileName)
|
||||||
|
{
|
||||||
|
if (outputMemory) {
|
||||||
|
if (fileName)
|
||||||
|
throw Exc(t_("Not possible to get file if output to memory is defined"));
|
||||||
|
if(T_tcc_relocate(stateTcc) != 0)
|
||||||
|
throw Exc(errorMsg);
|
||||||
|
} else if (!outputMemory) {
|
||||||
|
if (!fileName)
|
||||||
|
throw Exc(t_("File name is necessary if output to file is defined"));
|
||||||
|
if (T_tcc_output_file(stateTcc, fileName) != 0)
|
||||||
|
throw Exc(errorMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void *Tcc::GetSymbol(const char *funName)
|
||||||
|
{
|
||||||
|
if (!outputMemory)
|
||||||
|
throw Exc(t_("Not possible to get symbols if output to file is defined"));
|
||||||
|
unsigned long val;
|
||||||
|
T_tcc_get_symbol(stateTcc, (unsigned long *)&val, funName);
|
||||||
|
if (!errorMsg.IsEmpty())
|
||||||
|
throw Exc(errorMsg);
|
||||||
|
|
||||||
|
return (void *)val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tcc::AddIncludePath(const char *path)
|
||||||
|
{
|
||||||
|
bool ret = T_tcc_add_include_path(stateTcc, path) == 0? true: false;
|
||||||
|
if (!errorMsg.IsEmpty())
|
||||||
|
throw Exc(errorMsg);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
bool Tcc::AddLibraryPath(const char *path)
|
||||||
|
{
|
||||||
|
bool ret = T_tcc_add_library_path(stateTcc, path) == 0? true: false;
|
||||||
|
if (!errorMsg.IsEmpty())
|
||||||
|
throw Exc(errorMsg);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
61
bazaar/Tcc/Tcc.h
Normal file
61
bazaar/Tcc/Tcc.h
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
#ifndef _Tcc_Tcc_h
|
||||||
|
#define _Tcc_Tcc_h
|
||||||
|
|
||||||
|
#include "Tcc/lib/libtcc.h"
|
||||||
|
|
||||||
|
class Tcc
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
#if defined(PLATFORM_WIN32)
|
||||||
|
Tcc(const char *dllFile = "libtcc.dll");
|
||||||
|
#else
|
||||||
|
Tcc();
|
||||||
|
#endif
|
||||||
|
~Tcc();
|
||||||
|
|
||||||
|
bool AddIncludePath(const char *path);
|
||||||
|
bool AddLibraryPath(const char *path);
|
||||||
|
|
||||||
|
void SetOutputExe();
|
||||||
|
void SetOutputMemory();
|
||||||
|
|
||||||
|
void Compile(const char *my_program);
|
||||||
|
void AddSymbol(const char *funName, void *fun);
|
||||||
|
void *GetSymbol(const char *funName);
|
||||||
|
void Link(const char *fileName = 0);
|
||||||
|
|
||||||
|
String GetProgram()
|
||||||
|
{
|
||||||
|
String ret;
|
||||||
|
ret <<= program;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
TCCState *stateTcc;
|
||||||
|
#if defined(PLATFORM_WIN32)
|
||||||
|
HINSTANCE hinstLib;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void DefaultErrorHandler(void *opaque, const char *msg);
|
||||||
|
static String errorMsg;
|
||||||
|
static int initialProgramLines;
|
||||||
|
String program;
|
||||||
|
bool outputMemory;
|
||||||
|
|
||||||
|
#if defined(PLATFORM_WIN32)
|
||||||
|
TCCState *(*T_tcc_new)(void);
|
||||||
|
void (*T_tcc_delete)(TCCState *);
|
||||||
|
int (*T_tcc_set_output_type)(TCCState *s, int output_type);
|
||||||
|
void (*T_tcc_set_error_func)(TCCState *s, void *error_opaque, void (*error_func)(void *opaque, const char *msg));
|
||||||
|
int (*T_tcc_get_symbol)(TCCState *s, unsigned long *pval, const char *name);
|
||||||
|
int (*T_tcc_add_symbol)(TCCState *s, const char *name, unsigned long val);
|
||||||
|
int (*T_tcc_relocate)(TCCState *s);
|
||||||
|
int (*T_tcc_compile_string)(TCCState *s, const char *buf);
|
||||||
|
int (*T_tcc_add_include_path)(TCCState *s, const char *buf);
|
||||||
|
int (*T_tcc_add_library_path)(TCCState *s, const char *buf);
|
||||||
|
int (*T_tcc_output_file)(TCCState *s, const char *buf);
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
24
bazaar/Tcc/Tcc.upp
Normal file
24
bazaar/Tcc/Tcc.upp
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
description "Tiny C Compiler wrapper\377B255,42,0";
|
||||||
|
|
||||||
|
uses
|
||||||
|
Core;
|
||||||
|
|
||||||
|
options(POSIX) -DLIBTCC;
|
||||||
|
|
||||||
|
options(WIN32) "-DTCC_TARGET_PE -DLIBTCC";
|
||||||
|
|
||||||
|
file
|
||||||
|
Tcc.cpp,
|
||||||
|
Tcc.h,
|
||||||
|
libtcc.c,
|
||||||
|
srcdoc.tpp,
|
||||||
|
srcimp.tpp,
|
||||||
|
src.tpp,
|
||||||
|
src.tpp\Tcc.t,
|
||||||
|
lib/libtcc.h,
|
||||||
|
lib/README,
|
||||||
|
Copying;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "";
|
||||||
|
|
||||||
4
bazaar/Tcc/init
Normal file
4
bazaar/Tcc/init
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#ifndef _Tcc_icpp_init_stub
|
||||||
|
#define _Tcc_icpp_init_stub
|
||||||
|
#include "Core/init"
|
||||||
|
#endif
|
||||||
504
bazaar/Tcc/lib/COPYING
Normal file
504
bazaar/Tcc/lib/COPYING
Normal file
|
|
@ -0,0 +1,504 @@
|
||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 2.1, February 1999
|
||||||
|
|
||||||
|
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||||
|
59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Lesser GPL. It also counts
|
||||||
|
as the successor of the GNU Library Public License, version 2, hence
|
||||||
|
the version number 2.1.]
|
||||||
|
|
||||||
|
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 Lesser General Public License, applies to some
|
||||||
|
specially designated software packages--typically libraries--of the
|
||||||
|
Free Software Foundation and other authors who decide to use it. You
|
||||||
|
can use it too, but we suggest you first think carefully about whether
|
||||||
|
this license or the ordinary General Public License is the better
|
||||||
|
strategy to use in any particular case, based on the explanations below.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom of use,
|
||||||
|
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 and use pieces of
|
||||||
|
it in new free programs; and that you are informed that you can do
|
||||||
|
these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
distributors to deny you these rights or to ask you to surrender these
|
||||||
|
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 other code 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.
|
||||||
|
|
||||||
|
We protect your rights with a two-step method: (1) we copyright the
|
||||||
|
library, and (2) we offer you this license, which gives you legal
|
||||||
|
permission to copy, distribute and/or modify the library.
|
||||||
|
|
||||||
|
To protect each distributor, we want to make it very clear that
|
||||||
|
there is no warranty for the free library. Also, if the library is
|
||||||
|
modified by someone else and passed on, the recipients should know
|
||||||
|
that what they have is not the original version, so that the original
|
||||||
|
author's reputation will not be affected by problems that might be
|
||||||
|
introduced by others.
|
||||||
|
|
||||||
|
Finally, software patents pose a constant threat to the existence of
|
||||||
|
any free program. We wish to make sure that a company cannot
|
||||||
|
effectively restrict the users of a free program by obtaining a
|
||||||
|
restrictive license from a patent holder. Therefore, we insist that
|
||||||
|
any patent license obtained for a version of the library must be
|
||||||
|
consistent with the full freedom of use specified in this license.
|
||||||
|
|
||||||
|
Most GNU software, including some libraries, is covered by the
|
||||||
|
ordinary GNU General Public License. This license, the GNU Lesser
|
||||||
|
General Public License, applies to certain designated libraries, and
|
||||||
|
is quite different from the ordinary General Public License. We use
|
||||||
|
this license for certain libraries in order to permit linking those
|
||||||
|
libraries into non-free programs.
|
||||||
|
|
||||||
|
When a program is linked with a library, whether statically or using
|
||||||
|
a shared library, the combination of the two is legally speaking a
|
||||||
|
combined work, a derivative of the original library. The ordinary
|
||||||
|
General Public License therefore permits such linking only if the
|
||||||
|
entire combination fits its criteria of freedom. The Lesser General
|
||||||
|
Public License permits more lax criteria for linking other code with
|
||||||
|
the library.
|
||||||
|
|
||||||
|
We call this license the "Lesser" General Public License because it
|
||||||
|
does Less to protect the user's freedom than the ordinary General
|
||||||
|
Public License. It also provides other free software developers Less
|
||||||
|
of an advantage over competing non-free programs. These disadvantages
|
||||||
|
are the reason we use the ordinary General Public License for many
|
||||||
|
libraries. However, the Lesser license provides advantages in certain
|
||||||
|
special circumstances.
|
||||||
|
|
||||||
|
For example, on rare occasions, there may be a special need to
|
||||||
|
encourage the widest possible use of a certain library, so that it becomes
|
||||||
|
a de-facto standard. To achieve this, non-free programs must be
|
||||||
|
allowed to use the library. A more frequent case is that a free
|
||||||
|
library does the same job as widely used non-free libraries. In this
|
||||||
|
case, there is little to gain by limiting the free library to free
|
||||||
|
software only, so we use the Lesser General Public License.
|
||||||
|
|
||||||
|
In other cases, permission to use a particular library in non-free
|
||||||
|
programs enables a greater number of people to use a large body of
|
||||||
|
free software. For example, permission to use the GNU C Library in
|
||||||
|
non-free programs enables many more people to use the whole GNU
|
||||||
|
operating system, as well as its variant, the GNU/Linux operating
|
||||||
|
system.
|
||||||
|
|
||||||
|
Although the Lesser General Public License is Less protective of the
|
||||||
|
users' freedom, it does ensure that the user of a program that is
|
||||||
|
linked with the Library has the freedom and the wherewithal to run
|
||||||
|
that program using a modified version of the Library.
|
||||||
|
|
||||||
|
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, whereas the latter must
|
||||||
|
be combined with the library in order to run.
|
||||||
|
|
||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License Agreement applies to any software library or other
|
||||||
|
program which contains a notice placed by the copyright holder or
|
||||||
|
other authorized party saying it may be distributed under the terms of
|
||||||
|
this Lesser 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 combine 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) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (1) uses at run time a
|
||||||
|
copy of the library already present on the user's computer system,
|
||||||
|
rather than copying library functions into the executable, and (2)
|
||||||
|
will operate properly with a modified version of the library, if
|
||||||
|
the user installs one, as long as the modified version is
|
||||||
|
interface-compatible with the version that the work was made with.
|
||||||
|
|
||||||
|
c) 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.
|
||||||
|
|
||||||
|
d) 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.
|
||||||
|
|
||||||
|
e) 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 materials to be 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 with
|
||||||
|
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 Lesser 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
|
||||||
|
|
||||||
|
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 Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
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!
|
||||||
|
|
||||||
|
|
||||||
356
bazaar/Tcc/lib/Changelog
Normal file
356
bazaar/Tcc/lib/Changelog
Normal file
|
|
@ -0,0 +1,356 @@
|
||||||
|
version 0.9.24:
|
||||||
|
|
||||||
|
- added verbosity levels -v, -vv, -vvv
|
||||||
|
- Accept standard input as an inputstream (Hanzac Chen)
|
||||||
|
- Support c89 compilers other than gcc (Hanzac Chen)
|
||||||
|
- -soname linker option (Marc Andre Tanner)
|
||||||
|
- Just warn about unknown directives, ignore quotes in #error/#warning
|
||||||
|
- Define __STDC_VERSION__=199901L (477)
|
||||||
|
- Switch to newer tccpe.c (includes support for resources)
|
||||||
|
- Handle backslashes within #include/#error/#warning
|
||||||
|
- Import changesets (part 4) 428,457,460,467: defines for openbsd etc.
|
||||||
|
- Use _WIN32 for a windows hosted tcc and define it for the PE target,
|
||||||
|
otherwise define __unix / __linux (Detlef Riekenberg)
|
||||||
|
- Import changesets (part 3) 409,410: ARM EABI by Daniel Glöckner
|
||||||
|
- Some in-between fixes:
|
||||||
|
TCC -E no longer hangs with macro calls involving newlines.
|
||||||
|
(next_nomacro1 now advances the read-pointer with TOK_LINEFEED)
|
||||||
|
Global cast (int g_i = 1LL;) no longer crashes tcc.
|
||||||
|
(nocode_wanted is initially 1, and only 0 for gen_function)
|
||||||
|
On win32 now tcc.exe finds 'include' & 'lib' even if itself is in 'bin'.
|
||||||
|
(new function w32_tcc_lib_path removes 'bin' if detected)
|
||||||
|
Added quick build batch file for mingw (win32/build-tcc.bat)
|
||||||
|
Last added case label optimization (455) produced wrong code. Reverted.
|
||||||
|
|
||||||
|
- Import more changesets from Rob Landley's fork (part 2):
|
||||||
|
487: Handle long long constants in gen_opic() (Rob Landley)
|
||||||
|
484: Handle parentheses within __attribute__((...)) (Rob Landley)
|
||||||
|
480: Remove a goto in decl_initializer_alloc (Rob Landley)
|
||||||
|
475: Fix dereferences in inline assembly output (Joshua Phillips)
|
||||||
|
474: Cast ptrs to ints of different sizes correctly (Joshua Phillips)
|
||||||
|
473: Fix size of structs with empty array member (Joshua Phillips)
|
||||||
|
470: No warning for && and || with mixed pointers/integers (Rob Landley)
|
||||||
|
469: Fix symbol visibility problems in the linker (Vincent Pit)
|
||||||
|
468: Allow && and || involving pointer arguments (Rob Landley)
|
||||||
|
455: Optimize case labels with no code in between (Zdenek Pavlas)
|
||||||
|
450: Implement alloca for x86 (grischka)
|
||||||
|
415: Parse unicode escape sequences (Axel Liljencrantz)
|
||||||
|
407: Add a simple va_copy() in stdarg.h (Hasso Tepper)
|
||||||
|
400: Allow typedef names as symbols (Dave Dodge)
|
||||||
|
|
||||||
|
- Import some changesets from Rob Landley's fork (part 1):
|
||||||
|
462: Use LGPL with bcheck.c and il-gen.c
|
||||||
|
458: Fix global compound literals (in unary: case '&':) (Andrew Johnson)
|
||||||
|
456: Use return code from tcc_output_file in main() (Michael Somos)
|
||||||
|
442: Fix indirections with function pointers (***fn)() (grischka)
|
||||||
|
441: Fix LL left shift in libtcc1.c:__shldi3 (grischka)
|
||||||
|
440: Pass structures and function ptrs through ?: (grischka)
|
||||||
|
439: Keep rvalue in bit assignment (bit2 = bit1 = x) (grischka)
|
||||||
|
438: Degrade nonportable pointer assignment to warning (grischka)
|
||||||
|
437: Call 'saveregs()' before jumping with logical and/or/not (grischka)
|
||||||
|
435: Put local static variables into global memory (grischka)
|
||||||
|
432/434: Cast double and ptr to bool (grischka)
|
||||||
|
420: Zero pad x87 tenbyte long doubles (Felix Nawothnig)
|
||||||
|
417: Make 'sizeof' unsigned (Rob Landley)
|
||||||
|
397: Fix save_reg for longlongs (Daniel Glöckner)
|
||||||
|
396: Fix "invalid relocation entry" problem on ubuntu - (Bernhard Fischer)
|
||||||
|
|
||||||
|
- ignore AS_NEEDED ld command
|
||||||
|
- mark executable sections as executable when running in memory
|
||||||
|
- added support for win32 wchar_t (Filip Navara)
|
||||||
|
- segment override prefix support (Filip Navara)
|
||||||
|
- normalized slashes in paths (Filip Navara)
|
||||||
|
- windows style fastcall (Filip Navara)
|
||||||
|
- support for empty input register section in asm (Filip Navara)
|
||||||
|
- anonymous union/struct support (Filip Navara)
|
||||||
|
- fixed parsing of function parameters
|
||||||
|
- workaround for function pointers in conditional expressions (Dave Dodge)
|
||||||
|
- initial '-E' option support to use the C preprocessor alone
|
||||||
|
- discard type qualifiers when comparing function parameters (Dave Dodge)
|
||||||
|
- Bug fix: A long long value used as a test expression ignores the
|
||||||
|
upper 32 bits at runtime (Dave Dodge)
|
||||||
|
- fixed multiple concatenation of PPNUM tokens (initial patch by Dave Dodge)
|
||||||
|
- fixed multiple typedef specifiers handling
|
||||||
|
- fixed sign extension in some type conversions (Dave Dodge)
|
||||||
|
|
||||||
|
version 0.9.23:
|
||||||
|
|
||||||
|
- initial PE executable format for windows version (grischka)
|
||||||
|
- '#pragma pack' support (grischka)
|
||||||
|
- '#include_next' support (Bernhard Fischer)
|
||||||
|
- ignore '-pipe' option
|
||||||
|
- added -f[no-]leading-underscore
|
||||||
|
- preprocessor function macro parsing fix (grischka)
|
||||||
|
|
||||||
|
version 0.9.22:
|
||||||
|
|
||||||
|
- simple memory optimisations: kernel compilation is 30% faster
|
||||||
|
- linker symbol definitions fixes
|
||||||
|
- gcc 3.4 fixes
|
||||||
|
- fixed value stack full error
|
||||||
|
- 'packed' attribute support for variables and structure fields
|
||||||
|
- ignore 'const' and 'volatile' in function prototypes
|
||||||
|
- allow '_Bool' in bit fields
|
||||||
|
|
||||||
|
version 0.9.21:
|
||||||
|
|
||||||
|
- ARM target support (Daniel Glöckner)
|
||||||
|
- added '-funsigned-char, '-fsigned-char' and
|
||||||
|
'-Wimplicit-function-declaration'
|
||||||
|
- fixed assignment of const struct in struct
|
||||||
|
- line comment fix (reported by Bertram Felgenhauer)
|
||||||
|
- initial TMS320C67xx target support (TK)
|
||||||
|
- win32 configure
|
||||||
|
- regparm() attribute
|
||||||
|
- many built-in assembler fixes
|
||||||
|
- added '.org', '.fill' and '.previous' assembler directives
|
||||||
|
- '-fno-common' option
|
||||||
|
- '-Ttext' linker option
|
||||||
|
- section alignment fixes
|
||||||
|
- bit fields fixes
|
||||||
|
- do not generate code for unused inline functions
|
||||||
|
- '-oformat' linker option.
|
||||||
|
- added 'binary' output format.
|
||||||
|
|
||||||
|
version 0.9.20:
|
||||||
|
|
||||||
|
- added '-w' option
|
||||||
|
- added '.gnu.linkonce' ELF sections support
|
||||||
|
- fixed libc linking when running in memory (avoid 'stat' function
|
||||||
|
errors).
|
||||||
|
- extended '-run' option to be able to give several arguments to a C
|
||||||
|
script.
|
||||||
|
|
||||||
|
version 0.9.19:
|
||||||
|
|
||||||
|
- "alacarte" linking (Dave Long)
|
||||||
|
- simpler function call
|
||||||
|
- more strict type checks
|
||||||
|
- added 'const' and 'volatile' support and associated warnings
|
||||||
|
- added -Werror, -Wunsupported, -Wwrite-strings, -Wall.
|
||||||
|
- added __builtin_types_compatible_p() and __builtin_constant_p()
|
||||||
|
- chars support in assembler (Dave Long)
|
||||||
|
- .string, .globl, .section, .text, .data and .bss asm directive
|
||||||
|
support (Dave Long)
|
||||||
|
- man page generated from tcc-doc.texi
|
||||||
|
- fixed macro argument substitution
|
||||||
|
- fixed zero argument macro parsing
|
||||||
|
- changed license to LGPL
|
||||||
|
- added -rdynamic option support
|
||||||
|
|
||||||
|
version 0.9.18:
|
||||||
|
|
||||||
|
- header fix (time.h)
|
||||||
|
- fixed inline asm without operand case
|
||||||
|
- fixed 'default:' or 'case x:' with '}' after (incorrect C construct accepted
|
||||||
|
by gcc)
|
||||||
|
- added 'A' inline asm constraint.
|
||||||
|
|
||||||
|
version 0.9.17:
|
||||||
|
|
||||||
|
- PLT generation fix
|
||||||
|
- tcc doc fixes (Peter Lund)
|
||||||
|
- struct parse fix (signaled by Pedro A. Aranda Gutierrez)
|
||||||
|
- better _Bool lvalue support (signaled by Alex Measday)
|
||||||
|
- function parameters must be converted to pointers (signaled by Neil Brown)
|
||||||
|
- sanitized string and character constant parsing
|
||||||
|
- fixed comment parse (signaled by Damian M Gryski)
|
||||||
|
- fixed macro function bug (signaled by Philippe Ribet)
|
||||||
|
- added configure (initial patch by Mitchell N Charity)
|
||||||
|
- added '-run' and '-v' options (initial patch by vlindos)
|
||||||
|
- added real date report in __DATE__ and __TIME__ macros
|
||||||
|
|
||||||
|
version 0.9.16:
|
||||||
|
|
||||||
|
- added assembler language support
|
||||||
|
- added GCC inline asm() support
|
||||||
|
- fixed multiple variable definitions : uninitialized variables are
|
||||||
|
created as COMMON symbols.
|
||||||
|
- optimized macro processing
|
||||||
|
- added GCC statement expressions support
|
||||||
|
- added GCC local labels support
|
||||||
|
- fixed array declaration in old style function parameters
|
||||||
|
- support casts in static structure initializations
|
||||||
|
- added various __xxx[__] keywords for GCC compatibility
|
||||||
|
- ignore __extension__ GCC in an expression or in a type (still not perfect)
|
||||||
|
- added '? :' GCC extension support
|
||||||
|
|
||||||
|
version 0.9.15:
|
||||||
|
|
||||||
|
- compilation fixes for glibc 2.2, gcc 2.95.3 and gcc 3.2.
|
||||||
|
- FreeBSD compile fixes. Makefile patches still missing (Carl Drougge).
|
||||||
|
- fixed file type guessing if '.' is in the path.
|
||||||
|
- fixed tcc_compile_string()
|
||||||
|
- add a dummy page in ELF files to fix RX/RW accesses (pageexec at
|
||||||
|
freemail dot hu).
|
||||||
|
|
||||||
|
version 0.9.14:
|
||||||
|
|
||||||
|
- added #warning. error message if invalid preprocessing directive.
|
||||||
|
- added CType structure to ease typing (faster parse).
|
||||||
|
- suppressed secondary hash tables (faster parse).
|
||||||
|
- rewrote parser by optimizing common cases (faster parse).
|
||||||
|
- fixed signed long long comparisons.
|
||||||
|
- fixed 'int a(), b();' declaration case.
|
||||||
|
- fixed structure init without '{}'.
|
||||||
|
- correct alignment support in structures.
|
||||||
|
- empty structures support.
|
||||||
|
- gcc testsuite now supported.
|
||||||
|
- output only warning if implicit integer/pointer conversions.
|
||||||
|
- added static bitfield init.
|
||||||
|
|
||||||
|
version 0.9.13:
|
||||||
|
|
||||||
|
- correct preprocessing token pasting (## operator) in all cases (added
|
||||||
|
preprocessing number token).
|
||||||
|
- fixed long long register spill.
|
||||||
|
- fixed signed long long '>>'.
|
||||||
|
- removed memory leaks.
|
||||||
|
- better error handling : processing can continue on link errors. A
|
||||||
|
custom callback can be added to display error messages. Most
|
||||||
|
errors do not call exit() now.
|
||||||
|
- ignore -O, -W, -m and -f options
|
||||||
|
- added old style function declarations
|
||||||
|
- added GCC __alignof__ support.
|
||||||
|
- added GCC typeof support.
|
||||||
|
- added GCC computed gotos support.
|
||||||
|
- added stack backtrace in runtime error message. Improved runtime
|
||||||
|
error position display.
|
||||||
|
|
||||||
|
version 0.9.12:
|
||||||
|
|
||||||
|
- more fixes for || and && handling.
|
||||||
|
- improved '? :' type handling.
|
||||||
|
- fixed bound checking generation with structures
|
||||||
|
- force '#endif' to be in same file as matching '#if'
|
||||||
|
- #include file optimization with '#ifndef #endif' construct detection
|
||||||
|
- macro handling optimization
|
||||||
|
- added tcc_relocate() and tcc_get_symbol() in libtcc.
|
||||||
|
|
||||||
|
version 0.9.11:
|
||||||
|
|
||||||
|
- stdarg.h fix for double type (thanks to Philippe Ribet).
|
||||||
|
- correct white space characters and added MSDOS newline support.
|
||||||
|
- fixed invalid implicit function call type declaration.
|
||||||
|
- special macros such as __LINE__ are defined if tested with defined().
|
||||||
|
- fixed '!' operator with relocated address.
|
||||||
|
- added symbol + offset relocation (fixes some static variable initializers)
|
||||||
|
- '-l' option can be specified anywhere. '-c' option yields default
|
||||||
|
output name. added '-r' option for relocatable output.
|
||||||
|
- fixed '\nnn' octal parsing.
|
||||||
|
- fixed local extern variables declarations.
|
||||||
|
|
||||||
|
version 0.9.10:
|
||||||
|
|
||||||
|
- fixed lvalue type when saved in local stack.
|
||||||
|
- fixed '#include' syntax when using macros.
|
||||||
|
- fixed '#line' bug.
|
||||||
|
- removed size limit on strings. Unified string constants handling
|
||||||
|
with variable declarations.
|
||||||
|
- added correct support for '\xX' in wchar_t strings.
|
||||||
|
- added support for bound checking in generated executables
|
||||||
|
- fixed -I include order.
|
||||||
|
- fixed incorrect function displayed in runtime error.
|
||||||
|
|
||||||
|
version 0.9.9:
|
||||||
|
|
||||||
|
- fixed preprocessor expression parsing for #if/#elif.
|
||||||
|
- relocated debug info (.stab section).
|
||||||
|
- relocated bounds info (.bounds section).
|
||||||
|
- fixed cast to char of char constants ('\377' is -1 instead of 255)
|
||||||
|
- fixed implicit cast for unary plus.
|
||||||
|
- strings and '__func__' have now 'char[]' type instead of 'char *'
|
||||||
|
(fixes sizeof() return value).
|
||||||
|
- added __start_xxx and __stop_xxx symbols in linker.
|
||||||
|
- better DLL creation support (option -shared begins to work).
|
||||||
|
- ELF sections and hash tables are resized dynamically.
|
||||||
|
- executables and DLLs are stripped by default.
|
||||||
|
|
||||||
|
version 0.9.8:
|
||||||
|
|
||||||
|
- First version of full ELF linking support (generate objects, static
|
||||||
|
executable, dynamic executable, dynamic libraries). Dynamic library
|
||||||
|
support is not finished (need PIC support in compiler and some
|
||||||
|
patches in symbol exporting).
|
||||||
|
- First version of ELF loader for object (.o) and archive (.a) files.
|
||||||
|
- Support of simple GNU ld scripts (GROUP and FILE commands)
|
||||||
|
- Separated runtime library and bound check code from TCC (smaller
|
||||||
|
compiler core).
|
||||||
|
- fixed register reload in float compare.
|
||||||
|
- fixed implicit char/short to int casting.
|
||||||
|
- allow array type for address of ('&') operator.
|
||||||
|
- fixed unused || or && result.
|
||||||
|
- added GCC style variadic macro support.
|
||||||
|
- optimized bound checking code for array access.
|
||||||
|
- tcc includes are now in $(prefix)/lib/tcc/include.
|
||||||
|
- more command line options - more consistent handling of multiple
|
||||||
|
input files.
|
||||||
|
- added tcc man page (thanks to Cyril Bouthors).
|
||||||
|
- uClibc Makefile update
|
||||||
|
- converted documentation to texinfo format.
|
||||||
|
- added developper's guide in documentation.
|
||||||
|
|
||||||
|
version 0.9.7:
|
||||||
|
|
||||||
|
- added library API for easy dynamic compilation (see libtcc.h - first
|
||||||
|
draft).
|
||||||
|
- fixed long long register spill bug.
|
||||||
|
- fixed '? :' register spill bug.
|
||||||
|
|
||||||
|
version 0.9.6:
|
||||||
|
|
||||||
|
- added floating point constant propagation (fixes negative floating
|
||||||
|
point constants bug).
|
||||||
|
|
||||||
|
version 0.9.5:
|
||||||
|
|
||||||
|
- uClibc patches (submitted by Alfonso Martone).
|
||||||
|
- error reporting fix
|
||||||
|
- added CONFIG_TCC_BCHECK to get smaller code if needed.
|
||||||
|
|
||||||
|
version 0.9.4:
|
||||||
|
|
||||||
|
- windows port (currently cannot use -g, -b and dll functions).
|
||||||
|
- faster and simpler I/O handling.
|
||||||
|
- '-D' option works in all cases.
|
||||||
|
- preprocessor fixes (#elif and empty macro args)
|
||||||
|
- floating point fixes
|
||||||
|
- first code for CIL generation (does not work yet)
|
||||||
|
|
||||||
|
version 0.9.3:
|
||||||
|
|
||||||
|
- better and smaller code generator.
|
||||||
|
- full ISOC99 64 bit 'long long' support.
|
||||||
|
- full 32 bit 'float', 64 bit 'double' and 96 bit 'long double' support.
|
||||||
|
- added '-U' option.
|
||||||
|
- added assembly sections support.
|
||||||
|
- even faster startup time by mmaping sections instead of mallocing them.
|
||||||
|
- added GNUC __attribute__ keyword support (currently supports
|
||||||
|
'section' and 'aligned' attributes).
|
||||||
|
- added ELF file output (only usable for debugging now)
|
||||||
|
- added debug symbol generation (STAB format).
|
||||||
|
- added integrated runtime error analysis ('-g' option: print clear
|
||||||
|
run time error messages instead of "Segmentation fault").
|
||||||
|
- added first version of tiny memory and bound checker ('-b' option).
|
||||||
|
|
||||||
|
version 0.9.2:
|
||||||
|
|
||||||
|
- even faster parsing.
|
||||||
|
- various syntax parsing fixes.
|
||||||
|
- fixed external relocation handling for variables or functions pointers.
|
||||||
|
- better function pointers type handling.
|
||||||
|
- can compile multiple files (-i option).
|
||||||
|
- ANSI C bit fields are supported.
|
||||||
|
- beginning of float/double/long double support.
|
||||||
|
- beginning of long long support.
|
||||||
|
|
||||||
|
version 0.9.1:
|
||||||
|
|
||||||
|
- full ISOC99 initializers handling.
|
||||||
|
- compound literals.
|
||||||
|
- structures handle in assignments and as function param or return value.
|
||||||
|
- wide chars and strings.
|
||||||
|
- macro bug fix
|
||||||
|
|
||||||
|
version 0.9:
|
||||||
|
- initial version.
|
||||||
2
bazaar/Tcc/lib/GetDll.bat
Normal file
2
bazaar/Tcc/lib/GetDll.bat
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
gcc -O3 -shared -Wall -Wl,--export-all-symbols -mpreferred-stack-boundary=2 -march=i386 -falign-functions=0 -fno-strict-aliasing -DTCC_TARGET_PE -DLIBTCC -o libtcc.dll tcc.c
|
||||||
|
pause
|
||||||
313
bazaar/Tcc/lib/Makefile
Normal file
313
bazaar/Tcc/lib/Makefile
Normal file
|
|
@ -0,0 +1,313 @@
|
||||||
|
#
|
||||||
|
# Tiny C Compiler Makefile
|
||||||
|
#
|
||||||
|
include config.mak
|
||||||
|
|
||||||
|
CFLAGS+=-g -Wall
|
||||||
|
ifndef CONFIG_WIN32
|
||||||
|
LIBS=-lm
|
||||||
|
ifndef CONFIG_NOLDL
|
||||||
|
LIBS+=-ldl
|
||||||
|
endif
|
||||||
|
BCHECK_O=bcheck.o
|
||||||
|
endif
|
||||||
|
CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC
|
||||||
|
LIBS_P=
|
||||||
|
|
||||||
|
CFLAGS+=-mpreferred-stack-boundary=2
|
||||||
|
ifeq ($(GCC_MAJOR),2)
|
||||||
|
CFLAGS+=-m386 -malign-functions=0
|
||||||
|
else
|
||||||
|
CFLAGS+=-march=i386 -falign-functions=0 -fno-strict-aliasing
|
||||||
|
ifneq ($(GCC_MAJOR),3)
|
||||||
|
CFLAGS+=-Wno-pointer-sign -Wno-sign-compare
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
DISAS=objdump -d
|
||||||
|
INSTALL=install
|
||||||
|
|
||||||
|
ifdef CONFIG_WIN32
|
||||||
|
PROGS=tcc$(EXESUF)
|
||||||
|
ifdef CONFIG_CROSS
|
||||||
|
PROGS+=c67-tcc$(EXESUF) arm-tcc$(EXESUF)
|
||||||
|
endif
|
||||||
|
PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF)
|
||||||
|
else
|
||||||
|
ifeq ($(ARCH),i386)
|
||||||
|
PROGS=tcc$(EXESUF)
|
||||||
|
ifdef CONFIG_CROSS
|
||||||
|
PROGS+=arm-tcc$(EXESUF)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifeq ($(ARCH),arm)
|
||||||
|
PROGS=tcc$(EXESUF)
|
||||||
|
ifdef CONFIG_CROSS
|
||||||
|
PROGS+=i386-tcc$(EXESUF)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifdef CONFIG_CROSS
|
||||||
|
PROGS+=c67-tcc$(EXESUF) i386-win32-tcc$(EXESUF)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# run local version of tcc with local libraries and includes
|
||||||
|
TCC=./tcc -B. -I.
|
||||||
|
|
||||||
|
all: $(PROGS) \
|
||||||
|
libtcc1.a $(BCHECK_O) tcc-doc.html tcc.1 libtcc.a \
|
||||||
|
libtcc_test$(EXESUF)
|
||||||
|
|
||||||
|
Makefile: config.mak
|
||||||
|
|
||||||
|
# auto test
|
||||||
|
|
||||||
|
test: test.ref test.out
|
||||||
|
@if diff -u test.ref test.out ; then echo "Auto Test OK"; fi
|
||||||
|
|
||||||
|
tcctest.ref: tcctest.c
|
||||||
|
$(CC) $(CFLAGS) -w -I. -o $@ $<
|
||||||
|
|
||||||
|
test.ref: tcctest.ref
|
||||||
|
./tcctest.ref > $@
|
||||||
|
|
||||||
|
test.out: tcc tcctest.c
|
||||||
|
$(TCC) -run tcctest.c > $@
|
||||||
|
|
||||||
|
run: tcc tcctest.c
|
||||||
|
$(TCC) -run tcctest.c
|
||||||
|
|
||||||
|
# iterated test2 (compile tcc then compile tcctest.c !)
|
||||||
|
test2: tcc tcc.c tcctest.c test.ref
|
||||||
|
$(TCC) -run tcc.c -B. -I. -run tcctest.c > test.out2
|
||||||
|
@if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi
|
||||||
|
|
||||||
|
# iterated test3 (compile tcc then compile tcc then compile tcctest.c !)
|
||||||
|
test3: tcc tcc.c tcctest.c test.ref
|
||||||
|
$(TCC) -run tcc.c -B. -I. -run tcc.c -B. -I. -run tcctest.c > test.out3
|
||||||
|
@if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi
|
||||||
|
|
||||||
|
# binary output test
|
||||||
|
test4: tcc test.ref
|
||||||
|
# dynamic output
|
||||||
|
$(TCC) -o tcctest1 tcctest.c
|
||||||
|
./tcctest1 > test1.out
|
||||||
|
@if diff -u test.ref test1.out ; then echo "Dynamic Auto Test OK"; fi
|
||||||
|
# static output
|
||||||
|
$(TCC) -static -o tcctest2 tcctest.c
|
||||||
|
./tcctest2 > test2.out
|
||||||
|
@if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi
|
||||||
|
# object + link output
|
||||||
|
$(TCC) -c -o tcctest3.o tcctest.c
|
||||||
|
$(TCC) -o tcctest3 tcctest3.o
|
||||||
|
./tcctest3 > test3.out
|
||||||
|
@if diff -u test.ref test3.out ; then echo "Object Auto Test OK"; fi
|
||||||
|
# dynamic output + bound check
|
||||||
|
$(TCC) -b -o tcctest4 tcctest.c
|
||||||
|
./tcctest4 > test4.out
|
||||||
|
@if diff -u test.ref test4.out ; then echo "BCheck Auto Test OK"; fi
|
||||||
|
|
||||||
|
# memory and bound check auto test
|
||||||
|
BOUNDS_OK = 1 4 8 10
|
||||||
|
BOUNDS_FAIL= 2 5 7 9 11 12 13
|
||||||
|
|
||||||
|
btest: boundtest.c tcc
|
||||||
|
@for i in $(BOUNDS_OK); do \
|
||||||
|
if $(TCC) -b -run boundtest.c $$i ; then \
|
||||||
|
/bin/true ; \
|
||||||
|
else\
|
||||||
|
echo Failed positive test $$i ; exit 1 ; \
|
||||||
|
fi ;\
|
||||||
|
done ;\
|
||||||
|
for i in $(BOUNDS_FAIL); do \
|
||||||
|
if $(TCC) -b -run boundtest.c $$i ; then \
|
||||||
|
echo Failed negative test $$i ; exit 1 ;\
|
||||||
|
else\
|
||||||
|
/bin/true ; \
|
||||||
|
fi\
|
||||||
|
done ;\
|
||||||
|
echo Bound test OK
|
||||||
|
|
||||||
|
# speed test
|
||||||
|
speed: tcc ex2 ex3
|
||||||
|
time ./ex2 1238 2 3 4 10 13 4
|
||||||
|
time ./tcc -I. ./ex2.c 1238 2 3 4 10 13 4
|
||||||
|
time ./ex3 35
|
||||||
|
time ./tcc -I. ./ex3.c 35
|
||||||
|
|
||||||
|
ex2: ex2.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
ex3: ex3.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
# Host Tiny C Compiler
|
||||||
|
ifdef CONFIG_WIN32
|
||||||
|
tcc$(EXESUF): tcc.c i386-gen.c tccelf.c tccasm.c i386-asm.c tcctok.h libtcc.h i386-asm.h tccpe.c
|
||||||
|
$(CC) $(CFLAGS) -DTCC_TARGET_PE -o $@ $< $(LIBS)
|
||||||
|
else
|
||||||
|
ifeq ($(ARCH),i386)
|
||||||
|
tcc$(EXESUF): tcc.c i386-gen.c tccelf.c tccasm.c i386-asm.c tcctok.h libtcc.h i386-asm.h
|
||||||
|
$(CC) $(CFLAGS) -o $@ $< $(LIBS)
|
||||||
|
endif
|
||||||
|
ifeq ($(ARCH),arm)
|
||||||
|
tcc$(EXESUF): tcc.c arm-gen.c tccelf.c tccasm.c tcctok.h libtcc.h
|
||||||
|
$(CC) $(CFLAGS) -DTCC_TARGET_ARM -o $@ $< $(LIBS)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Cross Tiny C Compilers
|
||||||
|
i386-tcc$(EXESUF): tcc.c i386-gen.c tccelf.c tccasm.c i386-asm.c tcctok.h libtcc.h i386-asm.h
|
||||||
|
$(CC) $(CFLAGS) -o $@ $< $(LIBS)
|
||||||
|
|
||||||
|
c67-tcc$(EXESUF): tcc.c c67-gen.c tccelf.c tccasm.c tcctok.h libtcc.h tcccoff.c
|
||||||
|
$(CC) $(CFLAGS) -DTCC_TARGET_C67 -o $@ $< $(LIBS)
|
||||||
|
|
||||||
|
arm-tcc$(EXESUF): tcc.c arm-gen.c tccelf.c tccasm.c tcctok.h libtcc.h
|
||||||
|
$(CC) $(CFLAGS) -DTCC_TARGET_ARM -DTCC_ARM_EABI -o $@ $< $(LIBS)
|
||||||
|
|
||||||
|
i386-win32-tcc$(EXESUF): tcc.c i386-gen.c tccelf.c tccasm.c i386-asm.c tcctok.h libtcc.h i386-asm.h tccpe.c
|
||||||
|
$(CC) $(CFLAGS) -DTCC_TARGET_PE -o $@ $< $(LIBS)
|
||||||
|
|
||||||
|
# windows utilities
|
||||||
|
tiny_impdef$(EXESUF): win32/tools/tiny_impdef.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $< -lkernel32
|
||||||
|
tiny_libmaker$(EXESUF): win32/tools/tiny_libmaker.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $< -lkernel32
|
||||||
|
|
||||||
|
# TinyCC runtime libraries
|
||||||
|
ifdef CONFIG_WIN32
|
||||||
|
# for windows, we must use TCC because we generate ELF objects
|
||||||
|
LIBTCC1_OBJS=$(addprefix win32/lib/, crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o) libtcc1.o
|
||||||
|
LIBTCC1_CC=./tcc.exe -Bwin32 -DTCC_TARGET_PE
|
||||||
|
else
|
||||||
|
LIBTCC1_OBJS=libtcc1.o
|
||||||
|
LIBTCC1_CC=$(CC)
|
||||||
|
endif
|
||||||
|
ifeq ($(ARCH),i386)
|
||||||
|
LIBTCC1_OBJS+=alloca86.o alloca86-bt.o
|
||||||
|
endif
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(LIBTCC1_CC) -O2 -Wall -c -o $@ $<
|
||||||
|
|
||||||
|
%.o: %.S
|
||||||
|
$(LIBTCC1_CC) -c -o $@ $<
|
||||||
|
|
||||||
|
libtcc1.a: $(LIBTCC1_OBJS)
|
||||||
|
$(AR) rcs $@ $^
|
||||||
|
|
||||||
|
bcheck.o: bcheck.c
|
||||||
|
$(CC) -O2 -Wall -c -o $@ $<
|
||||||
|
|
||||||
|
install: tcc_install libinstall
|
||||||
|
|
||||||
|
tcc_install: $(PROGS) tcc.1 libtcc1.a $(BCHECK_O) tcc-doc.html
|
||||||
|
mkdir -p "$(bindir)"
|
||||||
|
$(INSTALL) -s -m755 $(PROGS) "$(bindir)"
|
||||||
|
ifndef CONFIG_WIN32
|
||||||
|
mkdir -p "$(mandir)/man1"
|
||||||
|
$(INSTALL) tcc.1 "$(mandir)/man1"
|
||||||
|
endif
|
||||||
|
mkdir -p "$(tccdir)"
|
||||||
|
mkdir -p "$(tccdir)/include"
|
||||||
|
ifdef CONFIG_WIN32
|
||||||
|
mkdir -p "$(tccdir)/lib"
|
||||||
|
$(INSTALL) -m644 libtcc1.a win32/lib/*.def "$(tccdir)/lib"
|
||||||
|
cp -r win32/include/. "$(tccdir)/include"
|
||||||
|
cp -r win32/examples/. "$(tccdir)/examples"
|
||||||
|
else
|
||||||
|
$(INSTALL) -m644 libtcc1.a $(BCHECK_O) "$(tccdir)"
|
||||||
|
$(INSTALL) -m644 stdarg.h stddef.h stdbool.h float.h varargs.h \
|
||||||
|
tcclib.h "$(tccdir)/include"
|
||||||
|
endif
|
||||||
|
mkdir -p "$(docdir)"
|
||||||
|
$(INSTALL) -m644 tcc-doc.html "$(docdir)"
|
||||||
|
ifdef CONFIG_WIN32
|
||||||
|
$(INSTALL) -m644 win32/readme.txt "$(docdir)"
|
||||||
|
endif
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *~ *.o *.a tcc tcct tcc_g tcctest.ref *.bin *.i ex2 \
|
||||||
|
core gmon.out test.out test.ref a.out tcc_p \
|
||||||
|
*.exe *.lib tcc.pod libtcc_test \
|
||||||
|
tcctest[1234] test[1234].out $(PROGS) win32/lib/*.o
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f config.h config.mak config.texi
|
||||||
|
|
||||||
|
# profiling version
|
||||||
|
tcc_p: tcc.c Makefile
|
||||||
|
$(CC) $(CFLAGS_P) -o $@ $< $(LIBS_P)
|
||||||
|
|
||||||
|
# libtcc generation and example
|
||||||
|
libinstall: libtcc.a
|
||||||
|
mkdir -p "$(libdir)"
|
||||||
|
$(INSTALL) -m644 libtcc.a "$(libdir)"
|
||||||
|
mkdir -p "$(includedir)"
|
||||||
|
$(INSTALL) -m644 libtcc.h "$(includedir)"
|
||||||
|
|
||||||
|
libtcc.o: tcc.c i386-gen.c Makefile
|
||||||
|
ifdef CONFIG_WIN32
|
||||||
|
$(CC) $(CFLAGS) -DTCC_TARGET_PE -DLIBTCC -c -o $@ $<
|
||||||
|
else
|
||||||
|
$(CC) $(CFLAGS) -DLIBTCC -c -o $@ $<
|
||||||
|
endif
|
||||||
|
|
||||||
|
libtcc.a: libtcc.o
|
||||||
|
$(AR) rcs $@ $^
|
||||||
|
|
||||||
|
libtcc_test$(EXESUF): libtcc_test.c libtcc.a
|
||||||
|
$(CC) $(CFLAGS) -o $@ $< libtcc.a $(LIBS)
|
||||||
|
|
||||||
|
libtest: libtcc_test
|
||||||
|
./libtcc_test
|
||||||
|
|
||||||
|
# targets for development
|
||||||
|
|
||||||
|
%.bin: %.c tcc
|
||||||
|
$(TCC) -g -o $@ $<
|
||||||
|
$(DISAS) $@
|
||||||
|
|
||||||
|
instr: instr.o
|
||||||
|
objdump -d instr.o
|
||||||
|
|
||||||
|
# tiny assembler testing
|
||||||
|
|
||||||
|
asmtest.ref: asmtest.S
|
||||||
|
$(CC) -c -o asmtest.ref.o asmtest.S
|
||||||
|
objdump -D asmtest.ref.o > $@
|
||||||
|
|
||||||
|
# XXX: we compute tcc.c to go faster during development !
|
||||||
|
asmtest.out: asmtest.S tcc
|
||||||
|
# ./tcc tcc.c -c asmtest.S
|
||||||
|
#asmtest.out: asmtest.S tcc
|
||||||
|
./tcc -c asmtest.S
|
||||||
|
objdump -D asmtest.o > $@
|
||||||
|
|
||||||
|
asmtest: asmtest.out asmtest.ref
|
||||||
|
@if diff -u --ignore-matching-lines="file format" asmtest.ref asmtest.out ; then echo "ASM Auto Test OK"; fi
|
||||||
|
|
||||||
|
instr.o: instr.S
|
||||||
|
$(CC) -O2 -Wall -g -c -o $@ $<
|
||||||
|
|
||||||
|
cache: tcc_g
|
||||||
|
cachegrind ./tcc_g -o /tmp/linpack -lm bench/linpack.c
|
||||||
|
vg_annotate tcc.c > /tmp/linpack.cache.log
|
||||||
|
|
||||||
|
# documentation and man page
|
||||||
|
tcc-doc.html: tcc-doc.texi
|
||||||
|
-texi2html -monolithic -number $<
|
||||||
|
|
||||||
|
tcc.1: tcc-doc.texi
|
||||||
|
-./texi2pod.pl $< tcc.pod
|
||||||
|
-pod2man --section=1 --center=" " --release=" " tcc.pod > $@
|
||||||
|
|
||||||
|
FILE=tcc-$(shell cat VERSION)
|
||||||
|
|
||||||
|
# tar release (use 'make -k tar' on a checkouted tree)
|
||||||
|
tar:
|
||||||
|
rm -rf /tmp/$(FILE)
|
||||||
|
cp -r . /tmp/$(FILE)
|
||||||
|
( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
|
||||||
|
rm -rf /tmp/$(FILE)
|
||||||
91
bazaar/Tcc/lib/README
Normal file
91
bazaar/Tcc/lib/README
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
Tiny C Compiler - C Scripting Everywhere - The Smallest ANSI C compiler
|
||||||
|
-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Features:
|
||||||
|
--------
|
||||||
|
|
||||||
|
- SMALL! You can compile and execute C code everywhere, for example on
|
||||||
|
rescue disks.
|
||||||
|
|
||||||
|
- FAST! tcc generates optimized x86 code. No byte code
|
||||||
|
overhead. Compile, assemble and link about 7 times faster than 'gcc
|
||||||
|
-O0'.
|
||||||
|
|
||||||
|
- UNLIMITED! Any C dynamic library can be used directly. TCC is
|
||||||
|
heading torward full ISOC99 compliance. TCC can of course compile
|
||||||
|
itself.
|
||||||
|
|
||||||
|
- SAFE! tcc includes an optional memory and bound checker. Bound
|
||||||
|
checked code can be mixed freely with standard code.
|
||||||
|
|
||||||
|
- Compile and execute C source directly. No linking or assembly
|
||||||
|
necessary. Full C preprocessor included.
|
||||||
|
|
||||||
|
- C script supported : just add '#!/usr/local/bin/tcc -run' at the first
|
||||||
|
line of your C source, and execute it directly from the command
|
||||||
|
line.
|
||||||
|
|
||||||
|
Documentation:
|
||||||
|
-------------
|
||||||
|
|
||||||
|
1) Installation on a i386 Linux host (for Windows read win32/readme.txt)
|
||||||
|
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
make test
|
||||||
|
make install
|
||||||
|
|
||||||
|
By default, tcc is installed in /usr/local/bin.
|
||||||
|
./configure --help shows configuration options.
|
||||||
|
|
||||||
|
|
||||||
|
2) Introduction
|
||||||
|
|
||||||
|
We assume here that you know ANSI C. Look at the example ex1.c to know
|
||||||
|
what the programs look like.
|
||||||
|
|
||||||
|
The include file <tcclib.h> can be used if you want a small basic libc
|
||||||
|
include support (especially useful for floppy disks). Of course, you
|
||||||
|
can also use standard headers, although they are slower to compile.
|
||||||
|
|
||||||
|
You can begin your C script with '#!/usr/local/bin/tcc -run' on the first
|
||||||
|
line and set its execute bits (chmod a+x your_script). Then, you can
|
||||||
|
launch the C code as a shell or perl script :-) The command line
|
||||||
|
arguments are put in 'argc' and 'argv' of the main functions, as in
|
||||||
|
ANSI C.
|
||||||
|
|
||||||
|
3) Examples
|
||||||
|
|
||||||
|
ex1.c: simplest example (hello world). Can also be launched directly
|
||||||
|
as a script: './ex1.c'.
|
||||||
|
|
||||||
|
ex2.c: more complicated example: find a number with the four
|
||||||
|
operations given a list of numbers (benchmark).
|
||||||
|
|
||||||
|
ex3.c: compute fibonacci numbers (benchmark).
|
||||||
|
|
||||||
|
ex4.c: more complicated: X11 program. Very complicated test in fact
|
||||||
|
because standard headers are being used !
|
||||||
|
|
||||||
|
ex5.c: 'hello world' with standard glibc headers.
|
||||||
|
|
||||||
|
tcc.c: TCC can of course compile itself. Used to check the code
|
||||||
|
generator.
|
||||||
|
|
||||||
|
tcctest.c: auto test for TCC which tests many subtle possible bugs. Used
|
||||||
|
when doing 'make test'.
|
||||||
|
|
||||||
|
4) Full Documentation
|
||||||
|
|
||||||
|
Please read tcc-doc.html to have all the features of TCC.
|
||||||
|
|
||||||
|
Additional information is available for the Windows port in
|
||||||
|
win32/readme.txt.
|
||||||
|
|
||||||
|
License:
|
||||||
|
-------
|
||||||
|
|
||||||
|
TCC is distributed under the GNU Lesser General Public License (see
|
||||||
|
COPYING file).
|
||||||
|
|
||||||
|
Fabrice Bellard.
|
||||||
95
bazaar/Tcc/lib/TODO
Normal file
95
bazaar/Tcc/lib/TODO
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
TODO list:
|
||||||
|
|
||||||
|
Bugs:
|
||||||
|
|
||||||
|
- fix macro substitution with nested definitions (ShangHongzhang)
|
||||||
|
- FPU st(0) is left unclean (kwisatz haderach). Incompatible with
|
||||||
|
optimized gcc/msc code
|
||||||
|
|
||||||
|
- constructors
|
||||||
|
- cast bug (Peter Wang)
|
||||||
|
- define incomplete type if defined several times (Peter Wang).
|
||||||
|
- configure --cc=tcc (still one bug in libtcc1.c)
|
||||||
|
- test binutils/gcc compile
|
||||||
|
- tci patch + argument.
|
||||||
|
- see -lxxx bug (Michael Charity).
|
||||||
|
- see transparent union pb in /urs/include/sys/socket.h
|
||||||
|
- precise behaviour of typeof with arrays ? (__put_user macro)
|
||||||
|
but should suffice for most cases)
|
||||||
|
- handle '? x, y : z' in unsized variable initialization (',' is
|
||||||
|
considered incorrectly as separator in preparser)
|
||||||
|
- transform functions to function pointers in function parameters
|
||||||
|
(net/ipv4/ip_output.c)
|
||||||
|
- fix function pointer type display
|
||||||
|
- check lcc test suite -> fix bitfield binary operations
|
||||||
|
- check section alignment in C
|
||||||
|
- fix invalid cast in comparison 'if (v == (int8_t)v)'
|
||||||
|
- finish varargs.h support (gcc 3.2 testsuite issue)
|
||||||
|
- fix static functions declared inside block
|
||||||
|
- fix multiple unions init
|
||||||
|
- sizeof, alignof, typeof can still generate code in some cases.
|
||||||
|
- Fix the remaining libtcc memory leaks.
|
||||||
|
- make libtcc fully reentrant (except for the compilation stage itself).
|
||||||
|
|
||||||
|
Bound checking:
|
||||||
|
|
||||||
|
- '-b' bug.
|
||||||
|
- fix bound exit on RedHat 7.3
|
||||||
|
- setjmp is not supported properly in bound checking.
|
||||||
|
- fix bound check code with '&' on local variables (currently done
|
||||||
|
only for local arrays).
|
||||||
|
- bound checking and float/long long/struct copy code. bound
|
||||||
|
checking and symbol + offset optimization
|
||||||
|
|
||||||
|
Missing features:
|
||||||
|
|
||||||
|
- disable-asm and disable-bcheck options
|
||||||
|
- __builtin_expect()
|
||||||
|
- improve '-E' option.
|
||||||
|
- add '-MD' option
|
||||||
|
- atexit (Nigel Horne)
|
||||||
|
- packed attribute
|
||||||
|
- C99: add variable size arrays (gcc 3.2 testsuite issue)
|
||||||
|
- C99: add complex types (gcc 3.2 testsuite issue)
|
||||||
|
- postfix compound literals (see 20010124-1.c)
|
||||||
|
|
||||||
|
Optimizations:
|
||||||
|
|
||||||
|
- suppress specific anonymous symbol handling
|
||||||
|
- more parse optimizations (=even faster compilation)
|
||||||
|
- memory alloc optimizations (=even faster compilation)
|
||||||
|
- optimize VT_LOCAL + const
|
||||||
|
- better local variables handling (needed for other targets)
|
||||||
|
|
||||||
|
Not critical:
|
||||||
|
|
||||||
|
- C99: fix multiple compound literals inits in blocks (ISOC99
|
||||||
|
normative example - only relevant when using gotos! -> must add
|
||||||
|
boolean variable to tell if compound literal was already
|
||||||
|
initialized).
|
||||||
|
- add PowerPC or ARM code generator and improve codegen for RISC (need
|
||||||
|
to suppress VT_LOCAL and use a base register instead).
|
||||||
|
- interactive mode / integrated debugger
|
||||||
|
- fix preprocessor symbol redefinition
|
||||||
|
- better constant opt (&&, ||, ?:)
|
||||||
|
- add portable byte code generator and interpreter for other
|
||||||
|
unsupported architectures.
|
||||||
|
- C++: variable declaration in for, minimal 'class' support.
|
||||||
|
- win32: __intxx. use resolve for bchecked malloc et al.
|
||||||
|
check exception code (exception filter func).
|
||||||
|
- handle void (__attribute__() *ptr)()
|
||||||
|
|
||||||
|
Fixed (probably):
|
||||||
|
|
||||||
|
- bug with defines:
|
||||||
|
#define spin_lock(lock) do { } while (0)
|
||||||
|
#define wq_spin_lock spin_lock
|
||||||
|
#define TEST() wq_spin_lock(a)
|
||||||
|
- typedefs can be structure fields
|
||||||
|
- see bugfixes.diff + improvement.diff from Daniel Glockner
|
||||||
|
- long long constant evaluation
|
||||||
|
- add alloca()
|
||||||
|
- gcc '-E' option.
|
||||||
|
- #include_next support for /usr/include/limits ?
|
||||||
|
- function pointers/lvalues in ? : (linux kernel net/core/dev.c)
|
||||||
|
- win32: add __stdcall, check GetModuleHandle for dlls.
|
||||||
1
bazaar/Tcc/lib/VERSION
Normal file
1
bazaar/Tcc/lib/VERSION
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
0.9.24
|
||||||
45
bazaar/Tcc/lib/alloca86-bt.S
Normal file
45
bazaar/Tcc/lib/alloca86-bt.S
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
/* ---------------------------------------------- */
|
||||||
|
/* alloca86b.S */
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
.globl __bound__alloca
|
||||||
|
|
||||||
|
__bound__alloca:
|
||||||
|
pop %edx
|
||||||
|
pop %eax
|
||||||
|
mov %eax, %ecx
|
||||||
|
add $3,%eax
|
||||||
|
and $-4,%eax
|
||||||
|
jz p6
|
||||||
|
|
||||||
|
#ifdef TCC_TARGET_PE
|
||||||
|
p4:
|
||||||
|
cmp $4096,%eax
|
||||||
|
jle p5
|
||||||
|
sub $4096,%esp
|
||||||
|
sub $4096,%eax
|
||||||
|
test %eax,(%esp)
|
||||||
|
jmp p4
|
||||||
|
|
||||||
|
p5:
|
||||||
|
#endif
|
||||||
|
|
||||||
|
sub %eax,%esp
|
||||||
|
mov %esp,%eax
|
||||||
|
|
||||||
|
push %edx
|
||||||
|
push %eax
|
||||||
|
push %ecx
|
||||||
|
push %eax
|
||||||
|
call __bound_new_region
|
||||||
|
add $8, %esp
|
||||||
|
pop %eax
|
||||||
|
pop %edx
|
||||||
|
|
||||||
|
p6:
|
||||||
|
push %edx
|
||||||
|
push %edx
|
||||||
|
ret
|
||||||
|
|
||||||
|
/* ---------------------------------------------- */
|
||||||
33
bazaar/Tcc/lib/alloca86.S
Normal file
33
bazaar/Tcc/lib/alloca86.S
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
/* ---------------------------------------------- */
|
||||||
|
/* alloca86.S */
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
.globl _alloca
|
||||||
|
|
||||||
|
_alloca:
|
||||||
|
pop %edx
|
||||||
|
pop %eax
|
||||||
|
add $3,%eax
|
||||||
|
and $-4,%eax
|
||||||
|
jz p3
|
||||||
|
|
||||||
|
#ifdef TCC_TARGET_PE
|
||||||
|
p1:
|
||||||
|
cmp $4096,%eax
|
||||||
|
jle p2
|
||||||
|
sub $4096,%esp
|
||||||
|
sub $4096,%eax
|
||||||
|
test %eax,(%esp)
|
||||||
|
jmp p1
|
||||||
|
p2:
|
||||||
|
#endif
|
||||||
|
|
||||||
|
sub %eax,%esp
|
||||||
|
mov %esp,%eax
|
||||||
|
p3:
|
||||||
|
push %edx
|
||||||
|
push %edx
|
||||||
|
ret
|
||||||
|
|
||||||
|
/* ---------------------------------------------- */
|
||||||
1700
bazaar/Tcc/lib/arm-gen.c
Normal file
1700
bazaar/Tcc/lib/arm-gen.c
Normal file
File diff suppressed because it is too large
Load diff
558
bazaar/Tcc/lib/asmtest.S
Normal file
558
bazaar/Tcc/lib/asmtest.S
Normal file
|
|
@ -0,0 +1,558 @@
|
||||||
|
|
||||||
|
/* some directive tests */
|
||||||
|
|
||||||
|
.byte 0xff
|
||||||
|
.byte 1, 2, 3
|
||||||
|
.short 1, 2, 3
|
||||||
|
.word 1, 2, 3
|
||||||
|
.long 1, 2, 3
|
||||||
|
.int 1, 2, 3
|
||||||
|
.align 8
|
||||||
|
.byte 1
|
||||||
|
.align 16, 0x90
|
||||||
|
.skip 3
|
||||||
|
.skip 15, 0x90
|
||||||
|
.string "hello\0world"
|
||||||
|
|
||||||
|
/* some label tests */
|
||||||
|
|
||||||
|
movl %eax, %ebx
|
||||||
|
L1:
|
||||||
|
movl %eax, %ebx
|
||||||
|
mov 0x10000, %eax
|
||||||
|
L2:
|
||||||
|
movl $L2 - L1, %ecx
|
||||||
|
var1:
|
||||||
|
nop ; nop ; nop ; nop
|
||||||
|
|
||||||
|
mov var1, %eax
|
||||||
|
|
||||||
|
/* instruction tests */
|
||||||
|
movl %eax, %ebx
|
||||||
|
mov 0x10000, %eax
|
||||||
|
mov 0x10000, %ax
|
||||||
|
mov 0x10000, %al
|
||||||
|
mov %al, 0x10000
|
||||||
|
|
||||||
|
mov $1, %edx
|
||||||
|
mov $1, %dx
|
||||||
|
mov $1, %dl
|
||||||
|
movb $2, 0x100(%ebx,%edx,2)
|
||||||
|
movw $2, 0x100(%ebx,%edx,2)
|
||||||
|
movl $2, 0x100(%ebx,%edx,2)
|
||||||
|
movl %eax, 0x100(%ebx,%edx,2)
|
||||||
|
movl 0x100(%ebx,%edx,2), %edx
|
||||||
|
movw %ax, 0x100(%ebx,%edx,2)
|
||||||
|
|
||||||
|
mov %eax, 0x12(,%edx,2)
|
||||||
|
|
||||||
|
mov %cr3, %edx
|
||||||
|
mov %ecx, %cr3
|
||||||
|
movl %cr3, %eax
|
||||||
|
movl %tr3, %eax
|
||||||
|
movl %db3, %ebx
|
||||||
|
movl %dr6, %eax
|
||||||
|
movl %fs, %ecx
|
||||||
|
movl %ebx, %fs
|
||||||
|
|
||||||
|
movsbl 0x1000, %eax
|
||||||
|
movsbw 0x1000, %ax
|
||||||
|
movswl 0x1000, %eax
|
||||||
|
|
||||||
|
movzbl 0x1000, %eax
|
||||||
|
movzbw 0x1000, %ax
|
||||||
|
movzwl 0x1000, %eax
|
||||||
|
|
||||||
|
movzb 0x1000, %eax
|
||||||
|
movzb 0x1000, %ax
|
||||||
|
|
||||||
|
|
||||||
|
pushl %eax
|
||||||
|
pushw %ax
|
||||||
|
push %eax
|
||||||
|
push %cs
|
||||||
|
push %gs
|
||||||
|
push $1
|
||||||
|
push $100
|
||||||
|
|
||||||
|
popl %eax
|
||||||
|
popw %ax
|
||||||
|
pop %eax
|
||||||
|
pop %ds
|
||||||
|
pop %fs
|
||||||
|
|
||||||
|
xchg %eax, %ecx
|
||||||
|
xchg %edx, %eax
|
||||||
|
xchg %bx, 0x10000
|
||||||
|
xchg 0x10000, %ebx
|
||||||
|
xchg 0x10000, %dl
|
||||||
|
|
||||||
|
in $100, %al
|
||||||
|
in $100, %ax
|
||||||
|
in $100, %eax
|
||||||
|
in %dx, %al
|
||||||
|
in %dx, %ax
|
||||||
|
in %dx, %eax
|
||||||
|
inb %dx
|
||||||
|
inw %dx
|
||||||
|
inl %dx
|
||||||
|
|
||||||
|
out %al, $100
|
||||||
|
out %ax, $100
|
||||||
|
out %eax, $100
|
||||||
|
|
||||||
|
/* NOTE: gas is bugged here, so size must be added */
|
||||||
|
outb %al, %dx
|
||||||
|
outw %ax, %dx
|
||||||
|
outl %eax, %dx
|
||||||
|
|
||||||
|
leal 0x1000(%ebx), %ecx
|
||||||
|
lea 0x1000(%ebx), %ecx
|
||||||
|
|
||||||
|
les 0x2000, %eax
|
||||||
|
lds 0x2000, %ebx
|
||||||
|
lfs 0x2000, %ecx
|
||||||
|
lgs 0x2000, %edx
|
||||||
|
lss 0x2000, %edx
|
||||||
|
|
||||||
|
addl $0x123, %eax
|
||||||
|
add $0x123, %ebx
|
||||||
|
addl $0x123, 0x100
|
||||||
|
addl $0x123, 0x100(%ebx)
|
||||||
|
addl $0x123, 0x100(%ebx,%edx,2)
|
||||||
|
addl $0x123, 0x100(%esp)
|
||||||
|
addl $0x123, (%ebp)
|
||||||
|
addl $0x123, (%esp)
|
||||||
|
cmpl $0x123, (%esp)
|
||||||
|
|
||||||
|
add %eax, (%ebx)
|
||||||
|
add (%ebx), %eax
|
||||||
|
|
||||||
|
or %dx, (%ebx)
|
||||||
|
or (%ebx), %si
|
||||||
|
|
||||||
|
add %cl, (%ebx)
|
||||||
|
add (%ebx), %dl
|
||||||
|
|
||||||
|
inc %edx
|
||||||
|
incl 0x10000
|
||||||
|
incb 0x10000
|
||||||
|
dec %dx
|
||||||
|
|
||||||
|
test $1, %al
|
||||||
|
test $1, %cl
|
||||||
|
|
||||||
|
testl $1, 0x1000
|
||||||
|
testb $1, 0x1000
|
||||||
|
testw $1, 0x1000
|
||||||
|
test %eax, %ebx
|
||||||
|
test %eax, 0x1000
|
||||||
|
test 0x1000, %edx
|
||||||
|
|
||||||
|
not %edx
|
||||||
|
notw 0x10000
|
||||||
|
notl 0x10000
|
||||||
|
notb 0x10000
|
||||||
|
|
||||||
|
neg %edx
|
||||||
|
negw 0x10000
|
||||||
|
negl 0x10000
|
||||||
|
negb 0x10000
|
||||||
|
|
||||||
|
imul %ecx
|
||||||
|
mul %edx
|
||||||
|
mulb %cl
|
||||||
|
|
||||||
|
imul %eax, %ecx
|
||||||
|
imul 0x1000, %cx
|
||||||
|
imul $10, %eax, %ecx
|
||||||
|
imul $10, %ax, %cx
|
||||||
|
imul $10, %eax
|
||||||
|
imul $0x1100000, %eax
|
||||||
|
imul $1, %eax
|
||||||
|
|
||||||
|
idivw 0x1000
|
||||||
|
div %ecx
|
||||||
|
div %bl
|
||||||
|
div %ecx, %eax
|
||||||
|
|
||||||
|
|
||||||
|
shl %edx
|
||||||
|
shl $10, %edx
|
||||||
|
shl %cl, %edx
|
||||||
|
|
||||||
|
shld $1, %eax, %edx
|
||||||
|
shld %cl, %eax, %edx
|
||||||
|
shld %eax, %edx
|
||||||
|
|
||||||
|
shrd $1, %eax, %edx
|
||||||
|
shrd %cl, %eax, %edx
|
||||||
|
shrd %eax, %edx
|
||||||
|
|
||||||
|
L4:
|
||||||
|
call 0x1000
|
||||||
|
call L4
|
||||||
|
call *%eax
|
||||||
|
call *0x1000
|
||||||
|
call func1
|
||||||
|
|
||||||
|
lcall $0x100, $0x1000
|
||||||
|
|
||||||
|
jmp 0x1000
|
||||||
|
jmp *%eax
|
||||||
|
jmp *0x1000
|
||||||
|
|
||||||
|
ljmp $0x100, $0x1000
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
ret $10
|
||||||
|
|
||||||
|
lret
|
||||||
|
|
||||||
|
lret $10
|
||||||
|
|
||||||
|
enter $1234, $10
|
||||||
|
|
||||||
|
L3:
|
||||||
|
jo 0x1000
|
||||||
|
jnp 0x1001
|
||||||
|
jne 0x1002
|
||||||
|
jg 0x1003
|
||||||
|
|
||||||
|
jo L3
|
||||||
|
jnp L3
|
||||||
|
jne L3
|
||||||
|
jg L3
|
||||||
|
|
||||||
|
loopne L3
|
||||||
|
loopnz L3
|
||||||
|
loope L3
|
||||||
|
loopz L3
|
||||||
|
loop L3
|
||||||
|
jecxz L3
|
||||||
|
|
||||||
|
|
||||||
|
seto %al
|
||||||
|
setnp 0x1000
|
||||||
|
setl 0xaaaa
|
||||||
|
setg %dl
|
||||||
|
|
||||||
|
fadd
|
||||||
|
fadd %st(1), %st
|
||||||
|
fadd %st(3)
|
||||||
|
|
||||||
|
faddp %st(5)
|
||||||
|
faddp
|
||||||
|
faddp %st(1), %st
|
||||||
|
|
||||||
|
fadds 0x1000
|
||||||
|
fiadds 0x1002
|
||||||
|
faddl 0x1004
|
||||||
|
fiaddl 0x1006
|
||||||
|
|
||||||
|
fmul
|
||||||
|
fmul %st(1), %st
|
||||||
|
fmul %st(3)
|
||||||
|
|
||||||
|
fmulp %st(5)
|
||||||
|
fmulp
|
||||||
|
fmulp %st(1), %st
|
||||||
|
|
||||||
|
fmuls 0x1000
|
||||||
|
fimuls 0x1002
|
||||||
|
fmull 0x1004
|
||||||
|
fimull 0x1006
|
||||||
|
|
||||||
|
fsub
|
||||||
|
fsub %st(1), %st
|
||||||
|
fsub %st(3)
|
||||||
|
|
||||||
|
fsubp %st(5)
|
||||||
|
fsubp
|
||||||
|
fsubp %st(1), %st
|
||||||
|
|
||||||
|
fsubs 0x1000
|
||||||
|
fisubs 0x1002
|
||||||
|
fsubl 0x1004
|
||||||
|
fisubl 0x1006
|
||||||
|
|
||||||
|
fsubr
|
||||||
|
fsubr %st(1), %st
|
||||||
|
fsubr %st(3)
|
||||||
|
|
||||||
|
fsubrp %st(5)
|
||||||
|
fsubrp
|
||||||
|
fsubrp %st(1), %st
|
||||||
|
|
||||||
|
fsubrs 0x1000
|
||||||
|
fisubrs 0x1002
|
||||||
|
fsubrl 0x1004
|
||||||
|
fisubrl 0x1006
|
||||||
|
|
||||||
|
fdiv
|
||||||
|
fdiv %st(1), %st
|
||||||
|
fdiv %st(3)
|
||||||
|
|
||||||
|
fdivp %st(5)
|
||||||
|
fdivp
|
||||||
|
fdivp %st(1), %st
|
||||||
|
|
||||||
|
fdivs 0x1000
|
||||||
|
fidivs 0x1002
|
||||||
|
fdivl 0x1004
|
||||||
|
fidivl 0x1006
|
||||||
|
|
||||||
|
fcom %st(3)
|
||||||
|
|
||||||
|
fcoms 0x1000
|
||||||
|
ficoms 0x1002
|
||||||
|
fcoml 0x1004
|
||||||
|
ficoml 0x1006
|
||||||
|
|
||||||
|
fcomp %st(5)
|
||||||
|
fcomp
|
||||||
|
fcompp
|
||||||
|
|
||||||
|
fcomps 0x1000
|
||||||
|
ficomps 0x1002
|
||||||
|
fcompl 0x1004
|
||||||
|
ficompl 0x1006
|
||||||
|
|
||||||
|
fld %st(5)
|
||||||
|
fldl 0x1000
|
||||||
|
flds 0x1002
|
||||||
|
fildl 0x1004
|
||||||
|
fst %st(4)
|
||||||
|
fstp %st(6)
|
||||||
|
fstpt 0x1006
|
||||||
|
fbstp 0x1008
|
||||||
|
|
||||||
|
fxch
|
||||||
|
fxch %st(4)
|
||||||
|
|
||||||
|
fucom %st(6)
|
||||||
|
fucomp %st(3)
|
||||||
|
fucompp
|
||||||
|
|
||||||
|
finit
|
||||||
|
fninit
|
||||||
|
fldcw 0x1000
|
||||||
|
fnstcw 0x1002
|
||||||
|
fstcw 0x1002
|
||||||
|
fnstsw 0x1004
|
||||||
|
fnstsw %eax
|
||||||
|
fstsw 0x1004
|
||||||
|
fstsw %eax
|
||||||
|
fnclex
|
||||||
|
fclex
|
||||||
|
fnstenv 0x1000
|
||||||
|
fstenv 0x1000
|
||||||
|
fldenv 0x1000
|
||||||
|
fnsave 0x1002
|
||||||
|
fsave 0x1000
|
||||||
|
frstor 0x1000
|
||||||
|
ffree %st(7)
|
||||||
|
ffreep %st(6)
|
||||||
|
|
||||||
|
ftst
|
||||||
|
fxam
|
||||||
|
fld1
|
||||||
|
fldl2t
|
||||||
|
fldl2e
|
||||||
|
fldpi
|
||||||
|
fldlg2
|
||||||
|
fldln2
|
||||||
|
fldz
|
||||||
|
|
||||||
|
f2xm1
|
||||||
|
fyl2x
|
||||||
|
fptan
|
||||||
|
fpatan
|
||||||
|
fxtract
|
||||||
|
fprem1
|
||||||
|
fdecstp
|
||||||
|
fincstp
|
||||||
|
fprem
|
||||||
|
fyl2xp1
|
||||||
|
fsqrt
|
||||||
|
fsincos
|
||||||
|
frndint
|
||||||
|
fscale
|
||||||
|
fsin
|
||||||
|
fcos
|
||||||
|
fchs
|
||||||
|
fabs
|
||||||
|
fnop
|
||||||
|
fwait
|
||||||
|
|
||||||
|
bswap %edx
|
||||||
|
xadd %ecx, %edx
|
||||||
|
xaddb %dl, 0x1000
|
||||||
|
xaddw %ax, 0x1000
|
||||||
|
xaddl %eax, 0x1000
|
||||||
|
cmpxchg %ecx, %edx
|
||||||
|
cmpxchgb %dl, 0x1000
|
||||||
|
cmpxchgw %ax, 0x1000
|
||||||
|
cmpxchgl %eax, 0x1000
|
||||||
|
invlpg 0x1000
|
||||||
|
cmpxchg8b 0x1002
|
||||||
|
|
||||||
|
fcmovb %st(5), %st
|
||||||
|
fcmove %st(5), %st
|
||||||
|
fcmovbe %st(5), %st
|
||||||
|
fcmovu %st(5), %st
|
||||||
|
fcmovnb %st(5), %st
|
||||||
|
fcmovne %st(5), %st
|
||||||
|
fcmovnbe %st(5), %st
|
||||||
|
fcmovnu %st(5), %st
|
||||||
|
fcomi %st(5), %st
|
||||||
|
fucomi %st(5), %st
|
||||||
|
fcomip %st(5), %st
|
||||||
|
fucomip %st(5), %st
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cmovo 0x1000, %eax
|
||||||
|
cmovs 0x1000, %eax
|
||||||
|
cmovns %edx, %edi
|
||||||
|
|
||||||
|
int $3
|
||||||
|
int $0x10
|
||||||
|
|
||||||
|
pusha
|
||||||
|
popa
|
||||||
|
clc
|
||||||
|
cld
|
||||||
|
cli
|
||||||
|
clts
|
||||||
|
cmc
|
||||||
|
lahf
|
||||||
|
sahf
|
||||||
|
pushfl
|
||||||
|
popfl
|
||||||
|
pushf
|
||||||
|
popf
|
||||||
|
stc
|
||||||
|
std
|
||||||
|
sti
|
||||||
|
aaa
|
||||||
|
aas
|
||||||
|
daa
|
||||||
|
das
|
||||||
|
aad
|
||||||
|
aam
|
||||||
|
cbw
|
||||||
|
cwd
|
||||||
|
cwde
|
||||||
|
cdq
|
||||||
|
cbtw
|
||||||
|
cwtd
|
||||||
|
cwtl
|
||||||
|
cltd
|
||||||
|
leave
|
||||||
|
int3
|
||||||
|
into
|
||||||
|
iret
|
||||||
|
rsm
|
||||||
|
hlt
|
||||||
|
wait
|
||||||
|
nop
|
||||||
|
|
||||||
|
/* XXX: handle prefixes */
|
||||||
|
#if 0
|
||||||
|
aword
|
||||||
|
addr16
|
||||||
|
#endif
|
||||||
|
lock
|
||||||
|
rep
|
||||||
|
repe
|
||||||
|
repz
|
||||||
|
repne
|
||||||
|
repnz
|
||||||
|
|
||||||
|
invd
|
||||||
|
wbinvd
|
||||||
|
cpuid
|
||||||
|
wrmsr
|
||||||
|
rdtsc
|
||||||
|
rdmsr
|
||||||
|
rdpmc
|
||||||
|
ud2
|
||||||
|
|
||||||
|
emms
|
||||||
|
movd %edx, %mm3
|
||||||
|
movd 0x1000, %mm2
|
||||||
|
movd %mm4, %ecx
|
||||||
|
movd %mm5, 0x1000
|
||||||
|
|
||||||
|
movq 0x1000, %mm2
|
||||||
|
movq %mm4, 0x1000
|
||||||
|
|
||||||
|
pand 0x1000, %mm3
|
||||||
|
pand %mm4, %mm5
|
||||||
|
|
||||||
|
psllw $1, %mm6
|
||||||
|
psllw 0x1000, %mm7
|
||||||
|
psllw %mm2, %mm7
|
||||||
|
|
||||||
|
xlat
|
||||||
|
cmpsb
|
||||||
|
scmpw
|
||||||
|
insl
|
||||||
|
outsw
|
||||||
|
lodsb
|
||||||
|
slodl
|
||||||
|
movsb
|
||||||
|
movsl
|
||||||
|
smovb
|
||||||
|
scasb
|
||||||
|
sscaw
|
||||||
|
stosw
|
||||||
|
sstol
|
||||||
|
|
||||||
|
bsf 0x1000, %ebx
|
||||||
|
bsr 0x1000, %ebx
|
||||||
|
bt %edx, 0x1000
|
||||||
|
btl $2, 0x1000
|
||||||
|
btc %edx, 0x1000
|
||||||
|
btcl $2, 0x1000
|
||||||
|
btr %edx, 0x1000
|
||||||
|
btrl $2, 0x1000
|
||||||
|
bts %edx, 0x1000
|
||||||
|
btsl $2, 0x1000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
boundl %edx, 0x10000
|
||||||
|
boundw %bx, 0x1000
|
||||||
|
|
||||||
|
arpl %bx, 0x1000
|
||||||
|
lar 0x1000, %eax
|
||||||
|
lgdt 0x1000
|
||||||
|
lidt 0x1000
|
||||||
|
lldt 0x1000
|
||||||
|
lmsw 0x1000
|
||||||
|
lsl 0x1000, %ecx
|
||||||
|
ltr 0x1000
|
||||||
|
|
||||||
|
sgdt 0x1000
|
||||||
|
sidt 0x1000
|
||||||
|
sldt 0x1000
|
||||||
|
smsw 0x1000
|
||||||
|
str 0x1000
|
||||||
|
|
||||||
|
verr 0x1000
|
||||||
|
verw 0x1000
|
||||||
|
|
||||||
|
push %ds
|
||||||
|
pushw %ds
|
||||||
|
pushl %ds
|
||||||
|
pop %ds
|
||||||
|
popw %ds
|
||||||
|
popl %ds
|
||||||
|
fxsave 1(%ebx)
|
||||||
|
fxrstor 1(%ecx)
|
||||||
|
pushl $1
|
||||||
|
pushw $1
|
||||||
|
push $1
|
||||||
868
bazaar/Tcc/lib/bcheck.c
Normal file
868
bazaar/Tcc/lib/bcheck.c
Normal file
|
|
@ -0,0 +1,868 @@
|
||||||
|
/*
|
||||||
|
* Tiny C Memory and bounds checker
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002 Fabrice Bellard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <string.h>
|
||||||
|
#if !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__OpenBSD__)
|
||||||
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//#define BOUND_DEBUG
|
||||||
|
|
||||||
|
/* define so that bound array is static (faster, but use memory if
|
||||||
|
bound checking not used) */
|
||||||
|
//#define BOUND_STATIC
|
||||||
|
|
||||||
|
/* use malloc hooks. Currently the code cannot be reliable if no hooks */
|
||||||
|
#define CONFIG_TCC_MALLOC_HOOKS
|
||||||
|
|
||||||
|
#define HAVE_MEMALIGN
|
||||||
|
|
||||||
|
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__dietlibc__) \
|
||||||
|
|| defined(__UCLIBC__) || defined(__OpenBSD__)
|
||||||
|
#warning Bound checking not fully supported in this environment.
|
||||||
|
#undef CONFIG_TCC_MALLOC_HOOKS
|
||||||
|
#undef HAVE_MEMALIGN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define BOUND_T1_BITS 13
|
||||||
|
#define BOUND_T2_BITS 11
|
||||||
|
#define BOUND_T3_BITS (32 - BOUND_T1_BITS - BOUND_T2_BITS)
|
||||||
|
|
||||||
|
#define BOUND_T1_SIZE (1 << BOUND_T1_BITS)
|
||||||
|
#define BOUND_T2_SIZE (1 << BOUND_T2_BITS)
|
||||||
|
#define BOUND_T3_SIZE (1 << BOUND_T3_BITS)
|
||||||
|
#define BOUND_E_BITS 4
|
||||||
|
|
||||||
|
#define BOUND_T23_BITS (BOUND_T2_BITS + BOUND_T3_BITS)
|
||||||
|
#define BOUND_T23_SIZE (1 << BOUND_T23_BITS)
|
||||||
|
|
||||||
|
|
||||||
|
/* this pointer is generated when bound check is incorrect */
|
||||||
|
#define INVALID_POINTER ((void *)(-2))
|
||||||
|
/* size of an empty region */
|
||||||
|
#define EMPTY_SIZE 0xffffffff
|
||||||
|
/* size of an invalid region */
|
||||||
|
#define INVALID_SIZE 0
|
||||||
|
|
||||||
|
typedef struct BoundEntry {
|
||||||
|
unsigned long start;
|
||||||
|
unsigned long size;
|
||||||
|
struct BoundEntry *next;
|
||||||
|
unsigned long is_invalid; /* true if pointers outside region are invalid */
|
||||||
|
} BoundEntry;
|
||||||
|
|
||||||
|
/* external interface */
|
||||||
|
void __bound_init(void);
|
||||||
|
void __bound_new_region(void *p, unsigned long size);
|
||||||
|
int __bound_delete_region(void *p);
|
||||||
|
|
||||||
|
#define FASTCALL __attribute__((regparm(3)))
|
||||||
|
|
||||||
|
void *__bound_malloc(size_t size, const void *caller);
|
||||||
|
void *__bound_memalign(size_t size, size_t align, const void *caller);
|
||||||
|
void __bound_free(void *ptr, const void *caller);
|
||||||
|
void *__bound_realloc(void *ptr, size_t size, const void *caller);
|
||||||
|
static void *libc_malloc(size_t size);
|
||||||
|
static void libc_free(void *ptr);
|
||||||
|
static void install_malloc_hooks(void);
|
||||||
|
static void restore_malloc_hooks(void);
|
||||||
|
|
||||||
|
#ifdef CONFIG_TCC_MALLOC_HOOKS
|
||||||
|
static void *saved_malloc_hook;
|
||||||
|
static void *saved_free_hook;
|
||||||
|
static void *saved_realloc_hook;
|
||||||
|
static void *saved_memalign_hook;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* linker definitions */
|
||||||
|
extern char _end;
|
||||||
|
|
||||||
|
/* TCC definitions */
|
||||||
|
extern char __bounds_start; /* start of static bounds table */
|
||||||
|
/* error message, just for TCC */
|
||||||
|
const char *__bound_error_msg;
|
||||||
|
|
||||||
|
/* runtime error output */
|
||||||
|
extern void rt_error(unsigned long pc, const char *fmt, ...);
|
||||||
|
|
||||||
|
#ifdef BOUND_STATIC
|
||||||
|
static BoundEntry *__bound_t1[BOUND_T1_SIZE]; /* page table */
|
||||||
|
#else
|
||||||
|
static BoundEntry **__bound_t1; /* page table */
|
||||||
|
#endif
|
||||||
|
static BoundEntry *__bound_empty_t2; /* empty page, for unused pages */
|
||||||
|
static BoundEntry *__bound_invalid_t2; /* invalid page, for invalid pointers */
|
||||||
|
|
||||||
|
static BoundEntry *__bound_find_region(BoundEntry *e1, void *p)
|
||||||
|
{
|
||||||
|
unsigned long addr, tmp;
|
||||||
|
BoundEntry *e;
|
||||||
|
|
||||||
|
e = e1;
|
||||||
|
while (e != NULL) {
|
||||||
|
addr = (unsigned long)p;
|
||||||
|
addr -= e->start;
|
||||||
|
if (addr <= e->size) {
|
||||||
|
/* put region at the head */
|
||||||
|
tmp = e1->start;
|
||||||
|
e1->start = e->start;
|
||||||
|
e->start = tmp;
|
||||||
|
tmp = e1->size;
|
||||||
|
e1->size = e->size;
|
||||||
|
e->size = tmp;
|
||||||
|
return e1;
|
||||||
|
}
|
||||||
|
e = e->next;
|
||||||
|
}
|
||||||
|
/* no entry found: return empty entry or invalid entry */
|
||||||
|
if (e1->is_invalid)
|
||||||
|
return __bound_invalid_t2;
|
||||||
|
else
|
||||||
|
return __bound_empty_t2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* print a bound error message */
|
||||||
|
static void bound_error(const char *fmt, ...)
|
||||||
|
{
|
||||||
|
__bound_error_msg = fmt;
|
||||||
|
*(int *)0 = 0; /* force a runtime error */
|
||||||
|
}
|
||||||
|
|
||||||
|
static void bound_alloc_error(void)
|
||||||
|
{
|
||||||
|
bound_error("not enough memory for bound checking code");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* currently, tcc cannot compile that because we use GNUC extensions */
|
||||||
|
#if !defined(__TINYC__)
|
||||||
|
|
||||||
|
/* return '(p + offset)' for pointer arithmetic (a pointer can reach
|
||||||
|
the end of a region in this case */
|
||||||
|
void * FASTCALL __bound_ptr_add(void *p, int offset)
|
||||||
|
{
|
||||||
|
unsigned long addr = (unsigned long)p;
|
||||||
|
BoundEntry *e;
|
||||||
|
#if defined(BOUND_DEBUG)
|
||||||
|
printf("add: 0x%x %d\n", (int)p, offset);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
e = __bound_t1[addr >> (BOUND_T2_BITS + BOUND_T3_BITS)];
|
||||||
|
e = (BoundEntry *)((char *)e +
|
||||||
|
((addr >> (BOUND_T3_BITS - BOUND_E_BITS)) &
|
||||||
|
((BOUND_T2_SIZE - 1) << BOUND_E_BITS)));
|
||||||
|
addr -= e->start;
|
||||||
|
if (addr > e->size) {
|
||||||
|
e = __bound_find_region(e, p);
|
||||||
|
addr = (unsigned long)p - e->start;
|
||||||
|
}
|
||||||
|
addr += offset;
|
||||||
|
if (addr > e->size)
|
||||||
|
return INVALID_POINTER; /* return an invalid pointer */
|
||||||
|
return p + offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return '(p + offset)' for pointer indirection (the resulting must
|
||||||
|
be strictly inside the region */
|
||||||
|
#define BOUND_PTR_INDIR(dsize) \
|
||||||
|
void * FASTCALL __bound_ptr_indir ## dsize (void *p, int offset) \
|
||||||
|
{ \
|
||||||
|
unsigned long addr = (unsigned long)p; \
|
||||||
|
BoundEntry *e; \
|
||||||
|
\
|
||||||
|
e = __bound_t1[addr >> (BOUND_T2_BITS + BOUND_T3_BITS)]; \
|
||||||
|
e = (BoundEntry *)((char *)e + \
|
||||||
|
((addr >> (BOUND_T3_BITS - BOUND_E_BITS)) & \
|
||||||
|
((BOUND_T2_SIZE - 1) << BOUND_E_BITS))); \
|
||||||
|
addr -= e->start; \
|
||||||
|
if (addr > e->size) { \
|
||||||
|
e = __bound_find_region(e, p); \
|
||||||
|
addr = (unsigned long)p - e->start; \
|
||||||
|
} \
|
||||||
|
addr += offset + dsize; \
|
||||||
|
if (addr > e->size) \
|
||||||
|
return INVALID_POINTER; /* return an invalid pointer */ \
|
||||||
|
return p + offset; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef __i386__
|
||||||
|
/* return the frame pointer of the caller */
|
||||||
|
#define GET_CALLER_FP(fp)\
|
||||||
|
{\
|
||||||
|
unsigned long *fp1;\
|
||||||
|
__asm__ __volatile__ ("movl %%ebp,%0" :"=g" (fp1));\
|
||||||
|
fp = fp1[0];\
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#error put code to extract the calling frame pointer
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* called when entering a function to add all the local regions */
|
||||||
|
void FASTCALL __bound_local_new(void *p1)
|
||||||
|
{
|
||||||
|
unsigned long addr, size, fp, *p = p1;
|
||||||
|
GET_CALLER_FP(fp);
|
||||||
|
for(;;) {
|
||||||
|
addr = p[0];
|
||||||
|
if (addr == 0)
|
||||||
|
break;
|
||||||
|
addr += fp;
|
||||||
|
size = p[1];
|
||||||
|
p += 2;
|
||||||
|
__bound_new_region((void *)addr, size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* called when leaving a function to delete all the local regions */
|
||||||
|
void FASTCALL __bound_local_delete(void *p1)
|
||||||
|
{
|
||||||
|
unsigned long addr, fp, *p = p1;
|
||||||
|
GET_CALLER_FP(fp);
|
||||||
|
for(;;) {
|
||||||
|
addr = p[0];
|
||||||
|
if (addr == 0)
|
||||||
|
break;
|
||||||
|
addr += fp;
|
||||||
|
p += 2;
|
||||||
|
__bound_delete_region((void *)addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
void __bound_local_new(void *p)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void __bound_local_delete(void *p)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void *__bound_ptr_add(void *p, int offset)
|
||||||
|
{
|
||||||
|
return p + offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define BOUND_PTR_INDIR(dsize) \
|
||||||
|
void *__bound_ptr_indir ## dsize (void *p, int offset) \
|
||||||
|
{ \
|
||||||
|
return p + offset; \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
BOUND_PTR_INDIR(1)
|
||||||
|
BOUND_PTR_INDIR(2)
|
||||||
|
BOUND_PTR_INDIR(4)
|
||||||
|
BOUND_PTR_INDIR(8)
|
||||||
|
BOUND_PTR_INDIR(12)
|
||||||
|
BOUND_PTR_INDIR(16)
|
||||||
|
|
||||||
|
static BoundEntry *__bound_new_page(void)
|
||||||
|
{
|
||||||
|
BoundEntry *page;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
page = libc_malloc(sizeof(BoundEntry) * BOUND_T2_SIZE);
|
||||||
|
if (!page)
|
||||||
|
bound_alloc_error();
|
||||||
|
for(i=0;i<BOUND_T2_SIZE;i++) {
|
||||||
|
/* put empty entries */
|
||||||
|
page[i].start = 0;
|
||||||
|
page[i].size = EMPTY_SIZE;
|
||||||
|
page[i].next = NULL;
|
||||||
|
page[i].is_invalid = 0;
|
||||||
|
}
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* currently we use malloc(). Should use bound_new_page() */
|
||||||
|
static BoundEntry *bound_new_entry(void)
|
||||||
|
{
|
||||||
|
BoundEntry *e;
|
||||||
|
e = libc_malloc(sizeof(BoundEntry));
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void bound_free_entry(BoundEntry *e)
|
||||||
|
{
|
||||||
|
libc_free(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline BoundEntry *get_page(int index)
|
||||||
|
{
|
||||||
|
BoundEntry *page;
|
||||||
|
page = __bound_t1[index];
|
||||||
|
if (page == __bound_empty_t2 || page == __bound_invalid_t2) {
|
||||||
|
/* create a new page if necessary */
|
||||||
|
page = __bound_new_page();
|
||||||
|
__bound_t1[index] = page;
|
||||||
|
}
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* mark a region as being invalid (can only be used during init) */
|
||||||
|
static void mark_invalid(unsigned long addr, unsigned long size)
|
||||||
|
{
|
||||||
|
unsigned long start, end;
|
||||||
|
BoundEntry *page;
|
||||||
|
int t1_start, t1_end, i, j, t2_start, t2_end;
|
||||||
|
|
||||||
|
start = addr;
|
||||||
|
end = addr + size;
|
||||||
|
|
||||||
|
t2_start = (start + BOUND_T3_SIZE - 1) >> BOUND_T3_BITS;
|
||||||
|
if (end != 0)
|
||||||
|
t2_end = end >> BOUND_T3_BITS;
|
||||||
|
else
|
||||||
|
t2_end = 1 << (BOUND_T1_BITS + BOUND_T2_BITS);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
printf("mark_invalid: start = %x %x\n", t2_start, t2_end);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* first we handle full pages */
|
||||||
|
t1_start = (t2_start + BOUND_T2_SIZE - 1) >> BOUND_T2_BITS;
|
||||||
|
t1_end = t2_end >> BOUND_T2_BITS;
|
||||||
|
|
||||||
|
i = t2_start & (BOUND_T2_SIZE - 1);
|
||||||
|
j = t2_end & (BOUND_T2_SIZE - 1);
|
||||||
|
|
||||||
|
if (t1_start == t1_end) {
|
||||||
|
page = get_page(t2_start >> BOUND_T2_BITS);
|
||||||
|
for(; i < j; i++) {
|
||||||
|
page[i].size = INVALID_SIZE;
|
||||||
|
page[i].is_invalid = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (i > 0) {
|
||||||
|
page = get_page(t2_start >> BOUND_T2_BITS);
|
||||||
|
for(; i < BOUND_T2_SIZE; i++) {
|
||||||
|
page[i].size = INVALID_SIZE;
|
||||||
|
page[i].is_invalid = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(i = t1_start; i < t1_end; i++) {
|
||||||
|
__bound_t1[i] = __bound_invalid_t2;
|
||||||
|
}
|
||||||
|
if (j != 0) {
|
||||||
|
page = get_page(t1_end);
|
||||||
|
for(i = 0; i < j; i++) {
|
||||||
|
page[i].size = INVALID_SIZE;
|
||||||
|
page[i].is_invalid = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void __bound_init(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
BoundEntry *page;
|
||||||
|
unsigned long start, size;
|
||||||
|
int *p;
|
||||||
|
|
||||||
|
/* save malloc hooks and install bound check hooks */
|
||||||
|
install_malloc_hooks();
|
||||||
|
|
||||||
|
#ifndef BOUND_STATIC
|
||||||
|
__bound_t1 = libc_malloc(BOUND_T1_SIZE * sizeof(BoundEntry *));
|
||||||
|
if (!__bound_t1)
|
||||||
|
bound_alloc_error();
|
||||||
|
#endif
|
||||||
|
__bound_empty_t2 = __bound_new_page();
|
||||||
|
for(i=0;i<BOUND_T1_SIZE;i++) {
|
||||||
|
__bound_t1[i] = __bound_empty_t2;
|
||||||
|
}
|
||||||
|
|
||||||
|
page = __bound_new_page();
|
||||||
|
for(i=0;i<BOUND_T2_SIZE;i++) {
|
||||||
|
/* put invalid entries */
|
||||||
|
page[i].start = 0;
|
||||||
|
page[i].size = INVALID_SIZE;
|
||||||
|
page[i].next = NULL;
|
||||||
|
page[i].is_invalid = 1;
|
||||||
|
}
|
||||||
|
__bound_invalid_t2 = page;
|
||||||
|
|
||||||
|
/* invalid pointer zone */
|
||||||
|
start = (unsigned long)INVALID_POINTER & ~(BOUND_T23_SIZE - 1);
|
||||||
|
size = BOUND_T23_SIZE;
|
||||||
|
mark_invalid(start, size);
|
||||||
|
|
||||||
|
#if !defined(__TINYC__) && defined(CONFIG_TCC_MALLOC_HOOKS)
|
||||||
|
/* malloc zone is also marked invalid. can only use that with
|
||||||
|
hooks because all libs should use the same malloc. The solution
|
||||||
|
would be to build a new malloc for tcc. */
|
||||||
|
start = (unsigned long)&_end;
|
||||||
|
size = 128 * 0x100000;
|
||||||
|
mark_invalid(start, size);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* add all static bound check values */
|
||||||
|
p = (int *)&__bounds_start;
|
||||||
|
while (p[0] != 0) {
|
||||||
|
__bound_new_region((void *)p[0], p[1]);
|
||||||
|
p += 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void add_region(BoundEntry *e,
|
||||||
|
unsigned long start, unsigned long size)
|
||||||
|
{
|
||||||
|
BoundEntry *e1;
|
||||||
|
if (e->start == 0) {
|
||||||
|
/* no region : add it */
|
||||||
|
e->start = start;
|
||||||
|
e->size = size;
|
||||||
|
} else {
|
||||||
|
/* already regions in the list: add it at the head */
|
||||||
|
e1 = bound_new_entry();
|
||||||
|
e1->start = e->start;
|
||||||
|
e1->size = e->size;
|
||||||
|
e1->next = e->next;
|
||||||
|
e->start = start;
|
||||||
|
e->size = size;
|
||||||
|
e->next = e1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* create a new region. It should not already exist in the region list */
|
||||||
|
void __bound_new_region(void *p, unsigned long size)
|
||||||
|
{
|
||||||
|
unsigned long start, end;
|
||||||
|
BoundEntry *page, *e, *e2;
|
||||||
|
int t1_start, t1_end, i, t2_start, t2_end;
|
||||||
|
|
||||||
|
start = (unsigned long)p;
|
||||||
|
end = start + size;
|
||||||
|
t1_start = start >> (BOUND_T2_BITS + BOUND_T3_BITS);
|
||||||
|
t1_end = end >> (BOUND_T2_BITS + BOUND_T3_BITS);
|
||||||
|
|
||||||
|
/* start */
|
||||||
|
page = get_page(t1_start);
|
||||||
|
t2_start = (start >> (BOUND_T3_BITS - BOUND_E_BITS)) &
|
||||||
|
((BOUND_T2_SIZE - 1) << BOUND_E_BITS);
|
||||||
|
t2_end = (end >> (BOUND_T3_BITS - BOUND_E_BITS)) &
|
||||||
|
((BOUND_T2_SIZE - 1) << BOUND_E_BITS);
|
||||||
|
#ifdef BOUND_DEBUG
|
||||||
|
printf("new %lx %lx %x %x %x %x\n",
|
||||||
|
start, end, t1_start, t1_end, t2_start, t2_end);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
e = (BoundEntry *)((char *)page + t2_start);
|
||||||
|
add_region(e, start, size);
|
||||||
|
|
||||||
|
if (t1_end == t1_start) {
|
||||||
|
/* same ending page */
|
||||||
|
e2 = (BoundEntry *)((char *)page + t2_end);
|
||||||
|
if (e2 > e) {
|
||||||
|
e++;
|
||||||
|
for(;e<e2;e++) {
|
||||||
|
e->start = start;
|
||||||
|
e->size = size;
|
||||||
|
}
|
||||||
|
add_region(e, start, size);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* mark until end of page */
|
||||||
|
e2 = page + BOUND_T2_SIZE;
|
||||||
|
e++;
|
||||||
|
for(;e<e2;e++) {
|
||||||
|
e->start = start;
|
||||||
|
e->size = size;
|
||||||
|
}
|
||||||
|
/* mark intermediate pages, if any */
|
||||||
|
for(i=t1_start+1;i<t1_end;i++) {
|
||||||
|
page = get_page(i);
|
||||||
|
e2 = page + BOUND_T2_SIZE;
|
||||||
|
for(e=page;e<e2;e++) {
|
||||||
|
e->start = start;
|
||||||
|
e->size = size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* last page */
|
||||||
|
page = get_page(t1_end);
|
||||||
|
e2 = (BoundEntry *)((char *)page + t2_end);
|
||||||
|
for(e=page;e<e2;e++) {
|
||||||
|
e->start = start;
|
||||||
|
e->size = size;
|
||||||
|
}
|
||||||
|
add_region(e, start, size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* delete a region */
|
||||||
|
static inline void delete_region(BoundEntry *e,
|
||||||
|
void *p, unsigned long empty_size)
|
||||||
|
{
|
||||||
|
unsigned long addr;
|
||||||
|
BoundEntry *e1;
|
||||||
|
|
||||||
|
addr = (unsigned long)p;
|
||||||
|
addr -= e->start;
|
||||||
|
if (addr <= e->size) {
|
||||||
|
/* region found is first one */
|
||||||
|
e1 = e->next;
|
||||||
|
if (e1 == NULL) {
|
||||||
|
/* no more region: mark it empty */
|
||||||
|
e->start = 0;
|
||||||
|
e->size = empty_size;
|
||||||
|
} else {
|
||||||
|
/* copy next region in head */
|
||||||
|
e->start = e1->start;
|
||||||
|
e->size = e1->size;
|
||||||
|
e->next = e1->next;
|
||||||
|
bound_free_entry(e1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* find the matching region */
|
||||||
|
for(;;) {
|
||||||
|
e1 = e;
|
||||||
|
e = e->next;
|
||||||
|
/* region not found: do nothing */
|
||||||
|
if (e == NULL)
|
||||||
|
break;
|
||||||
|
addr = (unsigned long)p - e->start;
|
||||||
|
if (addr <= e->size) {
|
||||||
|
/* found: remove entry */
|
||||||
|
e1->next = e->next;
|
||||||
|
bound_free_entry(e);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* WARNING: 'p' must be the starting point of the region. */
|
||||||
|
/* return non zero if error */
|
||||||
|
int __bound_delete_region(void *p)
|
||||||
|
{
|
||||||
|
unsigned long start, end, addr, size, empty_size;
|
||||||
|
BoundEntry *page, *e, *e2;
|
||||||
|
int t1_start, t1_end, t2_start, t2_end, i;
|
||||||
|
|
||||||
|
start = (unsigned long)p;
|
||||||
|
t1_start = start >> (BOUND_T2_BITS + BOUND_T3_BITS);
|
||||||
|
t2_start = (start >> (BOUND_T3_BITS - BOUND_E_BITS)) &
|
||||||
|
((BOUND_T2_SIZE - 1) << BOUND_E_BITS);
|
||||||
|
|
||||||
|
/* find region size */
|
||||||
|
page = __bound_t1[t1_start];
|
||||||
|
e = (BoundEntry *)((char *)page + t2_start);
|
||||||
|
addr = start - e->start;
|
||||||
|
if (addr > e->size)
|
||||||
|
e = __bound_find_region(e, p);
|
||||||
|
/* test if invalid region */
|
||||||
|
if (e->size == EMPTY_SIZE || (unsigned long)p != e->start)
|
||||||
|
return -1;
|
||||||
|
/* compute the size we put in invalid regions */
|
||||||
|
if (e->is_invalid)
|
||||||
|
empty_size = INVALID_SIZE;
|
||||||
|
else
|
||||||
|
empty_size = EMPTY_SIZE;
|
||||||
|
size = e->size;
|
||||||
|
end = start + size;
|
||||||
|
|
||||||
|
/* now we can free each entry */
|
||||||
|
t1_end = end >> (BOUND_T2_BITS + BOUND_T3_BITS);
|
||||||
|
t2_end = (end >> (BOUND_T3_BITS - BOUND_E_BITS)) &
|
||||||
|
((BOUND_T2_SIZE - 1) << BOUND_E_BITS);
|
||||||
|
|
||||||
|
delete_region(e, p, empty_size);
|
||||||
|
if (t1_end == t1_start) {
|
||||||
|
/* same ending page */
|
||||||
|
e2 = (BoundEntry *)((char *)page + t2_end);
|
||||||
|
if (e2 > e) {
|
||||||
|
e++;
|
||||||
|
for(;e<e2;e++) {
|
||||||
|
e->start = 0;
|
||||||
|
e->size = empty_size;
|
||||||
|
}
|
||||||
|
delete_region(e, p, empty_size);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* mark until end of page */
|
||||||
|
e2 = page + BOUND_T2_SIZE;
|
||||||
|
e++;
|
||||||
|
for(;e<e2;e++) {
|
||||||
|
e->start = 0;
|
||||||
|
e->size = empty_size;
|
||||||
|
}
|
||||||
|
/* mark intermediate pages, if any */
|
||||||
|
/* XXX: should free them */
|
||||||
|
for(i=t1_start+1;i<t1_end;i++) {
|
||||||
|
page = get_page(i);
|
||||||
|
e2 = page + BOUND_T2_SIZE;
|
||||||
|
for(e=page;e<e2;e++) {
|
||||||
|
e->start = 0;
|
||||||
|
e->size = empty_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* last page */
|
||||||
|
page = get_page(t2_end);
|
||||||
|
e2 = (BoundEntry *)((char *)page + t2_end);
|
||||||
|
for(e=page;e<e2;e++) {
|
||||||
|
e->start = 0;
|
||||||
|
e->size = empty_size;
|
||||||
|
}
|
||||||
|
delete_region(e, p, empty_size);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return the size of the region starting at p, or EMPTY_SIZE if non
|
||||||
|
existant region. */
|
||||||
|
static unsigned long get_region_size(void *p)
|
||||||
|
{
|
||||||
|
unsigned long addr = (unsigned long)p;
|
||||||
|
BoundEntry *e;
|
||||||
|
|
||||||
|
e = __bound_t1[addr >> (BOUND_T2_BITS + BOUND_T3_BITS)];
|
||||||
|
e = (BoundEntry *)((char *)e +
|
||||||
|
((addr >> (BOUND_T3_BITS - BOUND_E_BITS)) &
|
||||||
|
((BOUND_T2_SIZE - 1) << BOUND_E_BITS)));
|
||||||
|
addr -= e->start;
|
||||||
|
if (addr > e->size)
|
||||||
|
e = __bound_find_region(e, p);
|
||||||
|
if (e->start != (unsigned long)p)
|
||||||
|
return EMPTY_SIZE;
|
||||||
|
return e->size;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* patched memory functions */
|
||||||
|
|
||||||
|
static void install_malloc_hooks(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_TCC_MALLOC_HOOKS
|
||||||
|
saved_malloc_hook = __malloc_hook;
|
||||||
|
saved_free_hook = __free_hook;
|
||||||
|
saved_realloc_hook = __realloc_hook;
|
||||||
|
saved_memalign_hook = __memalign_hook;
|
||||||
|
__malloc_hook = __bound_malloc;
|
||||||
|
__free_hook = __bound_free;
|
||||||
|
__realloc_hook = __bound_realloc;
|
||||||
|
__memalign_hook = __bound_memalign;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void restore_malloc_hooks(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_TCC_MALLOC_HOOKS
|
||||||
|
__malloc_hook = saved_malloc_hook;
|
||||||
|
__free_hook = saved_free_hook;
|
||||||
|
__realloc_hook = saved_realloc_hook;
|
||||||
|
__memalign_hook = saved_memalign_hook;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *libc_malloc(size_t size)
|
||||||
|
{
|
||||||
|
void *ptr;
|
||||||
|
restore_malloc_hooks();
|
||||||
|
ptr = malloc(size);
|
||||||
|
install_malloc_hooks();
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void libc_free(void *ptr)
|
||||||
|
{
|
||||||
|
restore_malloc_hooks();
|
||||||
|
free(ptr);
|
||||||
|
install_malloc_hooks();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* XXX: we should use a malloc which ensure that it is unlikely that
|
||||||
|
two malloc'ed data have the same address if 'free' are made in
|
||||||
|
between. */
|
||||||
|
void *__bound_malloc(size_t size, const void *caller)
|
||||||
|
{
|
||||||
|
void *ptr;
|
||||||
|
|
||||||
|
/* we allocate one more byte to ensure the regions will be
|
||||||
|
separated by at least one byte. With the glibc malloc, it may
|
||||||
|
be in fact not necessary */
|
||||||
|
ptr = libc_malloc(size + 1);
|
||||||
|
|
||||||
|
if (!ptr)
|
||||||
|
return NULL;
|
||||||
|
__bound_new_region(ptr, size);
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *__bound_memalign(size_t size, size_t align, const void *caller)
|
||||||
|
{
|
||||||
|
void *ptr;
|
||||||
|
|
||||||
|
restore_malloc_hooks();
|
||||||
|
|
||||||
|
#ifndef HAVE_MEMALIGN
|
||||||
|
if (align > 4) {
|
||||||
|
/* XXX: handle it ? */
|
||||||
|
ptr = NULL;
|
||||||
|
} else {
|
||||||
|
/* we suppose that malloc aligns to at least four bytes */
|
||||||
|
ptr = malloc(size + 1);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* we allocate one more byte to ensure the regions will be
|
||||||
|
separated by at least one byte. With the glibc malloc, it may
|
||||||
|
be in fact not necessary */
|
||||||
|
ptr = memalign(size + 1, align);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
install_malloc_hooks();
|
||||||
|
|
||||||
|
if (!ptr)
|
||||||
|
return NULL;
|
||||||
|
__bound_new_region(ptr, size);
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void __bound_free(void *ptr, const void *caller)
|
||||||
|
{
|
||||||
|
if (ptr == NULL)
|
||||||
|
return;
|
||||||
|
if (__bound_delete_region(ptr) != 0)
|
||||||
|
bound_error("freeing invalid region");
|
||||||
|
|
||||||
|
libc_free(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *__bound_realloc(void *ptr, size_t size, const void *caller)
|
||||||
|
{
|
||||||
|
void *ptr1;
|
||||||
|
int old_size;
|
||||||
|
|
||||||
|
if (size == 0) {
|
||||||
|
__bound_free(ptr, caller);
|
||||||
|
return NULL;
|
||||||
|
} else {
|
||||||
|
ptr1 = __bound_malloc(size, caller);
|
||||||
|
if (ptr == NULL || ptr1 == NULL)
|
||||||
|
return ptr1;
|
||||||
|
old_size = get_region_size(ptr);
|
||||||
|
if (old_size == EMPTY_SIZE)
|
||||||
|
bound_error("realloc'ing invalid pointer");
|
||||||
|
memcpy(ptr1, ptr, old_size);
|
||||||
|
__bound_free(ptr, caller);
|
||||||
|
return ptr1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef CONFIG_TCC_MALLOC_HOOKS
|
||||||
|
void *__bound_calloc(size_t nmemb, size_t size)
|
||||||
|
{
|
||||||
|
void *ptr;
|
||||||
|
size = size * nmemb;
|
||||||
|
ptr = __bound_malloc(size, NULL);
|
||||||
|
if (!ptr)
|
||||||
|
return NULL;
|
||||||
|
memset(ptr, 0, size);
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
static void bound_dump(void)
|
||||||
|
{
|
||||||
|
BoundEntry *page, *e;
|
||||||
|
int i, j;
|
||||||
|
|
||||||
|
printf("region dump:\n");
|
||||||
|
for(i=0;i<BOUND_T1_SIZE;i++) {
|
||||||
|
page = __bound_t1[i];
|
||||||
|
for(j=0;j<BOUND_T2_SIZE;j++) {
|
||||||
|
e = page + j;
|
||||||
|
/* do not print invalid or empty entries */
|
||||||
|
if (e->size != EMPTY_SIZE && e->start != 0) {
|
||||||
|
printf("%08x:",
|
||||||
|
(i << (BOUND_T2_BITS + BOUND_T3_BITS)) +
|
||||||
|
(j << BOUND_T3_BITS));
|
||||||
|
do {
|
||||||
|
printf(" %08lx:%08lx", e->start, e->start + e->size);
|
||||||
|
e = e->next;
|
||||||
|
} while (e != NULL);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* some useful checked functions */
|
||||||
|
|
||||||
|
/* check that (p ... p + size - 1) lies inside 'p' region, if any */
|
||||||
|
static void __bound_check(const void *p, size_t size)
|
||||||
|
{
|
||||||
|
if (size == 0)
|
||||||
|
return;
|
||||||
|
p = __bound_ptr_add((void *)p, size);
|
||||||
|
if (p == INVALID_POINTER)
|
||||||
|
bound_error("invalid pointer");
|
||||||
|
}
|
||||||
|
|
||||||
|
void *__bound_memcpy(void *dst, const void *src, size_t size)
|
||||||
|
{
|
||||||
|
__bound_check(dst, size);
|
||||||
|
__bound_check(src, size);
|
||||||
|
/* check also region overlap */
|
||||||
|
if (src >= dst && src < dst + size)
|
||||||
|
bound_error("overlapping regions in memcpy()");
|
||||||
|
return memcpy(dst, src, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *__bound_memmove(void *dst, const void *src, size_t size)
|
||||||
|
{
|
||||||
|
__bound_check(dst, size);
|
||||||
|
__bound_check(src, size);
|
||||||
|
return memmove(dst, src, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *__bound_memset(void *dst, int c, size_t size)
|
||||||
|
{
|
||||||
|
__bound_check(dst, size);
|
||||||
|
return memset(dst, c, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* XXX: could be optimized */
|
||||||
|
int __bound_strlen(const char *s)
|
||||||
|
{
|
||||||
|
const char *p;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
len = 0;
|
||||||
|
for(;;) {
|
||||||
|
p = __bound_ptr_indir1((char *)s, len);
|
||||||
|
if (p == INVALID_POINTER)
|
||||||
|
bound_error("bad pointer in strlen()");
|
||||||
|
if (*p == '\0')
|
||||||
|
break;
|
||||||
|
len++;
|
||||||
|
}
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *__bound_strcpy(char *dst, const char *src)
|
||||||
|
{
|
||||||
|
int len;
|
||||||
|
len = __bound_strlen(src);
|
||||||
|
return __bound_memcpy(dst, src, len + 1);
|
||||||
|
}
|
||||||
|
|
||||||
214
bazaar/Tcc/lib/boundtest.c
Normal file
214
bazaar/Tcc/lib/boundtest.c
Normal file
|
|
@ -0,0 +1,214 @@
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define NB_ITS 1000000
|
||||||
|
//#define NB_ITS 1
|
||||||
|
#define TAB_SIZE 100
|
||||||
|
|
||||||
|
int tab[TAB_SIZE];
|
||||||
|
int ret_sum;
|
||||||
|
char tab3[256];
|
||||||
|
|
||||||
|
int test1(void)
|
||||||
|
{
|
||||||
|
int i, sum = 0;
|
||||||
|
for(i=0;i<TAB_SIZE;i++) {
|
||||||
|
sum += tab[i];
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* error */
|
||||||
|
int test2(void)
|
||||||
|
{
|
||||||
|
int i, sum = 0;
|
||||||
|
for(i=0;i<TAB_SIZE + 1;i++) {
|
||||||
|
sum += tab[i];
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* actually, profiling test */
|
||||||
|
int test3(void)
|
||||||
|
{
|
||||||
|
int sum;
|
||||||
|
int i, it;
|
||||||
|
|
||||||
|
sum = 0;
|
||||||
|
for(it=0;it<NB_ITS;it++) {
|
||||||
|
for(i=0;i<TAB_SIZE;i++) {
|
||||||
|
sum += tab[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ok */
|
||||||
|
int test4(void)
|
||||||
|
{
|
||||||
|
int i, sum = 0;
|
||||||
|
int *tab4;
|
||||||
|
|
||||||
|
tab4 = malloc(20 * sizeof(int));
|
||||||
|
for(i=0;i<20;i++) {
|
||||||
|
sum += tab4[i];
|
||||||
|
}
|
||||||
|
free(tab4);
|
||||||
|
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* error */
|
||||||
|
int test5(void)
|
||||||
|
{
|
||||||
|
int i, sum = 0;
|
||||||
|
int *tab4;
|
||||||
|
|
||||||
|
tab4 = malloc(20 * sizeof(int));
|
||||||
|
for(i=0;i<21;i++) {
|
||||||
|
sum += tab4[i];
|
||||||
|
}
|
||||||
|
free(tab4);
|
||||||
|
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* error */
|
||||||
|
/* XXX: currently: bug */
|
||||||
|
int test6(void)
|
||||||
|
{
|
||||||
|
int i, sum = 0;
|
||||||
|
int *tab4;
|
||||||
|
|
||||||
|
tab4 = malloc(20 * sizeof(int));
|
||||||
|
free(tab4);
|
||||||
|
for(i=0;i<21;i++) {
|
||||||
|
sum += tab4[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* error */
|
||||||
|
int test7(void)
|
||||||
|
{
|
||||||
|
int i, sum = 0;
|
||||||
|
int *p;
|
||||||
|
|
||||||
|
for(i=0;i<TAB_SIZE + 1;i++) {
|
||||||
|
p = &tab[i];
|
||||||
|
if (i == TAB_SIZE)
|
||||||
|
printf("i=%d %x\n", i, p);
|
||||||
|
sum += *p;
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ok */
|
||||||
|
int test8(void)
|
||||||
|
{
|
||||||
|
int i, sum = 0;
|
||||||
|
int tab[10];
|
||||||
|
|
||||||
|
for(i=0;i<10;i++) {
|
||||||
|
sum += tab[i];
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* error */
|
||||||
|
int test9(void)
|
||||||
|
{
|
||||||
|
int i, sum = 0;
|
||||||
|
char tab[10];
|
||||||
|
|
||||||
|
for(i=0;i<11;i++) {
|
||||||
|
sum += tab[i];
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ok */
|
||||||
|
int test10(void)
|
||||||
|
{
|
||||||
|
char tab[10];
|
||||||
|
char tab1[10];
|
||||||
|
|
||||||
|
memset(tab, 0, 10);
|
||||||
|
memcpy(tab, tab1, 10);
|
||||||
|
memmove(tab, tab1, 10);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* error */
|
||||||
|
int test11(void)
|
||||||
|
{
|
||||||
|
char tab[10];
|
||||||
|
|
||||||
|
memset(tab, 0, 11);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* error */
|
||||||
|
int test12(void)
|
||||||
|
{
|
||||||
|
void *ptr;
|
||||||
|
ptr = malloc(10);
|
||||||
|
free(ptr);
|
||||||
|
free(ptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* error */
|
||||||
|
int test13(void)
|
||||||
|
{
|
||||||
|
char pad1 = 0;
|
||||||
|
char tab[10];
|
||||||
|
char pad2 = 0;
|
||||||
|
memset(tab, 'a', sizeof(tab));
|
||||||
|
return strlen(tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
int (*table_test[])(void) = {
|
||||||
|
test1,
|
||||||
|
test1,
|
||||||
|
test2,
|
||||||
|
test3,
|
||||||
|
test4,
|
||||||
|
test5,
|
||||||
|
test6,
|
||||||
|
test7,
|
||||||
|
test8,
|
||||||
|
test9,
|
||||||
|
test10,
|
||||||
|
test11,
|
||||||
|
test12,
|
||||||
|
test13,
|
||||||
|
};
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int index;
|
||||||
|
int (*ftest)(void);
|
||||||
|
|
||||||
|
if (argc < 2) {
|
||||||
|
printf("usage: boundtest n\n"
|
||||||
|
"test TCC bound checking system\n"
|
||||||
|
);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
index = 0;
|
||||||
|
if (argc >= 2)
|
||||||
|
index = atoi(argv[1]);
|
||||||
|
/* well, we also use bounds on this ! */
|
||||||
|
ftest = table_test[index];
|
||||||
|
ftest();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* without bound 0.77 s
|
||||||
|
* with bounds 4.73
|
||||||
|
*/
|
||||||
2548
bazaar/Tcc/lib/c67-gen.c
Normal file
2548
bazaar/Tcc/lib/c67-gen.c
Normal file
File diff suppressed because it is too large
Load diff
446
bazaar/Tcc/lib/coff.h
Normal file
446
bazaar/Tcc/lib/coff.h
Normal file
|
|
@ -0,0 +1,446 @@
|
||||||
|
/**************************************************************************/
|
||||||
|
/* COFF.H */
|
||||||
|
/* COFF data structures and related definitions used by the linker */
|
||||||
|
/**************************************************************************/
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* COFF FILE HEADER */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
struct filehdr {
|
||||||
|
unsigned short f_magic; /* magic number */
|
||||||
|
unsigned short f_nscns; /* number of sections */
|
||||||
|
long f_timdat; /* time & date stamp */
|
||||||
|
long f_symptr; /* file pointer to symtab */
|
||||||
|
long f_nsyms; /* number of symtab entries */
|
||||||
|
unsigned short f_opthdr; /* sizeof(optional hdr) */
|
||||||
|
unsigned short f_flags; /* flags */
|
||||||
|
unsigned short f_TargetID; /* for C6x = 0x0099 */
|
||||||
|
};
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* File header flags */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
#define F_RELFLG 0x01 /* relocation info stripped from file */
|
||||||
|
#define F_EXEC 0x02 /* file is executable (no unresolved refs) */
|
||||||
|
#define F_LNNO 0x04 /* line nunbers stripped from file */
|
||||||
|
#define F_LSYMS 0x08 /* local symbols stripped from file */
|
||||||
|
#define F_GSP10 0x10 /* 34010 version */
|
||||||
|
#define F_GSP20 0x20 /* 34020 version */
|
||||||
|
#define F_SWABD 0x40 /* bytes swabbed (in names) */
|
||||||
|
#define F_AR16WR 0x80 /* byte ordering of an AR16WR (PDP-11) */
|
||||||
|
#define F_LITTLE 0x100 /* byte ordering of an AR32WR (vax) */
|
||||||
|
#define F_BIG 0x200 /* byte ordering of an AR32W (3B, maxi) */
|
||||||
|
#define F_PATCH 0x400 /* contains "patch" list in optional header */
|
||||||
|
#define F_NODF 0x400
|
||||||
|
|
||||||
|
#define F_VERSION (F_GSP10 | F_GSP20)
|
||||||
|
#define F_BYTE_ORDER (F_LITTLE | F_BIG)
|
||||||
|
#define FILHDR struct filehdr
|
||||||
|
|
||||||
|
//#define FILHSZ sizeof(FILHDR)
|
||||||
|
#define FILHSZ 22 // above rounds to align on 4 bytes which causes problems
|
||||||
|
|
||||||
|
#define COFF_C67_MAGIC 0x00c2
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* Macros to recognize magic numbers */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
#define ISMAGIC(x) (((unsigned short)(x))==(unsigned short)magic)
|
||||||
|
#define ISARCHIVE(x) ((((unsigned short)(x))==(unsigned short)ARTYPE))
|
||||||
|
#define BADMAGIC(x) (((unsigned short)(x) & 0x8080) && !ISMAGIC(x))
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* OPTIONAL FILE HEADER */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
typedef struct aouthdr {
|
||||||
|
short magic; /* see magic.h */
|
||||||
|
short vstamp; /* version stamp */
|
||||||
|
long tsize; /* text size in bytes, padded to FW bdry*/
|
||||||
|
long dsize; /* initialized data " " */
|
||||||
|
long bsize; /* uninitialized data " " */
|
||||||
|
long entrypt; /* entry pt. */
|
||||||
|
long text_start; /* base of text used for this file */
|
||||||
|
long data_start; /* base of data used for this file */
|
||||||
|
} AOUTHDR;
|
||||||
|
|
||||||
|
#define AOUTSZ sizeof(AOUTHDR)
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------*/
|
||||||
|
/* When a UNIX aout header is to be built in the optional header, */
|
||||||
|
/* the following magic numbers can appear in that header: */
|
||||||
|
/* */
|
||||||
|
/* AOUT1MAGIC : default : readonly sharable text segment */
|
||||||
|
/* AOUT2MAGIC: : writable text segment */
|
||||||
|
/* PAGEMAGIC : : configured for paging */
|
||||||
|
/*----------------------------------------------------------------------*/
|
||||||
|
#define AOUT1MAGIC 0410
|
||||||
|
#define AOUT2MAGIC 0407
|
||||||
|
#define PAGEMAGIC 0413
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* COMMON ARCHIVE FILE STRUCTURES */
|
||||||
|
/* */
|
||||||
|
/* ARCHIVE File Organization: */
|
||||||
|
/* _______________________________________________ */
|
||||||
|
/* |__________ARCHIVE_MAGIC_STRING_______________| */
|
||||||
|
/* |__________ARCHIVE_FILE_MEMBER_1______________| */
|
||||||
|
/* | | */
|
||||||
|
/* | Archive File Header "ar_hdr" | */
|
||||||
|
/* |.............................................| */
|
||||||
|
/* | Member Contents | */
|
||||||
|
/* | 1. External symbol directory | */
|
||||||
|
/* | 2. Text file | */
|
||||||
|
/* |_____________________________________________| */
|
||||||
|
/* |________ARCHIVE_FILE_MEMBER_2________________| */
|
||||||
|
/* | "ar_hdr" | */
|
||||||
|
/* |.............................................| */
|
||||||
|
/* | Member Contents (.o or text file) | */
|
||||||
|
/* |_____________________________________________| */
|
||||||
|
/* | . . . | */
|
||||||
|
/* | . . . | */
|
||||||
|
/* | . . . | */
|
||||||
|
/* |_____________________________________________| */
|
||||||
|
/* |________ARCHIVE_FILE_MEMBER_n________________| */
|
||||||
|
/* | "ar_hdr" | */
|
||||||
|
/* |.............................................| */
|
||||||
|
/* | Member Contents | */
|
||||||
|
/* |_____________________________________________| */
|
||||||
|
/* */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#define COFF_ARMAG "!<arch>\n"
|
||||||
|
#define SARMAG 8
|
||||||
|
#define ARFMAG "`\n"
|
||||||
|
|
||||||
|
struct ar_hdr /* archive file member header - printable ascii */
|
||||||
|
{
|
||||||
|
char ar_name[16]; /* file member name - `/' terminated */
|
||||||
|
char ar_date[12]; /* file member date - decimal */
|
||||||
|
char ar_uid[6]; /* file member user id - decimal */
|
||||||
|
char ar_gid[6]; /* file member group id - decimal */
|
||||||
|
char ar_mode[8]; /* file member mode - octal */
|
||||||
|
char ar_size[10]; /* file member size - decimal */
|
||||||
|
char ar_fmag[2]; /* ARFMAG - string to end header */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* SECTION HEADER */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
struct scnhdr {
|
||||||
|
char s_name[8]; /* section name */
|
||||||
|
long s_paddr; /* physical address */
|
||||||
|
long s_vaddr; /* virtual address */
|
||||||
|
long s_size; /* section size */
|
||||||
|
long s_scnptr; /* file ptr to raw data for section */
|
||||||
|
long s_relptr; /* file ptr to relocation */
|
||||||
|
long s_lnnoptr; /* file ptr to line numbers */
|
||||||
|
unsigned int s_nreloc; /* number of relocation entries */
|
||||||
|
unsigned int s_nlnno; /* number of line number entries */
|
||||||
|
unsigned int s_flags; /* flags */
|
||||||
|
unsigned short s_reserved; /* reserved byte */
|
||||||
|
unsigned short s_page; /* memory page id */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define SCNHDR struct scnhdr
|
||||||
|
#define SCNHSZ sizeof(SCNHDR)
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* Define constants for names of "special" sections */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
//#define _TEXT ".text"
|
||||||
|
#define _DATA ".data"
|
||||||
|
#define _BSS ".bss"
|
||||||
|
#define _CINIT ".cinit"
|
||||||
|
#define _TV ".tv"
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* The low 4 bits of s_flags is used as a section "type" */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
#define STYP_REG 0x00 /* "regular" : allocated, relocated, loaded */
|
||||||
|
#define STYP_DSECT 0x01 /* "dummy" : not allocated, relocated, not loaded */
|
||||||
|
#define STYP_NOLOAD 0x02 /* "noload" : allocated, relocated, not loaded */
|
||||||
|
#define STYP_GROUP 0x04 /* "grouped" : formed of input sections */
|
||||||
|
#define STYP_PAD 0x08 /* "padding" : not allocated, not relocated, loaded */
|
||||||
|
#define STYP_COPY 0x10 /* "copy" : used for C init tables -
|
||||||
|
not allocated, relocated,
|
||||||
|
loaded; reloc & lineno
|
||||||
|
entries processed normally */
|
||||||
|
#define STYP_TEXT 0x20 /* section contains text only */
|
||||||
|
#define STYP_DATA 0x40 /* section contains data only */
|
||||||
|
#define STYP_BSS 0x80 /* section contains bss only */
|
||||||
|
|
||||||
|
#define STYP_ALIGN 0x100 /* align flag passed by old version assemblers */
|
||||||
|
#define ALIGN_MASK 0x0F00 /* part of s_flags that is used for align vals */
|
||||||
|
#define ALIGNSIZE(x) (1 << ((x & ALIGN_MASK) >> 8))
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* RELOCATION ENTRIES */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
struct reloc
|
||||||
|
{
|
||||||
|
long r_vaddr; /* (virtual) address of reference */
|
||||||
|
short r_symndx; /* index into symbol table */
|
||||||
|
unsigned short r_disp; /* additional bits for address calculation */
|
||||||
|
unsigned short r_type; /* relocation type */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define RELOC struct reloc
|
||||||
|
#define RELSZ 10 /* sizeof(RELOC) */
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
/* define all relocation types */
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#define R_ABS 0 /* absolute address - no relocation */
|
||||||
|
#define R_DIR16 01 /* UNUSED */
|
||||||
|
#define R_REL16 02 /* UNUSED */
|
||||||
|
#define R_DIR24 04 /* UNUSED */
|
||||||
|
#define R_REL24 05 /* 24 bits, direct */
|
||||||
|
#define R_DIR32 06 /* UNUSED */
|
||||||
|
#define R_RELBYTE 017 /* 8 bits, direct */
|
||||||
|
#define R_RELWORD 020 /* 16 bits, direct */
|
||||||
|
#define R_RELLONG 021 /* 32 bits, direct */
|
||||||
|
#define R_PCRBYTE 022 /* 8 bits, PC-relative */
|
||||||
|
#define R_PCRWORD 023 /* 16 bits, PC-relative */
|
||||||
|
#define R_PCRLONG 024 /* 32 bits, PC-relative */
|
||||||
|
#define R_OCRLONG 030 /* GSP: 32 bits, one's complement direct */
|
||||||
|
#define R_GSPPCR16 031 /* GSP: 16 bits, PC relative (in words) */
|
||||||
|
#define R_GSPOPR32 032 /* GSP: 32 bits, direct big-endian */
|
||||||
|
#define R_PARTLS16 040 /* Brahma: 16 bit offset of 24 bit address*/
|
||||||
|
#define R_PARTMS8 041 /* Brahma: 8 bit page of 24 bit address */
|
||||||
|
#define R_PARTLS7 050 /* DSP: 7 bit offset of 16 bit address */
|
||||||
|
#define R_PARTMS9 051 /* DSP: 9 bit page of 16 bit address */
|
||||||
|
#define R_REL13 052 /* DSP: 13 bits, direct */
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* LINE NUMBER ENTRIES */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
struct lineno
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
long l_symndx ; /* sym. table index of function name
|
||||||
|
iff l_lnno == 0 */
|
||||||
|
long l_paddr ; /* (physical) address of line number */
|
||||||
|
} l_addr ;
|
||||||
|
unsigned short l_lnno ; /* line number */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define LINENO struct lineno
|
||||||
|
#define LINESZ 6 /* sizeof(LINENO) */
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* STORAGE CLASSES */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
#define C_EFCN -1 /* physical end of function */
|
||||||
|
#define C_NULL 0
|
||||||
|
#define C_AUTO 1 /* automatic variable */
|
||||||
|
#define C_EXT 2 /* external symbol */
|
||||||
|
#define C_STAT 3 /* static */
|
||||||
|
#define C_REG 4 /* register variable */
|
||||||
|
#define C_EXTDEF 5 /* external definition */
|
||||||
|
#define C_LABEL 6 /* label */
|
||||||
|
#define C_ULABEL 7 /* undefined label */
|
||||||
|
#define C_MOS 8 /* member of structure */
|
||||||
|
#define C_ARG 9 /* function argument */
|
||||||
|
#define C_STRTAG 10 /* structure tag */
|
||||||
|
#define C_MOU 11 /* member of union */
|
||||||
|
#define C_UNTAG 12 /* union tag */
|
||||||
|
#define C_TPDEF 13 /* type definition */
|
||||||
|
#define C_USTATIC 14 /* undefined static */
|
||||||
|
#define C_ENTAG 15 /* enumeration tag */
|
||||||
|
#define C_MOE 16 /* member of enumeration */
|
||||||
|
#define C_REGPARM 17 /* register parameter */
|
||||||
|
#define C_FIELD 18 /* bit field */
|
||||||
|
|
||||||
|
#define C_BLOCK 100 /* ".bb" or ".eb" */
|
||||||
|
#define C_FCN 101 /* ".bf" or ".ef" */
|
||||||
|
#define C_EOS 102 /* end of structure */
|
||||||
|
#define C_FILE 103 /* file name */
|
||||||
|
#define C_LINE 104 /* dummy sclass for line number entry */
|
||||||
|
#define C_ALIAS 105 /* duplicate tag */
|
||||||
|
#define C_HIDDEN 106 /* special storage class for external */
|
||||||
|
/* symbols in dmert public libraries */
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* SYMBOL TABLE ENTRIES */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#define SYMNMLEN 8 /* Number of characters in a symbol name */
|
||||||
|
#define FILNMLEN 14 /* Number of characters in a file name */
|
||||||
|
#define DIMNUM 4 /* Number of array dimensions in auxiliary entry */
|
||||||
|
|
||||||
|
|
||||||
|
struct syment
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
char _n_name[SYMNMLEN]; /* old COFF version */
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
long _n_zeroes; /* new == 0 */
|
||||||
|
long _n_offset; /* offset into string table */
|
||||||
|
} _n_n;
|
||||||
|
char *_n_nptr[2]; /* allows for overlaying */
|
||||||
|
} _n;
|
||||||
|
long n_value; /* value of symbol */
|
||||||
|
short n_scnum; /* section number */
|
||||||
|
unsigned short n_type; /* type and derived type */
|
||||||
|
char n_sclass; /* storage class */
|
||||||
|
char n_numaux; /* number of aux. entries */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define n_name _n._n_name
|
||||||
|
#define n_nptr _n._n_nptr[1]
|
||||||
|
#define n_zeroes _n._n_n._n_zeroes
|
||||||
|
#define n_offset _n._n_n._n_offset
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* Relocatable symbols have a section number of the */
|
||||||
|
/* section in which they are defined. Otherwise, section */
|
||||||
|
/* numbers have the following meanings: */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
#define N_UNDEF 0 /* undefined symbol */
|
||||||
|
#define N_ABS -1 /* value of symbol is absolute */
|
||||||
|
#define N_DEBUG -2 /* special debugging symbol */
|
||||||
|
#define N_TV (unsigned short)-3 /* needs transfer vector (preload) */
|
||||||
|
#define P_TV (unsigned short)-4 /* needs transfer vector (postload) */
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* The fundamental type of a symbol packed into the low */
|
||||||
|
/* 4 bits of the word. */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
#define _EF ".ef"
|
||||||
|
|
||||||
|
#define T_NULL 0 /* no type info */
|
||||||
|
#define T_ARG 1 /* function argument (only used by compiler) */
|
||||||
|
#define T_CHAR 2 /* character */
|
||||||
|
#define T_SHORT 3 /* short integer */
|
||||||
|
#define T_INT 4 /* integer */
|
||||||
|
#define T_LONG 5 /* long integer */
|
||||||
|
#define T_FLOAT 6 /* floating point */
|
||||||
|
#define T_DOUBLE 7 /* double word */
|
||||||
|
#define T_STRUCT 8 /* structure */
|
||||||
|
#define T_UNION 9 /* union */
|
||||||
|
#define T_ENUM 10 /* enumeration */
|
||||||
|
#define T_MOE 11 /* member of enumeration */
|
||||||
|
#define T_UCHAR 12 /* unsigned character */
|
||||||
|
#define T_USHORT 13 /* unsigned short */
|
||||||
|
#define T_UINT 14 /* unsigned integer */
|
||||||
|
#define T_ULONG 15 /* unsigned long */
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* derived types are: */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
#define DT_NON 0 /* no derived type */
|
||||||
|
#define DT_PTR 1 /* pointer */
|
||||||
|
#define DT_FCN 2 /* function */
|
||||||
|
#define DT_ARY 3 /* array */
|
||||||
|
|
||||||
|
#define MKTYPE(basic, d1,d2,d3,d4,d5,d6) \
|
||||||
|
((basic) | ((d1) << 4) | ((d2) << 6) | ((d3) << 8) |\
|
||||||
|
((d4) << 10) | ((d5) << 12) | ((d6) << 14))
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* type packing constants and macros */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
#define N_BTMASK_COFF 017
|
||||||
|
#define N_TMASK_COFF 060
|
||||||
|
#define N_TMASK1_COFF 0300
|
||||||
|
#define N_TMASK2_COFF 0360
|
||||||
|
#define N_BTSHFT_COFF 4
|
||||||
|
#define N_TSHIFT_COFF 2
|
||||||
|
|
||||||
|
#define BTYPE_COFF(x) ((x) & N_BTMASK_COFF)
|
||||||
|
#define ISINT(x) (((x) >= T_CHAR && (x) <= T_LONG) || \
|
||||||
|
((x) >= T_UCHAR && (x) <= T_ULONG) || (x) == T_ENUM)
|
||||||
|
#define ISFLT_COFF(x) ((x) == T_DOUBLE || (x) == T_FLOAT)
|
||||||
|
#define ISPTR_COFF(x) (((x) & N_TMASK_COFF) == (DT_PTR << N_BTSHFT_COFF))
|
||||||
|
#define ISFCN_COFF(x) (((x) & N_TMASK_COFF) == (DT_FCN << N_BTSHFT_COFF))
|
||||||
|
#define ISARY_COFF(x) (((x) & N_TMASK_COFF) == (DT_ARY << N_BTSHFT_COFF))
|
||||||
|
#define ISTAG_COFF(x) ((x)==C_STRTAG || (x)==C_UNTAG || (x)==C_ENTAG)
|
||||||
|
|
||||||
|
#define INCREF_COFF(x) ((((x)&~N_BTMASK_COFF)<<N_TSHIFT_COFF)|(DT_PTR<<N_BTSHFT_COFF)|(x&N_BTMASK_COFF))
|
||||||
|
#define DECREF_COFF(x) ((((x)>>N_TSHIFT_COFF)&~N_BTMASK_COFF)|((x)&N_BTMASK_COFF))
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* AUXILIARY SYMBOL ENTRY */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
union auxent
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
long x_tagndx; /* str, un, or enum tag indx */
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
unsigned short x_lnno; /* declaration line number */
|
||||||
|
unsigned short x_size; /* str, union, array size */
|
||||||
|
} x_lnsz;
|
||||||
|
long x_fsize; /* size of function */
|
||||||
|
} x_misc;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct /* if ISFCN, tag, or .bb */
|
||||||
|
{
|
||||||
|
long x_lnnoptr; /* ptr to fcn line # */
|
||||||
|
long x_endndx; /* entry ndx past block end */
|
||||||
|
} x_fcn;
|
||||||
|
struct /* if ISARY, up to 4 dimen. */
|
||||||
|
{
|
||||||
|
unsigned short x_dimen[DIMNUM];
|
||||||
|
} x_ary;
|
||||||
|
} x_fcnary;
|
||||||
|
unsigned short x_regcount; /* number of registers used by func */
|
||||||
|
} x_sym;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
char x_fname[FILNMLEN];
|
||||||
|
} x_file;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
long x_scnlen; /* section length */
|
||||||
|
unsigned short x_nreloc; /* number of relocation entries */
|
||||||
|
unsigned short x_nlinno; /* number of line numbers */
|
||||||
|
} x_scn;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define SYMENT struct syment
|
||||||
|
#define SYMESZ 18 /* sizeof(SYMENT) */
|
||||||
|
|
||||||
|
#define AUXENT union auxent
|
||||||
|
#define AUXESZ 18 /* sizeof(AUXENT) */
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
/* NAMES OF "SPECIAL" SYMBOLS */
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
#define _STEXT ".text"
|
||||||
|
#define _ETEXT "etext"
|
||||||
|
#define _SDATA ".data"
|
||||||
|
#define _EDATA "edata"
|
||||||
|
#define _SBSS ".bss"
|
||||||
|
#define _END "end"
|
||||||
|
#define _CINITPTR "cinit"
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
/* ENTRY POINT SYMBOLS */
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
#define _START "_start"
|
||||||
|
#define _MAIN "_main"
|
||||||
|
/* _CSTART "_c_int00" (defined in params.h) */
|
||||||
|
|
||||||
|
|
||||||
|
#define _TVORIG "_tvorig"
|
||||||
|
#define _TORIGIN "_torigin"
|
||||||
|
#define _DORIGIN "_dorigin"
|
||||||
|
|
||||||
|
#define _SORIGIN "_sorigin"
|
||||||
5
bazaar/Tcc/lib/config.h
Normal file
5
bazaar/Tcc/lib/config.h
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
/* Automatically generated by configure - do not modify */
|
||||||
|
#define CONFIG_TCCDIR "/usr/local/lib/tcc"
|
||||||
|
#define GCC_MAJOR 4
|
||||||
|
#define HOST_I386 1
|
||||||
|
#define TCC_VERSION "0.9.24"
|
||||||
21
bazaar/Tcc/lib/config.mak
Normal file
21
bazaar/Tcc/lib/config.mak
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Automatically generated by configure - do not modify
|
||||||
|
prefix=/usr/local
|
||||||
|
bindir=/usr/local/bin
|
||||||
|
tccdir=/usr/local/lib/tcc
|
||||||
|
libdir=/usr/local/lib
|
||||||
|
includedir=/usr/local/include
|
||||||
|
mandir=/usr/local/man
|
||||||
|
docdir=/usr/local/share/doc/tcc
|
||||||
|
MAKE=make
|
||||||
|
CC=gcc
|
||||||
|
GCC_MAJOR=4
|
||||||
|
HOST_CC=gcc
|
||||||
|
AR=ar
|
||||||
|
STRIP=strip -s -R .comment -R .note
|
||||||
|
CFLAGS=-O2
|
||||||
|
LDFLAGS=
|
||||||
|
LIBSUF=.a
|
||||||
|
EXESUF=
|
||||||
|
ARCH=i386
|
||||||
|
VERSION=0.9.24
|
||||||
|
SRC_PATH=/home/Aplicaciones/zLibs/Tcc/lib
|
||||||
1
bazaar/Tcc/lib/config.texi
Normal file
1
bazaar/Tcc/lib/config.texi
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
@set VERSION 0.9.24
|
||||||
367
bazaar/Tcc/lib/configure
vendored
Normal file
367
bazaar/Tcc/lib/configure
vendored
Normal file
|
|
@ -0,0 +1,367 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# tcc configure script (c) 2003 Fabrice Bellard
|
||||||
|
#
|
||||||
|
# set temporary file name
|
||||||
|
if test ! -z "$TMPDIR" ; then
|
||||||
|
TMPDIR1="${TMPDIR}"
|
||||||
|
elif test ! -z "$TEMPDIR" ; then
|
||||||
|
TMPDIR1="${TEMPDIR}"
|
||||||
|
else
|
||||||
|
TMPDIR1="/tmp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
TMPC="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.c"
|
||||||
|
TMPO="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.o"
|
||||||
|
TMPE="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}"
|
||||||
|
TMPS="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.S"
|
||||||
|
TMPH="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.h"
|
||||||
|
|
||||||
|
# default parameters
|
||||||
|
build_cross="no"
|
||||||
|
prefix=""
|
||||||
|
execprefix=""
|
||||||
|
bindir=""
|
||||||
|
libdir=""
|
||||||
|
tccdir=""
|
||||||
|
includedir=""
|
||||||
|
mandir=""
|
||||||
|
cross_prefix=""
|
||||||
|
cc="gcc"
|
||||||
|
host_cc="gcc"
|
||||||
|
ar="ar"
|
||||||
|
make="make"
|
||||||
|
strip="strip"
|
||||||
|
cpu=`uname -m`
|
||||||
|
case "$cpu" in
|
||||||
|
i386|i486|i586|i686|i86pc|BePC)
|
||||||
|
cpu="x86"
|
||||||
|
;;
|
||||||
|
armv4l)
|
||||||
|
cpu="armv4l"
|
||||||
|
;;
|
||||||
|
alpha)
|
||||||
|
cpu="alpha"
|
||||||
|
;;
|
||||||
|
"Power Macintosh"|ppc|ppc64)
|
||||||
|
cpu="powerpc"
|
||||||
|
;;
|
||||||
|
mips)
|
||||||
|
cpu="mips"
|
||||||
|
;;
|
||||||
|
s390)
|
||||||
|
cpu="s390"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
cpu="unknown"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
gprof="no"
|
||||||
|
bigendian="no"
|
||||||
|
mingw32="no"
|
||||||
|
LIBSUF=".a"
|
||||||
|
EXESUF=""
|
||||||
|
|
||||||
|
# OS specific
|
||||||
|
targetos=`uname -s`
|
||||||
|
case $targetos in
|
||||||
|
MINGW32*)
|
||||||
|
mingw32="yes"
|
||||||
|
;;
|
||||||
|
DragonFly)
|
||||||
|
noldl="yes"
|
||||||
|
;;
|
||||||
|
OpenBSD)
|
||||||
|
noldl="yes"
|
||||||
|
;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# find source path
|
||||||
|
# XXX: we assume an absolute path is given when launching configure,
|
||||||
|
# except in './configure' case.
|
||||||
|
source_path=${0%configure}
|
||||||
|
source_path=${source_path%/}
|
||||||
|
source_path_used="yes"
|
||||||
|
if test -z "$source_path" -o "$source_path" = "." ; then
|
||||||
|
source_path=`pwd`
|
||||||
|
source_path_used="no"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for opt do
|
||||||
|
case "$opt" in
|
||||||
|
--prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
|
--exec-prefix=*) execprefix=`echo $opt | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
|
--bindir=*) bindir=`echo $opt | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
|
--libdir=*) libdir=`echo $opt | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
|
--includedir=*) includedir=`echo $opt | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
|
--mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
|
--source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
|
--cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
|
--cc=*) cc=`echo $opt | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
|
--make=*) make=`echo $opt | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
|
--extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
|
||||||
|
;;
|
||||||
|
--extra-ldflags=*) LDFLAGS="${opt#--extra-ldflags=}"
|
||||||
|
;;
|
||||||
|
--extra-libs=*) extralibs=${opt#--extra-libs=}
|
||||||
|
;;
|
||||||
|
--cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
|
--enable-gprof) gprof="yes"
|
||||||
|
;;
|
||||||
|
--enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-"
|
||||||
|
;;
|
||||||
|
--enable-cross) build_cross="yes"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Checking for CFLAGS
|
||||||
|
if test -z "$CFLAGS"; then
|
||||||
|
CFLAGS="-O2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cc="${cross_prefix}${cc}"
|
||||||
|
ar="${cross_prefix}${ar}"
|
||||||
|
strip="${cross_prefix}${strip}"
|
||||||
|
|
||||||
|
if test "$mingw32" = "yes" ; then
|
||||||
|
LIBSUF=".lib"
|
||||||
|
EXESUF=".exe"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$cross_prefix" ; then
|
||||||
|
|
||||||
|
# ---
|
||||||
|
# big/little endian test
|
||||||
|
cat > $TMPC << EOF
|
||||||
|
#include <inttypes.h>
|
||||||
|
int main(int argc, char ** argv){
|
||||||
|
volatile uint32_t i=0x01234567;
|
||||||
|
return (*((uint8_t*)(&i))) == 0x67;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if $cc -o $TMPE $TMPC 2>/dev/null ; then
|
||||||
|
$TMPE && bigendian="yes"
|
||||||
|
else
|
||||||
|
echo big/little test failed
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
# if cross compiling, cannot launch a program, so make a static guess
|
||||||
|
if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" ; then
|
||||||
|
bigendian="yes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check gcc version
|
||||||
|
cat > $TMPC <<EOF
|
||||||
|
int main(void) {
|
||||||
|
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
#error gcc < 3.2
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
gcc_major="2"
|
||||||
|
if $cc -o $TMPO $TMPC 2> /dev/null ; then
|
||||||
|
gcc_major="3"
|
||||||
|
fi
|
||||||
|
cat > $TMPC <<EOF
|
||||||
|
int main(void) {
|
||||||
|
#if __GNUC__ >= 4
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
#error gcc < 4
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if $cc -o $TMPO $TMPC 2> /dev/null ; then
|
||||||
|
gcc_major="4"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
|
||||||
|
cat << EOF
|
||||||
|
|
||||||
|
Usage: configure [options]
|
||||||
|
Options: [defaults in brackets after descriptions]
|
||||||
|
|
||||||
|
EOF
|
||||||
|
echo "Standard options:"
|
||||||
|
echo " --help print this message"
|
||||||
|
echo " --prefix=PREFIX install in PREFIX [$prefix]"
|
||||||
|
echo " --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX"
|
||||||
|
echo " [same as prefix]"
|
||||||
|
echo " --bindir=DIR user executables in DIR [EPREFIX/bin]"
|
||||||
|
echo " --libdir=DIR object code libraries in DIR [EPREFIX/lib]"
|
||||||
|
echo " --includedir=DIR C header files in DIR [PREFIX/include]"
|
||||||
|
echo " --mandir=DIR man documentation in DIR [PREFIX/man]"
|
||||||
|
echo " --enable-cross build cross compilers"
|
||||||
|
echo ""
|
||||||
|
echo "Advanced options (experts only):"
|
||||||
|
echo " --source-path=PATH path of source code [$source_path]"
|
||||||
|
echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
|
||||||
|
echo " --cc=CC use C compiler CC [$cc]"
|
||||||
|
echo " --make=MAKE use specified make [$make]"
|
||||||
|
echo ""
|
||||||
|
#echo "NOTE: The object files are build at the place where configure is launched"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$mingw32" = "yes" ; then
|
||||||
|
if test -z "$prefix" ; then
|
||||||
|
prefix="/c/Program Files/tcc"
|
||||||
|
fi
|
||||||
|
execprefix="$prefix"
|
||||||
|
bindir="$prefix"
|
||||||
|
tccdir="$prefix"
|
||||||
|
docdir="$prefix/doc"
|
||||||
|
else
|
||||||
|
if test -z "$prefix" ; then
|
||||||
|
prefix="/usr/local"
|
||||||
|
fi
|
||||||
|
if test x"$execprefix" = x""; then
|
||||||
|
execprefix="${prefix}"
|
||||||
|
fi
|
||||||
|
if test x"$bindir" = x""; then
|
||||||
|
bindir="${execprefix}/bin"
|
||||||
|
fi
|
||||||
|
if test x"$docdir" = x""; then
|
||||||
|
docdir="$prefix/share/doc/tcc"
|
||||||
|
fi
|
||||||
|
fi # mingw32
|
||||||
|
|
||||||
|
if test x"$libdir" = x""; then
|
||||||
|
libdir="${execprefix}/lib"
|
||||||
|
fi
|
||||||
|
if test x"$tccdir" = x""; then
|
||||||
|
tccdir="${execprefix}/lib/tcc"
|
||||||
|
fi
|
||||||
|
if test x"$mandir" = x""; then
|
||||||
|
mandir="${prefix}/man"
|
||||||
|
fi
|
||||||
|
if test x"$includedir" = x""; then
|
||||||
|
includedir="${prefix}/include"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Binary directory $bindir"
|
||||||
|
echo "TinyCC directory $tccdir"
|
||||||
|
echo "Library directory $libdir"
|
||||||
|
echo "Include directory $includedir"
|
||||||
|
echo "Manual directory $mandir"
|
||||||
|
echo "Doc directory $docdir"
|
||||||
|
echo "Source path $source_path"
|
||||||
|
echo "C compiler $cc"
|
||||||
|
echo "make $make"
|
||||||
|
echo "CPU $cpu"
|
||||||
|
echo "Big Endian $bigendian"
|
||||||
|
echo "gprof enabled $gprof"
|
||||||
|
echo "cross compilers $build_cross"
|
||||||
|
|
||||||
|
echo "Creating config.mak and config.h"
|
||||||
|
|
||||||
|
echo "# Automatically generated by configure - do not modify" > config.mak
|
||||||
|
echo "/* Automatically generated by configure - do not modify */" > $TMPH
|
||||||
|
|
||||||
|
echo "prefix=$prefix" >> config.mak
|
||||||
|
echo "bindir=$bindir" >> config.mak
|
||||||
|
echo "tccdir=$tccdir" >> config.mak
|
||||||
|
echo "libdir=$libdir" >> config.mak
|
||||||
|
echo "includedir=$includedir" >> config.mak
|
||||||
|
echo "mandir=$mandir" >> config.mak
|
||||||
|
echo "docdir=$docdir" >> config.mak
|
||||||
|
echo "#define CONFIG_TCCDIR \"$tccdir\"" >> $TMPH
|
||||||
|
echo "MAKE=$make" >> config.mak
|
||||||
|
echo "CC=$cc" >> config.mak
|
||||||
|
echo "GCC_MAJOR=$gcc_major" >> config.mak
|
||||||
|
echo "#define GCC_MAJOR $gcc_major" >> $TMPH
|
||||||
|
echo "HOST_CC=$host_cc" >> config.mak
|
||||||
|
echo "AR=$ar" >> config.mak
|
||||||
|
echo "STRIP=$strip -s -R .comment -R .note" >> config.mak
|
||||||
|
echo "CFLAGS=$CFLAGS" >> config.mak
|
||||||
|
echo "LDFLAGS=$LDFLAGS" >> config.mak
|
||||||
|
echo "LIBSUF=$LIBSUF" >> config.mak
|
||||||
|
echo "EXESUF=$EXESUF" >> config.mak
|
||||||
|
if test "$cpu" = "x86" ; then
|
||||||
|
echo "ARCH=i386" >> config.mak
|
||||||
|
echo "#define HOST_I386 1" >> $TMPH
|
||||||
|
elif test "$cpu" = "armv4l" ; then
|
||||||
|
echo "ARCH=arm" >> config.mak
|
||||||
|
echo "#define HOST_ARM 1" >> $TMPH
|
||||||
|
elif test "$cpu" = "powerpc" ; then
|
||||||
|
echo "ARCH=ppc" >> config.mak
|
||||||
|
echo "#define HOST_PPC 1" >> $TMPH
|
||||||
|
elif test "$cpu" = "mips" ; then
|
||||||
|
echo "ARCH=mips" >> config.mak
|
||||||
|
echo "#define HOST_MIPS 1" >> $TMPH
|
||||||
|
elif test "$cpu" = "s390" ; then
|
||||||
|
echo "ARCH=s390" >> config.mak
|
||||||
|
echo "#define HOST_S390 1" >> $TMPH
|
||||||
|
elif test "$cpu" = "alpha" ; then
|
||||||
|
echo "ARCH=alpha" >> config.mak
|
||||||
|
echo "#define HOST_ALPHA 1" >> $TMPH
|
||||||
|
else
|
||||||
|
echo "Unsupported CPU"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if test "$noldl" = "yes" ; then
|
||||||
|
echo "CONFIG_NOLDL=yes" >> config.mak
|
||||||
|
fi
|
||||||
|
if test "$mingw32" = "yes" ; then
|
||||||
|
echo "CONFIG_WIN32=yes" >> config.mak
|
||||||
|
echo "#define CONFIG_WIN32 1" >> $TMPH
|
||||||
|
fi
|
||||||
|
if test "$bigendian" = "yes" ; then
|
||||||
|
echo "WORDS_BIGENDIAN=yes" >> config.mak
|
||||||
|
echo "#define WORDS_BIGENDIAN 1" >> $TMPH
|
||||||
|
fi
|
||||||
|
if test "$gprof" = "yes" ; then
|
||||||
|
echo "TARGET_GPROF=yes" >> config.mak
|
||||||
|
echo "#define HAVE_GPROF 1" >> $TMPH
|
||||||
|
fi
|
||||||
|
if test "$build_cross" = "yes" ; then
|
||||||
|
echo "CONFIG_CROSS=yes" >> config.mak
|
||||||
|
fi
|
||||||
|
version=`head $source_path/VERSION`
|
||||||
|
echo "VERSION=$version" >>config.mak
|
||||||
|
echo "#define TCC_VERSION \"$version\"" >> $TMPH
|
||||||
|
echo "@set VERSION $version" > config.texi
|
||||||
|
|
||||||
|
# build tree in object directory if source path is different from current one
|
||||||
|
if test "$source_path_used" = "yes" ; then
|
||||||
|
DIRS="tests"
|
||||||
|
FILES="Makefile tests/Makefile"
|
||||||
|
for dir in $DIRS ; do
|
||||||
|
mkdir -p $dir
|
||||||
|
done
|
||||||
|
for f in $FILES ; do
|
||||||
|
ln -sf $source_path/$f $f
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
echo "SRC_PATH=$source_path" >> config.mak
|
||||||
|
|
||||||
|
diff $TMPH config.h >/dev/null 2>&1
|
||||||
|
if test $? -ne 0 ; then
|
||||||
|
mv -f $TMPH config.h
|
||||||
|
else
|
||||||
|
echo "config.h is unchanged"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
|
||||||
114
bazaar/Tcc/lib/doc/readme.txt
Normal file
114
bazaar/Tcc/lib/doc/readme.txt
Normal file
|
|
@ -0,0 +1,114 @@
|
||||||
|
|
||||||
|
TinyCC
|
||||||
|
======
|
||||||
|
|
||||||
|
This file contains some additional information for usage of TinyCC
|
||||||
|
under MS-Windows:
|
||||||
|
|
||||||
|
|
||||||
|
Overview:
|
||||||
|
---------
|
||||||
|
TinyCC (aka TCC) is a small but hyperfast C compiler, written by
|
||||||
|
Fabrice Bellard.
|
||||||
|
|
||||||
|
TinyCC for MS-Windows can produce console applications, native
|
||||||
|
windows GUI programs and DLL's.
|
||||||
|
|
||||||
|
The package with under 300kb includes a complete C-compiler with
|
||||||
|
header files and basic system library support.
|
||||||
|
|
||||||
|
With the -run switch you can run C-sources without any linking
|
||||||
|
directly from the command line.
|
||||||
|
|
||||||
|
TinyCC can be used as dynamic code generator library in your own
|
||||||
|
program.
|
||||||
|
|
||||||
|
TinyCC can of course compile itself.
|
||||||
|
|
||||||
|
|
||||||
|
Compilation: (omit that if you use the binary ZIP package)
|
||||||
|
------------
|
||||||
|
You can use the MinGW and MSYS tools available at
|
||||||
|
http://www.mingw.org to compile TCC for Windows. Untar the TCC
|
||||||
|
archive and type in the MSYS shell:
|
||||||
|
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
TCC is installed in c:\Program Files\tcc
|
||||||
|
|
||||||
|
Alternatively you can use win32\build-tcc.bat to compile TCC
|
||||||
|
with just gcc and ar from MINGW. To install, copy the entire
|
||||||
|
contents of the win32 directory to where you want.
|
||||||
|
|
||||||
|
|
||||||
|
Installation: (from the binary ZIP package)
|
||||||
|
-------------
|
||||||
|
Just unzip the package to a directory anywhere on your computer.
|
||||||
|
|
||||||
|
The binary package does not include libtcc. If you want tcc as
|
||||||
|
dynamic code generator, please use the source code distribution.
|
||||||
|
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
---------
|
||||||
|
For the 'Fibonacci' console example type from the command line:
|
||||||
|
|
||||||
|
tcc examples\fib.c
|
||||||
|
|
||||||
|
For the 'Hello Windows' GUI example:
|
||||||
|
|
||||||
|
tcc examples\hello_win.c
|
||||||
|
|
||||||
|
For the 'Hello DLL' example:
|
||||||
|
|
||||||
|
tcc -shared examples\dll.c
|
||||||
|
tcc examples\hello_dll.c examples\dll.def
|
||||||
|
|
||||||
|
|
||||||
|
Import Definition Files:
|
||||||
|
------------------------
|
||||||
|
To link with Windows system DLLs, TinyCC uses import definition
|
||||||
|
files (.def) instead of libraries.
|
||||||
|
|
||||||
|
The included 'tiny_impdef' program may be used to make additional
|
||||||
|
.def files for any DLL. For example:
|
||||||
|
|
||||||
|
tiny_impdef.exe opengl32.dll
|
||||||
|
|
||||||
|
To use it, put the opengl32.def file into the tcc/lib directory,
|
||||||
|
and specify -lopengl32 at the tcc commandline.
|
||||||
|
|
||||||
|
|
||||||
|
Resource Files:
|
||||||
|
---------------
|
||||||
|
TinyCC-PE can now link windows resources in coff format as generated
|
||||||
|
by MINGW's windres.exe. For example:
|
||||||
|
|
||||||
|
windres -O coff app.rc -o appres.o
|
||||||
|
tcc app.c appres.o -o app.exe
|
||||||
|
|
||||||
|
|
||||||
|
Tiny Libmaker:
|
||||||
|
--------------
|
||||||
|
The included tiny_libmaker tool by Timovj Lahde can be used as
|
||||||
|
'ar' replacement to make a library from several object files.
|
||||||
|
|
||||||
|
|
||||||
|
Header Files:
|
||||||
|
-------------
|
||||||
|
The system header files (except _mingw.h) are from the mingw
|
||||||
|
distribution (http://www.mingw.org/).
|
||||||
|
|
||||||
|
|
||||||
|
Documentation and License:
|
||||||
|
--------------------------
|
||||||
|
TCC is distributed under the GNU Lesser General Public License
|
||||||
|
(see COPYING file).
|
||||||
|
|
||||||
|
Please read tcc-doc.html to have all the features of TCC. Also
|
||||||
|
visit: http://fabrice.bellard.free.fr/tcc/
|
||||||
|
|
||||||
|
|
||||||
|
-- grischka@users.sourceforge.net
|
||||||
2331
bazaar/Tcc/lib/doc/tcc-doc.html
Normal file
2331
bazaar/Tcc/lib/doc/tcc-doc.html
Normal file
File diff suppressed because it is too large
Load diff
1633
bazaar/Tcc/lib/elf.h
Normal file
1633
bazaar/Tcc/lib/elf.h
Normal file
File diff suppressed because it is too large
Load diff
57
bazaar/Tcc/lib/float.h
Normal file
57
bazaar/Tcc/lib/float.h
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
#ifndef _FLOAT_H_
|
||||||
|
#define _FLOAT_H_
|
||||||
|
|
||||||
|
#define FLT_RADIX 2
|
||||||
|
|
||||||
|
/* IEEE float */
|
||||||
|
#define FLT_MANT_DIG 24
|
||||||
|
#define FLT_DIG 6
|
||||||
|
#define FLT_ROUNDS 1
|
||||||
|
#define FLT_EPSILON 1.19209290e-07F
|
||||||
|
#define FLT_MIN_EXP (-125)
|
||||||
|
#define FLT_MIN 1.17549435e-38F
|
||||||
|
#define FLT_MIN_10_EXP (-37)
|
||||||
|
#define FLT_MAX_EXP 128
|
||||||
|
#define FLT_MAX 3.40282347e+38F
|
||||||
|
#define FLT_MAX_10_EXP 38
|
||||||
|
|
||||||
|
/* IEEE double */
|
||||||
|
#define DBL_MANT_DIG 53
|
||||||
|
#define DBL_DIG 15
|
||||||
|
#define DBL_EPSILON 2.2204460492503131e-16
|
||||||
|
#define DBL_MIN_EXP (-1021)
|
||||||
|
#define DBL_MIN 2.2250738585072014e-308
|
||||||
|
#define DBL_MIN_10_EXP (-307)
|
||||||
|
#define DBL_MAX_EXP 1024
|
||||||
|
#define DBL_MAX 1.7976931348623157e+308
|
||||||
|
#define DBL_MAX_10_EXP 308
|
||||||
|
|
||||||
|
/* horrible intel long double */
|
||||||
|
#ifdef __i386__
|
||||||
|
|
||||||
|
#define LDBL_MANT_DIG 64
|
||||||
|
#define LDBL_DIG 18
|
||||||
|
#define LDBL_EPSILON 1.08420217248550443401e-19L
|
||||||
|
#define LDBL_MIN_EXP (-16381)
|
||||||
|
#define LDBL_MIN 3.36210314311209350626e-4932L
|
||||||
|
#define LDBL_MIN_10_EXP (-4931)
|
||||||
|
#define LDBL_MAX_EXP 16384
|
||||||
|
#define LDBL_MAX 1.18973149535723176502e+4932L
|
||||||
|
#define LDBL_MAX_10_EXP 4932
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* same as IEEE double */
|
||||||
|
#define LDBL_MANT_DIG 53
|
||||||
|
#define LDBL_DIG 15
|
||||||
|
#define LDBL_EPSILON 2.2204460492503131e-16
|
||||||
|
#define LDBL_MIN_EXP (-1021)
|
||||||
|
#define LDBL_MIN 2.2250738585072014e-308
|
||||||
|
#define LDBL_MIN_10_EXP (-307)
|
||||||
|
#define LDBL_MAX_EXP 1024
|
||||||
|
#define LDBL_MAX 1.7976931348623157e+308
|
||||||
|
#define LDBL_MAX_10_EXP 308
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _FLOAT_H_ */
|
||||||
33
bazaar/Tcc/lib/gcctestsuite.sh
Normal file
33
bazaar/Tcc/lib/gcctestsuite.sh
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
TESTSUITE_PATH=$HOME/gcc/gcc-3.2/gcc/testsuite/gcc.c-torture
|
||||||
|
TCC="./tcc -B. -I. -DNO_TRAMPOLINES"
|
||||||
|
rm -f tcc.sum tcc.log
|
||||||
|
nb_failed="0"
|
||||||
|
|
||||||
|
for src in $TESTSUITE_PATH/compile/*.c ; do
|
||||||
|
echo $TCC -o /tmp/test.o -c $src
|
||||||
|
$TCC -o /tmp/test.o -c $src >> tcc.log 2>&1
|
||||||
|
if [ "$?" == "0" ] ; then
|
||||||
|
result="PASS"
|
||||||
|
else
|
||||||
|
result="FAIL"
|
||||||
|
nb_failed=$[ $nb_failed + 1 ]
|
||||||
|
fi
|
||||||
|
echo "$result: $src" >> tcc.sum
|
||||||
|
done
|
||||||
|
|
||||||
|
for src in $TESTSUITE_PATH/execute/*.c ; do
|
||||||
|
echo $TCC $src
|
||||||
|
$TCC $src >> tcc.log 2>&1
|
||||||
|
if [ "$?" == "0" ] ; then
|
||||||
|
result="PASS"
|
||||||
|
else
|
||||||
|
result="FAIL"
|
||||||
|
nb_failed=$[ $nb_failed + 1 ]
|
||||||
|
fi
|
||||||
|
echo "$result: $src" >> tcc.sum
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "$nb_failed test(s) failed." >> tcc.sum
|
||||||
|
echo "$nb_failed test(s) failed."
|
||||||
1211
bazaar/Tcc/lib/i386-asm.c
Normal file
1211
bazaar/Tcc/lib/i386-asm.c
Normal file
File diff suppressed because it is too large
Load diff
446
bazaar/Tcc/lib/i386-asm.h
Normal file
446
bazaar/Tcc/lib/i386-asm.h
Normal file
|
|
@ -0,0 +1,446 @@
|
||||||
|
DEF_ASM_OP0(pusha, 0x60) /* must be first OP0 */
|
||||||
|
DEF_ASM_OP0(popa, 0x61)
|
||||||
|
DEF_ASM_OP0(clc, 0xf8)
|
||||||
|
DEF_ASM_OP0(cld, 0xfc)
|
||||||
|
DEF_ASM_OP0(cli, 0xfa)
|
||||||
|
DEF_ASM_OP0(clts, 0x0f06)
|
||||||
|
DEF_ASM_OP0(cmc, 0xf5)
|
||||||
|
DEF_ASM_OP0(lahf, 0x9f)
|
||||||
|
DEF_ASM_OP0(sahf, 0x9e)
|
||||||
|
DEF_ASM_OP0(pushfl, 0x9c)
|
||||||
|
DEF_ASM_OP0(popfl, 0x9d)
|
||||||
|
DEF_ASM_OP0(pushf, 0x9c)
|
||||||
|
DEF_ASM_OP0(popf, 0x9d)
|
||||||
|
DEF_ASM_OP0(stc, 0xf9)
|
||||||
|
DEF_ASM_OP0(std, 0xfd)
|
||||||
|
DEF_ASM_OP0(sti, 0xfb)
|
||||||
|
DEF_ASM_OP0(aaa, 0x37)
|
||||||
|
DEF_ASM_OP0(aas, 0x3f)
|
||||||
|
DEF_ASM_OP0(daa, 0x27)
|
||||||
|
DEF_ASM_OP0(das, 0x2f)
|
||||||
|
DEF_ASM_OP0(aad, 0xd50a)
|
||||||
|
DEF_ASM_OP0(aam, 0xd40a)
|
||||||
|
DEF_ASM_OP0(cbw, 0x6698)
|
||||||
|
DEF_ASM_OP0(cwd, 0x6699)
|
||||||
|
DEF_ASM_OP0(cwde, 0x98)
|
||||||
|
DEF_ASM_OP0(cdq, 0x99)
|
||||||
|
DEF_ASM_OP0(cbtw, 0x6698)
|
||||||
|
DEF_ASM_OP0(cwtl, 0x98)
|
||||||
|
DEF_ASM_OP0(cwtd, 0x6699)
|
||||||
|
DEF_ASM_OP0(cltd, 0x99)
|
||||||
|
DEF_ASM_OP0(int3, 0xcc)
|
||||||
|
DEF_ASM_OP0(into, 0xce)
|
||||||
|
DEF_ASM_OP0(iret, 0xcf)
|
||||||
|
DEF_ASM_OP0(rsm, 0x0faa)
|
||||||
|
DEF_ASM_OP0(hlt, 0xf4)
|
||||||
|
DEF_ASM_OP0(wait, 0x9b)
|
||||||
|
DEF_ASM_OP0(nop, 0x90)
|
||||||
|
DEF_ASM_OP0(xlat, 0xd7)
|
||||||
|
|
||||||
|
/* strings */
|
||||||
|
ALT(DEF_ASM_OP0L(cmpsb, 0xa6, 0, OPC_BWL))
|
||||||
|
ALT(DEF_ASM_OP0L(scmpb, 0xa6, 0, OPC_BWL))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP0L(insb, 0x6c, 0, OPC_BWL))
|
||||||
|
ALT(DEF_ASM_OP0L(outsb, 0x6e, 0, OPC_BWL))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP0L(lodsb, 0xac, 0, OPC_BWL))
|
||||||
|
ALT(DEF_ASM_OP0L(slodb, 0xac, 0, OPC_BWL))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP0L(movsb, 0xa4, 0, OPC_BWL))
|
||||||
|
ALT(DEF_ASM_OP0L(smovb, 0xa4, 0, OPC_BWL))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP0L(scasb, 0xae, 0, OPC_BWL))
|
||||||
|
ALT(DEF_ASM_OP0L(sscab, 0xae, 0, OPC_BWL))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP0L(stosb, 0xaa, 0, OPC_BWL))
|
||||||
|
ALT(DEF_ASM_OP0L(sstob, 0xaa, 0, OPC_BWL))
|
||||||
|
|
||||||
|
/* bits */
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(bsfw, 0x0fbc, 0, OPC_MODRM | OPC_WL, OPT_REGW | OPT_EA, OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP2(bsrw, 0x0fbd, 0, OPC_MODRM | OPC_WL, OPT_REGW | OPT_EA, OPT_REGW))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(btw, 0x0fa3, 0, OPC_MODRM | OPC_WL, OPT_REGW, OPT_REGW | OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP2(btw, 0x0fba, 4, OPC_MODRM | OPC_WL, OPT_IM8, OPT_REGW | OPT_EA))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(btsw, 0x0fab, 0, OPC_MODRM | OPC_WL, OPT_REGW, OPT_REGW | OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP2(btsw, 0x0fba, 5, OPC_MODRM | OPC_WL, OPT_IM8, OPT_REGW | OPT_EA))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(btrw, 0x0fb3, 0, OPC_MODRM | OPC_WL, OPT_REGW, OPT_REGW | OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP2(btrw, 0x0fba, 6, OPC_MODRM | OPC_WL, OPT_IM8, OPT_REGW | OPT_EA))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(btcw, 0x0fbb, 0, OPC_MODRM | OPC_WL, OPT_REGW, OPT_REGW | OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP2(btcw, 0x0fba, 7, OPC_MODRM | OPC_WL, OPT_IM8, OPT_REGW | OPT_EA))
|
||||||
|
|
||||||
|
/* prefixes */
|
||||||
|
DEF_ASM_OP0(aword, 0x67)
|
||||||
|
DEF_ASM_OP0(addr16, 0x67)
|
||||||
|
DEF_ASM_OP0(word, 0x66)
|
||||||
|
DEF_ASM_OP0(data16, 0x66)
|
||||||
|
DEF_ASM_OP0(lock, 0xf0)
|
||||||
|
DEF_ASM_OP0(rep, 0xf3)
|
||||||
|
DEF_ASM_OP0(repe, 0xf3)
|
||||||
|
DEF_ASM_OP0(repz, 0xf3)
|
||||||
|
DEF_ASM_OP0(repne, 0xf2)
|
||||||
|
DEF_ASM_OP0(repnz, 0xf2)
|
||||||
|
|
||||||
|
DEF_ASM_OP0(invd, 0x0f08)
|
||||||
|
DEF_ASM_OP0(wbinvd, 0x0f09)
|
||||||
|
DEF_ASM_OP0(cpuid, 0x0fa2)
|
||||||
|
DEF_ASM_OP0(wrmsr, 0x0f30)
|
||||||
|
DEF_ASM_OP0(rdtsc, 0x0f31)
|
||||||
|
DEF_ASM_OP0(rdmsr, 0x0f32)
|
||||||
|
DEF_ASM_OP0(rdpmc, 0x0f33)
|
||||||
|
DEF_ASM_OP0(ud2, 0x0f0b)
|
||||||
|
|
||||||
|
/* NOTE: we took the same order as gas opcode definition order */
|
||||||
|
ALT(DEF_ASM_OP2(movb, 0xa0, 0, OPC_BWL, OPT_ADDR, OPT_EAX))
|
||||||
|
ALT(DEF_ASM_OP2(movb, 0xa2, 0, OPC_BWL, OPT_EAX, OPT_ADDR))
|
||||||
|
ALT(DEF_ASM_OP2(movb, 0x88, 0, OPC_MODRM | OPC_BWL, OPT_REG, OPT_EA | OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP2(movb, 0x8a, 0, OPC_MODRM | OPC_BWL, OPT_EA | OPT_REG, OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP2(movb, 0xb0, 0, OPC_REG | OPC_BWL, OPT_IM, OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP2(movb, 0xc6, 0, OPC_MODRM | OPC_BWL, OPT_IM, OPT_REG | OPT_EA))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(movw, 0x8c, 0, OPC_MODRM | OPC_WL, OPT_SEG, OPT_EA | OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP2(movw, 0x8e, 0, OPC_MODRM | OPC_WL, OPT_EA | OPT_REG, OPT_SEG))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(movw, 0x0f20, 0, OPC_MODRM | OPC_WL, OPT_CR, OPT_REG32))
|
||||||
|
ALT(DEF_ASM_OP2(movw, 0x0f21, 0, OPC_MODRM | OPC_WL, OPT_DB, OPT_REG32))
|
||||||
|
ALT(DEF_ASM_OP2(movw, 0x0f24, 0, OPC_MODRM | OPC_WL, OPT_TR, OPT_REG32))
|
||||||
|
ALT(DEF_ASM_OP2(movw, 0x0f22, 0, OPC_MODRM | OPC_WL, OPT_REG32, OPT_CR))
|
||||||
|
ALT(DEF_ASM_OP2(movw, 0x0f23, 0, OPC_MODRM | OPC_WL, OPT_REG32, OPT_DB))
|
||||||
|
ALT(DEF_ASM_OP2(movw, 0x0f26, 0, OPC_MODRM | OPC_WL, OPT_REG32, OPT_TR))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(movsbl, 0x0fbe, 0, OPC_MODRM, OPT_REG8 | OPT_EA, OPT_REG32))
|
||||||
|
ALT(DEF_ASM_OP2(movsbw, 0x0fbe, 0, OPC_MODRM | OPC_D16, OPT_REG8 | OPT_EA, OPT_REG16))
|
||||||
|
ALT(DEF_ASM_OP2(movswl, 0x0fbf, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG32))
|
||||||
|
ALT(DEF_ASM_OP2(movzbw, 0x0fb6, 0, OPC_MODRM | OPC_WL, OPT_REG8 | OPT_EA, OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP2(movzwl, 0x0fb7, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG32))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP1(pushw, 0x50, 0, OPC_REG | OPC_WL, OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP1(pushw, 0xff, 6, OPC_MODRM | OPC_WL, OPT_REGW | OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP1(pushw, 0x6a, 0, OPC_WL, OPT_IM8S))
|
||||||
|
ALT(DEF_ASM_OP1(pushw, 0x68, 0, OPC_WL, OPT_IM32))
|
||||||
|
ALT(DEF_ASM_OP1(pushw, 0x06, 0, OPC_WL, OPT_SEG))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP1(popw, 0x58, 0, OPC_REG | OPC_WL, OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP1(popw, 0x8f, 0, OPC_MODRM | OPC_WL, OPT_REGW | OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP1(popw, 0x07, 0, OPC_WL, OPT_SEG))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(xchgw, 0x90, 0, OPC_REG | OPC_WL, OPT_REG, OPT_EAX))
|
||||||
|
ALT(DEF_ASM_OP2(xchgw, 0x90, 0, OPC_REG | OPC_WL, OPT_EAX, OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP2(xchgb, 0x86, 0, OPC_MODRM | OPC_BWL, OPT_REG, OPT_EA | OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP2(xchgb, 0x86, 0, OPC_MODRM | OPC_BWL, OPT_EA | OPT_REG, OPT_REG))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(inb, 0xe4, 0, OPC_BWL, OPT_IM8, OPT_EAX))
|
||||||
|
ALT(DEF_ASM_OP1(inb, 0xe4, 0, OPC_BWL, OPT_IM8))
|
||||||
|
ALT(DEF_ASM_OP2(inb, 0xec, 0, OPC_BWL, OPT_DX, OPT_EAX))
|
||||||
|
ALT(DEF_ASM_OP1(inb, 0xec, 0, OPC_BWL, OPT_DX))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(outb, 0xe6, 0, OPC_BWL, OPT_EAX, OPT_IM8))
|
||||||
|
ALT(DEF_ASM_OP1(outb, 0xe6, 0, OPC_BWL, OPT_IM8))
|
||||||
|
ALT(DEF_ASM_OP2(outb, 0xee, 0, OPC_BWL, OPT_EAX, OPT_DX))
|
||||||
|
ALT(DEF_ASM_OP1(outb, 0xee, 0, OPC_BWL, OPT_DX))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(leaw, 0x8d, 0, OPC_MODRM | OPC_WL, OPT_EA, OPT_REG))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(les, 0xc4, 0, OPC_MODRM, OPT_EA, OPT_REG32))
|
||||||
|
ALT(DEF_ASM_OP2(lds, 0xc5, 0, OPC_MODRM, OPT_EA, OPT_REG32))
|
||||||
|
ALT(DEF_ASM_OP2(lss, 0x0fb2, 0, OPC_MODRM, OPT_EA, OPT_REG32))
|
||||||
|
ALT(DEF_ASM_OP2(lfs, 0x0fb4, 0, OPC_MODRM, OPT_EA, OPT_REG32))
|
||||||
|
ALT(DEF_ASM_OP2(lgs, 0x0fb5, 0, OPC_MODRM, OPT_EA, OPT_REG32))
|
||||||
|
|
||||||
|
/* arith */
|
||||||
|
ALT(DEF_ASM_OP2(addb, 0x00, 0, OPC_ARITH | OPC_MODRM | OPC_BWL, OPT_REG, OPT_EA | OPT_REG)) /* XXX: use D bit ? */
|
||||||
|
ALT(DEF_ASM_OP2(addb, 0x02, 0, OPC_ARITH | OPC_MODRM | OPC_BWL, OPT_EA | OPT_REG, OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP2(addb, 0x04, 0, OPC_ARITH | OPC_BWL, OPT_IM, OPT_EAX))
|
||||||
|
ALT(DEF_ASM_OP2(addb, 0x80, 0, OPC_ARITH | OPC_MODRM | OPC_BWL, OPT_IM, OPT_EA | OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP2(addw, 0x83, 0, OPC_ARITH | OPC_MODRM | OPC_WL, OPT_IM8S, OPT_EA | OPT_REG))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(testb, 0x84, 0, OPC_MODRM | OPC_BWL, OPT_EA | OPT_REG, OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP2(testb, 0x84, 0, OPC_MODRM | OPC_BWL, OPT_REG, OPT_EA | OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP2(testb, 0xa8, 0, OPC_BWL, OPT_IM, OPT_EAX))
|
||||||
|
ALT(DEF_ASM_OP2(testb, 0xf6, 0, OPC_MODRM | OPC_BWL, OPT_IM, OPT_EA | OPT_REG))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP1(incw, 0x40, 0, OPC_REG | OPC_WL, OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP1(incb, 0xfe, 0, OPC_MODRM | OPC_BWL, OPT_REG | OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP1(decw, 0x48, 0, OPC_REG | OPC_WL, OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP1(decb, 0xfe, 1, OPC_MODRM | OPC_BWL, OPT_REG | OPT_EA))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP1(notb, 0xf6, 2, OPC_MODRM | OPC_BWL, OPT_REG | OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP1(negb, 0xf6, 3, OPC_MODRM | OPC_BWL, OPT_REG | OPT_EA))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP1(mulb, 0xf6, 4, OPC_MODRM | OPC_BWL, OPT_REG | OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP1(imulb, 0xf6, 5, OPC_MODRM | OPC_BWL, OPT_REG | OPT_EA))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(imulw, 0x0faf, 0, OPC_MODRM | OPC_WL, OPT_REG | OPT_EA, OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP3(imulw, 0x6b, 0, OPC_MODRM | OPC_WL, OPT_IM8S, OPT_REGW | OPT_EA, OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP2(imulw, 0x6b, 0, OPC_MODRM | OPC_WL, OPT_IM8S, OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP3(imulw, 0x69, 0, OPC_MODRM | OPC_WL, OPT_IMW, OPT_REGW | OPT_EA, OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP2(imulw, 0x69, 0, OPC_MODRM | OPC_WL, OPT_IMW, OPT_REGW))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP1(divb, 0xf6, 6, OPC_MODRM | OPC_BWL, OPT_REG | OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP2(divb, 0xf6, 6, OPC_MODRM | OPC_BWL, OPT_REG | OPT_EA, OPT_EAX))
|
||||||
|
ALT(DEF_ASM_OP1(idivb, 0xf6, 7, OPC_MODRM | OPC_BWL, OPT_REG | OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP2(idivb, 0xf6, 7, OPC_MODRM | OPC_BWL, OPT_REG | OPT_EA, OPT_EAX))
|
||||||
|
|
||||||
|
/* shifts */
|
||||||
|
ALT(DEF_ASM_OP2(rolb, 0xc0, 0, OPC_MODRM | OPC_BWL | OPC_SHIFT, OPT_IM8, OPT_EA | OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP2(rolb, 0xd2, 0, OPC_MODRM | OPC_BWL | OPC_SHIFT, OPT_CL, OPT_EA | OPT_REG))
|
||||||
|
ALT(DEF_ASM_OP1(rolb, 0xd0, 0, OPC_MODRM | OPC_BWL | OPC_SHIFT, OPT_EA | OPT_REG))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP3(shldw, 0x0fa4, 0, OPC_MODRM | OPC_WL, OPT_IM8, OPT_REGW, OPT_EA | OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP3(shldw, 0x0fa5, 0, OPC_MODRM | OPC_WL, OPT_CL, OPT_REGW, OPT_EA | OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP2(shldw, 0x0fa5, 0, OPC_MODRM | OPC_WL, OPT_REGW, OPT_EA | OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP3(shrdw, 0x0fac, 0, OPC_MODRM | OPC_WL, OPT_IM8, OPT_REGW, OPT_EA | OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP3(shrdw, 0x0fad, 0, OPC_MODRM | OPC_WL, OPT_CL, OPT_REGW, OPT_EA | OPT_REGW))
|
||||||
|
ALT(DEF_ASM_OP2(shrdw, 0x0fad, 0, OPC_MODRM | OPC_WL, OPT_REGW, OPT_EA | OPT_REGW))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP1(call, 0xff, 2, OPC_MODRM, OPT_INDIR))
|
||||||
|
ALT(DEF_ASM_OP1(call, 0xe8, 0, OPC_JMP, OPT_ADDR))
|
||||||
|
ALT(DEF_ASM_OP1(jmp, 0xff, 4, OPC_MODRM, OPT_INDIR))
|
||||||
|
ALT(DEF_ASM_OP1(jmp, 0xeb, 0, OPC_SHORTJMP | OPC_JMP, OPT_ADDR))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP2(lcall, 0x9a, 0, 0, OPT_IM16, OPT_IM32))
|
||||||
|
ALT(DEF_ASM_OP1(lcall, 0xff, 3, 0, OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP2(ljmp, 0xea, 0, 0, OPT_IM16, OPT_IM32))
|
||||||
|
ALT(DEF_ASM_OP1(ljmp, 0xff, 5, 0, OPT_EA))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP1(int, 0xcd, 0, 0, OPT_IM8))
|
||||||
|
ALT(DEF_ASM_OP1(seto, 0x0f90, 0, OPC_MODRM | OPC_TEST, OPT_REG8 | OPT_EA))
|
||||||
|
DEF_ASM_OP2(enter, 0xc8, 0, 0, OPT_IM16, OPT_IM8)
|
||||||
|
DEF_ASM_OP0(leave, 0xc9)
|
||||||
|
DEF_ASM_OP0(ret, 0xc3)
|
||||||
|
ALT(DEF_ASM_OP1(ret, 0xc2, 0, 0, OPT_IM16))
|
||||||
|
DEF_ASM_OP0(lret, 0xcb)
|
||||||
|
ALT(DEF_ASM_OP1(lret, 0xca, 0, 0, OPT_IM16))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP1(jo, 0x70, 0, OPC_SHORTJMP | OPC_JMP | OPC_TEST, OPT_ADDR))
|
||||||
|
DEF_ASM_OP1(loopne, 0xe0, 0, OPC_SHORTJMP, OPT_ADDR)
|
||||||
|
DEF_ASM_OP1(loopnz, 0xe0, 0, OPC_SHORTJMP, OPT_ADDR)
|
||||||
|
DEF_ASM_OP1(loope, 0xe1, 0, OPC_SHORTJMP, OPT_ADDR)
|
||||||
|
DEF_ASM_OP1(loopz, 0xe1, 0, OPC_SHORTJMP, OPT_ADDR)
|
||||||
|
DEF_ASM_OP1(loop, 0xe2, 0, OPC_SHORTJMP, OPT_ADDR)
|
||||||
|
DEF_ASM_OP1(jecxz, 0xe3, 0, OPC_SHORTJMP, OPT_ADDR)
|
||||||
|
|
||||||
|
/* float */
|
||||||
|
/* specific fcomp handling */
|
||||||
|
ALT(DEF_ASM_OP0L(fcomp, 0xd8d9, 0, 0))
|
||||||
|
|
||||||
|
ALT(DEF_ASM_OP1(fadd, 0xd8c0, 0, OPC_FARITH | OPC_REG, OPT_ST))
|
||||||
|
ALT(DEF_ASM_OP2(fadd, 0xd8c0, 0, OPC_FARITH | OPC_REG, OPT_ST, OPT_ST0))
|
||||||
|
ALT(DEF_ASM_OP0L(fadd, 0xdec1, 0, OPC_FARITH))
|
||||||
|
ALT(DEF_ASM_OP1(faddp, 0xdec0, 0, OPC_FARITH | OPC_REG, OPT_ST))
|
||||||
|
ALT(DEF_ASM_OP2(faddp, 0xdec0, 0, OPC_FARITH | OPC_REG, OPT_ST, OPT_ST0))
|
||||||
|
ALT(DEF_ASM_OP2(faddp, 0xdec0, 0, OPC_FARITH | OPC_REG, OPT_ST0, OPT_ST))
|
||||||
|
ALT(DEF_ASM_OP0L(faddp, 0xdec1, 0, OPC_FARITH))
|
||||||
|
ALT(DEF_ASM_OP1(fadds, 0xd8, 0, OPC_FARITH | OPC_MODRM, OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP1(fiaddl, 0xda, 0, OPC_FARITH | OPC_MODRM, OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP1(faddl, 0xdc, 0, OPC_FARITH | OPC_MODRM, OPT_EA))
|
||||||
|
ALT(DEF_ASM_OP1(fiadds, 0xde, 0, OPC_FARITH | OPC_MODRM, OPT_EA))
|
||||||
|
|
||||||
|
DEF_ASM_OP0(fucompp, 0xdae9)
|
||||||
|
DEF_ASM_OP0(ftst, 0xd9e4)
|
||||||
|
DEF_ASM_OP0(fxam, 0xd9e5)
|
||||||
|
DEF_ASM_OP0(fld1, 0xd9e8)
|
||||||
|
DEF_ASM_OP0(fldl2t, 0xd9e9)
|
||||||
|
DEF_ASM_OP0(fldl2e, 0xd9ea)
|
||||||
|
DEF_ASM_OP0(fldpi, 0xd9eb)
|
||||||
|
DEF_ASM_OP0(fldlg2, 0xd9ec)
|
||||||
|
DEF_ASM_OP0(fldln2, 0xd9ed)
|
||||||
|
DEF_ASM_OP0(fldz, 0xd9ee)
|
||||||
|
|
||||||
|
DEF_ASM_OP0(f2xm1, 0xd9f0)
|
||||||
|
DEF_ASM_OP0(fyl2x, 0xd9f1)
|
||||||
|
DEF_ASM_OP0(fptan, 0xd9f2)
|
||||||
|
DEF_ASM_OP0(fpatan, 0xd9f3)
|
||||||
|
DEF_ASM_OP0(fxtract, 0xd9f4)
|
||||||
|
DEF_ASM_OP0(fprem1, 0xd9f5)
|
||||||
|
DEF_ASM_OP0(fdecstp, 0xd9f6)
|
||||||
|
DEF_ASM_OP0(fincstp, 0xd9f7)
|
||||||
|
DEF_ASM_OP0(fprem, 0xd9f8)
|
||||||
|
DEF_ASM_OP0(fyl2xp1, 0xd9f9)
|
||||||
|
DEF_ASM_OP0(fsqrt, 0xd9fa)
|
||||||
|
DEF_ASM_OP0(fsincos, 0xd9fb)
|
||||||
|
DEF_ASM_OP0(frndint, 0xd9fc)
|
||||||
|
DEF_ASM_OP0(fscale, 0xd9fd)
|
||||||
|
DEF_ASM_OP0(fsin, 0xd9fe)
|
||||||
|
DEF_ASM_OP0(fcos, 0xd9ff)
|
||||||
|
DEF_ASM_OP0(fchs, 0xd9e0)
|
||||||
|
DEF_ASM_OP0(fabs, 0xd9e1)
|
||||||
|
DEF_ASM_OP0(fninit, 0xdbe3)
|
||||||
|
DEF_ASM_OP0(fnclex, 0xdbe2)
|
||||||
|
DEF_ASM_OP0(fnop, 0xd9d0)
|
||||||
|
DEF_ASM_OP0(fwait, 0x9b)
|
||||||
|
|
||||||
|
/* fp load */
|
||||||
|
DEF_ASM_OP1(fld, 0xd9c0, 0, OPC_REG, OPT_ST)
|
||||||
|
DEF_ASM_OP1(fldl, 0xd9c0, 0, OPC_REG, OPT_ST)
|
||||||
|
DEF_ASM_OP1(flds, 0xd9, 0, OPC_MODRM, OPT_EA)
|
||||||
|
ALT(DEF_ASM_OP1(fldl, 0xdd, 0, OPC_MODRM, OPT_EA))
|
||||||
|
DEF_ASM_OP1(fildl, 0xdb, 0, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(fildq, 0xdf, 5, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(fildll, 0xdf, 5, OPC_MODRM,OPT_EA)
|
||||||
|
DEF_ASM_OP1(fldt, 0xdb, 5, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(fbld, 0xdf, 4, OPC_MODRM, OPT_EA)
|
||||||
|
|
||||||
|
/* fp store */
|
||||||
|
DEF_ASM_OP1(fst, 0xddd0, 0, OPC_REG, OPT_ST)
|
||||||
|
DEF_ASM_OP1(fstl, 0xddd0, 0, OPC_REG, OPT_ST)
|
||||||
|
DEF_ASM_OP1(fsts, 0xd9, 2, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(fstps, 0xd9, 3, OPC_MODRM, OPT_EA)
|
||||||
|
ALT(DEF_ASM_OP1(fstl, 0xdd, 2, OPC_MODRM, OPT_EA))
|
||||||
|
DEF_ASM_OP1(fstpl, 0xdd, 3, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(fist, 0xdf, 2, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(fistp, 0xdf, 3, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(fistl, 0xdb, 2, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(fistpl, 0xdb, 3, OPC_MODRM, OPT_EA)
|
||||||
|
|
||||||
|
DEF_ASM_OP1(fstp, 0xddd8, 0, OPC_REG, OPT_ST)
|
||||||
|
DEF_ASM_OP1(fistpq, 0xdf, 7, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(fistpll, 0xdf, 7, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(fstpt, 0xdb, 7, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(fbstp, 0xdf, 6, OPC_MODRM, OPT_EA)
|
||||||
|
|
||||||
|
/* exchange */
|
||||||
|
DEF_ASM_OP0(fxch, 0xd9c9)
|
||||||
|
ALT(DEF_ASM_OP1(fxch, 0xd9c8, 0, OPC_REG, OPT_ST))
|
||||||
|
|
||||||
|
/* misc FPU */
|
||||||
|
DEF_ASM_OP1(fucom, 0xdde0, 0, OPC_REG, OPT_ST )
|
||||||
|
DEF_ASM_OP1(fucomp, 0xdde8, 0, OPC_REG, OPT_ST )
|
||||||
|
|
||||||
|
DEF_ASM_OP0L(finit, 0xdbe3, 0, OPC_FWAIT)
|
||||||
|
DEF_ASM_OP1(fldcw, 0xd9, 5, OPC_MODRM, OPT_EA )
|
||||||
|
DEF_ASM_OP1(fnstcw, 0xd9, 7, OPC_MODRM, OPT_EA )
|
||||||
|
DEF_ASM_OP1(fstcw, 0xd9, 7, OPC_MODRM | OPC_FWAIT, OPT_EA )
|
||||||
|
DEF_ASM_OP0(fnstsw, 0xdfe0)
|
||||||
|
ALT(DEF_ASM_OP1(fnstsw, 0xdfe0, 0, 0, OPT_EAX ))
|
||||||
|
ALT(DEF_ASM_OP1(fnstsw, 0xdd, 7, OPC_MODRM, OPT_EA ))
|
||||||
|
DEF_ASM_OP1(fstsw, 0xdfe0, 0, OPC_FWAIT, OPT_EAX )
|
||||||
|
ALT(DEF_ASM_OP0L(fstsw, 0xdfe0, 0, OPC_FWAIT))
|
||||||
|
ALT(DEF_ASM_OP1(fstsw, 0xdd, 7, OPC_MODRM | OPC_FWAIT, OPT_EA ))
|
||||||
|
DEF_ASM_OP0L(fclex, 0xdbe2, 0, OPC_FWAIT)
|
||||||
|
DEF_ASM_OP1(fnstenv, 0xd9, 6, OPC_MODRM, OPT_EA )
|
||||||
|
DEF_ASM_OP1(fstenv, 0xd9, 6, OPC_MODRM | OPC_FWAIT, OPT_EA )
|
||||||
|
DEF_ASM_OP1(fldenv, 0xd9, 4, OPC_MODRM, OPT_EA )
|
||||||
|
DEF_ASM_OP1(fnsave, 0xdd, 6, OPC_MODRM, OPT_EA )
|
||||||
|
DEF_ASM_OP1(fsave, 0xdd, 6, OPC_MODRM | OPC_FWAIT, OPT_EA )
|
||||||
|
DEF_ASM_OP1(frstor, 0xdd, 4, OPC_MODRM, OPT_EA )
|
||||||
|
DEF_ASM_OP1(ffree, 0xddc0, 4, OPC_REG, OPT_ST )
|
||||||
|
DEF_ASM_OP1(ffreep, 0xdfc0, 4, OPC_REG, OPT_ST )
|
||||||
|
DEF_ASM_OP1(fxsave, 0x0fae, 0, OPC_MODRM, OPT_EA )
|
||||||
|
DEF_ASM_OP1(fxrstor, 0x0fae, 1, OPC_MODRM, OPT_EA )
|
||||||
|
|
||||||
|
/* segments */
|
||||||
|
DEF_ASM_OP2(arpl, 0x63, 0, OPC_MODRM, OPT_REG16, OPT_REG16 | OPT_EA)
|
||||||
|
DEF_ASM_OP2(lar, 0x0f02, 0, OPC_MODRM, OPT_REG32 | OPT_EA, OPT_REG32)
|
||||||
|
DEF_ASM_OP1(lgdt, 0x0f01, 2, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(lidt, 0x0f01, 3, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(lldt, 0x0f00, 2, OPC_MODRM, OPT_EA | OPT_REG)
|
||||||
|
DEF_ASM_OP1(lmsw, 0x0f01, 6, OPC_MODRM, OPT_EA | OPT_REG)
|
||||||
|
ALT(DEF_ASM_OP2(lslw, 0x0f03, 0, OPC_MODRM | OPC_WL, OPT_EA | OPT_REG, OPT_REG))
|
||||||
|
DEF_ASM_OP1(ltr, 0x0f00, 3, OPC_MODRM, OPT_EA | OPT_REG)
|
||||||
|
DEF_ASM_OP1(sgdt, 0x0f01, 0, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(sidt, 0x0f01, 1, OPC_MODRM, OPT_EA)
|
||||||
|
DEF_ASM_OP1(sldt, 0x0f00, 0, OPC_MODRM, OPT_REG | OPT_EA)
|
||||||
|
DEF_ASM_OP1(smsw, 0x0f01, 4, OPC_MODRM, OPT_REG | OPT_EA)
|
||||||
|
DEF_ASM_OP1(str, 0x0f00, 1, OPC_MODRM, OPT_REG16| OPT_EA)
|
||||||
|
DEF_ASM_OP1(verr, 0x0f00, 4, OPC_MODRM, OPT_REG | OPT_EA)
|
||||||
|
DEF_ASM_OP1(verw, 0x0f00, 5, OPC_MODRM, OPT_REG | OPT_EA)
|
||||||
|
|
||||||
|
/* 486 */
|
||||||
|
DEF_ASM_OP1(bswap, 0x0fc8, 0, OPC_REG, OPT_REG32 )
|
||||||
|
ALT(DEF_ASM_OP2(xaddb, 0x0fc0, 0, OPC_MODRM | OPC_BWL, OPT_REG, OPT_REG | OPT_EA ))
|
||||||
|
ALT(DEF_ASM_OP2(cmpxchgb, 0x0fb0, 0, OPC_MODRM | OPC_BWL, OPT_REG, OPT_REG | OPT_EA ))
|
||||||
|
DEF_ASM_OP1(invlpg, 0x0f01, 7, OPC_MODRM, OPT_EA )
|
||||||
|
|
||||||
|
DEF_ASM_OP2(boundl, 0x62, 0, OPC_MODRM, OPT_REG32, OPT_EA)
|
||||||
|
DEF_ASM_OP2(boundw, 0x62, 0, OPC_MODRM | OPC_D16, OPT_REG16, OPT_EA)
|
||||||
|
|
||||||
|
/* pentium */
|
||||||
|
DEF_ASM_OP1(cmpxchg8b, 0x0fc7, 1, OPC_MODRM, OPT_EA )
|
||||||
|
|
||||||
|
/* pentium pro */
|
||||||
|
ALT(DEF_ASM_OP2(cmovo, 0x0f40, 0, OPC_MODRM | OPC_TEST, OPT_REG32 | OPT_EA, OPT_REG32))
|
||||||
|
|
||||||
|
DEF_ASM_OP2(fcmovb, 0xdac0, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
DEF_ASM_OP2(fcmove, 0xdac8, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
DEF_ASM_OP2(fcmovbe, 0xdad0, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
DEF_ASM_OP2(fcmovu, 0xdad8, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
DEF_ASM_OP2(fcmovnb, 0xdbc0, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
DEF_ASM_OP2(fcmovne, 0xdbc8, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
DEF_ASM_OP2(fcmovnbe, 0xdbd0, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
DEF_ASM_OP2(fcmovnu, 0xdbd8, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
|
||||||
|
DEF_ASM_OP2(fucomi, 0xdbe8, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
DEF_ASM_OP2(fcomi, 0xdbf0, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
DEF_ASM_OP2(fucomip, 0xdfe8, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
DEF_ASM_OP2(fcomip, 0xdff0, 0, OPC_REG, OPT_ST, OPT_ST0 )
|
||||||
|
|
||||||
|
/* mmx */
|
||||||
|
DEF_ASM_OP0(emms, 0x0f77) /* must be last OP0 */
|
||||||
|
DEF_ASM_OP2(movd, 0x0f6e, 0, OPC_MODRM, OPT_EA | OPT_REG32, OPT_MMX )
|
||||||
|
ALT(DEF_ASM_OP2(movd, 0x0f7e, 0, OPC_MODRM, OPT_MMX, OPT_EA | OPT_REG32 ))
|
||||||
|
DEF_ASM_OP2(movq, 0x0f6f, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
ALT(DEF_ASM_OP2(movq, 0x0f7f, 0, OPC_MODRM, OPT_MMX, OPT_EA | OPT_MMX ))
|
||||||
|
DEF_ASM_OP2(packssdw, 0x0f6b, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(packsswb, 0x0f63, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(packuswb, 0x0f67, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(paddb, 0x0ffc, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(paddw, 0x0ffd, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(paddd, 0x0ffe, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(paddsb, 0x0fec, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(paddsw, 0x0fed, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(paddusb, 0x0fdc, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(paddusw, 0x0fdd, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pand, 0x0fdb, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pandn, 0x0fdf, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pcmpeqb, 0x0f74, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pcmpeqw, 0x0f75, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pcmpeqd, 0x0f76, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pcmpgtb, 0x0f64, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pcmpgtw, 0x0f65, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pcmpgtd, 0x0f66, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pmaddwd, 0x0ff5, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pmulhw, 0x0fe5, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pmullw, 0x0fd5, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(por, 0x0feb, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(psllw, 0x0ff1, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
ALT(DEF_ASM_OP2(psllw, 0x0f71, 6, OPC_MODRM, OPT_IM8, OPT_MMX ))
|
||||||
|
DEF_ASM_OP2(pslld, 0x0ff2, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
ALT(DEF_ASM_OP2(pslld, 0x0f72, 6, OPC_MODRM, OPT_IM8, OPT_MMX ))
|
||||||
|
DEF_ASM_OP2(psllq, 0x0ff3, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
ALT(DEF_ASM_OP2(psllq, 0x0f73, 6, OPC_MODRM, OPT_IM8, OPT_MMX ))
|
||||||
|
DEF_ASM_OP2(psraw, 0x0fe1, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
ALT(DEF_ASM_OP2(psraw, 0x0f71, 4, OPC_MODRM, OPT_IM8, OPT_MMX ))
|
||||||
|
DEF_ASM_OP2(psrad, 0x0fe2, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
ALT(DEF_ASM_OP2(psrad, 0x0f72, 4, OPC_MODRM, OPT_IM8, OPT_MMX ))
|
||||||
|
DEF_ASM_OP2(psrlw, 0x0fd1, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
ALT(DEF_ASM_OP2(psrlw, 0x0f71, 2, OPC_MODRM, OPT_IM8, OPT_MMX ))
|
||||||
|
DEF_ASM_OP2(psrld, 0x0fd2, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
ALT(DEF_ASM_OP2(psrld, 0x0f72, 2, OPC_MODRM, OPT_IM8, OPT_MMX ))
|
||||||
|
DEF_ASM_OP2(psrlq, 0x0fd3, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
ALT(DEF_ASM_OP2(psrlq, 0x0f73, 2, OPC_MODRM, OPT_IM8, OPT_MMX ))
|
||||||
|
DEF_ASM_OP2(psubb, 0x0ff8, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(psubw, 0x0ff9, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(psubd, 0x0ffa, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(psubsb, 0x0fe8, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(psubsw, 0x0fe9, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(psubusb, 0x0fd8, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(psubusw, 0x0fd9, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(punpckhbw, 0x0f68, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(punpckhwd, 0x0f69, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(punpckhdq, 0x0f6a, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(punpcklbw, 0x0f60, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(punpcklwd, 0x0f61, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(punpckldq, 0x0f62, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
DEF_ASM_OP2(pxor, 0x0fef, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
|
||||||
|
|
||||||
|
#undef ALT
|
||||||
|
#undef DEF_ASM_OP0
|
||||||
|
#undef DEF_ASM_OP0L
|
||||||
|
#undef DEF_ASM_OP1
|
||||||
|
#undef DEF_ASM_OP2
|
||||||
|
#undef DEF_ASM_OP3
|
||||||
1033
bazaar/Tcc/lib/i386-gen.c
Normal file
1033
bazaar/Tcc/lib/i386-gen.c
Normal file
File diff suppressed because it is too large
Load diff
667
bazaar/Tcc/lib/il-gen.c
Normal file
667
bazaar/Tcc/lib/il-gen.c
Normal file
|
|
@ -0,0 +1,667 @@
|
||||||
|
/*
|
||||||
|
* CIL code generator for TCC
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002 Fabrice Bellard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* number of available registers */
|
||||||
|
#define NB_REGS 3
|
||||||
|
|
||||||
|
/* a register can belong to several classes. The classes must be
|
||||||
|
sorted from more general to more precise (see gv2() code which does
|
||||||
|
assumptions on it). */
|
||||||
|
#define RC_ST 0x0001 /* any stack entry */
|
||||||
|
#define RC_ST0 0x0002 /* top of stack */
|
||||||
|
#define RC_ST1 0x0004 /* top - 1 */
|
||||||
|
|
||||||
|
#define RC_INT RC_ST
|
||||||
|
#define RC_FLOAT RC_ST
|
||||||
|
#define RC_IRET RC_ST0 /* function return: integer register */
|
||||||
|
#define RC_LRET RC_ST0 /* function return: second integer register */
|
||||||
|
#define RC_FRET RC_ST0 /* function return: float register */
|
||||||
|
|
||||||
|
/* pretty names for the registers */
|
||||||
|
enum {
|
||||||
|
REG_ST0 = 0,
|
||||||
|
REG_ST1,
|
||||||
|
REG_ST2,
|
||||||
|
};
|
||||||
|
|
||||||
|
int reg_classes[NB_REGS] = {
|
||||||
|
/* ST0 */ RC_ST | RC_ST0,
|
||||||
|
/* ST1 */ RC_ST | RC_ST1,
|
||||||
|
/* ST2 */ RC_ST,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* return registers for function */
|
||||||
|
#define REG_IRET REG_ST0 /* single word int return register */
|
||||||
|
#define REG_LRET REG_ST0 /* second word return register (for long long) */
|
||||||
|
#define REG_FRET REG_ST0 /* float return register */
|
||||||
|
|
||||||
|
/* defined if function parameters must be evaluated in reverse order */
|
||||||
|
//#define INVERT_FUNC_PARAMS
|
||||||
|
|
||||||
|
/* defined if structures are passed as pointers. Otherwise structures
|
||||||
|
are directly pushed on stack. */
|
||||||
|
//#define FUNC_STRUCT_PARAM_AS_PTR
|
||||||
|
|
||||||
|
/* pointer size, in bytes */
|
||||||
|
#define PTR_SIZE 4
|
||||||
|
|
||||||
|
/* long double size and alignment, in bytes */
|
||||||
|
#define LDOUBLE_SIZE 8
|
||||||
|
#define LDOUBLE_ALIGN 8
|
||||||
|
|
||||||
|
/* function call context */
|
||||||
|
typedef struct GFuncContext {
|
||||||
|
int func_call; /* func call type (FUNC_STDCALL or FUNC_CDECL) */
|
||||||
|
} GFuncContext;
|
||||||
|
|
||||||
|
/******************************************************/
|
||||||
|
/* opcode definitions */
|
||||||
|
|
||||||
|
#define IL_OP_PREFIX 0xFE
|
||||||
|
|
||||||
|
enum ILOPCodes {
|
||||||
|
#define OP(name, str, n) IL_OP_ ## name = n,
|
||||||
|
#include "il-opcodes.h"
|
||||||
|
#undef OP
|
||||||
|
};
|
||||||
|
|
||||||
|
char *il_opcodes_str[] = {
|
||||||
|
#define OP(name, str, n) [n] = str,
|
||||||
|
#include "il-opcodes.h"
|
||||||
|
#undef OP
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************/
|
||||||
|
|
||||||
|
/* arguments variable numbers start from there */
|
||||||
|
#define ARG_BASE 0x70000000
|
||||||
|
|
||||||
|
static FILE *il_outfile;
|
||||||
|
|
||||||
|
static void out_byte(int c)
|
||||||
|
{
|
||||||
|
*(char *)ind++ = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void out_le32(int c)
|
||||||
|
{
|
||||||
|
out_byte(c);
|
||||||
|
out_byte(c >> 8);
|
||||||
|
out_byte(c >> 16);
|
||||||
|
out_byte(c >> 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void init_outfile(void)
|
||||||
|
{
|
||||||
|
if (!il_outfile) {
|
||||||
|
il_outfile = stdout;
|
||||||
|
fprintf(il_outfile,
|
||||||
|
".assembly extern mscorlib\n"
|
||||||
|
"{\n"
|
||||||
|
".ver 1:0:2411:0\n"
|
||||||
|
"}\n\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void out_op1(int op)
|
||||||
|
{
|
||||||
|
if (op & 0x100)
|
||||||
|
out_byte(IL_OP_PREFIX);
|
||||||
|
out_byte(op & 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* output an opcode with prefix */
|
||||||
|
static void out_op(int op)
|
||||||
|
{
|
||||||
|
out_op1(op);
|
||||||
|
fprintf(il_outfile, " %s\n", il_opcodes_str[op]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void out_opb(int op, int c)
|
||||||
|
{
|
||||||
|
out_op1(op);
|
||||||
|
out_byte(c);
|
||||||
|
fprintf(il_outfile, " %s %d\n", il_opcodes_str[op], c);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void out_opi(int op, int c)
|
||||||
|
{
|
||||||
|
out_op1(op);
|
||||||
|
out_le32(c);
|
||||||
|
fprintf(il_outfile, " %s 0x%x\n", il_opcodes_str[op], c);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* XXX: not complete */
|
||||||
|
static void il_type_to_str(char *buf, int buf_size,
|
||||||
|
int t, const char *varstr)
|
||||||
|
{
|
||||||
|
int bt;
|
||||||
|
Sym *s, *sa;
|
||||||
|
char buf1[256];
|
||||||
|
const char *tstr;
|
||||||
|
|
||||||
|
t = t & VT_TYPE;
|
||||||
|
bt = t & VT_BTYPE;
|
||||||
|
buf[0] = '\0';
|
||||||
|
if (t & VT_UNSIGNED)
|
||||||
|
pstrcat(buf, buf_size, "unsigned ");
|
||||||
|
switch(bt) {
|
||||||
|
case VT_VOID:
|
||||||
|
tstr = "void";
|
||||||
|
goto add_tstr;
|
||||||
|
case VT_BOOL:
|
||||||
|
tstr = "bool";
|
||||||
|
goto add_tstr;
|
||||||
|
case VT_BYTE:
|
||||||
|
tstr = "int8";
|
||||||
|
goto add_tstr;
|
||||||
|
case VT_SHORT:
|
||||||
|
tstr = "int16";
|
||||||
|
goto add_tstr;
|
||||||
|
case VT_ENUM:
|
||||||
|
case VT_INT:
|
||||||
|
case VT_LONG:
|
||||||
|
tstr = "int32";
|
||||||
|
goto add_tstr;
|
||||||
|
case VT_LLONG:
|
||||||
|
tstr = "int64";
|
||||||
|
goto add_tstr;
|
||||||
|
case VT_FLOAT:
|
||||||
|
tstr = "float32";
|
||||||
|
goto add_tstr;
|
||||||
|
case VT_DOUBLE:
|
||||||
|
case VT_LDOUBLE:
|
||||||
|
tstr = "float64";
|
||||||
|
add_tstr:
|
||||||
|
pstrcat(buf, buf_size, tstr);
|
||||||
|
break;
|
||||||
|
case VT_STRUCT:
|
||||||
|
error("structures not handled yet");
|
||||||
|
break;
|
||||||
|
case VT_FUNC:
|
||||||
|
s = sym_find((unsigned)t >> VT_STRUCT_SHIFT);
|
||||||
|
il_type_to_str(buf, buf_size, s->t, varstr);
|
||||||
|
pstrcat(buf, buf_size, "(");
|
||||||
|
sa = s->next;
|
||||||
|
while (sa != NULL) {
|
||||||
|
il_type_to_str(buf1, sizeof(buf1), sa->t, NULL);
|
||||||
|
pstrcat(buf, buf_size, buf1);
|
||||||
|
sa = sa->next;
|
||||||
|
if (sa)
|
||||||
|
pstrcat(buf, buf_size, ", ");
|
||||||
|
}
|
||||||
|
pstrcat(buf, buf_size, ")");
|
||||||
|
goto no_var;
|
||||||
|
case VT_PTR:
|
||||||
|
s = sym_find((unsigned)t >> VT_STRUCT_SHIFT);
|
||||||
|
pstrcpy(buf1, sizeof(buf1), "*");
|
||||||
|
if (varstr)
|
||||||
|
pstrcat(buf1, sizeof(buf1), varstr);
|
||||||
|
il_type_to_str(buf, buf_size, s->t, buf1);
|
||||||
|
goto no_var;
|
||||||
|
}
|
||||||
|
if (varstr) {
|
||||||
|
pstrcat(buf, buf_size, " ");
|
||||||
|
pstrcat(buf, buf_size, varstr);
|
||||||
|
}
|
||||||
|
no_var: ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* patch relocation entry with value 'val' */
|
||||||
|
void greloc_patch1(Reloc *p, int val)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* output a symbol and patch all calls to it */
|
||||||
|
void gsym_addr(t, a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* output jump and return symbol */
|
||||||
|
static int out_opj(int op, int c)
|
||||||
|
{
|
||||||
|
out_op1(op);
|
||||||
|
out_le32(0);
|
||||||
|
if (c == 0) {
|
||||||
|
c = ind - (int)cur_text_section->data;
|
||||||
|
}
|
||||||
|
fprintf(il_outfile, " %s L%d\n", il_opcodes_str[op], c);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gsym(int t)
|
||||||
|
{
|
||||||
|
fprintf(il_outfile, "L%d:\n", t);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* load 'r' from value 'sv' */
|
||||||
|
void load(int r, SValue *sv)
|
||||||
|
{
|
||||||
|
int v, fc, ft;
|
||||||
|
|
||||||
|
v = sv->r & VT_VALMASK;
|
||||||
|
fc = sv->c.i;
|
||||||
|
ft = sv->t;
|
||||||
|
|
||||||
|
if (sv->r & VT_LVAL) {
|
||||||
|
if (v == VT_LOCAL) {
|
||||||
|
if (fc >= ARG_BASE) {
|
||||||
|
fc -= ARG_BASE;
|
||||||
|
if (fc >= 0 && fc <= 4) {
|
||||||
|
out_op(IL_OP_LDARG_0 + fc);
|
||||||
|
} else if (fc <= 0xff) {
|
||||||
|
out_opb(IL_OP_LDARG_S, fc);
|
||||||
|
} else {
|
||||||
|
out_opi(IL_OP_LDARG, fc);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (fc >= 0 && fc <= 4) {
|
||||||
|
out_op(IL_OP_LDLOC_0 + fc);
|
||||||
|
} else if (fc <= 0xff) {
|
||||||
|
out_opb(IL_OP_LDLOC_S, fc);
|
||||||
|
} else {
|
||||||
|
out_opi(IL_OP_LDLOC, fc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (v == VT_CONST) {
|
||||||
|
/* XXX: handle globals */
|
||||||
|
out_opi(IL_OP_LDSFLD, 0);
|
||||||
|
} else {
|
||||||
|
if ((ft & VT_BTYPE) == VT_FLOAT) {
|
||||||
|
out_op(IL_OP_LDIND_R4);
|
||||||
|
} else if ((ft & VT_BTYPE) == VT_DOUBLE) {
|
||||||
|
out_op(IL_OP_LDIND_R8);
|
||||||
|
} else if ((ft & VT_BTYPE) == VT_LDOUBLE) {
|
||||||
|
out_op(IL_OP_LDIND_R8);
|
||||||
|
} else if ((ft & VT_TYPE) == VT_BYTE)
|
||||||
|
out_op(IL_OP_LDIND_I1);
|
||||||
|
else if ((ft & VT_TYPE) == (VT_BYTE | VT_UNSIGNED))
|
||||||
|
out_op(IL_OP_LDIND_U1);
|
||||||
|
else if ((ft & VT_TYPE) == VT_SHORT)
|
||||||
|
out_op(IL_OP_LDIND_I2);
|
||||||
|
else if ((ft & VT_TYPE) == (VT_SHORT | VT_UNSIGNED))
|
||||||
|
out_op(IL_OP_LDIND_U2);
|
||||||
|
else
|
||||||
|
out_op(IL_OP_LDIND_I4);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (v == VT_CONST) {
|
||||||
|
/* XXX: handle globals */
|
||||||
|
if (fc >= -1 && fc <= 8) {
|
||||||
|
out_op(IL_OP_LDC_I4_M1 + fc + 1);
|
||||||
|
} else {
|
||||||
|
out_opi(IL_OP_LDC_I4, fc);
|
||||||
|
}
|
||||||
|
} else if (v == VT_LOCAL) {
|
||||||
|
if (fc >= ARG_BASE) {
|
||||||
|
fc -= ARG_BASE;
|
||||||
|
if (fc <= 0xff) {
|
||||||
|
out_opb(IL_OP_LDARGA_S, fc);
|
||||||
|
} else {
|
||||||
|
out_opi(IL_OP_LDARGA, fc);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (fc <= 0xff) {
|
||||||
|
out_opb(IL_OP_LDLOCA_S, fc);
|
||||||
|
} else {
|
||||||
|
out_opi(IL_OP_LDLOCA, fc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* XXX: do it */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* store register 'r' in lvalue 'v' */
|
||||||
|
void store(int r, SValue *sv)
|
||||||
|
{
|
||||||
|
int v, fc, ft;
|
||||||
|
|
||||||
|
v = sv->r & VT_VALMASK;
|
||||||
|
fc = sv->c.i;
|
||||||
|
ft = sv->t;
|
||||||
|
if (v == VT_LOCAL) {
|
||||||
|
if (fc >= ARG_BASE) {
|
||||||
|
fc -= ARG_BASE;
|
||||||
|
/* XXX: check IL arg store semantics */
|
||||||
|
if (fc <= 0xff) {
|
||||||
|
out_opb(IL_OP_STARG_S, fc);
|
||||||
|
} else {
|
||||||
|
out_opi(IL_OP_STARG, fc);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (fc >= 0 && fc <= 4) {
|
||||||
|
out_op(IL_OP_STLOC_0 + fc);
|
||||||
|
} else if (fc <= 0xff) {
|
||||||
|
out_opb(IL_OP_STLOC_S, fc);
|
||||||
|
} else {
|
||||||
|
out_opi(IL_OP_STLOC, fc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (v == VT_CONST) {
|
||||||
|
/* XXX: handle globals */
|
||||||
|
out_opi(IL_OP_STSFLD, 0);
|
||||||
|
} else {
|
||||||
|
if ((ft & VT_BTYPE) == VT_FLOAT)
|
||||||
|
out_op(IL_OP_STIND_R4);
|
||||||
|
else if ((ft & VT_BTYPE) == VT_DOUBLE)
|
||||||
|
out_op(IL_OP_STIND_R8);
|
||||||
|
else if ((ft & VT_BTYPE) == VT_LDOUBLE)
|
||||||
|
out_op(IL_OP_STIND_R8);
|
||||||
|
else if ((ft & VT_BTYPE) == VT_BYTE)
|
||||||
|
out_op(IL_OP_STIND_I1);
|
||||||
|
else if ((ft & VT_BTYPE) == VT_SHORT)
|
||||||
|
out_op(IL_OP_STIND_I2);
|
||||||
|
else
|
||||||
|
out_op(IL_OP_STIND_I4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* start function call and return function call context */
|
||||||
|
void gfunc_start(GFuncContext *c, int func_call)
|
||||||
|
{
|
||||||
|
c->func_call = func_call;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* push function parameter which is in (vtop->t, vtop->c). Stack entry
|
||||||
|
is then popped. */
|
||||||
|
void gfunc_param(GFuncContext *c)
|
||||||
|
{
|
||||||
|
if ((vtop->t & VT_BTYPE) == VT_STRUCT) {
|
||||||
|
error("structures passed as value not handled yet");
|
||||||
|
} else {
|
||||||
|
/* simply push on stack */
|
||||||
|
gv(RC_ST0);
|
||||||
|
}
|
||||||
|
vtop--;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* generate function call with address in (vtop->t, vtop->c) and free function
|
||||||
|
context. Stack entry is popped */
|
||||||
|
void gfunc_call(GFuncContext *c)
|
||||||
|
{
|
||||||
|
char buf[1024];
|
||||||
|
|
||||||
|
if ((vtop->r & (VT_VALMASK | VT_LVAL)) == VT_CONST) {
|
||||||
|
/* XXX: more info needed from tcc */
|
||||||
|
il_type_to_str(buf, sizeof(buf), vtop->t, "xxx");
|
||||||
|
fprintf(il_outfile, " call %s\n", buf);
|
||||||
|
} else {
|
||||||
|
/* indirect call */
|
||||||
|
gv(RC_INT);
|
||||||
|
il_type_to_str(buf, sizeof(buf), vtop->t, NULL);
|
||||||
|
fprintf(il_outfile, " calli %s\n", buf);
|
||||||
|
}
|
||||||
|
vtop--;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* generate function prolog of type 't' */
|
||||||
|
void gfunc_prolog(int t)
|
||||||
|
{
|
||||||
|
int addr, u, func_call;
|
||||||
|
Sym *sym;
|
||||||
|
char buf[1024];
|
||||||
|
|
||||||
|
init_outfile();
|
||||||
|
|
||||||
|
/* XXX: pass function name to gfunc_prolog */
|
||||||
|
il_type_to_str(buf, sizeof(buf), t, funcname);
|
||||||
|
fprintf(il_outfile, ".method static %s il managed\n", buf);
|
||||||
|
fprintf(il_outfile, "{\n");
|
||||||
|
/* XXX: cannot do better now */
|
||||||
|
fprintf(il_outfile, " .maxstack %d\n", NB_REGS);
|
||||||
|
fprintf(il_outfile, " .locals (int32, int32, int32, int32, int32, int32, int32, int32)\n");
|
||||||
|
|
||||||
|
if (!strcmp(funcname, "main"))
|
||||||
|
fprintf(il_outfile, " .entrypoint\n");
|
||||||
|
|
||||||
|
sym = sym_find((unsigned)t >> VT_STRUCT_SHIFT);
|
||||||
|
func_call = sym->r;
|
||||||
|
|
||||||
|
addr = ARG_BASE;
|
||||||
|
/* if the function returns a structure, then add an
|
||||||
|
implicit pointer parameter */
|
||||||
|
func_vt = sym->t;
|
||||||
|
if ((func_vt & VT_BTYPE) == VT_STRUCT) {
|
||||||
|
func_vc = addr;
|
||||||
|
addr++;
|
||||||
|
}
|
||||||
|
/* define parameters */
|
||||||
|
while ((sym = sym->next) != NULL) {
|
||||||
|
u = sym->t;
|
||||||
|
sym_push(sym->v & ~SYM_FIELD, u,
|
||||||
|
VT_LOCAL | VT_LVAL, addr);
|
||||||
|
addr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* generate function epilog */
|
||||||
|
void gfunc_epilog(void)
|
||||||
|
{
|
||||||
|
out_op(IL_OP_RET);
|
||||||
|
fprintf(il_outfile, "}\n\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* generate a jump to a label */
|
||||||
|
int gjmp(int t)
|
||||||
|
{
|
||||||
|
return out_opj(IL_OP_BR, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* generate a jump to a fixed address */
|
||||||
|
void gjmp_addr(int a)
|
||||||
|
{
|
||||||
|
/* XXX: handle syms */
|
||||||
|
out_opi(IL_OP_BR, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* generate a test. set 'inv' to invert test. Stack entry is popped */
|
||||||
|
int gtst(int inv, int t)
|
||||||
|
{
|
||||||
|
int v, *p, c;
|
||||||
|
|
||||||
|
v = vtop->r & VT_VALMASK;
|
||||||
|
if (v == VT_CMP) {
|
||||||
|
c = vtop->c.i ^ inv;
|
||||||
|
switch(c) {
|
||||||
|
case TOK_EQ:
|
||||||
|
c = IL_OP_BEQ;
|
||||||
|
break;
|
||||||
|
case TOK_NE:
|
||||||
|
c = IL_OP_BNE_UN;
|
||||||
|
break;
|
||||||
|
case TOK_LT:
|
||||||
|
c = IL_OP_BLT;
|
||||||
|
break;
|
||||||
|
case TOK_LE:
|
||||||
|
c = IL_OP_BLE;
|
||||||
|
break;
|
||||||
|
case TOK_GT:
|
||||||
|
c = IL_OP_BGT;
|
||||||
|
break;
|
||||||
|
case TOK_GE:
|
||||||
|
c = IL_OP_BGE;
|
||||||
|
break;
|
||||||
|
case TOK_ULT:
|
||||||
|
c = IL_OP_BLT_UN;
|
||||||
|
break;
|
||||||
|
case TOK_ULE:
|
||||||
|
c = IL_OP_BLE_UN;
|
||||||
|
break;
|
||||||
|
case TOK_UGT:
|
||||||
|
c = IL_OP_BGT_UN;
|
||||||
|
break;
|
||||||
|
case TOK_UGE:
|
||||||
|
c = IL_OP_BGE_UN;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
t = out_opj(c, t);
|
||||||
|
} else if (v == VT_JMP || v == VT_JMPI) {
|
||||||
|
/* && or || optimization */
|
||||||
|
if ((v & 1) == inv) {
|
||||||
|
/* insert vtop->c jump list in t */
|
||||||
|
p = &vtop->c.i;
|
||||||
|
while (*p != 0)
|
||||||
|
p = (int *)*p;
|
||||||
|
*p = t;
|
||||||
|
t = vtop->c.i;
|
||||||
|
} else {
|
||||||
|
t = gjmp(t);
|
||||||
|
gsym(vtop->c.i);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (is_float(vtop->t)) {
|
||||||
|
vpushi(0);
|
||||||
|
gen_op(TOK_NE);
|
||||||
|
}
|
||||||
|
if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_FORWARD)) == VT_CONST) {
|
||||||
|
/* constant jmp optimization */
|
||||||
|
if ((vtop->c.i != 0) != inv)
|
||||||
|
t = gjmp(t);
|
||||||
|
} else {
|
||||||
|
v = gv(RC_INT);
|
||||||
|
t = out_opj(IL_OP_BRTRUE - inv, t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vtop--;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* generate an integer binary operation */
|
||||||
|
void gen_opi(int op)
|
||||||
|
{
|
||||||
|
gv2(RC_ST1, RC_ST0);
|
||||||
|
switch(op) {
|
||||||
|
case '+':
|
||||||
|
out_op(IL_OP_ADD);
|
||||||
|
goto std_op;
|
||||||
|
case '-':
|
||||||
|
out_op(IL_OP_SUB);
|
||||||
|
goto std_op;
|
||||||
|
case '&':
|
||||||
|
out_op(IL_OP_AND);
|
||||||
|
goto std_op;
|
||||||
|
case '^':
|
||||||
|
out_op(IL_OP_XOR);
|
||||||
|
goto std_op;
|
||||||
|
case '|':
|
||||||
|
out_op(IL_OP_OR);
|
||||||
|
goto std_op;
|
||||||
|
case '*':
|
||||||
|
out_op(IL_OP_MUL);
|
||||||
|
goto std_op;
|
||||||
|
case TOK_SHL:
|
||||||
|
out_op(IL_OP_SHL);
|
||||||
|
goto std_op;
|
||||||
|
case TOK_SHR:
|
||||||
|
out_op(IL_OP_SHR_UN);
|
||||||
|
goto std_op;
|
||||||
|
case TOK_SAR:
|
||||||
|
out_op(IL_OP_SHR);
|
||||||
|
goto std_op;
|
||||||
|
case '/':
|
||||||
|
case TOK_PDIV:
|
||||||
|
out_op(IL_OP_DIV);
|
||||||
|
goto std_op;
|
||||||
|
case TOK_UDIV:
|
||||||
|
out_op(IL_OP_DIV_UN);
|
||||||
|
goto std_op;
|
||||||
|
case '%':
|
||||||
|
out_op(IL_OP_REM);
|
||||||
|
goto std_op;
|
||||||
|
case TOK_UMOD:
|
||||||
|
out_op(IL_OP_REM_UN);
|
||||||
|
std_op:
|
||||||
|
vtop--;
|
||||||
|
vtop[0].r = REG_ST0;
|
||||||
|
break;
|
||||||
|
case TOK_EQ:
|
||||||
|
case TOK_NE:
|
||||||
|
case TOK_LT:
|
||||||
|
case TOK_LE:
|
||||||
|
case TOK_GT:
|
||||||
|
case TOK_GE:
|
||||||
|
case TOK_ULT:
|
||||||
|
case TOK_ULE:
|
||||||
|
case TOK_UGT:
|
||||||
|
case TOK_UGE:
|
||||||
|
vtop--;
|
||||||
|
vtop[0].r = VT_CMP;
|
||||||
|
vtop[0].c.i = op;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* generate a floating point operation 'v = t1 op t2' instruction. The
|
||||||
|
two operands are guaranted to have the same floating point type */
|
||||||
|
void gen_opf(int op)
|
||||||
|
{
|
||||||
|
/* same as integer */
|
||||||
|
gen_opi(op);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* convert integers to fp 't' type. Must handle 'int', 'unsigned int'
|
||||||
|
and 'long long' cases. */
|
||||||
|
void gen_cvt_itof(int t)
|
||||||
|
{
|
||||||
|
gv(RC_ST0);
|
||||||
|
if (t == VT_FLOAT)
|
||||||
|
out_op(IL_OP_CONV_R4);
|
||||||
|
else
|
||||||
|
out_op(IL_OP_CONV_R8);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* convert fp to int 't' type */
|
||||||
|
/* XXX: handle long long case */
|
||||||
|
void gen_cvt_ftoi(int t)
|
||||||
|
{
|
||||||
|
gv(RC_ST0);
|
||||||
|
switch(t) {
|
||||||
|
case VT_INT | VT_UNSIGNED:
|
||||||
|
out_op(IL_OP_CONV_U4);
|
||||||
|
break;
|
||||||
|
case VT_LLONG:
|
||||||
|
out_op(IL_OP_CONV_I8);
|
||||||
|
break;
|
||||||
|
case VT_LLONG | VT_UNSIGNED:
|
||||||
|
out_op(IL_OP_CONV_U8);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
out_op(IL_OP_CONV_I4);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* convert from one floating point type to another */
|
||||||
|
void gen_cvt_ftof(int t)
|
||||||
|
{
|
||||||
|
gv(RC_ST0);
|
||||||
|
if (t == VT_FLOAT) {
|
||||||
|
out_op(IL_OP_CONV_R4);
|
||||||
|
} else {
|
||||||
|
out_op(IL_OP_CONV_R8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* end of CIL code generator */
|
||||||
|
/*************************************************************/
|
||||||
|
|
||||||
251
bazaar/Tcc/lib/il-opcodes.h
Normal file
251
bazaar/Tcc/lib/il-opcodes.h
Normal file
|
|
@ -0,0 +1,251 @@
|
||||||
|
/*
|
||||||
|
* CIL opcode definition
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002 Fabrice Bellard
|
||||||
|
*
|
||||||
|
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
OP(NOP, "nop", 0x00)
|
||||||
|
OP(BREAK, "break", 0x01)
|
||||||
|
OP(LDARG_0, "ldarg.0", 0x02)
|
||||||
|
OP(LDARG_1, "ldarg.1", 0x03)
|
||||||
|
OP(LDARG_2, "ldarg.2", 0x04)
|
||||||
|
OP(LDARG_3, "ldarg.3", 0x05)
|
||||||
|
OP(LDLOC_0, "ldloc.0", 0x06)
|
||||||
|
OP(LDLOC_1, "ldloc.1", 0x07)
|
||||||
|
OP(LDLOC_2, "ldloc.2", 0x08)
|
||||||
|
OP(LDLOC_3, "ldloc.3", 0x09)
|
||||||
|
OP(STLOC_0, "stloc.0", 0x0a)
|
||||||
|
OP(STLOC_1, "stloc.1", 0x0b)
|
||||||
|
OP(STLOC_2, "stloc.2", 0x0c)
|
||||||
|
OP(STLOC_3, "stloc.3", 0x0d)
|
||||||
|
OP(LDARG_S, "ldarg.s", 0x0e)
|
||||||
|
OP(LDARGA_S, "ldarga.s", 0x0f)
|
||||||
|
OP(STARG_S, "starg.s", 0x10)
|
||||||
|
OP(LDLOC_S, "ldloc.s", 0x11)
|
||||||
|
OP(LDLOCA_S, "ldloca.s", 0x12)
|
||||||
|
OP(STLOC_S, "stloc.s", 0x13)
|
||||||
|
OP(LDNULL, "ldnull", 0x14)
|
||||||
|
OP(LDC_I4_M1, "ldc.i4.m1", 0x15)
|
||||||
|
OP(LDC_I4_0, "ldc.i4.0", 0x16)
|
||||||
|
OP(LDC_I4_1, "ldc.i4.1", 0x17)
|
||||||
|
OP(LDC_I4_2, "ldc.i4.2", 0x18)
|
||||||
|
OP(LDC_I4_3, "ldc.i4.3", 0x19)
|
||||||
|
OP(LDC_I4_4, "ldc.i4.4", 0x1a)
|
||||||
|
OP(LDC_I4_5, "ldc.i4.5", 0x1b)
|
||||||
|
OP(LDC_I4_6, "ldc.i4.6", 0x1c)
|
||||||
|
OP(LDC_I4_7, "ldc.i4.7", 0x1d)
|
||||||
|
OP(LDC_I4_8, "ldc.i4.8", 0x1e)
|
||||||
|
OP(LDC_I4_S, "ldc.i4.s", 0x1f)
|
||||||
|
OP(LDC_I4, "ldc.i4", 0x20)
|
||||||
|
OP(LDC_I8, "ldc.i8", 0x21)
|
||||||
|
OP(LDC_R4, "ldc.r4", 0x22)
|
||||||
|
OP(LDC_R8, "ldc.r8", 0x23)
|
||||||
|
OP(LDPTR, "ldptr", 0x24)
|
||||||
|
OP(DUP, "dup", 0x25)
|
||||||
|
OP(POP, "pop", 0x26)
|
||||||
|
OP(JMP, "jmp", 0x27)
|
||||||
|
OP(CALL, "call", 0x28)
|
||||||
|
OP(CALLI, "calli", 0x29)
|
||||||
|
OP(RET, "ret", 0x2a)
|
||||||
|
OP(BR_S, "br.s", 0x2b)
|
||||||
|
OP(BRFALSE_S, "brfalse.s", 0x2c)
|
||||||
|
OP(BRTRUE_S, "brtrue.s", 0x2d)
|
||||||
|
OP(BEQ_S, "beq.s", 0x2e)
|
||||||
|
OP(BGE_S, "bge.s", 0x2f)
|
||||||
|
OP(BGT_S, "bgt.s", 0x30)
|
||||||
|
OP(BLE_S, "ble.s", 0x31)
|
||||||
|
OP(BLT_S, "blt.s", 0x32)
|
||||||
|
OP(BNE_UN_S, "bne.un.s", 0x33)
|
||||||
|
OP(BGE_UN_S, "bge.un.s", 0x34)
|
||||||
|
OP(BGT_UN_S, "bgt.un.s", 0x35)
|
||||||
|
OP(BLE_UN_S, "ble.un.s", 0x36)
|
||||||
|
OP(BLT_UN_S, "blt.un.s", 0x37)
|
||||||
|
OP(BR, "br", 0x38)
|
||||||
|
OP(BRFALSE, "brfalse", 0x39)
|
||||||
|
OP(BRTRUE, "brtrue", 0x3a)
|
||||||
|
OP(BEQ, "beq", 0x3b)
|
||||||
|
OP(BGE, "bge", 0x3c)
|
||||||
|
OP(BGT, "bgt", 0x3d)
|
||||||
|
OP(BLE, "ble", 0x3e)
|
||||||
|
OP(BLT, "blt", 0x3f)
|
||||||
|
OP(BNE_UN, "bne.un", 0x40)
|
||||||
|
OP(BGE_UN, "bge.un", 0x41)
|
||||||
|
OP(BGT_UN, "bgt.un", 0x42)
|
||||||
|
OP(BLE_UN, "ble.un", 0x43)
|
||||||
|
OP(BLT_UN, "blt.un", 0x44)
|
||||||
|
OP(SWITCH, "switch", 0x45)
|
||||||
|
OP(LDIND_I1, "ldind.i1", 0x46)
|
||||||
|
OP(LDIND_U1, "ldind.u1", 0x47)
|
||||||
|
OP(LDIND_I2, "ldind.i2", 0x48)
|
||||||
|
OP(LDIND_U2, "ldind.u2", 0x49)
|
||||||
|
OP(LDIND_I4, "ldind.i4", 0x4a)
|
||||||
|
OP(LDIND_U4, "ldind.u4", 0x4b)
|
||||||
|
OP(LDIND_I8, "ldind.i8", 0x4c)
|
||||||
|
OP(LDIND_I, "ldind.i", 0x4d)
|
||||||
|
OP(LDIND_R4, "ldind.r4", 0x4e)
|
||||||
|
OP(LDIND_R8, "ldind.r8", 0x4f)
|
||||||
|
OP(LDIND_REF, "ldind.ref", 0x50)
|
||||||
|
OP(STIND_REF, "stind.ref", 0x51)
|
||||||
|
OP(STIND_I1, "stind.i1", 0x52)
|
||||||
|
OP(STIND_I2, "stind.i2", 0x53)
|
||||||
|
OP(STIND_I4, "stind.i4", 0x54)
|
||||||
|
OP(STIND_I8, "stind.i8", 0x55)
|
||||||
|
OP(STIND_R4, "stind.r4", 0x56)
|
||||||
|
OP(STIND_R8, "stind.r8", 0x57)
|
||||||
|
OP(ADD, "add", 0x58)
|
||||||
|
OP(SUB, "sub", 0x59)
|
||||||
|
OP(MUL, "mul", 0x5a)
|
||||||
|
OP(DIV, "div", 0x5b)
|
||||||
|
OP(DIV_UN, "div.un", 0x5c)
|
||||||
|
OP(REM, "rem", 0x5d)
|
||||||
|
OP(REM_UN, "rem.un", 0x5e)
|
||||||
|
OP(AND, "and", 0x5f)
|
||||||
|
OP(OR, "or", 0x60)
|
||||||
|
OP(XOR, "xor", 0x61)
|
||||||
|
OP(SHL, "shl", 0x62)
|
||||||
|
OP(SHR, "shr", 0x63)
|
||||||
|
OP(SHR_UN, "shr.un", 0x64)
|
||||||
|
OP(NEG, "neg", 0x65)
|
||||||
|
OP(NOT, "not", 0x66)
|
||||||
|
OP(CONV_I1, "conv.i1", 0x67)
|
||||||
|
OP(CONV_I2, "conv.i2", 0x68)
|
||||||
|
OP(CONV_I4, "conv.i4", 0x69)
|
||||||
|
OP(CONV_I8, "conv.i8", 0x6a)
|
||||||
|
OP(CONV_R4, "conv.r4", 0x6b)
|
||||||
|
OP(CONV_R8, "conv.r8", 0x6c)
|
||||||
|
OP(CONV_U4, "conv.u4", 0x6d)
|
||||||
|
OP(CONV_U8, "conv.u8", 0x6e)
|
||||||
|
OP(CALLVIRT, "callvirt", 0x6f)
|
||||||
|
OP(CPOBJ, "cpobj", 0x70)
|
||||||
|
OP(LDOBJ, "ldobj", 0x71)
|
||||||
|
OP(LDSTR, "ldstr", 0x72)
|
||||||
|
OP(NEWOBJ, "newobj", 0x73)
|
||||||
|
OP(CASTCLASS, "castclass", 0x74)
|
||||||
|
OP(ISINST, "isinst", 0x75)
|
||||||
|
OP(CONV_R_UN, "conv.r.un", 0x76)
|
||||||
|
OP(ANN_DATA_S, "ann.data.s", 0x77)
|
||||||
|
OP(UNBOX, "unbox", 0x79)
|
||||||
|
OP(THROW, "throw", 0x7a)
|
||||||
|
OP(LDFLD, "ldfld", 0x7b)
|
||||||
|
OP(LDFLDA, "ldflda", 0x7c)
|
||||||
|
OP(STFLD, "stfld", 0x7d)
|
||||||
|
OP(LDSFLD, "ldsfld", 0x7e)
|
||||||
|
OP(LDSFLDA, "ldsflda", 0x7f)
|
||||||
|
OP(STSFLD, "stsfld", 0x80)
|
||||||
|
OP(STOBJ, "stobj", 0x81)
|
||||||
|
OP(CONV_OVF_I1_UN, "conv.ovf.i1.un", 0x82)
|
||||||
|
OP(CONV_OVF_I2_UN, "conv.ovf.i2.un", 0x83)
|
||||||
|
OP(CONV_OVF_I4_UN, "conv.ovf.i4.un", 0x84)
|
||||||
|
OP(CONV_OVF_I8_UN, "conv.ovf.i8.un", 0x85)
|
||||||
|
OP(CONV_OVF_U1_UN, "conv.ovf.u1.un", 0x86)
|
||||||
|
OP(CONV_OVF_U2_UN, "conv.ovf.u2.un", 0x87)
|
||||||
|
OP(CONV_OVF_U4_UN, "conv.ovf.u4.un", 0x88)
|
||||||
|
OP(CONV_OVF_U8_UN, "conv.ovf.u8.un", 0x89)
|
||||||
|
OP(CONV_OVF_I_UN, "conv.ovf.i.un", 0x8a)
|
||||||
|
OP(CONV_OVF_U_UN, "conv.ovf.u.un", 0x8b)
|
||||||
|
OP(BOX, "box", 0x8c)
|
||||||
|
OP(NEWARR, "newarr", 0x8d)
|
||||||
|
OP(LDLEN, "ldlen", 0x8e)
|
||||||
|
OP(LDELEMA, "ldelema", 0x8f)
|
||||||
|
OP(LDELEM_I1, "ldelem.i1", 0x90)
|
||||||
|
OP(LDELEM_U1, "ldelem.u1", 0x91)
|
||||||
|
OP(LDELEM_I2, "ldelem.i2", 0x92)
|
||||||
|
OP(LDELEM_U2, "ldelem.u2", 0x93)
|
||||||
|
OP(LDELEM_I4, "ldelem.i4", 0x94)
|
||||||
|
OP(LDELEM_U4, "ldelem.u4", 0x95)
|
||||||
|
OP(LDELEM_I8, "ldelem.i8", 0x96)
|
||||||
|
OP(LDELEM_I, "ldelem.i", 0x97)
|
||||||
|
OP(LDELEM_R4, "ldelem.r4", 0x98)
|
||||||
|
OP(LDELEM_R8, "ldelem.r8", 0x99)
|
||||||
|
OP(LDELEM_REF, "ldelem.ref", 0x9a)
|
||||||
|
OP(STELEM_I, "stelem.i", 0x9b)
|
||||||
|
OP(STELEM_I1, "stelem.i1", 0x9c)
|
||||||
|
OP(STELEM_I2, "stelem.i2", 0x9d)
|
||||||
|
OP(STELEM_I4, "stelem.i4", 0x9e)
|
||||||
|
OP(STELEM_I8, "stelem.i8", 0x9f)
|
||||||
|
OP(STELEM_R4, "stelem.r4", 0xa0)
|
||||||
|
OP(STELEM_R8, "stelem.r8", 0xa1)
|
||||||
|
OP(STELEM_REF, "stelem.ref", 0xa2)
|
||||||
|
OP(CONV_OVF_I1, "conv.ovf.i1", 0xb3)
|
||||||
|
OP(CONV_OVF_U1, "conv.ovf.u1", 0xb4)
|
||||||
|
OP(CONV_OVF_I2, "conv.ovf.i2", 0xb5)
|
||||||
|
OP(CONV_OVF_U2, "conv.ovf.u2", 0xb6)
|
||||||
|
OP(CONV_OVF_I4, "conv.ovf.i4", 0xb7)
|
||||||
|
OP(CONV_OVF_U4, "conv.ovf.u4", 0xb8)
|
||||||
|
OP(CONV_OVF_I8, "conv.ovf.i8", 0xb9)
|
||||||
|
OP(CONV_OVF_U8, "conv.ovf.u8", 0xba)
|
||||||
|
OP(REFANYVAL, "refanyval", 0xc2)
|
||||||
|
OP(CKFINITE, "ckfinite", 0xc3)
|
||||||
|
OP(MKREFANY, "mkrefany", 0xc6)
|
||||||
|
OP(ANN_CALL, "ann.call", 0xc7)
|
||||||
|
OP(ANN_CATCH, "ann.catch", 0xc8)
|
||||||
|
OP(ANN_DEAD, "ann.dead", 0xc9)
|
||||||
|
OP(ANN_HOISTED, "ann.hoisted", 0xca)
|
||||||
|
OP(ANN_HOISTED_CALL, "ann.hoisted.call", 0xcb)
|
||||||
|
OP(ANN_LAB, "ann.lab", 0xcc)
|
||||||
|
OP(ANN_DEF, "ann.def", 0xcd)
|
||||||
|
OP(ANN_REF_S, "ann.ref.s", 0xce)
|
||||||
|
OP(ANN_PHI, "ann.phi", 0xcf)
|
||||||
|
OP(LDTOKEN, "ldtoken", 0xd0)
|
||||||
|
OP(CONV_U2, "conv.u2", 0xd1)
|
||||||
|
OP(CONV_U1, "conv.u1", 0xd2)
|
||||||
|
OP(CONV_I, "conv.i", 0xd3)
|
||||||
|
OP(CONV_OVF_I, "conv.ovf.i", 0xd4)
|
||||||
|
OP(CONV_OVF_U, "conv.ovf.u", 0xd5)
|
||||||
|
OP(ADD_OVF, "add.ovf", 0xd6)
|
||||||
|
OP(ADD_OVF_UN, "add.ovf.un", 0xd7)
|
||||||
|
OP(MUL_OVF, "mul.ovf", 0xd8)
|
||||||
|
OP(MUL_OVF_UN, "mul.ovf.un", 0xd9)
|
||||||
|
OP(SUB_OVF, "sub.ovf", 0xda)
|
||||||
|
OP(SUB_OVF_UN, "sub.ovf.un", 0xdb)
|
||||||
|
OP(ENDFINALLY, "endfinally", 0xdc)
|
||||||
|
OP(LEAVE, "leave", 0xdd)
|
||||||
|
OP(LEAVE_S, "leave.s", 0xde)
|
||||||
|
OP(STIND_I, "stind.i", 0xdf)
|
||||||
|
OP(CONV_U, "conv.u", 0xe0)
|
||||||
|
|
||||||
|
/* prefix instructions. we use an opcode >= 256 to ease coding */
|
||||||
|
|
||||||
|
OP(ARGLIST, "arglist", 0x100)
|
||||||
|
OP(CEQ, "ceq", 0x101)
|
||||||
|
OP(CGT, "cgt", 0x102)
|
||||||
|
OP(CGT_UN, "cgt.un", 0x103)
|
||||||
|
OP(CLT, "clt", 0x104)
|
||||||
|
OP(CLT_UN, "clt.un", 0x105)
|
||||||
|
OP(LDFTN, "ldftn", 0x106)
|
||||||
|
OP(LDVIRTFTN, "ldvirtftn", 0x107)
|
||||||
|
OP(JMPI, "jmpi", 0x108)
|
||||||
|
OP(LDARG, "ldarg", 0x109)
|
||||||
|
OP(LDARGA, "ldarga", 0x10a)
|
||||||
|
OP(STARG, "starg", 0x10b)
|
||||||
|
OP(LDLOC, "ldloc", 0x10c)
|
||||||
|
OP(LDLOCA, "ldloca", 0x10d)
|
||||||
|
OP(STLOC, "stloc", 0x10e)
|
||||||
|
OP(LOCALLOC, "localloc", 0x10f)
|
||||||
|
OP(ENDFILTER, "endfilter", 0x111)
|
||||||
|
OP(UNALIGNED, "unaligned", 0x112)
|
||||||
|
OP(VOLATILE, "volatile", 0x113)
|
||||||
|
OP(TAIL, "tail", 0x114)
|
||||||
|
OP(INITOBJ, "initobj", 0x115)
|
||||||
|
OP(ANN_LIVE, "ann.live", 0x116)
|
||||||
|
OP(CPBLK, "cpblk", 0x117)
|
||||||
|
OP(INITBLK, "initblk", 0x118)
|
||||||
|
OP(ANN_REF, "ann.ref", 0x119)
|
||||||
|
OP(RETHROW, "rethrow", 0x11a)
|
||||||
|
OP(SIZEOF, "sizeof", 0x11c)
|
||||||
|
OP(REFANYTYPE, "refanytype", 0x11d)
|
||||||
|
OP(ANN_DATA, "ann.data", 0x122)
|
||||||
|
OP(ANN_ARG, "ann.arg", 0x123)
|
||||||
54
bazaar/Tcc/lib/include/_mingw.h
Normal file
54
bazaar/Tcc/lib/include/_mingw.h
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
/*
|
||||||
|
* _mingw.h
|
||||||
|
*
|
||||||
|
* This file is for TCC-PE and not part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __MINGW_H
|
||||||
|
#define __MINGW_H
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#define __int64 long long
|
||||||
|
#define __int32 long
|
||||||
|
#define __int16 short
|
||||||
|
#define __int8 char
|
||||||
|
#define __cdecl __attribute__((__cdecl__))
|
||||||
|
#define __stdcall __attribute__((__stdcall__))
|
||||||
|
#define __declspec(x) __attribute__((x))
|
||||||
|
|
||||||
|
#define __MINGW32_VERSION 2.0
|
||||||
|
#define __MINGW32_MAJOR_VERSION 2
|
||||||
|
#define __MINGW32_MINOR_VERSION 0
|
||||||
|
|
||||||
|
#define __MSVCRT__ 1
|
||||||
|
#define __MINGW_IMPORT extern
|
||||||
|
#define _CRTIMP
|
||||||
|
#define __CRT_INLINE extern __inline__
|
||||||
|
|
||||||
|
#define WIN32 1
|
||||||
|
|
||||||
|
#ifndef _WINT_T
|
||||||
|
#define _WINT_T
|
||||||
|
typedef unsigned int wint_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* for winapi */
|
||||||
|
#define _ANONYMOUS_UNION
|
||||||
|
#define _ANONYMOUS_STRUCT
|
||||||
|
#define DECLSPEC_NORETURN
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#define DECLARE_STDCALL_P(type) __stdcall type
|
||||||
|
|
||||||
|
#endif /* __MINGW_H */
|
||||||
71
bazaar/Tcc/lib/include/assert.h
Normal file
71
bazaar/Tcc/lib/include/assert.h
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
/*
|
||||||
|
* assert.h
|
||||||
|
*
|
||||||
|
* Define the assert macro for debug output.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ASSERT_H_
|
||||||
|
#define _ASSERT_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NDEBUG
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If not debugging, assert does nothing.
|
||||||
|
*/
|
||||||
|
#define assert(x) ((void)0)
|
||||||
|
|
||||||
|
#else /* debugging enabled */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* CRTDLL nicely supplies a function which does the actual output and
|
||||||
|
* call to abort.
|
||||||
|
*/
|
||||||
|
void _assert (const char*, const char*, int)
|
||||||
|
#ifdef __GNUC__
|
||||||
|
__attribute__ ((noreturn))
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Definition of the assert macro.
|
||||||
|
*/
|
||||||
|
#define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__))
|
||||||
|
#endif /* NDEBUG */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _ASSERT_H_ */
|
||||||
|
|
||||||
159
bazaar/Tcc/lib/include/conio.h
Normal file
159
bazaar/Tcc/lib/include/conio.h
Normal file
|
|
@ -0,0 +1,159 @@
|
||||||
|
/* A conio implementation for Mingw/Dev-C++.
|
||||||
|
*
|
||||||
|
* Written by:
|
||||||
|
* Hongli Lai <hongli@telekabel.nl>
|
||||||
|
* tkorrovi <tkorrovi@altavista.net> on 2002/02/26.
|
||||||
|
* Andrew Westcott <ajwestco@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* Offered for use in the public domain without any warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _CONIO_H_
|
||||||
|
#define _CONIO_H_
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define BLINK 0
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
BLACK,
|
||||||
|
BLUE,
|
||||||
|
GREEN,
|
||||||
|
CYAN,
|
||||||
|
RED,
|
||||||
|
MAGENTA,
|
||||||
|
BROWN,
|
||||||
|
LIGHTGRAY,
|
||||||
|
DARKGRAY,
|
||||||
|
LIGHTBLUE,
|
||||||
|
LIGHTGREEN,
|
||||||
|
LIGHTCYAN,
|
||||||
|
LIGHTRED,
|
||||||
|
LIGHTMAGENTA,
|
||||||
|
YELLOW,
|
||||||
|
WHITE
|
||||||
|
} COLORS;
|
||||||
|
|
||||||
|
|
||||||
|
#define cgets _cgets
|
||||||
|
#define cprintf _cprintf
|
||||||
|
#define cputs _cputs
|
||||||
|
#define cscanf _cscanf
|
||||||
|
#define ScreenClear clrscr
|
||||||
|
|
||||||
|
/* blinkvideo */
|
||||||
|
|
||||||
|
void clreol (void);
|
||||||
|
void clrscr (void);
|
||||||
|
|
||||||
|
int _conio_gettext (int left, int top, int right, int bottom,
|
||||||
|
char *str);
|
||||||
|
/* _conio_kbhit */
|
||||||
|
|
||||||
|
void delline (void);
|
||||||
|
|
||||||
|
/* gettextinfo */
|
||||||
|
void gotoxy(int x, int y);
|
||||||
|
/*
|
||||||
|
highvideo
|
||||||
|
insline
|
||||||
|
intensevideo
|
||||||
|
lowvideo
|
||||||
|
movetext
|
||||||
|
normvideo
|
||||||
|
*/
|
||||||
|
|
||||||
|
void puttext (int left, int top, int right, int bottom, char *str);
|
||||||
|
|
||||||
|
// Screen Variables
|
||||||
|
|
||||||
|
/* ScreenCols
|
||||||
|
ScreenGetChar
|
||||||
|
ScreenGetCursor
|
||||||
|
ScreenMode
|
||||||
|
ScreenPutChar
|
||||||
|
ScreenPutString
|
||||||
|
ScreenRetrieve
|
||||||
|
ScreenRows
|
||||||
|
ScreenSetCursor
|
||||||
|
ScreenUpdate
|
||||||
|
ScreenUpdateLine
|
||||||
|
ScreenVisualBell
|
||||||
|
_set_screen_lines */
|
||||||
|
|
||||||
|
void _setcursortype (int type);
|
||||||
|
|
||||||
|
void textattr (int _attr);
|
||||||
|
|
||||||
|
void textbackground (int color);
|
||||||
|
|
||||||
|
void textcolor (int color);
|
||||||
|
|
||||||
|
/* textmode */
|
||||||
|
|
||||||
|
int wherex (void);
|
||||||
|
|
||||||
|
int wherey (void);
|
||||||
|
|
||||||
|
/* window */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* The code below was part of Mingw's conio.h */
|
||||||
|
/*
|
||||||
|
* conio.h
|
||||||
|
*
|
||||||
|
* Low level console I/O functions. Pretty please try to use the ANSI
|
||||||
|
* standard ones if you are writing new code.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
char* _cgets (char*);
|
||||||
|
int _cprintf (const char*, ...);
|
||||||
|
int _cputs (const char*);
|
||||||
|
int _cscanf (char*, ...);
|
||||||
|
|
||||||
|
int _getch (void);
|
||||||
|
int _getche (void);
|
||||||
|
int _kbhit (void);
|
||||||
|
int _putch (int);
|
||||||
|
int _ungetch (int);
|
||||||
|
|
||||||
|
|
||||||
|
int getch (void);
|
||||||
|
int getche (void);
|
||||||
|
int kbhit (void);
|
||||||
|
int putch (int);
|
||||||
|
int ungetch (int);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _CONIO_H_ */
|
||||||
232
bazaar/Tcc/lib/include/ctype.h
Normal file
232
bazaar/Tcc/lib/include/ctype.h
Normal file
|
|
@ -0,0 +1,232 @@
|
||||||
|
/*
|
||||||
|
* ctype.h
|
||||||
|
*
|
||||||
|
* Functions for testing character types and converting characters.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _CTYPE_H_
|
||||||
|
#define _CTYPE_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define __need_wchar_t
|
||||||
|
#define __need_wint_t
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following flags are used to tell iswctype and _isctype what character
|
||||||
|
* types you are looking for.
|
||||||
|
*/
|
||||||
|
#define _UPPER 0x0001
|
||||||
|
#define _LOWER 0x0002
|
||||||
|
#define _DIGIT 0x0004
|
||||||
|
#define _SPACE 0x0008 /* HT LF VT FF CR SP */
|
||||||
|
#define _PUNCT 0x0010
|
||||||
|
#define _CONTROL 0x0020
|
||||||
|
#define _BLANK 0x0040 /* this is SP only, not SP and HT as in C99 */
|
||||||
|
#define _HEX 0x0080
|
||||||
|
#define _LEADBYTE 0x8000
|
||||||
|
|
||||||
|
#define _ALPHA 0x0103
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int isalnum(int);
|
||||||
|
int isalpha(int);
|
||||||
|
int iscntrl(int);
|
||||||
|
int isdigit(int);
|
||||||
|
int isgraph(int);
|
||||||
|
int islower(int);
|
||||||
|
int isprint(int);
|
||||||
|
int ispunct(int);
|
||||||
|
int isspace(int);
|
||||||
|
int isupper(int);
|
||||||
|
int isxdigit(int);
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
int _isctype (int, int);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* These are the ANSI versions, with correct checking of argument */
|
||||||
|
int tolower(int);
|
||||||
|
int toupper(int);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: The above are not old name type wrappers, but functions exported
|
||||||
|
* explicitly by MSVCRT/CRTDLL. However, underscored versions are also
|
||||||
|
* exported.
|
||||||
|
*/
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
/*
|
||||||
|
* These are the cheap non-std versions: The return values are undefined
|
||||||
|
* if the argument is not ASCII char or is not of appropriate case
|
||||||
|
*/
|
||||||
|
int _tolower(int);
|
||||||
|
int _toupper(int);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Also defined in stdlib.h */
|
||||||
|
#ifndef MB_CUR_MAX
|
||||||
|
# ifdef __MSVCRT__
|
||||||
|
# define MB_CUR_MAX __mb_cur_max
|
||||||
|
__MINGW_IMPORT int __mb_cur_max;
|
||||||
|
# else /* not __MSVCRT */
|
||||||
|
# define MB_CUR_MAX __mb_cur_max_dll
|
||||||
|
__MINGW_IMPORT int __mb_cur_max_dll;
|
||||||
|
# endif /* not __MSVCRT */
|
||||||
|
#endif /* MB_CUR_MAX */
|
||||||
|
|
||||||
|
__MINGW_IMPORT unsigned short _ctype[];
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
__MINGW_IMPORT unsigned short* _pctype;
|
||||||
|
#else /* CRTDLL */
|
||||||
|
__MINGW_IMPORT unsigned short* _pctype_dll;
|
||||||
|
#define _pctype _pctype_dll
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use inlines here rather than macros, because macros will upset
|
||||||
|
* C++ usage (eg, ::isalnum), and so usually get undefined
|
||||||
|
*
|
||||||
|
* According to standard for SB chars, these function are defined only
|
||||||
|
* for input values representable by unsigned char or EOF.
|
||||||
|
* Thus, there is no range test.
|
||||||
|
* This reproduces behaviour of MSVCRT.dll lib implemention for SB chars.
|
||||||
|
*
|
||||||
|
* If no MB char support is needed, these can be simplified even
|
||||||
|
* more by command line define -DMB_CUR_MAX=1. The compiler will then
|
||||||
|
* optimise away the constant condition.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#if ! (defined (__NO_CTYPE_INLINES) || defined (__STRICT_ANSI__ ))
|
||||||
|
/* use simple lookup if SB locale, else _isctype() */
|
||||||
|
#define __ISCTYPE(c, mask) (MB_CUR_MAX == 1 ? (_pctype[c] & mask) : _isctype(c, mask))
|
||||||
|
extern __inline__ int isalnum(int c) {return __ISCTYPE(c, (_ALPHA|_DIGIT));}
|
||||||
|
extern __inline__ int isalpha(int c) {return __ISCTYPE(c, _ALPHA);}
|
||||||
|
extern __inline__ int iscntrl(int c) {return __ISCTYPE(c, _CONTROL);}
|
||||||
|
extern __inline__ int isdigit(int c) {return __ISCTYPE(c, _DIGIT);}
|
||||||
|
extern __inline__ int isgraph(int c) {return __ISCTYPE(c, (_PUNCT|_ALPHA|_DIGIT));}
|
||||||
|
extern __inline__ int islower(int c) {return __ISCTYPE(c, _LOWER);}
|
||||||
|
extern __inline__ int isprint(int c) {return __ISCTYPE(c, (_BLANK|_PUNCT|_ALPHA|_DIGIT));}
|
||||||
|
extern __inline__ int ispunct(int c) {return __ISCTYPE(c, _PUNCT);}
|
||||||
|
extern __inline__ int isspace(int c) {return __ISCTYPE(c, _SPACE);}
|
||||||
|
extern __inline__ int isupper(int c) {return __ISCTYPE(c, _UPPER);}
|
||||||
|
extern __inline__ int isxdigit(int c) {return __ISCTYPE(c, _HEX);}
|
||||||
|
|
||||||
|
/* these reproduce behaviour of lib underscored versions */
|
||||||
|
extern __inline__ int _tolower(int c) {return ( c -'A'+'a');}
|
||||||
|
extern __inline__ int _toupper(int c) {return ( c -'a'+'A');}
|
||||||
|
|
||||||
|
/* TODO? Is it worth inlining ANSI tolower, toupper? Probably only
|
||||||
|
if we only want C-locale. */
|
||||||
|
|
||||||
|
#endif /* _NO_CTYPE_INLINES */
|
||||||
|
|
||||||
|
/* Wide character equivalents */
|
||||||
|
|
||||||
|
#ifndef WEOF
|
||||||
|
#define WEOF (wchar_t)(0xFFFF)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WCTYPE_T_DEFINED
|
||||||
|
typedef wchar_t wctype_t;
|
||||||
|
#define _WCTYPE_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int iswalnum(wint_t);
|
||||||
|
int iswalpha(wint_t);
|
||||||
|
int iswascii(wint_t);
|
||||||
|
int iswcntrl(wint_t);
|
||||||
|
int iswctype(wint_t, wctype_t);
|
||||||
|
int is_wctype(wint_t, wctype_t); /* Obsolete! */
|
||||||
|
int iswdigit(wint_t);
|
||||||
|
int iswgraph(wint_t);
|
||||||
|
int iswlower(wint_t);
|
||||||
|
int iswprint(wint_t);
|
||||||
|
int iswpunct(wint_t);
|
||||||
|
int iswspace(wint_t);
|
||||||
|
int iswupper(wint_t);
|
||||||
|
int iswxdigit(wint_t);
|
||||||
|
|
||||||
|
wchar_t towlower(wchar_t);
|
||||||
|
wchar_t towupper(wchar_t);
|
||||||
|
|
||||||
|
int isleadbyte (int);
|
||||||
|
|
||||||
|
/* Also in wctype.h */
|
||||||
|
#if ! (defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
|
||||||
|
#define __WCTYPE_INLINES_DEFINED
|
||||||
|
extern __inline__ int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
|
||||||
|
extern __inline__ int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
|
||||||
|
extern __inline__ int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);}
|
||||||
|
extern __inline__ int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
|
||||||
|
extern __inline__ int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
|
||||||
|
extern __inline__ int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
|
||||||
|
extern __inline__ int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
|
||||||
|
extern __inline__ int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
|
||||||
|
extern __inline__ int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
|
||||||
|
extern __inline__ int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
|
||||||
|
extern __inline__ int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
|
||||||
|
extern __inline__ int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
|
||||||
|
extern __inline__ int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
|
||||||
|
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
int __isascii (int);
|
||||||
|
int __toascii (int);
|
||||||
|
int __iscsymf (int); /* Valid first character in C symbol */
|
||||||
|
int __iscsym (int); /* Valid character in C symbol (after first) */
|
||||||
|
|
||||||
|
#ifndef __NO_CTYPE_INLINES
|
||||||
|
extern __inline__ int __isascii(int c) {return (((unsigned)c & ~0x7F) == 0);}
|
||||||
|
extern __inline__ int __toascii(int c) {return (c & 0x7F);}
|
||||||
|
extern __inline__ int __iscsymf(int c) {return (isalpha(c) || (c == '_'));}
|
||||||
|
extern __inline__ int __iscsym(int c) {return (isalnum(c) || (c == '_'));}
|
||||||
|
#endif /* __NO_CTYPE_INLINES */
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
int isascii (int);
|
||||||
|
int toascii (int);
|
||||||
|
int iscsymf (int);
|
||||||
|
int iscsym (int);
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _CTYPE_H_ */
|
||||||
|
|
||||||
26
bazaar/Tcc/lib/include/dir.h
Normal file
26
bazaar/Tcc/lib/include/dir.h
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* dir.h
|
||||||
|
*
|
||||||
|
* This file OBSOLESCENT and only provided for backward compatibility.
|
||||||
|
* Please use io.h instead.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
* Mumit Khan <khan@xraylith.wisc.edu>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
95
bazaar/Tcc/lib/include/direct.h
Normal file
95
bazaar/Tcc/lib/include/direct.h
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
/*
|
||||||
|
* direct.h
|
||||||
|
*
|
||||||
|
* Functions for manipulating paths and directories (included from io.h)
|
||||||
|
* plus functions for setting the current drive.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _DIRECT_H_
|
||||||
|
#define _DIRECT_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define __need_wchar_t
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _DISKFREE_T_DEFINED
|
||||||
|
/* needed by _getdiskfree (also in dos.h) */
|
||||||
|
struct _diskfree_t {
|
||||||
|
unsigned total_clusters;
|
||||||
|
unsigned avail_clusters;
|
||||||
|
unsigned sectors_per_cluster;
|
||||||
|
unsigned bytes_per_sector;
|
||||||
|
};
|
||||||
|
#define _DISKFREE_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* You really shouldn't be using these. Use the Win32 API functions instead.
|
||||||
|
* However, it does make it easier to port older code.
|
||||||
|
*/
|
||||||
|
int _getdrive (void);
|
||||||
|
unsigned long _getdrives(void);
|
||||||
|
int _chdrive (int);
|
||||||
|
char* _getdcwd (int, char*, int);
|
||||||
|
unsigned _getdiskfree (unsigned, struct _diskfree_t *);
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
# define diskfree_t _diskfree_t
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WDIRECT_DEFINED
|
||||||
|
/* wide character versions. Also in wchar.h */
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
int _wchdir(const wchar_t*);
|
||||||
|
wchar_t* _wgetcwd(wchar_t*, int);
|
||||||
|
wchar_t* _wgetdcwd(int, wchar_t*, int);
|
||||||
|
int _wmkdir(const wchar_t*);
|
||||||
|
int _wrmdir(const wchar_t*);
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
#define _WDIRECT_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _DIRECT_H_ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
96
bazaar/Tcc/lib/include/dirent.h
Normal file
96
bazaar/Tcc/lib/include/dirent.h
Normal file
|
|
@ -0,0 +1,96 @@
|
||||||
|
/*
|
||||||
|
* DIRENT.H (formerly DIRLIB.H)
|
||||||
|
*
|
||||||
|
* by M. J. Weinstein Released to public domain 1-Jan-89
|
||||||
|
*
|
||||||
|
* Because I have heard that this feature (opendir, readdir, closedir)
|
||||||
|
* it so useful for programmers coming from UNIX or attempting to port
|
||||||
|
* UNIX code, and because it is reasonably light weight, I have included
|
||||||
|
* it in the Mingw32 package. I have also added an implementation of
|
||||||
|
* rewinddir, seekdir and telldir.
|
||||||
|
* - Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that is will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includeds but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _DIRENT_H_
|
||||||
|
#define _DIRENT_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct dirent
|
||||||
|
{
|
||||||
|
long d_ino; /* Always zero. */
|
||||||
|
unsigned short d_reclen; /* Always zero. */
|
||||||
|
unsigned short d_namlen; /* Length of name in d_name. */
|
||||||
|
char* d_name; /* File name. */
|
||||||
|
/* NOTE: The name in the dirent structure points to the name in the
|
||||||
|
* finddata_t structure in the DIR. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is an internal data structure. Good programmers will not use it
|
||||||
|
* except as an argument to one of the functions below.
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
/* disk transfer area for this dir */
|
||||||
|
struct _finddata_t dd_dta;
|
||||||
|
|
||||||
|
/* dirent struct to return from dir (NOTE: this makes this thread
|
||||||
|
* safe as long as only one thread uses a particular DIR struct at
|
||||||
|
* a time) */
|
||||||
|
struct dirent dd_dir;
|
||||||
|
|
||||||
|
/* _findnext handle */
|
||||||
|
long dd_handle;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Status of search:
|
||||||
|
* 0 = not started yet (next entry to read is first entry)
|
||||||
|
* -1 = off the end
|
||||||
|
* positive = 0 based index of next entry
|
||||||
|
*/
|
||||||
|
short dd_stat;
|
||||||
|
|
||||||
|
/* given path for dir with search pattern (struct is extended) */
|
||||||
|
char dd_name[1];
|
||||||
|
} DIR;
|
||||||
|
|
||||||
|
|
||||||
|
DIR* opendir (const char*);
|
||||||
|
struct dirent* readdir (DIR*);
|
||||||
|
int closedir (DIR*);
|
||||||
|
void rewinddir (DIR*);
|
||||||
|
long telldir (DIR*);
|
||||||
|
void seekdir (DIR*, long);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _DIRENT_H_ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
110
bazaar/Tcc/lib/include/dos.h
Normal file
110
bazaar/Tcc/lib/include/dos.h
Normal file
|
|
@ -0,0 +1,110 @@
|
||||||
|
/*
|
||||||
|
* dos.h
|
||||||
|
*
|
||||||
|
* DOS-specific functions and structures.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _DOS_H_
|
||||||
|
#define _DOS_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define __need_wchar_t
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
/* For DOS file attributes */
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MSVCRT__ /* these are in CRTDLL, but not MSVCRT */
|
||||||
|
#ifndef __DECLSPEC_SUPPORTED
|
||||||
|
extern unsigned int *__imp__basemajor_dll;
|
||||||
|
extern unsigned int *__imp__baseminor_dll;
|
||||||
|
extern unsigned int *__imp__baseversion_dll;
|
||||||
|
extern unsigned int *__imp__osmajor_dll;
|
||||||
|
extern unsigned int *__imp__osminor_dll;
|
||||||
|
extern unsigned int *__imp__osmode_dll;
|
||||||
|
|
||||||
|
#define _basemajor (*__imp__basemajor_dll)
|
||||||
|
#define _baseminor (*__imp__baseminor_dll)
|
||||||
|
#define _baseversion (*__imp__baseversion_dll)
|
||||||
|
#define _osmajor (*__imp__osmajor_dll)
|
||||||
|
#define _osminor (*__imp__osminor_dll)
|
||||||
|
#define _osmode (*__imp__osmode_dll)
|
||||||
|
|
||||||
|
#else /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
__MINGW_IMPORT unsigned int _basemajor_dll;
|
||||||
|
__MINGW_IMPORT unsigned int _baseminor_dll;
|
||||||
|
__MINGW_IMPORT unsigned int _baseversion_dll;
|
||||||
|
__MINGW_IMPORT unsigned int _osmajor_dll;
|
||||||
|
__MINGW_IMPORT unsigned int _osminor_dll;
|
||||||
|
__MINGW_IMPORT unsigned int _osmode_dll;
|
||||||
|
|
||||||
|
#define _basemajor _basemajor_dll
|
||||||
|
#define _baseminor _baseminor_dll
|
||||||
|
#define _baseversion _baseversion_dll
|
||||||
|
#define _osmajor _osmajor_dll
|
||||||
|
#define _osminor _osminor_dll
|
||||||
|
#define _osmode _osmode_dll
|
||||||
|
|
||||||
|
#endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
#endif /* ! __MSVCRT__ */
|
||||||
|
|
||||||
|
#ifndef _DISKFREE_T_DEFINED
|
||||||
|
/* needed by _getdiskfree (also in direct.h) */
|
||||||
|
struct _diskfree_t {
|
||||||
|
unsigned total_clusters;
|
||||||
|
unsigned avail_clusters;
|
||||||
|
unsigned sectors_per_cluster;
|
||||||
|
unsigned bytes_per_sector;
|
||||||
|
};
|
||||||
|
#define _DISKFREE_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
unsigned _getdiskfree (unsigned, struct _diskfree_t *);
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
# define diskfree_t _diskfree_t
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _DOS_H_ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
117
bazaar/Tcc/lib/include/errno.h
Normal file
117
bazaar/Tcc/lib/include/errno.h
Normal file
|
|
@ -0,0 +1,117 @@
|
||||||
|
/*
|
||||||
|
* errno.h
|
||||||
|
*
|
||||||
|
* Error numbers and access to error reporting.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ERRNO_H_
|
||||||
|
#define _ERRNO_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Error numbers.
|
||||||
|
* TODO: Can't be sure of some of these assignments, I guessed from the
|
||||||
|
* names given by strerror and the defines in the Cygnus errno.h. A lot
|
||||||
|
* of the names from the Cygnus errno.h are not represented, and a few
|
||||||
|
* of the descriptions returned by strerror do not obviously match
|
||||||
|
* their error naming.
|
||||||
|
*/
|
||||||
|
#define EPERM 1 /* Operation not permitted */
|
||||||
|
#define ENOFILE 2 /* No such file or directory */
|
||||||
|
#define ENOENT 2
|
||||||
|
#define ESRCH 3 /* No such process */
|
||||||
|
#define EINTR 4 /* Interrupted function call */
|
||||||
|
#define EIO 5 /* Input/output error */
|
||||||
|
#define ENXIO 6 /* No such device or address */
|
||||||
|
#define E2BIG 7 /* Arg list too long */
|
||||||
|
#define ENOEXEC 8 /* Exec format error */
|
||||||
|
#define EBADF 9 /* Bad file descriptor */
|
||||||
|
#define ECHILD 10 /* No child processes */
|
||||||
|
#define EAGAIN 11 /* Resource temporarily unavailable */
|
||||||
|
#define ENOMEM 12 /* Not enough space */
|
||||||
|
#define EACCES 13 /* Permission denied */
|
||||||
|
#define EFAULT 14 /* Bad address */
|
||||||
|
/* 15 - Unknown Error */
|
||||||
|
#define EBUSY 16 /* strerror reports "Resource device" */
|
||||||
|
#define EEXIST 17 /* File exists */
|
||||||
|
#define EXDEV 18 /* Improper link (cross-device link?) */
|
||||||
|
#define ENODEV 19 /* No such device */
|
||||||
|
#define ENOTDIR 20 /* Not a directory */
|
||||||
|
#define EISDIR 21 /* Is a directory */
|
||||||
|
#define EINVAL 22 /* Invalid argument */
|
||||||
|
#define ENFILE 23 /* Too many open files in system */
|
||||||
|
#define EMFILE 24 /* Too many open files */
|
||||||
|
#define ENOTTY 25 /* Inappropriate I/O control operation */
|
||||||
|
/* 26 - Unknown Error */
|
||||||
|
#define EFBIG 27 /* File too large */
|
||||||
|
#define ENOSPC 28 /* No space left on device */
|
||||||
|
#define ESPIPE 29 /* Invalid seek (seek on a pipe?) */
|
||||||
|
#define EROFS 30 /* Read-only file system */
|
||||||
|
#define EMLINK 31 /* Too many links */
|
||||||
|
#define EPIPE 32 /* Broken pipe */
|
||||||
|
#define EDOM 33 /* Domain error (math functions) */
|
||||||
|
#define ERANGE 34 /* Result too large (possibly too small) */
|
||||||
|
/* 35 - Unknown Error */
|
||||||
|
#define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */
|
||||||
|
#define EDEADLK 36
|
||||||
|
/* 37 - Unknown Error */
|
||||||
|
#define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */
|
||||||
|
#define ENOLCK 39 /* No locks available (46 in Cyg?) */
|
||||||
|
#define ENOSYS 40 /* Function not implemented (88 in Cyg?) */
|
||||||
|
#define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */
|
||||||
|
#define EILSEQ 42 /* Illegal byte sequence */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the
|
||||||
|
* sockets.h header provided with windows32api-0.1.2.
|
||||||
|
* You should go and put an #if 0 ... #endif around the whole block
|
||||||
|
* of errors (look at the comment above them).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Definitions of errno. For _doserrno, sys_nerr and * sys_errlist, see
|
||||||
|
* stdlib.h.
|
||||||
|
*/
|
||||||
|
#ifdef _UWIN
|
||||||
|
#undef errno
|
||||||
|
extern int errno;
|
||||||
|
#else
|
||||||
|
int* _errno(void);
|
||||||
|
#define errno (*_errno())
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _ERRNO_H_ */
|
||||||
20
bazaar/Tcc/lib/include/excpt.h
Normal file
20
bazaar/Tcc/lib/include/excpt.h
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#ifndef _EXCPT_H
|
||||||
|
#define _EXCPT_H
|
||||||
|
#if __GNUC__ >=3
|
||||||
|
#pragma GCC system_header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* FIXME: This will make some code compile. The programs will most
|
||||||
|
likely crash when an exception is raised, but at least they will
|
||||||
|
compile. */
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define __try
|
||||||
|
#define __except(x) if (0) /* don't execute handler */
|
||||||
|
#define __finally
|
||||||
|
|
||||||
|
#define _try __try
|
||||||
|
#define _except __except
|
||||||
|
#define _finally __finally
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
135
bazaar/Tcc/lib/include/fcntl.h
Normal file
135
bazaar/Tcc/lib/include/fcntl.h
Normal file
|
|
@ -0,0 +1,135 @@
|
||||||
|
/*
|
||||||
|
* fcntl.h
|
||||||
|
*
|
||||||
|
* Access constants for _open. Note that the permissions constants are
|
||||||
|
* in sys/stat.h (ick).
|
||||||
|
*
|
||||||
|
* This code is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _FCNTL_H_
|
||||||
|
#define _FCNTL_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* It appears that fcntl.h should include io.h for compatibility...
|
||||||
|
*/
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
|
/* Specifiy one of these flags to define the access mode. */
|
||||||
|
#define _O_RDONLY 0
|
||||||
|
#define _O_WRONLY 1
|
||||||
|
#define _O_RDWR 2
|
||||||
|
|
||||||
|
/* Mask for access mode bits in the _open flags. */
|
||||||
|
#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
|
||||||
|
|
||||||
|
#define _O_APPEND 0x0008 /* Writes will add to the end of the file. */
|
||||||
|
|
||||||
|
#define _O_RANDOM 0x0010
|
||||||
|
#define _O_SEQUENTIAL 0x0020
|
||||||
|
#define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing.
|
||||||
|
* WARNING: Even if not created by _open! */
|
||||||
|
#define _O_NOINHERIT 0x0080
|
||||||
|
|
||||||
|
#define _O_CREAT 0x0100 /* Create the file if it does not exist. */
|
||||||
|
#define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */
|
||||||
|
#define _O_EXCL 0x0400 /* Open only if the file does not exist. */
|
||||||
|
|
||||||
|
/* NOTE: Text is the default even if the given _O_TEXT bit is not on. */
|
||||||
|
#define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */
|
||||||
|
#define _O_BINARY 0x8000 /* Input and output is not translated. */
|
||||||
|
#define _O_RAW _O_BINARY
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
|
||||||
|
/* POSIX/Non-ANSI names for increased portability */
|
||||||
|
#define O_RDONLY _O_RDONLY
|
||||||
|
#define O_WRONLY _O_WRONLY
|
||||||
|
#define O_RDWR _O_RDWR
|
||||||
|
#define O_ACCMODE _O_ACCMODE
|
||||||
|
#define O_APPEND _O_APPEND
|
||||||
|
#define O_CREAT _O_CREAT
|
||||||
|
#define O_TRUNC _O_TRUNC
|
||||||
|
#define O_EXCL _O_EXCL
|
||||||
|
#define O_TEXT _O_TEXT
|
||||||
|
#define O_BINARY _O_BINARY
|
||||||
|
#define O_TEMPORARY _O_TEMPORARY
|
||||||
|
#define O_NOINHERIT _O_NOINHERIT
|
||||||
|
#define O_SEQENTIAL _O_SEQUENTIAL
|
||||||
|
#define O_RANDOM _O_RANDOM
|
||||||
|
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This variable determines the default file mode.
|
||||||
|
* TODO: Which flags work?
|
||||||
|
*/
|
||||||
|
#ifndef __DECLSPEC_SUPPORTED
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
extern unsigned int* __imp__fmode;
|
||||||
|
#define _fmode (*__imp__fmode)
|
||||||
|
#else
|
||||||
|
/* CRTDLL */
|
||||||
|
extern unsigned int* __imp__fmode_dll;
|
||||||
|
#define _fmode (*__imp__fmode_dll)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
__MINGW_IMPORT unsigned int _fmode;
|
||||||
|
#else /* ! __MSVCRT__ */
|
||||||
|
__MINGW_IMPORT unsigned int _fmode_dll;
|
||||||
|
#define _fmode _fmode_dll
|
||||||
|
#endif /* ! __MSVCRT__ */
|
||||||
|
|
||||||
|
#endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int _setmode (int, int);
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
int setmode (int, int);
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _FCNTL_H_ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
85
bazaar/Tcc/lib/include/fenv.h
Normal file
85
bazaar/Tcc/lib/include/fenv.h
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
#ifndef _FENV_H
|
||||||
|
#define _FENV_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
For now, support only for the basic abstraction of flags that are
|
||||||
|
either set or clear. fexcept_t could be structure that holds more info
|
||||||
|
about the fp environment.
|
||||||
|
*/
|
||||||
|
typedef unsigned short fexcept_t;
|
||||||
|
|
||||||
|
/* This 28-byte struct represents the entire floating point
|
||||||
|
environment as stored by fnstenv or fstenv */
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned short __control_word;
|
||||||
|
unsigned short __unused0;
|
||||||
|
unsigned short __status_word;
|
||||||
|
unsigned short __unused1;
|
||||||
|
unsigned short __tag_word;
|
||||||
|
unsigned short __unused2;
|
||||||
|
unsigned int __ip_offset; /* instruction pointer offset */
|
||||||
|
unsigned short __ip_selector;
|
||||||
|
unsigned short __opcode;
|
||||||
|
unsigned int __data_offset;
|
||||||
|
unsigned short __data_selector;
|
||||||
|
unsigned short __unused3;
|
||||||
|
} fenv_t;
|
||||||
|
|
||||||
|
|
||||||
|
/* FPU status word exception flags */
|
||||||
|
#define FE_INVALID 0x01
|
||||||
|
#define FE_DENORMAL 0x02
|
||||||
|
#define FE_DIVBYZERO 0x04
|
||||||
|
#define FE_OVERFLOW 0x08
|
||||||
|
#define FE_UNDERFLOW 0x10
|
||||||
|
#define FE_INEXACT 0x20
|
||||||
|
#define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \
|
||||||
|
| FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
|
||||||
|
|
||||||
|
/* FPU control word rounding flags */
|
||||||
|
#define FE_TONEAREST 0x0000
|
||||||
|
#define FE_DOWNWARD 0x0400
|
||||||
|
#define FE_UPWARD 0x0800
|
||||||
|
#define FE_TOWARDZERO 0x0c00
|
||||||
|
|
||||||
|
|
||||||
|
/* The default floating point environment */
|
||||||
|
#define FE_DFL_ENV ((const fenv_t *)-1)
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*TODO: Some of these could be inlined */
|
||||||
|
/* 7.6.2 Exception */
|
||||||
|
|
||||||
|
extern int feclearexcept (int);
|
||||||
|
extern int fegetexceptflag (fexcept_t * flagp, int excepts);
|
||||||
|
extern int feraiseexcept (int excepts );
|
||||||
|
extern int fesetexceptflag (const fexcept_t *, int);
|
||||||
|
extern int fetestexcept (int excepts);
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.6.3 Rounding */
|
||||||
|
|
||||||
|
extern int fegetround (void);
|
||||||
|
extern int fesetround (int mode);
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.6.4 Environment */
|
||||||
|
|
||||||
|
extern int fegetenv (fenv_t * envp);
|
||||||
|
extern int fesetenv (const fenv_t * );
|
||||||
|
extern int feupdateenv (const fenv_t *);
|
||||||
|
extern int feholdexcept (fenv_t *);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* ndef _FENV_H */
|
||||||
224
bazaar/Tcc/lib/include/float.h
Normal file
224
bazaar/Tcc/lib/include/float.h
Normal file
|
|
@ -0,0 +1,224 @@
|
||||||
|
/*
|
||||||
|
* float.h
|
||||||
|
*
|
||||||
|
* Constants related to floating point arithmetic.
|
||||||
|
*
|
||||||
|
* Also included here are some non-ANSI bits for accessing the floating
|
||||||
|
* point controller.
|
||||||
|
*
|
||||||
|
* NOTE: GCC provides float.h, and it is probably more accurate than this,
|
||||||
|
* but it doesn't include the non-standard stuff for accessing the
|
||||||
|
* fp controller. (TODO: Move those bits elsewhere?) Thus it is
|
||||||
|
* probably not a good idea to use the GCC supplied version instead
|
||||||
|
* of this header.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _FLOAT_H_
|
||||||
|
#define _FLOAT_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define FLT_ROUNDS 1
|
||||||
|
#define FLT_GUARD 1
|
||||||
|
#define FLT_NORMALIZE 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The characteristics of float.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* The radix for floating point representation. */
|
||||||
|
#define FLT_RADIX 2
|
||||||
|
|
||||||
|
/* Decimal digits of precision. */
|
||||||
|
#define FLT_DIG 6
|
||||||
|
|
||||||
|
/* Smallest number such that 1+x != 1 */
|
||||||
|
#define FLT_EPSILON 1.19209290e-07F
|
||||||
|
|
||||||
|
/* The number of base FLT_RADIX digits in the mantissa. */
|
||||||
|
#define FLT_MANT_DIG 24
|
||||||
|
|
||||||
|
/* The maximum floating point number. */
|
||||||
|
#define FLT_MAX 3.40282347e+38F
|
||||||
|
|
||||||
|
/* Maximum n such that FLT_RADIX^n - 1 is representable. */
|
||||||
|
#define FLT_MAX_EXP 128
|
||||||
|
|
||||||
|
/* Maximum n such that 10^n is representable. */
|
||||||
|
#define FLT_MAX_10_EXP 38
|
||||||
|
|
||||||
|
/* Minimum normalized floating-point number. */
|
||||||
|
#define FLT_MIN 1.17549435e-38F
|
||||||
|
|
||||||
|
/* Minimum n such that FLT_RADIX^n is a normalized number. */
|
||||||
|
#define FLT_MIN_EXP (-125)
|
||||||
|
|
||||||
|
/* Minimum n such that 10^n is a normalized number. */
|
||||||
|
#define FLT_MIN_10_EXP (-37)
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The characteristics of double.
|
||||||
|
*/
|
||||||
|
#define DBL_DIG 15
|
||||||
|
#define DBL_EPSILON 1.1102230246251568e-16
|
||||||
|
#define DBL_MANT_DIG 53
|
||||||
|
#define DBL_MAX 1.7976931348623157e+308
|
||||||
|
#define DBL_MAX_EXP 1024
|
||||||
|
#define DBL_MAX_10_EXP 308
|
||||||
|
#define DBL_MIN 2.2250738585072014e-308
|
||||||
|
#define DBL_MIN_EXP (-1021)
|
||||||
|
#define DBL_MIN_10_EXP (-307)
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The characteristics of long double.
|
||||||
|
* NOTE: long double is the same as double.
|
||||||
|
*/
|
||||||
|
#define LDBL_DIG 15
|
||||||
|
#define LDBL_EPSILON 1.1102230246251568e-16L
|
||||||
|
#define LDBL_MANT_DIG 53
|
||||||
|
#define LDBL_MAX 1.7976931348623157e+308L
|
||||||
|
#define LDBL_MAX_EXP 1024
|
||||||
|
#define LDBL_MAX_10_EXP 308
|
||||||
|
#define LDBL_MIN 2.2250738585072014e-308L
|
||||||
|
#define LDBL_MIN_EXP (-1021)
|
||||||
|
#define LDBL_MIN_10_EXP (-307)
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Functions and definitions for controlling the FPU.
|
||||||
|
*/
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
/* TODO: These constants are only valid for x86 machines */
|
||||||
|
|
||||||
|
/* Control word masks for unMask */
|
||||||
|
#define _MCW_EM 0x0008001F /* Error masks */
|
||||||
|
#define _MCW_IC 0x00040000 /* Infinity */
|
||||||
|
#define _MCW_RC 0x00000300 /* Rounding */
|
||||||
|
#define _MCW_PC 0x00030000 /* Precision */
|
||||||
|
|
||||||
|
/* Control word values for unNew (use with related unMask above) */
|
||||||
|
#define _EM_INVALID 0x00000010
|
||||||
|
#define _EM_DENORMAL 0x00080000
|
||||||
|
#define _EM_ZERODIVIDE 0x00000008
|
||||||
|
#define _EM_OVERFLOW 0x00000004
|
||||||
|
#define _EM_UNDERFLOW 0x00000002
|
||||||
|
#define _EM_INEXACT 0x00000001
|
||||||
|
#define _IC_AFFINE 0x00040000
|
||||||
|
#define _IC_PROJECTIVE 0x00000000
|
||||||
|
#define _RC_CHOP 0x00000300
|
||||||
|
#define _RC_UP 0x00000200
|
||||||
|
#define _RC_DOWN 0x00000100
|
||||||
|
#define _RC_NEAR 0x00000000
|
||||||
|
#define _PC_24 0x00020000
|
||||||
|
#define _PC_53 0x00010000
|
||||||
|
#define _PC_64 0x00000000
|
||||||
|
|
||||||
|
/* These are also defined in Mingw math.h, needed to work around
|
||||||
|
GCC build issues. */
|
||||||
|
/* Return values for fpclass. */
|
||||||
|
#ifndef __MINGW_FPCLASS_DEFINED
|
||||||
|
#define __MINGW_FPCLASS_DEFINED 1
|
||||||
|
#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
|
||||||
|
#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
|
||||||
|
#define _FPCLASS_NINF 0x0004 /* Negative Infinity */
|
||||||
|
#define _FPCLASS_NN 0x0008 /* Negative Normal */
|
||||||
|
#define _FPCLASS_ND 0x0010 /* Negative Denormal */
|
||||||
|
#define _FPCLASS_NZ 0x0020 /* Negative Zero */
|
||||||
|
#define _FPCLASS_PZ 0x0040 /* Positive Zero */
|
||||||
|
#define _FPCLASS_PD 0x0080 /* Positive Denormal */
|
||||||
|
#define _FPCLASS_PN 0x0100 /* Positive Normal */
|
||||||
|
#define _FPCLASS_PINF 0x0200 /* Positive Infinity */
|
||||||
|
#endif /* __MINGW_FPCLASS_DEFINED */
|
||||||
|
|
||||||
|
/* invalid subconditions (_SW_INVALID also set) */
|
||||||
|
#define _SW_UNEMULATED 0x0040 /* unemulated instruction */
|
||||||
|
#define _SW_SQRTNEG 0x0080 /* square root of a neg number */
|
||||||
|
#define _SW_STACKOVERFLOW 0x0200 /* FP stack overflow */
|
||||||
|
#define _SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */
|
||||||
|
|
||||||
|
/* Floating point error signals and return codes */
|
||||||
|
#define _FPE_INVALID 0x81
|
||||||
|
#define _FPE_DENORMAL 0x82
|
||||||
|
#define _FPE_ZERODIVIDE 0x83
|
||||||
|
#define _FPE_OVERFLOW 0x84
|
||||||
|
#define _FPE_UNDERFLOW 0x85
|
||||||
|
#define _FPE_INEXACT 0x86
|
||||||
|
#define _FPE_UNEMULATED 0x87
|
||||||
|
#define _FPE_SQRTNEG 0x88
|
||||||
|
#define _FPE_STACKOVERFLOW 0x8a
|
||||||
|
#define _FPE_STACKUNDERFLOW 0x8b
|
||||||
|
#define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
|
||||||
|
* i.e. change the bits in unMask to have the values they have in unNew,
|
||||||
|
* leaving other bits unchanged. */
|
||||||
|
unsigned int _controlfp (unsigned int unNew, unsigned int unMask);
|
||||||
|
unsigned int _control87 (unsigned int unNew, unsigned int unMask);
|
||||||
|
|
||||||
|
|
||||||
|
unsigned int _clearfp (void); /* Clear the FPU status word */
|
||||||
|
unsigned int _statusfp (void); /* Report the FPU status word */
|
||||||
|
#define _clear87 _clearfp
|
||||||
|
#define _status87 _statusfp
|
||||||
|
|
||||||
|
void _fpreset (void); /* Reset the FPU */
|
||||||
|
void fpreset (void);
|
||||||
|
|
||||||
|
/* Global 'variable' for the current floating point error code. */
|
||||||
|
int * __fpecode(void);
|
||||||
|
#define _fpecode (*(__fpecode()))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IEEE recommended functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
double _chgsign (double);
|
||||||
|
double _copysign (double, double);
|
||||||
|
double _logb (double);
|
||||||
|
double _nextafter (double, double);
|
||||||
|
double _scalb (double, long);
|
||||||
|
|
||||||
|
int _finite (double);
|
||||||
|
int _fpclass (double);
|
||||||
|
int _isnan (double);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
#endif /* _FLOAT_H_ */
|
||||||
|
|
||||||
275
bazaar/Tcc/lib/include/inttypes.h
Normal file
275
bazaar/Tcc/lib/include/inttypes.h
Normal file
|
|
@ -0,0 +1,275 @@
|
||||||
|
/* 7.8 Format conversion of integer types <inttypes.h> */
|
||||||
|
|
||||||
|
#ifndef _INTTYPES_H
|
||||||
|
#define _INTTYPES_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#define __need_wchar_t
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
intmax_t quot;
|
||||||
|
intmax_t rem;
|
||||||
|
} imaxdiv_t;
|
||||||
|
|
||||||
|
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
|
||||||
|
|
||||||
|
/* 7.8.1 Macros for format specifiers
|
||||||
|
*
|
||||||
|
* MS runtime does not yet understand C9x standard "ll"
|
||||||
|
* length specifier. It appears to treat "ll" as "l".
|
||||||
|
* The non-standard I64 length specifier causes warning in GCC,
|
||||||
|
* but understood by MS runtime functions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* fprintf macros for signed types */
|
||||||
|
#define PRId8 "d"
|
||||||
|
#define PRId16 "d"
|
||||||
|
#define PRId32 "d"
|
||||||
|
#define PRId64 "I64d"
|
||||||
|
|
||||||
|
#define PRIdLEAST8 "d"
|
||||||
|
#define PRIdLEAST16 "d"
|
||||||
|
#define PRIdLEAST32 "d"
|
||||||
|
#define PRIdLEAST64 "I64d"
|
||||||
|
|
||||||
|
#define PRIdFAST8 "d"
|
||||||
|
#define PRIdFAST16 "d"
|
||||||
|
#define PRIdFAST32 "d"
|
||||||
|
#define PRIdFAST64 "I64d"
|
||||||
|
|
||||||
|
#define PRIdMAX "I64d"
|
||||||
|
#define PRIdPTR "d"
|
||||||
|
|
||||||
|
#define PRIi8 "i"
|
||||||
|
#define PRIi16 "i"
|
||||||
|
#define PRIi32 "i"
|
||||||
|
#define PRIi64 "I64i"
|
||||||
|
|
||||||
|
#define PRIiLEAST8 "i"
|
||||||
|
#define PRIiLEAST16 "i"
|
||||||
|
#define PRIiLEAST32 "i"
|
||||||
|
#define PRIiLEAST64 "I64i"
|
||||||
|
|
||||||
|
#define PRIiFAST8 "i"
|
||||||
|
#define PRIiFAST16 "i"
|
||||||
|
#define PRIiFAST32 "i"
|
||||||
|
#define PRIiFAST64 "I64i"
|
||||||
|
|
||||||
|
#define PRIiMAX "I64i"
|
||||||
|
#define PRIiPTR "i"
|
||||||
|
|
||||||
|
#define PRIo8 "o"
|
||||||
|
#define PRIo16 "o"
|
||||||
|
#define PRIo32 "o"
|
||||||
|
#define PRIo64 "I64o"
|
||||||
|
|
||||||
|
#define PRIoLEAST8 "o"
|
||||||
|
#define PRIoLEAST16 "o"
|
||||||
|
#define PRIoLEAST32 "o"
|
||||||
|
#define PRIoLEAST64 "I64o"
|
||||||
|
|
||||||
|
#define PRIoFAST8 "o"
|
||||||
|
#define PRIoFAST16 "o"
|
||||||
|
#define PRIoFAST32 "o"
|
||||||
|
#define PRIoFAST64 "I64o"
|
||||||
|
|
||||||
|
#define PRIoMAX "I64o"
|
||||||
|
|
||||||
|
#define PRIoPTR "o"
|
||||||
|
|
||||||
|
/* fprintf macros for unsigned types */
|
||||||
|
#define PRIu8 "u"
|
||||||
|
#define PRIu16 "u"
|
||||||
|
#define PRIu32 "u"
|
||||||
|
#define PRIu64 "I64u"
|
||||||
|
|
||||||
|
|
||||||
|
#define PRIuLEAST8 "u"
|
||||||
|
#define PRIuLEAST16 "u"
|
||||||
|
#define PRIuLEAST32 "u"
|
||||||
|
#define PRIuLEAST64 "I64u"
|
||||||
|
|
||||||
|
#define PRIuFAST8 "u"
|
||||||
|
#define PRIuFAST16 "u"
|
||||||
|
#define PRIuFAST32 "u"
|
||||||
|
#define PRIuFAST64 "I64u"
|
||||||
|
|
||||||
|
#define PRIuMAX "I64u"
|
||||||
|
#define PRIuPTR "u"
|
||||||
|
|
||||||
|
#define PRIx8 "x"
|
||||||
|
#define PRIx16 "x"
|
||||||
|
#define PRIx32 "x"
|
||||||
|
#define PRIx64 "I64x"
|
||||||
|
|
||||||
|
#define PRIxLEAST8 "x"
|
||||||
|
#define PRIxLEAST16 "x"
|
||||||
|
#define PRIxLEAST32 "x"
|
||||||
|
#define PRIxLEAST64 "I64x"
|
||||||
|
|
||||||
|
#define PRIxFAST8 "x"
|
||||||
|
#define PRIxFAST16 "x"
|
||||||
|
#define PRIxFAST32 "x"
|
||||||
|
#define PRIxFAST64 "I64x"
|
||||||
|
|
||||||
|
#define PRIxMAX "I64x"
|
||||||
|
#define PRIxPTR "x"
|
||||||
|
|
||||||
|
#define PRIX8 "X"
|
||||||
|
#define PRIX16 "X"
|
||||||
|
#define PRIX32 "X"
|
||||||
|
#define PRIX64 "I64X"
|
||||||
|
|
||||||
|
#define PRIXLEAST8 "X"
|
||||||
|
#define PRIXLEAST16 "X"
|
||||||
|
#define PRIXLEAST32 "X"
|
||||||
|
#define PRIXLEAST64 "I64X"
|
||||||
|
|
||||||
|
#define PRIXFAST8 "X"
|
||||||
|
#define PRIXFAST16 "X"
|
||||||
|
#define PRIXFAST32 "X"
|
||||||
|
#define PRIXFAST64 "I64X"
|
||||||
|
|
||||||
|
#define PRIXMAX "I64X"
|
||||||
|
#define PRIXPTR "X"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* fscanf macros for signed int types
|
||||||
|
* NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t
|
||||||
|
* (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have
|
||||||
|
* no length identifiers
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define SCNd16 "hd"
|
||||||
|
#define SCNd32 "d"
|
||||||
|
#define SCNd64 "I64d"
|
||||||
|
|
||||||
|
#define SCNdLEAST16 "hd"
|
||||||
|
#define SCNdLEAST32 "d"
|
||||||
|
#define SCNdLEAST64 "I64d"
|
||||||
|
|
||||||
|
#define SCNdFAST16 "hd"
|
||||||
|
#define SCNdFAST32 "d"
|
||||||
|
#define SCNdFAST64 "I64d"
|
||||||
|
|
||||||
|
#define SCNdMAX "I64d"
|
||||||
|
#define SCNdPTR "d"
|
||||||
|
|
||||||
|
#define SCNi16 "hi"
|
||||||
|
#define SCNi32 "i"
|
||||||
|
#define SCNi64 "I64i"
|
||||||
|
|
||||||
|
#define SCNiLEAST16 "hi"
|
||||||
|
#define SCNiLEAST32 "i"
|
||||||
|
#define SCNiLEAST64 "I64i"
|
||||||
|
|
||||||
|
#define SCNiFAST16 "hi"
|
||||||
|
#define SCNiFAST32 "i"
|
||||||
|
#define SCNiFAST64 "I64i"
|
||||||
|
|
||||||
|
#define SCNiMAX "I64i"
|
||||||
|
#define SCNiPTR "i"
|
||||||
|
|
||||||
|
#define SCNo16 "ho"
|
||||||
|
#define SCNo32 "o"
|
||||||
|
#define SCNo64 "I64o"
|
||||||
|
|
||||||
|
#define SCNoLEAST16 "ho"
|
||||||
|
#define SCNoLEAST32 "o"
|
||||||
|
#define SCNoLEAST64 "I64o"
|
||||||
|
|
||||||
|
#define SCNoFAST16 "ho"
|
||||||
|
#define SCNoFAST32 "o"
|
||||||
|
#define SCNoFAST64 "I64o"
|
||||||
|
|
||||||
|
#define SCNoMAX "I64o"
|
||||||
|
#define SCNoPTR "o"
|
||||||
|
|
||||||
|
#define SCNx16 "hx"
|
||||||
|
#define SCNx32 "x"
|
||||||
|
#define SCNx64 "I64x"
|
||||||
|
|
||||||
|
#define SCNxLEAST16 "hx"
|
||||||
|
#define SCNxLEAST32 "x"
|
||||||
|
#define SCNxLEAST64 "I64x"
|
||||||
|
|
||||||
|
#define SCNxFAST16 "hx"
|
||||||
|
#define SCNxFAST32 "x"
|
||||||
|
#define SCNxFAST64 "I64x"
|
||||||
|
|
||||||
|
#define SCNxMAX "I64x"
|
||||||
|
#define SCNxPTR "x"
|
||||||
|
|
||||||
|
|
||||||
|
/* fscanf macros for unsigned int types */
|
||||||
|
|
||||||
|
#define SCNu16 "hu"
|
||||||
|
#define SCNu32 "u"
|
||||||
|
#define SCNu64 "I64u"
|
||||||
|
|
||||||
|
#define SCNuLEAST16 "hu"
|
||||||
|
#define SCNuLEAST32 "u"
|
||||||
|
#define SCNuLEAST64 "I64u"
|
||||||
|
|
||||||
|
#define SCNuFAST16 "hu"
|
||||||
|
#define SCNuFAST32 "u"
|
||||||
|
#define SCNuFAST64 "I64u"
|
||||||
|
|
||||||
|
#define SCNuMAX "I64u"
|
||||||
|
#define SCNuPTR "u"
|
||||||
|
|
||||||
|
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||||
|
/*
|
||||||
|
* no length modifier for char types prior to C9x
|
||||||
|
* MS runtime scanf appears to treat "hh" as "h"
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* signed char */
|
||||||
|
#define SCNd8 "hhd"
|
||||||
|
#define SCNdLEAST8 "hhd"
|
||||||
|
#define SCNdFAST8 "hhd"
|
||||||
|
|
||||||
|
#define SCNi8 "hhi"
|
||||||
|
#define SCNiLEAST8 "hhi"
|
||||||
|
#define SCNiFAST8 "hhi"
|
||||||
|
|
||||||
|
#define SCNo8 "hho"
|
||||||
|
#define SCNoLEAST8 "hho"
|
||||||
|
#define SCNoFAST8 "hho"
|
||||||
|
|
||||||
|
#define SCNx8 "hhx"
|
||||||
|
#define SCNxLEAST8 "hhx"
|
||||||
|
#define SCNxFAST8 "hhx"
|
||||||
|
|
||||||
|
/* unsigned char */
|
||||||
|
#define SCNu8 "hhu"
|
||||||
|
#define SCNuLEAST8 "hhu"
|
||||||
|
#define SCNuFAST8 "hhu"
|
||||||
|
#endif /* __STDC_VERSION__ >= 199901 */
|
||||||
|
|
||||||
|
#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
|
||||||
|
|
||||||
|
extern inline intmax_t imaxabs (intmax_t j)
|
||||||
|
{return (j >= 0 ? j : -j);}
|
||||||
|
imaxdiv_t imaxdiv (intmax_t numer, intmax_t denom);
|
||||||
|
|
||||||
|
/* 7.8.2 Conversion functions for greatest-width integer types */
|
||||||
|
|
||||||
|
intmax_t strtoimax (const char* __restrict__ nptr, char** __restrict__ endptr, int base);
|
||||||
|
uintmax_t strtoumax (const char* __restrict__ nptr, char** __restrict__ endptr, int base);
|
||||||
|
|
||||||
|
intmax_t wcstoimax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr,
|
||||||
|
int base);
|
||||||
|
uintmax_t wcstoumax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr,
|
||||||
|
int base);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* ndef _INTTYPES_H */
|
||||||
296
bazaar/Tcc/lib/include/io.h
Normal file
296
bazaar/Tcc/lib/include/io.h
Normal file
|
|
@ -0,0 +1,296 @@
|
||||||
|
/*
|
||||||
|
* io.h
|
||||||
|
*
|
||||||
|
* System level I/O functions and types.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _IO_H_
|
||||||
|
#define _IO_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
/* We need the definition of FILE anyway... */
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
/* MSVC's io.h contains the stuff from dir.h, so I will too.
|
||||||
|
* NOTE: This also defines off_t, the file offset type, through
|
||||||
|
* an inclusion of sys/types.h */
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#include <sys/types.h> /* To get time_t. */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Attributes of files as returned by _findfirst et al.
|
||||||
|
*/
|
||||||
|
#define _A_NORMAL 0x00000000
|
||||||
|
#define _A_RDONLY 0x00000001
|
||||||
|
#define _A_HIDDEN 0x00000002
|
||||||
|
#define _A_SYSTEM 0x00000004
|
||||||
|
#define _A_VOLID 0x00000008
|
||||||
|
#define _A_SUBDIR 0x00000010
|
||||||
|
#define _A_ARCH 0x00000020
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifndef _FSIZE_T_DEFINED
|
||||||
|
typedef unsigned long _fsize_t;
|
||||||
|
#define _FSIZE_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following structure is filled in by _findfirst or _findnext when
|
||||||
|
* they succeed in finding a match.
|
||||||
|
*/
|
||||||
|
struct _finddata_t
|
||||||
|
{
|
||||||
|
unsigned attrib; /* Attributes, see constants above. */
|
||||||
|
time_t time_create;
|
||||||
|
time_t time_access; /* always midnight local time */
|
||||||
|
time_t time_write;
|
||||||
|
_fsize_t size;
|
||||||
|
char name[FILENAME_MAX]; /* may include spaces. */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _finddatai64_t {
|
||||||
|
unsigned attrib;
|
||||||
|
time_t time_create;
|
||||||
|
time_t time_access;
|
||||||
|
time_t time_write;
|
||||||
|
__int64 size;
|
||||||
|
char name[FILENAME_MAX];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _WFINDDATA_T_DEFINED
|
||||||
|
struct _wfinddata_t {
|
||||||
|
unsigned attrib;
|
||||||
|
time_t time_create; /* -1 for FAT file systems */
|
||||||
|
time_t time_access; /* -1 for FAT file systems */
|
||||||
|
time_t time_write;
|
||||||
|
_fsize_t size;
|
||||||
|
wchar_t name[FILENAME_MAX]; /* may include spaces. */
|
||||||
|
};
|
||||||
|
struct _wfinddatai64_t {
|
||||||
|
unsigned attrib;
|
||||||
|
time_t time_create;
|
||||||
|
time_t time_access;
|
||||||
|
time_t time_write;
|
||||||
|
__int64 size;
|
||||||
|
wchar_t name[FILENAME_MAX];
|
||||||
|
};
|
||||||
|
|
||||||
|
#define _WFINDDATA_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Functions for searching for files. _findfirst returns -1 if no match
|
||||||
|
* is found. Otherwise it returns a handle to be used in _findnext and
|
||||||
|
* _findclose calls. _findnext also returns -1 if no match could be found,
|
||||||
|
* and 0 if a match was found. Call _findclose when you are finished.
|
||||||
|
*/
|
||||||
|
int _findfirst (const char*, struct _finddata_t*);
|
||||||
|
int _findnext (int, struct _finddata_t*);
|
||||||
|
int _findclose (int);
|
||||||
|
|
||||||
|
int _chdir (const char*);
|
||||||
|
char* _getcwd (char*, int);
|
||||||
|
int _mkdir (const char*);
|
||||||
|
char* _mktemp (char*);
|
||||||
|
int _rmdir (const char*);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
__int64 _filelengthi64(int);
|
||||||
|
long _findfirsti64(const char*, struct _finddatai64_t*);
|
||||||
|
int _findnexti64(long, struct _finddatai64_t*);
|
||||||
|
__int64 _lseeki64(int, __int64, int);
|
||||||
|
__int64 _telli64(int);
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
|
||||||
|
#ifndef _UWIN
|
||||||
|
int chdir (const char*);
|
||||||
|
char* getcwd (char*, int);
|
||||||
|
int mkdir (const char*);
|
||||||
|
char* mktemp (char*);
|
||||||
|
int rmdir (const char*);
|
||||||
|
#endif /* _UWIN */
|
||||||
|
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
/* TODO: Maximum number of open handles has not been tested, I just set
|
||||||
|
* it the same as FOPEN_MAX. */
|
||||||
|
#define HANDLE_MAX FOPEN_MAX
|
||||||
|
|
||||||
|
|
||||||
|
/* Some defines for _access nAccessMode (MS doesn't define them, but
|
||||||
|
* it doesn't seem to hurt to add them). */
|
||||||
|
#define F_OK 0 /* Check for file existence */
|
||||||
|
#define X_OK 1 /* Check for execute permission. */
|
||||||
|
#define W_OK 2 /* Check for write permission */
|
||||||
|
#define R_OK 4 /* Check for read permission */
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int _access (const char*, int);
|
||||||
|
int _chsize (int, long);
|
||||||
|
int _close (int);
|
||||||
|
int _commit(int);
|
||||||
|
|
||||||
|
/* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80),
|
||||||
|
* the "owner write permission" bit (on FAT). */
|
||||||
|
int _creat (const char*, unsigned);
|
||||||
|
|
||||||
|
int _dup (int);
|
||||||
|
int _dup2 (int, int);
|
||||||
|
long _filelength (int);
|
||||||
|
int _fileno (FILE*);
|
||||||
|
long _get_osfhandle (int);
|
||||||
|
int _isatty (int);
|
||||||
|
|
||||||
|
/* In a very odd turn of events this function is excluded from those
|
||||||
|
* files which define _STREAM_COMPAT. This is required in order to
|
||||||
|
* build GNU libio because of a conflict with _eof in streambuf.h
|
||||||
|
* line 107. Actually I might just be able to change the name of
|
||||||
|
* the enum member in streambuf.h... we'll see. TODO */
|
||||||
|
#ifndef _STREAM_COMPAT
|
||||||
|
int _eof (int);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* LK_... locking commands defined in sys/locking.h. */
|
||||||
|
int _locking (int, int, long);
|
||||||
|
|
||||||
|
long _lseek (int, long, int);
|
||||||
|
|
||||||
|
/* Optional third argument is unsigned unPermissions. */
|
||||||
|
int _open (const char*, int, ...);
|
||||||
|
|
||||||
|
int _open_osfhandle (long, int);
|
||||||
|
int _pipe (int *, unsigned int, int);
|
||||||
|
int _read (int, void*, unsigned int);
|
||||||
|
|
||||||
|
/* SH_... flags for nShFlags defined in share.h
|
||||||
|
* Optional fourth argument is unsigned unPermissions */
|
||||||
|
int _sopen (const char*, int, int, ...);
|
||||||
|
|
||||||
|
long _tell (int);
|
||||||
|
/* Should umask be in sys/stat.h and/or sys/types.h instead? */
|
||||||
|
int _umask (int);
|
||||||
|
int _unlink (const char*);
|
||||||
|
int _write (int, const void*, unsigned int);
|
||||||
|
|
||||||
|
/* Wide character versions. Also declared in wchar.h. */
|
||||||
|
/* Not in crtdll.dll */
|
||||||
|
#if !defined (_WIO_DEFINED)
|
||||||
|
#if defined (__MSVCRT__)
|
||||||
|
int _waccess(const wchar_t*, int);
|
||||||
|
int _wchmod(const wchar_t*, int);
|
||||||
|
int _wcreat(const wchar_t*, int);
|
||||||
|
long _wfindfirst(wchar_t*, struct _wfinddata_t*);
|
||||||
|
int _wfindnext(long, struct _wfinddata_t *);
|
||||||
|
int _wunlink(const wchar_t*);
|
||||||
|
int _wopen(const wchar_t*, int, ...);
|
||||||
|
int _wsopen(const wchar_t*, int, int, ...);
|
||||||
|
wchar_t * _wmktemp(wchar_t*);
|
||||||
|
long _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
|
||||||
|
int _wfindnexti64(long, struct _wfinddatai64_t*);
|
||||||
|
#endif /* defined (__MSVCRT__) */
|
||||||
|
#define _WIO_DEFINED
|
||||||
|
#endif /* _WIO_DEFINED */
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
/*
|
||||||
|
* Non-underscored versions of non-ANSI functions to improve portability.
|
||||||
|
* These functions live in libmoldname.a.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _UWIN
|
||||||
|
int access (const char*, int);
|
||||||
|
int chsize (int, long );
|
||||||
|
int close (int);
|
||||||
|
int creat (const char*, int);
|
||||||
|
int dup (int);
|
||||||
|
int dup2 (int, int);
|
||||||
|
int eof (int);
|
||||||
|
long filelength (int);
|
||||||
|
int fileno (FILE*);
|
||||||
|
int isatty (int);
|
||||||
|
long lseek (int, long, int);
|
||||||
|
int open (const char*, int, ...);
|
||||||
|
int read (int, void*, unsigned int);
|
||||||
|
int sopen (const char*, int, int, ...);
|
||||||
|
long tell (int);
|
||||||
|
int umask (int);
|
||||||
|
int unlink (const char*);
|
||||||
|
int write (int, const void*, unsigned int);
|
||||||
|
#endif /* _UWIN */
|
||||||
|
|
||||||
|
/* Wide character versions. Also declared in wchar.h. */
|
||||||
|
/* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */
|
||||||
|
#if 0
|
||||||
|
int waccess(const wchar_t *, int);
|
||||||
|
int wchmod(const wchar_t *, int);
|
||||||
|
int wcreat(const wchar_t *, int);
|
||||||
|
long wfindfirst(wchar_t *, struct _wfinddata_t *);
|
||||||
|
int wfindnext(long, struct _wfinddata_t *);
|
||||||
|
int wunlink(const wchar_t *);
|
||||||
|
int wrename(const wchar_t *, const wchar_t *);
|
||||||
|
int wopen(const wchar_t *, int, ...);
|
||||||
|
int wsopen(const wchar_t *, int, int, ...);
|
||||||
|
wchar_t * wmktemp(wchar_t *);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* _IO_H_ not defined */
|
||||||
|
|
||||||
|
#endif /* Not strict ANSI */
|
||||||
|
|
||||||
115
bazaar/Tcc/lib/include/limits.h
Normal file
115
bazaar/Tcc/lib/include/limits.h
Normal file
|
|
@ -0,0 +1,115 @@
|
||||||
|
/*
|
||||||
|
* limits.h
|
||||||
|
*
|
||||||
|
* Defines constants for the sizes of integral types.
|
||||||
|
*
|
||||||
|
* NOTE: GCC should supply a version of this header and it should be safe to
|
||||||
|
* use that version instead of this one (maybe safer).
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _LIMITS_H_
|
||||||
|
#define _LIMITS_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File system limits
|
||||||
|
*
|
||||||
|
* TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the
|
||||||
|
* same as FILENAME_MAX and FOPEN_MAX from stdio.h?
|
||||||
|
* NOTE: Apparently the actual size of PATH_MAX is 260, but a space is
|
||||||
|
* required for the NUL. TODO: Test?
|
||||||
|
*/
|
||||||
|
#define PATH_MAX (259)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Characteristics of the char data type.
|
||||||
|
*
|
||||||
|
* TODO: Is MB_LEN_MAX correct?
|
||||||
|
*/
|
||||||
|
#define CHAR_BIT 8
|
||||||
|
#define MB_LEN_MAX 2
|
||||||
|
|
||||||
|
#define SCHAR_MIN (-128)
|
||||||
|
#define SCHAR_MAX 127
|
||||||
|
|
||||||
|
#define UCHAR_MAX 255
|
||||||
|
|
||||||
|
/* TODO: Is this safe? I think it might just be testing the preprocessor,
|
||||||
|
* not the compiler itself... */
|
||||||
|
#if ('\x80' < 0)
|
||||||
|
#define CHAR_MIN SCHAR_MIN
|
||||||
|
#define CHAR_MAX SCHAR_MAX
|
||||||
|
#else
|
||||||
|
#define CHAR_MIN 0
|
||||||
|
#define CHAR_MAX UCHAR_MAX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Maximum and minimum values for ints.
|
||||||
|
*/
|
||||||
|
#define INT_MAX 2147483647
|
||||||
|
#define INT_MIN (-INT_MAX-1)
|
||||||
|
|
||||||
|
#define UINT_MAX 0xffffffff
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Maximum and minimum values for shorts.
|
||||||
|
*/
|
||||||
|
#define SHRT_MAX 32767
|
||||||
|
#define SHRT_MIN (-SHRT_MAX-1)
|
||||||
|
|
||||||
|
#define USHRT_MAX 0xffff
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Maximum and minimum values for longs and unsigned longs.
|
||||||
|
*
|
||||||
|
* TODO: This is not correct for Alphas, which have 64 bit longs.
|
||||||
|
*/
|
||||||
|
#define LONG_MAX 2147483647L
|
||||||
|
|
||||||
|
#define LONG_MIN (-LONG_MAX-1)
|
||||||
|
|
||||||
|
#define ULONG_MAX 0xffffffffUL
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The GNU C compiler also allows 'long long int'
|
||||||
|
*/
|
||||||
|
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
|
||||||
|
|
||||||
|
#define LONG_LONG_MAX 9223372036854775807LL
|
||||||
|
#define LONG_LONG_MIN (-LONG_LONG_MAX-1)
|
||||||
|
|
||||||
|
#define ULONG_LONG_MAX (2ULL * LONG_LONG_MAX + 1)
|
||||||
|
|
||||||
|
/* ISO C9x macro names */
|
||||||
|
#define LLONG_MAX LONG_LONG_MAX
|
||||||
|
#define LLONG_MIN LONG_LONG_MIN
|
||||||
|
#define ULLONG_MAX ULONG_LONG_MAX
|
||||||
|
|
||||||
|
#endif /* Not Strict ANSI and GNU C compiler */
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* not _LIMITS_H_ */
|
||||||
100
bazaar/Tcc/lib/include/locale.h
Normal file
100
bazaar/Tcc/lib/include/locale.h
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
/*
|
||||||
|
* locale.h
|
||||||
|
*
|
||||||
|
* Functions and types for localization (ie. changing the appearance of
|
||||||
|
* output based on the standards of a certain country).
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _LOCALE_H_
|
||||||
|
#define _LOCALE_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: I have tried to test this, but I am limited by my knowledge of
|
||||||
|
* locale issues. The structure does not bomb if you look at the
|
||||||
|
* values, and 'decimal_point' even seems to be correct. But the
|
||||||
|
* rest of the values are, by default, not particularly useful
|
||||||
|
* (read meaningless and not related to the international settings
|
||||||
|
* of the system).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LC_ALL 0
|
||||||
|
#define LC_COLLATE 1
|
||||||
|
#define LC_CTYPE 2
|
||||||
|
#define LC_MONETARY 3
|
||||||
|
#define LC_NUMERIC 4
|
||||||
|
#define LC_TIME 5
|
||||||
|
#define LC_MIN LC_ALL
|
||||||
|
#define LC_MAX LC_TIME
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The structure returned by 'localeconv'.
|
||||||
|
*/
|
||||||
|
struct lconv
|
||||||
|
{
|
||||||
|
char* decimal_point;
|
||||||
|
char* thousands_sep;
|
||||||
|
char* grouping;
|
||||||
|
char* int_curr_symbol;
|
||||||
|
char* currency_symbol;
|
||||||
|
char* mon_decimal_point;
|
||||||
|
char* mon_thousands_sep;
|
||||||
|
char* mon_grouping;
|
||||||
|
char* positive_sign;
|
||||||
|
char* negative_sign;
|
||||||
|
char int_frac_digits;
|
||||||
|
char frac_digits;
|
||||||
|
char p_cs_precedes;
|
||||||
|
char p_sep_by_space;
|
||||||
|
char n_cs_precedes;
|
||||||
|
char n_sep_by_space;
|
||||||
|
char p_sign_posn;
|
||||||
|
char n_sign_posn;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
char* setlocale (int, const char*);
|
||||||
|
struct lconv* localeconv (void);
|
||||||
|
|
||||||
|
#ifndef _WLOCALE_DEFINED /* also declared in wchar.h */
|
||||||
|
# define __need_wchar_t
|
||||||
|
# include <stddef.h>
|
||||||
|
wchar_t* _wsetlocale(int, const wchar_t*);
|
||||||
|
# define _WLOCALE_DEFINED
|
||||||
|
#endif /* ndef _WLOCALE_DEFINED */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _LOCALE_H_ */
|
||||||
|
|
||||||
87
bazaar/Tcc/lib/include/malloc.h
Normal file
87
bazaar/Tcc/lib/include/malloc.h
Normal file
|
|
@ -0,0 +1,87 @@
|
||||||
|
/*
|
||||||
|
* malloc.h
|
||||||
|
*
|
||||||
|
* Support for programs which want to use malloc.h to get memory management
|
||||||
|
* functions. Unless you absolutely need some of these functions and they are
|
||||||
|
* not in the ANSI headers you should use the ANSI standard header files
|
||||||
|
* instead.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _MALLOC_H_
|
||||||
|
#define _MALLOC_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The structure used to walk through the heap with _heapwalk.
|
||||||
|
*/
|
||||||
|
typedef struct _heapinfo
|
||||||
|
{
|
||||||
|
int* _pentry;
|
||||||
|
size_t _size;
|
||||||
|
int _useflag;
|
||||||
|
} _HEAPINFO;
|
||||||
|
|
||||||
|
/* Values for _heapinfo.useflag */
|
||||||
|
#define _USEDENTRY 0
|
||||||
|
#define _FREEENTRY 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
The _heap* memory allocation functions are supported on NT
|
||||||
|
but not W9x. On latter, they always set errno to ENOSYS.
|
||||||
|
*/
|
||||||
|
int _heapwalk (_HEAPINFO*);
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
int heapwalk (_HEAPINFO*);
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
int _heapchk (void); /* Verify heap integrety. */
|
||||||
|
int _heapmin (void); /* Return unused heap to the OS. */
|
||||||
|
int _heapset (unsigned int);
|
||||||
|
|
||||||
|
size_t _msize (void*);
|
||||||
|
size_t _get_sbh_threshold (void);
|
||||||
|
int _set_sbh_threshold (size_t);
|
||||||
|
void * _expand (void*, size_t);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _MALLOC_H_ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
438
bazaar/Tcc/lib/include/math.h
Normal file
438
bazaar/Tcc/lib/include/math.h
Normal file
|
|
@ -0,0 +1,438 @@
|
||||||
|
/*
|
||||||
|
* math.h
|
||||||
|
*
|
||||||
|
* Mathematical functions.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _MATH_H_
|
||||||
|
#define _MATH_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Types for the _exception structure.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _DOMAIN 1 /* domain error in argument */
|
||||||
|
#define _SING 2 /* singularity */
|
||||||
|
#define _OVERFLOW 3 /* range overflow */
|
||||||
|
#define _UNDERFLOW 4 /* range underflow */
|
||||||
|
#define _TLOSS 5 /* total loss of precision */
|
||||||
|
#define _PLOSS 6 /* partial loss of precision */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Exception types with non-ANSI names for compatibility.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
|
||||||
|
#define DOMAIN _DOMAIN
|
||||||
|
#define SING _SING
|
||||||
|
#define OVERFLOW _OVERFLOW
|
||||||
|
#define UNDERFLOW _UNDERFLOW
|
||||||
|
#define TLOSS _TLOSS
|
||||||
|
#define PLOSS _PLOSS
|
||||||
|
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
|
||||||
|
/* These are also defined in Mingw float.h; needed here as well to work
|
||||||
|
around GCC build issues. */
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
#ifndef __MINGW_FPCLASS_DEFINED
|
||||||
|
#define __MINGW_FPCLASS_DEFINED 1
|
||||||
|
/* IEEE 754 classication */
|
||||||
|
#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
|
||||||
|
#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
|
||||||
|
#define _FPCLASS_NINF 0x0004 /* Negative Infinity */
|
||||||
|
#define _FPCLASS_NN 0x0008 /* Negative Normal */
|
||||||
|
#define _FPCLASS_ND 0x0010 /* Negative Denormal */
|
||||||
|
#define _FPCLASS_NZ 0x0020 /* Negative Zero */
|
||||||
|
#define _FPCLASS_PZ 0x0040 /* Positive Zero */
|
||||||
|
#define _FPCLASS_PD 0x0080 /* Positive Denormal */
|
||||||
|
#define _FPCLASS_PN 0x0100 /* Positive Normal */
|
||||||
|
#define _FPCLASS_PINF 0x0200 /* Positive Infinity */
|
||||||
|
#endif /* __MINGW_FPCLASS_DEFINED */
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HUGE_VAL is returned by strtod when the value would overflow the
|
||||||
|
* representation of 'double'. There are other uses as well.
|
||||||
|
*
|
||||||
|
* __imp__HUGE is a pointer to the actual variable _HUGE in
|
||||||
|
* MSVCRT.DLL. If we used _HUGE directly we would get a pointer
|
||||||
|
* to a thunk function.
|
||||||
|
*
|
||||||
|
* NOTE: The CRTDLL version uses _HUGE_dll instead.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __DECLSPEC_SUPPORTED
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
extern double* __imp__HUGE;
|
||||||
|
#define HUGE_VAL (*__imp__HUGE)
|
||||||
|
#else
|
||||||
|
/* CRTDLL */
|
||||||
|
extern double* __imp__HUGE_dll;
|
||||||
|
#define HUGE_VAL (*__imp__HUGE_dll)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
__MINGW_IMPORT double _HUGE;
|
||||||
|
#define HUGE_VAL _HUGE
|
||||||
|
#else
|
||||||
|
/* CRTDLL */
|
||||||
|
__MINGW_IMPORT double _HUGE_dll;
|
||||||
|
#define HUGE_VAL _HUGE_dll
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
struct _exception
|
||||||
|
{
|
||||||
|
int type;
|
||||||
|
char *name;
|
||||||
|
double arg1;
|
||||||
|
double arg2;
|
||||||
|
double retval;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
double sin (double);
|
||||||
|
double cos (double);
|
||||||
|
double tan (double);
|
||||||
|
double sinh (double);
|
||||||
|
double cosh (double);
|
||||||
|
double tanh (double);
|
||||||
|
double asin (double);
|
||||||
|
double acos (double);
|
||||||
|
double atan (double);
|
||||||
|
double atan2 (double, double);
|
||||||
|
double exp (double);
|
||||||
|
double log (double);
|
||||||
|
double log10 (double);
|
||||||
|
double pow (double, double);
|
||||||
|
double sqrt (double);
|
||||||
|
double ceil (double);
|
||||||
|
double floor (double);
|
||||||
|
double fabs (double);
|
||||||
|
double ldexp (double, int);
|
||||||
|
double frexp (double, int*);
|
||||||
|
double modf (double, double*);
|
||||||
|
double fmod (double, double);
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
/* Complex number (for cabs) */
|
||||||
|
struct _complex
|
||||||
|
{
|
||||||
|
double x; /* Real part */
|
||||||
|
double y; /* Imaginary part */
|
||||||
|
};
|
||||||
|
|
||||||
|
double _cabs (struct _complex);
|
||||||
|
double _hypot (double, double);
|
||||||
|
double _j0 (double);
|
||||||
|
double _j1 (double);
|
||||||
|
double _jn (int, double);
|
||||||
|
double _y0 (double);
|
||||||
|
double _y1 (double);
|
||||||
|
double _yn (int, double);
|
||||||
|
int _matherr (struct _exception *);
|
||||||
|
|
||||||
|
/* These are also declared in Mingw float.h; needed here as well to work
|
||||||
|
around GCC build issues. */
|
||||||
|
/* BEGIN FLOAT.H COPY */
|
||||||
|
/*
|
||||||
|
* IEEE recommended functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
double _chgsign (double);
|
||||||
|
double _copysign (double, double);
|
||||||
|
double _logb (double);
|
||||||
|
double _nextafter (double, double);
|
||||||
|
double _scalb (double, long);
|
||||||
|
|
||||||
|
int _finite (double);
|
||||||
|
int _fpclass (double);
|
||||||
|
int _isnan (double);
|
||||||
|
|
||||||
|
/* END FLOAT.H COPY */
|
||||||
|
|
||||||
|
#if !defined (_NO_OLDNAMES) \
|
||||||
|
|| (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L )
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Non-underscored versions of non-ANSI functions. These reside in
|
||||||
|
* liboldnames.a. They are now also ISO C99 standand names.
|
||||||
|
* Provided for extra portability.
|
||||||
|
*/
|
||||||
|
|
||||||
|
double cabs (struct _complex);
|
||||||
|
double hypot (double, double);
|
||||||
|
double j0 (double);
|
||||||
|
double j1 (double);
|
||||||
|
double jn (int, double);
|
||||||
|
double y0 (double);
|
||||||
|
double y1 (double);
|
||||||
|
double yn (int, double);
|
||||||
|
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __NO_ISOCEXT
|
||||||
|
|
||||||
|
#define INFINITY HUGE_VAL
|
||||||
|
#define NAN (0.0F/0.0F)
|
||||||
|
|
||||||
|
/*
|
||||||
|
Return values for fpclassify.
|
||||||
|
These are based on Intel x87 fpu condition codes
|
||||||
|
in the high byte of status word and differ from
|
||||||
|
the return values for MS IEEE 754 extension _fpclass()
|
||||||
|
*/
|
||||||
|
#define FP_NAN 0x0100
|
||||||
|
#define FP_NORMAL 0x0400
|
||||||
|
#define FP_INFINITE (FP_NAN | FP_NORMAL)
|
||||||
|
#define FP_ZERO 0x4000
|
||||||
|
#define FP_SUBNORMAL (FP_NORMAL | FP_ZERO)
|
||||||
|
/* 0x0200 is signbit mask */
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
double nan(const char *tagp);
|
||||||
|
float nanf(const char *tagp);
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
#define nan() nan("")
|
||||||
|
#define nanf() nanf("")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
We can't inline float, because we want to ensure truncation
|
||||||
|
to semantic type before classification. If we extend to long
|
||||||
|
double, we will also need to make double extern only.
|
||||||
|
(A normal long double value might become subnormal when
|
||||||
|
converted to double, and zero when converted to float.)
|
||||||
|
*/
|
||||||
|
extern __inline__ int __fpclassify (double x){
|
||||||
|
unsigned short sw;
|
||||||
|
__asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
|
||||||
|
return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
|
||||||
|
}
|
||||||
|
|
||||||
|
extern int __fpclassifyf (float);
|
||||||
|
|
||||||
|
#define fpclassify(x) ((sizeof(x) == sizeof(float)) ? __fpclassifyf(x) \
|
||||||
|
: __fpclassify(x))
|
||||||
|
|
||||||
|
/* We don't need to worry about trucation here:
|
||||||
|
A NaN stays a NaN. */
|
||||||
|
|
||||||
|
extern __inline__ int __isnan (double _x)
|
||||||
|
{
|
||||||
|
unsigned short sw;
|
||||||
|
__asm__ ("fxam;"
|
||||||
|
"fstsw %%ax": "=a" (sw) : "t" (_x));
|
||||||
|
return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
|
||||||
|
== FP_NAN;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern __inline__ int __isnanf (float _x)
|
||||||
|
{
|
||||||
|
unsigned short sw;
|
||||||
|
__asm__ ("fxam;"
|
||||||
|
"fstsw %%ax": "=a" (sw) : "t" (_x));
|
||||||
|
return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
|
||||||
|
== FP_NAN;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define isnan(x) ((sizeof(x) == sizeof(float)) ? __isnanf(x) \
|
||||||
|
: __isnan(x))
|
||||||
|
|
||||||
|
|
||||||
|
#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0)
|
||||||
|
#define isinf(x) (fpclassify(x) == FP_INFINITE)
|
||||||
|
#define isnormal(x) (fpclassify(x) == FP_NORMAL)
|
||||||
|
|
||||||
|
|
||||||
|
extern __inline__ int __signbit (double x) {
|
||||||
|
unsigned short stw;
|
||||||
|
__asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
|
||||||
|
return stw & 0x0200;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern __inline__ int __signbitf (float x) {
|
||||||
|
unsigned short stw;
|
||||||
|
__asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
|
||||||
|
return stw & 0x0200;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) \
|
||||||
|
: __signbit(x))
|
||||||
|
/*
|
||||||
|
* With these functions, comparisons involving quiet NaNs set the FP
|
||||||
|
* condition code to "unordered". The IEEE floating-point spec
|
||||||
|
* dictates that the result of floating-point comparisons should be
|
||||||
|
* false whenever a NaN is involved, with the exception of the !=,
|
||||||
|
* which always returns true.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if __GNUC__ >= 3
|
||||||
|
|
||||||
|
#define isgreater(x, y) __builtin_isgreater(x, y)
|
||||||
|
#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
|
||||||
|
#define isless(x, y) __builtin_isless(x, y)
|
||||||
|
#define islessequal(x, y) __builtin_islessequal(x, y)
|
||||||
|
#define islessgreater(x, y) __builtin_islessgreater(x, y)
|
||||||
|
#define isunordered(x, y) __builtin_isunordered(x, y)
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* helper */
|
||||||
|
extern __inline__ int __fp_unordered_compare (double x, double y){
|
||||||
|
unsigned short retval;
|
||||||
|
__asm__ ("fucom %%st(1);"
|
||||||
|
"fnstsw;": "=a" (retval) : "t" (x), "u" (y));
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define isgreater(x, y) ((__fp_unordered_compare(x, y) \
|
||||||
|
& 0x4500) == 0)
|
||||||
|
#define isless(x, y) ((__fp_unordered_compare (y, x) \
|
||||||
|
& 0x4500) == 0)
|
||||||
|
#define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \
|
||||||
|
& FP_INFINITE) == 0)
|
||||||
|
#define islessequal(x, y) ((__fp_unordered_compare(y, x) \
|
||||||
|
& FP_INFINITE) == 0)
|
||||||
|
#define islessgreater(x, y) ((__fp_unordered_compare(x, y) \
|
||||||
|
& FP_SUBNORMAL) == 0)
|
||||||
|
#define isunordered(x, y) ((__fp_unordered_compare(x, y) \
|
||||||
|
& 0x4500) == 0x4500)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* round, using fpu control word settings */
|
||||||
|
extern __inline__ double rint (double x)
|
||||||
|
{
|
||||||
|
double retval;
|
||||||
|
__asm__ ("frndint;": "=t" (retval) : "0" (x));
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern __inline__ float rintf (float x)
|
||||||
|
{
|
||||||
|
float retval;
|
||||||
|
__asm__ ("frndint;" : "=t" (retval) : "0" (x) );
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* round away from zero, regardless of fpu control word settings */
|
||||||
|
extern double round (double);
|
||||||
|
extern float roundf (float);
|
||||||
|
|
||||||
|
/* round towards zero, regardless of fpu control word settings */
|
||||||
|
extern double trunc (double);
|
||||||
|
extern float truncf (float);
|
||||||
|
|
||||||
|
|
||||||
|
/* fmax and fmin.
|
||||||
|
NaN arguments are treated as missing data: if one argument is a NaN and the other numeric, then the
|
||||||
|
these functions choose the numeric value.
|
||||||
|
*/
|
||||||
|
|
||||||
|
extern double fmax (double, double);
|
||||||
|
extern double fmin (double, double);
|
||||||
|
extern float fmaxf (float, float);
|
||||||
|
float fminf (float, float);
|
||||||
|
|
||||||
|
/* return x * y + z as a ternary op */
|
||||||
|
extern double fma (double, double, double);
|
||||||
|
extern float fmaf (float, float, float);
|
||||||
|
|
||||||
|
/* one lonely transcendental */
|
||||||
|
extern double log2 (double _x);
|
||||||
|
extern float log2f (float _x);
|
||||||
|
|
||||||
|
/* The underscored versions are in MSVCRT.dll.
|
||||||
|
The stubs for these are in libmingwex.a */
|
||||||
|
|
||||||
|
double copysign (double, double);
|
||||||
|
float copysignf (float, float);
|
||||||
|
double logb (double);
|
||||||
|
float logbf (float);
|
||||||
|
double nextafter (double, double);
|
||||||
|
float nextafterf (float, float);
|
||||||
|
double scalb (double, long);
|
||||||
|
float scalbf (float, long);
|
||||||
|
|
||||||
|
#if !defined (__STRICT_ANSI__) /* inline using non-ANSI functions */
|
||||||
|
extern __inline__ double copysign (double x, double y)
|
||||||
|
{ return _copysign(x, y); }
|
||||||
|
extern __inline__ float copysignf (float x, float y)
|
||||||
|
{ return _copysign(x, y); }
|
||||||
|
extern __inline__ double logb (double x)
|
||||||
|
{ return _logb(x); }
|
||||||
|
extern __inline__ float logbf (float x)
|
||||||
|
{ return _logb(x); }
|
||||||
|
extern __inline__ double nextafter(double x, double y)
|
||||||
|
{ return _nextafter(x, y); }
|
||||||
|
extern __inline__ float nextafterf(float x, float y)
|
||||||
|
{ return _nextafter(x, y); }
|
||||||
|
extern __inline__ double scalb (double x, long i)
|
||||||
|
{ return _scalb (x, i); }
|
||||||
|
extern __inline__ float scalbf (float x, long i)
|
||||||
|
{ return _scalb(x, i); }
|
||||||
|
#endif /* (__STRICT_ANSI__) */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* __NO_ISOCEXT */
|
||||||
|
|
||||||
|
#endif /* Not _MATH_H_ */
|
||||||
|
|
||||||
8
bazaar/Tcc/lib/include/mem.h
Normal file
8
bazaar/Tcc/lib/include/mem.h
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* mem.h maps to string.h
|
||||||
|
*/
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
#include <string.h>
|
||||||
|
#endif
|
||||||
9
bazaar/Tcc/lib/include/memory.h
Normal file
9
bazaar/Tcc/lib/include/memory.h
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* memory.h maps to the standard string.h header.
|
||||||
|
*/
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
#include <string.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
158
bazaar/Tcc/lib/include/process.h
Normal file
158
bazaar/Tcc/lib/include/process.h
Normal file
|
|
@ -0,0 +1,158 @@
|
||||||
|
/*
|
||||||
|
* process.h
|
||||||
|
*
|
||||||
|
* Function calls for spawning child processes.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _PROCESS_H_
|
||||||
|
#define _PROCESS_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
/* Includes a definition of _pid_t and pid_t */
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constants for cwait actions.
|
||||||
|
* Obsolete for Win32.
|
||||||
|
*/
|
||||||
|
#define _WAIT_CHILD 0
|
||||||
|
#define _WAIT_GRANDCHILD 1
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
#define WAIT_CHILD _WAIT_CHILD
|
||||||
|
#define WAIT_GRANDCHILD _WAIT_GRANDCHILD
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Mode constants for spawn functions.
|
||||||
|
*/
|
||||||
|
#define _P_WAIT 0
|
||||||
|
#define _P_NOWAIT 1
|
||||||
|
#define _P_OVERLAY 2
|
||||||
|
#define _OLD_P_OVERLAY _P_OVERLAY
|
||||||
|
#define _P_NOWAITO 3
|
||||||
|
#define _P_DETACH 4
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
#define P_WAIT _P_WAIT
|
||||||
|
#define P_NOWAIT _P_NOWAIT
|
||||||
|
#define P_OVERLAY _P_OVERLAY
|
||||||
|
#define OLD_P_OVERLAY _OLD_P_OVERLAY
|
||||||
|
#define P_NOWAITO _P_NOWAITO
|
||||||
|
#define P_DETACH _P_DETACH
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void _cexit(void);
|
||||||
|
void _c_exit(void);
|
||||||
|
|
||||||
|
int _cwait (int*, _pid_t, int);
|
||||||
|
|
||||||
|
_pid_t _getpid(void);
|
||||||
|
|
||||||
|
int _execl (const char*, const char*, ...);
|
||||||
|
int _execle (const char*, const char*, ...);
|
||||||
|
int _execlp (const char*, const char*, ...);
|
||||||
|
int _execlpe (const char*, const char*, ...);
|
||||||
|
int _execv (const char*, char* const*);
|
||||||
|
int _execve (const char*, char* const*, char* const*);
|
||||||
|
int _execvp (const char*, char* const*);
|
||||||
|
int _execvpe (const char*, char* const*, char* const*);
|
||||||
|
|
||||||
|
int _spawnl (int, const char*, const char*, ...);
|
||||||
|
int _spawnle (int, const char*, const char*, ...);
|
||||||
|
int _spawnlp (int, const char*, const char*, ...);
|
||||||
|
int _spawnlpe (int, const char*, const char*, ...);
|
||||||
|
int _spawnv (int, const char*, char* const*);
|
||||||
|
int _spawnve (int, const char*, char* const*, char* const*);
|
||||||
|
int _spawnvp (int, const char*, char* const*);
|
||||||
|
int _spawnvpe (int, const char*, char* const*, char* const*);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
|
||||||
|
* They are provided by MSVCRT.
|
||||||
|
*
|
||||||
|
* NOTE: Apparently _endthread calls CloseHandle on the handle of the thread,
|
||||||
|
* making for race conditions if you are not careful. Basically you have to
|
||||||
|
* make sure that no-one is going to do *anything* with the thread handle
|
||||||
|
* after the thread calls _endthread or returns from the thread function.
|
||||||
|
*
|
||||||
|
* NOTE: No old names for these functions. Use the underscore.
|
||||||
|
*/
|
||||||
|
unsigned long
|
||||||
|
_beginthread (void (*)(void *), unsigned, void*);
|
||||||
|
void _endthread (void);
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
unsigned long
|
||||||
|
_beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *),
|
||||||
|
void*, unsigned, unsigned*);
|
||||||
|
void _endthreadex (unsigned);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
/*
|
||||||
|
* Functions without the leading underscore, for portability. These functions
|
||||||
|
* live in liboldnames.a.
|
||||||
|
*/
|
||||||
|
int cwait (int*, pid_t, int);
|
||||||
|
pid_t getpid (void);
|
||||||
|
int execl (const char*, const char*, ...);
|
||||||
|
int execle (const char*, const char*, ...);
|
||||||
|
int execlp (const char*, const char*, ...);
|
||||||
|
int execlpe (const char*, const char*, ...);
|
||||||
|
int execv (const char*, char* const*);
|
||||||
|
int execve (const char*, char* const*, char* const*);
|
||||||
|
int execvp (const char*, char* const*);
|
||||||
|
int execvpe (const char*, char* const*, char* const*);
|
||||||
|
int spawnl (int, const char*, const char*, ...);
|
||||||
|
int spawnle (int, const char*, const char*, ...);
|
||||||
|
int spawnlp (int, const char*, const char*, ...);
|
||||||
|
int spawnlpe (int, const char*, const char*, ...);
|
||||||
|
int spawnv (int, const char*, char* const*);
|
||||||
|
int spawnve (int, const char*, char* const*, char* const*);
|
||||||
|
int spawnvp (int, const char*, char* const*);
|
||||||
|
int spawnvpe (int, const char*, char* const*, char* const*);
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* _PROCESS_H_ not defined */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
72
bazaar/Tcc/lib/include/setjmp.h
Normal file
72
bazaar/Tcc/lib/include/setjmp.h
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
/*
|
||||||
|
* setjmp.h
|
||||||
|
*
|
||||||
|
* Declarations supporting setjmp and longjump, a method for avoiding
|
||||||
|
* the normal function call return sequence. (Bleah!)
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _SETJMP_H_
|
||||||
|
#define _SETJMP_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The buffer used by setjmp to store the information used by longjmp
|
||||||
|
* to perform it's evil goto-like work. The size of this buffer was
|
||||||
|
* determined through experimentation; it's contents are a mystery.
|
||||||
|
* NOTE: This was determined on an i386 (actually a Pentium). The
|
||||||
|
* contents could be different on an Alpha or something else.
|
||||||
|
*/
|
||||||
|
#define _JBLEN 16
|
||||||
|
#define _JBTYPE int
|
||||||
|
typedef _JBTYPE jmp_buf[_JBLEN];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The function provided by CRTDLL which appears to do the actual work
|
||||||
|
* of setjmp.
|
||||||
|
*/
|
||||||
|
int _setjmp (jmp_buf);
|
||||||
|
|
||||||
|
#define setjmp(x) _setjmp(x)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return to the last setjmp call and act as if setjmp had returned
|
||||||
|
* nVal (which had better be non-zero!).
|
||||||
|
*/
|
||||||
|
void longjmp (jmp_buf, int);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _SETJMP_H_ */
|
||||||
|
|
||||||
44
bazaar/Tcc/lib/include/share.h
Normal file
44
bazaar/Tcc/lib/include/share.h
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
* share.h
|
||||||
|
*
|
||||||
|
* Constants for file sharing functions.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _SHARE_H_
|
||||||
|
#define _SHARE_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define SH_COMPAT 0x00 /* Compatibility */
|
||||||
|
#define SH_DENYRW 0x10 /* Deny read/write */
|
||||||
|
#define SH_DENYWR 0x20 /* Deny write */
|
||||||
|
#define SH_DENYRD 0x30 /* Deny read */
|
||||||
|
#define SH_DENYNO 0x40 /* Deny nothing */
|
||||||
|
|
||||||
|
#endif /* Not _SHARE_H_ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
111
bazaar/Tcc/lib/include/signal.h
Normal file
111
bazaar/Tcc/lib/include/signal.h
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
/*
|
||||||
|
* signal.h
|
||||||
|
*
|
||||||
|
* A way to set handlers for exceptional conditions (also known as signals).
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _SIGNAL_H_
|
||||||
|
#define _SIGNAL_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The actual signal values. Using other values with signal
|
||||||
|
* produces a SIG_ERR return value.
|
||||||
|
*
|
||||||
|
* NOTE: SIGINT is produced when the user presses Ctrl-C.
|
||||||
|
* SIGILL has not been tested.
|
||||||
|
* SIGFPE doesn't seem to work?
|
||||||
|
* SIGSEGV does not catch writing to a NULL pointer (that shuts down
|
||||||
|
* your app; can you say "segmentation violation core dump"?).
|
||||||
|
* SIGTERM comes from what kind of termination request exactly?
|
||||||
|
* SIGBREAK is indeed produced by pressing Ctrl-Break.
|
||||||
|
* SIGABRT is produced by calling abort.
|
||||||
|
* TODO: The above results may be related to not installing an appropriate
|
||||||
|
* structured exception handling frame. Results may be better if I ever
|
||||||
|
* manage to get the SEH stuff down.
|
||||||
|
*/
|
||||||
|
#define SIGINT 2 /* Interactive attention */
|
||||||
|
#define SIGILL 4 /* Illegal instruction */
|
||||||
|
#define SIGFPE 8 /* Floating point error */
|
||||||
|
#define SIGSEGV 11 /* Segmentation violation */
|
||||||
|
#define SIGTERM 15 /* Termination request */
|
||||||
|
#define SIGBREAK 21 /* Control-break */
|
||||||
|
#define SIGABRT 22 /* Abnormal termination (abort) */
|
||||||
|
|
||||||
|
#define NSIG 23 /* maximum signal number + 1 */
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifndef _SIG_ATOMIC_T_DEFINED
|
||||||
|
typedef int sig_atomic_t;
|
||||||
|
#define _SIG_ATOMIC_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The prototypes (below) are the easy part. The hard part is figuring
|
||||||
|
* out what signals are available and what numbers they are assigned
|
||||||
|
* along with appropriate values of SIG_DFL and SIG_IGN.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A pointer to a signal handler function. A signal handler takes a
|
||||||
|
* single int, which is the signal it handles.
|
||||||
|
*/
|
||||||
|
typedef void (*__p_sig_fn_t)(int);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These are special values of signal handler pointers which are
|
||||||
|
* used to send a signal to the default handler (SIG_DFL), ignore
|
||||||
|
* the signal (SIG_IGN), or indicate an error return (SIG_ERR).
|
||||||
|
*/
|
||||||
|
#define SIG_DFL ((__p_sig_fn_t) 0)
|
||||||
|
#define SIG_IGN ((__p_sig_fn_t) 1)
|
||||||
|
#define SIG_ERR ((__p_sig_fn_t) -1)
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Call signal to set the signal handler for signal sig to the
|
||||||
|
* function pointed to by handler. Returns a pointer to the
|
||||||
|
* previous handler, or SIG_ERR if an error occurs. Initially
|
||||||
|
* unhandled signals defined above will return SIG_DFL.
|
||||||
|
*/
|
||||||
|
__p_sig_fn_t signal(int, __p_sig_fn_t);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Raise the signal indicated by sig. Returns non-zero on success.
|
||||||
|
*/
|
||||||
|
int raise (int);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _SIGNAL_H_ */
|
||||||
|
|
||||||
16
bazaar/Tcc/lib/include/stdarg.h
Normal file
16
bazaar/Tcc/lib/include/stdarg.h
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#ifndef _STDARG_H
|
||||||
|
#define _STDARG_H
|
||||||
|
|
||||||
|
typedef char *va_list;
|
||||||
|
|
||||||
|
/* only correct for i386 */
|
||||||
|
#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)
|
||||||
|
#define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3)))
|
||||||
|
#define va_copy(dest, src) (dest) = (src)
|
||||||
|
#define va_end(ap)
|
||||||
|
|
||||||
|
/* fix a buggy dependency on GCC in libio.h */
|
||||||
|
typedef va_list __gnuc_va_list;
|
||||||
|
#define _VA_LIST_DEFINED
|
||||||
|
|
||||||
|
#endif
|
||||||
10
bazaar/Tcc/lib/include/stdbool.h
Normal file
10
bazaar/Tcc/lib/include/stdbool.h
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#ifndef _STDBOOL_H
|
||||||
|
#define _STDBOOL_H
|
||||||
|
|
||||||
|
/* ISOC99 boolean */
|
||||||
|
|
||||||
|
#define bool _Bool
|
||||||
|
#define true 1
|
||||||
|
#define false 0
|
||||||
|
|
||||||
|
#endif /* _STDBOOL_H */
|
||||||
26
bazaar/Tcc/lib/include/stddef.h
Normal file
26
bazaar/Tcc/lib/include/stddef.h
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef _STDDEF_H
|
||||||
|
#define _STDDEF_H
|
||||||
|
|
||||||
|
#define NULL ((void *)0)
|
||||||
|
typedef __SIZE_TYPE__ size_t;
|
||||||
|
typedef __WCHAR_TYPE__ wchar_t;
|
||||||
|
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
||||||
|
#define offsetof(type, field) ((size_t) &((type *)0)->field)
|
||||||
|
|
||||||
|
/* need to do that because of glibc 2.1 bug (should have a way to test
|
||||||
|
presence of 'long long' without __GNUC__, or TCC should define
|
||||||
|
__GNUC__ ? */
|
||||||
|
#if !defined(__int8_t_defined) && !defined(__dietlibc__)
|
||||||
|
#define __int8_t_defined
|
||||||
|
typedef char int8_t;
|
||||||
|
typedef short int int16_t;
|
||||||
|
typedef int int32_t;
|
||||||
|
typedef long long int int64_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __i386__
|
||||||
|
void *_alloca(size_t);
|
||||||
|
#define alloca _alloca
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
184
bazaar/Tcc/lib/include/stdint.h
Normal file
184
bazaar/Tcc/lib/include/stdint.h
Normal file
|
|
@ -0,0 +1,184 @@
|
||||||
|
/* ISO C9x 7.18 Integer types <stdint.h>
|
||||||
|
* Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* Date: 2000-12-02
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _STDINT_H
|
||||||
|
#define _STDINT_H
|
||||||
|
|
||||||
|
/* 7.18.1.1 Exact-width integer types */
|
||||||
|
typedef signed char int8_t;
|
||||||
|
typedef unsigned char uint8_t;
|
||||||
|
typedef short int16_t;
|
||||||
|
typedef unsigned short uint16_t;
|
||||||
|
typedef int int32_t;
|
||||||
|
typedef unsigned uint32_t;
|
||||||
|
typedef long long int64_t;
|
||||||
|
typedef unsigned long long uint64_t;
|
||||||
|
|
||||||
|
/* 7.18.1.2 Minimum-width integer types */
|
||||||
|
typedef signed char int_least8_t;
|
||||||
|
typedef unsigned char uint_least8_t;
|
||||||
|
typedef short int_least16_t;
|
||||||
|
typedef unsigned short uint_least16_t;
|
||||||
|
typedef int int_least32_t;
|
||||||
|
typedef unsigned uint_least32_t;
|
||||||
|
typedef long long int_least64_t;
|
||||||
|
typedef unsigned long long uint_least64_t;
|
||||||
|
|
||||||
|
/* 7.18.1.3 Fastest minimum-width integer types
|
||||||
|
* Not actually guaranteed to be fastest for all purposes
|
||||||
|
* Here we use the exact-width types for 8 and 16-bit ints.
|
||||||
|
*/
|
||||||
|
typedef char int_fast8_t;
|
||||||
|
typedef unsigned char uint_fast8_t;
|
||||||
|
typedef short int_fast16_t;
|
||||||
|
typedef unsigned short uint_fast16_t;
|
||||||
|
typedef int int_fast32_t;
|
||||||
|
typedef unsigned int uint_fast32_t;
|
||||||
|
typedef long long int_fast64_t;
|
||||||
|
typedef unsigned long long uint_fast64_t;
|
||||||
|
|
||||||
|
/* 7.18.1.4 Integer types capable of holding object pointers */
|
||||||
|
typedef int intptr_t;
|
||||||
|
typedef unsigned uintptr_t;
|
||||||
|
|
||||||
|
/* 7.18.1.5 Greatest-width integer types */
|
||||||
|
typedef long long intmax_t;
|
||||||
|
typedef unsigned long long uintmax_t;
|
||||||
|
|
||||||
|
/* 7.18.2 Limits of specified-width integer types */
|
||||||
|
#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
|
||||||
|
|
||||||
|
/* 7.18.2.1 Limits of exact-width integer types */
|
||||||
|
#define INT8_MIN (-128)
|
||||||
|
#define INT16_MIN (-32768)
|
||||||
|
#define INT32_MIN (-2147483647 - 1)
|
||||||
|
#define INT64_MIN (-9223372036854775807LL - 1)
|
||||||
|
|
||||||
|
#define INT8_MAX 127
|
||||||
|
#define INT16_MAX 32767
|
||||||
|
#define INT32_MAX 2147483647
|
||||||
|
#define INT64_MAX 9223372036854775807LL
|
||||||
|
|
||||||
|
#define UINT8_MAX 0xff /* 255U */
|
||||||
|
#define UINT16_MAX 0xffff /* 65535U */
|
||||||
|
#define UINT32_MAX 0xffffffff /* 4294967295U */
|
||||||
|
#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
|
||||||
|
|
||||||
|
/* 7.18.2.2 Limits of minimum-width integer types */
|
||||||
|
#define INT_LEAST8_MIN INT8_MIN
|
||||||
|
#define INT_LEAST16_MIN INT16_MIN
|
||||||
|
#define INT_LEAST32_MIN INT32_MIN
|
||||||
|
#define INT_LEAST64_MIN INT64_MIN
|
||||||
|
|
||||||
|
#define INT_LEAST8_MAX INT8_MAX
|
||||||
|
#define INT_LEAST16_MAX INT16_MAX
|
||||||
|
#define INT_LEAST32_MAX INT32_MAX
|
||||||
|
#define INT_LEAST64_MAX INT64_MAX
|
||||||
|
|
||||||
|
#define UINT_LEAST8_MAX UINT8_MAX
|
||||||
|
#define UINT_LEAST16_MAX UINT16_MAX
|
||||||
|
#define UINT_LEAST32_MAX UINT32_MAX
|
||||||
|
#define UINT_LEAST64_MAX UINT64_MAX
|
||||||
|
|
||||||
|
/* 7.18.2.3 Limits of fastest minimum-width integer types */
|
||||||
|
#define INT_FAST8_MIN INT8_MIN
|
||||||
|
#define INT_FAST16_MIN INT16_MIN
|
||||||
|
#define INT_FAST32_MIN INT32_MIN
|
||||||
|
#define INT_FAST64_MIN INT64_MIN
|
||||||
|
|
||||||
|
#define INT_FAST8_MAX INT8_MAX
|
||||||
|
#define INT_FAST16_MAX INT16_MAX
|
||||||
|
#define INT_FAST32_MAX INT32_MAX
|
||||||
|
#define INT_FAST64_MAX INT64_MAX
|
||||||
|
|
||||||
|
#define UINT_FAST8_MAX UINT8_MAX
|
||||||
|
#define UINT_FAST16_MAX UINT16_MAX
|
||||||
|
#define UINT_FAST32_MAX UINT32_MAX
|
||||||
|
#define UINT_FAST64_MAX UINT64_MAX
|
||||||
|
|
||||||
|
/* 7.18.2.4 Limits of integer types capable of holding
|
||||||
|
object pointers */
|
||||||
|
#define INTPTR_MIN INT32_MIN
|
||||||
|
#define INTPTR_MAX INT32_MAX
|
||||||
|
#define UINTPTR_MAX UINT32_MAX
|
||||||
|
|
||||||
|
/* 7.18.2.5 Limits of greatest-width integer types */
|
||||||
|
#define INTMAX_MIN INT64_MIN
|
||||||
|
#define INTMAX_MAX INT64_MAX
|
||||||
|
#define UINTMAX_MAX UINT64_MAX
|
||||||
|
|
||||||
|
/* 7.18.3 Limits of other integer types */
|
||||||
|
#define PTRDIFF_MIN INT32_MIN
|
||||||
|
#define PTRDIFF_MAX INT32_MAX
|
||||||
|
|
||||||
|
#define SIG_ATOMIC_MIN INT32_MIN
|
||||||
|
#define SIG_ATOMIC_MAX INT32_MAX
|
||||||
|
|
||||||
|
#define SIZE_MAX UINT32_MAX
|
||||||
|
|
||||||
|
#ifndef WCHAR_MIN /* also in wchar.h */
|
||||||
|
#define WCHAR_MIN 0
|
||||||
|
#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wint_t is unsigned int in __MINGW32__,
|
||||||
|
* but unsigned short in MS runtime
|
||||||
|
*/
|
||||||
|
#define WINT_MIN 0
|
||||||
|
#define WINT_MAX UINT32_MAX
|
||||||
|
|
||||||
|
#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.4 Macros for integer constants */
|
||||||
|
#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
|
||||||
|
|
||||||
|
/* 7.18.4.1 Macros for minimum-width integer constants
|
||||||
|
|
||||||
|
Accoding to Douglas Gwyn <gwyn@arl.mil>:
|
||||||
|
"This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
|
||||||
|
9899:1999 as initially published, the expansion was required
|
||||||
|
to be an integer constant of precisely matching type, which
|
||||||
|
is impossible to accomplish for the shorter types on most
|
||||||
|
platforms, because C99 provides no standard way to designate
|
||||||
|
an integer constant with width less than that of type int.
|
||||||
|
TC1 changed this to require just an integer constant
|
||||||
|
*expression* with *promoted* type."
|
||||||
|
|
||||||
|
The trick used here is from Clive D W Feather.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val))
|
||||||
|
#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val))
|
||||||
|
#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val))
|
||||||
|
#define INT64_C(val) (INT_LEAST64_MAX-INT_LEAST64_MAX+(val))
|
||||||
|
|
||||||
|
#define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val))
|
||||||
|
#define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val))
|
||||||
|
#define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val))
|
||||||
|
#define UINT64_C(val) (UINT_LEAST64_MAX-UINT_LEAST64_MAX+(val))
|
||||||
|
|
||||||
|
/* 7.18.4.2 Macros for greatest-width integer constants */
|
||||||
|
#define INTMAX_C(val) (INTMAX_MAX-INTMAX_MAX+(val))
|
||||||
|
#define UINTMAX_C(val) (UINTMAX_MAX-UINTMAX_MAX+(val))
|
||||||
|
|
||||||
|
#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
|
||||||
|
|
||||||
|
#endif
|
||||||
413
bazaar/Tcc/lib/include/stdio.h
Normal file
413
bazaar/Tcc/lib/include/stdio.h
Normal file
|
|
@ -0,0 +1,413 @@
|
||||||
|
/*
|
||||||
|
* stdio.h
|
||||||
|
*
|
||||||
|
* Definitions of types and prototypes of functions for standard input and
|
||||||
|
* output.
|
||||||
|
*
|
||||||
|
* NOTE: The file manipulation functions provided by Microsoft seem to
|
||||||
|
* work with either slash (/) or backslash (\) as the path separator.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _STDIO_H_
|
||||||
|
#define _STDIO_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define __need_size_t
|
||||||
|
#define __need_NULL
|
||||||
|
#define __need_wchar_t
|
||||||
|
#define __need_wint_t
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
|
||||||
|
/* Flags for the iobuf structure */
|
||||||
|
#define _IOREAD 1
|
||||||
|
#define _IOWRT 2
|
||||||
|
#define _IORW 0x0080 /* opened as "r+w" */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The three standard file pointers provided by the run time library.
|
||||||
|
* NOTE: These will go to the bit-bucket silently in GUI applications!
|
||||||
|
*/
|
||||||
|
#define STDIN_FILENO 0
|
||||||
|
#define STDOUT_FILENO 1
|
||||||
|
#define STDERR_FILENO 2
|
||||||
|
|
||||||
|
/* Returned by various functions on end of file condition or error. */
|
||||||
|
#define EOF (-1)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum length of a file name. You should use GetVolumeInformation
|
||||||
|
* instead of this constant. But hey, this works.
|
||||||
|
*
|
||||||
|
* NOTE: This is used in the structure _finddata_t (see io.h) so changing it
|
||||||
|
* is probably not a good idea.
|
||||||
|
*/
|
||||||
|
#define FILENAME_MAX (260)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum number of files that may be open at once. I have set this to
|
||||||
|
* a conservative number. The actual value may be higher.
|
||||||
|
*/
|
||||||
|
#define FOPEN_MAX (20)
|
||||||
|
|
||||||
|
/* After creating this many names, tmpnam and tmpfile return NULL */
|
||||||
|
#define TMP_MAX 32767
|
||||||
|
/*
|
||||||
|
* Tmpnam, tmpfile and, sometimes, _tempnam try to create
|
||||||
|
* temp files in the root directory of the current drive
|
||||||
|
* (not in pwd, as suggested by some older MS doc's).
|
||||||
|
* Redefining these macros does not effect the CRT functions.
|
||||||
|
*/
|
||||||
|
#define _P_tmpdir "\\"
|
||||||
|
#define _wP_tmpdir L"\\"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum size of name (including NUL) that will be put in the user
|
||||||
|
* supplied buffer caName for tmpnam.
|
||||||
|
* Inferred from the size of the static buffer returned by tmpnam
|
||||||
|
* when passed a NULL argument. May actually be smaller.
|
||||||
|
*/
|
||||||
|
#define L_tmpnam (16)
|
||||||
|
|
||||||
|
#define _IOFBF 0x0000
|
||||||
|
#define _IOLBF 0x0040
|
||||||
|
#define _IONBF 0x0004
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The buffer size as used by setbuf such that it is equivalent to
|
||||||
|
* (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ).
|
||||||
|
*/
|
||||||
|
#define BUFSIZ 512
|
||||||
|
|
||||||
|
/* Constants for nOrigin indicating the position relative to which fseek
|
||||||
|
* sets the file position. Enclosed in ifdefs because io.h could also
|
||||||
|
* define them. (Though not anymore since io.h includes this file now.) */
|
||||||
|
#ifndef SEEK_SET
|
||||||
|
#define SEEK_SET (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SEEK_CUR
|
||||||
|
#define SEEK_CUR (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SEEK_END
|
||||||
|
#define SEEK_END (2)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
/*
|
||||||
|
* I used to include stdarg.h at this point, in order to allow for the
|
||||||
|
* functions later on in the file which use va_list. That conflicts with
|
||||||
|
* using stdio.h and varargs.h in the same file, so I do the typedef myself.
|
||||||
|
*/
|
||||||
|
#ifndef _VA_LIST
|
||||||
|
#define _VA_LIST
|
||||||
|
#if defined __GNUC__ && __GNUC__ >= 3
|
||||||
|
typedef __builtin_va_list va_list;
|
||||||
|
#else
|
||||||
|
typedef char* va_list;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
* The structure underlying the FILE type.
|
||||||
|
*
|
||||||
|
* I still believe that nobody in their right mind should make use of the
|
||||||
|
* internals of this structure. Provided by Pedro A. Aranda Gutiirrez
|
||||||
|
* <paag@tid.es>.
|
||||||
|
*/
|
||||||
|
#ifndef _FILE_DEFINED
|
||||||
|
#define _FILE_DEFINED
|
||||||
|
typedef struct _iobuf
|
||||||
|
{
|
||||||
|
char* _ptr;
|
||||||
|
int _cnt;
|
||||||
|
char* _base;
|
||||||
|
int _flag;
|
||||||
|
int _file;
|
||||||
|
int _charbuf;
|
||||||
|
int _bufsiz;
|
||||||
|
char* _tmpfname;
|
||||||
|
} FILE;
|
||||||
|
#endif /* Not _FILE_DEFINED */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The standard file handles
|
||||||
|
*/
|
||||||
|
#ifndef __DECLSPEC_SUPPORTED
|
||||||
|
|
||||||
|
extern FILE (*__imp__iob)[]; /* A pointer to an array of FILE */
|
||||||
|
|
||||||
|
#define _iob (*__imp__iob) /* An array of FILE */
|
||||||
|
|
||||||
|
#else /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
__MINGW_IMPORT FILE _iob[]; /* An array of FILE imported from DLL. */
|
||||||
|
|
||||||
|
#endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
#define stdin (&_iob[STDIN_FILENO])
|
||||||
|
#define stdout (&_iob[STDOUT_FILENO])
|
||||||
|
#define stderr (&_iob[STDERR_FILENO])
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File Operations
|
||||||
|
*/
|
||||||
|
FILE* fopen (const char*, const char*);
|
||||||
|
FILE* freopen (const char*, const char*, FILE*);
|
||||||
|
int fflush (FILE*);
|
||||||
|
int fclose (FILE*);
|
||||||
|
/* MS puts remove & rename (but not wide versions) in io.h also */
|
||||||
|
int remove (const char*);
|
||||||
|
int rename (const char*, const char*);
|
||||||
|
FILE* tmpfile (void);
|
||||||
|
char* tmpnam (char*);
|
||||||
|
char* _tempnam (const char*, const char*);
|
||||||
|
|
||||||
|
#ifndef NO_OLDNAMES
|
||||||
|
char* tempnam (const char*, const char*);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int setvbuf (FILE*, char*, int, size_t);
|
||||||
|
|
||||||
|
void setbuf (FILE*, char*);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Formatted Output
|
||||||
|
*/
|
||||||
|
|
||||||
|
int fprintf (FILE*, const char*, ...);
|
||||||
|
int printf (const char*, ...);
|
||||||
|
int sprintf (char*, const char*, ...);
|
||||||
|
int _snprintf (char*, size_t, const char*, ...);
|
||||||
|
int vfprintf (FILE*, const char*, va_list);
|
||||||
|
int vprintf (const char*, va_list);
|
||||||
|
int vsprintf (char*, const char*, va_list);
|
||||||
|
int _vsnprintf (char*, size_t, const char*, va_list);
|
||||||
|
|
||||||
|
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
|
||||||
|
int snprintf(char* s, size_t n, const char* format, ...);
|
||||||
|
extern inline int vsnprintf (char* s, size_t n, const char* format,
|
||||||
|
va_list arg)
|
||||||
|
{ return _vsnprintf ( s, n, format, arg); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Formatted Input
|
||||||
|
*/
|
||||||
|
|
||||||
|
int fscanf (FILE*, const char*, ...);
|
||||||
|
int scanf (const char*, ...);
|
||||||
|
int sscanf (const char*, const char*, ...);
|
||||||
|
/*
|
||||||
|
* Character Input and Output Functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
int fgetc (FILE*);
|
||||||
|
char* fgets (char*, int, FILE*);
|
||||||
|
int fputc (int, FILE*);
|
||||||
|
int fputs (const char*, FILE*);
|
||||||
|
int getc (FILE*);
|
||||||
|
int getchar (void);
|
||||||
|
char* gets (char*);
|
||||||
|
int putc (int, FILE*);
|
||||||
|
int putchar (int);
|
||||||
|
int puts (const char*);
|
||||||
|
int ungetc (int, FILE*);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Direct Input and Output Functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
size_t fread (void*, size_t, size_t, FILE*);
|
||||||
|
size_t fwrite (const void*, size_t, size_t, FILE*);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File Positioning Functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
int fseek (FILE*, long, int);
|
||||||
|
long ftell (FILE*);
|
||||||
|
void rewind (FILE*);
|
||||||
|
|
||||||
|
#ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a */
|
||||||
|
/*
|
||||||
|
* Workaround for limitations on win9x where a file contents are
|
||||||
|
* not zero'd out if you seek past the end and then write.
|
||||||
|
*/
|
||||||
|
|
||||||
|
int __mingw_fseek (FILE *, long, int);
|
||||||
|
int __mingw_fwrite (const void*, size_t, size_t, FILE*);
|
||||||
|
#define fseek(fp, offset, whence) __mingw_fseek(fp, offset, whence)
|
||||||
|
#define fwrite(buffer, size, count, fp) __mingw_fwrite(buffer, size, count, fp)
|
||||||
|
#endif /* __USE_MINGW_FSEEK */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* An opaque data type used for storing file positions... The contents of
|
||||||
|
* this type are unknown, but we (the compiler) need to know the size
|
||||||
|
* because the programmer using fgetpos and fsetpos will be setting aside
|
||||||
|
* storage for fpos_t structres. Actually I tested using a byte array and
|
||||||
|
* it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL).
|
||||||
|
* Perhaps an unsigned long? TODO? It's definitely a 64-bit number in
|
||||||
|
* MSVCRT however, and for now `long long' will do.
|
||||||
|
*/
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
typedef long long fpos_t;
|
||||||
|
#else
|
||||||
|
typedef long fpos_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int fgetpos (FILE*, fpos_t*);
|
||||||
|
int fsetpos (FILE*, const fpos_t*);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Error Functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
void clearerr (FILE*);
|
||||||
|
int feof (FILE*);
|
||||||
|
int ferror (FILE*);
|
||||||
|
void perror (const char*);
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
/*
|
||||||
|
* Pipes
|
||||||
|
*/
|
||||||
|
FILE* _popen (const char*, const char*);
|
||||||
|
int _pclose (FILE*);
|
||||||
|
|
||||||
|
#ifndef NO_OLDNAMES
|
||||||
|
FILE* popen (const char*, const char*);
|
||||||
|
int pclose (FILE*);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Other Non ANSI functions
|
||||||
|
*/
|
||||||
|
int _flushall (void);
|
||||||
|
int _fgetchar (void);
|
||||||
|
int _fputchar (int);
|
||||||
|
FILE* _fdopen (int, const char*);
|
||||||
|
int _fileno (FILE*);
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
int fgetchar (void);
|
||||||
|
int fputchar (int);
|
||||||
|
FILE* fdopen (int, const char*);
|
||||||
|
int fileno (FILE*);
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
/* Wide versions */
|
||||||
|
|
||||||
|
#ifndef _WSTDIO_DEFINED
|
||||||
|
/* also in wchar.h - keep in sync */
|
||||||
|
int fwprintf (FILE*, const wchar_t*, ...);
|
||||||
|
int wprintf (const wchar_t*, ...);
|
||||||
|
int swprintf (wchar_t*, const wchar_t*, ...);
|
||||||
|
int _snwprintf (wchar_t*, size_t, const wchar_t*, ...);
|
||||||
|
int vfwprintf (FILE*, const wchar_t*, va_list);
|
||||||
|
int vwprintf (const wchar_t*, va_list);
|
||||||
|
int vswprintf (wchar_t*, const wchar_t*, va_list);
|
||||||
|
int _vsnwprintf (wchar_t*, size_t, const wchar_t*, va_list);
|
||||||
|
int fwscanf (FILE*, const wchar_t*, ...);
|
||||||
|
int wscanf (const wchar_t*, ...);
|
||||||
|
int swscanf (const wchar_t*, const wchar_t*, ...);
|
||||||
|
wint_t fgetwc (FILE*);
|
||||||
|
wint_t fputwc (wchar_t, FILE*);
|
||||||
|
wint_t ungetwc (wchar_t, FILE*);
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
wchar_t* fgetws (wchar_t*, int, FILE*);
|
||||||
|
int fputws (const wchar_t*, FILE*);
|
||||||
|
wint_t getwc (FILE*);
|
||||||
|
wint_t getwchar (void);
|
||||||
|
wchar_t* _getws (wchar_t*);
|
||||||
|
wint_t putwc (wint_t, FILE*);
|
||||||
|
int _putws (const wchar_t*);
|
||||||
|
wint_t putwchar (wint_t);
|
||||||
|
FILE* _wfopen (const wchar_t*, const wchar_t*);
|
||||||
|
FILE* _wfreopen (const wchar_t*, const wchar_t*, FILE*);
|
||||||
|
FILE* _wfsopen (const wchar_t*, const wchar_t*, int);
|
||||||
|
wchar_t* _wtmpnam (wchar_t*);
|
||||||
|
wchar_t* _wtempnam (const wchar_t*, const wchar_t*);
|
||||||
|
int _wrename (const wchar_t*, const wchar_t*);
|
||||||
|
int _wremove (const wchar_t*);
|
||||||
|
void _wperror (const wchar_t*);
|
||||||
|
FILE* _wpopen (const wchar_t*, const wchar_t*);
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
|
||||||
|
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
|
||||||
|
int snwprintf(wchar_t* s, size_t n, const wchar_t* format, ...);
|
||||||
|
extern inline int vsnwprintf (wchar_t* s, size_t n, const wchar_t* format,
|
||||||
|
va_list arg)
|
||||||
|
{ return _vsnwprintf ( s, n, format, arg); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define _WSTDIO_DEFINED
|
||||||
|
#endif /* _WSTDIO_DEFINED */
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
#ifndef NO_OLDNAMES
|
||||||
|
FILE* wpopen (const wchar_t*, const wchar_t*);
|
||||||
|
#endif /* not NO_OLDNAMES */
|
||||||
|
#endif /* MSVCRT runtime */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Other Non ANSI wide functions
|
||||||
|
*/
|
||||||
|
wint_t _fgetwchar (void);
|
||||||
|
wint_t _fputwchar (wint_t);
|
||||||
|
int _getw (FILE*);
|
||||||
|
int _putw (int, FILE*);
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
wint_t fgetwchar (void);
|
||||||
|
wint_t fputwchar (wint_t);
|
||||||
|
int getw (FILE*);
|
||||||
|
int putw (int, FILE*);
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#endif /* __STRICT_ANSI */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* _STDIO_H_ */
|
||||||
482
bazaar/Tcc/lib/include/stdlib.h
Normal file
482
bazaar/Tcc/lib/include/stdlib.h
Normal file
|
|
@ -0,0 +1,482 @@
|
||||||
|
/*
|
||||||
|
* stdlib.h
|
||||||
|
*
|
||||||
|
* Definitions for common types, variables, and functions.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _STDLIB_H_
|
||||||
|
#define _STDLIB_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
|
||||||
|
#define __need_size_t
|
||||||
|
#define __need_wchar_t
|
||||||
|
#define __need_NULL
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* RC_INVOKED */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* RAND_MAX is the maximum value that may be returned by rand.
|
||||||
|
* The minimum is zero.
|
||||||
|
*/
|
||||||
|
#define RAND_MAX 0x7FFF
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These values may be used as exit status codes.
|
||||||
|
*/
|
||||||
|
#define EXIT_SUCCESS 0
|
||||||
|
#define EXIT_FAILURE 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Definitions for path name functions.
|
||||||
|
* NOTE: All of these values have simply been chosen to be conservatively high.
|
||||||
|
* Remember that with long file names we can no longer depend on
|
||||||
|
* extensions being short.
|
||||||
|
*/
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef MAX_PATH
|
||||||
|
#define MAX_PATH (260)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define _MAX_PATH MAX_PATH
|
||||||
|
#define _MAX_DRIVE (3)
|
||||||
|
#define _MAX_DIR 256
|
||||||
|
#define _MAX_FNAME 256
|
||||||
|
#define _MAX_EXT 256
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This seems like a convenient place to declare these variables, which
|
||||||
|
* give programs using WinMain (or main for that matter) access to main-ish
|
||||||
|
* argc and argv. environ is a pointer to a table of environment variables.
|
||||||
|
* NOTE: Strings in _argv and environ are ANSI strings.
|
||||||
|
*/
|
||||||
|
extern int _argc;
|
||||||
|
extern char** _argv;
|
||||||
|
|
||||||
|
/* imports from runtime dll of the above variables */
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
|
||||||
|
extern int* __p___argc(void);
|
||||||
|
extern char*** __p___argv(void);
|
||||||
|
extern wchar_t*** __p___wargv(void);
|
||||||
|
|
||||||
|
#define __argc (*__p___argc())
|
||||||
|
#define __argv (*__p___argv())
|
||||||
|
#define __wargv (*__p___wargv())
|
||||||
|
|
||||||
|
#else /* !MSVCRT */
|
||||||
|
|
||||||
|
#ifndef __DECLSPEC_SUPPORTED
|
||||||
|
|
||||||
|
extern int* __imp___argc_dll;
|
||||||
|
extern char*** __imp___argv_dll;
|
||||||
|
#define __argc (*__imp___argc_dll)
|
||||||
|
#define __argv (*__imp___argv_dll)
|
||||||
|
|
||||||
|
#else /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
__MINGW_IMPORT int __argc_dll;
|
||||||
|
__MINGW_IMPORT char** __argv_dll;
|
||||||
|
#define __argc __argc_dll
|
||||||
|
#define __argv __argv_dll
|
||||||
|
|
||||||
|
#endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
#endif /* __MSVCRT */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Also defined in ctype.h.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MB_CUR_MAX
|
||||||
|
# ifdef __MSVCRT__
|
||||||
|
# define MB_CUR_MAX __mb_cur_max
|
||||||
|
__MINGW_IMPORT int __mb_cur_max;
|
||||||
|
# else /* not __MSVCRT */
|
||||||
|
# define MB_CUR_MAX __mb_cur_max_dll
|
||||||
|
__MINGW_IMPORT int __mb_cur_max_dll;
|
||||||
|
# endif /* not __MSVCRT */
|
||||||
|
#endif /* MB_CUR_MAX */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MS likes to declare errno in stdlib.h as well.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef _UWIN
|
||||||
|
#undef errno
|
||||||
|
extern int errno;
|
||||||
|
#else
|
||||||
|
int* _errno(void);
|
||||||
|
#define errno (*_errno())
|
||||||
|
#endif
|
||||||
|
int* __doserrno(void);
|
||||||
|
#define _doserrno (*__doserrno())
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use environ from the DLL, not as a global.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
extern char *** __p__environ(void);
|
||||||
|
extern wchar_t *** __p__wenviron(void);
|
||||||
|
# define _environ (*__p__environ())
|
||||||
|
# define _wenviron (*__p__wenviron())
|
||||||
|
#else /* ! __MSVCRT__ */
|
||||||
|
# ifndef __DECLSPEC_SUPPORTED
|
||||||
|
extern char *** __imp__environ_dll;
|
||||||
|
# define _environ (*__imp__environ_dll)
|
||||||
|
# else /* __DECLSPEC_SUPPORTED */
|
||||||
|
__MINGW_IMPORT char ** _environ_dll;
|
||||||
|
# define _environ _environ_dll
|
||||||
|
# endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
#endif /* ! __MSVCRT__ */
|
||||||
|
|
||||||
|
#define environ _environ
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
/* One of the MSVCRTxx libraries */
|
||||||
|
|
||||||
|
#ifndef __DECLSPEC_SUPPORTED
|
||||||
|
extern int* __imp__sys_nerr;
|
||||||
|
# define sys_nerr (*__imp__sys_nerr)
|
||||||
|
#else /* __DECLSPEC_SUPPORTED */
|
||||||
|
__MINGW_IMPORT int _sys_nerr;
|
||||||
|
# ifndef _UWIN
|
||||||
|
# define sys_nerr _sys_nerr
|
||||||
|
# endif /* _UWIN */
|
||||||
|
#endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
#else /* ! __MSVCRT__ */
|
||||||
|
|
||||||
|
/* CRTDLL run time library */
|
||||||
|
|
||||||
|
#ifndef __DECLSPEC_SUPPORTED
|
||||||
|
extern int* __imp__sys_nerr_dll;
|
||||||
|
# define sys_nerr (*__imp__sys_nerr_dll)
|
||||||
|
#else /* __DECLSPEC_SUPPORTED */
|
||||||
|
__MINGW_IMPORT int _sys_nerr_dll;
|
||||||
|
# define sys_nerr _sys_nerr_dll
|
||||||
|
#endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
#endif /* ! __MSVCRT__ */
|
||||||
|
|
||||||
|
#ifndef __DECLSPEC_SUPPORTED
|
||||||
|
extern char*** __imp__sys_errlist;
|
||||||
|
#define sys_errlist (*__imp__sys_errlist)
|
||||||
|
#else /* __DECLSPEC_SUPPORTED */
|
||||||
|
__MINGW_IMPORT char* _sys_errlist[];
|
||||||
|
#ifndef _UWIN
|
||||||
|
#define sys_errlist _sys_errlist
|
||||||
|
#endif /* _UWIN */
|
||||||
|
#endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* OS version and such constants.
|
||||||
|
*/
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
/* msvcrtxx.dll */
|
||||||
|
|
||||||
|
extern unsigned int* __p__osver(void);
|
||||||
|
extern unsigned int* __p__winver(void);
|
||||||
|
extern unsigned int* __p__winmajor(void);
|
||||||
|
extern unsigned int* __p__winminor(void);
|
||||||
|
|
||||||
|
#define _osver (*__p__osver())
|
||||||
|
#define _winver (*__p__winver())
|
||||||
|
#define _winmajor (*__p__winmajor())
|
||||||
|
#define _winminor (*__p__winminor())
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* Not msvcrtxx.dll, thus crtdll.dll */
|
||||||
|
|
||||||
|
#ifndef __DECLSPEC_SUPPORTED
|
||||||
|
|
||||||
|
extern unsigned int* _imp___osver_dll;
|
||||||
|
extern unsigned int* _imp___winver_dll;
|
||||||
|
extern unsigned int* _imp___winmajor_dll;
|
||||||
|
extern unsigned int* _imp___winminor_dll;
|
||||||
|
|
||||||
|
#define _osver (*_imp___osver_dll)
|
||||||
|
#define _winver (*_imp___winver_dll)
|
||||||
|
#define _winmajor (*_imp___winmajor_dll)
|
||||||
|
#define _winminor (*_imp___winminor_dll)
|
||||||
|
|
||||||
|
#else /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
__MINGW_IMPORT unsigned int _osver_dll;
|
||||||
|
__MINGW_IMPORT unsigned int _winver_dll;
|
||||||
|
__MINGW_IMPORT unsigned int _winmajor_dll;
|
||||||
|
__MINGW_IMPORT unsigned int _winminor_dll;
|
||||||
|
|
||||||
|
#define _osver _osver_dll
|
||||||
|
#define _winver _winver_dll
|
||||||
|
#define _winmajor _winmajor_dll
|
||||||
|
#define _winminor _winminor_dll
|
||||||
|
|
||||||
|
#endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined __MSVCRT__
|
||||||
|
/* although the _pgmptr is exported as DATA,
|
||||||
|
* be safe and use the access function __p__pgmptr() to get it. */
|
||||||
|
char** __p__pgmptr(void);
|
||||||
|
#define _pgmptr (*__p__pgmptr())
|
||||||
|
wchar_t** __p__wpgmptr(void);
|
||||||
|
#define _wpgmptr (*__p__wpgmptr())
|
||||||
|
#else /* ! __MSVCRT__ */
|
||||||
|
# ifndef __DECLSPEC_SUPPORTED
|
||||||
|
extern char** __imp__pgmptr_dll;
|
||||||
|
# define _pgmptr (*__imp__pgmptr_dll)
|
||||||
|
# else /* __DECLSPEC_SUPPORTED */
|
||||||
|
__MINGW_IMPORT char* _pgmptr_dll;
|
||||||
|
# define _pgmptr _pgmptr_dll
|
||||||
|
# endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
/* no wide version in CRTDLL */
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define _ATTRIB_NORETURN __attribute__ ((noreturn))
|
||||||
|
#else /* Not __GNUC__ */
|
||||||
|
#define _ATTRIB_NORETURN
|
||||||
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
|
double atof (const char*);
|
||||||
|
int atoi (const char*);
|
||||||
|
long atol (const char*);
|
||||||
|
int _wtoi (const wchar_t *);
|
||||||
|
long _wtol (const wchar_t *);
|
||||||
|
|
||||||
|
double strtod (const char*, char**);
|
||||||
|
#if !defined __NO_ISOCEXT /* extern stubs in static libmingwex.a */
|
||||||
|
extern __inline__ float strtof (const char *nptr, char **endptr)
|
||||||
|
{ return (strtod (nptr, endptr));}
|
||||||
|
#endif /* __NO_ISOCEXT */
|
||||||
|
|
||||||
|
long strtol (const char*, char**, int);
|
||||||
|
unsigned long strtoul (const char*, char**, int);
|
||||||
|
|
||||||
|
#ifndef _WSTDLIB_DEFINED
|
||||||
|
/* also declared in wchar.h */
|
||||||
|
double wcstod (const wchar_t*, wchar_t**);
|
||||||
|
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
|
||||||
|
extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr)
|
||||||
|
{ return (wcstod(nptr, endptr)); }
|
||||||
|
#endif /* __NO_ISOCEXT */
|
||||||
|
|
||||||
|
long wcstol (const wchar_t*, wchar_t**, int);
|
||||||
|
unsigned long wcstoul (const wchar_t*, wchar_t**, int);
|
||||||
|
#define _WSTDLIB_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
size_t wcstombs (char*, const wchar_t*, size_t);
|
||||||
|
int wctomb (char*, wchar_t);
|
||||||
|
|
||||||
|
int mblen (const char*, size_t);
|
||||||
|
size_t mbstowcs (wchar_t*, const char*, size_t);
|
||||||
|
int mbtowc (wchar_t*, const char*, size_t);
|
||||||
|
|
||||||
|
int rand (void);
|
||||||
|
void srand (unsigned int);
|
||||||
|
|
||||||
|
void* calloc (size_t, size_t);
|
||||||
|
void* malloc (size_t);
|
||||||
|
void* realloc (void*, size_t);
|
||||||
|
void free (void*);
|
||||||
|
|
||||||
|
void abort (void) _ATTRIB_NORETURN;
|
||||||
|
void exit (int) _ATTRIB_NORETURN;
|
||||||
|
int atexit (void (*)(void));
|
||||||
|
|
||||||
|
int system (const char*);
|
||||||
|
char* getenv (const char*);
|
||||||
|
|
||||||
|
void* bsearch (const void*, const void*, size_t, size_t,
|
||||||
|
int (*)(const void*, const void*));
|
||||||
|
void qsort (const void*, size_t, size_t,
|
||||||
|
int (*)(const void*, const void*));
|
||||||
|
|
||||||
|
int abs (int);
|
||||||
|
long labs (long);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* div_t and ldiv_t are structures used to return the results of div and
|
||||||
|
* ldiv.
|
||||||
|
*
|
||||||
|
* NOTE: div and ldiv appear not to work correctly unless
|
||||||
|
* -fno-pcc-struct-return is specified. This is included in the
|
||||||
|
* mingw32 specs file.
|
||||||
|
*/
|
||||||
|
typedef struct { int quot, rem; } div_t;
|
||||||
|
typedef struct { long quot, rem; } ldiv_t;
|
||||||
|
|
||||||
|
div_t div (int, int);
|
||||||
|
ldiv_t ldiv (long, long);
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: Officially the three following functions are obsolete. The Win32 API
|
||||||
|
* functions SetErrorMode, Beep and Sleep are their replacements.
|
||||||
|
*/
|
||||||
|
void _beep (unsigned int, unsigned int);
|
||||||
|
void _seterrormode (int);
|
||||||
|
void _sleep (unsigned long);
|
||||||
|
|
||||||
|
void _exit (int) _ATTRIB_NORETURN;
|
||||||
|
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
|
||||||
|
/* C99 function name */
|
||||||
|
void _Exit(int) _ATTRIB_NORETURN; /* Declare to get noreturn attribute. */
|
||||||
|
extern __inline__ void _Exit(int status)
|
||||||
|
{ _exit(status); }
|
||||||
|
#endif
|
||||||
|
/* _onexit is MS extension. Use atexit for portability. */
|
||||||
|
typedef int (* _onexit_t)(void);
|
||||||
|
_onexit_t _onexit( _onexit_t );
|
||||||
|
|
||||||
|
int _putenv (const char*);
|
||||||
|
void _searchenv (const char*, const char*, char*);
|
||||||
|
|
||||||
|
|
||||||
|
char* _ecvt (double, int, int*, int*);
|
||||||
|
char* _fcvt (double, int, int*, int*);
|
||||||
|
char* _gcvt (double, int, char*);
|
||||||
|
|
||||||
|
void _makepath (char*, const char*, const char*, const char*, const char*);
|
||||||
|
void _splitpath (const char*, char*, char*, char*, char*);
|
||||||
|
char* _fullpath (char*, const char*, size_t);
|
||||||
|
|
||||||
|
|
||||||
|
char* _itoa (int, char*, int);
|
||||||
|
char* _ltoa (long, char*, int);
|
||||||
|
char* _ultoa(unsigned long, char*, int);
|
||||||
|
wchar_t* _itow (int, wchar_t*, int);
|
||||||
|
wchar_t* _ltow (long, wchar_t*, int);
|
||||||
|
wchar_t* _ultow (unsigned long, wchar_t*, int);
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
__int64 _atoi64(const char *);
|
||||||
|
char* _i64toa(__int64, char *, int);
|
||||||
|
char* _ui64toa(unsigned __int64, char *, int);
|
||||||
|
__int64 _wtoi64(const wchar_t *);
|
||||||
|
wchar_t* _i64tow(__int64, wchar_t *, int);
|
||||||
|
wchar_t* _ui64tow(unsigned __int64, wchar_t *, int);
|
||||||
|
|
||||||
|
wchar_t* _wgetenv(const wchar_t*);
|
||||||
|
int _wputenv(const wchar_t*);
|
||||||
|
void _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
|
||||||
|
void _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
|
||||||
|
void _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
|
||||||
|
wchar_t* _wfullpath (wchar_t*, const wchar_t*, size_t);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
|
||||||
|
int putenv (const char*);
|
||||||
|
void searchenv (const char*, const char*, char*);
|
||||||
|
|
||||||
|
char* itoa (int, char*, int);
|
||||||
|
char* ltoa (long, char*, int);
|
||||||
|
|
||||||
|
#ifndef _UWIN
|
||||||
|
char* ecvt (double, int, int*, int*);
|
||||||
|
char* fcvt (double, int, int*, int*);
|
||||||
|
char* gcvt (double, int, char*);
|
||||||
|
#endif /* _UWIN */
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
/* C99 names */
|
||||||
|
|
||||||
|
#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
|
||||||
|
|
||||||
|
typedef struct { long long quot, rem; } lldiv_t;
|
||||||
|
|
||||||
|
lldiv_t lldiv (long long, long long);
|
||||||
|
|
||||||
|
extern __inline__ long long llabs(long long _j)
|
||||||
|
{return (_j >= 0 ? _j : -_j);}
|
||||||
|
|
||||||
|
long long strtoll (const char* __restrict__, char** __restrict, int);
|
||||||
|
unsigned long long strtoull (const char* __restrict__, char** __restrict__, int);
|
||||||
|
|
||||||
|
#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */
|
||||||
|
long long atoll (const char *);
|
||||||
|
|
||||||
|
#if !defined (__STRICT_ANSI__)
|
||||||
|
long long wtoll(const wchar_t *);
|
||||||
|
char* lltoa(long long, char *, int);
|
||||||
|
char* ulltoa(unsigned long long , char *, int);
|
||||||
|
wchar_t* lltow(long long, wchar_t *, int);
|
||||||
|
wchar_t* ulltow(unsigned long long, wchar_t *, int);
|
||||||
|
|
||||||
|
/* inline using non-ansi functions */
|
||||||
|
extern __inline__ long long atoll (const char * _c)
|
||||||
|
{ return _atoi64 (_c); }
|
||||||
|
extern __inline__ char* lltoa(long long _n, char * _c, int _i)
|
||||||
|
{ return _i64toa (_n, _c, _i); }
|
||||||
|
extern __inline__ char* ulltoa(unsigned long long _n, char * _c, int _i)
|
||||||
|
{ return _ui64toa (_n, _c, _i); }
|
||||||
|
extern __inline__ long long wtoll(const wchar_t * _w)
|
||||||
|
{ return _wtoi64 (_w); }
|
||||||
|
extern __inline__ wchar_t* lltow(long long _n, wchar_t * _w, int _i)
|
||||||
|
{ return _i64tow (_n, _w, _i); }
|
||||||
|
extern __inline__ wchar_t* ulltow(unsigned long long _n, wchar_t * _w, int _i)
|
||||||
|
{ return _ui64tow (_n, _w, _i); }
|
||||||
|
#endif /* (__STRICT_ANSI__) */
|
||||||
|
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
|
||||||
|
#endif /* !__NO_ISOCEXT */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Undefine the no return attribute used in some function definitions
|
||||||
|
*/
|
||||||
|
#undef _ATTRIB_NORETURN
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _STDLIB_H_ */
|
||||||
|
|
||||||
206
bazaar/Tcc/lib/include/string.h
Normal file
206
bazaar/Tcc/lib/include/string.h
Normal file
|
|
@ -0,0 +1,206 @@
|
||||||
|
/*
|
||||||
|
* string.h
|
||||||
|
*
|
||||||
|
* Definitions for memory and string functions.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _STRING_H_
|
||||||
|
#define _STRING_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Define size_t, wchar_t and NULL
|
||||||
|
*/
|
||||||
|
#define __need_size_t
|
||||||
|
#define __need_wchar_t
|
||||||
|
#define __need_NULL
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Prototypes of the ANSI Standard C library string functions.
|
||||||
|
*/
|
||||||
|
void* memchr (const void*, int, size_t);
|
||||||
|
int memcmp (const void*, const void*, size_t);
|
||||||
|
void* memcpy (void*, const void*, size_t);
|
||||||
|
void* memmove (void*, const void*, size_t);
|
||||||
|
void* memset (void*, int, size_t);
|
||||||
|
char* strcat (char*, const char*);
|
||||||
|
char* strchr (const char*, int);
|
||||||
|
int strcmp (const char*, const char*);
|
||||||
|
int strcoll (const char*, const char*); /* Compare using locale */
|
||||||
|
char* strcpy (char*, const char*);
|
||||||
|
size_t strcspn (const char*, const char*);
|
||||||
|
char* strerror (int); /* NOTE: NOT an old name wrapper. */
|
||||||
|
char* _strerror (const char *);
|
||||||
|
size_t strlen (const char*);
|
||||||
|
char* strncat (char*, const char*, size_t);
|
||||||
|
int strncmp (const char*, const char*, size_t);
|
||||||
|
char* strncpy (char*, const char*, size_t);
|
||||||
|
char* strpbrk (const char*, const char*);
|
||||||
|
char* strrchr (const char*, int);
|
||||||
|
size_t strspn (const char*, const char*);
|
||||||
|
char* strstr (const char*, const char*);
|
||||||
|
char* strtok (char*, const char*);
|
||||||
|
size_t strxfrm (char*, const char*, size_t);
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
/*
|
||||||
|
* Extra non-ANSI functions provided by the CRTDLL library
|
||||||
|
*/
|
||||||
|
void* _memccpy (void*, const void*, int, size_t);
|
||||||
|
int _memicmp (const void*, const void*, size_t);
|
||||||
|
char* _strdup (const char*);
|
||||||
|
int _strcmpi (const char*, const char*);
|
||||||
|
int _stricmp (const char*, const char*);
|
||||||
|
int _stricoll (const char*, const char*);
|
||||||
|
char* _strlwr (char*);
|
||||||
|
int _strnicmp (const char*, const char*, size_t);
|
||||||
|
char* _strnset (char*, int, size_t);
|
||||||
|
char* _strrev (char*);
|
||||||
|
char* _strset (char*, int);
|
||||||
|
char* _strupr (char*);
|
||||||
|
void _swab (const char*, char*, size_t);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Multi-byte character functions
|
||||||
|
*/
|
||||||
|
unsigned char* _mbschr (unsigned char*, unsigned char*);
|
||||||
|
unsigned char* _mbsncat (unsigned char*, const unsigned char*, size_t);
|
||||||
|
unsigned char* _mbstok (unsigned char*, unsigned char*);
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
int _strncoll(const char*, const char*, size_t);
|
||||||
|
int _strnicoll(const char*, const char*, size_t);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Unicode versions of the standard calls.
|
||||||
|
*/
|
||||||
|
wchar_t* wcscat (wchar_t*, const wchar_t*);
|
||||||
|
wchar_t* wcschr (const wchar_t*, wchar_t);
|
||||||
|
int wcscmp (const wchar_t*, const wchar_t*);
|
||||||
|
int wcscoll (const wchar_t*, const wchar_t*);
|
||||||
|
wchar_t* wcscpy (wchar_t*, const wchar_t*);
|
||||||
|
size_t wcscspn (const wchar_t*, const wchar_t*);
|
||||||
|
/* Note: No wcserror in CRTDLL. */
|
||||||
|
size_t wcslen (const wchar_t*);
|
||||||
|
wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
|
||||||
|
int wcsncmp(const wchar_t*, const wchar_t*, size_t);
|
||||||
|
wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
|
||||||
|
wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
|
||||||
|
wchar_t* wcsrchr(const wchar_t*, wchar_t);
|
||||||
|
size_t wcsspn(const wchar_t*, const wchar_t*);
|
||||||
|
wchar_t* wcsstr(const wchar_t*, const wchar_t*);
|
||||||
|
wchar_t* wcstok(wchar_t*, const wchar_t*);
|
||||||
|
size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
/*
|
||||||
|
* Unicode versions of non-ANSI functions provided by CRTDLL.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
|
||||||
|
#define _wcscmpi _wcsicmp
|
||||||
|
|
||||||
|
wchar_t* _wcsdup (wchar_t*);
|
||||||
|
int _wcsicmp (const wchar_t*, const wchar_t*);
|
||||||
|
int _wcsicoll (const wchar_t*, const wchar_t*);
|
||||||
|
wchar_t* _wcslwr (wchar_t*);
|
||||||
|
int _wcsnicmp (const wchar_t*, const wchar_t*, size_t);
|
||||||
|
wchar_t* _wcsnset (wchar_t*, wchar_t, size_t);
|
||||||
|
wchar_t* _wcsrev (wchar_t*);
|
||||||
|
wchar_t* _wcsset (wchar_t*, wchar_t);
|
||||||
|
wchar_t* _wcsupr (wchar_t*);
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
int _wcsncoll(const wchar_t*, const wchar_t*, size_t);
|
||||||
|
int _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Non-underscored versions of non-ANSI functions. They live in liboldnames.a
|
||||||
|
* and provide a little extra portability. Also a few extra UNIX-isms like
|
||||||
|
* strcasecmp.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void* memccpy (void*, const void*, int, size_t);
|
||||||
|
int memicmp (const void*, const void*, size_t);
|
||||||
|
char* strdup (const char*);
|
||||||
|
int strcmpi (const char*, const char*);
|
||||||
|
int stricmp (const char*, const char*);
|
||||||
|
int strcasecmp (const char*, const char*);
|
||||||
|
int stricoll (const char*, const char*);
|
||||||
|
char* strlwr (char*);
|
||||||
|
int strnicmp (const char*, const char*, size_t);
|
||||||
|
int strncasecmp (const char*, const char*, size_t);
|
||||||
|
char* strnset (char*, int, size_t);
|
||||||
|
char* strrev (char*);
|
||||||
|
char* strset (char*, int);
|
||||||
|
char* strupr (char*);
|
||||||
|
#ifndef _UWIN
|
||||||
|
void swab (const char*, char*, size_t);
|
||||||
|
#endif /* _UWIN */
|
||||||
|
|
||||||
|
/* NOTE: There is no _wcscmpi, but this is for compatibility. */
|
||||||
|
int wcscmpi (const wchar_t*, const wchar_t*);
|
||||||
|
wchar_t* wcsdup (wchar_t*);
|
||||||
|
int wcsicmp (const wchar_t*, const wchar_t*);
|
||||||
|
int wcsicoll (const wchar_t*, const wchar_t*);
|
||||||
|
wchar_t* wcslwr (wchar_t*);
|
||||||
|
int wcsnicmp (const wchar_t*, const wchar_t*, size_t);
|
||||||
|
wchar_t* wcsnset (wchar_t*, wchar_t, size_t);
|
||||||
|
wchar_t* wcsrev (wchar_t*);
|
||||||
|
wchar_t* wcsset (wchar_t*, wchar_t);
|
||||||
|
wchar_t* wcsupr (wchar_t*);
|
||||||
|
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
#endif /* Not strict ANSI */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _STRING_H_ */
|
||||||
|
|
||||||
8
bazaar/Tcc/lib/include/sys/fcntl.h
Normal file
8
bazaar/Tcc/lib/include/sys/fcntl.h
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* This fcntl.h maps to the root fcntl.h
|
||||||
|
*/
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
9
bazaar/Tcc/lib/include/sys/file.h
Normal file
9
bazaar/Tcc/lib/include/sys/file.h
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* This file.h maps to the root fcntl.h
|
||||||
|
* TODO?
|
||||||
|
*/
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
52
bazaar/Tcc/lib/include/sys/locking.h
Normal file
52
bazaar/Tcc/lib/include/sys/locking.h
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
* locking.h
|
||||||
|
*
|
||||||
|
* Constants for the mode parameter of the locking function.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _LOCKING_H_
|
||||||
|
#define _LOCKING_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define _LK_UNLCK 0 /* Unlock */
|
||||||
|
#define _LK_LOCK 1 /* Lock */
|
||||||
|
#define _LK_NBLCK 2 /* Non-blocking lock */
|
||||||
|
#define _LK_RLCK 3 /* Lock for read only */
|
||||||
|
#define _LK_NBRLCK 4 /* Non-blocking lock for read only */
|
||||||
|
|
||||||
|
#ifndef NO_OLDNAMES
|
||||||
|
#define LK_UNLCK _LK_UNLCK
|
||||||
|
#define LK_LOCK _LK_LOCK
|
||||||
|
#define LK_NBLCK _LK_NBLCK
|
||||||
|
#define LK_RLCK _LK_RLCK
|
||||||
|
#define LK_NBRLCK _LK_NBRLCK
|
||||||
|
#endif /* Not NO_OLDNAMES */
|
||||||
|
|
||||||
|
#endif /* Not _LOCKING_H_ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
190
bazaar/Tcc/lib/include/sys/stat.h
Normal file
190
bazaar/Tcc/lib/include/sys/stat.h
Normal file
|
|
@ -0,0 +1,190 @@
|
||||||
|
/*
|
||||||
|
* stat.h
|
||||||
|
*
|
||||||
|
* Symbolic constants for opening and creating files, also stat, fstat and
|
||||||
|
* chmod functions.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _STAT_H_
|
||||||
|
#define _STAT_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define __need_size_t
|
||||||
|
#define __need_wchar_t
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constants for the stat st_mode member.
|
||||||
|
*/
|
||||||
|
#define _S_IFIFO 0x1000 /* FIFO */
|
||||||
|
#define _S_IFCHR 0x2000 /* Character */
|
||||||
|
#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */
|
||||||
|
#define _S_IFDIR 0x4000 /* Directory */
|
||||||
|
#define _S_IFREG 0x8000 /* Regular */
|
||||||
|
|
||||||
|
#define _S_IFMT 0xF000 /* File type mask */
|
||||||
|
|
||||||
|
#define _S_IEXEC 0x0040
|
||||||
|
#define _S_IWRITE 0x0080
|
||||||
|
#define _S_IREAD 0x0100
|
||||||
|
|
||||||
|
#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
|
||||||
|
#define _S_IXUSR _S_IEXEC
|
||||||
|
#define _S_IWUSR _S_IWRITE
|
||||||
|
#define _S_IRUSR _S_IREAD
|
||||||
|
|
||||||
|
#define _S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
|
||||||
|
#define _S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO)
|
||||||
|
#define _S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR)
|
||||||
|
#define _S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK)
|
||||||
|
#define _S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
|
||||||
|
#define S_IFIFO _S_IFIFO
|
||||||
|
#define S_IFCHR _S_IFCHR
|
||||||
|
#define S_IFBLK _S_IFBLK
|
||||||
|
#define S_IFDIR _S_IFDIR
|
||||||
|
#define S_IFREG _S_IFREG
|
||||||
|
#define S_IFMT _S_IFMT
|
||||||
|
#define S_IEXEC _S_IEXEC
|
||||||
|
#define S_IWRITE _S_IWRITE
|
||||||
|
#define S_IREAD _S_IREAD
|
||||||
|
#define S_IRWXU _S_IRWXU
|
||||||
|
#define S_IXUSR _S_IXUSR
|
||||||
|
#define S_IWUSR _S_IWUSR
|
||||||
|
#define S_IRUSR _S_IRUSR
|
||||||
|
|
||||||
|
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||||
|
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||||
|
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||||
|
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||||
|
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||||
|
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifndef _STAT_DEFINED
|
||||||
|
/*
|
||||||
|
* The structure manipulated and returned by stat and fstat.
|
||||||
|
*
|
||||||
|
* NOTE: If called on a directory the values in the time fields are not only
|
||||||
|
* invalid, they will cause localtime et. al. to return NULL. And calling
|
||||||
|
* asctime with a NULL pointer causes an Invalid Page Fault. So watch it!
|
||||||
|
*/
|
||||||
|
struct _stat
|
||||||
|
{
|
||||||
|
_dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
|
||||||
|
_ino_t st_ino; /* Always zero ? */
|
||||||
|
_mode_t st_mode; /* See above constants */
|
||||||
|
short st_nlink; /* Number of links. */
|
||||||
|
short st_uid; /* User: Maybe significant on NT ? */
|
||||||
|
short st_gid; /* Group: Ditto */
|
||||||
|
_dev_t st_rdev; /* Seems useless (not even filled in) */
|
||||||
|
_off_t st_size; /* File size in bytes */
|
||||||
|
time_t st_atime; /* Accessed date (always 00:00 hrs local
|
||||||
|
* on FAT) */
|
||||||
|
time_t st_mtime; /* Modified time */
|
||||||
|
time_t st_ctime; /* Creation time */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct stat
|
||||||
|
{
|
||||||
|
_dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
|
||||||
|
_ino_t st_ino; /* Always zero ? */
|
||||||
|
_mode_t st_mode; /* See above constants */
|
||||||
|
short st_nlink; /* Number of links. */
|
||||||
|
short st_uid; /* User: Maybe significant on NT ? */
|
||||||
|
short st_gid; /* Group: Ditto */
|
||||||
|
_dev_t st_rdev; /* Seems useless (not even filled in) */
|
||||||
|
_off_t st_size; /* File size in bytes */
|
||||||
|
time_t st_atime; /* Accessed date (always 00:00 hrs local
|
||||||
|
* on FAT) */
|
||||||
|
time_t st_mtime; /* Modified time */
|
||||||
|
time_t st_ctime; /* Creation time */
|
||||||
|
};
|
||||||
|
#if defined (__MSVCRT__)
|
||||||
|
struct _stati64 {
|
||||||
|
_dev_t st_dev;
|
||||||
|
_ino_t st_ino;
|
||||||
|
unsigned short st_mode;
|
||||||
|
short st_nlink;
|
||||||
|
short st_uid;
|
||||||
|
short st_gid;
|
||||||
|
_dev_t st_rdev;
|
||||||
|
__int64 st_size;
|
||||||
|
time_t st_atime;
|
||||||
|
time_t st_mtime;
|
||||||
|
time_t st_ctime;
|
||||||
|
};
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
#define _STAT_DEFINED
|
||||||
|
#endif /* _STAT_DEFINED */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int _fstat (int, struct _stat*);
|
||||||
|
int _chmod (const char*, int);
|
||||||
|
int _stat (const char*, struct _stat*);
|
||||||
|
|
||||||
|
#if defined (__MSVCRT__)
|
||||||
|
int _fstati64(int, struct _stati64 *);
|
||||||
|
int _stati64(const char *, struct _stati64 *);
|
||||||
|
#if !defined ( _WSTAT_DEFINED) /* also declared in wchar.h */
|
||||||
|
int _wstat(const wchar_t*, struct _stat*);
|
||||||
|
int _wstati64 (const wchar_t*, struct _stati64*);
|
||||||
|
#define _WSTAT_DEFINED
|
||||||
|
#endif /* _WSTAT_DEFIND */
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
|
||||||
|
/* These functions live in liboldnames.a. */
|
||||||
|
int fstat (int, struct stat*);
|
||||||
|
int chmod (const char*, int);
|
||||||
|
int stat (const char*, struct stat*);
|
||||||
|
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _STAT_H_ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
3
bazaar/Tcc/lib/include/sys/time.h
Normal file
3
bazaar/Tcc/lib/include/sys/time.h
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
82
bazaar/Tcc/lib/include/sys/timeb.h
Normal file
82
bazaar/Tcc/lib/include/sys/timeb.h
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
/*
|
||||||
|
* timeb.h
|
||||||
|
*
|
||||||
|
* Support for the UNIX System V ftime system call.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _TIMEB_H_
|
||||||
|
#define _TIMEB_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO: Structure not tested.
|
||||||
|
*/
|
||||||
|
struct _timeb
|
||||||
|
{
|
||||||
|
long time;
|
||||||
|
short millitm;
|
||||||
|
short timezone;
|
||||||
|
short dstflag;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
/*
|
||||||
|
* TODO: Structure not tested.
|
||||||
|
*/
|
||||||
|
struct timeb
|
||||||
|
{
|
||||||
|
long time;
|
||||||
|
short millitm;
|
||||||
|
short timezone;
|
||||||
|
short dstflag;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* TODO: Not tested. */
|
||||||
|
void _ftime (struct _timeb*);
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
void ftime (struct timeb*);
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _TIMEB_H_ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
118
bazaar/Tcc/lib/include/sys/types.h
Normal file
118
bazaar/Tcc/lib/include/sys/types.h
Normal file
|
|
@ -0,0 +1,118 @@
|
||||||
|
/*
|
||||||
|
* types.h
|
||||||
|
*
|
||||||
|
* The definition of constants, data types and global variables.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
* Lots of types supplied by Pedro A. Aranda <paag@tid.es>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warrenties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _TYPES_H_
|
||||||
|
#define _TYPES_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define __need_wchar_t
|
||||||
|
#define __need_size_t
|
||||||
|
#define __need_ptrdiff_t
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifndef _TIME_T_DEFINED
|
||||||
|
typedef long time_t;
|
||||||
|
#define _TIME_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _OFF_T_
|
||||||
|
#define _OFF_T_
|
||||||
|
typedef long _off_t;
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
typedef _off_t off_t;
|
||||||
|
#endif
|
||||||
|
#endif /* Not _OFF_T_ */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _DEV_T_
|
||||||
|
#define _DEV_T_
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
typedef unsigned int _dev_t;
|
||||||
|
#else
|
||||||
|
typedef short _dev_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
typedef _dev_t dev_t;
|
||||||
|
#endif
|
||||||
|
#endif /* Not _DEV_T_ */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _INO_T_
|
||||||
|
#define _INO_T_
|
||||||
|
typedef short _ino_t;
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
typedef _ino_t ino_t;
|
||||||
|
#endif
|
||||||
|
#endif /* Not _INO_T_ */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _PID_T_
|
||||||
|
#define _PID_T_
|
||||||
|
typedef int _pid_t;
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
typedef _pid_t pid_t;
|
||||||
|
#endif
|
||||||
|
#endif /* Not _PID_T_ */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _MODE_T_
|
||||||
|
#define _MODE_T_
|
||||||
|
typedef unsigned short _mode_t;
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
typedef _mode_t mode_t;
|
||||||
|
#endif
|
||||||
|
#endif /* Not _MODE_T_ */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _SIGSET_T_
|
||||||
|
#define _SIGSET_T_
|
||||||
|
typedef int _sigset_t;
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
typedef _sigset_t sigset_t;
|
||||||
|
#endif
|
||||||
|
#endif /* Not _SIGSET_T_ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _TYPES_H_ */
|
||||||
9
bazaar/Tcc/lib/include/sys/unistd.h
Normal file
9
bazaar/Tcc/lib/include/sys/unistd.h
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* unistd.h maps (roughly) to io.h
|
||||||
|
*/
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
89
bazaar/Tcc/lib/include/sys/utime.h
Normal file
89
bazaar/Tcc/lib/include/sys/utime.h
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
/*
|
||||||
|
* utime.h
|
||||||
|
*
|
||||||
|
* Support for the utime function.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _UTIME_H_
|
||||||
|
#define _UTIME_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define __need_wchar_t
|
||||||
|
#define __need_size_t
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Structure used by _utime function.
|
||||||
|
*/
|
||||||
|
struct _utimbuf
|
||||||
|
{
|
||||||
|
time_t actime; /* Access time */
|
||||||
|
time_t modtime; /* Modification time */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
/* NOTE: Must be the same as _utimbuf above. */
|
||||||
|
struct utimbuf
|
||||||
|
{
|
||||||
|
time_t actime;
|
||||||
|
time_t modtime;
|
||||||
|
};
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int _utime (const char*, struct _utimbuf*);
|
||||||
|
int _futime (int, struct _utimbuf*);
|
||||||
|
|
||||||
|
/* The wide character version, only available for MSVCRT versions of the
|
||||||
|
* C runtime library. */
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
int _wutime (const wchar_t*, struct _utimbuf*);
|
||||||
|
#endif /* MSVCRT runtime */
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
int utime (const char*, struct utimbuf*);
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _UTIME_H_ */
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
367
bazaar/Tcc/lib/include/tchar.h
Normal file
367
bazaar/Tcc/lib/include/tchar.h
Normal file
|
|
@ -0,0 +1,367 @@
|
||||||
|
/*
|
||||||
|
* tchar.h
|
||||||
|
*
|
||||||
|
* Unicode mapping layer for the standard C library. By including this
|
||||||
|
* file and using the 't' names for string functions
|
||||||
|
* (eg. _tprintf) you can make code which can be easily adapted to both
|
||||||
|
* Unicode and non-unicode environments. In a unicode enabled compile define
|
||||||
|
* _UNICODE before including tchar.h, otherwise the standard non-unicode
|
||||||
|
* library functions will be used.
|
||||||
|
*
|
||||||
|
* Note that you still need to include string.h or stdlib.h etc. to define
|
||||||
|
* the appropriate functions. Also note that there are several defines
|
||||||
|
* included for non-ANSI functions which are commonly available (but using
|
||||||
|
* the convention of prepending an underscore to non-ANSI library function
|
||||||
|
* names).
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _TCHAR_H_
|
||||||
|
#define _TCHAR_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: This tests _UNICODE, which is different from the UNICODE define
|
||||||
|
* used to differentiate Win32 API calls.
|
||||||
|
*/
|
||||||
|
#ifdef _UNICODE
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use TCHAR instead of char or wchar_t. It will be appropriately translated
|
||||||
|
* if _UNICODE is correctly defined (or not).
|
||||||
|
*/
|
||||||
|
#ifndef _TCHAR_DEFINED
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
typedef wchar_t TCHAR;
|
||||||
|
typedef wchar_t _TCHAR;
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
#define _TCHAR_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* __TEXT is a private macro whose specific use is to force the expansion of a
|
||||||
|
* macro passed as an argument to the macros _T or _TEXT. DO NOT use this
|
||||||
|
* macro within your programs. It's name and function could change without
|
||||||
|
* notice.
|
||||||
|
*/
|
||||||
|
#define __TEXT(x) L##x
|
||||||
|
|
||||||
|
/* for porting from other Windows compilers */
|
||||||
|
#if 0 // no wide startup module
|
||||||
|
#define _tmain wmain
|
||||||
|
#define _tWinMain wWinMain
|
||||||
|
#define _tenviron _wenviron
|
||||||
|
#define __targv __wargv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Unicode functions
|
||||||
|
*/
|
||||||
|
#define _tprintf wprintf
|
||||||
|
#define _ftprintf fwprintf
|
||||||
|
#define _stprintf swprintf
|
||||||
|
#define _sntprintf _snwprintf
|
||||||
|
#define _vtprintf vwprintf
|
||||||
|
#define _vftprintf vfwprintf
|
||||||
|
#define _vstprintf vswprintf
|
||||||
|
#define _vsntprintf _vsnwprintf
|
||||||
|
#define _tscanf wscanf
|
||||||
|
#define _ftscanf fwscanf
|
||||||
|
#define _stscanf swscanf
|
||||||
|
#define _fgettc fgetwc
|
||||||
|
#define _fgettchar _fgetwchar
|
||||||
|
#define _fgetts fgetws
|
||||||
|
#define _fputtc fputwc
|
||||||
|
#define _fputtchar _fputwchar
|
||||||
|
#define _fputts fputws
|
||||||
|
#define _gettc getwc
|
||||||
|
#define _getts getws
|
||||||
|
#define _puttc putwc
|
||||||
|
#define _putts putws
|
||||||
|
#define _ungettc ungetwc
|
||||||
|
#define _tcstod wcstod
|
||||||
|
#define _tcstol wcstol
|
||||||
|
#define _tcstoul wcstoul
|
||||||
|
#define _itot _itow
|
||||||
|
#define _ltot _ltow
|
||||||
|
#define _ultot _ultow
|
||||||
|
#define _ttoi _wtoi
|
||||||
|
#define _ttol _wtol
|
||||||
|
#define _tcscat wcscat
|
||||||
|
#define _tcschr wcschr
|
||||||
|
#define _tcscmp wcscmp
|
||||||
|
#define _tcscpy wcscpy
|
||||||
|
#define _tcscspn wcscspn
|
||||||
|
#define _tcslen wcslen
|
||||||
|
#define _tcsncat wcsncat
|
||||||
|
#define _tcsncmp wcsncmp
|
||||||
|
#define _tcsncpy wcsncpy
|
||||||
|
#define _tcspbrk wcspbrk
|
||||||
|
#define _tcsrchr wcsrchr
|
||||||
|
#define _tcsspn wcsspn
|
||||||
|
#define _tcsstr wcsstr
|
||||||
|
#define _tcstok wcstok
|
||||||
|
#define _tcsdup _wcsdup
|
||||||
|
#define _tcsicmp _wcsicmp
|
||||||
|
#define _tcsnicmp _wcsnicmp
|
||||||
|
#define _tcsnset _wcsnset
|
||||||
|
#define _tcsrev _wcsrev
|
||||||
|
#define _tcsset _wcsset
|
||||||
|
#define _tcslwr _wcslwr
|
||||||
|
#define _tcsupr _wcsupr
|
||||||
|
#define _tcsxfrm wcsxfrm
|
||||||
|
#define _tcscoll wcscoll
|
||||||
|
#define _tcsicoll _wcsicoll
|
||||||
|
#define _istalpha iswalpha
|
||||||
|
#define _istupper iswupper
|
||||||
|
#define _istlower iswlower
|
||||||
|
#define _istdigit iswdigit
|
||||||
|
#define _istxdigit iswxdigit
|
||||||
|
#define _istspace iswspace
|
||||||
|
#define _istpunct iswpunct
|
||||||
|
#define _istalnum iswalnum
|
||||||
|
#define _istprint iswprint
|
||||||
|
#define _istgraph iswgraph
|
||||||
|
#define _istcntrl iswcntrl
|
||||||
|
#define _istascii iswascii
|
||||||
|
#define _totupper towupper
|
||||||
|
#define _totlower towlower
|
||||||
|
#define _tcsftime wcsftime
|
||||||
|
/* Macro functions */
|
||||||
|
#define _tcsdec _wcsdec
|
||||||
|
#define _tcsinc _wcsinc
|
||||||
|
#define _tcsnbcnt _wcsncnt
|
||||||
|
#define _tcsnccnt _wcsncnt
|
||||||
|
#define _tcsnextc _wcsnextc
|
||||||
|
#define _tcsninc _wcsninc
|
||||||
|
#define _tcsspnp _wcsspnp
|
||||||
|
#define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1)
|
||||||
|
#define _wcsinc(_wcs) ((_wcs)+1)
|
||||||
|
#define _wcsnextc(_wcs) ((unsigned int) *(_wcs))
|
||||||
|
#define _wcsninc(_wcs, _inc) (((_wcs)+(_inc)))
|
||||||
|
#define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs))
|
||||||
|
#define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL)
|
||||||
|
|
||||||
|
#if 1 // defined __MSVCRT__
|
||||||
|
/*
|
||||||
|
* These wide functions not in crtdll.dll.
|
||||||
|
* Define macros anyway so that _wfoo rather than _tfoo is undefined
|
||||||
|
*/
|
||||||
|
#define _ttoi64 _wtoi64
|
||||||
|
#define _i64tot _i64tow
|
||||||
|
#define _ui64tot _ui64tow
|
||||||
|
#define _tasctime _wasctime
|
||||||
|
#define _tctime _wctime
|
||||||
|
#define _tstrdate _wstrdate
|
||||||
|
#define _tstrtime _wstrtime
|
||||||
|
#define _tutime _wutime
|
||||||
|
#define _tcsnccoll _wcsncoll
|
||||||
|
#define _tcsncoll _wcsncoll
|
||||||
|
#define _tcsncicoll _wcsnicoll
|
||||||
|
#define _tcsnicoll _wcsnicoll
|
||||||
|
#define _taccess _waccess
|
||||||
|
#define _tchmod _wchmod
|
||||||
|
#define _tcreat _wcreat
|
||||||
|
#define _tfindfirst _wfindfirst
|
||||||
|
#define _tfindnext _wfindnext
|
||||||
|
#define _tfopen _wfopen
|
||||||
|
#define _tgetenv _wgetenv
|
||||||
|
#define _tmktemp _wmktemp
|
||||||
|
#define _topen _wopen
|
||||||
|
#define _tremove _wremove
|
||||||
|
#define _trename _wrename
|
||||||
|
#define _tsopen _wsopen
|
||||||
|
#define _tsetlocale _wsetlocale
|
||||||
|
#define _tunlink _wunlink
|
||||||
|
#define _tfinddata_t _wfinddata_t
|
||||||
|
#define _tfindfirsti64 _wfindfirsti64
|
||||||
|
#define _tfindnexti64 _wfindnexti64
|
||||||
|
#define _tfinddatai64_t _wfinddatai64_t
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
|
||||||
|
#else /* Not _UNICODE */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TCHAR, the type you should use instead of char.
|
||||||
|
*/
|
||||||
|
#ifndef _TCHAR_DEFINED
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
typedef char TCHAR;
|
||||||
|
typedef char _TCHAR;
|
||||||
|
#endif
|
||||||
|
#define _TCHAR_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* __TEXT is a private macro whose specific use is to force the expansion of a
|
||||||
|
* macro passed as an argument to the macros _T or _TEXT. DO NOT use this
|
||||||
|
* macro within your programs. It's name and function could change without
|
||||||
|
* notice.
|
||||||
|
*/
|
||||||
|
#define __TEXT(x) x
|
||||||
|
|
||||||
|
/* for porting from other Windows compilers */
|
||||||
|
#define _tmain main
|
||||||
|
#define _tWinMain WinMain
|
||||||
|
#define _tenviron _environ
|
||||||
|
#define __targv __argv
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Non-unicode (standard) functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _tprintf printf
|
||||||
|
#define _ftprintf fprintf
|
||||||
|
#define _stprintf sprintf
|
||||||
|
#define _sntprintf _snprintf
|
||||||
|
#define _vtprintf vprintf
|
||||||
|
#define _vftprintf vfprintf
|
||||||
|
#define _vstprintf vsprintf
|
||||||
|
#define _vsntprintf _vsnprintf
|
||||||
|
#define _tscanf scanf
|
||||||
|
#define _ftscanf fscanf
|
||||||
|
#define _stscanf sscanf
|
||||||
|
#define _fgettc fgetc
|
||||||
|
#define _fgettchar _fgetchar
|
||||||
|
#define _fgetts fgets
|
||||||
|
#define _fputtc fputc
|
||||||
|
#define _fputtchar _fputchar
|
||||||
|
#define _fputts fputs
|
||||||
|
#define _tfopen fopen
|
||||||
|
#define _tgetenv getenv
|
||||||
|
#define _gettc getc
|
||||||
|
#define _getts gets
|
||||||
|
#define _puttc putc
|
||||||
|
#define _putts puts
|
||||||
|
#define _ungettc ungetc
|
||||||
|
#define _tcstod strtod
|
||||||
|
#define _tcstol strtol
|
||||||
|
#define _tcstoul strtoul
|
||||||
|
#define _itot _itoa
|
||||||
|
#define _ltot _ltoa
|
||||||
|
#define _ultot _ultoa
|
||||||
|
#define _ttoi atoi
|
||||||
|
#define _ttol atol
|
||||||
|
#define _tcscat strcat
|
||||||
|
#define _tcschr strchr
|
||||||
|
#define _tcscmp strcmp
|
||||||
|
#define _tcscpy strcpy
|
||||||
|
#define _tcscspn strcspn
|
||||||
|
#define _tcslen strlen
|
||||||
|
#define _tcsncat strncat
|
||||||
|
#define _tcsncmp strncmp
|
||||||
|
#define _tcsncpy strncpy
|
||||||
|
#define _tcspbrk strpbrk
|
||||||
|
#define _tcsrchr strrchr
|
||||||
|
#define _tcsspn strspn
|
||||||
|
#define _tcsstr strstr
|
||||||
|
#define _tcstok strtok
|
||||||
|
#define _tcsdup _strdup
|
||||||
|
#define _tcsicmp _stricmp
|
||||||
|
#define _tcsnicmp _strnicmp
|
||||||
|
#define _tcsnset _strnset
|
||||||
|
#define _tcsrev _strrev
|
||||||
|
#define _tcsset _strset
|
||||||
|
#define _tcslwr _strlwr
|
||||||
|
#define _tcsupr _strupr
|
||||||
|
#define _tcsxfrm strxfrm
|
||||||
|
#define _tcscoll strcoll
|
||||||
|
#define _tcsicoll _stricoll
|
||||||
|
#define _istalpha isalpha
|
||||||
|
#define _istupper isupper
|
||||||
|
#define _istlower islower
|
||||||
|
#define _istdigit isdigit
|
||||||
|
#define _istxdigit isxdigit
|
||||||
|
#define _istspace isspace
|
||||||
|
#define _istpunct ispunct
|
||||||
|
#define _istalnum isalnum
|
||||||
|
#define _istprint isprint
|
||||||
|
#define _istgraph isgraph
|
||||||
|
#define _istcntrl iscntrl
|
||||||
|
#define _istascii isascii
|
||||||
|
#define _totupper toupper
|
||||||
|
#define _totlower tolower
|
||||||
|
#define _tasctime asctime
|
||||||
|
#define _tctime ctime
|
||||||
|
#define _tstrdate _strdate
|
||||||
|
#define _tstrtime _strtime
|
||||||
|
#define _tutime _utime
|
||||||
|
#define _tcsftime strftime
|
||||||
|
/* Macro functions */
|
||||||
|
#define _tcsdec _strdec
|
||||||
|
#define _tcsinc _strinc
|
||||||
|
#define _tcsnbcnt _strncnt
|
||||||
|
#define _tcsnccnt _strncnt
|
||||||
|
#define _tcsnextc _strnextc
|
||||||
|
#define _tcsninc _strninc
|
||||||
|
#define _tcsspnp _strspnp
|
||||||
|
#define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1)
|
||||||
|
#define _strinc(_str) ((_str)+1)
|
||||||
|
#define _strnextc(_str) ((unsigned int) *(_str))
|
||||||
|
#define _strninc(_str, _inc) (((_str)+(_inc)))
|
||||||
|
#define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str))
|
||||||
|
#define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL)
|
||||||
|
|
||||||
|
#define _tchmod _chmod
|
||||||
|
#define _tcreat _creat
|
||||||
|
#define _tfindfirst _findfirst
|
||||||
|
#define _tfindnext _findnext
|
||||||
|
#define _tmktemp _mktemp
|
||||||
|
#define _topen _open
|
||||||
|
#define _taccess _access
|
||||||
|
#define _tremove remove
|
||||||
|
#define _trename rename
|
||||||
|
#define _tsopen _sopen
|
||||||
|
#define _tsetlocale setlocale
|
||||||
|
#define _tunlink _unlink
|
||||||
|
#define _tfinddata_t _finddata_t
|
||||||
|
|
||||||
|
|
||||||
|
#if 1 // defined __MSVCRT__
|
||||||
|
/* Not in crtdll.dll. Define macros anyway? */
|
||||||
|
#define _ttoi64 _atoi64
|
||||||
|
#define _i64tot _i64toa
|
||||||
|
#define _ui64tot _ui64toa
|
||||||
|
#define _tcsnccoll _strncoll
|
||||||
|
#define _tcsncoll _strncoll
|
||||||
|
#define _tcsncicoll _strnicoll
|
||||||
|
#define _tcsnicoll _strnicoll
|
||||||
|
#define _tfindfirsti64 _findfirsti64
|
||||||
|
#define _tfindnexti64 _findnexti64
|
||||||
|
#define _tfinddatai64_t _finddatai64_t
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
|
||||||
|
#endif /* Not _UNICODE */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* UNICODE a constant string when _UNICODE is defined else returns the string
|
||||||
|
* unmodified. Also defined in w32api/winnt.h.
|
||||||
|
*/
|
||||||
|
#define _TEXT(x) __TEXT(x)
|
||||||
|
#define _T(x) __TEXT(x)
|
||||||
|
|
||||||
|
#endif /* Not _TCHAR_H_ */
|
||||||
|
|
||||||
219
bazaar/Tcc/lib/include/time.h
Normal file
219
bazaar/Tcc/lib/include/time.h
Normal file
|
|
@ -0,0 +1,219 @@
|
||||||
|
/*
|
||||||
|
* time.h
|
||||||
|
*
|
||||||
|
* Date and time functions and types.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _TIME_H_
|
||||||
|
#define _TIME_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define __need_wchar_t
|
||||||
|
#define __need_size_t
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Need a definition of time_t.
|
||||||
|
*/
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Number of clock ticks per second. A clock tick is the unit by which
|
||||||
|
* processor time is measured and is returned by 'clock'.
|
||||||
|
*/
|
||||||
|
#define CLOCKS_PER_SEC ((clock_t)1000)
|
||||||
|
#define CLK_TCK CLOCKS_PER_SEC
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A type for storing the current time and date. This is the number of
|
||||||
|
* seconds since midnight Jan 1, 1970.
|
||||||
|
* NOTE: Normally this is defined by the above include of sys/types.h
|
||||||
|
*/
|
||||||
|
#ifndef _TIME_T_DEFINED
|
||||||
|
typedef long time_t;
|
||||||
|
#define _TIME_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A type for measuring processor time (in clock ticks).
|
||||||
|
*/
|
||||||
|
#ifndef _CLOCK_T_DEFINED
|
||||||
|
typedef long clock_t;
|
||||||
|
#define _CLOCK_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A structure for storing all kinds of useful information about the
|
||||||
|
* current (or another) time.
|
||||||
|
*/
|
||||||
|
struct tm
|
||||||
|
{
|
||||||
|
int tm_sec; /* Seconds: 0-59 (K&R says 0-61?) */
|
||||||
|
int tm_min; /* Minutes: 0-59 */
|
||||||
|
int tm_hour; /* Hours since midnight: 0-23 */
|
||||||
|
int tm_mday; /* Day of the month: 1-31 */
|
||||||
|
int tm_mon; /* Months *since* january: 0-11 */
|
||||||
|
int tm_year; /* Years since 1900 */
|
||||||
|
int tm_wday; /* Days since Sunday (0-6) */
|
||||||
|
int tm_yday; /* Days since Jan. 1: 0-365 */
|
||||||
|
int tm_isdst; /* +1 Daylight Savings Time, 0 No DST,
|
||||||
|
* -1 don't know */
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
clock_t clock (void);
|
||||||
|
time_t time (time_t*);
|
||||||
|
double difftime (time_t, time_t);
|
||||||
|
time_t mktime (struct tm*);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These functions write to and return pointers to static buffers that may
|
||||||
|
* be overwritten by other function calls. Yikes!
|
||||||
|
*
|
||||||
|
* NOTE: localtime, and perhaps the others of the four functions grouped
|
||||||
|
* below may return NULL if their argument is not 'acceptable'. Also note
|
||||||
|
* that calling asctime with a NULL pointer will produce an Invalid Page
|
||||||
|
* Fault and crap out your program. Guess how I know. Hint: stat called on
|
||||||
|
* a directory gives 'invalid' times in st_atime etc...
|
||||||
|
*/
|
||||||
|
char* asctime (const struct tm*);
|
||||||
|
char* ctime (const time_t*);
|
||||||
|
struct tm* gmtime (const time_t*);
|
||||||
|
struct tm* localtime (const time_t*);
|
||||||
|
|
||||||
|
|
||||||
|
size_t strftime (char*, size_t, const char*, const struct tm*);
|
||||||
|
|
||||||
|
size_t wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
extern void _tzset (void);
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
extern void tzset (void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
size_t strftime(char*, size_t, const char*, const struct tm*);
|
||||||
|
char* _strdate(char*);
|
||||||
|
char* _strtime(char*);
|
||||||
|
|
||||||
|
#endif /* Not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* _daylight: non zero if daylight savings time is used.
|
||||||
|
* _timezone: difference in seconds between GMT and local time.
|
||||||
|
* _tzname: standard/daylight savings time zone names (an array with two
|
||||||
|
* elements).
|
||||||
|
*/
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
|
||||||
|
/* These are for compatibility with pre-VC 5.0 suppied MSVCRT. */
|
||||||
|
extern int* __p__daylight (void);
|
||||||
|
extern long* __p__timezone (void);
|
||||||
|
extern char** __p__tzname (void);
|
||||||
|
|
||||||
|
__MINGW_IMPORT int _daylight;
|
||||||
|
__MINGW_IMPORT long _timezone;
|
||||||
|
__MINGW_IMPORT char *_tzname[2];
|
||||||
|
|
||||||
|
#else /* not __MSVCRT (ie. crtdll) */
|
||||||
|
|
||||||
|
#ifndef __DECLSPEC_SUPPORTED
|
||||||
|
|
||||||
|
extern int* __imp__daylight_dll;
|
||||||
|
extern long* __imp__timezone_dll;
|
||||||
|
extern char** __imp__tzname;
|
||||||
|
|
||||||
|
#define _daylight (*__imp__daylight_dll)
|
||||||
|
#define _timezone (*__imp__timezone_dll)
|
||||||
|
#define _tzname (__imp__tzname)
|
||||||
|
|
||||||
|
#else /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
__MINGW_IMPORT int _daylight_dll;
|
||||||
|
__MINGW_IMPORT long _timezone_dll;
|
||||||
|
__MINGW_IMPORT char* _tzname[2];
|
||||||
|
|
||||||
|
#define _daylight _daylight_dll
|
||||||
|
#define _timezone _timezone_dll
|
||||||
|
|
||||||
|
#endif /* __DECLSPEC_SUPPORTED */
|
||||||
|
|
||||||
|
#endif /* not __MSVCRT__ */
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
|
||||||
|
/* These go in the oldnames import library for MSVCRT. */
|
||||||
|
__MINGW_IMPORT int daylight;
|
||||||
|
__MINGW_IMPORT long timezone;
|
||||||
|
__MINGW_IMPORT char *tzname[2];
|
||||||
|
|
||||||
|
#ifndef _WTIME_DEFINED
|
||||||
|
|
||||||
|
/* wide function prototypes, also declared in wchar.h */
|
||||||
|
|
||||||
|
wchar_t * _wasctime(const struct tm*);
|
||||||
|
wchar_t * _wctime(const time_t*);
|
||||||
|
wchar_t* _wstrdate(wchar_t*);
|
||||||
|
wchar_t* _wstrtime(wchar_t*);
|
||||||
|
|
||||||
|
#define _WTIME_DEFINED
|
||||||
|
#endif /* _WTIME_DEFINED */
|
||||||
|
|
||||||
|
|
||||||
|
#else /* not __MSVCRT__ */
|
||||||
|
|
||||||
|
/* CRTDLL is royally messed up when it comes to these macros.
|
||||||
|
TODO: import and alias these via oldnames import library instead
|
||||||
|
of macros. */
|
||||||
|
|
||||||
|
#define daylight _daylight
|
||||||
|
/* NOTE: timezone not defined because it would conflict with sys/timeb.h.
|
||||||
|
Also, tzname used to a be macro, but now it's in moldname. */
|
||||||
|
__MINGW_IMPORT char *tzname[2];
|
||||||
|
|
||||||
|
#endif /* not __MSVCRT__ */
|
||||||
|
|
||||||
|
#endif /* Not _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _TIME_H_ */
|
||||||
|
|
||||||
10
bazaar/Tcc/lib/include/unistd.h
Normal file
10
bazaar/Tcc/lib/include/unistd.h
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* unistd.h maps (roughly) to io.h
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
4
bazaar/Tcc/lib/include/values.h
Normal file
4
bazaar/Tcc/lib/include/values.h
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
/*
|
||||||
|
* TODO: Nothing here yet. Should provide UNIX compatibility constants
|
||||||
|
* comparible to those in limits.h and float.h.
|
||||||
|
*/
|
||||||
11
bazaar/Tcc/lib/include/varargs.h
Normal file
11
bazaar/Tcc/lib/include/varargs.h
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#ifndef _VARARGS_H
|
||||||
|
#define _VARARGS_H
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#define va_dcl
|
||||||
|
#define va_alist __va_alist
|
||||||
|
#undef va_start
|
||||||
|
#define va_start(ap) ap = __builtin_varargs_start
|
||||||
|
|
||||||
|
#endif
|
||||||
318
bazaar/Tcc/lib/include/wchar.h
Normal file
318
bazaar/Tcc/lib/include/wchar.h
Normal file
|
|
@ -0,0 +1,318 @@
|
||||||
|
/*
|
||||||
|
* wchar.h
|
||||||
|
*
|
||||||
|
* Defines of all functions for supporting wide characters. Actually it
|
||||||
|
* just includes all those headers, which is not a good thing to do from a
|
||||||
|
* processing time point of view, but it does mean that everything will be
|
||||||
|
* in sync.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
* $Author: bellard $
|
||||||
|
* $Date: 2005/04/17 13:14:29 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _WCHAR_H_
|
||||||
|
#define _WCHAR_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#define __need_size_t
|
||||||
|
#define __need_wint_t
|
||||||
|
#define __need_wchar_t
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#define WCHAR_MIN 0
|
||||||
|
#define WCHAR_MAX ((wchar_t)-1)
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
|
|
||||||
|
#ifndef _FSIZE_T_DEFINED
|
||||||
|
typedef unsigned long _fsize_t;
|
||||||
|
#define _FSIZE_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WFINDDATA_T_DEFINED
|
||||||
|
struct _wfinddata_t {
|
||||||
|
unsigned attrib;
|
||||||
|
time_t time_create; /* -1 for FAT file systems */
|
||||||
|
time_t time_access; /* -1 for FAT file systems */
|
||||||
|
time_t time_write;
|
||||||
|
_fsize_t size;
|
||||||
|
wchar_t name[FILENAME_MAX]; /* may include spaces. */
|
||||||
|
};
|
||||||
|
struct _wfinddatai64_t {
|
||||||
|
unsigned attrib;
|
||||||
|
time_t time_create;
|
||||||
|
time_t time_access;
|
||||||
|
time_t time_write;
|
||||||
|
__int64 size;
|
||||||
|
wchar_t name[FILENAME_MAX];
|
||||||
|
};
|
||||||
|
#define _WFINDDATA_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Wide character versions. Also defined in io.h. */
|
||||||
|
/* CHECK: I believe these only exist in MSVCRT, and not in CRTDLL. Also
|
||||||
|
applies to other wide character versions? */
|
||||||
|
#if !defined (_WIO_DEFINED)
|
||||||
|
#if defined (__MSVCRT__)
|
||||||
|
int _waccess (const wchar_t*, int);
|
||||||
|
int _wchmod (const wchar_t*, int);
|
||||||
|
int _wcreat (const wchar_t*, int);
|
||||||
|
long _wfindfirst (wchar_t*, struct _wfinddata_t *);
|
||||||
|
int _wfindnext (long, struct _wfinddata_t *);
|
||||||
|
int _wunlink (const wchar_t*);
|
||||||
|
int _wopen (const wchar_t*, int, ...);
|
||||||
|
int _wsopen (const wchar_t*, int, int, ...);
|
||||||
|
wchar_t* _wmktemp (wchar_t*);
|
||||||
|
long _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*);
|
||||||
|
int _wfindnexti64 (long, struct _wfinddatai64_t*);
|
||||||
|
#endif /* defined (__MSVCRT__) */
|
||||||
|
#define _WIO_DEFINED
|
||||||
|
#endif /* _WIO_DEFINED */
|
||||||
|
|
||||||
|
#ifndef _WSTDIO_DEFINED
|
||||||
|
/* also in stdio.h - keep in sync */
|
||||||
|
int fwprintf (FILE*, const wchar_t*, ...);
|
||||||
|
int wprintf (const wchar_t*, ...);
|
||||||
|
int swprintf (wchar_t*, const wchar_t*, ...);
|
||||||
|
int _snwprintf (wchar_t*, size_t, const wchar_t*, ...);
|
||||||
|
int vfwprintf (FILE*, const wchar_t*, va_list);
|
||||||
|
int vwprintf (const wchar_t*, va_list);
|
||||||
|
int vswprintf (wchar_t*, const wchar_t*, va_list);
|
||||||
|
int _vsnwprintf (wchar_t*, size_t, const wchar_t*, va_list);
|
||||||
|
int fwscanf (FILE*, const wchar_t*, ...);
|
||||||
|
int wscanf (const wchar_t*, ...);
|
||||||
|
int swscanf (const wchar_t*, const wchar_t*, ...);
|
||||||
|
wint_t fgetwc (FILE*);
|
||||||
|
wint_t fputwc (wchar_t, FILE*);
|
||||||
|
wint_t ungetwc (wchar_t, FILE*);
|
||||||
|
|
||||||
|
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
|
||||||
|
int snwprintf(wchar_t* s, size_t n, const wchar_t* format, ...);
|
||||||
|
extern inline int vsnwprintf (wchar_t* s, size_t n, const wchar_t* format,
|
||||||
|
va_list arg)
|
||||||
|
{ return _vsnwprintf ( s, n, format, arg); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
wchar_t* fgetws (wchar_t*, int, FILE*);
|
||||||
|
int fputws (const wchar_t*, FILE*);
|
||||||
|
wint_t getwc (FILE*);
|
||||||
|
wint_t getwchar (void);
|
||||||
|
wchar_t* _getws (wchar_t*);
|
||||||
|
wint_t putwc (wint_t, FILE*);
|
||||||
|
int _putws (const wchar_t*);
|
||||||
|
wint_t putwchar (wint_t);
|
||||||
|
|
||||||
|
FILE* _wfopen (const wchar_t*, const wchar_t*);
|
||||||
|
FILE* _wfreopen (const wchar_t*, const wchar_t*, FILE*);
|
||||||
|
FILE* _wfsopen (const wchar_t*, const wchar_t*, int);
|
||||||
|
wchar_t* _wtmpnam (wchar_t*);
|
||||||
|
wchar_t* _wtempnam (const wchar_t*, const wchar_t*);
|
||||||
|
int _wrename (const wchar_t*, const wchar_t*);
|
||||||
|
int _wremove (const wchar_t*)
|
||||||
|
|
||||||
|
FILE* _wpopen (const wchar_t*, const wchar_t*)
|
||||||
|
void _wperror (const wchar_t*);
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
#define _WSTDIO_DEFINED
|
||||||
|
#endif /* _WSTDIO_DEFINED */
|
||||||
|
|
||||||
|
#ifndef _WDIRECT_DEFINED
|
||||||
|
/* Also in direct.h */
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
int _wchdir (const wchar_t*);
|
||||||
|
wchar_t* _wgetcwd (wchar_t*, int);
|
||||||
|
wchar_t* _wgetdcwd (int, wchar_t*, int);
|
||||||
|
int _wmkdir (const wchar_t*);
|
||||||
|
int _wrmdir (const wchar_t*);
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
#define _WDIRECT_DEFINED
|
||||||
|
#endif /* _WDIRECT_DEFINED */
|
||||||
|
|
||||||
|
#ifndef _STAT_DEFINED
|
||||||
|
/*
|
||||||
|
* The structure manipulated and returned by stat and fstat.
|
||||||
|
*
|
||||||
|
* NOTE: If called on a directory the values in the time fields are not only
|
||||||
|
* invalid, they will cause localtime et. al. to return NULL. And calling
|
||||||
|
* asctime with a NULL pointer causes an Invalid Page Fault. So watch it!
|
||||||
|
*/
|
||||||
|
struct _stat
|
||||||
|
{
|
||||||
|
_dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
|
||||||
|
_ino_t st_ino; /* Always zero ? */
|
||||||
|
_mode_t st_mode; /* See above constants */
|
||||||
|
short st_nlink; /* Number of links. */
|
||||||
|
short st_uid; /* User: Maybe significant on NT ? */
|
||||||
|
short st_gid; /* Group: Ditto */
|
||||||
|
_dev_t st_rdev; /* Seems useless (not even filled in) */
|
||||||
|
_off_t st_size; /* File size in bytes */
|
||||||
|
time_t st_atime; /* Accessed date (always 00:00 hrs local
|
||||||
|
* on FAT) */
|
||||||
|
time_t st_mtime; /* Modified time */
|
||||||
|
time_t st_ctime; /* Creation time */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct stat
|
||||||
|
{
|
||||||
|
_dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
|
||||||
|
_ino_t st_ino; /* Always zero ? */
|
||||||
|
_mode_t st_mode; /* See above constants */
|
||||||
|
short st_nlink; /* Number of links. */
|
||||||
|
short st_uid; /* User: Maybe significant on NT ? */
|
||||||
|
short st_gid; /* Group: Ditto */
|
||||||
|
_dev_t st_rdev; /* Seems useless (not even filled in) */
|
||||||
|
_off_t st_size; /* File size in bytes */
|
||||||
|
time_t st_atime; /* Accessed date (always 00:00 hrs local
|
||||||
|
* on FAT) */
|
||||||
|
time_t st_mtime; /* Modified time */
|
||||||
|
time_t st_ctime; /* Creation time */
|
||||||
|
};
|
||||||
|
#if defined (__MSVCRT__)
|
||||||
|
struct _stati64 {
|
||||||
|
_dev_t st_dev;
|
||||||
|
_ino_t st_ino;
|
||||||
|
unsigned short st_mode;
|
||||||
|
short st_nlink;
|
||||||
|
short st_uid;
|
||||||
|
short st_gid;
|
||||||
|
_dev_t st_rdev;
|
||||||
|
__int64 st_size;
|
||||||
|
time_t st_atime;
|
||||||
|
time_t st_mtime;
|
||||||
|
time_t st_ctime;
|
||||||
|
};
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
#define _STAT_DEFINED
|
||||||
|
#endif /* _STAT_DEFINED */
|
||||||
|
|
||||||
|
#if !defined ( _WSTAT_DEFINED)
|
||||||
|
/* also declared in sys/stat.h */
|
||||||
|
#if defined __MSVCRT__
|
||||||
|
int _wstat (const wchar_t*, struct _stat*);
|
||||||
|
int _wstati64 (const wchar_t*, struct _stati64*);
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
#define _WSTAT_DEFINED
|
||||||
|
#endif /* ! _WSTAT_DEFIND */
|
||||||
|
|
||||||
|
#ifndef _WTIME_DEFINED
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
/* wide function prototypes, also declared in time.h */
|
||||||
|
wchar_t* _wasctime (const struct tm*);
|
||||||
|
wchar_t* _wctime (const time_t*);
|
||||||
|
wchar_t* _wstrdate (wchar_t*);
|
||||||
|
wchar_t* _wstrtime (wchar_t*);
|
||||||
|
#endif /* __MSVCRT__ */
|
||||||
|
size_t wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
|
||||||
|
#define _WTIME_DEFINED
|
||||||
|
#endif /* _WTIME_DEFINED */
|
||||||
|
|
||||||
|
#ifndef _WLOCALE_DEFINED /* also declared in locale.h */
|
||||||
|
wchar_t* _wsetlocale (int, const wchar_t*);
|
||||||
|
#define _WLOCALE_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WSTDLIB_DEFINED /* also declared in stdlib.h */
|
||||||
|
long wcstol (const wchar_t*, wchar_t**, int);
|
||||||
|
unsigned long wcstoul (const wchar_t*, wchar_t**, int);
|
||||||
|
double wcstod (const wchar_t*, wchar_t**);
|
||||||
|
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
|
||||||
|
extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr)
|
||||||
|
{ return (wcstod(nptr, endptr)); }
|
||||||
|
#endif /* __NO_ISOCEXT */
|
||||||
|
#define _WSTDLIB_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _NO_OLDNAMES
|
||||||
|
|
||||||
|
/* Wide character versions. Also declared in io.h. */
|
||||||
|
/* CHECK: Are these in the oldnames??? NO! */
|
||||||
|
#if (0)
|
||||||
|
int waccess (const wchar_t *, int);
|
||||||
|
int wchmod (const wchar_t *, int);
|
||||||
|
int wcreat (const wchar_t *, int);
|
||||||
|
long wfindfirst (wchar_t *, struct _wfinddata_t *);
|
||||||
|
int wfindnext (long, struct _wfinddata_t *);
|
||||||
|
int wunlink (const wchar_t *);
|
||||||
|
int wrename (const wchar_t *, const wchar_t *);
|
||||||
|
int wremove (const wchar_t *);
|
||||||
|
int wopen (const wchar_t *, int, ...);
|
||||||
|
int wsopen (const wchar_t *, int, int, ...);
|
||||||
|
wchar_t* wmktemp (wchar_t *);
|
||||||
|
#endif
|
||||||
|
#endif /* _NO_OLDNAMES */
|
||||||
|
|
||||||
|
#endif /* not __STRICT_ANSI__ */
|
||||||
|
|
||||||
|
/* These are resolved by -lmsvcp60 */
|
||||||
|
/* If you don't have msvcp60.dll in your windows system directory, you can
|
||||||
|
easily obtain it with a search from your favorite search engine. */
|
||||||
|
typedef int mbstate_t;
|
||||||
|
typedef wchar_t _Wint_t;
|
||||||
|
|
||||||
|
wint_t btowc(int);
|
||||||
|
size_t mbrlen(const char *, size_t, mbstate_t *);
|
||||||
|
size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
|
||||||
|
size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *);
|
||||||
|
|
||||||
|
size_t wcrtomb(char *, wchar_t, mbstate_t *);
|
||||||
|
size_t wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *);
|
||||||
|
int wctob(wint_t);
|
||||||
|
|
||||||
|
#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */
|
||||||
|
extern inline int fwide(FILE* stream, int mode) {return -1;} /* limited to byte orientation */
|
||||||
|
extern inline int mbsinit(const mbstate_t* ps) {return 1;}
|
||||||
|
wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);
|
||||||
|
wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n);
|
||||||
|
int wmemcmp(const wchar_t* s1, const wchar_t * s2, size_t n);
|
||||||
|
wchar_t* wmemcpy(wchar_t* __restrict__ s1, const wchar_t* __restrict__ s2,
|
||||||
|
size_t n);
|
||||||
|
wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);
|
||||||
|
long long wcstoll(const wchar_t* __restrict__ nptr,
|
||||||
|
wchar_t** __restrict__ endptr, int base);
|
||||||
|
unsigned long long wcstoull(const wchar_t* __restrict__ nptr,
|
||||||
|
wchar_t ** __restrict__ endptr, int base);
|
||||||
|
|
||||||
|
#endif /* __NO_ISOCEXT */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* end of extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* not _WCHAR_H_ */
|
||||||
|
|
||||||
127
bazaar/Tcc/lib/include/wctype.h
Normal file
127
bazaar/Tcc/lib/include/wctype.h
Normal file
|
|
@ -0,0 +1,127 @@
|
||||||
|
/*
|
||||||
|
* wctype.h
|
||||||
|
*
|
||||||
|
* Functions for testing wide character types and converting characters.
|
||||||
|
*
|
||||||
|
* This file is part of the Mingw32 package.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Created by Mumit Khan <khan@xraylith.wisc.edu>
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
*
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _WCTYPE_H_
|
||||||
|
#define _WCTYPE_H_
|
||||||
|
|
||||||
|
/* All the headers include this file. */
|
||||||
|
#include <_mingw.h>
|
||||||
|
|
||||||
|
#define __need_wchar_t
|
||||||
|
#define __need_wint_t
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following flags are used to tell iswctype and _isctype what character
|
||||||
|
* types you are looking for.
|
||||||
|
*/
|
||||||
|
#define _UPPER 0x0001
|
||||||
|
#define _LOWER 0x0002
|
||||||
|
#define _DIGIT 0x0004
|
||||||
|
#define _SPACE 0x0008
|
||||||
|
#define _PUNCT 0x0010
|
||||||
|
#define _CONTROL 0x0020
|
||||||
|
#define _BLANK 0x0040
|
||||||
|
#define _HEX 0x0080
|
||||||
|
#define _LEADBYTE 0x8000
|
||||||
|
|
||||||
|
#define _ALPHA 0x0103
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WEOF
|
||||||
|
#define WEOF (wchar_t)(0xFFFF)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WCTYPE_T_DEFINED
|
||||||
|
typedef wchar_t wctype_t;
|
||||||
|
#define _WCTYPE_T_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Wide character equivalents - also in ctype.h */
|
||||||
|
int iswalnum(wint_t);
|
||||||
|
int iswalpha(wint_t);
|
||||||
|
int iswascii(wint_t);
|
||||||
|
int iswcntrl(wint_t);
|
||||||
|
int iswctype(wint_t, wctype_t);
|
||||||
|
int is_wctype(wint_t, wctype_t); /* Obsolete! */
|
||||||
|
int iswdigit(wint_t);
|
||||||
|
int iswgraph(wint_t);
|
||||||
|
int iswlower(wint_t);
|
||||||
|
int iswprint(wint_t);
|
||||||
|
int iswpunct(wint_t);
|
||||||
|
int iswspace(wint_t);
|
||||||
|
int iswupper(wint_t);
|
||||||
|
int iswxdigit(wint_t);
|
||||||
|
|
||||||
|
wchar_t towlower(wchar_t);
|
||||||
|
wchar_t towupper(wchar_t);
|
||||||
|
|
||||||
|
int isleadbyte (int);
|
||||||
|
|
||||||
|
/* Also in ctype.h */
|
||||||
|
|
||||||
|
__MINGW_IMPORT unsigned short _ctype[];
|
||||||
|
#ifdef __MSVCRT__
|
||||||
|
__MINGW_IMPORT unsigned short* _pctype;
|
||||||
|
#else
|
||||||
|
__MINGW_IMPORT unsigned short* _pctype_dll;
|
||||||
|
#define _pctype _pctype_dll
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
|
||||||
|
#define __WCTYPE_INLINES_DEFINED
|
||||||
|
extern inline int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
|
||||||
|
extern inline int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
|
||||||
|
extern inline int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);}
|
||||||
|
extern inline int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
|
||||||
|
extern inline int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
|
||||||
|
extern inline int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
|
||||||
|
extern inline int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
|
||||||
|
extern inline int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
|
||||||
|
extern inline int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
|
||||||
|
extern inline int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
|
||||||
|
extern inline int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
|
||||||
|
extern inline int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
|
||||||
|
extern inline int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
|
||||||
|
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
|
||||||
|
|
||||||
|
|
||||||
|
typedef wchar_t wctrans_t;
|
||||||
|
wint_t towctrans(wint_t, wctrans_t);
|
||||||
|
wctrans_t wctrans(const char*);
|
||||||
|
wctype_t wctype(const char*);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* Not RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* Not _WCTYPE_H_ */
|
||||||
|
|
||||||
119
bazaar/Tcc/lib/include/winapi/basetsd.h
Normal file
119
bazaar/Tcc/lib/include/winapi/basetsd.h
Normal file
|
|
@ -0,0 +1,119 @@
|
||||||
|
#ifndef _BASETSD_H
|
||||||
|
#define _BASETSD_H
|
||||||
|
#if __GNUC__ >=3
|
||||||
|
#pragma GCC system_header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#ifndef __int64
|
||||||
|
#define __int64 long long
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN64)
|
||||||
|
#define __int3264 __int64
|
||||||
|
#define ADDRESS_TAG_BIT 0x40000000000UI64
|
||||||
|
#else /* !_WIN64 */
|
||||||
|
#define __int3264 __int32
|
||||||
|
#define ADDRESS_TAG_BIT 0x80000000UL
|
||||||
|
#define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) )
|
||||||
|
#define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )
|
||||||
|
#define LongToHandle( h) ((HANDLE)(LONG_PTR) (h))
|
||||||
|
#define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) )
|
||||||
|
#define PtrToLong( p ) ((LONG)(LONG_PTR) (p) )
|
||||||
|
#define PtrToUint( p ) ((UINT)(UINT_PTR) (p) )
|
||||||
|
#define PtrToInt( p ) ((INT)(INT_PTR) (p) )
|
||||||
|
#define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) )
|
||||||
|
#define PtrToShort( p ) ((short)(LONG_PTR)(p) )
|
||||||
|
#define IntToPtr( i ) ((VOID*)(INT_PTR)((int)i))
|
||||||
|
#define UIntToPtr( ui ) ((VOID*)(UINT_PTR)((unsigned int)ui))
|
||||||
|
#define LongToPtr( l ) ((VOID*)(LONG_PTR)((long)l))
|
||||||
|
#define ULongToPtr( ul ) ((VOID*)(ULONG_PTR)((unsigned long)ul))
|
||||||
|
#endif /* !_WIN64 */
|
||||||
|
|
||||||
|
#define UlongToPtr(ul) ULongToPtr(ul)
|
||||||
|
#define UintToPtr(ui) UIntToPtr(ui)
|
||||||
|
#define MAXUINT_PTR (~((UINT_PTR)0))
|
||||||
|
#define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1))
|
||||||
|
#define MININT_PTR (~MAXINT_PTR)
|
||||||
|
#define MAXULONG_PTR (~((ULONG_PTR)0))
|
||||||
|
#define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1))
|
||||||
|
#define MINLONG_PTR (~MAXLONG_PTR)
|
||||||
|
#define MAXUHALF_PTR ((UHALF_PTR)~0)
|
||||||
|
#define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1))
|
||||||
|
#define MINHALF_PTR (~MAXHALF_PTR)
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
typedef int LONG32, *PLONG32;
|
||||||
|
#ifndef XFree86Server
|
||||||
|
typedef int INT32, *PINT32;
|
||||||
|
#endif /* ndef XFree86Server */
|
||||||
|
typedef unsigned int ULONG32, *PULONG32;
|
||||||
|
typedef unsigned int DWORD32, *PDWORD32;
|
||||||
|
typedef unsigned int UINT32, *PUINT32;
|
||||||
|
|
||||||
|
#if defined(_WIN64)
|
||||||
|
typedef __int64 INT_PTR, *PINT_PTR;
|
||||||
|
typedef unsigned __int64 UINT_PTR, *PUINT_PTR;
|
||||||
|
typedef __int64 LONG_PTR, *PLONG_PTR;
|
||||||
|
typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
|
||||||
|
typedef unsigned __int64 HANDLE_PTR;
|
||||||
|
typedef unsigned int UHALF_PTR, *PUHALF_PTR;
|
||||||
|
typedef int HALF_PTR, *PHALF_PTR;
|
||||||
|
|
||||||
|
#if 0 /* TODO when WIN64 is here */
|
||||||
|
inline unsigned long HandleToUlong(const void* h )
|
||||||
|
{ return((unsigned long) h ); }
|
||||||
|
inline long HandleToLong( const void* h )
|
||||||
|
{ return((long) h ); }
|
||||||
|
inline void* LongToHandle( const long h )
|
||||||
|
{ return((void*) (INT_PTR) h ); }
|
||||||
|
inline unsigned long PtrToUlong( const void* p)
|
||||||
|
{ return((unsigned long) p ); }
|
||||||
|
inline unsigned int PtrToUint( const void* p )
|
||||||
|
{ return((unsigned int) p ); }
|
||||||
|
inline unsigned short PtrToUshort( const void* p )
|
||||||
|
{ return((unsigned short) p ); }
|
||||||
|
inline long PtrToLong( const void* p )
|
||||||
|
{ return((long) p ); }
|
||||||
|
inline int PtrToInt( const void* p )
|
||||||
|
{ return((int) p ); }
|
||||||
|
inline short PtrToShort( const void* p )
|
||||||
|
{ return((short) p ); }
|
||||||
|
inline void* IntToPtr( const int i )
|
||||||
|
{ return( (void*)(INT_PTR)i ); }
|
||||||
|
inline void* UIntToPtr(const unsigned int ui)
|
||||||
|
{ return( (void*)(UINT_PTR)ui ); }
|
||||||
|
inline void* LongToPtr( const long l )
|
||||||
|
{ return( (void*)(LONG_PTR)l ); }
|
||||||
|
inline void* ULongToPtr( const unsigned long ul )
|
||||||
|
{ return( (void*)(ULONG_PTR)ul ); }
|
||||||
|
#endif /* 0_ */
|
||||||
|
|
||||||
|
#else /* !_WIN64 */
|
||||||
|
typedef int INT_PTR, *PINT_PTR;
|
||||||
|
typedef unsigned int UINT_PTR, *PUINT_PTR;
|
||||||
|
typedef long LONG_PTR, *PLONG_PTR;
|
||||||
|
typedef unsigned long ULONG_PTR, *PULONG_PTR;
|
||||||
|
typedef unsigned short UHALF_PTR, *PUHALF_PTR;
|
||||||
|
typedef short HALF_PTR, *PHALF_PTR;
|
||||||
|
typedef unsigned long HANDLE_PTR;
|
||||||
|
#endif /* !_WIN64 */
|
||||||
|
|
||||||
|
typedef ULONG_PTR SIZE_T, *PSIZE_T;
|
||||||
|
typedef LONG_PTR SSIZE_T, *PSSIZE_T;
|
||||||
|
typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
|
||||||
|
typedef __int64 LONG64, *PLONG64;
|
||||||
|
typedef __int64 INT64, *PINT64;
|
||||||
|
typedef unsigned __int64 ULONG64, *PULONG64;
|
||||||
|
typedef unsigned __int64 DWORD64, *PDWORD64;
|
||||||
|
typedef unsigned __int64 UINT64, *PUINT64;
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* !RC_INVOKED */
|
||||||
|
|
||||||
|
#endif /* _BASETSD_H */
|
||||||
144
bazaar/Tcc/lib/include/winapi/basetyps.h
Normal file
144
bazaar/Tcc/lib/include/winapi/basetyps.h
Normal file
|
|
@ -0,0 +1,144 @@
|
||||||
|
#ifndef _BASETYPS_H
|
||||||
|
#define _BASETYPS_H
|
||||||
|
#if __GNUC__ >=3
|
||||||
|
#pragma GCC system_header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __OBJC__
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define EXTERN_C extern "C"
|
||||||
|
#else
|
||||||
|
#define EXTERN_C extern
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
#define STDMETHODCALLTYPE __stdcall
|
||||||
|
#define STDMETHODVCALLTYPE __cdecl
|
||||||
|
#define STDAPICALLTYPE __stdcall
|
||||||
|
#define STDAPIVCALLTYPE __cdecl
|
||||||
|
#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
|
||||||
|
#define STDAPI_(t) EXTERN_C t STDAPICALLTYPE
|
||||||
|
#define STDMETHODIMP HRESULT STDMETHODCALLTYPE
|
||||||
|
#define STDMETHODIMP_(t) t STDMETHODCALLTYPE
|
||||||
|
#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
|
||||||
|
#define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE
|
||||||
|
#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
|
||||||
|
#define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE
|
||||||
|
#define interface struct
|
||||||
|
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||||
|
#define STDMETHOD(m) virtual HRESULT STDMETHODCALLTYPE m
|
||||||
|
#define STDMETHOD_(t,m) virtual t STDMETHODCALLTYPE m
|
||||||
|
#define PURE =0
|
||||||
|
#define THIS_
|
||||||
|
#define THIS void
|
||||||
|
/*
|
||||||
|
__attribute__((com_interface)) is obsolete in __GNUC__ >= 3
|
||||||
|
g++ vtables are now COM-compatible by default
|
||||||
|
*/
|
||||||
|
#if defined(__GNUC__) && __GNUC__ < 3 && !defined(NOCOMATTRIBUTE)
|
||||||
|
#define DECLARE_INTERFACE(i) interface __attribute__((com_interface)) i
|
||||||
|
#define DECLARE_INTERFACE_(i,b) interface __attribute__((com_interface)) i : public b
|
||||||
|
#else
|
||||||
|
#define DECLARE_INTERFACE(i) interface i
|
||||||
|
#define DECLARE_INTERFACE_(i,b) interface i : public b
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define STDMETHOD(m) HRESULT(STDMETHODCALLTYPE *m)
|
||||||
|
#define STDMETHOD_(t,m) t(STDMETHODCALLTYPE *m)
|
||||||
|
#define PURE
|
||||||
|
#define THIS_ INTERFACE *,
|
||||||
|
#define THIS INTERFACE *
|
||||||
|
#ifndef CONST_VTABLE
|
||||||
|
#define CONST_VTABLE
|
||||||
|
#endif
|
||||||
|
#define DECLARE_INTERFACE(i) \
|
||||||
|
typedef interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; } i; \
|
||||||
|
typedef CONST_VTABLE struct i##Vtbl i##Vtbl; \
|
||||||
|
CONST_VTABLE struct i##Vtbl
|
||||||
|
#define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i)
|
||||||
|
#endif
|
||||||
|
#define BEGIN_INTERFACE
|
||||||
|
#define END_INTERFACE
|
||||||
|
|
||||||
|
#define FWD_DECL(i) typedef interface i i
|
||||||
|
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||||
|
#define IENUM_THIS(T)
|
||||||
|
#define IENUM_THIS_(T)
|
||||||
|
#else
|
||||||
|
#define IENUM_THIS(T) T*
|
||||||
|
#define IENUM_THIS_(T) T*,
|
||||||
|
#endif
|
||||||
|
#define DECLARE_ENUMERATOR_(I,T) \
|
||||||
|
DECLARE_INTERFACE_(I,IUnknown) \
|
||||||
|
{ \
|
||||||
|
STDMETHOD(QueryInterface)(IENUM_THIS_(I) REFIID,PVOID*) PURE; \
|
||||||
|
STDMETHOD_(ULONG,AddRef)(IENUM_THIS(I)) PURE; \
|
||||||
|
STDMETHOD_(ULONG,Release)(IENUM_THIS(I)) PURE; \
|
||||||
|
STDMETHOD(Next)(IENUM_THIS_(I) ULONG,T*,ULONG*) PURE; \
|
||||||
|
STDMETHOD(Skip)(IENUM_THIS_(I) ULONG) PURE; \
|
||||||
|
STDMETHOD(Reset)(IENUM_THIS(I)) PURE; \
|
||||||
|
STDMETHOD(Clone)(IENUM_THIS_(I) I**) PURE; \
|
||||||
|
}
|
||||||
|
#define DECLARE_ENUMERATOR(T) DECLARE_ENUMERATOR_(IEnum##T,T)
|
||||||
|
|
||||||
|
#endif /* __OBJC__ */
|
||||||
|
|
||||||
|
#ifndef _GUID_DEFINED /* also defined in winnt.h */
|
||||||
|
#define _GUID_DEFINED
|
||||||
|
typedef struct _GUID
|
||||||
|
{
|
||||||
|
unsigned long Data1;
|
||||||
|
unsigned short Data2;
|
||||||
|
unsigned short Data3;
|
||||||
|
unsigned char Data4[8];
|
||||||
|
} GUID,*REFGUID,*LPGUID;
|
||||||
|
#endif /* _GUID_DEFINED */
|
||||||
|
#ifndef UUID_DEFINED
|
||||||
|
#define UUID_DEFINED
|
||||||
|
typedef GUID UUID;
|
||||||
|
#endif /* UUID_DEFINED */
|
||||||
|
typedef GUID IID;
|
||||||
|
typedef GUID CLSID;
|
||||||
|
typedef CLSID *LPCLSID;
|
||||||
|
typedef IID *LPIID;
|
||||||
|
typedef IID *REFIID;
|
||||||
|
typedef CLSID *REFCLSID;
|
||||||
|
typedef GUID FMTID;
|
||||||
|
typedef FMTID *REFFMTID;
|
||||||
|
typedef unsigned long error_status_t;
|
||||||
|
#define uuid_t UUID
|
||||||
|
typedef unsigned long PROPID;
|
||||||
|
|
||||||
|
#ifndef _REFGUID_DEFINED
|
||||||
|
#if defined (__cplusplus) && !defined (CINTERFACE)
|
||||||
|
#define REFGUID const GUID&
|
||||||
|
#define REFIID const IID&
|
||||||
|
#define REFCLSID const CLSID&
|
||||||
|
#else
|
||||||
|
#define REFGUID const GUID* const
|
||||||
|
#define REFIID const IID* const
|
||||||
|
#define REFCLSID const CLSID* const
|
||||||
|
#endif
|
||||||
|
#define _REFGUID_DEFINED
|
||||||
|
#define _REFGIID_DEFINED
|
||||||
|
#define _REFCLSID_DEFINED
|
||||||
|
#endif
|
||||||
|
#ifndef GUID_SECTION
|
||||||
|
#define GUID_SECTION ".text"
|
||||||
|
#endif
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define GUID_SECT __attribute__ ((section (GUID_SECTION)))
|
||||||
|
#else
|
||||||
|
#define GUID_SECT
|
||||||
|
#endif
|
||||||
|
#if !defined(INITGUID) || (defined(INITGUID) && defined(__cplusplus))
|
||||||
|
#define GUID_EXT EXTERN_C
|
||||||
|
#else
|
||||||
|
#define GUID_EXT
|
||||||
|
#endif
|
||||||
|
#ifdef INITGUID
|
||||||
|
#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
|
||||||
|
#define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
|
||||||
|
#else
|
||||||
|
#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n
|
||||||
|
#define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
1852
bazaar/Tcc/lib/include/winapi/winbase.h
Normal file
1852
bazaar/Tcc/lib/include/winapi/winbase.h
Normal file
File diff suppressed because it is too large
Load diff
207
bazaar/Tcc/lib/include/winapi/wincon.h
Normal file
207
bazaar/Tcc/lib/include/winapi/wincon.h
Normal file
|
|
@ -0,0 +1,207 @@
|
||||||
|
#ifndef _WINCON_H
|
||||||
|
#define _WINCON_H
|
||||||
|
#if __GNUC__ >=3
|
||||||
|
#pragma GCC system_header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define FOREGROUND_BLUE 1
|
||||||
|
#define FOREGROUND_GREEN 2
|
||||||
|
#define FOREGROUND_RED 4
|
||||||
|
#define FOREGROUND_INTENSITY 8
|
||||||
|
#define BACKGROUND_BLUE 16
|
||||||
|
#define BACKGROUND_GREEN 32
|
||||||
|
#define BACKGROUND_RED 64
|
||||||
|
#define BACKGROUND_INTENSITY 128
|
||||||
|
#define CTRL_C_EVENT 0
|
||||||
|
#define CTRL_BREAK_EVENT 1
|
||||||
|
#define CTRL_CLOSE_EVENT 2
|
||||||
|
#define CTRL_LOGOFF_EVENT 5
|
||||||
|
#define CTRL_SHUTDOWN_EVENT 6
|
||||||
|
#define ENABLE_LINE_INPUT 2
|
||||||
|
#define ENABLE_ECHO_INPUT 4
|
||||||
|
#define ENABLE_PROCESSED_INPUT 1
|
||||||
|
#define ENABLE_WINDOW_INPUT 8
|
||||||
|
#define ENABLE_MOUSE_INPUT 16
|
||||||
|
#define ENABLE_PROCESSED_OUTPUT 1
|
||||||
|
#define ENABLE_WRAP_AT_EOL_OUTPUT 2
|
||||||
|
#define KEY_EVENT 1
|
||||||
|
#define MOUSE_EVENT 2
|
||||||
|
#define WINDOW_BUFFER_SIZE_EVENT 4
|
||||||
|
#define MENU_EVENT 8
|
||||||
|
#define FOCUS_EVENT 16
|
||||||
|
#define CAPSLOCK_ON 128
|
||||||
|
#define ENHANCED_KEY 256
|
||||||
|
#define RIGHT_ALT_PRESSED 1
|
||||||
|
#define LEFT_ALT_PRESSED 2
|
||||||
|
#define RIGHT_CTRL_PRESSED 4
|
||||||
|
#define LEFT_CTRL_PRESSED 8
|
||||||
|
#define SHIFT_PRESSED 16
|
||||||
|
#define NUMLOCK_ON 32
|
||||||
|
#define SCROLLLOCK_ON 64
|
||||||
|
#define FROM_LEFT_1ST_BUTTON_PRESSED 1
|
||||||
|
#define RIGHTMOST_BUTTON_PRESSED 2
|
||||||
|
#define FROM_LEFT_2ND_BUTTON_PRESSED 4
|
||||||
|
#define FROM_LEFT_3RD_BUTTON_PRESSED 8
|
||||||
|
#define FROM_LEFT_4TH_BUTTON_PRESSED 16
|
||||||
|
#define MOUSE_MOVED 1
|
||||||
|
#define DOUBLE_CLICK 2
|
||||||
|
#define MOUSE_WHEELED 4
|
||||||
|
|
||||||
|
typedef struct _CHAR_INFO {
|
||||||
|
union {
|
||||||
|
WCHAR UnicodeChar;
|
||||||
|
CHAR AsciiChar;
|
||||||
|
} Char;
|
||||||
|
WORD Attributes;
|
||||||
|
} CHAR_INFO,*PCHAR_INFO;
|
||||||
|
typedef struct _SMALL_RECT {
|
||||||
|
SHORT Left;
|
||||||
|
SHORT Top;
|
||||||
|
SHORT Right;
|
||||||
|
SHORT Bottom;
|
||||||
|
} SMALL_RECT,*PSMALL_RECT;
|
||||||
|
typedef struct _CONSOLE_CURSOR_INFO {
|
||||||
|
DWORD dwSize;
|
||||||
|
BOOL bVisible;
|
||||||
|
} CONSOLE_CURSOR_INFO,*PCONSOLE_CURSOR_INFO;
|
||||||
|
typedef struct _COORD {
|
||||||
|
SHORT X;
|
||||||
|
SHORT Y;
|
||||||
|
} COORD;
|
||||||
|
typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
|
||||||
|
COORD dwSize;
|
||||||
|
COORD dwCursorPosition;
|
||||||
|
WORD wAttributes;
|
||||||
|
SMALL_RECT srWindow;
|
||||||
|
COORD dwMaximumWindowSize;
|
||||||
|
} CONSOLE_SCREEN_BUFFER_INFO,*PCONSOLE_SCREEN_BUFFER_INFO;
|
||||||
|
typedef BOOL(CALLBACK *PHANDLER_ROUTINE)(DWORD);
|
||||||
|
typedef struct _KEY_EVENT_RECORD {
|
||||||
|
BOOL bKeyDown;
|
||||||
|
WORD wRepeatCount;
|
||||||
|
WORD wVirtualKeyCode;
|
||||||
|
WORD wVirtualScanCode;
|
||||||
|
union {
|
||||||
|
WCHAR UnicodeChar;
|
||||||
|
CHAR AsciiChar;
|
||||||
|
} uChar;
|
||||||
|
DWORD dwControlKeyState;
|
||||||
|
}
|
||||||
|
#ifdef __GNUC__
|
||||||
|
/* gcc's alignment is not what win32 expects */
|
||||||
|
PACKED
|
||||||
|
#endif
|
||||||
|
KEY_EVENT_RECORD;
|
||||||
|
|
||||||
|
typedef struct _MOUSE_EVENT_RECORD {
|
||||||
|
COORD dwMousePosition;
|
||||||
|
DWORD dwButtonState;
|
||||||
|
DWORD dwControlKeyState;
|
||||||
|
DWORD dwEventFlags;
|
||||||
|
} MOUSE_EVENT_RECORD;
|
||||||
|
typedef struct _WINDOW_BUFFER_SIZE_RECORD { COORD dwSize; } WINDOW_BUFFER_SIZE_RECORD;
|
||||||
|
typedef struct _MENU_EVENT_RECORD { UINT dwCommandId; } MENU_EVENT_RECORD,*PMENU_EVENT_RECORD;
|
||||||
|
typedef struct _FOCUS_EVENT_RECORD { BOOL bSetFocus; } FOCUS_EVENT_RECORD;
|
||||||
|
typedef struct _INPUT_RECORD {
|
||||||
|
WORD EventType;
|
||||||
|
union {
|
||||||
|
KEY_EVENT_RECORD KeyEvent;
|
||||||
|
MOUSE_EVENT_RECORD MouseEvent;
|
||||||
|
WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
|
||||||
|
MENU_EVENT_RECORD MenuEvent;
|
||||||
|
FOCUS_EVENT_RECORD FocusEvent;
|
||||||
|
} Event;
|
||||||
|
} INPUT_RECORD,*PINPUT_RECORD;
|
||||||
|
|
||||||
|
BOOL WINAPI AllocConsole(void);
|
||||||
|
HANDLE WINAPI CreateConsoleScreenBuffer(DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,PVOID);
|
||||||
|
BOOL WINAPI FillConsoleOutputAttribute(HANDLE,WORD,DWORD,COORD,PDWORD);
|
||||||
|
BOOL WINAPI FillConsoleOutputCharacterA(HANDLE,CHAR,DWORD,COORD,PDWORD);
|
||||||
|
BOOL WINAPI FillConsoleOutputCharacterW(HANDLE,WCHAR,DWORD,COORD,PDWORD);
|
||||||
|
BOOL WINAPI FlushConsoleInputBuffer(HANDLE);
|
||||||
|
BOOL WINAPI FreeConsole(void);
|
||||||
|
BOOL WINAPI GenerateConsoleCtrlEvent(DWORD,DWORD);
|
||||||
|
UINT WINAPI GetConsoleCP(void);
|
||||||
|
BOOL WINAPI GetConsoleCursorInfo(HANDLE,PCONSOLE_CURSOR_INFO);
|
||||||
|
BOOL WINAPI GetConsoleMode(HANDLE,PDWORD);
|
||||||
|
UINT WINAPI GetConsoleOutputCP(void);
|
||||||
|
BOOL WINAPI GetConsoleScreenBufferInfo(HANDLE,PCONSOLE_SCREEN_BUFFER_INFO);
|
||||||
|
DWORD WINAPI GetConsoleTitleA(LPSTR,DWORD);
|
||||||
|
DWORD WINAPI GetConsoleTitleW(LPWSTR,DWORD);
|
||||||
|
COORD WINAPI GetLargestConsoleWindowSize(HANDLE);
|
||||||
|
BOOL WINAPI GetNumberOfConsoleInputEvents(HANDLE,PDWORD);
|
||||||
|
BOOL WINAPI GetNumberOfConsoleMouseButtons(PDWORD);
|
||||||
|
BOOL WINAPI PeekConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
|
||||||
|
BOOL WINAPI PeekConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
|
||||||
|
BOOL WINAPI ReadConsoleA(HANDLE,PVOID,DWORD,PDWORD,PVOID);
|
||||||
|
BOOL WINAPI ReadConsoleW(HANDLE,PVOID,DWORD,PDWORD,PVOID);
|
||||||
|
BOOL WINAPI ReadConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
|
||||||
|
BOOL WINAPI ReadConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
|
||||||
|
BOOL WINAPI ReadConsoleOutputAttribute(HANDLE,LPWORD,DWORD,COORD,LPDWORD);
|
||||||
|
BOOL WINAPI ReadConsoleOutputCharacterA(HANDLE,LPSTR,DWORD,COORD,PDWORD);
|
||||||
|
BOOL WINAPI ReadConsoleOutputCharacterW(HANDLE,LPWSTR,DWORD,COORD,PDWORD);
|
||||||
|
BOOL WINAPI ReadConsoleOutputA(HANDLE,PCHAR_INFO,COORD,COORD,PSMALL_RECT);
|
||||||
|
BOOL WINAPI ReadConsoleOutputW(HANDLE,PCHAR_INFO,COORD,COORD,PSMALL_RECT);
|
||||||
|
BOOL WINAPI ScrollConsoleScreenBufferA(HANDLE,const SMALL_RECT*,const SMALL_RECT*,COORD,const CHAR_INFO*);
|
||||||
|
BOOL WINAPI ScrollConsoleScreenBufferW(HANDLE,const SMALL_RECT*,const SMALL_RECT*,COORD,const CHAR_INFO*);
|
||||||
|
BOOL WINAPI SetConsoleActiveScreenBuffer(HANDLE);
|
||||||
|
BOOL WINAPI SetConsoleCP(UINT);
|
||||||
|
BOOL WINAPI SetConsoleCtrlHandler(PHANDLER_ROUTINE,BOOL);
|
||||||
|
BOOL WINAPI SetConsoleCursorInfo(HANDLE,const CONSOLE_CURSOR_INFO*);
|
||||||
|
BOOL WINAPI SetConsoleCursorPosition(HANDLE,COORD);
|
||||||
|
BOOL WINAPI SetConsoleMode(HANDLE,DWORD);
|
||||||
|
BOOL WINAPI SetConsoleOutputCP(UINT);
|
||||||
|
BOOL WINAPI SetConsoleScreenBufferSize(HANDLE,COORD);
|
||||||
|
BOOL WINAPI SetConsoleTextAttribute(HANDLE,WORD);
|
||||||
|
BOOL WINAPI SetConsoleTitleA(LPCSTR);
|
||||||
|
BOOL WINAPI SetConsoleTitleW(LPCWSTR);
|
||||||
|
BOOL WINAPI SetConsoleWindowInfo(HANDLE,BOOL,const SMALL_RECT*);
|
||||||
|
BOOL WINAPI WriteConsoleA(HANDLE,PCVOID,DWORD,PDWORD,PVOID);
|
||||||
|
BOOL WINAPI WriteConsoleW(HANDLE,PCVOID,DWORD,PDWORD,PVOID);
|
||||||
|
BOOL WINAPI WriteConsoleInputA(HANDLE,const INPUT_RECORD*,DWORD,PDWORD);
|
||||||
|
BOOL WINAPI WriteConsoleInputW(HANDLE,const INPUT_RECORD*,DWORD,PDWORD);
|
||||||
|
BOOL WINAPI WriteConsoleOutputA(HANDLE,const CHAR_INFO*,COORD,COORD,PSMALL_RECT);
|
||||||
|
BOOL WINAPI WriteConsoleOutputW(HANDLE,const CHAR_INFO*,COORD,COORD,PSMALL_RECT);
|
||||||
|
BOOL WINAPI WriteConsoleOutputAttribute(HANDLE,const WORD*,DWORD,COORD,PDWORD);
|
||||||
|
BOOL WINAPI WriteConsoleOutputCharacterA(HANDLE,LPCSTR,DWORD,COORD,PDWORD);
|
||||||
|
BOOL WINAPI WriteConsoleOutputCharacterW(HANDLE,LPCWSTR,DWORD,COORD,PDWORD);
|
||||||
|
|
||||||
|
#ifdef UNICODE
|
||||||
|
#define FillConsoleOutputCharacter FillConsoleOutputCharacterW
|
||||||
|
#define GetConsoleTitle GetConsoleTitleW
|
||||||
|
#define PeekConsoleInput PeekConsoleInputW
|
||||||
|
#define ReadConsole ReadConsoleW
|
||||||
|
#define ReadConsoleInput ReadConsoleInputW
|
||||||
|
#define ReadConsoleOutput ReadConsoleOutputW
|
||||||
|
#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterW
|
||||||
|
#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferW
|
||||||
|
#define SetConsoleTitle SetConsoleTitleW
|
||||||
|
#define WriteConsole WriteConsoleW
|
||||||
|
#define WriteConsoleInput WriteConsoleInputW
|
||||||
|
#define WriteConsoleOutput WriteConsoleOutputW
|
||||||
|
#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterW
|
||||||
|
#else
|
||||||
|
#define FillConsoleOutputCharacter FillConsoleOutputCharacterA
|
||||||
|
#define GetConsoleTitle GetConsoleTitleA
|
||||||
|
#define PeekConsoleInput PeekConsoleInputA
|
||||||
|
#define ReadConsole ReadConsoleA
|
||||||
|
#define ReadConsoleInput ReadConsoleInputA
|
||||||
|
#define ReadConsoleOutput ReadConsoleOutputA
|
||||||
|
#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterA
|
||||||
|
#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferA
|
||||||
|
#define SetConsoleTitle SetConsoleTitleA
|
||||||
|
#define WriteConsole WriteConsoleA
|
||||||
|
#define WriteConsoleInput WriteConsoleInputA
|
||||||
|
#define WriteConsoleOutput WriteConsoleOutputA
|
||||||
|
#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
240
bazaar/Tcc/lib/include/winapi/windef.h
Normal file
240
bazaar/Tcc/lib/include/winapi/windef.h
Normal file
|
|
@ -0,0 +1,240 @@
|
||||||
|
#ifndef _WINDEF_H
|
||||||
|
#define _WINDEF_H
|
||||||
|
#if __GNUC__ >=3
|
||||||
|
#pragma GCC system_header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WINVER
|
||||||
|
#define WINVER 0x0400
|
||||||
|
#endif
|
||||||
|
#ifndef _WIN32_WINNT
|
||||||
|
#define _WIN32_WINNT WINVER
|
||||||
|
#endif
|
||||||
|
#ifndef WIN32
|
||||||
|
#define WIN32
|
||||||
|
#endif
|
||||||
|
#ifndef _WIN32
|
||||||
|
#define _WIN32
|
||||||
|
#endif
|
||||||
|
#define FAR
|
||||||
|
#define far
|
||||||
|
#define NEAR
|
||||||
|
#define near
|
||||||
|
#ifndef CONST
|
||||||
|
#define CONST const
|
||||||
|
#endif
|
||||||
|
#undef MAX_PATH
|
||||||
|
#define MAX_PATH 260
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define NULL 0
|
||||||
|
#else
|
||||||
|
#define NULL ((void*)0)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef FALSE
|
||||||
|
#define FALSE 0
|
||||||
|
#endif
|
||||||
|
#ifndef TRUE
|
||||||
|
#define TRUE 1
|
||||||
|
#endif
|
||||||
|
#define IN
|
||||||
|
#define OUT
|
||||||
|
#ifndef OPTIONAL
|
||||||
|
#define OPTIONAL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define PACKED __attribute__((packed))
|
||||||
|
#ifndef _stdcall
|
||||||
|
#define _stdcall __attribute__((stdcall))
|
||||||
|
#endif
|
||||||
|
#ifndef __stdcall
|
||||||
|
#define __stdcall __attribute__((stdcall))
|
||||||
|
#endif
|
||||||
|
#ifndef _cdecl
|
||||||
|
#define _cdecl __attribute__((cdecl))
|
||||||
|
#endif
|
||||||
|
#ifndef __cdecl
|
||||||
|
#define __cdecl __attribute__((cdecl))
|
||||||
|
#endif
|
||||||
|
#ifndef __declspec
|
||||||
|
#define __declspec(e) __attribute__((e))
|
||||||
|
#endif
|
||||||
|
#ifndef _declspec
|
||||||
|
#define _declspec(e) __attribute__((e))
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define PACKED
|
||||||
|
#define _cdecl
|
||||||
|
#define __cdecl
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef pascal
|
||||||
|
#undef _pascal
|
||||||
|
#undef __pascal
|
||||||
|
#define pascal __stdcall
|
||||||
|
#define _pascal __stdcall
|
||||||
|
#define __pascal __stdcall
|
||||||
|
#define PASCAL _pascal
|
||||||
|
#define CDECL _cdecl
|
||||||
|
#define STDCALL __stdcall
|
||||||
|
#define WINAPI __stdcall
|
||||||
|
#define WINAPIV __cdecl
|
||||||
|
#define APIENTRY __stdcall
|
||||||
|
#define CALLBACK __stdcall
|
||||||
|
#define APIPRIVATE __stdcall
|
||||||
|
|
||||||
|
#define DECLSPEC_IMPORT __declspec(dllimport)
|
||||||
|
#define DECLSPEC_EXPORT __declspec(dllexport)
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define DECLSPEC_NORETURN __declspec(noreturn)
|
||||||
|
#define DECLARE_STDCALL_P( type ) __stdcall type
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
#define DECLSPEC_NORETURN
|
||||||
|
#define DECLARE_STDCALL_P( type ) type __stdcall
|
||||||
|
#endif /* __GNUC__/__WATCOMC__ */
|
||||||
|
#define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
|
||||||
|
#define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
|
||||||
|
#define LOWORD(l) ((WORD)((DWORD)(l)))
|
||||||
|
#define HIWORD(l) ((WORD)(((DWORD)(l)>>16)&0xFFFF))
|
||||||
|
#define LOBYTE(w) ((BYTE)(w))
|
||||||
|
#define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
|
||||||
|
|
||||||
|
#ifndef _export
|
||||||
|
#define _export
|
||||||
|
#endif
|
||||||
|
#ifndef __export
|
||||||
|
#define __export
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NOMINMAX
|
||||||
|
#ifndef max
|
||||||
|
#define max(a,b) ((a)>(b)?(a):(b))
|
||||||
|
#endif
|
||||||
|
#ifndef min
|
||||||
|
#define min(a,b) ((a)<(b)?(a):(b))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define UNREFERENCED_PARAMETER(P) {(P)=(P);}
|
||||||
|
#define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
|
||||||
|
#define DBG_UNREFERENCED_PARAMETER(P)
|
||||||
|
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
|
||||||
|
|
||||||
|
typedef unsigned long DWORD;
|
||||||
|
typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
|
||||||
|
/* FIXME: Is there a good solution to this? */
|
||||||
|
#ifndef XFree86Server
|
||||||
|
#ifndef __OBJC__
|
||||||
|
typedef WINBOOL BOOL;
|
||||||
|
#else
|
||||||
|
#define BOOL WINBOOL
|
||||||
|
#endif
|
||||||
|
typedef unsigned char BYTE;
|
||||||
|
#endif /* ndef XFree86Server */
|
||||||
|
typedef BOOL *PBOOL,*LPBOOL;
|
||||||
|
typedef unsigned short WORD;
|
||||||
|
typedef float FLOAT;
|
||||||
|
typedef FLOAT *PFLOAT;
|
||||||
|
typedef BYTE *PBYTE,*LPBYTE;
|
||||||
|
typedef int *PINT,*LPINT;
|
||||||
|
typedef WORD *PWORD,*LPWORD;
|
||||||
|
typedef long *LPLONG;
|
||||||
|
typedef DWORD *PDWORD,*LPDWORD;
|
||||||
|
typedef void *PVOID,*LPVOID;
|
||||||
|
typedef CONST void *PCVOID,*LPCVOID;
|
||||||
|
typedef int INT;
|
||||||
|
typedef unsigned int UINT,*PUINT,*LPUINT;
|
||||||
|
|
||||||
|
#include <winnt.h>
|
||||||
|
|
||||||
|
typedef UINT WPARAM;
|
||||||
|
typedef LONG LPARAM;
|
||||||
|
typedef LONG LRESULT;
|
||||||
|
#ifndef _HRESULT_DEFINED
|
||||||
|
typedef LONG HRESULT;
|
||||||
|
#define _HRESULT_DEFINED
|
||||||
|
#endif
|
||||||
|
#ifndef XFree86Server
|
||||||
|
typedef WORD ATOM;
|
||||||
|
#endif /* XFree86Server */
|
||||||
|
typedef HANDLE HGLOBAL;
|
||||||
|
typedef HANDLE HLOCAL;
|
||||||
|
typedef HANDLE GLOBALHANDLE;
|
||||||
|
typedef HANDLE LOCALHANDLE;
|
||||||
|
typedef void *HGDIOBJ;
|
||||||
|
DECLARE_HANDLE(HACCEL);
|
||||||
|
DECLARE_HANDLE(HBITMAP);
|
||||||
|
DECLARE_HANDLE(HBRUSH);
|
||||||
|
DECLARE_HANDLE(HCOLORSPACE);
|
||||||
|
DECLARE_HANDLE(HDC);
|
||||||
|
DECLARE_HANDLE(HGLRC);
|
||||||
|
DECLARE_HANDLE(HDESK);
|
||||||
|
DECLARE_HANDLE(HENHMETAFILE);
|
||||||
|
DECLARE_HANDLE(HFONT);
|
||||||
|
DECLARE_HANDLE(HICON);
|
||||||
|
DECLARE_HANDLE(HKEY);
|
||||||
|
/* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
|
||||||
|
/* #if (WINVER >= 0x0500) */
|
||||||
|
DECLARE_HANDLE(HMONITOR);
|
||||||
|
#define HMONITOR_DECLARED 1
|
||||||
|
DECLARE_HANDLE(HTERMINAL);
|
||||||
|
DECLARE_HANDLE(HWINEVENTHOOK);
|
||||||
|
/* #endif */
|
||||||
|
typedef HKEY *PHKEY;
|
||||||
|
DECLARE_HANDLE(HMENU);
|
||||||
|
DECLARE_HANDLE(HMETAFILE);
|
||||||
|
DECLARE_HANDLE(HINSTANCE);
|
||||||
|
typedef HINSTANCE HMODULE;
|
||||||
|
DECLARE_HANDLE(HPALETTE);
|
||||||
|
DECLARE_HANDLE(HPEN);
|
||||||
|
DECLARE_HANDLE(HRGN);
|
||||||
|
DECLARE_HANDLE(HRSRC);
|
||||||
|
DECLARE_HANDLE(HSTR);
|
||||||
|
DECLARE_HANDLE(HTASK);
|
||||||
|
DECLARE_HANDLE(HWND);
|
||||||
|
DECLARE_HANDLE(HWINSTA);
|
||||||
|
DECLARE_HANDLE(HKL);
|
||||||
|
typedef int HFILE;
|
||||||
|
typedef HICON HCURSOR;
|
||||||
|
typedef DWORD COLORREF;
|
||||||
|
typedef int (WINAPI *FARPROC)();
|
||||||
|
typedef int (WINAPI *NEARPROC)();
|
||||||
|
typedef int (WINAPI *PROC)();
|
||||||
|
typedef struct tagRECT {
|
||||||
|
LONG left;
|
||||||
|
LONG top;
|
||||||
|
LONG right;
|
||||||
|
LONG bottom;
|
||||||
|
} RECT,*PRECT,*LPRECT;
|
||||||
|
typedef const RECT *LPCRECT;
|
||||||
|
typedef struct tagRECTL {
|
||||||
|
LONG left;
|
||||||
|
LONG top;
|
||||||
|
LONG right;
|
||||||
|
LONG bottom;
|
||||||
|
} RECTL,*PRECTL,*LPRECTL;
|
||||||
|
typedef const RECTL *LPCRECTL;
|
||||||
|
typedef struct tagPOINT {
|
||||||
|
LONG x;
|
||||||
|
LONG y;
|
||||||
|
} POINT,POINTL,*PPOINT,*LPPOINT,*PPOINTL,*LPPOINTL;
|
||||||
|
typedef struct tagSIZE {
|
||||||
|
LONG cx;
|
||||||
|
LONG cy;
|
||||||
|
} SIZE,SIZEL,*PSIZE,*LPSIZE,*PSIZEL,*LPSIZEL;
|
||||||
|
typedef struct tagPOINTS {
|
||||||
|
SHORT x;
|
||||||
|
SHORT y;
|
||||||
|
} POINTS,*PPOINTS,*LPPOINTS;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
176
bazaar/Tcc/lib/include/winapi/windows.h
Normal file
176
bazaar/Tcc/lib/include/winapi/windows.h
Normal file
|
|
@ -0,0 +1,176 @@
|
||||||
|
/*
|
||||||
|
windows.h - main header file for the Win32 API
|
||||||
|
|
||||||
|
Written by Anders Norlander <anorland@hem2.passagen.se>
|
||||||
|
|
||||||
|
This file is part of a free library for the Win32 API.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
*/
|
||||||
|
#ifndef _WINDOWS_H
|
||||||
|
#define _WINDOWS_H
|
||||||
|
#if __GNUC__ >=3
|
||||||
|
#pragma GCC system_header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* translate GCC target defines to MS equivalents. Keep this synchronized
|
||||||
|
with winnt.h. */
|
||||||
|
#if defined(__i686__) && !defined(_M_IX86)
|
||||||
|
#define _M_IX86 600
|
||||||
|
#elif defined(__i586__) && !defined(_M_IX86)
|
||||||
|
#define _M_IX86 500
|
||||||
|
#elif defined(__i486__) && !defined(_M_IX86)
|
||||||
|
#define _M_IX86 400
|
||||||
|
#elif defined(__i386__) && !defined(_M_IX86)
|
||||||
|
#define _M_IX86 300
|
||||||
|
#endif
|
||||||
|
#if defined(_M_IX86) && !defined(_X86_)
|
||||||
|
#define _X86_
|
||||||
|
#elif defined(_M_ALPHA) && !defined(_ALPHA_)
|
||||||
|
#define _ALPHA_
|
||||||
|
#elif defined(_M_PPC) && !defined(_PPC_)
|
||||||
|
#define _PPC_
|
||||||
|
#elif defined(_M_MRX000) && !defined(_MIPS_)
|
||||||
|
#define _MIPS_
|
||||||
|
#elif defined(_M_M68K) && !defined(_68K_)
|
||||||
|
#define _68K_
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef RC_INVOKED
|
||||||
|
/* winresrc.h includes the necessary headers */
|
||||||
|
#include <winresrc.h>
|
||||||
|
#else
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#ifndef NONAMELESSUNION
|
||||||
|
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
|
||||||
|
#define _ANONYMOUS_UNION __extension__
|
||||||
|
#define _ANONYMOUS_STRUCT __extension__
|
||||||
|
#else
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
#define _ANONYMOUS_UNION __extension__
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
#endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
|
||||||
|
#endif /* NONAMELESSUNION */
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
#define _ANONYMOUS_UNION
|
||||||
|
#define _ANONYMOUS_STRUCT
|
||||||
|
#endif /* __GNUC__/__WATCOMC__ */
|
||||||
|
|
||||||
|
#ifndef _ANONYMOUS_UNION
|
||||||
|
#define _ANONYMOUS_UNION
|
||||||
|
#define _UNION_NAME(x) x
|
||||||
|
#define DUMMYUNIONNAME u
|
||||||
|
#define DUMMYUNIONNAME2 u2
|
||||||
|
#define DUMMYUNIONNAME3 u3
|
||||||
|
#define DUMMYUNIONNAME4 u4
|
||||||
|
#define DUMMYUNIONNAME5 u5
|
||||||
|
#define DUMMYUNIONNAME6 u6
|
||||||
|
#define DUMMYUNIONNAME7 u7
|
||||||
|
#define DUMMYUNIONNAME8 u8
|
||||||
|
#else
|
||||||
|
#define _UNION_NAME(x)
|
||||||
|
#define DUMMYUNIONNAME
|
||||||
|
#define DUMMYUNIONNAME2
|
||||||
|
#define DUMMYUNIONNAME3
|
||||||
|
#define DUMMYUNIONNAME4
|
||||||
|
#define DUMMYUNIONNAME5
|
||||||
|
#define DUMMYUNIONNAME6
|
||||||
|
#define DUMMYUNIONNAME7
|
||||||
|
#define DUMMYUNIONNAME8
|
||||||
|
#endif
|
||||||
|
#ifndef _ANONYMOUS_STRUCT
|
||||||
|
#define _ANONYMOUS_STRUCT
|
||||||
|
#define _STRUCT_NAME(x) x
|
||||||
|
#define DUMMYSTRUCTNAME s
|
||||||
|
#define DUMMYSTRUCTNAME2 s2
|
||||||
|
#define DUMMYSTRUCTNAME3 s3
|
||||||
|
#else
|
||||||
|
#define _STRUCT_NAME(x)
|
||||||
|
#define DUMMYSTRUCTNAME
|
||||||
|
#define DUMMYSTRUCTNAME2
|
||||||
|
#define DUMMYSTRUCTNAME3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NO_STRICT
|
||||||
|
#ifndef STRICT
|
||||||
|
#define STRICT 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <windef.h>
|
||||||
|
#include <wincon.h>
|
||||||
|
#include <basetyps.h>
|
||||||
|
#include <excpt.h>
|
||||||
|
#include <winbase.h>
|
||||||
|
#ifndef _WINGDI_H
|
||||||
|
#include <wingdi.h>
|
||||||
|
#endif
|
||||||
|
#ifndef _WINUSER_H
|
||||||
|
#include <winuser.h>
|
||||||
|
#endif
|
||||||
|
#ifndef _WINNLS_H
|
||||||
|
#include <winnls.h>
|
||||||
|
#endif
|
||||||
|
#ifndef _WINVER_H
|
||||||
|
#include <winver.h>
|
||||||
|
#endif
|
||||||
|
#ifndef _WINNETWK_H
|
||||||
|
#include <winnetwk.h>
|
||||||
|
#endif
|
||||||
|
#ifndef _WINREG_H
|
||||||
|
#include <winreg.h>
|
||||||
|
#endif
|
||||||
|
#ifndef _WINSVC_H
|
||||||
|
#include <winsvc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
#include <commdlg.h>
|
||||||
|
#include <cderr.h>
|
||||||
|
#include <dde.h>
|
||||||
|
#include <ddeml.h>
|
||||||
|
#include <dlgs.h>
|
||||||
|
#include <lzexpand.h>
|
||||||
|
#include <mmsystem.h>
|
||||||
|
#include <nb30.h>
|
||||||
|
#include <rpc.h>
|
||||||
|
#include <shellapi.h>
|
||||||
|
#include <winperf.h>
|
||||||
|
#include <winspool.h>
|
||||||
|
#if defined(Win32_Winsock)
|
||||||
|
#warning "The Win32_Winsock macro name is deprecated.\
|
||||||
|
Please use __USE_W32_SOCKETS instead"
|
||||||
|
#ifndef __USE_W32_SOCKETS
|
||||||
|
#define __USE_W32_SOCKETS
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#if defined(__USE_W32_SOCKETS) || !(defined(__CYGWIN__) || defined(__MSYS__) || defined(_UWIN))
|
||||||
|
#if (_WIN32_WINNT >= 0x0400)
|
||||||
|
#include <winsock2.h>
|
||||||
|
/*
|
||||||
|
* MS likes to include mswsock.h here as well,
|
||||||
|
* but that can cause undefined symbols if
|
||||||
|
* winsock2.h is included before windows.h
|
||||||
|
*/
|
||||||
|
#else
|
||||||
|
#include <winsock.h>
|
||||||
|
#endif /* (_WIN32_WINNT >= 0x0400) */
|
||||||
|
#endif
|
||||||
|
#endif /* WIN32_LEAN_AND_MEAN */
|
||||||
|
|
||||||
|
#endif /* RC_INVOKED */
|
||||||
|
|
||||||
|
#ifdef __OBJC__
|
||||||
|
/* FIXME: Not undefining BOOL here causes all BOOLs to be WINBOOL (int),
|
||||||
|
but undefining it causes trouble as well if a file is included after
|
||||||
|
windows.h
|
||||||
|
*/
|
||||||
|
#undef BOOL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
1054
bazaar/Tcc/lib/include/winapi/winerror.h
Normal file
1054
bazaar/Tcc/lib/include/winapi/winerror.h
Normal file
File diff suppressed because it is too large
Load diff
2843
bazaar/Tcc/lib/include/winapi/wingdi.h
Normal file
2843
bazaar/Tcc/lib/include/winapi/wingdi.h
Normal file
File diff suppressed because it is too large
Load diff
346
bazaar/Tcc/lib/include/winapi/winnetwk.h
Normal file
346
bazaar/Tcc/lib/include/winapi/winnetwk.h
Normal file
|
|
@ -0,0 +1,346 @@
|
||||||
|
#ifndef _WINNETWK_H
|
||||||
|
#define _WINNETWK_H
|
||||||
|
#if __GNUC__ >=3
|
||||||
|
#pragma GCC system_header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
#define WNNC_NET_MSNET 0x00010000
|
||||||
|
#define WNNC_NET_LANMAN 0x00020000
|
||||||
|
#define WNNC_NET_NETWARE 0x00030000
|
||||||
|
#define WNNC_NET_VINES 0x00040000
|
||||||
|
#define WNNC_NET_10NET 0x00050000
|
||||||
|
#define WNNC_NET_LOCUS 0x00060000
|
||||||
|
#define WNNC_NET_SUN_PC_NFS 0x00070000
|
||||||
|
#define WNNC_NET_LANSTEP 0x00080000
|
||||||
|
#define WNNC_NET_9TILES 0x00090000
|
||||||
|
#define WNNC_NET_LANTASTIC 0x000A0000
|
||||||
|
#define WNNC_NET_AS400 0x000B0000
|
||||||
|
#define WNNC_NET_FTP_NFS 0x000C0000
|
||||||
|
#define WNNC_NET_PATHWORKS 0x000D0000
|
||||||
|
#define WNNC_NET_LIFENET 0x000E0000
|
||||||
|
#define WNNC_NET_POWERLAN 0x000F0000
|
||||||
|
#define WNNC_NET_BWNFS 0x00100000
|
||||||
|
#define WNNC_NET_COGENT 0x00110000
|
||||||
|
#define WNNC_NET_FARALLON 0x00120000
|
||||||
|
#define WNNC_NET_APPLETALK 0x00130000
|
||||||
|
#define WNNC_NET_INTERGRAPH 0x00140000
|
||||||
|
#define WNNC_NET_SYMFONET 0x00150000
|
||||||
|
#define WNNC_NET_CLEARCASE 0x00160000
|
||||||
|
#define WNNC_NET_FRONTIER 0x00170000
|
||||||
|
#define WNNC_NET_BMC 0x00180000
|
||||||
|
#define WNNC_NET_DCE 0x00190000
|
||||||
|
#define WNNC_NET_AVID 0x001A0000
|
||||||
|
#define WNNC_NET_DOCUSPACE 0x001B0000
|
||||||
|
#define WNNC_NET_MANGOSOFT 0x001C0000
|
||||||
|
#define WNNC_NET_SERNET 0x001D0000
|
||||||
|
#define WNNC_NET_DECORB 0x00200000
|
||||||
|
#define WNNC_NET_PROTSTOR 0x00210000
|
||||||
|
#define WNNC_NET_FJ_REDIR 0x00220000
|
||||||
|
#define WNNC_NET_DISTINCT 0x00230000
|
||||||
|
#define WNNC_NET_TWINS 0x00240000
|
||||||
|
#define WNNC_NET_RDR2SAMPLE 0x00250000
|
||||||
|
#define WNNC_NET_CSC 0x00260000
|
||||||
|
#define WNNC_NET_3IN1 0x00270000
|
||||||
|
#define WNNC_NET_EXTENDNET 0x00290000
|
||||||
|
#define WNNC_NET_OBJECT_DIRE 0x00300000
|
||||||
|
#define WNNC_NET_MASFAX 0x00310000
|
||||||
|
#define WNNC_NET_HOB_NFS 0x00320000
|
||||||
|
#define WNNC_NET_SHIVA 0x00330000
|
||||||
|
#define WNNC_NET_IBMAL 0x00340000
|
||||||
|
#define WNNC_CRED_MANAGER 0xFFFF0000
|
||||||
|
|
||||||
|
#define RESOURCE_CONNECTED 1
|
||||||
|
#define RESOURCE_GLOBALNET 2
|
||||||
|
#define RESOURCE_REMEMBERED 3
|
||||||
|
#define RESOURCE_RECENT 4
|
||||||
|
#define RESOURCE_CONTEXT 5
|
||||||
|
#define RESOURCETYPE_ANY 0
|
||||||
|
#define RESOURCETYPE_DISK 1
|
||||||
|
#define RESOURCETYPE_PRINT 2
|
||||||
|
#define RESOURCETYPE_RESERVED 8
|
||||||
|
#define RESOURCETYPE_UNKNOWN 0xFFFFFFFF
|
||||||
|
#define RESOURCEUSAGE_CONNECTABLE 0x00000001
|
||||||
|
#define RESOURCEUSAGE_CONTAINER 0x00000002
|
||||||
|
#define RESOURCEUSAGE_NOLOCALDEVICE 0x00000004
|
||||||
|
#define RESOURCEUSAGE_SIBLING 0x00000008
|
||||||
|
#define RESOURCEUSAGE_ATTACHED 0x00000010
|
||||||
|
#define RESOURCEUSAGE_ALL (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED)
|
||||||
|
#define RESOURCEUSAGE_RESERVED 0x80000000
|
||||||
|
#define RESOURCEDISPLAYTYPE_GENERIC 0
|
||||||
|
#define RESOURCEDISPLAYTYPE_DOMAIN 1
|
||||||
|
#define RESOURCEDISPLAYTYPE_SERVER 2
|
||||||
|
#define RESOURCEDISPLAYTYPE_SHARE 3
|
||||||
|
#define RESOURCEDISPLAYTYPE_FILE 4
|
||||||
|
#define RESOURCEDISPLAYTYPE_GROUP 5
|
||||||
|
#define RESOURCEDISPLAYTYPE_NETWORK 6
|
||||||
|
#define RESOURCEDISPLAYTYPE_ROOT 7
|
||||||
|
#define RESOURCEDISPLAYTYPE_SHAREADMIN 8
|
||||||
|
#define RESOURCEDISPLAYTYPE_DIRECTORY 9
|
||||||
|
#define RESOURCEDISPLAYTYPE_TREE 10
|
||||||
|
#define NETPROPERTY_PERSISTENT 1
|
||||||
|
#define CONNECT_UPDATE_PROFILE 1
|
||||||
|
#define CONNECT_UPDATE_RECENT 2
|
||||||
|
#define CONNECT_TEMPORARY 4
|
||||||
|
#define CONNECT_INTERACTIVE 8
|
||||||
|
#define CONNECT_PROMPT 16
|
||||||
|
#define CONNECT_NEED_DRIVE 32
|
||||||
|
#define CONNECT_REFCOUNT 64
|
||||||
|
#define CONNECT_REDIRECT 128
|
||||||
|
#define CONNECT_LOCALDRIVE 256
|
||||||
|
#define CONNECT_CURRENT_MEDIA 512
|
||||||
|
#define CONNDLG_RO_PATH 1
|
||||||
|
#define CONNDLG_CONN_POINT 2
|
||||||
|
#define CONNDLG_USE_MRU 4
|
||||||
|
#define CONNDLG_HIDE_BOX 8
|
||||||
|
#define CONNDLG_PERSIST 16
|
||||||
|
#define CONNDLG_NOT_PERSIST 32
|
||||||
|
#define DISC_UPDATE_PROFILE 1
|
||||||
|
#define DISC_NO_FORCE 64
|
||||||
|
#define WNFMT_MULTILINE 1
|
||||||
|
#define WNFMT_ABBREVIATED 2
|
||||||
|
#define WNFMT_INENUM 16
|
||||||
|
#define WNFMT_CONNECTION 32
|
||||||
|
#define WN_SUCCESS NO_ERROR
|
||||||
|
#define WN_NO_ERROR NO_ERROR
|
||||||
|
#define WN_NOT_SUPPORTED ERROR_NOT_SUPPORTED
|
||||||
|
#define WN_CANCEL ERROR_CANCELLED
|
||||||
|
#define WN_RETRY ERROR_RETRY
|
||||||
|
#define WN_NET_ERROR ERROR_UNEXP_NET_ERR
|
||||||
|
#define WN_MORE_DATA ERROR_MORE_DATA
|
||||||
|
#define WN_BAD_POINTER ERROR_INVALID_ADDRESS
|
||||||
|
#define WN_BAD_VALUE ERROR_INVALID_PARAMETER
|
||||||
|
#define WN_BAD_USER ERROR_BAD_USERNAME
|
||||||
|
#define WN_BAD_PASSWORD ERROR_INVALID_PASSWORD
|
||||||
|
#define WN_ACCESS_DENIED ERROR_ACCESS_DENIED
|
||||||
|
#define WN_FUNCTION_BUSY ERROR_BUSY
|
||||||
|
#define WN_WINDOWS_ERROR ERROR_UNEXP_NET_ERR
|
||||||
|
#define WN_OUT_OF_MEMORY ERROR_NOT_ENOUGH_MEMORY
|
||||||
|
#define WN_NO_NETWORK ERROR_NO_NETWORK
|
||||||
|
#define WN_EXTENDED_ERROR ERROR_EXTENDED_ERROR
|
||||||
|
#define WN_BAD_LEVEL ERROR_INVALID_LEVEL
|
||||||
|
#define WN_BAD_HANDLE ERROR_INVALID_HANDLE
|
||||||
|
#define WN_NOT_INITIALIZING ERROR_ALREADY_INITIALIZED
|
||||||
|
#define WN_NO_MORE_DEVICES ERROR_NO_MORE_DEVICES
|
||||||
|
#define WN_NOT_CONNECTED ERROR_NOT_CONNECTED
|
||||||
|
#define WN_OPEN_FILES ERROR_OPEN_FILES
|
||||||
|
#define WN_DEVICE_IN_USE ERROR_DEVICE_IN_USE
|
||||||
|
#define WN_BAD_NETNAME ERROR_BAD_NET_NAME
|
||||||
|
#define WN_BAD_LOCALNAME ERROR_BAD_DEVICE
|
||||||
|
#define WN_ALREADY_CONNECTED ERROR_ALREADY_ASSIGNED
|
||||||
|
#define WN_DEVICE_ERROR ERROR_GEN_FAILURE
|
||||||
|
#define WN_CONNECTION_CLOSED ERROR_CONNECTION_UNAVAIL
|
||||||
|
#define WN_NO_NET_OR_BAD_PATH ERROR_NO_NET_OR_BAD_PATH
|
||||||
|
#define WN_BAD_PROVIDER ERROR_BAD_PROVIDER
|
||||||
|
#define WN_CANNOT_OPEN_PROFILE ERROR_CANNOT_OPEN_PROFILE
|
||||||
|
#define WN_BAD_PROFILE ERROR_BAD_PROFILE
|
||||||
|
#define WN_BAD_DEV_TYPE ERROR_BAD_DEV_TYPE
|
||||||
|
#define WN_DEVICE_ALREADY_REMEMBERED ERROR_DEVICE_ALREADY_REMEMBERED
|
||||||
|
#define WN_NO_MORE_ENTRIES ERROR_NO_MORE_ITEMS
|
||||||
|
#define WN_NOT_CONTAINER ERROR_NOT_CONTAINER
|
||||||
|
#define WN_NOT_AUTHENTICATED ERROR_NOT_AUTHENTICATED
|
||||||
|
#define WN_NOT_LOGGED_ON ERROR_NOT_LOGGED_ON
|
||||||
|
#define WN_NOT_VALIDATED ERROR_NO_LOGON_SERVERS
|
||||||
|
#define UNIVERSAL_NAME_INFO_LEVEL 1
|
||||||
|
#define REMOTE_NAME_INFO_LEVEL 2
|
||||||
|
#define NETINFO_DLL16 1
|
||||||
|
#define NETINFO_DISKRED 4
|
||||||
|
#define NETINFO_PRINTERRED 8
|
||||||
|
#define RP_LOGON 1
|
||||||
|
#define RP_INIFILE 2
|
||||||
|
#define PP_DISPLAYERRORS 1
|
||||||
|
#define WNCON_FORNETCARD 1
|
||||||
|
#define WNCON_NOTROUTED 2
|
||||||
|
#define WNCON_SLOWLINK 4
|
||||||
|
#define WNCON_DYNAMIC 8
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
typedef struct _NETRESOURCEA {
|
||||||
|
DWORD dwScope;
|
||||||
|
DWORD dwType;
|
||||||
|
DWORD dwDisplayType;
|
||||||
|
DWORD dwUsage;
|
||||||
|
LPSTR lpLocalName;
|
||||||
|
LPSTR lpRemoteName;
|
||||||
|
LPSTR lpComment ;
|
||||||
|
LPSTR lpProvider;
|
||||||
|
}NETRESOURCEA,*LPNETRESOURCEA;
|
||||||
|
typedef struct _NETRESOURCEW {
|
||||||
|
DWORD dwScope;
|
||||||
|
DWORD dwType;
|
||||||
|
DWORD dwDisplayType;
|
||||||
|
DWORD dwUsage;
|
||||||
|
LPWSTR lpLocalName;
|
||||||
|
LPWSTR lpRemoteName;
|
||||||
|
LPWSTR lpComment ;
|
||||||
|
LPWSTR lpProvider;
|
||||||
|
}NETRESOURCEW,*LPNETRESOURCEW;
|
||||||
|
typedef struct _CONNECTDLGSTRUCTA{
|
||||||
|
DWORD cbStructure;
|
||||||
|
HWND hwndOwner;
|
||||||
|
LPNETRESOURCEA lpConnRes;
|
||||||
|
DWORD dwFlags;
|
||||||
|
DWORD dwDevNum;
|
||||||
|
} CONNECTDLGSTRUCTA,*LPCONNECTDLGSTRUCTA;
|
||||||
|
typedef struct _CONNECTDLGSTRUCTW{
|
||||||
|
DWORD cbStructure;
|
||||||
|
HWND hwndOwner;
|
||||||
|
LPNETRESOURCEW lpConnRes;
|
||||||
|
DWORD dwFlags;
|
||||||
|
DWORD dwDevNum;
|
||||||
|
} CONNECTDLGSTRUCTW,*LPCONNECTDLGSTRUCTW;
|
||||||
|
typedef struct _DISCDLGSTRUCTA{
|
||||||
|
DWORD cbStructure;
|
||||||
|
HWND hwndOwner;
|
||||||
|
LPSTR lpLocalName;
|
||||||
|
LPSTR lpRemoteName;
|
||||||
|
DWORD dwFlags;
|
||||||
|
} DISCDLGSTRUCTA,*LPDISCDLGSTRUCTA;
|
||||||
|
typedef struct _DISCDLGSTRUCTW{
|
||||||
|
DWORD cbStructure;
|
||||||
|
HWND hwndOwner;
|
||||||
|
LPWSTR lpLocalName;
|
||||||
|
LPWSTR lpRemoteName;
|
||||||
|
DWORD dwFlags;
|
||||||
|
} DISCDLGSTRUCTW,*LPDISCDLGSTRUCTW;
|
||||||
|
typedef struct _UNIVERSAL_NAME_INFOA { LPSTR lpUniversalName; }UNIVERSAL_NAME_INFOA,*LPUNIVERSAL_NAME_INFOA;
|
||||||
|
typedef struct _UNIVERSAL_NAME_INFOW { LPWSTR lpUniversalName; }UNIVERSAL_NAME_INFOW,*LPUNIVERSAL_NAME_INFOW;
|
||||||
|
typedef struct _REMOTE_NAME_INFOA {
|
||||||
|
LPSTR lpUniversalName;
|
||||||
|
LPSTR lpConnectionName;
|
||||||
|
LPSTR lpRemainingPath;
|
||||||
|
}REMOTE_NAME_INFOA,*LPREMOTE_NAME_INFOA;
|
||||||
|
typedef struct _REMOTE_NAME_INFOW {
|
||||||
|
LPWSTR lpUniversalName;
|
||||||
|
LPWSTR lpConnectionName;
|
||||||
|
LPWSTR lpRemainingPath;
|
||||||
|
}REMOTE_NAME_INFOW,*LPREMOTE_NAME_INFOW;
|
||||||
|
typedef struct _NETINFOSTRUCT{
|
||||||
|
DWORD cbStructure;
|
||||||
|
DWORD dwProviderVersion;
|
||||||
|
DWORD dwStatus;
|
||||||
|
DWORD dwCharacteristics;
|
||||||
|
DWORD dwHandle;
|
||||||
|
WORD wNetType;
|
||||||
|
DWORD dwPrinters;
|
||||||
|
DWORD dwDrives;
|
||||||
|
} NETINFOSTRUCT,*LPNETINFOSTRUCT;
|
||||||
|
typedef UINT(PASCAL *PFNGETPROFILEPATHA)(LPCSTR,LPSTR,UINT);
|
||||||
|
typedef UINT(PASCAL *PFNGETPROFILEPATHW)(LPCWSTR,LPWSTR,UINT);
|
||||||
|
typedef UINT(PASCAL *PFNRECONCILEPROFILEA)(LPCSTR,LPCSTR,DWORD);
|
||||||
|
typedef UINT(PASCAL *PFNRECONCILEPROFILEW)(LPCWSTR,LPCWSTR,DWORD);
|
||||||
|
typedef BOOL(PASCAL *PFNPROCESSPOLICIESA)(HWND,LPCSTR,LPCSTR,LPCSTR,DWORD);
|
||||||
|
typedef BOOL(PASCAL *PFNPROCESSPOLICIESW)(HWND,LPCWSTR,LPCWSTR,LPCWSTR,DWORD);
|
||||||
|
typedef struct _NETCONNECTINFOSTRUCT{
|
||||||
|
DWORD cbStructure;
|
||||||
|
DWORD dwFlags;
|
||||||
|
DWORD dwSpeed;
|
||||||
|
DWORD dwDelay;
|
||||||
|
DWORD dwOptDataSize;
|
||||||
|
} NETCONNECTINFOSTRUCT,*LPNETCONNECTINFOSTRUCT;
|
||||||
|
|
||||||
|
DWORD APIENTRY WNetAddConnectionA(LPCSTR,LPCSTR,LPCSTR);
|
||||||
|
DWORD APIENTRY WNetAddConnectionW(LPCWSTR,LPCWSTR,LPCWSTR);
|
||||||
|
DWORD APIENTRY WNetAddConnection2A(LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD);
|
||||||
|
DWORD APIENTRY WNetAddConnection2W(LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD);
|
||||||
|
DWORD APIENTRY WNetAddConnection3A(HWND,LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD);
|
||||||
|
DWORD APIENTRY WNetAddConnection3W(HWND,LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD);
|
||||||
|
DWORD APIENTRY WNetCancelConnectionA(LPCSTR,BOOL);
|
||||||
|
DWORD APIENTRY WNetCancelConnectionW(LPCWSTR,BOOL);
|
||||||
|
DWORD APIENTRY WNetCancelConnection2A(LPCSTR,DWORD,BOOL);
|
||||||
|
DWORD APIENTRY WNetCancelConnection2W(LPCWSTR,DWORD,BOOL);
|
||||||
|
DWORD APIENTRY WNetGetConnectionA(LPCSTR,LPSTR,PDWORD);
|
||||||
|
DWORD APIENTRY WNetGetConnectionW(LPCWSTR,LPWSTR,PDWORD);
|
||||||
|
DWORD APIENTRY WNetUseConnectionA(HWND,LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD,LPSTR,PDWORD,PDWORD);
|
||||||
|
DWORD APIENTRY WNetUseConnectionW(HWND,LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD,LPWSTR,PDWORD,PDWORD);
|
||||||
|
DWORD APIENTRY WNetSetConnectionA(LPCSTR,DWORD,PVOID);
|
||||||
|
DWORD APIENTRY WNetSetConnectionW(LPCWSTR,DWORD,PVOID);
|
||||||
|
DWORD APIENTRY WNetConnectionDialog(HWND,DWORD);
|
||||||
|
DWORD APIENTRY WNetDisconnectDialog(HWND,DWORD);
|
||||||
|
DWORD APIENTRY WNetConnectionDialog1A(LPCONNECTDLGSTRUCTA);
|
||||||
|
DWORD APIENTRY WNetConnectionDialog1W(LPCONNECTDLGSTRUCTW);
|
||||||
|
DWORD APIENTRY WNetDisconnectDialog1A(LPDISCDLGSTRUCTA);
|
||||||
|
DWORD APIENTRY WNetDisconnectDialog1W(LPDISCDLGSTRUCTW);
|
||||||
|
DWORD APIENTRY WNetOpenEnumA(DWORD,DWORD,DWORD,LPNETRESOURCEA,LPHANDLE);
|
||||||
|
DWORD APIENTRY WNetOpenEnumW(DWORD,DWORD,DWORD,LPNETRESOURCEW,LPHANDLE);
|
||||||
|
DWORD APIENTRY WNetEnumResourceA(HANDLE,PDWORD,PVOID,PDWORD);
|
||||||
|
DWORD APIENTRY WNetEnumResourceW(HANDLE,PDWORD,PVOID,PDWORD);
|
||||||
|
DWORD APIENTRY WNetCloseEnum(HANDLE);
|
||||||
|
DWORD APIENTRY WNetGetUniversalNameA(LPCSTR,DWORD,PVOID,PDWORD);
|
||||||
|
DWORD APIENTRY WNetGetUniversalNameW(LPCWSTR,DWORD,PVOID,PDWORD);
|
||||||
|
DWORD APIENTRY WNetGetUserA(LPCSTR,LPSTR,PDWORD);
|
||||||
|
DWORD APIENTRY WNetGetUserW(LPCWSTR,LPWSTR,PDWORD);
|
||||||
|
DWORD APIENTRY WNetGetProviderNameA(DWORD,LPSTR,PDWORD);
|
||||||
|
DWORD APIENTRY WNetGetProviderNameW(DWORD,LPWSTR,PDWORD);
|
||||||
|
DWORD APIENTRY WNetGetNetworkInformationA(LPCSTR,LPNETINFOSTRUCT);
|
||||||
|
DWORD APIENTRY WNetGetNetworkInformationW(LPCWSTR,LPNETINFOSTRUCT);
|
||||||
|
DWORD APIENTRY WNetGetResourceInformationA(LPNETRESOURCEA,LPVOID,LPDWORD,LPCSTR*);
|
||||||
|
DWORD APIENTRY WNetGetResourceInformationW(LPNETRESOURCEA,LPVOID,LPDWORD,LPCWSTR*);
|
||||||
|
DWORD APIENTRY WNetGetLastErrorA(PDWORD,LPSTR,DWORD,LPSTR,DWORD);
|
||||||
|
DWORD APIENTRY WNetGetLastErrorW(PDWORD,LPWSTR,DWORD,LPWSTR,DWORD);
|
||||||
|
DWORD APIENTRY MultinetGetConnectionPerformanceA(LPNETRESOURCEA,LPNETCONNECTINFOSTRUCT);
|
||||||
|
DWORD APIENTRY MultinetGetConnectionPerformanceW(LPNETRESOURCEW,LPNETCONNECTINFOSTRUCT);
|
||||||
|
#ifdef UNICODE
|
||||||
|
#define PFNPROCESSPOLICIES PFNPROCESSPOLICIESW
|
||||||
|
#define PFNRECONCILEPROFILE PFNRECONCILEPROFILEW
|
||||||
|
#define PFNGETPROFILEPATH PFNGETPROFILEPATHW
|
||||||
|
typedef NETRESOURCEW NETRESOURCE,*LPNETRESOURCE;
|
||||||
|
typedef CONNECTDLGSTRUCTW CONNECTDLGSTRUCT,*LPCONNECTDLGSTRUCT;
|
||||||
|
typedef DISCDLGSTRUCTW DISCDLGSTRUCT,*LPDISCDLGSTRUCT;
|
||||||
|
typedef REMOTE_NAME_INFOW REMOTE_NAME_INFO,*LPREMOTE_NAME_INFO;
|
||||||
|
typedef UNIVERSAL_NAME_INFOW UNIVERSAL_NAME_INFO,*LPUNIVERSAL_NAME_INFO;
|
||||||
|
#define WNetEnumResource WNetEnumResourceW
|
||||||
|
#define WNetOpenEnum WNetOpenEnumW
|
||||||
|
#define WNetGetResourceInformation WNetGetResourceInformationW
|
||||||
|
#define WNetGetUniversalName WNetGetUniversalNameW
|
||||||
|
#define WNetSetConnection WNetSetConnectionW
|
||||||
|
#define WNetUseConnection WNetUseConnectionW
|
||||||
|
#define WNetGetConnection WNetGetConnectionW
|
||||||
|
#define WNetCancelConnection2 WNetCancelConnection2W
|
||||||
|
#define WNetCancelConnection WNetCancelConnectionW
|
||||||
|
#define WNetAddConnection3 WNetAddConnection3W
|
||||||
|
#define WNetAddConnection2 WNetAddConnection2W
|
||||||
|
#define WNetAddConnection WNetAddConnectionW
|
||||||
|
#define WNetConnectionDialog1 WNetConnectionDialog1W
|
||||||
|
#define WNetDisconnectDialog1 WNetDisconnectDialog1W
|
||||||
|
#define WNetGetNetworkInformation WNetGetNetworkInformationW
|
||||||
|
#define WNetGetProviderName WNetGetProviderNameW
|
||||||
|
#define WNetGetUser WNetGetUserW
|
||||||
|
#define MultinetGetConnectionPerformance MultinetGetConnectionPerformanceW
|
||||||
|
#define WNetGetLastError WNetGetLastErrorW
|
||||||
|
#else
|
||||||
|
#define PFNGETPROFILEPATH PFNGETPROFILEPATHA
|
||||||
|
#define PFNRECONCILEPROFILE PFNRECONCILEPROFILEA
|
||||||
|
#define PFNPROCESSPOLICIES PFNPROCESSPOLICIESA
|
||||||
|
typedef NETRESOURCEA NETRESOURCE,*LPNETRESOURCE;
|
||||||
|
typedef CONNECTDLGSTRUCTA CONNECTDLGSTRUCT,*LPCONNECTDLGSTRUCT;
|
||||||
|
typedef DISCDLGSTRUCTA DISCDLGSTRUCT,*LPDISCDLGSTRUCT;
|
||||||
|
typedef UNIVERSAL_NAME_INFOA UNIVERSAL_NAME_INFO,*LPUNIVERSAL_NAME_INFO;
|
||||||
|
typedef REMOTE_NAME_INFOA REMOTE_NAME_INFO,*LPREMOTE_NAME_INFO;
|
||||||
|
#define WNetOpenEnum WNetOpenEnumA
|
||||||
|
#define WNetEnumResource WNetEnumResourceA
|
||||||
|
#define WNetGetResourceInformation WNetGetResourceInformationA
|
||||||
|
#define WNetGetUniversalName WNetGetUniversalNameA
|
||||||
|
#define WNetConnectionDialog1 WNetConnectionDialog1A
|
||||||
|
#define WNetDisconnectDialog1 WNetDisconnectDialog1A
|
||||||
|
#define WNetAddConnection2 WNetAddConnection2A
|
||||||
|
#define WNetAddConnection3 WNetAddConnection3A
|
||||||
|
#define WNetCancelConnection WNetCancelConnectionA
|
||||||
|
#define WNetCancelConnection2 WNetCancelConnection2A
|
||||||
|
#define WNetGetConnection WNetGetConnectionA
|
||||||
|
#define WNetUseConnection WNetUseConnectionA
|
||||||
|
#define WNetSetConnection WNetSetConnectionA
|
||||||
|
#define WNetAddConnection WNetAddConnectionA
|
||||||
|
#define WNetGetUser WNetGetUserA
|
||||||
|
#define WNetGetProviderName WNetGetProviderNameA
|
||||||
|
#define WNetGetNetworkInformation WNetGetNetworkInformationA
|
||||||
|
#define WNetGetLastError WNetGetLastErrorA
|
||||||
|
#define MultinetGetConnectionPerformance MultinetGetConnectionPerformanceA
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
651
bazaar/Tcc/lib/include/winapi/winnls.h
Normal file
651
bazaar/Tcc/lib/include/winapi/winnls.h
Normal file
|
|
@ -0,0 +1,651 @@
|
||||||
|
#ifndef _WINNLS_H
|
||||||
|
#define _WINNLS_H
|
||||||
|
#if __GNUC__ >=3
|
||||||
|
#pragma GCC system_header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MAX_LEADBYTES 12
|
||||||
|
#define MAX_DEFAULTCHAR 2
|
||||||
|
#define LOCALE_NOUSEROVERRIDE 0x80000000
|
||||||
|
#define LOCALE_USE_CP_ACP 0x40000000
|
||||||
|
#define LOCALE_ILANGUAGE 1
|
||||||
|
#define LOCALE_SLANGUAGE 2
|
||||||
|
#define LOCALE_SENGLANGUAGE 0x1001
|
||||||
|
#define LOCALE_SABBREVLANGNAME 3
|
||||||
|
#define LOCALE_SNATIVELANGNAME 4
|
||||||
|
#define LOCALE_ICOUNTRY 5
|
||||||
|
#define LOCALE_SCOUNTRY 6
|
||||||
|
#define LOCALE_SENGCOUNTRY 0x1002
|
||||||
|
#define LOCALE_SABBREVCTRYNAME 7
|
||||||
|
#define LOCALE_SNATIVECTRYNAME 8
|
||||||
|
#define LOCALE_IDEFAULTLANGUAGE 9
|
||||||
|
#define LOCALE_IDEFAULTCOUNTRY 10
|
||||||
|
#define LOCALE_IDEFAULTCODEPAGE 11
|
||||||
|
#define LOCALE_IDEFAULTANSICODEPAGE 0x1004
|
||||||
|
#define LOCALE_SLIST 12
|
||||||
|
#define LOCALE_IMEASURE 13
|
||||||
|
#define LOCALE_SDECIMAL 14
|
||||||
|
#define LOCALE_STHOUSAND 15
|
||||||
|
#define LOCALE_SGROUPING 16
|
||||||
|
#define LOCALE_IDIGITS 17
|
||||||
|
#define LOCALE_ILZERO 18
|
||||||
|
#define LOCALE_INEGNUMBER 0x1010
|
||||||
|
#define LOCALE_SNATIVEDIGITS 19
|
||||||
|
#define LOCALE_SCURRENCY 20
|
||||||
|
#define LOCALE_SINTLSYMBOL 21
|
||||||
|
#define LOCALE_SMONDECIMALSEP 22
|
||||||
|
#define LOCALE_SMONTHOUSANDSEP 23
|
||||||
|
#define LOCALE_SMONGROUPING 24
|
||||||
|
#define LOCALE_ICURRDIGITS 25
|
||||||
|
#define LOCALE_IINTLCURRDIGITS 26
|
||||||
|
#define LOCALE_ICURRENCY 27
|
||||||
|
#define LOCALE_INEGCURR 28
|
||||||
|
#define LOCALE_SDATE 29
|
||||||
|
#define LOCALE_STIME 30
|
||||||
|
#define LOCALE_SSHORTDATE 31
|
||||||
|
#define LOCALE_SLONGDATE 32
|
||||||
|
#define LOCALE_STIMEFORMAT 0x1003
|
||||||
|
#define LOCALE_IDATE 33
|
||||||
|
#define LOCALE_ILDATE 34
|
||||||
|
#define LOCALE_ITIME 35
|
||||||
|
#define LOCALE_ITIMEMARKPOSN 0x1005
|
||||||
|
#define LOCALE_ICENTURY 36
|
||||||
|
#define LOCALE_ITLZERO 37
|
||||||
|
#define LOCALE_IDAYLZERO 38
|
||||||
|
#define LOCALE_IMONLZERO 39
|
||||||
|
#define LOCALE_S1159 40
|
||||||
|
#define LOCALE_S2359 41
|
||||||
|
#define LOCALE_ICALENDARTYPE 0x1009
|
||||||
|
#define LOCALE_IOPTIONALCALENDAR 0x100B
|
||||||
|
#define LOCALE_IFIRSTDAYOFWEEK 0x100C
|
||||||
|
#define LOCALE_IFIRSTWEEKOFYEAR 0x100D
|
||||||
|
#define LOCALE_SDAYNAME1 42
|
||||||
|
#define LOCALE_SDAYNAME2 43
|
||||||
|
#define LOCALE_SDAYNAME3 44
|
||||||
|
#define LOCALE_SDAYNAME4 45
|
||||||
|
#define LOCALE_SDAYNAME5 46
|
||||||
|
#define LOCALE_SDAYNAME6 47
|
||||||
|
#define LOCALE_SDAYNAME7 48
|
||||||
|
#define LOCALE_SABBREVDAYNAME1 49
|
||||||
|
#define LOCALE_SABBREVDAYNAME2 50
|
||||||
|
#define LOCALE_SABBREVDAYNAME3 51
|
||||||
|
#define LOCALE_SABBREVDAYNAME4 52
|
||||||
|
#define LOCALE_SABBREVDAYNAME5 53
|
||||||
|
#define LOCALE_SABBREVDAYNAME6 54
|
||||||
|
#define LOCALE_SABBREVDAYNAME7 55
|
||||||
|
#define LOCALE_SMONTHNAME1 56
|
||||||
|
#define LOCALE_SMONTHNAME2 57
|
||||||
|
#define LOCALE_SMONTHNAME3 58
|
||||||
|
#define LOCALE_SMONTHNAME4 59
|
||||||
|
#define LOCALE_SMONTHNAME5 60
|
||||||
|
#define LOCALE_SMONTHNAME6 61
|
||||||
|
#define LOCALE_SMONTHNAME7 62
|
||||||
|
#define LOCALE_SMONTHNAME8 63
|
||||||
|
#define LOCALE_SMONTHNAME9 64
|
||||||
|
#define LOCALE_SMONTHNAME10 65
|
||||||
|
#define LOCALE_SMONTHNAME11 66
|
||||||
|
#define LOCALE_SMONTHNAME12 67
|
||||||
|
#define LOCALE_SMONTHNAME13 0x100E
|
||||||
|
#define LOCALE_SABBREVMONTHNAME1 68
|
||||||
|
#define LOCALE_SABBREVMONTHNAME2 69
|
||||||
|
#define LOCALE_SABBREVMONTHNAME3 70
|
||||||
|
#define LOCALE_SABBREVMONTHNAME4 71
|
||||||
|
#define LOCALE_SABBREVMONTHNAME5 72
|
||||||
|
#define LOCALE_SABBREVMONTHNAME6 73
|
||||||
|
#define LOCALE_SABBREVMONTHNAME7 74
|
||||||
|
#define LOCALE_SABBREVMONTHNAME8 75
|
||||||
|
#define LOCALE_SABBREVMONTHNAME9 76
|
||||||
|
#define LOCALE_SABBREVMONTHNAME10 77
|
||||||
|
#define LOCALE_SABBREVMONTHNAME11 78
|
||||||
|
#define LOCALE_SABBREVMONTHNAME12 79
|
||||||
|
#define LOCALE_SABBREVMONTHNAME13 0x100F
|
||||||
|
#define LOCALE_SPOSITIVESIGN 80
|
||||||
|
#define LOCALE_SNEGATIVESIGN 81
|
||||||
|
#define LOCALE_IPOSSIGNPOSN 82
|
||||||
|
#define LOCALE_INEGSIGNPOSN 83
|
||||||
|
#define LOCALE_IPOSSYMPRECEDES 84
|
||||||
|
#define LOCALE_IPOSSEPBYSPACE 85
|
||||||
|
#define LOCALE_INEGSYMPRECEDES 86
|
||||||
|
#define LOCALE_INEGSEPBYSPACE 87
|
||||||
|
#define LOCALE_FONTSIGNATURE 88
|
||||||
|
#define LOCALE_SISO639LANGNAME 89
|
||||||
|
#define LOCALE_SISO3166CTRYNAME 90
|
||||||
|
#define LOCALE_SYSTEM_DEFAULT 0x800
|
||||||
|
#define LOCALE_USER_DEFAULT 0x400
|
||||||
|
#define NORM_IGNORECASE 1
|
||||||
|
#define NORM_IGNOREKANATYPE 65536
|
||||||
|
#define NORM_IGNORENONSPACE 2
|
||||||
|
#define NORM_IGNORESYMBOLS 4
|
||||||
|
#define NORM_IGNOREWIDTH 131072
|
||||||
|
#define SORT_STRINGSORT 4096
|
||||||
|
#define LCMAP_LOWERCASE 0x00000100
|
||||||
|
#define LCMAP_UPPERCASE 0x00000200
|
||||||
|
#define LCMAP_SORTKEY 0x00000400
|
||||||
|
#define LCMAP_BYTEREV 0x00000800
|
||||||
|
#define LCMAP_HIRAGANA 0x00100000
|
||||||
|
#define LCMAP_KATAKANA 0x00200000
|
||||||
|
#define LCMAP_HALFWIDTH 0x00400000
|
||||||
|
#define LCMAP_FULLWIDTH 0x00800000
|
||||||
|
#define LCMAP_LINGUISTIC_CASING 0x01000000
|
||||||
|
#define LCMAP_SIMPLIFIED_CHINESE 0x02000000
|
||||||
|
#define LCMAP_TRADITIONAL_CHINESE 0x04000000
|
||||||
|
#define ENUM_ALL_CALENDARS (-1)
|
||||||
|
#define DATE_SHORTDATE 1
|
||||||
|
#define DATE_LONGDATE 2
|
||||||
|
#define DATE_USE_ALT_CALENDAR 4
|
||||||
|
#define CP_INSTALLED 1
|
||||||
|
#define CP_SUPPORTED 2
|
||||||
|
#define LCID_INSTALLED 1
|
||||||
|
#define LCID_SUPPORTED 2
|
||||||
|
#define LCID_ALTERNATE_SORTS 4
|
||||||
|
#define MAP_FOLDCZONE 16
|
||||||
|
#define MAP_FOLDDIGITS 128
|
||||||
|
#define MAP_PRECOMPOSED 32
|
||||||
|
#define MAP_COMPOSITE 64
|
||||||
|
#define CP_ACP 0
|
||||||
|
#define CP_OEMCP 1
|
||||||
|
#define CP_MACCP 2
|
||||||
|
#define CP_THREAD_ACP 3
|
||||||
|
#define CP_SYMBOL 42
|
||||||
|
#define CP_UTF7 65000
|
||||||
|
#define CP_UTF8 65001
|
||||||
|
#define CT_CTYPE1 1
|
||||||
|
#define CT_CTYPE2 2
|
||||||
|
#define CT_CTYPE3 4
|
||||||
|
#define C1_UPPER 1
|
||||||
|
#define C1_LOWER 2
|
||||||
|
#define C1_DIGIT 4
|
||||||
|
#define C1_SPACE 8
|
||||||
|
#define C1_PUNCT 16
|
||||||
|
#define C1_CNTRL 32
|
||||||
|
#define C1_BLANK 64
|
||||||
|
#define C1_XDIGIT 128
|
||||||
|
#define C1_ALPHA 256
|
||||||
|
#define C2_LEFTTORIGHT 1
|
||||||
|
#define C2_RIGHTTOLEFT 2
|
||||||
|
#define C2_EUROPENUMBER 3
|
||||||
|
#define C2_EUROPESEPARATOR 4
|
||||||
|
#define C2_EUROPETERMINATOR 5
|
||||||
|
#define C2_ARABICNUMBER 6
|
||||||
|
#define C2_COMMONSEPARATOR 7
|
||||||
|
#define C2_BLOCKSEPARATOR 8
|
||||||
|
#define C2_SEGMENTSEPARATOR 9
|
||||||
|
#define C2_WHITESPACE 10
|
||||||
|
#define C2_OTHERNEUTRAL 11
|
||||||
|
#define C2_NOTAPPLICABLE 0
|
||||||
|
#define C3_NONSPACING 1
|
||||||
|
#define C3_DIACRITIC 2
|
||||||
|
#define C3_VOWELMARK 4
|
||||||
|
#define C3_SYMBOL 8
|
||||||
|
#define C3_KATAKANA 16
|
||||||
|
#define C3_HIRAGANA 32
|
||||||
|
#define C3_HALFWIDTH 64
|
||||||
|
#define C3_FULLWIDTH 128
|
||||||
|
#define C3_IDEOGRAPH 256
|
||||||
|
#define C3_KASHIDA 512
|
||||||
|
#define C3_LEXICAL 1024
|
||||||
|
#define C3_ALPHA 32768
|
||||||
|
#define C3_NOTAPPLICABLE 0
|
||||||
|
#define TIME_NOMINUTESORSECONDS 1
|
||||||
|
#define TIME_NOSECONDS 2
|
||||||
|
#define TIME_NOTIMEMARKER 4
|
||||||
|
#define TIME_FORCE24HOURFORMAT 8
|
||||||
|
#define MB_PRECOMPOSED 1
|
||||||
|
#define MB_COMPOSITE 2
|
||||||
|
#define MB_ERR_INVALID_CHARS 8
|
||||||
|
#define MB_USEGLYPHCHARS 4
|
||||||
|
#define WC_COMPOSITECHECK 512
|
||||||
|
#define WC_DISCARDNS 16
|
||||||
|
#define WC_SEPCHARS 32
|
||||||
|
#define WC_DEFAULTCHAR 64
|
||||||
|
#define CTRY_DEFAULT 0
|
||||||
|
#define CTRY_ALBANIA 355
|
||||||
|
#define CTRY_ALGERIA 213
|
||||||
|
#define CTRY_ARGENTINA 54
|
||||||
|
#define CTRY_ARMENIA 374
|
||||||
|
#define CTRY_AUSTRALIA 61
|
||||||
|
#define CTRY_AUSTRIA 43
|
||||||
|
#define CTRY_AZERBAIJAN 994
|
||||||
|
#define CTRY_BAHRAIN 973
|
||||||
|
#define CTRY_BELARUS 375
|
||||||
|
#define CTRY_BELGIUM 32
|
||||||
|
#define CTRY_BELIZE 501
|
||||||
|
#define CTRY_BOLIVIA 591
|
||||||
|
#define CTRY_BRAZIL 55
|
||||||
|
#define CTRY_BRUNEI_DARUSSALAM 673
|
||||||
|
#define CTRY_BULGARIA 359
|
||||||
|
#define CTRY_CANADA 2
|
||||||
|
#define CTRY_CARIBBEAN 1
|
||||||
|
#define CTRY_CHILE 56
|
||||||
|
#define CTRY_COLOMBIA 57
|
||||||
|
#define CTRY_COSTA_RICA 506
|
||||||
|
#define CTRY_CROATIA 385
|
||||||
|
#define CTRY_CZECH 420
|
||||||
|
#define CTRY_DENMARK 45
|
||||||
|
#define CTRY_DOMINICAN_REPUBLIC 1
|
||||||
|
#define CTRY_ECUADOR 593
|
||||||
|
#define CTRY_EGYPT 20
|
||||||
|
#define CTRY_EL_SALVADOR 503
|
||||||
|
#define CTRY_ESTONIA 372
|
||||||
|
#define CTRY_FAEROE_ISLANDS 298
|
||||||
|
#define CTRY_FINLAND 358
|
||||||
|
#define CTRY_FRANCE 33
|
||||||
|
#define CTRY_GEORGIA 995
|
||||||
|
#define CTRY_GERMANY 49
|
||||||
|
#define CTRY_GREECE 30
|
||||||
|
#define CTRY_GUATEMALA 502
|
||||||
|
#define CTRY_HONDURAS 504
|
||||||
|
#define CTRY_HONG_KONG 852
|
||||||
|
#define CTRY_HUNGARY 36
|
||||||
|
#define CTRY_ICELAND 354
|
||||||
|
#define CTRY_INDIA 91
|
||||||
|
#define CTRY_INDONESIA 62
|
||||||
|
#define CTRY_IRAN 981
|
||||||
|
#define CTRY_IRAQ 964
|
||||||
|
#define CTRY_IRELAND 353
|
||||||
|
#define CTRY_ISRAEL 972
|
||||||
|
#define CTRY_ITALY 39
|
||||||
|
#define CTRY_JAMAICA 1
|
||||||
|
#define CTRY_JAPAN 81
|
||||||
|
#define CTRY_JORDAN 962
|
||||||
|
#define CTRY_KAZAKSTAN 7
|
||||||
|
#define CTRY_KENYA 254
|
||||||
|
#define CTRY_KUWAIT 965
|
||||||
|
#define CTRY_LATVIA 371
|
||||||
|
#define CTRY_LEBANON 961
|
||||||
|
#define CTRY_LIBYA 218
|
||||||
|
#define CTRY_LIECHTENSTEIN 41
|
||||||
|
#define CTRY_LITHUANIA 370
|
||||||
|
#define CTRY_LUXEMBOURG 352
|
||||||
|
#define CTRY_MACAU 853
|
||||||
|
#define CTRY_MACEDONIA 389
|
||||||
|
#define CTRY_MALAYSIA 60
|
||||||
|
#define CTRY_MEXICO 52
|
||||||
|
#define CTRY_MONACO 33
|
||||||
|
#define CTRY_MOROCCO 212
|
||||||
|
#define CTRY_NETHERLANDS 31
|
||||||
|
#define CTRY_NEW_ZEALAND 64
|
||||||
|
#define CTRY_NICARAGUA 505
|
||||||
|
#define CTRY_NORWAY 47
|
||||||
|
#define CTRY_OMAN 968
|
||||||
|
#define CTRY_PAKISTAN 92
|
||||||
|
#define CTRY_PANAMA 507
|
||||||
|
#define CTRY_PARAGUAY 595
|
||||||
|
#define CTRY_PERU 51
|
||||||
|
#define CTRY_PHILIPPINES 63
|
||||||
|
#define CTRY_POLAND 48
|
||||||
|
#define CTRY_PORTUGAL 351
|
||||||
|
#define CTRY_PRCHINA 86
|
||||||
|
#define CTRY_PUERTO_RICO 1
|
||||||
|
#define CTRY_QATAR 974
|
||||||
|
#define CTRY_ROMANIA 40
|
||||||
|
#define CTRY_RUSSIA 7
|
||||||
|
#define CTRY_SAUDI_ARABIA 966
|
||||||
|
#define CTRY_SERBIA 381
|
||||||
|
#define CTRY_SINGAPORE 65
|
||||||
|
#define CTRY_SLOVAK 421
|
||||||
|
#define CTRY_SLOVENIA 386
|
||||||
|
#define CTRY_SOUTH_AFRICA 27
|
||||||
|
#define CTRY_SOUTH_KOREA 82
|
||||||
|
#define CTRY_SPAIN 34
|
||||||
|
#define CTRY_SWEDEN 46
|
||||||
|
#define CTRY_SWITZERLAND 41
|
||||||
|
#define CTRY_SYRIA 963
|
||||||
|
#define CTRY_TAIWAN 886
|
||||||
|
#define CTRY_TATARSTAN 7
|
||||||
|
#define CTRY_THAILAND 66
|
||||||
|
#define CTRY_TRINIDAD_Y_TOBAGO 1
|
||||||
|
#define CTRY_TUNISIA 216
|
||||||
|
#define CTRY_TURKEY 90
|
||||||
|
#define CTRY_UAE 971
|
||||||
|
#define CTRY_UKRAINE 380
|
||||||
|
#define CTRY_UNITED_KINGDOM 44
|
||||||
|
#define CTRY_UNITED_STATES 1
|
||||||
|
#define CTRY_URUGUAY 598
|
||||||
|
#define CTRY_UZBEKISTAN 7
|
||||||
|
#define CTRY_VENEZUELA 58
|
||||||
|
#define CTRY_VIET_NAM 84
|
||||||
|
#define CTRY_YEMEN 967
|
||||||
|
#define CTRY_ZIMBABWE 263
|
||||||
|
#define CAL_ICALINTVALUE 1
|
||||||
|
#define CAL_SCALNAME 2
|
||||||
|
#define CAL_IYEAROFFSETRANGE 3
|
||||||
|
#define CAL_SERASTRING 4
|
||||||
|
#define CAL_SSHORTDATE 5
|
||||||
|
#define CAL_SLONGDATE 6
|
||||||
|
#define CAL_SDAYNAME1 7
|
||||||
|
#define CAL_SDAYNAME2 8
|
||||||
|
#define CAL_SDAYNAME3 9
|
||||||
|
#define CAL_SDAYNAME4 10
|
||||||
|
#define CAL_SDAYNAME5 11
|
||||||
|
#define CAL_SDAYNAME6 12
|
||||||
|
#define CAL_SDAYNAME7 13
|
||||||
|
#define CAL_SABBREVDAYNAME1 14
|
||||||
|
#define CAL_SABBREVDAYNAME2 15
|
||||||
|
#define CAL_SABBREVDAYNAME3 16
|
||||||
|
#define CAL_SABBREVDAYNAME4 17
|
||||||
|
#define CAL_SABBREVDAYNAME5 18
|
||||||
|
#define CAL_SABBREVDAYNAME6 19
|
||||||
|
#define CAL_SABBREVDAYNAME7 20
|
||||||
|
#define CAL_SMONTHNAME1 21
|
||||||
|
#define CAL_SMONTHNAME2 22
|
||||||
|
#define CAL_SMONTHNAME3 23
|
||||||
|
#define CAL_SMONTHNAME4 24
|
||||||
|
#define CAL_SMONTHNAME5 25
|
||||||
|
#define CAL_SMONTHNAME6 26
|
||||||
|
#define CAL_SMONTHNAME7 27
|
||||||
|
#define CAL_SMONTHNAME8 28
|
||||||
|
#define CAL_SMONTHNAME9 29
|
||||||
|
#define CAL_SMONTHNAME10 30
|
||||||
|
#define CAL_SMONTHNAME11 31
|
||||||
|
#define CAL_SMONTHNAME12 32
|
||||||
|
#define CAL_SMONTHNAME13 33
|
||||||
|
#define CAL_SABBREVMONTHNAME1 34
|
||||||
|
#define CAL_SABBREVMONTHNAME2 35
|
||||||
|
#define CAL_SABBREVMONTHNAME3 36
|
||||||
|
#define CAL_SABBREVMONTHNAME4 37
|
||||||
|
#define CAL_SABBREVMONTHNAME5 38
|
||||||
|
#define CAL_SABBREVMONTHNAME6 39
|
||||||
|
#define CAL_SABBREVMONTHNAME7 40
|
||||||
|
#define CAL_SABBREVMONTHNAME8 41
|
||||||
|
#define CAL_SABBREVMONTHNAME9 42
|
||||||
|
#define CAL_SABBREVMONTHNAME10 43
|
||||||
|
#define CAL_SABBREVMONTHNAME11 44
|
||||||
|
#define CAL_SABBREVMONTHNAME12 45
|
||||||
|
#define CAL_SABBREVMONTHNAME13 46
|
||||||
|
#define CAL_GREGORIAN 1
|
||||||
|
#define CAL_GREGORIAN_US 2
|
||||||
|
#define CAL_JAPAN 3
|
||||||
|
#define CAL_TAIWAN 4
|
||||||
|
#define CAL_KOREA 5
|
||||||
|
#define CAL_HIJRI 6
|
||||||
|
#define CAL_THAI 7
|
||||||
|
#define CAL_HEBREW 8
|
||||||
|
#define CAL_GREGORIAN_ME_FRENCH 9
|
||||||
|
#define CAL_GREGORIAN_ARABIC 10
|
||||||
|
#define CAL_GREGORIAN_XLIT_ENGLISH 11
|
||||||
|
#define CAL_GREGORIAN_XLIT_FRENCH 12
|
||||||
|
#define CSTR_LESS_THAN 1
|
||||||
|
#define CSTR_EQUAL 2
|
||||||
|
#define CSTR_GREATER_THAN 3
|
||||||
|
#define LGRPID_INSTALLED 1
|
||||||
|
#define LGRPID_SUPPORTED 2
|
||||||
|
#define LGRPID_WESTERN_EUROPE 1
|
||||||
|
#define LGRPID_CENTRAL_EUROPE 2
|
||||||
|
#define LGRPID_BALTIC 3
|
||||||
|
#define LGRPID_GREEK 4
|
||||||
|
#define LGRPID_CYRILLIC 5
|
||||||
|
#define LGRPID_TURKISH 6
|
||||||
|
#define LGRPID_JAPANESE 7
|
||||||
|
#define LGRPID_KOREAN 8
|
||||||
|
#define LGRPID_TRADITIONAL_CHINESE 9
|
||||||
|
#define LGRPID_SIMPLIFIED_CHINESE 10
|
||||||
|
#define LGRPID_THAI 11
|
||||||
|
#define LGRPID_HEBREW 12
|
||||||
|
#define LGRPID_ARABIC 13
|
||||||
|
#define LGRPID_VIETNAMESE 14
|
||||||
|
#define LGRPID_INDIC 15
|
||||||
|
#define LGRPID_GEORGIAN 16
|
||||||
|
#define LGRPID_ARMENIAN 17
|
||||||
|
|
||||||
|
#if(WINVER >= 0x0500)
|
||||||
|
#define LOCALE_SYEARMONTH 0x1006
|
||||||
|
#define LOCALE_SENGCURRNAME 0x1007
|
||||||
|
#define LOCALE_SNATIVECURRNAME 0x1008
|
||||||
|
#define LOCALE_IDEFAULTEBCDICCODEPAGE 0x1012
|
||||||
|
#define LOCALE_SSORTNAME 0x1013
|
||||||
|
#define LOCALE_IDIGITSUBSTITUTION 0x1014
|
||||||
|
#define LOCALE_IPAPERSIZE 0x100A
|
||||||
|
#define DATE_YEARMONTH 8
|
||||||
|
#define DATE_LTRREADING 16
|
||||||
|
#define DATE_RTLREADING 32
|
||||||
|
#define MAP_EXPAND_LIGATURES 0x2000
|
||||||
|
#define WC_NO_BEST_FIT_CHARS 1024
|
||||||
|
#define CAL_SYEARMONTH 47
|
||||||
|
#define CAL_ITWODIGITYEARMAX 48
|
||||||
|
#define CAL_NOUSEROVERRIDE LOCALE_NOUSEROVERRIDE
|
||||||
|
#define CAL_RETURN_NUMBER LOCALE_RETURN_NUMBER
|
||||||
|
#define CAL_USE_CP_ACP LOCALE_USE_CP_ACP
|
||||||
|
#endif /* WINVER >= 0x0500 */
|
||||||
|
#ifndef _BASETSD_H
|
||||||
|
typedef long LONG_PTR;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
typedef DWORD LCTYPE;
|
||||||
|
typedef DWORD CALTYPE;
|
||||||
|
typedef DWORD CALID;
|
||||||
|
typedef DWORD LGRPID;
|
||||||
|
typedef BOOL (CALLBACK *CALINFO_ENUMPROCA)(LPSTR);
|
||||||
|
typedef BOOL (CALLBACK *CALINFO_ENUMPROCW)(LPWSTR);
|
||||||
|
typedef BOOL (CALLBACK* CALINFO_ENUMPROCEXA)(LPSTR, CALID);
|
||||||
|
typedef BOOL (CALLBACK* CALINFO_ENUMPROCEXW)(LPWSTR, CALID);
|
||||||
|
typedef BOOL (CALLBACK* LANGUAGEGROUP_ENUMPROCA)(LGRPID, LPSTR, LPSTR, DWORD, LONG_PTR);
|
||||||
|
typedef BOOL (CALLBACK* LANGUAGEGROUP_ENUMPROCW)(LGRPID, LPWSTR, LPWSTR, DWORD, LONG_PTR);
|
||||||
|
typedef BOOL (CALLBACK* LANGGROUPLOCALE_ENUMPROCA)(LGRPID, LCID, LPSTR, LONG_PTR);
|
||||||
|
typedef BOOL (CALLBACK* LANGGROUPLOCALE_ENUMPROCW)(LGRPID, LCID, LPWSTR, LONG_PTR);
|
||||||
|
typedef BOOL (CALLBACK* UILANGUAGE_ENUMPROCW)(LPWSTR, LONG_PTR);
|
||||||
|
typedef BOOL (CALLBACK* UILANGUAGE_ENUMPROCA)(LPSTR, LONG_PTR);
|
||||||
|
typedef BOOL (CALLBACK *LOCALE_ENUMPROCA)(LPSTR);
|
||||||
|
typedef BOOL (CALLBACK *LOCALE_ENUMPROCW)(LPWSTR);
|
||||||
|
typedef BOOL (CALLBACK *CODEPAGE_ENUMPROCA)(LPSTR);
|
||||||
|
typedef BOOL (CALLBACK *CODEPAGE_ENUMPROCW)(LPWSTR);
|
||||||
|
typedef BOOL (CALLBACK *DATEFMT_ENUMPROCA)(LPSTR);
|
||||||
|
typedef BOOL (CALLBACK *DATEFMT_ENUMPROCW)(LPWSTR);
|
||||||
|
typedef BOOL (CALLBACK* DATEFMT_ENUMPROCEXA)(LPSTR, CALID);
|
||||||
|
typedef BOOL (CALLBACK* DATEFMT_ENUMPROCEXW)(LPWSTR, CALID);
|
||||||
|
typedef BOOL (CALLBACK *TIMEFMT_ENUMPROCA)(LPSTR);
|
||||||
|
typedef BOOL (CALLBACK *TIMEFMT_ENUMPROCW)(LPWSTR);
|
||||||
|
|
||||||
|
typedef struct _cpinfo {
|
||||||
|
UINT MaxCharSize;
|
||||||
|
BYTE DefaultChar[MAX_DEFAULTCHAR];
|
||||||
|
BYTE LeadByte[MAX_LEADBYTES];
|
||||||
|
} CPINFO,*LPCPINFO;
|
||||||
|
typedef struct _cpinfoexA {
|
||||||
|
UINT MaxCharSize;
|
||||||
|
BYTE DefaultChar[MAX_DEFAULTCHAR];
|
||||||
|
BYTE LeadByte[MAX_LEADBYTES];
|
||||||
|
WCHAR UnicodeDefaultChar;
|
||||||
|
UINT CodePage;
|
||||||
|
CHAR CodePageName[MAX_PATH];
|
||||||
|
} CPINFOEXA, *LPCPINFOEXA;
|
||||||
|
typedef struct _cpinfoexW {
|
||||||
|
UINT MaxCharSize;
|
||||||
|
BYTE DefaultChar[MAX_DEFAULTCHAR];
|
||||||
|
BYTE LeadByte[MAX_LEADBYTES];
|
||||||
|
WCHAR UnicodeDefaultChar;
|
||||||
|
UINT CodePage;
|
||||||
|
WCHAR CodePageName[MAX_PATH];
|
||||||
|
} CPINFOEXW, *LPCPINFOEXW;
|
||||||
|
typedef struct _currencyfmtA {
|
||||||
|
UINT NumDigits;
|
||||||
|
UINT LeadingZero;
|
||||||
|
UINT Grouping;
|
||||||
|
LPSTR lpDecimalSep;
|
||||||
|
LPSTR lpThousandSep;
|
||||||
|
UINT NegativeOrder;
|
||||||
|
UINT PositiveOrder;
|
||||||
|
LPSTR lpCurrencySymbol;
|
||||||
|
} CURRENCYFMTA, *LPCURRENCYFMTA;
|
||||||
|
typedef struct _currencyfmtW {
|
||||||
|
UINT NumDigits;
|
||||||
|
UINT LeadingZero;
|
||||||
|
UINT Grouping;
|
||||||
|
LPWSTR lpDecimalSep;
|
||||||
|
LPWSTR lpThousandSep;
|
||||||
|
UINT NegativeOrder;
|
||||||
|
UINT PositiveOrder;
|
||||||
|
LPWSTR lpCurrencySymbol;
|
||||||
|
} CURRENCYFMTW, *LPCURRENCYFMTW;
|
||||||
|
typedef struct _numberfmtA {
|
||||||
|
UINT NumDigits;
|
||||||
|
UINT LeadingZero;
|
||||||
|
UINT Grouping;
|
||||||
|
LPSTR lpDecimalSep;
|
||||||
|
LPSTR lpThousandSep;
|
||||||
|
UINT NegativeOrder;
|
||||||
|
} NUMBERFMTA, *LPNUMBERFMTA;
|
||||||
|
typedef struct _numberfmtW {
|
||||||
|
UINT NumDigits;
|
||||||
|
UINT LeadingZero;
|
||||||
|
UINT Grouping;
|
||||||
|
LPWSTR lpDecimalSep;
|
||||||
|
LPWSTR lpThousandSep;
|
||||||
|
UINT NegativeOrder;
|
||||||
|
} NUMBERFMTW, *LPNUMBERFMTW;
|
||||||
|
|
||||||
|
int WINAPI CompareStringA(LCID,DWORD,LPCSTR,int,LPCSTR,int);
|
||||||
|
int WINAPI CompareStringW(LCID,DWORD,LPCWSTR,int,LPCWSTR,int);
|
||||||
|
LCID WINAPI ConvertDefaultLocale(LCID);
|
||||||
|
BOOL WINAPI EnumCalendarInfoA(CALINFO_ENUMPROCA,LCID,CALID,CALTYPE);
|
||||||
|
BOOL WINAPI EnumCalendarInfoW(CALINFO_ENUMPROCW,LCID,CALID,CALTYPE);
|
||||||
|
BOOL WINAPI EnumDateFormatsA(DATEFMT_ENUMPROCA,LCID,DWORD);
|
||||||
|
BOOL WINAPI EnumDateFormatsW(DATEFMT_ENUMPROCW,LCID,DWORD);
|
||||||
|
BOOL WINAPI EnumSystemCodePagesA(CODEPAGE_ENUMPROCA,DWORD);
|
||||||
|
BOOL WINAPI EnumSystemCodePagesW(CODEPAGE_ENUMPROCW,DWORD);
|
||||||
|
BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA,DWORD);
|
||||||
|
BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD);
|
||||||
|
BOOL WINAPI EnumTimeFormatsA(TIMEFMT_ENUMPROCA,LCID,DWORD);
|
||||||
|
BOOL WINAPI EnumTimeFormatsW(TIMEFMT_ENUMPROCW,LCID,DWORD);
|
||||||
|
int WINAPI FoldStringA(DWORD,LPCSTR,int,LPSTR,int);
|
||||||
|
int WINAPI FoldStringW(DWORD,LPCWSTR,int,LPWSTR,int);
|
||||||
|
UINT WINAPI GetACP(void);
|
||||||
|
BOOL WINAPI GetCPInfo(UINT,LPCPINFO);
|
||||||
|
BOOL WINAPI GetCPInfoExA(UINT,DWORD,LPCPINFOEXA);
|
||||||
|
BOOL WINAPI GetCPInfoExW(UINT,DWORD,LPCPINFOEXW);
|
||||||
|
int WINAPI GetCurrencyFormatA(LCID,DWORD,LPCSTR,const CURRENCYFMTA*,LPSTR,int);
|
||||||
|
int WINAPI GetCurrencyFormatW(LCID,DWORD,LPCWSTR,const CURRENCYFMTW*,LPWSTR,int);
|
||||||
|
int WINAPI GetDateFormatA(LCID,DWORD,const SYSTEMTIME*,LPCSTR,LPSTR,int);
|
||||||
|
int WINAPI GetDateFormatW(LCID,DWORD,const SYSTEMTIME*,LPCWSTR,LPWSTR,int);
|
||||||
|
int WINAPI GetLocaleInfoA(LCID,LCTYPE,LPSTR,int);
|
||||||
|
int WINAPI GetLocaleInfoW(LCID,LCTYPE,LPWSTR,int);
|
||||||
|
int WINAPI GetNumberFormatA(LCID,DWORD,LPCSTR,const NUMBERFMTA*,LPSTR,int);
|
||||||
|
int WINAPI GetNumberFormatW(LCID,DWORD,LPCWSTR,const NUMBERFMTW*,LPWSTR,int);
|
||||||
|
UINT WINAPI GetOEMCP(void);
|
||||||
|
BOOL WINAPI GetStringTypeA(LCID,DWORD,LPCSTR,int,LPWORD);
|
||||||
|
BOOL WINAPI GetStringTypeW(DWORD,LPCWSTR,int,LPWORD);
|
||||||
|
BOOL WINAPI GetStringTypeExA(LCID,DWORD,LPCSTR,int,LPWORD);
|
||||||
|
BOOL WINAPI GetStringTypeExW(LCID,DWORD,LPCWSTR,int,LPWORD);
|
||||||
|
LANGID WINAPI GetSystemDefaultLangID(void);
|
||||||
|
LCID WINAPI GetSystemDefaultLCID(void);
|
||||||
|
LCID WINAPI GetThreadLocale(void);
|
||||||
|
int WINAPI GetTimeFormatA(LCID,DWORD,const SYSTEMTIME*,LPCSTR,LPSTR,int);
|
||||||
|
int WINAPI GetTimeFormatW(LCID,DWORD,const SYSTEMTIME*,LPCWSTR,LPWSTR,int);
|
||||||
|
LANGID WINAPI GetUserDefaultLangID(void);
|
||||||
|
LCID WINAPI GetUserDefaultLCID(void);
|
||||||
|
BOOL WINAPI IsDBCSLeadByte(BYTE);
|
||||||
|
BOOL WINAPI IsDBCSLeadByteEx(UINT,BYTE);
|
||||||
|
BOOL WINAPI IsValidCodePage(UINT);
|
||||||
|
BOOL WINAPI IsValidLocale(LCID,DWORD);
|
||||||
|
int WINAPI LCMapStringA(LCID,DWORD,LPCSTR,int,LPSTR,int);
|
||||||
|
int WINAPI LCMapStringW(LCID,DWORD,LPCWSTR,int,LPWSTR,int);
|
||||||
|
int WINAPI MultiByteToWideChar(UINT,DWORD,LPCSTR,int,LPWSTR,int);
|
||||||
|
BOOL WINAPI SetLocaleInfoA(LCID,LCTYPE,LPCSTR);
|
||||||
|
BOOL WINAPI SetLocaleInfoW(LCID,LCTYPE,LPCWSTR);
|
||||||
|
BOOL WINAPI SetThreadLocale(LCID);
|
||||||
|
int WINAPI WideCharToMultiByte(UINT,DWORD,LPCWSTR,int,LPSTR,int,LPCSTR,LPBOOL);
|
||||||
|
#if (WINVER >= 0x0500)
|
||||||
|
BOOL WINAPI EnumCalendarInfoExA(CALINFO_ENUMPROCEXA,LCID,CALID,CALTYPE);
|
||||||
|
BOOL WINAPI EnumCalendarInfoExW(CALINFO_ENUMPROCEXW,LCID,CALID,CALTYPE);
|
||||||
|
BOOL WINAPI EnumDateFormatsExA(DATEFMT_ENUMPROCEXA,LCID,DWORD);
|
||||||
|
BOOL WINAPI EnumDateFormatsExW(DATEFMT_ENUMPROCEXW,LCID,DWORD);
|
||||||
|
BOOL WINAPI EnumSystemLanguageGroupsA(LANGUAGEGROUP_ENUMPROCA,DWORD,LONG_PTR);
|
||||||
|
BOOL WINAPI EnumSystemLanguageGroupsW(LANGUAGEGROUP_ENUMPROCW,DWORD,LONG_PTR);
|
||||||
|
BOOL WINAPI EnumLanguageGroupLocalesA(LANGGROUPLOCALE_ENUMPROCA,LGRPID,DWORD,LONG_PTR);
|
||||||
|
BOOL WINAPI EnumLanguageGroupLocalesW(LANGGROUPLOCALE_ENUMPROCW,LGRPID,DWORD,LONG_PTR);
|
||||||
|
BOOL WINAPI EnumUILanguagesA(UILANGUAGE_ENUMPROCA,DWORD,LONG_PTR);
|
||||||
|
BOOL WINAPI EnumUILanguagesW(UILANGUAGE_ENUMPROCW,DWORD,LONG_PTR);
|
||||||
|
LANGID WINAPI GetSystemDefaultUILanguage(void);
|
||||||
|
LANGID WINAPI GetUserDefaultUILanguage(void);
|
||||||
|
BOOL WINAPI IsValidLanguageGroup(LGRPID,DWORD);
|
||||||
|
#endif /* (WINVER >= 0x0500) */
|
||||||
|
|
||||||
|
#ifdef UNICODE
|
||||||
|
#define CALINFO_ENUMPROC CALINFO_ENUMPROCW
|
||||||
|
#define CALINFO_ENUMPROCEX CALINFO_ENUMPROCEXW
|
||||||
|
#define LOCALE_ENUMPROC LOCALE_ENUMPROCW
|
||||||
|
#define CODEPAGE_ENUMPROC CODEPAGE_ENUMPROCW
|
||||||
|
#define DATEFMT_ENUMPROC DATEFMT_ENUMPROCW
|
||||||
|
#define DATEFMT_ENUMPROCEX DATEFMT_ENUMPROCEXW
|
||||||
|
#define TIMEFMT_ENUMPROC TIMEFMT_ENUMPROCW
|
||||||
|
#define LANGUAGEGROUP_ENUMPROC LANGUAGEGROUP_ENUMPROCW
|
||||||
|
#define LANGGROUPLOCALE_ENUMPROC LANGGROUPLOCALE_ENUMPROCW
|
||||||
|
#define UILANGUAGE_ENUMPROC UILANGUAGE_ENUMPROCW
|
||||||
|
typedef CPINFOEXW CPINFOEX;
|
||||||
|
typedef LPCPINFOEXW LPCPINFOEX;
|
||||||
|
typedef CURRENCYFMTW CURRENCYFMT;
|
||||||
|
typedef LPCURRENCYFMTW LPCURRENCYFMT;
|
||||||
|
typedef NUMBERFMTW NUMBERFMT;
|
||||||
|
typedef LPNUMBERFMTW LPNUMBERFMT;
|
||||||
|
#define CompareString CompareStringW
|
||||||
|
#define EnumCalendarInfo EnumCalendarInfoW
|
||||||
|
#define EnumSystemCodePages EnumSystemCodePagesW
|
||||||
|
#define EnumSystemLocales EnumSystemLocalesW
|
||||||
|
#define EnumTimeFormats EnumTimeFormatsW
|
||||||
|
#define FoldString FoldStringW
|
||||||
|
#define GetCPInfoEx GetCPInfoExW
|
||||||
|
#define GetCurrencyFormat GetCurrencyFormatW
|
||||||
|
#define GetDateFormat GetDateFormatW
|
||||||
|
#define GetLocaleInfo GetLocaleInfoW
|
||||||
|
#define GetNumberFormat GetNumberFormatW
|
||||||
|
#define GetStringTypeEx GetStringTypeExW
|
||||||
|
#define GetTimeFormat GetTimeFormatW
|
||||||
|
#define LCMapString LCMapStringW
|
||||||
|
#define SetLocaleInfo SetLocaleInfoW
|
||||||
|
#if (WINVER >= 0x0500)
|
||||||
|
#define EnumCalendarInfoEx EnumCalendarInfoExW;
|
||||||
|
#define EnumDateFormatsEx EnumDateFormatsExW;
|
||||||
|
#define EnumSystemLanguageGroups EnumSystemLanguageGroupsW;
|
||||||
|
#define EnumLanguageGroupLocales EnumLanguageGroupLocalesW;
|
||||||
|
#define EnumUILanguages EnumUILanguagesW;
|
||||||
|
#endif /* (WINVER >= 0x0500) */
|
||||||
|
#else
|
||||||
|
#define CALINFO_ENUMPROC CALINFO_ENUMPROCA
|
||||||
|
#define CALINFO_ENUMPROCEX CALINFO_ENUMPROCEXA
|
||||||
|
#define LOCALE_ENUMPROC LOCALE_ENUMPROCA
|
||||||
|
#define CODEPAGE_ENUMPROC CODEPAGE_ENUMPROCA
|
||||||
|
#define DATEFMT_ENUMPROC DATEFMT_ENUMPROCA
|
||||||
|
#define DATEFMT_ENUMPROCEX DATEFMT_ENUMPROCEXA
|
||||||
|
#define TIMEFMT_ENUMPROC TIMEFMT_ENUMPROCA
|
||||||
|
#define LANGUAGEGROUP_ENUMPROC LANGUAGEGROUP_ENUMPROCA
|
||||||
|
#define LANGGROUPLOCALE_ENUMPROC LANGGROUPLOCALE_ENUMPROCA
|
||||||
|
#define UILANGUAGE_ENUMPROC UILANGUAGE_ENUMPROCA
|
||||||
|
typedef CPINFOEXA CPINFOEX;
|
||||||
|
typedef LPCPINFOEXA LPCPINFOEX;
|
||||||
|
typedef CURRENCYFMTA CURRENCYFMT;
|
||||||
|
typedef LPCURRENCYFMTA LPCURRENCYFMT;
|
||||||
|
typedef NUMBERFMTA NUMBERFMT;
|
||||||
|
typedef LPNUMBERFMTA LPNUMBERFMT;
|
||||||
|
#define CompareString CompareStringA
|
||||||
|
#define EnumCalendarInfo EnumCalendarInfoA
|
||||||
|
#define EnumSystemCodePages EnumSystemCodePagesA
|
||||||
|
#define EnumSystemLocales EnumSystemLocalesA
|
||||||
|
#define EnumTimeFormats EnumTimeFormatsA
|
||||||
|
#define FoldString FoldStringA
|
||||||
|
#define GetCPInfoEx GetCPInfoExA
|
||||||
|
#define GetCurrencyFormat GetCurrencyFormatA
|
||||||
|
#define GetDateFormat GetDateFormatA
|
||||||
|
#define GetLocaleInfo GetLocaleInfoA
|
||||||
|
#define GetNumberFormat GetNumberFormatA
|
||||||
|
#define GetStringTypeEx GetStringTypeExA
|
||||||
|
#define GetTimeFormat GetTimeFormatA
|
||||||
|
#define LCMapString LCMapStringA
|
||||||
|
#define SetLocaleInfo SetLocaleInfoA
|
||||||
|
#if (WINVER >= 0x0500)
|
||||||
|
#define EnumCalendarInfoEx EnumCalendarInfoExA;
|
||||||
|
#define EnumDateFormatsEx EnumDateFormatsExA;
|
||||||
|
#define EnumSystemLanguageGroups EnumSystemLanguageGroupsA;
|
||||||
|
#define EnumLanguageGroupLocales EnumLanguageGroupLocalesA;
|
||||||
|
#define EnumUILanguages EnumUILanguagesA;
|
||||||
|
#endif /* (WINVER >= 0x0500) */
|
||||||
|
#endif /* UNICODE */
|
||||||
|
#endif /* RC_INVOKED */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
2667
bazaar/Tcc/lib/include/winapi/winnt.h
Normal file
2667
bazaar/Tcc/lib/include/winapi/winnt.h
Normal file
File diff suppressed because it is too large
Load diff
159
bazaar/Tcc/lib/include/winapi/winreg.h
Normal file
159
bazaar/Tcc/lib/include/winapi/winreg.h
Normal file
|
|
@ -0,0 +1,159 @@
|
||||||
|
#ifndef _WINREG_H
|
||||||
|
#define _WINREG_H
|
||||||
|
#if __GNUC__ >=3
|
||||||
|
#pragma GCC system_header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
#define HKEY_CLASSES_ROOT ((HKEY)0x80000000)
|
||||||
|
#define HKEY_CURRENT_USER ((HKEY)0x80000001)
|
||||||
|
#define HKEY_LOCAL_MACHINE ((HKEY)0x80000002)
|
||||||
|
#define HKEY_USERS ((HKEY)0x80000003)
|
||||||
|
#define HKEY_PERFORMANCE_DATA ((HKEY)0x80000004)
|
||||||
|
#define HKEY_CURRENT_CONFIG ((HKEY)0x80000005)
|
||||||
|
#define HKEY_DYN_DATA ((HKEY)0x80000006)
|
||||||
|
#define REG_OPTION_VOLATILE 1
|
||||||
|
#define REG_OPTION_NON_VOLATILE 0
|
||||||
|
#define REG_CREATED_NEW_KEY 1
|
||||||
|
#define REG_OPENED_EXISTING_KEY 2
|
||||||
|
#define REG_NONE 0
|
||||||
|
#define REG_SZ 1
|
||||||
|
#define REG_EXPAND_SZ 2
|
||||||
|
#define REG_BINARY 3
|
||||||
|
#define REG_DWORD 4
|
||||||
|
#define REG_DWORD_BIG_ENDIAN 5
|
||||||
|
#define REG_DWORD_LITTLE_ENDIAN 4
|
||||||
|
#define REG_LINK 6
|
||||||
|
#define REG_MULTI_SZ 7
|
||||||
|
#define REG_RESOURCE_LIST 8
|
||||||
|
#define REG_FULL_RESOURCE_DESCRIPTOR 9
|
||||||
|
#define REG_RESOURCE_REQUIREMENTS_LIST 10
|
||||||
|
#define REG_NOTIFY_CHANGE_NAME 1
|
||||||
|
#define REG_NOTIFY_CHANGE_ATTRIBUTES 2
|
||||||
|
#define REG_NOTIFY_CHANGE_LAST_SET 4
|
||||||
|
#define REG_NOTIFY_CHANGE_SECURITY 8
|
||||||
|
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
typedef ACCESS_MASK REGSAM;
|
||||||
|
typedef struct value_entA {
|
||||||
|
LPSTR ve_valuename;
|
||||||
|
DWORD ve_valuelen;
|
||||||
|
DWORD ve_valueptr;
|
||||||
|
DWORD ve_type;
|
||||||
|
} VALENTA,*PVALENTA;
|
||||||
|
typedef struct value_entW {
|
||||||
|
LPWSTR ve_valuename;
|
||||||
|
DWORD ve_valuelen;
|
||||||
|
DWORD ve_valueptr;
|
||||||
|
DWORD ve_type;
|
||||||
|
} VALENTW,*PVALENTW;
|
||||||
|
BOOL WINAPI AbortSystemShutdownA(LPCSTR);
|
||||||
|
BOOL WINAPI AbortSystemShutdownW(LPCWSTR);
|
||||||
|
BOOL WINAPI InitiateSystemShutdownA(LPSTR,LPSTR,DWORD,BOOL,BOOL);
|
||||||
|
BOOL WINAPI InitiateSystemShutdownW(LPWSTR,LPWSTR,DWORD,BOOL,BOOL);
|
||||||
|
LONG WINAPI RegCloseKey(HKEY);
|
||||||
|
LONG WINAPI RegConnectRegistryA(LPSTR,HKEY,PHKEY);
|
||||||
|
LONG WINAPI RegConnectRegistryW(LPWSTR,HKEY,PHKEY);
|
||||||
|
LONG WINAPI RegCreateKeyA(HKEY,LPCSTR,PHKEY);
|
||||||
|
LONG WINAPI RegCreateKeyExA(HKEY,LPCSTR,DWORD,LPSTR,DWORD,REGSAM,LPSECURITY_ATTRIBUTES,PHKEY,PDWORD);
|
||||||
|
LONG WINAPI RegCreateKeyExW(HKEY,LPCWSTR,DWORD,LPWSTR,DWORD,REGSAM,LPSECURITY_ATTRIBUTES,PHKEY,PDWORD);
|
||||||
|
LONG WINAPI RegCreateKeyW(HKEY,LPCWSTR,PHKEY);
|
||||||
|
LONG WINAPI RegDeleteKeyA(HKEY,LPCSTR);
|
||||||
|
LONG WINAPI RegDeleteKeyW(HKEY,LPCWSTR);
|
||||||
|
LONG WINAPI RegDeleteValueA (HKEY,LPCSTR);
|
||||||
|
LONG WINAPI RegDeleteValueW(HKEY,LPCWSTR);
|
||||||
|
LONG WINAPI RegEnumKeyA (HKEY,DWORD,LPSTR,DWORD);
|
||||||
|
LONG WINAPI RegEnumKeyW(HKEY,DWORD,LPWSTR,DWORD);
|
||||||
|
LONG WINAPI RegEnumKeyExA(HKEY,DWORD,LPSTR,PDWORD,PDWORD,LPSTR,PDWORD,PFILETIME);
|
||||||
|
LONG WINAPI RegEnumKeyExW(HKEY,DWORD,LPWSTR,PDWORD,PDWORD,LPWSTR,PDWORD,PFILETIME);
|
||||||
|
LONG WINAPI RegEnumValueA(HKEY,DWORD,LPSTR,PDWORD,PDWORD,PDWORD,LPBYTE,PDWORD);
|
||||||
|
LONG WINAPI RegEnumValueW(HKEY,DWORD,LPWSTR,PDWORD,PDWORD,PDWORD,LPBYTE,PDWORD);
|
||||||
|
LONG WINAPI RegFlushKey(HKEY);
|
||||||
|
LONG WINAPI RegGetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PDWORD);
|
||||||
|
LONG WINAPI RegLoadKeyA(HKEY,LPCSTR,LPCSTR);
|
||||||
|
LONG WINAPI RegLoadKeyW(HKEY,LPCWSTR,LPCWSTR);
|
||||||
|
LONG WINAPI RegNotifyChangeKeyValue(HKEY,BOOL,DWORD,HANDLE,BOOL);
|
||||||
|
LONG WINAPI RegOpenKeyA(HKEY,LPCSTR,PHKEY);
|
||||||
|
LONG WINAPI RegOpenKeyExA(HKEY,LPCSTR,DWORD,REGSAM,PHKEY);
|
||||||
|
LONG WINAPI RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY);
|
||||||
|
LONG WINAPI RegOpenKeyW(HKEY,LPCWSTR,PHKEY);
|
||||||
|
LONG WINAPI RegQueryInfoKeyA(HKEY,LPSTR,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PFILETIME);
|
||||||
|
LONG WINAPI RegQueryInfoKeyW(HKEY,LPWSTR,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PFILETIME);
|
||||||
|
LONG WINAPI RegQueryMultipleValuesA(HKEY,PVALENTA,DWORD,LPSTR,PDWORD);
|
||||||
|
LONG WINAPI RegQueryMultipleValuesW(HKEY,PVALENTW,DWORD,LPWSTR,PDWORD);
|
||||||
|
LONG WINAPI RegQueryValueA(HKEY,LPCSTR,LPSTR,PLONG);
|
||||||
|
LONG WINAPI RegQueryValueExA (HKEY,LPCSTR,PDWORD,PDWORD,LPBYTE,PDWORD);
|
||||||
|
LONG WINAPI RegQueryValueExW(HKEY,LPCWSTR,PDWORD,PDWORD,LPBYTE,PDWORD);
|
||||||
|
LONG WINAPI RegQueryValueW(HKEY,LPCWSTR,LPWSTR,PLONG);
|
||||||
|
LONG WINAPI RegReplaceKeyA(HKEY,LPCSTR,LPCSTR,LPCSTR);
|
||||||
|
LONG WINAPI RegReplaceKeyW(HKEY,LPCWSTR,LPCWSTR,LPCWSTR);
|
||||||
|
LONG WINAPI RegRestoreKeyA (HKEY,LPCSTR,DWORD);
|
||||||
|
LONG WINAPI RegRestoreKeyW(HKEY,LPCWSTR,DWORD);
|
||||||
|
LONG WINAPI RegSaveKeyA(HKEY,LPCSTR,LPSECURITY_ATTRIBUTES);
|
||||||
|
LONG WINAPI RegSaveKeyW(HKEY,LPCWSTR,LPSECURITY_ATTRIBUTES);
|
||||||
|
LONG WINAPI RegSetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
|
||||||
|
LONG WINAPI RegSetValueA(HKEY,LPCSTR,DWORD,LPCSTR,DWORD);
|
||||||
|
LONG WINAPI RegSetValueExA(HKEY,LPCSTR,DWORD,DWORD,const BYTE*,DWORD);
|
||||||
|
LONG WINAPI RegSetValueExW(HKEY,LPCWSTR,DWORD,DWORD,const BYTE*,DWORD);
|
||||||
|
LONG WINAPI RegSetValueW(HKEY,LPCWSTR,DWORD,LPCWSTR,DWORD);
|
||||||
|
LONG WINAPI RegUnLoadKeyA(HKEY,LPCSTR);
|
||||||
|
LONG WINAPI RegUnLoadKeyW(HKEY,LPCWSTR);
|
||||||
|
|
||||||
|
#ifdef UNICODE
|
||||||
|
typedef VALENTW VALENT,*PVALENT;
|
||||||
|
#define AbortSystemShutdown AbortSystemShutdownW
|
||||||
|
#define InitiateSystemShutdown InitiateSystemShutdownW
|
||||||
|
#define RegConnectRegistry RegConnectRegistryW
|
||||||
|
#define RegCreateKey RegCreateKeyW
|
||||||
|
#define RegCreateKeyEx RegCreateKeyExW
|
||||||
|
#define RegDeleteKey RegDeleteKeyW
|
||||||
|
#define RegDeleteValue RegDeleteValueW
|
||||||
|
#define RegEnumKey RegEnumKeyW
|
||||||
|
#define RegEnumKeyEx RegEnumKeyExW
|
||||||
|
#define RegEnumValue RegEnumValueW
|
||||||
|
#define RegLoadKey RegLoadKeyW
|
||||||
|
#define RegOpenKey RegOpenKeyW
|
||||||
|
#define RegOpenKeyEx RegOpenKeyExW
|
||||||
|
#define RegQueryInfoKey RegQueryInfoKeyW
|
||||||
|
#define RegQueryMultipleValues RegQueryMultipleValuesW
|
||||||
|
#define RegQueryValue RegQueryValueW
|
||||||
|
#define RegQueryValueEx RegQueryValueExW
|
||||||
|
#define RegReplaceKey RegReplaceKeyW
|
||||||
|
#define RegRestoreKey RegRestoreKeyW
|
||||||
|
#define RegSaveKey RegSaveKeyW
|
||||||
|
#define RegSetValue RegSetValueW
|
||||||
|
#define RegSetValueEx RegSetValueExW
|
||||||
|
#define RegUnLoadKey RegUnLoadKeyW
|
||||||
|
#else
|
||||||
|
typedef VALENTA VALENT,*PVALENT;
|
||||||
|
#define AbortSystemShutdown AbortSystemShutdownA
|
||||||
|
#define InitiateSystemShutdown InitiateSystemShutdownA
|
||||||
|
#define RegConnectRegistry RegConnectRegistryA
|
||||||
|
#define RegCreateKey RegCreateKeyA
|
||||||
|
#define RegCreateKeyEx RegCreateKeyExA
|
||||||
|
#define RegDeleteKey RegDeleteKeyA
|
||||||
|
#define RegDeleteValue RegDeleteValueA
|
||||||
|
#define RegEnumKey RegEnumKeyA
|
||||||
|
#define RegEnumKeyEx RegEnumKeyExA
|
||||||
|
#define RegEnumValue RegEnumValueA
|
||||||
|
#define RegLoadKey RegLoadKeyA
|
||||||
|
#define RegOpenKey RegOpenKeyA
|
||||||
|
#define RegOpenKeyEx RegOpenKeyExA
|
||||||
|
#define RegQueryInfoKey RegQueryInfoKeyA
|
||||||
|
#define RegQueryMultipleValues RegQueryMultipleValuesA
|
||||||
|
#define RegQueryValue RegQueryValueA
|
||||||
|
#define RegQueryValueEx RegQueryValueExA
|
||||||
|
#define RegReplaceKey RegReplaceKeyA
|
||||||
|
#define RegRestoreKey RegRestoreKeyA
|
||||||
|
#define RegSaveKey RegSaveKeyA
|
||||||
|
#define RegSetValue RegSetValueA
|
||||||
|
#define RegSetValueEx RegSetValueExA
|
||||||
|
#define RegUnLoadKey RegUnLoadKeyA
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
309
bazaar/Tcc/lib/include/winapi/winsvc.h
Normal file
309
bazaar/Tcc/lib/include/winapi/winsvc.h
Normal file
|
|
@ -0,0 +1,309 @@
|
||||||
|
#ifndef _WINSVC_H
|
||||||
|
#define _WINSVC_H
|
||||||
|
#if __GNUC__ >=3
|
||||||
|
#pragma GCC system_header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
#define SERVICES_ACTIVE_DATABASEA "ServicesActive"
|
||||||
|
#define SERVICES_ACTIVE_DATABASEW L"ServicesActive"
|
||||||
|
#define SERVICES_FAILED_DATABASEA "ServicesFailed"
|
||||||
|
#define SERVICES_FAILED_DATABASEW L"ServicesFailed"
|
||||||
|
#define SC_GROUP_IDENTIFIERA '+'
|
||||||
|
#define SC_GROUP_IDENTIFIERW L'+'
|
||||||
|
#define SC_MANAGER_ALL_ACCESS 0xf003f
|
||||||
|
#define SC_MANAGER_CONNECT 1
|
||||||
|
#define SC_MANAGER_CREATE_SERVICE 2
|
||||||
|
#define SC_MANAGER_ENUMERATE_SERVICE 4
|
||||||
|
#define SC_MANAGER_LOCK 8
|
||||||
|
#define SC_MANAGER_QUERY_LOCK_STATUS 16
|
||||||
|
#define SC_MANAGER_MODIFY_BOOT_CONFIG 32
|
||||||
|
#define SERVICE_NO_CHANGE (-1)
|
||||||
|
#define SERVICE_STOPPED 1
|
||||||
|
#define SERVICE_START_PENDING 2
|
||||||
|
#define SERVICE_STOP_PENDING 3
|
||||||
|
#define SERVICE_RUNNING 4
|
||||||
|
#define SERVICE_CONTINUE_PENDING 5
|
||||||
|
#define SERVICE_PAUSE_PENDING 6
|
||||||
|
#define SERVICE_PAUSED 7
|
||||||
|
#define SERVICE_ACCEPT_STOP 1
|
||||||
|
#define SERVICE_ACCEPT_PAUSE_CONTINUE 2
|
||||||
|
#define SERVICE_ACCEPT_SHUTDOWN 4
|
||||||
|
#define SERVICE_ACCEPT_PARAMCHANGE 8
|
||||||
|
#define SERVICE_ACCEPT_NETBINDCHANGE 16
|
||||||
|
#define SERVICE_ACCEPT_HARDWAREPROFILECHANGE 32
|
||||||
|
#define SERVICE_ACCEPT_POWEREVENT 64
|
||||||
|
#define SERVICE_ACCEPT_SESSIONCHANGE 128
|
||||||
|
#define SERVICE_CONTROL_STOP 1
|
||||||
|
#define SERVICE_CONTROL_PAUSE 2
|
||||||
|
#define SERVICE_CONTROL_CONTINUE 3
|
||||||
|
#define SERVICE_CONTROL_INTERROGATE 4
|
||||||
|
#define SERVICE_CONTROL_SHUTDOWN 5
|
||||||
|
#define SERVICE_CONTROL_PARAMCHANGE 6
|
||||||
|
#define SERVICE_CONTROL_NETBINDADD 7
|
||||||
|
#define SERVICE_CONTROL_NETBINDREMOVE 8
|
||||||
|
#define SERVICE_CONTROL_NETBINDENABLE 9
|
||||||
|
#define SERVICE_CONTROL_NETBINDDISABLE 10
|
||||||
|
#define SERVICE_CONTROL_DEVICEEVENT 11
|
||||||
|
#define SERVICE_CONTROL_HARDWAREPROFILECHANGE 12
|
||||||
|
#define SERVICE_CONTROL_POWEREVENT 13
|
||||||
|
#define SERVICE_CONTROL_SESSIONCHANGE 14
|
||||||
|
#define SERVICE_ACTIVE 1
|
||||||
|
#define SERVICE_INACTIVE 2
|
||||||
|
#define SERVICE_STATE_ALL 3
|
||||||
|
#define SERVICE_QUERY_CONFIG 1
|
||||||
|
#define SERVICE_CHANGE_CONFIG 2
|
||||||
|
#define SERVICE_QUERY_STATUS 4
|
||||||
|
#define SERVICE_ENUMERATE_DEPENDENTS 8
|
||||||
|
#define SERVICE_START 16
|
||||||
|
#define SERVICE_STOP 32
|
||||||
|
#define SERVICE_PAUSE_CONTINUE 64
|
||||||
|
#define SERVICE_INTERROGATE 128
|
||||||
|
#define SERVICE_USER_DEFINED_CONTROL 256
|
||||||
|
#define SERVICE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SERVICE_QUERY_CONFIG|SERVICE_CHANGE_CONFIG|SERVICE_QUERY_STATUS|SERVICE_ENUMERATE_DEPENDENTS|SERVICE_START|SERVICE_STOP|SERVICE_PAUSE_CONTINUE|SERVICE_INTERROGATE|SERVICE_USER_DEFINED_CONTROL)
|
||||||
|
#define SERVICE_RUNS_IN_SYSTEM_PROCESS 1
|
||||||
|
#define SERVICE_CONFIG_DESCRIPTION 1
|
||||||
|
#define SERVICE_CONFIG_FAILURE_ACTIONS 2
|
||||||
|
|
||||||
|
typedef struct _SERVICE_STATUS {
|
||||||
|
DWORD dwServiceType;
|
||||||
|
DWORD dwCurrentState;
|
||||||
|
DWORD dwControlsAccepted;
|
||||||
|
DWORD dwWin32ExitCode;
|
||||||
|
DWORD dwServiceSpecificExitCode;
|
||||||
|
DWORD dwCheckPoint;
|
||||||
|
DWORD dwWaitHint;
|
||||||
|
} SERVICE_STATUS,*LPSERVICE_STATUS;
|
||||||
|
typedef struct _SERVICE_STATUS_PROCESS {
|
||||||
|
DWORD dwServiceType;
|
||||||
|
DWORD dwCurrentState;
|
||||||
|
DWORD dwControlsAccepted;
|
||||||
|
DWORD dwWin32ExitCode;
|
||||||
|
DWORD dwServiceSpecificExitCode;
|
||||||
|
DWORD dwCheckPoint;
|
||||||
|
DWORD dwWaitHint;
|
||||||
|
DWORD dwProcessId;
|
||||||
|
DWORD dwServiceFlags;
|
||||||
|
} SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS;
|
||||||
|
typedef enum _SC_STATUS_TYPE {
|
||||||
|
SC_STATUS_PROCESS_INFO = 0
|
||||||
|
} SC_STATUS_TYPE;
|
||||||
|
typedef enum _SC_ENUM_TYPE {
|
||||||
|
SC_ENUM_PROCESS_INFO = 0
|
||||||
|
} SC_ENUM_TYPE;
|
||||||
|
typedef struct _ENUM_SERVICE_STATUSA {
|
||||||
|
LPSTR lpServiceName;
|
||||||
|
LPSTR lpDisplayName;
|
||||||
|
SERVICE_STATUS ServiceStatus;
|
||||||
|
} ENUM_SERVICE_STATUSA,*LPENUM_SERVICE_STATUSA;
|
||||||
|
typedef struct _ENUM_SERVICE_STATUSW {
|
||||||
|
LPWSTR lpServiceName;
|
||||||
|
LPWSTR lpDisplayName;
|
||||||
|
SERVICE_STATUS ServiceStatus;
|
||||||
|
} ENUM_SERVICE_STATUSW,*LPENUM_SERVICE_STATUSW;
|
||||||
|
typedef struct _ENUM_SERVICE_STATUS_PROCESSA {
|
||||||
|
LPSTR lpServiceName;
|
||||||
|
LPSTR lpDisplayName;
|
||||||
|
SERVICE_STATUS_PROCESS ServiceStatusProcess;
|
||||||
|
} ENUM_SERVICE_STATUS_PROCESSA,*LPENUM_SERVICE_STATUS_PROCESSA;
|
||||||
|
typedef struct _ENUM_SERVICE_STATUS_PROCESSW {
|
||||||
|
LPWSTR lpServiceName;
|
||||||
|
LPWSTR lpDisplayName;
|
||||||
|
SERVICE_STATUS_PROCESS ServiceStatusProcess;
|
||||||
|
} ENUM_SERVICE_STATUS_PROCESSW,*LPENUM_SERVICE_STATUS_PROCESSW;
|
||||||
|
typedef struct _QUERY_SERVICE_CONFIGA {
|
||||||
|
DWORD dwServiceType;
|
||||||
|
DWORD dwStartType;
|
||||||
|
DWORD dwErrorControl;
|
||||||
|
LPSTR lpBinaryPathName;
|
||||||
|
LPSTR lpLoadOrderGroup;
|
||||||
|
DWORD dwTagId;
|
||||||
|
LPSTR lpDependencies;
|
||||||
|
LPSTR lpServiceStartName;
|
||||||
|
LPSTR lpDisplayName;
|
||||||
|
} QUERY_SERVICE_CONFIGA,*LPQUERY_SERVICE_CONFIGA;
|
||||||
|
typedef struct _QUERY_SERVICE_CONFIGW {
|
||||||
|
DWORD dwServiceType;
|
||||||
|
DWORD dwStartType;
|
||||||
|
DWORD dwErrorControl;
|
||||||
|
LPWSTR lpBinaryPathName;
|
||||||
|
LPWSTR lpLoadOrderGroup;
|
||||||
|
DWORD dwTagId;
|
||||||
|
LPWSTR lpDependencies;
|
||||||
|
LPWSTR lpServiceStartName;
|
||||||
|
LPWSTR lpDisplayName;
|
||||||
|
} QUERY_SERVICE_CONFIGW,*LPQUERY_SERVICE_CONFIGW;
|
||||||
|
typedef struct _QUERY_SERVICE_LOCK_STATUSA {
|
||||||
|
DWORD fIsLocked;
|
||||||
|
LPSTR lpLockOwner;
|
||||||
|
DWORD dwLockDuration;
|
||||||
|
} QUERY_SERVICE_LOCK_STATUSA,*LPQUERY_SERVICE_LOCK_STATUSA;
|
||||||
|
typedef struct _QUERY_SERVICE_LOCK_STATUSW {
|
||||||
|
DWORD fIsLocked;
|
||||||
|
LPWSTR lpLockOwner;
|
||||||
|
DWORD dwLockDuration;
|
||||||
|
} QUERY_SERVICE_LOCK_STATUSW,*LPQUERY_SERVICE_LOCK_STATUSW;
|
||||||
|
typedef void (WINAPI *LPSERVICE_MAIN_FUNCTIONA)(DWORD,LPSTR*);
|
||||||
|
typedef void (WINAPI *LPSERVICE_MAIN_FUNCTIONW)(DWORD,LPWSTR*);
|
||||||
|
typedef struct _SERVICE_TABLE_ENTRYA {
|
||||||
|
LPSTR lpServiceName;
|
||||||
|
LPSERVICE_MAIN_FUNCTIONA lpServiceProc;
|
||||||
|
} SERVICE_TABLE_ENTRYA,*LPSERVICE_TABLE_ENTRYA;
|
||||||
|
typedef struct _SERVICE_TABLE_ENTRYW {
|
||||||
|
LPWSTR lpServiceName;
|
||||||
|
LPSERVICE_MAIN_FUNCTIONW lpServiceProc;
|
||||||
|
} SERVICE_TABLE_ENTRYW,*LPSERVICE_TABLE_ENTRYW;
|
||||||
|
DECLARE_HANDLE(SC_HANDLE);
|
||||||
|
typedef SC_HANDLE *LPSC_HANDLE;
|
||||||
|
typedef PVOID SC_LOCK;
|
||||||
|
typedef DWORD SERVICE_STATUS_HANDLE;
|
||||||
|
typedef VOID(WINAPI *LPHANDLER_FUNCTION)(DWORD);
|
||||||
|
typedef DWORD (WINAPI *LPHANDLER_FUNCTION_EX)(DWORD,DWORD,LPVOID,LPVOID);
|
||||||
|
typedef struct _SERVICE_DESCRIPTIONA {
|
||||||
|
LPSTR lpDescription;
|
||||||
|
} SERVICE_DESCRIPTIONA,*LPSERVICE_DESCRIPTIONA;
|
||||||
|
typedef struct _SERVICE_DESCRIPTIONW {
|
||||||
|
LPWSTR lpDescription;
|
||||||
|
} SERVICE_DESCRIPTIONW,*LPSERVICE_DESCRIPTIONW;
|
||||||
|
typedef enum _SC_ACTION_TYPE {
|
||||||
|
SC_ACTION_NONE = 0,
|
||||||
|
SC_ACTION_RESTART = 1,
|
||||||
|
SC_ACTION_REBOOT = 2,
|
||||||
|
SC_ACTION_RUN_COMMAND = 3
|
||||||
|
} SC_ACTION_TYPE;
|
||||||
|
typedef struct _SC_ACTION {
|
||||||
|
SC_ACTION_TYPE Type;
|
||||||
|
DWORD Delay;
|
||||||
|
} SC_ACTION,*LPSC_ACTION;
|
||||||
|
typedef struct _SERVICE_FAILURE_ACTIONSA {
|
||||||
|
DWORD dwResetPeriod;
|
||||||
|
LPSTR lpRebootMsg;
|
||||||
|
LPSTR lpCommand;
|
||||||
|
DWORD cActions;
|
||||||
|
SC_ACTION * lpsaActions;
|
||||||
|
} SERVICE_FAILURE_ACTIONSA,*LPSERVICE_FAILURE_ACTIONSA;
|
||||||
|
typedef struct _SERVICE_FAILURE_ACTIONSW {
|
||||||
|
DWORD dwResetPeriod;
|
||||||
|
LPWSTR lpRebootMsg;
|
||||||
|
LPWSTR lpCommand;
|
||||||
|
DWORD cActions;
|
||||||
|
SC_ACTION * lpsaActions;
|
||||||
|
} SERVICE_FAILURE_ACTIONSW,*LPSERVICE_FAILURE_ACTIONSW;
|
||||||
|
|
||||||
|
BOOL WINAPI ChangeServiceConfigA(SC_HANDLE,DWORD,DWORD,DWORD,LPCSTR,LPCSTR,LPDWORD,LPCSTR,LPCSTR,LPCSTR,LPCSTR);
|
||||||
|
BOOL WINAPI ChangeServiceConfigW(SC_HANDLE,DWORD,DWORD,DWORD,LPCWSTR,LPCWSTR,LPDWORD,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);
|
||||||
|
BOOL WINAPI ChangeServiceConfig2A(SC_HANDLE,DWORD,LPVOID);
|
||||||
|
BOOL WINAPI ChangeServiceConfig2W(SC_HANDLE,DWORD,LPVOID);
|
||||||
|
BOOL WINAPI CloseServiceHandle(SC_HANDLE);
|
||||||
|
BOOL WINAPI ControlService(SC_HANDLE,DWORD,LPSERVICE_STATUS);
|
||||||
|
SC_HANDLE WINAPI CreateServiceA(SC_HANDLE,LPCSTR,LPCSTR,DWORD,DWORD,DWORD,DWORD,LPCSTR,LPCSTR,PDWORD,LPCSTR,LPCSTR,LPCSTR);
|
||||||
|
SC_HANDLE WINAPI CreateServiceW(SC_HANDLE,LPCWSTR,LPCWSTR,DWORD,DWORD,DWORD,DWORD,LPCWSTR,LPCWSTR,PDWORD,LPCWSTR,LPCWSTR,LPCWSTR);
|
||||||
|
BOOL WINAPI DeleteService(SC_HANDLE);
|
||||||
|
BOOL WINAPI EnumDependentServicesA(SC_HANDLE,DWORD,LPENUM_SERVICE_STATUSA,DWORD,PDWORD,PDWORD);
|
||||||
|
BOOL WINAPI EnumDependentServicesW(SC_HANDLE,DWORD,LPENUM_SERVICE_STATUSW,DWORD,PDWORD,PDWORD);
|
||||||
|
BOOL WINAPI EnumServicesStatusA(SC_HANDLE,DWORD,DWORD,LPENUM_SERVICE_STATUSA,DWORD,PDWORD,PDWORD,PDWORD);
|
||||||
|
BOOL WINAPI EnumServicesStatusW(SC_HANDLE,DWORD,DWORD,LPENUM_SERVICE_STATUSW,DWORD,PDWORD,PDWORD,PDWORD);
|
||||||
|
BOOL WINAPI EnumServicesStatusExA(SC_HANDLE,SC_ENUM_TYPE,DWORD,DWORD,LPBYTE,DWORD,LPDWORD,LPDWORD,LPDWORD,LPCSTR);
|
||||||
|
BOOL WINAPI EnumServicesStatusExW(SC_HANDLE,SC_ENUM_TYPE,DWORD,DWORD,LPBYTE,DWORD,LPDWORD,LPDWORD,LPDWORD,LPCWSTR);
|
||||||
|
BOOL WINAPI GetServiceDisplayNameA(SC_HANDLE,LPCSTR,LPSTR,PDWORD);
|
||||||
|
BOOL WINAPI GetServiceDisplayNameW(SC_HANDLE,LPCWSTR,LPWSTR,PDWORD);
|
||||||
|
BOOL WINAPI GetServiceKeyNameA(SC_HANDLE,LPCSTR,LPSTR,PDWORD);
|
||||||
|
BOOL WINAPI GetServiceKeyNameW(SC_HANDLE,LPCWSTR,LPWSTR,PDWORD);
|
||||||
|
SC_LOCK WINAPI LockServiceDatabase(SC_HANDLE);
|
||||||
|
BOOL WINAPI NotifyBootConfigStatus(BOOL);
|
||||||
|
SC_HANDLE WINAPI OpenSCManagerA(LPCSTR,LPCSTR,DWORD);
|
||||||
|
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR,LPCWSTR,DWORD);
|
||||||
|
SC_HANDLE WINAPI OpenServiceA(SC_HANDLE,LPCSTR,DWORD);
|
||||||
|
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE,LPCWSTR,DWORD);
|
||||||
|
BOOL WINAPI QueryServiceConfigA(SC_HANDLE,LPQUERY_SERVICE_CONFIGA,DWORD,PDWORD);
|
||||||
|
BOOL WINAPI QueryServiceConfigW(SC_HANDLE,LPQUERY_SERVICE_CONFIGW,DWORD,PDWORD);
|
||||||
|
BOOL WINAPI QueryServiceConfig2A(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD);
|
||||||
|
BOOL WINAPI QueryServiceConfig2W(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD);
|
||||||
|
BOOL WINAPI QueryServiceLockStatusA(SC_HANDLE,LPQUERY_SERVICE_LOCK_STATUSA,DWORD,PDWORD);
|
||||||
|
BOOL WINAPI QueryServiceLockStatusW(SC_HANDLE,LPQUERY_SERVICE_LOCK_STATUSW,DWORD,PDWORD);
|
||||||
|
BOOL WINAPI QueryServiceObjectSecurity(SC_HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
|
||||||
|
BOOL WINAPI QueryServiceStatus(SC_HANDLE,LPSERVICE_STATUS);
|
||||||
|
BOOL WINAPI QueryServiceStatusEx(SC_HANDLE,SC_STATUS_TYPE,LPBYTE,DWORD,LPDWORD);
|
||||||
|
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerA(LPCSTR,LPHANDLER_FUNCTION);
|
||||||
|
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerW(LPCWSTR,LPHANDLER_FUNCTION);
|
||||||
|
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExA(LPCSTR,LPHANDLER_FUNCTION_EX,LPVOID);
|
||||||
|
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(LPCWSTR,LPHANDLER_FUNCTION_EX,LPVOID);
|
||||||
|
BOOL WINAPI SetServiceObjectSecurity(SC_HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
|
||||||
|
BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE,LPSERVICE_STATUS);
|
||||||
|
BOOL WINAPI StartServiceA(SC_HANDLE,DWORD,LPCSTR*);
|
||||||
|
BOOL WINAPI StartServiceCtrlDispatcherA(LPSERVICE_TABLE_ENTRYA);
|
||||||
|
BOOL WINAPI StartServiceCtrlDispatcherW(LPSERVICE_TABLE_ENTRYW);
|
||||||
|
BOOL WINAPI StartServiceW(SC_HANDLE,DWORD,LPCWSTR);
|
||||||
|
BOOL WINAPI UnlockServiceDatabase(SC_LOCK);
|
||||||
|
|
||||||
|
#ifdef UNICODE
|
||||||
|
typedef ENUM_SERVICE_STATUSW ENUM_SERVICE_STATUS,*LPENUM_SERVICE_STATUS;
|
||||||
|
typedef ENUM_SERVICE_STATUS_PROCESSW ENUM_SERVICE_STATUS_PROCESS;
|
||||||
|
typedef LPENUM_SERVICE_STATUS_PROCESSW LPENUM_SERVICE_STATUS_PROCESS;
|
||||||
|
typedef QUERY_SERVICE_CONFIGW QUERY_SERVICE_CONFIG,*LPQUERY_SERVICE_CONFIG;
|
||||||
|
typedef QUERY_SERVICE_LOCK_STATUSW QUERY_SERVICE_LOCK_STATUS,*LPQUERY_SERVICE_LOCK_STATUS;
|
||||||
|
typedef SERVICE_TABLE_ENTRYW SERVICE_TABLE_ENTRY,*LPSERVICE_TABLE_ENTRY;
|
||||||
|
typedef LPSERVICE_MAIN_FUNCTIONW LPSERVICE_MAIN_FUNCTION;
|
||||||
|
typedef SERVICE_DESCRIPTIONW SERVICE_DESCRIPTION;
|
||||||
|
typedef LPSERVICE_DESCRIPTIONW LPSERVICE_DESCRIPTION;
|
||||||
|
typedef SERVICE_FAILURE_ACTIONSW SERVICE_FAILURE_ACTIONS;
|
||||||
|
typedef LPSERVICE_FAILURE_ACTIONSW LPSERVICE_FAILURE_ACTIONS;
|
||||||
|
#define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEW
|
||||||
|
#define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEW
|
||||||
|
#define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERW
|
||||||
|
#define ChangeServiceConfig ChangeServiceConfigW
|
||||||
|
#define ChangeServiceConfig2 ChangeServiceConfig2W
|
||||||
|
#define CreateService CreateServiceW
|
||||||
|
#define EnumDependentServices EnumDependentServicesW
|
||||||
|
#define EnumServicesStatus EnumServicesStatusW
|
||||||
|
#define EnumServicesStatusEx EnumServicesStatusExW
|
||||||
|
#define GetServiceDisplayName GetServiceDisplayNameW
|
||||||
|
#define GetServiceKeyName GetServiceKeyNameW
|
||||||
|
#define OpenSCManager OpenSCManagerW
|
||||||
|
#define OpenService OpenServiceW
|
||||||
|
#define QueryServiceConfig QueryServiceConfigW
|
||||||
|
#define QueryServiceConfig2 QueryServiceConfig2W
|
||||||
|
#define QueryServiceLockStatus QueryServiceLockStatusW
|
||||||
|
#define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerW
|
||||||
|
#define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExW
|
||||||
|
#define StartService StartServiceW
|
||||||
|
#define StartServiceCtrlDispatcher StartServiceCtrlDispatcherW
|
||||||
|
#else
|
||||||
|
typedef ENUM_SERVICE_STATUSA ENUM_SERVICE_STATUS,*LPENUM_SERVICE_STATUS;
|
||||||
|
typedef ENUM_SERVICE_STATUS_PROCESSA ENUM_SERVICE_STATUS_PROCESS;
|
||||||
|
typedef LPENUM_SERVICE_STATUS_PROCESSA LPENUM_SERVICE_STATUS_PROCESS;
|
||||||
|
typedef QUERY_SERVICE_CONFIGA QUERY_SERVICE_CONFIG,*LPQUERY_SERVICE_CONFIG;
|
||||||
|
typedef QUERY_SERVICE_LOCK_STATUSA QUERY_SERVICE_LOCK_STATUS,*LPQUERY_SERVICE_LOCK_STATUS;
|
||||||
|
typedef SERVICE_TABLE_ENTRYA SERVICE_TABLE_ENTRY,*LPSERVICE_TABLE_ENTRY;
|
||||||
|
typedef LPSERVICE_MAIN_FUNCTIONA LPSERVICE_MAIN_FUNCTION;
|
||||||
|
typedef SERVICE_DESCRIPTIONA SERVICE_DESCRIPTION;
|
||||||
|
typedef LPSERVICE_DESCRIPTIONA LPSERVICE_DESCRIPTION;
|
||||||
|
typedef SERVICE_FAILURE_ACTIONSA SERVICE_FAILURE_ACTIONS;
|
||||||
|
typedef LPSERVICE_FAILURE_ACTIONSA LPSERVICE_FAILURE_ACTIONS;
|
||||||
|
#define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEA
|
||||||
|
#define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEA
|
||||||
|
#define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERA
|
||||||
|
#define ChangeServiceConfig ChangeServiceConfigA
|
||||||
|
#define ChangeServiceConfig2 ChangeServiceConfig2A
|
||||||
|
#define CreateService CreateServiceA
|
||||||
|
#define EnumDependentServices EnumDependentServicesA
|
||||||
|
#define EnumServicesStatus EnumServicesStatusA
|
||||||
|
#define EnumServicesStatusEx EnumServicesStatusExA
|
||||||
|
#define GetServiceDisplayName GetServiceDisplayNameA
|
||||||
|
#define GetServiceKeyName GetServiceKeyNameA
|
||||||
|
#define OpenSCManager OpenSCManagerA
|
||||||
|
#define OpenService OpenServiceA
|
||||||
|
#define QueryServiceConfig QueryServiceConfigA
|
||||||
|
#define QueryServiceConfig2 QueryServiceConfig2A
|
||||||
|
#define QueryServiceLockStatus QueryServiceLockStatusA
|
||||||
|
#define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerA
|
||||||
|
#define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExA
|
||||||
|
#define StartService StartServiceA
|
||||||
|
#define StartServiceCtrlDispatcher StartServiceCtrlDispatcherA
|
||||||
|
#endif
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* _WINSVC_H */
|
||||||
3472
bazaar/Tcc/lib/include/winapi/winuser.h
Normal file
3472
bazaar/Tcc/lib/include/winapi/winuser.h
Normal file
File diff suppressed because it is too large
Load diff
133
bazaar/Tcc/lib/include/winapi/winver.h
Normal file
133
bazaar/Tcc/lib/include/winapi/winver.h
Normal file
|
|
@ -0,0 +1,133 @@
|
||||||
|
#ifndef _WINVER_H
|
||||||
|
#define _WINVER_H
|
||||||
|
#if __GNUC__ >=3
|
||||||
|
#pragma GCC system_header
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
#define VS_FILE_INFO RT_VERSION
|
||||||
|
#define VS_VERSION_INFO 1
|
||||||
|
#define VS_USER_DEFINED 100
|
||||||
|
#define VS_FFI_SIGNATURE 0xFEEF04BD
|
||||||
|
#define VS_FFI_STRUCVERSION 0x10000
|
||||||
|
#define VS_FFI_FILEFLAGSMASK 0x3F
|
||||||
|
#define VS_FF_DEBUG 1
|
||||||
|
#define VS_FF_PRERELEASE 2
|
||||||
|
#define VS_FF_PATCHED 4
|
||||||
|
#define VS_FF_PRIVATEBUILD 8
|
||||||
|
#define VS_FF_INFOINFERRED 16
|
||||||
|
#define VS_FF_SPECIALBUILD 32
|
||||||
|
#define VOS_UNKNOWN 0
|
||||||
|
#define VOS_DOS 0x10000
|
||||||
|
#define VOS_OS216 0x20000
|
||||||
|
#define VOS_OS232 0x30000
|
||||||
|
#define VOS_NT 0x40000
|
||||||
|
#define VOS__BASE 0
|
||||||
|
#define VOS__WINDOWS16 1
|
||||||
|
#define VOS__PM16 2
|
||||||
|
#define VOS__PM32 3
|
||||||
|
#define VOS__WINDOWS32 4
|
||||||
|
#define VOS_DOS_WINDOWS16 0x10001
|
||||||
|
#define VOS_DOS_WINDOWS32 0x10004
|
||||||
|
#define VOS_OS216_PM16 0x20002
|
||||||
|
#define VOS_OS232_PM32 0x30003
|
||||||
|
#define VOS_NT_WINDOWS32 0x40004
|
||||||
|
#define VFT_UNKNOWN 0
|
||||||
|
#define VFT_APP 1
|
||||||
|
#define VFT_DLL 2
|
||||||
|
#define VFT_DRV 3
|
||||||
|
#define VFT_FONT 4
|
||||||
|
#define VFT_VXD 5
|
||||||
|
#define VFT_STATIC_LIB 7
|
||||||
|
#define VFT2_UNKNOWN 0
|
||||||
|
#define VFT2_DRV_PRINTER 1
|
||||||
|
#define VFT2_DRV_KEYBOARD 2
|
||||||
|
#define VFT2_DRV_LANGUAGE 3
|
||||||
|
#define VFT2_DRV_DISPLAY 4
|
||||||
|
#define VFT2_DRV_MOUSE 5
|
||||||
|
#define VFT2_DRV_NETWORK 6
|
||||||
|
#define VFT2_DRV_SYSTEM 7
|
||||||
|
#define VFT2_DRV_INSTALLABLE 8
|
||||||
|
#define VFT2_DRV_SOUND 9
|
||||||
|
#define VFT2_DRV_COMM 10
|
||||||
|
#define VFT2_DRV_INPUTMETHOD 11
|
||||||
|
#define VFT2_FONT_RASTER 1
|
||||||
|
#define VFT2_FONT_VECTOR 2
|
||||||
|
#define VFT2_FONT_TRUETYPE 3
|
||||||
|
#define VFFF_ISSHAREDFILE 1
|
||||||
|
#define VFF_CURNEDEST 1
|
||||||
|
#define VFF_FILEINUSE 2
|
||||||
|
#define VFF_BUFFTOOSMALL 4
|
||||||
|
#define VIFF_FORCEINSTALL 1
|
||||||
|
#define VIFF_DONTDELETEOLD 2
|
||||||
|
#define VIF_TEMPFILE 1
|
||||||
|
#define VIF_MISMATCH 2
|
||||||
|
#define VIF_SRCOLD 4
|
||||||
|
#define VIF_DIFFLANG 8
|
||||||
|
#define VIF_DIFFCODEPG 16
|
||||||
|
#define VIF_DIFFTYPE 32
|
||||||
|
#define VIF_WRITEPROT 64
|
||||||
|
#define VIF_FILEINUSE 128
|
||||||
|
#define VIF_OUTOFSPACE 256
|
||||||
|
#define VIF_ACCESSVIOLATION 512
|
||||||
|
#define VIF_SHARINGVIOLATION 1024
|
||||||
|
#define VIF_CANNOTCREATE 2048
|
||||||
|
#define VIF_CANNOTDELETE 4096
|
||||||
|
#define VIF_CANNOTRENAME 8192
|
||||||
|
#define VIF_CANNOTDELETECUR 16384
|
||||||
|
#define VIF_OUTOFMEMORY 32768
|
||||||
|
#define VIF_CANNOTREADSRC 65536
|
||||||
|
#define VIF_CANNOTREADDST 0x20000
|
||||||
|
#define VIF_BUFFTOOSMALL 0x40000
|
||||||
|
#ifndef RC_INVOKED
|
||||||
|
typedef struct tagVS_FIXEDFILEINFO {
|
||||||
|
DWORD dwSignature;
|
||||||
|
DWORD dwStrucVersion;
|
||||||
|
DWORD dwFileVersionMS;
|
||||||
|
DWORD dwFileVersionLS;
|
||||||
|
DWORD dwProductVersionMS;
|
||||||
|
DWORD dwProductVersionLS;
|
||||||
|
DWORD dwFileFlagsMask;
|
||||||
|
DWORD dwFileFlags;
|
||||||
|
DWORD dwFileOS;
|
||||||
|
DWORD dwFileType;
|
||||||
|
DWORD dwFileSubtype;
|
||||||
|
DWORD dwFileDateMS;
|
||||||
|
DWORD dwFileDateLS;
|
||||||
|
} VS_FIXEDFILEINFO;
|
||||||
|
DWORD WINAPI VerFindFileA(DWORD,LPSTR,LPSTR,LPSTR,LPSTR,PUINT,LPSTR,PUINT);
|
||||||
|
DWORD WINAPI VerFindFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT,LPWSTR,PUINT);
|
||||||
|
DWORD WINAPI VerInstallFileA(DWORD,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,PUINT);
|
||||||
|
DWORD WINAPI VerInstallFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT);
|
||||||
|
DWORD WINAPI GetFileVersionInfoSizeA(LPSTR,PDWORD);
|
||||||
|
DWORD WINAPI GetFileVersionInfoSizeW(LPWSTR,PDWORD);
|
||||||
|
BOOL WINAPI GetFileVersionInfoA(LPSTR,DWORD,DWORD,PVOID);
|
||||||
|
BOOL WINAPI GetFileVersionInfoW(LPWSTR,DWORD,DWORD,PVOID);
|
||||||
|
DWORD WINAPI VerLanguageNameA(DWORD,LPSTR,DWORD);
|
||||||
|
DWORD WINAPI VerLanguageNameW(DWORD,LPWSTR,DWORD);
|
||||||
|
BOOL WINAPI VerQueryValueA(PCVOID,LPSTR,PVOID*,PUINT);
|
||||||
|
BOOL WINAPI VerQueryValueW(PCVOID,LPWSTR,PVOID*,PUINT);
|
||||||
|
#ifdef UNICODE
|
||||||
|
#define VerFindFile VerFindFileW
|
||||||
|
#define VerQueryValue VerQueryValueW
|
||||||
|
#define VerInstallFile VerInstallFileW
|
||||||
|
#define GetFileVersionInfoSize GetFileVersionInfoSizeW
|
||||||
|
#define GetFileVersionInfo GetFileVersionInfoW
|
||||||
|
#define VerLanguageName VerLanguageNameW
|
||||||
|
#define VerQueryValue VerQueryValueW
|
||||||
|
#else
|
||||||
|
#define VerQueryValue VerQueryValueA
|
||||||
|
#define VerFindFile VerFindFileA
|
||||||
|
#define VerInstallFile VerInstallFileA
|
||||||
|
#define GetFileVersionInfoSize GetFileVersionInfoSizeA
|
||||||
|
#define GetFileVersionInfo GetFileVersionInfoA
|
||||||
|
#define VerLanguageName VerLanguageNameA
|
||||||
|
#define VerQueryValue VerQueryValueA
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
337
bazaar/Tcc/lib/lib/gdi32.def
Normal file
337
bazaar/Tcc/lib/lib/gdi32.def
Normal file
|
|
@ -0,0 +1,337 @@
|
||||||
|
LIBRARY gdi32.dll
|
||||||
|
|
||||||
|
EXPORTS
|
||||||
|
AbortDoc
|
||||||
|
AbortPath
|
||||||
|
AddFontResourceA
|
||||||
|
AddFontResourceW
|
||||||
|
AngleArc
|
||||||
|
AnimatePalette
|
||||||
|
Arc
|
||||||
|
ArcTo
|
||||||
|
BeginPath
|
||||||
|
BitBlt
|
||||||
|
ByeByeGDI
|
||||||
|
CancelDC
|
||||||
|
CheckColorsInGamut
|
||||||
|
ChoosePixelFormat
|
||||||
|
Chord
|
||||||
|
CloseEnhMetaFile
|
||||||
|
CloseFigure
|
||||||
|
CloseMetaFile
|
||||||
|
ColorCorrectPalette
|
||||||
|
ColorMatchToTarget
|
||||||
|
CombineRgn
|
||||||
|
CombineTransform
|
||||||
|
CopyEnhMetaFileA
|
||||||
|
CopyEnhMetaFileW
|
||||||
|
CopyMetaFileA
|
||||||
|
CopyMetaFileW
|
||||||
|
CreateBitmap
|
||||||
|
CreateBitmapIndirect
|
||||||
|
CreateBrushIndirect
|
||||||
|
CreateColorSpaceA
|
||||||
|
CreateColorSpaceW
|
||||||
|
CreateCompatibleBitmap
|
||||||
|
CreateCompatibleDC
|
||||||
|
CreateDCA
|
||||||
|
CreateDCW
|
||||||
|
CreateDIBPatternBrush
|
||||||
|
CreateDIBPatternBrushPt
|
||||||
|
CreateDIBSection
|
||||||
|
CreateDIBitmap
|
||||||
|
CreateDiscardableBitmap
|
||||||
|
CreateEllipticRgn
|
||||||
|
CreateEllipticRgnIndirect
|
||||||
|
CreateEnhMetaFileA
|
||||||
|
CreateEnhMetaFileW
|
||||||
|
CreateFontA
|
||||||
|
CreateFontIndirectA
|
||||||
|
CreateFontIndirectW
|
||||||
|
CreateFontW
|
||||||
|
CreateHalftonePalette
|
||||||
|
CreateHatchBrush
|
||||||
|
CreateICA
|
||||||
|
CreateICW
|
||||||
|
CreateMetaFileA
|
||||||
|
CreateMetaFileW
|
||||||
|
CreatePalette
|
||||||
|
CreatePatternBrush
|
||||||
|
CreatePen
|
||||||
|
CreatePenIndirect
|
||||||
|
CreatePolyPolygonRgn
|
||||||
|
CreatePolygonRgn
|
||||||
|
CreateRectRgn
|
||||||
|
CreateRectRgnIndirect
|
||||||
|
CreateRoundRectRgn
|
||||||
|
CreateScalableFontResourceA
|
||||||
|
CreateScalableFontResourceW
|
||||||
|
CreateSolidBrush
|
||||||
|
DPtoLP
|
||||||
|
DeleteColorSpace
|
||||||
|
DeleteDC
|
||||||
|
DeleteEnhMetaFile
|
||||||
|
DeleteMetaFile
|
||||||
|
DeleteObject
|
||||||
|
DescribePixelFormat
|
||||||
|
DeviceCapabilitiesEx
|
||||||
|
DeviceCapabilitiesExA
|
||||||
|
DeviceCapabilitiesExW
|
||||||
|
DrawEscape
|
||||||
|
Ellipse
|
||||||
|
EnableEUDC
|
||||||
|
EndDoc
|
||||||
|
EndPage
|
||||||
|
EndPath
|
||||||
|
EnumEnhMetaFile
|
||||||
|
EnumFontFamiliesA
|
||||||
|
EnumFontFamiliesExA
|
||||||
|
EnumFontFamiliesExW
|
||||||
|
EnumFontFamiliesW
|
||||||
|
EnumFontsA
|
||||||
|
EnumFontsW
|
||||||
|
EnumICMProfilesA
|
||||||
|
EnumICMProfilesW
|
||||||
|
EnumMetaFile
|
||||||
|
EnumObjects
|
||||||
|
EqualRgn
|
||||||
|
Escape
|
||||||
|
ExcludeClipRect
|
||||||
|
ExtCreatePen
|
||||||
|
ExtCreateRegion
|
||||||
|
ExtEscape
|
||||||
|
ExtFloodFill
|
||||||
|
ExtSelectClipRgn
|
||||||
|
ExtTextOutA
|
||||||
|
ExtTextOutW
|
||||||
|
FillPath
|
||||||
|
FillRgn
|
||||||
|
FixBrushOrgEx
|
||||||
|
FlattenPath
|
||||||
|
FloodFill
|
||||||
|
FrameRgn
|
||||||
|
GdiComment
|
||||||
|
GdiFlush
|
||||||
|
GdiGetBatchLimit
|
||||||
|
GdiPlayDCScript
|
||||||
|
GdiPlayJournal
|
||||||
|
GdiPlayScript
|
||||||
|
GdiSetBatchLimit
|
||||||
|
GetArcDirection
|
||||||
|
GetAspectRatioFilterEx
|
||||||
|
GetBitmapBits
|
||||||
|
GetBitmapDimensionEx
|
||||||
|
GetBkColor
|
||||||
|
GetBkMode
|
||||||
|
GetBoundsRect
|
||||||
|
GetBrushOrgEx
|
||||||
|
GetCharABCWidthsA
|
||||||
|
GetCharABCWidthsFloatA
|
||||||
|
GetCharABCWidthsFloatW
|
||||||
|
GetCharABCWidthsW
|
||||||
|
GetCharWidth32A
|
||||||
|
GetCharWidth32W
|
||||||
|
GetCharWidthA
|
||||||
|
GetCharWidthFloatA
|
||||||
|
GetCharWidthFloatW
|
||||||
|
GetCharWidthW
|
||||||
|
GetCharacterPlacementA
|
||||||
|
GetCharacterPlacementW
|
||||||
|
GetClipBox
|
||||||
|
GetClipRgn
|
||||||
|
GetColorAdjustment
|
||||||
|
GetColorSpace
|
||||||
|
GetCurrentObject
|
||||||
|
GetCurrentPositionEx
|
||||||
|
GetDCOrgEx
|
||||||
|
GetDIBColorTable
|
||||||
|
GetDIBits
|
||||||
|
GetDeviceCaps
|
||||||
|
GetDeviceGammaRamp
|
||||||
|
GetEnhMetaFileA
|
||||||
|
GetEnhMetaFileBits
|
||||||
|
GetEnhMetaFileDescriptionA
|
||||||
|
GetEnhMetaFileDescriptionW
|
||||||
|
GetEnhMetaFileHeader
|
||||||
|
GetEnhMetaFilePaletteEntries
|
||||||
|
GetEnhMetaFileW
|
||||||
|
GetFontData
|
||||||
|
GetFontLanguageInfo
|
||||||
|
GetFontResourceInfo
|
||||||
|
GetGlyphOutline
|
||||||
|
GetGlyphOutlineA
|
||||||
|
GetGlyphOutlineW
|
||||||
|
GetGraphicsMode
|
||||||
|
GetICMProfileA
|
||||||
|
GetICMProfileW
|
||||||
|
GetKerningPairs
|
||||||
|
GetKerningPairsA
|
||||||
|
GetKerningPairsW
|
||||||
|
GetLayout
|
||||||
|
GetLogColorSpaceA
|
||||||
|
GetLogColorSpaceW
|
||||||
|
GetMapMode
|
||||||
|
GetMetaFileA
|
||||||
|
GetMetaFileBitsEx
|
||||||
|
GetMetaFileW
|
||||||
|
GetMetaRgn
|
||||||
|
GetMiterLimit
|
||||||
|
GetNearestColor
|
||||||
|
GetNearestPaletteIndex
|
||||||
|
GetObjectA
|
||||||
|
GetObjectType
|
||||||
|
GetObjectW
|
||||||
|
GetOutlineTextMetricsA
|
||||||
|
GetOutlineTextMetricsW
|
||||||
|
GetPaletteEntries
|
||||||
|
GetPath
|
||||||
|
GetPixel
|
||||||
|
GetPixelFormat
|
||||||
|
GetPolyFillMode
|
||||||
|
GetROP2
|
||||||
|
GetRandomRgn
|
||||||
|
GetRasterizerCaps
|
||||||
|
GetRegionData
|
||||||
|
GetRgnBox
|
||||||
|
GetStockObject
|
||||||
|
GetStretchBltMode
|
||||||
|
GetSystemPaletteEntries
|
||||||
|
GetSystemPaletteUse
|
||||||
|
GetTextAlign
|
||||||
|
GetTextCharacterExtra
|
||||||
|
GetTextCharset
|
||||||
|
GetTextCharsetInfo
|
||||||
|
GetTextColor
|
||||||
|
GetTextExtentExPointA
|
||||||
|
GetTextExtentExPointW
|
||||||
|
GetTextExtentPoint32A
|
||||||
|
GetTextExtentPoint32W
|
||||||
|
GetTextExtentPointA
|
||||||
|
GetTextExtentPointW
|
||||||
|
GetTextFaceA
|
||||||
|
GetTextFaceW
|
||||||
|
GetTextMetricsA
|
||||||
|
GetTextMetricsW
|
||||||
|
GetViewportExtEx
|
||||||
|
GetViewportOrgEx
|
||||||
|
GetWinMetaFileBits
|
||||||
|
GetWindowExtEx
|
||||||
|
GetWindowOrgEx
|
||||||
|
GetWorldTransform
|
||||||
|
IntersectClipRect
|
||||||
|
InvertRgn
|
||||||
|
LPtoDP
|
||||||
|
LineDDA
|
||||||
|
LineTo
|
||||||
|
MaskBlt
|
||||||
|
ModifyWorldTransform
|
||||||
|
MoveToEx
|
||||||
|
OffsetClipRgn
|
||||||
|
OffsetRgn
|
||||||
|
OffsetViewportOrgEx
|
||||||
|
OffsetWindowOrgEx
|
||||||
|
PaintRgn
|
||||||
|
PatBlt
|
||||||
|
PathToRegion
|
||||||
|
Pie
|
||||||
|
PlayEnhMetaFile
|
||||||
|
PlayEnhMetaFileRecord
|
||||||
|
PlayMetaFile
|
||||||
|
PlayMetaFileRecord
|
||||||
|
PlgBlt
|
||||||
|
PolyBezier
|
||||||
|
PolyBezierTo
|
||||||
|
PolyDraw
|
||||||
|
PolyPolygon
|
||||||
|
PolyPolyline
|
||||||
|
PolyTextOutA
|
||||||
|
PolyTextOutW
|
||||||
|
Polygon
|
||||||
|
Polyline
|
||||||
|
PolylineTo
|
||||||
|
PtInRegion
|
||||||
|
PtVisible
|
||||||
|
RealizePalette
|
||||||
|
RectInRegion
|
||||||
|
RectVisible
|
||||||
|
Rectangle
|
||||||
|
RemoveFontResourceA
|
||||||
|
RemoveFontResourceW
|
||||||
|
ResetDCA
|
||||||
|
ResetDCW
|
||||||
|
ResizePalette
|
||||||
|
RestoreDC
|
||||||
|
RoundRect
|
||||||
|
SaveDC
|
||||||
|
ScaleViewportExtEx
|
||||||
|
ScaleWindowExtEx
|
||||||
|
SelectClipPath
|
||||||
|
SelectClipRgn
|
||||||
|
SelectObject
|
||||||
|
SelectPalette
|
||||||
|
SetAbortProc
|
||||||
|
SetArcDirection
|
||||||
|
SetBitmapBits
|
||||||
|
SetBitmapDimensionEx
|
||||||
|
SetBkColor
|
||||||
|
SetBkMode
|
||||||
|
SetBoundsRect
|
||||||
|
SetBrushOrgEx
|
||||||
|
SetColorAdjustment
|
||||||
|
SetColorSpace
|
||||||
|
SetDIBColorTable
|
||||||
|
SetDIBits
|
||||||
|
SetDIBitsToDevice
|
||||||
|
SetDeviceGammaRamp
|
||||||
|
SetEnhMetaFileBits
|
||||||
|
SetFontEnumeration
|
||||||
|
SetGraphicsMode
|
||||||
|
SetICMMode
|
||||||
|
SetICMProfileA
|
||||||
|
SetICMProfileW
|
||||||
|
SetLayout
|
||||||
|
SetMagicColors
|
||||||
|
SetMapMode
|
||||||
|
SetMapperFlags
|
||||||
|
SetMetaFileBitsEx
|
||||||
|
SetMetaRgn
|
||||||
|
SetMiterLimit
|
||||||
|
SetObjectOwner
|
||||||
|
SetPaletteEntries
|
||||||
|
SetPixel
|
||||||
|
SetPixelFormat
|
||||||
|
SetPixelV
|
||||||
|
SetPolyFillMode
|
||||||
|
SetROP2
|
||||||
|
SetRectRgn
|
||||||
|
SetStretchBltMode
|
||||||
|
SetSystemPaletteUse
|
||||||
|
SetTextAlign
|
||||||
|
SetTextCharacterExtra
|
||||||
|
SetTextColor
|
||||||
|
SetTextJustification
|
||||||
|
SetViewportExtEx
|
||||||
|
SetViewportOrgEx
|
||||||
|
SetWinMetaFileBits
|
||||||
|
SetWindowExtEx
|
||||||
|
SetWindowOrgEx
|
||||||
|
SetWorldTransform
|
||||||
|
StartDocA
|
||||||
|
StartDocW
|
||||||
|
StartPage
|
||||||
|
StretchBlt
|
||||||
|
StretchDIBits
|
||||||
|
StrokeAndFillPath
|
||||||
|
StrokePath
|
||||||
|
SwapBuffers
|
||||||
|
TextOutA
|
||||||
|
TextOutW
|
||||||
|
TranslateCharsetInfo
|
||||||
|
UnrealizeObject
|
||||||
|
UpdateColors
|
||||||
|
UpdateICMRegKeyA
|
||||||
|
UpdateICMRegKeyW
|
||||||
|
WidenPath
|
||||||
|
gdiPlaySpoolStream
|
||||||
|
pfnRealizePalette
|
||||||
|
pfnSelectPalette
|
||||||
763
bazaar/Tcc/lib/lib/kernel32.def
Normal file
763
bazaar/Tcc/lib/lib/kernel32.def
Normal file
|
|
@ -0,0 +1,763 @@
|
||||||
|
LIBRARY kernel32.dll
|
||||||
|
|
||||||
|
EXPORTS
|
||||||
|
AddAtomA
|
||||||
|
AddAtomW
|
||||||
|
AllocConsole
|
||||||
|
AllocLSCallback
|
||||||
|
AllocSLCallback
|
||||||
|
AreFileApisANSI
|
||||||
|
BackupRead
|
||||||
|
BackupSeek
|
||||||
|
BackupWrite
|
||||||
|
Beep
|
||||||
|
BeginUpdateResourceA
|
||||||
|
BeginUpdateResourceW
|
||||||
|
BuildCommDCBA
|
||||||
|
BuildCommDCBAndTimeoutsA
|
||||||
|
BuildCommDCBAndTimeoutsW
|
||||||
|
BuildCommDCBW
|
||||||
|
CallNamedPipeA
|
||||||
|
CallNamedPipeW
|
||||||
|
Callback12
|
||||||
|
Callback16
|
||||||
|
Callback20
|
||||||
|
Callback24
|
||||||
|
Callback28
|
||||||
|
Callback32
|
||||||
|
Callback36
|
||||||
|
Callback4
|
||||||
|
Callback40
|
||||||
|
Callback44
|
||||||
|
Callback48
|
||||||
|
Callback52
|
||||||
|
Callback56
|
||||||
|
Callback60
|
||||||
|
Callback64
|
||||||
|
Callback8
|
||||||
|
CancelDeviceWakeupRequest
|
||||||
|
CancelIo
|
||||||
|
CancelWaitableTimer
|
||||||
|
ClearCommBreak
|
||||||
|
ClearCommError
|
||||||
|
CloseHandle
|
||||||
|
CloseProfileUserMapping
|
||||||
|
CloseSystemHandle
|
||||||
|
CommConfigDialogA
|
||||||
|
CommConfigDialogW
|
||||||
|
CompareFileTime
|
||||||
|
CompareStringA
|
||||||
|
CompareStringW
|
||||||
|
ConnectNamedPipe
|
||||||
|
ContinueDebugEvent
|
||||||
|
ConvertDefaultLocale
|
||||||
|
ConvertThreadToFiber
|
||||||
|
ConvertToGlobalHandle
|
||||||
|
CopyFileA
|
||||||
|
CopyFileExA
|
||||||
|
CopyFileExW
|
||||||
|
CopyFileW
|
||||||
|
CreateConsoleScreenBuffer
|
||||||
|
CreateDirectoryA
|
||||||
|
CreateDirectoryExA
|
||||||
|
CreateDirectoryExW
|
||||||
|
CreateDirectoryW
|
||||||
|
CreateEventA
|
||||||
|
CreateEventW
|
||||||
|
CreateFiber
|
||||||
|
CreateFileA
|
||||||
|
CreateFileMappingA
|
||||||
|
CreateFileMappingW
|
||||||
|
CreateFileW
|
||||||
|
CreateIoCompletionPort
|
||||||
|
CreateKernelThread
|
||||||
|
CreateMailslotA
|
||||||
|
CreateMailslotW
|
||||||
|
CreateMutexA
|
||||||
|
CreateMutexW
|
||||||
|
CreateNamedPipeA
|
||||||
|
CreateNamedPipeW
|
||||||
|
CreatePipe
|
||||||
|
CreateProcessA
|
||||||
|
CreateProcessW
|
||||||
|
CreateRemoteThread
|
||||||
|
CreateSemaphoreA
|
||||||
|
CreateSemaphoreW
|
||||||
|
CreateSocketHandle
|
||||||
|
CreateTapePartition
|
||||||
|
CreateThread
|
||||||
|
CreateToolhelp32Snapshot
|
||||||
|
CreateWaitableTimerA
|
||||||
|
CreateWaitableTimerW
|
||||||
|
DebugActiveProcess
|
||||||
|
DebugBreak
|
||||||
|
DefineDosDeviceA
|
||||||
|
DefineDosDeviceW
|
||||||
|
DeleteAtom
|
||||||
|
DeleteCriticalSection
|
||||||
|
DeleteFiber
|
||||||
|
DeleteFileA
|
||||||
|
DeleteFileW
|
||||||
|
DeviceIoControl
|
||||||
|
DisableThreadLibraryCalls
|
||||||
|
DisconnectNamedPipe
|
||||||
|
DosDateTimeToFileTime
|
||||||
|
DuplicateHandle
|
||||||
|
EndUpdateResourceA
|
||||||
|
EndUpdateResourceW
|
||||||
|
EnterCriticalSection
|
||||||
|
EnumCalendarInfoA
|
||||||
|
EnumCalendarInfoExA
|
||||||
|
EnumCalendarInfoExW
|
||||||
|
EnumCalendarInfoW
|
||||||
|
EnumDateFormatsA
|
||||||
|
EnumDateFormatsExA
|
||||||
|
EnumDateFormatsExW
|
||||||
|
EnumDateFormatsW
|
||||||
|
EnumLanguageGroupLocalesA
|
||||||
|
EnumLanguageGroupLocalesW
|
||||||
|
EnumResourceLanguagesA
|
||||||
|
EnumResourceLanguagesW
|
||||||
|
EnumResourceNamesA
|
||||||
|
EnumResourceNamesW
|
||||||
|
EnumResourceTypesA
|
||||||
|
EnumResourceTypesW
|
||||||
|
EnumSystemCodePagesA
|
||||||
|
EnumSystemCodePagesW
|
||||||
|
EnumSystemGeoID
|
||||||
|
EnumSystemLanguageGroupsA
|
||||||
|
EnumSystemLanguageGroupsW
|
||||||
|
EnumSystemLocalesA
|
||||||
|
EnumSystemLocalesW
|
||||||
|
EnumTimeFormatsA
|
||||||
|
EnumTimeFormatsW
|
||||||
|
EnumUILanguagesA
|
||||||
|
EnumUILanguagesW
|
||||||
|
EraseTape
|
||||||
|
EscapeCommFunction
|
||||||
|
ExitProcess
|
||||||
|
ExitThread
|
||||||
|
ExpandEnvironmentStringsA
|
||||||
|
ExpandEnvironmentStringsW
|
||||||
|
FT_Exit0
|
||||||
|
FT_Exit12
|
||||||
|
FT_Exit16
|
||||||
|
FT_Exit20
|
||||||
|
FT_Exit24
|
||||||
|
FT_Exit28
|
||||||
|
FT_Exit32
|
||||||
|
FT_Exit36
|
||||||
|
FT_Exit4
|
||||||
|
FT_Exit40
|
||||||
|
FT_Exit44
|
||||||
|
FT_Exit48
|
||||||
|
FT_Exit52
|
||||||
|
FT_Exit56
|
||||||
|
FT_Exit8
|
||||||
|
FT_Prolog
|
||||||
|
FT_Thunk
|
||||||
|
FatalAppExitA
|
||||||
|
FatalAppExitW
|
||||||
|
FatalExit
|
||||||
|
FileTimeToDosDateTime
|
||||||
|
FileTimeToLocalFileTime
|
||||||
|
FileTimeToSystemTime
|
||||||
|
FillConsoleOutputAttribute
|
||||||
|
FillConsoleOutputCharacterA
|
||||||
|
FillConsoleOutputCharacterW
|
||||||
|
FindAtomA
|
||||||
|
FindAtomW
|
||||||
|
FindClose
|
||||||
|
FindCloseChangeNotification
|
||||||
|
FindFirstChangeNotificationA
|
||||||
|
FindFirstChangeNotificationW
|
||||||
|
FindFirstFileA
|
||||||
|
FindFirstFileExA
|
||||||
|
FindFirstFileExW
|
||||||
|
FindFirstFileW
|
||||||
|
FindNextChangeNotification
|
||||||
|
FindNextFileA
|
||||||
|
FindNextFileW
|
||||||
|
FindResourceA
|
||||||
|
FindResourceExA
|
||||||
|
FindResourceExW
|
||||||
|
FindResourceW
|
||||||
|
FlushConsoleInputBuffer
|
||||||
|
FlushFileBuffers
|
||||||
|
FlushInstructionCache
|
||||||
|
FlushViewOfFile
|
||||||
|
FoldStringA
|
||||||
|
FoldStringW
|
||||||
|
FormatMessageA
|
||||||
|
FormatMessageW
|
||||||
|
FreeConsole
|
||||||
|
FreeEnvironmentStringsA
|
||||||
|
FreeEnvironmentStringsW
|
||||||
|
FreeLSCallback
|
||||||
|
FreeLibrary
|
||||||
|
FreeLibraryAndExitThread
|
||||||
|
FreeResource
|
||||||
|
FreeSLCallback
|
||||||
|
GenerateConsoleCtrlEvent
|
||||||
|
GetACP
|
||||||
|
GetAtomNameA
|
||||||
|
GetAtomNameW
|
||||||
|
GetBinaryType
|
||||||
|
GetBinaryTypeA
|
||||||
|
GetBinaryTypeW
|
||||||
|
GetCPInfo
|
||||||
|
GetCPInfoExA
|
||||||
|
GetCPInfoExW
|
||||||
|
GetCalendarInfoA
|
||||||
|
GetCalendarInfoW
|
||||||
|
GetCommConfig
|
||||||
|
GetCommMask
|
||||||
|
GetCommModemStatus
|
||||||
|
GetCommProperties
|
||||||
|
GetCommState
|
||||||
|
GetCommTimeouts
|
||||||
|
GetCommandLineA
|
||||||
|
GetCommandLineW
|
||||||
|
GetCompressedFileSizeA
|
||||||
|
GetCompressedFileSizeW
|
||||||
|
GetComputerNameA
|
||||||
|
GetComputerNameW
|
||||||
|
GetConsoleCP
|
||||||
|
GetConsoleCursorInfo
|
||||||
|
GetConsoleMode
|
||||||
|
GetConsoleOutputCP
|
||||||
|
GetConsoleScreenBufferInfo
|
||||||
|
GetConsoleTitleA
|
||||||
|
GetConsoleTitleW
|
||||||
|
GetCurrencyFormatA
|
||||||
|
GetCurrencyFormatW
|
||||||
|
GetCurrentDirectoryA
|
||||||
|
GetCurrentDirectoryW
|
||||||
|
GetCurrentProcess
|
||||||
|
GetCurrentProcessId
|
||||||
|
GetCurrentThread
|
||||||
|
GetCurrentThreadId
|
||||||
|
GetDateFormatA
|
||||||
|
GetDateFormatW
|
||||||
|
GetDaylightFlag
|
||||||
|
GetDefaultCommConfigA
|
||||||
|
GetDefaultCommConfigW
|
||||||
|
GetDevicePowerState
|
||||||
|
GetDiskFreeSpaceA
|
||||||
|
GetDiskFreeSpaceExA
|
||||||
|
GetDiskFreeSpaceExW
|
||||||
|
GetDiskFreeSpaceW
|
||||||
|
GetDriveTypeA
|
||||||
|
GetDriveTypeW
|
||||||
|
GetEnvironmentStrings
|
||||||
|
GetEnvironmentStringsA
|
||||||
|
GetEnvironmentStringsW
|
||||||
|
GetEnvironmentVariableA
|
||||||
|
GetEnvironmentVariableW
|
||||||
|
GetErrorMode
|
||||||
|
GetExitCodeProcess
|
||||||
|
GetExitCodeThread
|
||||||
|
GetFileAttributesA
|
||||||
|
GetFileAttributesExA
|
||||||
|
GetFileAttributesExW
|
||||||
|
GetFileAttributesW
|
||||||
|
GetFileInformationByHandle
|
||||||
|
GetFileSize
|
||||||
|
GetFileTime
|
||||||
|
GetFileType
|
||||||
|
GetFullPathNameA
|
||||||
|
GetFullPathNameW
|
||||||
|
GetGeoInfoA
|
||||||
|
GetGeoInfoW
|
||||||
|
GetHandleContext
|
||||||
|
GetHandleInformation
|
||||||
|
GetLSCallbackTarget
|
||||||
|
GetLSCallbackTemplate
|
||||||
|
GetLargestConsoleWindowSize
|
||||||
|
GetLastError
|
||||||
|
GetLocalTime
|
||||||
|
GetLocaleInfoA
|
||||||
|
GetLocaleInfoW
|
||||||
|
GetLogicalDriveStringsA
|
||||||
|
GetLogicalDriveStringsW
|
||||||
|
GetLogicalDrives
|
||||||
|
GetLongPathNameA
|
||||||
|
GetLongPathNameW
|
||||||
|
GetMailslotInfo
|
||||||
|
GetModuleFileNameA
|
||||||
|
GetModuleFileNameW
|
||||||
|
GetModuleHandleA
|
||||||
|
GetModuleHandleW
|
||||||
|
GetNamedPipeHandleStateA
|
||||||
|
GetNamedPipeHandleStateW
|
||||||
|
GetNamedPipeInfo
|
||||||
|
GetNumberFormatA
|
||||||
|
GetNumberFormatW
|
||||||
|
GetNumberOfConsoleInputEvents
|
||||||
|
GetNumberOfConsoleMouseButtons
|
||||||
|
GetOEMCP
|
||||||
|
GetOverlappedResult
|
||||||
|
GetPriorityClass
|
||||||
|
GetPrivateProfileIntA
|
||||||
|
GetPrivateProfileIntW
|
||||||
|
GetPrivateProfileSectionA
|
||||||
|
GetPrivateProfileSectionNamesA
|
||||||
|
GetPrivateProfileSectionNamesW
|
||||||
|
GetPrivateProfileSectionW
|
||||||
|
GetPrivateProfileStringA
|
||||||
|
GetPrivateProfileStringW
|
||||||
|
GetPrivateProfileStructA
|
||||||
|
GetPrivateProfileStructW
|
||||||
|
GetProcAddress
|
||||||
|
GetProcessAffinityMask
|
||||||
|
GetProcessFlags
|
||||||
|
GetProcessHeap
|
||||||
|
GetProcessHeaps
|
||||||
|
GetProcessPriorityBoost
|
||||||
|
GetProcessShutdownParameters
|
||||||
|
GetProcessTimes
|
||||||
|
GetProcessVersion
|
||||||
|
GetProcessWorkingSetSize
|
||||||
|
GetProductName
|
||||||
|
GetProfileIntA
|
||||||
|
GetProfileIntW
|
||||||
|
GetProfileSectionA
|
||||||
|
GetProfileSectionW
|
||||||
|
GetProfileStringA
|
||||||
|
GetProfileStringW
|
||||||
|
GetQueuedCompletionStatus
|
||||||
|
GetSLCallbackTarget
|
||||||
|
GetSLCallbackTemplate
|
||||||
|
GetShortPathNameA
|
||||||
|
GetShortPathNameW
|
||||||
|
GetStartupInfoA
|
||||||
|
GetStartupInfoW
|
||||||
|
GetStdHandle
|
||||||
|
GetStringTypeA
|
||||||
|
GetStringTypeExA
|
||||||
|
GetStringTypeExW
|
||||||
|
GetStringTypeW
|
||||||
|
GetSystemDefaultLCID
|
||||||
|
GetSystemDefaultLangID
|
||||||
|
GetSystemDefaultUILanguage
|
||||||
|
GetSystemDirectoryA
|
||||||
|
GetSystemDirectoryW
|
||||||
|
GetSystemInfo
|
||||||
|
GetSystemPowerStatus
|
||||||
|
GetSystemTime
|
||||||
|
GetSystemTimeAdjustment
|
||||||
|
GetSystemTimeAsFileTime
|
||||||
|
GetTapeParameters
|
||||||
|
GetTapePosition
|
||||||
|
GetTapeStatus
|
||||||
|
GetTempFileNameA
|
||||||
|
GetTempFileNameW
|
||||||
|
GetTempPathA
|
||||||
|
GetTempPathW
|
||||||
|
GetThreadContext
|
||||||
|
GetThreadLocale
|
||||||
|
GetThreadPriority
|
||||||
|
GetThreadPriorityBoost
|
||||||
|
GetThreadSelectorEntry
|
||||||
|
GetThreadTimes
|
||||||
|
GetTickCount
|
||||||
|
GetTimeFormatA
|
||||||
|
GetTimeFormatW
|
||||||
|
GetTimeZoneInformation
|
||||||
|
GetUserDefaultLCID
|
||||||
|
GetUserDefaultLangID
|
||||||
|
GetUserDefaultUILanguage
|
||||||
|
GetUserGeoID
|
||||||
|
GetVersion
|
||||||
|
GetVersionExA
|
||||||
|
GetVersionExW
|
||||||
|
GetVolumeInformationA
|
||||||
|
GetVolumeInformationW
|
||||||
|
GetWindowsDirectoryA
|
||||||
|
GetWindowsDirectoryW
|
||||||
|
GetWriteWatch
|
||||||
|
GlobalAddAtomA
|
||||||
|
GlobalAddAtomW
|
||||||
|
GlobalAlloc
|
||||||
|
GlobalCompact
|
||||||
|
GlobalDeleteAtom
|
||||||
|
GlobalFindAtomA
|
||||||
|
GlobalFindAtomW
|
||||||
|
GlobalFix
|
||||||
|
GlobalFlags
|
||||||
|
GlobalFree
|
||||||
|
GlobalGetAtomNameA
|
||||||
|
GlobalGetAtomNameW
|
||||||
|
GlobalHandle
|
||||||
|
GlobalLock
|
||||||
|
GlobalMemoryStatus
|
||||||
|
GlobalReAlloc
|
||||||
|
GlobalSize
|
||||||
|
GlobalUnWire
|
||||||
|
GlobalUnfix
|
||||||
|
GlobalUnlock
|
||||||
|
GlobalWire
|
||||||
|
Heap32First
|
||||||
|
Heap32ListFirst
|
||||||
|
Heap32ListNext
|
||||||
|
Heap32Next
|
||||||
|
HeapAlloc
|
||||||
|
HeapCompact
|
||||||
|
HeapCreate
|
||||||
|
HeapDestroy
|
||||||
|
HeapFree
|
||||||
|
HeapLock
|
||||||
|
HeapReAlloc
|
||||||
|
HeapSetFlags
|
||||||
|
HeapSize
|
||||||
|
HeapUnlock
|
||||||
|
HeapValidate
|
||||||
|
HeapWalk
|
||||||
|
InitAtomTable
|
||||||
|
InitializeCriticalSection
|
||||||
|
InitializeCriticalSectionAndSpinCount
|
||||||
|
InterlockedCompareExchange
|
||||||
|
InterlockedDecrement
|
||||||
|
InterlockedExchange
|
||||||
|
InterlockedExchangeAdd
|
||||||
|
InterlockedIncrement
|
||||||
|
InvalidateNLSCache
|
||||||
|
IsBadCodePtr
|
||||||
|
IsBadHugeReadPtr
|
||||||
|
IsBadHugeWritePtr
|
||||||
|
IsBadReadPtr
|
||||||
|
IsBadStringPtrA
|
||||||
|
IsBadStringPtrW
|
||||||
|
IsBadWritePtr
|
||||||
|
IsDBCSLeadByte
|
||||||
|
IsDBCSLeadByteEx
|
||||||
|
IsDebuggerPresent
|
||||||
|
IsLSCallback
|
||||||
|
IsProcessorFeaturePresent
|
||||||
|
IsSLCallback
|
||||||
|
IsSystemResumeAutomatic
|
||||||
|
IsValidCodePage
|
||||||
|
IsValidLanguageGroup
|
||||||
|
IsValidLocale
|
||||||
|
K32Thk1632Epilog
|
||||||
|
K32Thk1632Prolog
|
||||||
|
K32_NtCreateFile
|
||||||
|
K32_RtlNtStatusToDosError
|
||||||
|
LCMapStringA
|
||||||
|
LCMapStringW
|
||||||
|
LeaveCriticalSection
|
||||||
|
LoadLibraryA
|
||||||
|
LoadLibraryExA
|
||||||
|
LoadLibraryExW
|
||||||
|
LoadLibraryW
|
||||||
|
LoadModule
|
||||||
|
LoadResource
|
||||||
|
LocalAlloc
|
||||||
|
LocalCompact
|
||||||
|
LocalFileTimeToFileTime
|
||||||
|
LocalFlags
|
||||||
|
LocalFree
|
||||||
|
LocalHandle
|
||||||
|
LocalLock
|
||||||
|
LocalReAlloc
|
||||||
|
LocalShrink
|
||||||
|
LocalSize
|
||||||
|
LocalUnlock
|
||||||
|
LockFile
|
||||||
|
LockFileEx
|
||||||
|
LockResource
|
||||||
|
MakeCriticalSectionGlobal
|
||||||
|
MapHInstLS
|
||||||
|
MapHInstLS_PN
|
||||||
|
MapHInstSL
|
||||||
|
MapHInstSL_PN
|
||||||
|
MapHModuleLS
|
||||||
|
MapHModuleSL
|
||||||
|
MapLS
|
||||||
|
MapSL
|
||||||
|
MapSLFix
|
||||||
|
MapViewOfFile
|
||||||
|
MapViewOfFileEx
|
||||||
|
Module32First
|
||||||
|
Module32Next
|
||||||
|
MoveFileA
|
||||||
|
MoveFileExA
|
||||||
|
MoveFileExW
|
||||||
|
MoveFileW
|
||||||
|
MulDiv
|
||||||
|
MultiByteToWideChar
|
||||||
|
NotifyNLSUserCache
|
||||||
|
OpenEventA
|
||||||
|
OpenEventW
|
||||||
|
OpenFile
|
||||||
|
OpenFileMappingA
|
||||||
|
OpenFileMappingW
|
||||||
|
OpenMutexA
|
||||||
|
OpenMutexW
|
||||||
|
OpenProcess
|
||||||
|
OpenProfileUserMapping
|
||||||
|
OpenSemaphoreA
|
||||||
|
OpenSemaphoreW
|
||||||
|
OpenThread
|
||||||
|
OpenVxDHandle
|
||||||
|
OpenWaitableTimerA
|
||||||
|
OpenWaitableTimerW
|
||||||
|
OutputDebugStringA
|
||||||
|
OutputDebugStringW
|
||||||
|
PeekConsoleInputA
|
||||||
|
PeekConsoleInputW
|
||||||
|
PeekNamedPipe
|
||||||
|
PostQueuedCompletionStatus
|
||||||
|
PrepareTape
|
||||||
|
Process32First
|
||||||
|
Process32Next
|
||||||
|
PulseEvent
|
||||||
|
PurgeComm
|
||||||
|
QT_Thunk
|
||||||
|
QueryDosDeviceA
|
||||||
|
QueryDosDeviceW
|
||||||
|
QueryNumberOfEventLogRecords
|
||||||
|
QueryOldestEventLogRecord
|
||||||
|
QueryPerformanceCounter
|
||||||
|
QueryPerformanceFrequency
|
||||||
|
QueueUserAPC
|
||||||
|
RaiseException
|
||||||
|
ReadConsoleA
|
||||||
|
ReadConsoleInputA
|
||||||
|
ReadConsoleInputW
|
||||||
|
ReadConsoleOutputA
|
||||||
|
ReadConsoleOutputAttribute
|
||||||
|
ReadConsoleOutputCharacterA
|
||||||
|
ReadConsoleOutputCharacterW
|
||||||
|
ReadConsoleOutputW
|
||||||
|
ReadConsoleW
|
||||||
|
ReadDirectoryChangesW
|
||||||
|
ReadFile
|
||||||
|
ReadFileEx
|
||||||
|
ReadFileScatter
|
||||||
|
ReadProcessMemory
|
||||||
|
RegisterServiceProcess
|
||||||
|
RegisterSysMsgHandler
|
||||||
|
ReinitializeCriticalSection
|
||||||
|
ReleaseMutex
|
||||||
|
ReleaseSemaphore
|
||||||
|
RemoveDirectoryA
|
||||||
|
RemoveDirectoryW
|
||||||
|
RequestDeviceWakeup
|
||||||
|
RequestWakeupLatency
|
||||||
|
ResetEvent
|
||||||
|
ResetNLSUserInfoCache
|
||||||
|
ResetWriteWatch
|
||||||
|
ResumeThread
|
||||||
|
RtlFillMemory
|
||||||
|
RtlMoveMemory
|
||||||
|
RtlUnwind
|
||||||
|
RtlZeroMemory
|
||||||
|
SMapLS
|
||||||
|
SMapLS_IP_EBP_12
|
||||||
|
SMapLS_IP_EBP_16
|
||||||
|
SMapLS_IP_EBP_20
|
||||||
|
SMapLS_IP_EBP_24
|
||||||
|
SMapLS_IP_EBP_28
|
||||||
|
SMapLS_IP_EBP_32
|
||||||
|
SMapLS_IP_EBP_36
|
||||||
|
SMapLS_IP_EBP_40
|
||||||
|
SMapLS_IP_EBP_8
|
||||||
|
SUnMapLS
|
||||||
|
SUnMapLS_IP_EBP_12
|
||||||
|
SUnMapLS_IP_EBP_16
|
||||||
|
SUnMapLS_IP_EBP_20
|
||||||
|
SUnMapLS_IP_EBP_24
|
||||||
|
SUnMapLS_IP_EBP_28
|
||||||
|
SUnMapLS_IP_EBP_32
|
||||||
|
SUnMapLS_IP_EBP_36
|
||||||
|
SUnMapLS_IP_EBP_40
|
||||||
|
SUnMapLS_IP_EBP_8
|
||||||
|
ScrollConsoleScreenBufferA
|
||||||
|
ScrollConsoleScreenBufferW
|
||||||
|
SearchPathA
|
||||||
|
SearchPathW
|
||||||
|
SetCalendarInfoA
|
||||||
|
SetCalendarInfoW
|
||||||
|
SetCommBreak
|
||||||
|
SetCommConfig
|
||||||
|
SetCommMask
|
||||||
|
SetCommState
|
||||||
|
SetCommTimeouts
|
||||||
|
SetComputerNameA
|
||||||
|
SetComputerNameW
|
||||||
|
SetConsoleActiveScreenBuffer
|
||||||
|
SetConsoleCP
|
||||||
|
SetConsoleCtrlHandler
|
||||||
|
SetConsoleCursorInfo
|
||||||
|
SetConsoleCursorPosition
|
||||||
|
SetConsoleMode
|
||||||
|
SetConsoleOutputCP
|
||||||
|
SetConsoleScreenBufferSize
|
||||||
|
SetConsoleTextAttribute
|
||||||
|
SetConsoleTitleA
|
||||||
|
SetConsoleTitleW
|
||||||
|
SetConsoleWindowInfo
|
||||||
|
SetCriticalSectionSpinCount
|
||||||
|
SetCurrentDirectoryA
|
||||||
|
SetCurrentDirectoryW
|
||||||
|
SetDaylightFlag
|
||||||
|
SetDefaultCommConfigA
|
||||||
|
SetDefaultCommConfigW
|
||||||
|
SetEndOfFile
|
||||||
|
SetEnvironmentVariableA
|
||||||
|
SetEnvironmentVariableW
|
||||||
|
SetErrorMode
|
||||||
|
SetEvent
|
||||||
|
SetFileApisToANSI
|
||||||
|
SetFileApisToOEM
|
||||||
|
SetFileAttributesA
|
||||||
|
SetFileAttributesW
|
||||||
|
SetFilePointer
|
||||||
|
SetFileTime
|
||||||
|
SetHandleContext
|
||||||
|
SetHandleCount
|
||||||
|
SetHandleInformation
|
||||||
|
SetLastError
|
||||||
|
SetLocalTime
|
||||||
|
SetLocaleInfoA
|
||||||
|
SetLocaleInfoW
|
||||||
|
SetMailslotInfo
|
||||||
|
SetMessageWaitingIndicator
|
||||||
|
SetNamedPipeHandleState
|
||||||
|
SetPriorityClass
|
||||||
|
SetProcessAffinityMask
|
||||||
|
SetProcessPriorityBoost
|
||||||
|
SetProcessShutdownParameters
|
||||||
|
SetProcessWorkingSetSize
|
||||||
|
SetStdHandle
|
||||||
|
SetSystemPowerState
|
||||||
|
SetSystemTime
|
||||||
|
SetSystemTimeAdjustment
|
||||||
|
SetTapeParameters
|
||||||
|
SetTapePosition
|
||||||
|
SetThreadAffinityMask
|
||||||
|
SetThreadContext
|
||||||
|
SetThreadExecutionState
|
||||||
|
SetThreadIdealProcessor
|
||||||
|
SetThreadLocale
|
||||||
|
SetThreadPriority
|
||||||
|
SetThreadPriorityBoost
|
||||||
|
SetTimeZoneInformation
|
||||||
|
SetUnhandledExceptionFilter
|
||||||
|
SetUserGeoID
|
||||||
|
SetVolumeLabelA
|
||||||
|
SetVolumeLabelW
|
||||||
|
SetWaitableTimer
|
||||||
|
SetupComm
|
||||||
|
SignalObjectAndWait
|
||||||
|
SignalSysMsgHandlers
|
||||||
|
SizeofResource
|
||||||
|
Sleep
|
||||||
|
SleepEx
|
||||||
|
SuspendThread
|
||||||
|
SwitchToFiber
|
||||||
|
SwitchToThread
|
||||||
|
SystemTimeToFileTime
|
||||||
|
SystemTimeToTzSpecificLocalTime
|
||||||
|
TerminateProcess
|
||||||
|
TerminateThread
|
||||||
|
Thread32First
|
||||||
|
Thread32Next
|
||||||
|
ThunkConnect32
|
||||||
|
TlsAlloc
|
||||||
|
TlsAllocInternal
|
||||||
|
TlsFree
|
||||||
|
TlsFreeInternal
|
||||||
|
TlsGetValue
|
||||||
|
TlsSetValue
|
||||||
|
Toolhelp32ReadProcessMemory
|
||||||
|
TransactNamedPipe
|
||||||
|
TransmitCommChar
|
||||||
|
TryEnterCriticalSection
|
||||||
|
UTRegister
|
||||||
|
UTUnRegister
|
||||||
|
UnMapLS
|
||||||
|
UnMapSLFixArray
|
||||||
|
UnhandledExceptionFilter
|
||||||
|
UninitializeCriticalSection
|
||||||
|
UnlockFile
|
||||||
|
UnlockFileEx
|
||||||
|
UnmapViewOfFile
|
||||||
|
UpdateResourceA
|
||||||
|
UpdateResourceW
|
||||||
|
VerLanguageNameA
|
||||||
|
VerLanguageNameW
|
||||||
|
VirtualAlloc
|
||||||
|
VirtualAllocEx
|
||||||
|
VirtualFree
|
||||||
|
VirtualFreeEx
|
||||||
|
VirtualLock
|
||||||
|
VirtualProtect
|
||||||
|
VirtualProtectEx
|
||||||
|
VirtualQuery
|
||||||
|
VirtualQueryEx
|
||||||
|
VirtualUnlock
|
||||||
|
WaitCommEvent
|
||||||
|
WaitForDebugEvent
|
||||||
|
WaitForMultipleObjects
|
||||||
|
WaitForMultipleObjectsEx
|
||||||
|
WaitForSingleObject
|
||||||
|
WaitForSingleObjectEx
|
||||||
|
WaitNamedPipeA
|
||||||
|
WaitNamedPipeW
|
||||||
|
WideCharToMultiByte
|
||||||
|
WinExec
|
||||||
|
WriteConsoleA
|
||||||
|
WriteConsoleInputA
|
||||||
|
WriteConsoleInputW
|
||||||
|
WriteConsoleOutputA
|
||||||
|
WriteConsoleOutputAttribute
|
||||||
|
WriteConsoleOutputCharacterA
|
||||||
|
WriteConsoleOutputCharacterW
|
||||||
|
WriteConsoleOutputW
|
||||||
|
WriteConsoleW
|
||||||
|
WriteFile
|
||||||
|
WriteFileEx
|
||||||
|
WriteFileGather
|
||||||
|
WritePrivateProfileSectionA
|
||||||
|
WritePrivateProfileSectionW
|
||||||
|
WritePrivateProfileStringA
|
||||||
|
WritePrivateProfileStringW
|
||||||
|
WritePrivateProfileStructA
|
||||||
|
WritePrivateProfileStructW
|
||||||
|
WriteProcessMemory
|
||||||
|
WriteProfileSectionA
|
||||||
|
WriteProfileSectionW
|
||||||
|
WriteProfileStringA
|
||||||
|
WriteProfileStringW
|
||||||
|
WriteTapemark
|
||||||
|
_DebugOut
|
||||||
|
_DebugPrintf
|
||||||
|
_hread
|
||||||
|
_hwrite
|
||||||
|
_lclose
|
||||||
|
_lcreat
|
||||||
|
_llseek
|
||||||
|
_lopen
|
||||||
|
_lread
|
||||||
|
_lwrite
|
||||||
|
dprintf
|
||||||
|
lstrcat
|
||||||
|
lstrcatA
|
||||||
|
lstrcatW
|
||||||
|
lstrcmp
|
||||||
|
lstrcmpA
|
||||||
|
lstrcmpW
|
||||||
|
lstrcmpi
|
||||||
|
lstrcmpiA
|
||||||
|
lstrcmpiW
|
||||||
|
lstrcpy
|
||||||
|
lstrcpyA
|
||||||
|
lstrcpyW
|
||||||
|
lstrcpyn
|
||||||
|
lstrcpynA
|
||||||
|
lstrcpynW
|
||||||
|
lstrlen
|
||||||
|
lstrlenA
|
||||||
|
lstrlenW
|
||||||
782
bazaar/Tcc/lib/lib/msvcrt.def
Normal file
782
bazaar/Tcc/lib/lib/msvcrt.def
Normal file
|
|
@ -0,0 +1,782 @@
|
||||||
|
LIBRARY msvcrt.dll
|
||||||
|
|
||||||
|
EXPORTS
|
||||||
|
$I10_OUTPUT
|
||||||
|
??0__non_rtti_object@@QAE@ABV0@@Z
|
||||||
|
??0__non_rtti_object@@QAE@PBD@Z
|
||||||
|
??0bad_cast@@QAE@ABQBD@Z
|
||||||
|
??0bad_cast@@QAE@ABV0@@Z
|
||||||
|
??0bad_typeid@@QAE@ABV0@@Z
|
||||||
|
??0bad_typeid@@QAE@PBD@Z
|
||||||
|
??0exception@@QAE@ABQBD@Z
|
||||||
|
??0exception@@QAE@ABV0@@Z
|
||||||
|
??0exception@@QAE@XZ
|
||||||
|
??1__non_rtti_object@@UAE@XZ
|
||||||
|
??1bad_cast@@UAE@XZ
|
||||||
|
??1bad_typeid@@UAE@XZ
|
||||||
|
??1exception@@UAE@XZ
|
||||||
|
??1type_info@@UAE@XZ
|
||||||
|
??2@YAPAXI@Z
|
||||||
|
??3@YAXPAX@Z
|
||||||
|
??4__non_rtti_object@@QAEAAV0@ABV0@@Z
|
||||||
|
??4bad_cast@@QAEAAV0@ABV0@@Z
|
||||||
|
??4bad_typeid@@QAEAAV0@ABV0@@Z
|
||||||
|
??4exception@@QAEAAV0@ABV0@@Z
|
||||||
|
??8type_info@@QBEHABV0@@Z
|
||||||
|
??9type_info@@QBEHABV0@@Z
|
||||||
|
??_7__non_rtti_object@@6B@
|
||||||
|
??_7bad_cast@@6B@
|
||||||
|
??_7bad_typeid@@6B@
|
||||||
|
??_7exception@@6B@
|
||||||
|
??_E__non_rtti_object@@UAEPAXI@Z
|
||||||
|
??_Ebad_cast@@UAEPAXI@Z
|
||||||
|
??_Ebad_typeid@@UAEPAXI@Z
|
||||||
|
??_Eexception@@UAEPAXI@Z
|
||||||
|
??_G__non_rtti_object@@UAEPAXI@Z
|
||||||
|
??_Gbad_cast@@UAEPAXI@Z
|
||||||
|
??_Gbad_typeid@@UAEPAXI@Z
|
||||||
|
??_Gexception@@UAEPAXI@Z
|
||||||
|
??_U@YAPAXI@Z
|
||||||
|
??_V@YAXPAX@Z
|
||||||
|
?_query_new_handler@@YAP6AHI@ZXZ
|
||||||
|
?_query_new_mode@@YAHXZ
|
||||||
|
?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z
|
||||||
|
?_set_new_mode@@YAHH@Z
|
||||||
|
?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z
|
||||||
|
?before@type_info@@QBEHABV1@@Z
|
||||||
|
?name@type_info@@QBEPBDXZ
|
||||||
|
?raw_name@type_info@@QBEPBDXZ
|
||||||
|
?set_new_handler@@YAP6AXXZP6AXXZ@Z
|
||||||
|
?set_terminate@@YAP6AXXZP6AXXZ@Z
|
||||||
|
?set_unexpected@@YAP6AXXZP6AXXZ@Z
|
||||||
|
?terminate@@YAXXZ
|
||||||
|
?unexpected@@YAXXZ
|
||||||
|
?what@exception@@UBEPBDXZ
|
||||||
|
_CIacos
|
||||||
|
_CIasin
|
||||||
|
_CIatan
|
||||||
|
_CIatan2
|
||||||
|
_CIcos
|
||||||
|
_CIcosh
|
||||||
|
_CIexp
|
||||||
|
_CIfmod
|
||||||
|
_CIlog
|
||||||
|
_CIlog10
|
||||||
|
_CIpow
|
||||||
|
_CIsin
|
||||||
|
_CIsinh
|
||||||
|
_CIsqrt
|
||||||
|
_CItan
|
||||||
|
_CItanh
|
||||||
|
_CxxThrowException
|
||||||
|
_EH_prolog
|
||||||
|
_Getdays
|
||||||
|
_Getmonths
|
||||||
|
_Gettnames
|
||||||
|
_HUGE
|
||||||
|
_Strftime
|
||||||
|
_XcptFilter
|
||||||
|
__CxxFrameHandler
|
||||||
|
__CxxLongjmpUnwind
|
||||||
|
__RTCastToVoid
|
||||||
|
__RTDynamicCast
|
||||||
|
__RTtypeid
|
||||||
|
__STRINGTOLD
|
||||||
|
__argc
|
||||||
|
__argv
|
||||||
|
__badioinfo
|
||||||
|
__crtCompareStringA
|
||||||
|
__crtGetLocaleInfoW
|
||||||
|
__crtLCMapStringA
|
||||||
|
__dllonexit
|
||||||
|
__doserrno
|
||||||
|
__fpecode
|
||||||
|
__getmainargs
|
||||||
|
__initenv
|
||||||
|
__isascii
|
||||||
|
__iscsym
|
||||||
|
__iscsymf
|
||||||
|
__lc_codepage
|
||||||
|
__lc_collate_cp
|
||||||
|
__lc_handle
|
||||||
|
__lconv_init
|
||||||
|
__mb_cur_max
|
||||||
|
__p___argc
|
||||||
|
__p___argv
|
||||||
|
__p___initenv
|
||||||
|
__p___mb_cur_max
|
||||||
|
__p___wargv
|
||||||
|
__p___winitenv
|
||||||
|
__p__acmdln
|
||||||
|
__p__amblksiz
|
||||||
|
__p__commode
|
||||||
|
__p__daylight
|
||||||
|
__p__dstbias
|
||||||
|
__p__environ
|
||||||
|
__p__fileinfo
|
||||||
|
__p__fmode
|
||||||
|
__p__iob
|
||||||
|
__p__mbcasemap
|
||||||
|
__p__mbctype
|
||||||
|
__p__osver
|
||||||
|
__p__pctype
|
||||||
|
__p__pgmptr
|
||||||
|
__p__pwctype
|
||||||
|
__p__timezone
|
||||||
|
__p__tzname
|
||||||
|
__p__wcmdln
|
||||||
|
__p__wenviron
|
||||||
|
__p__winmajor
|
||||||
|
__p__winminor
|
||||||
|
__p__winver
|
||||||
|
__p__wpgmptr
|
||||||
|
__pioinfo
|
||||||
|
__pxcptinfoptrs
|
||||||
|
__set_app_type
|
||||||
|
__setlc_active
|
||||||
|
__setusermatherr
|
||||||
|
__threadhandle
|
||||||
|
__threadid
|
||||||
|
__toascii
|
||||||
|
__unDName
|
||||||
|
__unDNameEx
|
||||||
|
__unguarded_readlc_active
|
||||||
|
__wargv
|
||||||
|
__wgetmainargs
|
||||||
|
__winitenv
|
||||||
|
_abnormal_termination
|
||||||
|
_access
|
||||||
|
_acmdln
|
||||||
|
_adj_fdiv_m16i
|
||||||
|
_adj_fdiv_m32
|
||||||
|
_adj_fdiv_m32i
|
||||||
|
_adj_fdiv_m64
|
||||||
|
_adj_fdiv_r
|
||||||
|
_adj_fdivr_m16i
|
||||||
|
_adj_fdivr_m32
|
||||||
|
_adj_fdivr_m32i
|
||||||
|
_adj_fdivr_m64
|
||||||
|
_adj_fpatan
|
||||||
|
_adj_fprem
|
||||||
|
_adj_fprem1
|
||||||
|
_adj_fptan
|
||||||
|
_adjust_fdiv
|
||||||
|
_aexit_rtn
|
||||||
|
_amsg_exit
|
||||||
|
_assert
|
||||||
|
_atodbl
|
||||||
|
_atoi64
|
||||||
|
_atoldbl
|
||||||
|
_beep
|
||||||
|
_beginthread
|
||||||
|
_beginthreadex
|
||||||
|
_c_exit
|
||||||
|
_cabs
|
||||||
|
_callnewh
|
||||||
|
_cexit
|
||||||
|
_cgets
|
||||||
|
_chdir
|
||||||
|
_chdrive
|
||||||
|
_chgsign
|
||||||
|
_chkesp
|
||||||
|
_chmod
|
||||||
|
_chsize
|
||||||
|
_clearfp
|
||||||
|
_close
|
||||||
|
_commit
|
||||||
|
_commode
|
||||||
|
_control87
|
||||||
|
_controlfp
|
||||||
|
_copysign
|
||||||
|
_cprintf
|
||||||
|
_cputs
|
||||||
|
_creat
|
||||||
|
_cscanf
|
||||||
|
_ctime64
|
||||||
|
_ctype
|
||||||
|
_cwait
|
||||||
|
_daylight
|
||||||
|
_dstbias
|
||||||
|
_dup
|
||||||
|
_dup2
|
||||||
|
_ecvt
|
||||||
|
_endthread
|
||||||
|
_endthreadex
|
||||||
|
_environ
|
||||||
|
_eof
|
||||||
|
_errno
|
||||||
|
_except_handler2
|
||||||
|
_except_handler3
|
||||||
|
_execl
|
||||||
|
_execle
|
||||||
|
_execlp
|
||||||
|
_execlpe
|
||||||
|
_execv
|
||||||
|
_execve
|
||||||
|
_execvp
|
||||||
|
_execvpe
|
||||||
|
_exit
|
||||||
|
_expand
|
||||||
|
_fcloseall
|
||||||
|
_fcvt
|
||||||
|
_fdopen
|
||||||
|
_fgetchar
|
||||||
|
_fgetwchar
|
||||||
|
_filbuf
|
||||||
|
_fileinfo
|
||||||
|
_filelength
|
||||||
|
_filelengthi64
|
||||||
|
_fileno
|
||||||
|
_findclose
|
||||||
|
_findfirst
|
||||||
|
_findfirst64
|
||||||
|
_findfirsti64
|
||||||
|
_findnext
|
||||||
|
_findnext64
|
||||||
|
_findnexti64
|
||||||
|
_finite
|
||||||
|
_flsbuf
|
||||||
|
_flushall
|
||||||
|
_fmode
|
||||||
|
_fpclass
|
||||||
|
_fpieee_flt
|
||||||
|
_fpreset
|
||||||
|
_fputchar
|
||||||
|
_fputwchar
|
||||||
|
_fsopen
|
||||||
|
_fstat
|
||||||
|
_fstat64
|
||||||
|
_fstati64
|
||||||
|
_ftime
|
||||||
|
_ftime64
|
||||||
|
_ftol
|
||||||
|
_fullpath
|
||||||
|
_futime
|
||||||
|
_futime64
|
||||||
|
_gcvt
|
||||||
|
_get_osfhandle
|
||||||
|
_get_sbh_threshold
|
||||||
|
_getch
|
||||||
|
_getche
|
||||||
|
_getcwd
|
||||||
|
_getdcwd
|
||||||
|
_getdiskfree
|
||||||
|
_getdllprocaddr
|
||||||
|
_getdrive
|
||||||
|
_getdrives
|
||||||
|
_getmaxstdio
|
||||||
|
_getmbcp
|
||||||
|
_getpid
|
||||||
|
_getsystime
|
||||||
|
_getw
|
||||||
|
_getws
|
||||||
|
_global_unwind2
|
||||||
|
_gmtime64
|
||||||
|
_heapadd
|
||||||
|
_heapchk
|
||||||
|
_heapmin
|
||||||
|
_heapset
|
||||||
|
_heapused
|
||||||
|
_heapwalk
|
||||||
|
_hypot
|
||||||
|
_i64toa
|
||||||
|
_i64tow
|
||||||
|
_initterm
|
||||||
|
_inp
|
||||||
|
_inpd
|
||||||
|
_inpw
|
||||||
|
_iob
|
||||||
|
_isatty
|
||||||
|
_isctype
|
||||||
|
_ismbbalnum
|
||||||
|
_ismbbalpha
|
||||||
|
_ismbbgraph
|
||||||
|
_ismbbkalnum
|
||||||
|
_ismbbkana
|
||||||
|
_ismbbkprint
|
||||||
|
_ismbbkpunct
|
||||||
|
_ismbblead
|
||||||
|
_ismbbprint
|
||||||
|
_ismbbpunct
|
||||||
|
_ismbbtrail
|
||||||
|
_ismbcalnum
|
||||||
|
_ismbcalpha
|
||||||
|
_ismbcdigit
|
||||||
|
_ismbcgraph
|
||||||
|
_ismbchira
|
||||||
|
_ismbckata
|
||||||
|
_ismbcl0
|
||||||
|
_ismbcl1
|
||||||
|
_ismbcl2
|
||||||
|
_ismbclegal
|
||||||
|
_ismbclower
|
||||||
|
_ismbcprint
|
||||||
|
_ismbcpunct
|
||||||
|
_ismbcspace
|
||||||
|
_ismbcsymbol
|
||||||
|
_ismbcupper
|
||||||
|
_ismbslead
|
||||||
|
_ismbstrail
|
||||||
|
_isnan
|
||||||
|
_itoa
|
||||||
|
_itow
|
||||||
|
_j0
|
||||||
|
_j1
|
||||||
|
_jn
|
||||||
|
_kbhit
|
||||||
|
_lfind
|
||||||
|
_loaddll
|
||||||
|
_local_unwind2
|
||||||
|
_localtime64
|
||||||
|
_lock
|
||||||
|
_locking
|
||||||
|
_logb
|
||||||
|
_longjmpex
|
||||||
|
_lrotl
|
||||||
|
_lrotr
|
||||||
|
_lsearch
|
||||||
|
_lseek
|
||||||
|
_lseeki64
|
||||||
|
_ltoa
|
||||||
|
_ltow
|
||||||
|
_makepath
|
||||||
|
_mbbtombc
|
||||||
|
_mbbtype
|
||||||
|
_mbcasemap
|
||||||
|
_mbccpy
|
||||||
|
_mbcjistojms
|
||||||
|
_mbcjmstojis
|
||||||
|
_mbclen
|
||||||
|
_mbctohira
|
||||||
|
_mbctokata
|
||||||
|
_mbctolower
|
||||||
|
_mbctombb
|
||||||
|
_mbctoupper
|
||||||
|
_mbctype
|
||||||
|
_mbsbtype
|
||||||
|
_mbscat
|
||||||
|
_mbschr
|
||||||
|
_mbscmp
|
||||||
|
_mbscoll
|
||||||
|
_mbscpy
|
||||||
|
_mbscspn
|
||||||
|
_mbsdec
|
||||||
|
_mbsdup
|
||||||
|
_mbsicmp
|
||||||
|
_mbsicoll
|
||||||
|
_mbsinc
|
||||||
|
_mbslen
|
||||||
|
_mbslwr
|
||||||
|
_mbsnbcat
|
||||||
|
_mbsnbcmp
|
||||||
|
_mbsnbcnt
|
||||||
|
_mbsnbcoll
|
||||||
|
_mbsnbcpy
|
||||||
|
_mbsnbicmp
|
||||||
|
_mbsnbicoll
|
||||||
|
_mbsnbset
|
||||||
|
_mbsncat
|
||||||
|
_mbsnccnt
|
||||||
|
_mbsncmp
|
||||||
|
_mbsncoll
|
||||||
|
_mbsncpy
|
||||||
|
_mbsnextc
|
||||||
|
_mbsnicmp
|
||||||
|
_mbsnicoll
|
||||||
|
_mbsninc
|
||||||
|
_mbsnset
|
||||||
|
_mbspbrk
|
||||||
|
_mbsrchr
|
||||||
|
_mbsrev
|
||||||
|
_mbsset
|
||||||
|
_mbsspn
|
||||||
|
_mbsspnp
|
||||||
|
_mbsstr
|
||||||
|
_mbstok
|
||||||
|
_mbstrlen
|
||||||
|
_mbsupr
|
||||||
|
_memccpy
|
||||||
|
_memicmp
|
||||||
|
_mkdir
|
||||||
|
_mktemp
|
||||||
|
_mktime64
|
||||||
|
_msize
|
||||||
|
_nextafter
|
||||||
|
_onexit
|
||||||
|
_open
|
||||||
|
_open_osfhandle
|
||||||
|
_osplatform
|
||||||
|
_osver
|
||||||
|
_outp
|
||||||
|
_outpd
|
||||||
|
_outpw
|
||||||
|
_pclose
|
||||||
|
_pctype
|
||||||
|
_pgmptr
|
||||||
|
_pipe
|
||||||
|
_popen
|
||||||
|
_purecall
|
||||||
|
_putch
|
||||||
|
_putenv
|
||||||
|
_putw
|
||||||
|
_putws
|
||||||
|
_pwctype
|
||||||
|
_read
|
||||||
|
_rmdir
|
||||||
|
_rmtmp
|
||||||
|
_rotl
|
||||||
|
_rotr
|
||||||
|
_safe_fdiv
|
||||||
|
_safe_fdivr
|
||||||
|
_safe_fprem
|
||||||
|
_safe_fprem1
|
||||||
|
_scalb
|
||||||
|
_searchenv
|
||||||
|
_seh_longjmp_unwind
|
||||||
|
_set_error_mode
|
||||||
|
_set_sbh_threshold
|
||||||
|
_seterrormode
|
||||||
|
_setjmp
|
||||||
|
_setjmp3
|
||||||
|
_setmaxstdio
|
||||||
|
_setmbcp
|
||||||
|
_setmode
|
||||||
|
_setsystime
|
||||||
|
_sleep
|
||||||
|
_snprintf
|
||||||
|
_snwprintf
|
||||||
|
_sopen
|
||||||
|
_spawnl
|
||||||
|
_spawnle
|
||||||
|
_spawnlp
|
||||||
|
_spawnlpe
|
||||||
|
_spawnv
|
||||||
|
_spawnve
|
||||||
|
_spawnvp
|
||||||
|
_spawnvpe
|
||||||
|
_splitpath
|
||||||
|
_stat
|
||||||
|
_stat64
|
||||||
|
_stati64
|
||||||
|
_statusfp
|
||||||
|
_strcmpi
|
||||||
|
_strdate
|
||||||
|
_strdup
|
||||||
|
_strerror
|
||||||
|
_stricmp
|
||||||
|
_stricoll
|
||||||
|
_strlwr
|
||||||
|
_strncoll
|
||||||
|
_strnicmp
|
||||||
|
_strnicoll
|
||||||
|
_strnset
|
||||||
|
_strrev
|
||||||
|
_strset
|
||||||
|
_strtime
|
||||||
|
_strupr
|
||||||
|
_swab
|
||||||
|
_sys_errlist
|
||||||
|
_sys_nerr
|
||||||
|
_tell
|
||||||
|
_telli64
|
||||||
|
_tempnam
|
||||||
|
_time64
|
||||||
|
_timezone
|
||||||
|
_tolower
|
||||||
|
_toupper
|
||||||
|
_tzname
|
||||||
|
_tzset
|
||||||
|
_ui64toa
|
||||||
|
_ui64tow
|
||||||
|
_ultoa
|
||||||
|
_ultow
|
||||||
|
_umask
|
||||||
|
_ungetch
|
||||||
|
_unlink
|
||||||
|
_unloaddll
|
||||||
|
_unlock
|
||||||
|
_utime
|
||||||
|
_utime64
|
||||||
|
_vsnprintf
|
||||||
|
_vsnwprintf
|
||||||
|
_waccess
|
||||||
|
_wasctime
|
||||||
|
_wchdir
|
||||||
|
_wchmod
|
||||||
|
_wcmdln
|
||||||
|
_wcreat
|
||||||
|
_wcsdup
|
||||||
|
_wcsicmp
|
||||||
|
_wcsicoll
|
||||||
|
_wcslwr
|
||||||
|
_wcsncoll
|
||||||
|
_wcsnicmp
|
||||||
|
_wcsnicoll
|
||||||
|
_wcsnset
|
||||||
|
_wcsrev
|
||||||
|
_wcsset
|
||||||
|
_wcsupr
|
||||||
|
_wctime
|
||||||
|
_wctime64
|
||||||
|
_wenviron
|
||||||
|
_wexecl
|
||||||
|
_wexecle
|
||||||
|
_wexeclp
|
||||||
|
_wexeclpe
|
||||||
|
_wexecv
|
||||||
|
_wexecve
|
||||||
|
_wexecvp
|
||||||
|
_wexecvpe
|
||||||
|
_wfdopen
|
||||||
|
_wfindfirst
|
||||||
|
_wfindfirst64
|
||||||
|
_wfindfirsti64
|
||||||
|
_wfindnext
|
||||||
|
_wfindnext64
|
||||||
|
_wfindnexti64
|
||||||
|
_wfopen
|
||||||
|
_wfreopen
|
||||||
|
_wfsopen
|
||||||
|
_wfullpath
|
||||||
|
_wgetcwd
|
||||||
|
_wgetdcwd
|
||||||
|
_wgetenv
|
||||||
|
_winmajor
|
||||||
|
_winminor
|
||||||
|
_winver
|
||||||
|
_wmakepath
|
||||||
|
_wmkdir
|
||||||
|
_wmktemp
|
||||||
|
_wopen
|
||||||
|
_wperror
|
||||||
|
_wpgmptr
|
||||||
|
_wpopen
|
||||||
|
_wputenv
|
||||||
|
_wremove
|
||||||
|
_wrename
|
||||||
|
_write
|
||||||
|
_wrmdir
|
||||||
|
_wsearchenv
|
||||||
|
_wsetlocale
|
||||||
|
_wsopen
|
||||||
|
_wspawnl
|
||||||
|
_wspawnle
|
||||||
|
_wspawnlp
|
||||||
|
_wspawnlpe
|
||||||
|
_wspawnv
|
||||||
|
_wspawnve
|
||||||
|
_wspawnvp
|
||||||
|
_wspawnvpe
|
||||||
|
_wsplitpath
|
||||||
|
_wstat
|
||||||
|
_wstat64
|
||||||
|
_wstati64
|
||||||
|
_wstrdate
|
||||||
|
_wstrtime
|
||||||
|
_wsystem
|
||||||
|
_wtempnam
|
||||||
|
_wtmpnam
|
||||||
|
_wtoi
|
||||||
|
_wtoi64
|
||||||
|
_wtol
|
||||||
|
_wunlink
|
||||||
|
_wutime
|
||||||
|
_wutime64
|
||||||
|
_y0
|
||||||
|
_y1
|
||||||
|
_yn
|
||||||
|
abort
|
||||||
|
abs
|
||||||
|
acos
|
||||||
|
asctime
|
||||||
|
asin
|
||||||
|
atan
|
||||||
|
atan2
|
||||||
|
atexit
|
||||||
|
atof
|
||||||
|
atoi
|
||||||
|
atol
|
||||||
|
bsearch
|
||||||
|
calloc
|
||||||
|
ceil
|
||||||
|
clearerr
|
||||||
|
clock
|
||||||
|
cos
|
||||||
|
cosh
|
||||||
|
ctime
|
||||||
|
difftime
|
||||||
|
div
|
||||||
|
exit
|
||||||
|
exp
|
||||||
|
fabs
|
||||||
|
fclose
|
||||||
|
feof
|
||||||
|
ferror
|
||||||
|
fflush
|
||||||
|
fgetc
|
||||||
|
fgetpos
|
||||||
|
fgets
|
||||||
|
fgetwc
|
||||||
|
fgetws
|
||||||
|
floor
|
||||||
|
fmod
|
||||||
|
fopen
|
||||||
|
fprintf
|
||||||
|
fputc
|
||||||
|
fputs
|
||||||
|
fputwc
|
||||||
|
fputws
|
||||||
|
fread
|
||||||
|
free
|
||||||
|
freopen
|
||||||
|
frexp
|
||||||
|
fscanf
|
||||||
|
fseek
|
||||||
|
fsetpos
|
||||||
|
ftell
|
||||||
|
fwprintf
|
||||||
|
fwrite
|
||||||
|
fwscanf
|
||||||
|
getc
|
||||||
|
getchar
|
||||||
|
getenv
|
||||||
|
gets
|
||||||
|
getwc
|
||||||
|
getwchar
|
||||||
|
gmtime
|
||||||
|
is_wctype
|
||||||
|
isalnum
|
||||||
|
isalpha
|
||||||
|
iscntrl
|
||||||
|
isdigit
|
||||||
|
isgraph
|
||||||
|
isleadbyte
|
||||||
|
islower
|
||||||
|
isprint
|
||||||
|
ispunct
|
||||||
|
isspace
|
||||||
|
isupper
|
||||||
|
iswalnum
|
||||||
|
iswalpha
|
||||||
|
iswascii
|
||||||
|
iswcntrl
|
||||||
|
iswctype
|
||||||
|
iswdigit
|
||||||
|
iswgraph
|
||||||
|
iswlower
|
||||||
|
iswprint
|
||||||
|
iswpunct
|
||||||
|
iswspace
|
||||||
|
iswupper
|
||||||
|
iswxdigit
|
||||||
|
isxdigit
|
||||||
|
labs
|
||||||
|
ldexp
|
||||||
|
ldiv
|
||||||
|
localeconv
|
||||||
|
localtime
|
||||||
|
log
|
||||||
|
log10
|
||||||
|
longjmp
|
||||||
|
malloc
|
||||||
|
mblen
|
||||||
|
mbstowcs
|
||||||
|
mbtowc
|
||||||
|
memchr
|
||||||
|
memcmp
|
||||||
|
memcpy
|
||||||
|
memmove
|
||||||
|
memset
|
||||||
|
mktime
|
||||||
|
modf
|
||||||
|
perror
|
||||||
|
pow
|
||||||
|
printf
|
||||||
|
putc
|
||||||
|
putchar
|
||||||
|
puts
|
||||||
|
putwc
|
||||||
|
putwchar
|
||||||
|
qsort
|
||||||
|
raise
|
||||||
|
rand
|
||||||
|
realloc
|
||||||
|
remove
|
||||||
|
rename
|
||||||
|
rewind
|
||||||
|
scanf
|
||||||
|
setbuf
|
||||||
|
setlocale
|
||||||
|
setvbuf
|
||||||
|
signal
|
||||||
|
sin
|
||||||
|
sinh
|
||||||
|
sprintf
|
||||||
|
sqrt
|
||||||
|
srand
|
||||||
|
sscanf
|
||||||
|
strcat
|
||||||
|
strchr
|
||||||
|
strcmp
|
||||||
|
strcoll
|
||||||
|
strcpy
|
||||||
|
strcspn
|
||||||
|
strerror
|
||||||
|
strftime
|
||||||
|
strlen
|
||||||
|
strncat
|
||||||
|
strncmp
|
||||||
|
strncpy
|
||||||
|
strpbrk
|
||||||
|
strrchr
|
||||||
|
strspn
|
||||||
|
strstr
|
||||||
|
strtod
|
||||||
|
strtok
|
||||||
|
strtol
|
||||||
|
strtoul
|
||||||
|
strxfrm
|
||||||
|
swprintf
|
||||||
|
swscanf
|
||||||
|
system
|
||||||
|
tan
|
||||||
|
tanh
|
||||||
|
time
|
||||||
|
tmpfile
|
||||||
|
tmpnam
|
||||||
|
tolower
|
||||||
|
toupper
|
||||||
|
towlower
|
||||||
|
towupper
|
||||||
|
ungetc
|
||||||
|
ungetwc
|
||||||
|
vfprintf
|
||||||
|
vfwprintf
|
||||||
|
vprintf
|
||||||
|
vsprintf
|
||||||
|
vswprintf
|
||||||
|
vwprintf
|
||||||
|
wcscat
|
||||||
|
wcschr
|
||||||
|
wcscmp
|
||||||
|
wcscoll
|
||||||
|
wcscpy
|
||||||
|
wcscspn
|
||||||
|
wcsftime
|
||||||
|
wcslen
|
||||||
|
wcsncat
|
||||||
|
wcsncmp
|
||||||
|
wcsncpy
|
||||||
|
wcspbrk
|
||||||
|
wcsrchr
|
||||||
|
wcsspn
|
||||||
|
wcsstr
|
||||||
|
wcstod
|
||||||
|
wcstok
|
||||||
|
wcstol
|
||||||
|
wcstombs
|
||||||
|
wcstoul
|
||||||
|
wcsxfrm
|
||||||
|
wctomb
|
||||||
|
wprintf
|
||||||
|
wscanf
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue