Home | History | Annotate | Download | only in adb

Lines Matching refs:FH

51 typedef struct FHRec_* FH;
55 void (*_fh_init)(FH);
56 int (*_fh_close)(FH);
57 int (*_fh_lseek)(FH, int, int);
58 int (*_fh_read)(FH, void*, int);
59 int (*_fh_write)(FH, const void*, int);
62 static void _fh_file_init(FH);
63 static int _fh_file_close(FH);
64 static int _fh_file_lseek(FH, int, int);
65 static int _fh_file_read(FH, void*, int);
66 static int _fh_file_write(FH, const void*, int);
76 static void _fh_socket_init(FH);
77 static int _fh_socket_close(FH);
78 static int _fh_socket_lseek(FH, int, int);
79 static int _fh_socket_read(FH, void*, int);
80 static int _fh_socket_write(FH, const void*, int);
142 static FH
145 FH f;
170 _fh_to_int( FH f )
178 static FH
181 FH f = NULL;
205 _fh_close( FH f )
208 // allocate a FH that we're in the middle of closing.
229 void operator()(struct FHRec_* fh) {
235 _fh_close(fh);
251 static void _fh_file_init( FH f ) {
255 static int _fh_file_close( FH f ) {
261 static int _fh_file_read( FH f, void* buf, int len ) {
274 static int _fh_file_write( FH f, const void* buf, int len ) {
287 static int _fh_file_lseek( FH f, int pos, int origin ) {
322 FH f;
385 FH f;
430 FH f = _fh_from_int(fd, __func__);
442 FH f = _fh_from_int(fd, __func__);
454 FH f = _fh_from_int(fd, __func__);
466 FH f = _fh_from_int(fd, __func__);
533 FH fh = _fh_from_int(fds[i].fd, __func__);
534 if (!fh || !fh->used || fh->clazz != &_fh_socket_class) {
540 .fd = fh->u.socket,
575 static void _fh_socket_init(FH f) {
579 static int _fh_socket_close( FH f ) {
600 static int _fh_socket_lseek( FH f, int pos, int origin ) {
605 static int _fh_socket_read(FH f, void* buf, int len) {
621 static int _fh_socket_write(FH f, const void* buf, int len) {
912 FH f = _fh_alloc( &_fh_socket_class );
920 FH serverfh = _fh_from_int(serverfd, __func__);
928 unique_fh fh(_fh_alloc( &_fh_socket_class ));
929 if (!fh) {
935 fh->fh_socket = accept( serverfh->fh_socket, addr, addrlen );
936 if (fh->fh_socket == INVALID_SOCKET) {
944 const int fd = _fh_to_int(fh.get());
945 snprintf( fh->name, sizeof(fh->name), "%d(accept:%s)", fd, serverfh->name );
947 fh.release();
954 FH fh = _fh_from_int(fd, __func__);
956 if ( !fh || fh->clazz != &_fh_socket_class ) {
966 int result = setsockopt( fh->fh_socket, level, optname,
979 FH fh = _fh_from_int(fd, __func__);
981 if (!fh || fh->clazz != &_fh_socket_class) {
987 int result = getsockname(fh->fh_socket, sockaddr, optlen);
1018 FH f = _fh_from_int(fd, __func__);
1088 FH fh = _fh_from_int(fd, __func__);
1090 if (!fh || !fh->used) {
1096 if (fh->clazz == &_fh_socket_class) {
1098 if (ioctlsocket(fh->u.socket, FIONBIO, &x) != 0) {
1113 FH fh = _fh_from_int(fd, __func__);
1115 if (!fh || fh->clazz != &_fh_socket_class) {
1127 if (WSAIoctl(fh->fh_socket, SIO_KEEPALIVE_VALS, &keepalive, sizeof(keepalive), nullptr, 0,