The X9.31 Sample Program

Surrendering Control

The following function, included as part of x931.c, can be used whenever an action may take a long time, and you need a mechanism for surrendering control.

/*

General Surrender Function

*/

/*

==========================

*/

int GeneralSurrenderFunction (handle) POINTER handle;

{

char s[100];

static time_t currentTime; time_t getTime;

if ((int)*handle == 0) { getTime = time(NULL);

strftime (s, 100, "%H:%M:%S on %A, %d %B %Y", localtime(&getTime)); printf ("\n%s\n", s);

printf ("Surrender function ...\n"); *handle = 1;

time (¤tTime);

}

else {

time (&getTime);

if (currentTime != getTime) { printf (" ."); currentTime = getTime;

}

}

return (0);

} /* end GeneralSurrenderFunction */

C h a p t e r 9 P u t t i n g I t A l l To g e t h e r : A n X 9 . 3 1 E x a m p l e

3 2 5

Page 347
Image 347
RSA Security 5.2.2 manual Surrendering Control, Return End GeneralSurrenderFunction