touched up some source files for borland and msvc.
added more options to bakefile description
This commit is contained in:
@ -86,8 +86,8 @@ Awk::RIOBase::operator Awk* () const
|
||||
|
||||
Awk::RIOBase::operator Awk::awk_t* () const
|
||||
{
|
||||
QSE_ASSERT (qse_awk_rtx_getawk(this->run->rtx) == this->run->awk->awk);
|
||||
return this->run->awk->awk;
|
||||
QSE_ASSERT (qse_awk_rtx_getawk(this->run->rtx) == this->run->awk->getHandle());
|
||||
return this->run->awk->getHandle();
|
||||
}
|
||||
|
||||
Awk::RIOBase::operator Awk::rio_arg_t* () const
|
||||
@ -191,9 +191,14 @@ Awk::Console::Mode Awk::Console::getMode () const
|
||||
// Awk::Value
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
const Awk::char_t* Awk::Value::EMPTY_STRING = QSE_T("");
|
||||
Awk::Value::IndexIterator Awk::Value::IndexIterator::END;
|
||||
|
||||
const Awk::char_t* Awk::Value::getEmptyStr()
|
||||
{
|
||||
static const Awk::char_t* EMPTY_STRING = QSE_T("");
|
||||
return EMPTY_STRING;
|
||||
}
|
||||
|
||||
Awk::Value::IntIndex::IntIndex (long_t x)
|
||||
{
|
||||
ptr = buf;
|
||||
@ -256,7 +261,7 @@ void* Awk::Value::operator new[] (size_t n, Run* run) throw ()
|
||||
return (char*)ptr+QSE_SIZEOF(run);
|
||||
}
|
||||
|
||||
#if !defined(__BORLANDC__)
|
||||
#if !defined(__BORLANDC__) && !defined(__WATCOMC__)
|
||||
void Awk::Value::operator delete (void* ptr, Run* run)
|
||||
{
|
||||
qse_awk_rtx_freemem (run->rtx, (char*)ptr-QSE_SIZEOF(run));
|
||||
@ -377,7 +382,7 @@ Awk::Value::operator const Awk::char_t* () const
|
||||
{
|
||||
const Awk::char_t* ptr;
|
||||
size_t len;
|
||||
if (Awk::Value::getStr (&ptr, &len) <= -1) ptr = EMPTY_STRING;
|
||||
if (Awk::Value::getStr (&ptr, &len) <= -1) ptr = getEmptyStr();
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@ -442,7 +447,7 @@ int Awk::Value::getNum (long_t* lv, flt_t* fv) const
|
||||
|
||||
int Awk::Value::getStr (const char_t** str, size_t* len) const
|
||||
{
|
||||
const char_t* p = EMPTY_STRING;
|
||||
const char_t* p = getEmptyStr();
|
||||
size_t l = 0;
|
||||
|
||||
QSE_ASSERT (this->val != QSE_NULL);
|
||||
|
@ -1387,11 +1387,11 @@ void* StdAwk::modopen (const mod_spec_t* spec)
|
||||
|
||||
#elif defined(__OS2__)
|
||||
|
||||
void* h;
|
||||
HMODULE h;
|
||||
qse_mchar_t* modpath;
|
||||
const qse_char_t* tmp[4];
|
||||
int count;
|
||||
UCHAR errbuf[CCHMAXPATH];
|
||||
char errbuf[CCHMAXPATH];
|
||||
|
||||
count = 0;
|
||||
if (spec->prefix) tmp[count++] = spec->prefix;
|
||||
@ -1414,8 +1414,8 @@ void* StdAwk::modopen (const mod_spec_t* spec)
|
||||
|
||||
QSE_MMGR_FREE (awk->mmgr, modpath);
|
||||
|
||||
QSE_ASSERT (QSE_SIZEOF(h) <= QSE_SIZEOF(void*));
|
||||
return h;
|
||||
QSE_ASSERT (QSE_SIZEOF(h) <= QSE_SIZEOF(void*));
|
||||
return (void*)h;
|
||||
|
||||
#elif defined(__DOS__)
|
||||
|
||||
|
@ -20,6 +20,22 @@
|
||||
|
||||
#include "awk.h"
|
||||
|
||||
#if !defined(QSE_AWK_DEFAULT_MODPREFIX)
|
||||
# if defined(_WIN32)
|
||||
# define QSE_AWK_DEFAULT_MODPREFIX "qseawk-"
|
||||
# elif defined(__OS2__)
|
||||
# define QSE_AWK_DEFAULT_MODPREFIX "awk-"
|
||||
# elif defined(__DOS__)
|
||||
# define QSE_AWK_DEFAULT_MODPREFIX "awk-"
|
||||
# else
|
||||
# define QSE_AWK_DEFAULT_MODPREFIX "libqseawk-"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(QSE_AWK_DEFAULT_MODPOSTFIX)
|
||||
# define QSE_AWK_DEFAULT_MODPOSTFIX ""
|
||||
#endif
|
||||
|
||||
enum tok_t
|
||||
{
|
||||
TOK_EOF,
|
||||
@ -6435,15 +6451,11 @@ static qse_awk_mod_t* query_module (
|
||||
|
||||
if (awk->opt.mod[0].len > 0)
|
||||
spec.prefix = awk->opt.mod[0].ptr;
|
||||
#if defined(QSE_AWK_DEFAULT_MODPREFIX)
|
||||
else spec.prefix = QSE_T(QSE_AWK_DEFAULT_MODPREFIX);
|
||||
#endif
|
||||
|
||||
if (awk->opt.mod[1].len > 0)
|
||||
spec.postfix = awk->opt.mod[1].ptr;
|
||||
#if defined(QSE_AWK_DEFAULT_MODPOSTFIX)
|
||||
else spec.postfix = QSE_T(QSE_AWK_DEFAULT_MODPOSTFIX);
|
||||
#endif
|
||||
|
||||
QSE_MEMSET (&md, 0, QSE_SIZEOF(md));
|
||||
if (awk->prm.modopen && awk->prm.modsym && awk->prm.modclose)
|
||||
|
@ -3170,9 +3170,7 @@ static qse_awk_val_t* eval_expression (qse_awk_rtx_t* rtx, qse_awk_nde_t* nde)
|
||||
{
|
||||
QSE_ASSERTX (
|
||||
rtx->inrec.d0->type == QSE_AWK_VAL_STR,
|
||||
"the internal value representing $0 should "
|
||||
"always be of the string type once it has "
|
||||
"been set/updated. it is nil initially.");
|
||||
"the internal value representing $0 should always be of the string type once it has been set/updated. it is nil initially.");
|
||||
|
||||
vs.ptr = ((qse_awk_val_str_t*)rtx->inrec.d0)->val.ptr;
|
||||
vs.len = ((qse_awk_val_str_t*)rtx->inrec.d0)->val.len;
|
||||
@ -4677,8 +4675,7 @@ static qse_awk_val_t* eval_binop_mod (
|
||||
qse_awk_val_t* res;
|
||||
|
||||
QSE_ASSERTX (rtx->awk->prm.math.mod != QSE_NULL,
|
||||
"the mod function must be provided when the awk object"
|
||||
" is created to be able to calculate floating-pointer remainder.");
|
||||
"the mod function must be provided when the awk object is created to be able to calculate floating-pointer remainder.");
|
||||
|
||||
n1 = qse_awk_rtx_valtonum (rtx, left, &l1, &r1);
|
||||
n2 = qse_awk_rtx_valtonum (rtx, right, &l2, &r2);
|
||||
@ -4736,8 +4733,7 @@ static qse_awk_val_t* eval_binop_exp (
|
||||
qse_awk_val_t* res;
|
||||
|
||||
QSE_ASSERTX (rtx->awk->prm.math.pow != QSE_NULL,
|
||||
"the pow function must be provided when the awk object"
|
||||
" is created to make exponentiation work properly.");
|
||||
"the pow function must be provided when the awk object is created to make exponentiation work properly.");
|
||||
|
||||
n1 = qse_awk_rtx_valtonum (rtx, left, &l1, &r1);
|
||||
n2 = qse_awk_rtx_valtonum (rtx, right, &l2, &r2);
|
||||
|
@ -380,7 +380,7 @@ static void* custom_awk_modopen (qse_awk_t* awk, const qse_awk_mod_spec_t* spec)
|
||||
qse_mchar_t* modpath;
|
||||
const qse_char_t* tmp[4];
|
||||
int count;
|
||||
UCHAR errbuf[CCHMAXPATH];
|
||||
char errbuf[CCHMAXPATH];
|
||||
APIRET rc;
|
||||
|
||||
count = 0;
|
||||
|
@ -882,8 +882,7 @@ void qse_awk_rtx_refdownval (qse_awk_rtx_t* rtx, qse_awk_val_t* val)
|
||||
#endif
|
||||
|
||||
QSE_ASSERTX (val->ref > 0,
|
||||
"the reference count of a value should be greater than zero for it "
|
||||
"to be decremented. check the source code for any bugs");
|
||||
"the reference count of a value should be greater than zero for it to be decremented. check the source code for any bugs");
|
||||
|
||||
val->ref--;
|
||||
if (val->ref <= 0)
|
||||
@ -897,8 +896,7 @@ void qse_awk_rtx_refdownval_nofree (qse_awk_rtx_t* rtx, qse_awk_val_t* val)
|
||||
if (IS_STATICVAL(val)) return;
|
||||
|
||||
QSE_ASSERTX (val->ref > 0,
|
||||
"the reference count of a value should be greater than zero for it"
|
||||
" to be decremented. check the source code for any bugs");
|
||||
"the reference count of a value should be greater than zero for it to be decremented. check the source code for any bugs");
|
||||
val->ref--;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user