fifo buffer implementation in C - No Talking - Task Based

preview_player
Показать описание
A simple fifo buffer implementation. Task in the Description⬇️

Task

struct s_fifo_buffer {
unsigned char *beg;
unsigned char *end;
unsigned char *tail_ptr;
unsigned char *head_ptr;
} t_fifo_buffer;

Function name : send
Prototype : int send(unsigned char * buf, int len);
Parameters : buf: buffer pointer to fill FIFO buffer
len: it is indicate how many byte take from buf variable.
Return value : The length of data written on FIFO buffer.
Description : Fill the FIFO buffer with buf variable comes as parameter.

Function name : bufRead
Prototype : int bufRead(unsigned char *buf);
Parameters : buf: buffer pointer to get from FIFO buffer
Return value : The lentgh of data read from FIFO buffer.
Description : Read data from FIFO buffer as len as.

00:00 definations
01:45 init function
02:21 next_ptr function
03:42 send function
04:57 bufRead function
07:38 main and testing

Happy Coding!

#cprogramming #computerscience #computerfundamentals

My Equipments
💻Huawei Matebook 13
🖱️Logitech M100
Рекомендации по теме
welcome to shbcf.ru