* renamed udd to ctx in qse_mmgr_t

* fixed problems in build and test scripts
This commit is contained in:
2011-08-15 03:07:31 +00:00
parent f332efc288
commit 6e2dd10655
37 changed files with 328 additions and 149 deletions

View File

@ -1,2 +1,2 @@
SUBDIRS = cmn sed awk cut stx net
SUBDIRS = cmn sed awk cut net stx
DIST_SUBDIRS = $(SUBDIRS)

View File

@ -229,7 +229,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = cmn sed awk cut stx net
SUBDIRS = cmn sed awk cut net stx
DIST_SUBDIRS = $(SUBDIRS)
all: all-recursive

View File

@ -1,5 +1,5 @@
/*
* $Id: run.c 520 2011-07-25 07:32:49Z hyunghwan.chung $
* $Id: run.c 549 2011-08-14 09:07:31Z hyunghwan.chung $
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
@ -1892,7 +1892,7 @@ static int run_block0 (qse_awk_rtx_t* rtx, qse_awk_nde_blk_t* nde)
#define ON_STATEMENT(rtx,nde) \
if ((rtx)->awk->stopall) (rtx)->exit_level = EXIT_ABORT; \
if ((rtx)->rcb.stm) (rtx)->rcb.stm (rtx, nde, (rtx)->rcb.udd);
if ((rtx)->rcb.stm) (rtx)->rcb.stm (rtx, nde, (rtx)->rcb.ctx);
static int run_statement (qse_awk_rtx_t* rtx, qse_awk_nde_t* nde)
{

View File

@ -24,19 +24,19 @@
QSE_BEGIN_NAMESPACE(QSE)
/////////////////////////////////
void* Mmgr::alloc_mem (void* udd, size_t n)
void* Mmgr::alloc_mem (void* ctx, size_t n)
{
return ((Mmgr*)udd)->allocMem (n);
return ((Mmgr*)ctx)->allocMem (n);
}
void* Mmgr::realloc_mem (void* udd, void* ptr, size_t n)
void* Mmgr::realloc_mem (void* ctx, void* ptr, size_t n)
{
return ((Mmgr*)udd)->reallocMem (ptr, n);
return ((Mmgr*)ctx)->reallocMem (ptr, n);
}
void Mmgr::free_mem (void* udd, void* ptr)
void Mmgr::free_mem (void* ctx, void* ptr)
{
return ((Mmgr*)udd)->freeMem (ptr);
return ((Mmgr*)ctx)->freeMem (ptr);
}
/////////////////////////////////

View File

@ -1,5 +1,5 @@
/*
* $Id: mem.c 441 2011-04-22 14:28:43Z hyunghwan.chung $
* $Id: mem.c 549 2011-08-14 09:07:31Z hyunghwan.chung $
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
@ -19,7 +19,12 @@
*/
#include <qse/cmn/mem.h>
#include <stdlib.h>
#if defined(_WIN32)
# include <windows.h>
#else
# include <stdlib.h>
#endif
#if defined(__SPU__)
#include <spu_intrinsics.h>
@ -417,17 +422,40 @@ void* qse_memrmem (const void* hs, qse_size_t hl, const void* nd, qse_size_t nl)
static void* mmgr_alloc (void* data, qse_size_t n)
{
return malloc (n);
#if defined(_WIN32)
HANDLE heap;
heap = GetProcessHeap ();
if (heap == NULL) return QSE_NULL;
return HeapAlloc (heap, 0, n);
#else
/* TODO: need to rewrite this for __OS2__ using DosAllocMem()? */
return malloc (n);
#endif
}
static void* mmgr_realloc (void* data, void* ptr, qse_size_t n)
{
return realloc (ptr, n);
#if defined(_WIN32)
HANDLE heap;
heap = GetProcessHeap ();
if (heap == NULL) return QSE_NULL;
return ptr? HeapReAlloc (heap, 0, ptr, n):
HeapAlloc (heap, 0, n);
#else
return realloc (ptr, n);
#endif
}
static void mmgr_free (void* data, void* ptr)
{
free (ptr);
#if defined(_WIN32)
HANDLE heap;
heap = GetProcessHeap ();
if (heap) HeapFree (heap, 0, ptr);
#else
free (ptr);
#endif
}
static qse_mmgr_t builtin_mmgr =

View File

@ -10,6 +10,7 @@ libqsenet_la_SOURCES = \
http.c \
htre.c \
htrd.c \
httpd.h \
httpd.c \
httpd_task.c

View File

@ -247,6 +247,7 @@ libqsenet_la_SOURCES = \
http.c \
htre.c \
htrd.c \
httpd.h \
httpd.c \
httpd_task.c

View File

@ -178,7 +178,7 @@ next:
{
qse_char_t buf[256];
scm->prm.sprintf (
scm->prm.udd,
scm->prm.ctx,
buf, QSE_COUNTOF(buf),
QSE_T("%Lf"),
#ifdef __MINGW32__

View File

@ -8,6 +8,8 @@ AM_CPPFLAGS = \
lib_LTLIBRARIES = libqsestx.la
libqsestx_la_SOURCES = stx.c err.c hash.c mem.c obj.c sym.c dic.c cls.c boot.c par.c
libqsestx_la_SOURCES = \
stx.h hash.h mem.h obj.h sym.h dic.h cls.h boot.h \
stx.c err.c hash.c mem.c obj.c sym.c dic.c cls.c boot.c par.c
libqsestx_la_LDFLAGS = -L../cmn -L$(libdir) -version-info 1:0:0 -no-undefined
libqsestx_la_LIBADD = -lqsecmn

View File

@ -243,7 +243,10 @@ AM_CPPFLAGS = \
-I$(includedir)
lib_LTLIBRARIES = libqsestx.la
libqsestx_la_SOURCES = stx.c err.c hash.c mem.c obj.c sym.c dic.c cls.c boot.c par.c
libqsestx_la_SOURCES = \
stx.h hash.h mem.h obj.h sym.h dic.h cls.h boot.h \
stx.c err.c hash.c mem.c obj.c sym.c dic.c cls.c boot.c par.c
libqsestx_la_LDFLAGS = -L../cmn -L$(libdir) -version-info 1:0:0 -no-undefined
libqsestx_la_LIBADD = -lqsecmn
all: all-am