1 /****************************************************************************
3 ** Program: pipe-handler - an AmigaDOS handler for named pipes
5 ** Author: Ed Puckett qix@mit-oz
7 ** Copyright 1987 by EpAc Software. All Rights Reserved.
9 ** History: 05-Jan-87 Original Version (1.0)
14 #define MAX_PIPELEN (1L << 24)
18 typedef struct pipebuf
19 { ULONG head
, /* index of first character */
20 tail
; /* index of last character */
21 BYTE full
; /* flag - takes care of full/empty ambiguity */
22 ULONG len
; /* length of buffer */
23 BYTE buf
[1]; /* buffer proceeds from here */
29 #define PipebufEmpty(pb) (((pb)->head == (pb)->tail) && (! (pb)->full))
30 #define PipebufFull(pb) (((pb)->head == (pb)->tail) && ((pb)->full))
31 #define FreePipebuf(pb) (FreeMem ((pb), sizeof (PIPEBUF) - 1 + (pb)->len))
35 extern PIPEBUF
*AllocPipebuf ( /* len */ );
36 extern ULONG
MoveFromPipebuf ( /* pb, dest, amt */ );
37 extern ULONG
MoveToPipebuf ( /* pb, src, amt */ );