Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ TimerCBProc(3X) — DeltaWindows 1.3.3 Release 4 Version 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

 

NAME

XtTimerCallbackProc − interface definition for procedure invoked when timeouts expire. 

SYNOPSIS

typedef void (∗XtTimerCallbackProc)(XtPointer, XtIntervalId ∗); XtPointer client_data;  XtIntervalId ∗id;

Inputs

client_data
Specifies the data that was registered with this procedure.

idSpecifies the ID returned when this procedure was registered. 

DESCRIPTION

An XtTimerCallbackProc is registered in a call to XtAppAddTimeOut(), and is invoked when the specified number of milliseconds elapse.  The client_data argument is data registered with the procedure in the call to XtAppAddTimeOut(), and the id argument is the value returned by that function. 

A timer callback is called once, and then is automatically removed.  If you want a callback to be called repeatedly, re-register the callback each time it is called,

EXAMPLE

The following XtTimerCallbackProc is from the xmh program.  It re-registers itself so that it will be called repeatedly.  Note that it uses its client_data argument to supply the application context so that it can re-register itself.  /∗ARGSUSED∗/ static void NeedToCheckScans(client_data, id)
    XtPointer client_data;
    XtIntervalId ∗id;           /∗ unused ∗/ {
    int i;
    if (!subProcessRunning) {
        DEBUG("[magic toc check ...")
        for (i = 0; i < numScrns; i++) {
            if (scrnList[i]->toc)
                TocRecheckValidity(scrnList[i]->toc);
            if (scrnList[i]->msg)
                TocRecheckValidity(MsgGetToc(scrnList[i]->msg));
        }
        DEBUG(" done]\n")
    }
    (void) XtAppAddTimeOut((XtAppContext)client_data,
                           (unsigned long) app_resources.rescan_interval,
                           NeedToCheckScans, client_data); } This procedure is initiallly registered with the following code:
    if (app_resources.rescan_interval > 0) {
        app_resources.rescan_interval ∗= 60000;
        (void) XtAppAddTimeOut(appCtx,
                 (unsigned long) app_resources.rescan_interval,
                 NeedToCheckScans, (XtPointer)appCtx);
    }

SEE ALSO

XtAppAddTimeOutUNIX SYSTEM V/68, XtRemoveTimeOutUNIX SYSTEM V/68. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026