touched up qse_task_t

This commit is contained in:
hyung-hwan 2012-10-15 09:36:39 +00:00
parent 55ee23a255
commit b907296f4a
48 changed files with 1054 additions and 663 deletions

View File

@ -17,6 +17,7 @@
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#if 0
#include <qse/sed/std.h>
#include <qse/cmn/str.h>
@ -1037,3 +1038,6 @@ int qse_main (int argc, qse_achar_t* argv[])
return qse_runmain (argc, argv, sed_main);
}
#endif
#include "../../samples/cmn/task01.c"

8
qse/configure vendored
View File

@ -18587,13 +18587,13 @@ fi
if test "$enable_debug_is" = "yes"
then
CFLAGS="$CFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG"
CXXFLAGS="$CXXFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG"
CFLAGS="$CFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG -U_FORTIFY_SOURCE"
CXXFLAGS="$CXXFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG -U_FORTIFY_SOURCE"
BUILD_MODE="debug"
else
CFLAGS="$CFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE"
CXXFLAGS="$CXXFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE"
CFLAGS="$CFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE -U_FORTIFY_SOURCE"
CXXFLAGS="$CXXFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE -U_FORTIFY_SOURCE"
BUILD_MODE="release"
fi

View File

@ -332,12 +332,12 @@ AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],[build the library in th
enable_debug_is=$enableval,enable_debug_is=no)
if test "$enable_debug_is" = "yes"
then
[CFLAGS="$CFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG"]
[CXXFLAGS="$CXXFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG"]
[CFLAGS="$CFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG -U_FORTIFY_SOURCE"]
[CXXFLAGS="$CXXFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG -U_FORTIFY_SOURCE"]
AC_SUBST(BUILD_MODE, "debug")
else
[CFLAGS="$CFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE"]
[CXXFLAGS="$CXXFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE"]
[CFLAGS="$CFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE -U_FORTIFY_SOURCE"]
[CXXFLAGS="$CXXFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE -U_FORTIFY_SOURCE"]
AC_SUBST(BUILD_MODE, "release")
fi

View File

