/usr/include/udport/udfifo.h is in libxgks-dev 2.6.1+dfsg.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | /*
* $Id: udfifo.h,v 1.1 2000/08/07 23:15:04 emmerson Exp $
*/
#ifndef UD_FIFO_H
#define UD_FIFO_H
#include "udposix.h"
#include <stddef.h>
/*
* FIFO access mode:
*/
#define UDFIFO_FORCE 1 /* discard oldest if necessary */
/*
* FIFO data structure. WARNING: Private definition: don't depend on the
* details of this structure!
*/
struct Udfifo {
const char *cookie; /* valid-structure cookie */
size_t eltsize; /* size of an element */
int mode; /* access mode */
int maxelts; /* size of FIFO in elements */
int count; /* current number of elements */
char *tail; /* destination for next put() */
char *head; /* source for next get() */
char *end; /* end of buffer */
char *buf; /* element buffer */
};
typedef struct Udfifo Udfifo;
/*
* Return values:
*/
#define UDFIFO_EFAILURE -1
#define UDFIFO_ESUCCESS 0
#define UDFIFO_EFORCED 1 /* success, but oldest element discarded */
/*
* Initialize a FIFO.
*/
UD_EXTERN_FUNC(
void udfifo_init, ( /* success or failure */
Udfifo *fifo, /* the FIFO */
size_t eltsize, /* size of an element in bytes */
int numelts /* maximum number of elements */
));
/*
* Set the mode of a FIFO.
*/
UD_EXTERN_FUNC(
int udfifo_setmode, (
Udfifo *fifo, /* the FIFO */
int mode /* UDFIFO_FORCE => discard oldest */
));
/*
* Add to a FIFO.
*/
UD_EXTERN_FUNC(
int udfifo_put, (
Udfifo *fifo, /* the FIFO */
const void *new, /* the element to add */
void *old /* (mode == UDFIFO_FORCE && old != NULL) =>
* discarded oldest element */
));
/*
* Remove from a FIFO.
*/
UD_EXTERN_FUNC(
int udfifo_get, (
Udfifo *fifo, /* the FIFO */
void *old /* old != NULL => the oldest element */
));
/*
* Return the number of elements in a FIFO.
*/
UD_EXTERN_FUNC(
int udfifo_count, (
const Udfifo *fifo /* the FIFO */
));
/*
* Return the number of empty spaces in a FIFO in elements.
*/
UD_EXTERN_FUNC(
int udfifo_space, (
const Udfifo *fifo /* the FIFO */
));
/*
* Destroy a FIFO.
*/
UD_EXTERN_FUNC(
void udfifo_destroy, (
Udfifo *fifo /* the FIFO */
));
#endif /* UD_FIFO_H not defined above */
|