/
isshlyapin
/
MIPT-CompTech-2ndCourse
Обзор
Документация
Войти
/
isshlyapin
/
MIPT-CompTech-2ndCourse
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
task2/include/duplex_pipe.h
21 строка
589 B
Шляпин Илья
Add task2 and change readme
02 окт 2024, 17:26
02 окт 2024, 17:26
9530485
Код
Авторство
О чём код?
#pragma once #include <stdio.h> typedef struct pPipe Pipe; typedef struct op_table Ops; struct op_table { ssize_t (*rcv)(Pipe *self); ssize_t (*snd)(Pipe *self); }; struct pPipe { char* data; // intermediate buffer size_t len; // data length in intermediate buffer int fd_direct[2]; // array of r/w descriptors for "pipe()" call (for parent-->child direction) int fd_back[2]; // array of r/w descriptors for "pipe()" call (for child-->parent direction) Ops actions; }; Pipe *ctor_pipe(void); int dtor_pipe(Pipe *pp);