6.5. Data Definitions for libSM

This section defines global identifiers and their values that are associated with interfaces contained in libSM. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.

This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.

This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.

6.5.1. X11/SM/SMlib.h


typedef IcePointer SmPointer;
typedef struct _SmcConn *SmcConn;
typedef struct _SmsConn *SmsConn;

typedef struct {
    int length;
    SmPointer value;
} SmPropValue;
typedef struct {
    char *name;
    char *type;
    int num_vals;
    SmPropValue *vals;
} SmProp;

typedef enum {
    SmcClosedNow,
    SmcClosedASAP,
    SmcConnectionInUse
} SmcCloseStatus;

typedef void (*SmcSaveYourselfPhase2Proc) (void);
typedef void (*SmcInteractProc) (void);
typedef void (*SmcDieProc) (void);
typedef void (*SmcShutdownCancelledProc) (void);
typedef void (*SmcSaveCompleteProc) (void);
typedef void (*SmcPropReplyProc) (void);

typedef struct {
    SmcShutdownCancelledProc callback;
    SmPointer client_data;
} SmcCallbacks;

typedef void (*SmsSetPropertiesProc) (void);
typedef void (*SmsDeletePropertiesProc) (void);
typedef void (*SmsGetPropertiesProc) (void);

typedef struct {
    SmsGetPropertiesProc callback;
    SmPointer manager_data;
} SmsCallbacks;

typedef int (*SmsNewClientProc) (void);

typedef void (*SmcErrorHandler) (void);
typedef void (*SmsErrorHandler) (void);

extern void SmFreeProperty(SmProp *);
extern void SmFreeReasons(int, char **);
extern char *SmcClientID(SmcConn);
extern SmcCloseStatus SmcCloseConnection(SmcConn, int, char **);
extern void SmcDeleteProperties(SmcConn, int, char **);
extern IceConn SmcGetIceConnection(SmcConn);
extern int SmcGetProperties(SmcConn, SmcPropReplyProc, SmPointer);
extern void SmcInteractDone(SmcConn, int);
extern int SmcInteractRequest(SmcConn, int, SmcInteractProc, SmPointer);
extern void SmcModifyCallbacks(SmcConn, unsigned long int, SmcCallbacks *);
extern SmcConn SmcOpenConnection(char *, SmPointer, int, int,
				 unsigned long int, SmcCallbacks *, char *,
				 char **, int, char *);
extern int SmcProtocolRevision(SmcConn);
extern int SmcProtocolVersion(SmcConn);
extern char *SmcRelease(SmcConn);
extern void SmcRequestSaveYourself(SmcConn, int, int, int, int, int);
extern int SmcRequestSaveYourselfPhase2(SmcConn, SmcSaveYourselfPhase2Proc,
					SmPointer);
extern void SmcSaveYourselfDone(SmcConn, int);
extern SmcErrorHandler SmcSetErrorHandler(SmcErrorHandler);
extern void SmcSetProperties(SmcConn, int, SmProp * *);
extern char *SmcVendor(SmcConn);
extern void SmsCleanUp(SmsConn);
extern char *SmsClientHostName(SmsConn);
extern char *SmsClientID(SmsConn);
extern void SmsDie(SmsConn);
extern char *SmsGenerateClientID(SmsConn);
extern IceConn SmsGetIceConnection(SmsConn);
extern int SmsInitialize(char *, char *, SmsNewClientProc, SmPointer,
			 IceHostBasedAuthProc, int, char *);
extern void SmsInteract(SmsConn);
extern int SmsProtocolRevision(SmsConn);
extern int SmsProtocolVersion(SmsConn);
extern int SmsRegisterClientReply(SmsConn, char *);
extern void SmsReturnProperties(SmsConn, int, SmProp * *);
extern void SmsSaveComplete(SmsConn);
extern void SmsSaveYourself(SmsConn, int, int, int, int);
extern void SmsSaveYourselfPhase2(SmsConn);
extern SmsErrorHandler SmsSetErrorHandler(SmsErrorHandler);
extern void SmsShutdownCancelled(SmsConn);