touched up some source files for borland and msvc.
added more options to bakefile description
This commit is contained in:
@ -161,7 +161,7 @@ public:
|
||||
///
|
||||
void clearError ();
|
||||
|
||||
protected:
|
||||
//protected: can't make it protected for borland
|
||||
void retrieveError ();
|
||||
void retrieveError (Run* run);
|
||||
/// @}
|
||||
@ -242,7 +242,7 @@ public:
|
||||
|
||||
operator awk_t* () const
|
||||
{
|
||||
return this->awk->awk;
|
||||
return this->awk->getHandle();
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -458,7 +458,7 @@ public:
|
||||
void* operator new (size_t n, Run* run) throw ();
|
||||
void* operator new[] (size_t n, Run* run) throw ();
|
||||
|
||||
#if !defined(__BORLANDC__)
|
||||
#if !defined(__BORLANDC__) && !defined(__WATCOMC__)
|
||||
// deletion when initialization fails
|
||||
void operator delete (void* p, Run* run);
|
||||
void operator delete[] (void* p, Run* run);
|
||||
@ -479,7 +479,7 @@ public:
|
||||
/// The Index() function creates an empty array index.
|
||||
Index ()
|
||||
{
|
||||
this->ptr = EMPTY_STRING;
|
||||
this->ptr = Value::getEmptyStr();
|
||||
this->len = 0;
|
||||
}
|
||||
|
||||
@ -650,7 +650,7 @@ public:
|
||||
|
||||
if (getStr (&p, &l) == -1)
|
||||
{
|
||||
p = EMPTY_STRING;
|
||||
p = getEmptyStr();
|
||||
l = 0;
|
||||
}
|
||||
|
||||
@ -778,7 +778,8 @@ public:
|
||||
qse_xstr_t str;
|
||||
} cached;
|
||||
|
||||
static const char_t* EMPTY_STRING;
|
||||
public:
|
||||
static const char_t* getEmptyStr();
|
||||
};
|
||||
|
||||
public:
|
||||
@ -1284,6 +1285,10 @@ protected:
|
||||
static void modclose (awk_t* awk, void* handle);
|
||||
static void* modsym (awk_t* awk, void* handle, const char_t* name);
|
||||
|
||||
public:
|
||||
// use this with care
|
||||
awk_t* getHandle() const { return this->awk; }
|
||||
|
||||
protected:
|
||||
awk_t* awk;
|
||||
|
||||
@ -1318,7 +1323,6 @@ private:
|
||||
|
||||
int init_runctx ();
|
||||
void fini_runctx ();
|
||||
|
||||
int dispatch_function (Run* run, const fnc_info_t* fi);
|
||||
|
||||
static const char_t* xerrstr (const awk_t* a, errnum_t num);
|
||||
|
@ -109,7 +109,7 @@ public:
|
||||
const char_t* ptr;
|
||||
};
|
||||
|
||||
StdAwk (Mmgr* mmgr = &StdMmgr::DFL):
|
||||
StdAwk (Mmgr* mmgr = StdMmgr::getDFL()):
|
||||
Awk (mmgr), console_cmgr (QSE_NULL)
|
||||
{
|
||||
}
|
||||
|
@ -34,8 +34,7 @@ public:
|
||||
void* reallocMem (void* ptr, size_t n);
|
||||
virtual void freeMem (void* ptr);
|
||||
|
||||
public:
|
||||
static StdMmgr DFL;
|
||||
static StdMmgr* getDFL();
|
||||
};
|
||||
|
||||
/////////////////////////////////
|
||||
|
@ -42,7 +42,7 @@
|
||||
* choice of the default character type #qse_char_t.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if defined(QSE_CHAR_IS_MCHAR)
|
||||
# define qse_main main
|
||||
# define QSE_ACHAR_IS_MCHAR
|
||||
|
@ -59,7 +59,9 @@
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# if !defined(QSE_CHAR_IS_WCHAR) && !defined(QSE_CHAR_IS_MCHAR)
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# endif
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#elif defined(__WATCOMC__) && !defined(__386__)
|
||||
@ -91,7 +93,9 @@
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# if !defined(QSE_CHAR_IS_WCHAR) && !defined(QSE_CHAR_IS_MCHAR)
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# endif
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#else
|
||||
|
@ -77,7 +77,9 @@ _M_X64 x64 platform
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# if !defined(QSE_CHAR_IS_WCHAR) && !defined(QSE_CHAR_IS_MCHAR)
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# endif
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#elif defined(__GNUC__) || defined(__DMC__) || defined(__POCC__)
|
||||
@ -113,7 +115,9 @@ _M_X64 x64 platform
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# if !defined(QSE_CHAR_IS_WCHAR) && !defined(QSE_CHAR_IS_MCHAR)
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# endif
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
@ -153,8 +157,50 @@ _M_X64 x64 platform
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# if !defined(QSE_CHAR_IS_WCHAR) && !defined(QSE_CHAR_IS_MCHAR)
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# endif
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
|
||||
# define QSE_SIZEOF_CHAR 1
|
||||
# define QSE_SIZEOF_SHORT 2
|
||||
# define QSE_SIZEOF_INT 4
|
||||
# define QSE_SIZEOF_LONG 4
|
||||
# define QSE_SIZEOF_LONG_LONG 0
|
||||
|
||||
# if defined(_WIN64)
|
||||
# define QSE_SIZEOF_VOID_P 8
|
||||
# else
|
||||
# define QSE_SIZEOF_VOID_P 4
|
||||
# endif
|
||||
# define QSE_SIZEOF_FLOAT 4
|
||||
# define QSE_SIZEOF_DOUBLE 8
|
||||
# define QSE_SIZEOF_LONG_DOUBLE 8
|
||||
# define QSE_SIZEOF_WCHAR_T 2
|
||||
|
||||
# define QSE_SIZEOF___INT8 1
|
||||
# define QSE_SIZEOF___INT16 2
|
||||
# define QSE_SIZEOF___INT32 4
|
||||
# define QSE_SIZEOF___INT64 8
|
||||
# define QSE_SIZEOF___INT128 0
|
||||
|
||||
# define QSE_SIZEOF_OFF64_T 0
|
||||
# define QSE_SIZEOF_OFF_T 8
|
||||
|
||||
# define QSE_SIZEOF_MBSTATE_T QSE_SIZEOF_LONG
|
||||
# define QSE_MBLEN_MAX 8
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# if !defined(QSE_CHAR_IS_WCHAR) && !defined(QSE_CHAR_IS_MCHAR)
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# endif
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#else
|
||||
# error Define the size of various data types.
|
||||
#endif
|
||||
|
@ -61,7 +61,10 @@
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# if !defined(QSE_CHAR_IS_WCHAR) && !defined(QSE_CHAR_IS_MCHAR)
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# endif
|
||||
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
@ -91,7 +94,9 @@
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# if !defined(QSE_CHAR_IS_WCHAR) && !defined(QSE_CHAR_IS_MCHAR)
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# endif
|
||||
# define QSE_ENABLE_BUNDLED_UNICODE 1
|
||||
|
||||
#else
|
||||
|
@ -243,7 +243,7 @@
|
||||
*/
|
||||
#define QSE_MT(txt) (txt)
|
||||
|
||||
#define QSE_WQ_I(val) (L ## QSE_MQ_I(val))
|
||||
#define QSE_WQ_I(val) (L ## #val)
|
||||
#define QSE_WQ(val) QSE_WQ_I(val)
|
||||
#define QSE_WC(ch) ((qse_wchar_t)L ## ch)
|
||||
#define QSE_WS(str) ((const qse_wchar_t*)L ## str)
|
||||
|
@ -37,7 +37,7 @@ QSE_BEGIN_NAMESPACE(QSE)
|
||||
/**
|
||||
* The Sed class implements a stream editor by wrapping around #qse_sed_t.
|
||||
*/
|
||||
class Sed: public Mmged
|
||||
class QSE_EXPORT Sed: public Mmged
|
||||
{
|
||||
public:
|
||||
/// The sed_t type redefines a stream editor type
|
||||
@ -63,7 +63,7 @@ public:
|
||||
/// The Stream class is a base class for I/O operation during
|
||||
/// execution.
|
||||
///
|
||||
class Stream: public Types
|
||||
class QSE_EXPORT Stream: public Types
|
||||
{
|
||||
public:
|
||||
/// The Mode type defines I/O modes.
|
||||
@ -74,7 +74,7 @@ public:
|
||||
};
|
||||
|
||||
/// The Data class conveys information need for I/O operations.
|
||||
class Data
|
||||
class QSE_EXPORT Data
|
||||
{
|
||||
public:
|
||||
friend class Sed;
|
||||
@ -86,27 +86,27 @@ public:
|
||||
public:
|
||||
/// The getMode() function returns the I/O mode
|
||||
/// requested.
|
||||
Mode getMode() const { return mode; }
|
||||
Mode getMode() const { return this->mode; }
|
||||
|
||||
/// The getHandle() function returns the I/O handle
|
||||
/// saved by setHandle().
|
||||
void* getHandle () const { return arg->handle; }
|
||||
void* getHandle () const { return this->arg->handle; }
|
||||
|
||||
/// The setHandle() function sets an I/O handle
|
||||
/// typically in the Stream::open() function.
|
||||
void setHandle (void* handle) { arg->handle = handle; }
|
||||
void setHandle (void* handle) { this->arg->handle = handle; }
|
||||
|
||||
/// The getName() function returns an I/O name.
|
||||
/// @return #QSE_NULL for the main data stream,
|
||||
/// file path for explicit file stream
|
||||
const char_t* getName () const { return arg->path; }
|
||||
const char_t* getName () const { return this->arg->path; }
|
||||
|
||||
/// The Sed* operator returns the associated Sed class.
|
||||
operator Sed* () const { return sed; }
|
||||
operator Sed* () const { return this->sed; }
|
||||
|
||||
/// The sed_t* operator returns a pointer to the
|
||||
/// underlying stream editor.
|
||||
operator sed_t* () const { return sed->sed; }
|
||||
operator sed_t* () const { return this->sed->getHandle(); }
|
||||
|
||||
protected:
|
||||
Sed* sed;
|
||||
@ -298,6 +298,10 @@ protected:
|
||||
errnum_t num ///< an error number
|
||||
) const;
|
||||
|
||||
public:
|
||||
// use this with care
|
||||
sed_t* getHandle() const { return this->sed; }
|
||||
|
||||
protected:
|
||||
/// handle to a primitive sed object
|
||||
sed_t* sed;
|
||||
|
@ -39,12 +39,12 @@ QSE_BEGIN_NAMESPACE(QSE)
|
||||
* I/O stream class, and sets the default memory manager.
|
||||
*
|
||||
*/
|
||||
class StdSed: public Sed
|
||||
class QSE_EXPORT StdSed: public Sed
|
||||
{
|
||||
public:
|
||||
StdSed (Mmgr* mmgr = &StdMmgr::DFL): Sed (mmgr) {}
|
||||
StdSed (Mmgr* mmgr = StdMmgr::getDFL()): Sed (mmgr) {}
|
||||
|
||||
class FileStream: public Stream
|
||||
class QSE_EXPORT FileStream: public Stream
|
||||
{
|
||||
public:
|
||||
FileStream (const char_t* infile = QSE_NULL,
|
||||
@ -65,7 +65,7 @@ public:
|
||||
qse_cmgr_t* cmgr;
|
||||
};
|
||||
|
||||
class StringStream: public Stream
|
||||
class QSE_EXPORT StringStream: public Stream
|
||||
{
|
||||
public:
|
||||
StringStream (const char_t* in);
|
||||
|
Reference in New Issue
Block a user