[ Index ]
[ Bottom ]
Circ v5 (Part 2)
[ Top
| Index
| Bottom
]
char* CircLocateAhead (int cid, int *number, int *size)
-------------------------------------------------------
Locate the next not yet located event in the circular buffer. This
function behaves mainly like CircLocate() but allows to locate events
in advance for parallel execution.
Note: Events can only be released in sequence. Your code must handle
this case correctly! You must call CircReleaseAhead() to release
an event.
cid : circular buffer id returned by CircOpen().
number: number of this event.
size : size in bytes of this event.
Return Values:
pointer where this event was located.
(char*)-1 if there is no more event available.
[ Top
| Index
| Bottom
]
int CircReleaseAhead (int cid)
------------------------------
Release latest event located with CircLocateAhead() and free space in
circular buffer.
cid: circular buffer id returned by CircOpen().
Return Values:
= 0 if everything was ok.
< 0 in case of error(s).
[ Top
| Index
| Bottom
]
int CircPutParam (int cid, int number, char *buf, int size, int setready)
----------------------------------------------------------------------
Put an event into the circular buffer. Actually CircReserve(), memcpy()
and CircValidateParam() are used. Convenient to copy data into the circular
buffer.
WARNING: See CircValidateParam
cid : circular buffer id returned by CircOpen() or CircOpenMulti().
number : number of this event.
buf : pointer to event buffer.
size : event lenght.
setready : if true(!=0), the event can be read from the circular buffer
(same as CircPut)
else, the event will be ready for reading after a call to CircCondConfirm
(same as CircCondPut)
Return Values:
>=0 if everything was ok.
< 0 in case of error(s).
[ Top
| Index
| Bottom
]
int CircPut (int cid, int number, char *buf, int size)
------------------------------------------------------
Put an event into the circular buffer. Actually CircReserve(), memcpy()
and CircValidate() are used. Convenient to copy data into the circular
buffer.
cid : circular buffer id returned by CircOpen() or CircOpenMulti().
number: number of this event.
buf : pointer to event buffer.
size : event lenght.
Return Values:
>=0 if everything was ok.
< 0 in case of error(s).
[ Top
| Index
| Bottom
]
int CircCondPut (int cid, int number, char *buf, int size)
----------------------------------------------------------
Conditionaly put an event into the circular buffer. Actually CircReserve(),
memcpy() and CircCondValidate() are used. Convenient to copy data into the
circular buffer.
WARNING: See CircCondValidate
cid : circular buffer id returned by CircOpen() or CircOpenMulti().
number: number of this event.
buf : pointer to event buffer.
size : event lenght.
Return Values:
>=0 if everything was ok.
< 0 in case of error(s).
[ Top
| Index
| Bottom
]
int CircGet (int cid, int *number, char *buf, int max_len)
----------------------------------------------------------
Get an event from the circular buffer. CircLocate(), memcpy() and CircRelease()
are used to implement this function. Convenient to copy data out of
the circular buffer.
cid : circular buffer id returned by CircOpen() or CircOpenMulti().
number : number of this event.
buf : pointer to event buffer.
max_len: maximum event lenght.
Return Values:
length of event if everything was ok.
< 0 in case of error(s).
[ Top
| Index
| Bottom
]
char* CircSearch (int cid, int *number, int *size)
--------------------------------------------------
Locate the next event in the circular buffer newer than the last processed.
cid : circular buffer id returned by CircOpen() or CircOpenMulti().
number: Input/output data
input = number of the last processed event
output number of the event found
size : size in bytes of event found.
Return values:
pointer where event was found.
(char*)-1 if no events available (buffer empty).
[ Top
| Index
| Bottom
]
int CircCopied (int cid,char* eventptr)
---------------------------------------
Release latest event processed by monitoring deamon.
cid: circular buffer id returned by CircOpen() or CircOpenMulti().
eventptr is a pointer to the event returned by CircSearch().
Return Values:
= 0 if everything was ok.
< 0 in case of error(s).
[ Top
| Index
| Bottom
]
Circ.h
The header file for package Circ: Should be included by
each application using the circular buffer interface!
[ Index ]
[ Top ]
Created 10/12/98 08:24 by
source2html v0.9