2
* ugetc.h -- $Id: ugetc.h 685 2003-03-08 15:26:51Z travo $
3
* play interface for non-event-driven programs
4
* -- incompatible with p_stdinit/p_stdout functions
6
* Copyright (c) 1998. See accompanying LEGAL file for details.
9
/* assumes <stdio.h> has been included */
13
/* non-play main programs may be able to use these as drop-in
14
* replacements for getc and/or fgets in order to use gist
15
* - in particular, u_getc can be the readline rl_getc_function
16
* - u_waitfor and u_wait_stdin return 0 if input available
17
* - such programs must also define u_abort_hook as appropriate
18
* - the code may call u_pending_events() to handle all pending
19
* events and expired alarms without blocking */
20
extern int u_getc(FILE *stream);
21
extern char *u_fgets(char *s, int size, FILE *stream);
22
extern int u_waitfor(FILE *stream);
24
/* call p_pending_events() to handle all pending
25
* events and expired alarms without blocking
26
* call p_wait_while to set a flag and wait for play graphics events
27
* until flag is reset to zero
28
* call p_xhandler to set abort_hook and on_exception routines
29
* a less obtrusive alternative to p_handler */
30
extern void p_pending_events(void);
31
extern void p_wait_while(int *flag);
32
extern void p_xhandler(void (*abort_hook)(void),
33
void (*on_exception)(int signal, char *errmsg));
34
extern int p_wait_stdin(void);