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 certian 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.

Currently - only SdsFreeId() is watched and the "reserved" item in the call back will always be zero when invoked from SdsFreeId(). It will be some other value if this feature is extended and it is invoked from elsewhere.

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.
>watchRoutineSdsWatchRoutineTypeThe routine to be invoked when the watch is triggered. If not specified, then a message is written to stdout.
>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 int (*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 (0) => SdsFree.

SDS_WATCH_EVENT_DELETE SdsDelete.
SDS_WATCH_EVENT_READFREE SdsReadFree.
SDS_WATCH_EVENT_NEW SdsNew.
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

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 tjf@aaoepp.aao.gov.au