Coda Distributed File System
bbuf.h
Go to the documentation of this file.
1#ifndef _BLURB_
2#define _BLURB_
3/*
4
5 Coda: an Experimental Distributed File System
6 Release 6
7
8 Copyright (c) 1987-2003 Carnegie Mellon University
9 All Rights Reserved
10
11Permission to use, copy, modify and distribute this software and its
12documentation is hereby granted, provided that both the copyright
13notice and this permission notice appear in all copies of the
14software, derivative works or modified versions, and any portions
15thereof, and that both notices appear in supporting documentation, and
16that credit is given to Carnegie Mellon University in all documents
17and publicity pertaining to direct or indirect use of this code or its
18derivatives.
19
20CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
21SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
22FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
23DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
24RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
25ANY DERIVATIVE WORK.
26
27Carnegie Mellon encourages users of this software to return any
28improvements or extensions that they make, and to grant Carnegie
29Mellon the rights to redistribute these changes without encumbrance.
30*/
31#endif /*_BLURB_*/
32
33// bbuf1.h
34//
35// class and method defns for the bbuf
36
37#ifndef _BBUF_H_
38#define _BBUF_H_
39
41{
44 BBUFOK
45};
46
47// parameterized types would be *so* much easier (grumble)
48
50
51class bbuf {
52 bbuf_item *buf;
53 int bnd;
54 int head, tail, count;
55 int low_fuel_mark; // point at which you stop spooling out.;
56 bool dbg;
57 MUTEX lock; // simple mutex scheme - maybe change later;
58 CONDITION low_fuel; // signal spool out threads;
59 CONDITION full_tank; // signal spool in threads;
60 void bbuf_error(char *, int);
61
62public:
63 bool full(void);
64 bool empty(void);
67 // void print_it(void);
68 void debug(bool);
69 void flush_the_tank(void);
70 bbuf(int, int = 0);
71 ~bbuf(void);
72 inline void examine(void)
73 {
74 fprintf(stderr, "head %d, tail %d, count %d\n", head, tail, count);
75 }
76};
77
78#endif _BBUF_H_
vmon_data * bbuf_item
Definition: bbuf.h:49
BbufStatus
Definition: bbuf.h:41
@ BBUFOK
Definition: bbuf.h:44
@ EBBUFMT
Definition: bbuf.h:42
@ EBBUFFL
Definition: bbuf.h:43
Definition: bbuf.h:51
bool full(void)
Definition: bbuf.c:147
BbufStatus remove(bbuf_item *)
Definition: bbuf.c:127
bbuf(int, int=0)
Definition: bbuf.c:81
void examine(void)
Definition: bbuf.h:72
void debug(bool)
Definition: bbuf.c:209
~bbuf(void)
Definition: bbuf.c:95
void flush_the_tank(void)
Definition: bbuf.c:171
BbufStatus insert(bbuf_item)
Definition: bbuf.c:104
bool empty(void)
Definition: bbuf.c:159
Definition: data.h:115
PROC * tail
Definition: util.c:74
PROC * head
Definition: util.c:73
char * CONDITION
Definition: mondgen.h:47
stderr
Definition: gensrvstats.py:48
fprintf(outFile, "Tag: SMARTFTP\n")
Definition: lock.h:68