[teklib-general] teklib: Added TMSG_INITTASK and TMSG_RUNTASK Hook message types; ...
Timm S. Mueller
tmueller at neoscientists.org
Sun Feb 15 17:05:59 CET 2009
details: http://hg.teklib.org/teklib/rev/ace13c29b851
changeset: 244:ace13c29b851
user: Timm S. Mueller <tmueller at neoscientists.org>
date: Sun Feb 08 00:49:12 2009 +0100
description:
Added TMSG_INITTASK and TMSG_RUNTASK Hook message types; TCreateTask() now
expects a THook instead of an init and task function; TTASKENTRY is mostly
obsolete now, only TCreateSysTask() and the HAL thread interface are still
using it
diffs (truncated from 1644 to 100 lines):
diff -r b924ba57cbdc -r ace13c29b851 src/date/tests/datetest.c
--- a/src/date/tests/datetest.c Sat Feb 07 04:17:21 2009 +0100
+++ b/src/date/tests/datetest.c Sun Feb 08 00:49:12 2009 +0100
@@ -550,7 +550,7 @@
}
/*****************************************************************************/
-TTASKENTRY void TEKMain(struct TTask *task)
+void TEKMain(struct TTask *task)
{
TExecBase = TGetExecBase(task);
TAstroBase = (struct TAstroBase *)
diff -r b924ba57cbdc -r ace13c29b851 src/display_directfb/display_dfb_mod.c
--- a/src/display_directfb/display_dfb_mod.c Sat Feb 07 04:17:21 2009 +0100
+++ b/src/display_directfb/display_dfb_mod.c Sun Feb 08 00:49:12 2009 +0100
@@ -16,9 +16,9 @@
static TMODAPI TINT dfb_abortio(DFBDISPLAY *mod, struct TVRequest *req);
static TMODAPI struct TVRequest *dfb_allocreq(DFBDISPLAY *mod);
static TMODAPI void dfb_freereq(DFBDISPLAY *mod, struct TVRequest *req);
-static TTASKENTRY TBOOL dfb_initinstance(struct TTask *task);
+static TBOOL dfb_initinstance(struct TTask *task);
static void dfb_exitinstance(DFBDISPLAY *inst);
-static TTASKENTRY void dfb_taskfunc(struct TTask *task);
+static void dfb_taskfunc(struct TTask *task);
LOCAL void dfb_wake(DFBDISPLAY *inst);
static void dfb_processevent(DFBDISPLAY *mod);
static TVOID dfb_processvisualevent(DFBDISPLAY *mod, DFBWINDOW *v, DFBEvent *evt);
@@ -63,6 +63,12 @@
return (TTAG) dfb_modopen(mod, obj);
case TMSG_CLOSEMODULE:
dfb_modclose(obj);
+ break;
+ case TMSG_INITTASK:
+ return dfb_initinstance(obj);
+ case TMSG_RUNTASK:
+ dfb_taskfunc(obj);
+ break;
}
return 0;
}
@@ -191,7 +197,7 @@
tags[0].tti_Value = (TTAG) mod;
tags[1].tti_Tag = TTAG_DONE;
mod->dfb_Task = TExecCreateTask(mod->dfb_ExecBase,
- (TTASKFUNC) dfb_taskfunc, (TINITFUNC) dfb_initinstance, tags);
+ &mod->dfb_Module.tmd_Handle.thn_Hook, tags);
if (mod->dfb_Task == TNULL) break;
mod->dfb_CmdPort = TExecGetUserPort(mod->dfb_ExecBase, mod->dfb_Task);
@@ -241,8 +247,7 @@
/*****************************************************************************/
-static TTASKENTRY TBOOL
-dfb_initinstance(struct TTask *task)
+static TBOOL dfb_initinstance(struct TTask *task)
{
DFBDISPLAY *inst = TExecGetTaskData(TGetExecBase(task), task);
@@ -508,8 +513,7 @@
}
}
-static TTASKENTRY void
-dfb_taskfunc(struct TTask *task)
+static void dfb_taskfunc(struct TTask *task)
{
static char pipebuf[256];
DFBDISPLAY *inst = TExecGetTaskData(TGetExecBase(task), task);
diff -r b924ba57cbdc -r ace13c29b851 src/display_rawfb/display_fb_mod.c
--- a/src/display_rawfb/display_fb_mod.c Sat Feb 07 04:17:21 2009 +0100
+++ b/src/display_rawfb/display_fb_mod.c Sun Feb 08 00:49:12 2009 +0100
@@ -10,8 +10,8 @@
#include "display_fb_mod.h"
-static TTASKENTRY void fb_taskfunc(struct TTask *task);
-static TTASKENTRY TBOOL fb_initinstance(struct TTask *task);
+static void fb_taskfunc(struct TTask *task);
+static TBOOL fb_initinstance(struct TTask *task);
static void fb_exitinstance(FBDISPLAY *inst);
static TAPTR fb_modopen(FBDISPLAY *mod, TTAGITEM *tags);
static void fb_modclose(FBDISPLAY *mod);
@@ -59,6 +59,12 @@
return (TTAG) fb_modopen(mod, obj);
case TMSG_CLOSEMODULE:
fb_modclose(obj);
+ break;
+ case TMSG_INITTASK:
+ return fb_initinstance(obj);
+ case TMSG_RUNTASK:
+ fb_taskfunc(obj);
+ break;
}
return 0;
}
@@ -185,8 +191,7 @@
tags[0].tti_Value = (TTAG) mod;
tags[1].tti_Tag = TTAG_DONE;
mod->fbd_Task = TExecCreateTask(mod->fbd_ExecBase,
More information about the teklib-general
mailing list