51 bool ret = (*i.
head == 0);
62 while (pointer < i.
space.
end() && *pointer != terminal) pointer++;
65 size_t n = pointer - i.
head;
81 return readto(i, pointer, terminal);
83 return readto(i, pointer, terminal);
86 size_t n = pointer - i.
head;
120 const int _nhandle = _getmaxstdio() / 2;
121 return f >= _nhandle;
123 const int _nhandle = 32;
124 return f >= _nhandle;
132 return recv(f, reinterpret_cast<char*>(buf), static_cast<int>(nbytes), 0);
134 return _read(f, buf, (
unsigned int)nbytes);
136 return read(f, buf, (
unsigned int)nbytes);
144 return send(f, reinterpret_cast<const char*>(buf), static_cast<int>(nbytes), 0);
146 return _write(f, buf, (
unsigned int)nbytes);
148 return write(f, buf, (
unsigned int)nbytes);
void resize(size_t length)
static ssize_t write_file_or_socket(int f, const void *buf, size_t nbytes)
static bool is_socket(int f)
static void close_file_or_socket(int f)
size_t readto(io_buf &i, char *&pointer, char terminal)
static ssize_t read_file_or_socket(int f, void *buf, size_t nbytes)
void buf_write(char *&pointer, size_t n)
size_t buf_read(char *&pointer, size_t n)