source: branches/minix3-book/include/minix/sysutil.h

Last change on this file was 4, checked in by Mattia Monga, 14 years ago

Importazione sorgenti libro

File size: 1.9 KB
Line 
1#ifndef _EXTRALIB_H
2#define _EXTRALIB_H
3
4/* Extra system library definitions to support device drivers and servers.
5 *
6 * Created:
7 * Mar 15, 2004 by Jorrit N. Herder
8 *
9 * Changes:
10 * May 31, 2005: added printf, kputc (relocated from syslib)
11 * May 31, 2005: added getuptime
12 * Mar 18, 2005: added tickdelay
13 * Oct 01, 2004: added env_parse, env_prefix, env_panic
14 * Jul 13, 2004: added fkey_ctl
15 * Apr 28, 2004: added report, panic
16 * Mar 31, 2004: setup like other libraries, such as syslib
17 */
18
19/*==========================================================================*
20 * Miscellaneous helper functions.
21 *==========================================================================*/
22
23/* Environment parsing return values. */
24#define EP_BUF_SIZE 128 /* local buffer for env value */
25#define EP_UNSET 0 /* variable not set */
26#define EP_OFF 1 /* var = off */
27#define EP_ON 2 /* var = on (or field left blank) */
28#define EP_SET 3 /* var = 1:2:3 (nonblank field) */
29#define EP_EGETKENV 4 /* sys_getkenv() failed ... */
30
31_PROTOTYPE( void env_setargs, (int argc, char *argv[]) );
32_PROTOTYPE( int env_get_param, (char *key, char *value, int max_size) );
33_PROTOTYPE( int env_prefix, (char *env, char *prefix) );
34_PROTOTYPE( void env_panic, (char *key) );
35_PROTOTYPE( int env_parse, (char *env, char *fmt, int field, long *param,
36 long min, long max) );
37
38#define fkey_map(fkeys, sfkeys) fkey_ctl(FKEY_MAP, (fkeys), (sfkeys))
39#define fkey_unmap(fkeys, sfkeys) fkey_ctl(FKEY_UNMAP, (fkeys), (sfkeys))
40#define fkey_events(fkeys, sfkeys) fkey_ctl(FKEY_EVENTS, (fkeys), (sfkeys))
41_PROTOTYPE( int fkey_ctl, (int req, int *fkeys, int *sfkeys) );
42
43_PROTOTYPE( int printf, (const char *fmt, ...));
44_PROTOTYPE( void kputc, (int c));
45_PROTOTYPE( void report, (char *who, char *mess, int num));
46_PROTOTYPE( void panic, (char *who, char *mess, int num));
47_PROTOTYPE( int getuptime, (clock_t *ticks));
48_PROTOTYPE( int tickdelay, (clock_t ticks));
49
50#endif /* _EXTRALIB_H */
51
Note: See TracBrowser for help on using the repository browser.