2
* playu.h -- $Id: playu.h 685 2003-03-08 15:26:51Z travo $
3
* UNIX-private portability layer declarations
5
* Copyright (c) 1998. See accompanying LEGAL file for details.
10
extern void (*u_on_idle)(void);
12
/* global objects used by main() for basic program flow control
13
* and ANSI C main() semantics */
14
extern int u_main_loop(int (*on_launch)(int,char**), int, char **);
15
extern int u_waiter(int wait);
16
extern void (*u_exception)(int signal, char *errmsg);
17
extern char *u_errmsg;
19
/* if set non-zero, p_abort will call this */
20
extern void (*u_abort_hook)(void);
22
extern void u_fpu_setup(int when);
24
/* arrange to call callback(context) when input or error arrives on fd
25
* - callback==0 cancels */
26
extern void u_event_src(int fd, void (*callback)(void *), void *context);
27
extern void u_prepoll(int (*conditional)(void *), void *context);
29
/* wait at most timeout milliseconds for input on any descriptor
30
* for which u_event_src has been called; timeout==-1 means forever
31
* - returns 0 on timeout or signal, 1 if callback made, <0 if error
32
* - at most one callback made per call to u_poll */
33
extern int u_poll(int timeout);
35
/* wait at most timeout milliseconds for input to arrive on fd only
36
* - returns 1 if input arrived, 0 if timeout or signal, <0 if error
37
* - no callback is made, you have to read fd after this if >0 */
38
extern int u_poll1(int fd, int timeout);
40
/* check whether this program is running in background */
41
extern int u_in_background(void);
43
/* expand ~ and $ENV_VAR in pathnames
44
* - return value is in p_wkspc, be careful not to clobber */
45
extern char *u_pathname(const char *pathname);
47
/* find argv[0] on PATH, track symbolic links to actual dir entry */
48
extern char *u_find_exe(const char *argv0);
49
extern char *u_track_link(const char *name);