SdsSetWatch - Set a watch routine to watch for events on a given SDS ID.

Function

Set a watch routine to watch for events on a given SDS ID.

Description

This feature is still somewhat experimental. It provides the ablity to watch certain happenings within SDS for a given SDS ID. For example, if a given SDS ID is being free-ed incorrectly - often caused by a double free,. then you can specify the SDS ID number to watch and arrange for the specified function to be invoked when that ID is free-ed.

You specify the ID, a routine to be invoked and the client data item.

Language

C

Declaration

void SdsSetWatch(SdsIdType id, watchRoutine, clientData, oldId, oldWatchRoutine, oldClientData, status)

Parameters

(">" input, "!" modified, "W" workspace, "<" output)

>idSdsIdTypeIdentifier to be watched. If 0, then cancel watching. If -1, then watch all IDs. Note, it is possible to watch an ID which is not currently in use, in that case, you will get a SDS_WATCH_EVENT_NEWID event when starts being used.
>watchRoutineSdsWatchRoutineTypeThe routine to be invoked when the watch is triggered. If not specified, then a message is written to stderr.
>clientDatavoid *Passed through to watchRoutine as its client data item.
<oldIdSdsIdType *If non-null, the previous id being watched is returned here. Zero if there was none.
<oldWatchRoutineSdsWatchRoutineType *If non-null, any old watch routine address is returned here.
<oldClientDatavoid **If non-null, any old watch routine client data is returned here.
!statusStatusType*Modified status.

Function Prototypes Used

typedef void (*SdsWatchRoutineType)(SdsIdType id, void * client_data, int event);

Parameters

(">" input, "!" modified, "W" workspace, "<" output)

>idSdsIdTypeThe ID which triggered the watch event.
>client_datavoid *As supplied to SdsSetWatch().
>eventintIndicates the event type. The following event types are supported. Others might be added later and code should allow for this.

SDS_WATCH_EVENT_FREE SdsFree or SdsFreeIdAndCheck.
SDS_WATCH_EVENT_DELETE SdsDelete.
SDS_WATCH_EVENT_READFREE SdsReadFree.
SDS_WATCH_EVENT_NEW SdsNew (on parent).
SDS_WATCH_EVENT_COPY SdsCopy.
SDS_WATCH_EVENT_INSERT SdsInsert.
SDS_WATCH_EVENT_INSERT_CELL SdsInsertCell.
SDS_WATCH_EVENT_EXTRACT SdsExtract.
SDS_WATCH_EVENT_RESIZE SdsResize
SDS_WATCH_EVENT_NEWID Any function that creates an id. "id" is the new SDS ID number.

Support

Tony Farrell, {AAO}

Version date

14-Sep-2004

Click here for the DRAMA home page and here for the AAO home page.

 For more information, contact tony.farrell@mq.edu.au