remove binary libraries from git
This commit is contained in:
5
libraries/i686-linux/include/.svn/all-wcprops
Normal file
5
libraries/i686-linux/include/.svn/all-wcprops
Normal file
@@ -0,0 +1,5 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 84
|
||||
/svn/linden/!svn/ver/2456/projects/2009/snowglobe/trunk/libraries/i686-linux/include
|
||||
END
|
||||
28
libraries/i686-linux/include/.svn/entries
Normal file
28
libraries/i686-linux/include/.svn/entries
Normal file
@@ -0,0 +1,28 @@
|
||||
10
|
||||
|
||||
dir
|
||||
3299
|
||||
https://svn.secondlife.com/svn/linden/projects/2009/snowglobe/trunk/libraries/i686-linux/include
|
||||
https://svn.secondlife.com/svn/linden
|
||||
|
||||
|
||||
|
||||
2008-06-11T19:50:31.947784Z
|
||||
636
|
||||
soft.linden
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
a6265765-422e-0410-accc-9fb60e44a920
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
/*
|
||||
ELFI.h - ELF reader and producer.
|
||||
Copyright (C) 2001 Serge Lamikhov-Center <to_serge@users.sourceforge.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef ELFI_H
|
||||
#define ELFI_H
|
||||
|
||||
#include <string>
|
||||
#include "ELFTypes.h"
|
||||
|
||||
// Forward declaration
|
||||
class IELFI;
|
||||
class IELFISection;
|
||||
class IELFIStringReader;
|
||||
class IELFISymbolTable;
|
||||
class IELFIRelocationTable;
|
||||
class IELFINoteReader;
|
||||
class IELFIDynamicReader;
|
||||
class IELFISegment;
|
||||
|
||||
|
||||
// ELF file reader interface. This class gives an access to properties
|
||||
// of a ELF file. Also you may get sections of the file or create
|
||||
// section's readers.
|
||||
class IELFI
|
||||
{
|
||||
public:
|
||||
virtual ~IELFI(){}
|
||||
|
||||
// Section reader's types
|
||||
enum ReaderType {
|
||||
ELFI_STRING, // Strings reader
|
||||
ELFI_SYMBOL, // Symbol table reader
|
||||
ELFI_RELOCATION, // Relocation table reader
|
||||
ELFI_NOTE, // Notes reader
|
||||
ELFI_DYNAMIC, // Dynamic section reader
|
||||
ELFI_HASH // Hash
|
||||
};
|
||||
|
||||
// Construct/destroy/initialize an object
|
||||
virtual ELFIO_Err Load( const std::string& sFileName ) = 0;
|
||||
virtual ELFIO_Err Load( std::istream* pStream, int startPos ) = 0;
|
||||
virtual bool IsInitialized() const = 0;
|
||||
virtual int AddRef() const = 0;
|
||||
virtual int Release() const = 0;
|
||||
|
||||
// ELF header functions
|
||||
virtual unsigned char GetClass() const = 0;
|
||||
virtual unsigned char GetEncoding() const = 0;
|
||||
virtual unsigned char GetELFVersion() const = 0;
|
||||
virtual Elf32_Half GetType() const = 0;
|
||||
virtual Elf32_Half GetMachine() const = 0;
|
||||
virtual Elf32_Word GetVersion() const = 0;
|
||||
virtual Elf32_Addr GetEntry() const = 0;
|
||||
virtual Elf32_Word GetFlags() const = 0;
|
||||
virtual Elf32_Half GetSecStrNdx() const = 0;
|
||||
|
||||
// Section provider functions
|
||||
virtual Elf32_Half GetSectionsNum() const = 0;
|
||||
virtual const IELFISection* GetSection( Elf32_Half index ) const = 0;
|
||||
virtual const IELFISection* GetSection( const std::string& name ) const = 0;
|
||||
|
||||
// Segment provider functions
|
||||
virtual Elf32_Half GetSegmentsNum() const = 0;
|
||||
virtual const IELFISegment* GetSegment( Elf32_Half index ) const = 0;
|
||||
|
||||
// Section readers' builder
|
||||
virtual ELFIO_Err CreateSectionReader( ReaderType type, const IELFISection* pSection,
|
||||
void** ppObj ) const = 0;
|
||||
};
|
||||
|
||||
|
||||
// The class represents an ELF file section
|
||||
class IELFISection
|
||||
{
|
||||
public:
|
||||
virtual ~IELFISection() = 0;
|
||||
|
||||
virtual int AddRef() const = 0;
|
||||
virtual int Release() const = 0;
|
||||
|
||||
// Section info functions
|
||||
virtual Elf32_Half GetIndex() const = 0;
|
||||
virtual std::string GetName() const = 0;
|
||||
virtual Elf32_Word GetType() const = 0;
|
||||
virtual Elf32_Word GetFlags() const = 0;
|
||||
virtual Elf32_Addr GetAddress() const = 0;
|
||||
virtual Elf32_Word GetSize() const = 0;
|
||||
virtual Elf32_Word GetLink() const = 0;
|
||||
virtual Elf32_Word GetInfo() const = 0;
|
||||
virtual Elf32_Word GetAddrAlign() const = 0;
|
||||
virtual Elf32_Word GetEntrySize() const = 0;
|
||||
virtual const char* GetData() const = 0;
|
||||
};
|
||||
|
||||
|
||||
// Program segment
|
||||
class IELFISegment
|
||||
{
|
||||
public:
|
||||
virtual ~IELFISegment() = 0;
|
||||
|
||||
virtual int AddRef() const = 0;
|
||||
virtual int Release() const = 0;
|
||||
|
||||
// Section info functions
|
||||
virtual Elf32_Word GetType() const = 0;
|
||||
virtual Elf32_Addr GetVirtualAddress() const = 0;
|
||||
virtual Elf32_Addr GetPhysicalAddress() const = 0;
|
||||
virtual Elf32_Word GetFileSize() const = 0;
|
||||
virtual Elf32_Word GetMemSize() const = 0;
|
||||
virtual Elf32_Word GetFlags() const = 0;
|
||||
virtual Elf32_Word GetAlign() const = 0;
|
||||
virtual const char* GetData() const = 0;
|
||||
};
|
||||
|
||||
|
||||
// String table reader
|
||||
class IELFIStringReader : virtual public IELFISection
|
||||
{
|
||||
public:
|
||||
virtual const char* GetString( Elf32_Word index ) const = 0;
|
||||
};
|
||||
|
||||
|
||||
// Symbol table reader
|
||||
class IELFISymbolTable : virtual public IELFISection
|
||||
{
|
||||
public:
|
||||
virtual Elf32_Half GetStringTableIndex() const = 0;
|
||||
virtual Elf32_Half GetHashTableIndex() const = 0;
|
||||
|
||||
virtual Elf32_Word GetSymbolNum() const = 0;
|
||||
virtual ELFIO_Err GetSymbol( Elf32_Word index,
|
||||
std::string& name, Elf32_Addr& value,
|
||||
Elf32_Word& size,
|
||||
unsigned char& bind, unsigned char& type,
|
||||
Elf32_Half& section ) const = 0;
|
||||
virtual ELFIO_Err GetSymbol( const std::string& name, Elf32_Addr& value,
|
||||
Elf32_Word& size,
|
||||
unsigned char& bind, unsigned char& type,
|
||||
Elf32_Half& section ) const = 0;
|
||||
};
|
||||
|
||||
|
||||
// Relocation table reader
|
||||
class IELFIRelocationTable : virtual public IELFISection
|
||||
{
|
||||
public:
|
||||
virtual Elf32_Half GetSymbolTableIndex() const = 0;
|
||||
virtual Elf32_Half GetTargetSectionIndex() const = 0;
|
||||
|
||||
virtual Elf32_Word GetEntriesNum() const = 0;
|
||||
virtual ELFIO_Err GetEntry( Elf32_Word index,
|
||||
Elf32_Addr& offset,
|
||||
Elf32_Word& symbol,
|
||||
unsigned char& type,
|
||||
Elf32_Sword& addend ) const = 0;
|
||||
virtual ELFIO_Err GetEntry( Elf32_Word index,
|
||||
Elf32_Addr& offset,
|
||||
Elf32_Addr& symbolValue,
|
||||
std::string& symbolName,
|
||||
unsigned char& type,
|
||||
Elf32_Sword& addend,
|
||||
Elf32_Sword& calcValue ) const = 0;
|
||||
};
|
||||
|
||||
|
||||
class IELFINoteReader : virtual public IELFISection
|
||||
{
|
||||
public:
|
||||
// Notes reader functions
|
||||
virtual Elf32_Word GetNotesNum() const = 0;
|
||||
virtual ELFIO_Err GetNote( Elf32_Word index,
|
||||
Elf32_Word& type,
|
||||
std::string& name,
|
||||
void*& desc,
|
||||
Elf32_Word& descSize ) const = 0;
|
||||
};
|
||||
|
||||
|
||||
class IELFIDynamicReader : virtual public IELFISection
|
||||
{
|
||||
public:
|
||||
// Notes reader functions
|
||||
virtual Elf32_Word GetEntriesNum() const = 0;
|
||||
virtual ELFIO_Err GetEntry( Elf32_Word index,
|
||||
Elf32_Sword& tag,
|
||||
Elf32_Word& value ) const = 0;
|
||||
};
|
||||
|
||||
#endif // ELFI_H
|
||||
@@ -1,281 +0,0 @@
|
||||
/*
|
||||
ELFIImpl.h - ELF reader and producer implementation classes.
|
||||
Copyright (C) 2001 Serge Lamikhov-Center <to_serge@users.sourceforge.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef ELFIIMPL_H
|
||||
#define ELFIIMPL_H
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include "ELFIO.h"
|
||||
|
||||
class ELFI : public IELFI
|
||||
{
|
||||
public:
|
||||
ELFI();
|
||||
virtual ~ELFI();
|
||||
|
||||
// Creation / state / destroy functions
|
||||
virtual ELFIO_Err Load( const std::string& sFileName );
|
||||
virtual ELFIO_Err Load( std::istream* pStream, int startPos );
|
||||
virtual bool IsInitialized() const;
|
||||
virtual int AddRef() const;
|
||||
virtual int Release() const;
|
||||
|
||||
// ELF header functions
|
||||
virtual unsigned char GetClass() const;
|
||||
virtual unsigned char GetEncoding() const;
|
||||
virtual unsigned char GetELFVersion() const;
|
||||
virtual Elf32_Half GetType() const;
|
||||
virtual Elf32_Half GetMachine() const;
|
||||
virtual Elf32_Word GetVersion() const;
|
||||
virtual Elf32_Addr GetEntry() const;
|
||||
virtual Elf32_Word GetFlags() const;
|
||||
virtual Elf32_Half GetSecStrNdx() const;
|
||||
|
||||
// Section provider functions
|
||||
virtual Elf32_Half GetSectionsNum() const;
|
||||
virtual const IELFISection* GetSection( Elf32_Half index ) const;
|
||||
virtual const IELFISection* GetSection( const std::string& name ) const;
|
||||
|
||||
// Segment provider functions
|
||||
virtual Elf32_Half GetSegmentsNum() const;
|
||||
virtual const IELFISegment* GetSegment( Elf32_Half index ) const;
|
||||
|
||||
// Section's readers
|
||||
virtual ELFIO_Err CreateSectionReader( ReaderType type, const IELFISection* pSection,
|
||||
void** ppObj ) const;
|
||||
|
||||
private:
|
||||
ELFIO_Err LoadSections();
|
||||
ELFIO_Err LoadSegments();
|
||||
|
||||
private:
|
||||
mutable int m_nRefCnt;
|
||||
std::istream* m_pStream;
|
||||
int m_nFileOffset;
|
||||
bool m_bOwnStream;
|
||||
bool m_bInitialized;
|
||||
Elf32_Ehdr m_header;
|
||||
std::vector<const IELFISection*> m_sections;
|
||||
std::vector<const IELFISegment*> m_segments;
|
||||
};
|
||||
|
||||
|
||||
class ELFISection : public IELFISection
|
||||
{
|
||||
public:
|
||||
ELFISection( IELFI* pIELFI, std::istream* pStream, int nFileOffset,
|
||||
Elf32_Shdr* pHeader, Elf32_Half index );
|
||||
virtual ~ELFISection();
|
||||
|
||||
virtual int AddRef() const;
|
||||
virtual int Release() const;
|
||||
|
||||
// Section info functions
|
||||
virtual Elf32_Half GetIndex() const;
|
||||
virtual std::string GetName() const;
|
||||
virtual Elf32_Word GetType() const;
|
||||
virtual Elf32_Word GetFlags() const;
|
||||
virtual Elf32_Addr GetAddress() const;
|
||||
virtual Elf32_Word GetSize() const;
|
||||
virtual Elf32_Word GetLink() const;
|
||||
virtual Elf32_Word GetInfo() const;
|
||||
virtual Elf32_Word GetAddrAlign() const;
|
||||
virtual Elf32_Word GetEntrySize() const;
|
||||
virtual const char* GetData() const;
|
||||
|
||||
private:
|
||||
Elf32_Half m_index;
|
||||
mutable int m_nRefCnt;
|
||||
IELFI* m_pIELFI;
|
||||
std::istream* m_pStream;
|
||||
int m_nFileOffset;
|
||||
Elf32_Shdr m_sh;
|
||||
mutable char* m_data;
|
||||
};
|
||||
|
||||
|
||||
class ELFISegment : public IELFISegment
|
||||
{
|
||||
public:
|
||||
ELFISegment( IELFI* pIELFI, std::istream* pStream, int nFileOffset,
|
||||
Elf32_Phdr* pHeader, Elf32_Half index );
|
||||
virtual ~ELFISegment();
|
||||
|
||||
virtual int AddRef() const;
|
||||
virtual int Release() const;
|
||||
|
||||
// Section info functions
|
||||
virtual Elf32_Word GetType() const;
|
||||
virtual Elf32_Addr GetVirtualAddress() const;
|
||||
virtual Elf32_Addr GetPhysicalAddress() const;
|
||||
virtual Elf32_Word GetFileSize() const;
|
||||
virtual Elf32_Word GetMemSize() const;
|
||||
virtual Elf32_Word GetFlags() const;
|
||||
virtual Elf32_Word GetAlign() const;
|
||||
virtual const char* GetData() const;
|
||||
|
||||
private:
|
||||
Elf32_Half m_index;
|
||||
mutable int m_nRefCnt;
|
||||
IELFI* m_pIELFI;
|
||||
std::istream* m_pStream;
|
||||
int m_nFileOffset;
|
||||
Elf32_Phdr m_sh;
|
||||
mutable char* m_data;
|
||||
};
|
||||
|
||||
|
||||
class ELFIReaderImpl : virtual public IELFISection
|
||||
{
|
||||
public:
|
||||
ELFIReaderImpl( const IELFI* pIELFI, const IELFISection* pSection );
|
||||
virtual ~ELFIReaderImpl();
|
||||
|
||||
virtual int AddRef() const;
|
||||
virtual int Release() const;
|
||||
|
||||
// Section info functions
|
||||
virtual Elf32_Half GetIndex() const;
|
||||
virtual std::string GetName() const;
|
||||
virtual Elf32_Word GetType() const;
|
||||
virtual Elf32_Word GetFlags() const;
|
||||
virtual Elf32_Addr GetAddress() const;
|
||||
virtual Elf32_Word GetSize() const;
|
||||
virtual Elf32_Word GetLink() const;
|
||||
virtual Elf32_Word GetInfo() const;
|
||||
virtual Elf32_Word GetAddrAlign() const;
|
||||
virtual Elf32_Word GetEntrySize() const;
|
||||
virtual const char* GetData() const;
|
||||
|
||||
protected:
|
||||
mutable int m_nRefCnt;
|
||||
const IELFI* m_pIELFI;
|
||||
const IELFISection* m_pSection;
|
||||
};
|
||||
|
||||
|
||||
class ELFIStringReader : public ELFIReaderImpl, public IELFIStringReader
|
||||
{
|
||||
public:
|
||||
ELFIStringReader( const IELFI* pIELFI, const IELFISection* pSection );
|
||||
virtual ~ELFIStringReader();
|
||||
|
||||
// IELFIStringReader implementation
|
||||
virtual const char* GetString( Elf32_Word index ) const;
|
||||
};
|
||||
|
||||
|
||||
class ELFISymbolTable : public ELFIReaderImpl, public IELFISymbolTable
|
||||
{
|
||||
public:
|
||||
ELFISymbolTable( const IELFI* pIELFI, const IELFISection* pSection );
|
||||
virtual ~ELFISymbolTable();
|
||||
|
||||
virtual int AddRef() const;
|
||||
virtual int Release() const;
|
||||
|
||||
virtual Elf32_Half GetStringTableIndex() const;
|
||||
virtual Elf32_Half GetHashTableIndex() const;
|
||||
|
||||
virtual Elf32_Word GetSymbolNum() const;
|
||||
virtual ELFIO_Err GetSymbol( Elf32_Word index,
|
||||
std::string& name, Elf32_Addr& value,
|
||||
Elf32_Word& size,
|
||||
unsigned char& bind, unsigned char& type,
|
||||
Elf32_Half& section ) const;
|
||||
virtual ELFIO_Err GetSymbol( const std::string& name, Elf32_Addr& value,
|
||||
Elf32_Word& size,
|
||||
unsigned char& bind, unsigned char& type,
|
||||
Elf32_Half& section ) const;
|
||||
|
||||
private:
|
||||
const IELFIStringReader* m_pStrReader;
|
||||
Elf32_Half m_nHashSection;
|
||||
const IELFISection* m_pHashSection;
|
||||
};
|
||||
|
||||
|
||||
class ELFIRelocationTable : public ELFIReaderImpl, public IELFIRelocationTable
|
||||
{
|
||||
public:
|
||||
ELFIRelocationTable( const IELFI* pIELFI, const IELFISection* pSection );
|
||||
virtual ~ELFIRelocationTable();
|
||||
|
||||
virtual int AddRef() const;
|
||||
virtual int Release() const;
|
||||
|
||||
virtual Elf32_Half GetSymbolTableIndex() const;
|
||||
virtual Elf32_Half GetTargetSectionIndex() const;
|
||||
|
||||
virtual Elf32_Word GetEntriesNum() const;
|
||||
virtual ELFIO_Err GetEntry( Elf32_Word index,
|
||||
Elf32_Addr& offset,
|
||||
Elf32_Word& symbol,
|
||||
unsigned char& type,
|
||||
Elf32_Sword& addend ) const;
|
||||
virtual ELFIO_Err GetEntry( Elf32_Word index,
|
||||
Elf32_Addr& offset,
|
||||
Elf32_Addr& symbolValue,
|
||||
std::string& symbolName,
|
||||
unsigned char& type,
|
||||
Elf32_Sword& addend,
|
||||
Elf32_Sword& calcValue ) const;
|
||||
|
||||
private:
|
||||
const IELFISymbolTable* m_pSymTbl;
|
||||
};
|
||||
|
||||
|
||||
class ELFINoteReader : public ELFIReaderImpl, public IELFINoteReader
|
||||
{
|
||||
public:
|
||||
ELFINoteReader( const IELFI* pIELFI, const IELFISection* pSection );
|
||||
virtual ~ELFINoteReader();
|
||||
|
||||
// Notes reader functions
|
||||
virtual Elf32_Word GetNotesNum() const;
|
||||
virtual ELFIO_Err GetNote( Elf32_Word index,
|
||||
Elf32_Word& type,
|
||||
std::string& name,
|
||||
void*& desc,
|
||||
Elf32_Word& descSize ) const;
|
||||
|
||||
private:
|
||||
void ProcessSection();
|
||||
|
||||
private:
|
||||
std::vector<Elf32_Word> m_beginPtrs;
|
||||
};
|
||||
|
||||
|
||||
class ELFIDynamicReader : public ELFIReaderImpl, public IELFIDynamicReader
|
||||
{
|
||||
public:
|
||||
ELFIDynamicReader( const IELFI* pIELFI, const IELFISection* pSection );
|
||||
virtual ~ELFIDynamicReader();
|
||||
|
||||
// Dynamic reader functions
|
||||
virtual Elf32_Word GetEntriesNum() const;
|
||||
virtual ELFIO_Err GetEntry( Elf32_Word index,
|
||||
Elf32_Sword& tag,
|
||||
Elf32_Word& value ) const;
|
||||
};
|
||||
|
||||
#endif // ELFIIMPL_H
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
ELFIO.h - ELF reader and producer.
|
||||
Copyright (C) 2001 Serge Lamikhov-Center <to_serge@users.sourceforge.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef ELFIO_H
|
||||
#define ELFIO_H
|
||||
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include "ELFTypes.h"
|
||||
|
||||
// ELFIO error codes
|
||||
enum ELFIO_Err {
|
||||
ERR_ELFIO_NO_ERROR, // No error
|
||||
ERR_ELFIO_INITIALIZED, // The ELFIO object was initialized
|
||||
ERR_ELFIO_MEMORY, // Out of memory
|
||||
ERR_ELFIO_CANT_OPEN, // Can't open a specified file
|
||||
ERR_ELFIO_NOT_ELF, // The file is not a valid ELF file
|
||||
ERR_NO_SUCH_READER, // There is no such reader
|
||||
ERR_ELFIO_SYMBOL_ERROR, // Symbol section reader error
|
||||
ERR_ELFIO_RELOCATION_ERROR, // Relocation section reader error
|
||||
ERR_ELFIO_INDEX_ERROR // Index is out of range
|
||||
};
|
||||
|
||||
|
||||
#include "ELFI.h"
|
||||
#include "ELFO.h"
|
||||
|
||||
|
||||
// This class builds two main objects: ELF file reader (ELFI)
|
||||
// and producer (ELFO)
|
||||
class ELFIO
|
||||
{
|
||||
public:
|
||||
virtual ~ELFIO() {}
|
||||
|
||||
static const ELFIO* GetInstance();
|
||||
|
||||
ELFIO_Err CreateELFI( IELFI** ppObj ) const;
|
||||
ELFIO_Err CreateELFO( IELFO** ppObj ) const;
|
||||
|
||||
virtual std::string GetErrorText( ELFIO_Err err ) const;
|
||||
|
||||
private:
|
||||
ELFIO();
|
||||
ELFIO( const ELFIO& );
|
||||
};
|
||||
|
||||
#endif // ELFIO_H
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
ELFIOUtils.h - Utility functions.
|
||||
Copyright (C) 2001 Serge Lamikhov-Center <to_serge@users.sourceforge.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ELFIOUTILS_H
|
||||
#define ELFIOUTILS_H
|
||||
|
||||
#include "ELFTypes.h"
|
||||
|
||||
Elf32_Addr Convert32Addr2Host ( Elf32_Addr addr, unsigned char encoding );
|
||||
Elf32_Half Convert32Half2Host ( Elf32_Half half, unsigned char encoding );
|
||||
Elf32_Off Convert32Off2Host ( Elf32_Off off, unsigned char encoding );
|
||||
Elf32_Sword Convert32Sword2Host( Elf32_Sword word, unsigned char encoding );
|
||||
Elf32_Word Convert32Word2Host ( Elf32_Word word, unsigned char encoding );
|
||||
|
||||
Elf32_Word ElfHashFunc( const unsigned char* name );
|
||||
|
||||
#endif // ELFIOUTILS_H
|
||||
@@ -1,249 +0,0 @@
|
||||
/*
|
||||
ELFO.h - ELF reader and producer.
|
||||
Copyright (C) 2001 Serge Lamikhov-Center <to_serge@users.sourceforge.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef ELFO_H
|
||||
#define ELFO_H
|
||||
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include "ELFTypes.h"
|
||||
|
||||
// Forward declaration
|
||||
class IELFO;
|
||||
class IELFOSection;
|
||||
class IELFOSegment;
|
||||
|
||||
class IELFO
|
||||
{
|
||||
public:
|
||||
virtual ~IELFO() {}
|
||||
|
||||
// Section reader's types
|
||||
enum WriterType {
|
||||
ELFO_STRING, // Strings writer
|
||||
ELFO_SYMBOL, // Symbol table writer
|
||||
ELFO_RELOCATION, // Relocation table writer
|
||||
ELFO_NOTE, // Notes writer
|
||||
ELFO_DYNAMIC, // Dynamic section writer
|
||||
ELFO_HASH // Hash
|
||||
};
|
||||
|
||||
// Construct/destroy/initialize an object
|
||||
virtual int AddRef() = 0;
|
||||
virtual int Release() = 0;
|
||||
|
||||
virtual ELFIO_Err Save( const std::string& sFileName ) = 0;
|
||||
|
||||
// ELF header functions
|
||||
virtual ELFIO_Err SetAttr( unsigned char fileClass,
|
||||
unsigned char encoding,
|
||||
unsigned char ELFVersion,
|
||||
Elf32_Half type,
|
||||
Elf32_Half machine,
|
||||
Elf32_Word version,
|
||||
Elf32_Word flags ) = 0;
|
||||
virtual Elf32_Addr GetEntry() const = 0;
|
||||
virtual ELFIO_Err SetEntry( Elf32_Addr entry ) = 0;
|
||||
virtual unsigned char GetEncoding() const = 0;
|
||||
|
||||
// Section provider functions
|
||||
virtual Elf32_Half GetSectionsNum() const = 0;
|
||||
virtual IELFOSection* GetSection( Elf32_Half index ) const = 0;
|
||||
virtual IELFOSection* GetSection( const std::string& name ) const = 0;
|
||||
virtual IELFOSection* AddSection( const std::string& name,
|
||||
Elf32_Word type,
|
||||
Elf32_Word flags,
|
||||
Elf32_Word info,
|
||||
Elf32_Word addrAlign,
|
||||
Elf32_Word entrySize ) = 0;
|
||||
virtual std::streampos GetSectionFileOffset( Elf32_Half index ) const = 0;
|
||||
|
||||
// Segment provider functions
|
||||
virtual Elf32_Half GetSegmentNum() const = 0;
|
||||
virtual IELFOSegment* AddSegment( Elf32_Word type, Elf32_Addr vaddr,
|
||||
Elf32_Addr paddr, Elf32_Word flags, Elf32_Word align ) = 0;
|
||||
virtual IELFOSegment* GetSegment( Elf32_Half index ) const = 0;
|
||||
|
||||
virtual ELFIO_Err CreateSectionWriter( WriterType type,
|
||||
IELFOSection* pSection,
|
||||
void** ppObj ) const = 0;
|
||||
};
|
||||
|
||||
|
||||
class IELFOSection
|
||||
{
|
||||
public:
|
||||
virtual ~IELFOSection() {}
|
||||
|
||||
virtual int AddRef() = 0;
|
||||
virtual int Release() = 0;
|
||||
|
||||
virtual Elf32_Half GetIndex() const = 0;
|
||||
virtual std::string GetName() const = 0;
|
||||
virtual Elf32_Word GetType() const = 0;
|
||||
virtual Elf32_Word GetFlags() const = 0;
|
||||
virtual Elf32_Word GetInfo() const = 0;
|
||||
virtual Elf32_Word GetAddrAlign() const = 0;
|
||||
virtual Elf32_Word GetEntrySize() const = 0;
|
||||
|
||||
virtual Elf32_Word GetNameIndex() const = 0;
|
||||
virtual void SetNameIndex( Elf32_Word index ) = 0;
|
||||
|
||||
virtual Elf32_Addr GetAddress() const = 0;
|
||||
virtual void SetAddress( Elf32_Addr addr ) = 0;
|
||||
|
||||
virtual Elf32_Word GetLink() const = 0;
|
||||
virtual void SetLink( Elf32_Word link ) = 0;
|
||||
|
||||
virtual char* GetData() const = 0;
|
||||
virtual Elf32_Word GetSize() const = 0;
|
||||
virtual ELFIO_Err SetData( const char* pData, Elf32_Word size ) = 0;
|
||||
virtual ELFIO_Err SetData( const std::string& data ) = 0;
|
||||
virtual ELFIO_Err AddData( const char* pData, Elf32_Word size ) = 0;
|
||||
virtual ELFIO_Err AddData( const std::string& data ) = 0;
|
||||
|
||||
virtual ELFIO_Err Save( std::ofstream& f, std::streampos posHeader,
|
||||
std::streampos posData ) = 0;
|
||||
};
|
||||
|
||||
|
||||
class IELFOSegment
|
||||
{
|
||||
public:
|
||||
virtual ~IELFOSegment() {}
|
||||
|
||||
virtual int AddRef() = 0;
|
||||
virtual int Release() = 0;
|
||||
|
||||
virtual Elf32_Word GetType() const = 0;
|
||||
virtual Elf32_Word GetFlags() const = 0;
|
||||
virtual Elf32_Word GetAlign() const = 0;
|
||||
|
||||
virtual Elf32_Addr GetVirtualAddress() const = 0;
|
||||
virtual Elf32_Addr GetPhysicalAddress() const = 0;
|
||||
virtual void SetAddresses( Elf32_Addr vaddr, Elf32_Addr paddr ) = 0;
|
||||
|
||||
virtual Elf32_Word GetFileSize() const = 0;
|
||||
virtual Elf32_Word GetMemSize() const = 0;
|
||||
|
||||
virtual Elf32_Half AddSection( IELFOSection* pSection ) = 0;
|
||||
|
||||
virtual ELFIO_Err Save( std::ofstream& f, std::streampos posHeader ) = 0;
|
||||
};
|
||||
|
||||
|
||||
// String table producer
|
||||
class IELFOStringWriter
|
||||
{
|
||||
public:
|
||||
virtual ~IELFOStringWriter() {}
|
||||
|
||||
virtual int AddRef() = 0;
|
||||
virtual int Release() = 0;
|
||||
|
||||
virtual const char* GetString( Elf32_Word index ) const = 0;
|
||||
virtual Elf32_Word AddString( const char* str ) = 0;
|
||||
};
|
||||
|
||||
|
||||
// Symbol table producer
|
||||
class IELFOSymbolTable
|
||||
{
|
||||
public:
|
||||
virtual ~IELFOSymbolTable() {}
|
||||
|
||||
virtual int AddRef() = 0;
|
||||
virtual int Release() = 0;
|
||||
|
||||
virtual Elf32_Word AddEntry( Elf32_Word name, Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char info, unsigned char other,
|
||||
Elf32_Half shndx ) = 0;
|
||||
virtual Elf32_Word AddEntry( Elf32_Word name, Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char bind, unsigned char type, unsigned char other,
|
||||
Elf32_Half shndx ) = 0;
|
||||
virtual Elf32_Word AddEntry( IELFOStringWriter* pStrWriter, const char* str,
|
||||
Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char info, unsigned char other,
|
||||
Elf32_Half shndx ) = 0;
|
||||
virtual Elf32_Word AddEntry( IELFOStringWriter* pStrWriter, const char* str,
|
||||
Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char bind, unsigned char type, unsigned char other,
|
||||
Elf32_Half shndx ) = 0;
|
||||
};
|
||||
|
||||
|
||||
// Relocation table producer
|
||||
class IELFORelocationTable
|
||||
{
|
||||
public:
|
||||
virtual ~IELFORelocationTable() {}
|
||||
|
||||
virtual int AddRef() = 0;
|
||||
virtual int Release() = 0;
|
||||
|
||||
virtual ELFIO_Err AddEntry( Elf32_Addr offset, Elf32_Word info ) = 0;
|
||||
virtual ELFIO_Err AddEntry( Elf32_Addr offset, Elf32_Word symbol,
|
||||
unsigned char type ) = 0;
|
||||
virtual ELFIO_Err AddEntry( Elf32_Addr offset, Elf32_Word info,
|
||||
Elf32_Sword addend ) = 0;
|
||||
virtual ELFIO_Err AddEntry( Elf32_Addr offset, Elf32_Word symbol,
|
||||
unsigned char type, Elf32_Sword addend ) = 0;
|
||||
virtual ELFIO_Err AddEntry( IELFOStringWriter* pStrWriter, const char* str,
|
||||
IELFOSymbolTable* pSymWriter,
|
||||
Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char symInfo, unsigned char other,
|
||||
Elf32_Half shndx,
|
||||
Elf32_Addr offset, unsigned char type ) = 0;
|
||||
virtual ELFIO_Err AddEntry( IELFOStringWriter* pStrWriter, const char* str,
|
||||
IELFOSymbolTable* pSymWriter,
|
||||
Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char symInfo, unsigned char other,
|
||||
Elf32_Half shndx,
|
||||
Elf32_Addr offset, unsigned char type,
|
||||
Elf32_Sword addend ) = 0;
|
||||
};
|
||||
|
||||
|
||||
// Note section producer
|
||||
class IELFONotesWriter
|
||||
{
|
||||
public:
|
||||
virtual ~IELFONotesWriter() {}
|
||||
|
||||
virtual int AddRef() = 0;
|
||||
virtual int Release() = 0;
|
||||
|
||||
virtual ELFIO_Err AddNote( Elf32_Word type, const std::string& name,
|
||||
const void* desc, Elf32_Word descSize ) = 0;
|
||||
};
|
||||
|
||||
|
||||
// Dynamic section producer
|
||||
class IELFODynamicWriter
|
||||
{
|
||||
public:
|
||||
virtual ~IELFODynamicWriter() {}
|
||||
|
||||
virtual int AddRef() = 0;
|
||||
virtual int Release() = 0;
|
||||
|
||||
virtual ELFIO_Err AddEntry( Elf32_Sword tag, Elf32_Word value ) = 0;
|
||||
};
|
||||
|
||||
#endif // ELFO_H
|
||||
@@ -1,295 +0,0 @@
|
||||
/*
|
||||
ELFOImpl.h - ELF reader and producer implementation classes.
|
||||
Copyright (C) 2001 Serge Lamikhov-Center <to_serge@users.sourceforge.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef ELFOIMPL_H
|
||||
#define ELFOIMPL_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "ELFIO.h"
|
||||
|
||||
class ELFOSection;
|
||||
class ELFOSegment;
|
||||
|
||||
class ELFO : public IELFO
|
||||
{
|
||||
public:
|
||||
// Construct/destroy/initialize an object
|
||||
ELFO();
|
||||
~ELFO();
|
||||
virtual int AddRef();
|
||||
virtual int Release();
|
||||
|
||||
virtual ELFIO_Err Save( const std::string& sFileName );
|
||||
|
||||
// ELF header functions
|
||||
virtual ELFIO_Err SetAttr( unsigned char fileClass,
|
||||
unsigned char encoding,
|
||||
unsigned char ELFVersion,
|
||||
Elf32_Half type,
|
||||
Elf32_Half machine,
|
||||
Elf32_Word version,
|
||||
Elf32_Word flags );
|
||||
virtual Elf32_Addr GetEntry() const;
|
||||
virtual ELFIO_Err SetEntry( Elf32_Addr entry );
|
||||
|
||||
virtual unsigned char GetEncoding() const;
|
||||
|
||||
// Section provider functions
|
||||
virtual Elf32_Half GetSectionsNum() const;
|
||||
virtual IELFOSection* GetSection( Elf32_Half index ) const;
|
||||
virtual IELFOSection* GetSection( const std::string& name ) const;
|
||||
virtual IELFOSection* AddSection( const std::string& name,
|
||||
Elf32_Word type,
|
||||
Elf32_Word flags,
|
||||
Elf32_Word info,
|
||||
Elf32_Word addrAlign,
|
||||
Elf32_Word entrySize );
|
||||
virtual std::streampos GetSectionFileOffset( Elf32_Half index ) const;
|
||||
|
||||
virtual Elf32_Half GetSegmentNum() const;
|
||||
virtual IELFOSegment* AddSegment( Elf32_Word type, Elf32_Addr vaddr,
|
||||
Elf32_Addr paddr, Elf32_Word flags, Elf32_Word align );
|
||||
virtual IELFOSegment* GetSegment( Elf32_Half index ) const;
|
||||
|
||||
virtual ELFIO_Err CreateSectionWriter( WriterType type,
|
||||
IELFOSection* pSection,
|
||||
void** ppObj ) const;
|
||||
|
||||
private:
|
||||
int m_nRefCnt;
|
||||
Elf32_Ehdr m_header;
|
||||
std::vector<ELFOSection*> m_sections;
|
||||
std::vector<ELFOSegment*> m_segments;
|
||||
};
|
||||
|
||||
|
||||
class ELFOSection : public IELFOSection
|
||||
{
|
||||
public:
|
||||
ELFOSection( Elf32_Half index,
|
||||
IELFO* pIELFO,
|
||||
const std::string& name,
|
||||
Elf32_Word type,
|
||||
Elf32_Word flags,
|
||||
Elf32_Word info,
|
||||
Elf32_Word addrAlign,
|
||||
Elf32_Word entrySize );
|
||||
~ELFOSection();
|
||||
|
||||
virtual int AddRef();
|
||||
virtual int Release();
|
||||
|
||||
virtual Elf32_Half GetIndex() const;
|
||||
virtual std::string GetName() const;
|
||||
virtual Elf32_Word GetType() const;
|
||||
virtual Elf32_Word GetFlags() const;
|
||||
virtual Elf32_Word GetInfo() const;
|
||||
virtual Elf32_Word GetAddrAlign() const;
|
||||
virtual Elf32_Word GetEntrySize() const;
|
||||
|
||||
virtual Elf32_Word GetNameIndex() const;
|
||||
virtual void SetNameIndex( Elf32_Word index );
|
||||
|
||||
virtual Elf32_Addr GetAddress() const;
|
||||
virtual void SetAddress( Elf32_Addr addr );
|
||||
|
||||
virtual Elf32_Word GetLink() const;
|
||||
virtual void SetLink( Elf32_Word link );
|
||||
|
||||
virtual char* GetData() const;
|
||||
virtual Elf32_Word GetSize() const;
|
||||
virtual ELFIO_Err SetData( const char* pData, Elf32_Word size );
|
||||
virtual ELFIO_Err SetData( const std::string& data );
|
||||
virtual ELFIO_Err AddData( const char* pData, Elf32_Word size );
|
||||
virtual ELFIO_Err AddData( const std::string& data );
|
||||
|
||||
virtual ELFIO_Err Save( std::ofstream& f, std::streampos posHeader,
|
||||
std::streampos posData );
|
||||
|
||||
private:
|
||||
Elf32_Half m_index;
|
||||
IELFO* m_pIELFO;
|
||||
Elf32_Shdr m_sh;
|
||||
std::string m_name;
|
||||
char* m_pData;
|
||||
};
|
||||
|
||||
|
||||
class ELFOSegment : public IELFOSegment
|
||||
{
|
||||
public:
|
||||
ELFOSegment( IELFO* pIELFO, Elf32_Word type, Elf32_Addr vaddr,
|
||||
Elf32_Addr paddr, Elf32_Word flags, Elf32_Word align );
|
||||
|
||||
virtual int AddRef();
|
||||
virtual int Release();
|
||||
|
||||
virtual Elf32_Word GetType() const;
|
||||
virtual Elf32_Word GetFlags() const;
|
||||
virtual Elf32_Word GetAlign() const;
|
||||
|
||||
virtual Elf32_Addr GetVirtualAddress() const;
|
||||
virtual Elf32_Addr GetPhysicalAddress() const;
|
||||
virtual void SetAddresses( Elf32_Addr vaddr, Elf32_Addr paddr );
|
||||
|
||||
virtual Elf32_Word GetFileSize() const;
|
||||
virtual Elf32_Word GetMemSize() const;
|
||||
|
||||
virtual Elf32_Half AddSection( IELFOSection* pSection );
|
||||
|
||||
virtual ELFIO_Err Save( std::ofstream& f, std::streampos posHeader );
|
||||
|
||||
private:
|
||||
IELFO* m_pIELFO;
|
||||
std::vector<IELFOSection*> m_sections;
|
||||
Elf32_Phdr m_ph;
|
||||
};
|
||||
|
||||
|
||||
// String table producer
|
||||
class ELFOStringWriter : public IELFOStringWriter
|
||||
{
|
||||
public:
|
||||
ELFOStringWriter( IELFO* pIELFI, IELFOSection* pSection );
|
||||
~ELFOStringWriter();
|
||||
|
||||
virtual int AddRef();
|
||||
virtual int Release();
|
||||
|
||||
virtual const char* GetString( Elf32_Word index ) const;
|
||||
virtual Elf32_Word AddString( const char* str );
|
||||
|
||||
private:
|
||||
int m_nRefCnt;
|
||||
IELFO* m_pIELFO;
|
||||
IELFOSection* m_pSection;
|
||||
std::string m_data;
|
||||
};
|
||||
|
||||
|
||||
// Symbol table producer
|
||||
class ELFOSymbolTable : public IELFOSymbolTable
|
||||
{
|
||||
public:
|
||||
ELFOSymbolTable( IELFO* pIELFI, IELFOSection* pSection );
|
||||
~ELFOSymbolTable();
|
||||
|
||||
virtual int AddRef();
|
||||
virtual int Release();
|
||||
|
||||
virtual Elf32_Word AddEntry( Elf32_Word name, Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char info, unsigned char other,
|
||||
Elf32_Half shndx );
|
||||
virtual Elf32_Word AddEntry( Elf32_Word name, Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char bind, unsigned char type, unsigned char other,
|
||||
Elf32_Half shndx );
|
||||
virtual Elf32_Word AddEntry( IELFOStringWriter* pStrWriter, const char* str,
|
||||
Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char info, unsigned char other,
|
||||
Elf32_Half shndx );
|
||||
virtual Elf32_Word AddEntry( IELFOStringWriter* pStrWriter, const char* str,
|
||||
Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char bind, unsigned char type, unsigned char other,
|
||||
Elf32_Half shndx );
|
||||
|
||||
private:
|
||||
int m_nRefCnt;
|
||||
IELFO* m_pIELFO;
|
||||
IELFOSection* m_pSection;
|
||||
};
|
||||
|
||||
|
||||
// Relocation table producer
|
||||
class ELFORelocationTable : public IELFORelocationTable
|
||||
{
|
||||
public:
|
||||
ELFORelocationTable( IELFO* pIELFI, IELFOSection* pSection );
|
||||
~ELFORelocationTable();
|
||||
|
||||
virtual int AddRef();
|
||||
virtual int Release();
|
||||
|
||||
virtual ELFIO_Err AddEntry( Elf32_Addr offset, Elf32_Word info );
|
||||
virtual ELFIO_Err AddEntry( Elf32_Addr offset, Elf32_Word symbol,
|
||||
unsigned char type );
|
||||
virtual ELFIO_Err AddEntry( Elf32_Addr offset, Elf32_Word info,
|
||||
Elf32_Sword addend );
|
||||
virtual ELFIO_Err AddEntry( Elf32_Addr offset, Elf32_Word symbol,
|
||||
unsigned char type, Elf32_Sword addend );
|
||||
virtual ELFIO_Err AddEntry( IELFOStringWriter* pStrWriter, const char* str,
|
||||
IELFOSymbolTable* pSymWriter,
|
||||
Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char symInfo, unsigned char other,
|
||||
Elf32_Half shndx,
|
||||
Elf32_Addr offset, unsigned char type );
|
||||
virtual ELFIO_Err AddEntry( IELFOStringWriter* pStrWriter, const char* str,
|
||||
IELFOSymbolTable* pSymWriter,
|
||||
Elf32_Addr value, Elf32_Word size,
|
||||
unsigned char symInfo, unsigned char other,
|
||||
Elf32_Half shndx,
|
||||
Elf32_Addr offset, unsigned char type,
|
||||
Elf32_Sword addend );
|
||||
|
||||
private:
|
||||
int m_nRefCnt;
|
||||
IELFO* m_pIELFO;
|
||||
IELFOSection* m_pSection;
|
||||
};
|
||||
|
||||
|
||||
// Note section producer
|
||||
class ELFONotesWriter : public IELFONotesWriter
|
||||
{
|
||||
public:
|
||||
ELFONotesWriter( IELFO* pIELFI, IELFOSection* pSection );
|
||||
~ELFONotesWriter();
|
||||
|
||||
virtual int AddRef();
|
||||
virtual int Release();
|
||||
|
||||
virtual ELFIO_Err AddNote( Elf32_Word type, const std::string& name,
|
||||
const void* desc, Elf32_Word descSize );
|
||||
|
||||
private:
|
||||
int m_nRefCnt;
|
||||
IELFO* m_pIELFO;
|
||||
IELFOSection* m_pSection;
|
||||
};
|
||||
|
||||
|
||||
// Dynamic section producer
|
||||
class ELFODynamicWriter : public IELFODynamicWriter
|
||||
{
|
||||
public:
|
||||
ELFODynamicWriter( IELFO* pIELFO, IELFOSection* pSection );
|
||||
~ELFODynamicWriter();
|
||||
|
||||
virtual int AddRef();
|
||||
virtual int Release();
|
||||
|
||||
virtual ELFIO_Err AddEntry( Elf32_Sword tag, Elf32_Word value );
|
||||
|
||||
private:
|
||||
int m_nRefCnt;
|
||||
IELFO* m_pIELFO;
|
||||
IELFOSection* m_pSection;
|
||||
};
|
||||
|
||||
#endif // ELFOIMPL_H
|
||||
@@ -1,431 +0,0 @@
|
||||
/*
|
||||
ELFTypes.h - Standart ELF data types.
|
||||
Copyright (C) 2001 Serge Lamikhov-Center <to_serge@users.sourceforge.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef ELFTYPES_H
|
||||
#define ELFTYPES_H
|
||||
|
||||
|
||||
// Attention! Platform depended definitions.
|
||||
typedef unsigned long Elf32_Addr;
|
||||
typedef unsigned short Elf32_Half;
|
||||
typedef unsigned long Elf32_Off;
|
||||
typedef signed long Elf32_Sword;
|
||||
typedef unsigned long Elf32_Word;
|
||||
|
||||
|
||||
///////////////////////
|
||||
// ELF Header Constants
|
||||
|
||||
// File type
|
||||
#define ET_NONE 0
|
||||
#define ET_REL 1
|
||||
#define ET_EXEC 2
|
||||
#define ET_DYN 3
|
||||
#define ET_CORE 4
|
||||
#define ET_LOOS 0xFE00
|
||||
#define ET_HIOS 0xFEFF
|
||||
#define ET_LOPROC 0xFF00
|
||||
#define ET_HIPROC 0xFFFF
|
||||
|
||||
// Machine/Architecture
|
||||
#define EM_NONE 0 // No machine
|
||||
#define EM_M32 1 // AT&T WE 32100
|
||||
#define EM_SPARC 2 // SPARC
|
||||
#define EM_386 3 // Intel 80386
|
||||
#define EM_68K 4 // Motorola 68000
|
||||
#define EM_88K 5 // Motorola 88000
|
||||
//reserved 6 Reserved for future use (was EM_486)
|
||||
#define EM_860 7 // Intel 80860
|
||||
#define EM_MIPS 8 // MIPS I Architecture
|
||||
#define EM_S370 9 // IBM System/370 Processor
|
||||
#define EM_MIPS_RS3_LE 10 // MIPS RS3000 Little-endian
|
||||
//reserved 11-14 Reserved for future use
|
||||
#define EM_PARISC 15 // Hewlett-Packard PA-RISC
|
||||
//reserved 16 Reserved for future use
|
||||
#define EM_VPP500 17 // Fujitsu VPP500
|
||||
#define EM_SPARC32PLUS 18 // Enhanced instruction set SPARC
|
||||
#define EM_960 19 // Intel 80960
|
||||
#define EM_PPC 20 // PowerPC
|
||||
#define EM_PPC64 21 // 64-bit PowerPC
|
||||
#define EM_S390 22 // IBM System/390 Processor
|
||||
//reserved 23-35 Reserved for future use
|
||||
#define EM_V800 36 // NEC V800
|
||||
#define EM_FR20 37 // Fujitsu FR20
|
||||
#define EM_RH32 38 // TRW RH-32
|
||||
#define EM_RCE 39 // Motorola RCE
|
||||
#define EM_ARM 40 // Advanced RISC Machines ARM
|
||||
#define EM_ALPHA 41 // Digital Alpha
|
||||
#define EM_SH 42 // Hitachi SH
|
||||
#define EM_SPARCV9 43 // SPARC Version 9
|
||||
#define EM_TRICORE 44 // Siemens TriCore embedded processor
|
||||
#define EM_ARC 45 // Argonaut RISC Core, Argonaut Technologies Inc.
|
||||
#define EM_H8_300 46 // Hitachi H8/300
|
||||
#define EM_H8_300H 47 // Hitachi H8/300H
|
||||
#define EM_H8S 48 // Hitachi H8S
|
||||
#define EM_H8_500 49 // Hitachi H8/500
|
||||
#define EM_IA_64 50 // Intel IA-64 processor architecture
|
||||
#define EM_MIPS_X 51 // Stanford MIPS-X
|
||||
#define EM_COLDFIRE 52 // Motorola ColdFire
|
||||
#define EM_68HC12 53 // Motorola M68HC12
|
||||
#define EM_MMA 54 // Fujitsu MMA Multimedia Accelerator
|
||||
#define EM_PCP 55 // Siemens PCP
|
||||
#define EM_NCPU 56 // Sony nCPU embedded RISC processor
|
||||
#define EM_NDR1 57 // Denso NDR1 microprocessor
|
||||
#define EM_STARCORE 58 // Motorola Star*Core processor
|
||||
#define EM_ME16 59 // Toyota ME16 processor
|
||||
#define EM_ST100 60 // STMicroelectronics ST100 processor
|
||||
#define EM_TINYJ 61 // Advanced Logic Corp. TinyJ embedded processor family
|
||||
#define EM_X86_64 62 // AMD x86-64 architecture
|
||||
#define EM_PDSP 63 // Sony DSP Processor
|
||||
//reserved 64-65 Reserved for future use
|
||||
#define EM_FX66 66 // Siemens FX66 microcontroller
|
||||
#define EM_ST9PLUS 67 // STMicroelectronics ST9+ 8/16 bit microcontroller
|
||||
#define EM_ST7 68 // STMicroelectronics ST7 8-bit microcontroller
|
||||
#define EM_68HC16 69 // Motorola MC68HC16 Microcontroller
|
||||
#define EM_68HC11 70 // Motorola MC68HC11 Microcontroller
|
||||
#define EM_68HC08 71 // Motorola MC68HC08 Microcontroller
|
||||
#define EM_68HC05 72 // Motorola MC68HC05 Microcontroller
|
||||
#define EM_SVX 73 // Silicon Graphics SVx
|
||||
#define EM_ST19 74 // STMicroelectronics ST19 8-bit microcontroller
|
||||
#define EM_VAX 75 // Digital VAX
|
||||
#define EM_CRIS 76 // Axis Communications 32-bit embedded processor
|
||||
#define EM_JAVELIN 77 // Infineon Technologies 32-bit embedded processor
|
||||
#define EM_FIREPATH 78 // Element 14 64-bit DSP Processor
|
||||
#define EM_ZSP 79 // LSI Logic 16-bit DSP Processor
|
||||
#define EM_MMIX 80 // Donald Knuth's educational 64-bit processor
|
||||
#define EM_HUANY 81 // Harvard University machine-independent object files
|
||||
#define EM_PRISM 82 // SiTera Prism
|
||||
#define EM_AVR 83 // Atmel AVR 8-bit microcontroller
|
||||
#define EM_FR30 84 // Fujitsu FR30
|
||||
#define EM_D10V 85 // Mitsubishi D10V
|
||||
#define EM_D30V 86 // Mitsubishi D30V
|
||||
#define EM_V850 87 // NEC v850
|
||||
#define EM_M32R 88 // Mitsubishi M32R
|
||||
#define EM_MN10300 89 // Matsushita MN10300
|
||||
#define EM_MN10200 90 // Matsushita MN10200
|
||||
#define EM_PJ 91 // picoJava
|
||||
#define EM_OPENRISC 92 // OpenRISC 32-bit embedded processor
|
||||
#define EM_ARC_A5 93 // ARC Cores Tangent-A5
|
||||
#define EM_XTENSA 94 // Tensilica Xtensa Architecture
|
||||
|
||||
// File version
|
||||
#define EV_NONE 0
|
||||
#define EV_CURRENT 1
|
||||
|
||||
// Identification index
|
||||
#define EI_MAG0 0
|
||||
#define EI_MAG1 1
|
||||
#define EI_MAG2 2
|
||||
#define EI_MAG3 3
|
||||
#define EI_CLASS 4
|
||||
#define EI_DATA 5
|
||||
#define EI_VERSION 6
|
||||
#define EI_OSABI 7
|
||||
#define EI_ABIVERSION 8
|
||||
#define EI_PAD 9
|
||||
#define EI_NIDENT 16
|
||||
|
||||
// Magic number
|
||||
#define ELFMAG0 0x7F
|
||||
#define ELFMAG1 'E'
|
||||
#define ELFMAG2 'L'
|
||||
#define ELFMAG3 'F'
|
||||
|
||||
// File class
|
||||
#define ELFCLASSNONE 0
|
||||
#define ELFCLASS32 1
|
||||
#define ELFCLASS64 2
|
||||
|
||||
// Encoding
|
||||
#define ELFDATANONE 0
|
||||
#define ELFDATA2LSB 1
|
||||
#define ELFDATA2MSB 2
|
||||
|
||||
// OS extensions
|
||||
#define ELFOSABI_NONE 0 // No extensions or unspecified
|
||||
#define ELFOSABI_HPUX 1 // Hewlett-Packard HP-UX
|
||||
#define ELFOSABI_NETBSD 2 // NetBSD
|
||||
#define ELFOSABI_LINUX 3 // Linux
|
||||
#define ELFOSABI_SOLARIS 6 // Sun Solaris
|
||||
#define ELFOSABI_AIX 7 // AIX
|
||||
#define ELFOSABI_IRIX 8 // IRIX
|
||||
#define ELFOSABI_FREEBSD 9 // FreeBSD
|
||||
#define ELFOSABI_TRU64 10 // Compaq TRU64 UNIX
|
||||
#define ELFOSABI_MODESTO 11 // Novell Modesto
|
||||
#define ELFOSABI_OPENBSD 12 // Open BSD
|
||||
|
||||
|
||||
/////////////////////
|
||||
// Sections constants
|
||||
|
||||
// Section indexes
|
||||
#define SHN_UNDEF 0
|
||||
#define SHN_LORESERVE 0xFF00
|
||||
#define SHN_LOPROC 0xFF00
|
||||
#define SHN_HIPROC 0xFF1F
|
||||
#define SHN_LOOS 0xFF20
|
||||
#define SHN_HIOS 0xFF3F
|
||||
#define SHN_ABS 0xFFF1
|
||||
#define SHN_COMMON 0xFFF2
|
||||
#define SHN_XINDEX 0xFFFF
|
||||
#define SHN_HIRESERVE 0xFFFF
|
||||
|
||||
// Section types
|
||||
#define SHT_NULL 0
|
||||
#define SHT_PROGBITS 1
|
||||
#define SHT_SYMTAB 2
|
||||
#define SHT_STRTAB 3
|
||||
#define SHT_RELA 4
|
||||
#define SHT_HASH 5
|
||||
#define SHT_DYNAMIC 6
|
||||
#define SHT_NOTE 7
|
||||
#define SHT_NOBITS 8
|
||||
#define SHT_REL 9
|
||||
#define SHT_SHLIB 10
|
||||
#define SHT_DYNSYM 11
|
||||
#define SHT_INIT_ARRAY 14
|
||||
#define SHT_FINI_ARRAY 15
|
||||
#define SHT_PREINIT_ARRAY 16
|
||||
#define SHT_GROUP 17
|
||||
#define SHT_SYMTAB_SHNDX 18
|
||||
#define SHT_LOOS 0x60000000
|
||||
#define SHT_HIOS 0x6fffffff
|
||||
#define SHT_LOPROC 0x70000000
|
||||
#define SHT_HIPROC 0x7FFFFFFF
|
||||
#define SHT_LOUSER 0x80000000
|
||||
#define SHT_HIUSER 0xFFFFFFFF
|
||||
|
||||
// Section flags
|
||||
#define SHF_WRITE 0x1
|
||||
#define SHF_ALLOC 0x2
|
||||
#define SHF_EXECINSTR 0x4
|
||||
#define SHF_MERGE 0x10
|
||||
#define SHF_STRINGS 0x20
|
||||
#define SHF_INFO_LINK 0x40
|
||||
#define SHF_LINK_ORDER 0x80
|
||||
#define SHF_OS_NONCONFORMING 0x100
|
||||
#define SHF_GROUP 0x200
|
||||
#define SHF_TLS 0x400
|
||||
#define SHF_MASKOS 0x0ff00000
|
||||
#define SHF_MASKPROC 0xF0000000
|
||||
|
||||
// Section group flags
|
||||
#define GRP_COMDAT 0x1
|
||||
#define GRP_MASKOS 0x0ff00000
|
||||
#define GRP_MASKPROC 0xf0000000
|
||||
|
||||
// Symbol binding
|
||||
#define STB_LOCAL 0
|
||||
#define STB_GLOBAL 1
|
||||
#define STB_WEAK 2
|
||||
#define STB_LOOS 10
|
||||
#define STB_HIOS 12
|
||||
#define STB_LOPROC 13
|
||||
#define STB_HIPROC 15
|
||||
|
||||
// Symbol types
|
||||
#define STT_NOTYPE 0
|
||||
#define STT_OBJECT 1
|
||||
#define STT_FUNC 2
|
||||
#define STT_SECTION 3
|
||||
#define STT_FILE 4
|
||||
#define STT_COMMON 5
|
||||
#define STT_TLS 6
|
||||
#define STT_LOOS 10
|
||||
#define STT_HIOS 12
|
||||
#define STT_LOPROC 13
|
||||
#define STT_HIPROC 15
|
||||
|
||||
// Symbol visibility
|
||||
#define STV_DEFAULT 0
|
||||
#define STV_INTERNAL 1
|
||||
#define STV_HIDDEN 2
|
||||
#define STV_PROTECTED 3
|
||||
|
||||
// Undefined name
|
||||
#define STN_UNDEF 0
|
||||
|
||||
// Relocation types
|
||||
#define R_386_NONE 0
|
||||
#define R_386_32 1
|
||||
#define R_386_PC32 2
|
||||
#define R_386_GOT32 3
|
||||
#define R_386_PLT32 4
|
||||
#define R_386_COPY 5
|
||||
#define R_386_GLOB_DAT 6
|
||||
#define R_386_JMP_SLOT 7
|
||||
#define R_386_RELATIVE 8
|
||||
#define R_386_GOTOFF 9
|
||||
#define R_386_GOTPC 10
|
||||
|
||||
// Segment types
|
||||
#define PT_NULL 0
|
||||
#define PT_LOAD 1
|
||||
#define PT_DYNAMIC 2
|
||||
#define PT_INTERP 3
|
||||
#define PT_NOTE 4
|
||||
#define PT_SHLIB 5
|
||||
#define PT_PHDR 6
|
||||
#define PT_TLS 7
|
||||
#define PT_LOOS 0x60000000
|
||||
#define PT_HIOS 0x6fffffff
|
||||
#define PT_LOPROC 0x70000000
|
||||
#define PT_HIPROC 0x7FFFFFFF
|
||||
|
||||
// Segment flags
|
||||
#define PF_X 1
|
||||
#define PF_W 2
|
||||
#define PF_R 4
|
||||
#define PF_MASKOS 0x0ff00000
|
||||
#define PF_MASKPROC 0xf0000000
|
||||
|
||||
// Dynamic Array Tags
|
||||
#define DT_NULL 0
|
||||
#define DT_NEEDED 1
|
||||
#define DT_PLTRELSZ 2
|
||||
#define DT_PLTGOT 3
|
||||
#define DT_HASH 4
|
||||
#define DT_STRTAB 5
|
||||
#define DT_SYMTAB 6
|
||||
#define DT_RELA 7
|
||||
#define DT_RELASZ 8
|
||||
#define DT_RELAENT 9
|
||||
#define DT_STRSZ 10
|
||||
#define DT_SYMENT 11
|
||||
#define DT_INIT 12
|
||||
#define DT_FINI 13
|
||||
#define DT_SONAME 14
|
||||
#define DT_RPATH 15
|
||||
#define DT_SYMBOLIC 16
|
||||
#define DT_REL 17
|
||||
#define DT_RELSZ 18
|
||||
#define DT_RELENT 19
|
||||
#define DT_PLTREL 20
|
||||
#define DT_DEBUG 21
|
||||
#define DT_TEXTREL 22
|
||||
#define DT_JMPREL 23
|
||||
#define DT_BIND_NOW 24
|
||||
#define DT_INIT_ARRAY 25
|
||||
#define DT_FINI_ARRAY 26
|
||||
#define DT_INIT_ARRAYSZ 27
|
||||
#define DT_FINI_ARRAYSZ 28
|
||||
#define DT_RUNPATH 29
|
||||
#define DT_FLAGS 30
|
||||
#define DT_ENCODING 32
|
||||
#define DT_PREINIT_ARRAY 32
|
||||
#define DT_PREINIT_ARRAYSZ 33
|
||||
#define DT_LOOS 0x6000000D
|
||||
#define DT_HIOS 0x6ffff000
|
||||
#define DT_LOPROC 0x70000000
|
||||
#define DT_HIPROC 0x7FFFFFFF
|
||||
|
||||
// DT_FLAGS values
|
||||
#define DF_ORIGIN 0x1
|
||||
#define DF_SYMBOLIC 0x2
|
||||
#define DF_TEXTREL 0x4
|
||||
#define DF_BIND_NOW 0x8
|
||||
#define DF_STATIC_TLS 0x10
|
||||
|
||||
|
||||
// ELF file header
|
||||
struct Elf32_Ehdr {
|
||||
unsigned char e_ident[EI_NIDENT];
|
||||
Elf32_Half e_type;
|
||||
Elf32_Half e_machine;
|
||||
Elf32_Word e_version;
|
||||
Elf32_Addr e_entry;
|
||||
Elf32_Off e_phoff;
|
||||
Elf32_Off e_shoff;
|
||||
Elf32_Word e_flags;
|
||||
Elf32_Half e_ehsize;
|
||||
Elf32_Half e_phentsize;
|
||||
Elf32_Half e_phnum;
|
||||
Elf32_Half e_shentsize;
|
||||
Elf32_Half e_shnum;
|
||||
Elf32_Half e_shstrndx;
|
||||
};
|
||||
|
||||
// Section header
|
||||
struct Elf32_Shdr {
|
||||
Elf32_Word sh_name;
|
||||
Elf32_Word sh_type;
|
||||
Elf32_Word sh_flags;
|
||||
Elf32_Addr sh_addr;
|
||||
Elf32_Off sh_offset;
|
||||
Elf32_Word sh_size;
|
||||
Elf32_Word sh_link;
|
||||
Elf32_Word sh_info;
|
||||
Elf32_Word sh_addralign;
|
||||
Elf32_Word sh_entsize;
|
||||
};
|
||||
|
||||
// Segment header
|
||||
struct Elf32_Phdr {
|
||||
Elf32_Word p_type;
|
||||
Elf32_Off p_offset;
|
||||
Elf32_Addr p_vaddr;
|
||||
Elf32_Addr p_paddr;
|
||||
Elf32_Word p_filesz;
|
||||
Elf32_Word p_memsz;
|
||||
Elf32_Word p_flags;
|
||||
Elf32_Word p_align;
|
||||
};
|
||||
|
||||
// Symbol table entry
|
||||
struct Elf32_Sym {
|
||||
Elf32_Word st_name;
|
||||
Elf32_Addr st_value;
|
||||
Elf32_Word st_size;
|
||||
unsigned char st_info;
|
||||
unsigned char st_other;
|
||||
Elf32_Half st_shndx;
|
||||
};
|
||||
|
||||
#define ELF32_ST_BIND(i) ((i)>>4)
|
||||
#define ELF32_ST_TYPE(i) ((i)&0xf)
|
||||
#define ELF32_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
|
||||
|
||||
#define ELF32_ST_VISIBILITY(o) ((o)&0x3)
|
||||
|
||||
// Relocation entries
|
||||
struct Elf32_Rel {
|
||||
Elf32_Addr r_offset;
|
||||
Elf32_Word r_info;
|
||||
};
|
||||
|
||||
struct Elf32_Rela {
|
||||
Elf32_Addr r_offset;
|
||||
Elf32_Word r_info;
|
||||
Elf32_Sword r_addend;
|
||||
};
|
||||
|
||||
#define ELF32_R_SYM(i) ((i)>>8)
|
||||
#define ELF32_R_TYPE(i) ((unsigned char)(i))
|
||||
#define ELF32_R_INFO(s,t) (((s)<<8 )+(unsigned char)(t))
|
||||
|
||||
// Dynamic structure
|
||||
struct Elf32_Dyn {
|
||||
Elf32_Sword d_tag;
|
||||
union {
|
||||
Elf32_Word d_val;
|
||||
Elf32_Addr d_ptr;
|
||||
} d_un;
|
||||
};
|
||||
|
||||
#endif // ELFTYPES_H
|
||||
@@ -1 +0,0 @@
|
||||
MESA 7.0.1 GL headers
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,353 +0,0 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
#ifndef __glu_h__
|
||||
#define __glu_h__
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#include "glu_mangle.h"
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#ifndef GLAPIENTRY
|
||||
#define GLAPIENTRY
|
||||
#endif
|
||||
|
||||
#ifndef GLAPIENTRYP
|
||||
#define GLAPIENTRYP GLAPIENTRY *
|
||||
#endif
|
||||
|
||||
#ifdef GLAPI
|
||||
#undef GLAPI
|
||||
#endif
|
||||
|
||||
# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
|
||||
# define GLAPI __declspec(dllexport)
|
||||
# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
|
||||
# define GLAPI __declspec(dllimport)
|
||||
# else /* for use with static link lib build of Win32 edition only */
|
||||
# define GLAPI extern
|
||||
# endif /* _STATIC_MESA support */
|
||||
|
||||
|
||||
#ifndef GLAPI
|
||||
#define GLAPI
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Extensions */
|
||||
#define GLU_EXT_object_space_tess 1
|
||||
#define GLU_EXT_nurbs_tessellator 1
|
||||
|
||||
/* Boolean */
|
||||
#define GLU_FALSE 0
|
||||
#define GLU_TRUE 1
|
||||
|
||||
/* Version */
|
||||
#define GLU_VERSION_1_1 1
|
||||
#define GLU_VERSION_1_2 1
|
||||
#define GLU_VERSION_1_3 1
|
||||
|
||||
/* StringName */
|
||||
#define GLU_VERSION 100800
|
||||
#define GLU_EXTENSIONS 100801
|
||||
|
||||
/* ErrorCode */
|
||||
#define GLU_INVALID_ENUM 100900
|
||||
#define GLU_INVALID_VALUE 100901
|
||||
#define GLU_OUT_OF_MEMORY 100902
|
||||
#define GLU_INCOMPATIBLE_GL_VERSION 100903
|
||||
#define GLU_INVALID_OPERATION 100904
|
||||
|
||||
/* NurbsDisplay */
|
||||
/* GLU_FILL */
|
||||
#define GLU_OUTLINE_POLYGON 100240
|
||||
#define GLU_OUTLINE_PATCH 100241
|
||||
|
||||
/* NurbsCallback */
|
||||
#define GLU_NURBS_ERROR 100103
|
||||
#define GLU_ERROR 100103
|
||||
#define GLU_NURBS_BEGIN 100164
|
||||
#define GLU_NURBS_BEGIN_EXT 100164
|
||||
#define GLU_NURBS_VERTEX 100165
|
||||
#define GLU_NURBS_VERTEX_EXT 100165
|
||||
#define GLU_NURBS_NORMAL 100166
|
||||
#define GLU_NURBS_NORMAL_EXT 100166
|
||||
#define GLU_NURBS_COLOR 100167
|
||||
#define GLU_NURBS_COLOR_EXT 100167
|
||||
#define GLU_NURBS_TEXTURE_COORD 100168
|
||||
#define GLU_NURBS_TEX_COORD_EXT 100168
|
||||
#define GLU_NURBS_END 100169
|
||||
#define GLU_NURBS_END_EXT 100169
|
||||
#define GLU_NURBS_BEGIN_DATA 100170
|
||||
#define GLU_NURBS_BEGIN_DATA_EXT 100170
|
||||
#define GLU_NURBS_VERTEX_DATA 100171
|
||||
#define GLU_NURBS_VERTEX_DATA_EXT 100171
|
||||
#define GLU_NURBS_NORMAL_DATA 100172
|
||||
#define GLU_NURBS_NORMAL_DATA_EXT 100172
|
||||
#define GLU_NURBS_COLOR_DATA 100173
|
||||
#define GLU_NURBS_COLOR_DATA_EXT 100173
|
||||
#define GLU_NURBS_TEXTURE_COORD_DATA 100174
|
||||
#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
|
||||
#define GLU_NURBS_END_DATA 100175
|
||||
#define GLU_NURBS_END_DATA_EXT 100175
|
||||
|
||||
/* NurbsError */
|
||||
#define GLU_NURBS_ERROR1 100251
|
||||
#define GLU_NURBS_ERROR2 100252
|
||||
#define GLU_NURBS_ERROR3 100253
|
||||
#define GLU_NURBS_ERROR4 100254
|
||||
#define GLU_NURBS_ERROR5 100255
|
||||
#define GLU_NURBS_ERROR6 100256
|
||||
#define GLU_NURBS_ERROR7 100257
|
||||
#define GLU_NURBS_ERROR8 100258
|
||||
#define GLU_NURBS_ERROR9 100259
|
||||
#define GLU_NURBS_ERROR10 100260
|
||||
#define GLU_NURBS_ERROR11 100261
|
||||
#define GLU_NURBS_ERROR12 100262
|
||||
#define GLU_NURBS_ERROR13 100263
|
||||
#define GLU_NURBS_ERROR14 100264
|
||||
#define GLU_NURBS_ERROR15 100265
|
||||
#define GLU_NURBS_ERROR16 100266
|
||||
#define GLU_NURBS_ERROR17 100267
|
||||
#define GLU_NURBS_ERROR18 100268
|
||||
#define GLU_NURBS_ERROR19 100269
|
||||
#define GLU_NURBS_ERROR20 100270
|
||||
#define GLU_NURBS_ERROR21 100271
|
||||
#define GLU_NURBS_ERROR22 100272
|
||||
#define GLU_NURBS_ERROR23 100273
|
||||
#define GLU_NURBS_ERROR24 100274
|
||||
#define GLU_NURBS_ERROR25 100275
|
||||
#define GLU_NURBS_ERROR26 100276
|
||||
#define GLU_NURBS_ERROR27 100277
|
||||
#define GLU_NURBS_ERROR28 100278
|
||||
#define GLU_NURBS_ERROR29 100279
|
||||
#define GLU_NURBS_ERROR30 100280
|
||||
#define GLU_NURBS_ERROR31 100281
|
||||
#define GLU_NURBS_ERROR32 100282
|
||||
#define GLU_NURBS_ERROR33 100283
|
||||
#define GLU_NURBS_ERROR34 100284
|
||||
#define GLU_NURBS_ERROR35 100285
|
||||
#define GLU_NURBS_ERROR36 100286
|
||||
#define GLU_NURBS_ERROR37 100287
|
||||
|
||||
/* NurbsProperty */
|
||||
#define GLU_AUTO_LOAD_MATRIX 100200
|
||||
#define GLU_CULLING 100201
|
||||
#define GLU_SAMPLING_TOLERANCE 100203
|
||||
#define GLU_DISPLAY_MODE 100204
|
||||
#define GLU_PARAMETRIC_TOLERANCE 100202
|
||||
#define GLU_SAMPLING_METHOD 100205
|
||||
#define GLU_U_STEP 100206
|
||||
#define GLU_V_STEP 100207
|
||||
#define GLU_NURBS_MODE 100160
|
||||
#define GLU_NURBS_MODE_EXT 100160
|
||||
#define GLU_NURBS_TESSELLATOR 100161
|
||||
#define GLU_NURBS_TESSELLATOR_EXT 100161
|
||||
#define GLU_NURBS_RENDERER 100162
|
||||
#define GLU_NURBS_RENDERER_EXT 100162
|
||||
|
||||
/* NurbsSampling */
|
||||
#define GLU_OBJECT_PARAMETRIC_ERROR 100208
|
||||
#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
|
||||
#define GLU_OBJECT_PATH_LENGTH 100209
|
||||
#define GLU_OBJECT_PATH_LENGTH_EXT 100209
|
||||
#define GLU_PATH_LENGTH 100215
|
||||
#define GLU_PARAMETRIC_ERROR 100216
|
||||
#define GLU_DOMAIN_DISTANCE 100217
|
||||
|
||||
/* NurbsTrim */
|
||||
#define GLU_MAP1_TRIM_2 100210
|
||||
#define GLU_MAP1_TRIM_3 100211
|
||||
|
||||
/* QuadricDrawStyle */
|
||||
#define GLU_POINT 100010
|
||||
#define GLU_LINE 100011
|
||||
#define GLU_FILL 100012
|
||||
#define GLU_SILHOUETTE 100013
|
||||
|
||||
/* QuadricCallback */
|
||||
/* GLU_ERROR */
|
||||
|
||||
/* QuadricNormal */
|
||||
#define GLU_SMOOTH 100000
|
||||
#define GLU_FLAT 100001
|
||||
#define GLU_NONE 100002
|
||||
|
||||
/* QuadricOrientation */
|
||||
#define GLU_OUTSIDE 100020
|
||||
#define GLU_INSIDE 100021
|
||||
|
||||
/* TessCallback */
|
||||
#define GLU_TESS_BEGIN 100100
|
||||
#define GLU_BEGIN 100100
|
||||
#define GLU_TESS_VERTEX 100101
|
||||
#define GLU_VERTEX 100101
|
||||
#define GLU_TESS_END 100102
|
||||
#define GLU_END 100102
|
||||
#define GLU_TESS_ERROR 100103
|
||||
#define GLU_TESS_EDGE_FLAG 100104
|
||||
#define GLU_EDGE_FLAG 100104
|
||||
#define GLU_TESS_COMBINE 100105
|
||||
#define GLU_TESS_BEGIN_DATA 100106
|
||||
#define GLU_TESS_VERTEX_DATA 100107
|
||||
#define GLU_TESS_END_DATA 100108
|
||||
#define GLU_TESS_ERROR_DATA 100109
|
||||
#define GLU_TESS_EDGE_FLAG_DATA 100110
|
||||
#define GLU_TESS_COMBINE_DATA 100111
|
||||
|
||||
/* TessContour */
|
||||
#define GLU_CW 100120
|
||||
#define GLU_CCW 100121
|
||||
#define GLU_INTERIOR 100122
|
||||
#define GLU_EXTERIOR 100123
|
||||
#define GLU_UNKNOWN 100124
|
||||
|
||||
/* TessProperty */
|
||||
#define GLU_TESS_WINDING_RULE 100140
|
||||
#define GLU_TESS_BOUNDARY_ONLY 100141
|
||||
#define GLU_TESS_TOLERANCE 100142
|
||||
|
||||
/* TessError */
|
||||
#define GLU_TESS_ERROR1 100151
|
||||
#define GLU_TESS_ERROR2 100152
|
||||
#define GLU_TESS_ERROR3 100153
|
||||
#define GLU_TESS_ERROR4 100154
|
||||
#define GLU_TESS_ERROR5 100155
|
||||
#define GLU_TESS_ERROR6 100156
|
||||
#define GLU_TESS_ERROR7 100157
|
||||
#define GLU_TESS_ERROR8 100158
|
||||
#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
|
||||
#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
|
||||
#define GLU_TESS_MISSING_END_POLYGON 100153
|
||||
#define GLU_TESS_MISSING_END_CONTOUR 100154
|
||||
#define GLU_TESS_COORD_TOO_LARGE 100155
|
||||
#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
|
||||
|
||||
/* TessWinding */
|
||||
#define GLU_TESS_WINDING_ODD 100130
|
||||
#define GLU_TESS_WINDING_NONZERO 100131
|
||||
#define GLU_TESS_WINDING_POSITIVE 100132
|
||||
#define GLU_TESS_WINDING_NEGATIVE 100133
|
||||
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
class GLUnurbs;
|
||||
class GLUquadric;
|
||||
class GLUtesselator;
|
||||
#else
|
||||
typedef struct GLUnurbs GLUnurbs;
|
||||
typedef struct GLUquadric GLUquadric;
|
||||
typedef struct GLUtesselator GLUtesselator;
|
||||
#endif
|
||||
|
||||
typedef GLUnurbs GLUnurbsObj;
|
||||
typedef GLUquadric GLUquadricObj;
|
||||
typedef GLUtesselator GLUtesselatorObj;
|
||||
typedef GLUtesselator GLUtriangulatorObj;
|
||||
|
||||
#define GLU_TESS_MAX_COORD 1.0e150
|
||||
|
||||
/* Internal convenience typedefs */
|
||||
typedef void (GLAPIENTRYP _GLUfuncptr)();
|
||||
|
||||
GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
|
||||
GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
|
||||
GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
|
||||
GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
|
||||
GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
|
||||
GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
|
||||
GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
|
||||
GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
|
||||
GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
|
||||
GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
|
||||
GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
|
||||
GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
|
||||
GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
|
||||
GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
|
||||
GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
|
||||
GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
|
||||
GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
|
||||
GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
|
||||
GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
|
||||
GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
|
||||
GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
|
||||
GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
|
||||
GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
|
||||
GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
|
||||
GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
|
||||
GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
|
||||
GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
|
||||
GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
|
||||
GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
|
||||
GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
|
||||
GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
|
||||
GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
|
||||
GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
|
||||
GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
|
||||
GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __glu_h__ */
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.0
|
||||
* Copyright (C) 1995-1998 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GLU_MANGLE_H
|
||||
#define GLU_MANGLE_H
|
||||
|
||||
|
||||
#define gluLookAt mgluLookAt
|
||||
#define gluOrtho2D mgluOrtho2D
|
||||
#define gluPerspective mgluPerspective
|
||||
#define gluPickMatrix mgluPickMatrix
|
||||
#define gluProject mgluProject
|
||||
#define gluUnProject mgluUnProject
|
||||
#define gluErrorString mgluErrorString
|
||||
#define gluScaleImage mgluScaleImage
|
||||
#define gluBuild1DMipmaps mgluBuild1DMipmaps
|
||||
#define gluBuild2DMipmaps mgluBuild2DMipmaps
|
||||
#define gluNewQuadric mgluNewQuadric
|
||||
#define gluDeleteQuadric mgluDeleteQuadric
|
||||
#define gluQuadricDrawStyle mgluQuadricDrawStyle
|
||||
#define gluQuadricOrientation mgluQuadricOrientation
|
||||
#define gluQuadricNormals mgluQuadricNormals
|
||||
#define gluQuadricTexture mgluQuadricTexture
|
||||
#define gluQuadricCallback mgluQuadricCallback
|
||||
#define gluCylinder mgluCylinder
|
||||
#define gluSphere mgluSphere
|
||||
#define gluDisk mgluDisk
|
||||
#define gluPartialDisk mgluPartialDisk
|
||||
#define gluNewNurbsRenderer mgluNewNurbsRenderer
|
||||
#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer
|
||||
#define gluLoadSamplingMatrices mgluLoadSamplingMatrices
|
||||
#define gluNurbsProperty mgluNurbsProperty
|
||||
#define gluGetNurbsProperty mgluGetNurbsProperty
|
||||
#define gluBeginCurve mgluBeginCurve
|
||||
#define gluEndCurve mgluEndCurve
|
||||
#define gluNurbsCurve mgluNurbsCurve
|
||||
#define gluBeginSurface mgluBeginSurface
|
||||
#define gluEndSurface mgluEndSurface
|
||||
#define gluNurbsSurface mgluNurbsSurface
|
||||
#define gluBeginTrim mgluBeginTrim
|
||||
#define gluEndTrim mgluEndTrim
|
||||
#define gluPwlCurve mgluPwlCurve
|
||||
#define gluNurbsCallback mgluNurbsCallback
|
||||
#define gluNewTess mgluNewTess
|
||||
#define gluDeleteTess mgluDeleteTess
|
||||
#define gluTessBeginPolygon mgluTessBeginPolygon
|
||||
#define gluTessBeginContour mgluTessBeginContour
|
||||
#define gluTessVertex mgluTessVertex
|
||||
#define gluTessEndPolygon mgluTessEndPolygon
|
||||
#define gluTessEndContour mgluTessEndContour
|
||||
#define gluTessProperty mgluTessProperty
|
||||
#define gluTessNormal mgluTessNormal
|
||||
#define gluTessCallback mgluTessCallback
|
||||
#define gluGetTessProperty mgluGetTessProperty
|
||||
#define gluBeginPolygon mgluBeginPolygon
|
||||
#define gluNextContour mgluNextContour
|
||||
#define gluEndPolygon mgluEndPolygon
|
||||
#define gluGetString mgluGetString
|
||||
#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels
|
||||
#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels
|
||||
#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels
|
||||
#define gluBuild3DMipmaps mgluBuild3DMipmaps
|
||||
#define gluCheckExtension mgluCheckExtension
|
||||
#define gluUnProject4 mgluUnProject4
|
||||
#define gluNurbsCallbackData mgluNurbsCallbackData
|
||||
#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT
|
||||
|
||||
#endif
|
||||
@@ -1,755 +0,0 @@
|
||||
#ifndef __glut_h__
|
||||
#define __glut_h__
|
||||
|
||||
/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
|
||||
|
||||
/* This program is freely distributable without licensing fees and is
|
||||
provided without guarantee or warrantee expressed or implied. This
|
||||
program is -not- in the public domain. */
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#include <GL/mesa_wgl.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
||||
/* GLUT 3.7 now tries to avoid including <windows.h>
|
||||
to avoid name space pollution, but Win32's <GL/gl.h>
|
||||
needs APIENTRY and WINGDIAPI defined properly.
|
||||
|
||||
tjump@spgs.com contributes:
|
||||
If users are building glut code on MS Windows, then they should
|
||||
make sure they include windows.h early, let's not get into a
|
||||
header definitions war since MS has proven it's capability to
|
||||
change header dependencies w/o publishing they have done so.
|
||||
|
||||
So, let's not include windows.h here, as it's not really required and
|
||||
MS own gl/gl.h *should* include it if the dependency is there. */
|
||||
|
||||
/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
|
||||
in your compile preprocessor options. */
|
||||
# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
|
||||
# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
|
||||
/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
|
||||
define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */
|
||||
# ifdef GLUT_USE_SGI_OPENGL
|
||||
# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */
|
||||
# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */
|
||||
# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */
|
||||
# else
|
||||
# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
|
||||
# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */
|
||||
# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* To disable supression of annoying warnings about floats being promoted
|
||||
to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
|
||||
options. */
|
||||
# ifndef GLUT_NO_WARNING_DISABLE
|
||||
# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */
|
||||
# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
|
||||
# endif
|
||||
|
||||
/* Win32 has an annoying issue where there are multiple C run-time
|
||||
libraries (CRTs). If the executable is linked with a different CRT
|
||||
from the GLUT DLL, the GLUT DLL will not share the same CRT static
|
||||
data seen by the executable. In particular, atexit callbacks registered
|
||||
in the executable will not be called if GLUT calls its (different)
|
||||
exit routine). GLUT is typically built with the
|
||||
"/MD" option (the CRT with multithreading DLL support), but the Visual
|
||||
C++ linker default is "/ML" (the single threaded CRT).
|
||||
|
||||
One workaround to this issue is requiring users to always link with
|
||||
the same CRT as GLUT is compiled with. That requires users supply a
|
||||
non-standard option. GLUT 3.7 has its own built-in workaround where
|
||||
the executable's "exit" function pointer is covertly passed to GLUT.
|
||||
GLUT then calls the executable's exit function pointer to ensure that
|
||||
any "atexit" calls registered by the application are called if GLUT
|
||||
needs to exit.
|
||||
|
||||
Note that the __glut*WithExit routines should NEVER be called directly.
|
||||
To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
|
||||
|
||||
/* XXX This is from Win32's <process.h> */
|
||||
# if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__cdecl)
|
||||
/* Define __cdecl for non-Microsoft compilers. */
|
||||
# define __cdecl
|
||||
# define GLUT_DEFINED___CDECL
|
||||
# endif
|
||||
# ifndef _CRTIMP
|
||||
# ifdef _NTSDK
|
||||
/* Definition compatible with NT SDK */
|
||||
# define _CRTIMP
|
||||
# else
|
||||
/* Current definition */
|
||||
# ifdef _DLL
|
||||
# define _CRTIMP __declspec(dllimport)
|
||||
# else
|
||||
# define _CRTIMP
|
||||
# endif
|
||||
# endif
|
||||
# define GLUT_DEFINED__CRTIMP
|
||||
# endif
|
||||
# ifndef GLUT_BUILDING_LIB
|
||||
extern _CRTIMP void __cdecl exit(int);
|
||||
# endif
|
||||
|
||||
/* GLUT callback calling convention for Win32. */
|
||||
# define GLUTCALLBACK __cdecl
|
||||
|
||||
/* for callback/function pointer defs */
|
||||
# define GLUTAPIENTRYV __cdecl
|
||||
|
||||
/* glut-win32 specific macros, defined to prevent collision with
|
||||
and redifinition of Windows system defs, also removes requirement of
|
||||
pretty much any standard windows header from this file */
|
||||
|
||||
#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
|
||||
# define GLUTAPIENTRY __stdcall
|
||||
#else
|
||||
# define GLUTAPIENTRY
|
||||
#endif
|
||||
|
||||
/* GLUT API entry point declarations for Win32. */
|
||||
#if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && defined(_DLL)
|
||||
# define GLUTAPI __declspec(dllexport)
|
||||
#elif defined(_DLL)
|
||||
# define GLUTAPI __declspec(dllimport)
|
||||
#else
|
||||
# define GLUTAPI extern
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(_WINDEF_) && !defined(MESA)
|
||||
# if !defined(MESA_MINWARN)
|
||||
# pragma message( "note: WINDOWS.H not included, providing Mesa definition of CALLBACK macro" )
|
||||
# pragma message( "----: and PROC typedef. If you receive compiler warnings about either ")
|
||||
# pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/glut.h" )
|
||||
# endif
|
||||
# define CALLBACK __stdcall
|
||||
|
||||
#if !defined(__MINGW32__)
|
||||
typedef int (GLUTAPIENTRY *PROC)();
|
||||
typedef void *HGLRC;
|
||||
typedef void *HDC;
|
||||
#endif
|
||||
typedef unsigned long COLORREF;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(MESA)
|
||||
# if !defined(MESA_MINWARN)
|
||||
# pragma message( "note: WINDOWS.H not included, providing Mesa definition of wgl functions" )
|
||||
# pragma message( "----: and macros. If you receive compiler warnings about any being multiply ")
|
||||
# pragma message( "----: defined you should include WINDOWS.H priot to gl/glut.h" )
|
||||
# endif
|
||||
# define WGL_FONT_LINES 0
|
||||
# define WGL_FONT_POLYGONS 1
|
||||
# ifdef UNICODE
|
||||
# define wglUseFontBitmaps wglUseFontBitmapsW
|
||||
# define wglUseFontOutlines wglUseFontOutlinesW
|
||||
# else
|
||||
# define wglUseFontBitmaps wglUseFontBitmapsA
|
||||
# define wglUseFontOutlines wglUseFontOutlinesA
|
||||
# endif /* !UNICODE */
|
||||
typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
|
||||
typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
|
||||
# define WGLAPI __declspec(dllimport)
|
||||
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
|
||||
WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
|
||||
WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
|
||||
WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
|
||||
WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
|
||||
WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
|
||||
WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
|
||||
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
|
||||
WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
|
||||
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
|
||||
WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
|
||||
WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
|
||||
WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
|
||||
WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
|
||||
WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
|
||||
WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
|
||||
WGLAPI int GLAPIENTRY SwapBuffers(HDC);
|
||||
WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
|
||||
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
|
||||
# undef WGLAPI
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#else /* _WIN32 not defined */
|
||||
|
||||
/* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */
|
||||
# define GLUTAPIENTRY GLAPIENTRY
|
||||
# define GLUTAPIENTRYV
|
||||
# define GLUTCALLBACK
|
||||
# define GLUTAPI extern
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
GLUT API revision history:
|
||||
|
||||
GLUT_API_VERSION is updated to reflect incompatible GLUT
|
||||
API changes (interface changes, semantic changes, deletions,
|
||||
or additions).
|
||||
|
||||
GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
|
||||
|
||||
GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
|
||||
extension. Supports new input devices like tablet, dial and button
|
||||
box, and Spaceball. Easy to query OpenGL extensions.
|
||||
|
||||
GLUT_API_VERSION=3 glutMenuStatus added.
|
||||
|
||||
GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
|
||||
glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
|
||||
video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
|
||||
glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
|
||||
glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
|
||||
|
||||
GLUT_API_VERSION=5 glutGetProcAddress (added by BrianP)
|
||||
**/
|
||||
#ifndef GLUT_API_VERSION /* allow this to be overriden */
|
||||
#define GLUT_API_VERSION 5
|
||||
#endif
|
||||
|
||||
/**
|
||||
GLUT implementation revision history:
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
|
||||
API revisions and implementation revisions (ie, bug fixes).
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
|
||||
GLUT Xlib-based implementation. 11/29/94
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
|
||||
GLUT Xlib-based implementation providing GLUT version 2
|
||||
interfaces.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
|
||||
and video resize. 1/3/97
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
|
||||
**/
|
||||
#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
|
||||
#define GLUT_XLIB_IMPLEMENTATION 15
|
||||
#endif
|
||||
|
||||
/* Display mode bit masks. */
|
||||
#define GLUT_RGB 0
|
||||
#define GLUT_RGBA GLUT_RGB
|
||||
#define GLUT_INDEX 1
|
||||
#define GLUT_SINGLE 0
|
||||
#define GLUT_DOUBLE 2
|
||||
#define GLUT_ACCUM 4
|
||||
#define GLUT_ALPHA 8
|
||||
#define GLUT_DEPTH 16
|
||||
#define GLUT_STENCIL 32
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
#define GLUT_MULTISAMPLE 128
|
||||
#define GLUT_STEREO 256
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_LUMINANCE 512
|
||||
#endif
|
||||
|
||||
/* Mouse buttons. */
|
||||
#define GLUT_LEFT_BUTTON 0
|
||||
#define GLUT_MIDDLE_BUTTON 1
|
||||
#define GLUT_RIGHT_BUTTON 2
|
||||
|
||||
/* Mouse button state. */
|
||||
#define GLUT_DOWN 0
|
||||
#define GLUT_UP 1
|
||||
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
/* function keys */
|
||||
#define GLUT_KEY_F1 1
|
||||
#define GLUT_KEY_F2 2
|
||||
#define GLUT_KEY_F3 3
|
||||
#define GLUT_KEY_F4 4
|
||||
#define GLUT_KEY_F5 5
|
||||
#define GLUT_KEY_F6 6
|
||||
#define GLUT_KEY_F7 7
|
||||
#define GLUT_KEY_F8 8
|
||||
#define GLUT_KEY_F9 9
|
||||
#define GLUT_KEY_F10 10
|
||||
#define GLUT_KEY_F11 11
|
||||
#define GLUT_KEY_F12 12
|
||||
/* directional keys */
|
||||
#define GLUT_KEY_LEFT 100
|
||||
#define GLUT_KEY_UP 101
|
||||
#define GLUT_KEY_RIGHT 102
|
||||
#define GLUT_KEY_DOWN 103
|
||||
#define GLUT_KEY_PAGE_UP 104
|
||||
#define GLUT_KEY_PAGE_DOWN 105
|
||||
#define GLUT_KEY_HOME 106
|
||||
#define GLUT_KEY_END 107
|
||||
#define GLUT_KEY_INSERT 108
|
||||
#endif
|
||||
|
||||
/* Entry/exit state. */
|
||||
#define GLUT_LEFT 0
|
||||
#define GLUT_ENTERED 1
|
||||
|
||||
/* Menu usage state. */
|
||||
#define GLUT_MENU_NOT_IN_USE 0
|
||||
#define GLUT_MENU_IN_USE 1
|
||||
|
||||
/* Visibility state. */
|
||||
#define GLUT_NOT_VISIBLE 0
|
||||
#define GLUT_VISIBLE 1
|
||||
|
||||
/* Window status state. */
|
||||
#define GLUT_HIDDEN 0
|
||||
#define GLUT_FULLY_RETAINED 1
|
||||
#define GLUT_PARTIALLY_RETAINED 2
|
||||
#define GLUT_FULLY_COVERED 3
|
||||
|
||||
/* Color index component selection values. */
|
||||
#define GLUT_RED 0
|
||||
#define GLUT_GREEN 1
|
||||
#define GLUT_BLUE 2
|
||||
|
||||
/* Layers for use. */
|
||||
#define GLUT_NORMAL 0
|
||||
#define GLUT_OVERLAY 1
|
||||
|
||||
#if defined(_WIN32) || defined (GLUT_IMPORT_LIB)
|
||||
/* Stroke font constants (use these in GLUT program). */
|
||||
#define GLUT_STROKE_ROMAN ((void*)0)
|
||||
#define GLUT_STROKE_MONO_ROMAN ((void*)1)
|
||||
|
||||
/* Bitmap font constants (use these in GLUT program). */
|
||||
#define GLUT_BITMAP_9_BY_15 ((void*)2)
|
||||
#define GLUT_BITMAP_8_BY_13 ((void*)3)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
|
||||
#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
|
||||
#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
|
||||
#endif
|
||||
#else
|
||||
/* Stroke font opaque addresses (use constants instead in source code). */
|
||||
GLUTAPI void *glutStrokeRoman;
|
||||
GLUTAPI void *glutStrokeMonoRoman;
|
||||
|
||||
/* Stroke font constants (use these in GLUT program). */
|
||||
#define GLUT_STROKE_ROMAN (&glutStrokeRoman)
|
||||
#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
|
||||
|
||||
/* Bitmap font opaque addresses (use constants instead in source code). */
|
||||
GLUTAPI void *glutBitmap9By15;
|
||||
GLUTAPI void *glutBitmap8By13;
|
||||
GLUTAPI void *glutBitmapTimesRoman10;
|
||||
GLUTAPI void *glutBitmapTimesRoman24;
|
||||
GLUTAPI void *glutBitmapHelvetica10;
|
||||
GLUTAPI void *glutBitmapHelvetica12;
|
||||
GLUTAPI void *glutBitmapHelvetica18;
|
||||
|
||||
/* Bitmap font constants (use these in GLUT program). */
|
||||
#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
|
||||
#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
|
||||
#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
|
||||
#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* glutGet parameters. */
|
||||
#define GLUT_WINDOW_X 100
|
||||
#define GLUT_WINDOW_Y 101
|
||||
#define GLUT_WINDOW_WIDTH 102
|
||||
#define GLUT_WINDOW_HEIGHT 103
|
||||
#define GLUT_WINDOW_BUFFER_SIZE 104
|
||||
#define GLUT_WINDOW_STENCIL_SIZE 105
|
||||
#define GLUT_WINDOW_DEPTH_SIZE 106
|
||||
#define GLUT_WINDOW_RED_SIZE 107
|
||||
#define GLUT_WINDOW_GREEN_SIZE 108
|
||||
#define GLUT_WINDOW_BLUE_SIZE 109
|
||||
#define GLUT_WINDOW_ALPHA_SIZE 110
|
||||
#define GLUT_WINDOW_ACCUM_RED_SIZE 111
|
||||
#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
|
||||
#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
|
||||
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
|
||||
#define GLUT_WINDOW_DOUBLEBUFFER 115
|
||||
#define GLUT_WINDOW_RGBA 116
|
||||
#define GLUT_WINDOW_PARENT 117
|
||||
#define GLUT_WINDOW_NUM_CHILDREN 118
|
||||
#define GLUT_WINDOW_COLORMAP_SIZE 119
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
#define GLUT_WINDOW_NUM_SAMPLES 120
|
||||
#define GLUT_WINDOW_STEREO 121
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_WINDOW_CURSOR 122
|
||||
#endif
|
||||
#define GLUT_SCREEN_WIDTH 200
|
||||
#define GLUT_SCREEN_HEIGHT 201
|
||||
#define GLUT_SCREEN_WIDTH_MM 202
|
||||
#define GLUT_SCREEN_HEIGHT_MM 203
|
||||
#define GLUT_MENU_NUM_ITEMS 300
|
||||
#define GLUT_DISPLAY_MODE_POSSIBLE 400
|
||||
#define GLUT_INIT_WINDOW_X 500
|
||||
#define GLUT_INIT_WINDOW_Y 501
|
||||
#define GLUT_INIT_WINDOW_WIDTH 502
|
||||
#define GLUT_INIT_WINDOW_HEIGHT 503
|
||||
#define GLUT_INIT_DISPLAY_MODE 504
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
#define GLUT_ELAPSED_TIME 700
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
#define GLUT_WINDOW_FORMAT_ID 123
|
||||
#endif
|
||||
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
/* glutDeviceGet parameters. */
|
||||
#define GLUT_HAS_KEYBOARD 600
|
||||
#define GLUT_HAS_MOUSE 601
|
||||
#define GLUT_HAS_SPACEBALL 602
|
||||
#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
|
||||
#define GLUT_HAS_TABLET 604
|
||||
#define GLUT_NUM_MOUSE_BUTTONS 605
|
||||
#define GLUT_NUM_SPACEBALL_BUTTONS 606
|
||||
#define GLUT_NUM_BUTTON_BOX_BUTTONS 607
|
||||
#define GLUT_NUM_DIALS 608
|
||||
#define GLUT_NUM_TABLET_BUTTONS 609
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
|
||||
#define GLUT_DEVICE_KEY_REPEAT 611
|
||||
#define GLUT_HAS_JOYSTICK 612
|
||||
#define GLUT_OWNS_JOYSTICK 613
|
||||
#define GLUT_JOYSTICK_BUTTONS 614
|
||||
#define GLUT_JOYSTICK_AXES 615
|
||||
#define GLUT_JOYSTICK_POLL_RATE 616
|
||||
#endif
|
||||
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
/* glutLayerGet parameters. */
|
||||
#define GLUT_OVERLAY_POSSIBLE 800
|
||||
#define GLUT_LAYER_IN_USE 801
|
||||
#define GLUT_HAS_OVERLAY 802
|
||||
#define GLUT_TRANSPARENT_INDEX 803
|
||||
#define GLUT_NORMAL_DAMAGED 804
|
||||
#define GLUT_OVERLAY_DAMAGED 805
|
||||
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
/* glutVideoResizeGet parameters. */
|
||||
#define GLUT_VIDEO_RESIZE_POSSIBLE 900
|
||||
#define GLUT_VIDEO_RESIZE_IN_USE 901
|
||||
#define GLUT_VIDEO_RESIZE_X_DELTA 902
|
||||
#define GLUT_VIDEO_RESIZE_Y_DELTA 903
|
||||
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
|
||||
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
|
||||
#define GLUT_VIDEO_RESIZE_X 906
|
||||
#define GLUT_VIDEO_RESIZE_Y 907
|
||||
#define GLUT_VIDEO_RESIZE_WIDTH 908
|
||||
#define GLUT_VIDEO_RESIZE_HEIGHT 909
|
||||
#endif
|
||||
|
||||
/* glutUseLayer parameters. */
|
||||
#define GLUT_NORMAL 0
|
||||
#define GLUT_OVERLAY 1
|
||||
|
||||
/* glutGetModifiers return mask. */
|
||||
#define GLUT_ACTIVE_SHIFT 1
|
||||
#define GLUT_ACTIVE_CTRL 2
|
||||
#define GLUT_ACTIVE_ALT 4
|
||||
|
||||
/* glutSetCursor parameters. */
|
||||
/* Basic arrows. */
|
||||
#define GLUT_CURSOR_RIGHT_ARROW 0
|
||||
#define GLUT_CURSOR_LEFT_ARROW 1
|
||||
/* Symbolic cursor shapes. */
|
||||
#define GLUT_CURSOR_INFO 2
|
||||
#define GLUT_CURSOR_DESTROY 3
|
||||
#define GLUT_CURSOR_HELP 4
|
||||
#define GLUT_CURSOR_CYCLE 5
|
||||
#define GLUT_CURSOR_SPRAY 6
|
||||
#define GLUT_CURSOR_WAIT 7
|
||||
#define GLUT_CURSOR_TEXT 8
|
||||
#define GLUT_CURSOR_CROSSHAIR 9
|
||||
/* Directional cursors. */
|
||||
#define GLUT_CURSOR_UP_DOWN 10
|
||||
#define GLUT_CURSOR_LEFT_RIGHT 11
|
||||
/* Sizing cursors. */
|
||||
#define GLUT_CURSOR_TOP_SIDE 12
|
||||
#define GLUT_CURSOR_BOTTOM_SIDE 13
|
||||
#define GLUT_CURSOR_LEFT_SIDE 14
|
||||
#define GLUT_CURSOR_RIGHT_SIDE 15
|
||||
#define GLUT_CURSOR_TOP_LEFT_CORNER 16
|
||||
#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
|
||||
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
|
||||
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
|
||||
/* Inherit from parent window. */
|
||||
#define GLUT_CURSOR_INHERIT 100
|
||||
/* Blank cursor. */
|
||||
#define GLUT_CURSOR_NONE 101
|
||||
/* Fullscreen crosshair (if available). */
|
||||
#define GLUT_CURSOR_FULL_CROSSHAIR 102
|
||||
#endif
|
||||
|
||||
/* GLUT initialization sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
|
||||
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
|
||||
GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
|
||||
#ifndef GLUT_BUILDING_LIB
|
||||
static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
|
||||
#define glutInit glutInit_ATEXIT_HACK
|
||||
#endif
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string);
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y);
|
||||
GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutMainLoop(void);
|
||||
|
||||
/* GLUT window sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
|
||||
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
|
||||
GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
|
||||
#ifndef GLUT_BUILDING_LIB
|
||||
static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
|
||||
#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
|
||||
#endif
|
||||
#endif
|
||||
GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win);
|
||||
GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
|
||||
GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win);
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void);
|
||||
GLUTAPI int GLUTAPIENTRY glutGetWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetWindow(int win);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title);
|
||||
GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y);
|
||||
GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutPopWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutPushWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutShowWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutHideWindow(void);
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
GLUTAPI void GLUTAPIENTRY glutFullScreen(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y);
|
||||
#endif
|
||||
|
||||
/* GLUT overlay sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer);
|
||||
GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
|
||||
GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win);
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutShowOverlay(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutHideOverlay(void);
|
||||
#endif
|
||||
|
||||
/* GLUT menu sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
|
||||
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
|
||||
GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
|
||||
#ifndef GLUT_BUILDING_LIB
|
||||
static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
|
||||
#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
|
||||
#endif
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);
|
||||
GLUTAPI int GLUTAPIENTRY glutGetMenu(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu);
|
||||
GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value);
|
||||
GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu);
|
||||
GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
|
||||
GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
|
||||
GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item);
|
||||
GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button);
|
||||
GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button);
|
||||
|
||||
/* GLUT window callback sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
|
||||
GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
|
||||
GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
|
||||
GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
|
||||
GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
|
||||
GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* GLUT color index sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue);
|
||||
GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
|
||||
GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
|
||||
|
||||
/* GLUT state retrieval sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutGet(GLenum type);
|
||||
GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type);
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
/* GLUT extension support sub-API */
|
||||
GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name);
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
|
||||
GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 5)
|
||||
typedef void (*GLUTproc)();
|
||||
GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName);
|
||||
#endif
|
||||
|
||||
/* GLUT font sub-API */
|
||||
GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character);
|
||||
GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character);
|
||||
GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character);
|
||||
GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string);
|
||||
GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string);
|
||||
#endif
|
||||
|
||||
/* GLUT pre-built models sub-API */
|
||||
GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void);
|
||||
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
/* GLUT video resize sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height);
|
||||
|
||||
/* GLUT debugging sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutReportErrors(void);
|
||||
#endif
|
||||
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
/* GLUT device control sub-API. */
|
||||
/* glutSetKeyRepeat modes. */
|
||||
#define GLUT_KEY_REPEAT_OFF 0
|
||||
#define GLUT_KEY_REPEAT_ON 1
|
||||
#define GLUT_KEY_REPEAT_DEFAULT 2
|
||||
|
||||
/* Joystick button masks. */
|
||||
#define GLUT_JOYSTICK_BUTTON_A 1
|
||||
#define GLUT_JOYSTICK_BUTTON_B 2
|
||||
#define GLUT_JOYSTICK_BUTTON_C 4
|
||||
#define GLUT_JOYSTICK_BUTTON_D 8
|
||||
|
||||
GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode);
|
||||
GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void);
|
||||
|
||||
/* GLUT game mode sub-API. */
|
||||
/* glutGameModeGet. */
|
||||
#define GLUT_GAME_MODE_ACTIVE 0
|
||||
#define GLUT_GAME_MODE_POSSIBLE 1
|
||||
#define GLUT_GAME_MODE_WIDTH 2
|
||||
#define GLUT_GAME_MODE_HEIGHT 3
|
||||
#define GLUT_GAME_MODE_PIXEL_DEPTH 4
|
||||
#define GLUT_GAME_MODE_REFRESH_RATE 5
|
||||
#define GLUT_GAME_MODE_DISPLAY_CHANGED 6
|
||||
|
||||
GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string);
|
||||
GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void);
|
||||
GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __glut_h__ */
|
||||
@@ -1,500 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GLX_H
|
||||
#define GLX_H
|
||||
|
||||
|
||||
#ifdef __VMS
|
||||
#include <GL/vms_x_fix.h>
|
||||
# ifdef __cplusplus
|
||||
/* VMS Xlib.h gives problems with C++.
|
||||
* this avoids a bunch of trivial warnings */
|
||||
#pragma message disable nosimpint
|
||||
#endif
|
||||
#endif
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#ifdef __VMS
|
||||
# ifdef __cplusplus
|
||||
#pragma message enable nosimpint
|
||||
#endif
|
||||
#endif
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#include "glx_mangle.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define GLX_VERSION_1_1 1
|
||||
#define GLX_VERSION_1_2 1
|
||||
#define GLX_VERSION_1_3 1
|
||||
#define GLX_VERSION_1_4 1
|
||||
|
||||
#define GLX_EXTENSION_NAME "GLX"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Tokens for glXChooseVisual and glXGetConfig:
|
||||
*/
|
||||
#define GLX_USE_GL 1
|
||||
#define GLX_BUFFER_SIZE 2
|
||||
#define GLX_LEVEL 3
|
||||
#define GLX_RGBA 4
|
||||
#define GLX_DOUBLEBUFFER 5
|
||||
#define GLX_STEREO 6
|
||||
#define GLX_AUX_BUFFERS 7
|
||||
#define GLX_RED_SIZE 8
|
||||
#define GLX_GREEN_SIZE 9
|
||||
#define GLX_BLUE_SIZE 10
|
||||
#define GLX_ALPHA_SIZE 11
|
||||
#define GLX_DEPTH_SIZE 12
|
||||
#define GLX_STENCIL_SIZE 13
|
||||
#define GLX_ACCUM_RED_SIZE 14
|
||||
#define GLX_ACCUM_GREEN_SIZE 15
|
||||
#define GLX_ACCUM_BLUE_SIZE 16
|
||||
#define GLX_ACCUM_ALPHA_SIZE 17
|
||||
|
||||
|
||||
/*
|
||||
* Error codes returned by glXGetConfig:
|
||||
*/
|
||||
#define GLX_BAD_SCREEN 1
|
||||
#define GLX_BAD_ATTRIBUTE 2
|
||||
#define GLX_NO_EXTENSION 3
|
||||
#define GLX_BAD_VISUAL 4
|
||||
#define GLX_BAD_CONTEXT 5
|
||||
#define GLX_BAD_VALUE 6
|
||||
#define GLX_BAD_ENUM 7
|
||||
|
||||
|
||||
/*
|
||||
* GLX 1.1 and later:
|
||||
*/
|
||||
#define GLX_VENDOR 1
|
||||
#define GLX_VERSION 2
|
||||
#define GLX_EXTENSIONS 3
|
||||
|
||||
|
||||
/*
|
||||
* GLX 1.3 and later:
|
||||
*/
|
||||
#define GLX_CONFIG_CAVEAT 0x20
|
||||
#define GLX_DONT_CARE 0xFFFFFFFF
|
||||
#define GLX_X_VISUAL_TYPE 0x22
|
||||
#define GLX_TRANSPARENT_TYPE 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
#define GLX_PIXMAP_BIT 0x00000002
|
||||
#define GLX_PBUFFER_BIT 0x00000004
|
||||
#define GLX_AUX_BUFFERS_BIT 0x00000010
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
|
||||
#define GLX_DEPTH_BUFFER_BIT 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT 0x00000080
|
||||
#define GLX_NONE 0x8000
|
||||
#define GLX_SLOW_CONFIG 0x8001
|
||||
#define GLX_TRUE_COLOR 0x8002
|
||||
#define GLX_DIRECT_COLOR 0x8003
|
||||
#define GLX_PSEUDO_COLOR 0x8004
|
||||
#define GLX_STATIC_COLOR 0x8005
|
||||
#define GLX_GRAY_SCALE 0x8006
|
||||
#define GLX_STATIC_GRAY 0x8007
|
||||
#define GLX_TRANSPARENT_RGB 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX 0x8009
|
||||
#define GLX_VISUAL_ID 0x800B
|
||||
#define GLX_SCREEN 0x800C
|
||||
#define GLX_NON_CONFORMANT_CONFIG 0x800D
|
||||
#define GLX_DRAWABLE_TYPE 0x8010
|
||||
#define GLX_RENDER_TYPE 0x8011
|
||||
#define GLX_X_RENDERABLE 0x8012
|
||||
#define GLX_FBCONFIG_ID 0x8013
|
||||
#define GLX_RGBA_TYPE 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE 0x8015
|
||||
#define GLX_MAX_PBUFFER_WIDTH 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS 0x8018
|
||||
#define GLX_PRESERVED_CONTENTS 0x801B
|
||||
#define GLX_LARGEST_PBUFFER 0x801C
|
||||
#define GLX_WIDTH 0x801D
|
||||
#define GLX_HEIGHT 0x801E
|
||||
#define GLX_EVENT_MASK 0x801F
|
||||
#define GLX_DAMAGED 0x8020
|
||||
#define GLX_SAVED 0x8021
|
||||
#define GLX_WINDOW 0x8022
|
||||
#define GLX_PBUFFER 0x8023
|
||||
#define GLX_PBUFFER_HEIGHT 0x8040
|
||||
#define GLX_PBUFFER_WIDTH 0x8041
|
||||
#define GLX_RGBA_BIT 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT 0x00000002
|
||||
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
|
||||
|
||||
|
||||
/*
|
||||
* GLX 1.4 and later:
|
||||
*/
|
||||
#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
|
||||
#define GLX_SAMPLES 0x186a1 /*100001*/
|
||||
|
||||
|
||||
|
||||
typedef struct __GLXcontextRec *GLXContext;
|
||||
typedef XID GLXPixmap;
|
||||
typedef XID GLXDrawable;
|
||||
/* GLX 1.3 and later */
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfig;
|
||||
typedef XID GLXFBConfigID;
|
||||
typedef XID GLXContextID;
|
||||
typedef XID GLXWindow;
|
||||
typedef XID GLXPbuffer;
|
||||
|
||||
|
||||
|
||||
extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
|
||||
int *attribList );
|
||||
|
||||
extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
|
||||
GLXContext shareList, Bool direct );
|
||||
|
||||
extern void glXDestroyContext( Display *dpy, GLXContext ctx );
|
||||
|
||||
extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
|
||||
GLXContext ctx);
|
||||
|
||||
extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
|
||||
unsigned long mask );
|
||||
|
||||
extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
|
||||
|
||||
extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
|
||||
Pixmap pixmap );
|
||||
|
||||
extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
|
||||
|
||||
extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
|
||||
|
||||
extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
|
||||
|
||||
extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
|
||||
|
||||
extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
|
||||
int attrib, int *value );
|
||||
|
||||
extern GLXContext glXGetCurrentContext( void );
|
||||
|
||||
extern GLXDrawable glXGetCurrentDrawable( void );
|
||||
|
||||
extern void glXWaitGL( void );
|
||||
|
||||
extern void glXWaitX( void );
|
||||
|
||||
extern void glXUseXFont( Font font, int first, int count, int list );
|
||||
|
||||
|
||||
|
||||
/* GLX 1.1 and later */
|
||||
extern const char *glXQueryExtensionsString( Display *dpy, int screen );
|
||||
|
||||
extern const char *glXQueryServerString( Display *dpy, int screen, int name );
|
||||
|
||||
extern const char *glXGetClientString( Display *dpy, int name );
|
||||
|
||||
|
||||
/* GLX 1.2 and later */
|
||||
extern Display *glXGetCurrentDisplay( void );
|
||||
|
||||
|
||||
/* GLX 1.3 and later */
|
||||
extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
|
||||
const int *attribList, int *nitems );
|
||||
|
||||
extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
|
||||
int attribute, int *value );
|
||||
|
||||
extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
|
||||
int *nelements );
|
||||
|
||||
extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
|
||||
GLXFBConfig config );
|
||||
|
||||
extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
|
||||
Window win, const int *attribList );
|
||||
|
||||
extern void glXDestroyWindow( Display *dpy, GLXWindow window );
|
||||
|
||||
extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
|
||||
Pixmap pixmap, const int *attribList );
|
||||
|
||||
extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
|
||||
|
||||
extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
|
||||
const int *attribList );
|
||||
|
||||
extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
|
||||
|
||||
extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
|
||||
unsigned int *value );
|
||||
|
||||
extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
|
||||
int renderType, GLXContext shareList,
|
||||
Bool direct );
|
||||
|
||||
extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
|
||||
GLXDrawable read, GLXContext ctx );
|
||||
|
||||
extern GLXDrawable glXGetCurrentReadDrawable( void );
|
||||
|
||||
extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
|
||||
int *value );
|
||||
|
||||
extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
|
||||
unsigned long mask );
|
||||
|
||||
extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
|
||||
unsigned long *mask );
|
||||
|
||||
|
||||
/* GLX 1.4 and later */
|
||||
extern void (*glXGetProcAddress(const GLubyte *procname))( void );
|
||||
|
||||
|
||||
#ifndef GLX_GLXEXT_LEGACY
|
||||
|
||||
#include <GL/glxext.h>
|
||||
|
||||
#else
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ARB 2. GLX_ARB_get_proc_address
|
||||
*/
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#define GLX_ARB_get_proc_address 1
|
||||
|
||||
typedef void (*__GLXextFuncPtr)(void);
|
||||
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
|
||||
|
||||
#endif /* GLX_ARB_get_proc_address */
|
||||
|
||||
|
||||
|
||||
#endif /* GLX_GLXEXT_LEGACY */
|
||||
|
||||
|
||||
/**
|
||||
** The following aren't in glxext.h yet.
|
||||
**/
|
||||
|
||||
|
||||
/*
|
||||
* ???. GLX_NV_vertex_array_range
|
||||
*/
|
||||
#ifndef GLX_NV_vertex_array_range
|
||||
#define GLX_NV_vertex_array_range
|
||||
|
||||
extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
extern void glXFreeMemoryNV(GLvoid *pointer);
|
||||
typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
|
||||
|
||||
#endif /* GLX_NV_vertex_array_range */
|
||||
|
||||
|
||||
/*
|
||||
* ???. GLX_MESA_allocate_memory
|
||||
*/
|
||||
#ifndef GLX_MESA_allocate_memory
|
||||
#define GLX_MESA_allocate_memory 1
|
||||
|
||||
extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
|
||||
extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer);
|
||||
extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer);
|
||||
typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
|
||||
typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer);
|
||||
typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer);
|
||||
|
||||
#endif /* GLX_MESA_allocate_memory */
|
||||
|
||||
|
||||
/*
|
||||
* ARB ?. GLX_ARB_render_texture
|
||||
* XXX This was never finalized!
|
||||
*/
|
||||
#ifndef GLX_ARB_render_texture
|
||||
#define GLX_ARB_render_texture 1
|
||||
|
||||
extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
|
||||
extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
|
||||
extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList);
|
||||
|
||||
#endif /* GLX_ARB_render_texture */
|
||||
|
||||
|
||||
/*
|
||||
* Remove this when glxext.h is updated.
|
||||
*/
|
||||
#ifndef GLX_NV_float_buffer
|
||||
#define GLX_NV_float_buffer 1
|
||||
|
||||
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
|
||||
|
||||
#endif /* GLX_NV_float_buffer */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* #?. GLX_MESA_swap_frame_usage
|
||||
*/
|
||||
#ifndef GLX_MESA_swap_frame_usage
|
||||
#define GLX_MESA_swap_frame_usage 1
|
||||
|
||||
extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
|
||||
extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
|
||||
extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
|
||||
extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
|
||||
|
||||
typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
|
||||
typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
|
||||
typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
|
||||
typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
|
||||
|
||||
#endif /* GLX_MESA_swap_frame_usage */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* #?. GLX_MESA_swap_control
|
||||
*/
|
||||
#ifndef GLX_MESA_swap_control
|
||||
#define GLX_MESA_swap_control 1
|
||||
|
||||
extern int glXSwapIntervalMESA(unsigned int interval);
|
||||
extern int glXGetSwapIntervalMESA(void);
|
||||
|
||||
typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
|
||||
typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
|
||||
|
||||
#endif /* GLX_MESA_swap_control */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* #?. GLX_EXT_texture_from_pixmap
|
||||
* XXX not finished?
|
||||
*/
|
||||
#ifndef GLX_EXT_texture_from_pixmap
|
||||
#define GLX_EXT_texture_from_pixmap 1
|
||||
|
||||
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
|
||||
#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
|
||||
#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
|
||||
#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
|
||||
#define GLX_Y_INVERTED_EXT 0x20D4
|
||||
|
||||
#define GLX_TEXTURE_FORMAT_EXT 0x20D5
|
||||
#define GLX_TEXTURE_TARGET_EXT 0x20D6
|
||||
#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
|
||||
|
||||
#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
|
||||
#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
|
||||
#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
|
||||
|
||||
#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
|
||||
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
|
||||
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
|
||||
|
||||
#define GLX_TEXTURE_1D_EXT 0x20DB
|
||||
#define GLX_TEXTURE_2D_EXT 0x20DC
|
||||
#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
|
||||
|
||||
#define GLX_FRONT_LEFT_EXT 0x20DE
|
||||
#define GLX_FRONT_RIGHT_EXT 0x20DF
|
||||
#define GLX_BACK_LEFT_EXT 0x20E0
|
||||
#define GLX_BACK_RIGHT_EXT 0x20E1
|
||||
#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
|
||||
#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
|
||||
#define GLX_AUX0_EXT 0x20E2
|
||||
#define GLX_AUX1_EXT 0x20E3
|
||||
#define GLX_AUX2_EXT 0x20E4
|
||||
#define GLX_AUX3_EXT 0x20E5
|
||||
#define GLX_AUX4_EXT 0x20E6
|
||||
#define GLX_AUX5_EXT 0x20E7
|
||||
#define GLX_AUX6_EXT 0x20E8
|
||||
#define GLX_AUX7_EXT 0x20E9
|
||||
#define GLX_AUX8_EXT 0x20EA
|
||||
#define GLX_AUX9_EXT 0x20EB
|
||||
|
||||
extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
|
||||
extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
|
||||
|
||||
#endif /* GLX_EXT_texture_from_pixmap */
|
||||
|
||||
|
||||
|
||||
|
||||
/*** Should these go here, or in another header? */
|
||||
/*
|
||||
** GLX Events
|
||||
*/
|
||||
typedef struct {
|
||||
int event_type; /* GLX_DAMAGED or GLX_SAVED */
|
||||
int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
|
||||
unsigned long serial; /* # of last request processed by server */
|
||||
Bool send_event; /* true if this came for SendEvent request */
|
||||
Display *display; /* display the event was read from */
|
||||
GLXDrawable drawable; /* XID of Drawable */
|
||||
unsigned int buffer_mask; /* mask indicating which buffers are affected */
|
||||
unsigned int aux_buffer; /* which aux buffer was affected */
|
||||
int x, y;
|
||||
int width, height;
|
||||
int count; /* if nonzero, at least this many more */
|
||||
} GLXPbufferClobberEvent;
|
||||
|
||||
typedef union __GLXEvent {
|
||||
GLXPbufferClobberEvent glxpbufferclobber;
|
||||
long pad[24];
|
||||
} GLXEvent;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GLX_MANGLE_H
|
||||
#define GLX_MANGLE_H
|
||||
|
||||
#define glXChooseVisual mglXChooseVisual
|
||||
#define glXCreateContext mglXCreateContext
|
||||
#define glXDestroyContext mglXDestroyContext
|
||||
#define glXMakeCurrent mglXMakeCurrent
|
||||
#define glXCopyContext mglXCopyContext
|
||||
#define glXSwapBuffers mglXSwapBuffers
|
||||
#define glXCreateGLXPixmap mglXCreateGLXPixmap
|
||||
#define glXDestroyGLXPixmap mglXDestroyGLXPixmap
|
||||
#define glXQueryExtension mglXQueryExtension
|
||||
#define glXQueryVersion mglXQueryVersion
|
||||
#define glXIsDirect mglXIsDirect
|
||||
#define glXGetConfig mglXGetConfig
|
||||
#define glXGetCurrentContext mglXGetCurrentContext
|
||||
#define glXGetCurrentDrawable mglXGetCurrentDrawable
|
||||
#define glXWaitGL mglXWaitGL
|
||||
#define glXWaitX mglXWaitX
|
||||
#define glXUseXFont mglXUseXFont
|
||||
#define glXQueryExtensionsString mglXQueryExtensionsString
|
||||
#define glXQueryServerString mglXQueryServerString
|
||||
#define glXGetClientString mglXGetClientString
|
||||
#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA
|
||||
#define glXReleaseBuffersMESA mglXReleaseBuffersMESA
|
||||
#define glXCopySubBufferMESA mglXCopySubBufferMESA
|
||||
#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
|
||||
#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
|
||||
|
||||
/* GLX 1.2 */
|
||||
#define glXGetCurrentDisplay mglXGetCurrentDisplay
|
||||
|
||||
/* GLX 1.3 */
|
||||
#define glXChooseFBConfig mglXChooseFBConfig
|
||||
#define glXGetFBConfigAttrib mglXGetFBConfigAttrib
|
||||
#define glXGetFBConfigs mglXGetFBConfigs
|
||||
#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig
|
||||
#define glXCreateWindow mglXCreateWindow
|
||||
#define glXDestroyWindow mglXDestroyWindow
|
||||
#define glXCreatePixmap mglXCreatePixmap
|
||||
#define glXDestroyPixmap mglXDestroyPixmap
|
||||
#define glXCreatePbuffer mglXCreatePbuffer
|
||||
#define glXDestroyPbuffer mglXDestroyPbuffer
|
||||
#define glXQueryDrawable mglXQueryDrawable
|
||||
#define glXCreateNewContext mglXCreateNewContext
|
||||
#define glXMakeContextCurrent mglXMakeContextCurrent
|
||||
#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable
|
||||
#define glXQueryContext mglXQueryContext
|
||||
#define glXSelectEvent mglXSelectEvent
|
||||
#define glXGetSelectedEvent mglXGetSelectedEvent
|
||||
|
||||
/* GLX 1.4 */
|
||||
#define glXGetProcAddress mglXGetProcAddress
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,785 +0,0 @@
|
||||
#ifndef __glxext_h_
|
||||
#define __glxext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glxext.h last updated 2007/04/21 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GLX_GLXEXT_VERSION 19
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
#define GLX_PIXMAP_BIT 0x00000002
|
||||
#define GLX_PBUFFER_BIT 0x00000004
|
||||
#define GLX_RGBA_BIT 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT 0x00000002
|
||||
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT 0x00000080
|
||||
#define GLX_CONFIG_CAVEAT 0x20
|
||||
#define GLX_X_VISUAL_TYPE 0x22
|
||||
#define GLX_TRANSPARENT_TYPE 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
|
||||
#define GLX_DONT_CARE 0xFFFFFFFF
|
||||
#define GLX_NONE 0x8000
|
||||
#define GLX_SLOW_CONFIG 0x8001
|
||||
#define GLX_TRUE_COLOR 0x8002
|
||||
#define GLX_DIRECT_COLOR 0x8003
|
||||
#define GLX_PSEUDO_COLOR 0x8004
|
||||
#define GLX_STATIC_COLOR 0x8005
|
||||
#define GLX_GRAY_SCALE 0x8006
|
||||
#define GLX_STATIC_GRAY 0x8007
|
||||
#define GLX_TRANSPARENT_RGB 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX 0x8009
|
||||
#define GLX_VISUAL_ID 0x800B
|
||||
#define GLX_SCREEN 0x800C
|
||||
#define GLX_NON_CONFORMANT_CONFIG 0x800D
|
||||
#define GLX_DRAWABLE_TYPE 0x8010
|
||||
#define GLX_RENDER_TYPE 0x8011
|
||||
#define GLX_X_RENDERABLE 0x8012
|
||||
#define GLX_FBCONFIG_ID 0x8013
|
||||
#define GLX_RGBA_TYPE 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE 0x8015
|
||||
#define GLX_MAX_PBUFFER_WIDTH 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS 0x8018
|
||||
#define GLX_PRESERVED_CONTENTS 0x801B
|
||||
#define GLX_LARGEST_PBUFFER 0x801C
|
||||
#define GLX_WIDTH 0x801D
|
||||
#define GLX_HEIGHT 0x801E
|
||||
#define GLX_EVENT_MASK 0x801F
|
||||
#define GLX_DAMAGED 0x8020
|
||||
#define GLX_SAVED 0x8021
|
||||
#define GLX_WINDOW 0x8022
|
||||
#define GLX_PBUFFER 0x8023
|
||||
#define GLX_PBUFFER_HEIGHT 0x8040
|
||||
#define GLX_PBUFFER_WIDTH 0x8041
|
||||
#endif
|
||||
|
||||
#ifndef GLX_VERSION_1_4
|
||||
#define GLX_SAMPLE_BUFFERS 100000
|
||||
#define GLX_SAMPLES 100001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_multisample
|
||||
#define GLX_SAMPLE_BUFFERS_ARB 100000
|
||||
#define GLX_SAMPLES_ARB 100001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_fbconfig_float
|
||||
#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
|
||||
#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_multisample
|
||||
#define GLX_SAMPLE_BUFFERS_SGIS 100000
|
||||
#define GLX_SAMPLES_SGIS 100001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_info
|
||||
#define GLX_X_VISUAL_TYPE_EXT 0x22
|
||||
#define GLX_TRANSPARENT_TYPE_EXT 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
|
||||
#define GLX_NONE_EXT 0x8000
|
||||
#define GLX_TRUE_COLOR_EXT 0x8002
|
||||
#define GLX_DIRECT_COLOR_EXT 0x8003
|
||||
#define GLX_PSEUDO_COLOR_EXT 0x8004
|
||||
#define GLX_STATIC_COLOR_EXT 0x8005
|
||||
#define GLX_GRAY_SCALE_EXT 0x8006
|
||||
#define GLX_STATIC_GRAY_EXT 0x8007
|
||||
#define GLX_TRANSPARENT_RGB_EXT 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX_EXT 0x8009
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_swap_control
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_video_sync
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_make_current_read
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_rating
|
||||
#define GLX_VISUAL_CAVEAT_EXT 0x20
|
||||
#define GLX_SLOW_VISUAL_EXT 0x8001
|
||||
#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
|
||||
/* reuse GLX_NONE_EXT */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_import_context
|
||||
#define GLX_SHARE_CONTEXT_EXT 0x800A
|
||||
#define GLX_VISUAL_ID_EXT 0x800B
|
||||
#define GLX_SCREEN_EXT 0x800C
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
#define GLX_WINDOW_BIT_SGIX 0x00000001
|
||||
#define GLX_PIXMAP_BIT_SGIX 0x00000002
|
||||
#define GLX_RGBA_BIT_SGIX 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
|
||||
#define GLX_DRAWABLE_TYPE_SGIX 0x8010
|
||||
#define GLX_RENDER_TYPE_SGIX 0x8011
|
||||
#define GLX_X_RENDERABLE_SGIX 0x8012
|
||||
#define GLX_FBCONFIG_ID_SGIX 0x8013
|
||||
#define GLX_RGBA_TYPE_SGIX 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
|
||||
/* reuse GLX_SCREEN_EXT */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
#define GLX_PBUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
|
||||
#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
|
||||
#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
|
||||
#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
|
||||
#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
|
||||
#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
|
||||
#define GLX_LARGEST_PBUFFER_SGIX 0x801C
|
||||
#define GLX_WIDTH_SGIX 0x801D
|
||||
#define GLX_HEIGHT_SGIX 0x801E
|
||||
#define GLX_EVENT_MASK_SGIX 0x801F
|
||||
#define GLX_DAMAGED_SGIX 0x8020
|
||||
#define GLX_SAVED_SGIX 0x8021
|
||||
#define GLX_WINDOW_SGIX 0x8022
|
||||
#define GLX_PBUFFER_SGIX 0x8023
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_cushion
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_resize
|
||||
#define GLX_SYNC_FRAME_SGIX 0x00000000
|
||||
#define GLX_SYNC_SWAP_SGIX 0x00000001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_dmbuffer
|
||||
#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_group
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_barrier
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_blended_overlay
|
||||
#define GLX_BLENDED_RGBA_SGIS 0x8025
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_shared_multisample
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SUN_get_transparent_index
|
||||
#endif
|
||||
|
||||
#ifndef GLX_3DFX_multisample
|
||||
#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
|
||||
#define GLX_SAMPLES_3DFX 0x8051
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_copy_sub_buffer
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_pixmap_colormap
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_set_3dfx_mode
|
||||
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
|
||||
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_visual_select_group
|
||||
#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_swap_method
|
||||
#define GLX_SWAP_METHOD_OML 0x8060
|
||||
#define GLX_SWAP_EXCHANGE_OML 0x8061
|
||||
#define GLX_SWAP_COPY_OML 0x8062
|
||||
#define GLX_SWAP_UNDEFINED_OML 0x8063
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_sync_control
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_float_buffer
|
||||
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_hyperpipe
|
||||
#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
|
||||
#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
|
||||
#define GLX_BAD_HYPERPIPE_SGIX 92
|
||||
#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
|
||||
#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
|
||||
#define GLX_PIPE_RECT_SGIX 0x00000001
|
||||
#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
|
||||
#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
|
||||
#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
|
||||
#define GLX_HYPERPIPE_ID_SGIX 0x8030
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_agp_offset
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_fbconfig_packed_float
|
||||
#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
|
||||
#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_framebuffer_sRGB
|
||||
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_texture_from_pixmap
|
||||
#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
|
||||
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
|
||||
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
|
||||
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
|
||||
#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
|
||||
#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
|
||||
#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
|
||||
#define GLX_Y_INVERTED_EXT 0x20D4
|
||||
#define GLX_TEXTURE_FORMAT_EXT 0x20D5
|
||||
#define GLX_TEXTURE_TARGET_EXT 0x20D6
|
||||
#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
|
||||
#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
|
||||
#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
|
||||
#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
|
||||
#define GLX_TEXTURE_1D_EXT 0x20DB
|
||||
#define GLX_TEXTURE_2D_EXT 0x20DC
|
||||
#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
|
||||
#define GLX_FRONT_LEFT_EXT 0x20DE
|
||||
#define GLX_FRONT_RIGHT_EXT 0x20DF
|
||||
#define GLX_BACK_LEFT_EXT 0x20E0
|
||||
#define GLX_BACK_RIGHT_EXT 0x20E1
|
||||
#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
|
||||
#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
|
||||
#define GLX_AUX0_EXT 0x20E2
|
||||
#define GLX_AUX1_EXT 0x20E3
|
||||
#define GLX_AUX2_EXT 0x20E4
|
||||
#define GLX_AUX3_EXT 0x20E5
|
||||
#define GLX_AUX4_EXT 0x20E6
|
||||
#define GLX_AUX5_EXT 0x20E7
|
||||
#define GLX_AUX6_EXT 0x20E8
|
||||
#define GLX_AUX7_EXT 0x20E9
|
||||
#define GLX_AUX8_EXT 0x20EA
|
||||
#define GLX_AUX9_EXT 0x20EB
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
typedef void (*__GLXextFuncPtr)(void);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
typedef XID GLXVideoSourceSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
typedef XID GLXFBConfigIDSGIX;
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
typedef XID GLXPbufferSGIX;
|
||||
typedef struct {
|
||||
int type;
|
||||
unsigned long serial; /* # of last request processed by server */
|
||||
Bool send_event; /* true if this came for SendEvent request */
|
||||
Display *display; /* display the event was read from */
|
||||
GLXDrawable drawable; /* i.d. of Drawable */
|
||||
int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
|
||||
int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
|
||||
unsigned int mask; /* mask indicating which buffers are affected*/
|
||||
int x, y;
|
||||
int width, height;
|
||||
int count; /* if nonzero, at least this many more */
|
||||
} GLXBufferClobberEventSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLEXT_64_TYPES_DEFINED
|
||||
/* This code block is duplicated in glxext.h, so must be protected */
|
||||
#define GLEXT_64_TYPES_DEFINED
|
||||
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
|
||||
/* (as used in the GLX_OML_sync_control extension). */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#include <inttypes.h>
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
#include <inttypes.h>
|
||||
#if defined(__STDC__)
|
||||
#if defined(__arch64__)
|
||||
typedef long int int64_t;
|
||||
typedef unsigned long int uint64_t;
|
||||
#else
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#endif /* __STDC__ */
|
||||
#elif defined( __VMS )
|
||||
#include <inttypes.h>
|
||||
#elif defined(__SCO__) || defined(__USLC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(__UNIXOS2__) || defined(__SOL64__)
|
||||
typedef long int int32_t;
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#elif defined(_WIN32) && defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(_WIN32)
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
#include <inttypes.h> /* Fallback option */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_VERSION_1_3 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *);
|
||||
extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *);
|
||||
extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *);
|
||||
extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig);
|
||||
extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *);
|
||||
extern void glXDestroyWindow (Display *, GLXWindow);
|
||||
extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *);
|
||||
extern void glXDestroyPixmap (Display *, GLXPixmap);
|
||||
extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *);
|
||||
extern void glXDestroyPbuffer (Display *, GLXPbuffer);
|
||||
extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *);
|
||||
extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool);
|
||||
extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext);
|
||||
extern GLXDrawable glXGetCurrentReadDrawable (void);
|
||||
extern Display * glXGetCurrentDisplay (void);
|
||||
extern int glXQueryContext (Display *, GLXContext, int, int *);
|
||||
extern void glXSelectEvent (Display *, GLXDrawable, unsigned long);
|
||||
extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
|
||||
typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
|
||||
typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
|
||||
typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
|
||||
typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
|
||||
typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_VERSION_1_4
|
||||
#define GLX_VERSION_1_4 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#define GLX_ARB_get_proc_address 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_multisample
|
||||
#define GLX_ARB_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_fbconfig_float
|
||||
#define GLX_ARB_fbconfig_float 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_multisample
|
||||
#define GLX_SGIS_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_info
|
||||
#define GLX_EXT_visual_info 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_swap_control
|
||||
#define GLX_SGI_swap_control 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXSwapIntervalSGI (int);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_video_sync
|
||||
#define GLX_SGI_video_sync 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXGetVideoSyncSGI (unsigned int *);
|
||||
extern int glXWaitVideoSyncSGI (int, int, unsigned int *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
|
||||
typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_make_current_read
|
||||
#define GLX_SGI_make_current_read 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext);
|
||||
extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
#define GLX_SGIX_video_source 1
|
||||
#ifdef _VL_H
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode);
|
||||
extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
|
||||
typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
|
||||
#endif /* _VL_H */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_rating
|
||||
#define GLX_EXT_visual_rating 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_import_context
|
||||
#define GLX_EXT_import_context 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Display * glXGetCurrentDisplayEXT (void);
|
||||
extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *);
|
||||
extern GLXContextID glXGetContextIDEXT (const GLXContext);
|
||||
extern GLXContext glXImportContextEXT (Display *, GLXContextID);
|
||||
extern void glXFreeContextEXT (Display *, GLXContext);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
|
||||
typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
|
||||
typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
|
||||
typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
|
||||
typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
#define GLX_SGIX_fbconfig 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *);
|
||||
extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *);
|
||||
extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap);
|
||||
extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
|
||||
extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX);
|
||||
extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
|
||||
typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
|
||||
typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
|
||||
typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
|
||||
typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
#define GLX_SGIX_pbuffer 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
|
||||
extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX);
|
||||
extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *);
|
||||
extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long);
|
||||
extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
|
||||
typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
|
||||
typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
|
||||
typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_cushion
|
||||
#define GLX_SGI_cushion 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXCushionSGI (Display *, Window, float);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_resize
|
||||
#define GLX_SGIX_video_resize 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXBindChannelToWindowSGIX (Display *, int, int, Window);
|
||||
extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int);
|
||||
extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *);
|
||||
extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *);
|
||||
extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
|
||||
typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
|
||||
typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
|
||||
typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
|
||||
typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_dmbuffer
|
||||
#define GLX_SGIX_dmbuffer 1
|
||||
#ifdef _DM_BUFFER_H_
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
|
||||
#endif /* _DM_BUFFER_H_ */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_group
|
||||
#define GLX_SGIX_swap_group 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_barrier
|
||||
#define GLX_SGIX_swap_barrier 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int);
|
||||
extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
|
||||
typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SUN_get_transparent_index
|
||||
#define GLX_SUN_get_transparent_index 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_copy_sub_buffer
|
||||
#define GLX_MESA_copy_sub_buffer 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_pixmap_colormap
|
||||
#define GLX_MESA_pixmap_colormap 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
#define GLX_MESA_release_buffers 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_set_3dfx_mode
|
||||
#define GLX_MESA_set_3dfx_mode 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXSet3DfxModeMESA (int);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_visual_select_group
|
||||
#define GLX_SGIX_visual_select_group 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_swap_method
|
||||
#define GLX_OML_swap_method 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_sync_control
|
||||
#define GLX_OML_sync_control 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
|
||||
extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
|
||||
extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t);
|
||||
extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *);
|
||||
extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
|
||||
typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
|
||||
typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_float_buffer
|
||||
#define GLX_NV_float_buffer 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_hyperpipe
|
||||
#define GLX_SGIX_hyperpipe 1
|
||||
|
||||
typedef struct {
|
||||
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
|
||||
int networkId;
|
||||
} GLXHyperpipeNetworkSGIX;
|
||||
|
||||
typedef struct {
|
||||
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
|
||||
int channel;
|
||||
unsigned int
|
||||
participationType;
|
||||
int timeSlice;
|
||||
} GLXHyperpipeConfigSGIX;
|
||||
|
||||
typedef struct {
|
||||
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
|
||||
int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
|
||||
int destXOrigin, destYOrigin, destWidth, destHeight;
|
||||
} GLXPipeRect;
|
||||
|
||||
typedef struct {
|
||||
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
|
||||
int XOrigin, YOrigin, maxHeight, maxWidth;
|
||||
} GLXPipeRectLimits;
|
||||
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *);
|
||||
extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *);
|
||||
extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *);
|
||||
extern int glXDestroyHyperpipeConfigSGIX (Display *, int);
|
||||
extern int glXBindHyperpipeSGIX (Display *, int);
|
||||
extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *);
|
||||
extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *);
|
||||
extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
|
||||
typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
|
||||
typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
|
||||
typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
|
||||
typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
|
||||
typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
|
||||
typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
|
||||
typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_agp_offset
|
||||
#define GLX_MESA_agp_offset 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern unsigned int glXGetAGPOffsetMESA (const void *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_fbconfig_packed_float
|
||||
#define GLX_EXT_fbconfig_packed_float 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_framebuffer_sRGB
|
||||
#define GLX_EXT_framebuffer_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_texture_from_pixmap
|
||||
#define GLX_EXT_texture_from_pixmap 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXBindTexImageEXT (Display *, GLXDrawable, int, const int *);
|
||||
extern void glXReleaseTexImageEXT (Display *, GLXDrawable, int);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
|
||||
typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,128 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
/* prototypes for the Mesa WGL functions */
|
||||
/* relocated here so that I could make GLUT get them properly */
|
||||
|
||||
#ifndef _mesa_wgl_h_
|
||||
#define _mesa_wgl_h_
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
# define __W32API_USE_DLLIMPORT__
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef WGLAPI
|
||||
#define WGLAPI GLAPI
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN 1
|
||||
# endif
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
|
||||
#ifndef _GNU_H_WINDOWS32_FUNCTIONS
|
||||
# ifdef UNICODE
|
||||
# define wglUseFontBitmaps wglUseFontBitmapsW
|
||||
# define wglUseFontOutlines wglUseFontOutlinesW
|
||||
# else
|
||||
# define wglUseFontBitmaps wglUseFontBitmapsA
|
||||
# define wglUseFontOutlines wglUseFontOutlinesA
|
||||
# endif /* !UNICODE */
|
||||
#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
|
||||
typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
|
||||
typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
|
||||
typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( disable : 4615 ) /* pragma warning : unknown user warning type*/
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
|
||||
#endif
|
||||
|
||||
|
||||
WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
|
||||
WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
|
||||
|
||||
WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
|
||||
WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
|
||||
WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
|
||||
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
|
||||
WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
|
||||
WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
|
||||
WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
|
||||
WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
|
||||
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
|
||||
WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
|
||||
WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
|
||||
WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
|
||||
WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
|
||||
WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
|
||||
WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
|
||||
|
||||
#ifndef __MINGW32__
|
||||
WGLAPI int GLAPIENTRY SwapBuffers(HDC);
|
||||
WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
|
||||
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
|
||||
WGLAPI const char * GLAPIENTRY wglGetExtensionsStringARB(HDC hdc);
|
||||
|
||||
#endif /* WGL_ARB_extensions_string */
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _mesa_wgl_h_ */
|
||||
@@ -1,289 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Mesa Off-Screen rendering interface.
|
||||
*
|
||||
* This is an operating system and window system independent interface to
|
||||
* Mesa which allows one to render images into a client-supplied buffer in
|
||||
* main memory. Such images may manipulated or saved in whatever way the
|
||||
* client wants.
|
||||
*
|
||||
* These are the API functions:
|
||||
* OSMesaCreateContext - create a new Off-Screen Mesa rendering context
|
||||
* OSMesaMakeCurrent - bind an OSMesaContext to a client's image buffer
|
||||
* and make the specified context the current one.
|
||||
* OSMesaDestroyContext - destroy an OSMesaContext
|
||||
* OSMesaGetCurrentContext - return thread's current context ID
|
||||
* OSMesaPixelStore - controls how pixels are stored in image buffer
|
||||
* OSMesaGetIntegerv - return OSMesa state parameters
|
||||
*
|
||||
*
|
||||
* The limits on the width and height of an image buffer are MAX_WIDTH and
|
||||
* MAX_HEIGHT as defined in Mesa/src/config.h. Defaults are 1280 and 1024.
|
||||
* You can increase them as needed but beware that many temporary arrays in
|
||||
* Mesa are dimensioned by MAX_WIDTH or MAX_HEIGHT.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef OSMESA_H
|
||||
#define OSMESA_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
||||
#define OSMESA_MAJOR_VERSION 6
|
||||
#define OSMESA_MINOR_VERSION 5
|
||||
#define OSMESA_PATCH_VERSION 0
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Values for the format parameter of OSMesaCreateContext()
|
||||
* New in version 2.0.
|
||||
*/
|
||||
#define OSMESA_COLOR_INDEX GL_COLOR_INDEX
|
||||
#define OSMESA_RGBA GL_RGBA
|
||||
#define OSMESA_BGRA 0x1
|
||||
#define OSMESA_ARGB 0x2
|
||||
#define OSMESA_RGB GL_RGB
|
||||
#define OSMESA_BGR 0x4
|
||||
#define OSMESA_RGB_565 0x5
|
||||
|
||||
|
||||
/*
|
||||
* OSMesaPixelStore() parameters:
|
||||
* New in version 2.0.
|
||||
*/
|
||||
#define OSMESA_ROW_LENGTH 0x10
|
||||
#define OSMESA_Y_UP 0x11
|
||||
|
||||
|
||||
/*
|
||||
* Accepted by OSMesaGetIntegerv:
|
||||
*/
|
||||
#define OSMESA_WIDTH 0x20
|
||||
#define OSMESA_HEIGHT 0x21
|
||||
#define OSMESA_FORMAT 0x22
|
||||
#define OSMESA_TYPE 0x23
|
||||
#define OSMESA_MAX_WIDTH 0x24 /* new in 4.0 */
|
||||
#define OSMESA_MAX_HEIGHT 0x25 /* new in 4.0 */
|
||||
|
||||
|
||||
typedef struct osmesa_context *OSMesaContext;
|
||||
|
||||
|
||||
#if defined(__BEOS__) || defined(__QUICKDRAW__)
|
||||
#pragma export on
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Create an Off-Screen Mesa rendering context. The only attribute needed is
|
||||
* an RGBA vs Color-Index mode flag.
|
||||
*
|
||||
* Input: format - one of OSMESA_COLOR_INDEX, OSMESA_RGBA, OSMESA_BGRA,
|
||||
* OSMESA_ARGB, OSMESA_RGB, or OSMESA_BGR.
|
||||
* sharelist - specifies another OSMesaContext with which to share
|
||||
* display lists. NULL indicates no sharing.
|
||||
* Return: an OSMesaContext or 0 if error
|
||||
*/
|
||||
GLAPI OSMesaContext GLAPIENTRY
|
||||
OSMesaCreateContext( GLenum format, OSMesaContext sharelist );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Create an Off-Screen Mesa rendering context and specify desired
|
||||
* size of depth buffer, stencil buffer and accumulation buffer.
|
||||
* If you specify zero for depthBits, stencilBits, accumBits you
|
||||
* can save some memory.
|
||||
*
|
||||
* New in Mesa 3.5
|
||||
*/
|
||||
GLAPI OSMesaContext GLAPIENTRY
|
||||
OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
|
||||
GLint accumBits, OSMesaContext sharelist);
|
||||
|
||||
|
||||
/*
|
||||
* Destroy an Off-Screen Mesa rendering context.
|
||||
*
|
||||
* Input: ctx - the context to destroy
|
||||
*/
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaDestroyContext( OSMesaContext ctx );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Bind an OSMesaContext to an image buffer. The image buffer is just a
|
||||
* block of memory which the client provides. Its size must be at least
|
||||
* as large as width*height*sizeof(type). Its address should be a multiple
|
||||
* of 4 if using RGBA mode.
|
||||
*
|
||||
* Image data is stored in the order of glDrawPixels: row-major order
|
||||
* with the lower-left image pixel stored in the first array position
|
||||
* (ie. bottom-to-top).
|
||||
*
|
||||
* Since the only type initially supported is GL_UNSIGNED_BYTE, if the
|
||||
* context is in RGBA mode, each pixel will be stored as a 4-byte RGBA
|
||||
* value. If the context is in color indexed mode, each pixel will be
|
||||
* stored as a 1-byte value.
|
||||
*
|
||||
* If the context's viewport hasn't been initialized yet, it will now be
|
||||
* initialized to (0,0,width,height).
|
||||
*
|
||||
* Input: ctx - the rendering context
|
||||
* buffer - the image buffer memory
|
||||
* type - data type for pixel components, only GL_UNSIGNED_BYTE
|
||||
* supported now
|
||||
* width, height - size of image buffer in pixels, at least 1
|
||||
* Return: GL_TRUE if success, GL_FALSE if error because of invalid ctx,
|
||||
* invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1,
|
||||
* width>internal limit or height>internal limit.
|
||||
*/
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type,
|
||||
GLsizei width, GLsizei height );
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Return the current Off-Screen Mesa rendering context handle.
|
||||
*/
|
||||
GLAPI OSMesaContext GLAPIENTRY
|
||||
OSMesaGetCurrentContext( void );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Set pixel store/packing parameters for the current context.
|
||||
* This is similar to glPixelStore.
|
||||
* Input: pname - OSMESA_ROW_LENGTH
|
||||
* specify actual pixels per row in image buffer
|
||||
* 0 = same as image width (default)
|
||||
* OSMESA_Y_UP
|
||||
* zero = Y coordinates increase downward
|
||||
* non-zero = Y coordinates increase upward (default)
|
||||
* value - the value for the parameter pname
|
||||
*
|
||||
* New in version 2.0.
|
||||
*/
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaPixelStore( GLint pname, GLint value );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Return an integer value like glGetIntegerv.
|
||||
* Input: pname -
|
||||
* OSMESA_WIDTH return current image width
|
||||
* OSMESA_HEIGHT return current image height
|
||||
* OSMESA_FORMAT return image format
|
||||
* OSMESA_TYPE return color component data type
|
||||
* OSMESA_ROW_LENGTH return row length in pixels
|
||||
* OSMESA_Y_UP returns 1 or 0 to indicate Y axis direction
|
||||
* value - pointer to integer in which to return result.
|
||||
*/
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaGetIntegerv( GLint pname, GLint *value );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Return the depth buffer associated with an OSMesa context.
|
||||
* Input: c - the OSMesa context
|
||||
* Output: width, height - size of buffer in pixels
|
||||
* bytesPerValue - bytes per depth value (2 or 4)
|
||||
* buffer - pointer to depth buffer values
|
||||
* Return: GL_TRUE or GL_FALSE to indicate success or failure.
|
||||
*
|
||||
* New in Mesa 2.4.
|
||||
*/
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height,
|
||||
GLint *bytesPerValue, void **buffer );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Return the color buffer associated with an OSMesa context.
|
||||
* Input: c - the OSMesa context
|
||||
* Output: width, height - size of buffer in pixels
|
||||
* format - buffer format (OSMESA_FORMAT)
|
||||
* buffer - pointer to depth buffer values
|
||||
* Return: GL_TRUE or GL_FALSE to indicate success or failure.
|
||||
*
|
||||
* New in Mesa 3.3.
|
||||
*/
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height,
|
||||
GLint *format, void **buffer );
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This typedef is new in Mesa 6.3.
|
||||
*/
|
||||
typedef void (*OSMESAproc)();
|
||||
|
||||
|
||||
/*
|
||||
* Return pointer to the named function.
|
||||
* New in Mesa 4.1
|
||||
* Return OSMESAproc in 6.3.
|
||||
*/
|
||||
GLAPI OSMESAproc GLAPIENTRY
|
||||
OSMesaGetProcAddress( const char *funcName );
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Enable/disable color clamping, off by default.
|
||||
* New in Mesa 6.4.2
|
||||
*/
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaColorClamp(GLboolean enable);
|
||||
|
||||
|
||||
#if defined(__BEOS__) || defined(__QUICKDRAW__)
|
||||
#pragma export off
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Main include header for the SDL library */
|
||||
|
||||
#ifndef _SDL_H
|
||||
#define _SDL_H
|
||||
|
||||
#include "SDL_main.h"
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_cdrom.h"
|
||||
#include "SDL_cpuinfo.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_loadso.h"
|
||||
#include "SDL_mutex.h"
|
||||
#include "SDL_rwops.h"
|
||||
#include "SDL_thread.h"
|
||||
#include "SDL_timer.h"
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_version.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* As of version 0.5, SDL is loaded dynamically into the application */
|
||||
|
||||
/* These are the flags which may be passed to SDL_Init() -- you should
|
||||
specify the subsystems which you will be using in your application.
|
||||
*/
|
||||
#define SDL_INIT_TIMER 0x00000001
|
||||
#define SDL_INIT_AUDIO 0x00000010
|
||||
#define SDL_INIT_VIDEO 0x00000020
|
||||
#define SDL_INIT_CDROM 0x00000100
|
||||
#define SDL_INIT_JOYSTICK 0x00000200
|
||||
#define SDL_INIT_NOPARACHUTE 0x00100000 /* Don't catch fatal signals */
|
||||
#define SDL_INIT_EVENTTHREAD 0x01000000 /* Not supported on all OS's */
|
||||
#define SDL_INIT_EVERYTHING 0x0000FFFF
|
||||
|
||||
/* This function loads the SDL dynamically linked library and initializes
|
||||
* the subsystems specified by 'flags' (and those satisfying dependencies)
|
||||
* Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
|
||||
* signal handlers for some commonly ignored fatal signals (like SIGSEGV)
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
|
||||
|
||||
/* This function initializes specific SDL subsystems */
|
||||
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
|
||||
|
||||
/* This function cleans up specific SDL subsystems */
|
||||
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
|
||||
|
||||
/* This function returns mask of the specified subsystems which have
|
||||
been initialized.
|
||||
If 'flags' is 0, it returns a mask of all initialized subsystems.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
|
||||
|
||||
/* This function cleans up all initialized subsystems and unloads the
|
||||
* dynamically linked library. You should call it upon all exit conditions.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_Quit(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_H */
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Include file for SDL application focus event handling */
|
||||
|
||||
#ifndef _SDL_active_h
|
||||
#define _SDL_active_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* The available application states */
|
||||
#define SDL_APPMOUSEFOCUS 0x01 /* The app has mouse coverage */
|
||||
#define SDL_APPINPUTFOCUS 0x02 /* The app has input focus */
|
||||
#define SDL_APPACTIVE 0x04 /* The application is active */
|
||||
|
||||
/* Function prototypes */
|
||||
/*
|
||||
* This function returns the current state of the application, which is a
|
||||
* bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
|
||||
* SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
|
||||
* see your application, otherwise it has been iconified or disabled.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_active_h */
|
||||
@@ -1,253 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Access to the raw audio mixing buffer for the SDL library */
|
||||
|
||||
#ifndef _SDL_audio_h
|
||||
#define _SDL_audio_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_mutex.h"
|
||||
#include "SDL_thread.h"
|
||||
#include "SDL_rwops.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* The calculated values in this structure are calculated by SDL_OpenAudio() */
|
||||
typedef struct SDL_AudioSpec {
|
||||
int freq; /* DSP frequency -- samples per second */
|
||||
Uint16 format; /* Audio data format */
|
||||
Uint8 channels; /* Number of channels: 1 mono, 2 stereo */
|
||||
Uint8 silence; /* Audio buffer silence value (calculated) */
|
||||
Uint16 samples; /* Audio buffer size in samples (power of 2) */
|
||||
Uint16 padding; /* Necessary for some compile environments */
|
||||
Uint32 size; /* Audio buffer size in bytes (calculated) */
|
||||
/* This function is called when the audio device needs more data.
|
||||
'stream' is a pointer to the audio data buffer
|
||||
'len' is the length of that buffer in bytes.
|
||||
Once the callback returns, the buffer will no longer be valid.
|
||||
Stereo samples are stored in a LRLRLR ordering.
|
||||
*/
|
||||
void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);
|
||||
void *userdata;
|
||||
} SDL_AudioSpec;
|
||||
|
||||
/* Audio format flags (defaults to LSB byte order) */
|
||||
#define AUDIO_U8 0x0008 /* Unsigned 8-bit samples */
|
||||
#define AUDIO_S8 0x8008 /* Signed 8-bit samples */
|
||||
#define AUDIO_U16LSB 0x0010 /* Unsigned 16-bit samples */
|
||||
#define AUDIO_S16LSB 0x8010 /* Signed 16-bit samples */
|
||||
#define AUDIO_U16MSB 0x1010 /* As above, but big-endian byte order */
|
||||
#define AUDIO_S16MSB 0x9010 /* As above, but big-endian byte order */
|
||||
#define AUDIO_U16 AUDIO_U16LSB
|
||||
#define AUDIO_S16 AUDIO_S16LSB
|
||||
|
||||
/* Native audio byte ordering */
|
||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
||||
#define AUDIO_U16SYS AUDIO_U16LSB
|
||||
#define AUDIO_S16SYS AUDIO_S16LSB
|
||||
#else
|
||||
#define AUDIO_U16SYS AUDIO_U16MSB
|
||||
#define AUDIO_S16SYS AUDIO_S16MSB
|
||||
#endif
|
||||
|
||||
|
||||
/* A structure to hold a set of audio conversion filters and buffers */
|
||||
typedef struct SDL_AudioCVT {
|
||||
int needed; /* Set to 1 if conversion possible */
|
||||
Uint16 src_format; /* Source audio format */
|
||||
Uint16 dst_format; /* Target audio format */
|
||||
double rate_incr; /* Rate conversion increment */
|
||||
Uint8 *buf; /* Buffer to hold entire audio data */
|
||||
int len; /* Length of original audio buffer */
|
||||
int len_cvt; /* Length of converted audio buffer */
|
||||
int len_mult; /* buffer must be len*len_mult big */
|
||||
double len_ratio; /* Given len, final size is len*len_ratio */
|
||||
void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
|
||||
int filter_index; /* Current audio conversion function */
|
||||
} SDL_AudioCVT;
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/* These functions are used internally, and should not be used unless you
|
||||
* have a specific need to specify the audio driver you want to use.
|
||||
* You should normally use SDL_Init() or SDL_InitSubSystem().
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
|
||||
extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
|
||||
|
||||
/* This function fills the given character buffer with the name of the
|
||||
* current audio driver, and returns a pointer to it if the audio driver has
|
||||
* been initialized. It returns NULL if no driver has been initialized.
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
|
||||
|
||||
/*
|
||||
* This function opens the audio device with the desired parameters, and
|
||||
* returns 0 if successful, placing the actual hardware parameters in the
|
||||
* structure pointed to by 'obtained'. If 'obtained' is NULL, the audio
|
||||
* data passed to the callback function will be guaranteed to be in the
|
||||
* requested format, and will be automatically converted to the hardware
|
||||
* audio format if necessary. This function returns -1 if it failed
|
||||
* to open the audio device, or couldn't set up the audio thread.
|
||||
*
|
||||
* When filling in the desired audio spec structure,
|
||||
* 'desired->freq' should be the desired audio frequency in samples-per-second.
|
||||
* 'desired->format' should be the desired audio format.
|
||||
* 'desired->samples' is the desired size of the audio buffer, in samples.
|
||||
* This number should be a power of two, and may be adjusted by the audio
|
||||
* driver to a value more suitable for the hardware. Good values seem to
|
||||
* range between 512 and 8096 inclusive, depending on the application and
|
||||
* CPU speed. Smaller values yield faster response time, but can lead
|
||||
* to underflow if the application is doing heavy processing and cannot
|
||||
* fill the audio buffer in time. A stereo sample consists of both right
|
||||
* and left channels in LR ordering.
|
||||
* Note that the number of samples is directly related to time by the
|
||||
* following formula: ms = (samples*1000)/freq
|
||||
* 'desired->size' is the size in bytes of the audio buffer, and is
|
||||
* calculated by SDL_OpenAudio().
|
||||
* 'desired->silence' is the value used to set the buffer to silence,
|
||||
* and is calculated by SDL_OpenAudio().
|
||||
* 'desired->callback' should be set to a function that will be called
|
||||
* when the audio device is ready for more data. It is passed a pointer
|
||||
* to the audio buffer, and the length in bytes of the audio buffer.
|
||||
* This function usually runs in a separate thread, and so you should
|
||||
* protect data structures that it accesses by calling SDL_LockAudio()
|
||||
* and SDL_UnlockAudio() in your code.
|
||||
* 'desired->userdata' is passed as the first parameter to your callback
|
||||
* function.
|
||||
*
|
||||
* The audio device starts out playing silence when it's opened, and should
|
||||
* be enabled for playing by calling SDL_PauseAudio(0) when you are ready
|
||||
* for your audio callback function to be called. Since the audio driver
|
||||
* may modify the requested size of the audio buffer, you should allocate
|
||||
* any local mixing buffers after you open the audio device.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);
|
||||
|
||||
/*
|
||||
* Get the current audio state:
|
||||
*/
|
||||
typedef enum {
|
||||
SDL_AUDIO_STOPPED = 0,
|
||||
SDL_AUDIO_PLAYING,
|
||||
SDL_AUDIO_PAUSED
|
||||
} SDL_audiostatus;
|
||||
extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void);
|
||||
|
||||
/*
|
||||
* This function pauses and unpauses the audio callback processing.
|
||||
* It should be called with a parameter of 0 after opening the audio
|
||||
* device to start playing sound. This is so you can safely initialize
|
||||
* data for your callback function after opening the audio device.
|
||||
* Silence will be written to the audio device during the pause.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
|
||||
|
||||
/*
|
||||
* This function loads a WAVE from the data source, automatically freeing
|
||||
* that source if 'freesrc' is non-zero. For example, to load a WAVE file,
|
||||
* you could do:
|
||||
* SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
|
||||
*
|
||||
* If this function succeeds, it returns the given SDL_AudioSpec,
|
||||
* filled with the audio data format of the wave data, and sets
|
||||
* 'audio_buf' to a malloc()'d buffer containing the audio data,
|
||||
* and sets 'audio_len' to the length of that audio buffer, in bytes.
|
||||
* You need to free the audio buffer with SDL_FreeWAV() when you are
|
||||
* done with it.
|
||||
*
|
||||
* This function returns NULL and sets the SDL error message if the
|
||||
* wave file cannot be opened, uses an unknown data format, or is
|
||||
* corrupt. Currently raw and MS-ADPCM WAVE files are supported.
|
||||
*/
|
||||
extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
|
||||
|
||||
/* Compatibility convenience function -- loads a WAV from a file */
|
||||
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
|
||||
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
|
||||
|
||||
/*
|
||||
* This function frees data previously allocated with SDL_LoadWAV_RW()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf);
|
||||
|
||||
/*
|
||||
* This function takes a source format and rate and a destination format
|
||||
* and rate, and initializes the 'cvt' structure with information needed
|
||||
* by SDL_ConvertAudio() to convert a buffer of audio data from one format
|
||||
* to the other.
|
||||
* This function returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
|
||||
Uint16 src_format, Uint8 src_channels, int src_rate,
|
||||
Uint16 dst_format, Uint8 dst_channels, int dst_rate);
|
||||
|
||||
/* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
|
||||
* created an audio buffer cvt->buf, and filled it with cvt->len bytes of
|
||||
* audio data in the source format, this function will convert it in-place
|
||||
* to the desired format.
|
||||
* The data conversion may expand the size of the audio data, so the buffer
|
||||
* cvt->buf should be allocated after the cvt structure is initialized by
|
||||
* SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt);
|
||||
|
||||
/*
|
||||
* This takes two audio buffers of the playing audio format and mixes
|
||||
* them, performing addition, volume adjustment, and overflow clipping.
|
||||
* The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
|
||||
* for full audio volume. Note this does not change hardware volume.
|
||||
* This is provided for convenience -- you can mix your own audio data.
|
||||
*/
|
||||
#define SDL_MIX_MAXVOLUME 128
|
||||
extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume);
|
||||
|
||||
/*
|
||||
* The lock manipulated by these functions protects the callback function.
|
||||
* During a LockAudio/UnlockAudio pair, you can be guaranteed that the
|
||||
* callback function is not running. Do not call these from the callback
|
||||
* function or you will cause deadlock.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockAudio(void);
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
|
||||
|
||||
/*
|
||||
* This function shuts down audio processing and closes the audio device.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_audio_h */
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* DEPRECATED */
|
||||
#include "SDL_endian.h"
|
||||
@@ -1,171 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* This is the CD-audio control API for Simple DirectMedia Layer */
|
||||
|
||||
#ifndef _SDL_cdrom_h
|
||||
#define _SDL_cdrom_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* In order to use these functions, SDL_Init() must have been called
|
||||
with the SDL_INIT_CDROM flag. This causes SDL to scan the system
|
||||
for CD-ROM drives, and load appropriate drivers.
|
||||
*/
|
||||
|
||||
/* The maximum number of CD-ROM tracks on a disk */
|
||||
#define SDL_MAX_TRACKS 99
|
||||
|
||||
/* The types of CD-ROM track possible */
|
||||
#define SDL_AUDIO_TRACK 0x00
|
||||
#define SDL_DATA_TRACK 0x04
|
||||
|
||||
/* The possible states which a CD-ROM drive can be in. */
|
||||
typedef enum {
|
||||
CD_TRAYEMPTY,
|
||||
CD_STOPPED,
|
||||
CD_PLAYING,
|
||||
CD_PAUSED,
|
||||
CD_ERROR = -1
|
||||
} CDstatus;
|
||||
|
||||
/* Given a status, returns true if there's a disk in the drive */
|
||||
#define CD_INDRIVE(status) ((int)(status) > 0)
|
||||
|
||||
typedef struct SDL_CDtrack {
|
||||
Uint8 id; /* Track number */
|
||||
Uint8 type; /* Data or audio track */
|
||||
Uint16 unused;
|
||||
Uint32 length; /* Length, in frames, of this track */
|
||||
Uint32 offset; /* Offset, in frames, from start of disk */
|
||||
} SDL_CDtrack;
|
||||
|
||||
/* This structure is only current as of the last call to SDL_CDStatus() */
|
||||
typedef struct SDL_CD {
|
||||
int id; /* Private drive identifier */
|
||||
CDstatus status; /* Current drive status */
|
||||
|
||||
/* The rest of this structure is only valid if there's a CD in drive */
|
||||
int numtracks; /* Number of tracks on disk */
|
||||
int cur_track; /* Current track position */
|
||||
int cur_frame; /* Current frame offset within current track */
|
||||
SDL_CDtrack track[SDL_MAX_TRACKS+1];
|
||||
} SDL_CD;
|
||||
|
||||
/* Conversion functions from frames to Minute/Second/Frames and vice versa */
|
||||
#define CD_FPS 75
|
||||
#define FRAMES_TO_MSF(f, M,S,F) { \
|
||||
int value = f; \
|
||||
*(F) = value%CD_FPS; \
|
||||
value /= CD_FPS; \
|
||||
*(S) = value%60; \
|
||||
value /= 60; \
|
||||
*(M) = value; \
|
||||
}
|
||||
#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
|
||||
|
||||
/* CD-audio API functions: */
|
||||
|
||||
/* Returns the number of CD-ROM drives on the system, or -1 if
|
||||
SDL_Init() has not been called with the SDL_INIT_CDROM flag.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
|
||||
|
||||
/* Returns a human-readable, system-dependent identifier for the CD-ROM.
|
||||
Example:
|
||||
"/dev/cdrom"
|
||||
"E:"
|
||||
"/dev/disk/ide/1/master"
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
|
||||
|
||||
/* Opens a CD-ROM drive for access. It returns a drive handle on success,
|
||||
or NULL if the drive was invalid or busy. This newly opened CD-ROM
|
||||
becomes the default CD used when other CD functions are passed a NULL
|
||||
CD-ROM handle.
|
||||
Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.
|
||||
*/
|
||||
extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
|
||||
|
||||
/* This function returns the current status of the given drive.
|
||||
If the drive has a CD in it, the table of contents of the CD and current
|
||||
play position of the CD will be stored in the SDL_CD structure.
|
||||
*/
|
||||
extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
|
||||
|
||||
/* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
|
||||
tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
|
||||
until the end of the CD. This function will skip data tracks.
|
||||
This function should only be called after calling SDL_CDStatus() to
|
||||
get track information about the CD.
|
||||
For example:
|
||||
// Play entire CD:
|
||||
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
|
||||
SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
|
||||
// Play last track:
|
||||
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
|
||||
SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
|
||||
}
|
||||
// Play first and second track and 10 seconds of third track:
|
||||
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
|
||||
SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
|
||||
|
||||
This function returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
|
||||
int start_track, int start_frame, int ntracks, int nframes);
|
||||
|
||||
/* Play the given CD starting at 'start' frame for 'length' frames.
|
||||
It returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
|
||||
|
||||
/* Pause play -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
|
||||
|
||||
/* Resume play -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
|
||||
|
||||
/* Stop play -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
|
||||
|
||||
/* Eject CD-ROM -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
|
||||
|
||||
/* Closes the handle for the CD-ROM drive */
|
||||
extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_video_h */
|
||||
@@ -1,307 +0,0 @@
|
||||
/* include/SDL_config.h. Generated by configure. */
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_h
|
||||
#define _SDL_config_h
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
/* General platform specific identifiers */
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* Make sure that this isn't included by Visual C++ */
|
||||
#ifdef _MSC_VER
|
||||
#error You should copy include/SDL_config.h.default to include/SDL_config.h
|
||||
#endif
|
||||
|
||||
/* C language features */
|
||||
/* #undef const */
|
||||
/* #undef inline */
|
||||
/* #undef volatile */
|
||||
|
||||
/* C datatypes */
|
||||
/* #undef size_t */
|
||||
/* #undef int8_t */
|
||||
/* #undef uint8_t */
|
||||
/* #undef int16_t */
|
||||
/* #undef uint16_t */
|
||||
/* #undef int32_t */
|
||||
/* #undef uint32_t */
|
||||
/* #undef int64_t */
|
||||
/* #undef uint64_t */
|
||||
/* #undef uintptr_t */
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Endianness */
|
||||
#define SDL_BYTEORDER 1234
|
||||
|
||||
/* Comment this if you want to build without any C library requirements */
|
||||
#define HAVE_LIBC 1
|
||||
#if HAVE_LIBC
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#undef HAVE_STDLIB_H
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_ICONV_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
/* #undef HAVE_ALTIVEC_H */
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#endif
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
/* #undef HAVE_STRLCPY */
|
||||
/* #undef HAVE_STRLCAT */
|
||||
#define HAVE_STRDUP 1
|
||||
/* #undef HAVE__STRREV */
|
||||
/* #undef HAVE__STRUPR */
|
||||
/* #undef HAVE__STRLWR */
|
||||
/* #undef HAVE_INDEX */
|
||||
/* #undef HAVE_RINDEX */
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
/* #undef HAVE_ITOA */
|
||||
/* #undef HAVE__LTOA */
|
||||
/* #undef HAVE__UITOA */
|
||||
/* #undef HAVE__ULTOA */
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
/* #undef HAVE__I64TOA */
|
||||
/* #undef HAVE__UI64TOA */
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
/* #undef HAVE__STRICMP */
|
||||
#define HAVE_STRCASECMP 1
|
||||
/* #undef HAVE__STRNICMP */
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_ICONV 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
/* #undef HAVE_CLOCK_GETTIME */
|
||||
#define HAVE_DLVSYM 1
|
||||
#define HAVE_GETPAGESIZE 1
|
||||
|
||||
#else
|
||||
/* We may need some replacement for stdarg.h here */
|
||||
#include <stdarg.h>
|
||||
#endif /* HAVE_LIBC */
|
||||
|
||||
/* Allow disabling of core subsystems */
|
||||
/* #undef SDL_AUDIO_DISABLED */
|
||||
/* #undef SDL_CDROM_DISABLED */
|
||||
/* #undef SDL_CPUINFO_DISABLED */
|
||||
/* #undef SDL_EVENTS_DISABLED */
|
||||
/* #undef SDL_FILE_DISABLED */
|
||||
/* #undef SDL_JOYSTICK_DISABLED */
|
||||
/* #undef SDL_LOADSO_DISABLED */
|
||||
/* #undef SDL_THREADS_DISABLED */
|
||||
/* #undef SDL_TIMERS_DISABLED */
|
||||
/* #undef SDL_VIDEO_DISABLED */
|
||||
|
||||
/* Enable various audio drivers */
|
||||
/* #undef SDL_AUDIO_DRIVER_ALSA */
|
||||
/* #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC */
|
||||
/* #undef SDL_AUDIO_DRIVER_ARTS */
|
||||
/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
|
||||
/* #undef SDL_AUDIO_DRIVER_BAUDIO */
|
||||
/* #undef SDL_AUDIO_DRIVER_BSD */
|
||||
/* #undef SDL_AUDIO_DRIVER_COREAUDIO */
|
||||
/* #undef SDL_AUDIO_DRIVER_DART */
|
||||
/* #undef SDL_AUDIO_DRIVER_DC */
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
/* #undef SDL_AUDIO_DRIVER_DMEDIA */
|
||||
/* #undef SDL_AUDIO_DRIVER_DSOUND */
|
||||
/* #undef SDL_AUDIO_DRIVER_PULSE */
|
||||
/* #undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC */
|
||||
/* #undef SDL_AUDIO_DRIVER_ESD */
|
||||
/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */
|
||||
/* #undef SDL_AUDIO_DRIVER_MINT */
|
||||
/* #undef SDL_AUDIO_DRIVER_MMEAUDIO */
|
||||
/* #undef SDL_AUDIO_DRIVER_NAS */
|
||||
#define SDL_AUDIO_DRIVER_OSS 1
|
||||
/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */
|
||||
/* #undef SDL_AUDIO_DRIVER_PAUD */
|
||||
/* #undef SDL_AUDIO_DRIVER_QNXNTO */
|
||||
/* #undef SDL_AUDIO_DRIVER_SNDMGR */
|
||||
/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */
|
||||
/* #undef SDL_AUDIO_DRIVER_WAVEOUT */
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
/* #undef SDL_CDROM_AIX */
|
||||
/* #undef SDL_CDROM_BEOS */
|
||||
/* #undef SDL_CDROM_BSDI */
|
||||
/* #undef SDL_CDROM_DC */
|
||||
/* #undef SDL_CDROM_DUMMY */
|
||||
/* #undef SDL_CDROM_FREEBSD */
|
||||
#define SDL_CDROM_LINUX 1
|
||||
/* #undef SDL_CDROM_MACOS */
|
||||
/* #undef SDL_CDROM_MACOSX */
|
||||
/* #undef SDL_CDROM_MINT */
|
||||
/* #undef SDL_CDROM_OPENBSD */
|
||||
/* #undef SDL_CDROM_OS2 */
|
||||
/* #undef SDL_CDROM_OSF */
|
||||
/* #undef SDL_CDROM_QNX */
|
||||
/* #undef SDL_CDROM_WIN32 */
|
||||
|
||||
/* Enable various input drivers */
|
||||
/* #undef SDL_INPUT_TSLIB */
|
||||
/* #undef SDL_JOYSTICK_BEOS */
|
||||
/* #undef SDL_JOYSTICK_DC */
|
||||
/* #undef SDL_JOYSTICK_DUMMY */
|
||||
/* #undef SDL_JOYSTICK_IOKIT */
|
||||
#define SDL_JOYSTICK_LINUX 1
|
||||
/* #undef SDL_JOYSTICK_LINUXEV */
|
||||
/* #undef SDL_JOYSTICK_MACOS */
|
||||
/* #undef SDL_JOYSTICK_MINT */
|
||||
/* #undef SDL_JOYSTICK_OS2 */
|
||||
/* #undef SDL_JOYSTICK_RISCOS */
|
||||
/* #undef SDL_JOYSTICK_WINMM */
|
||||
/* #undef SDL_JOYSTICK_USBHID */
|
||||
/* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
/* #undef SDL_LOADSO_BEOS */
|
||||
/* #undef SDL_LOADSO_DLCOMPAT */
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
/* #undef SDL_LOADSO_DUMMY */
|
||||
/* #undef SDL_LOADSO_LDG */
|
||||
/* #undef SDL_LOADSO_MACOS */
|
||||
/* #undef SDL_LOADSO_OS2 */
|
||||
/* #undef SDL_LOADSO_WIN32 */
|
||||
|
||||
/* Enable various threading systems */
|
||||
/* #undef SDL_THREAD_BEOS */
|
||||
/* #undef SDL_THREAD_DC */
|
||||
/* #undef SDL_THREAD_OS2 */
|
||||
/* #undef SDL_THREAD_PTH */
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
||||
/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
|
||||
/* #undef SDL_THREAD_SPROC */
|
||||
/* #undef SDL_THREAD_WIN32 */
|
||||
|
||||
/* Enable various timer systems */
|
||||
/* #undef SDL_TIMER_BEOS */
|
||||
/* #undef SDL_TIMER_DC */
|
||||
/* #undef SDL_TIMER_DUMMY */
|
||||
/* #undef SDL_TIMER_MACOS */
|
||||
/* #undef SDL_TIMER_MINT */
|
||||
/* #undef SDL_TIMER_OS2 */
|
||||
/* #undef SDL_TIMER_RISCOS */
|
||||
#define SDL_TIMER_UNIX 1
|
||||
/* #undef SDL_TIMER_WIN32 */
|
||||
/* #undef SDL_TIMER_WINCE */
|
||||
|
||||
/* Enable various video drivers */
|
||||
/* #undef SDL_VIDEO_DRIVER_AALIB */
|
||||
/* #undef SDL_VIDEO_DRIVER_BWINDOW */
|
||||
/* #undef SDL_VIDEO_DRIVER_DC */
|
||||
/* #undef SDL_VIDEO_DRIVER_DDRAW */
|
||||
#define SDL_VIDEO_DRIVER_DGA 1
|
||||
/* #undef SDL_VIDEO_DRIVER_DIRECTFB */
|
||||
/* #undef SDL_VIDEO_DRIVER_DRAWSPROCKET */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_FBCON 1
|
||||
/* #undef SDL_VIDEO_DRIVER_GAPI */
|
||||
/* #undef SDL_VIDEO_DRIVER_GEM */
|
||||
/* #undef SDL_VIDEO_DRIVER_GGI */
|
||||
/* #undef SDL_VIDEO_DRIVER_IPOD */
|
||||
/* #undef SDL_VIDEO_DRIVER_NANOX */
|
||||
/* #undef SDL_VIDEO_DRIVER_OS2FS */
|
||||
/* #undef SDL_VIDEO_DRIVER_PHOTON */
|
||||
/* #undef SDL_VIDEO_DRIVER_PICOGUI */
|
||||
/* #undef SDL_VIDEO_DRIVER_PS2GS */
|
||||
/* #undef SDL_VIDEO_DRIVER_QTOPIA */
|
||||
/* #undef SDL_VIDEO_DRIVER_QUARTZ */
|
||||
/* #undef SDL_VIDEO_DRIVER_RISCOS */
|
||||
/* #undef SDL_VIDEO_DRIVER_SVGALIB */
|
||||
/* #undef SDL_VIDEO_DRIVER_TOOLBOX */
|
||||
/* #undef SDL_VIDEO_DRIVER_VGL */
|
||||
/* #undef SDL_VIDEO_DRIVER_WINDIB */
|
||||
/* #undef SDL_VIDEO_DRIVER_WSCONS */
|
||||
#define SDL_VIDEO_DRIVER_X11 1
|
||||
#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1
|
||||
#define SDL_VIDEO_DRIVER_X11_DPMS 1
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "libX11.so.6"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "libXext.so.6"
|
||||
/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR */
|
||||
/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER */
|
||||
#define SDL_VIDEO_DRIVER_X11_VIDMODE 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XME 1
|
||||
/* #undef SDL_VIDEO_DRIVER_X11_XRANDR */
|
||||
#define SDL_VIDEO_DRIVER_X11_XV 1
|
||||
/* #undef SDL_VIDEO_DRIVER_XBIOS */
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
#define SDL_VIDEO_OPENGL_GLX 1
|
||||
/* #undef SDL_VIDEO_OPENGL_WGL */
|
||||
/* #undef SDL_VIDEO_OPENGL_OSMESA */
|
||||
/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
|
||||
|
||||
/* Enable assembly routines */
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
#define SDL_HERMES_BLITTERS 1
|
||||
/* #undef SDL_ALTIVEC_BLITTERS */
|
||||
|
||||
#endif /* _SDL_config_h */
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_h
|
||||
#define _SDL_config_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* Add any platform that doesn't build using the configure system */
|
||||
#if defined(__DREAMCAST__)
|
||||
#include "SDL_config_dreamcast.h"
|
||||
#elif defined(__MACOS__)
|
||||
#include "SDL_config_macos.h"
|
||||
#elif defined(__MACOSX__)
|
||||
#include "SDL_config_macosx.h"
|
||||
#elif defined(__SYMBIAN32__)
|
||||
#include "SDL_config_symbian.h" /* must be before win32! */
|
||||
#elif defined(__WIN32__)
|
||||
#include "SDL_config_win32.h"
|
||||
#elif defined(__OS2__)
|
||||
#include "SDL_config_os2.h"
|
||||
#else
|
||||
#include "SDL_config_minimal.h"
|
||||
#endif /* platform config */
|
||||
|
||||
#endif /* _SDL_config_h */
|
||||
@@ -1,305 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_h
|
||||
#define _SDL_config_h
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
/* General platform specific identifiers */
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* Make sure that this isn't included by Visual C++ */
|
||||
#ifdef _MSC_VER
|
||||
#error You should copy include/SDL_config.h.default to include/SDL_config.h
|
||||
#endif
|
||||
|
||||
/* C language features */
|
||||
#undef const
|
||||
#undef inline
|
||||
#undef volatile
|
||||
|
||||
/* C datatypes */
|
||||
#undef size_t
|
||||
#undef int8_t
|
||||
#undef uint8_t
|
||||
#undef int16_t
|
||||
#undef uint16_t
|
||||
#undef int32_t
|
||||
#undef uint32_t
|
||||
#undef int64_t
|
||||
#undef uint64_t
|
||||
#undef uintptr_t
|
||||
#undef SDL_HAS_64BIT_TYPE
|
||||
|
||||
/* Endianness */
|
||||
#undef SDL_BYTEORDER
|
||||
|
||||
/* Comment this if you want to build without any C library requirements */
|
||||
#undef HAVE_LIBC
|
||||
#if HAVE_LIBC
|
||||
|
||||
/* Useful headers */
|
||||
#undef HAVE_ALLOCA_H
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
#undef HAVE_STDIO_H
|
||||
#undef STDC_HEADERS
|
||||
#undef HAVE_STDLIB_H
|
||||
#undef HAVE_STDARG_H
|
||||
#undef HAVE_MALLOC_H
|
||||
#undef HAVE_MEMORY_H
|
||||
#undef HAVE_STRING_H
|
||||
#undef HAVE_STRINGS_H
|
||||
#undef HAVE_INTTYPES_H
|
||||
#undef HAVE_STDINT_H
|
||||
#undef HAVE_CTYPE_H
|
||||
#undef HAVE_MATH_H
|
||||
#undef HAVE_ICONV_H
|
||||
#undef HAVE_SIGNAL_H
|
||||
#undef HAVE_ALTIVEC_H
|
||||
|
||||
/* C library functions */
|
||||
#undef HAVE_MALLOC
|
||||
#undef HAVE_CALLOC
|
||||
#undef HAVE_REALLOC
|
||||
#undef HAVE_FREE
|
||||
#undef HAVE_ALLOCA
|
||||
#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
|
||||
#undef HAVE_GETENV
|
||||
#undef HAVE_PUTENV
|
||||
#undef HAVE_UNSETENV
|
||||
#endif
|
||||
#undef HAVE_QSORT
|
||||
#undef HAVE_ABS
|
||||
#undef HAVE_BCOPY
|
||||
#undef HAVE_MEMSET
|
||||
#undef HAVE_MEMCPY
|
||||
#undef HAVE_MEMMOVE
|
||||
#undef HAVE_MEMCMP
|
||||
#undef HAVE_STRLEN
|
||||
#undef HAVE_STRLCPY
|
||||
#undef HAVE_STRLCAT
|
||||
#undef HAVE_STRDUP
|
||||
#undef HAVE__STRREV
|
||||
#undef HAVE__STRUPR
|
||||
#undef HAVE__STRLWR
|
||||
#undef HAVE_INDEX
|
||||
#undef HAVE_RINDEX
|
||||
#undef HAVE_STRCHR
|
||||
#undef HAVE_STRRCHR
|
||||
#undef HAVE_STRSTR
|
||||
#undef HAVE_ITOA
|
||||
#undef HAVE__LTOA
|
||||
#undef HAVE__UITOA
|
||||
#undef HAVE__ULTOA
|
||||
#undef HAVE_STRTOL
|
||||
#undef HAVE_STRTOUL
|
||||
#undef HAVE__I64TOA
|
||||
#undef HAVE__UI64TOA
|
||||
#undef HAVE_STRTOLL
|
||||
#undef HAVE_STRTOULL
|
||||
#undef HAVE_STRTOD
|
||||
#undef HAVE_ATOI
|
||||
#undef HAVE_ATOF
|
||||
#undef HAVE_STRCMP
|
||||
#undef HAVE_STRNCMP
|
||||
#undef HAVE__STRICMP
|
||||
#undef HAVE_STRCASECMP
|
||||
#undef HAVE__STRNICMP
|
||||
#undef HAVE_STRNCASECMP
|
||||
#undef HAVE_SSCANF
|
||||
#undef HAVE_SNPRINTF
|
||||
#undef HAVE_VSNPRINTF
|
||||
#undef HAVE_ICONV
|
||||
#undef HAVE_SIGACTION
|
||||
#undef HAVE_SETJMP
|
||||
#undef HAVE_NANOSLEEP
|
||||
#undef HAVE_CLOCK_GETTIME
|
||||
#undef HAVE_DLVSYM
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
#else
|
||||
/* We may need some replacement for stdarg.h here */
|
||||
#include <stdarg.h>
|
||||
#endif /* HAVE_LIBC */
|
||||
|
||||
/* Allow disabling of core subsystems */
|
||||
#undef SDL_AUDIO_DISABLED
|
||||
#undef SDL_CDROM_DISABLED
|
||||
#undef SDL_CPUINFO_DISABLED
|
||||
#undef SDL_EVENTS_DISABLED
|
||||
#undef SDL_FILE_DISABLED
|
||||
#undef SDL_JOYSTICK_DISABLED
|
||||
#undef SDL_LOADSO_DISABLED
|
||||
#undef SDL_THREADS_DISABLED
|
||||
#undef SDL_TIMERS_DISABLED
|
||||
#undef SDL_VIDEO_DISABLED
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#undef SDL_AUDIO_DRIVER_ALSA
|
||||
#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_ARTS
|
||||
#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_BAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_BSD
|
||||
#undef SDL_AUDIO_DRIVER_COREAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_DART
|
||||
#undef SDL_AUDIO_DRIVER_DC
|
||||
#undef SDL_AUDIO_DRIVER_DISK
|
||||
#undef SDL_AUDIO_DRIVER_DUMMY
|
||||
#undef SDL_AUDIO_DRIVER_DMEDIA
|
||||
#undef SDL_AUDIO_DRIVER_DSOUND
|
||||
#undef SDL_AUDIO_DRIVER_PULSE
|
||||
#undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_ESD
|
||||
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_MINT
|
||||
#undef SDL_AUDIO_DRIVER_MMEAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_NAS
|
||||
#undef SDL_AUDIO_DRIVER_OSS
|
||||
#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
|
||||
#undef SDL_AUDIO_DRIVER_PAUD
|
||||
#undef SDL_AUDIO_DRIVER_QNXNTO
|
||||
#undef SDL_AUDIO_DRIVER_SNDMGR
|
||||
#undef SDL_AUDIO_DRIVER_SUNAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_WAVEOUT
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#undef SDL_CDROM_AIX
|
||||
#undef SDL_CDROM_BEOS
|
||||
#undef SDL_CDROM_BSDI
|
||||
#undef SDL_CDROM_DC
|
||||
#undef SDL_CDROM_DUMMY
|
||||
#undef SDL_CDROM_FREEBSD
|
||||
#undef SDL_CDROM_LINUX
|
||||
#undef SDL_CDROM_MACOS
|
||||
#undef SDL_CDROM_MACOSX
|
||||
#undef SDL_CDROM_MINT
|
||||
#undef SDL_CDROM_OPENBSD
|
||||
#undef SDL_CDROM_OS2
|
||||
#undef SDL_CDROM_OSF
|
||||
#undef SDL_CDROM_QNX
|
||||
#undef SDL_CDROM_WIN32
|
||||
|
||||
/* Enable various input drivers */
|
||||
#undef SDL_INPUT_TSLIB
|
||||
#undef SDL_JOYSTICK_BEOS
|
||||
#undef SDL_JOYSTICK_DC
|
||||
#undef SDL_JOYSTICK_DUMMY
|
||||
#undef SDL_JOYSTICK_IOKIT
|
||||
#undef SDL_JOYSTICK_LINUX
|
||||
#undef SDL_JOYSTICK_LINUXEV
|
||||
#undef SDL_JOYSTICK_MACOS
|
||||
#undef SDL_JOYSTICK_MINT
|
||||
#undef SDL_JOYSTICK_OS2
|
||||
#undef SDL_JOYSTICK_RISCOS
|
||||
#undef SDL_JOYSTICK_WINMM
|
||||
#undef SDL_JOYSTICK_USBHID
|
||||
#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#undef SDL_LOADSO_BEOS
|
||||
#undef SDL_LOADSO_DLCOMPAT
|
||||
#undef SDL_LOADSO_DLOPEN
|
||||
#undef SDL_LOADSO_DUMMY
|
||||
#undef SDL_LOADSO_LDG
|
||||
#undef SDL_LOADSO_MACOS
|
||||
#undef SDL_LOADSO_OS2
|
||||
#undef SDL_LOADSO_WIN32
|
||||
|
||||
/* Enable various threading systems */
|
||||
#undef SDL_THREAD_BEOS
|
||||
#undef SDL_THREAD_DC
|
||||
#undef SDL_THREAD_OS2
|
||||
#undef SDL_THREAD_PTH
|
||||
#undef SDL_THREAD_PTHREAD
|
||||
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
|
||||
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
|
||||
#undef SDL_THREAD_SPROC
|
||||
#undef SDL_THREAD_WIN32
|
||||
|
||||
/* Enable various timer systems */
|
||||
#undef SDL_TIMER_BEOS
|
||||
#undef SDL_TIMER_DC
|
||||
#undef SDL_TIMER_DUMMY
|
||||
#undef SDL_TIMER_MACOS
|
||||
#undef SDL_TIMER_MINT
|
||||
#undef SDL_TIMER_OS2
|
||||
#undef SDL_TIMER_RISCOS
|
||||
#undef SDL_TIMER_UNIX
|
||||
#undef SDL_TIMER_WIN32
|
||||
#undef SDL_TIMER_WINCE
|
||||
|
||||
/* Enable various video drivers */
|
||||
#undef SDL_VIDEO_DRIVER_AALIB
|
||||
#undef SDL_VIDEO_DRIVER_BWINDOW
|
||||
#undef SDL_VIDEO_DRIVER_DC
|
||||
#undef SDL_VIDEO_DRIVER_DDRAW
|
||||
#undef SDL_VIDEO_DRIVER_DGA
|
||||
#undef SDL_VIDEO_DRIVER_DIRECTFB
|
||||
#undef SDL_VIDEO_DRIVER_DRAWSPROCKET
|
||||
#undef SDL_VIDEO_DRIVER_DUMMY
|
||||
#undef SDL_VIDEO_DRIVER_FBCON
|
||||
#undef SDL_VIDEO_DRIVER_GAPI
|
||||
#undef SDL_VIDEO_DRIVER_GEM
|
||||
#undef SDL_VIDEO_DRIVER_GGI
|
||||
#undef SDL_VIDEO_DRIVER_IPOD
|
||||
#undef SDL_VIDEO_DRIVER_NANOX
|
||||
#undef SDL_VIDEO_DRIVER_OS2FS
|
||||
#undef SDL_VIDEO_DRIVER_PHOTON
|
||||
#undef SDL_VIDEO_DRIVER_PICOGUI
|
||||
#undef SDL_VIDEO_DRIVER_PS2GS
|
||||
#undef SDL_VIDEO_DRIVER_QTOPIA
|
||||
#undef SDL_VIDEO_DRIVER_QUARTZ
|
||||
#undef SDL_VIDEO_DRIVER_RISCOS
|
||||
#undef SDL_VIDEO_DRIVER_SVGALIB
|
||||
#undef SDL_VIDEO_DRIVER_TOOLBOX
|
||||
#undef SDL_VIDEO_DRIVER_VGL
|
||||
#undef SDL_VIDEO_DRIVER_WINDIB
|
||||
#undef SDL_VIDEO_DRIVER_WSCONS
|
||||
#undef SDL_VIDEO_DRIVER_X11
|
||||
#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE
|
||||
#undef SDL_VIDEO_DRIVER_X11_DPMS
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
|
||||
#undef SDL_VIDEO_DRIVER_X11_VIDMODE
|
||||
#undef SDL_VIDEO_DRIVER_X11_XINERAMA
|
||||
#undef SDL_VIDEO_DRIVER_X11_XME
|
||||
#undef SDL_VIDEO_DRIVER_X11_XRANDR
|
||||
#undef SDL_VIDEO_DRIVER_X11_XV
|
||||
#undef SDL_VIDEO_DRIVER_XBIOS
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#undef SDL_VIDEO_OPENGL
|
||||
#undef SDL_VIDEO_OPENGL_GLX
|
||||
#undef SDL_VIDEO_OPENGL_WGL
|
||||
#undef SDL_VIDEO_OPENGL_OSMESA
|
||||
#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
|
||||
|
||||
/* Enable assembly routines */
|
||||
#undef SDL_ASSEMBLY_ROUTINES
|
||||
#undef SDL_HERMES_BLITTERS
|
||||
#undef SDL_ALTIVEC_BLITTERS
|
||||
|
||||
#endif /* _SDL_config_h */
|
||||
@@ -1,106 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_dreamcast_h
|
||||
#define _SDL_config_dreamcast_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE_INDEX 1
|
||||
#define HAVE_RINDEX 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRICMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_DC 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#define SDL_CDROM_DC 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_DC 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_DUMMY 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_DC 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_DC 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DC 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
|
||||
#endif /* _SDL_config_dreamcast_h */
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_macos_h
|
||||
#define _SDL_config_macos_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#include <MacTypes.h>
|
||||
|
||||
typedef SInt8 int8_t;
|
||||
typedef UInt8 uint8_t;
|
||||
typedef SInt16 int16_t;
|
||||
typedef UInt16 uint16_t;
|
||||
typedef SInt32 int32_t;
|
||||
typedef UInt32 uint32_t;
|
||||
typedef SInt64 int64_t;
|
||||
typedef UInt64 uint64_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_ITOA 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_SNDMGR 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#if TARGET_API_MAC_CARBON
|
||||
#define SDL_CDROM_DUMMY 1
|
||||
#else
|
||||
#define SDL_CDROM_MACOS 1
|
||||
#endif
|
||||
|
||||
/* Enable various input drivers */
|
||||
#if TARGET_API_MAC_CARBON
|
||||
#define SDL_JOYSTICK_DUMMY 1
|
||||
#else
|
||||
#define SDL_JOYSTICK_MACOS 1
|
||||
#endif
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_MACOS 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREADS_DISABLED 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_MACOS 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1
|
||||
#define SDL_VIDEO_DRIVER_TOOLBOX 1
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
|
||||
#endif /* _SDL_config_macos_h */
|
||||
@@ -1,135 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_macosx_h
|
||||
#define _SDL_config_macosx_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Useful headers */
|
||||
/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */
|
||||
#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) )
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#endif
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_COREAUDIO 1
|
||||
#define SDL_AUDIO_DRIVER_SNDMGR 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#define SDL_CDROM_MACOSX 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_IOKIT 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#ifdef __ppc__
|
||||
/* For Mac OS X 10.2 compatibility */
|
||||
#define SDL_LOADSO_DLCOMPAT 1
|
||||
#else
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
#endif
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_UNIX 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))
|
||||
#define SDL_VIDEO_DRIVER_TOOLBOX 1
|
||||
#else
|
||||
#define SDL_VIDEO_DRIVER_QUARTZ 1
|
||||
#endif
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
|
||||
/* Enable assembly routines */
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
#ifdef __ppc__
|
||||
#define SDL_ALTIVEC_BLITTERS 1
|
||||
#endif
|
||||
|
||||
#endif /* _SDL_config_macosx_h */
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_minimal_h
|
||||
#define _SDL_config_minimal_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is the minimal configuration that can be used to build SDL */
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned int size_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
|
||||
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
|
||||
#define SDL_CDROM_DISABLED 1
|
||||
|
||||
/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
|
||||
#define SDL_JOYSTICK_DISABLED 1
|
||||
|
||||
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
|
||||
#define SDL_LOADSO_DISABLED 1
|
||||
|
||||
/* Enable the stub thread support (src/thread/generic/\*.c) */
|
||||
#define SDL_THREADS_DISABLED 1
|
||||
|
||||
/* Enable the stub timer support (src/timer/dummy/\*.c) */
|
||||
#define SDL_TIMERS_DISABLED 1
|
||||
|
||||
/* Enable the dummy video driver (src/video/dummy/\*.c) */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
|
||||
#endif /* _SDL_config_minimal_h */
|
||||
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_nds_h
|
||||
#define _SDL_config_nds_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
/* General platform specific identifiers */
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* C datatypes */
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Endianness */
|
||||
#define SDL_BYTEORDER 1234
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_ICONV_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_SETJMP 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_NDS 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
|
||||
#define SDL_CDROM_DISABLED 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_NDS 1
|
||||
|
||||
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
|
||||
#define SDL_LOADSO_DISABLED 1
|
||||
|
||||
/* Enable the stub thread support (src/thread/generic/\*.c) */
|
||||
#define SDL_THREADS_DISABLED 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_NDS 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_NDS 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
|
||||
#endif /* _SDL_config_nds_h */
|
||||
@@ -1,141 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_os2_h
|
||||
#define _SDL_config_os2_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned int size_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Use Watcom's LIBC */
|
||||
#define HAVE_LIBC 1
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE__STRREV 1
|
||||
#define HAVE__STRUPR 1
|
||||
#define HAVE__STRLWR 1
|
||||
#define HAVE_INDEX 1
|
||||
#define HAVE_RINDEX 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_ITOA 1
|
||||
#define HAVE__LTOA 1
|
||||
#define HAVE__UITOA 1
|
||||
#define HAVE__ULTOA 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE__I64TOA 1
|
||||
#define HAVE__UI64TOA 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRICMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_CLOCK_GETTIME 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_DART 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#define SDL_CDROM_OS2 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_OS2 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_OS2 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_OS2 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_OS2 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_OS2FS 1
|
||||
|
||||
/* Enable OpenGL support */
|
||||
/* Nothing here yet for OS/2... :( */
|
||||
|
||||
/* Enable assembly routines where available */
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
|
||||
#endif /* _SDL_config_os2_h */
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Symbian version Markus Mertama
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SDL_CONFIG_SYMBIAN_H
|
||||
#define _SDL_CONFIG_SYMBIAN_H
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is the minimal configuration that can be used to build SDL */
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
#ifdef __GCCE__
|
||||
#define SYMBIAN32_GCCE
|
||||
#endif
|
||||
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
|
||||
#ifndef _INTPTR_T_DECLARED
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif
|
||||
|
||||
#ifndef _INT8_T_DECLARED
|
||||
typedef signed char int8_t;
|
||||
#endif
|
||||
|
||||
#ifndef _UINT8_T_DECLARED
|
||||
typedef unsigned char uint8_t;
|
||||
#endif
|
||||
|
||||
#ifndef _INT16_T_DECLARED
|
||||
typedef signed short int16_t;
|
||||
#endif
|
||||
|
||||
#ifndef _UINT16_T_DECLARED
|
||||
typedef unsigned short uint16_t;
|
||||
#endif
|
||||
|
||||
#ifndef _INT32_T_DECLARED
|
||||
typedef signed int int32_t;
|
||||
#endif
|
||||
|
||||
#ifndef _UINT32_T_DECLARED
|
||||
typedef unsigned int uint32_t;
|
||||
#endif
|
||||
|
||||
#ifndef _INT64_T_DECLARED
|
||||
typedef signed long long int64_t;
|
||||
#endif
|
||||
|
||||
#ifndef _UINT64_T_DECLARED
|
||||
typedef unsigned long long uint64_t;
|
||||
#endif
|
||||
|
||||
#define SDL_AUDIO_DRIVER_EPOCAUDIO 1
|
||||
|
||||
|
||||
/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
|
||||
#define SDL_CDROM_DISABLED 1
|
||||
|
||||
/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
|
||||
#define SDL_JOYSTICK_DISABLED 1
|
||||
|
||||
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
|
||||
#define SDL_LOADSO_DISABLED 1
|
||||
|
||||
#define SDL_THREAD_SYMBIAN 1
|
||||
|
||||
#define SDL_VIDEO_DRIVER_EPOC 1
|
||||
|
||||
#define SDL_VIDEO_OPENGL 0
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
#define HAVE_LIBC 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
//#define HAVE_ALLOCA 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE__STRUPR 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_ITOA 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
//#define HAVE__STRICMP 1
|
||||
#define HAVE__STRNICMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
|
||||
|
||||
|
||||
#endif /* _SDL_CONFIG_SYMBIAN_H */
|
||||
@@ -1,180 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_win32_h
|
||||
#define _SDL_config_win32_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#if defined(__GNUC__) || defined(__DMC__)
|
||||
#define HAVE_STDINT_H 1
|
||||
#elif defined(_MSC_VER)
|
||||
typedef signed __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#ifndef _UINTPTR_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif
|
||||
#define _UINTPTR_T_DEFINED
|
||||
#endif
|
||||
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
|
||||
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
|
||||
#define DWORD_PTR DWORD
|
||||
#endif
|
||||
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
|
||||
#define LONG_PTR LONG
|
||||
#endif
|
||||
#else /* !__GNUC__ && !_MSC_VER */
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
#ifndef _SIZE_T_DEFINED_
|
||||
#define _SIZE_T_DEFINED_
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif /* __GNUC__ || _MSC_VER */
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Enabled for SDL 1.2 (binary compatibility) */
|
||||
#define HAVE_LIBC 1
|
||||
#ifdef HAVE_LIBC
|
||||
/* Useful headers */
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#ifndef _WIN32_WCE
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#endif
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE__STRREV 1
|
||||
#define HAVE__STRUPR 1
|
||||
#define HAVE__STRLWR 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_ITOA 1
|
||||
#define HAVE__LTOA 1
|
||||
#define HAVE__ULTOA 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE__STRICMP 1
|
||||
#define HAVE__STRNICMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#else
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
#endif
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#ifndef _WIN32_WCE
|
||||
#define SDL_AUDIO_DRIVER_DSOUND 1
|
||||
#endif
|
||||
#define SDL_AUDIO_DRIVER_WAVEOUT 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#ifdef _WIN32_WCE
|
||||
#define SDL_CDROM_DISABLED 1
|
||||
#else
|
||||
#define SDL_CDROM_WIN32 1
|
||||
#endif
|
||||
|
||||
/* Enable various input drivers */
|
||||
#ifdef _WIN32_WCE
|
||||
#define SDL_JOYSTICK_DISABLED 1
|
||||
#else
|
||||
#define SDL_JOYSTICK_WINMM 1
|
||||
#endif
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_WIN32 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_WIN32 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#ifdef _WIN32_WCE
|
||||
#define SDL_TIMER_WINCE 1
|
||||
#else
|
||||
#define SDL_TIMER_WIN32 1
|
||||
#endif
|
||||
|
||||
/* Enable various video drivers */
|
||||
#ifdef _WIN32_WCE
|
||||
#define SDL_VIDEO_DRIVER_GAPI 1
|
||||
#endif
|
||||
#ifndef _WIN32_WCE
|
||||
#define SDL_VIDEO_DRIVER_DDRAW 1
|
||||
#endif
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_WINDIB 1
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#ifndef _WIN32_WCE
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
#define SDL_VIDEO_OPENGL_WGL 1
|
||||
#endif
|
||||
|
||||
/* Enable assembly routines (Win64 doesn't have inline asm) */
|
||||
#ifndef _WIN64
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
#endif
|
||||
|
||||
#endif /* _SDL_config_win32_h */
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* CPU feature detection for SDL */
|
||||
|
||||
#ifndef _SDL_cpuinfo_h
|
||||
#define _SDL_cpuinfo_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This function returns true if the CPU has the RDTSC instruction
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
|
||||
|
||||
/* This function returns true if the CPU has MMX features
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
||||
|
||||
/* This function returns true if the CPU has MMX Ext. features
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
|
||||
|
||||
/* This function returns true if the CPU has 3DNow features
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
|
||||
|
||||
/* This function returns true if the CPU has 3DNow! Ext. features
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
|
||||
|
||||
/* This function returns true if the CPU has SSE features
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
|
||||
|
||||
/* This function returns true if the CPU has SSE2 features
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
|
||||
|
||||
/* This function returns true if the CPU has AltiVec features
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_cpuinfo_h */
|
||||
@@ -1,194 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Functions for reading and writing endian-specific values */
|
||||
|
||||
#ifndef _SDL_endian_h
|
||||
#define _SDL_endian_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
/* The two types of endianness */
|
||||
#define SDL_LIL_ENDIAN 1234
|
||||
#define SDL_BIG_ENDIAN 4321
|
||||
|
||||
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
|
||||
#if defined(__hppa__) || \
|
||||
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
|
||||
(defined(__MIPS__) && defined(__MISPEB__)) || \
|
||||
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
|
||||
defined(__sparc__)
|
||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
||||
#else
|
||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
||||
#endif
|
||||
#endif /* !SDL_BYTEORDER */
|
||||
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Use inline functions for compilers that support them, and static
|
||||
functions for those that do not. Because these functions become
|
||||
static for compilers that do not support inline functions, this
|
||||
header should only be included in files that actually use them.
|
||||
*/
|
||||
#if defined(__GNUC__) && defined(__i386__) && \
|
||||
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
|
||||
static __inline__ Uint16 SDL_Swap16(Uint16 x)
|
||||
{
|
||||
__asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x));
|
||||
return x;
|
||||
}
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
static __inline__ Uint16 SDL_Swap16(Uint16 x)
|
||||
{
|
||||
__asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x));
|
||||
return x;
|
||||
}
|
||||
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
|
||||
static __inline__ Uint16 SDL_Swap16(Uint16 x)
|
||||
{
|
||||
Uint16 result;
|
||||
|
||||
__asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
|
||||
return result;
|
||||
}
|
||||
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
|
||||
static __inline__ Uint16 SDL_Swap16(Uint16 x)
|
||||
{
|
||||
__asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc");
|
||||
return x;
|
||||
}
|
||||
#else
|
||||
static __inline__ Uint16 SDL_Swap16(Uint16 x) {
|
||||
return((x<<8)|(x>>8));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__i386__) && \
|
||||
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
|
||||
static __inline__ Uint32 SDL_Swap32(Uint32 x)
|
||||
{
|
||||
__asm__("bswap %0" : "=r" (x) : "0" (x));
|
||||
return x;
|
||||
}
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
static __inline__ Uint32 SDL_Swap32(Uint32 x)
|
||||
{
|
||||
__asm__("bswapl %0" : "=r" (x) : "0" (x));
|
||||
return x;
|
||||
}
|
||||
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
|
||||
static __inline__ Uint32 SDL_Swap32(Uint32 x)
|
||||
{
|
||||
Uint32 result;
|
||||
|
||||
__asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
|
||||
__asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x));
|
||||
__asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x));
|
||||
return result;
|
||||
}
|
||||
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
|
||||
static __inline__ Uint32 SDL_Swap32(Uint32 x)
|
||||
{
|
||||
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc");
|
||||
return x;
|
||||
}
|
||||
#else
|
||||
static __inline__ Uint32 SDL_Swap32(Uint32 x) {
|
||||
return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SDL_HAS_64BIT_TYPE
|
||||
#if defined(__GNUC__) && defined(__i386__) && \
|
||||
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
|
||||
static __inline__ Uint64 SDL_Swap64(Uint64 x)
|
||||
{
|
||||
union {
|
||||
struct { Uint32 a,b; } s;
|
||||
Uint64 u;
|
||||
} v;
|
||||
v.u = x;
|
||||
__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
|
||||
: "=r" (v.s.a), "=r" (v.s.b)
|
||||
: "0" (v.s.a), "1" (v.s.b));
|
||||
return v.u;
|
||||
}
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
static __inline__ Uint64 SDL_Swap64(Uint64 x)
|
||||
{
|
||||
__asm__("bswapq %0" : "=r" (x) : "0" (x));
|
||||
return x;
|
||||
}
|
||||
#else
|
||||
static __inline__ Uint64 SDL_Swap64(Uint64 x)
|
||||
{
|
||||
Uint32 hi, lo;
|
||||
|
||||
/* Separate into high and low 32-bit values and swap them */
|
||||
lo = (Uint32)(x&0xFFFFFFFF);
|
||||
x >>= 32;
|
||||
hi = (Uint32)(x&0xFFFFFFFF);
|
||||
x = SDL_Swap32(lo);
|
||||
x <<= 32;
|
||||
x |= SDL_Swap32(hi);
|
||||
return(x);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
/* This is mainly to keep compilers from complaining in SDL code.
|
||||
If there is no real 64-bit datatype, then compilers will complain about
|
||||
the fake 64-bit datatype that SDL provides when it compiles user code.
|
||||
*/
|
||||
#define SDL_Swap64(X) (X)
|
||||
#endif /* SDL_HAS_64BIT_TYPE */
|
||||
|
||||
|
||||
/* Byteswap item from the specified endianness to the native endianness */
|
||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
||||
#define SDL_SwapLE16(X) (X)
|
||||
#define SDL_SwapLE32(X) (X)
|
||||
#define SDL_SwapLE64(X) (X)
|
||||
#define SDL_SwapBE16(X) SDL_Swap16(X)
|
||||
#define SDL_SwapBE32(X) SDL_Swap32(X)
|
||||
#define SDL_SwapBE64(X) SDL_Swap64(X)
|
||||
#else
|
||||
#define SDL_SwapLE16(X) SDL_Swap16(X)
|
||||
#define SDL_SwapLE32(X) SDL_Swap32(X)
|
||||
#define SDL_SwapLE64(X) SDL_Swap64(X)
|
||||
#define SDL_SwapBE16(X) (X)
|
||||
#define SDL_SwapBE32(X) (X)
|
||||
#define SDL_SwapBE64(X) (X)
|
||||
#endif
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_endian_h */
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Simple error message routines for SDL */
|
||||
|
||||
#ifndef _SDL_error_h
|
||||
#define _SDL_error_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Public functions */
|
||||
extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
|
||||
extern DECLSPEC char * SDLCALL SDL_GetError(void);
|
||||
extern DECLSPEC void SDLCALL SDL_ClearError(void);
|
||||
|
||||
/* Private error message function - used internally */
|
||||
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
|
||||
#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
|
||||
typedef enum {
|
||||
SDL_ENOMEM,
|
||||
SDL_EFREAD,
|
||||
SDL_EFWRITE,
|
||||
SDL_EFSEEK,
|
||||
SDL_UNSUPPORTED,
|
||||
SDL_LASTERROR
|
||||
} SDL_errorcode;
|
||||
extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_error_h */
|
||||
@@ -1,337 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Include file for SDL event handling */
|
||||
|
||||
#ifndef _SDL_events_h
|
||||
#define _SDL_events_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_active.h"
|
||||
#include "SDL_keyboard.h"
|
||||
#include "SDL_mouse.h"
|
||||
#include "SDL_joystick.h"
|
||||
#include "SDL_quit.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* General keyboard/mouse state definitions */
|
||||
#define SDL_RELEASED 0
|
||||
#define SDL_PRESSED 1
|
||||
|
||||
/* Event enumerations */
|
||||
typedef enum {
|
||||
SDL_NOEVENT = 0, /* Unused (do not remove) */
|
||||
SDL_ACTIVEEVENT, /* Application loses/gains visibility */
|
||||
SDL_KEYDOWN, /* Keys pressed */
|
||||
SDL_KEYUP, /* Keys released */
|
||||
SDL_MOUSEMOTION, /* Mouse moved */
|
||||
SDL_MOUSEBUTTONDOWN, /* Mouse button pressed */
|
||||
SDL_MOUSEBUTTONUP, /* Mouse button released */
|
||||
SDL_JOYAXISMOTION, /* Joystick axis motion */
|
||||
SDL_JOYBALLMOTION, /* Joystick trackball motion */
|
||||
SDL_JOYHATMOTION, /* Joystick hat position change */
|
||||
SDL_JOYBUTTONDOWN, /* Joystick button pressed */
|
||||
SDL_JOYBUTTONUP, /* Joystick button released */
|
||||
SDL_QUIT, /* User-requested quit */
|
||||
SDL_SYSWMEVENT, /* System specific event */
|
||||
SDL_EVENT_RESERVEDA, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVEDB, /* Reserved for future use.. */
|
||||
SDL_VIDEORESIZE, /* User resized video mode */
|
||||
SDL_VIDEOEXPOSE, /* Screen needs to be redrawn */
|
||||
SDL_EVENT_RESERVED2, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED3, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED4, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED5, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED6, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED7, /* Reserved for future use.. */
|
||||
/* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
|
||||
SDL_USEREVENT = 24,
|
||||
/* This last event is only for bounding internal arrays
|
||||
It is the number of bits in the event mask datatype -- Uint32
|
||||
*/
|
||||
SDL_NUMEVENTS = 32
|
||||
} SDL_EventType;
|
||||
|
||||
/* Predefined event masks */
|
||||
#define SDL_EVENTMASK(X) (1<<(X))
|
||||
typedef enum {
|
||||
SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
|
||||
SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
|
||||
SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
|
||||
SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)|
|
||||
SDL_EVENTMASK(SDL_KEYUP),
|
||||
SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
|
||||
SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
|
||||
SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
|
||||
SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)|
|
||||
SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)|
|
||||
SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
|
||||
SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION),
|
||||
SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION),
|
||||
SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION),
|
||||
SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
|
||||
SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP),
|
||||
SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)|
|
||||
SDL_EVENTMASK(SDL_JOYBALLMOTION)|
|
||||
SDL_EVENTMASK(SDL_JOYHATMOTION)|
|
||||
SDL_EVENTMASK(SDL_JOYBUTTONDOWN)|
|
||||
SDL_EVENTMASK(SDL_JOYBUTTONUP),
|
||||
SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE),
|
||||
SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
|
||||
SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
|
||||
SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
|
||||
} SDL_EventMask ;
|
||||
#define SDL_ALLEVENTS 0xFFFFFFFF
|
||||
|
||||
/* Application visibility event structure */
|
||||
typedef struct SDL_ActiveEvent {
|
||||
Uint8 type; /* SDL_ACTIVEEVENT */
|
||||
Uint8 gain; /* Whether given states were gained or lost (1/0) */
|
||||
Uint8 state; /* A mask of the focus states */
|
||||
} SDL_ActiveEvent;
|
||||
|
||||
/* Keyboard event structure */
|
||||
typedef struct SDL_KeyboardEvent {
|
||||
Uint8 type; /* SDL_KEYDOWN or SDL_KEYUP */
|
||||
Uint8 which; /* The keyboard device index */
|
||||
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
|
||||
SDL_keysym keysym;
|
||||
} SDL_KeyboardEvent;
|
||||
|
||||
/* Mouse motion event structure */
|
||||
typedef struct SDL_MouseMotionEvent {
|
||||
Uint8 type; /* SDL_MOUSEMOTION */
|
||||
Uint8 which; /* The mouse device index */
|
||||
Uint8 state; /* The current button state */
|
||||
Uint16 x, y; /* The X/Y coordinates of the mouse */
|
||||
Sint16 xrel; /* The relative motion in the X direction */
|
||||
Sint16 yrel; /* The relative motion in the Y direction */
|
||||
} SDL_MouseMotionEvent;
|
||||
|
||||
/* Mouse button event structure */
|
||||
typedef struct SDL_MouseButtonEvent {
|
||||
Uint8 type; /* SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
|
||||
Uint8 which; /* The mouse device index */
|
||||
Uint8 button; /* The mouse button index */
|
||||
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
|
||||
Uint16 x, y; /* The X/Y coordinates of the mouse at press time */
|
||||
} SDL_MouseButtonEvent;
|
||||
|
||||
/* Joystick axis motion event structure */
|
||||
typedef struct SDL_JoyAxisEvent {
|
||||
Uint8 type; /* SDL_JOYAXISMOTION */
|
||||
Uint8 which; /* The joystick device index */
|
||||
Uint8 axis; /* The joystick axis index */
|
||||
Sint16 value; /* The axis value (range: -32768 to 32767) */
|
||||
} SDL_JoyAxisEvent;
|
||||
|
||||
/* Joystick trackball motion event structure */
|
||||
typedef struct SDL_JoyBallEvent {
|
||||
Uint8 type; /* SDL_JOYBALLMOTION */
|
||||
Uint8 which; /* The joystick device index */
|
||||
Uint8 ball; /* The joystick trackball index */
|
||||
Sint16 xrel; /* The relative motion in the X direction */
|
||||
Sint16 yrel; /* The relative motion in the Y direction */
|
||||
} SDL_JoyBallEvent;
|
||||
|
||||
/* Joystick hat position change event structure */
|
||||
typedef struct SDL_JoyHatEvent {
|
||||
Uint8 type; /* SDL_JOYHATMOTION */
|
||||
Uint8 which; /* The joystick device index */
|
||||
Uint8 hat; /* The joystick hat index */
|
||||
Uint8 value; /* The hat position value:
|
||||
SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
|
||||
SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
|
||||
SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
|
||||
Note that zero means the POV is centered.
|
||||
*/
|
||||
} SDL_JoyHatEvent;
|
||||
|
||||
/* Joystick button event structure */
|
||||
typedef struct SDL_JoyButtonEvent {
|
||||
Uint8 type; /* SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
|
||||
Uint8 which; /* The joystick device index */
|
||||
Uint8 button; /* The joystick button index */
|
||||
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
|
||||
} SDL_JoyButtonEvent;
|
||||
|
||||
/* The "window resized" event
|
||||
When you get this event, you are responsible for setting a new video
|
||||
mode with the new width and height.
|
||||
*/
|
||||
typedef struct SDL_ResizeEvent {
|
||||
Uint8 type; /* SDL_VIDEORESIZE */
|
||||
int w; /* New width */
|
||||
int h; /* New height */
|
||||
} SDL_ResizeEvent;
|
||||
|
||||
/* The "screen redraw" event */
|
||||
typedef struct SDL_ExposeEvent {
|
||||
Uint8 type; /* SDL_VIDEOEXPOSE */
|
||||
} SDL_ExposeEvent;
|
||||
|
||||
/* The "quit requested" event */
|
||||
typedef struct SDL_QuitEvent {
|
||||
Uint8 type; /* SDL_QUIT */
|
||||
} SDL_QuitEvent;
|
||||
|
||||
/* A user-defined event type */
|
||||
typedef struct SDL_UserEvent {
|
||||
Uint8 type; /* SDL_USEREVENT through SDL_NUMEVENTS-1 */
|
||||
int code; /* User defined event code */
|
||||
void *data1; /* User defined data pointer */
|
||||
void *data2; /* User defined data pointer */
|
||||
} SDL_UserEvent;
|
||||
|
||||
/* If you want to use this event, you should include SDL_syswm.h */
|
||||
struct SDL_SysWMmsg;
|
||||
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
|
||||
typedef struct SDL_SysWMEvent {
|
||||
Uint8 type;
|
||||
SDL_SysWMmsg *msg;
|
||||
} SDL_SysWMEvent;
|
||||
|
||||
/* General event structure */
|
||||
typedef union SDL_Event {
|
||||
Uint8 type;
|
||||
SDL_ActiveEvent active;
|
||||
SDL_KeyboardEvent key;
|
||||
SDL_MouseMotionEvent motion;
|
||||
SDL_MouseButtonEvent button;
|
||||
SDL_JoyAxisEvent jaxis;
|
||||
SDL_JoyBallEvent jball;
|
||||
SDL_JoyHatEvent jhat;
|
||||
SDL_JoyButtonEvent jbutton;
|
||||
SDL_ResizeEvent resize;
|
||||
SDL_ExposeEvent expose;
|
||||
SDL_QuitEvent quit;
|
||||
SDL_UserEvent user;
|
||||
SDL_SysWMEvent syswm;
|
||||
} SDL_Event;
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/* Pumps the event loop, gathering events from the input devices.
|
||||
This function updates the event queue and internal input device state.
|
||||
This should only be run in the thread that sets the video mode.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
|
||||
|
||||
/* Checks the event queue for messages and optionally returns them.
|
||||
If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
|
||||
the back of the event queue.
|
||||
If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
|
||||
of the event queue, matching 'mask', will be returned and will not
|
||||
be removed from the queue.
|
||||
If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
|
||||
of the event queue, matching 'mask', will be returned and will be
|
||||
removed from the queue.
|
||||
This function returns the number of events actually stored, or -1
|
||||
if there was an error. This function is thread-safe.
|
||||
*/
|
||||
typedef enum {
|
||||
SDL_ADDEVENT,
|
||||
SDL_PEEKEVENT,
|
||||
SDL_GETEVENT
|
||||
} SDL_eventaction;
|
||||
/* */
|
||||
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
|
||||
SDL_eventaction action, Uint32 mask);
|
||||
|
||||
/* Polls for currently pending events, and returns 1 if there are any pending
|
||||
events, or 0 if there are none available. If 'event' is not NULL, the next
|
||||
event is removed from the queue and stored in that area.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event);
|
||||
|
||||
/* Waits indefinitely for the next available event, returning 1, or 0 if there
|
||||
was an error while waiting for events. If 'event' is not NULL, the next
|
||||
event is removed from the queue and stored in that area.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event);
|
||||
|
||||
/* Add an event to the event queue.
|
||||
This function returns 0 on success, or -1 if the event queue was full
|
||||
or there was some other error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
|
||||
|
||||
/*
|
||||
This function sets up a filter to process all events before they
|
||||
change internal state and are posted to the internal event queue.
|
||||
|
||||
The filter is protypted as:
|
||||
*/
|
||||
typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event);
|
||||
/*
|
||||
If the filter returns 1, then the event will be added to the internal queue.
|
||||
If it returns 0, then the event will be dropped from the queue, but the
|
||||
internal state will still be updated. This allows selective filtering of
|
||||
dynamically arriving events.
|
||||
|
||||
WARNING: Be very careful of what you do in the event filter function, as
|
||||
it may run in a different thread!
|
||||
|
||||
There is one caveat when dealing with the SDL_QUITEVENT event type. The
|
||||
event filter is only called when the window manager desires to close the
|
||||
application window. If the event filter returns 1, then the window will
|
||||
be closed, otherwise the window will remain open if possible.
|
||||
If the quit event is generated by an interrupt signal, it will bypass the
|
||||
internal queue and be delivered to the application at the next event poll.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
|
||||
|
||||
/*
|
||||
Return the current event filter - can be used to "chain" filters.
|
||||
If there is no event filter set, this function returns NULL.
|
||||
*/
|
||||
extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
|
||||
|
||||
/*
|
||||
This function allows you to set the state of processing certain events.
|
||||
If 'state' is set to SDL_IGNORE, that event will be automatically dropped
|
||||
from the event queue and will not event be filtered.
|
||||
If 'state' is set to SDL_ENABLE, that event will be processed normally.
|
||||
If 'state' is set to SDL_QUERY, SDL_EventState() will return the
|
||||
current processing state of the specified event.
|
||||
*/
|
||||
#define SDL_QUERY -1
|
||||
#define SDL_IGNORE 0
|
||||
#define SDL_DISABLE 0
|
||||
#define SDL_ENABLE 1
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_events_h */
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* DEPRECATED */
|
||||
#include "SDL_stdinc.h"
|
||||
@@ -1,167 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Include file for SDL joystick event handling */
|
||||
|
||||
#ifndef _SDL_joystick_h
|
||||
#define _SDL_joystick_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* In order to use these functions, SDL_Init() must have been called
|
||||
with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
|
||||
for joysticks, and load appropriate drivers.
|
||||
*/
|
||||
|
||||
/* The joystick structure used to identify an SDL joystick */
|
||||
struct _SDL_Joystick;
|
||||
typedef struct _SDL_Joystick SDL_Joystick;
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
/*
|
||||
* Count the number of joysticks attached to the system
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
||||
|
||||
/*
|
||||
* Get the implementation dependent name of a joystick.
|
||||
* This can be called before any joysticks are opened.
|
||||
* If no name can be found, this function returns NULL.
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index);
|
||||
|
||||
/*
|
||||
* Open a joystick for use - the index passed as an argument refers to
|
||||
* the N'th joystick on the system. This index is the value which will
|
||||
* identify this joystick in future joystick events.
|
||||
*
|
||||
* This function returns a joystick identifier, or NULL if an error occurred.
|
||||
*/
|
||||
extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index);
|
||||
|
||||
/*
|
||||
* Returns 1 if the joystick has been opened, or 0 if it has not.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index);
|
||||
|
||||
/*
|
||||
* Get the device index of an opened joystick.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick);
|
||||
|
||||
/*
|
||||
* Get the number of general axis controls on a joystick
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
|
||||
|
||||
/*
|
||||
* Get the number of trackballs on a joystick
|
||||
* Joystick trackballs have only relative motion events associated
|
||||
* with them and their state cannot be polled.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
|
||||
|
||||
/*
|
||||
* Get the number of POV hats on a joystick
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
|
||||
|
||||
/*
|
||||
* Get the number of buttons on a joystick
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
|
||||
|
||||
/*
|
||||
* Update the current state of the open joysticks.
|
||||
* This is called automatically by the event loop if any joystick
|
||||
* events are enabled.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
|
||||
|
||||
/*
|
||||
* Enable/disable joystick event polling.
|
||||
* If joystick events are disabled, you must call SDL_JoystickUpdate()
|
||||
* yourself and check the state of the joystick when you want joystick
|
||||
* information.
|
||||
* The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
|
||||
|
||||
/*
|
||||
* Get the current state of an axis control on a joystick
|
||||
* The state is a value ranging from -32768 to 32767.
|
||||
* The axis indices start at index 0.
|
||||
*/
|
||||
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
|
||||
|
||||
/*
|
||||
* Get the current state of a POV hat on a joystick
|
||||
* The return value is one of the following positions:
|
||||
*/
|
||||
#define SDL_HAT_CENTERED 0x00
|
||||
#define SDL_HAT_UP 0x01
|
||||
#define SDL_HAT_RIGHT 0x02
|
||||
#define SDL_HAT_DOWN 0x04
|
||||
#define SDL_HAT_LEFT 0x08
|
||||
#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
|
||||
#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
|
||||
#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
|
||||
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
|
||||
/*
|
||||
* The hat indices start at index 0.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
|
||||
|
||||
/*
|
||||
* Get the ball axis change since the last poll
|
||||
* This returns 0, or -1 if you passed it invalid parameters.
|
||||
* The ball indices start at index 0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
|
||||
|
||||
/*
|
||||
* Get the current state of a button on a joystick
|
||||
* The button indices start at index 0.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
|
||||
|
||||
/*
|
||||
* Close a joystick previously opened with SDL_JoystickOpen()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_joystick_h */
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Include file for SDL keyboard event handling */
|
||||
|
||||
#ifndef _SDL_keyboard_h
|
||||
#define _SDL_keyboard_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_keysym.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Keysym structure
|
||||
- The scancode is hardware dependent, and should not be used by general
|
||||
applications. If no hardware scancode is available, it will be 0.
|
||||
|
||||
- The 'unicode' translated character is only available when character
|
||||
translation is enabled by the SDL_EnableUNICODE() API. If non-zero,
|
||||
this is a UNICODE character corresponding to the keypress. If the
|
||||
high 9 bits of the character are 0, then this maps to the equivalent
|
||||
ASCII character:
|
||||
char ch;
|
||||
if ( (keysym.unicode & 0xFF80) == 0 ) {
|
||||
ch = keysym.unicode & 0x7F;
|
||||
} else {
|
||||
An international character..
|
||||
}
|
||||
*/
|
||||
typedef struct SDL_keysym {
|
||||
Uint8 scancode; /* hardware specific scancode */
|
||||
SDLKey sym; /* SDL virtual keysym */
|
||||
SDLMod mod; /* current key modifiers */
|
||||
Uint16 unicode; /* translated character */
|
||||
} SDL_keysym;
|
||||
|
||||
/* This is the mask which refers to all hotkey bindings */
|
||||
#define SDL_ALL_HOTKEYS 0xFFFFFFFF
|
||||
|
||||
/* Function prototypes */
|
||||
/*
|
||||
* Enable/Disable UNICODE translation of keyboard input.
|
||||
* This translation has some overhead, so translation defaults off.
|
||||
* If 'enable' is 1, translation is enabled.
|
||||
* If 'enable' is 0, translation is disabled.
|
||||
* If 'enable' is -1, the translation state is not changed.
|
||||
* It returns the previous state of keyboard translation.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
|
||||
|
||||
/*
|
||||
* Enable/Disable keyboard repeat. Keyboard repeat defaults to off.
|
||||
* 'delay' is the initial delay in ms between the time when a key is
|
||||
* pressed, and keyboard repeat begins.
|
||||
* 'interval' is the time in ms between keyboard repeat events.
|
||||
*/
|
||||
#define SDL_DEFAULT_REPEAT_DELAY 500
|
||||
#define SDL_DEFAULT_REPEAT_INTERVAL 30
|
||||
/*
|
||||
* If 'delay' is set to 0, keyboard repeat is disabled.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
|
||||
extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
|
||||
|
||||
/*
|
||||
* Get a snapshot of the current state of the keyboard.
|
||||
* Returns an array of keystates, indexed by the SDLK_* syms.
|
||||
* Used:
|
||||
* Uint8 *keystate = SDL_GetKeyState(NULL);
|
||||
* if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed.
|
||||
*/
|
||||
extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
|
||||
|
||||
/*
|
||||
* Get the current key modifier state
|
||||
*/
|
||||
extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
|
||||
|
||||
/*
|
||||
* Set the current key modifier state
|
||||
* This does not change the keyboard state, only the key modifier flags.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
|
||||
|
||||
/*
|
||||
* Get the name of an SDL virtual keysym
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_keyboard_h */
|
||||
@@ -1,311 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_keysym_h
|
||||
#define _SDL_keysym_h
|
||||
|
||||
/* What we really want is a mapping of every raw key on the keyboard.
|
||||
To support international keyboards, we use the range 0xA1 - 0xFF
|
||||
as international virtual keycodes. We'll follow in the footsteps of X11...
|
||||
The names of the keys
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
/* The keyboard syms have been cleverly chosen to map to ASCII */
|
||||
SDLK_UNKNOWN = 0,
|
||||
SDLK_FIRST = 0,
|
||||
SDLK_BACKSPACE = 8,
|
||||
SDLK_TAB = 9,
|
||||
SDLK_CLEAR = 12,
|
||||
SDLK_RETURN = 13,
|
||||
SDLK_PAUSE = 19,
|
||||
SDLK_ESCAPE = 27,
|
||||
SDLK_SPACE = 32,
|
||||
SDLK_EXCLAIM = 33,
|
||||
SDLK_QUOTEDBL = 34,
|
||||
SDLK_HASH = 35,
|
||||
SDLK_DOLLAR = 36,
|
||||
SDLK_AMPERSAND = 38,
|
||||
SDLK_QUOTE = 39,
|
||||
SDLK_LEFTPAREN = 40,
|
||||
SDLK_RIGHTPAREN = 41,
|
||||
SDLK_ASTERISK = 42,
|
||||
SDLK_PLUS = 43,
|
||||
SDLK_COMMA = 44,
|
||||
SDLK_MINUS = 45,
|
||||
SDLK_PERIOD = 46,
|
||||
SDLK_SLASH = 47,
|
||||
SDLK_0 = 48,
|
||||
SDLK_1 = 49,
|
||||
SDLK_2 = 50,
|
||||
SDLK_3 = 51,
|
||||
SDLK_4 = 52,
|
||||
SDLK_5 = 53,
|
||||
SDLK_6 = 54,
|
||||
SDLK_7 = 55,
|
||||
SDLK_8 = 56,
|
||||
SDLK_9 = 57,
|
||||
SDLK_COLON = 58,
|
||||
SDLK_SEMICOLON = 59,
|
||||
SDLK_LESS = 60,
|
||||
SDLK_EQUALS = 61,
|
||||
SDLK_GREATER = 62,
|
||||
SDLK_QUESTION = 63,
|
||||
SDLK_AT = 64,
|
||||
/*
|
||||
Skip uppercase letters
|
||||
*/
|
||||
SDLK_LEFTBRACKET = 91,
|
||||
SDLK_BACKSLASH = 92,
|
||||
SDLK_RIGHTBRACKET = 93,
|
||||
SDLK_CARET = 94,
|
||||
SDLK_UNDERSCORE = 95,
|
||||
SDLK_BACKQUOTE = 96,
|
||||
SDLK_a = 97,
|
||||
SDLK_b = 98,
|
||||
SDLK_c = 99,
|
||||
SDLK_d = 100,
|
||||
SDLK_e = 101,
|
||||
SDLK_f = 102,
|
||||
SDLK_g = 103,
|
||||
SDLK_h = 104,
|
||||
SDLK_i = 105,
|
||||
SDLK_j = 106,
|
||||
SDLK_k = 107,
|
||||
SDLK_l = 108,
|
||||
SDLK_m = 109,
|
||||
SDLK_n = 110,
|
||||
SDLK_o = 111,
|
||||
SDLK_p = 112,
|
||||
SDLK_q = 113,
|
||||
SDLK_r = 114,
|
||||
SDLK_s = 115,
|
||||
SDLK_t = 116,
|
||||
SDLK_u = 117,
|
||||
SDLK_v = 118,
|
||||
SDLK_w = 119,
|
||||
SDLK_x = 120,
|
||||
SDLK_y = 121,
|
||||
SDLK_z = 122,
|
||||
SDLK_DELETE = 127,
|
||||
/* End of ASCII mapped keysyms */
|
||||
|
||||
/* International keyboard syms */
|
||||
SDLK_WORLD_0 = 160, /* 0xA0 */
|
||||
SDLK_WORLD_1 = 161,
|
||||
SDLK_WORLD_2 = 162,
|
||||
SDLK_WORLD_3 = 163,
|
||||
SDLK_WORLD_4 = 164,
|
||||
SDLK_WORLD_5 = 165,
|
||||
SDLK_WORLD_6 = 166,
|
||||
SDLK_WORLD_7 = 167,
|
||||
SDLK_WORLD_8 = 168,
|
||||
SDLK_WORLD_9 = 169,
|
||||
SDLK_WORLD_10 = 170,
|
||||
SDLK_WORLD_11 = 171,
|
||||
SDLK_WORLD_12 = 172,
|
||||
SDLK_WORLD_13 = 173,
|
||||
SDLK_WORLD_14 = 174,
|
||||
SDLK_WORLD_15 = 175,
|
||||
SDLK_WORLD_16 = 176,
|
||||
SDLK_WORLD_17 = 177,
|
||||
SDLK_WORLD_18 = 178,
|
||||
SDLK_WORLD_19 = 179,
|
||||
SDLK_WORLD_20 = 180,
|
||||
SDLK_WORLD_21 = 181,
|
||||
SDLK_WORLD_22 = 182,
|
||||
SDLK_WORLD_23 = 183,
|
||||
SDLK_WORLD_24 = 184,
|
||||
SDLK_WORLD_25 = 185,
|
||||
SDLK_WORLD_26 = 186,
|
||||
SDLK_WORLD_27 = 187,
|
||||
SDLK_WORLD_28 = 188,
|
||||
SDLK_WORLD_29 = 189,
|
||||
SDLK_WORLD_30 = 190,
|
||||
SDLK_WORLD_31 = 191,
|
||||
SDLK_WORLD_32 = 192,
|
||||
SDLK_WORLD_33 = 193,
|
||||
SDLK_WORLD_34 = 194,
|
||||
SDLK_WORLD_35 = 195,
|
||||
SDLK_WORLD_36 = 196,
|
||||
SDLK_WORLD_37 = 197,
|
||||
SDLK_WORLD_38 = 198,
|
||||
SDLK_WORLD_39 = 199,
|
||||
SDLK_WORLD_40 = 200,
|
||||
SDLK_WORLD_41 = 201,
|
||||
SDLK_WORLD_42 = 202,
|
||||
SDLK_WORLD_43 = 203,
|
||||
SDLK_WORLD_44 = 204,
|
||||
SDLK_WORLD_45 = 205,
|
||||
SDLK_WORLD_46 = 206,
|
||||
SDLK_WORLD_47 = 207,
|
||||
SDLK_WORLD_48 = 208,
|
||||
SDLK_WORLD_49 = 209,
|
||||
SDLK_WORLD_50 = 210,
|
||||
SDLK_WORLD_51 = 211,
|
||||
SDLK_WORLD_52 = 212,
|
||||
SDLK_WORLD_53 = 213,
|
||||
SDLK_WORLD_54 = 214,
|
||||
SDLK_WORLD_55 = 215,
|
||||
SDLK_WORLD_56 = 216,
|
||||
SDLK_WORLD_57 = 217,
|
||||
SDLK_WORLD_58 = 218,
|
||||
SDLK_WORLD_59 = 219,
|
||||
SDLK_WORLD_60 = 220,
|
||||
SDLK_WORLD_61 = 221,
|
||||
SDLK_WORLD_62 = 222,
|
||||
SDLK_WORLD_63 = 223,
|
||||
SDLK_WORLD_64 = 224,
|
||||
SDLK_WORLD_65 = 225,
|
||||
SDLK_WORLD_66 = 226,
|
||||
SDLK_WORLD_67 = 227,
|
||||
SDLK_WORLD_68 = 228,
|
||||
SDLK_WORLD_69 = 229,
|
||||
SDLK_WORLD_70 = 230,
|
||||
SDLK_WORLD_71 = 231,
|
||||
SDLK_WORLD_72 = 232,
|
||||
SDLK_WORLD_73 = 233,
|
||||
SDLK_WORLD_74 = 234,
|
||||
SDLK_WORLD_75 = 235,
|
||||
SDLK_WORLD_76 = 236,
|
||||
SDLK_WORLD_77 = 237,
|
||||
SDLK_WORLD_78 = 238,
|
||||
SDLK_WORLD_79 = 239,
|
||||
SDLK_WORLD_80 = 240,
|
||||
SDLK_WORLD_81 = 241,
|
||||
SDLK_WORLD_82 = 242,
|
||||
SDLK_WORLD_83 = 243,
|
||||
SDLK_WORLD_84 = 244,
|
||||
SDLK_WORLD_85 = 245,
|
||||
SDLK_WORLD_86 = 246,
|
||||
SDLK_WORLD_87 = 247,
|
||||
SDLK_WORLD_88 = 248,
|
||||
SDLK_WORLD_89 = 249,
|
||||
SDLK_WORLD_90 = 250,
|
||||
SDLK_WORLD_91 = 251,
|
||||
SDLK_WORLD_92 = 252,
|
||||
SDLK_WORLD_93 = 253,
|
||||
SDLK_WORLD_94 = 254,
|
||||
SDLK_WORLD_95 = 255, /* 0xFF */
|
||||
|
||||
/* Numeric keypad */
|
||||
SDLK_KP0 = 256,
|
||||
SDLK_KP1 = 257,
|
||||
SDLK_KP2 = 258,
|
||||
SDLK_KP3 = 259,
|
||||
SDLK_KP4 = 260,
|
||||
SDLK_KP5 = 261,
|
||||
SDLK_KP6 = 262,
|
||||
SDLK_KP7 = 263,
|
||||
SDLK_KP8 = 264,
|
||||
SDLK_KP9 = 265,
|
||||
SDLK_KP_PERIOD = 266,
|
||||
SDLK_KP_DIVIDE = 267,
|
||||
SDLK_KP_MULTIPLY = 268,
|
||||
SDLK_KP_MINUS = 269,
|
||||
SDLK_KP_PLUS = 270,
|
||||
SDLK_KP_ENTER = 271,
|
||||
SDLK_KP_EQUALS = 272,
|
||||
|
||||
/* Arrows + Home/End pad */
|
||||
SDLK_UP = 273,
|
||||
SDLK_DOWN = 274,
|
||||
SDLK_RIGHT = 275,
|
||||
SDLK_LEFT = 276,
|
||||
SDLK_INSERT = 277,
|
||||
SDLK_HOME = 278,
|
||||
SDLK_END = 279,
|
||||
SDLK_PAGEUP = 280,
|
||||
SDLK_PAGEDOWN = 281,
|
||||
|
||||
/* Function keys */
|
||||
SDLK_F1 = 282,
|
||||
SDLK_F2 = 283,
|
||||
SDLK_F3 = 284,
|
||||
SDLK_F4 = 285,
|
||||
SDLK_F5 = 286,
|
||||
SDLK_F6 = 287,
|
||||
SDLK_F7 = 288,
|
||||
SDLK_F8 = 289,
|
||||
SDLK_F9 = 290,
|
||||
SDLK_F10 = 291,
|
||||
SDLK_F11 = 292,
|
||||
SDLK_F12 = 293,
|
||||
SDLK_F13 = 294,
|
||||
SDLK_F14 = 295,
|
||||
SDLK_F15 = 296,
|
||||
|
||||
/* Key state modifier keys */
|
||||
SDLK_NUMLOCK = 300,
|
||||
SDLK_CAPSLOCK = 301,
|
||||
SDLK_SCROLLOCK = 302,
|
||||
SDLK_RSHIFT = 303,
|
||||
SDLK_LSHIFT = 304,
|
||||
SDLK_RCTRL = 305,
|
||||
SDLK_LCTRL = 306,
|
||||
SDLK_RALT = 307,
|
||||
SDLK_LALT = 308,
|
||||
SDLK_RMETA = 309,
|
||||
SDLK_LMETA = 310,
|
||||
SDLK_LSUPER = 311, /* Left "Windows" key */
|
||||
SDLK_RSUPER = 312, /* Right "Windows" key */
|
||||
SDLK_MODE = 313, /* "Alt Gr" key */
|
||||
SDLK_COMPOSE = 314, /* Multi-key compose key */
|
||||
|
||||
/* Miscellaneous function keys */
|
||||
SDLK_HELP = 315,
|
||||
SDLK_PRINT = 316,
|
||||
SDLK_SYSREQ = 317,
|
||||
SDLK_BREAK = 318,
|
||||
SDLK_MENU = 319,
|
||||
SDLK_POWER = 320, /* Power Macintosh power key */
|
||||
SDLK_EURO = 321, /* Some european keyboards */
|
||||
SDLK_UNDO = 322, /* Atari keyboard has Undo */
|
||||
|
||||
/* Add any other keys here */
|
||||
|
||||
SDLK_LAST
|
||||
} SDLKey;
|
||||
|
||||
/* Enumeration of valid key mods (possibly OR'd together) */
|
||||
typedef enum {
|
||||
KMOD_NONE = 0x0000,
|
||||
KMOD_LSHIFT= 0x0001,
|
||||
KMOD_RSHIFT= 0x0002,
|
||||
KMOD_LCTRL = 0x0040,
|
||||
KMOD_RCTRL = 0x0080,
|
||||
KMOD_LALT = 0x0100,
|
||||
KMOD_RALT = 0x0200,
|
||||
KMOD_LMETA = 0x0400,
|
||||
KMOD_RMETA = 0x0800,
|
||||
KMOD_NUM = 0x1000,
|
||||
KMOD_CAPS = 0x2000,
|
||||
KMOD_MODE = 0x4000,
|
||||
KMOD_RESERVED = 0x8000
|
||||
} SDLMod;
|
||||
|
||||
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
|
||||
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
|
||||
#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
|
||||
#define KMOD_META (KMOD_LMETA|KMOD_RMETA)
|
||||
|
||||
#endif /* _SDL_keysym_h */
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* System dependent library loading routines */
|
||||
|
||||
/* Some things to keep in mind:
|
||||
- These functions only work on C function names. Other languages may
|
||||
have name mangling and intrinsic language support that varies from
|
||||
compiler to compiler.
|
||||
- Make sure you declare your function pointers with the same calling
|
||||
convention as the actual library function. Your code will crash
|
||||
mysteriously if you do not do this.
|
||||
- Avoid namespace collisions. If you load a symbol from the library,
|
||||
it is not defined whether or not it goes into the global symbol
|
||||
namespace for the application. If it does and it conflicts with
|
||||
symbols in your code or other shared libraries, you will not get
|
||||
the results you expect. :)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SDL_loadso_h
|
||||
#define _SDL_loadso_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This function dynamically loads a shared object and returns a pointer
|
||||
* to the object handle (or NULL if there was an error).
|
||||
* The 'sofile' parameter is a system dependent name of the object file.
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile);
|
||||
|
||||
/* Given an object handle, this function looks up the address of the
|
||||
* named function in the shared object and returns it. This address
|
||||
* is no longer valid after calling SDL_UnloadObject().
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name);
|
||||
|
||||
/* Unload a shared object from memory */
|
||||
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_loadso_h */
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_main_h
|
||||
#define _SDL_main_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
|
||||
|
||||
#if defined(__WIN32__) || \
|
||||
(defined(__MWERKS__) && !defined(__BEOS__)) || \
|
||||
defined(__MACOS__) || defined(__MACOSX__) || \
|
||||
defined(__SYMBIAN32__) || defined(QWS)
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define C_LINKAGE "C"
|
||||
#else
|
||||
#define C_LINKAGE
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* The application's main() function must be called with C linkage,
|
||||
and should be declared like this:
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
}
|
||||
*/
|
||||
#define main SDL_main
|
||||
|
||||
/* The prototype for the application's main() function */
|
||||
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
|
||||
|
||||
|
||||
/* From the SDL library code -- needed for registering the app on Win32 */
|
||||
#ifdef __WIN32__
|
||||
|
||||
#include "begin_code.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This should be called from your WinMain() function, if any */
|
||||
extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
|
||||
/* This can also be called, but is no longer necessary */
|
||||
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
|
||||
/* This can also be called, but is no longer necessary (SDL_Quit calls it) */
|
||||
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
#endif
|
||||
|
||||
/* From the SDL library code -- needed for registering QuickDraw on MacOS */
|
||||
#if defined(__MACOS__)
|
||||
|
||||
#include "begin_code.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Forward declaration so we don't need to include QuickDraw.h */
|
||||
struct QDGlobals;
|
||||
|
||||
/* This should be called from your main() function, if any */
|
||||
extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
#endif
|
||||
|
||||
#endif /* Need to redefine main()? */
|
||||
|
||||
#endif /* _SDL_main_h */
|
||||
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Include file for SDL mouse event handling */
|
||||
|
||||
#ifndef _SDL_mouse_h
|
||||
#define _SDL_mouse_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_video.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct WMcursor WMcursor; /* Implementation dependent */
|
||||
typedef struct SDL_Cursor {
|
||||
SDL_Rect area; /* The area of the mouse cursor */
|
||||
Sint16 hot_x, hot_y; /* The "tip" of the cursor */
|
||||
Uint8 *data; /* B/W cursor data */
|
||||
Uint8 *mask; /* B/W cursor mask */
|
||||
Uint8 *save[2]; /* Place to save cursor area */
|
||||
WMcursor *wm_cursor; /* Window-manager cursor */
|
||||
} SDL_Cursor;
|
||||
|
||||
/* Function prototypes */
|
||||
/*
|
||||
* Retrieve the current state of the mouse.
|
||||
* The current button state is returned as a button bitmask, which can
|
||||
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
|
||||
* current mouse cursor position. You can pass NULL for either x or y.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
|
||||
|
||||
/*
|
||||
* Retrieve the current state of the mouse.
|
||||
* The current button state is returned as a button bitmask, which can
|
||||
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
|
||||
* mouse deltas since the last call to SDL_GetRelativeMouseState().
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
|
||||
|
||||
/*
|
||||
* Set the position of the mouse cursor (generates a mouse motion event)
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
|
||||
|
||||
/*
|
||||
* Create a cursor using the specified data and mask (in MSB format).
|
||||
* The cursor width must be a multiple of 8 bits.
|
||||
*
|
||||
* The cursor is created in black and white according to the following:
|
||||
* data mask resulting pixel on screen
|
||||
* 0 1 White
|
||||
* 1 1 Black
|
||||
* 0 0 Transparent
|
||||
* 1 0 Inverted color if possible, black if not.
|
||||
*
|
||||
* Cursors created with this function must be freed with SDL_FreeCursor().
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
|
||||
(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
|
||||
|
||||
/*
|
||||
* Set the currently active cursor to the specified one.
|
||||
* If the cursor is currently visible, the change will be immediately
|
||||
* represented on the display.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
|
||||
|
||||
/*
|
||||
* Returns the currently active cursor.
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
|
||||
|
||||
/*
|
||||
* Deallocates a cursor created with SDL_CreateCursor().
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor);
|
||||
|
||||
/*
|
||||
* Toggle whether or not the cursor is shown on the screen.
|
||||
* The cursor start off displayed, but can be turned off.
|
||||
* SDL_ShowCursor() returns 1 if the cursor was being displayed
|
||||
* before the call, or 0 if it was not. You can query the current
|
||||
* state by passing a 'toggle' value of -1.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
|
||||
|
||||
/* Used as a mask when testing buttons in buttonstate
|
||||
Button 1: Left mouse button
|
||||
Button 2: Middle mouse button
|
||||
Button 3: Right mouse button
|
||||
Button 4: Mouse wheel up (may also be a real button)
|
||||
Button 5: Mouse wheel down (may also be a real button)
|
||||
*/
|
||||
#define SDL_BUTTON(X) (1 << ((X)-1))
|
||||
#define SDL_BUTTON_LEFT 1
|
||||
#define SDL_BUTTON_MIDDLE 2
|
||||
#define SDL_BUTTON_RIGHT 3
|
||||
#define SDL_BUTTON_WHEELUP 4
|
||||
#define SDL_BUTTON_WHEELDOWN 5
|
||||
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
|
||||
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
|
||||
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_mouse_h */
|
||||
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_mutex_h
|
||||
#define _SDL_mutex_h
|
||||
|
||||
/* Functions to provide thread synchronization primitives
|
||||
|
||||
These are independent of the other SDL routines.
|
||||
*/
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Synchronization functions which can time out return this value
|
||||
if they time out.
|
||||
*/
|
||||
#define SDL_MUTEX_TIMEDOUT 1
|
||||
|
||||
/* This is the timeout value which corresponds to never time out */
|
||||
#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* Mutex functions */
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* The SDL mutex structure, defined in SDL_mutex.c */
|
||||
struct SDL_mutex;
|
||||
typedef struct SDL_mutex SDL_mutex;
|
||||
|
||||
/* Create a mutex, initialized unlocked */
|
||||
extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
|
||||
|
||||
/* Lock the mutex (Returns 0, or -1 on error) */
|
||||
#define SDL_LockMutex(m) SDL_mutexP(m)
|
||||
extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
|
||||
|
||||
/* Unlock the mutex (Returns 0, or -1 on error)
|
||||
It is an error to unlock a mutex that has not been locked by
|
||||
the current thread, and doing so results in undefined behavior.
|
||||
*/
|
||||
#define SDL_UnlockMutex(m) SDL_mutexV(m)
|
||||
extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex);
|
||||
|
||||
/* Destroy a mutex */
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex);
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* Semaphore functions */
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* The SDL semaphore structure, defined in SDL_sem.c */
|
||||
struct SDL_semaphore;
|
||||
typedef struct SDL_semaphore SDL_sem;
|
||||
|
||||
/* Create a semaphore, initialized with value, returns NULL on failure. */
|
||||
extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
|
||||
|
||||
/* Destroy a semaphore */
|
||||
extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
|
||||
|
||||
/* This function suspends the calling thread until the semaphore pointed
|
||||
* to by sem has a positive count. It then atomically decreases the semaphore
|
||||
* count.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem);
|
||||
|
||||
/* Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds,
|
||||
SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem);
|
||||
|
||||
/* Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if
|
||||
the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
|
||||
the allotted time, and -1 on error.
|
||||
On some platforms this function is implemented by looping with a delay
|
||||
of 1 ms, and so should be avoided if possible.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms);
|
||||
|
||||
/* Atomically increases the semaphore's count (not blocking), returns 0,
|
||||
or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem);
|
||||
|
||||
/* Returns the current count of the semaphore */
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem);
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* Condition variable functions */
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* The SDL condition variable structure, defined in SDL_cond.c */
|
||||
struct SDL_cond;
|
||||
typedef struct SDL_cond SDL_cond;
|
||||
|
||||
/* Create a condition variable */
|
||||
extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void);
|
||||
|
||||
/* Destroy a condition variable */
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond);
|
||||
|
||||
/* Restart one of the threads that are waiting on the condition variable,
|
||||
returns 0 or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond);
|
||||
|
||||
/* Restart all threads that are waiting on the condition variable,
|
||||
returns 0 or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond);
|
||||
|
||||
/* Wait on the condition variable, unlocking the provided mutex.
|
||||
The mutex must be locked before entering this function!
|
||||
The mutex is re-locked once the condition variable is signaled.
|
||||
Returns 0 when it is signaled, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);
|
||||
|
||||
/* Waits for at most 'ms' milliseconds, and returns 0 if the condition
|
||||
variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
|
||||
signaled in the allotted time, and -1 on error.
|
||||
On some platforms this function is implemented by looping with a delay
|
||||
of 1 ms, and so should be avoided if possible.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_mutex_h */
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
#ifndef _SDLname_h_
|
||||
#define _SDLname_h_
|
||||
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
#define NeedFunctionPrototypes 1
|
||||
#endif
|
||||
|
||||
#define SDL_NAME(X) SDL_##X
|
||||
|
||||
#endif /* _SDLname_h_ */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Try to get a standard set of platform defines */
|
||||
|
||||
#ifndef _SDL_platform_h
|
||||
#define _SDL_platform_h
|
||||
|
||||
#if defined(_AIX)
|
||||
#undef __AIX__
|
||||
#define __AIX__ 1
|
||||
#endif
|
||||
#if defined(__BEOS__)
|
||||
#undef __BEOS__
|
||||
#define __BEOS__ 1
|
||||
#endif
|
||||
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
|
||||
#undef __BSDI__
|
||||
#define __BSDI__ 1
|
||||
#endif
|
||||
#if defined(_arch_dreamcast)
|
||||
#undef __DREAMCAST__
|
||||
#define __DREAMCAST__ 1
|
||||
#endif
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
#undef __FREEBSD__
|
||||
#define __FREEBSD__ 1
|
||||
#endif
|
||||
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
|
||||
#undef __HPUX__
|
||||
#define __HPUX__ 1
|
||||
#endif
|
||||
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
|
||||
#undef __IRIX__
|
||||
#define __IRIX__ 1
|
||||
#endif
|
||||
#if defined(linux) || defined(__linux) || defined(__linux__)
|
||||
#undef __LINUX__
|
||||
#define __LINUX__ 1
|
||||
#endif
|
||||
#if defined(__APPLE__)
|
||||
#undef __MACOSX__
|
||||
#define __MACOSX__ 1
|
||||
#elif defined(macintosh)
|
||||
#undef __MACOS__
|
||||
#define __MACOS__ 1
|
||||
#endif
|
||||
#if defined(__NetBSD__)
|
||||
#undef __NETBSD__
|
||||
#define __NETBSD__ 1
|
||||
#endif
|
||||
#if defined(__OpenBSD__)
|
||||
#undef __OPENBSD__
|
||||
#define __OPENBSD__ 1
|
||||
#endif
|
||||
#if defined(__OS2__)
|
||||
#undef __OS2__
|
||||
#define __OS2__ 1
|
||||
#endif
|
||||
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
|
||||
#undef __OSF__
|
||||
#define __OSF__ 1
|
||||
#endif
|
||||
#if defined(__QNXNTO__)
|
||||
#undef __QNXNTO__
|
||||
#define __QNXNTO__ 1
|
||||
#endif
|
||||
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
|
||||
#undef __RISCOS__
|
||||
#define __RISCOS__ 1
|
||||
#endif
|
||||
#if defined(__SVR4)
|
||||
#undef __SOLARIS__
|
||||
#define __SOLARIS__ 1
|
||||
#endif
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
#undef __WIN32__
|
||||
#define __WIN32__ 1
|
||||
#endif
|
||||
|
||||
#endif /* _SDL_platform_h */
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Include file for SDL quit event handling */
|
||||
|
||||
#ifndef _SDL_quit_h
|
||||
#define _SDL_quit_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
/*
|
||||
An SDL_QUITEVENT is generated when the user tries to close the application
|
||||
window. If it is ignored or filtered out, the window will remain open.
|
||||
If it is not ignored or filtered, it is queued normally and the window
|
||||
is allowed to close. When the window is closed, screen updates will
|
||||
complete, but have no effect.
|
||||
|
||||
SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
|
||||
and SIGTERM (system termination request), if handlers do not already
|
||||
exist, that generate SDL_QUITEVENT events as well. There is no way
|
||||
to determine the cause of an SDL_QUITEVENT, but setting a signal
|
||||
handler in your application will override the default generation of
|
||||
quit events for that signal.
|
||||
*/
|
||||
|
||||
/* There are no functions directly affecting the quit event */
|
||||
#define SDL_QuitRequested() \
|
||||
(SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK))
|
||||
|
||||
#endif /* _SDL_quit_h */
|
||||
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* This file provides a general interface for SDL to read and write
|
||||
data sources. It can easily be extended to files, memory, etc.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_rwops_h
|
||||
#define _SDL_rwops_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This is the read/write operation structure -- very basic */
|
||||
|
||||
typedef struct SDL_RWops {
|
||||
/* Seek to 'offset' relative to whence, one of stdio's whence values:
|
||||
SEEK_SET, SEEK_CUR, SEEK_END
|
||||
Returns the final offset in the data source.
|
||||
*/
|
||||
int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence);
|
||||
|
||||
/* Read up to 'num' objects each of size 'objsize' from the data
|
||||
source to the area pointed at by 'ptr'.
|
||||
Returns the number of objects read, or -1 if the read failed.
|
||||
*/
|
||||
int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
|
||||
|
||||
/* Write exactly 'num' objects each of size 'objsize' from the area
|
||||
pointed at by 'ptr' to data source.
|
||||
Returns 'num', or -1 if the write failed.
|
||||
*/
|
||||
int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
|
||||
|
||||
/* Close and free an allocated SDL_FSops structure */
|
||||
int (SDLCALL *close)(struct SDL_RWops *context);
|
||||
|
||||
Uint32 type;
|
||||
union {
|
||||
#if defined(__WIN32__) && !defined(__SYMBIAN32__)
|
||||
struct {
|
||||
int append;
|
||||
void *h;
|
||||
struct {
|
||||
void *data;
|
||||
int size;
|
||||
int left;
|
||||
} buffer;
|
||||
} win32io;
|
||||
#endif
|
||||
#ifdef HAVE_STDIO_H
|
||||
struct {
|
||||
int autoclose;
|
||||
FILE *fp;
|
||||
} stdio;
|
||||
#endif
|
||||
struct {
|
||||
Uint8 *base;
|
||||
Uint8 *here;
|
||||
Uint8 *stop;
|
||||
} mem;
|
||||
struct {
|
||||
void *data1;
|
||||
} unknown;
|
||||
} hidden;
|
||||
|
||||
} SDL_RWops;
|
||||
|
||||
|
||||
/* Functions to create SDL_RWops structures from various data sources */
|
||||
|
||||
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode);
|
||||
|
||||
#ifdef HAVE_STDIO_H
|
||||
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose);
|
||||
#endif
|
||||
|
||||
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size);
|
||||
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size);
|
||||
|
||||
extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void);
|
||||
extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area);
|
||||
|
||||
#define RW_SEEK_SET 0 /* Seek from the beginning of data */
|
||||
#define RW_SEEK_CUR 1 /* Seek relative to current read point */
|
||||
#define RW_SEEK_END 2 /* Seek relative to the end of data */
|
||||
|
||||
/* Macros to easily read and write from an SDL_RWops structure */
|
||||
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
|
||||
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
|
||||
#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
|
||||
#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
|
||||
#define SDL_RWclose(ctx) (ctx)->close(ctx)
|
||||
|
||||
|
||||
/* Read an item of the specified endianness and return in native format */
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src);
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src);
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src);
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src);
|
||||
|
||||
/* Write an item of native format to the specified endianness */
|
||||
extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value);
|
||||
extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value);
|
||||
extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value);
|
||||
extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value);
|
||||
extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value);
|
||||
extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_rwops_h */
|
||||
@@ -1,594 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* This is a general header that includes C language support */
|
||||
|
||||
#ifndef _SDL_stdinc_h
|
||||
#define _SDL_stdinc_h
|
||||
|
||||
#include "SDL_config.h"
|
||||
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#if defined(STDC_HEADERS)
|
||||
# include <stdlib.h>
|
||||
# include <stddef.h>
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# if defined(HAVE_STDLIB_H)
|
||||
# include <stdlib.h>
|
||||
# elif defined(HAVE_MALLOC_H)
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
# if defined(HAVE_STDDEF_H)
|
||||
# include <stddef.h>
|
||||
# endif
|
||||
# if defined(HAVE_STDARG_H)
|
||||
# include <stdarg.h>
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
|
||||
# include <memory.h>
|
||||
# endif
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#if defined(HAVE_INTTYPES_H)
|
||||
# include <inttypes.h>
|
||||
#elif defined(HAVE_STDINT_H)
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#ifdef HAVE_CTYPE_H
|
||||
# include <ctype.h>
|
||||
#endif
|
||||
#ifdef HAVE_ICONV_H
|
||||
# include <iconv.h>
|
||||
#endif
|
||||
|
||||
/* The number of elements in an array */
|
||||
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
|
||||
#define SDL_TABLESIZE(table) SDL_arraysize(table)
|
||||
|
||||
/* Basic data types */
|
||||
typedef enum SDL_bool {
|
||||
SDL_FALSE = 0,
|
||||
SDL_TRUE = 1
|
||||
} SDL_bool;
|
||||
|
||||
typedef int8_t Sint8;
|
||||
typedef uint8_t Uint8;
|
||||
typedef int16_t Sint16;
|
||||
typedef uint16_t Uint16;
|
||||
typedef int32_t Sint32;
|
||||
typedef uint32_t Uint32;
|
||||
|
||||
#ifdef SDL_HAS_64BIT_TYPE
|
||||
typedef int64_t Sint64;
|
||||
#ifndef SYMBIAN32_GCCE
|
||||
typedef uint64_t Uint64;
|
||||
#endif
|
||||
#else
|
||||
/* This is really just a hack to prevent the compiler from complaining */
|
||||
typedef struct {
|
||||
Uint32 hi;
|
||||
Uint32 lo;
|
||||
} Uint64, Sint64;
|
||||
#endif
|
||||
|
||||
/* Make sure the types really have the right sizes */
|
||||
#define SDL_COMPILE_TIME_ASSERT(name, x) \
|
||||
typedef int SDL_dummy_ ## name[(x) * 2 - 1]
|
||||
|
||||
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
|
||||
SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
|
||||
SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
|
||||
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
|
||||
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
|
||||
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
|
||||
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
|
||||
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
|
||||
|
||||
/* Check to make sure enums are the size of ints, for structure packing.
|
||||
For both Watcom C/C++ and Borland C/C++ the compiler option that makes
|
||||
enums having the size of an int must be enabled.
|
||||
This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
|
||||
*/
|
||||
/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */
|
||||
#ifdef __MWERKS__
|
||||
#pragma enumsalwaysint on
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
DUMMY_ENUM_VALUE
|
||||
} SDL_DUMMY_ENUM;
|
||||
|
||||
#ifndef __NDS__
|
||||
SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
|
||||
#endif
|
||||
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC
|
||||
#define SDL_malloc malloc
|
||||
#else
|
||||
extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CALLOC
|
||||
#define SDL_calloc calloc
|
||||
#else
|
||||
extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_REALLOC
|
||||
#define SDL_realloc realloc
|
||||
#else
|
||||
extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FREE
|
||||
#define SDL_free free
|
||||
#else
|
||||
extern DECLSPEC void SDLCALL SDL_free(void *mem);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_ALLOCA) && !defined(alloca)
|
||||
# if defined(HAVE_ALLOCA_H)
|
||||
# include <alloca.h>
|
||||
# elif defined(__GNUC__)
|
||||
# define alloca __builtin_alloca
|
||||
# elif defined(_MSC_VER)
|
||||
# include <malloc.h>
|
||||
# define alloca _alloca
|
||||
# elif defined(__WATCOMC__)
|
||||
# include <malloc.h>
|
||||
# elif defined(__DMC__)
|
||||
# include <stdlib.h>
|
||||
# elif defined(__AIX__)
|
||||
#pragma alloca
|
||||
# elif defined(__MRC__)
|
||||
void *alloca (unsigned);
|
||||
# else
|
||||
char *alloca ();
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_ALLOCA
|
||||
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
|
||||
#define SDL_stack_free(data)
|
||||
#else
|
||||
#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count))
|
||||
#define SDL_stack_free(data) SDL_free(data)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETENV
|
||||
#define SDL_getenv getenv
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PUTENV
|
||||
#define SDL_putenv putenv
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_QSORT
|
||||
#define SDL_qsort qsort
|
||||
#else
|
||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
|
||||
int (*compare)(const void *, const void *));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ABS
|
||||
#define SDL_abs abs
|
||||
#else
|
||||
#define SDL_abs(X) ((X) < 0 ? -(X) : (X))
|
||||
#endif
|
||||
|
||||
#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
|
||||
|
||||
#ifdef HAVE_CTYPE_H
|
||||
#define SDL_isdigit(X) isdigit(X)
|
||||
#define SDL_isspace(X) isspace(X)
|
||||
#define SDL_toupper(X) toupper(X)
|
||||
#define SDL_tolower(X) tolower(X)
|
||||
#else
|
||||
#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9'))
|
||||
#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n'))
|
||||
#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X))
|
||||
#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MEMSET
|
||||
#define SDL_memset memset
|
||||
#else
|
||||
extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(i386)
|
||||
#define SDL_memset4(dst, val, len) \
|
||||
do { \
|
||||
int u0, u1, u2; \
|
||||
__asm__ __volatile__ ( \
|
||||
"cld\n\t" \
|
||||
"rep ; stosl\n\t" \
|
||||
: "=&D" (u0), "=&a" (u1), "=&c" (u2) \
|
||||
: "0" (dst), "1" (val), "2" ((Uint32)(len)) \
|
||||
: "memory" ); \
|
||||
} while(0)
|
||||
#endif
|
||||
#ifndef SDL_memset4
|
||||
#define SDL_memset4(dst, val, len) \
|
||||
do { \
|
||||
unsigned _count = (len); \
|
||||
unsigned _n = (_count + 3) / 4; \
|
||||
Uint32 *_p = (Uint32 *)(dst); \
|
||||
Uint32 _val = (val); \
|
||||
switch (_count % 4) { \
|
||||
case 0: do { *_p++ = _val; \
|
||||
case 3: *_p++ = _val; \
|
||||
case 2: *_p++ = _val; \
|
||||
case 1: *_p++ = _val; \
|
||||
} while ( --_n ); \
|
||||
} \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
/* We can count on memcpy existing on Mac OS X and being well-tuned. */
|
||||
#if defined(__MACH__) && defined(__APPLE__)
|
||||
#define SDL_memcpy(dst, src, len) memcpy(dst, src, len)
|
||||
#elif defined(__GNUC__) && defined(i386)
|
||||
#define SDL_memcpy(dst, src, len) \
|
||||
do { \
|
||||
int u0, u1, u2; \
|
||||
__asm__ __volatile__ ( \
|
||||
"cld\n\t" \
|
||||
"rep ; movsl\n\t" \
|
||||
"testb $2,%b4\n\t" \
|
||||
"je 1f\n\t" \
|
||||
"movsw\n" \
|
||||
"1:\ttestb $1,%b4\n\t" \
|
||||
"je 2f\n\t" \
|
||||
"movsb\n" \
|
||||
"2:" \
|
||||
: "=&c" (u0), "=&D" (u1), "=&S" (u2) \
|
||||
: "0" ((unsigned)(len)/4), "q" (len), "1" (dst),"2" (src) \
|
||||
: "memory" ); \
|
||||
} while(0)
|
||||
#endif
|
||||
#ifndef SDL_memcpy
|
||||
#ifdef HAVE_MEMCPY
|
||||
#define SDL_memcpy memcpy
|
||||
#elif defined(HAVE_BCOPY)
|
||||
#define SDL_memcpy(d, s, n) bcopy((s), (d), (n))
|
||||
#else
|
||||
extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* We can count on memcpy existing on Mac OS X and being well-tuned. */
|
||||
#if defined(__MACH__) && defined(__APPLE__)
|
||||
#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
|
||||
#elif defined(__GNUC__) && defined(i386)
|
||||
#define SDL_memcpy4(dst, src, len) \
|
||||
do { \
|
||||
int ecx, edi, esi; \
|
||||
__asm__ __volatile__ ( \
|
||||
"cld\n\t" \
|
||||
"rep ; movsl" \
|
||||
: "=&c" (ecx), "=&D" (edi), "=&S" (esi) \
|
||||
: "0" ((unsigned)(len)), "1" (dst), "2" (src) \
|
||||
: "memory" ); \
|
||||
} while(0)
|
||||
#endif
|
||||
#ifndef SDL_memcpy4
|
||||
#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(i386)
|
||||
#define SDL_revcpy(dst, src, len) \
|
||||
do { \
|
||||
int u0, u1, u2; \
|
||||
char *dstp = (char *)(dst); \
|
||||
char *srcp = (char *)(src); \
|
||||
int n = (len); \
|
||||
if ( n >= 4 ) { \
|
||||
__asm__ __volatile__ ( \
|
||||
"std\n\t" \
|
||||
"rep ; movsl\n\t" \
|
||||
: "=&c" (u0), "=&D" (u1), "=&S" (u2) \
|
||||
: "0" (n >> 2), \
|
||||
"1" (dstp+(n-4)), "2" (srcp+(n-4)) \
|
||||
: "memory" ); \
|
||||
} \
|
||||
switch (n & 3) { \
|
||||
case 3: dstp[2] = srcp[2]; \
|
||||
case 2: dstp[1] = srcp[1]; \
|
||||
case 1: dstp[0] = srcp[0]; \
|
||||
break; \
|
||||
default: \
|
||||
break; \
|
||||
} \
|
||||
} while(0)
|
||||
#endif
|
||||
#ifndef SDL_revcpy
|
||||
extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MEMMOVE
|
||||
#define SDL_memmove memmove
|
||||
#elif defined(HAVE_BCOPY)
|
||||
#define SDL_memmove(d, s, n) bcopy((s), (d), (n))
|
||||
#else
|
||||
#define SDL_memmove(dst, src, len) \
|
||||
do { \
|
||||
if ( dst < src ) { \
|
||||
SDL_memcpy(dst, src, len); \
|
||||
} else { \
|
||||
SDL_revcpy(dst, src, len); \
|
||||
} \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MEMCMP
|
||||
#define SDL_memcmp memcmp
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRLEN
|
||||
#define SDL_strlen strlen
|
||||
#else
|
||||
extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRLCPY
|
||||
#define SDL_strlcpy strlcpy
|
||||
#else
|
||||
extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRLCAT
|
||||
#define SDL_strlcat strlcat
|
||||
#else
|
||||
extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRDUP
|
||||
#define SDL_strdup strdup
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strdup(const char *string);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__STRREV
|
||||
#define SDL_strrev _strrev
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strrev(char *string);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__STRUPR
|
||||
#define SDL_strupr _strupr
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strupr(char *string);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__STRLWR
|
||||
#define SDL_strlwr _strlwr
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strlwr(char *string);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRCHR
|
||||
#define SDL_strchr strchr
|
||||
#elif defined(HAVE_INDEX)
|
||||
#define SDL_strchr index
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRRCHR
|
||||
#define SDL_strrchr strrchr
|
||||
#elif defined(HAVE_RINDEX)
|
||||
#define SDL_strrchr rindex
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRSTR
|
||||
#define SDL_strstr strstr
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ITOA
|
||||
#define SDL_itoa itoa
|
||||
#else
|
||||
#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__LTOA
|
||||
#define SDL_ltoa _ltoa
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__UITOA
|
||||
#define SDL_uitoa _uitoa
|
||||
#else
|
||||
#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__ULTOA
|
||||
#define SDL_ultoa _ultoa
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRTOL
|
||||
#define SDL_strtol strtol
|
||||
#else
|
||||
extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRTOUL
|
||||
#define SDL_strtoul strtoul
|
||||
#else
|
||||
extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base);
|
||||
#endif
|
||||
|
||||
#ifdef SDL_HAS_64BIT_TYPE
|
||||
|
||||
#ifdef HAVE__I64TOA
|
||||
#define SDL_lltoa _i64toa
|
||||
#else
|
||||
extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__UI64TOA
|
||||
#define SDL_ulltoa _ui64toa
|
||||
#else
|
||||
extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRTOLL
|
||||
#define SDL_strtoll strtoll
|
||||
#else
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRTOULL
|
||||
#define SDL_strtoull strtoull
|
||||
#else
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base);
|
||||
#endif
|
||||
|
||||
#endif /* SDL_HAS_64BIT_TYPE */
|
||||
|
||||
#ifdef HAVE_STRTOD
|
||||
#define SDL_strtod strtod
|
||||
#else
|
||||
extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ATOI
|
||||
#define SDL_atoi atoi
|
||||
#else
|
||||
#define SDL_atoi(X) SDL_strtol(X, NULL, 0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ATOF
|
||||
#define SDL_atof atof
|
||||
#else
|
||||
#define SDL_atof(X) SDL_strtod(X, NULL)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRCMP
|
||||
#define SDL_strcmp strcmp
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRNCMP
|
||||
#define SDL_strncmp strncmp
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRCASECMP
|
||||
#define SDL_strcasecmp strcasecmp
|
||||
#elif defined(HAVE__STRICMP)
|
||||
#define SDL_strcasecmp _stricmp
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRNCASECMP
|
||||
#define SDL_strncasecmp strncasecmp
|
||||
#elif defined(HAVE__STRNICMP)
|
||||
#define SDL_strncasecmp _strnicmp
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SSCANF
|
||||
#define SDL_sscanf sscanf
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SNPRINTF
|
||||
#define SDL_snprintf snprintf
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_VSNPRINTF
|
||||
#define SDL_vsnprintf vsnprintf
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
|
||||
#endif
|
||||
|
||||
/* The SDL implementation of iconv() returns these error codes */
|
||||
#define SDL_ICONV_ERROR (size_t)-1
|
||||
#define SDL_ICONV_E2BIG (size_t)-2
|
||||
#define SDL_ICONV_EILSEQ (size_t)-3
|
||||
#define SDL_ICONV_EINVAL (size_t)-4
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
#define SDL_iconv_t iconv_t
|
||||
#define SDL_iconv_open iconv_open
|
||||
#define SDL_iconv_close iconv_close
|
||||
#else
|
||||
typedef struct _SDL_iconv_t *SDL_iconv_t;
|
||||
extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode);
|
||||
extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
|
||||
#endif
|
||||
extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
|
||||
/* This function converts a string between encodings in one pass, returning a
|
||||
string that must be freed with SDL_free() or NULL on error.
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft);
|
||||
#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
|
||||
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
|
||||
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_stdinc_h */
|
||||
@@ -1,214 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Include file for SDL custom system window manager hooks */
|
||||
|
||||
#ifndef _SDL_syswm_h
|
||||
#define _SDL_syswm_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_version.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Your application has access to a special type of event 'SDL_SYSWMEVENT',
|
||||
which contains window-manager specific information and arrives whenever
|
||||
an unhandled window event occurs. This event is ignored by default, but
|
||||
you can enable it with SDL_EventState()
|
||||
*/
|
||||
#ifdef SDL_PROTOTYPES_ONLY
|
||||
struct SDL_SysWMinfo;
|
||||
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
|
||||
#else
|
||||
|
||||
/* This is the structure for custom window manager events */
|
||||
#if defined(SDL_VIDEO_DRIVER_X11)
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
/* conflicts with Quickdraw.h */
|
||||
#define Cursor X11Cursor
|
||||
#endif
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
/* matches the re-define above */
|
||||
#undef Cursor
|
||||
#endif
|
||||
|
||||
/* These are the various supported subsystems under UNIX */
|
||||
typedef enum {
|
||||
SDL_SYSWM_X11
|
||||
} SDL_SYSWM_TYPE;
|
||||
|
||||
/* The UNIX custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
SDL_SYSWM_TYPE subsystem;
|
||||
union {
|
||||
XEvent xevent;
|
||||
} event;
|
||||
};
|
||||
|
||||
/* The UNIX custom window manager information structure.
|
||||
When this structure is returned, it holds information about which
|
||||
low level system it is using, and will be one of SDL_SYSWM_TYPE.
|
||||
*/
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
SDL_SYSWM_TYPE subsystem;
|
||||
union {
|
||||
struct {
|
||||
Display *display; /* The X11 display */
|
||||
Window window; /* The X11 display window */
|
||||
/* These locking functions should be called around
|
||||
any X11 functions using the display variable,
|
||||
but not the gfxdisplay variable.
|
||||
They lock the event thread, so should not be
|
||||
called around event functions or from event filters.
|
||||
*/
|
||||
void (*lock_func)(void);
|
||||
void (*unlock_func)(void);
|
||||
|
||||
/* Introduced in SDL 1.0.2 */
|
||||
Window fswindow; /* The X11 fullscreen window */
|
||||
Window wmwindow; /* The X11 managed input window */
|
||||
|
||||
/* Introduced in SDL 1.2.12 */
|
||||
Display *gfxdisplay; /* The X11 display to which rendering is done */
|
||||
} x11;
|
||||
} info;
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_NANOX)
|
||||
#include <microwin/nano-X.h>
|
||||
|
||||
/* The generic custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
int data;
|
||||
};
|
||||
|
||||
/* The windows custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version ;
|
||||
GR_WINDOW_ID window ; /* The display window */
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
/* The windows custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
HWND hwnd; /* The window for the message */
|
||||
UINT msg; /* The type of message */
|
||||
WPARAM wParam; /* WORD message parameter */
|
||||
LPARAM lParam; /* LONG message parameter */
|
||||
};
|
||||
|
||||
/* The windows custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
HWND window; /* The Win32 display window */
|
||||
HGLRC hglrc; /* The OpenGL context, if any */
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_RISCOS)
|
||||
|
||||
/* RISC OS custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
int eventCode; /* The window for the message */
|
||||
int pollBlock[64];
|
||||
};
|
||||
|
||||
/* The RISC OS custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
int wimpVersion; /* Wimp version running under */
|
||||
int taskHandle; /* The RISC OS task handle */
|
||||
int window; /* The RISC OS display window */
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_PHOTON)
|
||||
#include <sys/neutrino.h>
|
||||
#include <Ph.h>
|
||||
|
||||
/* The QNX custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
int data;
|
||||
};
|
||||
|
||||
/* The QNX custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
int data;
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#else
|
||||
|
||||
/* The generic custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
int data;
|
||||
};
|
||||
|
||||
/* The generic custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
int data;
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#endif /* video driver type */
|
||||
|
||||
#endif /* SDL_PROTOTYPES_ONLY */
|
||||
|
||||
/* Function prototypes */
|
||||
/*
|
||||
* This function gives you custom hooks into the window manager information.
|
||||
* It fills the structure pointed to by 'info' with custom information and
|
||||
* returns 1 if the function is implemented. If it's not implemented, or
|
||||
* the version member of the 'info' structure is invalid, it returns 0.
|
||||
*
|
||||
* You typically use this function like this:
|
||||
* SDL_SysWMInfo info;
|
||||
* SDL_VERSION(&info.version);
|
||||
* if ( SDL_GetWMInfo(&info) ) { ... }
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_syswm_h */
|
||||
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_thread_h
|
||||
#define _SDL_thread_h
|
||||
|
||||
/* Header for the SDL thread management routines
|
||||
|
||||
These are independent of the other SDL routines.
|
||||
*/
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
/* Thread synchronization primitives */
|
||||
#include "SDL_mutex.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* The SDL thread structure, defined in SDL_thread.c */
|
||||
struct SDL_Thread;
|
||||
typedef struct SDL_Thread SDL_Thread;
|
||||
|
||||
/* Create a thread */
|
||||
#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__)
|
||||
/*
|
||||
We compile SDL into a DLL on OS/2. This means, that it's the DLL which
|
||||
creates a new thread for the calling process with the SDL_CreateThread()
|
||||
API. There is a problem with this, that only the RTL of the SDL.DLL will
|
||||
be initialized for those threads, and not the RTL of the calling application!
|
||||
To solve this, we make a little hack here.
|
||||
We'll always use the caller's _beginthread() and _endthread() APIs to
|
||||
start a new thread. This way, if it's the SDL.DLL which uses this API,
|
||||
then the RTL of SDL.DLL will be used to create the new thread, and if it's
|
||||
the application, then the RTL of the application will be used.
|
||||
So, in short:
|
||||
Always use the _beginthread() and _endthread() of the calling runtime library!
|
||||
*/
|
||||
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
|
||||
#ifndef _WIN32_WCE
|
||||
#include <process.h> /* This has _beginthread() and _endthread() defined! */
|
||||
#endif
|
||||
|
||||
#ifdef __OS2__
|
||||
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
|
||||
typedef void (*pfnSDL_CurrentEndThread)(void);
|
||||
#elif __GNUC__
|
||||
typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
|
||||
unsigned (__stdcall *func)(void *), void *arg,
|
||||
unsigned, unsigned *threadID);
|
||||
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
|
||||
#else
|
||||
typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
|
||||
unsigned (__stdcall *func)(void *), void *arg,
|
||||
unsigned, unsigned *threadID);
|
||||
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
|
||||
#endif
|
||||
|
||||
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
|
||||
|
||||
#ifdef __OS2__
|
||||
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread)
|
||||
#elif defined(_WIN32_WCE)
|
||||
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL)
|
||||
#else
|
||||
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex)
|
||||
#endif
|
||||
#else
|
||||
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data);
|
||||
#endif
|
||||
|
||||
/* Get the 32-bit thread identifier for the current thread */
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
|
||||
|
||||
/* Get the 32-bit thread identifier for the specified thread,
|
||||
equivalent to SDL_ThreadID() if the specified thread is NULL.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
|
||||
|
||||
/* Wait for a thread to finish.
|
||||
The return code for the thread function is placed in the area
|
||||
pointed to by 'status', if 'status' is not NULL.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status);
|
||||
|
||||
/* Forcefully kill a thread without worrying about its state */
|
||||
extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_thread_h */
|
||||
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_timer_h
|
||||
#define _SDL_timer_h
|
||||
|
||||
/* Header for the SDL time management routines */
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This is the OS scheduler timeslice, in milliseconds */
|
||||
#define SDL_TIMESLICE 10
|
||||
|
||||
/* This is the maximum resolution of the SDL timer on all platforms */
|
||||
#define TIMER_RESOLUTION 10 /* Experimentally determined */
|
||||
|
||||
/* Get the number of milliseconds since the SDL library initialization.
|
||||
* Note that this value wraps if the program runs for more than ~49 days.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
|
||||
|
||||
/* Wait a specified number of milliseconds before returning */
|
||||
extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
|
||||
|
||||
/* Function prototype for the timer callback function */
|
||||
typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval);
|
||||
|
||||
/* Set a callback to run after the specified number of milliseconds has
|
||||
* elapsed. The callback function is passed the current timer interval
|
||||
* and returns the next timer interval. If the returned value is the
|
||||
* same as the one passed in, the periodic alarm continues, otherwise a
|
||||
* new alarm is scheduled. If the callback returns 0, the periodic alarm
|
||||
* is cancelled.
|
||||
*
|
||||
* To cancel a currently running timer, call SDL_SetTimer(0, NULL);
|
||||
*
|
||||
* The timer callback function may run in a different thread than your
|
||||
* main code, and so shouldn't call any functions from within itself.
|
||||
*
|
||||
* The maximum resolution of this timer is 10 ms, which means that if
|
||||
* you request a 16 ms timer, your callback will run approximately 20 ms
|
||||
* later on an unloaded system. If you wanted to set a flag signaling
|
||||
* a frame update at 30 frames per second (every 33 ms), you might set a
|
||||
* timer for 30 ms:
|
||||
* SDL_SetTimer((33/10)*10, flag_update);
|
||||
*
|
||||
* If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init().
|
||||
*
|
||||
* Under UNIX, you should not use raise or use SIGALRM and this function
|
||||
* in the same program, as it is implemented using setitimer(). You also
|
||||
* should not use this function in multi-threaded applications as signals
|
||||
* to multi-threaded apps have undefined behavior in some implementations.
|
||||
*
|
||||
* This function returns 0 if successful, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
|
||||
|
||||
/* New timer API, supports multiple timers
|
||||
* Written by Stephane Peter <megastep@lokigames.com>
|
||||
*/
|
||||
|
||||
/* Function prototype for the new timer callback function.
|
||||
* The callback function is passed the current timer interval and returns
|
||||
* the next timer interval. If the returned value is the same as the one
|
||||
* passed in, the periodic alarm continues, otherwise a new alarm is
|
||||
* scheduled. If the callback returns 0, the periodic alarm is cancelled.
|
||||
*/
|
||||
typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param);
|
||||
|
||||
/* Definition of the timer ID type */
|
||||
typedef struct _SDL_TimerID *SDL_TimerID;
|
||||
|
||||
/* Add a new timer to the pool of timers already running.
|
||||
Returns a timer ID, or NULL when an error occurs.
|
||||
*/
|
||||
extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
|
||||
|
||||
/* Remove one of the multiple timers knowing its ID.
|
||||
* Returns a boolean value indicating success.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_timer_h */
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* DEPRECATED */
|
||||
#include "SDL_stdinc.h"
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* This header defines the current SDL version */
|
||||
|
||||
#ifndef _SDL_version_h
|
||||
#define _SDL_version_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
|
||||
*/
|
||||
#define SDL_MAJOR_VERSION 1
|
||||
#define SDL_MINOR_VERSION 2
|
||||
#define SDL_PATCHLEVEL 12
|
||||
|
||||
typedef struct SDL_version {
|
||||
Uint8 major;
|
||||
Uint8 minor;
|
||||
Uint8 patch;
|
||||
} SDL_version;
|
||||
|
||||
/* This macro can be used to fill a version structure with the compile-time
|
||||
* version of the SDL library.
|
||||
*/
|
||||
#define SDL_VERSION(X) \
|
||||
{ \
|
||||
(X)->major = SDL_MAJOR_VERSION; \
|
||||
(X)->minor = SDL_MINOR_VERSION; \
|
||||
(X)->patch = SDL_PATCHLEVEL; \
|
||||
}
|
||||
|
||||
/* This macro turns the version numbers into a numeric value:
|
||||
(1,2,3) -> (1203)
|
||||
This assumes that there will never be more than 100 patchlevels
|
||||
*/
|
||||
#define SDL_VERSIONNUM(X, Y, Z) \
|
||||
((X)*1000 + (Y)*100 + (Z))
|
||||
|
||||
/* This is the version number macro for the current SDL version */
|
||||
#define SDL_COMPILEDVERSION \
|
||||
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
|
||||
|
||||
/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
|
||||
#define SDL_VERSION_ATLEAST(X, Y, Z) \
|
||||
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
|
||||
|
||||
/* This function gets the version of the dynamically linked SDL library.
|
||||
it should NOT be used to fill a version structure, instead you should
|
||||
use the SDL_Version() macro.
|
||||
*/
|
||||
extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_version_h */
|
||||
@@ -1,891 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* Header file for access to the SDL raw framebuffer window */
|
||||
|
||||
#ifndef _SDL_video_h
|
||||
#define _SDL_video_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_rwops.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Transparency definitions: These define alpha as the opacity of a surface */
|
||||
#define SDL_ALPHA_OPAQUE 255
|
||||
#define SDL_ALPHA_TRANSPARENT 0
|
||||
|
||||
/* Useful data types */
|
||||
typedef struct SDL_Rect {
|
||||
Sint16 x, y;
|
||||
Uint16 w, h;
|
||||
} SDL_Rect;
|
||||
|
||||
typedef struct SDL_Color {
|
||||
Uint8 r;
|
||||
Uint8 g;
|
||||
Uint8 b;
|
||||
Uint8 unused;
|
||||
} SDL_Color;
|
||||
#define SDL_Colour SDL_Color
|
||||
|
||||
typedef struct SDL_Palette {
|
||||
int ncolors;
|
||||
SDL_Color *colors;
|
||||
} SDL_Palette;
|
||||
|
||||
/* Everything in the pixel format structure is read-only */
|
||||
typedef struct SDL_PixelFormat {
|
||||
SDL_Palette *palette;
|
||||
Uint8 BitsPerPixel;
|
||||
Uint8 BytesPerPixel;
|
||||
Uint8 Rloss;
|
||||
Uint8 Gloss;
|
||||
Uint8 Bloss;
|
||||
Uint8 Aloss;
|
||||
Uint8 Rshift;
|
||||
Uint8 Gshift;
|
||||
Uint8 Bshift;
|
||||
Uint8 Ashift;
|
||||
Uint32 Rmask;
|
||||
Uint32 Gmask;
|
||||
Uint32 Bmask;
|
||||
Uint32 Amask;
|
||||
|
||||
/* RGB color key information */
|
||||
Uint32 colorkey;
|
||||
/* Alpha value information (per-surface alpha) */
|
||||
Uint8 alpha;
|
||||
} SDL_PixelFormat;
|
||||
|
||||
/* This structure should be treated as read-only, except for 'pixels',
|
||||
which, if not NULL, contains the raw pixel data for the surface.
|
||||
*/
|
||||
typedef struct SDL_Surface {
|
||||
Uint32 flags; /* Read-only */
|
||||
SDL_PixelFormat *format; /* Read-only */
|
||||
int w, h; /* Read-only */
|
||||
Uint16 pitch; /* Read-only */
|
||||
void *pixels; /* Read-write */
|
||||
int offset; /* Private */
|
||||
|
||||
/* Hardware-specific surface info */
|
||||
struct private_hwdata *hwdata;
|
||||
|
||||
/* clipping information */
|
||||
SDL_Rect clip_rect; /* Read-only */
|
||||
Uint32 unused1; /* for binary compatibility */
|
||||
|
||||
/* Allow recursive locks */
|
||||
Uint32 locked; /* Private */
|
||||
|
||||
/* info for fast blit mapping to other surfaces */
|
||||
struct SDL_BlitMap *map; /* Private */
|
||||
|
||||
/* format version, bumped at every change to invalidate blit maps */
|
||||
unsigned int format_version; /* Private */
|
||||
|
||||
/* Reference count -- used when freeing surface */
|
||||
int refcount; /* Read-mostly */
|
||||
} SDL_Surface;
|
||||
|
||||
/* These are the currently supported flags for the SDL_surface */
|
||||
/* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
|
||||
#define SDL_SWSURFACE 0x00000000 /* Surface is in system memory */
|
||||
#define SDL_HWSURFACE 0x00000001 /* Surface is in video memory */
|
||||
#define SDL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */
|
||||
/* Available for SDL_SetVideoMode() */
|
||||
#define SDL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
|
||||
#define SDL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
|
||||
#define SDL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */
|
||||
#define SDL_FULLSCREEN 0x80000000 /* Surface is a full screen display */
|
||||
#define SDL_OPENGL 0x00000002 /* Create an OpenGL rendering context */
|
||||
#define SDL_OPENGLBLIT 0x0000000A /* Create an OpenGL rendering context and use it for blitting */
|
||||
#define SDL_RESIZABLE 0x00000010 /* This video mode may be resized */
|
||||
#define SDL_NOFRAME 0x00000020 /* No window caption or edge frame */
|
||||
/* Used internally (read-only) */
|
||||
#define SDL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */
|
||||
#define SDL_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
|
||||
#define SDL_RLEACCELOK 0x00002000 /* Private flag */
|
||||
#define SDL_RLEACCEL 0x00004000 /* Surface is RLE encoded */
|
||||
#define SDL_SRCALPHA 0x00010000 /* Blit uses source alpha blending */
|
||||
#define SDL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
|
||||
|
||||
/* Evaluates to true if the surface needs to be locked before access */
|
||||
#define SDL_MUSTLOCK(surface) \
|
||||
(surface->offset || \
|
||||
((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
|
||||
|
||||
/* typedef for private surface blitting functions */
|
||||
typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
|
||||
struct SDL_Surface *dst, SDL_Rect *dstrect);
|
||||
|
||||
|
||||
/* Useful for determining the video hardware capabilities */
|
||||
typedef struct SDL_VideoInfo {
|
||||
Uint32 hw_available :1; /* Flag: Can you create hardware surfaces? */
|
||||
Uint32 wm_available :1; /* Flag: Can you talk to a window manager? */
|
||||
Uint32 UnusedBits1 :6;
|
||||
Uint32 UnusedBits2 :1;
|
||||
Uint32 blit_hw :1; /* Flag: Accelerated blits HW --> HW */
|
||||
Uint32 blit_hw_CC :1; /* Flag: Accelerated blits with Colorkey */
|
||||
Uint32 blit_hw_A :1; /* Flag: Accelerated blits with Alpha */
|
||||
Uint32 blit_sw :1; /* Flag: Accelerated blits SW --> HW */
|
||||
Uint32 blit_sw_CC :1; /* Flag: Accelerated blits with Colorkey */
|
||||
Uint32 blit_sw_A :1; /* Flag: Accelerated blits with Alpha */
|
||||
Uint32 blit_fill :1; /* Flag: Accelerated color fill */
|
||||
Uint32 UnusedBits3 :16;
|
||||
Uint32 video_mem; /* The total amount of video memory (in K) */
|
||||
SDL_PixelFormat *vfmt; /* Value: The format of the video surface */
|
||||
int current_w; /* Value: The current video mode width */
|
||||
int current_h; /* Value: The current video mode height */
|
||||
} SDL_VideoInfo;
|
||||
|
||||
|
||||
/* The most common video overlay formats.
|
||||
For an explanation of these pixel formats, see:
|
||||
http://www.webartz.com/fourcc/indexyuv.htm
|
||||
|
||||
For information on the relationship between color spaces, see:
|
||||
http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
|
||||
*/
|
||||
#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U (3 planes) */
|
||||
#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V (3 planes) */
|
||||
#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
|
||||
#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
|
||||
#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
|
||||
|
||||
/* The YUV hardware video overlay */
|
||||
typedef struct SDL_Overlay {
|
||||
Uint32 format; /* Read-only */
|
||||
int w, h; /* Read-only */
|
||||
int planes; /* Read-only */
|
||||
Uint16 *pitches; /* Read-only */
|
||||
Uint8 **pixels; /* Read-write */
|
||||
|
||||
/* Hardware-specific surface info */
|
||||
struct private_yuvhwfuncs *hwfuncs;
|
||||
struct private_yuvhwdata *hwdata;
|
||||
|
||||
/* Special flags */
|
||||
Uint32 hw_overlay :1; /* Flag: This overlay hardware accelerated? */
|
||||
Uint32 UnusedBits :31;
|
||||
} SDL_Overlay;
|
||||
|
||||
|
||||
/* Public enumeration for setting the OpenGL window attributes. */
|
||||
typedef enum {
|
||||
SDL_GL_RED_SIZE,
|
||||
SDL_GL_GREEN_SIZE,
|
||||
SDL_GL_BLUE_SIZE,
|
||||
SDL_GL_ALPHA_SIZE,
|
||||
SDL_GL_BUFFER_SIZE,
|
||||
SDL_GL_DOUBLEBUFFER,
|
||||
SDL_GL_DEPTH_SIZE,
|
||||
SDL_GL_STENCIL_SIZE,
|
||||
SDL_GL_ACCUM_RED_SIZE,
|
||||
SDL_GL_ACCUM_GREEN_SIZE,
|
||||
SDL_GL_ACCUM_BLUE_SIZE,
|
||||
SDL_GL_ACCUM_ALPHA_SIZE,
|
||||
SDL_GL_STEREO,
|
||||
SDL_GL_MULTISAMPLEBUFFERS,
|
||||
SDL_GL_MULTISAMPLESAMPLES,
|
||||
SDL_GL_ACCELERATED_VISUAL,
|
||||
SDL_GL_SWAP_CONTROL
|
||||
} SDL_GLattr;
|
||||
|
||||
/* flags for SDL_SetPalette() */
|
||||
#define SDL_LOGPAL 0x01
|
||||
#define SDL_PHYSPAL 0x02
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/* These functions are used internally, and should not be used unless you
|
||||
* have a specific need to specify the video driver you want to use.
|
||||
* You should normally use SDL_Init() or SDL_InitSubSystem().
|
||||
*
|
||||
* SDL_VideoInit() initializes the video subsystem -- sets up a connection
|
||||
* to the window manager, etc, and determines the current video mode and
|
||||
* pixel format, but does not initialize a window or graphics mode.
|
||||
* Note that event handling is activated by this routine.
|
||||
*
|
||||
* If you use both sound and video in your application, you need to call
|
||||
* SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
|
||||
* you won't be able to set full-screen display modes.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags);
|
||||
extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
|
||||
|
||||
/* This function fills the given character buffer with the name of the
|
||||
* video driver, and returns a pointer to it if the video driver has
|
||||
* been initialized. It returns NULL if no driver has been initialized.
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
|
||||
|
||||
/*
|
||||
* This function returns a pointer to the current display surface.
|
||||
* If SDL is doing format conversion on the display surface, this
|
||||
* function returns the publicly visible surface, not the real video
|
||||
* surface.
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void);
|
||||
|
||||
/*
|
||||
* This function returns a read-only pointer to information about the
|
||||
* video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt'
|
||||
* member of the returned structure will contain the pixel format of the
|
||||
* "best" video mode.
|
||||
*/
|
||||
extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void);
|
||||
|
||||
/*
|
||||
* Check to see if a particular video mode is supported.
|
||||
* It returns 0 if the requested mode is not supported under any bit depth,
|
||||
* or returns the bits-per-pixel of the closest available mode with the
|
||||
* given width and height. If this bits-per-pixel is different from the
|
||||
* one used when setting the video mode, SDL_SetVideoMode() will succeed,
|
||||
* but will emulate the requested bits-per-pixel with a shadow surface.
|
||||
*
|
||||
* The arguments to SDL_VideoModeOK() are the same ones you would pass to
|
||||
* SDL_SetVideoMode()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
|
||||
|
||||
/*
|
||||
* Return a pointer to an array of available screen dimensions for the
|
||||
* given format and video flags, sorted largest to smallest. Returns
|
||||
* NULL if there are no dimensions available for a particular format,
|
||||
* or (SDL_Rect **)-1 if any dimension is okay for the given format.
|
||||
*
|
||||
* If 'format' is NULL, the mode list will be for the format given
|
||||
* by SDL_GetVideoInfo()->vfmt
|
||||
*/
|
||||
extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
|
||||
|
||||
/*
|
||||
* Set up a video mode with the specified width, height and bits-per-pixel.
|
||||
*
|
||||
* If 'bpp' is 0, it is treated as the current display bits per pixel.
|
||||
*
|
||||
* If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
|
||||
* requested bits-per-pixel, but will return whatever video pixel format is
|
||||
* available. The default is to emulate the requested pixel format if it
|
||||
* is not natively available.
|
||||
*
|
||||
* If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
|
||||
* video memory, if possible, and you may have to call SDL_LockSurface()
|
||||
* in order to access the raw framebuffer. Otherwise, the video surface
|
||||
* will be created in system memory.
|
||||
*
|
||||
* If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
|
||||
* updates asynchronously, but you must always lock before accessing pixels.
|
||||
* SDL will wait for updates to complete before returning from the lock.
|
||||
*
|
||||
* If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
|
||||
* that the colors set by SDL_SetColors() will be the colors you get.
|
||||
* Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
|
||||
* of the colors exactly the way they are requested, and you should look
|
||||
* at the video surface structure to determine the actual palette.
|
||||
* If SDL cannot guarantee that the colors you request can be set,
|
||||
* i.e. if the colormap is shared, then the video surface may be created
|
||||
* under emulation in system memory, overriding the SDL_HWSURFACE flag.
|
||||
*
|
||||
* If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
|
||||
* a fullscreen video mode. The default is to create a windowed mode
|
||||
* if the current graphics system has a window manager.
|
||||
* If the SDL library is able to set a fullscreen video mode, this flag
|
||||
* will be set in the surface that is returned.
|
||||
*
|
||||
* If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
|
||||
* two surfaces in video memory and swap between them when you call
|
||||
* SDL_Flip(). This is usually slower than the normal single-buffering
|
||||
* scheme, but prevents "tearing" artifacts caused by modifying video
|
||||
* memory while the monitor is refreshing. It should only be used by
|
||||
* applications that redraw the entire screen on every update.
|
||||
*
|
||||
* If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
|
||||
* window manager, if any, to resize the window at runtime. When this
|
||||
* occurs, SDL will send a SDL_VIDEORESIZE event to you application,
|
||||
* and you must respond to the event by re-calling SDL_SetVideoMode()
|
||||
* with the requested size (or another size that suits the application).
|
||||
*
|
||||
* If SDL_NOFRAME is set in 'flags', the SDL library will create a window
|
||||
* without any title bar or frame decoration. Fullscreen video modes have
|
||||
* this flag set automatically.
|
||||
*
|
||||
* This function returns the video framebuffer surface, or NULL if it fails.
|
||||
*
|
||||
* If you rely on functionality provided by certain video flags, check the
|
||||
* flags of the returned surface to make sure that functionality is available.
|
||||
* SDL will fall back to reduced functionality if the exact flags you wanted
|
||||
* are not available.
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode
|
||||
(int width, int height, int bpp, Uint32 flags);
|
||||
|
||||
/*
|
||||
* Makes sure the given list of rectangles is updated on the given screen.
|
||||
* If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
|
||||
* screen.
|
||||
* These functions should not be called while 'screen' is locked.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UpdateRects
|
||||
(SDL_Surface *screen, int numrects, SDL_Rect *rects);
|
||||
extern DECLSPEC void SDLCALL SDL_UpdateRect
|
||||
(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
|
||||
|
||||
/*
|
||||
* On hardware that supports double-buffering, this function sets up a flip
|
||||
* and returns. The hardware will wait for vertical retrace, and then swap
|
||||
* video buffers before the next video surface blit or lock will return.
|
||||
* On hardware that doesn not support double-buffering, this is equivalent
|
||||
* to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
|
||||
* The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
|
||||
* setting the video mode for this function to perform hardware flipping.
|
||||
* This function returns 0 if successful, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen);
|
||||
|
||||
/*
|
||||
* Set the gamma correction for each of the color channels.
|
||||
* The gamma values range (approximately) between 0.1 and 10.0
|
||||
*
|
||||
* If this function isn't supported directly by the hardware, it will
|
||||
* be emulated using gamma ramps, if available. If successful, this
|
||||
* function returns 0, otherwise it returns -1.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
|
||||
|
||||
/*
|
||||
* Set the gamma translation table for the red, green, and blue channels
|
||||
* of the video hardware. Each table is an array of 256 16-bit quantities,
|
||||
* representing a mapping between the input and output for that channel.
|
||||
* The input is the index into the array, and the output is the 16-bit
|
||||
* gamma value at that index, scaled to the output color precision.
|
||||
*
|
||||
* You may pass NULL for any of the channels to leave it unchanged.
|
||||
* If the call succeeds, it will return 0. If the display driver or
|
||||
* hardware does not support gamma translation, or otherwise fails,
|
||||
* this function will return -1.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue);
|
||||
|
||||
/*
|
||||
* Retrieve the current values of the gamma translation tables.
|
||||
*
|
||||
* You must pass in valid pointers to arrays of 256 16-bit quantities.
|
||||
* Any of the pointers may be NULL to ignore that channel.
|
||||
* If the call succeeds, it will return 0. If the display driver or
|
||||
* hardware does not support gamma translation, or otherwise fails,
|
||||
* this function will return -1.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue);
|
||||
|
||||
/*
|
||||
* Sets a portion of the colormap for the given 8-bit surface. If 'surface'
|
||||
* is not a palettized surface, this function does nothing, returning 0.
|
||||
* If all of the colors were set as passed to SDL_SetColors(), it will
|
||||
* return 1. If not all the color entries were set exactly as given,
|
||||
* it will return 0, and you should look at the surface palette to
|
||||
* determine the actual color palette.
|
||||
*
|
||||
* When 'surface' is the surface associated with the current display, the
|
||||
* display colormap will be updated with the requested colors. If
|
||||
* SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
|
||||
* will always return 1, and the palette is guaranteed to be set the way
|
||||
* you desire, even if the window colormap has to be warped or run under
|
||||
* emulation.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface,
|
||||
SDL_Color *colors, int firstcolor, int ncolors);
|
||||
|
||||
/*
|
||||
* Sets a portion of the colormap for a given 8-bit surface.
|
||||
* 'flags' is one or both of:
|
||||
* SDL_LOGPAL -- set logical palette, which controls how blits are mapped
|
||||
* to/from the surface,
|
||||
* SDL_PHYSPAL -- set physical palette, which controls how pixels look on
|
||||
* the screen
|
||||
* Only screens have physical palettes. Separate change of physical/logical
|
||||
* palettes is only possible if the screen has SDL_HWPALETTE set.
|
||||
*
|
||||
* The return value is 1 if all colours could be set as requested, and 0
|
||||
* otherwise.
|
||||
*
|
||||
* SDL_SetColors() is equivalent to calling this function with
|
||||
* flags = (SDL_LOGPAL|SDL_PHYSPAL).
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
|
||||
SDL_Color *colors, int firstcolor,
|
||||
int ncolors);
|
||||
|
||||
/*
|
||||
* Maps an RGB triple to an opaque pixel value for a given pixel format
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
|
||||
(const SDL_PixelFormat * const format,
|
||||
const Uint8 r, const Uint8 g, const Uint8 b);
|
||||
|
||||
/*
|
||||
* Maps an RGBA quadruple to a pixel value for a given pixel format
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA
|
||||
(const SDL_PixelFormat * const format,
|
||||
const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a);
|
||||
|
||||
/*
|
||||
* Maps a pixel value into the RGB components for a given pixel format
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt,
|
||||
Uint8 *r, Uint8 *g, Uint8 *b);
|
||||
|
||||
/*
|
||||
* Maps a pixel value into the RGBA components for a given pixel format
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt,
|
||||
Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
|
||||
|
||||
/*
|
||||
* Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
|
||||
* If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
|
||||
* If the depth is greater than 8 bits, the pixel format is set using the
|
||||
* flags '[RGB]mask'.
|
||||
* If the function runs out of memory, it will return NULL.
|
||||
*
|
||||
* The 'flags' tell what kind of surface to create.
|
||||
* SDL_SWSURFACE means that the surface should be created in system memory.
|
||||
* SDL_HWSURFACE means that the surface should be created in video memory,
|
||||
* with the same format as the display surface. This is useful for surfaces
|
||||
* that will not change much, to take advantage of hardware acceleration
|
||||
* when being blitted to the display surface.
|
||||
* SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
|
||||
* this surface, but you must always lock it before accessing the pixels.
|
||||
* SDL will wait for current blits to finish before returning from the lock.
|
||||
* SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
|
||||
* If the hardware supports acceleration of colorkey blits between
|
||||
* two surfaces in video memory, SDL will try to place the surface in
|
||||
* video memory. If this isn't possible or if there is no hardware
|
||||
* acceleration available, the surface will be placed in system memory.
|
||||
* SDL_SRCALPHA means that the surface will be used for alpha blits and
|
||||
* if the hardware supports hardware acceleration of alpha blits between
|
||||
* two surfaces in video memory, to place the surface in video memory
|
||||
* if possible, otherwise it will be placed in system memory.
|
||||
* If the surface is created in video memory, blits will be _much_ faster,
|
||||
* but the surface format must be identical to the video surface format,
|
||||
* and the only way to access the pixels member of the surface is to use
|
||||
* the SDL_LockSurface() and SDL_UnlockSurface() calls.
|
||||
* If the requested surface actually resides in video memory, SDL_HWSURFACE
|
||||
* will be set in the flags member of the returned surface. If for some
|
||||
* reason the surface could not be placed in video memory, it will not have
|
||||
* the SDL_HWSURFACE flag set, and will be created in system memory instead.
|
||||
*/
|
||||
#define SDL_AllocSurface SDL_CreateRGBSurface
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface
|
||||
(Uint32 flags, int width, int height, int depth,
|
||||
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
||||
int width, int height, int depth, int pitch,
|
||||
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
||||
extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
|
||||
|
||||
/*
|
||||
* SDL_LockSurface() sets up a surface for directly accessing the pixels.
|
||||
* Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
|
||||
* to and read from 'surface->pixels', using the pixel format stored in
|
||||
* 'surface->format'. Once you are done accessing the surface, you should
|
||||
* use SDL_UnlockSurface() to release it.
|
||||
*
|
||||
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
|
||||
* to 0, then you can read and write to the surface at any time, and the
|
||||
* pixel format of the surface will not change. In particular, if the
|
||||
* SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
|
||||
* will not need to lock the display surface before accessing it.
|
||||
*
|
||||
* No operating system or library calls should be made between lock/unlock
|
||||
* pairs, as critical system locks may be held during this time.
|
||||
*
|
||||
* SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
|
||||
|
||||
/*
|
||||
* Load a surface from a seekable SDL data source (memory or file.)
|
||||
* If 'freesrc' is non-zero, the source will be closed after being read.
|
||||
* Returns the new surface, or NULL if there was an error.
|
||||
* The new surface should be freed with SDL_FreeSurface().
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
|
||||
|
||||
/* Convenience macro -- load a surface from a file */
|
||||
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
|
||||
|
||||
/*
|
||||
* Save a surface to a seekable SDL data source (memory or file.)
|
||||
* If 'freedst' is non-zero, the source will be closed after being written.
|
||||
* Returns 0 if successful or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
|
||||
(SDL_Surface *surface, SDL_RWops *dst, int freedst);
|
||||
|
||||
/* Convenience macro -- save a surface to a file */
|
||||
#define SDL_SaveBMP(surface, file) \
|
||||
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
|
||||
|
||||
/*
|
||||
* Sets the color key (transparent pixel) in a blittable surface.
|
||||
* If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
|
||||
* 'key' will be the transparent pixel in the source image of a blit.
|
||||
* SDL_RLEACCEL requests RLE acceleration for the surface if present,
|
||||
* and removes RLE acceleration if absent.
|
||||
* If 'flag' is 0, this function clears any current color key.
|
||||
* This function returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetColorKey
|
||||
(SDL_Surface *surface, Uint32 flag, Uint32 key);
|
||||
|
||||
/*
|
||||
* This function sets the alpha value for the entire surface, as opposed to
|
||||
* using the alpha component of each pixel. This value measures the range
|
||||
* of transparency of the surface, 0 being completely transparent to 255
|
||||
* being completely opaque. An 'alpha' value of 255 causes blits to be
|
||||
* opaque, the source pixels copied to the destination (the default). Note
|
||||
* that per-surface alpha can be combined with colorkey transparency.
|
||||
*
|
||||
* If 'flag' is 0, alpha blending is disabled for the surface.
|
||||
* If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
|
||||
* OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
|
||||
* surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
|
||||
*
|
||||
* The 'alpha' parameter is ignored for surfaces that have an alpha channel.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);
|
||||
|
||||
/*
|
||||
* Sets the clipping rectangle for the destination surface in a blit.
|
||||
*
|
||||
* If the clip rectangle is NULL, clipping will be disabled.
|
||||
* If the clip rectangle doesn't intersect the surface, the function will
|
||||
* return SDL_FALSE and blits will be completely clipped. Otherwise the
|
||||
* function returns SDL_TRUE and blits to the surface will be clipped to
|
||||
* the intersection of the surface area and the clipping rectangle.
|
||||
*
|
||||
* Note that blits are automatically clipped to the edges of the source
|
||||
* and destination surfaces.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect);
|
||||
|
||||
/*
|
||||
* Gets the clipping rectangle for the destination surface in a blit.
|
||||
* 'rect' must be a pointer to a valid rectangle which will be filled
|
||||
* with the correct values.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
|
||||
|
||||
/*
|
||||
* Creates a new surface of the specified format, and then copies and maps
|
||||
* the given surface to it so the blit of the converted surface will be as
|
||||
* fast as possible. If this function fails, it returns NULL.
|
||||
*
|
||||
* The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
|
||||
* semantics. You can also pass SDL_RLEACCEL in the flags parameter and
|
||||
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting
|
||||
* surface.
|
||||
*
|
||||
* This function is used internally by SDL_DisplayFormat().
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface
|
||||
(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
|
||||
|
||||
/*
|
||||
* This performs a fast blit from the source surface to the destination
|
||||
* surface. It assumes that the source and destination rectangles are
|
||||
* the same size. If either 'srcrect' or 'dstrect' are NULL, the entire
|
||||
* surface (src or dst) is copied. The final blit rectangles are saved
|
||||
* in 'srcrect' and 'dstrect' after all clipping is performed.
|
||||
* If the blit is successful, it returns 0, otherwise it returns -1.
|
||||
*
|
||||
* The blit function should not be called on a locked surface.
|
||||
*
|
||||
* The blit semantics for surfaces with and without alpha and colorkey
|
||||
* are defined as follows:
|
||||
*
|
||||
* RGBA->RGB:
|
||||
* SDL_SRCALPHA set:
|
||||
* alpha-blend (using alpha-channel).
|
||||
* SDL_SRCCOLORKEY ignored.
|
||||
* SDL_SRCALPHA not set:
|
||||
* copy RGB.
|
||||
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
* RGB values of the source colour key, ignoring alpha in the
|
||||
* comparison.
|
||||
*
|
||||
* RGB->RGBA:
|
||||
* SDL_SRCALPHA set:
|
||||
* alpha-blend (using the source per-surface alpha value);
|
||||
* set destination alpha to opaque.
|
||||
* SDL_SRCALPHA not set:
|
||||
* copy RGB, set destination alpha to source per-surface alpha value.
|
||||
* both:
|
||||
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
* source colour key.
|
||||
*
|
||||
* RGBA->RGBA:
|
||||
* SDL_SRCALPHA set:
|
||||
* alpha-blend (using the source alpha channel) the RGB values;
|
||||
* leave destination alpha untouched. [Note: is this correct?]
|
||||
* SDL_SRCCOLORKEY ignored.
|
||||
* SDL_SRCALPHA not set:
|
||||
* copy all of RGBA to the destination.
|
||||
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
* RGB values of the source colour key, ignoring alpha in the
|
||||
* comparison.
|
||||
*
|
||||
* RGB->RGB:
|
||||
* SDL_SRCALPHA set:
|
||||
* alpha-blend (using the source per-surface alpha value).
|
||||
* SDL_SRCALPHA not set:
|
||||
* copy RGB.
|
||||
* both:
|
||||
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
* source colour key.
|
||||
*
|
||||
* If either of the surfaces were in video memory, and the blit returns -2,
|
||||
* the video memory was lost, so it should be reloaded with artwork and
|
||||
* re-blitted:
|
||||
while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
|
||||
while ( SDL_LockSurface(image) < 0 )
|
||||
Sleep(10);
|
||||
-- Write image pixels to image->pixels --
|
||||
SDL_UnlockSurface(image);
|
||||
}
|
||||
* This happens under DirectX 5.0 when the system switches away from your
|
||||
* fullscreen application. The lock will also fail until you have access
|
||||
* to the video memory again.
|
||||
*/
|
||||
/* You should call SDL_BlitSurface() unless you know exactly how SDL
|
||||
blitting works internally and how to use the other blit functions.
|
||||
*/
|
||||
#define SDL_BlitSurface SDL_UpperBlit
|
||||
|
||||
/* This is the public blit function, SDL_BlitSurface(), and it performs
|
||||
rectangle validation and clipping before passing it to SDL_LowerBlit()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_UpperBlit
|
||||
(SDL_Surface *src, SDL_Rect *srcrect,
|
||||
SDL_Surface *dst, SDL_Rect *dstrect);
|
||||
/* This is a semi-private blit function and it performs low-level surface
|
||||
blitting only.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LowerBlit
|
||||
(SDL_Surface *src, SDL_Rect *srcrect,
|
||||
SDL_Surface *dst, SDL_Rect *dstrect);
|
||||
|
||||
/*
|
||||
* This function performs a fast fill of the given rectangle with 'color'
|
||||
* The given rectangle is clipped to the destination surface clip area
|
||||
* and the final fill rectangle is saved in the passed in pointer.
|
||||
* If 'dstrect' is NULL, the whole surface will be filled with 'color'
|
||||
* The color should be a pixel of the format used by the surface, and
|
||||
* can be generated by the SDL_MapRGB() function.
|
||||
* This function returns 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FillRect
|
||||
(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
|
||||
|
||||
/*
|
||||
* This function takes a surface and copies it to a new surface of the
|
||||
* pixel format and colors of the video framebuffer, suitable for fast
|
||||
* blitting onto the display surface. It calls SDL_ConvertSurface()
|
||||
*
|
||||
* If you want to take advantage of hardware colorkey or alpha blit
|
||||
* acceleration, you should set the colorkey and alpha value before
|
||||
* calling this function.
|
||||
*
|
||||
* If the conversion fails or runs out of memory, it returns NULL
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface);
|
||||
|
||||
/*
|
||||
* This function takes a surface and copies it to a new surface of the
|
||||
* pixel format and colors of the video framebuffer (if possible),
|
||||
* suitable for fast alpha blitting onto the display surface.
|
||||
* The new surface will always have an alpha channel.
|
||||
*
|
||||
* If you want to take advantage of hardware colorkey or alpha blit
|
||||
* acceleration, you should set the colorkey and alpha value before
|
||||
* calling this function.
|
||||
*
|
||||
* If the conversion fails or runs out of memory, it returns NULL
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface);
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* YUV video surface overlay functions */
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This function creates a video output overlay
|
||||
Calling the returned surface an overlay is something of a misnomer because
|
||||
the contents of the display surface underneath the area where the overlay
|
||||
is shown is undefined - it may be overwritten with the converted YUV data.
|
||||
*/
|
||||
extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height,
|
||||
Uint32 format, SDL_Surface *display);
|
||||
|
||||
/* Lock an overlay for direct access, and unlock it when you are done */
|
||||
extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay);
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
|
||||
|
||||
/* Blit a video overlay to the display surface.
|
||||
The contents of the video surface underneath the blit destination are
|
||||
not defined.
|
||||
The width and height of the destination rectangle may be different from
|
||||
that of the overlay, but currently only 2x scaling is supported.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
|
||||
|
||||
/* Free a video overlay */
|
||||
extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay);
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* OpenGL support functions. */
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Dynamically load an OpenGL library, or the default one if path is NULL
|
||||
*
|
||||
* If you do this, you need to retrieve all of the GL functions used in
|
||||
* your program from the dynamic library using SDL_GL_GetProcAddress().
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
|
||||
|
||||
/*
|
||||
* Get the address of a GL function
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc);
|
||||
|
||||
/*
|
||||
* Set an attribute of the OpenGL subsystem before intialization.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
|
||||
|
||||
/*
|
||||
* Get an attribute of the OpenGL subsystem from the windowing
|
||||
* interface, such as glX. This is of course different from getting
|
||||
* the values from SDL's internal OpenGL subsystem, which only
|
||||
* stores the values you request before initialization.
|
||||
*
|
||||
* Developers should track the values they pass into SDL_GL_SetAttribute
|
||||
* themselves if they want to retrieve these values.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value);
|
||||
|
||||
/*
|
||||
* Swap the OpenGL buffers, if double-buffering is supported.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
|
||||
|
||||
/*
|
||||
* Internal functions that should not be called unless you have read
|
||||
* and understood the source code for these functions.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects);
|
||||
extern DECLSPEC void SDLCALL SDL_GL_Lock(void);
|
||||
extern DECLSPEC void SDLCALL SDL_GL_Unlock(void);
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* These functions allow interaction with the window manager, if any. */
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Sets/Gets the title and icon text of the display window (UTF-8 encoded)
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon);
|
||||
extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
|
||||
|
||||
/*
|
||||
* Sets the icon for the display window.
|
||||
* This function must be called before the first call to SDL_SetVideoMode().
|
||||
* It takes an icon surface, and a mask in MSB format.
|
||||
* If 'mask' is NULL, the entire icon surface will be used as the icon.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);
|
||||
|
||||
/*
|
||||
* This function iconifies the window, and returns 1 if it succeeded.
|
||||
* If the function succeeds, it generates an SDL_APPACTIVE loss event.
|
||||
* This function is a noop and returns 0 in non-windowed environments.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
|
||||
|
||||
/*
|
||||
* Toggle fullscreen mode without changing the contents of the screen.
|
||||
* If the display surface does not require locking before accessing
|
||||
* the pixel information, then the memory pointers will not change.
|
||||
*
|
||||
* If this function was able to toggle fullscreen mode (change from
|
||||
* running in a window to fullscreen, or vice-versa), it will return 1.
|
||||
* If it is not implemented, or fails, it returns 0.
|
||||
*
|
||||
* The next call to SDL_SetVideoMode() will set the mode fullscreen
|
||||
* attribute based on the flags parameter - if SDL_FULLSCREEN is not
|
||||
* set, then the display will be windowed by default where supported.
|
||||
*
|
||||
* This is currently only implemented in the X11 video driver.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);
|
||||
|
||||
/*
|
||||
* This function allows you to set and query the input grab state of
|
||||
* the application. It returns the new input grab state.
|
||||
*/
|
||||
typedef enum {
|
||||
SDL_GRAB_QUERY = -1,
|
||||
SDL_GRAB_OFF = 0,
|
||||
SDL_GRAB_ON = 1,
|
||||
SDL_GRAB_FULLSCREEN /* Used internally */
|
||||
} SDL_GrabMode;
|
||||
/*
|
||||
* Grabbing means that the mouse is confined to the application window,
|
||||
* and nearly all keyboard input is passed directly to the application,
|
||||
* and not interpreted by a window manager, if any.
|
||||
*/
|
||||
extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
|
||||
|
||||
/* Not in public API at the moment - do not use! */
|
||||
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
|
||||
SDL_Surface *dst, SDL_Rect *dstrect);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_video_h */
|
||||
@@ -1,156 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2004 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* This file sets things up for C dynamic library function definitions,
|
||||
static inlined functions, and structures aligned at 4-byte alignment.
|
||||
If you don't like ugly C preprocessor code, don't look at this file. :)
|
||||
*/
|
||||
|
||||
/* This shouldn't be nested -- included it around code only. */
|
||||
#ifdef _begin_code_h
|
||||
#error Nested inclusion of begin_code.h
|
||||
#endif
|
||||
#define _begin_code_h
|
||||
|
||||
/* Some compilers use a special export keyword */
|
||||
#ifndef DECLSPEC
|
||||
# if defined(__BEOS__)
|
||||
# if defined(__GNUC__)
|
||||
# define DECLSPEC __declspec(dllexport)
|
||||
# else
|
||||
# define DECLSPEC __declspec(export)
|
||||
# endif
|
||||
# elif defined(__WIN32__)
|
||||
# ifdef __BORLANDC__
|
||||
# ifdef BUILD_SDL
|
||||
# define DECLSPEC
|
||||
# else
|
||||
# define DECLSPEC __declspec(dllimport)
|
||||
# endif
|
||||
# else
|
||||
# define DECLSPEC __declspec(dllexport)
|
||||
# endif
|
||||
# elif defined(__OS2__)
|
||||
# ifdef __WATCOMC__
|
||||
# ifdef BUILD_SDL
|
||||
# define DECLSPEC __declspec(dllexport)
|
||||
# else
|
||||
# define DECLSPEC
|
||||
# endif
|
||||
# else
|
||||
# define DECLSPEC
|
||||
# endif
|
||||
# else
|
||||
# if defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define DECLSPEC __attribute__ ((visibility("default")))
|
||||
# else
|
||||
# define DECLSPEC
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* By default SDL uses the C calling convention */
|
||||
#ifndef SDLCALL
|
||||
#if defined(__WIN32__) && !defined(__GNUC__)
|
||||
#define SDLCALL __cdecl
|
||||
#else
|
||||
#ifdef __OS2__
|
||||
/* But on OS/2, we use the _System calling convention */
|
||||
/* to be compatible with every compiler */
|
||||
#define SDLCALL _System
|
||||
#else
|
||||
#define SDLCALL
|
||||
#endif
|
||||
#endif
|
||||
#endif /* SDLCALL */
|
||||
|
||||
#ifdef __SYMBIAN32__
|
||||
#ifndef EKA2
|
||||
#undef DECLSPEC
|
||||
#define DECLSPEC
|
||||
#elif !defined(__WINS__)
|
||||
#undef DECLSPEC
|
||||
#define DECLSPEC __declspec(dllexport)
|
||||
#endif //EKA2
|
||||
#endif //__SYMBIAN32__
|
||||
|
||||
/* Force structure packing at 4 byte alignment.
|
||||
This is necessary if the header is included in code which has structure
|
||||
packing set to an alternate value, say for loading structures from disk.
|
||||
The packing is reset to the previous value in close_code.h
|
||||
*/
|
||||
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable: 4103)
|
||||
#endif
|
||||
#ifdef __BORLANDC__
|
||||
#pragma nopackwarning
|
||||
#endif
|
||||
#pragma pack(push,4)
|
||||
#elif (defined(__MWERKS__) && defined(__MACOS__))
|
||||
#pragma options align=mac68k4byte
|
||||
#pragma enumsalwaysint on
|
||||
#endif /* Compiler needs structure packing set */
|
||||
|
||||
/* Set up compiler-specific options for inlining functions */
|
||||
#ifndef SDL_INLINE_OKAY
|
||||
#ifdef __GNUC__
|
||||
#define SDL_INLINE_OKAY
|
||||
#else
|
||||
/* Add any special compiler-specific cases here */
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || \
|
||||
defined(__DMC__) || defined(__SC__) || \
|
||||
defined(__WATCOMC__) || defined(__LCC__) || \
|
||||
defined(__DECC) || defined(__EABI__)
|
||||
#ifndef __inline__
|
||||
#define __inline__ __inline
|
||||
#endif
|
||||
#define SDL_INLINE_OKAY
|
||||
#else
|
||||
#if !defined(__MRC__) && !defined(_SGI_SOURCE)
|
||||
#ifndef __inline__
|
||||
#define __inline__ inline
|
||||
#endif
|
||||
#define SDL_INLINE_OKAY
|
||||
#endif /* Not a funky compiler */
|
||||
#endif /* Visual C++ */
|
||||
#endif /* GNU C */
|
||||
#endif /* SDL_INLINE_OKAY */
|
||||
|
||||
/* If inlining isn't supported, remove "__inline__", turning static
|
||||
inlined functions into static functions (resulting in code bloat
|
||||
in all files which include the offending header files)
|
||||
*/
|
||||
#ifndef SDL_INLINE_OKAY
|
||||
#define __inline__
|
||||
#endif
|
||||
|
||||
/* Apparently this is needed by several Windows compilers */
|
||||
#if !defined(__MACH__)
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
#define NULL 0
|
||||
#else
|
||||
#define NULL ((void *)0)
|
||||
#endif
|
||||
#endif /* NULL */
|
||||
#endif /* ! Mac OS X - breaks precompiled headers */
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2004 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/* This file reverses the effects of begin_code.h and should be included
|
||||
after you finish any function and structure declarations in your headers
|
||||
*/
|
||||
|
||||
#undef _begin_code_h
|
||||
|
||||
/* Reset structure packing at previous byte alignment */
|
||||
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
|
||||
#ifdef __BORLANDC__
|
||||
#pragma nopackwarning
|
||||
#endif
|
||||
#if (defined(__MWERKS__) && defined(__MACOS__))
|
||||
#pragma options align=reset
|
||||
#pragma enumsalwaysint reset
|
||||
#else
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
#endif /* Compiler needs structure packing set */
|
||||
|
||||
@@ -1,397 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef APR_H
|
||||
#define APR_H
|
||||
|
||||
/* GENERATED FILE WARNING! DO NOT EDIT apr.h
|
||||
*
|
||||
* You must modify apr.h.in instead.
|
||||
*
|
||||
* And please, make an effort to stub apr.hw and apr.hnw in the process.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file apr.h
|
||||
* @brief APR Platform Definitions
|
||||
* @remark This is a generated header generated from include/apr.h.in by
|
||||
* ./configure, or copied from include/apr.hw or include/apr.hnw
|
||||
* for Win32 or Netware by those build environments, respectively.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup APR Apache Portability Runtime library
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @defgroup apr_platform Platform Definitions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* So that we can use inline on some critical functions, and use
|
||||
* GNUC attributes (such as to get -Wall warnings for printf-like
|
||||
* functions). Only do this in gcc 2.7 or later ... it may work
|
||||
* on earlier stuff, but why chance it.
|
||||
*
|
||||
* We've since discovered that the gcc shipped with NeXT systems
|
||||
* as "cc" is completely broken. It claims to be __GNUC__ and so
|
||||
* on, but it doesn't implement half of the things that __GNUC__
|
||||
* means. In particular it's missing inline and the __attribute__
|
||||
* stuff. So we hack around it. PR#1613. -djg
|
||||
*/
|
||||
#if !defined(__GNUC__) || __GNUC__ < 2 || \
|
||||
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
|
||||
defined(NEXT)
|
||||
#ifndef __attribute__
|
||||
#define __attribute__(__x)
|
||||
#endif
|
||||
#define APR_INLINE
|
||||
#define APR_HAS_INLINE 0
|
||||
#else
|
||||
#define APR_INLINE __inline__
|
||||
#define APR_HAS_INLINE 1
|
||||
#endif
|
||||
|
||||
#define APR_HAVE_ARPA_INET_H 1
|
||||
#define APR_HAVE_CONIO_H 0
|
||||
#define APR_HAVE_CRYPT_H 1
|
||||
#define APR_HAVE_CTYPE_H 1
|
||||
#define APR_HAVE_DIRENT_H 1
|
||||
#define APR_HAVE_ERRNO_H 1
|
||||
#define APR_HAVE_FCNTL_H 1
|
||||
#define APR_HAVE_IO_H 0
|
||||
#define APR_HAVE_LIMITS_H 1
|
||||
#define APR_HAVE_NETDB_H 1
|
||||
#define APR_HAVE_NETINET_IN_H 1
|
||||
#define APR_HAVE_NETINET_SCTP_H 0
|
||||
#define APR_HAVE_NETINET_SCTP_UIO_H 0
|
||||
#define APR_HAVE_NETINET_TCP_H 1
|
||||
#define APR_HAVE_PTHREAD_H 1
|
||||
#define APR_HAVE_SEMAPHORE_H 1
|
||||
#define APR_HAVE_SIGNAL_H 1
|
||||
#define APR_HAVE_STDARG_H 1
|
||||
#define APR_HAVE_STDINT_H 1
|
||||
#define APR_HAVE_STDIO_H 1
|
||||
#define APR_HAVE_STDLIB_H 1
|
||||
#define APR_HAVE_STRING_H 1
|
||||
#define APR_HAVE_STRINGS_H 1
|
||||
#define APR_HAVE_SYS_IOCTL_H 1
|
||||
#define APR_HAVE_SYS_SENDFILE_H 1
|
||||
#define APR_HAVE_SYS_SIGNAL_H 1
|
||||
#define APR_HAVE_SYS_SOCKET_H 1
|
||||
#define APR_HAVE_SYS_SOCKIO_H 0
|
||||
#define APR_HAVE_SYS_SYSLIMITS_H 0
|
||||
#define APR_HAVE_SYS_TIME_H 1
|
||||
#define APR_HAVE_SYS_TYPES_H 1
|
||||
#define APR_HAVE_SYS_UIO_H 1
|
||||
#define APR_HAVE_SYS_UN_H 1
|
||||
#define APR_HAVE_SYS_WAIT_H 1
|
||||
#define APR_HAVE_TIME_H 1
|
||||
#define APR_HAVE_UNISTD_H 1
|
||||
|
||||
/** @} */
|
||||
|
||||
/* We don't include our conditional headers within the doxyblocks
|
||||
* or the extern "C" namespace
|
||||
*/
|
||||
|
||||
#if APR_HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if APR_HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS)
|
||||
/* C99 7.18.4 requires that stdint.h only exposes INT64_C
|
||||
* and UINT64_C for C++ implementations if this is defined: */
|
||||
#define __STDC_CONSTANT_MACROS
|
||||
#endif
|
||||
|
||||
#if APR_HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if APR_HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#ifdef OS2
|
||||
#define INCL_DOS
|
||||
#define INCL_DOSERRORS
|
||||
#include <os2.h>
|
||||
#endif
|
||||
|
||||
/* header files for PATH_MAX, _POSIX_PATH_MAX */
|
||||
#if APR_HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#else
|
||||
#if APR_HAVE_SYS_SYSLIMITS_H
|
||||
#include <sys/syslimits.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @addtogroup apr_platform
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define APR_HAVE_SHMEM_MMAP_TMP 1
|
||||
#define APR_HAVE_SHMEM_MMAP_SHM 1
|
||||
#define APR_HAVE_SHMEM_MMAP_ZERO 1
|
||||
#define APR_HAVE_SHMEM_SHMGET_ANON 1
|
||||
#define APR_HAVE_SHMEM_SHMGET 1
|
||||
#define APR_HAVE_SHMEM_MMAP_ANON 1
|
||||
#define APR_HAVE_SHMEM_BEOS 0
|
||||
|
||||
#define APR_USE_SHMEM_MMAP_TMP 0
|
||||
#define APR_USE_SHMEM_MMAP_SHM 0
|
||||
#define APR_USE_SHMEM_MMAP_ZERO 0
|
||||
#define APR_USE_SHMEM_SHMGET_ANON 0
|
||||
#define APR_USE_SHMEM_SHMGET 1
|
||||
#define APR_USE_SHMEM_MMAP_ANON 1
|
||||
#define APR_USE_SHMEM_BEOS 0
|
||||
|
||||
#define APR_USE_FLOCK_SERIALIZE 0
|
||||
#define APR_USE_SYSVSEM_SERIALIZE 1
|
||||
#define APR_USE_POSIXSEM_SERIALIZE 0
|
||||
#define APR_USE_FCNTL_SERIALIZE 0
|
||||
#define APR_USE_PROC_PTHREAD_SERIALIZE 0
|
||||
#define APR_USE_PTHREAD_SERIALIZE 1
|
||||
|
||||
#define APR_HAS_FLOCK_SERIALIZE 1
|
||||
#define APR_HAS_SYSVSEM_SERIALIZE 1
|
||||
#define APR_HAS_POSIXSEM_SERIALIZE 1
|
||||
#define APR_HAS_FCNTL_SERIALIZE 1
|
||||
#define APR_HAS_PROC_PTHREAD_SERIALIZE 1
|
||||
|
||||
#define APR_PROCESS_LOCK_IS_GLOBAL 0
|
||||
|
||||
#define APR_HAVE_CORKABLE_TCP 1
|
||||
#define APR_HAVE_GETRLIMIT 1
|
||||
#define APR_HAVE_IN_ADDR 1
|
||||
#define APR_HAVE_INET_ADDR 1
|
||||
#define APR_HAVE_INET_NETWORK 1
|
||||
#define APR_HAVE_IPV6 1
|
||||
#define APR_HAVE_MEMMOVE 1
|
||||
#define APR_HAVE_SETRLIMIT 1
|
||||
#define APR_HAVE_SIGACTION 1
|
||||
#define APR_HAVE_SIGSUSPEND 1
|
||||
#define APR_HAVE_SIGWAIT 1
|
||||
#define APR_HAVE_SA_STORAGE 1
|
||||
#define APR_HAVE_STRCASECMP 1
|
||||
#define APR_HAVE_STRDUP 1
|
||||
#define APR_HAVE_STRICMP 0
|
||||
#define APR_HAVE_STRNCASECMP 1
|
||||
#define APR_HAVE_STRNICMP 0
|
||||
#define APR_HAVE_STRSTR 1
|
||||
#define APR_HAVE_MEMCHR 1
|
||||
#define APR_HAVE_STRUCT_RLIMIT 1
|
||||
#define APR_HAVE_UNION_SEMUN 0
|
||||
#define APR_HAVE_SCTP 0
|
||||
|
||||
/* APR Feature Macros */
|
||||
#define APR_HAS_SHARED_MEMORY 1
|
||||
#define APR_HAS_THREADS 1
|
||||
#define APR_HAS_SENDFILE 1
|
||||
#define APR_HAS_MMAP 1
|
||||
#define APR_HAS_FORK 1
|
||||
#define APR_HAS_RANDOM 1
|
||||
#define APR_HAS_OTHER_CHILD 1
|
||||
#define APR_HAS_DSO 1
|
||||
#define APR_HAS_SO_ACCEPTFILTER 0
|
||||
#define APR_HAS_UNICODE_FS 0
|
||||
#define APR_HAS_PROC_INVOKED 0
|
||||
#define APR_HAS_USER 1
|
||||
#define APR_HAS_LARGE_FILES 0
|
||||
#define APR_HAS_XTHREAD_FILES 0
|
||||
#define APR_HAS_OS_UUID 1
|
||||
|
||||
#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0
|
||||
|
||||
/* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible
|
||||
* to poll on files/pipes.
|
||||
*/
|
||||
#define APR_FILES_AS_SOCKETS 1
|
||||
|
||||
/* This macro indicates whether or not EBCDIC is the native character set.
|
||||
*/
|
||||
#define APR_CHARSET_EBCDIC 0
|
||||
|
||||
/* If we have a TCP implementation that can be "corked", what flag
|
||||
* do we use?
|
||||
*/
|
||||
#define APR_TCP_NOPUSH_FLAG TCP_CORK
|
||||
|
||||
/* Is the TCP_NODELAY socket option inherited from listening sockets?
|
||||
*/
|
||||
#define APR_TCP_NODELAY_INHERITED 1
|
||||
|
||||
/* Is the O_NONBLOCK flag inherited from listening sockets?
|
||||
*/
|
||||
#define APR_O_NONBLOCK_INHERITED 0
|
||||
|
||||
/* Typedefs that APR needs. */
|
||||
|
||||
typedef unsigned char apr_byte_t;
|
||||
|
||||
typedef short apr_int16_t;
|
||||
typedef unsigned short apr_uint16_t;
|
||||
|
||||
typedef int apr_int32_t;
|
||||
typedef unsigned int apr_uint32_t;
|
||||
|
||||
typedef long long apr_int64_t;
|
||||
typedef unsigned long long apr_uint64_t;
|
||||
|
||||
typedef size_t apr_size_t;
|
||||
typedef ssize_t apr_ssize_t;
|
||||
typedef long apr_off_t;
|
||||
typedef socklen_t apr_socklen_t;
|
||||
|
||||
#define APR_SIZEOF_VOIDP 4
|
||||
|
||||
/* Are we big endian? */
|
||||
#define APR_IS_BIGENDIAN 0
|
||||
|
||||
/* Mechanisms to properly type numeric literals */
|
||||
#define APR_INT64_C(val) INT64_C(val)
|
||||
#define APR_UINT64_C(val) UINT64_C(val)
|
||||
|
||||
/* Definitions that APR programs need to work properly. */
|
||||
|
||||
/**
|
||||
* Thread callbacks from APR functions must be declared with APR_THREAD_FUNC,
|
||||
* so that they follow the platform's calling convention.
|
||||
* @example
|
||||
*/
|
||||
/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
|
||||
*/
|
||||
#define APR_THREAD_FUNC
|
||||
|
||||
/**
|
||||
* The public APR functions are declared with APR_DECLARE(), so they may
|
||||
* use the most appropriate calling convention. Public APR functions with
|
||||
* variable arguments must use APR_DECLARE_NONSTD().
|
||||
*
|
||||
* @remark Both the declaration and implementations must use the same macro.
|
||||
* @example
|
||||
*/
|
||||
/** APR_DECLARE(rettype) apr_func(args)
|
||||
* @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
|
||||
* @remark Note that when APR compiles the library itself, it passes the
|
||||
* symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32)
|
||||
* to export public symbols from the dynamic library build.\n
|
||||
* The user must define the APR_DECLARE_STATIC when compiling to target
|
||||
* the static APR library on some platforms (e.g. Win32.) The public symbols
|
||||
* are neither exported nor imported when APR_DECLARE_STATIC is defined.\n
|
||||
* By default, compiling an application and including the APR public
|
||||
* headers, without defining APR_DECLARE_STATIC, will prepare the code to be
|
||||
* linked to the dynamic library.
|
||||
*/
|
||||
#define APR_DECLARE(type) type
|
||||
|
||||
/**
|
||||
* The public APR functions using variable arguments are declared with
|
||||
* APR_DECLARE_NONSTD(), as they must follow the C language calling convention.
|
||||
* @see APR_DECLARE @see APR_DECLARE_DATA
|
||||
* @remark Both the declaration and implementations must use the same macro.
|
||||
* @example
|
||||
*/
|
||||
/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
|
||||
*/
|
||||
#define APR_DECLARE_NONSTD(type) type
|
||||
|
||||
/**
|
||||
* The public APR variables are declared with AP_MODULE_DECLARE_DATA.
|
||||
* This assures the appropriate indirection is invoked at compile time.
|
||||
* @see APR_DECLARE @see APR_DECLARE_NONSTD
|
||||
* @remark Note that the declaration and implementations use different forms,
|
||||
* but both must include the macro.
|
||||
* @example
|
||||
*/
|
||||
/** extern APR_DECLARE_DATA type apr_variable;\n
|
||||
* APR_DECLARE_DATA type apr_variable = value;
|
||||
*/
|
||||
#define APR_DECLARE_DATA
|
||||
|
||||
/* Define APR_SSIZE_T_FMT.
|
||||
* If ssize_t is an integer we define it to be "d",
|
||||
* if ssize_t is a long int we define it to be "ld",
|
||||
* if ssize_t is neither we declare an error here.
|
||||
* I looked for a better way to define this here, but couldn't find one, so
|
||||
* to find the logic for this definition search for "ssize_t_fmt" in
|
||||
* configure.in.
|
||||
*/
|
||||
#define APR_SSIZE_T_FMT "d"
|
||||
|
||||
/* And APR_SIZE_T_FMT */
|
||||
#define APR_SIZE_T_FMT "d"
|
||||
|
||||
/* And APR_OFF_T_FMT */
|
||||
#define APR_OFF_T_FMT "ld"
|
||||
|
||||
/* And APR_PID_T_FMT */
|
||||
#define APR_PID_T_FMT "d"
|
||||
|
||||
/* And APR_INT64_T_FMT */
|
||||
#define APR_INT64_T_FMT "lld"
|
||||
|
||||
/* And APR_UINT64_T_FMT */
|
||||
#define APR_UINT64_T_FMT "llu"
|
||||
|
||||
/* And APR_UINT64_T_HEX_FMT */
|
||||
#define APR_UINT64_T_HEX_FMT "llx"
|
||||
|
||||
/* Does the proc mutex lock threads too */
|
||||
#define APR_PROC_MUTEX_IS_GLOBAL 0
|
||||
|
||||
/* Local machine definition for console and log output. */
|
||||
#define APR_EOL_STR "\n"
|
||||
|
||||
|
||||
#if APR_HAVE_SYS_WAIT_H
|
||||
#ifdef WEXITSTATUS
|
||||
#define apr_wait_t int
|
||||
#else
|
||||
#define apr_wait_t union wait
|
||||
#define WEXITSTATUS(status) (int)((status).w_retcode)
|
||||
#define WTERMSIG(status) (int)((status).w_termsig)
|
||||
#endif /* !WEXITSTATUS */
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
|
||||
#if defined(PATH_MAX)
|
||||
#define APR_PATH_MAX PATH_MAX
|
||||
#elif defined(_POSIX_PATH_MAX)
|
||||
#define APR_PATH_MAX _POSIX_PATH_MAX
|
||||
#else
|
||||
#error no decision has been made on APR_PATH_MAX for your platform
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* APR_H */
|
||||
@@ -1,389 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef APR_H
|
||||
#define APR_H
|
||||
|
||||
/* GENERATED FILE WARNING! DO NOT EDIT apr.h
|
||||
*
|
||||
* You must modify apr.h.in instead.
|
||||
*
|
||||
* And please, make an effort to stub apr.hw and apr.hnw in the process.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file apr.h
|
||||
* @brief APR Platform Definitions
|
||||
* @remark This is a generated header generated from include/apr.h.in by
|
||||
* ./configure, or copied from include/apr.hw or include/apr.hnw
|
||||
* for Win32 or Netware by those build environments, respectively.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup APR Apache Portability Runtime library
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @defgroup apr_platform Platform Definitions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* So that we can use inline on some critical functions, and use
|
||||
* GNUC attributes (such as to get -Wall warnings for printf-like
|
||||
* functions). Only do this in gcc 2.7 or later ... it may work
|
||||
* on earlier stuff, but why chance it.
|
||||
*
|
||||
* We've since discovered that the gcc shipped with NeXT systems
|
||||
* as "cc" is completely broken. It claims to be __GNUC__ and so
|
||||
* on, but it doesn't implement half of the things that __GNUC__
|
||||
* means. In particular it's missing inline and the __attribute__
|
||||
* stuff. So we hack around it. PR#1613. -djg
|
||||
*/
|
||||
#if !defined(__GNUC__) || __GNUC__ < 2 || \
|
||||
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
|
||||
defined(NEXT)
|
||||
#ifndef __attribute__
|
||||
#define __attribute__(__x)
|
||||
#endif
|
||||
#define APR_INLINE
|
||||
#define APR_HAS_INLINE 0
|
||||
#else
|
||||
#define APR_INLINE __inline__
|
||||
#define APR_HAS_INLINE 1
|
||||
#endif
|
||||
|
||||
#define APR_HAVE_ARPA_INET_H @arpa_ineth@
|
||||
#define APR_HAVE_CONIO_H @conioh@
|
||||
#define APR_HAVE_CRYPT_H @crypth@
|
||||
#define APR_HAVE_CTYPE_H @ctypeh@
|
||||
#define APR_HAVE_DIRENT_H @direnth@
|
||||
#define APR_HAVE_ERRNO_H @errnoh@
|
||||
#define APR_HAVE_FCNTL_H @fcntlh@
|
||||
#define APR_HAVE_IO_H @ioh@
|
||||
#define APR_HAVE_LIMITS_H @limitsh@
|
||||
#define APR_HAVE_NETDB_H @netdbh@
|
||||
#define APR_HAVE_NETINET_IN_H @netinet_inh@
|
||||
#define APR_HAVE_NETINET_SCTP_H @netinet_sctph@
|
||||
#define APR_HAVE_NETINET_SCTP_UIO_H @netinet_sctp_uioh@
|
||||
#define APR_HAVE_NETINET_TCP_H @netinet_tcph@
|
||||
#define APR_HAVE_PTHREAD_H @pthreadh@
|
||||
#define APR_HAVE_SEMAPHORE_H @semaphoreh@
|
||||
#define APR_HAVE_SIGNAL_H @signalh@
|
||||
#define APR_HAVE_STDARG_H @stdargh@
|
||||
#define APR_HAVE_STDINT_H @stdint@
|
||||
#define APR_HAVE_STDIO_H @stdioh@
|
||||
#define APR_HAVE_STDLIB_H @stdlibh@
|
||||
#define APR_HAVE_STRING_H @stringh@
|
||||
#define APR_HAVE_STRINGS_H @stringsh@
|
||||
#define APR_HAVE_SYS_IOCTL_H @sys_ioctlh@
|
||||
#define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@
|
||||
#define APR_HAVE_SYS_SIGNAL_H @sys_signalh@
|
||||
#define APR_HAVE_SYS_SOCKET_H @sys_socketh@
|
||||
#define APR_HAVE_SYS_SOCKIO_H @sys_sockioh@
|
||||
#define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@
|
||||
#define APR_HAVE_SYS_TIME_H @sys_timeh@
|
||||
#define APR_HAVE_SYS_TYPES_H @sys_typesh@
|
||||
#define APR_HAVE_SYS_UIO_H @sys_uioh@
|
||||
#define APR_HAVE_SYS_UN_H @sys_unh@
|
||||
#define APR_HAVE_SYS_WAIT_H @sys_waith@
|
||||
#define APR_HAVE_TIME_H @timeh@
|
||||
#define APR_HAVE_UNISTD_H @unistdh@
|
||||
|
||||
/** @} */
|
||||
|
||||
/* We don't include our conditional headers within the doxyblocks
|
||||
* or the extern "C" namespace
|
||||
*/
|
||||
|
||||
#if APR_HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if APR_HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#if APR_HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if APR_HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#ifdef OS2
|
||||
#define INCL_DOS
|
||||
#define INCL_DOSERRORS
|
||||
#include <os2.h>
|
||||
#endif
|
||||
|
||||
/* header files for PATH_MAX, _POSIX_PATH_MAX */
|
||||
#if APR_HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#else
|
||||
#if APR_HAVE_SYS_SYSLIMITS_H
|
||||
#include <sys/syslimits.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @addtogroup apr_platform
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define APR_HAVE_SHMEM_MMAP_TMP @havemmaptmp@
|
||||
#define APR_HAVE_SHMEM_MMAP_SHM @havemmapshm@
|
||||
#define APR_HAVE_SHMEM_MMAP_ZERO @havemmapzero@
|
||||
#define APR_HAVE_SHMEM_SHMGET_ANON @haveshmgetanon@
|
||||
#define APR_HAVE_SHMEM_SHMGET @haveshmget@
|
||||
#define APR_HAVE_SHMEM_MMAP_ANON @havemmapanon@
|
||||
#define APR_HAVE_SHMEM_BEOS @havebeosarea@
|
||||
|
||||
#define APR_USE_SHMEM_MMAP_TMP @usemmaptmp@
|
||||
#define APR_USE_SHMEM_MMAP_SHM @usemmapshm@
|
||||
#define APR_USE_SHMEM_MMAP_ZERO @usemmapzero@
|
||||
#define APR_USE_SHMEM_SHMGET_ANON @useshmgetanon@
|
||||
#define APR_USE_SHMEM_SHMGET @useshmget@
|
||||
#define APR_USE_SHMEM_MMAP_ANON @usemmapanon@
|
||||
#define APR_USE_SHMEM_BEOS @usebeosarea@
|
||||
|
||||
#define APR_USE_FLOCK_SERIALIZE @flockser@
|
||||
#define APR_USE_SYSVSEM_SERIALIZE @sysvser@
|
||||
#define APR_USE_POSIXSEM_SERIALIZE @posixser@
|
||||
#define APR_USE_FCNTL_SERIALIZE @fcntlser@
|
||||
#define APR_USE_PROC_PTHREAD_SERIALIZE @procpthreadser@
|
||||
#define APR_USE_PTHREAD_SERIALIZE @pthreadser@
|
||||
|
||||
#define APR_HAS_FLOCK_SERIALIZE @hasflockser@
|
||||
#define APR_HAS_SYSVSEM_SERIALIZE @hassysvser@
|
||||
#define APR_HAS_POSIXSEM_SERIALIZE @hasposixser@
|
||||
#define APR_HAS_FCNTL_SERIALIZE @hasfcntlser@
|
||||
#define APR_HAS_PROC_PTHREAD_SERIALIZE @hasprocpthreadser@
|
||||
|
||||
#define APR_PROCESS_LOCK_IS_GLOBAL @proclockglobal@
|
||||
|
||||
#define APR_HAVE_CORKABLE_TCP @have_corkable_tcp@
|
||||
#define APR_HAVE_GETRLIMIT @have_getrlimit@
|
||||
#define APR_HAVE_IN_ADDR @have_in_addr@
|
||||
#define APR_HAVE_INET_ADDR @have_inet_addr@
|
||||
#define APR_HAVE_INET_NETWORK @have_inet_network@
|
||||
#define APR_HAVE_IPV6 @have_ipv6@
|
||||
#define APR_HAVE_MEMMOVE @have_memmove@
|
||||
#define APR_HAVE_SETRLIMIT @have_setrlimit@
|
||||
#define APR_HAVE_SIGACTION @have_sigaction@
|
||||
#define APR_HAVE_SIGSUSPEND @have_sigsuspend@
|
||||
#define APR_HAVE_SIGWAIT @have_sigwait@
|
||||
#define APR_HAVE_SA_STORAGE @have_sa_storage@
|
||||
#define APR_HAVE_STRCASECMP @have_strcasecmp@
|
||||
#define APR_HAVE_STRDUP @have_strdup@
|
||||
#define APR_HAVE_STRICMP @have_stricmp@
|
||||
#define APR_HAVE_STRNCASECMP @have_strncasecmp@
|
||||
#define APR_HAVE_STRNICMP @have_strnicmp@
|
||||
#define APR_HAVE_STRSTR @have_strstr@
|
||||
#define APR_HAVE_MEMCHR @have_memchr@
|
||||
#define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@
|
||||
#define APR_HAVE_UNION_SEMUN @have_union_semun@
|
||||
#define APR_HAVE_SCTP @have_sctp@
|
||||
|
||||
/* APR Feature Macros */
|
||||
#define APR_HAS_SHARED_MEMORY @sharedmem@
|
||||
#define APR_HAS_THREADS @threads@
|
||||
#define APR_HAS_SENDFILE @sendfile@
|
||||
#define APR_HAS_MMAP @mmap@
|
||||
#define APR_HAS_FORK @fork@
|
||||
#define APR_HAS_RANDOM @rand@
|
||||
#define APR_HAS_OTHER_CHILD @oc@
|
||||
#define APR_HAS_DSO @aprdso@
|
||||
#define APR_HAS_SO_ACCEPTFILTER @acceptfilter@
|
||||
#define APR_HAS_UNICODE_FS 0
|
||||
#define APR_HAS_PROC_INVOKED 0
|
||||
#define APR_HAS_USER 1
|
||||
#define APR_HAS_LARGE_FILES @aprlfs@
|
||||
#define APR_HAS_XTHREAD_FILES 0
|
||||
#define APR_HAS_OS_UUID 0
|
||||
|
||||
/* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible
|
||||
* to poll on files/pipes.
|
||||
*/
|
||||
#define APR_FILES_AS_SOCKETS @file_as_socket@
|
||||
|
||||
/* This macro indicates whether or not EBCDIC is the native character set.
|
||||
*/
|
||||
#define APR_CHARSET_EBCDIC @apr_charset_ebcdic@
|
||||
|
||||
/* If we have a TCP implementation that can be "corked", what flag
|
||||
* do we use?
|
||||
*/
|
||||
#define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@
|
||||
|
||||
/* Is the TCP_NODELAY socket option inherited from listening sockets?
|
||||
*/
|
||||
#define APR_TCP_NODELAY_INHERITED @tcp_nodelay_inherited@
|
||||
|
||||
/* Is the O_NONBLOCK flag inherited from listening sockets?
|
||||
*/
|
||||
#define APR_O_NONBLOCK_INHERITED @o_nonblock_inherited@
|
||||
|
||||
/* Typedefs that APR needs. */
|
||||
|
||||
typedef unsigned char apr_byte_t;
|
||||
|
||||
typedef @short_value@ apr_int16_t;
|
||||
typedef unsigned @short_value@ apr_uint16_t;
|
||||
|
||||
typedef @int_value@ apr_int32_t;
|
||||
typedef unsigned @int_value@ apr_uint32_t;
|
||||
|
||||
typedef @long_value@ apr_int64_t;
|
||||
typedef unsigned @long_value@ apr_uint64_t;
|
||||
|
||||
typedef @size_t_value@ apr_size_t;
|
||||
typedef @ssize_t_value@ apr_ssize_t;
|
||||
typedef @off_t_value@ apr_off_t;
|
||||
typedef @socklen_t_value@ apr_socklen_t;
|
||||
|
||||
#define APR_SIZEOF_VOIDP @voidp_size@
|
||||
|
||||
/* Are we big endian? */
|
||||
#define APR_IS_BIGENDIAN @bigendian@
|
||||
|
||||
/* Mechanisms to properly type numeric literals */
|
||||
@int64_literal@
|
||||
@uint64_literal@
|
||||
|
||||
/* Definitions that APR programs need to work properly. */
|
||||
|
||||
/**
|
||||
* Thread callbacks from APR functions must be declared with APR_THREAD_FUNC,
|
||||
* so that they follow the platform's calling convention.
|
||||
* @example
|
||||
*/
|
||||
/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
|
||||
*/
|
||||
#define APR_THREAD_FUNC
|
||||
|
||||
/**
|
||||
* The public APR functions are declared with APR_DECLARE(), so they may
|
||||
* use the most appropriate calling convention. Public APR functions with
|
||||
* variable arguments must use APR_DECLARE_NONSTD().
|
||||
*
|
||||
* @remark Both the declaration and implementations must use the same macro.
|
||||
* @example
|
||||
*/
|
||||
/** APR_DECLARE(rettype) apr_func(args)
|
||||
* @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
|
||||
* @remark Note that when APR compiles the library itself, it passes the
|
||||
* symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32)
|
||||
* to export public symbols from the dynamic library build.\n
|
||||
* The user must define the APR_DECLARE_STATIC when compiling to target
|
||||
* the static APR library on some platforms (e.g. Win32.) The public symbols
|
||||
* are neither exported nor imported when APR_DECLARE_STATIC is defined.\n
|
||||
* By default, compiling an application and including the APR public
|
||||
* headers, without defining APR_DECLARE_STATIC, will prepare the code to be
|
||||
* linked to the dynamic library.
|
||||
*/
|
||||
#define APR_DECLARE(type) type
|
||||
|
||||
/**
|
||||
* The public APR functions using variable arguments are declared with
|
||||
* APR_DECLARE_NONSTD(), as they must follow the C language calling convention.
|
||||
* @see APR_DECLARE @see APR_DECLARE_DATA
|
||||
* @remark Both the declaration and implementations must use the same macro.
|
||||
* @example
|
||||
*/
|
||||
/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
|
||||
*/
|
||||
#define APR_DECLARE_NONSTD(type) type
|
||||
|
||||
/**
|
||||
* The public APR variables are declared with AP_MODULE_DECLARE_DATA.
|
||||
* This assures the appropriate indirection is invoked at compile time.
|
||||
* @see APR_DECLARE @see APR_DECLARE_NONSTD
|
||||
* @remark Note that the declaration and implementations use different forms,
|
||||
* but both must include the macro.
|
||||
* @example
|
||||
*/
|
||||
/** extern APR_DECLARE_DATA type apr_variable;\n
|
||||
* APR_DECLARE_DATA type apr_variable = value;
|
||||
*/
|
||||
#define APR_DECLARE_DATA
|
||||
|
||||
/* Define APR_SSIZE_T_FMT.
|
||||
* If ssize_t is an integer we define it to be "d",
|
||||
* if ssize_t is a long int we define it to be "ld",
|
||||
* if ssize_t is neither we declare an error here.
|
||||
* I looked for a better way to define this here, but couldn't find one, so
|
||||
* to find the logic for this definition search for "ssize_t_fmt" in
|
||||
* configure.in.
|
||||
*/
|
||||
@ssize_t_fmt@
|
||||
|
||||
/* And APR_SIZE_T_FMT */
|
||||
@size_t_fmt@
|
||||
|
||||
/* And APR_OFF_T_FMT */
|
||||
@off_t_fmt@
|
||||
|
||||
/* And APR_PID_T_FMT */
|
||||
@pid_t_fmt@
|
||||
|
||||
/* And APR_INT64_T_FMT */
|
||||
@int64_t_fmt@
|
||||
|
||||
/* And APR_UINT64_T_FMT */
|
||||
@uint64_t_fmt@
|
||||
|
||||
/* And APR_UINT64_T_HEX_FMT */
|
||||
@uint64_t_hex_fmt@
|
||||
|
||||
/* Does the proc mutex lock threads too */
|
||||
#define APR_PROC_MUTEX_IS_GLOBAL @proc_mutex_is_global@
|
||||
|
||||
/* Local machine definition for console and log output. */
|
||||
#define APR_EOL_STR "@eolstr@"
|
||||
|
||||
|
||||
#if APR_HAVE_SYS_WAIT_H
|
||||
#ifdef WEXITSTATUS
|
||||
#define apr_wait_t int
|
||||
#else
|
||||
#define apr_wait_t union wait
|
||||
#define WEXITSTATUS(status) (int)((status).w_retcode)
|
||||
#define WTERMSIG(status) (int)((status).w_termsig)
|
||||
#endif /* !WEXITSTATUS */
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
|
||||
#if defined(PATH_MAX)
|
||||
#define APR_PATH_MAX PATH_MAX
|
||||
#elif defined(_POSIX_PATH_MAX)
|
||||
#define APR_PATH_MAX _POSIX_PATH_MAX
|
||||
#else
|
||||
#error no decision has been made on APR_PATH_MAX for your platform
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* APR_H */
|
||||
@@ -1,341 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef APR_H
|
||||
#define APR_H
|
||||
|
||||
/* GENERATED FILE WARNING! DO NOT EDIT apr.h
|
||||
*
|
||||
* You must modify apr.hnw instead.
|
||||
*
|
||||
* And please, make an effort to stub apr.hw and apr.h.in in the process.
|
||||
*
|
||||
* This is the NetWare specific version of apr.h. It is copied from
|
||||
* apr.hnw at the start of a NetWare build by prebuildNW.bat.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file apr.h
|
||||
* @brief APR Platform Definitions
|
||||
* @remark This is a generated header generated from include/apr.h.in by
|
||||
* ./configure, or copied from include/apr.hw or include/apr.hnw
|
||||
* for Win32 or Netware by those build environments, respectively.
|
||||
*/
|
||||
|
||||
#if defined(NETWARE) || defined(DOXYGEN)
|
||||
|
||||
#define FD_SETSIZE 1024
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <nks/thread.h>
|
||||
#include <nks/synch.h>
|
||||
#include <nks/time.h>
|
||||
#include <signal.h>
|
||||
#include <novsock2.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef NW_BUILD_IPV6
|
||||
#include <novtcpip.h>
|
||||
#endif
|
||||
|
||||
#define _POSIX_THREAD_SAFE_FUNCTIONS 1
|
||||
#define READDIR_IS_THREAD_SAFE 1
|
||||
|
||||
/* Keep #include'd headers from within the __cplusplus or doxyblocks */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup apr_platform Platform Definitions
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define APR_INLINE
|
||||
#define APR_HAS_INLINE 0
|
||||
#ifndef __attribute__
|
||||
#define __attribute__(__x)
|
||||
#endif
|
||||
#define ENUM_BITFIELD(e,n,w) signed int n : w
|
||||
|
||||
#define APR_HAVE_ARPA_INET_H 0
|
||||
#define APR_HAVE_CONIO_H 0
|
||||
#define APR_HAVE_CRYPT_H 0
|
||||
#define APR_HAVE_CTYPE_H 1
|
||||
#define APR_HAVE_DIRENT_H 1
|
||||
#define APR_HAVE_ERRNO_H 1
|
||||
#define APR_HAVE_FCNTL_H 1
|
||||
#define APR_HAVE_IO_H 0
|
||||
#define APR_HAVE_LIMITS_H 1
|
||||
#define APR_HAVE_NETDB_H 0
|
||||
#define APR_HAVE_NETINET_IN_H 0
|
||||
#define APR_HAVE_NETINET_SCTP_H 0
|
||||
#define APR_HAVE_NETINET_SCTP_UIO_H 0
|
||||
#define APR_HAVE_NETINET_TCP_H 0
|
||||
#define APR_HAVE_PTHREAD_H 0
|
||||
#define APR_HAVE_SIGNAL_H 1
|
||||
#define APR_HAVE_STDARG_H 1
|
||||
#define APR_HAVE_STDINT_H 0
|
||||
#define APR_HAVE_STDIO_H 1
|
||||
#define APR_HAVE_STDLIB_H 1
|
||||
#define APR_HAVE_STRING_H 1
|
||||
#define APR_HAVE_STRINGS_H 0
|
||||
#define APR_HAVE_STRTOLL 1
|
||||
#define APR_HAVE_SYS_SENDFILE_H 0
|
||||
#define APR_HAVE_SYS_SIGNAL_H 0
|
||||
#define APR_HAVE_SYS_SOCKET_H 0
|
||||
#define APR_HAVE_SYS_SOCKIO_H 0
|
||||
#define APR_HAVE_SYS_SYSLIMITS_H 0
|
||||
#define APR_HAVE_SYS_TIME_H 0
|
||||
#define APR_HAVE_SYS_TYPES_H 1
|
||||
#define APR_HAVE_SYS_UIO_H 1
|
||||
#define APR_HAVE_SYS_UN_H 0
|
||||
#define APR_HAVE_SYS_WAIT_H 0
|
||||
#define APR_HAVE_TIME_H 1
|
||||
#define APR_HAVE_UNISTD_H 1
|
||||
|
||||
#define APR_HAVE_SHMEM_MMAP_TMP 0
|
||||
#define APR_HAVE_SHMEM_MMAP_SHM 0
|
||||
#define APR_HAVE_SHMEM_MMAP_ZERO 0
|
||||
#define APR_HAVE_SHMEM_SHMGET_ANON 0
|
||||
#define APR_HAVE_SHMEM_SHMGET 0
|
||||
#define APR_HAVE_SHMEM_MMAP_ANON 0
|
||||
#define APR_HAVE_SHMEM_BEOS 0
|
||||
|
||||
#define APR_USE_SHMEM_MMAP_TMP 0
|
||||
#define APR_USE_SHMEM_MMAP_SHM 0
|
||||
#define APR_USE_SHMEM_MMAP_ZERO 0
|
||||
#define APR_USE_SHMEM_SHMGET_ANON 0
|
||||
#define APR_USE_SHMEM_SHMGET 0
|
||||
#define APR_USE_SHMEM_MMAP_ANON 0
|
||||
#define APR_USE_SHMEM_BEOS 0
|
||||
|
||||
#define APR_USE_FLOCK_SERIALIZE 0
|
||||
#define APR_USE_SYSVSEM_SERIALIZE 0
|
||||
#define APR_USE_FCNTL_SERIALIZE 0
|
||||
#define APR_USE_PROC_PTHREAD_SERIALIZE 0
|
||||
#define APR_USE_PTHREAD_SERIALIZE 0
|
||||
|
||||
#define APR_HAS_FLOCK_SERIALIZE 0
|
||||
#define APR_HAS_SYSVSEM_SERIALIZE 0
|
||||
#define APR_HAS_FCNTL_SERIALIZE 0
|
||||
#define APR_HAS_PROC_PTHREAD_SERIALIZE 0
|
||||
#define APR_HAS_RWLOCK_SERIALIZE 0
|
||||
|
||||
#define APR_HAS_LOCK_CREATE_NP 0
|
||||
|
||||
#define APR_PROCESS_LOCK_IS_GLOBAL 1
|
||||
|
||||
#define APR_FILE_BASED_SHM 0
|
||||
|
||||
#define APR_HAVE_CORKABLE_TCP 0
|
||||
#define APR_HAVE_GETRLIMIT 0
|
||||
#define APR_HAVE_ICONV 0
|
||||
#define APR_HAVE_IN_ADDR 1
|
||||
#define APR_HAVE_INET_ADDR 1
|
||||
#define APR_HAVE_INET_NETWORK 0
|
||||
#ifdef NW_BUILD_IPV6
|
||||
#define APR_HAVE_IPV6 1
|
||||
#else
|
||||
#define APR_HAVE_IPV6 0
|
||||
#endif
|
||||
#define APR_HAVE_MEMCHR 1
|
||||
#define APR_HAVE_MEMMOVE 1
|
||||
#define APR_HAVE_SETRLIMIT 0
|
||||
#define APR_HAVE_SIGACTION 0
|
||||
#define APR_HAVE_SIGSUSPEND 0
|
||||
#define APR_HAVE_SIGWAIT 0
|
||||
#define APR_HAVE_STRCASECMP 1
|
||||
#define APR_HAVE_STRDUP 1
|
||||
#define APR_HAVE_STRICMP 1
|
||||
#define APR_HAVE_STRNCASECMP 1
|
||||
#define APR_HAVE_STRNICMP 1
|
||||
#define APR_HAVE_STRSTR 1
|
||||
#define APR_HAVE_STRUCT_RLIMIT 0
|
||||
#define APR_HAVE_UNION_SEMUN 0
|
||||
#define APR_HAVE_SCTP 0
|
||||
|
||||
/* APR Feature Macros */
|
||||
#define APR_HAS_SHARED_MEMORY 0
|
||||
#define APR_HAS_THREADS 1
|
||||
#define APR_HAS_SENDFILE 0
|
||||
#define APR_HAS_MMAP 0
|
||||
#define APR_HAS_FORK 0
|
||||
#define APR_HAS_RANDOM 1
|
||||
#define APR_HAS_OTHER_CHILD 0
|
||||
#define APR_HAS_DSO 1
|
||||
#define APR_HAS_SO_ACCEPTFILTER 0
|
||||
#define APR_HAS_UNICODE_FS 0
|
||||
#define APR_HAS_PROC_INVOKED 0
|
||||
#define APR_HAS_USER 1
|
||||
#define APR_HAS_LARGE_FILES 1
|
||||
#define APR_HAS_XTHREAD_FILES 0
|
||||
#define APR_HAS_OS_UUID 0
|
||||
|
||||
/* Netware can poll on files/pipes.
|
||||
*/
|
||||
#define APR_FILES_AS_SOCKETS 1
|
||||
|
||||
/* This macro indicates whether or not EBCDIC is the native character set.
|
||||
*/
|
||||
#define APR_CHARSET_EBCDIC 0
|
||||
|
||||
/* Is the TCP_NODELAY socket option inherited from listening sockets?
|
||||
*/
|
||||
#define APR_TCP_NODELAY_INHERITED 1
|
||||
|
||||
/* Is the O_NONBLOCK flag inherited from listening sockets?
|
||||
*/
|
||||
#define APR_O_NONBLOCK_INHERITED 1
|
||||
|
||||
/* Typedefs that APR needs. */
|
||||
|
||||
typedef unsigned char apr_byte_t;
|
||||
|
||||
typedef short apr_int16_t;
|
||||
typedef unsigned short apr_uint16_t;
|
||||
|
||||
typedef int apr_int32_t;
|
||||
typedef unsigned int apr_uint32_t;
|
||||
|
||||
typedef long long apr_int64_t;
|
||||
typedef unsigned long long apr_uint64_t;
|
||||
|
||||
typedef size_t apr_size_t;
|
||||
typedef ssize_t apr_ssize_t;
|
||||
#if APR_HAS_LARGE_FILES
|
||||
typedef off64_t apr_off_t;
|
||||
#else
|
||||
typedef off_t apr_off_t;
|
||||
#endif
|
||||
typedef int apr_socklen_t;
|
||||
|
||||
/* Are we big endian? */
|
||||
/* XXX: Fatal assumption on Alpha platforms */
|
||||
#define APR_IS_BIGENDIAN 0
|
||||
|
||||
#ifdef UNKNOWN_NETWARE_64BIT_FLAG_NEEDED
|
||||
#define APR_SIZEOF_VOIDP 8
|
||||
#else
|
||||
#define APR_SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
/* Mechanisms to properly type numeric literals */
|
||||
#define APR_INT64_C(val) (val##LL)
|
||||
#define APR_UINT64_C(val) (val##ULL)
|
||||
|
||||
/* PROC mutex is a GLOBAL mutex on Netware */
|
||||
#define APR_PROC_MUTEX_IS_GLOBAL 1
|
||||
|
||||
/* Definitions that APR programs need to work properly. */
|
||||
|
||||
/**
|
||||
* Thread callbacks from APR functions must be declared with APR_THREAD_FUNC,
|
||||
* so that they follow the platform's calling convention.
|
||||
* @example
|
||||
*/
|
||||
/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
|
||||
*/
|
||||
#define APR_THREAD_FUNC
|
||||
|
||||
/**
|
||||
* The public APR functions are declared with APR_DECLARE(), so they may
|
||||
* use the most appropriate calling convention. Public APR functions with
|
||||
* variable arguments must use APR_DECLARE_NONSTD().
|
||||
*
|
||||
* @remark Both the declaration and implementations must use the same macro.
|
||||
* @example
|
||||
*/
|
||||
/** APR_DECLARE(rettype) apr_func(args)
|
||||
* @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
|
||||
* @remark Note that when APR compiles the library itself, it passes the
|
||||
* symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32)
|
||||
* to export public symbols from the dynamic library build.\n
|
||||
* The user must define the APR_DECLARE_STATIC when compiling to target
|
||||
* the static APR library on some platforms (e.g. Win32.) The public symbols
|
||||
* are neither exported nor imported when APR_DECLARE_STATIC is defined.\n
|
||||
* By default, compiling an application and including the APR public
|
||||
* headers, without defining APR_DECLARE_STATIC, will prepare the code to be
|
||||
* linked to the dynamic library.
|
||||
*/
|
||||
#define APR_DECLARE(type) type
|
||||
|
||||
/**
|
||||
* The public APR functions using variable arguments are declared with
|
||||
* APR_DECLARE_NONSTD(), as they must follow the C language calling convention.
|
||||
* @see APR_DECLARE @see APR_DECLARE_DATA
|
||||
* @remark Both the declaration and implementations must use the same macro.
|
||||
* @example
|
||||
*/
|
||||
/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
|
||||
*/
|
||||
#define APR_DECLARE_NONSTD(type) type
|
||||
|
||||
/**
|
||||
* The public APR variables are declared with AP_MODULE_DECLARE_DATA.
|
||||
* This assures the appropriate indirection is invoked at compile time.
|
||||
* @see APR_DECLARE @see APR_DECLARE_NONSTD
|
||||
* @remark Note that the declaration and implementations use different forms,
|
||||
* but both must include the macro.
|
||||
* @example
|
||||
*/
|
||||
/** extern APR_DECLARE_DATA type apr_variable;\n
|
||||
* APR_DECLARE_DATA type apr_variable = value;
|
||||
*/
|
||||
#define APR_DECLARE_DATA
|
||||
|
||||
#define APR_SSIZE_T_FMT "d"
|
||||
|
||||
#define APR_SIZE_T_FMT "d"
|
||||
|
||||
#if APR_HAS_LARGE_FILES
|
||||
#define APR_OFF_T_FMT "lld"
|
||||
#else
|
||||
#define APR_OFF_T_FMT "ld"
|
||||
#endif
|
||||
|
||||
#define APR_PID_T_FMT "d"
|
||||
|
||||
/* Local machine definition for console and log output. */
|
||||
#define APR_EOL_STR "\r\n"
|
||||
|
||||
typedef int apr_wait_t;
|
||||
|
||||
#define APR_PATH_MAX PATH_MAX
|
||||
|
||||
#define APR_INT64_T_FMT "lld"
|
||||
#define APR_UINT64_T_FMT "llu"
|
||||
#define APR_UINT64_T_HEX_FMT "llx"
|
||||
#define APR_TIME_T_FMT APR_INT64_T_FMT
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* NETWARE */
|
||||
|
||||
#endif /* APR_H */
|
||||
@@ -1,507 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef APR_H
|
||||
#define APR_H
|
||||
|
||||
/* GENERATED FILE WARNING! DO NOT EDIT apr.h
|
||||
*
|
||||
* You must modify apr.hw instead.
|
||||
*
|
||||
* And please, make an effort to stub apr.hnw and apr.h.in in the process.
|
||||
*
|
||||
* This is the Win32 specific version of apr.h. It is copied from
|
||||
* apr.hw by the apr.dsp and libapr.dsp projects.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file apr.h
|
||||
* @brief APR Platform Definitions
|
||||
* @remark This is a generated header generated from include/apr.h.in by
|
||||
* ./configure, or copied from include/apr.hw or include/apr.hnw
|
||||
* for Win32 or Netware by those build environments, respectively.
|
||||
*/
|
||||
|
||||
#if defined(WIN32) || defined(DOXYGEN)
|
||||
|
||||
/* Ignore most warnings (back down to /W3) for poorly constructed headers
|
||||
*/
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1200
|
||||
#pragma warning(push, 3)
|
||||
#endif
|
||||
|
||||
/* disable or reduce the frequency of...
|
||||
* C4057: indirection to slightly different base types
|
||||
* C4075: slight indirection changes (unsigned short* vs short[])
|
||||
* C4100: unreferenced formal parameter
|
||||
* C4127: conditional expression is constant
|
||||
* C4163: '_rotl64' : not available as an intrinsic function
|
||||
* C4201: nonstandard extension nameless struct/unions
|
||||
* C4244: int to char/short - precision loss
|
||||
* C4514: unreferenced inline function removed
|
||||
*/
|
||||
#pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244)
|
||||
|
||||
/* Has windows.h already been included? If so, our preferences don't matter,
|
||||
* but we will still need the winsock things no matter what was included.
|
||||
* If not, include a restricted set of windows headers to our tastes.
|
||||
*/
|
||||
#ifndef _WINDOWS_
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#ifndef _WIN32_WINNT
|
||||
|
||||
/* Restrict the server to a subset of Windows NT 4.0 header files by default
|
||||
*/
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#endif
|
||||
#ifndef NOUSER
|
||||
#define NOUSER
|
||||
#endif
|
||||
#ifndef NOMCX
|
||||
#define NOMCX
|
||||
#endif
|
||||
#ifndef NOIME
|
||||
#define NOIME
|
||||
#endif
|
||||
#include <windows.h>
|
||||
/*
|
||||
* Add a _very_few_ declarations missing from the restricted set of headers
|
||||
* (If this list becomes extensive, re-enable the required headers above!)
|
||||
* winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now
|
||||
*/
|
||||
#define SW_HIDE 0
|
||||
#ifndef _WIN32_WCE
|
||||
#include <winsock2.h>
|
||||
#include <mswsock.h>
|
||||
#else
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif /* !_WINDOWS_ */
|
||||
|
||||
/**
|
||||
* @defgroup apr_platform Platform Definitions
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define APR_INLINE __inline
|
||||
#define APR_HAS_INLINE 1
|
||||
#ifndef __attribute__
|
||||
#define __attribute__(__x)
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WCE
|
||||
#define APR_HAVE_ARPA_INET_H 0
|
||||
#define APR_HAVE_CONIO_H 1
|
||||
#define APR_HAVE_CRYPT_H 0
|
||||
#define APR_HAVE_CTYPE_H 1
|
||||
#define APR_HAVE_DIRENT_H 0
|
||||
#define APR_HAVE_ERRNO_H 1
|
||||
#define APR_HAVE_FCNTL_H 1
|
||||
#define APR_HAVE_IO_H 1
|
||||
#define APR_HAVE_LIMITS_H 1
|
||||
#define APR_HAVE_NETDB_H 0
|
||||
#define APR_HAVE_NETINET_IN_H 0
|
||||
#define APR_HAVE_NETINET_SCTP_H 0
|
||||
#define APR_HAVE_NETINET_SCTP_UIO_H 0
|
||||
#define APR_HAVE_NETINET_TCP_H 0
|
||||
#define APR_HAVE_PTHREAD_H 0
|
||||
#define APR_HAVE_SIGNAL_H 1
|
||||
#define APR_HAVE_STDARG_H 1
|
||||
#define APR_HAVE_STDINT_H 0
|
||||
#define APR_HAVE_STDIO_H 1
|
||||
#define APR_HAVE_STDLIB_H 1
|
||||
#define APR_HAVE_STRING_H 1
|
||||
#define APR_HAVE_STRINGS_H 0
|
||||
#define APR_HAVE_SYS_SENDFILE_H 0
|
||||
#define APR_HAVE_SYS_SIGNAL_H 0
|
||||
#define APR_HAVE_SYS_SOCKET_H 0
|
||||
#define APR_HAVE_SYS_SOCKIO_H 0
|
||||
#define APR_HAVE_SYS_SYSLIMITS_H 0
|
||||
#define APR_HAVE_SYS_TIME_H 0
|
||||
#define APR_HAVE_SYS_TYPES_H 1
|
||||
#define APR_HAVE_SYS_UIO_H 0
|
||||
#define APR_HAVE_SYS_WAIT_H 0
|
||||
#define APR_HAVE_UNISTD_H 0
|
||||
#define APR_HAVE_STDDEF_H 1
|
||||
#define APR_HAVE_PROCESS_H 1
|
||||
#define APR_HAVE_TIME_H 1
|
||||
#else
|
||||
#define APR_HAVE_ARPA_INET_H 0
|
||||
#define APR_HAVE_CONIO_H 0
|
||||
#define APR_HAVE_CRYPT_H 0
|
||||
#define APR_HAVE_CTYPE_H 0
|
||||
#define APR_HAVE_DIRENT_H 0
|
||||
#define APR_HAVE_ERRNO_H 0
|
||||
#define APR_HAVE_FCNTL_H 0
|
||||
#define APR_HAVE_IO_H 0
|
||||
#define APR_HAVE_LIMITS_H 0
|
||||
#define APR_HAVE_NETDB_H 0
|
||||
#define APR_HAVE_NETINET_IN_H 0
|
||||
#define APR_HAVE_NETINET_TCP_H 0
|
||||
#define APR_HAVE_PTHREAD_H 0
|
||||
#define APR_HAVE_SIGNAL_H 0
|
||||
#define APR_HAVE_STDARG_H 0
|
||||
#define APR_HAVE_STDINT_H 0
|
||||
#define APR_HAVE_STDIO_H 1
|
||||
#define APR_HAVE_STDLIB_H 1
|
||||
#define APR_HAVE_STRING_H 1
|
||||
#define APR_HAVE_STRINGS_H 0
|
||||
#define APR_HAVE_SYS_SENDFILE_H 0
|
||||
#define APR_HAVE_SYS_SIGNAL_H 0
|
||||
#define APR_HAVE_SYS_SOCKET_H 0
|
||||
#define APR_HAVE_SYS_SYSLIMITS_H 0
|
||||
#define APR_HAVE_SYS_TIME_H 0
|
||||
#define APR_HAVE_SYS_TYPES_H 0
|
||||
#define APR_HAVE_SYS_UIO_H 0
|
||||
#define APR_HAVE_SYS_WAIT_H 0
|
||||
#define APR_HAVE_UNISTD_H 0
|
||||
#define APR_HAVE_STDDEF_H 0
|
||||
#define APR_HAVE_PROCESS_H 0
|
||||
#define APR_HAVE_TIME_H 0
|
||||
#endif
|
||||
|
||||
#define APR_USE_FLOCK_SERIALIZE 0
|
||||
#define APR_USE_SYSVSEM_SERIALIZE 0
|
||||
#define APR_USE_FCNTL_SERIALIZE 0
|
||||
#define APR_USE_PROC_PTHREAD_SERIALIZE 0
|
||||
#define APR_USE_PTHREAD_SERIALIZE 0
|
||||
|
||||
#define APR_HAS_FLOCK_SERIALIZE 0
|
||||
#define APR_HAS_SYSVSEM_SERIALIZE 0
|
||||
#define APR_HAS_FCNTL_SERIALIZE 0
|
||||
#define APR_HAS_PROC_PTHREAD_SERIALIZE 0
|
||||
#define APR_HAS_RWLOCK_SERIALIZE 0
|
||||
|
||||
#define APR_HAS_LOCK_CREATE_NP 0
|
||||
|
||||
#define APR_PROCESS_LOCK_IS_GLOBAL 0
|
||||
|
||||
#define APR_USES_ANONYMOUS_SHM 0
|
||||
#define APR_USES_FILEBASED_SHM 0
|
||||
#define APR_USES_KEYBASED_SHM 0
|
||||
|
||||
#define APR_FILE_BASED_SHM 0
|
||||
#define APR_MEM_BASED_SHM 0
|
||||
|
||||
#define APR_HAVE_CORKABLE_TCP 0
|
||||
#define APR_HAVE_GETRLIMIT 0
|
||||
#define APR_HAVE_ICONV 0
|
||||
#define APR_HAVE_IN_ADDR 1
|
||||
#define APR_HAVE_INET_ADDR 1
|
||||
#define APR_HAVE_INET_NETWORK 0
|
||||
#define APR_HAVE_IPV6 0
|
||||
#define APR_HAVE_MEMMOVE 1
|
||||
#define APR_HAVE_SETRLIMIT 0
|
||||
#define APR_HAVE_SIGACTION 0
|
||||
#define APR_HAVE_SIGSUSPEND 0
|
||||
#define APR_HAVE_SIGWAIT 0
|
||||
#define APR_HAVE_STRCASECMP 0
|
||||
#define APR_HAVE_STRDUP 1
|
||||
#define APR_HAVE_STRNCASECMP 0
|
||||
#define APR_HAVE_STRSTR 1
|
||||
#define APR_HAVE_MEMCHR 1
|
||||
#define APR_HAVE_STRUCT_RLIMIT 0
|
||||
#define APR_HAVE_UNION_SEMUN 0
|
||||
#define APR_HAVE_SCTP 0
|
||||
|
||||
#ifndef _WIN32_WCE
|
||||
#define APR_HAVE_STRICMP 1
|
||||
#define APR_HAVE_STRNICMP 1
|
||||
#else
|
||||
#define APR_HAVE_STRICMP 0
|
||||
#define APR_HAVE_STRNICMP 0
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
/* We don't include our conditional headers within the doxyblocks
|
||||
* or the extern "C" namespace
|
||||
*/
|
||||
|
||||
#if APR_HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#if APR_HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#if APR_HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#if APR_HAVE_STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
#if APR_HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
#if APR_HAVE_PROCESS_H
|
||||
#include <process.h>
|
||||
#endif
|
||||
#if APR_HAVE_IPV6
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @addtogroup apr_platform
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* APR Feature Macros */
|
||||
#define APR_HAS_SHARED_MEMORY 1
|
||||
#define APR_HAS_THREADS 1
|
||||
#define APR_HAS_MMAP 1
|
||||
#define APR_HAS_FORK 0
|
||||
#define APR_HAS_RANDOM 1
|
||||
#define APR_HAS_OTHER_CHILD 1
|
||||
#define APR_HAS_DSO 1
|
||||
#define APR_HAS_SO_ACCEPTFILTER 0
|
||||
#define APR_HAS_UNICODE_FS 1
|
||||
#define APR_HAS_PROC_INVOKED 1
|
||||
#ifndef _WIN32_WCE
|
||||
#define APR_HAS_SENDFILE 1
|
||||
#define APR_HAS_USER 1
|
||||
#define APR_HAS_LARGE_FILES 1
|
||||
#define APR_HAS_XTHREAD_FILES 1
|
||||
#else
|
||||
#define APR_HAS_SENDFILE 0
|
||||
#define APR_HAS_USER 0
|
||||
#define APR_HAS_LARGE_FILES 0
|
||||
#define APR_HAS_XTHREAD_FILES 0
|
||||
#endif
|
||||
#define APR_HAS_OS_UUID 1
|
||||
|
||||
/* Win32 cannot poll [just yet] on files/pipes.
|
||||
*/
|
||||
#define APR_FILES_AS_SOCKETS 0
|
||||
|
||||
/* This macro indicates whether or not EBCDIC is the native character set.
|
||||
*/
|
||||
#define APR_CHARSET_EBCDIC 0
|
||||
|
||||
/* Is the TCP_NODELAY socket option inherited from listening sockets?
|
||||
*/
|
||||
#define APR_TCP_NODELAY_INHERITED 1
|
||||
|
||||
/* Is the O_NONBLOCK flag inherited from listening sockets?
|
||||
*/
|
||||
#define APR_O_NONBLOCK_INHERITED 1
|
||||
|
||||
/* Typedefs that APR needs. */
|
||||
|
||||
typedef unsigned char apr_byte_t;
|
||||
|
||||
typedef short apr_int16_t;
|
||||
typedef unsigned short apr_uint16_t;
|
||||
|
||||
typedef int apr_int32_t;
|
||||
typedef unsigned int apr_uint32_t;
|
||||
|
||||
typedef __int64 apr_int64_t;
|
||||
typedef unsigned __int64 apr_uint64_t;
|
||||
|
||||
typedef size_t apr_size_t;
|
||||
#if APR_HAVE_STDDEF_H
|
||||
typedef ptrdiff_t apr_ssize_t;
|
||||
#else
|
||||
typedef int apr_ssize_t;
|
||||
#endif
|
||||
#if APR_HAS_LARGE_FILES
|
||||
typedef __int64 apr_off_t;
|
||||
#else
|
||||
typedef int apr_off_t;
|
||||
#endif
|
||||
typedef int apr_socklen_t;
|
||||
|
||||
/* Are we big endian? */
|
||||
/* XXX: Fatal assumption on Alpha platforms */
|
||||
#define APR_IS_BIGENDIAN 0
|
||||
|
||||
#ifdef WIN64
|
||||
#define APR_SIZEOF_VOIDP 8
|
||||
#else
|
||||
#define APR_SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
/* XXX These simply don't belong here, perhaps in apr_portable.h
|
||||
* based on some APR_HAVE_PID/GID/UID?
|
||||
*/
|
||||
typedef int pid_t;
|
||||
typedef int uid_t;
|
||||
typedef int gid_t;
|
||||
|
||||
/* Mechanisms to properly type numeric literals */
|
||||
|
||||
#define APR_INT64_C(val) (val##i64)
|
||||
#define APR_UINT64_C(val) (val##Ui64)
|
||||
|
||||
|
||||
#if APR_HAVE_IPV6
|
||||
|
||||
/* Appears in later flavors, not the originals. */
|
||||
#ifndef in_addr6
|
||||
#define in6_addr in_addr6
|
||||
#endif
|
||||
|
||||
#ifndef WS2TCPIP_INLINE
|
||||
6:09 PM 11/16/2003#define IN6_IS_ADDR_V4MAPPED(a) \
|
||||
( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \
|
||||
&& (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
|
||||
#endif
|
||||
|
||||
#endif /* APR_HAS_IPV6 */
|
||||
|
||||
/* Definitions that APR programs need to work properly. */
|
||||
|
||||
/**
|
||||
* Thread callbacks from APR functions must be declared with APR_THREAD_FUNC,
|
||||
* so that they follow the platform's calling convention.
|
||||
* @example
|
||||
*/
|
||||
/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
|
||||
*/
|
||||
#define APR_THREAD_FUNC __stdcall
|
||||
|
||||
|
||||
#if defined(DOXYGEN) || !defined(WIN32)
|
||||
|
||||
/**
|
||||
* The public APR functions are declared with APR_DECLARE(), so they may
|
||||
* use the most appropriate calling convention. Public APR functions with
|
||||
* variable arguments must use APR_DECLARE_NONSTD().
|
||||
*
|
||||
* @remark Both the declaration and implementations must use the same macro.
|
||||
* @example
|
||||
*/
|
||||
/** APR_DECLARE(rettype) apr_func(args)
|
||||
* @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
|
||||
* @remark Note that when APR compiles the library itself, it passes the
|
||||
* symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32)
|
||||
* to export public symbols from the dynamic library build.\n
|
||||
* The user must define the APR_DECLARE_STATIC when compiling to target
|
||||
* the static APR library on some platforms (e.g. Win32.) The public symbols
|
||||
* are neither exported nor imported when APR_DECLARE_STATIC is defined.\n
|
||||
* By default, compiling an application and including the APR public
|
||||
* headers, without defining APR_DECLARE_STATIC, will prepare the code to be
|
||||
* linked to the dynamic library.
|
||||
*/
|
||||
#define APR_DECLARE(type) type
|
||||
|
||||
/**
|
||||
* The public APR functions using variable arguments are declared with
|
||||
* APR_DECLARE_NONSTD(), as they must follow the C language calling convention.
|
||||
* @see APR_DECLARE @see APR_DECLARE_DATA
|
||||
* @remark Both the declaration and implementations must use the same macro.
|
||||
* @example
|
||||
*/
|
||||
/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
|
||||
*/
|
||||
#define APR_DECLARE_NONSTD(type) type
|
||||
|
||||
/**
|
||||
* The public APR variables are declared with AP_MODULE_DECLARE_DATA.
|
||||
* This assures the appropriate indirection is invoked at compile time.
|
||||
* @see APR_DECLARE @see APR_DECLARE_NONSTD
|
||||
* @remark Note that the declaration and implementations use different forms,
|
||||
* but both must include the macro.
|
||||
* @example
|
||||
*/
|
||||
/** extern APR_DECLARE_DATA type apr_variable;\n
|
||||
* APR_DECLARE_DATA type apr_variable = value;
|
||||
*/
|
||||
#define APR_DECLARE_DATA
|
||||
|
||||
#elif defined(APR_DECLARE_STATIC)
|
||||
#define APR_DECLARE(type) type __stdcall
|
||||
#define APR_DECLARE_NONSTD(type) type
|
||||
#define APR_DECLARE_DATA
|
||||
#elif defined(APR_DECLARE_EXPORT)
|
||||
#define APR_DECLARE(type) __declspec(dllexport) type __stdcall
|
||||
#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type
|
||||
#define APR_DECLARE_DATA __declspec(dllexport)
|
||||
#else
|
||||
#define APR_DECLARE(type) __declspec(dllimport) type __stdcall
|
||||
#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type
|
||||
#define APR_DECLARE_DATA __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#ifdef WIN64
|
||||
#define APR_SSIZE_T_FMT "I64d"
|
||||
#define APR_SIZE_T_FMT "I64d"
|
||||
#else
|
||||
#define APR_SSIZE_T_FMT "d"
|
||||
#define APR_SIZE_T_FMT "d"
|
||||
#endif
|
||||
|
||||
#if APR_HAS_LARGE_FILES
|
||||
#define APR_OFF_T_FMT "I64d"
|
||||
#else
|
||||
#define APR_OFF_T_FMT "d"
|
||||
#endif
|
||||
|
||||
#define APR_PID_T_FMT "d"
|
||||
|
||||
#define APR_INT64_T_FMT "I64d"
|
||||
#define APR_UINT64_T_FMT "I64u"
|
||||
#define APR_UINT64_T_HEX_FMT "I64x"
|
||||
|
||||
/* Local machine definition for console and log output. */
|
||||
#define APR_EOL_STR "\r\n"
|
||||
|
||||
/* No difference between PROC and GLOBAL mutex */
|
||||
#define APR_PROC_MUTEX_IS_GLOBAL 1
|
||||
|
||||
typedef int apr_wait_t;
|
||||
|
||||
/* struct iovec is needed to emulate Unix writev */
|
||||
struct iovec {
|
||||
char* iov_base;
|
||||
apr_size_t iov_len;
|
||||
};
|
||||
|
||||
/* Nasty Win32 .h ommissions we really need */
|
||||
#define STDIN_FILENO 0
|
||||
#define STDOUT_FILENO 1
|
||||
#define STDERR_FILENO 2
|
||||
|
||||
#if APR_HAS_UNICODE_FS
|
||||
/* An arbitrary size that is digestable. True max is a bit less than 32000 */
|
||||
#define APR_PATH_MAX 8192
|
||||
#else /* !APR_HAS_UNICODE_FS */
|
||||
#define APR_PATH_MAX MAX_PATH
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Done with badly written headers
|
||||
*/
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1200
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
||||
#endif /* APR_H */
|
||||
@@ -1,159 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_ALLOCATOR_H
|
||||
#define APR_ALLOCATOR_H
|
||||
|
||||
/**
|
||||
* @file apr_allocator.h
|
||||
* @brief APR Internal Memory Allocation
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_errno.h"
|
||||
#define APR_WANT_MEMFUNC /**< For no good reason? */
|
||||
#include "apr_want.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup apr_allocator Internal Memory Allocation
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** the allocator structure */
|
||||
typedef struct apr_allocator_t apr_allocator_t;
|
||||
/** the structure which holds information about the allocation */
|
||||
typedef struct apr_memnode_t apr_memnode_t;
|
||||
|
||||
/** basic memory node structure
|
||||
* @note The next, ref and first_avail fields are available for use by the
|
||||
* caller of apr_allocator_alloc(), the remaining fields are read-only.
|
||||
* The next field has to be used with caution and sensibly set when the
|
||||
* memnode is passed back to apr_allocator_free(). See apr_allocator_free()
|
||||
* for details.
|
||||
* The ref and first_avail fields will be properly restored by
|
||||
* apr_allocator_free().
|
||||
*/
|
||||
struct apr_memnode_t {
|
||||
apr_memnode_t *next; /**< next memnode */
|
||||
apr_memnode_t **ref; /**< reference to self */
|
||||
apr_uint32_t index; /**< size */
|
||||
apr_uint32_t free_index; /**< how much free */
|
||||
char *first_avail; /**< pointer to first free memory */
|
||||
char *endp; /**< pointer to end of free memory */
|
||||
};
|
||||
|
||||
/** The base size of a memory node - aligned. */
|
||||
#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
|
||||
|
||||
/** Symbolic constants */
|
||||
#define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0
|
||||
|
||||
/**
|
||||
* Create a new allocator
|
||||
* @param allocator The allocator we have just created.
|
||||
*
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator);
|
||||
|
||||
/**
|
||||
* Destroy an allocator
|
||||
* @param allocator The allocator to be destroyed
|
||||
* @remark Any memnodes not given back to the allocator prior to destroying
|
||||
* will _not_ be free()d.
|
||||
*/
|
||||
APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator);
|
||||
|
||||
/**
|
||||
* Allocate a block of mem from the allocator
|
||||
* @param allocator The allocator to allocate from
|
||||
* @param size The size of the mem to allocate (excluding the
|
||||
* memnode structure)
|
||||
*/
|
||||
APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator,
|
||||
apr_size_t size);
|
||||
|
||||
/**
|
||||
* Free a list of blocks of mem, giving them back to the allocator.
|
||||
* The list is typically terminated by a memnode with its next field
|
||||
* set to NULL.
|
||||
* @param allocator The allocator to give the mem back to
|
||||
* @param memnode The memory node to return
|
||||
*/
|
||||
APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator,
|
||||
apr_memnode_t *memnode);
|
||||
|
||||
#include "apr_pools.h"
|
||||
|
||||
/**
|
||||
* Set the owner of the allocator
|
||||
* @param allocator The allocator to set the owner for
|
||||
* @param pool The pool that is to own the allocator
|
||||
* @remark Typically pool is the highest level pool using the allocator
|
||||
*/
|
||||
/*
|
||||
* XXX: see if we can come up with something a bit better. Currently
|
||||
* you can make a pool an owner, but if the pool doesn't use the allocator
|
||||
* the allocator will never be destroyed.
|
||||
*/
|
||||
APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Get the current owner of the allocator
|
||||
* @param allocator The allocator to get the owner from
|
||||
*/
|
||||
APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator);
|
||||
|
||||
/**
|
||||
* Set the current threshold at which the allocator should start
|
||||
* giving blocks back to the system.
|
||||
* @param allocator The allocator the set the threshold on
|
||||
* @param size The threshold. 0 == unlimited.
|
||||
*/
|
||||
APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
|
||||
apr_size_t size);
|
||||
|
||||
#include "apr_thread_mutex.h"
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
/**
|
||||
* Set a mutex for the allocator to use
|
||||
* @param allocator The allocator to set the mutex for
|
||||
* @param mutex The mutex
|
||||
*/
|
||||
APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator,
|
||||
apr_thread_mutex_t *mutex);
|
||||
|
||||
/**
|
||||
* Get the mutex currently set for the allocator
|
||||
* @param allocator The allocator
|
||||
*/
|
||||
APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get(
|
||||
apr_allocator_t *allocator);
|
||||
|
||||
#endif /* APR_HAS_THREADS */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !APR_ALLOCATOR_H */
|
||||
@@ -1,127 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file apr_anylock.h
|
||||
* @brief APR-Util transparent any lock flavor wrapper
|
||||
*/
|
||||
#ifndef APR_ANYLOCK_H
|
||||
#define APR_ANYLOCK_H
|
||||
|
||||
#include "apr_proc_mutex.h"
|
||||
#include "apr_thread_mutex.h"
|
||||
#include "apr_thread_rwlock.h"
|
||||
|
||||
/** Structure that may contain any APR lock type */
|
||||
typedef struct apr_anylock_t {
|
||||
/** Indicates what type of lock is in lock */
|
||||
enum tm_lock {
|
||||
apr_anylock_none, /**< None */
|
||||
apr_anylock_procmutex, /**< Process-based */
|
||||
apr_anylock_threadmutex, /**< Thread-based */
|
||||
apr_anylock_readlock, /**< Read lock */
|
||||
apr_anylock_writelock /**< Write lock */
|
||||
} type;
|
||||
/** Union of all possible APR locks */
|
||||
union apr_anylock_u_t {
|
||||
apr_proc_mutex_t *pm; /**< Process mutex */
|
||||
#if APR_HAS_THREADS
|
||||
apr_thread_mutex_t *tm; /**< Thread mutex */
|
||||
apr_thread_rwlock_t *rw; /**< Read-write lock */
|
||||
#endif
|
||||
} lock;
|
||||
} apr_anylock_t;
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
|
||||
/** Lock an apr_anylock_t structure */
|
||||
#define APR_ANYLOCK_LOCK(lck) \
|
||||
(((lck)->type == apr_anylock_none) \
|
||||
? APR_SUCCESS \
|
||||
: (((lck)->type == apr_anylock_threadmutex) \
|
||||
? apr_thread_mutex_lock((lck)->lock.tm) \
|
||||
: (((lck)->type == apr_anylock_procmutex) \
|
||||
? apr_proc_mutex_lock((lck)->lock.pm) \
|
||||
: (((lck)->type == apr_anylock_readlock) \
|
||||
? apr_thread_rwlock_rdlock((lck)->lock.rw) \
|
||||
: (((lck)->type == apr_anylock_writelock) \
|
||||
? apr_thread_rwlock_wrlock((lck)->lock.rw) \
|
||||
: APR_EINVAL)))))
|
||||
|
||||
#else /* APR_HAS_THREADS */
|
||||
|
||||
#define APR_ANYLOCK_LOCK(lck) \
|
||||
(((lck)->type == apr_anylock_none) \
|
||||
? APR_SUCCESS \
|
||||
: (((lck)->type == apr_anylock_procmutex) \
|
||||
? apr_proc_mutex_lock((lck)->lock.pm) \
|
||||
: APR_EINVAL))
|
||||
|
||||
#endif /* APR_HAS_THREADS */
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
|
||||
/** Try to lock an apr_anylock_t structure */
|
||||
#define APR_ANYLOCK_TRYLOCK(lck) \
|
||||
(((lck)->type == apr_anylock_none) \
|
||||
? APR_SUCCESS \
|
||||
: (((lck)->type == apr_anylock_threadmutex) \
|
||||
? apr_thread_mutex_trylock((lck)->lock.tm) \
|
||||
: (((lck)->type == apr_anylock_procmutex) \
|
||||
? apr_proc_mutex_trylock((lck)->lock.pm) \
|
||||
: (((lck)->type == apr_anylock_readlock) \
|
||||
? apr_thread_rwlock_tryrdlock((lck)->lock.rw) \
|
||||
: (((lck)->type == apr_anylock_writelock) \
|
||||
? apr_thread_rwlock_trywrlock((lck)->lock.rw) \
|
||||
: APR_EINVAL)))))
|
||||
|
||||
#else /* APR_HAS_THREADS */
|
||||
|
||||
#define APR_ANYLOCK_TRYLOCK(lck) \
|
||||
(((lck)->type == apr_anylock_none) \
|
||||
? APR_SUCCESS \
|
||||
: (((lck)->type == apr_anylock_procmutex) \
|
||||
? apr_proc_mutex_trylock((lck)->lock.pm) \
|
||||
: APR_EINVAL))
|
||||
|
||||
#endif /* APR_HAS_THREADS */
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
|
||||
/** Unlock an apr_anylock_t structure */
|
||||
#define APR_ANYLOCK_UNLOCK(lck) \
|
||||
(((lck)->type == apr_anylock_none) \
|
||||
? APR_SUCCESS \
|
||||
: (((lck)->type == apr_anylock_threadmutex) \
|
||||
? apr_thread_mutex_unlock((lck)->lock.tm) \
|
||||
: (((lck)->type == apr_anylock_procmutex) \
|
||||
? apr_proc_mutex_unlock((lck)->lock.pm) \
|
||||
: ((((lck)->type == apr_anylock_readlock) || \
|
||||
((lck)->type == apr_anylock_writelock)) \
|
||||
? apr_thread_rwlock_unlock((lck)->lock.rw) \
|
||||
: APR_EINVAL))))
|
||||
|
||||
#else /* APR_HAS_THREADS */
|
||||
|
||||
#define APR_ANYLOCK_UNLOCK(lck) \
|
||||
(((lck)->type == apr_anylock_none) \
|
||||
? APR_SUCCESS \
|
||||
: (((lck)->type == apr_anylock_procmutex) \
|
||||
? apr_proc_mutex_unlock((lck)->lock.pm) \
|
||||
: APR_EINVAL))
|
||||
|
||||
#endif /* APR_HAS_THREADS */
|
||||
|
||||
#endif /* !APR_ANYLOCK_H */
|
||||
@@ -1,128 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_ATOMIC_H
|
||||
#define APR_ATOMIC_H
|
||||
|
||||
/**
|
||||
* @file apr_atomic.h
|
||||
* @brief APR Atomic Operations
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_pools.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup apr_atomic Atomic Operations
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* this function is required on some platforms to initialize the
|
||||
* atomic operation's internal structures
|
||||
* @param p pool
|
||||
* @return APR_SUCCESS on successful completion
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p);
|
||||
|
||||
/*
|
||||
* Atomic operations on 32-bit values
|
||||
* Note: Each of these functions internally implements a memory barrier
|
||||
* on platforms that require it
|
||||
*/
|
||||
|
||||
/**
|
||||
* atomically read an apr_uint32_t from memory
|
||||
* @param mem the pointer
|
||||
*/
|
||||
APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem);
|
||||
|
||||
/**
|
||||
* atomically set an apr_uint32_t in memory
|
||||
* @param mem pointer to the object
|
||||
* @param val value that the object will assume
|
||||
*/
|
||||
APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val);
|
||||
|
||||
/**
|
||||
* atomically add 'val' to an apr_uint32_t
|
||||
* @param mem pointer to the object
|
||||
* @param val amount to add
|
||||
* @return old value pointed to by mem
|
||||
*/
|
||||
APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val);
|
||||
|
||||
/**
|
||||
* atomically subtract 'val' from an apr_uint32_t
|
||||
* @param mem pointer to the object
|
||||
* @param val amount to subtract
|
||||
*/
|
||||
APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val);
|
||||
|
||||
/**
|
||||
* atomically increment an apr_uint32_t by 1
|
||||
* @param mem pointer to the object
|
||||
* @return old value pointed to by mem
|
||||
*/
|
||||
APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem);
|
||||
|
||||
/**
|
||||
* atomically decrement an apr_uint32_t by 1
|
||||
* @param mem pointer to the atomic value
|
||||
* @return zero if the value becomes zero on decrement, otherwise non-zero
|
||||
*/
|
||||
APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem);
|
||||
|
||||
/**
|
||||
* compare an apr_uint32_t's value with 'cmp'.
|
||||
* If they are the same swap the value with 'with'
|
||||
* @param mem pointer to the value
|
||||
* @param with what to swap it with
|
||||
* @param cmp the value to compare it to
|
||||
* @return the old value of *mem
|
||||
*/
|
||||
APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with,
|
||||
apr_uint32_t cmp);
|
||||
|
||||
/**
|
||||
* exchange an apr_uint32_t's value with 'val'.
|
||||
* @param mem pointer to the value
|
||||
* @param val what to swap it with
|
||||
* @return the old value of *mem
|
||||
*/
|
||||
APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val);
|
||||
|
||||
/**
|
||||
* compare the pointer's value with cmp.
|
||||
* If they are the same swap the value with 'with'
|
||||
* @param mem pointer to the pointer
|
||||
* @param with what to swap it with
|
||||
* @param cmp the value to compare it to
|
||||
* @return the old value of the pointer
|
||||
*/
|
||||
APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !APR_ATOMIC_H */
|
||||
@@ -1,110 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* The apr_vsnprintf/apr_snprintf functions are based on, and used with the
|
||||
* permission of, the SIO stdio-replacement strx_* functions by Panos
|
||||
* Tsirigotis <panos@alumni.cs.colorado.edu> for xinetd.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file apr_base64.h
|
||||
* @brief APR-UTIL Base64 Encoding
|
||||
*/
|
||||
#ifndef APR_BASE64_H
|
||||
#define APR_BASE64_H
|
||||
|
||||
#include "apu.h"
|
||||
#include "apr_general.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup APR_Util_Base64 Base64 Encoding
|
||||
* @ingroup APR_Util
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Simple BASE64 encode/decode functions.
|
||||
*
|
||||
* As we might encode binary strings, hence we require the length of
|
||||
* the incoming plain source. And return the length of what we decoded.
|
||||
*
|
||||
* The decoding function takes any non valid char (i.e. whitespace, \0
|
||||
* or anything non A-Z,0-9 etc as terminal.
|
||||
*
|
||||
* plain strings/binary sequences are not assumed '\0' terminated. Encoded
|
||||
* strings are neither. But probably should.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given the length of an un-encrypted string, get the length of the
|
||||
* encrypted string.
|
||||
* @param len the length of an unencrypted string.
|
||||
* @return the length of the string after it is encrypted
|
||||
*/
|
||||
APU_DECLARE(int) apr_base64_encode_len(int len);
|
||||
|
||||
/**
|
||||
* Encode a text string using base64encoding.
|
||||
* @param coded_dst The destination string for the encoded string.
|
||||
* @param plain_src The original string in plain text
|
||||
* @param len_plain_src The length of the plain text string
|
||||
* @return the length of the encoded string
|
||||
*/
|
||||
APU_DECLARE(int) apr_base64_encode(char * coded_dst, const char *plain_src,
|
||||
int len_plain_src);
|
||||
|
||||
/**
|
||||
* Encode an EBCDIC string using base64encoding.
|
||||
* @param coded_dst The destination string for the encoded string.
|
||||
* @param plain_src The original string in plain text
|
||||
* @param len_plain_src The length of the plain text string
|
||||
* @return the length of the encoded string
|
||||
*/
|
||||
APU_DECLARE(int) apr_base64_encode_binary(char * coded_dst,
|
||||
const unsigned char *plain_src,
|
||||
int len_plain_src);
|
||||
|
||||
/**
|
||||
* Determine the length of a plain text string given the encoded version
|
||||
* @param coded_src The encoded string
|
||||
* @return the length of the plain text string
|
||||
*/
|
||||
APU_DECLARE(int) apr_base64_decode_len(const char * coded_src);
|
||||
|
||||
/**
|
||||
* Decode a string to plain text
|
||||
* @param plain_dst The destination string for the plain text
|
||||
* @param coded_src The encoded string
|
||||
* @return the length of the plain text string
|
||||
*/
|
||||
APU_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src);
|
||||
|
||||
/**
|
||||
* Decode an EBCDIC string to plain text
|
||||
* @param plain_dst The destination string for the plain text
|
||||
* @param coded_src The encoded string
|
||||
* @return the length of the plain text string
|
||||
*/
|
||||
APU_DECLARE(int) apr_base64_decode_binary(unsigned char * plain_dst,
|
||||
const char *coded_src);
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !APR_BASE64_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,105 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_DATE_H
|
||||
#define APR_DATE_H
|
||||
|
||||
/**
|
||||
* @file apr_date.h
|
||||
* @brief APR-UTIL date routines
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup APR_Util_Date Date routines
|
||||
* @ingroup APR_Util
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*
|
||||
* apr_date.h: prototypes for date parsing utility routines
|
||||
*/
|
||||
|
||||
#include "apu.h"
|
||||
#include "apr_time.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** A bad date. */
|
||||
#define APR_DATE_BAD ((apr_time_t)0)
|
||||
|
||||
/**
|
||||
* Compare a string to a mask
|
||||
* @param data The string to compare
|
||||
* @param mask Mask characters (arbitrary maximum is 256 characters):
|
||||
* <PRE>
|
||||
* '\@' - uppercase letter
|
||||
* '\$' - lowercase letter
|
||||
* '\&' - hex digit
|
||||
* '#' - digit
|
||||
* '~' - digit or space
|
||||
* '*' - swallow remaining characters
|
||||
* </PRE>
|
||||
* @remark The mask tests for an exact match for any other character
|
||||
* @return 1 if the string matches, 0 otherwise
|
||||
*/
|
||||
APU_DECLARE(int) apr_date_checkmask(const char *data, const char *mask);
|
||||
|
||||
/**
|
||||
* Parses an HTTP date in one of three standard forms:
|
||||
* <PRE>
|
||||
* Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
|
||||
* Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
|
||||
* Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
|
||||
* </PRE>
|
||||
* @param date The date in one of the three formats above
|
||||
* @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or
|
||||
* 0 if this would be out of range or if the date is invalid.
|
||||
*/
|
||||
APU_DECLARE(apr_time_t) apr_date_parse_http(const char *date);
|
||||
|
||||
/**
|
||||
* Parses a string resembling an RFC 822 date. This is meant to be
|
||||
* leinent in its parsing of dates. Hence, this will parse a wider
|
||||
* range of dates than apr_date_parse_http.
|
||||
*
|
||||
* The prominent mailer (or poster, if mailer is unknown) that has
|
||||
* been seen in the wild is included for the unknown formats.
|
||||
* <PRE>
|
||||
* Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
|
||||
* Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
|
||||
* Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
|
||||
* Sun, 6 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
|
||||
* Sun, 06 Nov 94 08:49:37 GMT ; RFC 822
|
||||
* Sun, 6 Nov 94 08:49:37 GMT ; RFC 822
|
||||
* Sun, 06 Nov 94 08:49 GMT ; Unknown [drtr\@ast.cam.ac.uk]
|
||||
* Sun, 6 Nov 94 08:49 GMT ; Unknown [drtr\@ast.cam.ac.uk]
|
||||
* Sun, 06 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85]
|
||||
* Sun, 6 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85]
|
||||
* </PRE>
|
||||
*
|
||||
* @param date The date in one of the formats above
|
||||
* @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or
|
||||
* 0 if this would be out of range or if the date is invalid.
|
||||
*/
|
||||
APU_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date);
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !APR_DATE_H */
|
||||
@@ -1,223 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_DBM_H
|
||||
#define APR_DBM_H
|
||||
|
||||
#include "apu.h"
|
||||
#include "apr.h"
|
||||
#include "apr_errno.h"
|
||||
#include "apr_pools.h"
|
||||
#include "apr_file_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file apr_dbm.h
|
||||
* @brief APR-UTIL DBM library
|
||||
*/
|
||||
/**
|
||||
* @defgroup APR_Util_DBM DBM routines
|
||||
* @ingroup APR_Util
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* Structure for referencing a dbm
|
||||
*/
|
||||
typedef struct apr_dbm_t apr_dbm_t;
|
||||
|
||||
/**
|
||||
* Structure for referencing the datum record within a dbm
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/** pointer to the 'data' to retrieve/store in the DBM */
|
||||
char *dptr;
|
||||
/** size of the 'data' to retrieve/store in the DBM */
|
||||
apr_size_t dsize;
|
||||
} apr_datum_t;
|
||||
|
||||
/* modes to open the DB */
|
||||
#define APR_DBM_READONLY 1 /**< open for read-only access */
|
||||
#define APR_DBM_READWRITE 2 /**< open for read-write access */
|
||||
#define APR_DBM_RWCREATE 3 /**< open for r/w, create if needed */
|
||||
#define APR_DBM_RWTRUNC 4 /**< open for r/w, truncating an existing
|
||||
DB if present */
|
||||
/**
|
||||
* Open a dbm file by file name and type of DBM
|
||||
* @param dbm The newly opened database
|
||||
* @param type The type of the DBM (not all may be available at run time)
|
||||
* <pre>
|
||||
* GDBM for GDBM files
|
||||
* SDBM for SDBM files
|
||||
* DB for berkeley DB files
|
||||
* NDBM for NDBM files
|
||||
* default for the default DBM type
|
||||
* </pre>
|
||||
* @param name The dbm file name to open
|
||||
* @param mode The flag value
|
||||
* <PRE>
|
||||
* APR_DBM_READONLY open for read-only access
|
||||
* APR_DBM_READWRITE open for read-write access
|
||||
* APR_DBM_RWCREATE open for r/w, create if needed
|
||||
* APR_DBM_RWTRUNC open for r/w, truncate if already there
|
||||
* </PRE>
|
||||
* @param perm Permissions to apply to if created
|
||||
* @param cntxt The pool to use when creating the dbm
|
||||
* @remark The dbm name may not be a true file name, as many dbm packages
|
||||
* append suffixes for seperate data and index files.
|
||||
*/
|
||||
|
||||
APU_DECLARE(apr_status_t) apr_dbm_open_ex(apr_dbm_t **dbm, const char* type,
|
||||
const char *name,
|
||||
apr_int32_t mode, apr_fileperms_t perm,
|
||||
apr_pool_t *cntxt);
|
||||
|
||||
|
||||
/**
|
||||
* Open a dbm file by file name
|
||||
* @param dbm The newly opened database
|
||||
* @param name The dbm file name to open
|
||||
* @param mode The flag value
|
||||
* <PRE>
|
||||
* APR_DBM_READONLY open for read-only access
|
||||
* APR_DBM_READWRITE open for read-write access
|
||||
* APR_DBM_RWCREATE open for r/w, create if needed
|
||||
* APR_DBM_RWTRUNC open for r/w, truncate if already there
|
||||
* </PRE>
|
||||
* @param perm Permissions to apply to if created
|
||||
* @param cntxt The pool to use when creating the dbm
|
||||
* @remark The dbm name may not be a true file name, as many dbm packages
|
||||
* append suffixes for seperate data and index files.
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_dbm_open(apr_dbm_t **dbm, const char *name,
|
||||
apr_int32_t mode, apr_fileperms_t perm,
|
||||
apr_pool_t *cntxt);
|
||||
|
||||
/**
|
||||
* Close a dbm file previously opened by apr_dbm_open
|
||||
* @param dbm The database to close
|
||||
*/
|
||||
APU_DECLARE(void) apr_dbm_close(apr_dbm_t *dbm);
|
||||
|
||||
/**
|
||||
* Fetch a dbm record value by key
|
||||
* @param dbm The database
|
||||
* @param key The key datum to find this record
|
||||
* @param pvalue The value datum retrieved for this record
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_dbm_fetch(apr_dbm_t *dbm, apr_datum_t key,
|
||||
apr_datum_t *pvalue);
|
||||
/**
|
||||
* Store a dbm record value by key
|
||||
* @param dbm The database
|
||||
* @param key The key datum to store this record by
|
||||
* @param value The value datum to store in this record
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_dbm_store(apr_dbm_t *dbm, apr_datum_t key,
|
||||
apr_datum_t value);
|
||||
|
||||
/**
|
||||
* Delete a dbm record value by key
|
||||
* @param dbm The database
|
||||
* @param key The key datum of the record to delete
|
||||
* @remark It is not an error to delete a non-existent record.
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_dbm_delete(apr_dbm_t *dbm, apr_datum_t key);
|
||||
|
||||
/**
|
||||
* Search for a key within the dbm
|
||||
* @param dbm The database
|
||||
* @param key The datum describing a key to test
|
||||
*/
|
||||
APU_DECLARE(int) apr_dbm_exists(apr_dbm_t *dbm, apr_datum_t key);
|
||||
|
||||
/**
|
||||
* Retrieve the first record key from a dbm
|
||||
* @param dbm The database
|
||||
* @param pkey The key datum of the first record
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_dbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey);
|
||||
|
||||
/**
|
||||
* Retrieve the next record key from a dbm
|
||||
* @param dbm The database
|
||||
* @param pkey The key datum of the next record
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_dbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey);
|
||||
|
||||
/**
|
||||
* Proactively toss any memory associated with the apr_datum_t.
|
||||
* @param dbm The database
|
||||
* @param data The datum to free.
|
||||
*/
|
||||
APU_DECLARE(void) apr_dbm_freedatum(apr_dbm_t *dbm, apr_datum_t data);
|
||||
|
||||
/**
|
||||
* Report more information when an apr_dbm function fails.
|
||||
* @param dbm The database
|
||||
* @param errcode A DBM-specific value for the error (for logging). If this
|
||||
* isn't needed, it may be NULL.
|
||||
* @param errbuf Location to store the error text
|
||||
* @param errbufsize The size of the provided buffer
|
||||
* @return The errbuf parameter, for convenience.
|
||||
*/
|
||||
APU_DECLARE(char *) apr_dbm_geterror(apr_dbm_t *dbm, int *errcode,
|
||||
char *errbuf, apr_size_t errbufsize);
|
||||
/**
|
||||
* If the specified file/path were passed to apr_dbm_open(), return the
|
||||
* actual file/path names which would be (created and) used. At most, two
|
||||
* files may be used; used2 may be NULL if only one file is used.
|
||||
* @param pool The pool for allocating used1 and used2.
|
||||
* @param type The type of DBM you require info on
|
||||
* @param pathname The path name to generate used-names from.
|
||||
* @param used1 The first pathname used by the apr_dbm implementation.
|
||||
* @param used2 The second pathname used by apr_dbm. If only one file is
|
||||
* used by the specific implementation, this will be set to NULL.
|
||||
* @return An error if the specified type is invalid.
|
||||
* @remark The dbm file(s) don't need to exist. This function only manipulates
|
||||
* the pathnames.
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *pool,
|
||||
const char *type,
|
||||
const char *pathname,
|
||||
const char **used1,
|
||||
const char **used2);
|
||||
|
||||
/**
|
||||
* If the specified file/path were passed to apr_dbm_open(), return the
|
||||
* actual file/path names which would be (created and) used. At most, two
|
||||
* files may be used; used2 may be NULL if only one file is used.
|
||||
* @param pool The pool for allocating used1 and used2.
|
||||
* @param pathname The path name to generate used-names from.
|
||||
* @param used1 The first pathname used by the apr_dbm implementation.
|
||||
* @param used2 The second pathname used by apr_dbm. If only one file is
|
||||
* used by the specific implementation, this will be set to NULL.
|
||||
* @remark The dbm file(s) don't need to exist. This function only manipulates
|
||||
* the pathnames.
|
||||
*/
|
||||
APU_DECLARE(void) apr_dbm_get_usednames(apr_pool_t *pool,
|
||||
const char *pathname,
|
||||
const char **used1,
|
||||
const char **used2);
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !APR_DBM_H */
|
||||
@@ -1,93 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_DSO_DOT_H
|
||||
#define APR_DSO_DOT_H
|
||||
|
||||
/**
|
||||
* @file apr_dso.h
|
||||
* @brief APR Dynamic Object Handling Routines
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_pools.h"
|
||||
#include "apr_errno.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup apr_dso Dynamic Object Handling
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if APR_HAS_DSO || defined(DOXYGEN)
|
||||
|
||||
/**
|
||||
* Structure for referencing dynamic objects
|
||||
*/
|
||||
typedef struct apr_dso_handle_t apr_dso_handle_t;
|
||||
|
||||
/**
|
||||
* Structure for referencing symbols from dynamic objects
|
||||
*/
|
||||
typedef void * apr_dso_handle_sym_t;
|
||||
|
||||
/**
|
||||
* Load a DSO library.
|
||||
* @param res_handle Location to store new handle for the DSO.
|
||||
* @param path Path to the DSO library
|
||||
* @param ctx Pool to use.
|
||||
* @bug We aught to provide an alternative to RTLD_GLOBAL, which
|
||||
* is the only supported method of loading DSOs today.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
|
||||
const char *path, apr_pool_t *ctx);
|
||||
|
||||
/**
|
||||
* Close a DSO library.
|
||||
* @param handle handle to close.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle);
|
||||
|
||||
/**
|
||||
* Load a symbol from a DSO handle.
|
||||
* @param ressym Location to store the loaded symbol
|
||||
* @param handle handle to load the symbol from.
|
||||
* @param symname Name of the symbol to load.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym,
|
||||
apr_dso_handle_t *handle,
|
||||
const char *symname);
|
||||
|
||||
/**
|
||||
* Report more information when a DSO function fails.
|
||||
* @param dso The dso handle that has been opened
|
||||
* @param buf Location to store the dso error
|
||||
* @param bufsize The size of the provided buffer
|
||||
*/
|
||||
APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize);
|
||||
|
||||
#endif /* APR_HAS_DSO */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,66 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_ENV_H
|
||||
#define APR_ENV_H
|
||||
/**
|
||||
* @file apr_env.h
|
||||
* @brief APR Environment functions
|
||||
*/
|
||||
#include "apr_errno.h"
|
||||
#include "apr_pools.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @defgroup apr_env Functions for manupulating the environment
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the value of an environment variable
|
||||
* @param value the returned value, allocated from @a pool
|
||||
* @param envvar the name of the environment variable
|
||||
* @param pool where to allocate @a value and any temporary storage from
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_env_get(char **value, const char *envvar,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Set the value of an environment variable
|
||||
* @param envvar the name of the environment variable
|
||||
* @param value the value to set
|
||||
* @param pool where to allocate temporary storage from
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, const char *value,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Delete a variable from the environment
|
||||
* @param envvar the name of the environment variable
|
||||
* @param pool where to allocate temporary storage from
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! APR_ENV_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,418 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_FILE_INFO_H
|
||||
#define APR_FILE_INFO_H
|
||||
|
||||
/**
|
||||
* @file apr_file_info.h
|
||||
* @brief APR File Information
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_user.h"
|
||||
#include "apr_pools.h"
|
||||
#include "apr_tables.h"
|
||||
#include "apr_time.h"
|
||||
#include "apr_errno.h"
|
||||
|
||||
#if APR_HAVE_SYS_UIO_H
|
||||
#include <sys/uio.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @defgroup apr_file_info File Information
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Many applications use the type member to determine the
|
||||
* existance of a file or initialization of the file info,
|
||||
* so the APR_NOFILE value must be distinct from APR_UNKFILE.
|
||||
*/
|
||||
|
||||
/** apr_filetype_e values for the filetype member of the
|
||||
* apr_file_info_t structure
|
||||
* @warning: Not all of the filetypes below can be determined.
|
||||
* For example, a given platform might not correctly report
|
||||
* a socket descriptor as APR_SOCK if that type isn't
|
||||
* well-identified on that platform. In such cases where
|
||||
* a filetype exists but cannot be described by the recognized
|
||||
* flags below, the filetype will be APR_UNKFILE. If the
|
||||
* filetype member is not determined, the type will be APR_NOFILE.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
APR_NOFILE = 0, /**< no file type determined */
|
||||
APR_REG, /**< a regular file */
|
||||
APR_DIR, /**< a directory */
|
||||
APR_CHR, /**< a character device */
|
||||
APR_BLK, /**< a block device */
|
||||
APR_PIPE, /**< a FIFO / pipe */
|
||||
APR_LNK, /**< a symbolic link */
|
||||
APR_SOCK, /**< a [unix domain] socket */
|
||||
APR_UNKFILE = 127 /**< a file of some other unknown type */
|
||||
} apr_filetype_e;
|
||||
|
||||
/**
|
||||
* @defgroup apr_file_permissions File Permissions flags
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define APR_FPROT_USETID 0x8000 /**< Set user id */
|
||||
#define APR_FPROT_UREAD 0x0400 /**< Read by user */
|
||||
#define APR_FPROT_UWRITE 0x0200 /**< Write by user */
|
||||
#define APR_FPROT_UEXECUTE 0x0100 /**< Execute by user */
|
||||
|
||||
#define APR_FPROT_GSETID 0x4000 /**< Set group id */
|
||||
#define APR_FPROT_GREAD 0x0040 /**< Read by group */
|
||||
#define APR_FPROT_GWRITE 0x0020 /**< Write by group */
|
||||
#define APR_FPROT_GEXECUTE 0x0010 /**< Execute by group */
|
||||
|
||||
#define APR_FPROT_WSTICKY 0x2000 /**< Sticky bit */
|
||||
#define APR_FPROT_WREAD 0x0004 /**< Read by others */
|
||||
#define APR_FPROT_WWRITE 0x0002 /**< Write by others */
|
||||
#define APR_FPROT_WEXECUTE 0x0001 /**< Execute by others */
|
||||
|
||||
#define APR_FPROT_OS_DEFAULT 0x0FFF /**< use OS's default permissions */
|
||||
|
||||
/* additional permission flags for apr_file_copy and apr_file_append */
|
||||
#define APR_FPROT_FILE_SOURCE_PERMS 0x1000 /**< Copy source file's permissions */
|
||||
|
||||
/* backcompat */
|
||||
#define APR_USETID APR_FPROT_USETID /**< @deprecated @see APR_FPROT_USETID */
|
||||
#define APR_UREAD APR_FPROT_UREAD /**< @deprecated @see APR_FPROT_UREAD */
|
||||
#define APR_UWRITE APR_FPROT_UWRITE /**< @deprecated @see APR_FPROT_UWRITE */
|
||||
#define APR_UEXECUTE APR_FPROT_UEXECUTE /**< @deprecated @see APR_FPROT_UEXECUTE */
|
||||
#define APR_GSETID APR_FPROT_GSETID /**< @deprecated @see APR_FPROT_GSETID */
|
||||
#define APR_GREAD APR_FPROT_GREAD /**< @deprecated @see APR_FPROT_GREAD */
|
||||
#define APR_GWRITE APR_FPROT_GWRITE /**< @deprecated @see APR_FPROT_GWRITE */
|
||||
#define APR_GEXECUTE APR_FPROT_GEXECUTE /**< @deprecated @see APR_FPROT_GEXECUTE */
|
||||
#define APR_WSTICKY APR_FPROT_WSTICKY /**< @deprecated @see APR_FPROT_WSTICKY */
|
||||
#define APR_WREAD APR_FPROT_WREAD /**< @deprecated @see APR_FPROT_WREAD */
|
||||
#define APR_WWRITE APR_FPROT_WWRITE /**< @deprecated @see APR_FPROT_WWRITE */
|
||||
#define APR_WEXECUTE APR_FPROT_WEXECUTE /**< @deprecated @see APR_FPROT_WEXECUTE */
|
||||
#define APR_OS_DEFAULT APR_FPROT_OS_DEFAULT /**< @deprecated @see APR_FPROT_OS_DEFAULT */
|
||||
#define APR_FILE_SOURCE_PERMS APR_FPROT_FILE_SOURCE_PERMS /**< @deprecated @see APR_FPROT_FILE_SOURCE_PERMS */
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
/**
|
||||
* Structure for referencing directories.
|
||||
*/
|
||||
typedef struct apr_dir_t apr_dir_t;
|
||||
/**
|
||||
* Structure for determining file permissions.
|
||||
*/
|
||||
typedef apr_int32_t apr_fileperms_t;
|
||||
#if (defined WIN32) || (defined NETWARE)
|
||||
/**
|
||||
* Structure for determining the inode of the file.
|
||||
*/
|
||||
typedef apr_uint64_t apr_ino_t;
|
||||
/**
|
||||
* Structure for determining the device the file is on.
|
||||
*/
|
||||
typedef apr_uint32_t apr_dev_t;
|
||||
#else
|
||||
/** The inode of the file. */
|
||||
typedef ino_t apr_ino_t;
|
||||
/**
|
||||
* Structure for determining the device the file is on.
|
||||
*/
|
||||
typedef dev_t apr_dev_t;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup apr_file_stat Stat Functions
|
||||
* @{
|
||||
*/
|
||||
/** file info structure */
|
||||
typedef struct apr_finfo_t apr_finfo_t;
|
||||
|
||||
#define APR_FINFO_LINK 0x00000001 /**< Stat the link not the file itself if it is a link */
|
||||
#define APR_FINFO_MTIME 0x00000010 /**< Modification Time */
|
||||
#define APR_FINFO_CTIME 0x00000020 /**< Creation or inode-changed time */
|
||||
#define APR_FINFO_ATIME 0x00000040 /**< Access Time */
|
||||
#define APR_FINFO_SIZE 0x00000100 /**< Size of the file */
|
||||
#define APR_FINFO_CSIZE 0x00000200 /**< Storage size consumed by the file */
|
||||
#define APR_FINFO_DEV 0x00001000 /**< Device */
|
||||
#define APR_FINFO_INODE 0x00002000 /**< Inode */
|
||||
#define APR_FINFO_NLINK 0x00004000 /**< Number of links */
|
||||
#define APR_FINFO_TYPE 0x00008000 /**< Type */
|
||||
#define APR_FINFO_USER 0x00010000 /**< User */
|
||||
#define APR_FINFO_GROUP 0x00020000 /**< Group */
|
||||
#define APR_FINFO_UPROT 0x00100000 /**< User protection bits */
|
||||
#define APR_FINFO_GPROT 0x00200000 /**< Group protection bits */
|
||||
#define APR_FINFO_WPROT 0x00400000 /**< World protection bits */
|
||||
#define APR_FINFO_ICASE 0x01000000 /**< if dev is case insensitive */
|
||||
#define APR_FINFO_NAME 0x02000000 /**< ->name in proper case */
|
||||
|
||||
#define APR_FINFO_MIN 0x00008170 /**< type, mtime, ctime, atime, size */
|
||||
#define APR_FINFO_IDENT 0x00003000 /**< dev and inode */
|
||||
#define APR_FINFO_OWNER 0x00030000 /**< user and group */
|
||||
#define APR_FINFO_PROT 0x00700000 /**< all protections */
|
||||
#define APR_FINFO_NORM 0x0073b170 /**< an atomic unix apr_stat() */
|
||||
#define APR_FINFO_DIRENT 0x02000000 /**< an atomic unix apr_dir_read() */
|
||||
|
||||
/**
|
||||
* The file information structure. This is analogous to the POSIX
|
||||
* stat structure.
|
||||
*/
|
||||
struct apr_finfo_t {
|
||||
/** Allocates memory and closes lingering handles in the specified pool */
|
||||
apr_pool_t *pool;
|
||||
/** The bitmask describing valid fields of this apr_finfo_t structure
|
||||
* including all available 'wanted' fields and potentially more */
|
||||
apr_int32_t valid;
|
||||
/** The access permissions of the file. Mimics Unix access rights. */
|
||||
apr_fileperms_t protection;
|
||||
/** The type of file. One of APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE,
|
||||
* APR_LNK or APR_SOCK. If the type is undetermined, the value is APR_NOFILE.
|
||||
* If the type cannot be determined, the value is APR_UNKFILE.
|
||||
*/
|
||||
apr_filetype_e filetype;
|
||||
/** The user id that owns the file */
|
||||
apr_uid_t user;
|
||||
/** The group id that owns the file */
|
||||
apr_gid_t group;
|
||||
/** The inode of the file. */
|
||||
apr_ino_t inode;
|
||||
/** The id of the device the file is on. */
|
||||
apr_dev_t device;
|
||||
/** The number of hard links to the file. */
|
||||
apr_int32_t nlink;
|
||||
/** The size of the file */
|
||||
apr_off_t size;
|
||||
/** The storage size consumed by the file */
|
||||
apr_off_t csize;
|
||||
/** The time the file was last accessed */
|
||||
apr_time_t atime;
|
||||
/** The time the file was last modified */
|
||||
apr_time_t mtime;
|
||||
/** The time the file was created, or the inode was last changed */
|
||||
apr_time_t ctime;
|
||||
/** The pathname of the file (possibly unrooted) */
|
||||
const char *fname;
|
||||
/** The file's name (no path) in filesystem case */
|
||||
const char *name;
|
||||
/** The file's handle, if accessed (can be submitted to apr_duphandle) */
|
||||
struct apr_file_t *filehand;
|
||||
};
|
||||
|
||||
/**
|
||||
* get the specified file's stats. The file is specified by filename,
|
||||
* instead of using a pre-opened file.
|
||||
* @param finfo Where to store the information about the file, which is
|
||||
* never touched if the call fails.
|
||||
* @param fname The name of the file to stat.
|
||||
* @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values
|
||||
* @param pool the pool to use to allocate the new file.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
|
||||
apr_int32_t wanted, apr_pool_t *pool);
|
||||
|
||||
/** @} */
|
||||
/**
|
||||
* @defgroup apr_dir Directory Manipulation Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Open the specified directory.
|
||||
* @param new_dir The opened directory descriptor.
|
||||
* @param dirname The full path to the directory (use / on all systems)
|
||||
* @param pool The pool to use.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir,
|
||||
const char *dirname,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* close the specified directory.
|
||||
* @param thedir the directory descriptor to close.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir);
|
||||
|
||||
/**
|
||||
* Read the next entry from the specified directory.
|
||||
* @param finfo the file info structure and filled in by apr_dir_read
|
||||
* @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values
|
||||
* @param thedir the directory descriptor returned from apr_dir_open
|
||||
* @remark No ordering is guaranteed for the entries read.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
|
||||
apr_dir_t *thedir);
|
||||
|
||||
/**
|
||||
* Rewind the directory to the first entry.
|
||||
* @param thedir the directory descriptor to rewind.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup apr_filepath Filepath Manipulation Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** Cause apr_filepath_merge to fail if addpath is above rootpath */
|
||||
#define APR_FILEPATH_NOTABOVEROOT 0x01
|
||||
|
||||
/** internal: Only meaningful with APR_FILEPATH_NOTABOVEROOT */
|
||||
#define APR_FILEPATH_SECUREROOTTEST 0x02
|
||||
|
||||
/** Cause apr_filepath_merge to fail if addpath is above rootpath,
|
||||
* even given a rootpath /foo/bar and an addpath ../bar/bash
|
||||
*/
|
||||
#define APR_FILEPATH_SECUREROOT 0x03
|
||||
|
||||
/** Fail apr_filepath_merge if the merged path is relative */
|
||||
#define APR_FILEPATH_NOTRELATIVE 0x04
|
||||
|
||||
/** Fail apr_filepath_merge if the merged path is absolute */
|
||||
#define APR_FILEPATH_NOTABSOLUTE 0x08
|
||||
|
||||
/** Return the file system's native path format (e.g. path delimiters
|
||||
* of ':' on MacOS9, '\' on Win32, etc.) */
|
||||
#define APR_FILEPATH_NATIVE 0x10
|
||||
|
||||
/** Resolve the true case of existing directories and file elements
|
||||
* of addpath, (resolving any aliases on Win32) and append a proper
|
||||
* trailing slash if a directory
|
||||
*/
|
||||
#define APR_FILEPATH_TRUENAME 0x20
|
||||
|
||||
/**
|
||||
* Extract the rootpath from the given filepath
|
||||
* @param rootpath the root file path returned with APR_SUCCESS or APR_EINCOMPLETE
|
||||
* @param filepath the pathname to parse for its root component
|
||||
* @param flags the desired rules to apply, from
|
||||
* <PRE>
|
||||
* APR_FILEPATH_NATIVE Use native path seperators (e.g. '\' on Win32)
|
||||
* APR_FILEPATH_TRUENAME Tests that the root exists, and makes it proper
|
||||
* </PRE>
|
||||
* @param p the pool to allocate the new path string from
|
||||
* @remark on return, filepath points to the first non-root character in the
|
||||
* given filepath. In the simplest example, given a filepath of "/foo",
|
||||
* returns the rootpath of "/" and filepath points at "foo". This is far
|
||||
* more complex on other platforms, which will canonicalize the root form
|
||||
* to a consistant format, given the APR_FILEPATH_TRUENAME flag, and also
|
||||
* test for the validity of that root (e.g., that a drive d:/ or network
|
||||
* share //machine/foovol/).
|
||||
* The function returns APR_ERELATIVE if filepath isn't rooted (an
|
||||
* error), APR_EINCOMPLETE if the root path is ambigious (but potentially
|
||||
* legitimate, e.g. "/" on Windows is incomplete because it doesn't specify
|
||||
* the drive letter), or APR_EBADPATH if the root is simply invalid.
|
||||
* APR_SUCCESS is returned if filepath is an absolute path.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath,
|
||||
const char **filepath,
|
||||
apr_int32_t flags,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Merge additional file path onto the previously processed rootpath
|
||||
* @param newpath the merged paths returned
|
||||
* @param rootpath the root file path (NULL uses the current working path)
|
||||
* @param addpath the path to add to the root path
|
||||
* @param flags the desired APR_FILEPATH_ rules to apply when merging
|
||||
* @param p the pool to allocate the new path string from
|
||||
* @remark if the flag APR_FILEPATH_TRUENAME is given, and the addpath
|
||||
* contains wildcard characters ('*', '?') on platforms that don't support
|
||||
* such characters within filenames, the paths will be merged, but the
|
||||
* result code will be APR_EPATHWILD, and all further segments will not
|
||||
* reflect the true filenames including the wildcard and following segments.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath,
|
||||
const char *rootpath,
|
||||
const char *addpath,
|
||||
apr_int32_t flags,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Split a search path into separate components
|
||||
* @param pathelts the returned components of the search path
|
||||
* @param liststr the search path (e.g., <tt>getenv("PATH")</tt>)
|
||||
* @param p the pool to allocate the array and path components from
|
||||
* @remark empty path componenta do not become part of @a pathelts.
|
||||
* @remark the path separator in @a liststr is system specific;
|
||||
* e.g., ':' on Unix, ';' on Windows, etc.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts,
|
||||
const char *liststr,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Merge a list of search path components into a single search path
|
||||
* @param liststr the returned search path; may be NULL if @a pathelts is empty
|
||||
* @param pathelts the components of the search path
|
||||
* @param p the pool to allocate the search path from
|
||||
* @remark emtpy strings in the source array are ignored.
|
||||
* @remark the path separator in @a liststr is system specific;
|
||||
* e.g., ':' on Unix, ';' on Windows, etc.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr,
|
||||
apr_array_header_t *pathelts,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Return the default file path (for relative file names)
|
||||
* @param path the default path string returned
|
||||
* @param flags optional flag APR_FILEPATH_NATIVE to retrieve the
|
||||
* default file path in os-native format.
|
||||
* @param p the pool to allocate the default path string from
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_int32_t flags,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Set the default file path (for relative file names)
|
||||
* @param path the default path returned
|
||||
* @param p the pool to allocate any working storage
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p);
|
||||
|
||||
/** The FilePath character encoding is unknown */
|
||||
#define APR_FILEPATH_ENCODING_UNKNOWN 0
|
||||
|
||||
/** The FilePath character encoding is locale-dependent */
|
||||
#define APR_FILEPATH_ENCODING_LOCALE 1
|
||||
|
||||
/** The FilePath character encoding is UTF-8 */
|
||||
#define APR_FILEPATH_ENCODING_UTF8 2
|
||||
|
||||
/**
|
||||
* Determine the encoding used internally by the FilePath functions
|
||||
* @param style points to a variable which receives the encoding style flag
|
||||
* @param p the pool to allocate any working storage
|
||||
* @remark Use @c apr_os_locale_encoding and/or @c apr_os_default_encoding
|
||||
* to get the name of the path encoding if it's not UTF-8.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p);
|
||||
/** @} */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! APR_FILE_INFO_H */
|
||||
@@ -1,805 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_FILE_IO_H
|
||||
#define APR_FILE_IO_H
|
||||
|
||||
/**
|
||||
* @file apr_file_io.h
|
||||
* @brief APR File I/O Handling
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_pools.h"
|
||||
#include "apr_time.h"
|
||||
#include "apr_errno.h"
|
||||
#include "apr_file_info.h"
|
||||
#include "apr_inherit.h"
|
||||
|
||||
#define APR_WANT_STDIO /**< for SEEK_* */
|
||||
#define APR_WANT_IOVEC /**< for apr_file_writev */
|
||||
#include "apr_want.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @defgroup apr_file_io File I/O Handling Functions
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup apr_file_open_flags File Open Flags/Routines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Note to implementors: Values in the range 0x00100000--0x80000000
|
||||
are reserved for platform-specific values. */
|
||||
|
||||
#define APR_FOPEN_READ 0x00001 /**< Open the file for reading */
|
||||
#define APR_FOPEN_WRITE 0x00002 /**< Open the file for writing */
|
||||
#define APR_FOPEN_CREATE 0x00004 /**< Create the file if not there */
|
||||
#define APR_FOPEN_APPEND 0x00008 /**< Append to the end of the file */
|
||||
#define APR_FOPEN_TRUNCATE 0x00010 /**< Open the file and truncate
|
||||
to 0 length */
|
||||
#define APR_FOPEN_BINARY 0x00020 /**< Open the file in binary mode */
|
||||
#define APR_FOPEN_EXCL 0x00040 /**< Open should fail if APR_CREATE
|
||||
and file exists. */
|
||||
#define APR_FOPEN_BUFFERED 0x00080 /**< Open the file for buffered I/O */
|
||||
#define APR_FOPEN_DELONCLOSE 0x00100 /**< Delete the file after close */
|
||||
#define APR_FOPEN_XTHREAD 0x00200 /**< Platform dependent tag to open
|
||||
the file for use across multiple
|
||||
threads */
|
||||
#define APR_FOPEN_SHARELOCK 0x00400 /**< Platform dependent support for
|
||||
higher level locked read/write
|
||||
access to support writes across
|
||||
process/machines */
|
||||
#define APR_FOPEN_NOCLEANUP 0x00800 /**< Do not register a cleanup
|
||||
when the file is opened */
|
||||
#define APR_FOPEN_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this
|
||||
file should support
|
||||
apr_socket_sendfile operation */
|
||||
#define APR_FOPEN_LARGEFILE 0x04000 /**< Platform dependent flag to enable
|
||||
large file support; WARNING see
|
||||
below. */
|
||||
/* backcompat */
|
||||
#define APR_READ APR_FOPEN_READ /**< @deprecated @see APR_FOPEN_READ */
|
||||
#define APR_WRITE APR_FOPEN_WRITE /**< @deprecated @see APR_FOPEN_WRITE */
|
||||
#define APR_CREATE APR_FOPEN_CREATE /**< @deprecated @see APR_FOPEN_CREATE */
|
||||
#define APR_APPEND APR_FOPEN_APPEND /**< @deprecated @see APR_FOPEN_APPEND */
|
||||
#define APR_TRUNCATE APR_FOPEN_TRUNCATE /**< @deprecated @see APR_FOPEN_TRUNCATE */
|
||||
#define APR_BINARY APR_FOPEN_BINARY /**< @deprecated @see APR_FOPEN_BINARY */
|
||||
#define APR_EXCL APR_FOPEN_EXCL /**< @deprecated @see APR_FOPEN_EXCL */
|
||||
#define APR_BUFFERED APR_FOPEN_BUFFERED /**< @deprecated @see APR_FOPEN_BUFFERED */
|
||||
#define APR_DELONCLOSE APR_FOPEN_DELONCLOSE /**< @deprecated @see APR_FOPEN_DELONCLOSE */
|
||||
#define APR_XTHREAD APR_FOPEN_XTHREAD /**< @deprecated @see APR_FOPEN_XTHREAD */
|
||||
#define APR_SHARELOCK APR_FOPEN_SHARELOCK /**< @deprecated @see APR_FOPEN_SHARELOCK */
|
||||
#define APR_FILE_NOCLEANUP APR_FOPEN_NOCLEANUP /**< @deprecated @see APR_FOPEN_NOCLEANUP */
|
||||
#define APR_SENDFILE_ENABLED APR_FOPEN_SENDFILE_ENABLED /**< @deprecated @see APR_FOPEN_SENDFILE_ENABLED */
|
||||
#define APR_LARGEFILE APR_FOPEN_LARGEFILE /**< @deprecated @see APR_FOPEN_LARGEFILE */
|
||||
|
||||
/** @warning The APR_LARGEFILE flag only has effect on some platforms
|
||||
* where sizeof(apr_off_t) == 4. Where implemented, it allows opening
|
||||
* and writing to a file which exceeds the size which can be
|
||||
* represented by apr_off_t (2 gigabytes). When a file's size does
|
||||
* exceed 2Gb, apr_file_info_get() will fail with an error on the
|
||||
* descriptor, likewise apr_stat()/apr_lstat() will fail on the
|
||||
* filename. apr_dir_read() will fail with APR_INCOMPLETE on a
|
||||
* directory entry for a large file depending on the particular
|
||||
* APR_FINFO_* flags. Generally, it is not recommended to use this
|
||||
* flag. */
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup apr_file_seek_flags File Seek Flags
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* flags for apr_file_seek */
|
||||
/** Set the file position */
|
||||
#define APR_SET SEEK_SET
|
||||
/** Current */
|
||||
#define APR_CUR SEEK_CUR
|
||||
/** Go to end of file */
|
||||
#define APR_END SEEK_END
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup apr_file_attrs_set_flags File Attribute Flags
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* flags for apr_file_attrs_set */
|
||||
#define APR_FILE_ATTR_READONLY 0x01 /**< File is read-only */
|
||||
#define APR_FILE_ATTR_EXECUTABLE 0x02 /**< File is executable */
|
||||
#define APR_FILE_ATTR_HIDDEN 0x04 /**< File is hidden */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup apr_file_writev{_full} max iovec size
|
||||
* @{
|
||||
*/
|
||||
#if defined(DOXYGEN)
|
||||
#define APR_MAX_IOVEC_SIZE 1024 /**< System dependent maximum
|
||||
size of an iovec array */
|
||||
#elif defined(IOV_MAX)
|
||||
#define APR_MAX_IOVEC_SIZE IOV_MAX
|
||||
#elif defined(MAX_IOVEC)
|
||||
#define APR_MAX_IOVEC_SIZE MAX_IOVEC
|
||||
#else
|
||||
#define APR_MAX_IOVEC_SIZE 1024
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
/** File attributes */
|
||||
typedef apr_uint32_t apr_fileattrs_t;
|
||||
|
||||
/** Type to pass as whence argument to apr_file_seek. */
|
||||
typedef int apr_seek_where_t;
|
||||
|
||||
/**
|
||||
* Structure for referencing files.
|
||||
*/
|
||||
typedef struct apr_file_t apr_file_t;
|
||||
|
||||
/* File lock types/flags */
|
||||
/**
|
||||
* @defgroup apr_file_lock_types File Lock Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define APR_FLOCK_SHARED 1 /**< Shared lock. More than one process
|
||||
or thread can hold a shared lock
|
||||
at any given time. Essentially,
|
||||
this is a "read lock", preventing
|
||||
writers from establishing an
|
||||
exclusive lock. */
|
||||
#define APR_FLOCK_EXCLUSIVE 2 /**< Exclusive lock. Only one process
|
||||
may hold an exclusive lock at any
|
||||
given time. This is analogous to
|
||||
a "write lock". */
|
||||
|
||||
#define APR_FLOCK_TYPEMASK 0x000F /**< mask to extract lock type */
|
||||
#define APR_FLOCK_NONBLOCK 0x0010 /**< do not block while acquiring the
|
||||
file lock */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* Open the specified file.
|
||||
* @param newf The opened file descriptor.
|
||||
* @param fname The full path to the file (using / on all systems)
|
||||
* @param flag Or'ed value of:
|
||||
* <PRE>
|
||||
* APR_READ open for reading
|
||||
* APR_WRITE open for writing
|
||||
* APR_CREATE create the file if not there
|
||||
* APR_APPEND file ptr is set to end prior to all writes
|
||||
* APR_TRUNCATE set length to zero if file exists
|
||||
* APR_BINARY not a text file (This flag is ignored on
|
||||
* UNIX because it has no meaning)
|
||||
* APR_BUFFERED buffer the data. Default is non-buffered
|
||||
* APR_EXCL return error if APR_CREATE and file exists
|
||||
* APR_DELONCLOSE delete the file after closing.
|
||||
* APR_XTHREAD Platform dependent tag to open the file
|
||||
* for use across multiple threads
|
||||
* APR_SHARELOCK Platform dependent support for higher
|
||||
* level locked read/write access to support
|
||||
* writes across process/machines
|
||||
* APR_FILE_NOCLEANUP Do not register a cleanup with the pool
|
||||
* passed in on the <EM>pool</EM> argument (see below).
|
||||
* The apr_os_file_t handle in apr_file_t will not
|
||||
* be closed when the pool is destroyed.
|
||||
* APR_SENDFILE_ENABLED Open with appropriate platform semantics
|
||||
* for sendfile operations. Advisory only,
|
||||
* apr_socket_sendfile does not check this flag.
|
||||
* </PRE>
|
||||
* @param perm Access permissions for file.
|
||||
* @param pool The pool to use.
|
||||
* @remark If perm is APR_OS_DEFAULT and the file is being created,
|
||||
* appropriate default permissions will be used.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **newf, const char *fname,
|
||||
apr_int32_t flag, apr_fileperms_t perm,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Close the specified file.
|
||||
* @param file The file descriptor to close.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file);
|
||||
|
||||
/**
|
||||
* Delete the specified file.
|
||||
* @param path The full path to the file (using / on all systems)
|
||||
* @param pool The pool to use.
|
||||
* @remark If the file is open, it won't be removed until all
|
||||
* instances are closed.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Rename the specified file.
|
||||
* @param from_path The full path to the original file (using / on all systems)
|
||||
* @param to_path The full path to the new file (using / on all systems)
|
||||
* @param pool The pool to use.
|
||||
* @warning If a file exists at the new location, then it will be
|
||||
* overwritten. Moving files or directories across devices may not be
|
||||
* possible.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path,
|
||||
const char *to_path,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Copy the specified file to another file.
|
||||
* @param from_path The full path to the original file (using / on all systems)
|
||||
* @param to_path The full path to the new file (using / on all systems)
|
||||
* @param perms Access permissions for the new file if it is created.
|
||||
* In place of the usual or'd combination of file permissions, the
|
||||
* value APR_FILE_SOURCE_PERMS may be given, in which case the source
|
||||
* file's permissions are copied.
|
||||
* @param pool The pool to use.
|
||||
* @remark The new file does not need to exist, it will be created if required.
|
||||
* @warning If the new file already exists, its contents will be overwritten.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path,
|
||||
const char *to_path,
|
||||
apr_fileperms_t perms,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Append the specified file to another file.
|
||||
* @param from_path The full path to the source file (use / on all systems)
|
||||
* @param to_path The full path to the destination file (use / on all systems)
|
||||
* @param perms Access permissions for the destination file if it is created.
|
||||
* In place of the usual or'd combination of file permissions, the
|
||||
* value APR_FILE_SOURCE_PERMS may be given, in which case the source
|
||||
* file's permissions are copied.
|
||||
* @param pool The pool to use.
|
||||
* @remark The new file does not need to exist, it will be created if required.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_append(const char *from_path,
|
||||
const char *to_path,
|
||||
apr_fileperms_t perms,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Are we at the end of the file
|
||||
* @param fptr The apr file we are testing.
|
||||
* @remark Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr);
|
||||
|
||||
/**
|
||||
* Open standard error as an apr file pointer.
|
||||
* @param thefile The apr file to use as stderr.
|
||||
* @param pool The pool to allocate the file out of.
|
||||
*
|
||||
* @remark The only reason that the apr_file_open_std* functions exist
|
||||
* is that you may not always have a stderr/out/in on Windows. This
|
||||
* is generally a problem with newer versions of Windows and services.
|
||||
*
|
||||
* @remark The other problem is that the C library functions generally work
|
||||
* differently on Windows and Unix. So, by using apr_file_open_std*
|
||||
* functions, you can get a handle to an APR struct that works with
|
||||
* the APR functions which are supposed to work identically on all
|
||||
* platforms.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* open standard output as an apr file pointer.
|
||||
* @param thefile The apr file to use as stdout.
|
||||
* @param pool The pool to allocate the file out of.
|
||||
*
|
||||
* @remark See remarks for apr_file_open_stdout.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* open standard input as an apr file pointer.
|
||||
* @param thefile The apr file to use as stdin.
|
||||
* @param pool The pool to allocate the file out of.
|
||||
*
|
||||
* @remark See remarks for apr_file_open_stdout.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Read data from the specified file.
|
||||
* @param thefile The file descriptor to read from.
|
||||
* @param buf The buffer to store the data to.
|
||||
* @param nbytes On entry, the number of bytes to read; on exit, the number
|
||||
* of bytes read.
|
||||
*
|
||||
* @remark apr_file_read will read up to the specified number of
|
||||
* bytes, but never more. If there isn't enough data to fill that
|
||||
* number of bytes, all of the available data is read. The third
|
||||
* argument is modified to reflect the number of bytes read. If a
|
||||
* char was put back into the stream via ungetc, it will be the first
|
||||
* character returned.
|
||||
*
|
||||
* @remark It is not possible for both bytes to be read and an APR_EOF
|
||||
* or other error to be returned. APR_EINTR is never returned.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf,
|
||||
apr_size_t *nbytes);
|
||||
|
||||
/**
|
||||
* Write data to the specified file.
|
||||
* @param thefile The file descriptor to write to.
|
||||
* @param buf The buffer which contains the data.
|
||||
* @param nbytes On entry, the number of bytes to write; on exit, the number
|
||||
* of bytes written.
|
||||
*
|
||||
* @remark apr_file_write will write up to the specified number of
|
||||
* bytes, but never more. If the OS cannot write that many bytes, it
|
||||
* will write as many as it can. The third argument is modified to
|
||||
* reflect the * number of bytes written.
|
||||
*
|
||||
* @remark It is possible for both bytes to be written and an error to
|
||||
* be returned. APR_EINTR is never returned.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf,
|
||||
apr_size_t *nbytes);
|
||||
|
||||
/**
|
||||
* Write data from iovec array to the specified file.
|
||||
* @param thefile The file descriptor to write to.
|
||||
* @param vec The array from which to get the data to write to the file.
|
||||
* @param nvec The number of elements in the struct iovec array. This must
|
||||
* be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function
|
||||
* will fail with APR_EINVAL.
|
||||
* @param nbytes The number of bytes written.
|
||||
*
|
||||
* @remark It is possible for both bytes to be written and an error to
|
||||
* be returned. APR_EINTR is never returned.
|
||||
*
|
||||
* @remark apr_file_writev is available even if the underlying
|
||||
* operating system doesn't provide writev().
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile,
|
||||
const struct iovec *vec,
|
||||
apr_size_t nvec, apr_size_t *nbytes);
|
||||
|
||||
/**
|
||||
* Read data from the specified file, ensuring that the buffer is filled
|
||||
* before returning.
|
||||
* @param thefile The file descriptor to read from.
|
||||
* @param buf The buffer to store the data to.
|
||||
* @param nbytes The number of bytes to read.
|
||||
* @param bytes_read If non-NULL, this will contain the number of bytes read.
|
||||
*
|
||||
* @remark apr_file_read will read up to the specified number of
|
||||
* bytes, but never more. If there isn't enough data to fill that
|
||||
* number of bytes, then the process/thread will block until it is
|
||||
* available or EOF is reached. If a char was put back into the
|
||||
* stream via ungetc, it will be the first character returned.
|
||||
*
|
||||
* @remark It is possible for both bytes to be read and an error to be
|
||||
* returned. And if *bytes_read is less than nbytes, an accompanying
|
||||
* error is _always_ returned.
|
||||
*
|
||||
* @remark APR_EINTR is never returned.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf,
|
||||
apr_size_t nbytes,
|
||||
apr_size_t *bytes_read);
|
||||
|
||||
/**
|
||||
* Write data to the specified file, ensuring that all of the data is
|
||||
* written before returning.
|
||||
* @param thefile The file descriptor to write to.
|
||||
* @param buf The buffer which contains the data.
|
||||
* @param nbytes The number of bytes to write.
|
||||
* @param bytes_written If non-NULL, set to the number of bytes written.
|
||||
*
|
||||
* @remark apr_file_write will write up to the specified number of
|
||||
* bytes, but never more. If the OS cannot write that many bytes, the
|
||||
* process/thread will block until they can be written. Exceptional
|
||||
* error such as "out of space" or "pipe closed" will terminate with
|
||||
* an error.
|
||||
*
|
||||
* @remark It is possible for both bytes to be written and an error to
|
||||
* be returned. And if *bytes_written is less than nbytes, an
|
||||
* accompanying error is _always_ returned.
|
||||
*
|
||||
* @remark APR_EINTR is never returned.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile,
|
||||
const void *buf,
|
||||
apr_size_t nbytes,
|
||||
apr_size_t *bytes_written);
|
||||
|
||||
|
||||
/**
|
||||
* Write data from iovec array to the specified file, ensuring that all of the
|
||||
* data is written before returning.
|
||||
* @param thefile The file descriptor to write to.
|
||||
* @param vec The array from which to get the data to write to the file.
|
||||
* @param nvec The number of elements in the struct iovec array. This must
|
||||
* be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function
|
||||
* will fail with APR_EINVAL.
|
||||
* @param nbytes The number of bytes written.
|
||||
*
|
||||
* @remark apr_file_writev_full is available even if the underlying
|
||||
* operating system doesn't provide writev().
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile,
|
||||
const struct iovec *vec,
|
||||
apr_size_t nvec,
|
||||
apr_size_t *nbytes);
|
||||
/**
|
||||
* Write a character into the specified file.
|
||||
* @param ch The character to write.
|
||||
* @param thefile The file descriptor to write to
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile);
|
||||
|
||||
/**
|
||||
* Read a character from the specified file.
|
||||
* @param ch The character to read into
|
||||
* @param thefile The file descriptor to read from
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile);
|
||||
|
||||
/**
|
||||
* Put a character back onto a specified stream.
|
||||
* @param ch The character to write.
|
||||
* @param thefile The file descriptor to write to
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile);
|
||||
|
||||
/**
|
||||
* Read a string from the specified file.
|
||||
* @param str The buffer to store the string in.
|
||||
* @param len The length of the string
|
||||
* @param thefile The file descriptor to read from
|
||||
* @remark The buffer will be NUL-terminated if any characters are stored.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len,
|
||||
apr_file_t *thefile);
|
||||
|
||||
/**
|
||||
* Write the string into the specified file.
|
||||
* @param str The string to write.
|
||||
* @param thefile The file descriptor to write to
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile);
|
||||
|
||||
/**
|
||||
* Flush the file's buffer.
|
||||
* @param thefile The file descriptor to flush
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile);
|
||||
|
||||
/**
|
||||
* Duplicate the specified file descriptor.
|
||||
* @param new_file The structure to duplicate into.
|
||||
* @param old_file The file to duplicate.
|
||||
* @param p The pool to use for the new file.
|
||||
* @remark *new_file must point to a valid apr_file_t, or point to NULL.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file,
|
||||
apr_file_t *old_file,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Duplicate the specified file descriptor and close the original
|
||||
* @param new_file The old file that is to be closed and reused
|
||||
* @param old_file The file to duplicate
|
||||
* @param p The pool to use for the new file
|
||||
*
|
||||
* @remark new_file MUST point at a valid apr_file_t. It cannot be NULL.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file,
|
||||
apr_file_t *old_file,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Move the specified file descriptor to a new pool
|
||||
* @param new_file Pointer in which to return the new apr_file_t
|
||||
* @param old_file The file to move
|
||||
* @param p The pool to which the descriptor is to be moved
|
||||
* @remark Unlike apr_file_dup2(), this function doesn't do an
|
||||
* OS dup() operation on the underlying descriptor; it just
|
||||
* moves the descriptor's apr_file_t wrapper to a new pool.
|
||||
* @remark The new pool need not be an ancestor of old_file's pool.
|
||||
* @remark After calling this function, old_file may not be used
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file,
|
||||
apr_file_t *old_file,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Move the read/write file offset to a specified byte within a file.
|
||||
* @param thefile The file descriptor
|
||||
* @param where How to move the pointer, one of:
|
||||
* <PRE>
|
||||
* APR_SET -- set the offset to offset
|
||||
* APR_CUR -- add the offset to the current position
|
||||
* APR_END -- add the offset to the current file size
|
||||
* </PRE>
|
||||
* @param offset The offset to move the pointer to.
|
||||
* @remark The third argument is modified to be the offset the pointer
|
||||
was actually moved to.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile,
|
||||
apr_seek_where_t where,
|
||||
apr_off_t *offset);
|
||||
|
||||
/**
|
||||
* Create an anonymous pipe.
|
||||
* @param in The file descriptor to use as input to the pipe.
|
||||
* @param out The file descriptor to use as output from the pipe.
|
||||
* @param pool The pool to operate on.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in,
|
||||
apr_file_t **out,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Create a named pipe.
|
||||
* @param filename The filename of the named pipe
|
||||
* @param perm The permissions for the newly created pipe.
|
||||
* @param pool The pool to operate on.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename,
|
||||
apr_fileperms_t perm,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Get the timeout value for a pipe or manipulate the blocking state.
|
||||
* @param thepipe The pipe we are getting a timeout for.
|
||||
* @param timeout The current timeout value in microseconds.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe,
|
||||
apr_interval_time_t *timeout);
|
||||
|
||||
/**
|
||||
* Set the timeout value for a pipe or manipulate the blocking state.
|
||||
* @param thepipe The pipe we are setting a timeout on.
|
||||
* @param timeout The timeout value in microseconds. Values < 0 mean wait
|
||||
* forever, 0 means do not wait at all.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe,
|
||||
apr_interval_time_t timeout);
|
||||
|
||||
/** file (un)locking functions. */
|
||||
|
||||
/**
|
||||
* Establish a lock on the specified, open file. The lock may be advisory
|
||||
* or mandatory, at the discretion of the platform. The lock applies to
|
||||
* the file as a whole, rather than a specific range. Locks are established
|
||||
* on a per-thread/process basis; a second lock by the same thread will not
|
||||
* block.
|
||||
* @param thefile The file to lock.
|
||||
* @param type The type of lock to establish on the file.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type);
|
||||
|
||||
/**
|
||||
* Remove any outstanding locks on the file.
|
||||
* @param thefile The file to unlock.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile);
|
||||
|
||||
/**accessor and general file_io functions. */
|
||||
|
||||
/**
|
||||
* return the file name of the current file.
|
||||
* @param new_path The path of the file.
|
||||
* @param thefile The currently open file.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path,
|
||||
apr_file_t *thefile);
|
||||
|
||||
/**
|
||||
* Return the data associated with the current file.
|
||||
* @param data The user data associated with the file.
|
||||
* @param key The key to use for retreiving data associated with this file.
|
||||
* @param file The currently open file.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key,
|
||||
apr_file_t *file);
|
||||
|
||||
/**
|
||||
* Set the data associated with the current file.
|
||||
* @param file The currently open file.
|
||||
* @param data The user data to associate with the file.
|
||||
* @param key The key to use for assocaiteing data with the file.
|
||||
* @param cleanup The cleanup routine to use when the file is destroyed.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data,
|
||||
const char *key,
|
||||
apr_status_t (*cleanup)(void *));
|
||||
|
||||
/**
|
||||
* Write a string to a file using a printf format.
|
||||
* @param fptr The file to write to.
|
||||
* @param format The format string
|
||||
* @param ... The values to substitute in the format string
|
||||
* @return The number of bytes written
|
||||
*/
|
||||
APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr,
|
||||
const char *format, ...)
|
||||
__attribute__((format(printf,2,3)));
|
||||
|
||||
/**
|
||||
* set the specified file's permission bits.
|
||||
* @param fname The file (name) to apply the permissions to.
|
||||
* @param perms The permission bits to apply to the file.
|
||||
*
|
||||
* @warning Some platforms may not be able to apply all of the
|
||||
* available permission bits; APR_INCOMPLETE will be returned if some
|
||||
* permissions are specified which could not be set.
|
||||
*
|
||||
* @warning Platforms which do not implement this feature will return
|
||||
* APR_ENOTIMPL.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname,
|
||||
apr_fileperms_t perms);
|
||||
|
||||
/**
|
||||
* Set attributes of the specified file.
|
||||
* @param fname The full path to the file (using / on all systems)
|
||||
* @param attributes Or'd combination of
|
||||
* <PRE>
|
||||
* APR_FILE_ATTR_READONLY - make the file readonly
|
||||
* APR_FILE_ATTR_EXECUTABLE - make the file executable
|
||||
* APR_FILE_ATTR_HIDDEN - make the file hidden
|
||||
* </PRE>
|
||||
* @param attr_mask Mask of valid bits in attributes.
|
||||
* @param pool the pool to use.
|
||||
* @remark This function should be used in preference to explict manipulation
|
||||
* of the file permissions, because the operations to provide these
|
||||
* attributes are platform specific and may involve more than simply
|
||||
* setting permission bits.
|
||||
* @warning Platforms which do not implement this feature will return
|
||||
* APR_ENOTIMPL.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname,
|
||||
apr_fileattrs_t attributes,
|
||||
apr_fileattrs_t attr_mask,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Set the mtime of the specified file.
|
||||
* @param fname The full path to the file (using / on all systems)
|
||||
* @param mtime The mtime to apply to the file.
|
||||
* @param pool The pool to use.
|
||||
* @warning Platforms which do not implement this feature will return
|
||||
* APR_ENOTIMPL.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname,
|
||||
apr_time_t mtime,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Create a new directory on the file system.
|
||||
* @param path the path for the directory to be created. (use / on all systems)
|
||||
* @param perm Permissions for the new direcoty.
|
||||
* @param pool the pool to use.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/** Creates a new directory on the file system, but behaves like
|
||||
* 'mkdir -p'. Creates intermediate directories as required. No error
|
||||
* will be reported if PATH already exists.
|
||||
* @param path the path for the directory to be created. (use / on all systems)
|
||||
* @param perm Permissions for the new direcoty.
|
||||
* @param pool the pool to use.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path,
|
||||
apr_fileperms_t perm,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Remove directory from the file system.
|
||||
* @param path the path for the directory to be removed. (use / on all systems)
|
||||
* @param pool the pool to use.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* get the specified file's stats.
|
||||
* @param finfo Where to store the information about the file.
|
||||
* @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values
|
||||
* @param thefile The file to get information about.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo,
|
||||
apr_int32_t wanted,
|
||||
apr_file_t *thefile);
|
||||
|
||||
|
||||
/**
|
||||
* Truncate the file's length to the specified offset
|
||||
* @param fp The file to truncate
|
||||
* @param offset The offset to truncate to.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset);
|
||||
|
||||
/**
|
||||
* Retrieve the flags that were passed into apr_file_open()
|
||||
* when the file was opened.
|
||||
* @return apr_int32_t the flags
|
||||
*/
|
||||
APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f);
|
||||
|
||||
/**
|
||||
* Get the pool used by the file.
|
||||
*/
|
||||
APR_POOL_DECLARE_ACCESSOR(file);
|
||||
|
||||
/**
|
||||
* Set a file to be inherited by child processes.
|
||||
*
|
||||
*/
|
||||
APR_DECLARE_INHERIT_SET(file);
|
||||
|
||||
/**
|
||||
* Unset a file from being inherited by child processes.
|
||||
*/
|
||||
APR_DECLARE_INHERIT_UNSET(file);
|
||||
|
||||
/**
|
||||
* Open a temporary file
|
||||
* @param fp The apr file to use as a temporary file.
|
||||
* @param templ The template to use when creating a temp file.
|
||||
* @param flags The flags to open the file with. If this is zero,
|
||||
* the file is opened with
|
||||
* APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE
|
||||
* @param p The pool to allocate the file out of.
|
||||
* @remark
|
||||
* This function generates a unique temporary file name from template.
|
||||
* The last six characters of template must be XXXXXX and these are replaced
|
||||
* with a string that makes the filename unique. Since it will be modified,
|
||||
* template must not be a string constant, but should be declared as a character
|
||||
* array.
|
||||
*
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ,
|
||||
apr_int32_t flags, apr_pool_t *p);
|
||||
|
||||
|
||||
/**
|
||||
* Find an existing directory suitable as a temporary storage location.
|
||||
* @param temp_dir The temp directory.
|
||||
* @param p The pool to use for any necessary allocations.
|
||||
* @remark
|
||||
* This function uses an algorithm to search for a directory that an
|
||||
* an application can use for temporary storage. Once such a
|
||||
* directory is found, that location is cached by the library. Thus,
|
||||
* callers only pay the cost of this algorithm once if that one time
|
||||
* is successful.
|
||||
*
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir,
|
||||
apr_pool_t *p);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! APR_FILE_IO_H */
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)fnmatch.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
/* This file has been modified by the Apache Software Foundation. */
|
||||
#ifndef _APR_FNMATCH_H_
|
||||
#define _APR_FNMATCH_H_
|
||||
|
||||
/**
|
||||
* @file apr_fnmatch.h
|
||||
* @brief APR FNMatch Functions
|
||||
*/
|
||||
|
||||
#include "apr_errno.h"
|
||||
#include "apr_tables.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup apr_fnmatch Filename Matching Functions
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define APR_FNM_NOMATCH 1 /**< Match failed. */
|
||||
|
||||
#define APR_FNM_NOESCAPE 0x01 /**< Disable backslash escaping. */
|
||||
#define APR_FNM_PATHNAME 0x02 /**< Slash must be matched by slash. */
|
||||
#define APR_FNM_PERIOD 0x04 /**< Period must be matched by period. */
|
||||
#define APR_FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively.
|
||||
* @remark This flag is an Apache addition
|
||||
*/
|
||||
|
||||
/**
|
||||
* Try to match the string to the given pattern, return APR_SUCCESS if
|
||||
* match, else return APR_FNM_NOMATCH.
|
||||
* @param pattern The pattern to match to
|
||||
* @param strings The string we are trying to match
|
||||
* @param flags flags to use in the match. Bitwise OR of:
|
||||
* <PRE>
|
||||
* APR_FNM_NOESCAPE Disable backslash escaping
|
||||
* APR_FNM_PATHNAME Slash must be matched by slash
|
||||
* APR_FNM_PERIOD Period must be matched by period
|
||||
* APR_FNM_CASE_BLIND Compare characters case-insensitively.
|
||||
* </PRE>
|
||||
*/
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern,
|
||||
const char *strings, int flags);
|
||||
|
||||
/**
|
||||
* Determine if the given pattern is a regular expression.
|
||||
* @param pattern The pattern to search for glob characters.
|
||||
* @return non-zero if pattern has any glob characters in it
|
||||
*/
|
||||
APR_DECLARE(int) apr_fnmatch_test(const char *pattern);
|
||||
|
||||
/**
|
||||
* Find all files that match a specified pattern.
|
||||
* @param pattern The pattern to use for finding files.
|
||||
* @param result Array to use when storing the results
|
||||
* @param p The pool to use.
|
||||
* @return non-zero if pattern has any glob characters in it
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern,
|
||||
apr_array_header_t **result,
|
||||
apr_pool_t *p);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_APR_FNMATCH_H_ */
|
||||
@@ -1,240 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_GENERAL_H
|
||||
#define APR_GENERAL_H
|
||||
|
||||
/**
|
||||
* @file apr_general.h
|
||||
* This is collection of oddballs that didn't fit anywhere else,
|
||||
* and might move to more appropriate headers with the release
|
||||
* of APR 1.0.
|
||||
* @brief APR Miscellaneous library routines
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_pools.h"
|
||||
#include "apr_errno.h"
|
||||
|
||||
#if APR_HAVE_SIGNAL_H
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @defgroup apr_general Miscellaneous library routines
|
||||
* @ingroup APR
|
||||
* This is collection of oddballs that didn't fit anywhere else,
|
||||
* and might move to more appropriate headers with the release
|
||||
* of APR 1.0.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** FALSE */
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
/** TRUE */
|
||||
#ifndef TRUE
|
||||
#define TRUE (!FALSE)
|
||||
#endif
|
||||
|
||||
/** a space */
|
||||
#define APR_ASCII_BLANK '\040'
|
||||
/** a carrige return */
|
||||
#define APR_ASCII_CR '\015'
|
||||
/** a line feed */
|
||||
#define APR_ASCII_LF '\012'
|
||||
/** a tab */
|
||||
#define APR_ASCII_TAB '\011'
|
||||
|
||||
/** signal numbers typedef */
|
||||
typedef int apr_signum_t;
|
||||
|
||||
/**
|
||||
* Finding offsets of elements within structures.
|
||||
* Taken from the X code... they've sweated portability of this stuff
|
||||
* so we don't have to. Sigh...
|
||||
* @param p_type pointer type name
|
||||
* @param field data field within the structure pointed to
|
||||
* @return offset
|
||||
*/
|
||||
|
||||
#if defined(CRAY) || (defined(__arm) && !defined(LINUX))
|
||||
#ifdef __STDC__
|
||||
#define APR_OFFSET(p_type,field) _Offsetof(p_type,field)
|
||||
#else
|
||||
#ifdef CRAY2
|
||||
#define APR_OFFSET(p_type,field) \
|
||||
(sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
|
||||
|
||||
#else /* !CRAY2 */
|
||||
|
||||
#define APR_OFFSET(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
|
||||
|
||||
#endif /* !CRAY2 */
|
||||
#endif /* __STDC__ */
|
||||
#else /* ! (CRAY || __arm) */
|
||||
|
||||
#define APR_OFFSET(p_type,field) \
|
||||
((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
|
||||
|
||||
#endif /* !CRAY */
|
||||
|
||||
/**
|
||||
* Finding offsets of elements within structures.
|
||||
* @param s_type structure type name
|
||||
* @param field data field within the structure
|
||||
* @return offset
|
||||
*/
|
||||
#if defined(offsetof) && !defined(__cplusplus)
|
||||
#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
|
||||
#else
|
||||
#define APR_OFFSETOF(s_type,field) APR_OFFSET(s_type*,field)
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN
|
||||
|
||||
/* A couple of prototypes for functions in case some platform doesn't
|
||||
* have it
|
||||
*/
|
||||
#if (!APR_HAVE_STRCASECMP) && (APR_HAVE_STRICMP)
|
||||
#define strcasecmp(s1, s2) stricmp(s1, s2)
|
||||
#elif (!APR_HAVE_STRCASECMP)
|
||||
int strcasecmp(const char *a, const char *b);
|
||||
#endif
|
||||
|
||||
#if (!APR_HAVE_STRNCASECMP) && (APR_HAVE_STRNICMP)
|
||||
#define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
|
||||
#elif (!APR_HAVE_STRNCASECMP)
|
||||
int strncasecmp(const char *a, const char *b, size_t n);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Alignment macros
|
||||
*/
|
||||
|
||||
/* APR_ALIGN() is only to be used to align on a power of 2 boundary */
|
||||
#define APR_ALIGN(size, boundary) \
|
||||
(((size) + ((boundary) - 1)) & ~((boundary) - 1))
|
||||
|
||||
/** Default alignment */
|
||||
#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
|
||||
|
||||
|
||||
/**
|
||||
* String and memory functions
|
||||
*/
|
||||
|
||||
/* APR_STRINGIFY is defined here, and also in apr_release.h, so wrap it */
|
||||
#ifndef APR_STRINGIFY
|
||||
/** Properly quote a value as a string in the C preprocessor */
|
||||
#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
|
||||
/** Helper macro for APR_STRINGIFY */
|
||||
#define APR_STRINGIFY_HELPER(n) #n
|
||||
#endif
|
||||
|
||||
#if (!APR_HAVE_MEMMOVE)
|
||||
#define memmove(a,b,c) bcopy(b,a,c)
|
||||
#endif
|
||||
|
||||
#if (!APR_HAVE_MEMCHR)
|
||||
void *memchr(const void *s, int c, size_t n);
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup apr_library Library initialization and termination
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Setup any APR internal data structures. This MUST be the first function
|
||||
* called for any APR library.
|
||||
* @remark See apr_app_initialize if this is an application, rather than
|
||||
* a library consumer of apr.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_initialize(void);
|
||||
|
||||
/**
|
||||
* Set up an application with normalized argc, argv (and optionally env) in
|
||||
* order to deal with platform-specific oddities, such as Win32 services,
|
||||
* code pages and signals. This must be the first function called for any
|
||||
* APR program.
|
||||
* @param argc Pointer to the argc that may be corrected
|
||||
* @param argv Pointer to the argv that may be corrected
|
||||
* @param env Pointer to the env that may be corrected, may be NULL
|
||||
* @remark See apr_initialize if this is a library consumer of apr.
|
||||
* Otherwise, this call is identical to apr_initialize, and must be closed
|
||||
* with a call to apr_terminate at the end of program execution.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_app_initialize(int *argc,
|
||||
char const * const * *argv,
|
||||
char const * const * *env);
|
||||
|
||||
/**
|
||||
* Tear down any APR internal data structures which aren't torn down
|
||||
* automatically.
|
||||
* @remark An APR program must call this function at termination once it
|
||||
* has stopped using APR services. The APR developers suggest using
|
||||
* atexit to ensure this is called. When using APR from a language
|
||||
* other than C that has problems with the calling convention, use
|
||||
* apr_terminate2() instead.
|
||||
*/
|
||||
APR_DECLARE_NONSTD(void) apr_terminate(void);
|
||||
|
||||
/**
|
||||
* Tear down any APR internal data structures which aren't torn down
|
||||
* automatically, same as apr_terminate
|
||||
* @remark An APR program must call either the apr_terminate or apr_terminate2
|
||||
* function once it it has finished using APR services. The APR
|
||||
* developers suggest using atexit(apr_terminate) to ensure this is done.
|
||||
* apr_terminate2 exists to allow non-c language apps to tear down apr,
|
||||
* while apr_terminate is recommended from c language applications.
|
||||
*/
|
||||
APR_DECLARE(void) apr_terminate2(void);
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup apr_random Random Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if APR_HAS_RANDOM || defined(DOXYGEN)
|
||||
|
||||
/* TODO: I'm not sure this is the best place to put this prototype...*/
|
||||
/**
|
||||
* Generate random bytes.
|
||||
* @param buf Buffer to fill with random bytes
|
||||
* @param length Length of buffer in bytes
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
|
||||
apr_size_t length);
|
||||
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! APR_GENERAL_H */
|
||||
@@ -1,157 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_GETOPT_H
|
||||
#define APR_GETOPT_H
|
||||
|
||||
/**
|
||||
* @file apr_getopt.h
|
||||
* @brief APR Command Arguments (getopt)
|
||||
*/
|
||||
|
||||
#include "apr_pools.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @defgroup apr_getopt Command Argument Parsing
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* defintion of a error function
|
||||
*/
|
||||
typedef void (apr_getopt_err_fn_t)(void *arg, const char *err, ...);
|
||||
|
||||
/** @see apr_getopt_t */
|
||||
typedef struct apr_getopt_t apr_getopt_t;
|
||||
|
||||
/**
|
||||
* Structure to store command line argument information.
|
||||
*/
|
||||
struct apr_getopt_t {
|
||||
/** context for processing */
|
||||
apr_pool_t *cont;
|
||||
/** function to print error message (NULL == no messages) */
|
||||
apr_getopt_err_fn_t *errfn;
|
||||
/** user defined first arg to pass to error message */
|
||||
void *errarg;
|
||||
/** index into parent argv vector */
|
||||
int ind;
|
||||
/** character checked for validity */
|
||||
int opt;
|
||||
/** reset getopt */
|
||||
int reset;
|
||||
/** count of arguments */
|
||||
int argc;
|
||||
/** array of pointers to arguments */
|
||||
const char **argv;
|
||||
/** argument associated with option */
|
||||
char const* place;
|
||||
/** set to nonzero to support interleaving options with regular args */
|
||||
int interleave;
|
||||
/** start of non-option arguments skipped for interleaving */
|
||||
int skip_start;
|
||||
/** end of non-option arguments skipped for interleaving */
|
||||
int skip_end;
|
||||
};
|
||||
|
||||
/** @see apr_getopt_option_t */
|
||||
typedef struct apr_getopt_option_t apr_getopt_option_t;
|
||||
|
||||
/**
|
||||
* Structure used to describe options that getopt should search for.
|
||||
*/
|
||||
struct apr_getopt_option_t {
|
||||
/** long option name, or NULL if option has no long name */
|
||||
const char *name;
|
||||
/** option letter, or a value greater than 255 if option has no letter */
|
||||
int optch;
|
||||
/** nonzero if option takes an argument */
|
||||
int has_arg;
|
||||
/** a description of the option */
|
||||
const char *description;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize the arguments for parsing by apr_getopt().
|
||||
* @param os The options structure created for apr_getopt()
|
||||
* @param cont The pool to operate on
|
||||
* @param argc The number of arguments to parse
|
||||
* @param argv The array of arguments to parse
|
||||
* @remark Arguments 2 and 3 are most commonly argc and argv from main(argc, argv)
|
||||
* The errfn is initialized to fprintf(stderr... but may be overridden.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont,
|
||||
int argc, const char * const *argv);
|
||||
|
||||
/**
|
||||
* Parse the options initialized by apr_getopt_init().
|
||||
* @param os The apr_opt_t structure returned by apr_getopt_init()
|
||||
* @param opts A string of characters that are acceptable options to the
|
||||
* program. Characters followed by ":" are required to have an
|
||||
* option associated
|
||||
* @param option_ch The next option character parsed
|
||||
* @param option_arg The argument following the option character:
|
||||
* @return There are four potential status values on exit. They are:
|
||||
* <PRE>
|
||||
* APR_EOF -- No more options to parse
|
||||
* APR_BADCH -- Found a bad option character
|
||||
* APR_BADARG -- No argument followed the option flag
|
||||
* APR_SUCCESS -- The next option was found.
|
||||
* </PRE>
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts,
|
||||
char *option_ch, const char **option_arg);
|
||||
|
||||
/**
|
||||
* Parse the options initialized by apr_getopt_init(), accepting long
|
||||
* options beginning with "--" in addition to single-character
|
||||
* options beginning with "-".
|
||||
* @param os The apr_getopt_t structure created by apr_getopt_init()
|
||||
* @param opts A pointer to a list of apr_getopt_option_t structures, which
|
||||
* can be initialized with { "name", optch, has_args }. has_args
|
||||
* is nonzero if the option requires an argument. A structure
|
||||
* with an optch value of 0 terminates the list.
|
||||
* @param option_ch Receives the value of "optch" from the apr_getopt_option_t
|
||||
* structure corresponding to the next option matched.
|
||||
* @param option_arg Receives the argument following the option, if any.
|
||||
* @return There are four potential status values on exit. They are:
|
||||
* <PRE>
|
||||
* APR_EOF -- No more options to parse
|
||||
* APR_BADCH -- Found a bad option character
|
||||
* APR_BADARG -- No argument followed the option flag
|
||||
* APR_SUCCESS -- The next option was found.
|
||||
* </PRE>
|
||||
* When APR_SUCCESS is returned, os->ind gives the index of the first
|
||||
* non-option argument. On error, a message will be printed to stdout unless
|
||||
* os->err is set to 0. If os->interleave is set to nonzero, options can come
|
||||
* after arguments, and os->argv will be permuted to leave non-option arguments
|
||||
* at the end (the original argv is unaffected).
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os,
|
||||
const apr_getopt_option_t *opts,
|
||||
int *option_ch,
|
||||
const char **option_arg);
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! APR_GETOPT_H */
|
||||
@@ -1,152 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_GLOBAL_MUTEX_H
|
||||
#define APR_GLOBAL_MUTEX_H
|
||||
|
||||
/**
|
||||
* @file apr_global_mutex.h
|
||||
* @brief APR Global Locking Routines
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_proc_mutex.h" /* only for apr_lockmech_e */
|
||||
#include "apr_pools.h"
|
||||
#include "apr_errno.h"
|
||||
#if APR_PROC_MUTEX_IS_GLOBAL
|
||||
#include "apr_proc_mutex.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @defgroup APR_GlobalMutex Global Locking Routines
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if !APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN)
|
||||
|
||||
/** Opaque global mutex structure. */
|
||||
typedef struct apr_global_mutex_t apr_global_mutex_t;
|
||||
|
||||
/* Function definitions */
|
||||
|
||||
/**
|
||||
* Create and initialize a mutex that can be used to synchronize both
|
||||
* processes and threads. Note: There is considerable overhead in using
|
||||
* this API if only cross-process or cross-thread mutual exclusion is
|
||||
* required. See apr_proc_mutex.h and apr_thread_mutex.h for more
|
||||
* specialized lock routines.
|
||||
* @param mutex the memory address where the newly created mutex will be
|
||||
* stored.
|
||||
* @param fname A file name to use if the lock mechanism requires one. This
|
||||
* argument should always be provided. The lock code itself will
|
||||
* determine if it should be used.
|
||||
* @param mech The mechanism to use for the interprocess lock, if any; one of
|
||||
* <PRE>
|
||||
* APR_LOCK_FCNTL
|
||||
* APR_LOCK_FLOCK
|
||||
* APR_LOCK_SYSVSEM
|
||||
* APR_LOCK_POSIXSEM
|
||||
* APR_LOCK_PROC_PTHREAD
|
||||
* APR_LOCK_DEFAULT pick the default mechanism for the platform
|
||||
* </PRE>
|
||||
* @param pool the pool from which to allocate the mutex.
|
||||
* @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports
|
||||
* APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex,
|
||||
const char *fname,
|
||||
apr_lockmech_e mech,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Re-open a mutex in a child process.
|
||||
* @param mutex The newly re-opened mutex structure.
|
||||
* @param fname A file name to use if the mutex mechanism requires one. This
|
||||
* argument should always be provided. The mutex code itself will
|
||||
* determine if it should be used. This filename should be the
|
||||
* same one that was passed to apr_global_mutex_create().
|
||||
* @param pool The pool to operate on.
|
||||
* @remark This function must be called to maintain portability, even
|
||||
* if the underlying lock mechanism does not require it.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_global_mutex_child_init(
|
||||
apr_global_mutex_t **mutex,
|
||||
const char *fname,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Acquire the lock for the given mutex. If the mutex is already locked,
|
||||
* the current thread will be put to sleep until the lock becomes available.
|
||||
* @param mutex the mutex on which to acquire the lock.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex);
|
||||
|
||||
/**
|
||||
* Attempt to acquire the lock for the given mutex. If the mutex has already
|
||||
* been acquired, the call returns immediately with APR_EBUSY. Note: it
|
||||
* is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine
|
||||
* if the return value was APR_EBUSY, for portability reasons.
|
||||
* @param mutex the mutex on which to attempt the lock acquiring.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex);
|
||||
|
||||
/**
|
||||
* Release the lock for the given mutex.
|
||||
* @param mutex the mutex from which to release the lock.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex);
|
||||
|
||||
/**
|
||||
* Destroy the mutex and free the memory associated with the lock.
|
||||
* @param mutex the mutex to destroy.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex);
|
||||
|
||||
/**
|
||||
* Get the pool used by this global_mutex.
|
||||
* @return apr_pool_t the pool
|
||||
*/
|
||||
APR_POOL_DECLARE_ACCESSOR(global_mutex);
|
||||
|
||||
#else /* APR_PROC_MUTEX_IS_GLOBAL */
|
||||
|
||||
/* Some platforms [e.g. Win32] have cross process locks that are truly
|
||||
* global locks, since there isn't the concept of cross-process locks.
|
||||
* Define these platforms in terms of an apr_proc_mutex_t.
|
||||
*/
|
||||
|
||||
#define apr_global_mutex_t apr_proc_mutex_t
|
||||
#define apr_global_mutex_create apr_proc_mutex_create
|
||||
#define apr_global_mutex_child_init apr_proc_mutex_child_init
|
||||
#define apr_global_mutex_lock apr_proc_mutex_lock
|
||||
#define apr_global_mutex_trylock apr_proc_mutex_trylock
|
||||
#define apr_global_mutex_unlock apr_proc_mutex_unlock
|
||||
#define apr_global_mutex_destroy apr_proc_mutex_destroy
|
||||
#define apr_global_mutex_pool_get apr_proc_mutex_pool_get
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ndef APR_GLOBAL_MUTEX_H */
|
||||
@@ -1,224 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_HASH_H
|
||||
#define APR_HASH_H
|
||||
|
||||
/**
|
||||
* @file apr_hash.h
|
||||
* @brief APR Hash Tables
|
||||
*/
|
||||
|
||||
#include "apr_pools.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup apr_hash Hash Tables
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* When passing a key to apr_hash_set or apr_hash_get, this value can be
|
||||
* passed to indicate a string-valued key, and have apr_hash compute the
|
||||
* length automatically.
|
||||
*
|
||||
* @remark apr_hash will use strlen(key) for the length. The NUL terminator
|
||||
* is not included in the hash value (why throw a constant in?).
|
||||
* Since the hash table merely references the provided key (rather
|
||||
* than copying it), apr_hash_this() will return the NUL-term'd key.
|
||||
*/
|
||||
#define APR_HASH_KEY_STRING (-1)
|
||||
|
||||
/**
|
||||
* Abstract type for hash tables.
|
||||
*/
|
||||
typedef struct apr_hash_t apr_hash_t;
|
||||
|
||||
/**
|
||||
* Abstract type for scanning hash tables.
|
||||
*/
|
||||
typedef struct apr_hash_index_t apr_hash_index_t;
|
||||
|
||||
/**
|
||||
* Callback functions for calculating hash values.
|
||||
* @param key The key.
|
||||
* @param klen The length of the key, or APR_HASH_KEY_STRING to use the string
|
||||
* length. If APR_HASH_KEY_STRING then returns the actual key length.
|
||||
*/
|
||||
typedef unsigned int (*apr_hashfunc_t)(const char *key, apr_ssize_t *klen);
|
||||
|
||||
/**
|
||||
* The default hash function.
|
||||
*/
|
||||
unsigned int apr_hashfunc_default(const char *key, apr_ssize_t *klen);
|
||||
|
||||
/**
|
||||
* Create a hash table.
|
||||
* @param pool The pool to allocate the hash table out of
|
||||
* @return The hash table just created
|
||||
*/
|
||||
APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Create a hash table with a custom hash function
|
||||
* @param pool The pool to allocate the hash table out of
|
||||
* @param hash_func A custom hash function.
|
||||
* @return The hash table just created
|
||||
*/
|
||||
APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool,
|
||||
apr_hashfunc_t hash_func);
|
||||
|
||||
/**
|
||||
* Make a copy of a hash table
|
||||
* @param pool The pool from which to allocate the new hash table
|
||||
* @param h The hash table to clone
|
||||
* @return The hash table just created
|
||||
* @remark Makes a shallow copy
|
||||
*/
|
||||
APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool,
|
||||
const apr_hash_t *h);
|
||||
|
||||
/**
|
||||
* Associate a value with a key in a hash table.
|
||||
* @param ht The hash table
|
||||
* @param key Pointer to the key
|
||||
* @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length.
|
||||
* @param val Value to associate with the key
|
||||
* @remark If the value is NULL the hash entry is deleted.
|
||||
*/
|
||||
APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key,
|
||||
apr_ssize_t klen, const void *val);
|
||||
|
||||
/**
|
||||
* Look up the value associated with a key in a hash table.
|
||||
* @param ht The hash table
|
||||
* @param key Pointer to the key
|
||||
* @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length.
|
||||
* @return Returns NULL if the key is not present.
|
||||
*/
|
||||
APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
|
||||
apr_ssize_t klen);
|
||||
|
||||
/**
|
||||
* Start iterating over the entries in a hash table.
|
||||
* @param p The pool to allocate the apr_hash_index_t iterator. If this
|
||||
* pool is NULL, then an internal, non-thread-safe iterator is used.
|
||||
* @param ht The hash table
|
||||
* @remark There is no restriction on adding or deleting hash entries during
|
||||
* an iteration (although the results may be unpredictable unless all you do
|
||||
* is delete the current entry) and multiple iterations can be in
|
||||
* progress at the same time.
|
||||
|
||||
* @example
|
||||
*/
|
||||
/**
|
||||
* <PRE>
|
||||
*
|
||||
* int sum_values(apr_pool_t *p, apr_hash_t *ht)
|
||||
* {
|
||||
* apr_hash_index_t *hi;
|
||||
* void *val;
|
||||
* int sum = 0;
|
||||
* for (hi = apr_hash_first(p, ht); hi; hi = apr_hash_next(hi)) {
|
||||
* apr_hash_this(hi, NULL, NULL, &val);
|
||||
* sum += *(int *)val;
|
||||
* }
|
||||
* return sum;
|
||||
* }
|
||||
* </PRE>
|
||||
*/
|
||||
APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht);
|
||||
|
||||
/**
|
||||
* Continue iterating over the entries in a hash table.
|
||||
* @param hi The iteration state
|
||||
* @return a pointer to the updated iteration state. NULL if there are no more
|
||||
* entries.
|
||||
*/
|
||||
APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi);
|
||||
|
||||
/**
|
||||
* Get the current entry's details from the iteration state.
|
||||
* @param hi The iteration state
|
||||
* @param key Return pointer for the pointer to the key.
|
||||
* @param klen Return pointer for the key length.
|
||||
* @param val Return pointer for the associated value.
|
||||
* @remark The return pointers should point to a variable that will be set to the
|
||||
* corresponding data, or they may be NULL if the data isn't interesting.
|
||||
*/
|
||||
APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key,
|
||||
apr_ssize_t *klen, void **val);
|
||||
|
||||
/**
|
||||
* Get the number of key/value pairs in the hash table.
|
||||
* @param ht The hash table
|
||||
* @return The number of key/value pairs in the hash table.
|
||||
*/
|
||||
APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht);
|
||||
|
||||
/**
|
||||
* Merge two hash tables into one new hash table. The values of the overlay
|
||||
* hash override the values of the base if both have the same key. Both
|
||||
* hash tables must use the same hash function.
|
||||
* @param p The pool to use for the new hash table
|
||||
* @param overlay The table to add to the initial table
|
||||
* @param base The table that represents the initial values of the new table
|
||||
* @return A new hash table containing all of the data from the two passed in
|
||||
*/
|
||||
APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p,
|
||||
const apr_hash_t *overlay,
|
||||
const apr_hash_t *base);
|
||||
|
||||
/**
|
||||
* Merge two hash tables into one new hash table. If the same key
|
||||
* is present in both tables, call the supplied merge function to
|
||||
* produce a merged value for the key in the new table. Both
|
||||
* hash tables must use the same hash function.
|
||||
* @param p The pool to use for the new hash table
|
||||
* @param h1 The first of the tables to merge
|
||||
* @param h2 The second of the tables to merge
|
||||
* @param merger A callback function to merge values, or NULL to
|
||||
* make values from h1 override values from h2 (same semantics as
|
||||
* apr_hash_overlay())
|
||||
* @param data Client data to pass to the merger function
|
||||
* @return A new hash table containing all of the data from the two passed in
|
||||
*/
|
||||
APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p,
|
||||
const apr_hash_t *h1,
|
||||
const apr_hash_t *h2,
|
||||
void * (*merger)(apr_pool_t *p,
|
||||
const void *key,
|
||||
apr_ssize_t klen,
|
||||
const void *h1_val,
|
||||
const void *h2_val,
|
||||
const void *data),
|
||||
const void *data);
|
||||
|
||||
/**
|
||||
* Get a pointer to the pool which the hash table was created in
|
||||
*/
|
||||
APR_POOL_DECLARE_ACCESSOR(hash);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !APR_HASH_H */
|
||||
@@ -1,255 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_HOOKS_H
|
||||
#define APR_HOOKS_H
|
||||
|
||||
#include "apu.h"
|
||||
/* For apr_array_header_t */
|
||||
#include "apr_tables.h"
|
||||
|
||||
/**
|
||||
* @file apr_hooks.h
|
||||
* @brief Apache hook functions
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/**
|
||||
* @defgroup APR_Util_Hook Hook Functions
|
||||
* @ingroup APR_Util
|
||||
* @{
|
||||
*/
|
||||
/** macro to return the prototype of the hook function */
|
||||
#define APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name) \
|
||||
link##_DECLARE(apr_array_header_t *) ns##_hook_get_##name(void)
|
||||
|
||||
/** macro to declare the hook correctly */
|
||||
#define APR_DECLARE_EXTERNAL_HOOK(ns,link,ret,name,args) \
|
||||
typedef ret ns##_HOOK_##name##_t args; \
|
||||
link##_DECLARE(void) ns##_hook_##name(ns##_HOOK_##name##_t *pf, \
|
||||
const char * const *aszPre, \
|
||||
const char * const *aszSucc, int nOrder); \
|
||||
link##_DECLARE(ret) ns##_run_##name args; \
|
||||
APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name); \
|
||||
typedef struct ns##_LINK_##name##_t \
|
||||
{ \
|
||||
ns##_HOOK_##name##_t *pFunc; \
|
||||
const char *szName; \
|
||||
const char * const *aszPredecessors; \
|
||||
const char * const *aszSuccessors; \
|
||||
int nOrder; \
|
||||
} ns##_LINK_##name##_t;
|
||||
|
||||
/** macro to declare the hook structure */
|
||||
#define APR_HOOK_STRUCT(members) \
|
||||
static struct { members } _hooks;
|
||||
|
||||
/** macro to link the hook structure */
|
||||
#define APR_HOOK_LINK(name) \
|
||||
apr_array_header_t *link_##name;
|
||||
|
||||
/** macro to implement the hook */
|
||||
#define APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \
|
||||
link##_DECLARE(void) ns##_hook_##name(ns##_HOOK_##name##_t *pf,const char * const *aszPre, \
|
||||
const char * const *aszSucc,int nOrder) \
|
||||
{ \
|
||||
ns##_LINK_##name##_t *pHook; \
|
||||
if(!_hooks.link_##name) \
|
||||
{ \
|
||||
_hooks.link_##name=apr_array_make(apr_hook_global_pool,1,sizeof(ns##_LINK_##name##_t)); \
|
||||
apr_hook_sort_register(#name,&_hooks.link_##name); \
|
||||
} \
|
||||
pHook=apr_array_push(_hooks.link_##name); \
|
||||
pHook->pFunc=pf; \
|
||||
pHook->aszPredecessors=aszPre; \
|
||||
pHook->aszSuccessors=aszSucc; \
|
||||
pHook->nOrder=nOrder; \
|
||||
pHook->szName=apr_hook_debug_current; \
|
||||
if(apr_hook_debug_enabled) \
|
||||
apr_hook_debug_show(#name,aszPre,aszSucc); \
|
||||
} \
|
||||
APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name) \
|
||||
{ \
|
||||
return _hooks.link_##name; \
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement a hook that has no return code, and therefore runs all of the
|
||||
* registered functions
|
||||
* @param ns The namespace prefix of the hook functions
|
||||
* @param link The linkage declaration prefix of the hook
|
||||
* @param name The name of the hook
|
||||
* @param args_decl The declaration of the arguments for the hook
|
||||
* @param args_use The names for the arguments for the hook
|
||||
* @note The link prefix FOO corresponds to FOO_DECLARE() macros, which
|
||||
* provide export linkage from the module that IMPLEMENTs the hook, and
|
||||
* import linkage from external modules that link to the hook's module.
|
||||
*/
|
||||
#define APR_IMPLEMENT_EXTERNAL_HOOK_VOID(ns,link,name,args_decl,args_use) \
|
||||
APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \
|
||||
link##_DECLARE(void) ns##_run_##name args_decl \
|
||||
{ \
|
||||
ns##_LINK_##name##_t *pHook; \
|
||||
int n; \
|
||||
\
|
||||
if(!_hooks.link_##name) \
|
||||
return; \
|
||||
\
|
||||
pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
|
||||
for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
|
||||
pHook[n].pFunc args_use; \
|
||||
}
|
||||
|
||||
/* FIXME: note that this returns ok when nothing is run. I suspect it should
|
||||
really return decline, but that breaks Apache currently - Ben
|
||||
*/
|
||||
/**
|
||||
* Implement a hook that runs until one of the functions returns something
|
||||
* other than OK or DECLINE
|
||||
* @param ns The namespace prefix of the hook functions
|
||||
* @param link The linkage declaration prefix of the hook
|
||||
* @param ret Type to return
|
||||
* @param name The name of the hook
|
||||
* @param args_decl The declaration of the arguments for the hook
|
||||
* @param args_use The names for the arguments for the hook
|
||||
* @param ok Success value
|
||||
* @param decline Decline value
|
||||
* @note The link prefix FOO corresponds to FOO_DECLARE() macros, which
|
||||
* provide export linkage from the module that IMPLEMENTs the hook, and
|
||||
* import linkage from external modules that link to the hook's module.
|
||||
*/
|
||||
#define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ns,link,ret,name,args_decl,args_use,ok,decline) \
|
||||
APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \
|
||||
link##_DECLARE(ret) ns##_run_##name args_decl \
|
||||
{ \
|
||||
ns##_LINK_##name##_t *pHook; \
|
||||
int n; \
|
||||
ret rv; \
|
||||
\
|
||||
if(!_hooks.link_##name) \
|
||||
return ok; \
|
||||
\
|
||||
pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
|
||||
for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
|
||||
{ \
|
||||
rv=pHook[n].pFunc args_use; \
|
||||
\
|
||||
if(rv != ok && rv != decline) \
|
||||
return rv; \
|
||||
} \
|
||||
return ok; \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Implement a hook that runs until the first function returns something
|
||||
* other than the value of decline
|
||||
* @param ns The namespace prefix of the hook functions
|
||||
* @param link The linkage declaration prefix of the hook
|
||||
* @param name The name of the hook
|
||||
* @param ret Type to return
|
||||
* @param args_decl The declaration of the arguments for the hook
|
||||
* @param args_use The names for the arguments for the hook
|
||||
* @param decline Decline value
|
||||
* @note The link prefix FOO corresponds to FOO_DECLARE() macros, which
|
||||
* provide export linkage from the module that IMPLEMENTs the hook, and
|
||||
* import linkage from external modules that link to the hook's module.
|
||||
*/
|
||||
#define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ns,link,ret,name,args_decl,args_use,decline) \
|
||||
APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \
|
||||
link##_DECLARE(ret) ns##_run_##name args_decl \
|
||||
{ \
|
||||
ns##_LINK_##name##_t *pHook; \
|
||||
int n; \
|
||||
ret rv; \
|
||||
\
|
||||
if(!_hooks.link_##name) \
|
||||
return decline; \
|
||||
\
|
||||
pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
|
||||
for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
|
||||
{ \
|
||||
rv=pHook[n].pFunc args_use; \
|
||||
\
|
||||
if(rv != decline) \
|
||||
return rv; \
|
||||
} \
|
||||
return decline; \
|
||||
}
|
||||
|
||||
/* Hook orderings */
|
||||
/** run this hook first, before ANYTHING */
|
||||
#define APR_HOOK_REALLY_FIRST (-10)
|
||||
/** run this hook first */
|
||||
#define APR_HOOK_FIRST 0
|
||||
/** run this hook somewhere */
|
||||
#define APR_HOOK_MIDDLE 10
|
||||
/** run this hook after every other hook which is defined*/
|
||||
#define APR_HOOK_LAST 20
|
||||
/** run this hook last, after EVERYTHING */
|
||||
#define APR_HOOK_REALLY_LAST 30
|
||||
|
||||
/**
|
||||
* The global pool used to allocate any memory needed by the hooks.
|
||||
*/
|
||||
APU_DECLARE_DATA extern apr_pool_t *apr_hook_global_pool;
|
||||
|
||||
/**
|
||||
* A global variable to determine if debugging information about the
|
||||
* hooks functions should be printed
|
||||
*/
|
||||
APU_DECLARE_DATA extern int apr_hook_debug_enabled;
|
||||
|
||||
/**
|
||||
* The name of the module that is currently registering a function
|
||||
*/
|
||||
APU_DECLARE_DATA extern const char *apr_hook_debug_current;
|
||||
|
||||
/**
|
||||
* Register a hook function to be sorted
|
||||
* @param szHookName The name of the Hook the function is registered for
|
||||
* @param aHooks The array which stores all of the functions for this hook
|
||||
*/
|
||||
APU_DECLARE(void) apr_hook_sort_register(const char *szHookName,
|
||||
apr_array_header_t **aHooks);
|
||||
/**
|
||||
* Sort all of the registerd functions for a given hook
|
||||
*/
|
||||
APU_DECLARE(void) apr_hook_sort_all(void);
|
||||
|
||||
/**
|
||||
* Print all of the information about the current hook. This is used for
|
||||
* debugging purposes.
|
||||
* @param szName The name of the hook
|
||||
* @param aszPre All of the functions in the predecessor array
|
||||
* @param aszSucc All of the functions in the successor array
|
||||
*/
|
||||
APU_DECLARE(void) apr_hook_debug_show(const char *szName,
|
||||
const char * const *aszPre,
|
||||
const char * const *aszSucc);
|
||||
|
||||
/**
|
||||
* Remove all currently registered functions.
|
||||
*/
|
||||
APU_DECLARE(void) apr_hook_deregister_all(void);
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* APR_HOOKS_H */
|
||||
@@ -1,50 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_INHERIT_H
|
||||
#define APR_INHERIT_H
|
||||
|
||||
/**
|
||||
* @file apr_inherit.h
|
||||
* @brief APR File Handle Inheritance Helpers
|
||||
* @remark This internal header includes internal declaration helpers
|
||||
* for other headers to declare apr_foo_inherit_[un]set functions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Prototype for type-specific declarations of apr_foo_inherit_set
|
||||
* functions.
|
||||
* @remark Doxygen unwraps this macro (via doxygen.conf) to provide
|
||||
* actual help for each specific occurance of apr_foo_inherit_set.
|
||||
* @remark the linkage is specified for APR. It would be possible to expand
|
||||
* the macros to support other linkages.
|
||||
*/
|
||||
#define APR_DECLARE_INHERIT_SET(type) \
|
||||
APR_DECLARE(apr_status_t) apr_##type##_inherit_set( \
|
||||
apr_##type##_t *the##type)
|
||||
|
||||
/**
|
||||
* Prototype for type-specific declarations of apr_foo_inherit_unset
|
||||
* functions.
|
||||
* @remark Doxygen unwraps this macro (via doxygen.conf) to provide
|
||||
* actual help for each specific occurance of apr_foo_inherit_unset.
|
||||
* @remark the linkage is specified for APR. It would be possible to expand
|
||||
* the macros to support other linkages.
|
||||
*/
|
||||
#define APR_DECLARE_INHERIT_UNSET(type) \
|
||||
APR_DECLARE(apr_status_t) apr_##type##_inherit_unset( \
|
||||
apr_##type##_t *the##type)
|
||||
|
||||
#endif /* ! APR_INHERIT_H */
|
||||
@@ -1,124 +0,0 @@
|
||||
/* Copyright 2002-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h
|
||||
*/
|
||||
/**
|
||||
* @file apr_ldap.h
|
||||
* @brief APR-UTIL LDAP
|
||||
*/
|
||||
#ifndef APU_LDAP_H
|
||||
#define APU_LDAP_H
|
||||
|
||||
/**
|
||||
* @defgroup APR_Util_LDAP LDAP
|
||||
* @ingroup APR_Util
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* this will be defined if LDAP support was compiled into apr-util */
|
||||
#define APR_HAS_LDAP 0
|
||||
|
||||
/* identify the LDAP toolkit used */
|
||||
#define APR_HAS_NETSCAPE_LDAPSDK 0
|
||||
#define APR_HAS_SOLARIS_LDAPSDK 0
|
||||
#define APR_HAS_NOVELL_LDAPSDK 0
|
||||
#define APR_HAS_MOZILLA_LDAPSDK 0
|
||||
#define APR_HAS_OPENLDAP_LDAPSDK 0
|
||||
#define APR_HAS_MICROSOFT_LDAPSDK 0
|
||||
#define APR_HAS_OTHER_LDAPSDK 0
|
||||
|
||||
|
||||
/*
|
||||
* Handle the case when LDAP is enabled
|
||||
*/
|
||||
#if APR_HAS_LDAP
|
||||
|
||||
/*
|
||||
* The following #defines are DEPRECATED and should not be used for
|
||||
* anything. They remain to maintain binary compatibility.
|
||||
* The original code defined the OPENLDAP SDK as present regardless
|
||||
* of what really was there, which was way bogus. In addition, the
|
||||
* apr_ldap_url_parse*() functions have been rewritten specifically for
|
||||
* APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero.
|
||||
*/
|
||||
#define APR_HAS_LDAP_SSL 1
|
||||
#define APR_HAS_LDAP_URL_PARSE 0
|
||||
|
||||
|
||||
/*
|
||||
* Include the standard LDAP header files.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Detected standard functions
|
||||
*/
|
||||
#define APR_HAS_LDAPSSL_CLIENT_INIT 0
|
||||
#define APR_HAS_LDAPSSL_CLIENT_DEINIT 0
|
||||
#define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 0
|
||||
#define APR_HAS_LDAP_START_TLS_S 0
|
||||
#define APR_HAS_LDAP_SSLINIT 0
|
||||
#define APR_HAS_LDAPSSL_INIT 0
|
||||
#define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0
|
||||
|
||||
/*
|
||||
* Make sure the secure LDAP port is defined
|
||||
*/
|
||||
#ifndef LDAPS_PORT
|
||||
#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */
|
||||
#endif
|
||||
|
||||
|
||||
/* Note: Macros defining const casting has been removed in APR v1.0,
|
||||
* pending real support for LDAP v2.0 toolkits.
|
||||
*
|
||||
* In the mean time, please use an LDAP v3.0 toolkit.
|
||||
*/
|
||||
#if LDAP_VERSION_MAX <= 2
|
||||
#error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* This structure allows the C LDAP API error codes to be returned
|
||||
* along with plain text error messages that explain to us mere mortals
|
||||
* what really happened.
|
||||
*/
|
||||
typedef struct apr_ldap_err_t {
|
||||
const char *reason;
|
||||
const char *msg;
|
||||
int rc;
|
||||
} apr_ldap_err_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "apr_ldap_url.h"
|
||||
#include "apr_ldap_init.h"
|
||||
#include "apr_ldap_option.h"
|
||||
|
||||
/** @} */
|
||||
#endif /* APR_HAS_LDAP */
|
||||
#endif /* APU_LDAP_H */
|
||||
@@ -1,136 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file apr_ldap_init.h
|
||||
* @brief APR-UTIL LDAP ldap_init() functions
|
||||
*/
|
||||
#ifndef APR_LDAP_INIT_H
|
||||
#define APR_LDAP_INIT_H
|
||||
|
||||
/**
|
||||
* @defgroup APR_Util_LDAP LDAP
|
||||
* @ingroup APR_Util
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "apr_ldap.h"
|
||||
|
||||
#if APR_HAS_LDAP
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* APR LDAP SSL Initialise function
|
||||
*
|
||||
* This function initialises SSL on the underlying LDAP toolkit
|
||||
* if this is necessary.
|
||||
*
|
||||
* If a CA certificate is provided, this is set, however the setting
|
||||
* of certificates via this method has been deprecated and will be removed in
|
||||
* APR v2.0.
|
||||
*
|
||||
* The apr_ldap_set_option() function with the APR_LDAP_OPT_TLS_CERT option
|
||||
* should be used instead to set certificates.
|
||||
*
|
||||
* If SSL support is not available on this platform, or a problem
|
||||
* was encountered while trying to set the certificate, the function
|
||||
* will return APR_EGENERAL. Further LDAP specific error information
|
||||
* can be found in result_err.
|
||||
* @param pool The pool to use
|
||||
* @param cert_auth_file The name of the certificate to use, can be NULL
|
||||
* @param cert_file_type The type of certificate specified. See the
|
||||
* apr_ldap_set_option() APR_LDAP_OPT_TLS_CERT option for details.
|
||||
* @param result_err The returned result
|
||||
*/
|
||||
APU_DECLARE(int) apr_ldap_ssl_init(apr_pool_t *pool,
|
||||
const char *cert_auth_file,
|
||||
int cert_file_type,
|
||||
apr_ldap_err_t **result_err);
|
||||
|
||||
/**
|
||||
* APR LDAP SSL De-Initialise function
|
||||
*
|
||||
* This function tears down any SSL certificate setup previously
|
||||
* set using apr_ldap_ssl_init(). It should be called to clean
|
||||
* up if a graceful restart of a service is attempted.
|
||||
* @todo currently we do not check whether apr_ldap_ssl_init()
|
||||
* has been called first - we probably should.
|
||||
*/
|
||||
APU_DECLARE(int) apr_ldap_ssl_deinit(void);
|
||||
|
||||
/**
|
||||
* APR LDAP initialise function
|
||||
*
|
||||
* This function is responsible for initialising an LDAP
|
||||
* connection in a toolkit independant way. It does the
|
||||
* job of ldap_init() from the C api.
|
||||
*
|
||||
* It handles both the SSL and non-SSL case, and attempts
|
||||
* to hide the complexity setup from the user. This function
|
||||
* assumes that any certificate setup necessary has already
|
||||
* been done.
|
||||
*
|
||||
* If SSL or STARTTLS needs to be enabled, and the underlying
|
||||
* toolkit supports it, the following values are accepted for
|
||||
* secure:
|
||||
*
|
||||
* APR_LDAP_NONE: No encryption
|
||||
* APR_LDAP_SSL: SSL encryption (ldaps://)
|
||||
* APR_LDAP_STARTTLS: Force STARTTLS on ldap://
|
||||
* @remark The Novell toolkit is only able to set the SSL mode via this
|
||||
* function. To work around this limitation, set the SSL mode here if no
|
||||
* per connection client certificates are present, otherwise set secure
|
||||
* APR_LDAP_NONE here, then set the per connection client certificates,
|
||||
* followed by setting the SSL mode via apr_ldap_set_option(). As Novell
|
||||
* does not support per connection client certificates, this problem is
|
||||
* worked around while still being compatible with other LDAP toolkits.
|
||||
* @param pool The pool to use
|
||||
* @param ldap The LDAP handle
|
||||
* @param hostname The name of the host to connect to. This can be either a
|
||||
* DNS name, or an IP address.
|
||||
* @param portno The port to connect to
|
||||
* @param secure The security mode to set
|
||||
* @param result_err The returned result
|
||||
*/
|
||||
APU_DECLARE(int) apr_ldap_init(apr_pool_t *pool,
|
||||
LDAP **ldap,
|
||||
const char *hostname,
|
||||
int portno,
|
||||
int secure,
|
||||
apr_ldap_err_t **result_err);
|
||||
|
||||
/**
|
||||
* APR LDAP info function
|
||||
*
|
||||
* This function returns a string describing the LDAP toolkit
|
||||
* currently in use. The string is placed inside result_err->reason.
|
||||
* @param pool The pool to use
|
||||
* @param result_err The returned result
|
||||
*/
|
||||
APU_DECLARE(int) apr_ldap_info(apr_pool_t *pool,
|
||||
apr_ldap_err_t **result_err);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* APR_HAS_LDAP */
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* APR_LDAP_URL_H */
|
||||
@@ -1,234 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file apr_ldap_option.h
|
||||
* @brief APR-UTIL LDAP ldap_*_option() functions
|
||||
*/
|
||||
#ifndef APR_LDAP_OPTION_H
|
||||
#define APR_LDAP_OPTION_H
|
||||
|
||||
/**
|
||||
* @defgroup APR_Util_LDAP LDAP
|
||||
* @ingroup APR_Util
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "apr_ldap.h"
|
||||
|
||||
#if APR_HAS_LDAP
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* The following defines handle the different TLS certificate
|
||||
* options available. If these options are missing, APR will try and
|
||||
* emulate support for this using the deprecated ldap_start_tls_s()
|
||||
* function.
|
||||
*/
|
||||
/**
|
||||
* Set SSL mode to one of APR_LDAP_NONE, APR_LDAP_SSL, APR_LDAP_STARTTLS
|
||||
* or APR_LDAP_STOPTLS.
|
||||
*/
|
||||
#define APR_LDAP_OPT_TLS 0x6fff
|
||||
/**
|
||||
* Set zero or more CA certificates, client certificates or private
|
||||
* keys globally, or per connection (where supported).
|
||||
*/
|
||||
#define APR_LDAP_OPT_TLS_CERT 0x6ffe
|
||||
|
||||
/**
|
||||
* Structures for the apr_set_option() cases
|
||||
*/
|
||||
|
||||
/**
|
||||
* APR_LDAP_OPT_TLS_CERT
|
||||
*
|
||||
* This structure includes possible options to set certificates on
|
||||
* system initialisation. Different SDKs have different certificate
|
||||
* requirements, and to achieve this multiple certificates must be
|
||||
* specified at once passed as an (apr_array_header_t *).
|
||||
*
|
||||
* Netscape:
|
||||
* Needs the CA cert database (cert7.db), the client cert database (key3.db)
|
||||
* and the security module file (secmod.db) set at the system initialisation
|
||||
* time. Three types are supported: APR_LDAP_CERT7_DB, APR_LDAP_KEY3_DB and
|
||||
* APR_LDAP_SECMOD.
|
||||
*
|
||||
* To specify a client cert connection, a certificate nickname needs to be
|
||||
* provided with a type of APR_LDAP_CERT.
|
||||
* int ldapssl_enable_clientauth( LDAP *ld, char *keynickname,
|
||||
* char *keypasswd, char *certnickname );
|
||||
* keynickname is currently not used, and should be set to ""
|
||||
*
|
||||
* Novell:
|
||||
* Needs CA certificates and client certificates set at system initialisation
|
||||
* time. Three types are supported: APR_LDAP_CA*, APR_LDAP_CERT* and
|
||||
* APR_LDAP_KEY*.
|
||||
*
|
||||
* Certificates cannot be specified per connection.
|
||||
*
|
||||
* The functions used are:
|
||||
* ldapssl_add_trusted_cert(serverTrustedRoot, serverTrustedRootEncoding);
|
||||
* Clients certs and keys are set at system initialisation time with
|
||||
* int ldapssl_set_client_cert (
|
||||
* void *cert,
|
||||
* int type
|
||||
* void *password);
|
||||
* type can be LDAPSSL_CERT_FILETYPE_B64 or LDAPSSL_CERT_FILETYPE_DER
|
||||
* ldapssl_set_client_private_key(clientPrivateKey,
|
||||
* clientPrivateKeyEncoding,
|
||||
* clientPrivateKeyPassword);
|
||||
*
|
||||
* OpenSSL:
|
||||
* Needs one or more CA certificates to be set at system initialisation time
|
||||
* with a type of APR_LDAP_CA*.
|
||||
*
|
||||
* May have one or more client certificates set per connection with a type of
|
||||
* APR_LDAP_CERT*, and keys with APR_LDAP_KEY*.
|
||||
*/
|
||||
/** CA certificate type unknown */
|
||||
#define APR_LDAP_CA_TYPE_UNKNOWN 0
|
||||
/** binary DER encoded CA certificate */
|
||||
#define APR_LDAP_CA_TYPE_DER 1
|
||||
/** PEM encoded CA certificate */
|
||||
#define APR_LDAP_CA_TYPE_BASE64 2
|
||||
/** Netscape/Mozilla cert7.db CA certificate database */
|
||||
#define APR_LDAP_CA_TYPE_CERT7_DB 3
|
||||
/** Netscape/Mozilla secmod file */
|
||||
#define APR_LDAP_CA_TYPE_SECMOD 4
|
||||
/** Client certificate type unknown */
|
||||
#define APR_LDAP_CERT_TYPE_UNKNOWN 5
|
||||
/** binary DER encoded client certificate */
|
||||
#define APR_LDAP_CERT_TYPE_DER 6
|
||||
/** PEM encoded client certificate */
|
||||
#define APR_LDAP_CERT_TYPE_BASE64 7
|
||||
/** Netscape/Mozilla key3.db client certificate database */
|
||||
#define APR_LDAP_CERT_TYPE_KEY3_DB 8
|
||||
/** Netscape/Mozilla client certificate nickname */
|
||||
#define APR_LDAP_CERT_TYPE_NICKNAME 9
|
||||
/** Private key type unknown */
|
||||
#define APR_LDAP_KEY_TYPE_UNKNOWN 10
|
||||
/** binary DER encoded private key */
|
||||
#define APR_LDAP_KEY_TYPE_DER 11
|
||||
/** PEM encoded private key */
|
||||
#define APR_LDAP_KEY_TYPE_BASE64 12
|
||||
/** PKCS#12 encoded client certificate */
|
||||
#define APR_LDAP_CERT_TYPE_PFX 13
|
||||
/** PKCS#12 encoded private key */
|
||||
#define APR_LDAP_KEY_TYPE_PFX 14
|
||||
|
||||
/**
|
||||
* Certificate structure.
|
||||
*
|
||||
* This structure is used to store certificate details. An array of
|
||||
* these structures is passed to apr_ldap_set_option() to set CA
|
||||
* and client certificates.
|
||||
* @param type Type of certificate APR_LDAP_*_TYPE_*
|
||||
* @param path Path, file or nickname of the certificate
|
||||
* @param password Optional password, can be NULL
|
||||
*/
|
||||
typedef struct apr_ldap_opt_tls_cert_t apr_ldap_opt_tls_cert_t;
|
||||
struct apr_ldap_opt_tls_cert_t {
|
||||
int type;
|
||||
const char *path;
|
||||
const char *password;
|
||||
};
|
||||
|
||||
/**
|
||||
* APR_LDAP_OPT_TLS
|
||||
*
|
||||
* This sets the SSL level on the LDAP handle.
|
||||
*
|
||||
* Netscape/Mozilla:
|
||||
* Supports SSL, but not STARTTLS
|
||||
* SSL is enabled by calling ldapssl_install_routines().
|
||||
*
|
||||
* Novell:
|
||||
* Supports SSL and STARTTLS.
|
||||
* SSL is enabled by calling ldapssl_install_routines(). Note that calling
|
||||
* other ldap functions before ldapssl_install_routines() may cause this
|
||||
* function to fail.
|
||||
* STARTTLS is enabled by calling ldapssl_start_tls_s() after calling
|
||||
* ldapssl_install_routines() (check this).
|
||||
*
|
||||
* OpenLDAP:
|
||||
* Supports SSL and supports STARTTLS, but none of this is documented:
|
||||
* http://www.openldap.org/lists/openldap-software/200409/msg00618.html
|
||||
* Documentation for both SSL support and STARTTLS has been deleted from
|
||||
* the OpenLDAP documentation and website.
|
||||
*/
|
||||
|
||||
/** No encryption */
|
||||
#define APR_LDAP_NONE 0
|
||||
/** SSL encryption (ldaps://) */
|
||||
#define APR_LDAP_SSL 1
|
||||
/** TLS encryption (STARTTLS) */
|
||||
#define APR_LDAP_STARTTLS 2
|
||||
/** end TLS encryption (STOPTLS) */
|
||||
#define APR_LDAP_STOPTLS 3
|
||||
|
||||
/**
|
||||
* APR LDAP get option function
|
||||
*
|
||||
* This function gets option values from a given LDAP session if
|
||||
* one was specified. It maps to the native ldap_get_option() function.
|
||||
* @param pool The pool to use
|
||||
* @param ldap The LDAP handle
|
||||
* @param option The LDAP_OPT_* option to return
|
||||
* @param outvalue The value returned (if any)
|
||||
* @param result_err The apr_ldap_err_t structure contained detailed results
|
||||
* of the operation.
|
||||
*/
|
||||
APU_DECLARE(int) apr_ldap_get_option(apr_pool_t *pool,
|
||||
LDAP *ldap,
|
||||
int option,
|
||||
void *outvalue,
|
||||
apr_ldap_err_t **result_err);
|
||||
|
||||
/**
|
||||
* APR LDAP set option function
|
||||
*
|
||||
* This function sets option values to a given LDAP session if
|
||||
* one was specified. It maps to the native ldap_set_option() function.
|
||||
*
|
||||
* Where an option is not supported by an LDAP toolkit, this function
|
||||
* will try and apply legacy functions to achieve the same effect,
|
||||
* depending on the platform.
|
||||
* @param pool The pool to use
|
||||
* @param ldap The LDAP handle
|
||||
* @param option The LDAP_OPT_* option to set
|
||||
* @param invalue The value to set
|
||||
* @param result_err The apr_ldap_err_t structure contained detailed results
|
||||
* of the operation.
|
||||
*/
|
||||
APU_DECLARE(int) apr_ldap_set_option(apr_pool_t *pool,
|
||||
LDAP *ldap,
|
||||
int option,
|
||||
const void *invalue,
|
||||
apr_ldap_err_t **result_err);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* APR_HAS_LDAP */
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* APR_LDAP_OPTION_H */
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file apr_ldap_url.h
|
||||
* @brief APR-UTIL LDAP ldap_init() functions
|
||||
*/
|
||||
#ifndef APR_LDAP_URL_H
|
||||
#define APR_LDAP_URL_H
|
||||
|
||||
/**
|
||||
* @defgroup APR_Util_LDAP LDAP
|
||||
* @ingroup APR_Util
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if APR_HAS_LDAP
|
||||
|
||||
#include "apu.h"
|
||||
#include "apr_pools.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** Structure to access an exploded LDAP URL */
|
||||
typedef struct apr_ldap_url_desc_t {
|
||||
struct apr_ldap_url_desc_t *lud_next;
|
||||
char *lud_scheme;
|
||||
char *lud_host;
|
||||
int lud_port;
|
||||
char *lud_dn;
|
||||
char **lud_attrs;
|
||||
int lud_scope;
|
||||
char *lud_filter;
|
||||
char **lud_exts;
|
||||
int lud_crit_exts;
|
||||
} apr_ldap_url_desc_t;
|
||||
|
||||
#ifndef APR_LDAP_URL_SUCCESS
|
||||
#define APR_LDAP_URL_SUCCESS 0x00 /* Success */
|
||||
#define APR_LDAP_URL_ERR_MEM 0x01 /* can't allocate memory space */
|
||||
#define APR_LDAP_URL_ERR_PARAM 0x02 /* parameter is bad */
|
||||
#define APR_LDAP_URL_ERR_BADSCHEME 0x03 /* URL doesn't begin with "ldap[si]://" */
|
||||
#define APR_LDAP_URL_ERR_BADENCLOSURE 0x04 /* URL is missing trailing ">" */
|
||||
#define APR_LDAP_URL_ERR_BADURL 0x05 /* URL is bad */
|
||||
#define APR_LDAP_URL_ERR_BADHOST 0x06 /* host port is bad */
|
||||
#define APR_LDAP_URL_ERR_BADATTRS 0x07 /* bad (or missing) attributes */
|
||||
#define APR_LDAP_URL_ERR_BADSCOPE 0x08 /* scope string is invalid (or missing) */
|
||||
#define APR_LDAP_URL_ERR_BADFILTER 0x09 /* bad or missing filter */
|
||||
#define APR_LDAP_URL_ERR_BADEXTS 0x0a /* bad or missing extensions */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Is this URL an ldap url? ldap://
|
||||
* @param url The url to test
|
||||
*/
|
||||
APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url);
|
||||
|
||||
/**
|
||||
* Is this URL an SSL ldap url? ldaps://
|
||||
* @param url The url to test
|
||||
*/
|
||||
APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url);
|
||||
|
||||
/**
|
||||
* Is this URL an ldap socket url? ldapi://
|
||||
* @param url The url to test
|
||||
*/
|
||||
APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url);
|
||||
|
||||
/**
|
||||
* Parse an LDAP URL.
|
||||
* @param pool The pool to use
|
||||
* @param url_in The URL to parse
|
||||
* @param ludpp The structure to return the exploded URL
|
||||
* @param result_err The result structure of the operation
|
||||
*/
|
||||
APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool,
|
||||
const char *url_in,
|
||||
apr_ldap_url_desc_t **ludpp,
|
||||
apr_ldap_err_t **result_err);
|
||||
|
||||
/**
|
||||
* Parse an LDAP URL.
|
||||
* @param pool The pool to use
|
||||
* @param url_in The URL to parse
|
||||
* @param ludpp The structure to return the exploded URL
|
||||
* @param result_err The result structure of the operation
|
||||
*/
|
||||
APU_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool,
|
||||
const char *url_in,
|
||||
apr_ldap_url_desc_t **ludpp,
|
||||
apr_ldap_err_t **result_err);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* APR_HAS_LDAP */
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* APR_LDAP_URL_H */
|
||||
@@ -1,229 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_LIB_H
|
||||
#define APR_LIB_H
|
||||
|
||||
/**
|
||||
* @file apr_lib.h
|
||||
* This is collection of oddballs that didn't fit anywhere else,
|
||||
* and might move to more appropriate headers with the release
|
||||
* of APR 1.0.
|
||||
* @brief APR general purpose library routines
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_errno.h"
|
||||
|
||||
#if APR_HAVE_CTYPE_H
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
#if APR_HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @defgroup apr_lib General Purpose Library Routines
|
||||
* @ingroup APR
|
||||
* This is collection of oddballs that didn't fit anywhere else,
|
||||
* and might move to more appropriate headers with the release
|
||||
* of APR 1.0.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** A constant representing a 'large' string. */
|
||||
#define HUGE_STRING_LEN 8192
|
||||
|
||||
/*
|
||||
* Define the structures used by the APR general-purpose library.
|
||||
*/
|
||||
|
||||
/** @see apr_vformatter_buff_t */
|
||||
typedef struct apr_vformatter_buff_t apr_vformatter_buff_t;
|
||||
|
||||
/**
|
||||
* Structure used by the variable-formatter routines.
|
||||
*/
|
||||
struct apr_vformatter_buff_t {
|
||||
/** The current position */
|
||||
char *curpos;
|
||||
/** The end position of the format string */
|
||||
char *endpos;
|
||||
};
|
||||
|
||||
/**
|
||||
* return the final element of the pathname
|
||||
* @param pathname The path to get the final element of
|
||||
* @return the final element of the path
|
||||
* @remark
|
||||
* <PRE>
|
||||
* For example:
|
||||
* "/foo/bar/gum" -> "gum"
|
||||
* "/foo/bar/gum/" -> ""
|
||||
* "gum" -> "gum"
|
||||
* "bs\\path\\stuff" -> "stuff"
|
||||
* </PRE>
|
||||
*/
|
||||
APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname);
|
||||
|
||||
/**
|
||||
* apr_killpg
|
||||
* Small utility macros to make things easier to read. Not usually a
|
||||
* goal, to be sure..
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#define apr_killpg(x, y)
|
||||
#else /* WIN32 */
|
||||
#ifdef NO_KILLPG
|
||||
#define apr_killpg(x, y) (kill (-(x), (y)))
|
||||
#else /* NO_KILLPG */
|
||||
#define apr_killpg(x, y) (killpg ((x), (y)))
|
||||
#endif /* NO_KILLPG */
|
||||
#endif /* WIN32 */
|
||||
|
||||
/**
|
||||
* apr_vformatter() is a generic printf-style formatting routine
|
||||
* with some extensions.
|
||||
* @param flush_func The function to call when the buffer is full
|
||||
* @param c The buffer to write to
|
||||
* @param fmt The format string
|
||||
* @param ap The arguments to use to fill out the format string.
|
||||
*
|
||||
* @remark
|
||||
* <PRE>
|
||||
* The extensions are:
|
||||
*
|
||||
* %%pA takes a struct in_addr *, and prints it as a.b.c.d
|
||||
* %%pI takes an apr_sockaddr_t * and prints it as a.b.c.d:port or
|
||||
* [ipv6-address]:port
|
||||
* %%pT takes an apr_os_thread_t * and prints it in decimal
|
||||
* ('0' is printed if !APR_HAS_THREADS)
|
||||
* %%pp takes a void * and outputs it in hex
|
||||
*
|
||||
* The %%p hacks are to force gcc's printf warning code to skip
|
||||
* over a pointer argument without complaining. This does
|
||||
* mean that the ANSI-style %%p (output a void * in hex format) won't
|
||||
* work as expected at all, but that seems to be a fair trade-off
|
||||
* for the increased robustness of having printf-warnings work.
|
||||
*
|
||||
* Additionally, apr_vformatter allows for arbitrary output methods
|
||||
* using the apr_vformatter_buff and flush_func.
|
||||
*
|
||||
* The apr_vformatter_buff has two elements curpos and endpos.
|
||||
* curpos is where apr_vformatter will write the next byte of output.
|
||||
* It proceeds writing output to curpos, and updating curpos, until
|
||||
* either the end of output is reached, or curpos == endpos (i.e. the
|
||||
* buffer is full).
|
||||
*
|
||||
* If the end of output is reached, apr_vformatter returns the
|
||||
* number of bytes written.
|
||||
*
|
||||
* When the buffer is full, the flush_func is called. The flush_func
|
||||
* can return -1 to indicate that no further output should be attempted,
|
||||
* and apr_vformatter will return immediately with -1. Otherwise
|
||||
* the flush_func should flush the buffer in whatever manner is
|
||||
* appropriate, re apr_pool_t nitialize curpos and endpos, and return 0.
|
||||
*
|
||||
* Note that flush_func is only invoked as a result of attempting to
|
||||
* write another byte at curpos when curpos >= endpos. So for
|
||||
* example, it's possible when the output exactly matches the buffer
|
||||
* space available that curpos == endpos will be true when
|
||||
* apr_vformatter returns.
|
||||
*
|
||||
* apr_vformatter does not call out to any other code, it is entirely
|
||||
* self-contained. This allows the callers to do things which are
|
||||
* otherwise "unsafe". For example, apr_psprintf uses the "scratch"
|
||||
* space at the unallocated end of a block, and doesn't actually
|
||||
* complete the allocation until apr_vformatter returns. apr_psprintf
|
||||
* would be completely broken if apr_vformatter were to call anything
|
||||
* that used this same pool. Similarly http_bprintf() uses the "scratch"
|
||||
* space at the end of its output buffer, and doesn't actually note
|
||||
* that the space is in use until it either has to flush the buffer
|
||||
* or until apr_vformatter returns.
|
||||
* </PRE>
|
||||
*/
|
||||
APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b),
|
||||
apr_vformatter_buff_t *c, const char *fmt,
|
||||
va_list ap);
|
||||
|
||||
/**
|
||||
* Display a prompt and read in the password from stdin.
|
||||
* @param prompt The prompt to display
|
||||
* @param pwbuf Buffer to store the password
|
||||
* @param bufsize The length of the password buffer.
|
||||
* @remark If the password entered must be truncated to fit in
|
||||
* the provided buffer, APR_ENAMETOOLONG will be returned.
|
||||
* Note that the bufsize paramater is passed by reference for no
|
||||
* reason; its value will never be modified by the apr_password_get()
|
||||
* function.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf,
|
||||
apr_size_t *bufsize);
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup apr_ctype ctype functions
|
||||
* These macros allow correct support of 8-bit characters on systems which
|
||||
* support 8-bit characters. Pretty dumb how the cast is required, but
|
||||
* that's legacy libc for ya. These new macros do not support EOF like
|
||||
* the standard macros do. Tough.
|
||||
* @{
|
||||
*/
|
||||
/** @see isalnum */
|
||||
#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
|
||||
/** @see isalpha */
|
||||
#define apr_isalpha(c) (isalpha(((unsigned char)(c))))
|
||||
/** @see iscntrl */
|
||||
#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
|
||||
/** @see isdigit */
|
||||
#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
|
||||
/** @see isgraph */
|
||||
#define apr_isgraph(c) (isgraph(((unsigned char)(c))))
|
||||
/** @see islower*/
|
||||
#define apr_islower(c) (islower(((unsigned char)(c))))
|
||||
/** @see isascii */
|
||||
#ifdef isascii
|
||||
#define apr_isascii(c) (isascii(((unsigned char)(c))))
|
||||
#else
|
||||
#define apr_isascii(c) (((c) & ~0x7f)==0)
|
||||
#endif
|
||||
/** @see isprint */
|
||||
#define apr_isprint(c) (isprint(((unsigned char)(c))))
|
||||
/** @see ispunct */
|
||||
#define apr_ispunct(c) (ispunct(((unsigned char)(c))))
|
||||
/** @see isspace */
|
||||
#define apr_isspace(c) (isspace(((unsigned char)(c))))
|
||||
/** @see isupper */
|
||||
#define apr_isupper(c) (isupper(((unsigned char)(c))))
|
||||
/** @see isxdigit */
|
||||
#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
|
||||
/** @see tolower */
|
||||
#define apr_tolower(c) (tolower(((unsigned char)(c))))
|
||||
/** @see toupper */
|
||||
#define apr_toupper(c) (toupper(((unsigned char)(c))))
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! APR_LIB_H */
|
||||
@@ -1,134 +0,0 @@
|
||||
/* Copyright 2001-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* This is derived from material copyright RSA Data Security, Inc.
|
||||
* Their notice is reproduced below in its entirety.
|
||||
*
|
||||
* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
* rights reserved.
|
||||
*
|
||||
* License to copy and use this software is granted provided that it
|
||||
* is identified as the "RSA Data Security, Inc. MD4 Message-Digest
|
||||
* Algorithm" in all material mentioning or referencing this software
|
||||
* or this function.
|
||||
*
|
||||
* License is also granted to make and use derivative works provided
|
||||
* that such works are identified as "derived from the RSA Data
|
||||
* Security, Inc. MD4 Message-Digest Algorithm" in all material
|
||||
* mentioning or referencing the derived work.
|
||||
*
|
||||
* RSA Data Security, Inc. makes no representations concerning either
|
||||
* the merchantability of this software or the suitability of this
|
||||
* software for any particular purpose. It is provided "as is"
|
||||
* without express or implied warranty of any kind.
|
||||
*
|
||||
* These notices must be retained in any copies of any part of this
|
||||
* documentation and/or software.
|
||||
*/
|
||||
|
||||
#ifndef APR_MD4_H
|
||||
#define APR_MD4_H
|
||||
|
||||
#include "apu.h"
|
||||
#include "apr_xlate.h"
|
||||
/**
|
||||
* @file apr_md4.h
|
||||
* @brief APR-UTIL MD4 Library
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup APR_Util_MD4 MD4 Library
|
||||
* @ingroup APR_Util
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** The digestsize for MD4 */
|
||||
#define APR_MD4_DIGESTSIZE 16
|
||||
|
||||
/** @see apr_md4_ctx_t */
|
||||
typedef struct apr_md4_ctx_t apr_md4_ctx_t;
|
||||
|
||||
/** MD4 context. */
|
||||
struct apr_md4_ctx_t {
|
||||
/** state (ABCD) */
|
||||
apr_uint32_t state[4];
|
||||
/** number of bits, modulo 2^64 (lsb first) */
|
||||
apr_uint32_t count[2];
|
||||
/** input buffer */
|
||||
unsigned char buffer[64];
|
||||
#if APR_HAS_XLATE
|
||||
/** translation handle */
|
||||
apr_xlate_t *xlate;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* MD4 Initialize. Begins an MD4 operation, writing a new context.
|
||||
* @param context The MD4 context to initialize.
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_md4_init(apr_md4_ctx_t *context);
|
||||
|
||||
#if APR_HAS_XLATE
|
||||
/**
|
||||
* MDr4 translation setup. Provides the APR translation handle to be used
|
||||
* for translating the content before calculating the digest.
|
||||
* @param context The MD4 content to set the translation for.
|
||||
* @param xlate The translation handle to use for this MD4 context
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_md4_set_xlate(apr_md4_ctx_t *context,
|
||||
apr_xlate_t *xlate);
|
||||
#else
|
||||
#define apr_md4_set_xlate(context, xlate) APR_ENOTIMPL
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MD4 block update operation. Continue an MD4 message-digest operation,
|
||||
* processing another message block, and updating the context.
|
||||
* @param context The MD4 content to update.
|
||||
* @param input next message block to update
|
||||
* @param inputLen The length of the next message block
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_md4_update(apr_md4_ctx_t *context,
|
||||
const unsigned char *input,
|
||||
apr_size_t inputLen);
|
||||
|
||||
/**
|
||||
* MD4 finalization. Ends an MD4 message-digest operation, writing the
|
||||
* message digest and zeroing the context
|
||||
* @param digest The final MD4 digest
|
||||
* @param context The MD4 content we are finalizing.
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_md4_final(
|
||||
unsigned char digest[APR_MD4_DIGESTSIZE],
|
||||
apr_md4_ctx_t *context);
|
||||
|
||||
/**
|
||||
* MD4 digest computation
|
||||
* @param digest The MD4 digest
|
||||
* @param input message block to use
|
||||
* @param inputLen The length of the message block
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_md4(unsigned char digest[APR_MD4_DIGESTSIZE],
|
||||
const unsigned char *input,
|
||||
apr_size_t inputLen);
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !APR_MD4_H */
|
||||
@@ -1,161 +0,0 @@
|
||||
/*
|
||||
* This is work is derived from material Copyright RSA Data Security, Inc.
|
||||
*
|
||||
* The RSA copyright statement and Licence for that original material is
|
||||
* included below. This is followed by the Apache copyright statement and
|
||||
* licence for the modifications made to that material.
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
rights reserved.
|
||||
|
||||
License to copy and use this software is granted provided that it
|
||||
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
|
||||
Algorithm" in all material mentioning or referencing this software
|
||||
or this function.
|
||||
|
||||
License is also granted to make and use derivative works provided
|
||||
that such works are identified as "derived from the RSA Data
|
||||
Security, Inc. MD5 Message-Digest Algorithm" in all material
|
||||
mentioning or referencing the derived work.
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software.
|
||||
*/
|
||||
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_MD5_H
|
||||
#define APR_MD5_H
|
||||
|
||||
#include "apu.h"
|
||||
#include "apr_xlate.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/**
|
||||
* @file apr_md5.h
|
||||
* @brief APR MD5 Routines
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup APR_MD5 MD5 Routines
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** The MD5 digest size */
|
||||
#define APR_MD5_DIGESTSIZE 16
|
||||
|
||||
/** @see apr_md5_ctx_t */
|
||||
typedef struct apr_md5_ctx_t apr_md5_ctx_t;
|
||||
|
||||
/** MD5 context. */
|
||||
struct apr_md5_ctx_t {
|
||||
/** state (ABCD) */
|
||||
apr_uint32_t state[4];
|
||||
/** number of bits, modulo 2^64 (lsb first) */
|
||||
apr_uint32_t count[2];
|
||||
/** input buffer */
|
||||
unsigned char buffer[64];
|
||||
/** translation handle
|
||||
* ignored if xlate is unsupported
|
||||
*/
|
||||
apr_xlate_t *xlate;
|
||||
};
|
||||
|
||||
/**
|
||||
* MD5 Initialize. Begins an MD5 operation, writing a new context.
|
||||
* @param context The MD5 context to initialize.
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context);
|
||||
|
||||
/**
|
||||
* MD5 translation setup. Provides the APR translation handle to be used
|
||||
* for translating the content before calculating the digest.
|
||||
* @param context The MD5 content to set the translation for.
|
||||
* @param xlate The translation handle to use for this MD5 context
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context,
|
||||
apr_xlate_t *xlate);
|
||||
|
||||
/**
|
||||
* MD5 block update operation. Continue an MD5 message-digest operation,
|
||||
* processing another message block, and updating the context.
|
||||
* @param context The MD5 content to update.
|
||||
* @param input next message block to update
|
||||
* @param inputLen The length of the next message block
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
|
||||
const void *input,
|
||||
apr_size_t inputLen);
|
||||
|
||||
/**
|
||||
* MD5 finalization. Ends an MD5 message-digest operation, writing the
|
||||
* message digest and zeroing the context
|
||||
* @param digest The final MD5 digest
|
||||
* @param context The MD5 content we are finalizing.
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[APR_MD5_DIGESTSIZE],
|
||||
apr_md5_ctx_t *context);
|
||||
|
||||
/**
|
||||
* MD5 in one step
|
||||
* @param digest The final MD5 digest
|
||||
* @param input The message block to use
|
||||
* @param inputLen The length of the message block
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_md5(unsigned char digest[APR_MD5_DIGESTSIZE],
|
||||
const void *input,
|
||||
apr_size_t inputLen);
|
||||
|
||||
/**
|
||||
* Encode a password using an MD5 algorithm
|
||||
* @param password The password to encode
|
||||
* @param salt The salt to use for the encoding
|
||||
* @param result The string to store the encoded password in
|
||||
* @param nbytes The size of the result buffer
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt,
|
||||
char *result, apr_size_t nbytes);
|
||||
|
||||
|
||||
/**
|
||||
* Validate hashes created by APR-supported algorithms: md5 and sha1.
|
||||
* hashes created by crypt are supported only on platforms that provide
|
||||
* crypt(3), so don't rely on that function unless you know that your
|
||||
* application will be run only on platforms that support it. On platforms
|
||||
* that don't support crypt(3), this falls back to a clear text string
|
||||
* comparison.
|
||||
* @param passwd The password to validate
|
||||
* @param hash The password to validate against
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_password_validate(const char *passwd,
|
||||
const char *hash);
|
||||
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !APR_MD5_H */
|
||||
@@ -1,170 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_MMAP_H
|
||||
#define APR_MMAP_H
|
||||
|
||||
/**
|
||||
* @file apr_mmap.h
|
||||
* @brief APR MMAP routines
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_pools.h"
|
||||
#include "apr_errno.h"
|
||||
#include "apr_ring.h"
|
||||
#include "apr_file_io.h" /* for apr_file_t */
|
||||
|
||||
#ifdef BEOS
|
||||
#include <kernel/OS.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @defgroup apr_mmap MMAP (Memory Map) Routines
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** MMap opened for reading */
|
||||
#define APR_MMAP_READ 1
|
||||
/** MMap opened for writing */
|
||||
#define APR_MMAP_WRITE 2
|
||||
|
||||
/** @see apr_mmap_t */
|
||||
typedef struct apr_mmap_t apr_mmap_t;
|
||||
|
||||
/**
|
||||
* @remark
|
||||
* As far as I can tell the only really sane way to store an MMAP is as a
|
||||
* void * and a length. BeOS requires this area_id, but that's just a little
|
||||
* something extra. I am exposing this type, because it doesn't make much
|
||||
* sense to keep it private, and opening it up makes some stuff easier in
|
||||
* Apache.
|
||||
*/
|
||||
/** The MMAP structure */
|
||||
struct apr_mmap_t {
|
||||
/** The pool the mmap structure was allocated out of. */
|
||||
apr_pool_t *cntxt;
|
||||
#ifdef BEOS
|
||||
/** An area ID. Only valid on BeOS */
|
||||
area_id area;
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
/** The handle of the file mapping */
|
||||
HANDLE mhandle;
|
||||
/** The start of the real memory page area (mapped view) */
|
||||
void *mv;
|
||||
/** The physical start, size and offset */
|
||||
apr_off_t pstart;
|
||||
apr_size_t psize;
|
||||
apr_off_t poffset;
|
||||
#endif
|
||||
/** The start of the memory mapped area */
|
||||
void *mm;
|
||||
/** The amount of data in the mmap */
|
||||
apr_size_t size;
|
||||
/** ring of apr_mmap_t's that reference the same
|
||||
* mmap'ed region; acts in place of a reference count */
|
||||
APR_RING_ENTRY(apr_mmap_t) link;
|
||||
};
|
||||
|
||||
#if APR_HAS_MMAP || defined(DOXYGEN)
|
||||
|
||||
/** @def APR_MMAP_THRESHOLD
|
||||
* Files have to be at least this big before they're mmap()d. This is to deal
|
||||
* with systems where the expense of doing an mmap() and an munmap() outweighs
|
||||
* the benefit for small files. It shouldn't be set lower than 1.
|
||||
*/
|
||||
#ifdef MMAP_THRESHOLD
|
||||
# define APR_MMAP_THRESHOLD MMAP_THRESHOLD
|
||||
#else
|
||||
# ifdef SUNOS4
|
||||
# define APR_MMAP_THRESHOLD (8*1024)
|
||||
# else
|
||||
# define APR_MMAP_THRESHOLD 1
|
||||
# endif /* SUNOS4 */
|
||||
#endif /* MMAP_THRESHOLD */
|
||||
|
||||
/** @def APR_MMAP_LIMIT
|
||||
* Maximum size of MMap region
|
||||
*/
|
||||
#ifdef MMAP_LIMIT
|
||||
# define APR_MMAP_LIMIT MMAP_LIMIT
|
||||
#else
|
||||
# define APR_MMAP_LIMIT (4*1024*1024)
|
||||
#endif /* MMAP_LIMIT */
|
||||
|
||||
/** Can this file be MMaped */
|
||||
#define APR_MMAP_CANDIDATE(filelength) \
|
||||
((filelength >= APR_MMAP_THRESHOLD) && (filelength < APR_MMAP_LIMIT))
|
||||
|
||||
/* Function definitions */
|
||||
|
||||
/**
|
||||
* Create a new mmap'ed file out of an existing APR file.
|
||||
* @param newmmap The newly created mmap'ed file.
|
||||
* @param file The file turn into an mmap.
|
||||
* @param offset The offset into the file to start the data pointer at.
|
||||
* @param size The size of the file
|
||||
* @param flag bit-wise or of:
|
||||
* <PRE>
|
||||
* APR_MMAP_READ MMap opened for reading
|
||||
* APR_MMAP_WRITE MMap opened for writing
|
||||
* </PRE>
|
||||
* @param cntxt The pool to use when creating the mmap.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap,
|
||||
apr_file_t *file, apr_off_t offset,
|
||||
apr_size_t size, apr_int32_t flag,
|
||||
apr_pool_t *cntxt);
|
||||
|
||||
/**
|
||||
* Duplicate the specified MMAP.
|
||||
* @param new_mmap The structure to duplicate into.
|
||||
* @param old_mmap The mmap to duplicate.
|
||||
* @param p The pool to use for new_mmap.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap,
|
||||
apr_mmap_t *old_mmap,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Remove a mmap'ed.
|
||||
* @param mm The mmap'ed file.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm);
|
||||
|
||||
/**
|
||||
* Move the pointer into the mmap'ed file to the specified offset.
|
||||
* @param addr The pointer to the offset specified.
|
||||
* @param mm The mmap'ed file.
|
||||
* @param offset The offset to move to.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mm,
|
||||
apr_off_t offset);
|
||||
|
||||
#endif /* APR_HAS_MMAP */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! APR_MMAP_H */
|
||||
@@ -1,820 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_NETWORK_IO_H
|
||||
#define APR_NETWORK_IO_H
|
||||
/**
|
||||
* @file apr_network_io.h
|
||||
* @brief APR Network library
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_pools.h"
|
||||
#include "apr_file_io.h"
|
||||
#include "apr_errno.h"
|
||||
#include "apr_inherit.h"
|
||||
|
||||
#if APR_HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @defgroup apr_network_io Network Routines
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef APR_MAX_SECS_TO_LINGER
|
||||
/** Maximum seconds to linger */
|
||||
#define APR_MAX_SECS_TO_LINGER 30
|
||||
#endif
|
||||
|
||||
#ifndef APRMAXHOSTLEN
|
||||
/** Maximum hostname length */
|
||||
#define APRMAXHOSTLEN 256
|
||||
#endif
|
||||
|
||||
#ifndef APR_ANYADDR
|
||||
/** Default 'any' address */
|
||||
#define APR_ANYADDR "0.0.0.0"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup apr_sockopt Socket option definitions
|
||||
* @{
|
||||
*/
|
||||
#define APR_SO_LINGER 1 /**< Linger */
|
||||
#define APR_SO_KEEPALIVE 2 /**< Keepalive */
|
||||
#define APR_SO_DEBUG 4 /**< Debug */
|
||||
#define APR_SO_NONBLOCK 8 /**< Non-blocking IO */
|
||||
#define APR_SO_REUSEADDR 16 /**< Reuse addresses */
|
||||
#define APR_SO_SNDBUF 64 /**< Send buffer */
|
||||
#define APR_SO_RCVBUF 128 /**< Receive buffer */
|
||||
#define APR_SO_DISCONNECTED 256 /**< Disconnected */
|
||||
#define APR_TCP_NODELAY 512 /**< For SCTP sockets, this is mapped
|
||||
* to STCP_NODELAY internally.
|
||||
*/
|
||||
#define APR_TCP_NOPUSH 1024 /**< No push */
|
||||
#define APR_RESET_NODELAY 2048 /**< This flag is ONLY set internally
|
||||
* when we set APR_TCP_NOPUSH with
|
||||
* APR_TCP_NODELAY set to tell us that
|
||||
* APR_TCP_NODELAY should be turned on
|
||||
* again when NOPUSH is turned off
|
||||
*/
|
||||
#define APR_INCOMPLETE_READ 4096 /**< Set on non-blocking sockets
|
||||
* (timeout != 0) on which the
|
||||
* previous read() did not fill a buffer
|
||||
* completely. the next apr_socket_recv()
|
||||
* will first call select()/poll() rather than
|
||||
* going straight into read(). (Can also
|
||||
* be set by an application to force a
|
||||
* select()/poll() call before the next
|
||||
* read, in cases where the app expects
|
||||
* that an immediate read would fail.)
|
||||
*/
|
||||
#define APR_INCOMPLETE_WRITE 8192 /**< like APR_INCOMPLETE_READ, but for write
|
||||
* @see APR_INCOMPLETE_READ
|
||||
*/
|
||||
#define APR_IPV6_V6ONLY 16384 /**< Don't accept IPv4 connections on an
|
||||
* IPv6 listening socket.
|
||||
*/
|
||||
#define APR_TCP_DEFER_ACCEPT 32768 /**< Delay accepting of new connections
|
||||
* until data is available.
|
||||
* @see apr_socket_accept_filter
|
||||
*/
|
||||
|
||||
/** @} */
|
||||
|
||||
/** Define what type of socket shutdown should occur. */
|
||||
typedef enum {
|
||||
APR_SHUTDOWN_READ, /**< no longer allow read request */
|
||||
APR_SHUTDOWN_WRITE, /**< no longer allow write requests */
|
||||
APR_SHUTDOWN_READWRITE /**< no longer allow read or write requests */
|
||||
} apr_shutdown_how_e;
|
||||
|
||||
#define APR_IPV4_ADDR_OK 0x01 /**< @see apr_sockaddr_info_get() */
|
||||
#define APR_IPV6_ADDR_OK 0x02 /**< @see apr_sockaddr_info_get() */
|
||||
|
||||
#if (!APR_HAVE_IN_ADDR)
|
||||
/**
|
||||
* We need to make sure we always have an in_addr type, so APR will just
|
||||
* define it ourselves, if the platform doesn't provide it.
|
||||
*/
|
||||
struct in_addr {
|
||||
apr_uint32_t s_addr; /**< storage to hold the IP# */
|
||||
};
|
||||
#endif
|
||||
|
||||
/** @def APR_INADDR_NONE
|
||||
* Not all platforms have a real INADDR_NONE. This macro replaces
|
||||
* INADDR_NONE on all platforms.
|
||||
*/
|
||||
#ifdef INADDR_NONE
|
||||
#define APR_INADDR_NONE INADDR_NONE
|
||||
#else
|
||||
#define APR_INADDR_NONE ((unsigned int) 0xffffffff)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def APR_INET
|
||||
* Not all platforms have these defined, so we'll define them here
|
||||
* The default values come from FreeBSD 4.1.1
|
||||
*/
|
||||
#define APR_INET AF_INET
|
||||
/** @def APR_UNSPEC
|
||||
* Let the system decide which address family to use
|
||||
*/
|
||||
#ifdef AF_UNSPEC
|
||||
#define APR_UNSPEC AF_UNSPEC
|
||||
#else
|
||||
#define APR_UNSPEC 0
|
||||
#endif
|
||||
#if APR_HAVE_IPV6
|
||||
/** @def APR_INET6
|
||||
* IPv6 Address Family. Not all platforms may have this defined.
|
||||
*/
|
||||
|
||||
#define APR_INET6 AF_INET6
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup IP_Proto IP Protocol Definitions for use when creating sockets
|
||||
* @{
|
||||
*/
|
||||
#define APR_PROTO_TCP 6 /**< TCP */
|
||||
#define APR_PROTO_UDP 17 /**< UDP */
|
||||
#define APR_PROTO_SCTP 132 /**< SCTP */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* Enum to tell us if we're interested in remote or local socket
|
||||
*/
|
||||
typedef enum {
|
||||
APR_LOCAL,
|
||||
APR_REMOTE
|
||||
} apr_interface_e;
|
||||
|
||||
/**
|
||||
* The specific declaration of inet_addr's ... some platforms fall back
|
||||
* inet_network (this is not good, but necessary)
|
||||
*/
|
||||
|
||||
#if APR_HAVE_INET_ADDR
|
||||
#define apr_inet_addr inet_addr
|
||||
#elif APR_HAVE_INET_NETWORK /* only DGUX, as far as I know */
|
||||
/**
|
||||
* @warning
|
||||
* not generally safe... inet_network() and inet_addr() perform
|
||||
* different functions */
|
||||
#define apr_inet_addr inet_network
|
||||
#endif
|
||||
|
||||
/** A structure to represent sockets */
|
||||
typedef struct apr_socket_t apr_socket_t;
|
||||
/**
|
||||
* A structure to encapsulate headers and trailers for apr_socket_sendfile
|
||||
*/
|
||||
typedef struct apr_hdtr_t apr_hdtr_t;
|
||||
/** A structure to represent in_addr */
|
||||
typedef struct in_addr apr_in_addr_t;
|
||||
/** A structure to represent an IP subnet */
|
||||
typedef struct apr_ipsubnet_t apr_ipsubnet_t;
|
||||
|
||||
/** @remark use apr_uint16_t just in case some system has a short that isn't 16 bits... */
|
||||
typedef apr_uint16_t apr_port_t;
|
||||
|
||||
/** @remark It's defined here as I think it should all be platform safe...
|
||||
* @see apr_sockaddr_t
|
||||
*/
|
||||
typedef struct apr_sockaddr_t apr_sockaddr_t;
|
||||
/**
|
||||
* APRs socket address type, used to ensure protocol independence
|
||||
*/
|
||||
struct apr_sockaddr_t {
|
||||
/** The pool to use... */
|
||||
apr_pool_t *pool;
|
||||
/** The hostname */
|
||||
char *hostname;
|
||||
/** Either a string of the port number or the service name for the port */
|
||||
char *servname;
|
||||
/** The numeric port */
|
||||
apr_port_t port;
|
||||
/** The family */
|
||||
apr_int32_t family;
|
||||
/** How big is the sockaddr we're using? */
|
||||
apr_socklen_t salen;
|
||||
/** How big is the ip address structure we're using? */
|
||||
int ipaddr_len;
|
||||
/** How big should the address buffer be? 16 for v4 or 46 for v6
|
||||
* used in inet_ntop... */
|
||||
int addr_str_len;
|
||||
/** This points to the IP address structure within the appropriate
|
||||
* sockaddr structure. */
|
||||
void *ipaddr_ptr;
|
||||
/** If multiple addresses were found by apr_sockaddr_info_get(), this
|
||||
* points to a representation of the next address. */
|
||||
apr_sockaddr_t *next;
|
||||
/** Union of either IPv4 or IPv6 sockaddr. */
|
||||
union {
|
||||
/** IPv4 sockaddr structure */
|
||||
struct sockaddr_in sin;
|
||||
#if APR_HAVE_IPV6
|
||||
/** IPv6 sockaddr structure */
|
||||
struct sockaddr_in6 sin6;
|
||||
#endif
|
||||
#if APR_HAVE_SA_STORAGE
|
||||
/** Placeholder to ensure that the size of this union is not
|
||||
* dependent on whether APR_HAVE_IPV6 is defined. */
|
||||
struct sockaddr_storage sas;
|
||||
#endif
|
||||
} sa;
|
||||
};
|
||||
|
||||
#if APR_HAS_SENDFILE
|
||||
/**
|
||||
* Support reusing the socket on platforms which support it (from disconnect,
|
||||
* specifically Win32.
|
||||
* @remark Optional flag passed into apr_socket_sendfile()
|
||||
*/
|
||||
#define APR_SENDFILE_DISCONNECT_SOCKET 1
|
||||
#endif
|
||||
|
||||
/** A structure to encapsulate headers and trailers for apr_socket_sendfile */
|
||||
struct apr_hdtr_t {
|
||||
/** An iovec to store the headers sent before the file. */
|
||||
struct iovec* headers;
|
||||
/** number of headers in the iovec */
|
||||
int numheaders;
|
||||
/** An iovec to store the trailers sent after the file. */
|
||||
struct iovec* trailers;
|
||||
/** number of trailers in the iovec */
|
||||
int numtrailers;
|
||||
};
|
||||
|
||||
/* function definitions */
|
||||
|
||||
/**
|
||||
* Create a socket.
|
||||
* @param new_sock The new socket that has been set up.
|
||||
* @param family The address family of the socket (e.g., APR_INET).
|
||||
* @param type The type of the socket (e.g., SOCK_STREAM).
|
||||
* @param protocol The protocol of the socket (e.g., APR_PROTO_TCP).
|
||||
* @param cont The pool to use
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock,
|
||||
int family, int type,
|
||||
int protocol,
|
||||
apr_pool_t *cont);
|
||||
|
||||
/**
|
||||
* Shutdown either reading, writing, or both sides of a socket.
|
||||
* @param thesocket The socket to close
|
||||
* @param how How to shutdown the socket. One of:
|
||||
* <PRE>
|
||||
* APR_SHUTDOWN_READ no longer allow read requests
|
||||
* APR_SHUTDOWN_WRITE no longer allow write requests
|
||||
* APR_SHUTDOWN_READWRITE no longer allow read or write requests
|
||||
* </PRE>
|
||||
* @see apr_shutdown_how_e
|
||||
* @remark This does not actually close the socket descriptor, it just
|
||||
* controls which calls are still valid on the socket.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket,
|
||||
apr_shutdown_how_e how);
|
||||
|
||||
/**
|
||||
* Close a socket.
|
||||
* @param thesocket The socket to close
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket);
|
||||
|
||||
/**
|
||||
* Bind the socket to its associated port
|
||||
* @param sock The socket to bind
|
||||
* @param sa The socket address to bind to
|
||||
* @remark This may be where we will find out if there is any other process
|
||||
* using the selected port.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock,
|
||||
apr_sockaddr_t *sa);
|
||||
|
||||
/**
|
||||
* Listen to a bound socket for connections.
|
||||
* @param sock The socket to listen on
|
||||
* @param backlog The number of outstanding connections allowed in the sockets
|
||||
* listen queue. If this value is less than zero, the listen
|
||||
* queue size is set to zero.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock,
|
||||
apr_int32_t backlog);
|
||||
|
||||
/**
|
||||
* Accept a new connection request
|
||||
* @param new_sock A copy of the socket that is connected to the socket that
|
||||
* made the connection request. This is the socket which should
|
||||
* be used for all future communication.
|
||||
* @param sock The socket we are listening on.
|
||||
* @param connection_pool The pool for the new socket.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock,
|
||||
apr_socket_t *sock,
|
||||
apr_pool_t *connection_pool);
|
||||
|
||||
/**
|
||||
* Issue a connection request to a socket either on the same machine
|
||||
* or a different one.
|
||||
* @param sock The socket we wish to use for our side of the connection
|
||||
* @param sa The address of the machine we wish to connect to.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock,
|
||||
apr_sockaddr_t *sa);
|
||||
|
||||
/**
|
||||
* Create apr_sockaddr_t from hostname, address family, and port.
|
||||
* @param sa The new apr_sockaddr_t.
|
||||
* @param hostname The hostname or numeric address string to resolve/parse, or
|
||||
* NULL to build an address that corresponds to 0.0.0.0 or ::
|
||||
* @param family The address family to use, or APR_UNSPEC if the system should
|
||||
* decide.
|
||||
* @param port The port number.
|
||||
* @param flags Special processing flags:
|
||||
* <PRE>
|
||||
* APR_IPV4_ADDR_OK first query for IPv4 addresses; only look
|
||||
* for IPv6 addresses if the first query failed;
|
||||
* only valid if family is APR_UNSPEC and hostname
|
||||
* isn't NULL; mutually exclusive with
|
||||
* APR_IPV6_ADDR_OK
|
||||
* APR_IPV6_ADDR_OK first query for IPv6 addresses; only look
|
||||
* for IPv4 addresses if the first query failed;
|
||||
* only valid if family is APR_UNSPEC and hostname
|
||||
* isn't NULL and APR_HAVE_IPV6; mutually exclusive
|
||||
* with APR_IPV4_ADDR_OK
|
||||
* </PRE>
|
||||
* @param p The pool for the apr_sockaddr_t and associated storage.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa,
|
||||
const char *hostname,
|
||||
apr_int32_t family,
|
||||
apr_port_t port,
|
||||
apr_int32_t flags,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Look up the host name from an apr_sockaddr_t.
|
||||
* @param hostname The hostname.
|
||||
* @param sa The apr_sockaddr_t.
|
||||
* @param flags Special processing flags.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname,
|
||||
apr_sockaddr_t *sa,
|
||||
apr_int32_t flags);
|
||||
|
||||
/**
|
||||
* Parse hostname/IP address with scope id and port.
|
||||
*
|
||||
* Any of the following strings are accepted:
|
||||
* 8080 (just the port number)
|
||||
* www.apache.org (just the hostname)
|
||||
* www.apache.org:8080 (hostname and port number)
|
||||
* [fe80::1]:80 (IPv6 numeric address string only)
|
||||
* [fe80::1%eth0] (IPv6 numeric address string and scope id)
|
||||
*
|
||||
* Invalid strings:
|
||||
* (empty string)
|
||||
* [abc] (not valid IPv6 numeric address string)
|
||||
* abc:65536 (invalid port number)
|
||||
*
|
||||
* @param addr The new buffer containing just the hostname. On output, *addr
|
||||
* will be NULL if no hostname/IP address was specfied.
|
||||
* @param scope_id The new buffer containing just the scope id. On output,
|
||||
* *scope_id will be NULL if no scope id was specified.
|
||||
* @param port The port number. On output, *port will be 0 if no port was
|
||||
* specified.
|
||||
* ### FIXME: 0 is a legal port (per RFC 1700). this should
|
||||
* ### return something besides zero if the port is missing.
|
||||
* @param str The input string to be parsed.
|
||||
* @param p The pool from which *addr and *scope_id are allocated.
|
||||
* @remark If scope id shouldn't be allowed, check for scope_id != NULL in
|
||||
* addition to checking the return code. If addr/hostname should be
|
||||
* required, check for addr == NULL in addition to checking the
|
||||
* return code.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr,
|
||||
char **scope_id,
|
||||
apr_port_t *port,
|
||||
const char *str,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Get name of the current machine
|
||||
* @param buf A buffer to store the hostname in.
|
||||
* @param len The maximum length of the hostname that can be stored in the
|
||||
* buffer provided. The suggested length is APRMAXHOSTLEN + 1.
|
||||
* @param cont The pool to use.
|
||||
* @remark If the buffer was not large enough, an error will be returned.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont);
|
||||
|
||||
/**
|
||||
* Return the data associated with the current socket
|
||||
* @param data The user data associated with the socket.
|
||||
* @param key The key to associate with the user data.
|
||||
* @param sock The currently open socket.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key,
|
||||
apr_socket_t *sock);
|
||||
|
||||
/**
|
||||
* Set the data associated with the current socket.
|
||||
* @param sock The currently open socket.
|
||||
* @param data The user data to associate with the socket.
|
||||
* @param key The key to associate with the data.
|
||||
* @param cleanup The cleanup to call when the socket is destroyed.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data,
|
||||
const char *key,
|
||||
apr_status_t (*cleanup)(void*));
|
||||
|
||||
/**
|
||||
* Send data over a network.
|
||||
* @param sock The socket to send the data over.
|
||||
* @param buf The buffer which contains the data to be sent.
|
||||
* @param len On entry, the number of bytes to send; on exit, the number
|
||||
* of bytes sent.
|
||||
* @remark
|
||||
* <PRE>
|
||||
* This functions acts like a blocking write by default. To change
|
||||
* this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
|
||||
* socket option.
|
||||
*
|
||||
* It is possible for both bytes to be sent and an error to be returned.
|
||||
*
|
||||
* APR_EINTR is never returned.
|
||||
* </PRE>
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf,
|
||||
apr_size_t *len);
|
||||
|
||||
/**
|
||||
* Send multiple packets of data over a network.
|
||||
* @param sock The socket to send the data over.
|
||||
* @param vec The array of iovec structs containing the data to send
|
||||
* @param nvec The number of iovec structs in the array
|
||||
* @param len Receives the number of bytes actually written
|
||||
* @remark
|
||||
* <PRE>
|
||||
* This functions acts like a blocking write by default. To change
|
||||
* this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
|
||||
* socket option.
|
||||
* The number of bytes actually sent is stored in argument 3.
|
||||
*
|
||||
* It is possible for both bytes to be sent and an error to be returned.
|
||||
*
|
||||
* APR_EINTR is never returned.
|
||||
* </PRE>
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock,
|
||||
const struct iovec *vec,
|
||||
apr_int32_t nvec, apr_size_t *len);
|
||||
|
||||
/**
|
||||
* @param sock The socket to send from
|
||||
* @param where The apr_sockaddr_t describing where to send the data
|
||||
* @param flags The flags to use
|
||||
* @param buf The data to send
|
||||
* @param len The length of the data to send
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock,
|
||||
apr_sockaddr_t *where,
|
||||
apr_int32_t flags, const char *buf,
|
||||
apr_size_t *len);
|
||||
|
||||
/**
|
||||
* @param from The apr_sockaddr_t to fill in the recipient info
|
||||
* @param sock The socket to use
|
||||
* @param flags The flags to use
|
||||
* @param buf The buffer to use
|
||||
* @param len The length of the available buffer
|
||||
*/
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from,
|
||||
apr_socket_t *sock,
|
||||
apr_int32_t flags, char *buf,
|
||||
apr_size_t *len);
|
||||
|
||||
#if APR_HAS_SENDFILE || defined(DOXYGEN)
|
||||
|
||||
/**
|
||||
* Send a file from an open file descriptor to a socket, along with
|
||||
* optional headers and trailers
|
||||
* @param sock The socket to which we're writing
|
||||
* @param file The open file from which to read
|
||||
* @param hdtr A structure containing the headers and trailers to send
|
||||
* @param offset Offset into the file where we should begin writing
|
||||
* @param len (input) - Number of bytes to send from the file
|
||||
* (output) - Number of bytes actually sent,
|
||||
* including headers, file, and trailers
|
||||
* @param flags APR flags that are mapped to OS specific flags
|
||||
* @remark This functions acts like a blocking write by default. To change
|
||||
* this behavior, use apr_socket_timeout_set() or the
|
||||
* APR_SO_NONBLOCK socket option.
|
||||
* The number of bytes actually sent is stored in the len parameter.
|
||||
* The offset parameter is passed by reference for no reason; its
|
||||
* value will never be modified by the apr_socket_sendfile() function.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock,
|
||||
apr_file_t *file,
|
||||
apr_hdtr_t *hdtr,
|
||||
apr_off_t *offset,
|
||||
apr_size_t *len,
|
||||
apr_int32_t flags);
|
||||
|
||||
#endif /* APR_HAS_SENDFILE */
|
||||
|
||||
/**
|
||||
* Read data from a network.
|
||||
* @param sock The socket to read the data from.
|
||||
* @param buf The buffer to store the data in.
|
||||
* @param len On entry, the number of bytes to receive; on exit, the number
|
||||
* of bytes received.
|
||||
* @remark
|
||||
* <PRE>
|
||||
* This functions acts like a blocking read by default. To change
|
||||
* this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
|
||||
* socket option.
|
||||
* The number of bytes actually received is stored in argument 3.
|
||||
*
|
||||
* It is possible for both bytes to be received and an APR_EOF or
|
||||
* other error to be returned.
|
||||
*
|
||||
* APR_EINTR is never returned.
|
||||
* </PRE>
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock,
|
||||
char *buf, apr_size_t *len);
|
||||
|
||||
/**
|
||||
* Setup socket options for the specified socket
|
||||
* @param sock The socket to set up.
|
||||
* @param opt The option we would like to configure. One of:
|
||||
* <PRE>
|
||||
* APR_SO_DEBUG -- turn on debugging information
|
||||
* APR_SO_KEEPALIVE -- keep connections active
|
||||
* APR_SO_LINGER -- lingers on close if data is present
|
||||
* APR_SO_NONBLOCK -- Turns blocking on/off for socket
|
||||
* When this option is enabled, use
|
||||
* the APR_STATUS_IS_EAGAIN() macro to
|
||||
* see if a send or receive function
|
||||
* could not transfer data without
|
||||
* blocking.
|
||||
* APR_SO_REUSEADDR -- The rules used in validating addresses
|
||||
* supplied to bind should allow reuse
|
||||
* of local addresses.
|
||||
* APR_SO_SNDBUF -- Set the SendBufferSize
|
||||
* APR_SO_RCVBUF -- Set the ReceiveBufferSize
|
||||
* </PRE>
|
||||
* @param on Value for the option.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock,
|
||||
apr_int32_t opt, apr_int32_t on);
|
||||
|
||||
/**
|
||||
* Setup socket timeout for the specified socket
|
||||
* @param sock The socket to set up.
|
||||
* @param t Value for the timeout.
|
||||
* <PRE>
|
||||
* t > 0 -- read and write calls return APR_TIMEUP if specified time
|
||||
* elapsess with no data read or written
|
||||
* t == 0 -- read and write calls never block
|
||||
* t < 0 -- read and write calls block
|
||||
* </PRE>
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock,
|
||||
apr_interval_time_t t);
|
||||
|
||||
/**
|
||||
* Query socket options for the specified socket
|
||||
* @param sock The socket to query
|
||||
* @param opt The option we would like to query. One of:
|
||||
* <PRE>
|
||||
* APR_SO_DEBUG -- turn on debugging information
|
||||
* APR_SO_KEEPALIVE -- keep connections active
|
||||
* APR_SO_LINGER -- lingers on close if data is present
|
||||
* APR_SO_NONBLOCK -- Turns blocking on/off for socket
|
||||
* APR_SO_REUSEADDR -- The rules used in validating addresses
|
||||
* supplied to bind should allow reuse
|
||||
* of local addresses.
|
||||
* APR_SO_SNDBUF -- Set the SendBufferSize
|
||||
* APR_SO_RCVBUF -- Set the ReceiveBufferSize
|
||||
* APR_SO_DISCONNECTED -- Query the disconnected state of the socket.
|
||||
* (Currently only used on Windows)
|
||||
* </PRE>
|
||||
* @param on Socket option returned on the call.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock,
|
||||
apr_int32_t opt, apr_int32_t *on);
|
||||
|
||||
/**
|
||||
* Query socket timeout for the specified socket
|
||||
* @param sock The socket to query
|
||||
* @param t Socket timeout returned from the query.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock,
|
||||
apr_interval_time_t *t);
|
||||
|
||||
/**
|
||||
* Query the specified socket if at the OOB/Urgent data mark
|
||||
* @param sock The socket to query
|
||||
* @param atmark Is set to true if socket is at the OOB/urgent mark,
|
||||
* otherwise is set to false.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock,
|
||||
int *atmark);
|
||||
|
||||
/**
|
||||
* Return an apr_sockaddr_t from an apr_socket_t
|
||||
* @param sa The returned apr_sockaddr_t.
|
||||
* @param which Which interface do we want the apr_sockaddr_t for?
|
||||
* @param sock The socket to use
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa,
|
||||
apr_interface_e which,
|
||||
apr_socket_t *sock);
|
||||
|
||||
/**
|
||||
* Return the IP address (in numeric address string format) in
|
||||
* an APR socket address. APR will allocate storage for the IP address
|
||||
* string from the pool of the apr_sockaddr_t.
|
||||
* @param addr The IP address.
|
||||
* @param sockaddr The socket address to reference.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr,
|
||||
apr_sockaddr_t *sockaddr);
|
||||
|
||||
/**
|
||||
* See if the IP addresses in two APR socket addresses are
|
||||
* equivalent. Appropriate logic is present for comparing
|
||||
* IPv4-mapped IPv6 addresses with IPv4 addresses.
|
||||
*
|
||||
* @param addr1 One of the APR socket addresses.
|
||||
* @param addr2 The other APR socket address.
|
||||
* @remark The return value will be non-zero if the addresses
|
||||
* are equivalent.
|
||||
*/
|
||||
APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1,
|
||||
const apr_sockaddr_t *addr2);
|
||||
|
||||
/**
|
||||
* Return the type of the socket.
|
||||
* @param sock The socket to query.
|
||||
* @param type The returned type (e.g., SOCK_STREAM).
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock,
|
||||
int *type);
|
||||
|
||||
/**
|
||||
* Given an apr_sockaddr_t and a service name, set the port for the service
|
||||
* @param sockaddr The apr_sockaddr_t that will have its port set
|
||||
* @param servname The name of the service you wish to use
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr,
|
||||
const char *servname);
|
||||
/**
|
||||
* Build an ip-subnet representation from an IP address and optional netmask or
|
||||
* number-of-bits.
|
||||
* @param ipsub The new ip-subnet representation
|
||||
* @param ipstr The input IP address string
|
||||
* @param mask_or_numbits The input netmask or number-of-bits string, or NULL
|
||||
* @param p The pool to allocate from
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub,
|
||||
const char *ipstr,
|
||||
const char *mask_or_numbits,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet
|
||||
* representation.
|
||||
* @param ipsub The ip-subnet representation
|
||||
* @param sa The socket address to test
|
||||
* @return non-zero if the socket address is within the subnet, 0 otherwise
|
||||
*/
|
||||
APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa);
|
||||
|
||||
#if APR_HAS_SO_ACCEPTFILTER || defined(DOXYGEN)
|
||||
/**
|
||||
* Set an OS level accept filter.
|
||||
* @param sock The socket to put the accept filter on.
|
||||
* @param name The accept filter
|
||||
* @param args Any extra args to the accept filter. Passing NULL here removes
|
||||
* the accept filter.
|
||||
*/
|
||||
apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name,
|
||||
char *args);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Return the protocol of the socket.
|
||||
* @param sock The socket to query.
|
||||
* @param protocol The returned protocol (e.g., APR_PROTO_TCP).
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock,
|
||||
int *protocol);
|
||||
|
||||
/**
|
||||
* Set a socket to be inherited by child processes.
|
||||
*/
|
||||
APR_DECLARE_INHERIT_SET(socket);
|
||||
|
||||
/**
|
||||
* Unset a socket from being inherited by child processes.
|
||||
*/
|
||||
APR_DECLARE_INHERIT_UNSET(socket);
|
||||
|
||||
/**
|
||||
* @defgroup apr_mcast IP Multicast
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Join a Multicast Group
|
||||
* @param sock The socket to join a multicast group
|
||||
* @param join The address of the multicast group to join
|
||||
* @param iface Address of the interface to use. If NULL is passed, the
|
||||
* default multicast interface will be used. (OS Dependent)
|
||||
* @param source Source Address to accept transmissions from (non-NULL
|
||||
* implies Source-Specific Multicast)
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock,
|
||||
apr_sockaddr_t *join,
|
||||
apr_sockaddr_t *iface,
|
||||
apr_sockaddr_t *source);
|
||||
|
||||
/**
|
||||
* Leave a Multicast Group. All arguments must be the same as
|
||||
* apr_mcast_join.
|
||||
* @param sock The socket to leave a multicast group
|
||||
* @param addr The address of the multicast group to leave
|
||||
* @param iface Address of the interface to use. If NULL is passed, the
|
||||
* default multicast interface will be used. (OS Dependent)
|
||||
* @param source Source Address to accept transmissions from (non-NULL
|
||||
* implies Source-Specific Multicast)
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock,
|
||||
apr_sockaddr_t *addr,
|
||||
apr_sockaddr_t *iface,
|
||||
apr_sockaddr_t *source);
|
||||
|
||||
/**
|
||||
* Set the Multicast Time to Live (ttl) for a multicast transmission.
|
||||
* @param sock The socket to set the multicast ttl
|
||||
* @param ttl Time to live to Assign. 0-255, default=1
|
||||
* @remark If the TTL is 0, packets will only be seen by sockets on
|
||||
* the local machine, and only when multicast loopback is enabled.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock,
|
||||
apr_byte_t ttl);
|
||||
|
||||
/**
|
||||
* Toggle IP Multicast Loopback
|
||||
* @param sock The socket to set multicast loopback
|
||||
* @param opt 0=disable, 1=enable
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock,
|
||||
apr_byte_t opt);
|
||||
|
||||
|
||||
/**
|
||||
* Set the Interface to be used for outgoing Multicast Transmissions.
|
||||
* @param sock The socket to set the multicast interface on
|
||||
* @param iface Address of the interface to use for Multicast
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock,
|
||||
apr_sockaddr_t *iface);
|
||||
|
||||
/** @} */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! APR_NETWORK_IO_H */
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
/* Copyright 2001-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_OPTIONAL_H
|
||||
#define APR_OPTIONAL_H
|
||||
|
||||
#include "apu.h"
|
||||
/**
|
||||
* @file apr_optional.h
|
||||
* @brief APR-UTIL registration of functions exported by modules
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup APR_Util_Opt Optional Functions
|
||||
* @ingroup APR_Util
|
||||
*
|
||||
* Typesafe registration and retrieval of functions that may not be present
|
||||
* (i.e. functions exported by optional modules)
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* The type of an optional function.
|
||||
* @param name The name of the function
|
||||
*/
|
||||
#define APR_OPTIONAL_FN_TYPE(name) apr_OFN_##name##_t
|
||||
|
||||
/**
|
||||
* Declare an optional function.
|
||||
* @param ret The return type of the function
|
||||
* @param name The name of the function
|
||||
* @param args The function arguments (including brackets)
|
||||
*/
|
||||
#define APR_DECLARE_OPTIONAL_FN(ret,name,args) \
|
||||
typedef ret (APR_OPTIONAL_FN_TYPE(name)) args
|
||||
|
||||
/**
|
||||
* XXX: This doesn't belong here, then!
|
||||
* Private function! DO NOT USE!
|
||||
* @internal
|
||||
*/
|
||||
|
||||
typedef void (apr_opt_fn_t)(void);
|
||||
/** @internal */
|
||||
APU_DECLARE_NONSTD(void) apr_dynamic_fn_register(const char *szName,
|
||||
apr_opt_fn_t *pfn);
|
||||
|
||||
/**
|
||||
* Register an optional function. This can be later retrieved, type-safely, by
|
||||
* name. Like all global functions, the name must be unique. Note that,
|
||||
* confusingly but correctly, the function itself can be static!
|
||||
* @param name The name of the function
|
||||
*/
|
||||
#define APR_REGISTER_OPTIONAL_FN(name) do { \
|
||||
APR_OPTIONAL_FN_TYPE(name) *apu__opt = name; \
|
||||
apr_dynamic_fn_register(#name,(apr_opt_fn_t *)apu__opt); \
|
||||
} while (0)
|
||||
|
||||
/** @internal
|
||||
* Private function! DO NOT USE!
|
||||
*/
|
||||
APU_DECLARE(apr_opt_fn_t *) apr_dynamic_fn_retrieve(const char *szName);
|
||||
|
||||
/**
|
||||
* Retrieve an optional function. Returns NULL if the function is not present.
|
||||
* @param name The name of the function
|
||||
*/
|
||||
#define APR_RETRIEVE_OPTIONAL_FN(name) \
|
||||
(APR_OPTIONAL_FN_TYPE(name) *)apr_dynamic_fn_retrieve(#name)
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* APR_OPTIONAL_H */
|
||||
@@ -1,116 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* @file apr_optional_hooks.h
|
||||
* @brief Apache optional hook functions
|
||||
*/
|
||||
|
||||
|
||||
#ifndef APR_OPTIONAL_HOOK_H
|
||||
#define APR_OPTIONAL_HOOK_H
|
||||
|
||||
#include "apr_tables.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/**
|
||||
* @defgroup APR_Util_OPT_HOOK Optional Hook Functions
|
||||
* @ingroup APR_Util_Hook
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* Function to implemnt the APR_OPTIONAL_HOOK Macro
|
||||
* @internal
|
||||
* @see APR_OPTIONAL_HOOK
|
||||
*
|
||||
* @param name The name of the hook
|
||||
* @param pfn A pointer to a function that will be called
|
||||
* @param aszPre a NULL-terminated array of strings that name modules whose hooks should precede this one
|
||||
* @param aszSucc a NULL-terminated array of strings that name modules whose hooks should succeed this one
|
||||
* @param nOrder an integer determining order before honouring aszPre and aszSucc (for example HOOK_MIDDLE)
|
||||
*/
|
||||
|
||||
|
||||
APU_DECLARE(void) apr_optional_hook_add(const char *szName,void (*pfn)(void),
|
||||
const char * const *aszPre,
|
||||
const char * const *aszSucc,
|
||||
int nOrder);
|
||||
|
||||
/**
|
||||
* Hook to an optional hook.
|
||||
*
|
||||
* @param ns The namespace prefix of the hook functions
|
||||
* @param name The name of the hook
|
||||
* @param pfn A pointer to a function that will be called
|
||||
* @param aszPre a NULL-terminated array of strings that name modules whose hooks should precede this one
|
||||
* @param aszSucc a NULL-terminated array of strings that name modules whose hooks should succeed this one
|
||||
* @param nOrder an integer determining order before honouring aszPre and aszSucc (for example HOOK_MIDDLE)
|
||||
*/
|
||||
|
||||
#define APR_OPTIONAL_HOOK(ns,name,pfn,aszPre,aszSucc,nOrder) do { \
|
||||
ns##_HOOK_##name##_t *apu__hook = pfn; \
|
||||
apr_optional_hook_add(#name,(void (*)(void))apu__hook,aszPre, aszSucc, nOrder); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param szName - the name of the function
|
||||
* @return the hook structure for a given hook
|
||||
*/
|
||||
APU_DECLARE(apr_array_header_t *) apr_optional_hook_get(const char *szName);
|
||||
|
||||
/**
|
||||
* Implement an optional hook that runs until one of the functions
|
||||
* returns something other than OK or DECLINE.
|
||||
*
|
||||
* @param ns The namespace prefix of the hook functions
|
||||
* @param link The linkage declaration prefix of the hook
|
||||
* @param ret The type of the return value of the hook
|
||||
* @param ret The type of the return value of the hook
|
||||
* @param name The name of the hook
|
||||
* @param args_decl The declaration of the arguments for the hook
|
||||
* @param args_use The names for the arguments for the hook
|
||||
* @param ok Success value
|
||||
* @param decline Decline value
|
||||
*/
|
||||
#define APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ns,link,ret,name,args_decl,args_use,ok,decline) \
|
||||
link##_DECLARE(ret) ns##_run_##name args_decl \
|
||||
{ \
|
||||
ns##_LINK_##name##_t *pHook; \
|
||||
int n; \
|
||||
ret rv; \
|
||||
apr_array_header_t *pHookArray=apr_optional_hook_get(#name); \
|
||||
\
|
||||
if(!pHookArray) \
|
||||
return ok; \
|
||||
\
|
||||
pHook=(ns##_LINK_##name##_t *)pHookArray->elts; \
|
||||
for(n=0 ; n < pHookArray->nelts ; ++n) \
|
||||
{ \
|
||||
rv=(pHook[n].pFunc)args_use; \
|
||||
\
|
||||
if(rv != ok && rv != decline) \
|
||||
return rv; \
|
||||
} \
|
||||
return ok; \
|
||||
}
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* APR_OPTIONAL_HOOK_H */
|
||||
@@ -1,175 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_POLL_H
|
||||
#define APR_POLL_H
|
||||
/**
|
||||
* @file apr_poll.h
|
||||
* @brief APR Poll interface
|
||||
*/
|
||||
#include "apr.h"
|
||||
#include "apr_pools.h"
|
||||
#include "apr_errno.h"
|
||||
#include "apr_inherit.h"
|
||||
#include "apr_file_io.h"
|
||||
#include "apr_network_io.h"
|
||||
|
||||
#if APR_HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @defgroup apr_poll Poll Routines
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Poll options
|
||||
*/
|
||||
#define APR_POLLIN 0x001 /**< Can read without blocking */
|
||||
#define APR_POLLPRI 0x002 /**< Priority data available */
|
||||
#define APR_POLLOUT 0x004 /**< Can write without blocking */
|
||||
#define APR_POLLERR 0x010 /**< Pending error */
|
||||
#define APR_POLLHUP 0x020 /**< Hangup occurred */
|
||||
#define APR_POLLNVAL 0x040 /**< Descriptior invalid */
|
||||
|
||||
/**
|
||||
* Pollset Flags
|
||||
*/
|
||||
#define APR_POLLSET_THREADSAFE 0x001 /**< Adding or Removing a Descriptor is thread safe */
|
||||
|
||||
/** Used in apr_pollfd_t to determine what the apr_descriptor is */
|
||||
typedef enum {
|
||||
APR_NO_DESC, /**< nothing here */
|
||||
APR_POLL_SOCKET, /**< descriptor refers to a socket */
|
||||
APR_POLL_FILE, /**< descriptor refers to a file */
|
||||
APR_POLL_LASTDESC /**< descriptor is the last one in the list */
|
||||
} apr_datatype_e ;
|
||||
|
||||
/** Union of either an APR file or socket. */
|
||||
typedef union {
|
||||
apr_file_t *f; /**< file */
|
||||
apr_socket_t *s; /**< socket */
|
||||
} apr_descriptor;
|
||||
|
||||
/** @see apr_pollfd_t */
|
||||
typedef struct apr_pollfd_t apr_pollfd_t;
|
||||
|
||||
/** Poll descriptor set. */
|
||||
struct apr_pollfd_t {
|
||||
apr_pool_t *p; /**< associated pool */
|
||||
apr_datatype_e desc_type; /**< descriptor type */
|
||||
apr_int16_t reqevents; /**< requested events */
|
||||
apr_int16_t rtnevents; /**< returned events */
|
||||
apr_descriptor desc; /**< @see apr_descriptor */
|
||||
void *client_data; /**< allows app to associate context */
|
||||
};
|
||||
|
||||
|
||||
/* General-purpose poll API for arbitrarily large numbers of
|
||||
* file descriptors
|
||||
*/
|
||||
|
||||
/** Opaque structure used for pollset API */
|
||||
typedef struct apr_pollset_t apr_pollset_t;
|
||||
|
||||
/**
|
||||
* Setup a pollset object
|
||||
* @param pollset The pointer in which to return the newly created object
|
||||
* @param size The maximum number of descriptors that this pollset can hold
|
||||
* @param p The pool from which to allocate the pollset
|
||||
* @param flags Optional flags to modify the operation of the pollset.
|
||||
*
|
||||
* @remark If flags equals APR_POLLSET_THREADSAFE, then a pollset is
|
||||
* created on which it is safe to make concurrent calls to
|
||||
* apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() from
|
||||
* separate threads. This feature is only supported on some
|
||||
* platforms; the apr_pollset_create() call will fail with
|
||||
* APR_ENOTIMPL on platforms where it is not supported.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
|
||||
apr_uint32_t size,
|
||||
apr_pool_t *p,
|
||||
apr_uint32_t flags);
|
||||
|
||||
/**
|
||||
* Destroy a pollset object
|
||||
* @param pollset The pollset to destroy
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset);
|
||||
|
||||
/**
|
||||
* Add a socket or file descriptor to a pollset
|
||||
* @param pollset The pollset to which to add the descriptor
|
||||
* @param descriptor The descriptor to add
|
||||
* @remark If you set client_data in the descriptor, that value
|
||||
* will be returned in the client_data field whenever this
|
||||
* descriptor is signalled in apr_pollset_poll().
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
|
||||
const apr_pollfd_t *descriptor);
|
||||
|
||||
/**
|
||||
* Remove a descriptor from a pollset
|
||||
* @param pollset The pollset from which to remove the descriptor
|
||||
* @param descriptor The descriptor to remove
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset,
|
||||
const apr_pollfd_t *descriptor);
|
||||
|
||||
/**
|
||||
* Block for activity on the descriptor(s) in a pollset
|
||||
* @param pollset The pollset to use
|
||||
* @param timeout Timeout in microseconds
|
||||
* @param num Number of signalled descriptors (output parameter)
|
||||
* @param descriptors Array of signalled descriptors (output parameter)
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
|
||||
apr_interval_time_t timeout,
|
||||
apr_int32_t *num,
|
||||
const apr_pollfd_t **descriptors);
|
||||
|
||||
|
||||
/**
|
||||
* Poll the sockets in the poll structure
|
||||
* @param aprset The poll structure we will be using.
|
||||
* @param numsock The number of sockets we are polling
|
||||
* @param nsds The number of sockets signalled.
|
||||
* @param timeout The amount of time in microseconds to wait. This is
|
||||
* a maximum, not a minimum. If a socket is signalled, we
|
||||
* will wake up before this time. A negative number means
|
||||
* wait until a socket is signalled.
|
||||
* @remark The number of sockets signalled is returned in the third argument.
|
||||
* This is a blocking call, and it will not return until either a
|
||||
* socket has been signalled, or the timeout has expired.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock,
|
||||
apr_int32_t *nsds,
|
||||
apr_interval_time_t timeout);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! APR_POLL_H */
|
||||
|
||||
@@ -1,649 +0,0 @@
|
||||
/* Copyright 2000-2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef APR_POOLS_H
|
||||
#define APR_POOLS_H
|
||||
|
||||
/**
|
||||
* @file apr_pools.h
|
||||
* @brief APR memory allocation
|
||||
*
|
||||
* Resource allocation routines...
|
||||
*
|
||||
* designed so that we don't have to keep track of EVERYTHING so that
|
||||
* it can be explicitly freed later (a fundamentally unsound strategy ---
|
||||
* particularly in the presence of die()).
|
||||
*
|
||||
* Instead, we maintain pools, and allocate items (both memory and I/O
|
||||
* handlers) from the pools --- currently there are two, one for per
|
||||
* transaction info, and one for config info. When a transaction is over,
|
||||
* we can delete everything in the per-transaction apr_pool_t without fear,
|
||||
* and without thinking too hard about it either.
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_errno.h"
|
||||
#include "apr_general.h" /* for APR_STRINGIFY */
|
||||
#define APR_WANT_MEMFUNC /**< for no good reason? */
|
||||
#include "apr_want.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup apr_pools Memory Pool Functions
|
||||
* @ingroup APR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** The fundamental pool type */
|
||||
typedef struct apr_pool_t apr_pool_t;
|
||||
|
||||
|
||||
/**
|
||||
* Declaration helper macro to construct apr_foo_pool_get()s.
|
||||
*
|
||||
* This standardized macro is used by opaque (APR) data types to return
|
||||
* the apr_pool_t that is associated with the data type.
|
||||
*
|
||||
* APR_POOL_DECLARE_ACCESSOR() is used in a header file to declare the
|
||||
* accessor function. A typical usage and result would be:
|
||||
* <pre>
|
||||
* APR_POOL_DECLARE_ACCESSOR(file);
|
||||
* becomes:
|
||||
* APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob);
|
||||
* </pre>
|
||||
* @remark Doxygen unwraps this macro (via doxygen.conf) to provide
|
||||
* actual help for each specific occurance of apr_foo_pool_get.
|
||||
* @remark the linkage is specified for APR. It would be possible to expand
|
||||
* the macros to support other linkages.
|
||||
*/
|
||||
#define APR_POOL_DECLARE_ACCESSOR(type) \
|
||||
APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \
|
||||
(const apr_##type##_t *the##type)
|
||||
|
||||
/**
|
||||
* Implementation helper macro to provide apr_foo_pool_get()s.
|
||||
*
|
||||
* In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to
|
||||
* actually define the function. It assumes the field is named "pool".
|
||||
*/
|
||||
#define APR_POOL_IMPLEMENT_ACCESSOR(type) \
|
||||
APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \
|
||||
(const apr_##type##_t *the##type) \
|
||||
{ return the##type->pool; }
|
||||
|
||||
|
||||
/**
|
||||
* Pool debug levels
|
||||
*
|
||||
* <pre>
|
||||
* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
||||
* ---------------------------------
|
||||
* | | | | | | | | x | General debug code enabled (useful in
|
||||
* combination with --with-efence).
|
||||
*
|
||||
* | | | | | | | x | | Verbose output on stderr (report
|
||||
* CREATE, CLEAR, DESTROY).
|
||||
*
|
||||
* | | | | x | | | | | Verbose output on stderr (report
|
||||
* PALLOC, PCALLOC).
|
||||
*
|
||||
* | | | | | | x | | | Lifetime checking. On each use of a
|
||||
* pool, check its lifetime. If the pool
|
||||
* is out of scope, abort().
|
||||
* In combination with the verbose flag
|
||||
* above, it will output LIFE in such an
|
||||
* event prior to aborting.
|
||||
*
|
||||
* | | | | | x | | | | Pool owner checking. On each use of a
|
||||
* pool, check if the current thread is the
|
||||
* pools owner. If not, abort(). In
|
||||
* combination with the verbose flag above,
|
||||
* it will output OWNER in such an event
|
||||
* prior to aborting. Use the debug
|
||||
* function apr_pool_owner_set() to switch
|
||||
* a pools ownership.
|
||||
*
|
||||
* When no debug level was specified, assume general debug mode.
|
||||
* If level 0 was specified, debugging is switched off
|
||||
* </pre>
|
||||
*/
|
||||
#if defined(APR_POOL_DEBUG)
|
||||
/* If APR_POOL_DEBUG is blank, we get 1; if it is a number, we get -1. */
|
||||
#if (APR_POOL_DEBUG - APR_POOL_DEBUG -1 == 1)
|
||||
#undef APR_POOL_DEBUG
|
||||
#define APR_POOL_DEBUG 1
|
||||
#endif
|
||||
#else
|
||||
#define APR_POOL_DEBUG 0
|
||||
#endif
|
||||
|
||||
/** the place in the code where the particular function was called */
|
||||
#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
|
||||
|
||||
|
||||
|
||||
/** A function that is called when allocation fails. */
|
||||
typedef int (*apr_abortfunc_t)(int retcode);
|
||||
|
||||
/*
|
||||
* APR memory structure manipulators (pools, tables, and arrays).
|
||||
*/
|
||||
|
||||
/*
|
||||
* Initialization
|
||||
*/
|
||||
|
||||
/**
|
||||
* Setup all of the internal structures required to use pools
|
||||
* @remark Programs do NOT need to call this directly. APR will call this
|
||||
* automatically from apr_initialize.
|
||||
* @internal
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pool_initialize(void);
|
||||
|
||||
/**
|
||||
* Tear down all of the internal structures required to use pools
|
||||
* @remark Programs do NOT need to call this directly. APR will call this
|
||||
* automatically from apr_terminate.
|
||||
* @internal
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_terminate(void);
|
||||
|
||||
|
||||
/*
|
||||
* Pool creation/destruction
|
||||
*/
|
||||
|
||||
#include "apr_allocator.h"
|
||||
|
||||
/**
|
||||
* Create a new pool.
|
||||
* @param newpool The pool we have just created.
|
||||
* @param parent The parent pool. If this is NULL, the new pool is a root
|
||||
* pool. If it is non-NULL, the new pool will inherit all
|
||||
* of its parent pool's attributes, except the apr_pool_t will
|
||||
* be a sub-pool.
|
||||
* @param abort_fn A function to use if the pool cannot allocate more memory.
|
||||
* @param allocator The allocator to use with the new pool. If NULL the
|
||||
* allocator of the parent pool will be used.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool,
|
||||
apr_pool_t *parent,
|
||||
apr_abortfunc_t abort_fn,
|
||||
apr_allocator_t *allocator);
|
||||
|
||||
/**
|
||||
* Debug version of apr_pool_create_ex.
|
||||
* @param newpool @see apr_pool_create.
|
||||
* @param parent @see apr_pool_create.
|
||||
* @param abort_fn @see apr_pool_create.
|
||||
* @param allocator @see apr_pool_create.
|
||||
* @param file_line Where the function is called from.
|
||||
* This is usually APR_POOL__FILE_LINE__.
|
||||
* @remark Only available when APR_POOL_DEBUG is defined.
|
||||
* Call this directly if you have you apr_pool_create_ex
|
||||
* calls in a wrapper function and wish to override
|
||||
* the file_line argument to reflect the caller of
|
||||
* your wrapper function. If you do not have
|
||||
* apr_pool_create_ex in a wrapper, trust the macro
|
||||
* and don't call apr_pool_create_ex_debug directly.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool,
|
||||
apr_pool_t *parent,
|
||||
apr_abortfunc_t abort_fn,
|
||||
apr_allocator_t *allocator,
|
||||
const char *file_line);
|
||||
|
||||
#if APR_POOL_DEBUG
|
||||
#define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \
|
||||
apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \
|
||||
APR_POOL__FILE_LINE__)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Create a new pool.
|
||||
* @param newpool The pool we have just created.
|
||||
* @param parent The parent pool. If this is NULL, the new pool is a root
|
||||
* pool. If it is non-NULL, the new pool will inherit all
|
||||
* of its parent pool's attributes, except the apr_pool_t will
|
||||
* be a sub-pool.
|
||||
*/
|
||||
#if defined(DOXYGEN)
|
||||
APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool,
|
||||
apr_pool_t *parent);
|
||||
#else
|
||||
#if APR_POOL_DEBUG
|
||||
#define apr_pool_create(newpool, parent) \
|
||||
apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \
|
||||
APR_POOL__FILE_LINE__)
|
||||
#else
|
||||
#define apr_pool_create(newpool, parent) \
|
||||
apr_pool_create_ex(newpool, parent, NULL, NULL)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Find the pools allocator
|
||||
* @param pool The pool to get the allocator from.
|
||||
*/
|
||||
APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Clear all memory in the pool and run all the cleanups. This also destroys all
|
||||
* subpools.
|
||||
* @param p The pool to clear
|
||||
* @remark This does not actually free the memory, it just allows the pool
|
||||
* to re-use this memory for the next allocation.
|
||||
* @see apr_pool_destroy()
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_clear(apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Debug version of apr_pool_clear.
|
||||
* @param p See: apr_pool_clear.
|
||||
* @param file_line Where the function is called from.
|
||||
* This is usually APR_POOL__FILE_LINE__.
|
||||
* @remark Only available when APR_POOL_DEBUG is defined.
|
||||
* Call this directly if you have you apr_pool_clear
|
||||
* calls in a wrapper function and wish to override
|
||||
* the file_line argument to reflect the caller of
|
||||
* your wrapper function. If you do not have
|
||||
* apr_pool_clear in a wrapper, trust the macro
|
||||
* and don't call apr_pool_destroy_clear directly.
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p,
|
||||
const char *file_line);
|
||||
|
||||
#if APR_POOL_DEBUG
|
||||
#define apr_pool_clear(p) \
|
||||
apr_pool_clear_debug(p, APR_POOL__FILE_LINE__)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Destroy the pool. This takes similar action as apr_pool_clear() and then
|
||||
* frees all the memory.
|
||||
* @param p The pool to destroy
|
||||
* @remark This will actually free the memory
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Debug version of apr_pool_destroy.
|
||||
* @param p See: apr_pool_destroy.
|
||||
* @param file_line Where the function is called from.
|
||||
* This is usually APR_POOL__FILE_LINE__.
|
||||
* @remark Only available when APR_POOL_DEBUG is defined.
|
||||
* Call this directly if you have you apr_pool_destroy
|
||||
* calls in a wrapper function and wish to override
|
||||
* the file_line argument to reflect the caller of
|
||||
* your wrapper function. If you do not have
|
||||
* apr_pool_destroy in a wrapper, trust the macro
|
||||
* and don't call apr_pool_destroy_debug directly.
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p,
|
||||
const char *file_line);
|
||||
|
||||
#if APR_POOL_DEBUG
|
||||
#define apr_pool_destroy(p) \
|
||||
apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Memory allocation
|
||||
*/
|
||||
|
||||
/**
|
||||
* Allocate a block of memory from a pool
|
||||
* @param p The pool to allocate from
|
||||
* @param size The amount of memory to allocate
|
||||
* @return The allocated memory
|
||||
*/
|
||||
APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size);
|
||||
|
||||
/**
|
||||
* Debug version of apr_palloc
|
||||
* @param p See: apr_palloc
|
||||
* @param size See: apr_palloc
|
||||
* @param file_line Where the function is called from.
|
||||
* This is usually APR_POOL__FILE_LINE__.
|
||||
* @return See: apr_palloc
|
||||
*/
|
||||
APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size,
|
||||
const char *file_line);
|
||||
|
||||
#if APR_POOL_DEBUG
|
||||
#define apr_palloc(p, size) \
|
||||
apr_palloc_debug(p, size, APR_POOL__FILE_LINE__)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Allocate a block of memory from a pool and set all of the memory to 0
|
||||
* @param p The pool to allocate from
|
||||
* @param size The amount of memory to allocate
|
||||
* @return The allocated memory
|
||||
*/
|
||||
#if defined(DOXYGEN)
|
||||
APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size);
|
||||
#elif !APR_POOL_DEBUG
|
||||
#define apr_pcalloc(p, size) memset(apr_palloc(p, size), 0, size)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Debug version of apr_pcalloc
|
||||
* @param p See: apr_pcalloc
|
||||
* @param size See: apr_pcalloc
|
||||
* @param file_line Where the function is called from.
|
||||
* This is usually APR_POOL__FILE_LINE__.
|
||||
* @return See: apr_pcalloc
|
||||
*/
|
||||
APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size,
|
||||
const char *file_line);
|
||||
|
||||
#if APR_POOL_DEBUG
|
||||
#define apr_pcalloc(p, size) \
|
||||
apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Pool Properties
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set the function to be called when an allocation failure occurs.
|
||||
* @remark If the program wants APR to exit on a memory allocation error,
|
||||
* then this function can be called to set the callback to use (for
|
||||
* performing cleanup and then exiting). If this function is not called,
|
||||
* then APR will return an error and expect the calling program to
|
||||
* deal with the error accordingly.
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc,
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Get the abort function associated with the specified pool.
|
||||
* @param pool The pool for retrieving the abort function.
|
||||
* @return The abort function for the given pool.
|
||||
*/
|
||||
APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Get the parent pool of the specified pool.
|
||||
* @param pool The pool for retrieving the parent pool.
|
||||
* @return The parent of the given pool.
|
||||
*/
|
||||
APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Determine if pool a is an ancestor of pool b
|
||||
* @param a The pool to search
|
||||
* @param b The pool to search for
|
||||
* @return True if a is an ancestor of b, NULL is considered an ancestor
|
||||
* of all pools.
|
||||
*/
|
||||
APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b);
|
||||
|
||||
/**
|
||||
* Tag a pool (give it a name)
|
||||
* @param pool The pool to tag
|
||||
* @param tag The tag
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag);
|
||||
|
||||
|
||||
/*
|
||||
* User data management
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set the data associated with the current pool
|
||||
* @param data The user data associated with the pool.
|
||||
* @param key The key to use for association
|
||||
* @param cleanup The cleanup program to use to cleanup the data (NULL if none)
|
||||
* @param pool The current pool
|
||||
* @warning The data to be attached to the pool should have a life span
|
||||
* at least as long as the pool it is being attached to.
|
||||
*
|
||||
* Users of APR must take EXTREME care when choosing a key to
|
||||
* use for their data. It is possible to accidentally overwrite
|
||||
* data by choosing a key that another part of the program is using.
|
||||
* Therefore it is advised that steps are taken to ensure that unique
|
||||
* keys are used for all of the userdata objects in a particular pool
|
||||
* (the same key in two different pools or a pool and one of its
|
||||
* subpools is okay) at all times. Careful namespace prefixing of
|
||||
* key names is a typical way to help ensure this uniqueness.
|
||||
*
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pool_userdata_set(
|
||||
const void *data,
|
||||
const char *key,
|
||||
apr_status_t (*cleanup)(void *),
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Set the data associated with the current pool
|
||||
* @param data The user data associated with the pool.
|
||||
* @param key The key to use for association
|
||||
* @param cleanup The cleanup program to use to cleanup the data (NULL if none)
|
||||
* @param pool The current pool
|
||||
* @note same as apr_pool_userdata_set(), except that this version doesn't
|
||||
* make a copy of the key (this function is useful, for example, when
|
||||
* the key is a string literal)
|
||||
* @warning This should NOT be used if the key could change addresses by
|
||||
* any means between the apr_pool_userdata_setn() call and a
|
||||
* subsequent apr_pool_userdata_get() on that key, such as if a
|
||||
* static string is used as a userdata key in a DSO and the DSO could
|
||||
* be unloaded and reloaded between the _setn() and the _get(). You
|
||||
* MUST use apr_pool_userdata_set() in such cases.
|
||||
* @warning More generally, the key and the data to be attached to the
|
||||
* pool should have a life span at least as long as the pool itself.
|
||||
*
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pool_userdata_setn(
|
||||
const void *data,
|
||||
const char *key,
|
||||
apr_status_t (*cleanup)(void *),
|
||||
apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Return the data associated with the current pool.
|
||||
* @param data The user data associated with the pool.
|
||||
* @param key The key for the data to retrieve
|
||||
* @param pool The current pool.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key,
|
||||
apr_pool_t *pool);
|
||||
|
||||
|
||||
/*
|
||||
* Cleanup
|
||||
*
|
||||
* Cleanups are performed in the reverse order they were registered. That is:
|
||||
* Last In, First Out. A cleanup function can safely allocate memory from
|
||||
* the pool that is being cleaned up. It can also safely register additional
|
||||
* cleanups which will be run LIFO, directly after the current cleanup
|
||||
* terminates. Cleanups have to take caution in calling functions that
|
||||
* create subpools. Subpools, created during cleanup will NOT automatically
|
||||
* be cleaned up. In other words, cleanups are to clean up after themselves.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Register a function to be called when a pool is cleared or destroyed
|
||||
* @param p The pool register the cleanup with
|
||||
* @param data The data to pass to the cleanup function.
|
||||
* @param plain_cleanup The function to call when the pool is cleared
|
||||
* or destroyed
|
||||
* @param child_cleanup The function to call when a child process is about
|
||||
* to exec - this function is called in the child, obviously!
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_cleanup_register(
|
||||
apr_pool_t *p,
|
||||
const void *data,
|
||||
apr_status_t (*plain_cleanup)(void *),
|
||||
apr_status_t (*child_cleanup)(void *));
|
||||
|
||||
/**
|
||||
* Remove a previously registered cleanup function
|
||||
* @param p The pool remove the cleanup from
|
||||
* @param data The data to remove from cleanup
|
||||
* @param cleanup The function to remove from cleanup
|
||||
* @remarks For some strange reason only the plain_cleanup is handled by this
|
||||
* function
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data,
|
||||
apr_status_t (*cleanup)(void *));
|
||||
|
||||
/**
|
||||
* Replace the child cleanup of a previously registered cleanup
|
||||
* @param p The pool of the registered cleanup
|
||||
* @param data The data of the registered cleanup
|
||||
* @param plain_cleanup The plain cleanup function of the registered cleanup
|
||||
* @param child_cleanup The function to register as the child cleanup
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_child_cleanup_set(
|
||||
apr_pool_t *p,
|
||||
const void *data,
|
||||
apr_status_t (*plain_cleanup)(void *),
|
||||
apr_status_t (*child_cleanup)(void *));
|
||||
|
||||
/**
|
||||
* Run the specified cleanup function immediately and unregister it. Use
|
||||
* @a data instead of the data that was registered with the cleanup.
|
||||
* @param p The pool remove the cleanup from
|
||||
* @param data The data to remove from cleanup
|
||||
* @param cleanup The function to remove from cleanup
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_pool_cleanup_run(
|
||||
apr_pool_t *p,
|
||||
void *data,
|
||||
apr_status_t (*cleanup)(void *));
|
||||
|
||||
/**
|
||||
* An empty cleanup function
|
||||
* @param data The data to cleanup
|
||||
*/
|
||||
APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data);
|
||||
|
||||
/* Preparing for exec() --- close files, etc., but *don't* flush I/O
|
||||
* buffers, *don't* wait for subprocesses, and *don't* free any memory.
|
||||
*/
|
||||
/**
|
||||
* Run all of the child_cleanups, so that any unnecessary files are
|
||||
* closed because we are about to exec a new program
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_cleanup_for_exec(void);
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup PoolDebug Pool Debugging functions.
|
||||
*
|
||||
* pools have nested lifetimes -- sub_pools are destroyed when the
|
||||
* parent pool is cleared. We allow certain liberties with operations
|
||||
* on things such as tables (and on other structures in a more general
|
||||
* sense) where we allow the caller to insert values into a table which
|
||||
* were not allocated from the table's pool. The table's data will
|
||||
* remain valid as long as all the pools from which its values are
|
||||
* allocated remain valid.
|
||||
*
|
||||
* For example, if B is a sub pool of A, and you build a table T in
|
||||
* pool B, then it's safe to insert data allocated in A or B into T
|
||||
* (because B lives at most as long as A does, and T is destroyed when
|
||||
* B is cleared/destroyed). On the other hand, if S is a table in
|
||||
* pool A, it is safe to insert data allocated in A into S, but it
|
||||
* is *not safe* to insert data allocated from B into S... because
|
||||
* B can be cleared/destroyed before A is (which would leave dangling
|
||||
* pointers in T's data structures).
|
||||
*
|
||||
* In general we say that it is safe to insert data into a table T
|
||||
* if the data is allocated in any ancestor of T's pool. This is the
|
||||
* basis on which the APR_POOL_DEBUG code works -- it tests these ancestor
|
||||
* relationships for all data inserted into tables. APR_POOL_DEBUG also
|
||||
* provides tools (apr_pool_find, and apr_pool_is_ancestor) for other
|
||||
* folks to implement similar restrictions for their own data
|
||||
* structures.
|
||||
*
|
||||
* However, sometimes this ancestor requirement is inconvenient --
|
||||
* sometimes we're forced to create a sub pool (such as through
|
||||
* apr_sub_req_lookup_uri), and the sub pool is guaranteed to have
|
||||
* the same lifetime as the parent pool. This is a guarantee implemented
|
||||
* by the *caller*, not by the pool code. That is, the caller guarantees
|
||||
* they won't destroy the sub pool individually prior to destroying the
|
||||
* parent pool.
|
||||
*
|
||||
* In this case the caller must call apr_pool_join() to indicate this
|
||||
* guarantee to the APR_POOL_DEBUG code. There are a few examples spread
|
||||
* through the standard modules.
|
||||
*
|
||||
* These functions are only implemented when #APR_POOL_DEBUG is set.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#if APR_POOL_DEBUG || defined(DOXYGEN)
|
||||
/**
|
||||
* Guarantee that a subpool has the same lifetime as the parent.
|
||||
* @param p The parent pool
|
||||
* @param sub The subpool
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub);
|
||||
|
||||
/**
|
||||
* Find a pool from something allocated in it.
|
||||
* @param mem The thing allocated in the pool
|
||||
* @return The pool it is allocated in
|
||||
*/
|
||||
APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem);
|
||||
|
||||
/**
|
||||
* Report the number of bytes currently in the pool
|
||||
* @param p The pool to inspect
|
||||
* @param recurse Recurse/include the subpools' sizes
|
||||
* @return The number of bytes
|
||||
*/
|
||||
APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse);
|
||||
|
||||
/**
|
||||
* Lock a pool
|
||||
* @param pool The pool to lock
|
||||
* @param flag The flag
|
||||
*/
|
||||
APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag);
|
||||
|
||||
/* @} */
|
||||
|
||||
#else /* APR_POOL_DEBUG or DOXYGEN */
|
||||
|
||||
#ifdef apr_pool_join
|
||||
#undef apr_pool_join
|
||||
#endif
|
||||
#define apr_pool_join(a,b)
|
||||
|
||||
#ifdef apr_pool_lock
|
||||
#undef apr_pool_lock
|
||||
#endif
|
||||
#define apr_pool_lock(pool, lock)
|
||||
|
||||
#endif /* APR_POOL_DEBUG or DOXYGEN */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !APR_POOLS_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user