2016-05-30 23:58:58 -04:00
|
|
|
#pragma once
|
2016-05-19 10:41:06 -04:00
|
|
|
|
2016-06-14 23:32:35 -04:00
|
|
|
#include "common.hpp"
|
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS
|
2016-06-14 23:32:35 -04:00
|
|
|
|
|
|
|
namespace io_util {
|
2017-01-01 02:58:33 -05:00
|
|
|
string read(int read_fd, size_t bytes_to_read);
|
2016-11-02 15:22:45 -04:00
|
|
|
string readline(int read_fd);
|
2016-06-14 23:32:35 -04:00
|
|
|
|
2017-01-01 02:58:33 -05:00
|
|
|
size_t write(int write_fd, size_t bytes_to_write, const string& data);
|
2016-11-25 07:55:15 -05:00
|
|
|
size_t writeline(int write_fd, const string& data);
|
2016-05-19 10:41:06 -04:00
|
|
|
|
2016-11-25 07:55:15 -05:00
|
|
|
void tail(int read_fd, const function<void(string)>& callback);
|
2016-11-02 15:22:45 -04:00
|
|
|
void tail(int read_fd, int writeback_fd);
|
2016-05-19 10:41:06 -04:00
|
|
|
|
2017-01-11 12:15:46 -05:00
|
|
|
bool poll(int fd, short int events, int timeout_ms = 0);
|
|
|
|
bool poll_read(int fd, int timeout_ms = 0);
|
|
|
|
bool poll_write(int fd, int timeout_ms = 0);
|
2016-05-19 10:41:06 -04:00
|
|
|
|
2016-11-03 14:01:45 -04:00
|
|
|
bool interrupt_read(int write_fd);
|
2016-12-25 13:58:52 -05:00
|
|
|
|
|
|
|
void set_block(int fd);
|
|
|
|
void set_nonblock(int fd);
|
2016-05-19 10:41:06 -04:00
|
|
|
}
|
2016-06-14 23:32:35 -04:00
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS_END
|