Annotation of embedaddon/mpd/src/msg.h, revision 1.1
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:
! 25: /* Forward decl */
! 26:
! 27: struct msghandler
! 28: {
! 29: void (*func)(int type, void *arg);
! 30: const char *dbg;
! 31: };
! 32:
! 33: typedef struct msghandler MsgHandler;
! 34:
! 35: /*
! 36: * FUNCTIONS
! 37: */
! 38:
! 39: #define MsgRegister(m, func) \
! 40: MsgRegister2(m, func, #func "()")
! 41: extern void MsgRegister2(MsgHandler *m, void (*func)(int typ, void *arg), const char *dbg);
! 42: extern void MsgUnRegister(MsgHandler *m);
! 43: extern void MsgSend(MsgHandler *m, int type, void *arg);
! 44: extern const char *MsgName(int msg);
! 45:
! 46: #endif
! 47:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>