diff options
author | mor <empty> | 1994-03-30 21:48:21 +0000 |
---|---|---|
committer | mor <empty> | 1994-03-30 21:48:21 +0000 |
commit | fb60abdb00dae07dc8282f79b60708e2075f5e85 (patch) | |
tree | 1e03d77846b4af64e8e14ac43f3a028123c9b9b4 /xc/lib/SM/sm_process.c | |
parent | 439d6054686149be2f68eb1fe23fe003aa3c223a (diff) |
Added SaveYourselfPhase2, SaveComplete, SaveYourselfPhase2Request.
Cast in _IceErrorBadValue
Diffstat (limited to 'xc/lib/SM/sm_process.c')
-rw-r--r-- | xc/lib/SM/sm_process.c | 74 |
1 files changed, 68 insertions, 6 deletions
diff --git a/xc/lib/SM/sm_process.c b/xc/lib/SM/sm_process.c index a1aee99ce..2fba11899 100644 --- a/xc/lib/SM/sm_process.c +++ b/xc/lib/SM/sm_process.c @@ -1,4 +1,4 @@ -/* $XConsortium: sm_process.c,v 1.23 94/03/16 16:31:59 mor Exp $ */ +/* $XConsortium: sm_process.c,v 1.24 94/03/18 16:03:17 mor Exp $ */ /****************************************************************************** Copyright 1993 by the Massachusetts Institute of Technology, @@ -207,7 +207,7 @@ IceReplyWaitInfo *replyWait; if (errOffset >= 0) { _IceErrorBadValue (iceConn, _SmcOpcode, - SM_SaveYourself, errOffset, 1, &errVal); + SM_SaveYourself, errOffset, 1, (IcePointer) &errVal); } else { @@ -216,12 +216,35 @@ IceReplyWaitInfo *replyWait; pMsg->saveType, pMsg->shutdown, pMsg->interactStyle, pMsg->fast); + smcConn->save_yourself_in_progress = True; + if (pMsg->shutdown) smcConn->shutdown_in_progress = True; } break; } + case SM_SaveYourselfPhase2: + + if (!smcConn->phase2_wait) + { + _IceErrorBadState (iceConn, _SmcOpcode, + SM_SaveYourselfPhase2, IceCanContinue); + } + else + { + CHECK_SIZE_MATCH (iceConn, _SmcOpcode, opcode, + length, SIZEOF (smSaveYourselfPhase2Msg), + IceFatalToProtocol); + + (*smcConn->phase2_wait->phase2_proc) (smcConn, + smcConn->phase2_wait->client_data); + + free ((char *) smcConn->phase2_wait); + smcConn->phase2_wait = NULL; + } + break; + case SM_Interact: if (!smcConn->interact_waits) @@ -245,6 +268,26 @@ IceReplyWaitInfo *replyWait; } break; + case SM_SaveComplete: + + if (!smcConn->save_yourself_in_progress) + { + _IceErrorBadState (iceConn, _SmcOpcode, + SM_SaveComplete, IceCanContinue); + } + else + { + CHECK_SIZE_MATCH (iceConn, _SmcOpcode, opcode, + length, SIZEOF (smSaveCompleteMsg), + IceFatalToProtocol); + + smcConn->save_yourself_in_progress = False; + + (*smcConn->callbacks.save_complete.callback) (smcConn, + smcConn->callbacks.save_complete.client_data); + } + break; + case SM_Die: CHECK_SIZE_MATCH (iceConn, _SmcOpcode, opcode, @@ -501,7 +544,7 @@ Bool swap; unsigned char errVal = pMsg->dialogType; _IceErrorBadValue (iceConn, _SmsOpcode, - SM_InteractRequest, 2, 1, &errVal); + SM_InteractRequest, 2, 1, (IcePointer) &errVal); } else if (pMsg->dialogType == SmDialogNormal && smsConn->interaction_allowed != SmInteractStyleAny) @@ -541,7 +584,7 @@ Bool swap; unsigned char errVal = pMsg->cancelShutdown; _IceErrorBadValue (iceConn, _SmsOpcode, - SM_InteractDone, 2, 1, &errVal); + SM_InteractDone, 2, 1, (IcePointer) &errVal); } else if (pMsg->cancelShutdown && !smsConn->can_cancel_shutdown) { @@ -605,7 +648,7 @@ Bool swap; if (errOffset >= 0) { _IceErrorBadValue (iceConn, _SmsOpcode, - SM_SaveYourselfRequest, errOffset, 1, &errVal); + SM_SaveYourselfRequest, errOffset, 1, (IcePointer) &errVal); } else { @@ -617,6 +660,25 @@ Bool swap; break; } + case SM_SaveYourselfPhase2Request: + + if (!smsConn->save_yourself_in_progress) + { + _IceErrorBadState (iceConn, _SmsOpcode, + SM_SaveYourselfPhase2Request, IceCanContinue); + } + else + { + CHECK_SIZE_MATCH (iceConn, _SmsOpcode, opcode, + length, SIZEOF (smSaveYourselfPhase2RequestMsg), + IceFatalToProtocol); + + (*smsConn->callbacks.save_yourself_phase2_request.callback) ( + smsConn, smsConn->callbacks. + save_yourself_phase2_request.manager_data); + } + break; + case SM_SaveYourselfDone: if (!smsConn->save_yourself_in_progress) @@ -639,7 +701,7 @@ Bool swap; unsigned char errVal = pMsg->success; _IceErrorBadValue (iceConn, _SmsOpcode, - SM_SaveYourselfDone, 2, 1, &errVal); + SM_SaveYourselfDone, 2, 1, (IcePointer) &errVal); } else { |