Annotation of embedaddon/mpd/src/msg.h, revision 1.1.1.2
1.1 misho 1:
2: /*
3: * msg.h
4: *
5: * Written by Archie Cobbs <archie@freebsd.org>
6: * Copyright (c) 1995-1999 Whistle Communications, Inc. All rights reserved.
7: * See ``COPYRIGHT.whistle''
8: */
9:
10: #ifndef _MSG_H_
11: #define _MSG_H_
12:
13: /*
14: * DEFINITIONS
15: */
16:
17: /* Messages you can send to a link or a bundle */
18:
19: #define MSG_OPEN 1 /* Bring yourself up */
20: #define MSG_CLOSE 2 /* Bring yourself down */
21: #define MSG_UP 3 /* Lower layer went up */
22: #define MSG_DOWN 4 /* Lower layer went down */
23: #define MSG_SHUTDOWN 5 /* Object should disappear */
24:
1.1.1.2 ! misho 25: #ifndef SMALL_SYSTEM
! 26: #define MSG_QUEUE_LEN 8192 /* Internal messages queue length */
! 27: #define MSG_QUEUE_MASK 0x1FFF /* Mask for this length */
! 28: #else
! 29: #define MSG_QUEUE_LEN 512
! 30: #define MSG_QUEUE_MASK 0x1FF
! 31: #endif
! 32:
! 33: /*
! 34: * GLOBAL VARIABLES
! 35: */
! 36:
! 37: extern int gQThresMin, gQThresMax, gQThresDiff;
! 38:
1.1 misho 39: /* Forward decl */
40:
41: struct msghandler
42: {
43: void (*func)(int type, void *arg);
44: const char *dbg;
45: };
46:
47: typedef struct msghandler MsgHandler;
48:
49: /*
50: * FUNCTIONS
51: */
52:
53: #define MsgRegister(m, func) \
54: MsgRegister2(m, func, #func "()")
55: extern void MsgRegister2(MsgHandler *m, void (*func)(int typ, void *arg), const char *dbg);
56: extern void MsgUnRegister(MsgHandler *m);
57: extern void MsgSend(MsgHandler *m, int type, void *arg);
58: extern const char *MsgName(int msg);
59:
60: #endif
61:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>