/usr/include/udport/udfifo_err.h is in libxgks-dev 2.6.1+dfsg.2-4+b1.
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 | /*
* $Id: udfifo_err.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 {
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 *buf; /* element buffer */
char *end; /* end of buffer */
};
typedef struct Udfifo Udfifo;
/*
* Return values:
*/
#define UDFIFO_ENOENT -4 /* no entry */
#define UDFIFO_ENOSPC -3 /* insufficient space */
#define UDFIFO_ENOMEM -2 /* insufficient memory */
#define UDFIFO_EINVAL -1 /* invalid argument */
#define UDFIFO_ESUCCESS 0 /* success */
#define UDFIFO_EFORCED 1 /* success, but oldest element discarded */
/*
* Initialize a FIFO.
*/
UD_EXTERN_FUNC(
int udfifo_init, ( /* success or failure */
Udfifo *fifo, /* the FIFO */
size_t eltsize, /* size of an element in bytes */
int numelts, /* maximum number of elements */
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_SUCCESS or UDFIFO_FAILURE */
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(
int udfifo_destroy, (
Udfifo *fifo /* the FIFO */
));
#endif /* UD_FIFO_H not defined above */
|