Home | History | Annotate | Download | only in adb

Lines Matching refs:fh

75 typedef struct FHRec_*          FH;
81 void (*_fh_init) ( FH f );
82 int (*_fh_close)( FH f );
83 int (*_fh_lseek)( FH f, int pos, int origin );
84 int (*_fh_read) ( FH f, void* buf, int len );
85 int (*_fh_write)( FH f, const void* buf, int len );
86 void (*_fh_hook) ( FH f, int events, EventHook hook );
123 static FH
126 FH f;
149 _fh_to_int( FH f )
157 static FH
161 FH f = NULL;
190 _fh_close( FH f )
214 _fh_file_init( FH f )
220 _fh_file_close( FH f )
228 _fh_file_read( FH f, void* buf, int len )
243 _fh_file_write( FH f, const void* buf, int len )
258 _fh_file_lseek( FH f, int pos, int origin )
283 static void _fh_file_hook( FH f, int event, EventHook eventhook ); /* forward */
305 FH f;
364 FH f;
404 FH f = _fh_from_int(fd);
416 FH f = _fh_from_int(fd);
428 FH f = _fh_from_int(fd);
440 FH f = _fh_from_int(fd);
454 FH f = _fh_from_int(fd);
487 _fh_socket_init( FH f )
495 _fh_socket_close( FH f )
507 _fh_socket_lseek( FH f, int pos, int origin )
514 _fh_socket_read( FH f, void* buf, int len )
525 _fh_socket_write( FH f, const void* buf, int len )
535 static void _fh_socket_hook( FH f, int event, EventHook hook ); /* forward */
581 FH f = _fh_alloc( &_fh_socket_class );
618 FH f = _fh_alloc( &_fh_socket_class );
664 FH f = _fh_alloc( &_fh_socket_class );
706 FH f = _fh_alloc( &_fh_socket_class );
754 FH serverfh = _fh_from_int(serverfd);
755 FH fh;
762 fh = _fh_alloc( &_fh_socket_class );
763 if (!fh) {
768 fh->fh_socket = accept( serverfh->fh_socket, addr, addrlen );
769 if (fh->fh_socket == INVALID_SOCKET) {
770 _fh_close( fh );
775 snprintf( fh->name, sizeof(fh->name), "%d(accept:%s)", _fh_to_int(fh), serverfh->name );
776 D( "adb_socket_accept on fd %d returns fd %d\n", serverfd, _fh_to_int(fh) );
777 return _fh_to_int(fh);
783 FH fh = _fh_from_int(fd);
786 if ( !fh || fh->clazz != &_fh_socket_class )
789 setsockopt( fh->fh_socket, IPPROTO_TCP, TCP_NODELAY, (const char*)&on, sizeof(on) );
1101 FH a_fd;
1106 void _fh_socketpair_init( FH f )
1112 _fh_socketpair_close( FH f )
1135 _fh_socketpair_lseek( FH f, int pos, int origin )
1142 _fh_socketpair_read( FH f, void* buf, int len )
1159 _fh_socketpair_write( FH f, const void* buf, int len )
1176 static void _fh_socketpair_hook( FH f, int event, EventHook hook ); /* forward */
1191 FH fa, fb;
1283 FH fh;
1298 event_hook_alloc( FH fh )
1309 hook->fh = fh;
1327 hook->fh = NULL;
1338 FH f = hook->fh;
1363 event_looper_find_p( EventLooper looper, FH fh )
1368 if ( node == NULL || node->fh == fh )
1379 FH f = _fh_from_int(fd);
1411 FH fh = _fh_from_int(fd);
1412 EventHook *pnode = event_looper_find_p( looper, fh );
1722 D( "adb_win32: signaling %s for %x\n", hook->fh->name, hook->ready );
1952 static void _fh_file_hook( FH f, int events, EventHook hook )
1987 if (!WSAEnumNetworkEvents( hook->fh->fh_socket, NULL, &evts ))
2009 FH fh = hook->fh;
2012 hook->h = fh->event;
2014 D( "_event_socket_start: no event for %s\n", fh->name );
2018 if ( flags != fh->mask ) {
2019 D( "_event_socket_start: hooking %s for %x (flags %ld)\n", hook->fh->name, hook->wanted, flags );
2020 if ( WSAEventSelect( fh->fh_socket, hook->h, flags ) ) {
2021 D( "_event_socket_start: WSAEventSelect() for %s failed, error %d\n", hook->fh->name, WSAGetLastError() );
2027 fh->mask = flags;
2040 FH fh = hook->fh;
2043 if (!WSAEnumNetworkEvents( fh->fh_socket, hook->h, &evts ) ) {
2050 D( "_event_socket_check %s returns %d\n", fh->name, result );
2057 FH fh = hook->fh;
2060 if (!WSAEnumNetworkEvents( fh->fh_socket, NULL, &evts )) {
2071 static void _fh_socket_hook( FH f, int events, EventHook hook )
2087 FH fh = hook->fh;
2088 SocketPair pair = fh->fh_pair;
2089 BipBuffer rbip = (pair->a_fd == fh) ? &pair->b2a_bip : &pair->a2b_bip;
2090 BipBuffer wbip = (pair->a_fd == fh) ? &pair->a2b_bip : &pair->b2a_bip;
2101 FH fh = hook->fh;
2102 SocketPair pair = fh->fh_pair;
2103 BipBuffer rbip = (pair->a_fd == fh) ? &pair->b2a_bip : &pair->a2b_bip;
2104 BipBuffer wbip = (pair->a_fd == fh) ? &pair->a2b_bip : &pair->b2a_bip;
2117 hook->fh->name, _fh_to_int(fh), hook->wanted);
2127 static void _fh_socketpair_hook( FH fh, int events, EventHook hook )