#ifndef __READ_UTILS_H__ #define __READ_UTILS_H__ #ifdef __cplusplus extern "C" { #endif /************************************************************* * 功能: 设定的时间内读取数据 **************************************************************/ int read_data_until_time(int fd, char *buffer, int len, int timeout_first, int timeout_interval); /************************************************************* * 功能: 读一串至截止字符的字符串,在设定的时间内读不到数据则函数返回 **************************************************************/ int read_data_until_char(int fd, char *buffer, int len, char until, int timeout_first, int timeout_interval); /************************************************************* * 功能: 读一串至截止字符串的字符串,在设定的时间内读不到数据则函数返回 **************************************************************/ int read_data_until_str(int fd, char *buffer, int len, char *until, int until_len, int timeout_first, int timeout_interval); #ifdef __cplusplus } #endif #endif