SAPNotifyOfChange(3sapd)


SAPNotifyOfChange -- register callback function to be activated if server information changes

Synopsis

#include <sap_app.h> 

int SAPNotifyOfChange(int Signal, void (*Function)(int), uint16 ServerType);

Description

SAPNotifyOfChange gives control to the specified function when one or more server entries have changed. This function allows the process to maintain very accurate SAP information and is used by the Server Advertiser.


NOTE: This function is supported only when the SAP daemon is running.

Parameters

(IN) Signal
Specifies the signal that will be used to notify the process when a change has occurred.

(IN) (*Function)(int)
Specifies the callback function that will be invoked when a change has occurred.

(IN) ServerType
Set to either a type of server or ALL_SERVER_TYPE. Server types are defined in the include file.

Usage

The Signal argument specifies the signal that will be used to notify the process when a change has occurred. SAPNotifyOfChange registers the process for the indicated signal.

If Signal value is SAP_STOP_NOTIFICATION, notification of changes will be discontinued, and the callback function will be unregistered.

The Function argument specifies the callback function that will be invoked when a change has occurred. The specified function will typically use SAPGetChangedServers(3sapd) so that the process can obtain information about the changed servers.

If the Signal argument is set to SAP_STOP_NOTIFICATION, the Function argument is ignored. The callback function needs no knowledge of the actual signal mechanism involved. This mechanism is set up when SAPNotifyOfChange is invoked.

The ServerType argument is set to either a type of server or to ALL_SERVER_TYPE to obtain information on all servers.

Return values

If unsuccessful, the function returns a negative number which is the negative of the error code.

0
successful

-5
duplicate registration of callback function

-10
not supported (SAP daemon not running)

Examples

   void Function (int Sig) 
   { 
       return; 
   } 
   : 
   : 
       ServerType = FILE_SERVER_TYPE; 
       ret = SAPNotifyOfChange (SIGUSR1, Function, ServerType); 

References

SAPGetChangedServers(3sapd)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.