- simplified devser queue

- added inherited sct variables starting with @
- inserted SctIsPending / DevIsPending
- some general improvements in scriptcontext.c/sctdriveobj.c
This commit is contained in:
zolliker
2010-01-27 13:39:33 +00:00
parent 7976b52212
commit a56838b90d
5 changed files with 303 additions and 246 deletions

View File

@ -72,15 +72,15 @@ void DevDisconnect(DevSer * devser);
* \param actionData the action data
* \param prio the priority
* \param hdl the action handler
* \param matchFunc the match function
* \param matchFunc a match function with two arguments of the same type
* \param killFunc the action data kill function (called from DevKill and
* after the action has finished, i.e. when hdl returned NULL)
* or NULL if no kill function is needed.
* \return 0 when not queued because a similar action is already on the queue,
* 1 on success.
* \return 1 when this was a new action, 0 when an action was overwritten
* in the second case the actionData's kill Function is called
*/
int DevQueue(DevSer * devser, void *actionData, DevPrio prio,
DevActionHandler hdl, DevActionMatch * matchFunc,
DevActionHandler * hdl, DevActionMatch * matchFunc,
DevKillActionData * killFunc);
/** \brief Schedule a periodic action
@ -92,25 +92,25 @@ int DevQueue(DevSer * devser, void *actionData, DevPrio prio,
* \param prio the priority
* \param interval the interval in seconds (0 is allowed)
* \param hdl the action handler
* \param matchFunc the match function (callData must be of the same type as actionData)
* \param killFunc the action data kill function (called from DevKill and
* from DevUnschedule) or NULL if no kill function is needed.
* \return 0 when this was a new action, > 0 when an action was overwritten
* \param matchFunc a match function with two arguments of the same type
* \param killFunc the action data kill function or NULL if no kill function is needed.
* \return 1 when this was a new action, 0 when an action was overwritten
* in the second case the actionData's kill Function is called
*/
int DevSchedule(DevSer * devser, void *actionData,
DevPrio prio, double interval,
DevActionHandler hdl, DevActionMatch * matchFunc,
DevActionHandler * hdl, DevActionMatch * matchFunc,
DevKillActionData * killFunc);
/** \brief Unschedule matching actions
* \param devser the device serializer
* \param actionData the callers data to be used as first argument of the match function
* \param callData the callers data to be used as first argument of the match function
* \param hdl the action handler
* \param matchFunc the match function (callData does not need to have the same type as actionData)
* \param matchFunc a match function (the first argument might have an other type than the second)
* \return the number of unscheduled actions
*/
int DevUnschedule(DevSer * devser, void *actionData,
DevActionHandler hdl, DevActionMatch * matchFunc);
int DevUnschedule(DevSer * devser, void *callData,
DevActionHandler * hdl, DevActionMatch * matchFunc);
/** \brief remove action from the serializer
* \param devser the device serializer
@ -118,6 +118,15 @@ int DevUnschedule(DevSer * devser, void *actionData,
*/
int DevRemoveAction(DevSer * devser, void *actionData);
/** \brief check if an action is pending
* \param devser the device serializer
* \param callData the callers data to be used as first argument of the match function
* \param hdl the action handler
* \param matchFunc a match function (the first argument might have an other type than the second)
* \return the number of unscheduled actions
*/
int DevIsPending(DevSer * devser, void *callData,
DevActionHandler * hdl, DevActionMatch * matchFunc);
/** \brief Convert integer priority to text
* \param prio