@ -24,28 +24,55 @@
#include <qse/types.h>
#include <qse/macros.h>
typedef void (*qse_task_fnc_t) (void* ctx);
typedef struct qse_task_t qse_task_t;
typedef struct qse_task_slice_t qse_task_slice_t;
typedef qse_task_slice_t* (*qse_task_fnc_t) (
qse_task_t* task,
qse_task_slice_t* slice,
void* ctx
);
#ifdef __cplusplus
extern "C" {
#endif
int qse_gettaskid (
qse_task_t* qse_task_open (
qse_mmgr_t* mmgr,
qse_size_t xtnsize
);
void qse_task_close (
qse_task_t* task
);
qse_task_t* qse_maketask (
qse_mmgr_t* qse_task_getmmgr (
qse_task_t* task
);
void* qse_task_getxtn (
qse_task_t* task
);
qse_task_slice_t* qse_task_create (
qse_task_t* task,
qse_task_fnc_t fnc,
void* ctx,
qse_size_t stsize
qse_size_t stksize
);
int qse_task_boot (
void
qse_task_t* task,
qse_task_slice_t* to
);
void qse_task_schedule (
qse_task_t* task,
qse_task_slice_t* from,
qse_task_slice_t* to
);
#ifdef __cplusplus
}
#endif

View File

@ -105,15 +105,14 @@
* The QSE_OFFSETOF() macro returns the offset of a field from the beginning
* of a structure.
*/
#define QSE_OFFSETOF(type,member) \
((qse_size_t)&((type*)0)->member)
#define QSE_OFFSETOF(type,member) ((qse_size_t)&((type*)0)->member)
/**
* The QSE_ALIGNOF() macro returns the alignment size of a structure.
* Note that this macro may not work reliably depending on the type given.
*/
#define QSE_ALIGNOF(type) QSE_OFFSETOF(struct { qse_uint8_t d1; type d2 }, d2)
/*(sizeof(struct { qse_uint8_t d1; type d2 }) - sizeof(type))*/
#define QSE_ALIGNOF(type) QSE_OFFSETOF(struct { qse_uint8_t d1; type d2; }, d2)
/*(sizeof(struct { qse_uint8_t d1; type d2; }) - sizeof(type))*/
/**
* The QSE_TYPE_IS_SIGNED() macro determines if a type is signed.

View File

@ -1244,15 +1244,21 @@ qse_long_t qse_awk_rtx_hashval (qse_awk_rtx_t* rtx, qse_awk_val_t* v)
case QSE_AWK_VAL_INT:
/*hv = ((qse_awk_val_int_t*)v)->val;*/
hv = (qse_long_t)hash (&((qse_awk_val_int_t*)v)->val, QSE_SIZEOF(((qse_awk_val_int_t*)v)->val));
hv = (qse_long_t)hash (
(qse_uint8_t*)&((qse_awk_val_int_t*)v)->val,
QSE_SIZEOF(((qse_awk_val_int_t*)v)->val));
break;
case QSE_AWK_VAL_FLT:
hv = (qse_long_t)hash (&((qse_awk_val_flt_t*)v)->val, QSE_SIZEOF(((qse_awk_val_flt_t*)v)->val));
hv = (qse_long_t)hash (
(qse_uint8_t*)&((qse_awk_val_flt_t*)v)->val,
QSE_SIZEOF(((qse_awk_val_flt_t*)v)->val));
break;
case QSE_AWK_VAL_STR:
hv = (qse_long_t)hash (((qse_awk_val_str_t*)v)->val.ptr, ((qse_awk_val_str_t*)v)->val.len * QSE_SIZEOF(qse_char_t));
hv = (qse_long_t)hash (
(qse_uint8_t*)((qse_awk_val_str_t*)v)->val.ptr,
((qse_awk_val_str_t*)v)->val.len * QSE_SIZEOF(qse_char_t));
break;
default:

View File

@ -31,38 +31,36 @@ int qse_runmain (
return handler (argc, (qse_char_t**)argv);
#else
int i, ret;
qse_char_t** v;
qse_mmgr_t* mmgr = QSE_MMGR_GETDFL ();
v = (qse_char_t**) QSE_MMGR_ALLOC (
mmgr, (argc + 1) * QSE_SIZEOF(qse_char_t*));
if (v == QSE_NULL) return -1;
for (i = 0; i < argc + 1; i++) v[i] = QSE_NULL;
for (i = 0; i < argc; i++)
{
int i, ret;
qse_char_t** v;
qse_mmgr_t* mmgr = QSE_MMGR_GETDFL ();
v = (qse_char_t**) QSE_MMGR_ALLOC (
mmgr, (argc + 1) * QSE_SIZEOF(qse_char_t*));
if (v == QSE_NULL) return -1;
for (i = 0; i < argc + 1; i++) v[i] = QSE_NULL;
for (i = 0; i < argc; i++)
v[i]= qse_mbstowcsalldup (argv[i], mmgr);
if (v[i] == QSE_NULL)
{
v[i]= qse_mbstowcsalldup (argv[i], mmgr);
if (v[i] == QSE_NULL)
{
ret = -1;
goto oops;
}
ret = -1;
goto oops;
}
ret = handler (argc, v);
oops:
for (i = 0; i < argc + 1; i++)
{
if (v[i] != QSE_NULL) QSE_MMGR_FREE (mmgr, v[i]);
}
QSE_MMGR_FREE (mmgr, v);
return ret;
}
ret = handler (argc, v);
oops:
for (i = 0; i < argc + 1; i++)
{
if (v[i] != QSE_NULL) QSE_MMGR_FREE (mmgr, v[i]);
}
QSE_MMGR_FREE (mmgr, v);
return ret;
#endif
}
@ -72,50 +70,47 @@ int qse_runmainwithenv (
{
#if (defined(QSE_ACHAR_IS_MCHAR) && defined(QSE_CHAR_IS_MCHAR)) || \
(defined(QSE_ACHAR_IS_WCHAR) && defined(QSE_CHAR_IS_WCHAR))
{
return handler (argc, (qse_char_t**)argv, (qse_char_t**)envp);
}
return handler (argc, (qse_char_t**)argv, (qse_char_t**)envp);
#else
int i, ret, envc;
qse_char_t** v;
qse_mmgr_t* mmgr = QSE_MMGR_GETDFL ();
if (envp) for (envc = 0; envp[envc]; envc++) ; /* count the number of env items */
else envc = 0;
v = (qse_char_t**) QSE_MMGR_ALLOC (
mmgr, (argc + 1 + envc + 1) * QSE_SIZEOF(qse_char_t*));
if (v == QSE_NULL) return -1;
for (i = 0; i < argc + 1 + envc + 1; i++) v[i] = QSE_NULL;
for (i = 0; i < argc + 1 + envc; i++)
{
int i, ret, envc;
qse_char_t** v;
qse_mmgr_t* mmgr = QSE_MMGR_GETDFL ();
qse_achar_t* x;
for (envc = 0; envp[envc]; envc++) ; /* count the number of env items */
if (i < argc) x = argv[i];
else if (i == argc) continue;
else x = envp[i - argc - 1];
v = (qse_char_t**) QSE_MMGR_ALLOC (
mmgr, (argc + 1 + envc + 1) * QSE_SIZEOF(qse_char_t*));
if (v == QSE_NULL) return -1;
for (i = 0; i < argc + 1 + envc + 1; i++) v[i] = QSE_NULL;
for (i = 0; i < argc + 1 + envc; i++)
v[i]= qse_mbstowcsalldup (x, mmgr);
if (v[i] == QSE_NULL)
{
qse_achar_t* x;
if (i < argc) x = argv[i];
else if (i == argc) continue;
else x = envp[i - argc - 1];
v[i]= qse_mbstowcsalldup (x, mmgr);
if (v[i] == QSE_NULL)
{
ret = -1;
goto oops;
}
ret = -1;
goto oops;
}
ret = handler (argc, v, &v[argc + 1]);
oops:
for (i = 0; i < argc + 1 + envc + 1; i++)
{
if (v[i] != QSE_NULL) QSE_MMGR_FREE (mmgr, v[i]);
}
QSE_MMGR_FREE (mmgr, v);
return ret;
}
ret = handler (argc, v, &v[argc + 1]);
oops:
for (i = 0; i < argc + 1 + envc + 1; i++)
{
if (v[i] != QSE_NULL) QSE_MMGR_FREE (mmgr, v[i]);
}
QSE_MMGR_FREE (mmgr, v);
return ret;
#endif
}

View File

@ -19,250 +19,254 @@
*/
#include <qse/cmn/task.h>
#include "mem.h"
#if defined(_WIN64)
# include <windows.h>
#else
# include <setjmp.h>
# if defined(HAVE_UCONTEXT_H)
# include <ucontext.h>
# endif
# include <setjmp.h>
# if defined(HAVE_MAKECONTEXT) && defined(HAVE_SWAPCONTEXT) && \
defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT)
# define USE_UCONTEXT
# endif
#endif
typedef struct tmgr_t tmgr_t;
struct tmgr_t
struct qse_task_t
{
int count;
int idinc;
qse_mmgr_t* mmgr;
qse_task_t* dead;
qse_task_t* current;
qse_task_t* head;
qse_task_t* tail;
qse_task_slice_t* dead;
qse_task_slice_t* current;
qse_size_t count;
qse_task_slice_t* head;
qse_task_slice_t* tail;
#if defined(_WIN64)
void* fiber;
#elif defined(HAVE_SWAPCONTEXT)
#elif defined(USE_UCONTEXT)
ucontext_t uctx;
#else
jmp_buf backjmp;
#endif
};
struct qse_task_t
struct qse_task_slice_t
{
/* queue */
tmgr_t* tmgr;
int id;
qse_task_fnc_t fnc;
void* ctx;
qse_size_t stsize;
#if defined(_WIN64)
void* fiber;
#elif defined(HAVE_SWAPCONTEXT)
#elif defined(USE_UCONTEXT)
ucontext_t uctx;
#else
jmp_buf jmpbuf;
#endif
qse_task_t* prev;
qse_task_t* next;
qse_task_t* task;
int id;
qse_task_fnc_t fnc;
void* ctx;
qse_size_t stksize;
qse_task_slice_t* prev;
qse_task_slice_t* next;
};
static tmgr_t* tmgr;
int qse_task_init (qse_task_t* task, qse_mmgr_t* mmgr);
void qse_task_fini (qse_task_t* task);
qse_task_t* qse_task_alloc (qse_task_fnc_t fnc, void* ctx, qse_size_t stsize)
static void purge_slice (qse_task_t* task, qse_task_slice_t* slice);
static void purge_dead_slices (qse_task_t* task);
static void purge_current_slice (qse_task_slice_t* slice, qse_task_slice_t* to);
qse_task_t* qse_task_open (qse_mmgr_t* mmgr, qse_size_t xtnsize)
{
qse_task_t* task;
task = malloc (QSE_SIZEOF(*task) + stsize);
task = QSE_MMGR_ALLOC (mmgr, QSE_SIZEOF(*task) + xtnsize);
if (task == QSE_NULL) return QSE_NULL;
//QSE_MEMSET (task, 0, QSE_SIZEOF(*task));
QSE_MEMSET (task, 0, QSE_SIZEOF(*task) + stsize);
task->tmgr = tmgr;
task->fnc = fnc;
task->ctx = ctx;
task->stsize = stsize;
if (tmgr->head)
if (qse_task_init (task, mmgr) <= -1)
{
task->next= tmgr->head;
tmgr->head->prev = task;
tmgr->head = task;
}
else
{
tmgr->head = task;
tmgr->tail = task;
QSE_MMGR_FREE (task->mmgr, task);
return QSE_NULL;
}
task->id = tmgr->idinc;
tmgr->count++;
tmgr->idinc++;
QSE_MEMSET (task + 1, 0, xtnsize);
return task;
}
static void purge_dead_tasks (void)
void qse_task_close (qse_task_t* task)
{
qse_task_t* x;
qse_task_fini (task);
QSE_MMGR_FREE (task->mmgr, task);
}
while (tmgr->dead)
int qse_task_init (qse_task_t* task, qse_mmgr_t* mmgr)
{
QSE_MEMSET (task, 0, QSE_SIZEOF(*task));
task->mmgr = mmgr;
return 0;
}
void qse_task_fini (qse_task_t* task)
{
QSE_ASSERT (task->dead == QSE_NULL);
QSE_ASSERT (task->current == QSE_NULL);
if (task->count > 0)
{
x = tmgr->dead;
tmgr->dead = x->next;
#if defined(_WIN64)
DeleteFiber (x->fiber);
#endif
free (x);
/* am i closing after boot failure? */
qse_task_slice_t* slice, * next;
slice = task->head;
while (slice)
{
next = slice->next;
purge_slice (task, slice);
slice = next;
}
task->count = 0;
task->head = QSE_NULL;
task->tail = QSE_NULL;
}
}
void qse_task_schedule (void)
qse_mmgr_t* qse_task_getmmgr (qse_task_t* task)
{
qse_task_t* current;
return task->mmgr;
}
current = tmgr->current; /* old current */
tmgr->current = current->next? current->next: tmgr->head;
#if defined(_WIN64)
/* current->fiber is handled by SwitchToFiber() implicitly */
SwitchToFiber (tmgr->current->fiber);
purge_dead_tasks ();
#elif defined(HAVE_SWAPCONTEXT)
swapcontext (&current->uctx, &tmgr->current->uctx);
purge_dead_tasks ();
#else
//printf ("switch from %d to %d\n", current->id, tmgr->current->id);
if (setjmp (current->jmpbuf) != 0)
void* qse_task_getxtn (qse_task_t* task)
{
return (void*)(task + 1);
}
static qse_task_slice_t* alloc_slice (
qse_task_t* task, qse_task_fnc_t fnc,
void* ctx, qse_size_t stksize)
{
qse_task_slice_t* slice;
slice = QSE_MMGR_ALLOC (task->mmgr, QSE_SIZEOF(*slice) + stksize);
if (slice == QSE_NULL) return QSE_NULL;
QSE_MEMSET (slice, 0, QSE_SIZEOF(*slice));
slice->task = task;
slice->fnc = fnc;
slice->ctx = ctx;
slice->stksize = stksize;
return slice;
}
static void link_task (qse_task_t* task, qse_task_slice_t* slice)
{
if (task->head)
{
purge_dead_tasks ();
return;
slice->next = task->head;
task->head->prev = slice;
task->head = slice;
}
longjmp (tmgr->current->jmpbuf, 1);
#endif
}
static void purge_current_task (void)
{
qse_task_t* current;
if (tmgr->count == 1)
else
{
/* to purge later */
tmgr->current->next = tmgr->dead;
tmgr->dead = tmgr->current;
tmgr->current = QSE_NULL;
tmgr->head = QSE_NULL;
tmgr->tail = QSE_NULL;
tmgr->count = 0;
tmgr->idinc = 0;
#if defined(_WIN64)
SwitchToFiber (tmgr->fiber);
#elif defined(HAVE_SWAPCONTEXT)
setcontext (&tmgr->uctx);
#else
longjmp (tmgr->backjmp, 1);
#endif
assert (!"must not reach here....");
task->head = slice;
task->tail = slice;
}
current = tmgr->current;
tmgr->current = current->next? current->next: tmgr->head;
if (current->prev) current->prev->next = current->next;
if (current->next) current->next->prev = current->prev;
if (current == tmgr->head) tmgr->head = current->next;
if (current == tmgr->tail) tmgr->tail = current->prev;
tmgr->count--;
/* to purge later */
current->next = tmgr->dead;
tmgr->dead = current;
task->count++;
}
#if defined(_WIN64)
SwitchToFiber (tmgr->current->fiber);
#elif defined(HAVE_SWAPCONTEXT)
setcontext (&tmgr->current->uctx);
# define __CALL_BACK__ __stdcall
#else
longjmp (tmgr->current->jmpbuf, 1);
# define __CALL_BACK__
#endif
}
#if defined(_WIN64)
static void __stdcall execute_current_task (void* task)
static void __CALL_BACK__ execute_current_slice (qse_task_slice_t* slice)
{
assert (tmgr->current != QSE_NULL);
tmgr->current->fnc (tmgr->current->ctx);
purge_current_task ();
}
#else
qse_task_slice_t* to;
static void execute_current_task (void)
{
assert (tmgr->current != QSE_NULL);
tmgr->current->fnc (tmgr->current->ctx);
QSE_ASSERT (slice->task->current == slice);
to = slice->fnc (slice->task, slice, slice->ctx);
/* the task function is now terminated. we need to
* purge it from the task list */
purge_current_task ();
* purge it from the slice list and switch to the next
* slice. */
purge_current_slice (slice, to);
QSE_ASSERT (!"must never reach here...");
}
#endif
static qse_task_t* xxtask;
static void* xxoldsp;
#if defined(__WATCOMC__)
/* for watcom, i support i386/32bit only */
extern void* set_sp (void*);
#pragma aux set_sp = \
"xchg eax, esp" \
extern void* prepare_sp (void*);
#pragma aux prepare_sp = \
"mov dword ptr[eax+4], esp" \
"mov esp, eax" \
"mov eax, dword ptr[esp+0]" \
parm [eax] value [eax] modify [esp]
extern void* restore_sp (void);
#pragma aux restore_sp = \
"mov esp, dword ptr[esp+4]" \
modify [esp]
extern void* get_slice (void);
#pragma aux get_slice = \
"mov eax, dword ptr[esp+0]" \
value [eax]
#endif
qse_task_t* qse_maketask (qse_task_fnc_t fnc, void* ctx, qse_size_t stsize)
qse_task_slice_t* qse_task_create (
qse_task_t* task, qse_task_fnc_t fnc,
void* ctx, qse_size_t stksize)
{
qse_task_t* task;
void* newsp;
qse_task_slice_t* slice;
register void* tmp;
stksize = ((stksize + QSE_SIZEOF(void*) - 1) / QSE_SIZEOF(void*)) * QSE_SIZEOF(void*);
#if defined(_WIN64)
task = qse_task_alloc (fnc, ctx, 0);
if (task == QSE_NULL) return QSE_NULL;
slice = alloc_slice (task, fnc, ctx, 0);
if (slice == QSE_NULL) return QSE_NULL;
task->fiber = CreateFiberEx (stsize, stsize, FIBER_FLAG_FLOAT_SWITCH, execute_current_task, QSE_NULL);
if (task->fiber == QSE_NULL)
slice->fiber = CreateFiberEx (
stksize, stksize, FIBER_FLAG_FLOAT_SWITCH,
execute_current_slice, slice);
if (slice->fiber == QSE_NULL)
{
/* TODO: delete task */
QSE_MMGR_FREE (task->mmgr, slice);
return QSE_NULL;
}
#elif defined(HAVE_SWAPCONTEXT)
#elif defined(USE_UCONTEXT)
task = qse_task_alloc (fnc, ctx, stsize);
if (task == QSE_NULL) return QSE_NULL;
slice = alloc_slice (task, fnc, ctx, stksize);
if (slice == QSE_NULL) return QSE_NULL;
if (getcontext (&task->uctx) <= -1)
if (getcontext (&slice->uctx) <= -1)
{
/* TODO: delete task */
QSE_MMGR_FREE (task->mmgr, slice);
return QSE_NULL;
}
task->uctx.uc_stack.ss_sp = task + 1;
task->uctx.uc_stack.ss_size = stsize;
task->uctx.uc_link = QSE_NULL;
makecontext (&task->uctx, execute_current_task, 0);
slice->uctx.uc_stack.ss_sp = slice + 1;
slice->uctx.uc_stack.ss_size = stksize;
slice->uctx.uc_link = QSE_NULL;
makecontext (&slice->uctx, execute_current_slice, 1, slice);
#else
task = qse_task_alloc (fnc, ctx, stsize);
if (task == QSE_NULL) return QSE_NULL;
if (stksize < QSE_SIZEOF(void*) * 3)
stksize = QSE_SIZEOF(void*) * 3; /* for t1 & t2 */
slice = alloc_slice (task, fnc, ctx, stksize);
if (slice == QSE_NULL) return QSE_NULL;
/* setjmp() doesn't allow different stacks for
* each execution content. let me use some assembly
@ -271,71 +275,65 @@ qse_task_t* qse_maketask (qse_task_fnc_t fnc, void* ctx, qse_size_t stsize)
*
* this stack is used for the task function when
* longjmp() is made. */
xxtask = task;
newsp = ((qse_uint8_t*)(task + 1)) + stsize - QSE_SIZEOF(void*);
tmp = ((qse_uint8_t*)(slice + 1)) + stksize - QSE_SIZEOF(void*);
tmp = (qse_uint8_t*)tmp - QSE_SIZEOF(void*);
*(void**)tmp = NULL; /* t1 */
tmp = (qse_uint8_t*)tmp - QSE_SIZEOF(void*);
*(void**)tmp = slice; /* t2 */
#if defined(__WATCOMC__)
xxoldsp = set_sp (newsp);
tmp = prepare_sp (tmp);
#elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64))
/*
__asm__ volatile (
"xchgq %0, %%rsp\n"
: "=r"(xxoldsp)
: "0"(newsp)
: "%rsp"
);
*/
__asm__ volatile (
"movq %%rsp, %0\n\t"
"movq %1, %%rsp\n"
: "=m"(xxoldsp)
: "r"(newsp)
"movq %%rsp, 8(%1)\n\t" /* t1 = %rsp */
"movq %1, %%rsp\n\t" /* %rsp = tmp */
"movq 0(%%rsp), %0\n" /* tmp = t2 */
: "=r"(tmp)
: "0"(tmp)
: "%rsp", "memory"
);
#elif defined(__GNUC__) && (defined(__i386) || defined(i386))
__asm__ volatile (
"xchgl %0, %%esp\n"
: "=r"(xxoldsp)
: "0"(newsp)
: "%esp"
"movl %%esp, 4(%1)\n\t" /* t1 = %esp */
"movl %1, %%esp\n\t" /* %esp = tmp */
"movl 0(%%esp), %0\n" /* tmp = t2 */
: "=r"(tmp)
: "0"(tmp)
: "%esp", "memory"
);
#elif defined(__GNUC__) && (defined(__mips) || defined(mips))
__asm__ volatile (
"sw $sp, %0\n\t" /* store $sp to xxoldsp */
"move $sp, %1\n" /* move the register content for newsp to $sp */
: "=m"(xxoldsp)
: "r"(newsp)
"sw $sp, 4(%1)\n\t" /* t1 = $sp */
"move $sp, %1\n\t" /* %sp = tmp */
"lw %0, 0($sp)\n" /* tmp = t2 */
: "=r"(tmp)
: "0"(tmp)
: "$sp", "memory"
);
/*
__asm__ volatile (
"move %0, $sp\n\t"
"move $sp, %1\n"
: "=&r"(xxoldsp)
: "r"(newsp)
: "$sp", "memory"
);
*/
#elif defined(__GNUC__) && defined(__arm__)
__asm__ volatile (
"str sp, %0\n\t"
"mov sp, %1\n"
: "=m"(xxoldsp)
: "r"(newsp)
"str sp, [%1, #4]\n\t" /* t1 = sp */
"mov sp, %1\n" /* sp = tmp */
"ldr %0, [sp, #0]\n" /* tmp = t2 */
: "=r"(tmp)
: "0"(tmp)
: "sp", "memory"
);
/* TODO: support more architecture */
#else
/* TODO: support more architecture */
/* TODO: destroy task */
//tmgr->errnum = QSE_TMGR_ENOIMPL;
QSE_MMGR_FREE (task->mmgr, task);
return QSE_NULL;
#endif /* __WATCOMC__ */
@ -349,112 +347,254 @@ qse_task_t* qse_maketask (qse_task_fnc_t fnc, void* ctx, qse_size_t stsize)
* this approach makes this function thread-unsafe.
*/
/* when qse_maketask() is called,
/* when qse_task_task_create() is called,
* setjmp() saves the context and return 0.
*
* subsequently, when longjmp() is made
* for this saved context, setjmp() returns
* a non-zero value.
*/
if (setjmp (xxtask->jmpbuf) != 0)
if (setjmp (((qse_task_slice_t*)tmp)->jmpbuf) != 0)
{
/* longjmp() is made to here. */
execute_current_task ();
assert (!"must never reach here....\n");
#if defined(__WATCOMC__)
tmp = get_slice ();
#elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64))
__asm__ volatile (
"movq 0(%%rsp), %0\n" /* tmp = t2 */
: "=r"(tmp)
);
#elif defined(__GNUC__) && (defined(__i386) || defined(i386))
__asm__ volatile (
"movl 0(%%esp), %0\n" /* tmp = t2 */
: "=r"(tmp)
);
#elif defined(__GNUC__) && (defined(__mips) || defined(mips))
__asm__ volatile (
"lw %0, 0($sp)\n" /* tmp = t2 */
: "=r"(tmp)
);
#elif defined(__GNUC__) && defined(__arm__)
__asm__ volatile (
"ldr %0, [sp, #0]\n" /* tmp = t2 */
: "=r"(tmp)
);
#endif /* __WATCOMC__ */
execute_current_slice ((qse_task_slice_t*)tmp);
QSE_ASSERT (!"must never reach here....\n");
}
/* restore the stack pointer once i finish saving the longjmp() context.
* this part is reached only when qse_maketask() is invoked. */
* this part is reached only when qse_task_task_create() is invoked. */
#if defined(__WATCOMC__)
set_sp (xxoldsp);
restore_sp ();
#elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64))
/* i assume that %rsp didn't change after the call to setjmp() */
__asm__ volatile (
"movq %0, %%rsp\n"
:
: "m"(xxoldsp) /*"r"(xxoldsp)*/
: "%rsp"
"movq 8(%%rsp), %%rsp\n" /* %rsp = t1 */
:
:
: "%rsp"
);
#elif defined(__GNUC__) && (defined(__i386) || defined(i386))
__asm__ volatile (
"movl %0, %%esp\n"
:
: "r"(xxoldsp)
: "%esp"
"movl 4(%%esp), %%esp\n" /* %esp = t1 */
:
:
: "%esp"
);
#elif defined(__GNUC__) && (defined(__mips) || defined(mips))
__asm__ volatile (
"lw $sp, %0\n" /*"move $sp, %0\n" */
:
: "m"(xxoldsp) /* "r"(xxoldsp) */
"lw $sp, 4($sp)\n" /* $sp = t1 */
:
:
: "$sp"
);
#elif defined(__GNUC__) && defined(__arm__)
__asm__ volatile (
"ldr sp, %0\n"
:
: "m"(xxoldsp)
"ldr sp, [sp, #4]\n" /* sp = t1 */
:
:
: "sp"
);
#endif /* __WATCOMC__ */
#endif
return task;
link_task (task, slice);
return slice;
}
int qse_gettaskid (qse_task_t* task)
int qse_task_boot (qse_task_t* task, qse_task_slice_t* to)
{
return task->id;
}
QSE_ASSERT (task->current == QSE_NULL);
int qse_task_boot (void)
{
if (tmgr->count <= 0) return -1;
if (to == QSE_NULL) to = task->head;
#if defined(_WIN64)
tmgr->fiber = ConvertThreadToFiberEx (QSE_NULL, FIBER_FLAG_FLOAT_SWITCH);
if (tmgr->fiber == QSE_NULL)
{
/*TODO: destroy all the tasks created */
return -1;
}
task->fiber = ConvertThreadToFiberEx (QSE_NULL, FIBER_FLAG_FLOAT_SWITCH);
if (task->fiber == QSE_NULL) return -1;
tmgr->current = tmgr->tail;
SwitchToFiber (tmgr->current->fiber);
task->current = to;
SwitchToFiber (task->current->fiber);
ConvertFiberToThread ();
#elif defined(HAVE_SWAPCONTEXT)
#elif defined(USE_UCONTEXT)
tmgr->current = tmgr->tail;
if (swapcontext (&tmgr->uctx, &tmgr->current->uctx) <= -1)
task->current = to;
if (swapcontext (&task->uctx, &task->current->uctx) <= -1)
{
/*TODO: destroy all the tasks created */
task->current = QSE_NULL;
return -1;
}
#else
if (setjmp (tmgr->backjmp) != 0)
if (setjmp (task->backjmp) != 0)
{
/* longjmp() back */
goto done;
}
tmgr->current = tmgr->tail;
longjmp (tmgr->current->jmpbuf, 1);
assert (!"must never reach here");
task->current = to;
longjmp (task->current->jmpbuf, 1);
QSE_ASSERT (!"must never reach here");
done:
#endif
assert (tmgr->current == QSE_NULL);
assert (tmgr->count == 0);
QSE_ASSERT (task->current == QSE_NULL);
QSE_ASSERT (task->count == 0);
purge_dead_tasks ();
printf ("END OF TASK_BOOT...\n");
if (task->dead) purge_dead_slices (task);
return 0;
}
/* NOTE for __WATCOMC__.
when the number of parameters are more than 2 for qse_task_schedule(),
this setjmp()/longjmp() based tasking didn't work.
if i change this to
void qse_task_schedule (qse_task_slice_t* from, qse_task_slice_t* to)
{
qse_task_t* task = from->task
....
}
it worked. i stopped investigating this problem. so i don't know the
real cause of this problem. let me get back to this later when i have
time for this.
*/
void qse_task_schedule (
qse_task_t* task, qse_task_slice_t* from, qse_task_slice_t* to)
{
QSE_ASSERT (from != QSE_NULL);
if (to == QSE_NULL)
{
/* round-robin if the target is not specified */
to = from->next? from->next: task->head;
}
QSE_ASSERT (task == to->task);
QSE_ASSERT (task == from->task);
QSE_ASSERT (task->current == from);
if (to == from) return;
task->current = to;
#if defined(_WIN64)
/* current->fiber is handled by SwitchToFiber() implicitly */
SwitchToFiber (to->fiber);
if (task->dead) purge_dead_slices (task);
#elif defined(USE_UCONTEXT)
swapcontext (&from->uctx, &to->uctx);
if (task->dead) purge_dead_slices (task);
#else
if (setjmp (from->jmpbuf) != 0)
{
if (task->dead) purge_dead_slices (task);
return;
}
longjmp (to->jmpbuf, 1);
#endif
}
static void purge_dead_slices (qse_task_t* task)
{
qse_task_slice_t* slice;
while (task->dead)
{
slice = task->dead;
task->dead = slice->next;
purge_slice (task, slice);
}
}
static void purge_slice (qse_task_t* task, qse_task_slice_t* slice)
{
#if defined(_WIN64)
if (slice->fiber) DeleteFiber (slice->fiber);
#endif
QSE_MMGR_FREE (task->mmgr, slice);
}
static void purge_current_slice (qse_task_slice_t* slice, qse_task_slice_t* to)
{
qse_task_t* task = slice->task;
QSE_ASSERT (task->current == slice);
if (task->count == 1)
{
/* to purge later */
slice->next = task->dead;
task->dead = slice;
task->current = QSE_NULL;
task->head = QSE_NULL;
task->tail = QSE_NULL;
task->count = 0;
#if defined(_WIN64)
SwitchToFiber (task->fiber);
#elif defined(USE_UCONTEXT)
setcontext (&task->uctx);
#else
longjmp (task->backjmp, 1);
#endif
QSE_ASSERT (!"must not reach here....");
}
task->current = (to && to != slice)? to: (slice->next? slice->next: task->head);
if (slice->prev) slice->prev->next = slice->next;
if (slice->next) slice->next->prev = slice->prev;
if (slice == task->head) task->head = slice->next;
if (slice == task->tail) task->tail = slice->prev;
task->count--;
/* to purge later */
slice->next = task->dead;
task->dead = slice;
#if defined(_WIN64)
SwitchToFiber (task->current->fiber);
#elif defined(USE_UCONTEXT)
setcontext (&task->current->uctx);
#else
longjmp (task->current->jmpbuf, 1);
#endif
}

View File

@ -281,10 +281,9 @@ typedef enum { STR_WIDE, STR_BYTE, STR_MBS, STR_USER } tre_str_type_t;
/* Returns number of bytes to add to (char *)ptr to make it
properly aligned for the type. */
#define ALIGN(ptr, type) \
((((qse_uintptr_t)ptr) % QSE_SIZEOF(type)) \
? (QSE_SIZEOF(type) - (((qse_uintptr_t)ptr) % QSE_SIZEOF(type))) \
: 0)
#define ALIGN(ptr,type) \
((((qse_uintptr_t)ptr) % QSE_SIZEOF(type))? \
(QSE_SIZEOF(type) - (((qse_uintptr_t)ptr) % QSE_SIZEOF(type))): 0)
#undef MAX
#undef MIN

View File

@ -88,7 +88,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -115,7 +115,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -160,7 +160,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -449,7 +449,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -199,7 +199,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -219,7 +219,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -223,7 +223,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -37,6 +37,7 @@ bin_PROGRAMS = \
sll \
slmb01 \
str01 \
task01 \
time \
tre01 \
uri01 \

View File

@ -41,8 +41,8 @@ bin_PROGRAMS = chr01$(EXEEXT) env$(EXEEXT) dll$(EXEEXT) fio01$(EXEEXT) \
mbwc02$(EXEEXT) nwad01$(EXEEXT) oht$(EXEEXT) path01$(EXEEXT) \
pio$(EXEEXT) pma$(EXEEXT) rex01$(EXEEXT) rbt$(EXEEXT) \
sio01$(EXEEXT) sio02$(EXEEXT) sio03$(EXEEXT) sll$(EXEEXT) \
slmb01$(EXEEXT) str01$(EXEEXT) time$(EXEEXT) tre01$(EXEEXT) \
uri01$(EXEEXT) xma$(EXEEXT)
slmb01$(EXEEXT) str01$(EXEEXT) task01$(EXEEXT) time$(EXEEXT) \
tre01$(EXEEXT) uri01$(EXEEXT) xma$(EXEEXT)
@WCHAR_TRUE@@WIN32_TRUE@am__append_1 = $(UNICOWS_LIBS)
subdir = samples/cmn
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
@ -182,6 +182,10 @@ am_str01_OBJECTS = str01.$(OBJEXT)
str01_OBJECTS = $(am_str01_OBJECTS)
str01_LDADD = $(LDADD)
str01_DEPENDENCIES = $(am__DEPENDENCIES_2)
task01_SOURCES = task01.c
task01_OBJECTS = task01.$(OBJEXT)
task01_LDADD = $(LDADD)
task01_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_time_OBJECTS = time.$(OBJEXT)
time_OBJECTS = $(am_time_OBJECTS)
time_LDADD = $(LDADD)
@ -220,7 +224,7 @@ SOURCES = $(chr01_SOURCES) $(dll_SOURCES) $(env_SOURCES) \
$(oht_SOURCES) $(path01_SOURCES) $(pio_SOURCES) $(pma_SOURCES) \
$(rbt_SOURCES) $(rex01_SOURCES) $(sio01_SOURCES) \
$(sio02_SOURCES) $(sio03_SOURCES) $(sll_SOURCES) \
$(slmb01_SOURCES) $(str01_SOURCES) $(time_SOURCES) \
$(slmb01_SOURCES) $(str01_SOURCES) task01.c $(time_SOURCES) \
$(tre01_SOURCES) uri01.c $(xma_SOURCES)
DIST_SOURCES = $(chr01_SOURCES) $(dll_SOURCES) $(env_SOURCES) \
$(fio01_SOURCES) $(fio02_SOURCES) $(fma_SOURCES) \
@ -231,7 +235,7 @@ DIST_SOURCES = $(chr01_SOURCES) $(dll_SOURCES) $(env_SOURCES) \
$(oht_SOURCES) $(path01_SOURCES) $(pio_SOURCES) $(pma_SOURCES) \
$(rbt_SOURCES) $(rex01_SOURCES) $(sio01_SOURCES) \
$(sio02_SOURCES) $(sio03_SOURCES) $(sll_SOURCES) \
$(slmb01_SOURCES) $(str01_SOURCES) $(time_SOURCES) \
$(slmb01_SOURCES) $(str01_SOURCES) task01.c $(time_SOURCES) \
$(tre01_SOURCES) uri01.c $(xma_SOURCES)
ETAGS = etags
CTAGS = ctags
@ -596,6 +600,9 @@ slmb01$(EXEEXT): $(slmb01_OBJECTS) $(slmb01_DEPENDENCIES) $(EXTRA_slmb01_DEPENDE
str01$(EXEEXT): $(str01_OBJECTS) $(str01_DEPENDENCIES) $(EXTRA_str01_DEPENDENCIES)
@rm -f str01$(EXEEXT)
$(LINK) $(str01_OBJECTS) $(str01_LDADD) $(LIBS)
task01$(EXEEXT): $(task01_OBJECTS) $(task01_DEPENDENCIES) $(EXTRA_task01_DEPENDENCIES)
@rm -f task01$(EXEEXT)
$(LINK) $(task01_OBJECTS) $(task01_LDADD) $(LIBS)
time$(EXEEXT): $(time_OBJECTS) $(time_DEPENDENCIES) $(EXTRA_time_DEPENDENCIES)
@rm -f time$(EXEEXT)
$(LINK) $(time_OBJECTS) $(time_LDADD) $(LIBS)
@ -645,6 +652,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sll.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slmb01.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str01.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task01.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tre01.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uri01.Po@am__quote@

View File

@ -34,7 +34,7 @@ int main ()
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -62,7 +62,7 @@ int qse_main (int argc, qse_achar_t* argv[], qse_achar_t* envp[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -82,7 +82,7 @@ int qse_main (int argc, qse_achar_t* argv[], qse_achar_t* envp[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -81,7 +81,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -44,7 +44,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -194,7 +194,7 @@ int qse_main (int argc, qse_achar_t* argv[], qse_achar_t* envp[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -28,7 +28,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -33,7 +33,7 @@ int qse_main (int argc, qse_achar_t* argv[], qse_achar_t* envp[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -219,7 +219,7 @@ int main ()
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -299,7 +299,7 @@ int main ()
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -155,12 +155,12 @@ static int test_main (int argc, qse_char_t* argv[], qse_char_t* envp[])
int qse_main (int argc, qse_achar_t* argv[], qse_achar_t* envp[])
{
#if defined(_WIN32)
char locale[100];
char locale[100];
UINT codepage = GetConsoleOutputCP();
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -71,7 +71,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -76,7 +76,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -98,7 +98,7 @@ int main ()
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -151,7 +151,7 @@ int main ()
if (codepage == CP_UTF8)
{
/*SetConsoleOutputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -139,7 +139,7 @@ int main ()
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -200,7 +200,7 @@ int main ()
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

104
qse/samples/cmn/task01.c Normal file
View File

@ -0,0 +1,104 @@
#include <qse/cmn/task.h>
#include <qse/cmn/main.h>
#include <qse/cmn/mbwc.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/stdio.h>
#include <locale.h>
#if defined(_WIN32)
# include <windows.h>
#endif
static qse_task_slice_t* print (
qse_task_t* task, qse_task_slice_t* slice, void* ctx)
{
int i;
int num = (int)ctx;
qse_printf (QSE_T("task[%03d] => starting\n"), num);
for (i = 0; i < 5; i++)
{
qse_printf (QSE_T("task[%03d] => %03d\n"), num, i);
qse_task_schedule (task, slice, QSE_NULL);
if (i == 2 && num == 1)
{
qse_task_create (task, print, (void*)99, 40000);
}
}
qse_printf (QSE_T("task[%03d] => exiting\n"), num);
return QSE_NULL;
}
static int start_task (qse_task_fnc_t fnc)
{
qse_task_t* task;
qse_task_slice_t* slice;
task = qse_task_open (QSE_MMGR_GETDFL(), 0);
if (task == NULL)
{
qse_printf (QSE_T("cannot initialize tasking system\n"));
return -1;
}
qse_printf (QSE_T("== END ==\n"));
if (qse_task_create (task, fnc, (void*)1, 40000) == QSE_NULL ||
(slice = qse_task_create (task, fnc, (void*)2, 40000)) == QSE_NULL ||
qse_task_create (task, fnc, (void*)3, 40000) == QSE_NULL ||
qse_task_create (task, fnc, (void*)4, 40000) == QSE_NULL)
{
qse_printf (QSE_T("cannot create task slice\n"));
qse_task_close (task);
return -1;
}
if (qse_task_boot (task, slice) <= -1)
{
qse_printf (QSE_T("cannot start task\n"));
qse_task_close (task);
return -1;
}
qse_printf (QSE_T("== END ==\n"));
qse_task_close (task);
return 0;
}
static int test_main (int argc, qse_char_t* argv[])
{
int ret;
ret = start_task (print);
qse_printf (QSE_T("== END ==\n"));
return ret;
}
int qse_main (int argc, qse_achar_t* argv[])
{
#if defined(_WIN32)
char locale[100];
UINT codepage = GetConsoleOutputCP();
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{
sprintf (locale, ".%u", (unsigned int)codepage);
setlocale (LC_ALL, locale);
qse_setdflcmgrbyid (QSE_CMGR_SLMB);
}
#else
setlocale (LC_ALL, "");
qse_setdflcmgrbyid (QSE_CMGR_SLMB);
#endif
return qse_runmain (argc, argv, test_main);
}

View File

@ -83,7 +83,7 @@ int qse_main (int argc, qse_achar_t* argv[], qse_achar_t* envp[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -122,7 +122,7 @@ int qse_main (int argc, qse_achar_t* argv[], qse_achar_t* envp[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -98,7 +98,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -226,7 +226,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -879,7 +879,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -76,7 +76,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -85,7 +85,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -100,7 +100,7 @@ int qse_main (int argc, qse_achar_t* argv[])
if (codepage == CP_UTF8)
{
/*SetConsoleOUtputCP (CP_UTF8);*/
qse_setdflcmgr (qse_utf8cmgr);
qse_setdflcmgrbyid (QSE_CMGR_UTF8);
}
else
{

View File

@ -42,7 +42,7 @@ WVList
0
10
WPickList
83
85
11
MItem
3
@ -564,7 +564,7 @@ WVList
127
MItem
29
../../../../../lib/cmn/nwio.c
../../../../../lib/cmn/nwif.c
128
WString
4
@ -581,8 +581,8 @@ WVList
0
131
MItem
28
../../../../../lib/cmn/oht.c
29
../../../../../lib/cmn/nwio.c
132
WString
4
@ -600,7 +600,7 @@ WVList
135
MItem
28
../../../../../lib/cmn/opt.c
../../../../../lib/cmn/oht.c
136
WString
4
@ -617,8 +617,8 @@ WVList
0
139
MItem
38
../../../../../lib/cmn/path-basename.c
28
../../../../../lib/cmn/opt.c
140
WString
4
@ -635,8 +635,8 @@ WVList
0
143
MItem
35
../../../../../lib/cmn/path-canon.c
38
../../../../../lib/cmn/path-basename.c
144
WString
4
@ -653,8 +653,8 @@ WVList
0
147
MItem
28
../../../../../lib/cmn/pio.c
35
../../../../../lib/cmn/path-canon.c
148
WString
4
@ -672,7 +672,7 @@ WVList
151
MItem
28
../../../../../lib/cmn/pma.c
../../../../../lib/cmn/pio.c
152
WString
4
@ -690,7 +690,7 @@ WVList
155
MItem
28
../../../../../lib/cmn/rbt.c
../../../../../lib/cmn/pma.c
156
WString
4
@ -708,7 +708,7 @@ WVList
159
MItem
28
../../../../../lib/cmn/rex.c
../../../../../lib/cmn/rbt.c
160
WString
4
@ -726,7 +726,7 @@ WVList
163
MItem
28
../../../../../lib/cmn/sio.c
../../../../../lib/cmn/rex.c
164
WString
4
@ -744,7 +744,7 @@ WVList
167
MItem
28
../../../../../lib/cmn/sll.c
../../../../../lib/cmn/sio.c
168
WString
4
@ -761,8 +761,8 @@ WVList
0
171
MItem
29
../../../../../lib/cmn/slmb.c
28
../../../../../lib/cmn/sll.c
172
WString
4
@ -779,8 +779,8 @@ WVList
0
175
MItem
30
../../../../../lib/cmn/stdio.c
29
../../../../../lib/cmn/slmb.c
176
WString
4
@ -797,8 +797,8 @@ WVList
0
179
MItem
32
../../../../../lib/cmn/str-beg.c
30
../../../../../lib/cmn/stdio.c
180
WString
4
@ -816,7 +816,7 @@ WVList
183
MItem
32
../../../../../lib/cmn/str-cat.c
../../../../../lib/cmn/str-beg.c
184
WString
4
@ -834,7 +834,7 @@ WVList
187
MItem
32
../../../../../lib/cmn/str-chr.c
../../../../../lib/cmn/str-cat.c
188
WString
4
@ -852,7 +852,7 @@ WVList
191
MItem
32
../../../../../lib/cmn/str-cmp.c
../../../../../lib/cmn/str-chr.c
192
WString
4
@ -870,7 +870,7 @@ WVList
195
MItem
32
../../../../../lib/cmn/str-cnv.c
../../../../../lib/cmn/str-cmp.c
196
WString
4
@ -888,7 +888,7 @@ WVList
199
MItem
32
../../../../../lib/cmn/str-cpy.c
../../../../../lib/cmn/str-cnv.c
200
WString
4
@ -906,7 +906,7 @@ WVList
203
MItem
32
../../../../../lib/cmn/str-del.c
../../../../../lib/cmn/str-cpy.c
204
WString
4
@ -924,7 +924,7 @@ WVList
207
MItem
32
../../../../../lib/cmn/str-dup.c
../../../../../lib/cmn/str-del.c
208
WString
4
@ -941,8 +941,8 @@ WVList
0
211
MItem
33
../../../../../lib/cmn/str-dynm.c
32
../../../../../lib/cmn/str-dup.c
212
WString
4
@ -960,7 +960,7 @@ WVList
215
MItem
33
../../../../../lib/cmn/str-dynw.c
../../../../../lib/cmn/str-dynm.c
216
WString
4
@ -977,8 +977,8 @@ WVList
0
219
MItem
32
../../../../../lib/cmn/str-end.c
33
../../../../../lib/cmn/str-dynw.c
220
WString
4
@ -995,8 +995,8 @@ WVList
0
223
MItem
33
../../../../../lib/cmn/str-excl.c
32
../../../../../lib/cmn/str-end.c
224
WString
4
@ -1014,7 +1014,7 @@ WVList
227
MItem
33
../../../../../lib/cmn/str-fcpy.c
../../../../../lib/cmn/str-excl.c
228
WString
4
@ -1031,8 +1031,8 @@ WVList
0
231
MItem
34
../../../../../lib/cmn/str-fnmat.c
33
../../../../../lib/cmn/str-fcpy.c
232
WString
4
@ -1049,8 +1049,8 @@ WVList
0
235
MItem
33
../../../../../lib/cmn/str-incl.c
34
../../../../../lib/cmn/str-fnmat.c
236
WString
4
@ -1067,8 +1067,8 @@ WVList
0
239
MItem
32
../../../../../lib/cmn/str-len.c
33
../../../../../lib/cmn/str-incl.c
240
WString
4
@ -1086,7 +1086,7 @@ WVList
243
MItem
32
../../../../../lib/cmn/str-pac.c
../../../../../lib/cmn/str-len.c
244
WString
4
@ -1103,8 +1103,8 @@ WVList
0
247
MItem
33
../../../../../lib/cmn/str-pbrk.c
32
../../../../../lib/cmn/str-pac.c
248
WString
4
@ -1121,8 +1121,8 @@ WVList
0
251
MItem
32
../../../../../lib/cmn/str-put.c
33
../../../../../lib/cmn/str-pbrk.c
252
WString
4
@ -1140,7 +1140,7 @@ WVList
255
MItem
32
../../../../../lib/cmn/str-rev.c
../../../../../lib/cmn/str-put.c
256
WString
4
@ -1158,7 +1158,7 @@ WVList
259
MItem
32
../../../../../lib/cmn/str-rot.c
../../../../../lib/cmn/str-rev.c
260
WString
4
@ -1176,7 +1176,7 @@ WVList
263
MItem
32
../../../../../lib/cmn/str-set.c
../../../../../lib/cmn/str-rot.c
264
WString
4
@ -1194,7 +1194,7 @@ WVList
267
MItem
32
../../../../../lib/cmn/str-spl.c
../../../../../lib/cmn/str-set.c
268
WString
4
@ -1212,7 +1212,7 @@ WVList
271
MItem
32
../../../../../lib/cmn/str-spn.c
../../../../../lib/cmn/str-spl.c
272
WString
4
@ -1230,7 +1230,7 @@ WVList
275
MItem
32
../../../../../lib/cmn/str-str.c
../../../../../lib/cmn/str-spn.c
276
WString
4
@ -1247,8 +1247,8 @@ WVList
0
279
MItem
34
../../../../../lib/cmn/str-subst.c
32
../../../../../lib/cmn/str-str.c
280
WString
4
@ -1265,8 +1265,8 @@ WVList
0
283
MItem
32
../../../../../lib/cmn/str-tok.c
34
../../../../../lib/cmn/str-subst.c
284
WString
4
@ -1284,7 +1284,7 @@ WVList
287
MItem
32
../../../../../lib/cmn/str-trm.c
../../../../../lib/cmn/str-tok.c
288
WString
4
@ -1301,8 +1301,8 @@ WVList
0
291
MItem
33
../../../../../lib/cmn/str-word.c
32
../../../../../lib/cmn/str-trm.c
292
WString
4
@ -1319,8 +1319,8 @@ WVList
0
295
MItem
29
../../../../../lib/cmn/time.c
33
../../../../../lib/cmn/str-word.c
296
WString
4
@ -1337,8 +1337,8 @@ WVList
0
299
MItem
28
../../../../../lib/cmn/tio.c
29
../../../../../lib/cmn/task.c
300
WString
4
@ -1355,8 +1355,8 @@ WVList
0
303
MItem
32
../../../../../lib/cmn/tre-ast.c
29
../../../../../lib/cmn/time.c
304
WString
4
@ -1373,8 +1373,8 @@ WVList
0
307
MItem
36
../../../../../lib/cmn/tre-compile.c
28
../../../../../lib/cmn/tio.c
308
WString
4
@ -1391,8 +1391,8 @@ WVList
0
311
MItem
44
../../../../../lib/cmn/tre-match-backtrack.c
32
../../../../../lib/cmn/tre-ast.c
312
WString
4
@ -1409,8 +1409,8 @@ WVList
0
315
MItem
43
../../../../../lib/cmn/tre-match-parallel.c
36
../../../../../lib/cmn/tre-compile.c
316
WString
4
@ -1427,8 +1427,8 @@ WVList
0
319
MItem
34
../../../../../lib/cmn/tre-parse.c
44
../../../../../lib/cmn/tre-match-backtrack.c
320
WString
4
@ -1445,8 +1445,8 @@ WVList
0
323
MItem
34
../../../../../lib/cmn/tre-stack.c
43
../../../../../lib/cmn/tre-match-parallel.c
324
WString
4
@ -1463,8 +1463,8 @@ WVList
0
327
MItem
28
../../../../../lib/cmn/tre.c
34
../../../../../lib/cmn/tre-parse.c
328
WString
4
@ -1481,8 +1481,8 @@ WVList
0
331
MItem
29
../../../../../lib/cmn/utf8.c
34
../../../../../lib/cmn/tre-stack.c
332
WString
4
@ -1500,7 +1500,7 @@ WVList
335
MItem
28
../../../../../lib/cmn/xma.c
../../../../../lib/cmn/tre.c
336
WString
4
@ -1517,44 +1517,44 @@ WVList
0
339
MItem
3
*.h
29
../../../../../lib/cmn/utf8.c
340
WString
3
NIL
4
COBJ
341
WVList
0
342
WVList
0
-1
11
1
1
0
343
MItem
28
../../../../../lib/cmn/mem.h
../../../../../lib/cmn/xma.c
344
WString
3
NIL
4
COBJ
345
WVList
0
346
WVList
0
339
11
1
1
0
347
MItem
32
../../../../../lib/cmn/syscall.h
3
*.h
348
WString
3
@ -1565,7 +1565,43 @@ WVList
350
WVList
0
339
-1
1
1
0
351
MItem
28
../../../../../lib/cmn/mem.h
352
WString
3
NIL
353
WVList
0
354
WVList
0
347
1
1
0
355
MItem
32
../../../../../lib/cmn/syscall.h
356
WString
3
NIL
357
WVList
0
358
WVList
0
347
1
1
0

View File

@ -42,7 +42,7 @@ WVList
0
10
WPickList
83
85
11
MItem
3
@ -576,7 +576,7 @@ WVList
130
MItem
29
../../../../../lib/cmn/nwio.c
../../../../../lib/cmn/nwif.c
131
WString
4
@ -593,8 +593,8 @@ WVList
0
134
MItem
28
../../../../../lib/cmn/oht.c
29
../../../../../lib/cmn/nwio.c
135
WString
4
@ -612,7 +612,7 @@ WVList
138
MItem
28
../../../../../lib/cmn/opt.c
../../../../../lib/cmn/oht.c
139
WString
4
@ -629,8 +629,8 @@ WVList
0
142
MItem
38
../../../../../lib/cmn/path-basename.c
28
../../../../../lib/cmn/opt.c
143
WString
4
@ -647,8 +647,8 @@ WVList
0
146
MItem
35
../../../../../lib/cmn/path-canon.c
38
../../../../../lib/cmn/path-basename.c
147
WString
4
@ -665,8 +665,8 @@ WVList
0
150
MItem
28
../../../../../lib/cmn/pio.c
35
../../../../../lib/cmn/path-canon.c
151
WString
4
@ -684,7 +684,7 @@ WVList
154
MItem
28
../../../../../lib/cmn/pma.c
../../../../../lib/cmn/pio.c
155
WString
4
@ -702,7 +702,7 @@ WVList
158
MItem
28
../../../../../lib/cmn/rbt.c
../../../../../lib/cmn/pma.c
159
WString
4
@ -720,7 +720,7 @@ WVList
162
MItem
28
../../../../../lib/cmn/rex.c
../../../../../lib/cmn/rbt.c
163
WString
4
@ -738,7 +738,7 @@ WVList
166
MItem
28
../../../../../lib/cmn/sio.c
../../../../../lib/cmn/rex.c
167
WString
4
@ -756,7 +756,7 @@ WVList
170
MItem
28
../../../../../lib/cmn/sll.c
../../../../../lib/cmn/sio.c
171
WString
4
@ -773,8 +773,8 @@ WVList
0
174
MItem
29
../../../../../lib/cmn/slmb.c
28
../../../../../lib/cmn/sll.c
175
WString
4
@ -791,8 +791,8 @@ WVList
0
178
MItem
30
../../../../../lib/cmn/stdio.c
29
../../../../../lib/cmn/slmb.c
179
WString
4
@ -809,8 +809,8 @@ WVList
0
182
MItem
32
../../../../../lib/cmn/str-beg.c
30
../../../../../lib/cmn/stdio.c
183
WString
4
@ -828,7 +828,7 @@ WVList
186
MItem
32
../../../../../lib/cmn/str-cat.c
../../../../../lib/cmn/str-beg.c
187
WString
4
@ -846,7 +846,7 @@ WVList
190
MItem
32
../../../../../lib/cmn/str-chr.c
../../../../../lib/cmn/str-cat.c
191
WString
4
@ -864,7 +864,7 @@ WVList
194
MItem
32
../../../../../lib/cmn/str-cmp.c
../../../../../lib/cmn/str-chr.c
195
WString
4
@ -882,7 +882,7 @@ WVList
198
MItem
32
../../../../../lib/cmn/str-cnv.c
../../../../../lib/cmn/str-cmp.c
199
WString
4
@ -900,7 +900,7 @@ WVList
202
MItem
32
../../../../../lib/cmn/str-cpy.c
../../../../../lib/cmn/str-cnv.c
203
WString
4
@ -918,7 +918,7 @@ WVList
206
MItem
32
../../../../../lib/cmn/str-del.c
../../../../../lib/cmn/str-cpy.c
207
WString
4
@ -936,7 +936,7 @@ WVList
210
MItem
32
../../../../../lib/cmn/str-dup.c
../../../../../lib/cmn/str-del.c
211
WString
4
@ -953,8 +953,8 @@ WVList
0
214
MItem
33
../../../../../lib/cmn/str-dynm.c
32
../../../../../lib/cmn/str-dup.c
215
WString
4
@ -972,7 +972,7 @@ WVList
218
MItem
33
../../../../../lib/cmn/str-dynw.c
../../../../../lib/cmn/str-dynm.c
219
WString
4
@ -989,8 +989,8 @@ WVList
0
222
MItem
32
../../../../../lib/cmn/str-end.c
33
../../../../../lib/cmn/str-dynw.c
223
WString
4
@ -1007,8 +1007,8 @@ WVList
0
226
MItem
33
../../../../../lib/cmn/str-excl.c
32
../../../../../lib/cmn/str-end.c
227
WString
4
@ -1026,7 +1026,7 @@ WVList
230
MItem
33
../../../../../lib/cmn/str-fcpy.c
../../../../../lib/cmn/str-excl.c
231
WString
4
@ -1043,8 +1043,8 @@ WVList
0
234
MItem
34
../../../../../lib/cmn/str-fnmat.c
33
../../../../../lib/cmn/str-fcpy.c
235
WString
4
@ -1061,8 +1061,8 @@ WVList
0
238
MItem
33
../../../../../lib/cmn/str-incl.c
34
../../../../../lib/cmn/str-fnmat.c
239
WString
4
@ -1079,8 +1079,8 @@ WVList
0
242
MItem
32
../../../../../lib/cmn/str-len.c
33
../../../../../lib/cmn/str-incl.c
243
WString
4
@ -1098,7 +1098,7 @@ WVList
246
MItem
32
../../../../../lib/cmn/str-pac.c
../../../../../lib/cmn/str-len.c
247
WString
4
@ -1115,8 +1115,8 @@ WVList
0
250
MItem
33
../../../../../lib/cmn/str-pbrk.c
32
../../../../../lib/cmn/str-pac.c
251
WString
4
@ -1133,8 +1133,8 @@ WVList
0
254
MItem
32
../../../../../lib/cmn/str-put.c
33
../../../../../lib/cmn/str-pbrk.c
255
WString
4
@ -1152,7 +1152,7 @@ WVList
258
MItem
32
../../../../../lib/cmn/str-rev.c
../../../../../lib/cmn/str-put.c
259
WString
4
@ -1170,7 +1170,7 @@ WVList
262
MItem
32
../../../../../lib/cmn/str-rot.c
../../../../../lib/cmn/str-rev.c
263
WString
4
@ -1188,7 +1188,7 @@ WVList
266
MItem
32
../../../../../lib/cmn/str-set.c
../../../../../lib/cmn/str-rot.c
267
WString
4
@ -1206,7 +1206,7 @@ WVList
270
MItem
32
../../../../../lib/cmn/str-spl.c
../../../../../lib/cmn/str-set.c
271
WString
4
@ -1224,7 +1224,7 @@ WVList
274
MItem
32
../../../../../lib/cmn/str-spn.c
../../../../../lib/cmn/str-spl.c
275
WString
4
@ -1242,7 +1242,7 @@ WVList
278
MItem
32
../../../../../lib/cmn/str-str.c
../../../../../lib/cmn/str-spn.c
279
WString
4
@ -1259,8 +1259,8 @@ WVList
0
282
MItem
34
../../../../../lib/cmn/str-subst.c
32
../../../../../lib/cmn/str-str.c
283
WString
4
@ -1277,8 +1277,8 @@ WVList
0
286
MItem
32
../../../../../lib/cmn/str-tok.c
34
../../../../../lib/cmn/str-subst.c
287
WString
4
@ -1296,7 +1296,7 @@ WVList
290
MItem
32
../../../../../lib/cmn/str-trm.c
../../../../../lib/cmn/str-tok.c
291
WString
4
@ -1313,8 +1313,8 @@ WVList
0
294
MItem
33
../../../../../lib/cmn/str-word.c
32
../../../../../lib/cmn/str-trm.c
295
WString
4
@ -1331,8 +1331,8 @@ WVList
0
298
MItem
29
../../../../../lib/cmn/time.c
33
../../../../../lib/cmn/str-word.c
299
WString
4
@ -1349,8 +1349,8 @@ WVList
0
302
MItem
28
../../../../../lib/cmn/tio.c
29
../../../../../lib/cmn/task.c
303
WString
4
@ -1367,8 +1367,8 @@ WVList
0
306
MItem
32
../../../../../lib/cmn/tre-ast.c
29
../../../../../lib/cmn/time.c
307
WString
4
@ -1385,8 +1385,8 @@ WVList
0
310
MItem
36
../../../../../lib/cmn/tre-compile.c
28
../../../../../lib/cmn/tio.c
311
WString
4
@ -1403,8 +1403,8 @@ WVList
0
314
MItem
44
../../../../../lib/cmn/tre-match-backtrack.c
32
../../../../../lib/cmn/tre-ast.c
315
WString
4
@ -1421,8 +1421,8 @@ WVList
0
318
MItem
43
../../../../../lib/cmn/tre-match-parallel.c
36
../../../../../lib/cmn/tre-compile.c
319
WString
4
@ -1439,8 +1439,8 @@ WVList
0
322
MItem
34
../../../../../lib/cmn/tre-parse.c
44
../../../../../lib/cmn/tre-match-backtrack.c
323
WString
4
@ -1457,8 +1457,8 @@ WVList
0
326
MItem
34
../../../../../lib/cmn/tre-stack.c
43
../../../../../lib/cmn/tre-match-parallel.c
327
WString
4
@ -1475,8 +1475,8 @@ WVList
0
330
MItem
28
../../../../../lib/cmn/tre.c
34
../../../../../lib/cmn/tre-parse.c
331
WString
4
@ -1493,8 +1493,8 @@ WVList
0
334
MItem
29
../../../../../lib/cmn/utf8.c
34
../../../../../lib/cmn/tre-stack.c
335
WString
4
@ -1512,7 +1512,7 @@ WVList
338
MItem
28
../../../../../lib/cmn/xma.c
../../../../../lib/cmn/tre.c
339
WString
4
@ -1529,44 +1529,44 @@ WVList
0
342
MItem
3
*.h
29
../../../../../lib/cmn/utf8.c
343
WString
3
NIL
4
COBJ
344
WVList
0
345
WVList
0
-1
11
1
1
0
346
MItem
28
../../../../../lib/cmn/mem.h
../../../../../lib/cmn/xma.c
347
WString
3
NIL
4
COBJ
348
WVList
0
349
WVList
0
342
11
1
1
0
350
MItem
32
../../../../../lib/cmn/syscall.h
3
*.h
351
WString
3
@ -1577,7 +1577,43 @@ WVList
353
WVList
0
342
-1
1
1
0
354
MItem
28
../../../../../lib/cmn/mem.h
355
WString
3
NIL
356
WVList
0
357
WVList
0
350
1
1
0
358
MItem
32
../../../../../lib/cmn/syscall.h
359
WString
3
NIL
360
WVList
0
361
WVList
0
350
1
1
0

View File

@ -4,8 +4,8 @@ projectIdent
VpeMain
1
WRect
440
160
790
200
9320
9680
2
@ -76,11 +76,11 @@ WVList
VComponent
20
WRect
1080
1070
2520
5700
4240
0
1
0
21
WFileName
@ -128,14 +128,14 @@ WRect
480
5700
4240
0
1
0
30
WFileName
28
debug/os2/lib/cmn/qsecmn.tgt
45
45
48
31
VComponent
32
@ -189,10 +189,10 @@ VComponent
41
WRect
2660
66
40
5700
4240
0
1
0
42
WFileName
@ -256,14 +256,14 @@ WRect
560
5700
4240
1
0
0
54
WFileName
30
debug/dos32/cmd/sed/qsesed.tgt
0
0
1
55
VComponent
56

View File

@ -42,7 +42,7 @@ WVList
0
10
WPickList
81
83
11
MItem
3
@ -576,7 +576,7 @@ WVList
131
MItem
29
../../../../../lib/cmn/nwio.c
../../../../../lib/cmn/nwif.c
132
WString
4
@ -593,8 +593,8 @@ WVList
0
135
MItem
28
../../../../../lib/cmn/oht.c
29
../../../../../lib/cmn/nwio.c
136
WString
4
@ -612,7 +612,7 @@ WVList
139
MItem
28
../../../../../lib/cmn/opt.c
../../../../../lib/cmn/oht.c
140
WString
4
@ -629,8 +629,8 @@ WVList
0
143
MItem
38
../../../../../lib/cmn/path-basename.c
28
../../../../../lib/cmn/opt.c
144
WString
4
@ -647,8 +647,8 @@ WVList
0
147
MItem
35
../../../../../lib/cmn/path-canon.c
38
../../../../../lib/cmn/path-basename.c
148
WString
4
@ -665,8 +665,8 @@ WVList
0
151
MItem
28
../../../../../lib/cmn/pio.c
35
../../../../../lib/cmn/path-canon.c
152
WString
4
@ -684,7 +684,7 @@ WVList
155
MItem
28
../../../../../lib/cmn/pma.c
../../../../../lib/cmn/pio.c
156
WString
4
@ -702,7 +702,7 @@ WVList
159
MItem
28
../../../../../lib/cmn/rbt.c
../../../../../lib/cmn/pma.c
160
WString
4
@ -720,7 +720,7 @@ WVList
163
MItem
28
../../../../../lib/cmn/rex.c
../../../../../lib/cmn/rbt.c
164
WString
4
@ -738,7 +738,7 @@ WVList
167
MItem
28
../../../../../lib/cmn/sio.c
../../../../../lib/cmn/rex.c
168
WString
4
@ -756,7 +756,7 @@ WVList
171
MItem
28
../../../../../lib/cmn/sll.c
../../../../../lib/cmn/sio.c
172
WString
4
@ -773,8 +773,8 @@ WVList
0
175
MItem
29
../../../../../lib/cmn/slmb.c
28
../../../../../lib/cmn/sll.c
176
WString
4
@ -791,8 +791,8 @@ WVList
0
179
MItem
30
../../../../../lib/cmn/stdio.c
29
../../../../../lib/cmn/slmb.c
180
WString
4
@ -809,8 +809,8 @@ WVList
0
183
MItem
32
../../../../../lib/cmn/str-beg.c
30
../../../../../lib/cmn/stdio.c
184
WString
4
@ -828,7 +828,7 @@ WVList
187
MItem
32
../../../../../lib/cmn/str-cat.c
../../../../../lib/cmn/str-beg.c
188
WString
4
@ -846,7 +846,7 @@ WVList
191
MItem
32
../../../../../lib/cmn/str-chr.c
../../../../../lib/cmn/str-cat.c
192
WString
4
@ -864,7 +864,7 @@ WVList
195
MItem
32
../../../../../lib/cmn/str-cmp.c
../../../../../lib/cmn/str-chr.c
196
WString
4
@ -882,7 +882,7 @@ WVList
199
MItem
32
../../../../../lib/cmn/str-cnv.c
../../../../../lib/cmn/str-cmp.c
200
WString
4
@ -900,7 +900,7 @@ WVList
203
MItem
32
../../../../../lib/cmn/str-cpy.c
../../../../../lib/cmn/str-cnv.c
204
WString
4
@ -918,7 +918,7 @@ WVList
207
MItem
32
../../../../../lib/cmn/str-del.c
../../../../../lib/cmn/str-cpy.c
208
WString
4
@ -936,7 +936,7 @@ WVList
211
MItem
32
../../../../../lib/cmn/str-dup.c
../../../../../lib/cmn/str-del.c
212
WString
4
@ -953,8 +953,8 @@ WVList
0
215
MItem
33
../../../../../lib/cmn/str-dynm.c
32
../../../../../lib/cmn/str-dup.c
216
WString
4
@ -972,7 +972,7 @@ WVList
219
MItem
33
../../../../../lib/cmn/str-dynw.c
../../../../../lib/cmn/str-dynm.c
220
WString
4
@ -989,8 +989,8 @@ WVList
0
223
MItem
32
../../../../../lib/cmn/str-end.c
33
../../../../../lib/cmn/str-dynw.c
224
WString
4
@ -1007,8 +1007,8 @@ WVList
0
227
MItem
33
../../../../../lib/cmn/str-excl.c
32
../../../../../lib/cmn/str-end.c
228
WString
4
@ -1026,7 +1026,7 @@ WVList
231
MItem
33
../../../../../lib/cmn/str-fcpy.c
../../../../../lib/cmn/str-excl.c
232
WString
4
@ -1043,8 +1043,8 @@ WVList
0
235
MItem
34
../../../../../lib/cmn/str-fnmat.c
33
../../../../../lib/cmn/str-fcpy.c
236
WString
4
@ -1061,8 +1061,8 @@ WVList
0
239
MItem
33
../../../../../lib/cmn/str-incl.c
34
../../../../../lib/cmn/str-fnmat.c
240
WString
4
@ -1079,8 +1079,8 @@ WVList
0
243
MItem
32
../../../../../lib/cmn/str-len.c
33
../../../../../lib/cmn/str-incl.c
244
WString
4
@ -1098,7 +1098,7 @@ WVList
247
MItem
32
../../../../../lib/cmn/str-pac.c
../../../../../lib/cmn/str-len.c
248
WString
4
@ -1115,8 +1115,8 @@ WVList
0
251
MItem
33
../../../../../lib/cmn/str-pbrk.c
32
../../../../../lib/cmn/str-pac.c
252
WString
4
@ -1133,8 +1133,8 @@ WVList
0
255
MItem
32
../../../../../lib/cmn/str-put.c
33
../../../../../lib/cmn/str-pbrk.c
256
WString
4
@ -1152,7 +1152,7 @@ WVList
259
MItem
32
../../../../../lib/cmn/str-rev.c
../../../../../lib/cmn/str-put.c
260
WString
4
@ -1170,7 +1170,7 @@ WVList
263
MItem
32
../../../../../lib/cmn/str-rot.c
../../../../../lib/cmn/str-rev.c
264
WString
4
@ -1188,7 +1188,7 @@ WVList
267
MItem
32
../../../../../lib/cmn/str-set.c
../../../../../lib/cmn/str-rot.c
268
WString
4
@ -1206,7 +1206,7 @@ WVList
271
MItem
32
../../../../../lib/cmn/str-spl.c
../../../../../lib/cmn/str-set.c
272
WString
4
@ -1224,7 +1224,7 @@ WVList
275
MItem
32
../../../../../lib/cmn/str-spn.c
../../../../../lib/cmn/str-spl.c
276
WString
4
@ -1242,7 +1242,7 @@ WVList
279
MItem
32
../../../../../lib/cmn/str-str.c
../../../../../lib/cmn/str-spn.c
280
WString
4
@ -1259,8 +1259,8 @@ WVList
0
283
MItem
34
../../../../../lib/cmn/str-subst.c
32
../../../../../lib/cmn/str-str.c
284
WString
4
@ -1277,8 +1277,8 @@ WVList
0
287
MItem
32
../../../../../lib/cmn/str-tok.c
34
../../../../../lib/cmn/str-subst.c
288
WString
4
@ -1296,7 +1296,7 @@ WVList
291
MItem
32
../../../../../lib/cmn/str-trm.c
../../../../../lib/cmn/str-tok.c
292
WString
4
@ -1313,8 +1313,8 @@ WVList
0
295
MItem
33
../../../../../lib/cmn/str-word.c
32
../../../../../lib/cmn/str-trm.c
296
WString
4
@ -1331,8 +1331,8 @@ WVList
0
299
MItem
29
../../../../../lib/cmn/time.c
33
../../../../../lib/cmn/str-word.c
300
WString
4
@ -1349,8 +1349,8 @@ WVList
0
303
MItem
28
../../../../../lib/cmn/tio.c
29
../../../../../lib/cmn/task.c
304
WString
4
@ -1367,8 +1367,8 @@ WVList
0
307
MItem
32
../../../../../lib/cmn/tre-ast.c
29
../../../../../lib/cmn/time.c
308
WString
4
@ -1385,8 +1385,8 @@ WVList
0
311
MItem
36
../../../../../lib/cmn/tre-compile.c
28
../../../../../lib/cmn/tio.c
312
WString
4
@ -1403,8 +1403,8 @@ WVList
0
315
MItem
44
../../../../../lib/cmn/tre-match-backtrack.c
32
../../../../../lib/cmn/tre-ast.c
316
WString
4
@ -1421,8 +1421,8 @@ WVList
0
319
MItem
43
../../../../../lib/cmn/tre-match-parallel.c
36
../../../../../lib/cmn/tre-compile.c
320
WString
4
@ -1439,8 +1439,8 @@ WVList
0
323
MItem
34
../../../../../lib/cmn/tre-parse.c
44
../../../../../lib/cmn/tre-match-backtrack.c
324
WString
4
@ -1457,8 +1457,8 @@ WVList
0
327
MItem
34
../../../../../lib/cmn/tre-stack.c
43
../../../../../lib/cmn/tre-match-parallel.c
328
WString
4
@ -1475,8 +1475,8 @@ WVList
0
331
MItem
28
../../../../../lib/cmn/tre.c
34
../../../../../lib/cmn/tre-parse.c
332
WString
4
@ -1493,8 +1493,8 @@ WVList
0
335
MItem
29
../../../../../lib/cmn/utf8.c
34
../../../../../lib/cmn/tre-stack.c
336
WString
4
@ -1512,7 +1512,7 @@ WVList
339
MItem
28
../../../../../lib/cmn/xma.c
../../../../../lib/cmn/tre.c
340
WString
4
@ -1529,44 +1529,44 @@ WVList
0
343
MItem
3
*.h
29
../../../../../lib/cmn/utf8.c
344
WString
3
NIL
4
COBJ
345
WVList
0
346
WVList
0
-1
11
1
1
0
347
MItem
28
../../../../../lib/cmn/mem.h
../../../../../lib/cmn/xma.c
348
WString
3
NIL
4
COBJ
349
WVList
0
350
WVList
0
343
11
1
1
0
351
MItem
32
../../../../../lib/cmn/syscall.h
3
*.h
352
WString
3
@ -1577,7 +1577,43 @@ WVList
354
WVList
0
343
-1
1
1
0
355
MItem
28
../../../../../lib/cmn/mem.h
356
WString
3
NIL
357
WVList
0
358
WVList
0
351
1
1
0
359
MItem
32
../../../../../lib/cmn/syscall.h
360
WString
3
NIL
361
WVList
0
362
WVList
0
351
1
1
0