12 #include <sys/types.h>
17 #define DT_QCONTROL_VALID 0
18 #define DT_QCONTROL_DEAD_SPACE 1
19 #define DT_QCONTROL_END 2
21 #define DtSMQFrontLockSem 0
22 #define DtSMQPacketCountSem 1
28 #define DtSMQByteCountSem 0
30 #define DtCsSemaphoresUsed 2
32 #define DtSMQDontGoYet 0
33 #define DtSMQIAmGoingAway 1
34 #define DtSMQYouMustGoAway 2
36 #define DtSMQExternal 0
37 #define DtSMQInternal 1
39 #ifdef DtUSE_UTILITIES_NAMESPACE
40 namespace DtUSE_UTILITIES_NAMESPACE
65 unsigned char internal;
91 bool pleaseInit,
bool dropOldest);
95 void setBlockingRead(
bool mode)
96 { queue->hdr.blockingRead = mode ? 1 : 0; }
98 void setBlockingWrite(
bool mode)
99 { queue->hdr.blockingWrite = mode ? 1 : 0; }
101 bool isBlockingRead()
102 {
return queue->hdr.blockingRead ?
true :
false; }
104 bool isBlockingWrite()
105 {
return queue->hdr.blockingWrite ?
true :
false; }
108 {
return queue->hdr.dropOldest ?
true :
false; }
112 DtU32 notifyReader();
118 int lockFront(
int wait);
119 void unlockFront(
void);
121 void incrPacketCount(
int amount);
122 void incrByteCount(
int amount);
123 void decrByteCount(
int amount);
124 void decrPacketCount(
int amount);
128 void setFront(
int newFront) { queue->hdr.front = newFront; }
131 void setGoAway(
int reason) { queue->hdr.goAway = reason; }
133 void setDropOldest(
bool mode)
134 { queue->hdr.dropOldest = mode ? 1 : 0; }
137 bool isInternal() {
return queue->hdr.internal ?
true :
false; }
149 struct sembuf testAndSetLock;
150 struct sembuf clearLock;
151 struct sembuf addBytes;
152 struct sembuf subBytes;
153 struct sembuf addPackets;
154 struct sembuf subPackets;
159 #ifdef DtUSE_UTILITIES_NAMESPACE