World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл fifo.h

См. исходные тексты.

Классы

struct  AVFifoBuffer
 

Определения типов

typedef struct AVFifoBuffer AVFifoBuffer
 

Функции

AVFifoBufferav_fifo_alloc (unsigned int size)
 
AVFifoBufferav_fifo_alloc_array (size_t nmemb, size_t size)
 
void av_fifo_free (AVFifoBuffer *f)
 
void av_fifo_freep (AVFifoBuffer **f)
 
void av_fifo_reset (AVFifoBuffer *f)
 
int av_fifo_size (const AVFifoBuffer *f)
 
int av_fifo_space (const AVFifoBuffer *f)
 
int av_fifo_generic_peek_at (AVFifoBuffer *f, void *dest, int offset, int buf_size, void(*func)(void *, void *, int))
 
int av_fifo_generic_peek (AVFifoBuffer *f, void *dest, int buf_size, void(*func)(void *, void *, int))
 
int av_fifo_generic_read (AVFifoBuffer *f, void *dest, int buf_size, void(*func)(void *, void *, int))
 
int av_fifo_generic_write (AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))
 
int av_fifo_realloc2 (AVFifoBuffer *f, unsigned int size)
 
int av_fifo_grow (AVFifoBuffer *f, unsigned int additional_space)
 
void av_fifo_drain (AVFifoBuffer *f, int size)
 
static uint8_tav_fifo_peek2 (const AVFifoBuffer *f, int offs)
 

Подробное описание

a very simple circular buffer FIFO implementation

См. определение в файле fifo.h

Типы

◆ AVFifoBuffer

typedef struct AVFifoBuffer AVFifoBuffer

Функции

◆ av_fifo_alloc()

AVFifoBuffer* av_fifo_alloc ( unsigned int  size)

Initialize an AVFifoBuffer.

Аргументы
sizeof FIFO
Возвращает
AVFifoBuffer or NULL in case of memory allocation failure

◆ av_fifo_alloc_array()

AVFifoBuffer* av_fifo_alloc_array ( size_t  nmemb,
size_t  size 
)

Initialize an AVFifoBuffer.

Аргументы
nmembnumber of elements
sizesize of the single element
Возвращает
AVFifoBuffer or NULL in case of memory allocation failure

◆ av_fifo_free()

void av_fifo_free ( AVFifoBuffer f)

Free an AVFifoBuffer.

Аргументы
fAVFifoBuffer to free

◆ av_fifo_freep()

void av_fifo_freep ( AVFifoBuffer **  f)

Free an AVFifoBuffer and reset pointer to NULL.

Аргументы
fAVFifoBuffer to free

◆ av_fifo_reset()

void av_fifo_reset ( AVFifoBuffer f)

Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.

Аргументы
fAVFifoBuffer to reset

◆ av_fifo_size()

int av_fifo_size ( const AVFifoBuffer f)

Return the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from it.

Аргументы
fAVFifoBuffer to read from
Возвращает
size

◆ av_fifo_space()

int av_fifo_space ( const AVFifoBuffer f)

Return the amount of space in bytes in the AVFifoBuffer, that is the amount of data you can write into it.

Аргументы
fAVFifoBuffer to write into
Возвращает
size

◆ av_fifo_generic_peek_at()

int av_fifo_generic_peek_at ( AVFifoBuffer f,
void dest,
int  offset,
int  buf_size,
void(*)(void *, void *, int)  func 
)

Feed data at specific position from an AVFifoBuffer to a user-supplied callback. Similar as av_fifo_gereric_read but without discarding data.

Аргументы
fAVFifoBuffer to read from
offsetoffset from current read position
buf_sizenumber of bytes to read
funcgeneric read function
destdata destination

◆ av_fifo_generic_peek()

int av_fifo_generic_peek ( AVFifoBuffer f,
void dest,
int  buf_size,
void(*)(void *, void *, int)  func 
)

Feed data from an AVFifoBuffer to a user-supplied callback. Similar as av_fifo_gereric_read but without discarding data.

Аргументы
fAVFifoBuffer to read from
buf_sizenumber of bytes to read
funcgeneric read function
destdata destination

◆ av_fifo_generic_read()

int av_fifo_generic_read ( AVFifoBuffer f,
void dest,
int  buf_size,
void(*)(void *, void *, int)  func 
)

Feed data from an AVFifoBuffer to a user-supplied callback.

Аргументы
fAVFifoBuffer to read from
buf_sizenumber of bytes to read
funcgeneric read function
destdata destination

◆ av_fifo_generic_write()

int av_fifo_generic_write ( AVFifoBuffer f,
void src,
int  size,
int(*)(void *, void *, int)  func 
)

Feed data from a user-supplied callback to an AVFifoBuffer.

Аргументы
fAVFifoBuffer to write to
srcdata source; non-const since it may be used as a modifiable context by the function defined in func
sizenumber of bytes to write
funcgeneric write function; the first parameter is src, the second is dest_buf, the third is dest_buf_size. func must return the number of bytes written to dest_buf, or <= 0 to indicate no more data available to write. If func is NULL, src is interpreted as a simple byte array for source data.
Возвращает
the number of bytes written to the FIFO

◆ av_fifo_realloc2()

int av_fifo_realloc2 ( AVFifoBuffer f,
unsigned int  size 
)

Resize an AVFifoBuffer. In case of reallocation failure, the old FIFO is kept unchanged.

Аргументы
fAVFifoBuffer to resize
sizenew AVFifoBuffer size in bytes
Возвращает
<0 for failure, >=0 otherwise

◆ av_fifo_grow()

int av_fifo_grow ( AVFifoBuffer f,
unsigned int  additional_space 
)

Enlarge an AVFifoBuffer. In case of reallocation failure, the old FIFO is kept unchanged. The new fifo size may be larger than the requested size.

Аргументы
fAVFifoBuffer to resize
additional_spacethe amount of space in bytes to allocate in addition to av_fifo_size()
Возвращает
<0 for failure, >=0 otherwise

◆ av_fifo_drain()

void av_fifo_drain ( AVFifoBuffer f,
int  size 
)

Read and discard the specified amount of data from an AVFifoBuffer.

Аргументы
fAVFifoBuffer to read from
sizeamount of data to read in bytes

◆ av_fifo_peek2()

static uint8_t* av_fifo_peek2 ( const AVFifoBuffer f,
int  offs 
)
inlinestatic

Return a pointer to the data stored in a FIFO buffer at a certain offset. The FIFO buffer is not modified.

Аргументы
fAVFifoBuffer to peek at, f must be non-NULL
offsan offset in bytes, its absolute value must be less than the used buffer size or the returned pointer will point outside to the buffer data. The used buffer size can be checked with av_fifo_size().

См. определение в файле fifo.h строка 169

170 {
171  uint8_t *ptr = f->rptr + offs;
172  if (ptr >= f->end)
173  ptr = f->buffer + (ptr - f->end);
174  else if (ptr < f->buffer)
175  ptr = f->end - (f->buffer - ptr);
176  return ptr;
177 }
buffer
EGLContext EGLenum EGLClientBuffer buffer
Definition: SDL_egl.h:952
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
uint8_t
unsigned __int8 uint8_t
Definition: SDL_config.h:35