1996-11-02 10:00:46 -08:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Objective Caml */
|
|
|
|
/* */
|
|
|
|
/* Damien Doligez, projet Para, INRIA Rocquencourt */
|
|
|
|
/* */
|
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
1999-11-17 10:59:06 -08:00
|
|
|
/* en Automatique. All rights reserved. This file is distributed */
|
|
|
|
/* under the terms of the GNU Library General Public License. */
|
1996-11-02 10:00:46 -08:00
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
#ifndef _rotatecursor_
|
|
|
|
#define _rotatecursor_
|
|
|
|
|
1999-11-08 09:11:23 -08:00
|
|
|
/* [rotatecursor_flag] will be automagically set to 1 when the time comes
|
|
|
|
to call [rotatecursor_action].
|
|
|
|
*/
|
|
|
|
extern int volatile rotatecursor_flag;
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
1999-11-08 09:11:23 -08:00
|
|
|
/* Use [rotatecursor_options] to set advanced parameters:
|
|
|
|
|
|
|
|
1. [p1] is a pointer to another variable that will be set to 1 when
|
|
|
|
the time is up, unless it is already nonzero. Typical use is when
|
|
|
|
you already have a variable in your program that is set
|
|
|
|
asynchronously for something else, and you want to avoid testing
|
|
|
|
two different variables in your inner loop. Pass NULL if you don't
|
|
|
|
need this feature.
|
|
|
|
|
|
|
|
2. [period] is the interval (in milliseconds) between calls to
|
|
|
|
RotateCursor. Reasonable values are between 10 and 200;
|
|
|
|
the default is 50.
|
1996-11-02 10:00:46 -08:00
|
|
|
*/
|
1999-11-08 09:11:23 -08:00
|
|
|
void rotatecursor_options (int volatile *p1, int period);
|
1996-11-02 10:00:46 -08:00
|
|
|
|
1997-11-12 10:59:32 -08:00
|
|
|
/* [reverse] is 0 to rotate the cursor clockwise, anything else to
|
1999-11-08 09:11:23 -08:00
|
|
|
rotate counterclockwise. This function resets [rotatecursor_flag]
|
|
|
|
to 0.
|
|
|
|
This function always returns 0. It returns an int so you can use
|
|
|
|
it in an expression as well as a statement. Useful for some macros.
|
1996-11-02 10:00:46 -08:00
|
|
|
*/
|
1997-11-12 10:59:32 -08:00
|
|
|
int rotatecursor_action (int reverse);
|
1996-11-02 10:00:46 -08:00
|
|
|
|
1999-11-08 09:11:23 -08:00
|
|
|
/* Simple interface to [rotatecursor_flag] and [rotatecursor_action].
|
|
|
|
Can be used as a statement (followed by a semicolon) or in an
|
|
|
|
expression (followed by a comma).
|
|
|
|
*/
|
|
|
|
#define ROTATECURSOR_MAGIC() (rotatecursor_flag ? rotatecursor_action (0) : 0)
|
|
|
|
|
1996-11-02 10:00:46 -08:00
|
|
|
#endif /* _rotatecursor_ */
|