#ifndef MPLIB1_BPO_QUEUE #define MPLIB1_BPO_QUEUE /* ******************************************************************************* * Copyright (c) 1996 Martin Poole * ******************************************************************************* ** ** WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! ** ** Any changes to be made to this file should first be checked with ** mplib1 source control for library integrity. ** ** mplib1 source control can be reached at mplib1@quatermass.co.uk ** * * $Source$ * $Author$ * $Date$ * $Revision$ * ******************************************************************************* * * Change History * * $Log$ * ******************************************************************************* */ #ident "$Header$" #ifndef MPLIB1_CONFIG #include #endif #ifndef MPLIB1_BPO_LOCK #include #endif #ifndef MPLIB1_BPO_LIST #include #endif #ifndef MPLIB1_BPO_INIT #include #endif #ifndef MPLIB1_BPO_ALLOC #include #endif #ifndef MPLIB1_BPO_PROC #include #endif /* ------------------------------------------------------------------ defines ------------------------------------------------------------------ */ #define Q_NM_UNKNOWN 0 #define Q_NM_NONE 1 #define Q_NM_PIPE 2 #ifndef BIT #define BIT(x) (1<<(x)) #endif #define Q_SOLE_READER BIT(0) #define Q_MULTI_READ BIT(1) #define Q_WRITER BIT(2) #define Q_PERSISTENT BIT(4) #define Q_DELETED BIT(8) #define Q_DEBUG BIT(15) #define Q_CHECK_ALL_QUEUES 1 #define Q_CHECK_THIS_QUEUE 2 #define Q_CHECK_DEAD_QUEUES 3 /* Return values to the validate processes inform call */ #define Q_LEAVE_QUEUE 0 #define Q_DELETE_QUEUE 1 #ifndef PID_STR_LEN #define PID_STR_LEN 12 #endif /* ------------------------------------------------------------------ structures ------------------------------------------------------------------ */ /* The following is for convenience only. On no account should user programs exmaine or modify this structure in any way. Hell, for all you know, I've changed the structure internally. Where would that get you ? */ struct bpo_Q { bpo_Node_t Q_Node; bpo_List_t Q_List; int Q_id; int Q_Count; int Q_max_count; int Q_notify; int Q_flags; pid_t Q_sole_pid; bpo_List_t Q_pid_r_list; char Q_name[1]; }; struct bpo_Q_Mesg { bpo_Node_t Q_Node; /* Node for linking to Q */ off_t reply_Q; /* offset to reply Q */ int reply_id; /* id of reply Q (sanity check) */ }; /* ------------------------------------------------------------------ function definitions ------------------------------------------------------------------ */ extern int mpPutMsg( const char *q_name, bpo_Node_t *q_node ); extern void *mpGetMsg( const char *q_name, const void *hint ); extern int mpReplyMsg( struct bpo_Q_Mesg *mesp ); extern int mpPostMsg( const char *q_name, struct bpo_Q_Mesg *mesp, struct bpo_Q *reply_q ); extern void * mpFindQ( const char *q_name, const void *hint ); extern int mpCheckQ( const char *q_name, const void *hint ); extern int mpWaitQ( const char *name, const void *hint ); extern struct bpo_Q * mpCreateQ( const void *hint, const char *q_name, int q_max, int q_flags, int q_mech ); extern void * bpo_send_and_get( const char *q_name, struct bpo_Q_Mesg *bpo_msg, struct bpo_Q *reply_q ); #endif /* -- End of File -- */