]>
Commit | Line | Data |
---|---|---|
1b4f8140 CMN |
1 | /* |
2 | * netops.h - convencience functions for networking | |
3 | */ | |
4 | #ifndef INCLUDE_netops_h__ | |
5 | #define INCLUDE_netops_h__ | |
6 | ||
74bd343a CMN |
7 | #ifndef _WIN32 |
8 | typedef int GIT_SOCKET; | |
9 | #else | |
10 | typedef unsigned int GIT_SOCKET; | |
11 | #endif | |
12 | ||
ea7a5452 | 13 | typedef struct gitno_buffer { |
c7c787ce | 14 | char *data; |
ea7a5452 CMN |
15 | unsigned int len; |
16 | unsigned int offset; | |
74bd343a | 17 | GIT_SOCKET fd; |
ea7a5452 CMN |
18 | } gitno_buffer; |
19 | ||
c7c787ce | 20 | void gitno_buffer_setup(gitno_buffer *buf, char *data, unsigned int len, int fd); |
ea7a5452 | 21 | int gitno_recv(gitno_buffer *buf); |
c7c787ce | 22 | void gitno_consume(gitno_buffer *buf, const char *ptr); |
ea7a5452 CMN |
23 | void gitno_consume_n(gitno_buffer *buf, unsigned int cons); |
24 | ||
1b4f8140 | 25 | int gitno_connect(const char *host, const char *port); |
4e95ef02 | 26 | int gitno_send(int s, const char *msg, int len, int flags); |
74bd343a | 27 | int gitno_select_in(gitno_buffer *buf, long int sec, long int usec); |
1b4f8140 CMN |
28 | |
29 | #endif |