#ifndef KPTY_H
#define KPTY_H

#include <stdint.h>
#include <lib/ringbuf.h>
#include <vfs.h>

typedef struct {

} wait_queue_t;

typedef struct {
    ring_buf_t master_rb;
    ring_buf_t slave_rb;
    wait_queue_t master_wq;
    wait_queue_t slave_wq;
    uint32_t flags;
    uint32_t pid;
} pty_t;

uint32_t pty_master_read(struct vfs_node* node, uint32_t offset, uint32_t size, uint8_t* buffer);
uint32_t pty_master_write(struct vfs_node* node, uint32_t offset, uint32_t size, uint8_t* buffer);

uint32_t pty_slave_read(struct vfs_node* node, uint32_t offset, uint32_t size, uint8_t* buffer);
uint32_t pty_slave_write(struct vfs_node* node, uint32_t offset, uint32_t size, uint8_t* buffer);

#endif