]> git.proxmox.com Git - libgit2.git/blob - src/netops.h
Merge pull request #392 from sschuberth/development
[libgit2.git] / src / netops.h
1 /*
2 * Copyright (C) 2009-2011 the libgit2 contributors
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7 #ifndef INCLUDE_netops_h__
8 #define INCLUDE_netops_h__
9
10 #ifndef GIT_WIN32
11 typedef int GIT_SOCKET;
12 #else
13 typedef unsigned int GIT_SOCKET;
14 #endif
15
16 typedef struct gitno_buffer {
17 char *data;
18 size_t len;
19 size_t offset;
20 GIT_SOCKET fd;
21 } gitno_buffer;
22
23 void gitno_buffer_setup(gitno_buffer *buf, char *data, unsigned int len, int fd);
24 int gitno_recv(gitno_buffer *buf);
25 void gitno_consume(gitno_buffer *buf, const char *ptr);
26 void gitno_consume_n(gitno_buffer *buf, size_t cons);
27
28 int gitno_connect(const char *host, const char *port);
29 int gitno_send(int s, const char *msg, size_t len, int flags);
30 int gitno_select_in(gitno_buffer *buf, long int sec, long int usec);
31
32 #endif