Initial import (untested!)
This commit is contained in:
parent
9e8f380121
commit
41b6f6bd4a
112
dlls/regex/CRegEx.cpp
Executable file
112
dlls/regex/CRegEx.cpp
Executable file
|
@ -0,0 +1,112 @@
|
||||||
|
#include "pcre.h"
|
||||||
|
#include "CRegEx.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
RegEx::RegEx()
|
||||||
|
{
|
||||||
|
mErrorOffset = 0;
|
||||||
|
mError = NULL;
|
||||||
|
re = NULL;
|
||||||
|
mFree = true;
|
||||||
|
subject = NULL;
|
||||||
|
mSubStrings = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegEx::Clear()
|
||||||
|
{
|
||||||
|
mErrorOffset = 0;
|
||||||
|
mError = NULL;
|
||||||
|
if (re)
|
||||||
|
pcre_free(re);
|
||||||
|
re = NULL;
|
||||||
|
mFree = true;
|
||||||
|
if (subject)
|
||||||
|
delete [] subject;
|
||||||
|
subject = NULL;
|
||||||
|
mSubStrings = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegEx::~RegEx()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RegEx::isFree(bool set, bool val)
|
||||||
|
{
|
||||||
|
if (set)
|
||||||
|
{
|
||||||
|
mFree = val;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return mFree;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int RegEx::Compile(const char *pattern)
|
||||||
|
{
|
||||||
|
int errno;
|
||||||
|
|
||||||
|
if (!mFree)
|
||||||
|
Clear();
|
||||||
|
|
||||||
|
re = pcre_compile(pattern, 0, &mError, &mErrorOffset, NULL);
|
||||||
|
|
||||||
|
if (re == NULL)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mFree = false;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int RegEx::Match(const char *str)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
if (mFree || re == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
//save str
|
||||||
|
subject = new char[strlen(str)+1];
|
||||||
|
strcpy(subject, str);
|
||||||
|
|
||||||
|
rc = pcre_exec(re, NULL, subject, (int)strlen(subject), 0, 0, ovector, 30);
|
||||||
|
|
||||||
|
if (rc < 0)
|
||||||
|
{
|
||||||
|
if (rc == PCRE_ERROR_NOMATCH)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
mErrorOffset = rc;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mSubStrings = rc;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *RegEx::GetSubstring(int s, char buffer[], int max)
|
||||||
|
{
|
||||||
|
if (s >= mSubStrings || s < 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
char *substr_a = subject + ovector[2*s];
|
||||||
|
int substr_l = ovector[2*s+1] - ovector[2*s];
|
||||||
|
|
||||||
|
for (int i = 0; i<substr_l; i++)
|
||||||
|
{
|
||||||
|
if (i >= max)
|
||||||
|
break;
|
||||||
|
buffer[i] = substr_a[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer[i] = '\0';
|
||||||
|
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
26
dlls/regex/CRegEx.h
Executable file
26
dlls/regex/CRegEx.h
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef _INCLUDE_CREGEX_H
|
||||||
|
#define _INCLUDE_CREGEX_H
|
||||||
|
|
||||||
|
class RegEx
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RegEx();
|
||||||
|
~RegEx();
|
||||||
|
bool isFree(bool set=false, bool val=false);
|
||||||
|
void Clear();
|
||||||
|
|
||||||
|
int Compile(const char *pattern);
|
||||||
|
int Match(const char *str);
|
||||||
|
const char *GetSubstring(int s, char buffer[], int max);
|
||||||
|
public:
|
||||||
|
int mErrorOffset;
|
||||||
|
const char *mError;
|
||||||
|
int mSubStrings;
|
||||||
|
private:
|
||||||
|
pcre *re;
|
||||||
|
bool mFree;
|
||||||
|
int ovector[30];
|
||||||
|
char *subject;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //_INCLUDE_CREGEX_H
|
444
dlls/regex/CVector.h
Executable file
444
dlls/regex/CVector.h
Executable file
|
@ -0,0 +1,444 @@
|
||||||
|
/* AMX Mod X
|
||||||
|
*
|
||||||
|
* by the AMX Mod X Development Team
|
||||||
|
* originally developed by OLO
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation; either version 2 of the License, or (at
|
||||||
|
* your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
* In addition, as a special exception, the author gives permission to
|
||||||
|
* link the code of this program with the Half-Life Game Engine ("HL
|
||||||
|
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||||
|
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||||
|
* respects for all of the code used other than the HL Engine and MODs
|
||||||
|
* from Valve. If you modify this file, you may extend this exception
|
||||||
|
* to your version of the file, but you are not obligated to do so. If
|
||||||
|
* you do not wish to do so, delete this exception statement from your
|
||||||
|
* version.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __CVECTOR_H__
|
||||||
|
#define __CVECTOR_H__
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
// Vector
|
||||||
|
template <class T> class CVector
|
||||||
|
{
|
||||||
|
bool Grow()
|
||||||
|
{
|
||||||
|
// automatic grow
|
||||||
|
size_t newSize = m_Size * 2;
|
||||||
|
if (newSize == 0)
|
||||||
|
newSize = 8; // a good init value
|
||||||
|
T *newData = new T[newSize];
|
||||||
|
if (!newData)
|
||||||
|
return false;
|
||||||
|
if (m_Data)
|
||||||
|
{
|
||||||
|
memcpy(newData, m_Data, m_Size * sizeof(T));
|
||||||
|
delete [] m_Data;
|
||||||
|
}
|
||||||
|
m_Data = newData;
|
||||||
|
m_Size = newSize;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GrowIfNeeded()
|
||||||
|
{
|
||||||
|
if (m_CurrentUsedSize >= m_Size)
|
||||||
|
return Grow();
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ChangeSize(size_t size)
|
||||||
|
{
|
||||||
|
// change size
|
||||||
|
if (size == m_Size)
|
||||||
|
return true;
|
||||||
|
T *newData = new T[size];
|
||||||
|
if (!newData)
|
||||||
|
return false;
|
||||||
|
if (m_Data)
|
||||||
|
{
|
||||||
|
memcpy(newData, m_Data, (m_Size < size) ? (m_Size * sizeof(T)) : (size * sizeof(T)));
|
||||||
|
delete [] m_Data;
|
||||||
|
}
|
||||||
|
if (m_Size < size)
|
||||||
|
m_CurrentSize = size;
|
||||||
|
m_Data = newData;
|
||||||
|
m_Size = size;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FreeMemIfPossible()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
protected:
|
||||||
|
T *m_Data;
|
||||||
|
size_t m_Size;
|
||||||
|
size_t m_CurrentUsedSize;
|
||||||
|
size_t m_CurrentSize;
|
||||||
|
public:
|
||||||
|
class iterator
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
T *m_Ptr;
|
||||||
|
public:
|
||||||
|
// constructors / destructors
|
||||||
|
iterator()
|
||||||
|
{
|
||||||
|
m_Ptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator(T * ptr)
|
||||||
|
{
|
||||||
|
m_Ptr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// member functions
|
||||||
|
T * base()
|
||||||
|
{
|
||||||
|
return m_Ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
const T * base() const
|
||||||
|
{
|
||||||
|
return m_Ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// operators
|
||||||
|
T & operator*()
|
||||||
|
{
|
||||||
|
return *m_Ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
T * operator->()
|
||||||
|
{
|
||||||
|
return m_Ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator & operator++() // preincrement
|
||||||
|
{
|
||||||
|
++m_Ptr;
|
||||||
|
return (*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator operator++(int) // postincrement
|
||||||
|
{
|
||||||
|
iterator tmp = *this;
|
||||||
|
++m_Ptr;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator & operator--() // predecrement
|
||||||
|
{
|
||||||
|
--m_Ptr;
|
||||||
|
return (*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator operator--(int) // postdecrememnt
|
||||||
|
{
|
||||||
|
iterator tmp = *this;
|
||||||
|
--m_Ptr;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(T * right) const
|
||||||
|
{
|
||||||
|
return (m_Ptr == right);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(const iterator & right) const
|
||||||
|
{
|
||||||
|
return (m_Ptr == right.m_Ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!=(T * right) const
|
||||||
|
{
|
||||||
|
return (m_Ptr != right);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!=(const iterator & right) const
|
||||||
|
{
|
||||||
|
return (m_Ptr != right.m_Ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator & operator+=(size_t offset)
|
||||||
|
{
|
||||||
|
m_Ptr += offset;
|
||||||
|
return (*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator & operator-=(size_t offset)
|
||||||
|
{
|
||||||
|
m_Ptr += offset;
|
||||||
|
return (*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator operator+(size_t offset) const
|
||||||
|
{
|
||||||
|
iterator tmp(*this);
|
||||||
|
tmp.m_Ptr += offset;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator operator-(size_t offset) const
|
||||||
|
{
|
||||||
|
iterator tmp(*this);
|
||||||
|
tmp.m_Ptr += offset;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
T & operator[](size_t offset)
|
||||||
|
{
|
||||||
|
return (*(*this + offset));
|
||||||
|
}
|
||||||
|
|
||||||
|
const T & operator[](size_t offset) const
|
||||||
|
{
|
||||||
|
return (*(*this + offset));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator<(const iterator & right) const
|
||||||
|
{
|
||||||
|
return m_Ptr < right.m_Ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator>(const iterator & right) const
|
||||||
|
{
|
||||||
|
return m_Ptr > right.m_Ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator<=(const iterator & right) const
|
||||||
|
{
|
||||||
|
return m_Ptr <= right.m_Ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator>=(const iterator & right) const
|
||||||
|
{
|
||||||
|
return m_Ptr >= right.m_Ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t operator-(const iterator & right) const
|
||||||
|
{
|
||||||
|
return m_Ptr - right.m_Ptr;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// constructors / destructors
|
||||||
|
CVector<T>()
|
||||||
|
{
|
||||||
|
m_Size = 0;
|
||||||
|
m_CurrentUsedSize = 0;
|
||||||
|
m_Data = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
CVector<T>(const CVector<T> & other)
|
||||||
|
{
|
||||||
|
// copy data
|
||||||
|
m_Data = new T [other.m_Size];
|
||||||
|
m_Size = other.m_Size;
|
||||||
|
m_CurrentUsedSize = other.m_CurrentUsedSize;
|
||||||
|
memcpy(m_Data, other.m_Data, m_CurrentUsedSize * sizeof(T));
|
||||||
|
}
|
||||||
|
|
||||||
|
~CVector<T>()
|
||||||
|
{
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// interface
|
||||||
|
size_t size() const
|
||||||
|
{
|
||||||
|
return m_CurrentUsedSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t capacity() const
|
||||||
|
{
|
||||||
|
return m_Size;
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator begin()
|
||||||
|
{
|
||||||
|
return iterator(m_Data);
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator end()
|
||||||
|
{
|
||||||
|
return iterator(m_Data + m_CurrentUsedSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator iterAt(size_t pos)
|
||||||
|
{
|
||||||
|
if (pos > m_CurrentUsedSize)
|
||||||
|
assert(0);
|
||||||
|
return iterator(m_Data + pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool reserve(size_t newSize)
|
||||||
|
{
|
||||||
|
return ChangeSize(newSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool push_back(const T & elem)
|
||||||
|
{
|
||||||
|
++m_CurrentUsedSize;
|
||||||
|
if (!GrowIfNeeded())
|
||||||
|
{
|
||||||
|
--m_CurrentUsedSize;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_Data[m_CurrentUsedSize - 1] = elem;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void pop_back()
|
||||||
|
{
|
||||||
|
--m_CurrentUsedSize;
|
||||||
|
if (m_CurrentUsedSize < 0)
|
||||||
|
m_CurrentUsedSize = 0;
|
||||||
|
// :TODO: free memory sometimes
|
||||||
|
}
|
||||||
|
|
||||||
|
bool resize(size_t newSize)
|
||||||
|
{
|
||||||
|
if (!ChangeSize(newSize))
|
||||||
|
return false;
|
||||||
|
FreeMemIfPossible();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool empty() const
|
||||||
|
{
|
||||||
|
return (m_CurrentUsedSize == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
T & at(size_t pos)
|
||||||
|
{
|
||||||
|
if (pos > m_CurrentUsedSize)
|
||||||
|
{
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
return m_Data[pos];
|
||||||
|
}
|
||||||
|
|
||||||
|
const T & at(size_t pos) const
|
||||||
|
{
|
||||||
|
if (pos > m_CurrentUsedSize)
|
||||||
|
{
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
return m_Data[pos];
|
||||||
|
}
|
||||||
|
|
||||||
|
T & operator[](size_t pos)
|
||||||
|
{
|
||||||
|
return at(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
const T & operator[](size_t pos) const
|
||||||
|
{
|
||||||
|
return at(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
T & front()
|
||||||
|
{
|
||||||
|
if (m_CurrentUsedSize < 1)
|
||||||
|
{
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
return m_Data[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
const T & front() const
|
||||||
|
{
|
||||||
|
if (m_CurrentUsedSize < 1)
|
||||||
|
{
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
return m_Data[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
T & back()
|
||||||
|
{
|
||||||
|
if (m_CurrentUsedSize < 1)
|
||||||
|
{
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
return m_Data[m_CurrentUsedSize - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
const T & back() const
|
||||||
|
{
|
||||||
|
if (m_CurrentUsedSize < 1)
|
||||||
|
{
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
return m_Data[m_CurrentUsedSize - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
bool insert(iterator where, const T & value)
|
||||||
|
{
|
||||||
|
// we have to insert before
|
||||||
|
// if it is begin, don't decrement
|
||||||
|
if (where != m_Data)
|
||||||
|
--where;
|
||||||
|
// validate iter
|
||||||
|
if (where < m_Data || where >= (m_Data + m_CurrentUsedSize))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
++m_CurrentUsedSize;
|
||||||
|
if (!GrowIfNeeded())
|
||||||
|
{
|
||||||
|
--m_CurrentUsedSize;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
memmove(where.base() + 1, where.base(), m_CurrentUsedSize - (where - m_Data));
|
||||||
|
memcpy(where.base(), &value, sizeof(T));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void erase(iterator where)
|
||||||
|
{
|
||||||
|
// validate iter
|
||||||
|
if (where < m_Data || where >= (m_Data + m_CurrentUsedSize))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (m_CurrentUsedSize > 1)
|
||||||
|
{
|
||||||
|
// move
|
||||||
|
memmove(where.base(), where.base() + 1, m_CurrentUsedSize - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
--m_CurrentUsedSize;
|
||||||
|
// :TODO: free memory sometimes
|
||||||
|
}
|
||||||
|
|
||||||
|
void clear()
|
||||||
|
{
|
||||||
|
m_Size = 0;
|
||||||
|
m_CurrentUsedSize = 0;
|
||||||
|
delete [] m_Data;
|
||||||
|
m_Data = NULL;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __CVECTOR_H__
|
||||||
|
|
3042
dlls/regex/amxxmodule.cpp
Executable file
3042
dlls/regex/amxxmodule.cpp
Executable file
File diff suppressed because it is too large
Load Diff
2197
dlls/regex/amxxmodule.h
Executable file
2197
dlls/regex/amxxmodule.h
Executable file
File diff suppressed because it is too large
Load Diff
BIN
dlls/regex/lib_win/pcre.lib
Executable file
BIN
dlls/regex/lib_win/pcre.lib
Executable file
Binary file not shown.
BIN
dlls/regex/lib_win/pcreposix.lib
Executable file
BIN
dlls/regex/lib_win/pcreposix.lib
Executable file
Binary file not shown.
104
dlls/regex/module.cpp
Executable file
104
dlls/regex/module.cpp
Executable file
|
@ -0,0 +1,104 @@
|
||||||
|
#include <string.h>
|
||||||
|
#include "pcre.h"
|
||||||
|
#include "CVector.h"
|
||||||
|
#include "CRegEx.h"
|
||||||
|
#include "amxxmodule.h"
|
||||||
|
#include "module.h"
|
||||||
|
|
||||||
|
CVector<RegEx *> PEL;
|
||||||
|
|
||||||
|
int GetPEL()
|
||||||
|
{
|
||||||
|
for (int i=0; i<(int)PEL.size(); i++)
|
||||||
|
{
|
||||||
|
if (PEL[i]->isFree())
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegEx *x = new RegEx();
|
||||||
|
PEL.push_back(x);
|
||||||
|
|
||||||
|
return (int)PEL.size() - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL regex_match(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int len;
|
||||||
|
const char *str = MF_GetAmxString(amx, params[1], 0, &len);
|
||||||
|
const char *regex = MF_GetAmxString(amx, params[2], 1, &len);
|
||||||
|
|
||||||
|
int id = GetPEL();
|
||||||
|
RegEx *x = PEL[id];
|
||||||
|
|
||||||
|
if (x->Compile(regex) == 0)
|
||||||
|
{
|
||||||
|
cell *eOff = MF_GetAmxAddr(amx, params[3]);
|
||||||
|
const char *err = x->mError;
|
||||||
|
*eOff = x->mErrorOffset;
|
||||||
|
MF_SetAmxString(amx, params[4], err?err:"unknown", params[5]);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int e = x->Match(str);
|
||||||
|
if (e == -1)
|
||||||
|
{
|
||||||
|
/* there was a match error. destroy this and move on. */
|
||||||
|
cell *res = MF_GetAmxAddr(amx, params[3]);
|
||||||
|
*res = x->mErrorOffset;
|
||||||
|
x->Clear();
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
cell *res = MF_GetAmxAddr(amx, params[3]);
|
||||||
|
*res = x->mSubStrings;
|
||||||
|
}
|
||||||
|
|
||||||
|
return id+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL regex_substr(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id >= (int)PEL.size() || id < 0 || PEL[id]->isFree())
|
||||||
|
{
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid regex handle %d", id);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegEx *x = PEL[id];
|
||||||
|
//good idea? probably not.
|
||||||
|
static char buffer[4096];
|
||||||
|
|
||||||
|
const char *ret = x->GetSubstring(params[2], buffer, 4095);
|
||||||
|
|
||||||
|
if (ret == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
MF_SetAmxString(amx, params[3], ret, params[4]);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
AMX_NATIVE_INFO regex_Natives[] = {
|
||||||
|
{"regex_match", regex_match},
|
||||||
|
{"regex_substr", regex_substr},
|
||||||
|
{NULL, NULL},
|
||||||
|
};
|
||||||
|
|
||||||
|
void OnAmxxAttach()
|
||||||
|
{
|
||||||
|
MF_AddNatives(regex_Natives);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnAmxxDetach()
|
||||||
|
{
|
||||||
|
for (int i = 0; i<(int)PEL.size(); i++)
|
||||||
|
{
|
||||||
|
if (PEL[i])
|
||||||
|
{
|
||||||
|
delete PEL[i];
|
||||||
|
PEL[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PEL.clear();
|
||||||
|
}
|
10
dlls/regex/module.h
Executable file
10
dlls/regex/module.h
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
/* (C)2004 David "BAILOPAN" anderosn
|
||||||
|
* Licensed under the GNU General Public License, version 2
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _INCLUDE_REGEX_H
|
||||||
|
#define _INCLUDE_REGEX_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif //_INCLUDE_REGEX_H
|
462
dlls/regex/moduleconfig.h
Executable file
462
dlls/regex/moduleconfig.h
Executable file
|
@ -0,0 +1,462 @@
|
||||||
|
// Configuration
|
||||||
|
|
||||||
|
#ifndef __MODULECONFIG_H__
|
||||||
|
#define __MODULECONFIG_H__
|
||||||
|
|
||||||
|
// Module info
|
||||||
|
#define MODULE_NAME "RegEx"
|
||||||
|
#define MODULE_VERSION "1.00"
|
||||||
|
#define MODULE_AUTHOR "BAILOPAN"
|
||||||
|
#define MODULE_URL "http://www.amxmodx.org/"
|
||||||
|
#define MODULE_LOGTAG "REGEX"
|
||||||
|
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||||
|
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||||
|
|
||||||
|
#ifdef __DATE__
|
||||||
|
#define MODULE_DATE __DATE__
|
||||||
|
#else // __DATE__
|
||||||
|
#define MODULE_DATE "Unknown"
|
||||||
|
#endif // __DATE__
|
||||||
|
|
||||||
|
// metamod plugin?
|
||||||
|
// #define USE_METAMOD
|
||||||
|
|
||||||
|
// - AMXX Init functions
|
||||||
|
// Also consider using FN_META_*
|
||||||
|
// AMXX query
|
||||||
|
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||||
|
// AMXX attach
|
||||||
|
// Do native functions init here (MF_AddNatives)
|
||||||
|
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||||
|
// AMXX detach
|
||||||
|
#define FN_AMXX_DETACH OnAmxxDetach
|
||||||
|
// All plugins loaded
|
||||||
|
// Do forward functions init here (MF_RegisterForward)
|
||||||
|
// #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||||
|
|
||||||
|
/**** METAMOD ****/
|
||||||
|
// If your module doesn't use metamod, you may close the file now :)
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
// ----
|
||||||
|
// Hook Functions
|
||||||
|
// Uncomment these to be called
|
||||||
|
// You can also change the function name
|
||||||
|
|
||||||
|
// - Metamod init functions
|
||||||
|
// Also consider using FN_AMXX_*
|
||||||
|
// Meta query
|
||||||
|
//#define FN_META_QUERY OnMetaQuery
|
||||||
|
// Meta attach
|
||||||
|
//#define FN_META_ATTACH OnMetaAttach
|
||||||
|
// Meta detach
|
||||||
|
//#define FN_META_DETACH OnMetaDetach
|
||||||
|
|
||||||
|
// (wd) are Will Day's notes
|
||||||
|
// - GetEntityAPI2 functions
|
||||||
|
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||||
|
// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */
|
||||||
|
// #define FN_DispatchThink DispatchThink /* pfnThink() */
|
||||||
|
// #define FN_DispatchUse DispatchUse /* pfnUse() */
|
||||||
|
// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
||||||
|
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||||
|
// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */
|
||||||
|
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||||
|
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||||
|
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||||
|
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
|
||||||
|
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
|
||||||
|
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
|
||||||
|
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||||
|
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||||
|
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||||
|
// #define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||||
|
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||||
|
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||||
|
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||||
|
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||||
|
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||||
|
// #define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||||
|
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||||
|
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||||
|
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||||
|
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||||
|
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||||
|
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||||
|
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
|
||||||
|
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
|
||||||
|
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
|
||||||
|
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
|
||||||
|
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
|
||||||
|
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
|
||||||
|
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
|
||||||
|
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
|
||||||
|
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
|
||||||
|
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
|
||||||
|
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
|
||||||
|
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
|
||||||
|
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||||
|
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||||
|
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||||
|
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||||
|
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||||
|
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||||
|
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
|
||||||
|
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
|
||||||
|
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
|
||||||
|
|
||||||
|
// - GetEntityAPI2_Post functions
|
||||||
|
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||||
|
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
||||||
|
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||||
|
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||||
|
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||||
|
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||||
|
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
|
||||||
|
// #define FN_DispatchSave_Post DispatchSave_Post
|
||||||
|
// #define FN_DispatchRestore_Post DispatchRestore_Post
|
||||||
|
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
|
||||||
|
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
|
||||||
|
// #define FN_SaveReadFields_Post SaveReadFields_Post
|
||||||
|
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||||
|
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||||
|
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||||
|
// #define FN_ClientConnect_Post ClientConnect_Post
|
||||||
|
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||||
|
// #define FN_ClientKill_Post ClientKill_Post
|
||||||
|
// #define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||||
|
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||||
|
// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||||
|
// #define FN_ServerActivate_Post ServerActivate_Post
|
||||||
|
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||||
|
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||||
|
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||||
|
// #define FN_StartFrame_Post StartFrame_Post
|
||||||
|
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||||
|
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||||
|
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||||
|
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
|
||||||
|
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
|
||||||
|
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
|
||||||
|
// #define FN_SpectatorThink_Post SpectatorThink_Post
|
||||||
|
// #define FN_Sys_Error_Post Sys_Error_Post
|
||||||
|
// #define FN_PM_Move_Post PM_Move_Post
|
||||||
|
// #define FN_PM_Init_Post PM_Init_Post
|
||||||
|
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
|
||||||
|
// #define FN_SetupVisibility_Post SetupVisibility_Post
|
||||||
|
// #define FN_UpdateClientData_Post UpdateClientData_Post
|
||||||
|
// #define FN_AddToFullPack_Post AddToFullPack_Post
|
||||||
|
// #define FN_CreateBaseline_Post CreateBaseline_Post
|
||||||
|
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
|
||||||
|
// #define FN_GetWeaponData_Post GetWeaponData_Post
|
||||||
|
// #define FN_CmdStart_Post CmdStart_Post
|
||||||
|
// #define FN_CmdEnd_Post CmdEnd_Post
|
||||||
|
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
|
||||||
|
// #define FN_GetHullBounds_Post GetHullBounds_Post
|
||||||
|
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
|
||||||
|
// #define FN_InconsistentFile_Post InconsistentFile_Post
|
||||||
|
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
|
||||||
|
|
||||||
|
// - GetEngineAPI functions
|
||||||
|
// #define FN_PrecacheModel PrecacheModel
|
||||||
|
// #define FN_PrecacheSound PrecacheSound
|
||||||
|
// #define FN_SetModel SetModel
|
||||||
|
// #define FN_ModelIndex ModelIndex
|
||||||
|
// #define FN_ModelFrames ModelFrames
|
||||||
|
// #define FN_SetSize SetSize
|
||||||
|
// #define FN_ChangeLevel ChangeLevel
|
||||||
|
// #define FN_GetSpawnParms GetSpawnParms
|
||||||
|
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||||
|
// #define FN_VecToYaw VecToYaw
|
||||||
|
// #define FN_VecToAngles VecToAngles
|
||||||
|
// #define FN_MoveToOrigin MoveToOrigin
|
||||||
|
// #define FN_ChangeYaw ChangeYaw
|
||||||
|
// #define FN_ChangePitch ChangePitch
|
||||||
|
// #define FN_FindEntityByString FindEntityByString
|
||||||
|
// #define FN_GetEntityIllum GetEntityIllum
|
||||||
|
// #define FN_FindEntityInSphere FindEntityInSphere
|
||||||
|
// #define FN_FindClientInPVS FindClientInPVS
|
||||||
|
// #define FN_EntitiesInPVS EntitiesInPVS
|
||||||
|
// #define FN_MakeVectors MakeVectors
|
||||||
|
// #define FN_AngleVectors AngleVectors
|
||||||
|
// #define FN_CreateEntity CreateEntity
|
||||||
|
// #define FN_RemoveEntity RemoveEntity
|
||||||
|
// #define FN_CreateNamedEntity CreateNamedEntity
|
||||||
|
// #define FN_MakeStatic MakeStatic
|
||||||
|
// #define FN_EntIsOnFloor EntIsOnFloor
|
||||||
|
// #define FN_DropToFloor DropToFloor
|
||||||
|
// #define FN_WalkMove WalkMove
|
||||||
|
// #define FN_SetOrigin SetOrigin
|
||||||
|
// #define FN_EmitSound EmitSound
|
||||||
|
// #define FN_EmitAmbientSound EmitAmbientSound
|
||||||
|
// #define FN_TraceLine TraceLine
|
||||||
|
// #define FN_TraceToss TraceToss
|
||||||
|
// #define FN_TraceMonsterHull TraceMonsterHull
|
||||||
|
// #define FN_TraceHull TraceHull
|
||||||
|
// #define FN_TraceModel TraceModel
|
||||||
|
// #define FN_TraceTexture TraceTexture
|
||||||
|
// #define FN_TraceSphere TraceSphere
|
||||||
|
// #define FN_GetAimVector GetAimVector
|
||||||
|
// #define FN_ServerCommand ServerCommand
|
||||||
|
// #define FN_ServerExecute ServerExecute
|
||||||
|
// #define FN_engClientCommand engClientCommand
|
||||||
|
// #define FN_ParticleEffect ParticleEffect
|
||||||
|
// #define FN_LightStyle LightStyle
|
||||||
|
// #define FN_DecalIndex DecalIndex
|
||||||
|
// #define FN_PointContents PointContents
|
||||||
|
// #define FN_MessageBegin MessageBegin
|
||||||
|
// #define FN_MessageEnd MessageEnd
|
||||||
|
// #define FN_WriteByte WriteByte
|
||||||
|
// #define FN_WriteChar WriteChar
|
||||||
|
// #define FN_WriteShort WriteShort
|
||||||
|
// #define FN_WriteLong WriteLong
|
||||||
|
// #define FN_WriteAngle WriteAngle
|
||||||
|
// #define FN_WriteCoord WriteCoord
|
||||||
|
// #define FN_WriteString WriteString
|
||||||
|
// #define FN_WriteEntity WriteEntity
|
||||||
|
// #define FN_CVarRegister CVarRegister
|
||||||
|
// #define FN_CVarGetFloat CVarGetFloat
|
||||||
|
// #define FN_CVarGetString CVarGetString
|
||||||
|
// #define FN_CVarSetFloat CVarSetFloat
|
||||||
|
// #define FN_CVarSetString CVarSetString
|
||||||
|
// #define FN_AlertMessage AlertMessage
|
||||||
|
// #define FN_EngineFprintf EngineFprintf
|
||||||
|
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
|
||||||
|
// #define FN_PvEntPrivateData PvEntPrivateData
|
||||||
|
// #define FN_FreeEntPrivateData FreeEntPrivateData
|
||||||
|
// #define FN_SzFromIndex SzFromIndex
|
||||||
|
// #define FN_AllocString AllocString
|
||||||
|
// #define FN_GetVarsOfEnt GetVarsOfEnt
|
||||||
|
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
|
||||||
|
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
|
||||||
|
// #define FN_IndexOfEdict IndexOfEdict
|
||||||
|
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
|
||||||
|
// #define FN_FindEntityByVars FindEntityByVars
|
||||||
|
// #define FN_GetModelPtr GetModelPtr
|
||||||
|
// #define FN_RegUserMsg RegUserMsg
|
||||||
|
// #define FN_AnimationAutomove AnimationAutomove
|
||||||
|
// #define FN_GetBonePosition GetBonePosition
|
||||||
|
// #define FN_FunctionFromName FunctionFromName
|
||||||
|
// #define FN_NameForFunction NameForFunction
|
||||||
|
// #define FN_ClientPrintf ClientPrintf
|
||||||
|
// #define FN_ServerPrint ServerPrint
|
||||||
|
// #define FN_Cmd_Args Cmd_Args
|
||||||
|
// #define FN_Cmd_Argv Cmd_Argv
|
||||||
|
// #define FN_Cmd_Argc Cmd_Argc
|
||||||
|
// #define FN_GetAttachment GetAttachment
|
||||||
|
// #define FN_CRC32_Init CRC32_Init
|
||||||
|
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
|
||||||
|
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
|
||||||
|
// #define FN_CRC32_Final CRC32_Final
|
||||||
|
// #define FN_RandomLong RandomLong
|
||||||
|
// #define FN_RandomFloat RandomFloat
|
||||||
|
// #define FN_SetView SetView
|
||||||
|
// #define FN_Time Time
|
||||||
|
// #define FN_CrosshairAngle CrosshairAngle
|
||||||
|
// #define FN_LoadFileForMe LoadFileForMe
|
||||||
|
// #define FN_FreeFile FreeFile
|
||||||
|
// #define FN_EndSection EndSection
|
||||||
|
// #define FN_CompareFileTime CompareFileTime
|
||||||
|
// #define FN_GetGameDir GetGameDir
|
||||||
|
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
|
||||||
|
// #define FN_FadeClientVolume FadeClientVolume
|
||||||
|
// #define FN_SetClientMaxspeed SetClientMaxspeed
|
||||||
|
// #define FN_CreateFakeClient CreateFakeClient
|
||||||
|
// #define FN_RunPlayerMove RunPlayerMove
|
||||||
|
// #define FN_NumberOfEntities NumberOfEntities
|
||||||
|
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
|
||||||
|
// #define FN_InfoKeyValue InfoKeyValue
|
||||||
|
// #define FN_SetKeyValue SetKeyValue
|
||||||
|
// #define FN_SetClientKeyValue SetClientKeyValue
|
||||||
|
// #define FN_IsMapValid IsMapValid
|
||||||
|
// #define FN_StaticDecal StaticDecal
|
||||||
|
// #define FN_PrecacheGeneric PrecacheGeneric
|
||||||
|
// #define FN_GetPlayerUserId GetPlayerUserId
|
||||||
|
// #define FN_BuildSoundMsg BuildSoundMsg
|
||||||
|
// #define FN_IsDedicatedServer IsDedicatedServer
|
||||||
|
// #define FN_CVarGetPointer CVarGetPointer
|
||||||
|
// #define FN_GetPlayerWONId GetPlayerWONId
|
||||||
|
// #define FN_Info_RemoveKey Info_RemoveKey
|
||||||
|
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
|
||||||
|
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||||
|
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||||
|
// #define FN_PrecacheEvent PrecacheEvent
|
||||||
|
// #define FN_PlaybackEvent PlaybackEvent
|
||||||
|
// #define FN_SetFatPVS SetFatPVS
|
||||||
|
// #define FN_SetFatPAS SetFatPAS
|
||||||
|
// #define FN_CheckVisibility CheckVisibility
|
||||||
|
// #define FN_DeltaSetField DeltaSetField
|
||||||
|
// #define FN_DeltaUnsetField DeltaUnsetField
|
||||||
|
// #define FN_DeltaAddEncoder DeltaAddEncoder
|
||||||
|
// #define FN_GetCurrentPlayer GetCurrentPlayer
|
||||||
|
// #define FN_CanSkipPlayer CanSkipPlayer
|
||||||
|
// #define FN_DeltaFindField DeltaFindField
|
||||||
|
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
|
||||||
|
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
|
||||||
|
// #define FN_SetGroupMask SetGroupMask
|
||||||
|
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
|
||||||
|
// #define FN_Cvar_DirectSet Cvar_DirectSet
|
||||||
|
// #define FN_ForceUnmodified ForceUnmodified
|
||||||
|
// #define FN_GetPlayerStats GetPlayerStats
|
||||||
|
// #define FN_AddServerCommand AddServerCommand
|
||||||
|
// #define FN_Voice_GetClientListening Voice_GetClientListening
|
||||||
|
// #define FN_Voice_SetClientListening Voice_SetClientListening
|
||||||
|
// #define FN_GetPlayerAuthId GetPlayerAuthId
|
||||||
|
|
||||||
|
// - GetEngineAPI_Post functions
|
||||||
|
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||||
|
// #define FN_PrecacheSound_Post PrecacheSound_Post
|
||||||
|
// #define FN_SetModel_Post SetModel_Post
|
||||||
|
// #define FN_ModelIndex_Post ModelIndex_Post
|
||||||
|
// #define FN_ModelFrames_Post ModelFrames_Post
|
||||||
|
// #define FN_SetSize_Post SetSize_Post
|
||||||
|
// #define FN_ChangeLevel_Post ChangeLevel_Post
|
||||||
|
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
|
||||||
|
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
|
||||||
|
// #define FN_VecToYaw_Post VecToYaw_Post
|
||||||
|
// #define FN_VecToAngles_Post VecToAngles_Post
|
||||||
|
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
|
||||||
|
// #define FN_ChangeYaw_Post ChangeYaw_Post
|
||||||
|
// #define FN_ChangePitch_Post ChangePitch_Post
|
||||||
|
// #define FN_FindEntityByString_Post FindEntityByString_Post
|
||||||
|
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
|
||||||
|
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
|
||||||
|
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
|
||||||
|
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
|
||||||
|
// #define FN_MakeVectors_Post MakeVectors_Post
|
||||||
|
// #define FN_AngleVectors_Post AngleVectors_Post
|
||||||
|
// #define FN_CreateEntity_Post CreateEntity_Post
|
||||||
|
// #define FN_RemoveEntity_Post RemoveEntity_Post
|
||||||
|
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
|
||||||
|
// #define FN_MakeStatic_Post MakeStatic_Post
|
||||||
|
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
|
||||||
|
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||||
|
// #define FN_WalkMove_Post WalkMove_Post
|
||||||
|
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||||
|
// #define FN_EmitSound_Post EmitSound_Post
|
||||||
|
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||||
|
// #define FN_TraceLine_Post TraceLine_Post
|
||||||
|
// #define FN_TraceToss_Post TraceToss_Post
|
||||||
|
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||||
|
// #define FN_TraceHull_Post TraceHull_Post
|
||||||
|
// #define FN_TraceModel_Post TraceModel_Post
|
||||||
|
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||||
|
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||||
|
// #define FN_GetAimVector_Post GetAimVector_Post
|
||||||
|
// #define FN_ServerCommand_Post ServerCommand_Post
|
||||||
|
// #define FN_ServerExecute_Post ServerExecute_Post
|
||||||
|
// #define FN_engClientCommand_Post engClientCommand_Post
|
||||||
|
// #define FN_ParticleEffect_Post ParticleEffect_Post
|
||||||
|
// #define FN_LightStyle_Post LightStyle_Post
|
||||||
|
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||||
|
// #define FN_PointContents_Post PointContents_Post
|
||||||
|
// #define FN_MessageBegin_Post MessageBegin_Post
|
||||||
|
// #define FN_MessageEnd_Post MessageEnd_Post
|
||||||
|
// #define FN_WriteByte_Post WriteByte_Post
|
||||||
|
// #define FN_WriteChar_Post WriteChar_Post
|
||||||
|
// #define FN_WriteShort_Post WriteShort_Post
|
||||||
|
// #define FN_WriteLong_Post WriteLong_Post
|
||||||
|
// #define FN_WriteAngle_Post WriteAngle_Post
|
||||||
|
// #define FN_WriteCoord_Post WriteCoord_Post
|
||||||
|
// #define FN_WriteString_Post WriteString_Post
|
||||||
|
// #define FN_WriteEntity_Post WriteEntity_Post
|
||||||
|
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||||
|
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||||
|
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||||
|
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
|
||||||
|
// #define FN_CVarSetString_Post CVarSetString_Post
|
||||||
|
// #define FN_AlertMessage_Post AlertMessage_Post
|
||||||
|
// #define FN_EngineFprintf_Post EngineFprintf_Post
|
||||||
|
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
|
||||||
|
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
|
||||||
|
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
|
||||||
|
// #define FN_SzFromIndex_Post SzFromIndex_Post
|
||||||
|
// #define FN_AllocString_Post AllocString_Post
|
||||||
|
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
|
||||||
|
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
|
||||||
|
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
|
||||||
|
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
|
||||||
|
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||||
|
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||||
|
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||||
|
// #define FN_RegUserMsg_Post RegUserMsg_Post
|
||||||
|
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||||
|
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||||
|
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||||
|
// #define FN_NameForFunction_Post NameForFunction_Post
|
||||||
|
// #define FN_ClientPrintf_Post ClientPrintf_Post
|
||||||
|
// #define FN_ServerPrint_Post ServerPrint_Post
|
||||||
|
// #define FN_Cmd_Args_Post Cmd_Args_Post
|
||||||
|
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
|
||||||
|
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
|
||||||
|
// #define FN_GetAttachment_Post GetAttachment_Post
|
||||||
|
// #define FN_CRC32_Init_Post CRC32_Init_Post
|
||||||
|
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
|
||||||
|
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
|
||||||
|
// #define FN_CRC32_Final_Post CRC32_Final_Post
|
||||||
|
// #define FN_RandomLong_Post RandomLong_Post
|
||||||
|
// #define FN_RandomFloat_Post RandomFloat_Post
|
||||||
|
// #define FN_SetView_Post SetView_Post
|
||||||
|
// #define FN_Time_Post Time_Post
|
||||||
|
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
|
||||||
|
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
|
||||||
|
// #define FN_FreeFile_Post FreeFile_Post
|
||||||
|
// #define FN_EndSection_Post EndSection_Post
|
||||||
|
// #define FN_CompareFileTime_Post CompareFileTime_Post
|
||||||
|
// #define FN_GetGameDir_Post GetGameDir_Post
|
||||||
|
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
|
||||||
|
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
|
||||||
|
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
|
||||||
|
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
|
||||||
|
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
|
||||||
|
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
|
||||||
|
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
|
||||||
|
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
|
||||||
|
// #define FN_SetKeyValue_Post SetKeyValue_Post
|
||||||
|
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
|
||||||
|
// #define FN_IsMapValid_Post IsMapValid_Post
|
||||||
|
// #define FN_StaticDecal_Post StaticDecal_Post
|
||||||
|
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
|
||||||
|
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
|
||||||
|
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
|
||||||
|
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
|
||||||
|
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
|
||||||
|
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
|
||||||
|
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
|
||||||
|
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
|
||||||
|
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
|
||||||
|
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
|
||||||
|
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
|
||||||
|
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
|
||||||
|
// #define FN_SetFatPVS_Post SetFatPVS_Post
|
||||||
|
// #define FN_SetFatPAS_Post SetFatPAS_Post
|
||||||
|
// #define FN_CheckVisibility_Post CheckVisibility_Post
|
||||||
|
// #define FN_DeltaSetField_Post DeltaSetField_Post
|
||||||
|
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
|
||||||
|
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
|
||||||
|
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
|
||||||
|
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
|
||||||
|
// #define FN_DeltaFindField_Post DeltaFindField_Post
|
||||||
|
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
|
||||||
|
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
|
||||||
|
// #define FN_SetGroupMask_Post SetGroupMask_Post
|
||||||
|
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
|
||||||
|
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
|
||||||
|
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
|
||||||
|
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
|
||||||
|
// #define FN_AddServerCommand_Post AddServerCommand_Post
|
||||||
|
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
|
||||||
|
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
|
||||||
|
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
|
||||||
|
|
||||||
|
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
|
||||||
|
// #define FN_GameShutdown GameShutdown
|
||||||
|
// #define FN_ShouldCollide ShouldCollide
|
||||||
|
|
||||||
|
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
|
||||||
|
// #define FN_GameShutdown_Post GameShutdown_Post
|
||||||
|
// #define FN_ShouldCollide_Post ShouldCollide_Post
|
||||||
|
|
||||||
|
|
||||||
|
#endif // USE_METAMOD
|
||||||
|
|
||||||
|
#endif // __MODULECONFIG_H__
|
193
dlls/regex/pcre.h
Executable file
193
dlls/regex/pcre.h
Executable file
|
@ -0,0 +1,193 @@
|
||||||
|
/*************************************************
|
||||||
|
* Perl-Compatible Regular Expressions *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* Copyright (c) 1997-2003 University of Cambridge */
|
||||||
|
|
||||||
|
#ifndef _PCRE_H
|
||||||
|
#define _PCRE_H
|
||||||
|
|
||||||
|
/* The file pcre.h is build by "configure". Do not edit it; instead
|
||||||
|
make changes to pcre.in. */
|
||||||
|
|
||||||
|
#define PCRE_MAJOR 4
|
||||||
|
#define PCRE_MINOR 5
|
||||||
|
#define PCRE_DATE 01-December-2003
|
||||||
|
|
||||||
|
/* Win32 uses DLL by default */
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
# ifdef PCRE_DEFINITION
|
||||||
|
# ifdef DLL_EXPORT
|
||||||
|
# define PCRE_DATA_SCOPE __declspec(dllexport)
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# ifndef PCRE_STATIC
|
||||||
|
# define PCRE_DATA_SCOPE extern __declspec(dllimport)
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef PCRE_DATA_SCOPE
|
||||||
|
# define PCRE_DATA_SCOPE extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Have to include stdlib.h in order to ensure that size_t is defined;
|
||||||
|
it is needed here for malloc. */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/* Allow for C++ users */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Options */
|
||||||
|
|
||||||
|
#define PCRE_CASELESS 0x0001
|
||||||
|
#define PCRE_MULTILINE 0x0002
|
||||||
|
#define PCRE_DOTALL 0x0004
|
||||||
|
#define PCRE_EXTENDED 0x0008
|
||||||
|
#define PCRE_ANCHORED 0x0010
|
||||||
|
#define PCRE_DOLLAR_ENDONLY 0x0020
|
||||||
|
#define PCRE_EXTRA 0x0040
|
||||||
|
#define PCRE_NOTBOL 0x0080
|
||||||
|
#define PCRE_NOTEOL 0x0100
|
||||||
|
#define PCRE_UNGREEDY 0x0200
|
||||||
|
#define PCRE_NOTEMPTY 0x0400
|
||||||
|
#define PCRE_UTF8 0x0800
|
||||||
|
#define PCRE_NO_AUTO_CAPTURE 0x1000
|
||||||
|
#define PCRE_NO_UTF8_CHECK 0x2000
|
||||||
|
|
||||||
|
/* Exec-time and get/set-time error codes */
|
||||||
|
|
||||||
|
#define PCRE_ERROR_NOMATCH (-1)
|
||||||
|
#define PCRE_ERROR_NULL (-2)
|
||||||
|
#define PCRE_ERROR_BADOPTION (-3)
|
||||||
|
#define PCRE_ERROR_BADMAGIC (-4)
|
||||||
|
#define PCRE_ERROR_UNKNOWN_NODE (-5)
|
||||||
|
#define PCRE_ERROR_NOMEMORY (-6)
|
||||||
|
#define PCRE_ERROR_NOSUBSTRING (-7)
|
||||||
|
#define PCRE_ERROR_MATCHLIMIT (-8)
|
||||||
|
#define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */
|
||||||
|
#define PCRE_ERROR_BADUTF8 (-10)
|
||||||
|
#define PCRE_ERROR_BADUTF8_OFFSET (-11)
|
||||||
|
|
||||||
|
/* Request types for pcre_fullinfo() */
|
||||||
|
|
||||||
|
#define PCRE_INFO_OPTIONS 0
|
||||||
|
#define PCRE_INFO_SIZE 1
|
||||||
|
#define PCRE_INFO_CAPTURECOUNT 2
|
||||||
|
#define PCRE_INFO_BACKREFMAX 3
|
||||||
|
#define PCRE_INFO_FIRSTBYTE 4
|
||||||
|
#define PCRE_INFO_FIRSTCHAR 4 /* For backwards compatibility */
|
||||||
|
#define PCRE_INFO_FIRSTTABLE 5
|
||||||
|
#define PCRE_INFO_LASTLITERAL 6
|
||||||
|
#define PCRE_INFO_NAMEENTRYSIZE 7
|
||||||
|
#define PCRE_INFO_NAMECOUNT 8
|
||||||
|
#define PCRE_INFO_NAMETABLE 9
|
||||||
|
#define PCRE_INFO_STUDYSIZE 10
|
||||||
|
|
||||||
|
/* Request types for pcre_config() */
|
||||||
|
|
||||||
|
#define PCRE_CONFIG_UTF8 0
|
||||||
|
#define PCRE_CONFIG_NEWLINE 1
|
||||||
|
#define PCRE_CONFIG_LINK_SIZE 2
|
||||||
|
#define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3
|
||||||
|
#define PCRE_CONFIG_MATCH_LIMIT 4
|
||||||
|
#define PCRE_CONFIG_STACKRECURSE 5
|
||||||
|
|
||||||
|
/* Bit flags for the pcre_extra structure */
|
||||||
|
|
||||||
|
#define PCRE_EXTRA_STUDY_DATA 0x0001
|
||||||
|
#define PCRE_EXTRA_MATCH_LIMIT 0x0002
|
||||||
|
#define PCRE_EXTRA_CALLOUT_DATA 0x0004
|
||||||
|
|
||||||
|
/* Types */
|
||||||
|
|
||||||
|
struct real_pcre; /* declaration; the definition is private */
|
||||||
|
typedef struct real_pcre pcre;
|
||||||
|
|
||||||
|
/* The structure for passing additional data to pcre_exec(). This is defined in
|
||||||
|
such as way as to be extensible. */
|
||||||
|
|
||||||
|
typedef struct pcre_extra {
|
||||||
|
unsigned long int flags; /* Bits for which fields are set */
|
||||||
|
void *study_data; /* Opaque data from pcre_study() */
|
||||||
|
unsigned long int match_limit; /* Maximum number of calls to match() */
|
||||||
|
void *callout_data; /* Data passed back in callouts */
|
||||||
|
} pcre_extra;
|
||||||
|
|
||||||
|
/* The structure for passing out data via the pcre_callout_function. We use a
|
||||||
|
structure so that new fields can be added on the end in future versions,
|
||||||
|
without changing the API of the function, thereby allowing old clients to work
|
||||||
|
without modification. */
|
||||||
|
|
||||||
|
typedef struct pcre_callout_block {
|
||||||
|
int version; /* Identifies version of block */
|
||||||
|
/* ------------------------ Version 0 ------------------------------- */
|
||||||
|
int callout_number; /* Number compiled into pattern */
|
||||||
|
int *offset_vector; /* The offset vector */
|
||||||
|
const char *subject; /* The subject being matched */
|
||||||
|
int subject_length; /* The length of the subject */
|
||||||
|
int start_match; /* Offset to start of this match attempt */
|
||||||
|
int current_position; /* Where we currently are */
|
||||||
|
int capture_top; /* Max current capture */
|
||||||
|
int capture_last; /* Most recently closed capture */
|
||||||
|
void *callout_data; /* Data passed in with the call */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
} pcre_callout_block;
|
||||||
|
|
||||||
|
/* Indirection for store get and free functions. These can be set to
|
||||||
|
alternative malloc/free functions if required. Special ones are used in the
|
||||||
|
non-recursive case for "frames". There is also an optional callout function
|
||||||
|
that is triggered by the (?) regex item. Some magic is required for Win32 DLL;
|
||||||
|
it is null on other OS. For Virtual Pascal, these have to be different again.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef VPCOMPAT
|
||||||
|
PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t);
|
||||||
|
PCRE_DATA_SCOPE void (*pcre_free)(void *);
|
||||||
|
PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t);
|
||||||
|
PCRE_DATA_SCOPE void (*pcre_stack_free)(void *);
|
||||||
|
PCRE_DATA_SCOPE int (*pcre_callout)(pcre_callout_block *);
|
||||||
|
#else /* VPCOMPAT */
|
||||||
|
extern void *pcre_malloc(size_t);
|
||||||
|
extern void pcre_free(void *);
|
||||||
|
extern void *pcre_stack_malloc(size_t);
|
||||||
|
extern void pcre_stack_free(void *);
|
||||||
|
extern int pcre_callout(pcre_callout_block *);
|
||||||
|
#endif /* VPCOMPAT */
|
||||||
|
|
||||||
|
/* Exported PCRE functions */
|
||||||
|
|
||||||
|
extern pcre *pcre_compile(const char *, int, const char **,
|
||||||
|
int *, const unsigned char *);
|
||||||
|
extern int pcre_config(int, void *);
|
||||||
|
extern int pcre_copy_named_substring(const pcre *, const char *,
|
||||||
|
int *, int, const char *, char *, int);
|
||||||
|
extern int pcre_copy_substring(const char *, int *, int, int,
|
||||||
|
char *, int);
|
||||||
|
extern int pcre_exec(const pcre *, const pcre_extra *,
|
||||||
|
const char *, int, int, int, int *, int);
|
||||||
|
extern void pcre_free_substring(const char *);
|
||||||
|
extern void pcre_free_substring_list(const char **);
|
||||||
|
extern int pcre_fullinfo(const pcre *, const pcre_extra *, int,
|
||||||
|
void *);
|
||||||
|
extern int pcre_get_named_substring(const pcre *, const char *,
|
||||||
|
int *, int, const char *, const char **);
|
||||||
|
extern int pcre_get_stringnumber(const pcre *, const char *);
|
||||||
|
extern int pcre_get_substring(const char *, int *, int, int,
|
||||||
|
const char **);
|
||||||
|
extern int pcre_get_substring_list(const char *, int *, int,
|
||||||
|
const char ***);
|
||||||
|
extern int pcre_info(const pcre *, int *, int *);
|
||||||
|
extern const unsigned char *pcre_maketables(void);
|
||||||
|
extern pcre_extra *pcre_study(const pcre *, int, const char **);
|
||||||
|
extern const char *pcre_version(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* End of pcre.h */
|
Loading…
Reference in New Issue
Block a user